addBlockFloatingLabel.ts 633 B

1234567891011121314151617
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import type { Classes } from '#shared/form/plugins/utils.ts'
  3. import { clean, extendClasses } from '#shared/form/plugins/utils.ts'
  4. import { addStaticFloatingLabel } from './addStaticFloatingLabel.ts'
  5. export const addBlockFloatingLabel = (classes: Classes = {}): Classes => {
  6. return addStaticFloatingLabel(
  7. extendClasses(classes, {
  8. outer: 'floating-input',
  9. label: clean(
  10. `formkit-populated:-translate-y-[0.4rem] formkit-populated:scale-80 formkit-populated:opacity-75 formkit-populated:text-xs text-base`,
  11. ),
  12. }),
  13. )
  14. }