addBlockFloatingLabel.ts 664 B

123456789101112131415161718192021
  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]
  11. formkit-populated:scale-80
  12. formkit-populated:opacity-75
  13. formkit-populated:text-xs
  14. text-base
  15. `),
  16. }),
  17. )
  18. }