@webx-ui/core 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Pagination/Pagination.d.ts +45 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/Pagination/types.d.ts +29 -0
- package/dist/components/Table/Table.d.ts +34 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Table/types.d.ts +142 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/index.js +1849 -1193
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/components/Button/Button.vue","../src/components/Card/Card.vue","../src/composables/useFormField.ts","../src/components/Checkbox/Checkbox.vue","../src/components/CheckboxGroup/CheckboxGroup.vue","../src/components/ColorPicker/ColorPicker.vue","../src/components/DatePicker/DatePicker.vue","../src/components/DateRangePicker/DateRangePicker.vue","../src/components/DateTimePicker/DateTimePicker.vue","../src/components/Form/Form.vue","../src/components/FormItem/FormItem.vue","../src/components/Input/Input.vue","../src/components/InputNumber/InputNumber.vue","../src/components/Radio/Radio.vue","../src/components/RadioGroup/RadioGroup.vue","../src/components/Rate/Rate.vue","../src/components/RichText/icons.ts","../src/components/RichText/ToolbarButton.vue","../src/components/RichText/tools.ts","../src/components/RichText/RichText.vue","../src/components/Select/Select.vue","../src/components/Slider/Slider.vue","../src/components/Switch/Switch.vue","../src/components/TagsInput/TagsInput.vue","../src/components/Textarea/Textarea.vue","../src/components/TimePicker/TimePicker.vue","../src/plugin.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport type { ButtonEmits, ButtonProps } from './types'\n\ndefineOptions({ name: 'WxButton', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n type: 'default',\n variant: 'solid',\n size: 'md',\n disabled: false,\n loading: false,\n block: false,\n round: false,\n href: undefined,\n target: undefined,\n nativeType: 'button',\n})\n\nconst emit = defineEmits<ButtonEmits>()\n\nconst isDisabled = computed(() => props.disabled || props.loading)\nconst tag = computed(() => (props.href ? 'a' : 'button'))\n\nconst classes = computed(() => [\n 'wx-button',\n `wx-button--${props.type}`,\n `wx-button--${props.variant}`,\n `wx-button--${props.size}`,\n {\n 'wx-button--block': props.block,\n 'wx-button--round': props.round,\n 'wx-button--loading': props.loading,\n 'is-disabled': isDisabled.value,\n },\n])\n\nconst nativeAttrs = computed(() =>\n props.href\n ? {\n href: isDisabled.value ? undefined : props.href,\n target: props.target,\n role: 'button',\n 'aria-disabled': isDisabled.value ? 'true' : undefined,\n tabindex: isDisabled.value ? -1 : undefined,\n }\n : {\n type: props.nativeType,\n disabled: isDisabled.value,\n },\n)\n\nfunction onClick(event: MouseEvent) {\n if (isDisabled.value) {\n event.preventDefault()\n event.stopPropagation()\n return\n }\n emit('click', event)\n}\n</script>\n\n<template>\n <component\n :is=\"tag\"\n v-bind=\"{ ...nativeAttrs, ...$attrs }\"\n :class=\"classes\"\n :aria-busy=\"loading || undefined\"\n @click=\"onClick\"\n >\n <span v-if=\"loading\" class=\"wx-button__spinner\" aria-hidden=\"true\" />\n <span v-else-if=\"$slots.icon\" class=\"wx-button__icon\">\n <slot name=\"icon\" />\n </span>\n <span v-if=\"$slots.default\" class=\"wx-button__label\">\n <slot />\n </span>\n </component>\n</template>\n\n<style scoped>\n.wx-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--wx-space-8);\n box-sizing: border-box;\n border: 1px solid transparent;\n border-radius: var(--wx-radius-control);\n font-family: inherit;\n font-weight: var(--wx-font-weight-semibold);\n line-height: var(--wx-font-line-height-tight);\n text-decoration: none;\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n transition:\n background-color var(--wx-duration-normal) var(--wx-easing-standard),\n border-color var(--wx-duration-normal) var(--wx-easing-standard),\n color var(--wx-duration-normal) var(--wx-easing-standard),\n box-shadow var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-button:focus-visible {\n outline: none;\n box-shadow: var(--wx-ring-focus);\n}\n\n/* sizes */\n.wx-button--sm {\n height: var(--wx-size-control-sm);\n padding: 0 var(--wx-space-12);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-button--md {\n height: var(--wx-size-control-md);\n padding: 0 var(--wx-space-18);\n font-size: var(--wx-font-size-md);\n}\n\n.wx-button--lg {\n height: var(--wx-size-control-lg);\n padding: 0 var(--wx-space-24);\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-button--block {\n display: flex;\n width: 100%;\n}\n\n.wx-button--round {\n border-radius: var(--wx-radius-full);\n}\n\n/*\n * Each type exposes its own palette through local variables, so the variant rules\n * below stay type-agnostic.\n */\n.wx-button--default {\n --wx-button-bg: var(--wx-bg-surface);\n --wx-button-bg-hover: var(--wx-bg-fill);\n --wx-button-bg-active: var(--wx-bg-fill-hover);\n --wx-button-bg-disabled: var(--wx-bg-surface);\n --wx-button-fg: var(--wx-text-default);\n --wx-button-border: var(--wx-border-default);\n}\n\n.wx-button--primary {\n --wx-button-bg: var(--wx-color-primary);\n --wx-button-bg-hover: var(--wx-color-primary-hover);\n --wx-button-bg-active: var(--wx-color-primary-active);\n --wx-button-bg-disabled: var(--wx-color-primary-disabled);\n --wx-button-fg: var(--wx-color-primary-contrast);\n --wx-button-border: var(--wx-color-primary);\n --wx-button-accent: var(--wx-color-primary);\n --wx-button-soft: var(--wx-color-primary-soft);\n}\n\n.wx-button--success {\n --wx-button-bg: var(--wx-color-success);\n --wx-button-bg-hover: var(--wx-color-success-hover);\n --wx-button-bg-active: var(--wx-color-success-active);\n --wx-button-bg-disabled: var(--wx-color-success-disabled);\n --wx-button-fg: var(--wx-color-success-contrast);\n --wx-button-border: var(--wx-color-success);\n --wx-button-accent: var(--wx-color-success);\n --wx-button-soft: var(--wx-color-success-soft);\n}\n\n.wx-button--warning {\n --wx-button-bg: var(--wx-color-warning);\n --wx-button-bg-hover: var(--wx-color-warning-hover);\n --wx-button-bg-active: var(--wx-color-warning-active);\n --wx-button-bg-disabled: var(--wx-color-warning-disabled);\n --wx-button-fg: var(--wx-color-warning-contrast);\n --wx-button-border: var(--wx-color-warning);\n --wx-button-accent: var(--wx-color-warning);\n --wx-button-soft: var(--wx-color-warning-soft);\n}\n\n.wx-button--danger {\n --wx-button-bg: var(--wx-color-danger);\n --wx-button-bg-hover: var(--wx-color-danger-hover);\n --wx-button-bg-active: var(--wx-color-danger-active);\n --wx-button-bg-disabled: var(--wx-color-danger-disabled);\n --wx-button-fg: var(--wx-color-danger-contrast);\n --wx-button-border: var(--wx-color-danger);\n --wx-button-accent: var(--wx-color-danger);\n --wx-button-soft: var(--wx-color-danger-soft);\n}\n\n/* solid */\n.wx-button--solid {\n background: var(--wx-button-bg);\n border-color: var(--wx-button-border);\n color: var(--wx-button-fg);\n}\n\n.wx-button--solid:hover:not(.is-disabled) {\n background: var(--wx-button-bg-hover);\n border-color: var(--wx-button-bg-hover);\n}\n\n.wx-button--solid:active:not(.is-disabled) {\n background: var(--wx-button-bg-active);\n border-color: var(--wx-button-bg-active);\n}\n\n.wx-button--solid.is-disabled {\n background: var(--wx-button-bg-disabled);\n border-color: var(--wx-button-bg-disabled);\n}\n\n.wx-button--solid.wx-button--default.is-disabled {\n border-color: var(--wx-border-default);\n color: var(--wx-text-disabled);\n}\n\n/* outline */\n.wx-button--outline {\n background: transparent;\n border-color: var(--wx-button-accent, var(--wx-border-default));\n color: var(--wx-button-accent, var(--wx-text-default));\n}\n\n.wx-button--outline:hover:not(.is-disabled) {\n background: var(--wx-button-soft, var(--wx-bg-fill));\n}\n\n.wx-button--outline:active:not(.is-disabled) {\n border-color: var(--wx-button-bg-active);\n color: var(--wx-button-bg-active);\n}\n\n.wx-button--outline.is-disabled {\n border-color: var(--wx-button-bg-disabled);\n color: var(--wx-button-bg-disabled);\n}\n\n/* text */\n.wx-button--text {\n background: transparent;\n border-color: transparent;\n color: var(--wx-button-accent, var(--wx-text-default));\n}\n\n.wx-button--text:hover:not(.is-disabled) {\n background: var(--wx-bg-fill);\n}\n\n.wx-button--text:active:not(.is-disabled) {\n background: var(--wx-bg-fill-hover);\n}\n\n.wx-button--text.is-disabled {\n color: var(--wx-text-disabled);\n}\n\n/* states */\n.wx-button.is-disabled {\n cursor: not-allowed;\n}\n\n.wx-button--loading {\n cursor: progress;\n}\n\n.wx-button__spinner {\n width: 1em;\n height: 1em;\n border: 2px solid currentcolor;\n border-right-color: transparent;\n border-radius: var(--wx-radius-full);\n animation: wx-button-spin var(--wx-duration-slow) linear infinite;\n}\n\n.wx-button__icon {\n display: inline-flex;\n align-items: center;\n}\n\n@keyframes wx-button-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wx-button {\n transition: none;\n }\n\n .wx-button__spinner {\n animation-duration: 2s;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue'\nimport type { CardProps } from './types'\n\ndefineOptions({ name: 'WxCard' })\n\nconst props = withDefaults(defineProps<CardProps>(), {\n title: undefined,\n shadow: 'always',\n padding: 'md',\n bordered: false,\n})\n\nconst slots = useSlots()\n\nconst hasHeader = computed(() => Boolean(props.title || slots.header || slots.extra))\nconst hasSidebar = computed(() => Boolean(slots.sidebar))\n\nconst classes = computed(() => [\n 'wx-card',\n `wx-card--shadow-${props.shadow}`,\n `wx-card--padding-${props.padding}`,\n {\n 'wx-card--bordered': props.bordered,\n 'wx-card--with-sidebar': hasSidebar.value,\n },\n])\n</script>\n\n<template>\n <section :class=\"classes\">\n <header v-if=\"hasHeader\" class=\"wx-card__header\">\n <div class=\"wx-card__title\">\n <slot name=\"header\">{{ title }}</slot>\n </div>\n <div v-if=\"$slots.extra\" class=\"wx-card__extra\">\n <slot name=\"extra\" />\n </div>\n </header>\n\n <div class=\"wx-card__body\">\n <div v-if=\"hasSidebar\" class=\"wx-card__layout\">\n <aside class=\"wx-card__sidebar\">\n <slot name=\"sidebar\" />\n </aside>\n <div class=\"wx-card__content\">\n <slot />\n </div>\n </div>\n <slot v-else />\n </div>\n\n <footer v-if=\"$slots.footer\" class=\"wx-card__footer\">\n <slot name=\"footer\" />\n </footer>\n </section>\n</template>\n\n<style scoped>\n.wx-card {\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n background: var(--wx-bg-surface);\n border: 1px solid transparent;\n border-radius: var(--wx-radius-md);\n color: var(--wx-text-default);\n transition: box-shadow var(--wx-duration-normal) var(--wx-easing-standard);\n /* The sidebar layout reacts to the card's own width, not the viewport's. */\n container-type: inline-size;\n}\n\n.wx-card--bordered {\n border-color: var(--wx-border-default);\n}\n\n.wx-card--shadow-always {\n box-shadow: var(--wx-shadow-card);\n}\n\n.wx-card--shadow-hover:hover {\n box-shadow: var(--wx-shadow-card);\n}\n\n.wx-card__header,\n.wx-card__body,\n.wx-card__footer {\n padding: var(--wx-card-padding, var(--wx-space-16));\n}\n\n.wx-card--padding-none {\n --wx-card-padding: 0px;\n}\n\n.wx-card--padding-sm {\n --wx-card-padding: var(--wx-space-12);\n}\n\n.wx-card--padding-md {\n --wx-card-padding: var(--wx-space-16);\n}\n\n.wx-card--padding-lg {\n --wx-card-padding: var(--wx-space-24);\n}\n\n.wx-card__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--wx-space-16);\n padding-bottom: 0;\n}\n\n.wx-card__title {\n min-width: 0;\n color: var(--wx-text-strong);\n font-size: var(--wx-font-size-lg);\n font-weight: var(--wx-font-weight-semibold);\n line-height: var(--wx-font-line-height-tight);\n}\n\n.wx-card__extra {\n flex: 0 0 auto;\n color: var(--wx-text-muted);\n}\n\n.wx-card__body {\n flex: 1 1 auto;\n}\n\n.wx-card__footer {\n padding-top: 0;\n}\n\n/* Sidebar layout: stacked by default, two columns once the card is wide enough. */\n.wx-card__layout {\n display: flex;\n flex-direction: column;\n gap: var(--wx-card-padding, var(--wx-space-16));\n}\n\n.wx-card__sidebar,\n.wx-card__content {\n min-width: 0;\n}\n\n.wx-card__content {\n flex: 1 1 auto;\n}\n\n@container (min-width: 560px) {\n .wx-card__layout {\n flex-direction: row;\n }\n\n .wx-card__sidebar {\n flex: 0 0 auto;\n width: var(--wx-card-sidebar-width, 240px);\n }\n}\n</style>\n","import { computed, inject, provide, type ComputedRef, type InjectionKey, type Ref } from 'vue'\n\nexport type ControlSize = 'sm' | 'md' | 'lg'\nexport type ControlStatus = 'default' | 'success' | 'warning' | 'error'\n\n/** Field name -> messages, the shape Laravel returns on a 422. */\nexport type ValidationErrors = Record<string, string[]>\n\nexport interface FormContext {\n /** Server-side errors, keyed by field name. */\n errors: Ref<ValidationErrors>\n disabled: Ref<boolean>\n size: Ref<ControlSize>\n labelPosition: Ref<'top' | 'left'>\n labelWidth: Ref<string | undefined>\n}\n\nexport interface FormItemContext {\n /** Id given to the control, so the label's `for` matches. */\n id: ComputedRef<string>\n /** Ids of the help and error nodes, for `aria-describedby`. */\n describedBy: ComputedRef<string | undefined>\n status: ComputedRef<ControlStatus>\n disabled: ComputedRef<boolean>\n size: ComputedRef<ControlSize | undefined>\n /** Set by grouped controls so the label points at the group, not one input. */\n registerLabelTarget: (id: string | undefined) => void\n}\n\nexport const formContextKey: InjectionKey<FormContext> = Symbol('wx-form')\nexport const formItemContextKey: InjectionKey<FormItemContext> = Symbol('wx-form-item')\n\nlet uid = 0\nexport function useId(prefix = 'wx'): string {\n uid += 1\n return `${prefix}-${uid}`\n}\n\nexport interface FormFieldProps {\n disabled?: boolean\n size?: ControlSize\n status?: ControlStatus\n id?: string\n}\n\n/**\n * Resolves what a control should render as, given its own props, the enclosing\n * `WxFormItem` and the enclosing `WxForm`. The control's own prop always wins;\n * `WxFormItem` beats `WxForm`.\n */\nexport function useFormField(props: FormFieldProps) {\n const form = inject(formContextKey, null)\n const item = inject(formItemContextKey, null)\n const fallbackId = useId('wx-control')\n\n const id = computed(() => props.id ?? item?.id.value ?? fallbackId)\n\n const disabled = computed(\n () => props.disabled || item?.disabled.value || form?.disabled.value || false,\n )\n\n const size = computed<ControlSize>(\n () => props.size ?? item?.size.value ?? form?.size.value ?? 'md',\n )\n\n const status = computed<ControlStatus>(() => {\n if (props.status && props.status !== 'default') return props.status\n return item?.status.value ?? 'default'\n })\n\n const describedBy = computed(() => item?.describedBy.value)\n\n return { id, disabled, size, status, describedBy, form, item }\n}\n\n/**\n * What a checkbox, radio or switch may carry. Deliberately narrower than `unknown`:\n * a `v-model` that hands back `unknown` is useless to the caller, and object values\n * would need identity comparison rather than `===`.\n */\nexport type ChoiceValue = string | number | boolean | null\n\n/** Used by `WxCheckboxGroup` / `WxRadioGroup` to share state with their children. */\nexport interface ChoiceGroupContext<T> {\n name: ComputedRef<string | undefined>\n modelValue: Ref<T>\n disabled: ComputedRef<boolean>\n size: ComputedRef<ControlSize>\n toggle: (value: ChoiceValue, checked: boolean) => void\n}\n\nexport const checkboxGroupKey: InjectionKey<ChoiceGroupContext<ChoiceValue[]>> =\n Symbol('wx-checkbox-group')\nexport const radioGroupKey: InjectionKey<ChoiceGroupContext<ChoiceValue | undefined>> =\n Symbol('wx-radio-group')\n\nexport function provideFormItem(context: FormItemContext): void {\n provide(formItemContextKey, context)\n}\n","<script setup lang=\"ts\">\nimport { computed, inject, onMounted, ref, watch } from 'vue'\nimport { checkboxGroupKey, useFormField } from '../../composables/useFormField'\nimport type { CheckboxEmits, CheckboxProps } from './types'\n\ndefineOptions({ name: 'WxCheckbox', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<CheckboxProps>(), {\n value: undefined,\n label: undefined,\n indeterminate: false,\n disabled: undefined,\n size: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<CheckboxEmits>()\n\nconst model = defineModel<boolean>({ default: false })\n\nconst group = inject(checkboxGroupKey, null)\nconst field = useFormField(props)\nconst inputRef = ref<HTMLInputElement | null>(null)\n\nconst checked = computed(() =>\n group ? group.modelValue.value.includes(props.value ?? null) : model.value === true,\n)\n\nconst disabled = computed(() => props.disabled || group?.disabled.value || field.disabled.value)\nconst size = computed(() => props.size ?? group?.size.value ?? field.size.value)\n\nconst classes = computed(() => [\n 'wx-checkbox',\n `wx-checkbox--${size.value}`,\n {\n 'is-checked': checked.value,\n 'is-indeterminate': props.indeterminate && !checked.value,\n 'is-disabled': disabled.value,\n },\n])\n\n/** `indeterminate` only exists as a DOM property, never as an attribute. */\nfunction syncIndeterminate() {\n if (inputRef.value) inputRef.value.indeterminate = props.indeterminate && !checked.value\n}\n\nonMounted(syncIndeterminate)\nwatch([() => props.indeterminate, checked], syncIndeterminate)\n\nfunction onChange(event: Event) {\n const next = (event.target as HTMLInputElement).checked\n if (group) group.toggle(props.value ?? null, next)\n else model.value = next\n emit('change', next)\n}\n</script>\n\n<template>\n <label :class=\"classes\">\n <input\n :id=\"field.id.value\"\n ref=\"inputRef\"\n v-bind=\"$attrs\"\n class=\"wx-checkbox__native\"\n type=\"checkbox\"\n :name=\"name ?? group?.name.value\"\n :checked=\"checked\"\n :disabled=\"disabled\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n @change=\"onChange\"\n />\n\n <span class=\"wx-checkbox__box\" aria-hidden=\"true\">\n <svg class=\"wx-checkbox__mark\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n v-if=\"indeterminate && !checked\"\n d=\"M4 8h8\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n <path\n v-else\n d=\"M3.5 8.5l3 3 6-6\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </span>\n\n <span v-if=\"label || $slots.default\" class=\"wx-checkbox__label\">\n <slot>{{ label }}</slot>\n </span>\n </label>\n</template>\n\n<style scoped>\n.wx-checkbox {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-8);\n cursor: pointer;\n user-select: none;\n color: var(--wx-text-default);\n}\n\n.wx-checkbox.is-disabled {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-checkbox__native {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n}\n\n.wx-checkbox__box {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n box-sizing: border-box;\n width: var(--wx-checkbox-size, 20px);\n height: var(--wx-checkbox-size, 20px);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-strong);\n border-radius: var(--wx-radius-xs);\n color: transparent;\n transition:\n background-color var(--wx-duration-fast) var(--wx-easing-standard),\n border-color var(--wx-duration-fast) var(--wx-easing-standard),\n color var(--wx-duration-fast) var(--wx-easing-standard),\n box-shadow var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-checkbox--sm {\n --wx-checkbox-size: 16px;\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-checkbox--md {\n --wx-checkbox-size: 20px;\n font-size: var(--wx-font-size-md);\n}\n\n.wx-checkbox--lg {\n --wx-checkbox-size: 24px;\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-checkbox:hover:not(.is-disabled) .wx-checkbox__box {\n border-color: var(--wx-color-primary);\n}\n\n.wx-checkbox.is-checked .wx-checkbox__box,\n.wx-checkbox.is-indeterminate .wx-checkbox__box {\n border-color: var(--wx-color-primary);\n color: var(--wx-color-primary);\n}\n\n.wx-checkbox.is-disabled .wx-checkbox__box {\n background: var(--wx-bg-disabled);\n border-color: var(--wx-border-default);\n}\n\n.wx-checkbox.is-disabled.is-checked .wx-checkbox__box,\n.wx-checkbox.is-disabled.is-indeterminate .wx-checkbox__box {\n color: var(--wx-color-primary-disabled);\n border-color: var(--wx-color-primary-disabled);\n}\n\n.wx-checkbox__native:focus-visible + .wx-checkbox__box {\n border-color: var(--wx-color-primary);\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-checkbox__mark {\n width: 100%;\n height: 100%;\n}\n\n.wx-checkbox__label {\n line-height: var(--wx-font-line-height-normal);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wx-checkbox__box {\n transition: none;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, provide } from 'vue'\nimport { checkboxGroupKey, useFormField, type ChoiceValue } from '../../composables/useFormField'\nimport WxCheckbox from '../Checkbox/Checkbox.vue'\nimport type { CheckboxGroupEmits, CheckboxGroupProps } from './types'\n\ndefineOptions({ name: 'WxCheckboxGroup' })\n\nconst props = withDefaults(defineProps<CheckboxGroupProps>(), {\n options: undefined,\n disabled: undefined,\n size: undefined,\n name: undefined,\n inline: false,\n min: undefined,\n max: undefined,\n})\n\nconst emit = defineEmits<CheckboxGroupEmits>()\n\nconst model = defineModel<ChoiceValue[]>({ default: () => [] })\n\nconst field = useFormField(props)\n\n/** A group cannot be the target of a `for`, so the item label becomes a span. */\nfield.item?.registerLabelTarget(undefined)\n\nconst disabled = computed(() => props.disabled ?? field.disabled.value)\nconst size = computed(() => props.size ?? field.size.value)\n\nfunction toggle(value: ChoiceValue, checked: boolean) {\n const current = model.value ?? []\n if (checked) {\n if (current.includes(value)) return\n if (props.max !== undefined && current.length >= props.max) return\n model.value = [...current, value]\n } else {\n if (props.min !== undefined && current.length <= props.min) return\n model.value = current.filter((item) => item !== value)\n }\n emit('change', model.value)\n}\n\nprovide(checkboxGroupKey, {\n name: computed(() => props.name),\n modelValue: computed(() => model.value ?? []),\n disabled,\n size,\n toggle,\n})\n</script>\n\n<template>\n <div\n :class=\"['wx-checkbox-group', { 'wx-checkbox-group--inline': inline }]\"\n role=\"group\"\n :aria-labelledby=\"field.item ? `${field.item.id.value}-label` : undefined\"\n :aria-describedby=\"field.describedBy.value\"\n >\n <slot>\n <wx-checkbox\n v-for=\"option in options\"\n :key=\"String(option.value)\"\n :value=\"option.value\"\n :label=\"option.label\"\n :disabled=\"option.disabled\"\n />\n </slot>\n </div>\n</template>\n\n<style scoped>\n.wx-checkbox-group {\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-8);\n}\n\n.wx-checkbox-group--inline {\n flex-direction: row;\n flex-wrap: wrap;\n gap: var(--wx-space-16);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue'\nimport {\n ColorAreaArea,\n ColorAreaRoot,\n ColorAreaThumb,\n ColorSliderRoot,\n ColorSliderThumb,\n ColorSliderTrack,\n PopoverAnchor,\n PopoverContent,\n PopoverPortal,\n PopoverRoot,\n colorToHex,\n convertToHsb,\n getAreaBackgroundStyle,\n getSliderBackgroundStyle,\n parseColor,\n} from 'reka-ui'\nimport type { Color } from 'reka-ui'\nimport { useFormField } from '../../composables/useFormField'\nimport type { ColorPickerEmits, ColorPickerProps } from './types'\n\ndefineOptions({ name: 'WxColorPicker', inheritAttrs: false })\n\nconst HEX = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i\n\nconst props = withDefaults(defineProps<ColorPickerProps>(), {\n presets: () => [],\n clearable: false,\n placeholder: '#000000',\n teleport: true,\n disabled: undefined,\n readonly: false,\n size: undefined,\n status: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<ColorPickerEmits>()\n\nconst model = defineModel<string | null>({ default: null })\n\nconst field = useFormField(props)\nconst open = ref(false)\n\n/** What the text box shows. Kept separate so a half-typed hex is not thrown away. */\nconst text = ref(model.value ?? '')\n\nwatch(model, (value) => {\n text.value = value ?? ''\n})\n\n/**\n * A hex parses into an RGB colour, and the picker works in HSB. Both the gradients and\n * the primitives take the space from the object unless told otherwise, so an unconverted\n * colour draws an RGB area — where the brightness gradient runs the other way and the\n * square looks upside down until the first drag replaces the object.\n */\nfunction toWorking(hex: string): Color {\n return convertToHsb(parseColor(hex))\n}\n\n/**\n * The picker works on a colour object, not on the hex string.\n *\n * A grey has no hue to speak of, so parsing #919191 back into channels invents one —\n * and re-deriving it on every pointer move is what made the hue strip jump from blue\n * to teal to red as the pointer travelled into the desaturated corner. Holding the\n * object keeps the hue the user chose even where the colour cannot express it.\n */\nconst working = ref<Color>(\n toWorking(model.value && HEX.test(model.value) ? model.value : '#427edd'),\n)\n\nwatch(model, (value) => {\n const hex = value && HEX.test(value) ? value : null\n if (!hex || hex === colorToHex(working.value).toLowerCase()) return\n working.value = toWorking(hex)\n})\n\n// The space is stated rather than read off the colour, so the gradients cannot drift\n// away from the channels the area and the slider are pinned to.\nconst areaStyle = computed(() =>\n getAreaBackgroundStyle(working.value, 'saturation', 'brightness', 'hsb'),\n)\nconst hueStyle = computed(() => getSliderBackgroundStyle(working.value, 'hue', 'hsb'))\n\nconst swatch = computed(() => (model.value && HEX.test(model.value) ? model.value : null))\n\nconst classes = computed(() => [\n 'wx-color-picker',\n `wx-color-picker--${field.size.value}`,\n {\n [`wx-color-picker--${field.status.value}`]: field.status.value !== 'default',\n 'is-open': open.value,\n 'is-disabled': field.disabled.value,\n },\n])\n\nfunction commit(value: string | null) {\n if (model.value === value) return\n model.value = value\n emit('change', value)\n}\n\n/** Typing is free-form; only a complete hex reaches the model. */\nfunction onInput(event: Event) {\n const value = (event.target as HTMLInputElement).value\n text.value = value\n if (HEX.test(value)) commit(value.toLowerCase())\n else if (value === '') commit(null)\n}\n\n/** On blur the box either shows a valid colour or goes back to the last one. */\nfunction onBlur() {\n if (text.value === '') {\n commit(null)\n return\n }\n const candidate = text.value.startsWith('#') ? text.value : `#${text.value}`\n if (HEX.test(candidate)) {\n commit(candidate.toLowerCase())\n text.value = candidate.toLowerCase()\n } else {\n text.value = model.value ?? ''\n }\n}\n\n/**\n * The two primitives do not agree on which event carries the new colour: the hue\n * slider reports through `change`, the saturation area through `update:modelValue`.\n * Both are bound on both, and only string payloads are taken — the slider can also\n * hand back a colour object. Committing twice is harmless: an unchanged value is\n * dropped.\n */\nfunction onColor(color: Color) {\n working.value = convertToHsb(color)\n commit(colorToHex(color).toLowerCase())\n}\n\n/** Presets and typing come in as hex and have to be parsed back into the picker. */\nfunction onHex(value: string) {\n const hex = value.toLowerCase()\n working.value = toWorking(hex)\n commit(hex)\n}\n\nfunction clear() {\n commit(null)\n text.value = ''\n}\n\nfunction openPicker() {\n if (!field.disabled.value && !props.readonly) open.value = true\n}\n</script>\n\n<template>\n <popover-root v-model:open=\"open\">\n <div :class=\"classes\">\n <popover-anchor as-child>\n <div class=\"wx-color-picker__field\" @click=\"openPicker\">\n <button\n class=\"wx-color-picker__swatch\"\n type=\"button\"\n :disabled=\"field.disabled.value\"\n :aria-label=\"ariaLabel ?? 'Pick a colour'\"\n :style=\"swatch ? { background: swatch } : undefined\"\n :class=\"{ 'is-empty': !swatch }\"\n />\n\n <input\n :id=\"field.id.value\"\n v-bind=\"$attrs\"\n class=\"wx-color-picker__input\"\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n :value=\"text\"\n :name=\"name\"\n :placeholder=\"placeholder\"\n :disabled=\"field.disabled.value\"\n :readonly=\"readonly\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n :aria-invalid=\"field.status.value === 'error' || undefined\"\n @input=\"onInput\"\n @blur=\"onBlur\"\n />\n\n <button\n v-if=\"clearable && swatch && !field.disabled.value\"\n class=\"wx-color-picker__clear\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Clear\"\n @click.stop=\"clear\"\n >\n ✕\n </button>\n </div>\n </popover-anchor>\n\n <popover-portal :disabled=\"!teleport\">\n <popover-content class=\"wx-color-picker__panel\" :side-offset=\"4\" align=\"start\">\n <!-- Channels are stated: the defaults are RGB, which would move the hue as\n the pointer travels and disagree with the gradient drawn underneath. -->\n <color-area-root\n class=\"wx-color-picker__area\"\n color-space=\"hsb\"\n x-channel=\"saturation\"\n y-channel=\"brightness\"\n :model-value=\"working\"\n @update:color=\"onColor\"\n >\n <color-area-area class=\"wx-color-picker__area-surface\" :style=\"areaStyle\">\n <color-area-thumb class=\"wx-color-picker__thumb\" />\n </color-area-area>\n </color-area-root>\n\n <color-slider-root\n class=\"wx-color-picker__hue\"\n color-space=\"hsb\"\n channel=\"hue\"\n :model-value=\"working\"\n @update:color=\"onColor\"\n >\n <color-slider-track class=\"wx-color-picker__hue-track\" :style=\"hueStyle\">\n <color-slider-thumb class=\"wx-color-picker__thumb\" />\n </color-slider-track>\n </color-slider-root>\n\n <div v-if=\"presets.length\" class=\"wx-color-picker__presets\">\n <button\n v-for=\"preset in presets\"\n :key=\"preset\"\n class=\"wx-color-picker__preset\"\n type=\"button\"\n :style=\"{ background: preset }\"\n :aria-label=\"preset\"\n :aria-pressed=\"model === preset\"\n @click=\"onHex(preset)\"\n />\n </div>\n </popover-content>\n </popover-portal>\n </div>\n </popover-root>\n</template>\n\n<style scoped>\n.wx-color-picker {\n display: block;\n width: 100%;\n}\n\n.wx-color-picker__field {\n display: flex;\n align-items: center;\n gap: var(--wx-space-8);\n box-sizing: border-box;\n height: var(--wx-size-control-md);\n padding: 0 var(--wx-space-8) 0 var(--wx-space-6);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-control);\n color: var(--wx-text-default);\n font-size: var(--wx-font-size-md);\n cursor: text;\n transition: border-color var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-color-picker--sm .wx-color-picker__field {\n height: var(--wx-size-control-sm);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-color-picker--lg .wx-color-picker__field {\n height: var(--wx-size-control-lg);\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-color-picker__field:hover {\n border-color: var(--wx-border-strong);\n}\n\n.wx-color-picker.is-open .wx-color-picker__field,\n.wx-color-picker__field:focus-within {\n border-color: var(--wx-border-focus);\n}\n\n.wx-color-picker--error .wx-color-picker__field {\n border-color: var(--wx-color-danger);\n}\n\n.wx-color-picker--success .wx-color-picker__field {\n border-color: var(--wx-color-success);\n}\n\n.wx-color-picker--warning .wx-color-picker__field {\n border-color: var(--wx-color-warning);\n}\n\n.wx-color-picker.is-disabled .wx-color-picker__field {\n background: var(--wx-bg-disabled);\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-color-picker__swatch {\n flex: 0 0 auto;\n width: 22px;\n height: 22px;\n padding: 0;\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-xs);\n cursor: pointer;\n}\n\n/* A chequerboard says \"no colour\" more clearly than an empty box. */\n.wx-color-picker__swatch.is-empty {\n background-image:\n linear-gradient(45deg, var(--wx-bg-fill) 25%, transparent 25%),\n linear-gradient(-45deg, var(--wx-bg-fill) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, var(--wx-bg-fill) 75%),\n linear-gradient(-45deg, transparent 75%, var(--wx-bg-fill) 75%);\n background-size: 8px 8px;\n background-position:\n 0 0,\n 0 4px,\n 4px -4px,\n -4px 0;\n}\n\n.wx-color-picker__input {\n flex: 1 1 auto;\n min-width: 0;\n height: 100%;\n padding: 0;\n background: transparent;\n border: none;\n outline: none;\n color: inherit;\n font-family: var(--wx-font-family-mono);\n font-size: inherit;\n text-transform: lowercase;\n}\n\n.wx-color-picker__input::placeholder {\n color: var(--wx-text-placeholder);\n text-transform: none;\n}\n\n.wx-color-picker__clear {\n flex: 0 0 auto;\n width: 18px;\n height: 18px;\n padding: 0;\n background: transparent;\n border: none;\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-xs);\n line-height: 1;\n cursor: pointer;\n}\n\n.wx-color-picker__clear:hover {\n color: var(--wx-text-default);\n}\n</style>\n\n<style>\n/* Teleported panel. */\n.wx-color-picker__panel {\n z-index: var(--wx-z-index-popover);\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-10);\n width: 232px;\n padding: var(--wx-space-10);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-sm);\n box-shadow: var(--wx-shadow-popover);\n}\n\n.wx-color-picker__area,\n.wx-color-picker__area-surface {\n position: relative;\n width: 100%;\n height: 140px;\n border-radius: var(--wx-radius-xs);\n}\n\n.wx-color-picker__hue {\n position: relative;\n height: 14px;\n}\n\n.wx-color-picker__hue-track {\n /* Reka renders the track as an inline element, where width and height do nothing. */\n display: block;\n position: relative;\n width: 100%;\n height: 100%;\n border-radius: var(--wx-radius-full);\n}\n\n.wx-color-picker__thumb {\n width: 14px;\n height: 14px;\n background: transparent;\n border: 2px solid #fff;\n border-radius: var(--wx-radius-full);\n box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35);\n}\n\n.wx-color-picker__thumb:focus-visible {\n outline: none;\n box-shadow:\n 0 0 0 1px rgb(0 0 0 / 0.35),\n var(--wx-ring-focus);\n}\n\n.wx-color-picker__presets {\n display: flex;\n flex-wrap: wrap;\n gap: var(--wx-space-4);\n}\n\n.wx-color-picker__preset {\n width: 20px;\n height: 20px;\n padding: 0;\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-xs);\n cursor: pointer;\n}\n\n.wx-color-picker__preset[aria-pressed='true'] {\n box-shadow: 0 0 0 2px var(--wx-color-primary);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueDatePicker } from '@vuepic/vue-datepicker'\nimport { useFormField } from '../../composables/useFormField'\nimport '../../styles/datepicker.css'\nimport type { DatePickerEmits, DatePickerModelValue, DatePickerProps } from './types'\n\ndefineOptions({ name: 'WxDatePicker', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<DatePickerProps>(), {\n type: 'date',\n valueFormat: undefined,\n format: undefined,\n placeholder: undefined,\n clearable: true,\n minDate: undefined,\n maxDate: undefined,\n seconds: false,\n minutesIncrement: 1,\n is24: true,\n weekStart: 1,\n autoApply: true,\n textInput: false,\n teleport: true,\n disabled: undefined,\n readonly: false,\n size: undefined,\n status: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<DatePickerEmits>()\n\nconst model = defineModel<DatePickerModelValue>({ default: null })\n\nconst field = useFormField(props)\n\nconst hasTime = computed(() => props.type !== 'date')\n\n/**\n * What the model holds. Defaults match the column types a Laravel migration\n * produces, so the value can go to the API untouched; `'date'` opts out and keeps\n * `Date` objects.\n */\nconst modelType = computed(() => {\n if (props.valueFormat === 'date') return undefined\n if (props.valueFormat) return props.valueFormat\n if (props.type === 'time') return props.seconds ? 'HH:mm:ss' : 'HH:mm'\n if (props.type === 'datetime') return props.seconds ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd HH:mm'\n return 'yyyy-MM-dd'\n})\n\n/** What the field shows. Day-first, because this kit is aimed at European admins. */\nconst displayFormat = computed(() => {\n if (props.format) return props.format\n const time = props.seconds ? 'HH:mm:ss' : 'HH:mm'\n if (props.type === 'time') return time\n if (props.type === 'datetime') return `dd.MM.yyyy ${time}`\n return 'dd.MM.yyyy'\n})\n\n/**\n * The overlay is sized to a calendar (`modeHeight`, 255 by default) so switching\n * between panes does not resize the menu. A time-only picker has no calendar to\n * match, and the default leaves ~150px of empty space around the columns.\n */\nconst config = computed(() => (props.type === 'time' ? { modeHeight: 125 } : undefined))\n\nconst timeConfig = computed(() => ({\n enableTimePicker: hasTime.value,\n enableSeconds: props.seconds,\n is24: props.is24,\n minutesIncrement: props.minutesIncrement,\n}))\n\nconst inputAttrs = computed(() => ({\n id: field.id.value,\n name: props.name,\n clearable: props.clearable,\n // The library reads `state: false` as invalid; leaving it undefined means neutral.\n state: field.status.value === 'error' ? false : undefined,\n 'aria-label': props.ariaLabel,\n 'aria-describedby': field.describedBy.value,\n}))\n\nconst classes = computed(() => [\n 'wx-datepicker',\n `wx-datepicker--${field.size.value}`,\n {\n [`wx-datepicker--${field.status.value}`]: field.status.value !== 'default',\n 'is-disabled': field.disabled.value,\n },\n])\n\nfunction onUpdate(value: DatePickerModelValue) {\n model.value = value\n emit('change', value)\n}\n\nfunction onCleared() {\n model.value = null\n emit('change', null)\n emit('clear')\n}\n</script>\n\n<template>\n <div :class=\"classes\">\n <vue-date-picker\n :model-value=\"model\"\n :model-type=\"modelType\"\n :formats=\"{ input: displayFormat }\"\n :time-picker=\"type === 'time'\"\n :time-config=\"timeConfig\"\n :config=\"config\"\n :input-attrs=\"inputAttrs\"\n :ui=\"{ input: 'wx-datepicker__input', menu: 'wx-datepicker__menu' }\"\n :placeholder=\"placeholder\"\n :min-date=\"minDate\"\n :max-date=\"maxDate\"\n :week-start=\"weekStart\"\n :auto-apply=\"autoApply\"\n :text-input=\"textInput\"\n :teleport=\"teleport\"\n :disabled=\"field.disabled.value\"\n :readonly=\"readonly\"\n v-bind=\"$attrs\"\n @update:model-value=\"onUpdate\"\n @cleared=\"onCleared\"\n @open=\"emit('open')\"\n @closed=\"emit('close')\"\n >\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps ?? {}\" />\n </template>\n </vue-date-picker>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueDatePicker } from '@vuepic/vue-datepicker'\nimport { useFormField } from '../../composables/useFormField'\nimport '../../styles/datepicker.css'\nimport type { DateRangePickerEmits, DateRangePickerModelValue, DateRangePickerProps } from './types'\n\ndefineOptions({ name: 'WxDateRangePicker', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<DateRangePickerProps>(), {\n valueFormat: undefined,\n format: undefined,\n placeholder: undefined,\n clearable: true,\n minDate: undefined,\n maxDate: undefined,\n months: 2,\n weekStart: 1,\n autoApply: true,\n textInput: false,\n teleport: true,\n disabled: undefined,\n readonly: false,\n size: undefined,\n status: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<DateRangePickerEmits>()\n\nconst model = defineModel<DateRangePickerModelValue>({ default: null })\n\nconst field = useFormField(props)\n\nconst modelType = computed(() =>\n props.valueFormat === 'date' ? undefined : (props.valueFormat ?? 'yyyy-MM-dd'),\n)\nconst displayFormat = computed(() => props.format ?? 'dd.MM.yyyy')\n\nconst inputAttrs = computed(() => ({\n id: field.id.value,\n name: props.name,\n clearable: props.clearable,\n state: field.status.value === 'error' ? false : undefined,\n 'aria-label': props.ariaLabel,\n 'aria-describedby': field.describedBy.value,\n}))\n\nconst classes = computed(() => [\n 'wx-datepicker',\n 'wx-datepicker--range',\n `wx-datepicker--${field.size.value}`,\n {\n [`wx-datepicker--${field.status.value}`]: field.status.value !== 'default',\n 'is-disabled': field.disabled.value,\n },\n])\n\n/** The library hands back `null` while only the first date has been picked. */\nfunction onUpdate(value: DateRangePickerModelValue) {\n model.value = value\n emit('change', value)\n}\n\nfunction onCleared() {\n model.value = null\n emit('change', null)\n emit('clear')\n}\n</script>\n\n<template>\n <div :class=\"classes\">\n <vue-date-picker\n range\n :model-value=\"model\"\n :model-type=\"modelType\"\n :formats=\"{ input: displayFormat }\"\n :multi-calendars=\"months\"\n :input-attrs=\"inputAttrs\"\n :ui=\"{ input: 'wx-datepicker__input', menu: 'wx-datepicker__menu' }\"\n :placeholder=\"placeholder\"\n :min-date=\"minDate\"\n :max-date=\"maxDate\"\n :week-start=\"weekStart\"\n :auto-apply=\"autoApply\"\n :text-input=\"textInput\"\n :teleport=\"teleport\"\n :disabled=\"field.disabled.value\"\n :readonly=\"readonly\"\n v-bind=\"$attrs\"\n @update:model-value=\"onUpdate\"\n @cleared=\"onCleared\"\n @open=\"emit('open')\"\n @closed=\"emit('close')\"\n >\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps ?? {}\" />\n </template>\n </vue-date-picker>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport WxDatePicker from '../DatePicker/DatePicker.vue'\nimport type { DatePickerModelValue, DatePickerProps } from '../DatePicker/types'\n\ndefineOptions({ name: 'WxDateTimePicker' })\n\n/**\n * Every prop defaults to `undefined` on purpose. Vue casts an absent boolean prop\n * to `false`, and this preset forwards its whole prop object — without these the\n * preset would hand `WxDatePicker` an explicit `false` for `is24`, `clearable`,\n * `autoApply` and `teleport`, overriding that component's own defaults. Passing\n * `undefined` lets each default apply as if the prop had never been written.\n */\nwithDefaults(defineProps<Omit<DatePickerProps, 'type'>>(), {\n valueFormat: undefined,\n format: undefined,\n placeholder: undefined,\n clearable: undefined,\n minDate: undefined,\n maxDate: undefined,\n seconds: undefined,\n minutesIncrement: undefined,\n is24: undefined,\n weekStart: undefined,\n autoApply: undefined,\n textInput: undefined,\n teleport: undefined,\n disabled: undefined,\n readonly: undefined,\n size: undefined,\n status: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst model = defineModel<DatePickerModelValue>({ default: null })\n</script>\n\n<template>\n <wx-date-picker v-model=\"model\" type=\"datetime\" v-bind=\"$props\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps ?? {}\" />\n </template>\n </wx-date-picker>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, provide, toRef } from 'vue'\nimport { formContextKey, type ValidationErrors } from '../../composables/useFormField'\nimport type { FormEmits, FormProps } from './types'\n\ndefineOptions({ name: 'WxForm' })\n\nconst props = withDefaults(defineProps<FormProps>(), {\n errors: undefined,\n disabled: false,\n size: 'md',\n labelPosition: 'top',\n labelWidth: undefined,\n gap: 'md',\n})\n\nconst emit = defineEmits<FormEmits>()\n\nconst errors = computed<ValidationErrors>(() => props.errors ?? {})\n\nprovide(formContextKey, {\n errors,\n disabled: toRef(props, 'disabled'),\n size: toRef(props, 'size'),\n labelPosition: toRef(props, 'labelPosition'),\n labelWidth: toRef(props, 'labelWidth'),\n})\n\n/** Native submit is always prevented: forms here talk to a data adapter, not a URL. */\nfunction onSubmit(event: SubmitEvent) {\n event.preventDefault()\n emit('submit', event)\n}\n\nfunction onReset(event: Event) {\n emit('reset', event)\n}\n</script>\n\n<template>\n <form\n :class=\"['wx-form', `wx-form--gap-${gap}`, `wx-form--label-${labelPosition}`]\"\n novalidate\n @submit=\"onSubmit\"\n @reset=\"onReset\"\n >\n <slot />\n </form>\n</template>\n\n<style scoped>\n.wx-form {\n display: flex;\n flex-direction: column;\n}\n\n.wx-form--gap-sm {\n gap: var(--wx-space-8);\n}\n\n.wx-form--gap-md {\n gap: var(--wx-space-16);\n}\n\n.wx-form--gap-lg {\n gap: var(--wx-space-24);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, inject, ref } from 'vue'\nimport {\n formContextKey,\n provideFormItem,\n useId,\n type ControlSize,\n type ControlStatus,\n} from '../../composables/useFormField'\nimport type { FormItemProps } from './types'\n\ndefineOptions({ name: 'WxFormItem' })\n\nconst props = withDefaults(defineProps<FormItemProps>(), {\n label: undefined,\n name: undefined,\n required: false,\n error: undefined,\n help: undefined,\n disabled: false,\n size: undefined,\n labelWidth: undefined,\n reserveErrorSpace: false,\n})\n\nconst form = inject(formContextKey, null)\n\nconst baseId = useId('wx-field')\nconst errorId = `${baseId}-error`\nconst helpId = `${baseId}-help`\n\n/**\n * Grouped controls (checkbox and radio groups) cannot be targeted by `for`,\n * so they register themselves and the label becomes a plain span instead.\n */\nconst labelMode = ref<'control' | 'group'>('control')\nconst controlId = ref<string>(baseId)\n\nfunction registerLabelTarget(id: string | undefined) {\n if (id === undefined) {\n labelMode.value = 'group'\n return\n }\n labelMode.value = 'control'\n controlId.value = id\n}\n\nconst messages = computed<string[]>(() => {\n if (props.error !== undefined) {\n return Array.isArray(props.error) ? props.error : [props.error]\n }\n if (props.name && form) return form.errors.value[props.name] ?? []\n return []\n})\n\nconst hasError = computed(() => messages.value.length > 0)\nconst status = computed<ControlStatus>(() => (hasError.value ? 'error' : 'default'))\n\n/**\n * Only ever names nodes that are actually rendered — the help text gives way to the\n * error, and a dangling `aria-describedby` is worse than none.\n */\nconst describedBy = computed(() => {\n if (hasError.value) return errorId\n return props.help ? helpId : undefined\n})\n\nconst size = computed<ControlSize | undefined>(() => props.size)\nconst disabled = computed(() => props.disabled)\n\nconst labelWidth = computed(() => props.labelWidth ?? form?.labelWidth.value)\nconst isInline = computed(() => form?.labelPosition.value === 'left')\n\nprovideFormItem({\n id: computed(() => baseId),\n describedBy,\n status,\n disabled,\n size,\n registerLabelTarget,\n})\n\ndefineExpose({ messages, hasError })\n</script>\n\n<template>\n <div\n :class=\"[\n 'wx-form-item',\n { 'wx-form-item--inline': isInline, 'is-error': hasError, 'is-required': required },\n ]\"\n :style=\"isInline && labelWidth ? { '--wx-form-item-label-width': labelWidth } : undefined\"\n >\n <component\n :is=\"labelMode === 'group' ? 'span' : 'label'\"\n v-if=\"label || $slots.label\"\n :id=\"`${baseId}-label`\"\n class=\"wx-form-item__label\"\n :for=\"labelMode === 'group' ? undefined : controlId\"\n >\n <slot name=\"label\">{{ label }}</slot>\n <span v-if=\"required\" class=\"wx-form-item__required\" aria-hidden=\"true\">*</span>\n </component>\n\n <div class=\"wx-form-item__control\">\n <slot />\n\n <p v-if=\"hasError\" :id=\"errorId\" class=\"wx-form-item__error\" role=\"alert\">\n {{ messages[0] }}\n </p>\n <p v-else-if=\"help\" :id=\"helpId\" class=\"wx-form-item__help\">{{ help }}</p>\n <p v-else-if=\"reserveErrorSpace\" class=\"wx-form-item__error\" aria-hidden=\"true\"> </p>\n </div>\n </div>\n</template>\n\n<style scoped>\n.wx-form-item {\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-6);\n min-width: 0;\n}\n\n.wx-form-item--inline {\n flex-direction: row;\n align-items: flex-start;\n gap: var(--wx-space-16);\n}\n\n.wx-form-item--inline .wx-form-item__label {\n flex: 0 0 auto;\n width: var(--wx-form-item-label-width, 160px);\n /* Line the label up with the first line of a control's text. */\n padding-top: calc((var(--wx-size-control-md) - 1lh) / 2);\n}\n\n.wx-form-item--inline .wx-form-item__control {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.wx-form-item__label {\n color: var(--wx-text-default);\n font-size: var(--wx-font-size-sm);\n font-weight: var(--wx-font-weight-medium);\n line-height: var(--wx-font-line-height-normal);\n}\n\n.wx-form-item__required {\n margin-left: var(--wx-space-2);\n color: var(--wx-color-danger);\n}\n\n.wx-form-item__control {\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-4);\n min-width: 0;\n}\n\n.wx-form-item__error,\n.wx-form-item__help {\n margin: 0;\n font-size: var(--wx-font-size-sm);\n line-height: var(--wx-font-line-height-normal);\n}\n\n.wx-form-item__error {\n color: var(--wx-color-danger);\n}\n\n.wx-form-item__help {\n color: var(--wx-text-muted);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref } from 'vue'\nimport { useFormField } from '../../composables/useFormField'\nimport type { InputEmits, InputModelValue, InputProps } from './types'\n\ndefineOptions({ name: 'WxInput', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<InputProps>(), {\n type: 'text',\n size: undefined,\n status: undefined,\n id: undefined,\n placeholder: undefined,\n disabled: undefined,\n readonly: false,\n clearable: false,\n maxlength: undefined,\n showCount: false,\n autocomplete: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<InputEmits>()\n\nconst model = defineModel<InputModelValue>({ default: '' })\n\nconst field = useFormField(props)\nconst inputRef = ref<HTMLInputElement | null>(null)\nconst focused = ref(false)\n\nconst currentValue = computed(() => (model.value == null ? '' : String(model.value)))\n\nconst showClear = computed(\n () =>\n props.clearable && !field.disabled.value && !props.readonly && currentValue.value.length > 0,\n)\n\nconst counter = computed(() =>\n props.showCount && props.maxlength ? `${currentValue.value.length}/${props.maxlength}` : null,\n)\n\nconst classes = computed(() => [\n 'wx-input',\n `wx-input--${field.size.value}`,\n {\n [`wx-input--${field.status.value}`]: field.status.value !== 'default',\n 'is-focused': focused.value,\n 'is-disabled': field.disabled.value,\n 'is-readonly': props.readonly,\n },\n])\n\nfunction onInput(event: Event) {\n const value = (event.target as HTMLInputElement).value\n model.value = value\n emit('input', value)\n}\n\nfunction onChange(event: Event) {\n emit('change', (event.target as HTMLInputElement).value)\n}\n\nfunction onFocus(event: FocusEvent) {\n focused.value = true\n emit('focus', event)\n}\n\nfunction onBlur(event: FocusEvent) {\n focused.value = false\n emit('blur', event)\n}\n\nfunction clear() {\n model.value = ''\n emit('input', '')\n emit('change', '')\n emit('clear')\n inputRef.value?.focus()\n}\n\ndefineExpose({\n focus: () => inputRef.value?.focus(),\n blur: () => inputRef.value?.blur(),\n select: () => inputRef.value?.select(),\n input: inputRef,\n})\n</script>\n\n<template>\n <div :class=\"classes\">\n <span v-if=\"$slots.prefix\" class=\"wx-input__affix wx-input__affix--prefix\">\n <slot name=\"prefix\" />\n </span>\n\n <input\n :id=\"field.id.value\"\n ref=\"inputRef\"\n v-bind=\"$attrs\"\n class=\"wx-input__inner\"\n :type=\"type\"\n :value=\"currentValue\"\n :placeholder=\"placeholder\"\n :disabled=\"field.disabled.value\"\n :readonly=\"readonly\"\n :maxlength=\"maxlength\"\n :autocomplete=\"autocomplete\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n :aria-invalid=\"field.status.value === 'error' || undefined\"\n @input=\"onInput\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n />\n\n <button\n v-if=\"showClear\"\n class=\"wx-input__clear\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Clear\"\n @click=\"clear\"\n >\n ✕\n </button>\n\n <span v-if=\"counter\" class=\"wx-input__count\">{{ counter }}</span>\n\n <span v-if=\"$slots.suffix\" class=\"wx-input__affix wx-input__affix--suffix\">\n <slot name=\"suffix\" />\n </span>\n </div>\n</template>\n\n<style scoped>\n.wx-input {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-8);\n box-sizing: border-box;\n width: 100%;\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-control);\n color: var(--wx-text-default);\n transition:\n border-color var(--wx-duration-normal) var(--wx-easing-standard),\n background-color var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-input:hover:not(.is-disabled) {\n border-color: var(--wx-border-strong);\n}\n\n/* The reference marks focus with a tinted border rather than a ring. */\n.wx-input.is-focused {\n border-color: var(--wx-border-focus);\n}\n\n.wx-input--sm {\n height: var(--wx-size-control-sm);\n padding: 0 var(--wx-space-10);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-input--md {\n height: var(--wx-size-control-md);\n padding: 0 var(--wx-space-12);\n font-size: var(--wx-font-size-md);\n}\n\n.wx-input--lg {\n height: var(--wx-size-control-lg);\n padding: 0 var(--wx-space-16);\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-input--error,\n.wx-input--error.is-focused {\n border-color: var(--wx-color-danger);\n}\n\n.wx-input--success,\n.wx-input--success.is-focused {\n border-color: var(--wx-color-success);\n}\n\n.wx-input--warning,\n.wx-input--warning.is-focused {\n border-color: var(--wx-color-warning);\n}\n\n.wx-input.is-disabled {\n background: var(--wx-bg-disabled);\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-input__inner {\n flex: 1 1 auto;\n min-width: 0;\n height: 100%;\n padding: 0;\n background: transparent;\n border: none;\n outline: none;\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\n.wx-input__inner::placeholder {\n color: var(--wx-text-placeholder);\n}\n\n.wx-input__inner:disabled {\n cursor: not-allowed;\n}\n\n.wx-input__affix,\n.wx-input__count {\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n color: var(--wx-text-muted);\n}\n\n.wx-input__count {\n font-size: var(--wx-font-size-xs);\n font-variant-numeric: tabular-nums;\n}\n\n.wx-input__clear {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 18px;\n height: 18px;\n padding: 0;\n background: transparent;\n border: none;\n border-radius: var(--wx-radius-full);\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-xs);\n line-height: 1;\n cursor: pointer;\n transition: background-color var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-input__clear:hover {\n background: var(--wx-bg-fill);\n color: var(--wx-text-default);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue'\nimport { useFormField } from '../../composables/useFormField'\nimport type { InputNumberEmits, InputNumberModelValue, InputNumberProps } from './types'\n\ndefineOptions({ name: 'WxInputNumber', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<InputNumberProps>(), {\n min: undefined,\n max: undefined,\n step: 1,\n precision: undefined,\n controls: true,\n controlsPosition: 'sides',\n wheel: false,\n size: undefined,\n status: undefined,\n id: undefined,\n name: undefined,\n placeholder: undefined,\n disabled: undefined,\n readonly: false,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<InputNumberEmits>()\n\nconst model = defineModel<InputNumberModelValue>({ default: null })\n\nconst field = useFormField(props)\nconst inputRef = ref<HTMLInputElement | null>(null)\nconst focused = ref(false)\n\n/** Decimals to keep: explicit `precision`, otherwise whatever `step` implies. */\nconst precision = computed(() => {\n if (props.precision !== undefined) return props.precision\n const [, decimals = ''] = String(props.step).split('.')\n return decimals.length\n})\n\n/** Rounds through a scaled integer so 0.1 + 0.2 does not leak into the model. */\nfunction round(value: number): number {\n const factor = 10 ** precision.value\n return Math.round((value + Number.EPSILON) * factor) / factor\n}\n\nfunction clamp(value: number): number {\n let next = value\n if (props.min !== undefined) next = Math.max(next, props.min)\n if (props.max !== undefined) next = Math.min(next, props.max)\n return round(next)\n}\n\nconst current = computed<number | null>(() =>\n typeof model.value === 'number' && Number.isFinite(model.value) ? model.value : null,\n)\n\n/** What the user sees. Kept as text so a half-typed \"-\" or \"1.\" survives. */\nconst display = ref(current.value === null ? '' : current.value.toFixed(precision.value))\n\nwatch(current, (value) => {\n if (focused.value) return\n display.value = value === null ? '' : value.toFixed(precision.value)\n})\n\nconst disabled = computed(() => field.disabled.value)\nconst canDecrease = computed(\n () =>\n !disabled.value &&\n !props.readonly &&\n (props.min === undefined || (current.value ?? 0) > props.min),\n)\nconst canIncrease = computed(\n () =>\n !disabled.value &&\n !props.readonly &&\n (props.max === undefined || (current.value ?? 0) < props.max),\n)\n\nconst classes = computed(() => [\n 'wx-input-number',\n `wx-input-number--${field.size.value}`,\n `wx-input-number--controls-${props.controls ? props.controlsPosition : 'none'}`,\n {\n [`wx-input-number--${field.status.value}`]: field.status.value !== 'default',\n 'is-focused': focused.value,\n 'is-disabled': disabled.value,\n },\n])\n\nfunction commit(value: number | null) {\n if (model.value === value) return\n model.value = value\n emit('change', value)\n}\n\nfunction stepBy(direction: 1 | -1) {\n if (disabled.value || props.readonly) return\n const base = current.value ?? clamp(0)\n const next = clamp(base + direction * props.step)\n commit(next)\n display.value = next.toFixed(precision.value)\n}\n\nfunction onInput(event: Event) {\n display.value = (event.target as HTMLInputElement).value\n const parsed = Number.parseFloat(display.value)\n // While typing, only push through values that already make sense.\n if (display.value === '') commit(null)\n else if (Number.isFinite(parsed)) commit(round(parsed))\n}\n\n/** Clamping and formatting happen on blur, so typing 5 into a min=10 field is possible. */\nfunction normalize() {\n if (display.value.trim() === '') {\n commit(null)\n display.value = ''\n return\n }\n const parsed = Number.parseFloat(display.value)\n if (!Number.isFinite(parsed)) {\n display.value = current.value === null ? '' : current.value.toFixed(precision.value)\n return\n }\n const next = clamp(parsed)\n commit(next)\n display.value = next.toFixed(precision.value)\n}\n\nfunction onFocus(event: FocusEvent) {\n focused.value = true\n emit('focus', event)\n}\n\nfunction onBlur(event: FocusEvent) {\n focused.value = false\n normalize()\n emit('blur', event)\n}\n\n/**\n * Only ever acts on a focused field, and swallows the scroll while it does — a\n * hovered field must not steal the page's scrolling.\n */\nfunction onWheel(event: WheelEvent) {\n if (!props.wheel || !focused.value || disabled.value || props.readonly) return\n event.preventDefault()\n stepBy(event.deltaY < 0 ? 1 : -1)\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'ArrowUp') {\n event.preventDefault()\n stepBy(1)\n } else if (event.key === 'ArrowDown') {\n event.preventDefault()\n stepBy(-1)\n } else if (event.key === 'Enter') {\n normalize()\n }\n}\n\ndefineExpose({\n focus: () => inputRef.value?.focus(),\n blur: () => inputRef.value?.blur(),\n increase: () => stepBy(1),\n decrease: () => stepBy(-1),\n input: inputRef,\n})\n</script>\n\n<template>\n <div :class=\"classes\">\n <button\n v-if=\"controls\"\n class=\"wx-input-number__button wx-input-number__button--decrease\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Decrease\"\n :disabled=\"!canDecrease\"\n @click=\"stepBy(-1)\"\n >\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M3.5 8h9\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </button>\n\n <input\n :id=\"field.id.value\"\n ref=\"inputRef\"\n v-bind=\"$attrs\"\n class=\"wx-input-number__inner\"\n type=\"text\"\n inputmode=\"decimal\"\n autocomplete=\"off\"\n :name=\"name\"\n :value=\"display\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n :aria-invalid=\"field.status.value === 'error' || undefined\"\n role=\"spinbutton\"\n :aria-valuenow=\"current ?? undefined\"\n :aria-valuemin=\"min\"\n :aria-valuemax=\"max\"\n @input=\"onInput\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @keydown=\"onKeydown\"\n @wheel=\"onWheel\"\n />\n\n <button\n v-if=\"controls\"\n class=\"wx-input-number__button wx-input-number__button--increase\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Increase\"\n :disabled=\"!canIncrease\"\n @click=\"stepBy(1)\"\n >\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M8 3.5v9M3.5 8h9\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n </div>\n</template>\n\n<style scoped>\n.wx-input-number {\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n width: 100%;\n height: var(--wx-size-control-md);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-control);\n color: var(--wx-text-default);\n overflow: hidden;\n transition:\n border-color var(--wx-duration-normal) var(--wx-easing-standard),\n background-color var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-input-number--sm {\n height: var(--wx-size-control-sm);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-input-number--md {\n height: var(--wx-size-control-md);\n font-size: var(--wx-font-size-md);\n}\n\n.wx-input-number--lg {\n height: var(--wx-size-control-lg);\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-input-number:hover:not(.is-disabled) {\n border-color: var(--wx-border-strong);\n}\n\n.wx-input-number.is-focused {\n border-color: var(--wx-border-focus);\n}\n\n.wx-input-number--error,\n.wx-input-number--error.is-focused {\n border-color: var(--wx-color-danger);\n}\n\n.wx-input-number--success {\n border-color: var(--wx-color-success);\n}\n\n.wx-input-number--warning {\n border-color: var(--wx-color-warning);\n}\n\n.wx-input-number.is-disabled {\n background: var(--wx-bg-disabled);\n color: var(--wx-text-disabled);\n}\n\n.wx-input-number__inner {\n flex: 1 1 auto;\n min-width: 0;\n height: 100%;\n padding: 0 var(--wx-space-12);\n background: transparent;\n border: none;\n outline: none;\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n font-variant-numeric: tabular-nums;\n text-align: center;\n}\n\n.wx-input-number--controls-none .wx-input-number__inner {\n text-align: left;\n}\n\n.wx-input-number__inner::placeholder {\n color: var(--wx-text-placeholder);\n}\n\n.wx-input-number__inner:disabled {\n cursor: not-allowed;\n}\n\n.wx-input-number__button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: calc(var(--wx-size-control-md) - 8px);\n height: 100%;\n padding: 0;\n background: var(--wx-bg-fill);\n border: none;\n color: var(--wx-text-default);\n cursor: pointer;\n transition: background-color var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-input-number__button svg {\n width: 16px;\n height: 16px;\n}\n\n.wx-input-number__button:hover:not(:disabled) {\n background: var(--wx-bg-fill-hover);\n color: var(--wx-color-primary);\n}\n\n.wx-input-number__button:disabled {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n/*\n * Stacked layout: the DOM order stays decrease → input → increase (which is what a\n * screen reader and the tab order want); grid puts the buttons where they belong.\n */\n.wx-input-number--controls-right {\n display: grid;\n grid-template-columns: 1fr auto;\n grid-template-rows: 1fr 1fr;\n}\n\n.wx-input-number--controls-right .wx-input-number__inner {\n grid-column: 1;\n grid-row: 1 / span 2;\n text-align: left;\n}\n\n.wx-input-number--controls-right .wx-input-number__button {\n width: calc(var(--wx-size-control-md) - 16px);\n height: 100%;\n border-left: 1px solid var(--wx-border-default);\n}\n\n.wx-input-number--controls-right .wx-input-number__button--increase {\n grid-column: 2;\n grid-row: 1;\n}\n\n.wx-input-number--controls-right .wx-input-number__button--decrease {\n grid-column: 2;\n grid-row: 2;\n border-top: 1px solid var(--wx-border-default);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, inject } from 'vue'\nimport { radioGroupKey, useFormField, type ChoiceValue } from '../../composables/useFormField'\nimport type { RadioEmits, RadioProps } from './types'\n\ndefineOptions({ name: 'WxRadio', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<RadioProps>(), {\n label: undefined,\n disabled: undefined,\n size: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<RadioEmits>()\n\nconst model = defineModel<ChoiceValue>({ default: null })\n\nconst group = inject(radioGroupKey, null)\nconst field = useFormField(props)\n\nconst checked = computed(() =>\n group ? group.modelValue.value === props.value : model.value === props.value,\n)\n\nconst disabled = computed(() => props.disabled || group?.disabled.value || field.disabled.value)\nconst size = computed(() => props.size ?? group?.size.value ?? field.size.value)\n\nconst classes = computed(() => [\n 'wx-radio',\n `wx-radio--${size.value}`,\n { 'is-checked': checked.value, 'is-disabled': disabled.value },\n])\n\nfunction onChange() {\n if (group) group.toggle(props.value, true)\n else model.value = props.value\n emit('change', props.value)\n}\n</script>\n\n<template>\n <label :class=\"classes\">\n <input\n :id=\"field.id.value\"\n v-bind=\"$attrs\"\n class=\"wx-radio__native\"\n type=\"radio\"\n :name=\"name ?? group?.name.value\"\n :checked=\"checked\"\n :disabled=\"disabled\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n @change=\"onChange\"\n />\n\n <span class=\"wx-radio__box\" aria-hidden=\"true\">\n <span class=\"wx-radio__dot\" />\n </span>\n\n <span v-if=\"label || $slots.default\" class=\"wx-radio__label\">\n <slot>{{ label }}</slot>\n </span>\n </label>\n</template>\n\n<style scoped>\n.wx-radio {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-8);\n cursor: pointer;\n user-select: none;\n color: var(--wx-text-default);\n}\n\n.wx-radio.is-disabled {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-radio__native {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n}\n\n.wx-radio__box {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n box-sizing: border-box;\n width: var(--wx-radio-size, 20px);\n height: var(--wx-radio-size, 20px);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-strong);\n border-radius: var(--wx-radius-full);\n transition:\n border-color var(--wx-duration-fast) var(--wx-easing-standard),\n box-shadow var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-radio--sm {\n --wx-radio-size: 16px;\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-radio--md {\n --wx-radio-size: 20px;\n font-size: var(--wx-font-size-md);\n}\n\n.wx-radio--lg {\n --wx-radio-size: 24px;\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-radio__dot {\n width: 50%;\n height: 50%;\n border-radius: var(--wx-radius-full);\n background: var(--wx-color-primary);\n transform: scale(0);\n transition: transform var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-radio:hover:not(.is-disabled) .wx-radio__box {\n border-color: var(--wx-color-primary);\n}\n\n.wx-radio.is-checked .wx-radio__box {\n border-color: var(--wx-color-primary);\n}\n\n.wx-radio.is-checked .wx-radio__dot {\n transform: scale(1);\n}\n\n.wx-radio.is-disabled .wx-radio__box {\n background: var(--wx-bg-disabled);\n border-color: var(--wx-border-default);\n}\n\n.wx-radio.is-disabled .wx-radio__dot {\n background: var(--wx-color-primary-disabled);\n}\n\n.wx-radio__native:focus-visible + .wx-radio__box {\n border-color: var(--wx-color-primary);\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-radio__label {\n line-height: var(--wx-font-line-height-normal);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wx-radio__box,\n .wx-radio__dot {\n transition: none;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, provide } from 'vue'\nimport {\n radioGroupKey,\n useFormField,\n useId,\n type ChoiceValue,\n} from '../../composables/useFormField'\nimport WxRadio from '../Radio/Radio.vue'\nimport type { RadioGroupEmits, RadioGroupProps } from './types'\n\ndefineOptions({ name: 'WxRadioGroup' })\n\nconst props = withDefaults(defineProps<RadioGroupProps>(), {\n options: undefined,\n disabled: undefined,\n size: undefined,\n name: undefined,\n inline: false,\n})\n\nconst emit = defineEmits<RadioGroupEmits>()\n\nconst model = defineModel<ChoiceValue>({ default: null })\n\nconst field = useFormField(props)\nconst fallbackName = useId('wx-radio-group')\n\n/** A group cannot be the target of a `for`, so the item label becomes a span. */\nfield.item?.registerLabelTarget(undefined)\n\nconst disabled = computed(() => props.disabled ?? field.disabled.value)\nconst size = computed(() => props.size ?? field.size.value)\n\n/**\n * Radios sharing a `name` are one roving-tabindex group in the browser, which is\n * what gives arrow-key navigation for free — so a name is always set.\n */\nconst name = computed(() => props.name ?? fallbackName)\n\nfunction toggle(value: ChoiceValue) {\n if (model.value === value) return\n model.value = value\n emit('change', value)\n}\n\nprovide(radioGroupKey, {\n name,\n modelValue: computed(() => model.value),\n disabled,\n size,\n toggle,\n})\n</script>\n\n<template>\n <div\n :class=\"['wx-radio-group', { 'wx-radio-group--inline': inline }]\"\n role=\"radiogroup\"\n :aria-labelledby=\"field.item ? `${field.item.id.value}-label` : undefined\"\n :aria-describedby=\"field.describedBy.value\"\n >\n <slot>\n <wx-radio\n v-for=\"option in options\"\n :key=\"String(option.value)\"\n :value=\"option.value\"\n :label=\"option.label\"\n :disabled=\"option.disabled\"\n />\n </slot>\n </div>\n</template>\n\n<style scoped>\n.wx-radio-group {\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-8);\n}\n\n.wx-radio-group--inline {\n flex-direction: row;\n flex-wrap: wrap;\n gap: var(--wx-space-16);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref } from 'vue'\nimport { useFormField } from '../../composables/useFormField'\nimport type { RateEmits, RateProps } from './types'\n\ndefineOptions({ name: 'WxRate', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<RateProps>(), {\n max: 5,\n allowHalf: false,\n clearable: true,\n showValue: false,\n readonly: false,\n disabled: undefined,\n size: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<RateEmits>()\n\nconst model = defineModel<number>({ default: 0 })\n\nconst field = useFormField(props)\nconst hovered = ref<number | null>(null)\n\nconst interactive = computed(() => !field.disabled.value && !props.readonly)\n\n/** What the stars show right now: the hovered value while pointing, the model otherwise. */\nconst shown = computed(() => hovered.value ?? model.value ?? 0)\n\nconst stars = computed(() =>\n Array.from({ length: props.max }, (_, index) => {\n const position = index + 1\n const fill = Math.min(Math.max(shown.value - index, 0), 1)\n return { position, full: fill >= 1, half: fill > 0 && fill < 1 }\n }),\n)\n\nconst classes = computed(() => [\n 'wx-rate',\n `wx-rate--${field.size.value}`,\n { 'is-disabled': field.disabled.value, 'is-readonly': props.readonly },\n])\n\n/** Halves come from the pointer landing on the left side of a star. */\nfunction valueAt(position: number, event: MouseEvent): number {\n if (!props.allowHalf) return position\n const target = event.currentTarget as HTMLElement\n const { left, width } = target.getBoundingClientRect()\n return event.clientX - left < width / 2 ? position - 0.5 : position\n}\n\n/** `toggle` is what makes clicking the current value clear it — the arrow keys must not. */\nfunction set(value: number, toggle = false) {\n const next = toggle && props.clearable && model.value === value ? 0 : value\n if (next === model.value) return\n model.value = next\n emit('change', next)\n}\n\nfunction onClick(position: number, event: MouseEvent) {\n if (!interactive.value) return\n set(valueAt(position, event), true)\n}\n\nfunction onHover(position: number, event: MouseEvent) {\n if (!interactive.value) return\n hovered.value = valueAt(position, event)\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (!interactive.value) return\n const step = props.allowHalf ? 0.5 : 1\n const current = model.value ?? 0\n\n if (event.key === 'ArrowRight' || event.key === 'ArrowUp') {\n event.preventDefault()\n set(Math.min(current + step, props.max))\n } else if (event.key === 'ArrowLeft' || event.key === 'ArrowDown') {\n event.preventDefault()\n set(Math.max(current - step, 0))\n } else if (event.key === 'Home') {\n event.preventDefault()\n set(0)\n } else if (event.key === 'End') {\n event.preventDefault()\n set(props.max)\n }\n}\n</script>\n\n<template>\n <div\n :id=\"field.id.value\"\n v-bind=\"$attrs\"\n :class=\"classes\"\n role=\"slider\"\n :tabindex=\"interactive ? 0 : -1\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n :aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n :aria-valuenow=\"model ?? 0\"\n :aria-readonly=\"readonly || undefined\"\n :aria-disabled=\"field.disabled.value || undefined\"\n @keydown=\"onKeydown\"\n @mouseleave=\"hovered = null\"\n >\n <span\n v-for=\"star in stars\"\n :key=\"star.position\"\n class=\"wx-rate__star\"\n :class=\"{ 'is-full': star.full, 'is-half': star.half }\"\n @click=\"onClick(star.position, $event)\"\n @mousemove=\"onHover(star.position, $event)\"\n >\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n class=\"wx-rate__outline\"\n d=\"M12 3.5l2.6 5.3 5.9.9-4.2 4.1 1 5.8-5.3-2.8-5.3 2.8 1-5.8-4.2-4.1 5.9-.9z\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linejoin=\"round\"\n />\n <path\n class=\"wx-rate__fill\"\n d=\"M12 3.5l2.6 5.3 5.9.9-4.2 4.1 1 5.8-5.3-2.8-5.3 2.8 1-5.8-4.2-4.1 5.9-.9z\"\n fill=\"currentColor\"\n />\n </svg>\n </span>\n\n <span v-if=\"showValue\" class=\"wx-rate__value\">{{ model ?? 0 }}</span>\n\n <input v-if=\"name\" type=\"hidden\" :name=\"name\" :value=\"model ?? 0\" />\n </div>\n</template>\n\n<style scoped>\n.wx-rate {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-2);\n color: var(--wx-border-strong);\n}\n\n.wx-rate:focus-visible {\n outline: none;\n border-radius: var(--wx-radius-xs);\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-rate--sm {\n --wx-rate-size: 18px;\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-rate--md {\n --wx-rate-size: 22px;\n font-size: var(--wx-font-size-md);\n}\n\n.wx-rate--lg {\n --wx-rate-size: 28px;\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-rate__star {\n display: inline-flex;\n width: var(--wx-rate-size, 22px);\n height: var(--wx-rate-size, 22px);\n cursor: pointer;\n}\n\n.wx-rate.is-disabled .wx-rate__star,\n.wx-rate.is-readonly .wx-rate__star {\n cursor: default;\n}\n\n.wx-rate.is-disabled {\n opacity: 0.6;\n}\n\n.wx-rate__star svg {\n width: 100%;\n height: 100%;\n overflow: visible;\n}\n\n/* The filled star is clipped to nothing, then revealed whole or by half. */\n.wx-rate__fill {\n color: var(--wx-color-warning);\n clip-path: inset(0 100% 0 0);\n transition: clip-path var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-rate__star.is-full .wx-rate__fill {\n clip-path: inset(0);\n}\n\n.wx-rate__star.is-half .wx-rate__fill {\n clip-path: inset(0 50% 0 0);\n}\n\n.wx-rate__star.is-full,\n.wx-rate__star.is-half {\n color: var(--wx-color-warning);\n}\n\n.wx-rate__value {\n margin-left: var(--wx-space-6);\n color: var(--wx-text-muted);\n font-variant-numeric: tabular-nums;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wx-rate__fill {\n transition: none;\n }\n}\n</style>\n","/**\n * Toolbar glyphs as raw path data, drawn on a 24×24 grid with a 1.7 stroke.\n * Inline rather than an icon package: it is a dozen paths, and a dependency for\n * that would be worse than the duplication.\n */\nexport const richTextIcons: Record<string, string> = {\n bold: 'M7 5h6a3.5 3.5 0 0 1 0 7H7zm0 7h7a3.5 3.5 0 0 1 0 7H7z',\n italic: 'M15 5h-5M14 19H9M13.5 5 10.5 19',\n strike:\n 'M5 12h14M8 8.5A3 3 0 0 1 11 6h2a3 3 0 0 1 3 2.5M16 15.5A3 3 0 0 1 13 18h-2a3 3 0 0 1-3-2.5',\n code: 'm9 8-5 4 5 4M15 8l5 4-5 4',\n bulletList: 'M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01',\n orderedList: 'M10 6h10M10 12h10M10 18h10M4 6h1v4M4 10h2M4 14h2v2H4v2h2',\n blockquote: 'M7 15V9h4v6H7l-2 3M15 15V9h4v6h-4l-2 3',\n hr: 'M4 12h16',\n link: 'M10 13a4 4 0 0 0 5.7.4l2.6-2.6a4 4 0 0 0-5.7-5.7l-1.5 1.5M14 11a4 4 0 0 0-5.7-.4l-2.6 2.6a4 4 0 0 0 5.7 5.7l1.5-1.5',\n table: 'M4 6h16v12H4zM4 10h16M10 10v8M4 14h16',\n image: 'M4 6h16v12H4zM4 15l4-4 4 4 3-3 5 5M9 9.5h.01',\n youtube:\n 'M3 8.5A2.5 2.5 0 0 1 5.5 6h13A2.5 2.5 0 0 1 21 8.5v7a2.5 2.5 0 0 1-2.5 2.5h-13A2.5 2.5 0 0 1 3 15.5zM10.5 9.5l4 2.5-4 2.5z',\n undo: 'M4 9h11a4.5 4.5 0 0 1 0 9h-4M4 9l4-4M4 9l4 4',\n redo: 'M20 9H9a4.5 4.5 0 0 0 0 9h4M20 9l-4-4M20 9l-4 4',\n rowAfter: 'M4 5h16M4 11h16M8 15v6M5 18h6',\n rowBefore: 'M4 19h16M4 13h16M8 3v6M5 6h6',\n columnAfter: 'M5 4v16M11 4v16M15 8h6M18 5v6',\n columnBefore: 'M19 4v16M13 4v16M3 8h6M6 5v6',\n deleteRow: 'M4 8h16M4 16h16M9 12h6',\n deleteColumn: 'M8 4v16M16 4v16M12 9v6',\n deleteTable: 'M5 7h14M9 7V5h6v2M7 7l1 12h8l1-12M10 11v4M14 11v4',\n mergeCells: 'M4 6h16v12H4zM12 6v3M12 15v3M9 12h6M9 12l2-2M9 12l2 2',\n check: 'm5 13 4 4L19 7',\n close: 'M6 6l12 12M18 6 6 18',\n}\n","<script setup lang=\"ts\">\nimport { richTextIcons } from './icons'\n\ndefineOptions({ name: 'WxRichTextToolbarButton' })\n\nwithDefaults(\n defineProps<{\n /** Key into the icon set. Omit it and the `text` shows instead. */\n icon?: string\n /** Short label used for headings, where a glyph reads worse than \"H2\". */\n text?: string\n label: string\n active?: boolean\n disabled?: boolean\n }>(),\n { icon: undefined, text: undefined, active: false, disabled: false },\n)\n\ndefineEmits<{ click: [] }>()\n</script>\n\n<template>\n <button\n type=\"button\"\n class=\"wx-rich-text__tool\"\n :class=\"{ 'is-active': active }\"\n :title=\"label\"\n :aria-label=\"label\"\n :aria-pressed=\"active\"\n :disabled=\"disabled\"\n @click=\"$emit('click')\"\n >\n <svg v-if=\"icon\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path\n :d=\"richTextIcons[icon]\"\n stroke=\"currentColor\"\n stroke-width=\"1.7\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <span v-else class=\"wx-rich-text__tool-text\">{{ text }}</span>\n </button>\n</template>\n\n<style scoped>\n.wx-rich-text__tool {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 30px;\n height: 30px;\n padding: 0;\n background: transparent;\n border: 1px solid transparent;\n border-radius: var(--wx-radius-xs);\n color: var(--wx-text-default);\n cursor: pointer;\n transition:\n background-color var(--wx-duration-fast) var(--wx-easing-standard),\n color var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-rich-text__tool svg {\n width: 18px;\n height: 18px;\n}\n\n.wx-rich-text__tool-text {\n font-size: var(--wx-font-size-sm);\n font-weight: var(--wx-font-weight-semibold);\n}\n\n.wx-rich-text__tool:hover:not(:disabled) {\n background: var(--wx-bg-fill);\n}\n\n.wx-rich-text__tool.is-active {\n background: var(--wx-color-primary-soft);\n color: var(--wx-color-primary);\n}\n\n.wx-rich-text__tool:focus-visible {\n outline: none;\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-rich-text__tool:disabled {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n</style>\n","import type { RichTextTool } from './types'\n\n/**\n * Kept out of the component because `withDefaults` cannot reference a binding\n * declared inside `<script setup>` — it is hoisted out of `setup()`.\n */\nexport const DEFAULT_TOOLS: RichTextTool[] = [\n 'bold',\n 'italic',\n 'strike',\n 'code',\n 'divider',\n 'h2',\n 'h3',\n 'h4',\n 'divider',\n 'bulletList',\n 'orderedList',\n 'blockquote',\n 'hr',\n 'divider',\n 'link',\n 'table',\n 'image',\n 'youtube',\n 'divider',\n 'undo',\n 'redo',\n]\n\nexport const DEFAULT_ACCEPT = [\n 'image/png',\n 'image/jpeg',\n 'image/gif',\n 'image/webp',\n 'image/svg+xml',\n]\n\nexport interface ToolMeta {\n label: string\n icon?: string\n text?: string\n}\n\nexport const TOOL_META: Record<Exclude<RichTextTool, 'divider'>, ToolMeta> = {\n bold: { label: 'Bold', icon: 'bold' },\n italic: { label: 'Italic', icon: 'italic' },\n strike: { label: 'Strikethrough', icon: 'strike' },\n code: { label: 'Inline code', icon: 'code' },\n h2: { label: 'Heading 2', text: 'H2' },\n h3: { label: 'Heading 3', text: 'H3' },\n h4: { label: 'Heading 4', text: 'H4' },\n bulletList: { label: 'Bulleted list', icon: 'bulletList' },\n orderedList: { label: 'Numbered list', icon: 'orderedList' },\n blockquote: { label: 'Quote', icon: 'blockquote' },\n hr: { label: 'Divider', icon: 'hr' },\n link: { label: 'Link', icon: 'link' },\n table: { label: 'Table', icon: 'table' },\n image: { label: 'Image', icon: 'image' },\n youtube: { label: 'YouTube video', icon: 'youtube' },\n undo: { label: 'Undo', icon: 'undo' },\n redo: { label: 'Redo', icon: 'redo' },\n}\n\n/** Shown as a second row while the caret sits inside a table. */\nexport const TABLE_TOOLS = [\n { key: 'addRowAfter', label: 'Row below', icon: 'rowAfter' },\n { key: 'addRowBefore', label: 'Row above', icon: 'rowBefore' },\n { key: 'addColumnAfter', label: 'Column after', icon: 'columnAfter' },\n { key: 'addColumnBefore', label: 'Column before', icon: 'columnBefore' },\n { key: 'deleteRow', label: 'Delete row', icon: 'deleteRow' },\n { key: 'deleteColumn', label: 'Delete column', icon: 'deleteColumn' },\n { key: 'mergeOrSplit', label: 'Merge or split cells', icon: 'mergeCells' },\n { key: 'deleteTable', label: 'Delete table', icon: 'deleteTable' },\n] as const\n\nexport type TableToolKey = (typeof TABLE_TOOLS)[number]['key']\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue'\nimport { EditorContent, useEditor } from '@tiptap/vue-3'\nimport StarterKit from '@tiptap/starter-kit'\nimport { TableKit } from '@tiptap/extension-table'\nimport Image from '@tiptap/extension-image'\nimport Youtube from '@tiptap/extension-youtube'\nimport FileHandler from '@tiptap/extension-file-handler'\nimport { useFormField } from '../../composables/useFormField'\nimport WxRichTextToolbarButton from './ToolbarButton.vue'\nimport { DEFAULT_ACCEPT, DEFAULT_TOOLS, TABLE_TOOLS, TOOL_META, type TableToolKey } from './tools'\nimport type { RichTextEmits, RichTextProps, RichTextTool } from './types'\n\ndefineOptions({ name: 'WxRichText', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<RichTextProps>(), {\n placeholder: undefined,\n disabled: undefined,\n readonly: false,\n size: undefined,\n status: undefined,\n id: undefined,\n ariaLabel: undefined,\n minHeight: '220px',\n tools: () => DEFAULT_TOOLS,\n upload: undefined,\n pickImage: undefined,\n accept: () => DEFAULT_ACCEPT,\n})\n\nconst emit = defineEmits<RichTextEmits>()\n\nconst model = defineModel<string>({ default: '' })\n\nconst field = useFormField(props)\nconst focused = ref(false)\nconst uploading = ref(0)\nconst fileInput = ref<HTMLInputElement | null>(null)\n\n/** The link and YouTube buttons open one shared bar rather than a `prompt()`. */\nconst prompt = ref<{ kind: 'link' | 'youtube'; value: string } | null>(null)\n\nconst editable = computed(() => !field.disabled.value && !props.readonly)\n\n/** Tiptap renders `<p></p>` for an empty document; a backend wants an empty string. */\nfunction readHtml(): string {\n const instance = editor.value\n if (!instance || instance.isEmpty) return ''\n return instance.getHTML()\n}\n\nconst editor = useEditor({\n content: model.value ?? '',\n editable: editable.value,\n extensions: [\n StarterKit.configure({\n link: {\n openOnClick: false,\n autolink: true,\n HTMLAttributes: { rel: 'noopener noreferrer nofollow', target: '_blank' },\n },\n }),\n TableKit.configure({ table: { resizable: true } }),\n Image.configure({ HTMLAttributes: { class: 'wx-rich-text__image' } }),\n Youtube.configure({ nocookie: true, width: 640, height: 360 }),\n FileHandler.configure({\n allowedMimeTypes: props.accept,\n onDrop: (_editor, files, pos) => void uploadFiles(files, pos),\n onPaste: (_editor, files) => void uploadFiles(files),\n }),\n ],\n onUpdate: () => {\n const html = readHtml()\n model.value = html\n emit('change', html)\n },\n onFocus: () => {\n focused.value = true\n emit('focus')\n },\n onBlur: () => {\n focused.value = false\n emit('blur')\n },\n})\n\n/** Only replaces the document when the value really differs, or the caret jumps. */\nwatch(model, (value) => {\n const instance = editor.value\n if (!instance) return\n if ((value ?? '') === readHtml()) return\n instance.commands.setContent(value ?? '', { emitUpdate: false })\n})\n\nwatch(editable, (value) => editor.value?.setEditable(value))\n\nconst isEmpty = computed(() => editor.value?.isEmpty ?? true)\nconst inTable = computed(() => editor.value?.isActive('table') ?? false)\n\nconst classes = computed(() => [\n 'wx-rich-text',\n `wx-rich-text--${field.size.value}`,\n {\n [`wx-rich-text--${field.status.value}`]: field.status.value !== 'default',\n 'is-focused': focused.value,\n 'is-disabled': field.disabled.value,\n 'is-readonly': props.readonly,\n },\n])\n\nfunction insertImage(url: string, alt?: string, pos?: number) {\n const instance = editor.value\n if (!instance) return\n const at = pos ?? instance.state.selection.anchor\n instance\n .chain()\n .focus()\n .insertContentAt(at, { type: 'image', attrs: { src: url, alt } })\n .run()\n}\n\n/**\n * Uploads happen one file at a time and insert only on success — a failed upload\n * leaves nothing behind to clean up.\n */\nasync function uploadFiles(files: File[], pos?: number) {\n if (!props.upload) return\n for (const file of files) {\n uploading.value += 1\n try {\n const result = await props.upload(file)\n insertImage(result.url, result.alt, pos)\n } catch (error) {\n emit('uploadError', error, file)\n } finally {\n uploading.value -= 1\n }\n }\n}\n\nasync function onImageButton() {\n if (props.pickImage) {\n const url = await props.pickImage()\n if (url) insertImage(url)\n return\n }\n fileInput.value?.click()\n}\n\nfunction onFilePicked(event: Event) {\n const input = event.target as HTMLInputElement\n const files = Array.from(input.files ?? [])\n input.value = ''\n void uploadFiles(files)\n}\n\nfunction openPrompt(kind: 'link' | 'youtube') {\n const current = kind === 'link' ? (editor.value?.getAttributes('link').href ?? '') : ''\n prompt.value = { kind, value: String(current) }\n}\n\nfunction applyPrompt() {\n const instance = editor.value\n const current = prompt.value\n if (!instance || !current) return\n const value = current.value.trim()\n\n if (current.kind === 'link') {\n if (value) instance.chain().focus().extendMarkRange('link').setLink({ href: value }).run()\n else instance.chain().focus().extendMarkRange('link').unsetLink().run()\n } else if (value) {\n instance.commands.setYoutubeVideo({ src: value })\n }\n\n prompt.value = null\n}\n\n/** Whether a tool should render at all — the image button needs somewhere to get a file. */\nfunction toolVisible(tool: RichTextTool): boolean {\n if (tool === 'image') return Boolean(props.upload || props.pickImage)\n return true\n}\n\nconst visibleTools = computed(() => props.tools.filter(toolVisible))\n\nfunction isActive(tool: RichTextTool): boolean {\n const instance = editor.value\n if (!instance) return false\n switch (tool) {\n case 'h2':\n return instance.isActive('heading', { level: 2 })\n case 'h3':\n return instance.isActive('heading', { level: 3 })\n case 'h4':\n return instance.isActive('heading', { level: 4 })\n default:\n return instance.isActive(tool)\n }\n}\n\nfunction run(tool: RichTextTool) {\n const instance = editor.value\n if (!instance) return\n const chain = instance.chain().focus()\n\n switch (tool) {\n case 'bold':\n chain.toggleBold().run()\n break\n case 'italic':\n chain.toggleItalic().run()\n break\n case 'strike':\n chain.toggleStrike().run()\n break\n case 'code':\n chain.toggleCode().run()\n break\n case 'h2':\n chain.toggleHeading({ level: 2 }).run()\n break\n case 'h3':\n chain.toggleHeading({ level: 3 }).run()\n break\n case 'h4':\n chain.toggleHeading({ level: 4 }).run()\n break\n case 'bulletList':\n chain.toggleBulletList().run()\n break\n case 'orderedList':\n chain.toggleOrderedList().run()\n break\n case 'blockquote':\n chain.toggleBlockquote().run()\n break\n case 'hr':\n chain.setHorizontalRule().run()\n break\n case 'undo':\n chain.undo().run()\n break\n case 'redo':\n chain.redo().run()\n break\n case 'table':\n chain.insertTable({ rows: 3, cols: 3, withHeaderRow: true }).run()\n break\n case 'link':\n openPrompt('link')\n break\n case 'youtube':\n openPrompt('youtube')\n break\n case 'image':\n void onImageButton()\n break\n }\n}\n\nfunction runTableCommand(key: TableToolKey) {\n const instance = editor.value\n if (!instance) return\n const chain = instance.chain().focus() as unknown as Record<string, () => { run: () => void }>\n chain[key]().run()\n}\n\ndefineExpose({\n editor,\n focus: () => editor.value?.commands.focus(),\n clear: () => editor.value?.commands.clearContent(true),\n})\n</script>\n\n<template>\n <div :class=\"classes\">\n <div class=\"wx-rich-text__toolbar\" role=\"toolbar\" :aria-label=\"ariaLabel ?? 'Text formatting'\">\n <template v-for=\"(tool, index) in visibleTools\" :key=\"`${tool}-${index}`\">\n <span v-if=\"tool === 'divider'\" class=\"wx-rich-text__divider\" aria-hidden=\"true\" />\n <wx-rich-text-toolbar-button\n v-else\n :icon=\"TOOL_META[tool].icon\"\n :text=\"TOOL_META[tool].text\"\n :label=\"TOOL_META[tool].label\"\n :active=\"isActive(tool)\"\n :disabled=\"!editable\"\n @click=\"run(tool)\"\n />\n </template>\n\n <span v-if=\"uploading > 0\" class=\"wx-rich-text__uploading\">Uploading…</span>\n </div>\n\n <div v-if=\"inTable && editable\" class=\"wx-rich-text__toolbar wx-rich-text__toolbar--table\">\n <wx-rich-text-toolbar-button\n v-for=\"tool in TABLE_TOOLS\"\n :key=\"tool.key\"\n :icon=\"tool.icon\"\n :label=\"tool.label\"\n @click=\"runTableCommand(tool.key)\"\n />\n </div>\n\n <form v-if=\"prompt\" class=\"wx-rich-text__prompt\" @submit.prevent=\"applyPrompt\">\n <label class=\"wx-rich-text__prompt-label\" :for=\"`${field.id.value}-prompt`\">\n {{ prompt.kind === 'link' ? 'Link address' : 'YouTube URL' }}\n </label>\n <input\n :id=\"`${field.id.value}-prompt`\"\n v-model=\"prompt.value\"\n class=\"wx-rich-text__prompt-input\"\n type=\"url\"\n :placeholder=\"prompt.kind === 'link' ? 'https://example.com' : 'https://youtu.be/…'\"\n @keydown.esc=\"prompt = null\"\n />\n <wx-rich-text-toolbar-button icon=\"check\" label=\"Apply\" @click=\"applyPrompt\" />\n <wx-rich-text-toolbar-button icon=\"close\" label=\"Cancel\" @click=\"prompt = null\" />\n </form>\n\n <div class=\"wx-rich-text__body\" :style=\"{ minHeight }\">\n <span v-if=\"placeholder && isEmpty\" class=\"wx-rich-text__placeholder\">{{ placeholder }}</span>\n <editor-content\n :editor=\"editor\"\n class=\"wx-rich-text__content\"\n :aria-describedby=\"field.describedBy.value\"\n />\n </div>\n\n <input\n v-if=\"upload && !pickImage\"\n ref=\"fileInput\"\n class=\"wx-rich-text__file\"\n type=\"file\"\n :accept=\"accept.join(',')\"\n multiple\n @change=\"onFilePicked\"\n />\n </div>\n</template>\n\n<style scoped>\n.wx-rich-text {\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n width: 100%;\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-control);\n color: var(--wx-text-default);\n transition: border-color var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-rich-text.is-focused {\n border-color: var(--wx-border-focus);\n}\n\n.wx-rich-text--error,\n.wx-rich-text--error.is-focused {\n border-color: var(--wx-color-danger);\n}\n\n.wx-rich-text--success {\n border-color: var(--wx-color-success);\n}\n\n.wx-rich-text--warning {\n border-color: var(--wx-color-warning);\n}\n\n.wx-rich-text.is-disabled {\n background: var(--wx-bg-disabled);\n color: var(--wx-text-disabled);\n}\n\n.wx-rich-text__toolbar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--wx-space-2);\n padding: var(--wx-space-6);\n border-bottom: 1px solid var(--wx-border-muted);\n}\n\n.wx-rich-text__toolbar--table {\n background: var(--wx-bg-subtle);\n}\n\n.wx-rich-text__divider {\n width: 1px;\n height: 18px;\n margin: 0 var(--wx-space-4);\n background: var(--wx-border-default);\n}\n\n.wx-rich-text__uploading {\n margin-left: auto;\n padding: 0 var(--wx-space-8);\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-rich-text__prompt {\n display: flex;\n align-items: center;\n gap: var(--wx-space-8);\n padding: var(--wx-space-8);\n background: var(--wx-bg-subtle);\n border-bottom: 1px solid var(--wx-border-muted);\n}\n\n.wx-rich-text__prompt-label {\n flex: 0 0 auto;\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-rich-text__prompt-input {\n flex: 1 1 auto;\n min-width: 0;\n height: var(--wx-size-control-sm);\n padding: 0 var(--wx-space-10);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-xs);\n outline: none;\n color: inherit;\n font-family: inherit;\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-rich-text__prompt-input:focus {\n border-color: var(--wx-border-focus);\n}\n\n.wx-rich-text__body {\n position: relative;\n flex: 1 1 auto;\n padding: var(--wx-space-12) var(--wx-space-16);\n}\n\n.wx-rich-text__placeholder {\n position: absolute;\n top: var(--wx-space-12);\n left: var(--wx-space-16);\n color: var(--wx-text-placeholder);\n pointer-events: none;\n}\n\n.wx-rich-text__file {\n display: none;\n}\n\n/* The editing surface itself is rendered by ProseMirror. */\n.wx-rich-text__content :deep(.ProseMirror) {\n outline: none;\n min-height: inherit;\n line-height: var(--wx-font-line-height-relaxed);\n}\n\n/*\n * Host applications decorate content tags globally — VitePress, which renders these\n * docs, gives every h2 a top border and 24px of padding, and turns tables into\n * `display: block`. The editing surface has to look the same wherever it is\n * embedded, so anything a host is likely to set is stated here instead of inherited.\n */\n.wx-rich-text__content :deep(h1),\n.wx-rich-text__content :deep(h2),\n.wx-rich-text__content :deep(h3),\n.wx-rich-text__content :deep(h4),\n.wx-rich-text__content :deep(h5),\n.wx-rich-text__content :deep(h6) {\n margin: var(--wx-space-18) 0 var(--wx-space-8);\n padding: 0;\n border: 0;\n color: var(--wx-text-strong);\n font-weight: var(--wx-font-weight-semibold);\n line-height: var(--wx-font-line-height-tight);\n}\n\n.wx-rich-text__content :deep(p) {\n margin: 0 0 var(--wx-space-12);\n}\n\n/* Nothing pushes the document away from the top or bottom edge of the field. */\n.wx-rich-text__content :deep(.ProseMirror > :first-child) {\n margin-top: 0;\n}\n\n.wx-rich-text__content :deep(.ProseMirror > :last-child) {\n margin-bottom: 0;\n}\n\n.wx-rich-text__content :deep(h2) {\n font-size: var(--wx-font-size-2xl);\n}\n\n.wx-rich-text__content :deep(h3) {\n font-size: var(--wx-font-size-xl);\n}\n\n.wx-rich-text__content :deep(h4) {\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-rich-text__content :deep(ul),\n.wx-rich-text__content :deep(ol) {\n margin: 0 0 var(--wx-space-12);\n padding-left: var(--wx-space-24);\n}\n\n.wx-rich-text__content :deep(blockquote) {\n margin: 0 0 var(--wx-space-12);\n padding-left: var(--wx-space-16);\n border-left: 3px solid var(--wx-color-primary-soft);\n color: var(--wx-text-muted);\n}\n\n.wx-rich-text__content :deep(a) {\n color: var(--wx-text-link);\n text-decoration: underline;\n}\n\n.wx-rich-text__content :deep(code) {\n padding: 2px var(--wx-space-4);\n background: var(--wx-bg-fill);\n border-radius: var(--wx-radius-xs);\n font-family: var(--wx-font-family-mono);\n font-size: 0.9em;\n}\n\n.wx-rich-text__content :deep(pre) {\n margin: 0 0 var(--wx-space-12);\n padding: var(--wx-space-12);\n background: var(--wx-bg-inverse);\n border-radius: var(--wx-radius-xs);\n color: var(--wx-text-inverse);\n overflow-x: auto;\n}\n\n.wx-rich-text__content :deep(hr) {\n margin: var(--wx-space-18) 0;\n border: none;\n border-top: 1px solid var(--wx-border-default);\n}\n\n.wx-rich-text__content :deep(img),\n.wx-rich-text__content :deep(iframe) {\n max-width: 100%;\n border-radius: var(--wx-radius-xs);\n}\n\n.wx-rich-text__content :deep(img.ProseMirror-selectednode) {\n outline: 2px solid var(--wx-color-primary);\n}\n\n.wx-rich-text__content :deep(table) {\n /* Stated because hosts turn tables into `display: block` for horizontal scrolling. */\n display: table;\n width: 100%;\n margin: 0 0 var(--wx-space-12);\n border-collapse: collapse;\n table-layout: fixed;\n overflow: hidden;\n}\n\n.wx-rich-text__content :deep(th),\n.wx-rich-text__content :deep(td) {\n position: relative;\n padding: var(--wx-space-6) var(--wx-space-10);\n border: 1px solid var(--wx-border-default);\n vertical-align: top;\n}\n\n.wx-rich-text__content :deep(th) {\n background: var(--wx-bg-fill);\n font-weight: var(--wx-font-weight-semibold);\n text-align: left;\n}\n\n.wx-rich-text__content :deep(.selectedCell::after) {\n content: '';\n position: absolute;\n inset: 0;\n background: var(--wx-color-primary-soft);\n pointer-events: none;\n}\n\n.wx-rich-text__content :deep(.column-resize-handle) {\n position: absolute;\n top: 0;\n right: -2px;\n bottom: 0;\n width: 4px;\n background: var(--wx-color-primary);\n cursor: col-resize;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue'\nimport {\n ComboboxAnchor,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxInput,\n ComboboxItem,\n ComboboxItemIndicator,\n ComboboxPortal,\n ComboboxRoot,\n ComboboxTrigger,\n ComboboxViewport,\n} from 'reka-ui'\nimport { useFormField } from '../../composables/useFormField'\nimport type { SelectEmits, SelectModelValue, SelectProps, SelectValue } from './types'\n\ndefineOptions({ name: 'WxSelect', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<SelectProps>(), {\n options: () => [],\n multiple: false,\n filterable: false,\n clearable: false,\n placeholder: undefined,\n emptyText: 'Nothing found',\n teleport: true,\n disabled: undefined,\n size: undefined,\n status: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<SelectEmits>()\n\nconst model = defineModel<SelectModelValue>({ default: null })\n\nconst field = useFormField(props)\nconst open = ref(false)\n\n/**\n * The text in the search field. Controlled here rather than left to the combobox:\n * with `multiple` the input has no display value to fall back on and renders the\n * model itself, so picking two tags leaves \"news,releases\" sitting in the box.\n */\nconst searchText = ref('')\n\n/** Reka wants an array for multiple and a bare value otherwise. */\nconst selection = computed({\n get: () => (props.multiple ? ((model.value as SelectValue[]) ?? []) : (model.value ?? null)),\n set: (value) => {\n model.value = value as SelectModelValue\n emit('change', value as SelectModelValue)\n },\n})\n\nconst labelOf = (value: SelectValue) =>\n props.options.find((option) => option.value === value)?.label ?? String(value)\n\nconst selectedOptions = computed(() => {\n if (!props.multiple) return []\n return ((model.value as SelectValue[]) ?? []).map((value) => ({ value, label: labelOf(value) }))\n})\n\nconst singleLabel = computed(() => {\n if (props.multiple) return ''\n const value = model.value as SelectValue | null\n return value === null || value === undefined ? '' : labelOf(value)\n})\n\nconst hasSelection = computed(() =>\n props.multiple\n ? selectedOptions.value.length > 0\n : model.value !== null && model.value !== undefined && model.value !== '',\n)\n\nconst showClear = computed(() => props.clearable && !field.disabled.value && hasSelection.value)\n\nconst classes = computed(() => [\n 'wx-select',\n `wx-select--${field.size.value}`,\n {\n [`wx-select--${field.status.value}`]: field.status.value !== 'default',\n 'is-open': open.value,\n 'is-disabled': field.disabled.value,\n 'is-multiple': props.multiple,\n },\n])\n\n/** A pick clears the search in multiple mode and shows the label in single mode. */\nwatch(\n () => model.value,\n () => {\n searchText.value = props.multiple ? '' : singleLabel.value\n },\n { immediate: true },\n)\n\nwatch(open, (value) => {\n if (value) {\n emit('open')\n return\n }\n searchText.value = props.multiple ? '' : singleLabel.value\n emit('close')\n})\n\n/** Clicking the field is how everyone expects a select to open. */\nfunction openList() {\n if (!field.disabled.value) open.value = true\n}\n\n/**\n * What a filterable field shows once a value is picked. Without it the input falls\n * back to the raw value, so choosing \"Maria Kovalenko\" leaves \"12\" in the box.\n */\nfunction displayValue(value: unknown): string {\n return value === null || value === undefined ? '' : labelOf(value as SelectValue)\n}\n\n/**\n * Reka filters the list itself and keeps no public search term, so the value is read\n * straight off the input — that is what a caller loading options from a backend needs.\n */\nfunction onSearch(event: Event) {\n emit('search', (event.target as HTMLInputElement).value)\n}\n\nfunction clear() {\n model.value = props.multiple ? [] : null\n emit('change', model.value)\n emit('clear')\n}\n\nfunction removeTag(value: SelectValue) {\n const next = ((model.value as SelectValue[]) ?? []).filter((item) => item !== value)\n model.value = next\n emit('change', next)\n}\n</script>\n\n<template>\n <combobox-root\n v-model=\"selection\"\n v-model:open=\"open\"\n :multiple=\"multiple\"\n :disabled=\"field.disabled.value\"\n :name=\"name\"\n :ignore-filter=\"!filterable\"\n :open-on-click=\"true\"\n :class=\"classes\"\n as=\"div\"\n >\n <combobox-anchor class=\"wx-select__anchor\" as=\"div\" @click=\"openList\">\n <div class=\"wx-select__value\">\n <template v-if=\"multiple\">\n <span\n v-for=\"option in selectedOptions\"\n :key=\"String(option.value)\"\n class=\"wx-select__tag\"\n >\n {{ option.label }}\n <button\n v-if=\"!field.disabled.value\"\n class=\"wx-select__tag-remove\"\n type=\"button\"\n tabindex=\"-1\"\n :aria-label=\"`Remove ${option.label}`\"\n @click.stop=\"removeTag(option.value)\"\n >\n ✕\n </button>\n </span>\n </template>\n\n <combobox-input\n v-if=\"filterable\"\n :id=\"field.id.value\"\n v-bind=\"$attrs\"\n v-model=\"searchText\"\n class=\"wx-select__input\"\n :placeholder=\"placeholder\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n :aria-invalid=\"field.status.value === 'error' || undefined\"\n :display-value=\"multiple ? undefined : displayValue\"\n auto-focus\n @input=\"onSearch\"\n />\n\n <template v-else>\n <span v-if=\"!multiple && hasSelection\" class=\"wx-select__single\">{{ singleLabel }}</span>\n <span v-else-if=\"!hasSelection\" class=\"wx-select__placeholder\">{{ placeholder }}</span>\n </template>\n </div>\n\n <button\n v-if=\"showClear\"\n class=\"wx-select__clear\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Clear\"\n @click.stop=\"clear\"\n >\n ✕\n </button>\n\n <combobox-trigger\n :id=\"filterable ? undefined : field.id.value\"\n class=\"wx-select__toggle\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n >\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"m4 6 4 4 4-4\"\n stroke=\"currentColor\"\n stroke-width=\"1.6\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </combobox-trigger>\n </combobox-anchor>\n\n <combobox-portal :disabled=\"!teleport\">\n <combobox-content class=\"wx-select__content\" position=\"popper\" :side-offset=\"4\">\n <combobox-viewport class=\"wx-select__viewport\">\n <combobox-empty class=\"wx-select__empty\">{{ emptyText }}</combobox-empty>\n\n <slot>\n <combobox-item\n v-for=\"option in options\"\n :key=\"String(option.value)\"\n class=\"wx-select__option\"\n :value=\"option.value\"\n :disabled=\"option.disabled\"\n >\n <span class=\"wx-select__option-label\">{{ option.label }}</span>\n <combobox-item-indicator class=\"wx-select__check\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"m3.5 8.5 3 3 6-6\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </combobox-item-indicator>\n </combobox-item>\n </slot>\n </combobox-viewport>\n </combobox-content>\n </combobox-portal>\n </combobox-root>\n</template>\n\n<style scoped>\n.wx-select {\n display: block;\n width: 100%;\n}\n\n.wx-select__anchor {\n display: flex;\n align-items: center;\n gap: var(--wx-space-6);\n box-sizing: border-box;\n min-height: var(--wx-size-control-md);\n padding: 0 var(--wx-space-6) 0 var(--wx-space-12);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-control);\n color: var(--wx-text-default);\n font-size: var(--wx-font-size-md);\n cursor: pointer;\n transition: border-color var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-select--sm .wx-select__anchor {\n min-height: var(--wx-size-control-sm);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-select--lg .wx-select__anchor {\n min-height: var(--wx-size-control-lg);\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-select__anchor:hover {\n border-color: var(--wx-border-strong);\n}\n\n.wx-select.is-open .wx-select__anchor {\n border-color: var(--wx-border-focus);\n}\n\n.wx-select--error .wx-select__anchor,\n.wx-select--error.is-open .wx-select__anchor {\n border-color: var(--wx-color-danger);\n}\n\n.wx-select--success .wx-select__anchor {\n border-color: var(--wx-color-success);\n}\n\n.wx-select--warning .wx-select__anchor {\n border-color: var(--wx-color-warning);\n}\n\n.wx-select.is-disabled .wx-select__anchor {\n background: var(--wx-bg-disabled);\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-select__value {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--wx-space-4);\n flex: 1 1 auto;\n min-width: 0;\n padding: var(--wx-space-4) 0;\n}\n\n.wx-select__single,\n.wx-select__placeholder {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.wx-select__placeholder {\n color: var(--wx-text-placeholder);\n}\n\n.wx-select__input {\n flex: 1 1 60px;\n min-width: 0;\n padding: 0;\n background: transparent;\n border: none;\n outline: none;\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n}\n\n.wx-select__input::placeholder {\n color: var(--wx-text-placeholder);\n}\n\n.wx-select__tag {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-4);\n padding: 2px var(--wx-space-6);\n background: var(--wx-bg-fill);\n border-radius: var(--wx-radius-xs);\n font-size: var(--wx-font-size-sm);\n line-height: var(--wx-font-line-height-tight);\n}\n\n.wx-select__tag-remove,\n.wx-select__clear {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n background: transparent;\n border: none;\n border-radius: var(--wx-radius-full);\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-xs);\n line-height: 1;\n cursor: pointer;\n}\n\n.wx-select__tag-remove:hover,\n.wx-select__clear:hover {\n color: var(--wx-text-default);\n}\n\n.wx-select__clear {\n flex: 0 0 auto;\n width: 18px;\n height: 18px;\n}\n\n.wx-select__toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 24px;\n height: 24px;\n padding: 0;\n background: transparent;\n border: none;\n color: var(--wx-text-muted);\n cursor: inherit;\n transition: transform var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-select__toggle svg {\n width: 16px;\n height: 16px;\n}\n\n.wx-select.is-open .wx-select__toggle {\n transform: rotate(180deg);\n}\n</style>\n\n<style>\n/* The list is teleported, so its styles cannot be scoped to the component. */\n.wx-select__content {\n z-index: var(--wx-z-index-dropdown);\n box-sizing: border-box;\n width: var(--reka-combobox-trigger-width);\n max-height: 280px;\n padding: var(--wx-space-4);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-sm);\n box-shadow: var(--wx-shadow-popover);\n color: var(--wx-text-default);\n font-family: var(--wx-font-family-sans);\n font-size: var(--wx-font-size-md);\n overflow: hidden;\n}\n\n.wx-select__viewport {\n max-height: 272px;\n overflow-y: auto;\n}\n\n.wx-select__option {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--wx-space-8);\n padding: var(--wx-space-6) var(--wx-space-10);\n border-radius: var(--wx-radius-xs);\n cursor: pointer;\n user-select: none;\n}\n\n.wx-select__option[data-highlighted] {\n background: var(--wx-bg-fill);\n outline: none;\n}\n\n.wx-select__option[data-state='checked'] {\n color: var(--wx-color-primary);\n font-weight: var(--wx-font-weight-medium);\n}\n\n.wx-select__option[data-disabled] {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-select__option-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.wx-select__check {\n display: inline-flex;\n flex: 0 0 auto;\n color: var(--wx-color-primary);\n}\n\n.wx-select__check svg {\n width: 16px;\n height: 16px;\n}\n\n.wx-select__empty {\n padding: var(--wx-space-10);\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-sm);\n text-align: center;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { SliderRange, SliderRoot, SliderThumb, SliderTrack } from 'reka-ui'\nimport { useFormField } from '../../composables/useFormField'\nimport type { SliderEmits, SliderModelValue, SliderProps } from './types'\n\ndefineOptions({ name: 'WxSlider', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<SliderProps>(), {\n min: 0,\n max: 100,\n step: 1,\n range: false,\n minStepsBetweenThumbs: 0,\n showValue: false,\n marks: undefined,\n disabled: undefined,\n size: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<SliderEmits>()\n\nconst model = defineModel<SliderModelValue>({ default: null })\n\nconst field = useFormField(props)\n\n/**\n * The underlying slider always works with an array. A single slider keeps a plain\n * number in the model, because that is what a caller wants to store.\n */\nconst values = computed<number[]>(() => {\n if (props.range) {\n const pair = Array.isArray(model.value) ? model.value : []\n return [pair[0] ?? props.min, pair[1] ?? props.max]\n }\n const single = Array.isArray(model.value) ? model.value[0] : model.value\n return [single ?? props.min]\n})\n\nfunction onUpdate(next: number[] | undefined) {\n if (!next) return\n const value = props.range ? [...next] : next[0]\n model.value = value\n emit('change', value)\n}\n\nconst marks = computed(() =>\n Object.entries(props.marks ?? {}).map(([value, label]) => ({\n value: Number(value),\n label,\n offset: ((Number(value) - props.min) / (props.max - props.min)) * 100,\n })),\n)\n\nconst classes = computed(() => [\n 'wx-slider',\n `wx-slider--${field.size.value}`,\n { 'is-disabled': field.disabled.value, 'is-range': props.range },\n])\n</script>\n\n<template>\n <div :class=\"classes\">\n <div class=\"wx-slider__row\">\n <slider-root\n :id=\"field.id.value\"\n v-bind=\"$attrs\"\n class=\"wx-slider__root\"\n :model-value=\"values\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :disabled=\"field.disabled.value\"\n :min-steps-between-thumbs=\"minStepsBetweenThumbs\"\n :name=\"name\"\n @update:model-value=\"onUpdate\"\n >\n <slider-track class=\"wx-slider__track\">\n <slider-range class=\"wx-slider__range\" />\n </slider-track>\n\n <slider-thumb\n v-for=\"index in values.length\"\n :key=\"index\"\n class=\"wx-slider__thumb\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n />\n </slider-root>\n\n <span v-if=\"showValue\" class=\"wx-slider__value\">\n {{ range ? `${values[0]} — ${values[1]}` : values[0] }}\n </span>\n </div>\n\n <div v-if=\"marks.length\" class=\"wx-slider__marks\" aria-hidden=\"true\">\n <span\n v-for=\"mark in marks\"\n :key=\"mark.value\"\n class=\"wx-slider__mark\"\n :style=\"{ left: `${mark.offset}%` }\"\n >\n {{ mark.label }}\n </span>\n </div>\n </div>\n</template>\n\n<style scoped>\n.wx-slider {\n display: block;\n width: 100%;\n}\n\n.wx-slider__row {\n display: flex;\n align-items: center;\n gap: var(--wx-space-16);\n}\n\n.wx-slider__root {\n position: relative;\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n height: var(--wx-size-control-md);\n touch-action: none;\n user-select: none;\n}\n\n.wx-slider--sm .wx-slider__root {\n height: var(--wx-size-control-sm);\n}\n\n.wx-slider--lg .wx-slider__root {\n height: var(--wx-size-control-lg);\n}\n\n.wx-slider__track {\n position: relative;\n flex: 1 1 auto;\n height: 4px;\n background: var(--wx-bg-fill-hover);\n border-radius: var(--wx-radius-full);\n}\n\n.wx-slider__range {\n position: absolute;\n height: 100%;\n background: var(--wx-color-primary);\n border-radius: var(--wx-radius-full);\n}\n\n.wx-slider__thumb {\n display: block;\n width: 18px;\n height: 18px;\n background: var(--wx-bg-surface);\n border: 2px solid var(--wx-color-primary);\n border-radius: var(--wx-radius-full);\n box-shadow: var(--wx-shadow-card);\n cursor: grab;\n transition: box-shadow var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-slider__thumb:focus-visible {\n outline: none;\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-slider__thumb:active {\n cursor: grabbing;\n}\n\n.wx-slider.is-disabled .wx-slider__range {\n background: var(--wx-color-primary-disabled);\n}\n\n.wx-slider.is-disabled .wx-slider__thumb {\n border-color: var(--wx-color-primary-disabled);\n cursor: not-allowed;\n}\n\n.wx-slider__value {\n flex: 0 0 auto;\n min-width: 4ch;\n color: var(--wx-text-default);\n font-size: var(--wx-font-size-sm);\n font-variant-numeric: tabular-nums;\n text-align: right;\n}\n\n.wx-slider__marks {\n position: relative;\n height: 18px;\n margin-top: calc(var(--wx-space-4) * -1);\n}\n\n.wx-slider__mark {\n position: absolute;\n transform: translateX(-50%);\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-xs);\n white-space: nowrap;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { useFormField, type ChoiceValue } from '../../composables/useFormField'\nimport type { SwitchEmits, SwitchProps } from './types'\n\ndefineOptions({ name: 'WxSwitch', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<SwitchProps>(), {\n activeValue: true,\n inactiveValue: false,\n label: undefined,\n disabled: undefined,\n size: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<SwitchEmits>()\n\nconst model = defineModel<ChoiceValue>({ default: false })\n\nconst field = useFormField(props)\n\nconst checked = computed(() => model.value === props.activeValue)\nconst size = computed(() => props.size ?? field.size.value)\n\nconst classes = computed(() => [\n 'wx-switch',\n `wx-switch--${size.value}`,\n { 'is-checked': checked.value, 'is-disabled': field.disabled.value },\n])\n\nfunction onChange(event: Event) {\n const next = (event.target as HTMLInputElement).checked ? props.activeValue : props.inactiveValue\n model.value = next\n emit('change', next)\n}\n</script>\n\n<template>\n <label :class=\"classes\">\n <input\n :id=\"field.id.value\"\n v-bind=\"$attrs\"\n class=\"wx-switch__native\"\n type=\"checkbox\"\n role=\"switch\"\n :name=\"name\"\n :checked=\"checked\"\n :disabled=\"field.disabled.value\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n @change=\"onChange\"\n />\n\n <span class=\"wx-switch__track\" aria-hidden=\"true\">\n <span class=\"wx-switch__thumb\" />\n </span>\n\n <span v-if=\"label || $slots.default\" class=\"wx-switch__label\">\n <slot>{{ label }}</slot>\n </span>\n </label>\n</template>\n\n<style scoped>\n.wx-switch {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-8);\n cursor: pointer;\n user-select: none;\n color: var(--wx-text-default);\n}\n\n.wx-switch.is-disabled {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-switch__native {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n}\n\n.wx-switch__track {\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n box-sizing: border-box;\n width: calc(var(--wx-switch-height) * 1.8);\n height: var(--wx-switch-height);\n padding: 2px;\n background: var(--wx-border-strong);\n border-radius: var(--wx-radius-full);\n transition:\n background-color var(--wx-duration-normal) var(--wx-easing-standard),\n box-shadow var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-switch--sm {\n --wx-switch-height: 18px;\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-switch--md {\n --wx-switch-height: 22px;\n font-size: var(--wx-font-size-md);\n}\n\n.wx-switch--lg {\n --wx-switch-height: 26px;\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-switch__thumb {\n width: calc(var(--wx-switch-height) - 4px);\n height: calc(var(--wx-switch-height) - 4px);\n background: var(--wx-bg-surface);\n border-radius: var(--wx-radius-full);\n box-shadow: var(--wx-shadow-card);\n transition: transform var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-switch.is-checked .wx-switch__track {\n background: var(--wx-color-primary);\n}\n\n.wx-switch.is-checked .wx-switch__thumb {\n transform: translateX(calc(var(--wx-switch-height) * 0.8));\n}\n\n.wx-switch.is-disabled .wx-switch__track {\n background: var(--wx-border-default);\n}\n\n.wx-switch.is-disabled.is-checked .wx-switch__track {\n background: var(--wx-color-primary-disabled);\n}\n\n.wx-switch__native:focus-visible + .wx-switch__track {\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-switch__label {\n line-height: var(--wx-font-line-height-normal);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wx-switch__track,\n .wx-switch__thumb {\n transition: none;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue'\nimport { useFormField } from '../../composables/useFormField'\nimport type { TagsInputEmits, TagsInputProps } from './types'\n\ndefineOptions({ name: 'WxTagsInput', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<TagsInputProps>(), {\n suggestions: () => [],\n placeholder: undefined,\n emptyText: 'Nothing found',\n max: undefined,\n duplicates: false,\n allowCreate: true,\n disabled: undefined,\n size: undefined,\n status: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<TagsInputEmits>()\n\nconst model = defineModel<string[]>({ default: () => [] })\n\nconst field = useFormField(props)\nconst inputRef = ref<HTMLInputElement | null>(null)\nconst text = ref('')\nconst open = ref(false)\nconst highlighted = ref(-1)\n/** The tag Backspace has marked; the next Backspace removes it. */\nconst armed = ref(-1)\n\nconst tags = computed(() => model.value ?? [])\n\nconst suggestions = computed(() =>\n props.suggestions.filter((suggestion) => !tags.value.includes(suggestion)),\n)\n\nconst showList = computed(() => open.value && suggestions.value.length > 0)\n\nconst full = computed(() => props.max !== undefined && tags.value.length >= props.max)\n\nconst classes = computed(() => [\n 'wx-tags-input',\n `wx-tags-input--${field.size.value}`,\n {\n [`wx-tags-input--${field.status.value}`]: field.status.value !== 'default',\n 'is-open': showList.value,\n 'is-disabled': field.disabled.value,\n },\n])\n\nwatch(suggestions, () => {\n highlighted.value = -1\n})\n\nfunction commit(next: string[]) {\n model.value = next\n emit('change', next)\n}\n\nfunction add(tag: string) {\n const value = tag.trim()\n if (!value || full.value) return\n if (!props.duplicates && tags.value.includes(value)) {\n text.value = ''\n return\n }\n commit([...tags.value, value])\n text.value = ''\n open.value = false\n armed.value = -1\n}\n\nfunction remove(index: number) {\n commit(tags.value.filter((_, position) => position !== index))\n armed.value = -1\n}\n\nfunction onInput(event: Event) {\n const value = (event.target as HTMLInputElement).value\n text.value = value\n armed.value = -1\n highlighted.value = -1\n if (value) open.value = true\n emit('search', value)\n}\n\n/**\n * Backspace on an empty field marks the last tag first and removes it on the second\n * press — deleting something the user cannot see would be worse than one extra key.\n */\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n open.value = false\n armed.value = -1\n return\n }\n\n if (event.key === 'Backspace' && text.value === '' && tags.value.length > 0) {\n event.preventDefault()\n if (armed.value === tags.value.length - 1) remove(armed.value)\n else armed.value = tags.value.length - 1\n return\n }\n\n if (event.key === 'ArrowDown' && showList.value) {\n event.preventDefault()\n highlighted.value = (highlighted.value + 1) % suggestions.value.length\n return\n }\n\n if (event.key === 'ArrowUp' && showList.value) {\n event.preventDefault()\n highlighted.value =\n highlighted.value <= 0 ? suggestions.value.length - 1 : highlighted.value - 1\n return\n }\n\n if (event.key === 'Enter') {\n event.preventDefault()\n if (showList.value && highlighted.value >= 0) add(suggestions.value[highlighted.value])\n else if (props.allowCreate) add(text.value)\n }\n}\n\nfunction onBlur() {\n armed.value = -1\n // Let a click on a suggestion land before the list disappears.\n window.setTimeout(() => {\n open.value = false\n }, 120)\n}\n\ndefineExpose({ focus: () => inputRef.value?.focus() })\n</script>\n\n<template>\n <div :class=\"classes\">\n <div class=\"wx-tags-input__anchor\" @click=\"inputRef?.focus()\">\n <span\n v-for=\"(tag, index) in tags\"\n :key=\"tag\"\n class=\"wx-tags-input__tag\"\n :class=\"{ 'is-armed': index === armed }\"\n >\n {{ tag }}\n <button\n v-if=\"!field.disabled.value\"\n class=\"wx-tags-input__remove\"\n type=\"button\"\n tabindex=\"-1\"\n :aria-label=\"`Remove ${tag}`\"\n @click.stop=\"remove(index)\"\n >\n ✕\n </button>\n </span>\n\n <input\n :id=\"field.id.value\"\n ref=\"inputRef\"\n v-bind=\"$attrs\"\n class=\"wx-tags-input__field\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n :value=\"text\"\n :placeholder=\"placeholder\"\n :disabled=\"field.disabled.value\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n :aria-invalid=\"field.status.value === 'error' || undefined\"\n :aria-expanded=\"showList\"\n @input=\"onInput\"\n @keydown=\"onKeydown\"\n @focus=\"open = true\"\n @blur=\"onBlur\"\n />\n\n <ul v-if=\"showList\" class=\"wx-tags-input__list\" role=\"listbox\">\n <li\n v-for=\"(suggestion, index) in suggestions\"\n :key=\"suggestion\"\n class=\"wx-tags-input__option\"\n :class=\"{ 'is-highlighted': index === highlighted }\"\n role=\"option\"\n :aria-selected=\"index === highlighted\"\n @mousedown.prevent=\"add(suggestion)\"\n @mousemove=\"highlighted = index\"\n >\n {{ suggestion }}\n </li>\n </ul>\n </div>\n\n <select v-if=\"name\" class=\"wx-sr-only\" :name=\"name\" multiple tabindex=\"-1\" aria-hidden=\"true\">\n <option v-for=\"tag in tags\" :key=\"tag\" :value=\"tag\" selected>{{ tag }}</option>\n </select>\n </div>\n</template>\n\n<style scoped>\n.wx-tags-input {\n display: block;\n width: 100%;\n}\n\n.wx-tags-input__anchor {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--wx-space-4);\n box-sizing: border-box;\n min-height: var(--wx-size-control-md);\n padding: var(--wx-space-4) var(--wx-space-10);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-control);\n color: var(--wx-text-default);\n font-size: var(--wx-font-size-md);\n cursor: text;\n transition: border-color var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-tags-input--sm .wx-tags-input__anchor {\n min-height: var(--wx-size-control-sm);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-tags-input--lg .wx-tags-input__anchor {\n min-height: var(--wx-size-control-lg);\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-tags-input__anchor:hover {\n border-color: var(--wx-border-strong);\n}\n\n.wx-tags-input__anchor:focus-within {\n border-color: var(--wx-border-focus);\n}\n\n.wx-tags-input--error .wx-tags-input__anchor {\n border-color: var(--wx-color-danger);\n}\n\n.wx-tags-input--success .wx-tags-input__anchor {\n border-color: var(--wx-color-success);\n}\n\n.wx-tags-input--warning .wx-tags-input__anchor {\n border-color: var(--wx-color-warning);\n}\n\n.wx-tags-input.is-disabled .wx-tags-input__anchor {\n background: var(--wx-bg-disabled);\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-tags-input__tag {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-4);\n padding: 2px var(--wx-space-6);\n background: var(--wx-bg-fill);\n border-radius: var(--wx-radius-xs);\n font-size: var(--wx-font-size-sm);\n line-height: var(--wx-font-line-height-tight);\n}\n\n.wx-tags-input__tag.is-armed {\n background: var(--wx-color-danger-soft);\n color: var(--wx-color-danger);\n}\n\n.wx-tags-input__remove {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n background: transparent;\n border: none;\n color: currentcolor;\n font-size: var(--wx-font-size-xs);\n line-height: 1;\n opacity: 0.65;\n cursor: pointer;\n}\n\n.wx-tags-input__remove:hover {\n opacity: 1;\n}\n\n.wx-tags-input__field {\n flex: 1 1 80px;\n min-width: 0;\n padding: 0;\n background: transparent;\n border: none;\n outline: none;\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n}\n\n.wx-tags-input__field::placeholder {\n color: var(--wx-text-placeholder);\n}\n\n.wx-tags-input__list {\n position: absolute;\n top: calc(100% + var(--wx-space-4));\n left: 0;\n right: 0;\n z-index: var(--wx-z-index-dropdown);\n max-height: 220px;\n margin: 0;\n padding: var(--wx-space-4);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-sm);\n box-shadow: var(--wx-shadow-popover);\n list-style: none;\n overflow-y: auto;\n}\n\n.wx-tags-input__option {\n padding: var(--wx-space-6) var(--wx-space-10);\n border-radius: var(--wx-radius-xs);\n cursor: pointer;\n}\n\n.wx-tags-input__option.is-highlighted {\n background: var(--wx-bg-fill);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, ref, watch } from 'vue'\nimport { useFormField } from '../../composables/useFormField'\nimport type { TextareaEmits, TextareaModelValue, TextareaProps } from './types'\n\ndefineOptions({ name: 'WxTextarea', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<TextareaProps>(), {\n size: undefined,\n status: undefined,\n id: undefined,\n placeholder: undefined,\n disabled: undefined,\n readonly: false,\n rows: 3,\n autosize: false,\n maxlength: undefined,\n showCount: false,\n resize: 'vertical',\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<TextareaEmits>()\n\nconst model = defineModel<TextareaModelValue>({ default: '' })\n\nconst field = useFormField(props)\nconst textareaRef = ref<HTMLTextAreaElement | null>(null)\nconst focused = ref(false)\n\nconst currentValue = computed(() => model.value ?? '')\n\nconst counter = computed(() =>\n props.showCount && props.maxlength ? `${currentValue.value.length}/${props.maxlength}` : null,\n)\n\nconst autosizeOptions = computed(() =>\n props.autosize === true ? {} : props.autosize === false ? null : props.autosize,\n)\n\nconst classes = computed(() => [\n 'wx-textarea',\n `wx-textarea--${field.size.value}`,\n {\n [`wx-textarea--${field.status.value}`]: field.status.value !== 'default',\n 'is-focused': focused.value,\n 'is-disabled': field.disabled.value,\n 'is-readonly': props.readonly,\n 'is-autosize': Boolean(autosizeOptions.value),\n },\n])\n\n/** Grows the field to fit its content, clamped by minRows / maxRows. */\nfunction syncHeight() {\n const options = autosizeOptions.value\n const el = textareaRef.value\n if (!options || !el) return\n\n el.style.height = 'auto'\n const styles = getComputedStyle(el)\n const lineHeight = Number.parseFloat(styles.lineHeight) || 20\n const vertical =\n Number.parseFloat(styles.paddingTop) +\n Number.parseFloat(styles.paddingBottom) +\n Number.parseFloat(styles.borderTopWidth) +\n Number.parseFloat(styles.borderBottomWidth)\n\n let height = el.scrollHeight\n if (options.minRows) height = Math.max(height, options.minRows * lineHeight + vertical)\n if (options.maxRows) height = Math.min(height, options.maxRows * lineHeight + vertical)\n\n el.style.height = `${height}px`\n el.style.overflowY = options.maxRows && el.scrollHeight > height ? 'auto' : 'hidden'\n}\n\nonMounted(() => nextTick(syncHeight))\nwatch([currentValue, autosizeOptions], () => nextTick(syncHeight))\n\nfunction onInput(event: Event) {\n const value = (event.target as HTMLTextAreaElement).value\n model.value = value\n emit('input', value)\n}\n\nfunction onChange(event: Event) {\n emit('change', (event.target as HTMLTextAreaElement).value)\n}\n\nfunction onFocus(event: FocusEvent) {\n focused.value = true\n emit('focus', event)\n}\n\nfunction onBlur(event: FocusEvent) {\n focused.value = false\n emit('blur', event)\n}\n\ndefineExpose({\n focus: () => textareaRef.value?.focus(),\n blur: () => textareaRef.value?.blur(),\n select: () => textareaRef.value?.select(),\n textarea: textareaRef,\n})\n</script>\n\n<template>\n <div :class=\"classes\">\n <textarea\n :id=\"field.id.value\"\n ref=\"textareaRef\"\n v-bind=\"$attrs\"\n class=\"wx-textarea__inner\"\n :value=\"currentValue\"\n :rows=\"rows\"\n :placeholder=\"placeholder\"\n :disabled=\"field.disabled.value\"\n :readonly=\"readonly\"\n :maxlength=\"maxlength\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n :aria-invalid=\"field.status.value === 'error' || undefined\"\n :style=\"{ resize }\"\n @input=\"onInput\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n />\n\n <span v-if=\"counter\" class=\"wx-textarea__count\">{{ counter }}</span>\n </div>\n</template>\n\n<style scoped>\n.wx-textarea {\n position: relative;\n display: block;\n box-sizing: border-box;\n width: 100%;\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-control);\n color: var(--wx-text-default);\n transition:\n border-color var(--wx-duration-normal) var(--wx-easing-standard),\n background-color var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-textarea:hover:not(.is-disabled) {\n border-color: var(--wx-border-strong);\n}\n\n.wx-textarea.is-focused {\n border-color: var(--wx-border-focus);\n}\n\n.wx-textarea--error,\n.wx-textarea--error.is-focused {\n border-color: var(--wx-color-danger);\n}\n\n.wx-textarea--success,\n.wx-textarea--success.is-focused {\n border-color: var(--wx-color-success);\n}\n\n.wx-textarea--warning,\n.wx-textarea--warning.is-focused {\n border-color: var(--wx-color-warning);\n}\n\n.wx-textarea.is-disabled {\n background: var(--wx-bg-disabled);\n color: var(--wx-text-disabled);\n}\n\n.wx-textarea__inner {\n display: block;\n box-sizing: border-box;\n width: 100%;\n margin: 0;\n padding: var(--wx-space-8) var(--wx-space-12);\n background: transparent;\n border: none;\n outline: none;\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n line-height: var(--wx-font-line-height-normal);\n}\n\n.wx-textarea--sm {\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-textarea--md {\n font-size: var(--wx-font-size-md);\n}\n\n.wx-textarea--lg {\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-textarea.is-autosize .wx-textarea__inner {\n resize: none !important;\n overflow-y: hidden;\n}\n\n.wx-textarea__inner::placeholder {\n color: var(--wx-text-placeholder);\n}\n\n.wx-textarea__inner:disabled {\n cursor: not-allowed;\n}\n\n.wx-textarea__count {\n position: absolute;\n right: var(--wx-space-8);\n bottom: var(--wx-space-4);\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-xs);\n font-variant-numeric: tabular-nums;\n pointer-events: none;\n}\n</style>\n","<script setup lang=\"ts\">\nimport WxDatePicker from '../DatePicker/DatePicker.vue'\nimport type { DatePickerModelValue, DatePickerProps } from '../DatePicker/types'\n\ndefineOptions({ name: 'WxTimePicker' })\n\n/**\n * Every prop defaults to `undefined` on purpose. Vue casts an absent boolean prop\n * to `false`, and this preset forwards its whole prop object — without these the\n * preset would hand `WxDatePicker` an explicit `false` for `is24`, `clearable`,\n * `autoApply` and `teleport`, overriding that component's own defaults. Passing\n * `undefined` lets each default apply as if the prop had never been written.\n */\nwithDefaults(defineProps<Omit<DatePickerProps, 'type'>>(), {\n valueFormat: undefined,\n format: undefined,\n placeholder: undefined,\n clearable: undefined,\n minDate: undefined,\n maxDate: undefined,\n seconds: undefined,\n minutesIncrement: undefined,\n is24: undefined,\n weekStart: undefined,\n autoApply: undefined,\n textInput: undefined,\n teleport: undefined,\n disabled: undefined,\n readonly: undefined,\n size: undefined,\n status: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst model = defineModel<DatePickerModelValue>({ default: null })\n</script>\n\n<template>\n <wx-date-picker v-model=\"model\" type=\"time\" v-bind=\"$props\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps ?? {}\" />\n </template>\n </wx-date-picker>\n</template>\n","import type { App, Plugin } from 'vue'\nimport * as components from './components'\n\nexport interface WebxUiOptions {\n /**\n * Prefix used when registering components globally.\n * Components are declared as `WxButton`, so the default keeps that name.\n */\n prefix?: string\n}\n\n/**\n * Registers every component globally:\n *\n * ```ts\n * import { WebxUI } from '@webx-ui/core'\n * import '@webx-ui/core/style.css'\n *\n * app.use(WebxUI)\n * ```\n *\n * Prefer named imports when bundle size matters — they tree-shake.\n */\nexport const WebxUI: Plugin<[WebxUiOptions?]> = {\n install(app: App, options: WebxUiOptions = {}) {\n const { prefix = 'Wx' } = options\n\n for (const [name, component] of Object.entries(components)) {\n if (!name.startsWith('Wx')) continue\n const registeredName = prefix === 'Wx' ? name : `${prefix}${name.slice(2)}`\n app.component(registeredName, component)\n }\n },\n}\n\nexport default WebxUI\n"],"names":["props","__props","emit","__emit","isDisabled","computed","tag","classes","nativeAttrs","onClick","event","_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","$attrs","_createElementBlock","_hoisted_1","$slots","_hoisted_2","_renderSlot","_ctx","_hoisted_3","slots","useSlots","hasHeader","hasSidebar","_createElementVNode","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","formContextKey","formItemContextKey","uid","useId","prefix","useFormField","form","inject","item","fallbackId","id","disabled","size","status","describedBy","checkboxGroupKey","radioGroupKey","provideFormItem","context","provide","model","_useModel","group","field","inputRef","ref","checked","syncIndeterminate","onMounted","watch","onChange","next","_unref","toggle","value","current","_Fragment","_renderList","option","WxCheckbox","HEX","open","text","toWorking","hex","convertToHsb","parseColor","working","colorToHex","areaStyle","getAreaBackgroundStyle","hueStyle","getSliderBackgroundStyle","swatch","commit","onInput","onBlur","candidate","onColor","color","onHex","clear","openPicker","PopoverRoot","$event","_createVNode","PopoverAnchor","_normalizeClass","_normalizeStyle","PopoverPortal","PopoverContent","ColorAreaRoot","ColorAreaArea","ColorAreaThumb","ColorSliderRoot","ColorSliderTrack","ColorSliderThumb","preset","hasTime","modelType","displayFormat","time","config","timeConfig","inputAttrs","onUpdate","onCleared","_","name","_withCtx","slotProps","_normalizeProps","_guardReactiveProps","WxDatePicker","$props","_createSlots","errors","toRef","onSubmit","onReset","baseId","errorId","helpId","labelMode","controlId","registerLabelTarget","messages","hasError","labelWidth","isInline","__expose","focused","currentValue","showClear","counter","onFocus","_toDisplayString","precision","decimals","round","factor","clamp","display","canDecrease","canIncrease","stepBy","direction","base","parsed","normalize","onWheel","onKeydown","fallbackName","WxRadio","hovered","interactive","shown","stars","index","position","fill","valueAt","target","left","width","set","onHover","step","star","richTextIcons","$emit","DEFAULT_TOOLS","DEFAULT_ACCEPT","TOOL_META","TABLE_TOOLS","uploading","fileInput","prompt","editable","readHtml","instance","editor","useEditor","StarterKit","TableKit","Image","Youtube","FileHandler","_editor","files","pos","uploadFiles","html","isEmpty","inTable","insertImage","url","alt","at","file","result","error","onImageButton","onFilePicked","input","openPrompt","kind","applyPrompt","toolVisible","tool","visibleTools","isActive","run","chain","runTableCommand","key","WxRichTextToolbarButton","_cache","_vModelText","EditorContent","searchText","selection","labelOf","selectedOptions","singleLabel","hasSelection","openList","displayValue","onSearch","removeTag","ComboboxRoot","ComboboxAnchor","_withModifiers","ComboboxTrigger","ComboboxPortal","ComboboxContent","ComboboxViewport","ComboboxEmpty","ComboboxItem","ComboboxItemIndicator","values","pair","marks","label","SliderTrack","SliderRange","SliderThumb","mark","highlighted","armed","tags","suggestions","suggestion","showList","full","add","remove","_createTextVNode","textareaRef","autosizeOptions","syncHeight","options","el","styles","lineHeight","vertical","height","nextTick","WebxUI","app","component","components","registeredName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,UAAMA,IAAQC,GAaRC,IAAOC,GAEPC,IAAaC,EAAS,MAAML,EAAM,YAAYA,EAAM,OAAO,GAC3DM,IAAMD,EAAS,MAAOL,EAAM,OAAO,MAAM,QAAS,GAElDO,IAAUF,EAAS,MAAM;AAAA,MAC7B;AAAA,MACA,cAAcL,EAAM,IAAI;AAAA,MACxB,cAAcA,EAAM,OAAO;AAAA,MAC3B,cAAcA,EAAM,IAAI;AAAA,MACxB;AAAA,QACE,oBAAoBA,EAAM;AAAA,QAC1B,oBAAoBA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,qBAAqB;AAAA,QAChD,iBAASvD,EAAA,OAAA;AAAA,QACT,SAAAuF;AAAA,QACA,UAAAzB;AAAA,QACA,SAAAqF;AAAA,QACA,QAAA3D;AAAA,MAAA;MAGS0D,EAAA,cAAZnI,EAAoE,QAApEG,IAAoEkI,EAAjBF,EAAA,KAAO,GAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7F9D,UAAM9F,IAAQC,EAAiCrD,GAAA,YAAkB;sBAI/DU,EAAA,GAAAC,EAIiBkH,IAJjBhH,EAIiB;AAAA,kBAJQuC,EAAA;AAAA,oDAAAA,EAAK,QAAA4C;AAAA,MAAE,MAAK;AAAA,IAAA,GAAe8B,EAAAA,MAAM,GAAAC,GAAA,EAAA,GAAA,KAAA;AAAA,QAC1B9G,EAAAA,QAAM,CAAlBsG,GAAGC;;QACnB,IAAAC,EAAA,CAD6CC,MAAS;AAAA,UACtDvG,EAA8CC,EAAA,QAAjCoG,GAAIG,GAAAC,GAAUF,KAAS,CAAA,CAAA,CAAA,CAAA;AAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CCnB7B8J,KAAmC;AAAA,EAC9C,QAAQC,GAAUR,IAAyB,IAAI;AAC7C,UAAM,EAAE,QAAA7O,IAAS,KAAA,IAAS6O;AAE1B,eAAW,CAACzJ,GAAMkK,CAAS,KAAK,OAAO,QAAQC,EAAU,GAAG;AAC1D,UAAI,CAACnK,EAAK,WAAW,IAAI,EAAG;AAC5B,YAAMoK,IAAiBxP,MAAW,OAAOoF,IAAO,GAAGpF,CAAM,GAAGoF,EAAK,MAAM,CAAC,CAAC;AACzE,MAAAiK,EAAI,UAAUG,GAAgBF,CAAS;AAAA,IACzC;AAAA,EACF;AACF;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/components/Button/Button.vue","../src/components/Card/Card.vue","../src/composables/useFormField.ts","../src/components/Checkbox/Checkbox.vue","../src/components/CheckboxGroup/CheckboxGroup.vue","../src/components/ColorPicker/ColorPicker.vue","../src/components/DatePicker/DatePicker.vue","../src/components/DateRangePicker/DateRangePicker.vue","../src/components/DateTimePicker/DateTimePicker.vue","../src/components/Form/Form.vue","../src/components/FormItem/FormItem.vue","../src/components/Input/Input.vue","../src/components/InputNumber/InputNumber.vue","../src/components/Pagination/Pagination.vue","../src/components/Radio/Radio.vue","../src/components/RadioGroup/RadioGroup.vue","../src/components/Rate/Rate.vue","../src/components/RichText/icons.ts","../src/components/RichText/ToolbarButton.vue","../src/components/RichText/tools.ts","../src/components/RichText/RichText.vue","../src/components/Select/Select.vue","../src/components/Slider/Slider.vue","../src/components/Switch/Switch.vue","../src/components/Table/Table.vue","../src/components/TagsInput/TagsInput.vue","../src/components/Textarea/Textarea.vue","../src/components/TimePicker/TimePicker.vue","../src/plugin.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport type { ButtonEmits, ButtonProps } from './types'\n\ndefineOptions({ name: 'WxButton', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n type: 'default',\n variant: 'solid',\n size: 'md',\n disabled: false,\n loading: false,\n block: false,\n round: false,\n href: undefined,\n target: undefined,\n nativeType: 'button',\n})\n\nconst emit = defineEmits<ButtonEmits>()\n\nconst isDisabled = computed(() => props.disabled || props.loading)\nconst tag = computed(() => (props.href ? 'a' : 'button'))\n\nconst classes = computed(() => [\n 'wx-button',\n `wx-button--${props.type}`,\n `wx-button--${props.variant}`,\n `wx-button--${props.size}`,\n {\n 'wx-button--block': props.block,\n 'wx-button--round': props.round,\n 'wx-button--loading': props.loading,\n 'is-disabled': isDisabled.value,\n },\n])\n\nconst nativeAttrs = computed(() =>\n props.href\n ? {\n href: isDisabled.value ? undefined : props.href,\n target: props.target,\n role: 'button',\n 'aria-disabled': isDisabled.value ? 'true' : undefined,\n tabindex: isDisabled.value ? -1 : undefined,\n }\n : {\n type: props.nativeType,\n disabled: isDisabled.value,\n },\n)\n\nfunction onClick(event: MouseEvent) {\n if (isDisabled.value) {\n event.preventDefault()\n event.stopPropagation()\n return\n }\n emit('click', event)\n}\n</script>\n\n<template>\n <component\n :is=\"tag\"\n v-bind=\"{ ...nativeAttrs, ...$attrs }\"\n :class=\"classes\"\n :aria-busy=\"loading || undefined\"\n @click=\"onClick\"\n >\n <span v-if=\"loading\" class=\"wx-button__spinner\" aria-hidden=\"true\" />\n <span v-else-if=\"$slots.icon\" class=\"wx-button__icon\">\n <slot name=\"icon\" />\n </span>\n <span v-if=\"$slots.default\" class=\"wx-button__label\">\n <slot />\n </span>\n </component>\n</template>\n\n<style scoped>\n.wx-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--wx-space-8);\n box-sizing: border-box;\n border: 1px solid transparent;\n border-radius: var(--wx-radius-control);\n font-family: inherit;\n font-weight: var(--wx-font-weight-semibold);\n line-height: var(--wx-font-line-height-tight);\n text-decoration: none;\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n transition:\n background-color var(--wx-duration-normal) var(--wx-easing-standard),\n border-color var(--wx-duration-normal) var(--wx-easing-standard),\n color var(--wx-duration-normal) var(--wx-easing-standard),\n box-shadow var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-button:focus-visible {\n outline: none;\n box-shadow: var(--wx-ring-focus);\n}\n\n/* sizes */\n.wx-button--sm {\n height: var(--wx-size-control-sm);\n padding: 0 var(--wx-space-12);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-button--md {\n height: var(--wx-size-control-md);\n padding: 0 var(--wx-space-18);\n font-size: var(--wx-font-size-md);\n}\n\n.wx-button--lg {\n height: var(--wx-size-control-lg);\n padding: 0 var(--wx-space-24);\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-button--block {\n display: flex;\n width: 100%;\n}\n\n.wx-button--round {\n border-radius: var(--wx-radius-full);\n}\n\n/*\n * Each type exposes its own palette through local variables, so the variant rules\n * below stay type-agnostic.\n */\n.wx-button--default {\n --wx-button-bg: var(--wx-bg-surface);\n --wx-button-bg-hover: var(--wx-bg-fill);\n --wx-button-bg-active: var(--wx-bg-fill-hover);\n --wx-button-bg-disabled: var(--wx-bg-surface);\n --wx-button-fg: var(--wx-text-default);\n --wx-button-border: var(--wx-border-default);\n}\n\n.wx-button--primary {\n --wx-button-bg: var(--wx-color-primary);\n --wx-button-bg-hover: var(--wx-color-primary-hover);\n --wx-button-bg-active: var(--wx-color-primary-active);\n --wx-button-bg-disabled: var(--wx-color-primary-disabled);\n --wx-button-fg: var(--wx-color-primary-contrast);\n --wx-button-border: var(--wx-color-primary);\n --wx-button-accent: var(--wx-color-primary);\n --wx-button-soft: var(--wx-color-primary-soft);\n}\n\n.wx-button--success {\n --wx-button-bg: var(--wx-color-success);\n --wx-button-bg-hover: var(--wx-color-success-hover);\n --wx-button-bg-active: var(--wx-color-success-active);\n --wx-button-bg-disabled: var(--wx-color-success-disabled);\n --wx-button-fg: var(--wx-color-success-contrast);\n --wx-button-border: var(--wx-color-success);\n --wx-button-accent: var(--wx-color-success);\n --wx-button-soft: var(--wx-color-success-soft);\n}\n\n.wx-button--warning {\n --wx-button-bg: var(--wx-color-warning);\n --wx-button-bg-hover: var(--wx-color-warning-hover);\n --wx-button-bg-active: var(--wx-color-warning-active);\n --wx-button-bg-disabled: var(--wx-color-warning-disabled);\n --wx-button-fg: var(--wx-color-warning-contrast);\n --wx-button-border: var(--wx-color-warning);\n --wx-button-accent: var(--wx-color-warning);\n --wx-button-soft: var(--wx-color-warning-soft);\n}\n\n.wx-button--danger {\n --wx-button-bg: var(--wx-color-danger);\n --wx-button-bg-hover: var(--wx-color-danger-hover);\n --wx-button-bg-active: var(--wx-color-danger-active);\n --wx-button-bg-disabled: var(--wx-color-danger-disabled);\n --wx-button-fg: var(--wx-color-danger-contrast);\n --wx-button-border: var(--wx-color-danger);\n --wx-button-accent: var(--wx-color-danger);\n --wx-button-soft: var(--wx-color-danger-soft);\n}\n\n/* solid */\n.wx-button--solid {\n background: var(--wx-button-bg);\n border-color: var(--wx-button-border);\n color: var(--wx-button-fg);\n}\n\n.wx-button--solid:hover:not(.is-disabled) {\n background: var(--wx-button-bg-hover);\n border-color: var(--wx-button-bg-hover);\n}\n\n.wx-button--solid:active:not(.is-disabled) {\n background: var(--wx-button-bg-active);\n border-color: var(--wx-button-bg-active);\n}\n\n.wx-button--solid.is-disabled {\n background: var(--wx-button-bg-disabled);\n border-color: var(--wx-button-bg-disabled);\n}\n\n.wx-button--solid.wx-button--default.is-disabled {\n border-color: var(--wx-border-default);\n color: var(--wx-text-disabled);\n}\n\n/* outline */\n.wx-button--outline {\n background: transparent;\n border-color: var(--wx-button-accent, var(--wx-border-default));\n color: var(--wx-button-accent, var(--wx-text-default));\n}\n\n.wx-button--outline:hover:not(.is-disabled) {\n background: var(--wx-button-soft, var(--wx-bg-fill));\n}\n\n.wx-button--outline:active:not(.is-disabled) {\n border-color: var(--wx-button-bg-active);\n color: var(--wx-button-bg-active);\n}\n\n.wx-button--outline.is-disabled {\n border-color: var(--wx-button-bg-disabled);\n color: var(--wx-button-bg-disabled);\n}\n\n/* text */\n.wx-button--text {\n background: transparent;\n border-color: transparent;\n color: var(--wx-button-accent, var(--wx-text-default));\n}\n\n.wx-button--text:hover:not(.is-disabled) {\n background: var(--wx-bg-fill);\n}\n\n.wx-button--text:active:not(.is-disabled) {\n background: var(--wx-bg-fill-hover);\n}\n\n.wx-button--text.is-disabled {\n color: var(--wx-text-disabled);\n}\n\n/* states */\n.wx-button.is-disabled {\n cursor: not-allowed;\n}\n\n.wx-button--loading {\n cursor: progress;\n}\n\n.wx-button__spinner {\n width: 1em;\n height: 1em;\n border: 2px solid currentcolor;\n border-right-color: transparent;\n border-radius: var(--wx-radius-full);\n animation: wx-button-spin var(--wx-duration-slow) linear infinite;\n}\n\n.wx-button__icon {\n display: inline-flex;\n align-items: center;\n}\n\n@keyframes wx-button-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wx-button {\n transition: none;\n }\n\n .wx-button__spinner {\n animation-duration: 2s;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue'\nimport type { CardProps } from './types'\n\ndefineOptions({ name: 'WxCard' })\n\nconst props = withDefaults(defineProps<CardProps>(), {\n title: undefined,\n shadow: 'always',\n padding: 'md',\n bordered: false,\n})\n\nconst slots = useSlots()\n\nconst hasHeader = computed(() => Boolean(props.title || slots.header || slots.extra))\nconst hasSidebar = computed(() => Boolean(slots.sidebar))\n\nconst classes = computed(() => [\n 'wx-card',\n `wx-card--shadow-${props.shadow}`,\n `wx-card--padding-${props.padding}`,\n {\n 'wx-card--bordered': props.bordered,\n 'wx-card--with-sidebar': hasSidebar.value,\n },\n])\n</script>\n\n<template>\n <section :class=\"classes\">\n <header v-if=\"hasHeader\" class=\"wx-card__header\">\n <div class=\"wx-card__title\">\n <slot name=\"header\">{{ title }}</slot>\n </div>\n <div v-if=\"$slots.extra\" class=\"wx-card__extra\">\n <slot name=\"extra\" />\n </div>\n </header>\n\n <div class=\"wx-card__body\">\n <div v-if=\"hasSidebar\" class=\"wx-card__layout\">\n <aside class=\"wx-card__sidebar\">\n <slot name=\"sidebar\" />\n </aside>\n <div class=\"wx-card__content\">\n <slot />\n </div>\n </div>\n <slot v-else />\n </div>\n\n <footer v-if=\"$slots.footer\" class=\"wx-card__footer\">\n <slot name=\"footer\" />\n </footer>\n </section>\n</template>\n\n<style scoped>\n.wx-card {\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n background: var(--wx-bg-surface);\n border: 1px solid transparent;\n border-radius: var(--wx-radius-md);\n color: var(--wx-text-default);\n transition: box-shadow var(--wx-duration-normal) var(--wx-easing-standard);\n /* The sidebar layout reacts to the card's own width, not the viewport's. */\n container-type: inline-size;\n}\n\n.wx-card--bordered {\n border-color: var(--wx-border-default);\n}\n\n.wx-card--shadow-always {\n box-shadow: var(--wx-shadow-card);\n}\n\n.wx-card--shadow-hover:hover {\n box-shadow: var(--wx-shadow-card);\n}\n\n.wx-card__header,\n.wx-card__body,\n.wx-card__footer {\n padding: var(--wx-card-padding, var(--wx-space-16));\n}\n\n.wx-card--padding-none {\n --wx-card-padding: 0px;\n}\n\n.wx-card--padding-sm {\n --wx-card-padding: var(--wx-space-12);\n}\n\n.wx-card--padding-md {\n --wx-card-padding: var(--wx-space-16);\n}\n\n.wx-card--padding-lg {\n --wx-card-padding: var(--wx-space-24);\n}\n\n.wx-card__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--wx-space-16);\n padding-bottom: 0;\n}\n\n.wx-card__title {\n min-width: 0;\n color: var(--wx-text-strong);\n font-size: var(--wx-font-size-lg);\n font-weight: var(--wx-font-weight-semibold);\n line-height: var(--wx-font-line-height-tight);\n}\n\n.wx-card__extra {\n flex: 0 0 auto;\n color: var(--wx-text-muted);\n}\n\n.wx-card__body {\n flex: 1 1 auto;\n}\n\n.wx-card__footer {\n padding-top: 0;\n}\n\n/* Sidebar layout: stacked by default, two columns once the card is wide enough. */\n.wx-card__layout {\n display: flex;\n flex-direction: column;\n gap: var(--wx-card-padding, var(--wx-space-16));\n}\n\n.wx-card__sidebar,\n.wx-card__content {\n min-width: 0;\n}\n\n.wx-card__content {\n flex: 1 1 auto;\n}\n\n@container (min-width: 560px) {\n .wx-card__layout {\n flex-direction: row;\n }\n\n .wx-card__sidebar {\n flex: 0 0 auto;\n width: var(--wx-card-sidebar-width, 240px);\n }\n}\n</style>\n","import { computed, inject, provide, type ComputedRef, type InjectionKey, type Ref } from 'vue'\n\nexport type ControlSize = 'sm' | 'md' | 'lg'\nexport type ControlStatus = 'default' | 'success' | 'warning' | 'error'\n\n/** Field name -> messages, the shape Laravel returns on a 422. */\nexport type ValidationErrors = Record<string, string[]>\n\nexport interface FormContext {\n /** Server-side errors, keyed by field name. */\n errors: Ref<ValidationErrors>\n disabled: Ref<boolean>\n size: Ref<ControlSize>\n labelPosition: Ref<'top' | 'left'>\n labelWidth: Ref<string | undefined>\n}\n\nexport interface FormItemContext {\n /** Id given to the control, so the label's `for` matches. */\n id: ComputedRef<string>\n /** Ids of the help and error nodes, for `aria-describedby`. */\n describedBy: ComputedRef<string | undefined>\n status: ComputedRef<ControlStatus>\n disabled: ComputedRef<boolean>\n size: ComputedRef<ControlSize | undefined>\n /** Set by grouped controls so the label points at the group, not one input. */\n registerLabelTarget: (id: string | undefined) => void\n}\n\nexport const formContextKey: InjectionKey<FormContext> = Symbol('wx-form')\nexport const formItemContextKey: InjectionKey<FormItemContext> = Symbol('wx-form-item')\n\nlet uid = 0\nexport function useId(prefix = 'wx'): string {\n uid += 1\n return `${prefix}-${uid}`\n}\n\nexport interface FormFieldProps {\n disabled?: boolean\n size?: ControlSize\n status?: ControlStatus\n id?: string\n}\n\n/**\n * Resolves what a control should render as, given its own props, the enclosing\n * `WxFormItem` and the enclosing `WxForm`. The control's own prop always wins;\n * `WxFormItem` beats `WxForm`.\n */\nexport function useFormField(props: FormFieldProps) {\n const form = inject(formContextKey, null)\n const item = inject(formItemContextKey, null)\n const fallbackId = useId('wx-control')\n\n const id = computed(() => props.id ?? item?.id.value ?? fallbackId)\n\n const disabled = computed(\n () => props.disabled || item?.disabled.value || form?.disabled.value || false,\n )\n\n const size = computed<ControlSize>(\n () => props.size ?? item?.size.value ?? form?.size.value ?? 'md',\n )\n\n const status = computed<ControlStatus>(() => {\n if (props.status && props.status !== 'default') return props.status\n return item?.status.value ?? 'default'\n })\n\n const describedBy = computed(() => item?.describedBy.value)\n\n return { id, disabled, size, status, describedBy, form, item }\n}\n\n/**\n * What a checkbox, radio or switch may carry. Deliberately narrower than `unknown`:\n * a `v-model` that hands back `unknown` is useless to the caller, and object values\n * would need identity comparison rather than `===`.\n */\nexport type ChoiceValue = string | number | boolean | null\n\n/** Used by `WxCheckboxGroup` / `WxRadioGroup` to share state with their children. */\nexport interface ChoiceGroupContext<T> {\n name: ComputedRef<string | undefined>\n modelValue: Ref<T>\n disabled: ComputedRef<boolean>\n size: ComputedRef<ControlSize>\n toggle: (value: ChoiceValue, checked: boolean) => void\n}\n\nexport const checkboxGroupKey: InjectionKey<ChoiceGroupContext<ChoiceValue[]>> =\n Symbol('wx-checkbox-group')\nexport const radioGroupKey: InjectionKey<ChoiceGroupContext<ChoiceValue | undefined>> =\n Symbol('wx-radio-group')\n\nexport function provideFormItem(context: FormItemContext): void {\n provide(formItemContextKey, context)\n}\n","<script setup lang=\"ts\">\nimport { computed, inject, onMounted, ref, watch } from 'vue'\nimport { checkboxGroupKey, useFormField } from '../../composables/useFormField'\nimport type { CheckboxEmits, CheckboxProps } from './types'\n\ndefineOptions({ name: 'WxCheckbox', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<CheckboxProps>(), {\n value: undefined,\n label: undefined,\n indeterminate: false,\n disabled: undefined,\n size: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<CheckboxEmits>()\n\nconst model = defineModel<boolean>({ default: false })\n\nconst group = inject(checkboxGroupKey, null)\nconst field = useFormField(props)\nconst inputRef = ref<HTMLInputElement | null>(null)\n\nconst checked = computed(() =>\n group ? group.modelValue.value.includes(props.value ?? null) : model.value === true,\n)\n\nconst disabled = computed(() => props.disabled || group?.disabled.value || field.disabled.value)\nconst size = computed(() => props.size ?? group?.size.value ?? field.size.value)\n\nconst classes = computed(() => [\n 'wx-checkbox',\n `wx-checkbox--${size.value}`,\n {\n 'is-checked': checked.value,\n 'is-indeterminate': props.indeterminate && !checked.value,\n 'is-disabled': disabled.value,\n },\n])\n\n/** `indeterminate` only exists as a DOM property, never as an attribute. */\nfunction syncIndeterminate() {\n if (inputRef.value) inputRef.value.indeterminate = props.indeterminate && !checked.value\n}\n\nonMounted(syncIndeterminate)\nwatch([() => props.indeterminate, checked], syncIndeterminate)\n\nfunction onChange(event: Event) {\n const next = (event.target as HTMLInputElement).checked\n if (group) group.toggle(props.value ?? null, next)\n else model.value = next\n emit('change', next)\n}\n</script>\n\n<template>\n <label :class=\"classes\">\n <input\n :id=\"field.id.value\"\n ref=\"inputRef\"\n v-bind=\"$attrs\"\n class=\"wx-checkbox__native\"\n type=\"checkbox\"\n :name=\"name ?? group?.name.value\"\n :checked=\"checked\"\n :disabled=\"disabled\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n @change=\"onChange\"\n />\n\n <span class=\"wx-checkbox__box\" aria-hidden=\"true\">\n <svg class=\"wx-checkbox__mark\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n v-if=\"indeterminate && !checked\"\n d=\"M4 8h8\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n <path\n v-else\n d=\"M3.5 8.5l3 3 6-6\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </span>\n\n <span v-if=\"label || $slots.default\" class=\"wx-checkbox__label\">\n <slot>{{ label }}</slot>\n </span>\n </label>\n</template>\n\n<style scoped>\n.wx-checkbox {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-8);\n cursor: pointer;\n user-select: none;\n color: var(--wx-text-default);\n}\n\n.wx-checkbox.is-disabled {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-checkbox__native {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n}\n\n.wx-checkbox__box {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n box-sizing: border-box;\n width: var(--wx-checkbox-size, 20px);\n height: var(--wx-checkbox-size, 20px);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-strong);\n border-radius: var(--wx-radius-xs);\n color: transparent;\n transition:\n background-color var(--wx-duration-fast) var(--wx-easing-standard),\n border-color var(--wx-duration-fast) var(--wx-easing-standard),\n color var(--wx-duration-fast) var(--wx-easing-standard),\n box-shadow var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-checkbox--sm {\n --wx-checkbox-size: 16px;\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-checkbox--md {\n --wx-checkbox-size: 20px;\n font-size: var(--wx-font-size-md);\n}\n\n.wx-checkbox--lg {\n --wx-checkbox-size: 24px;\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-checkbox:hover:not(.is-disabled) .wx-checkbox__box {\n border-color: var(--wx-color-primary);\n}\n\n.wx-checkbox.is-checked .wx-checkbox__box,\n.wx-checkbox.is-indeterminate .wx-checkbox__box {\n border-color: var(--wx-color-primary);\n color: var(--wx-color-primary);\n}\n\n.wx-checkbox.is-disabled .wx-checkbox__box {\n background: var(--wx-bg-disabled);\n border-color: var(--wx-border-default);\n}\n\n.wx-checkbox.is-disabled.is-checked .wx-checkbox__box,\n.wx-checkbox.is-disabled.is-indeterminate .wx-checkbox__box {\n color: var(--wx-color-primary-disabled);\n border-color: var(--wx-color-primary-disabled);\n}\n\n.wx-checkbox__native:focus-visible + .wx-checkbox__box {\n border-color: var(--wx-color-primary);\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-checkbox__mark {\n width: 100%;\n height: 100%;\n}\n\n.wx-checkbox__label {\n line-height: var(--wx-font-line-height-normal);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wx-checkbox__box {\n transition: none;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, provide } from 'vue'\nimport { checkboxGroupKey, useFormField, type ChoiceValue } from '../../composables/useFormField'\nimport WxCheckbox from '../Checkbox/Checkbox.vue'\nimport type { CheckboxGroupEmits, CheckboxGroupProps } from './types'\n\ndefineOptions({ name: 'WxCheckboxGroup' })\n\nconst props = withDefaults(defineProps<CheckboxGroupProps>(), {\n options: undefined,\n disabled: undefined,\n size: undefined,\n name: undefined,\n inline: false,\n min: undefined,\n max: undefined,\n})\n\nconst emit = defineEmits<CheckboxGroupEmits>()\n\nconst model = defineModel<ChoiceValue[]>({ default: () => [] })\n\nconst field = useFormField(props)\n\n/** A group cannot be the target of a `for`, so the item label becomes a span. */\nfield.item?.registerLabelTarget(undefined)\n\nconst disabled = computed(() => props.disabled ?? field.disabled.value)\nconst size = computed(() => props.size ?? field.size.value)\n\nfunction toggle(value: ChoiceValue, checked: boolean) {\n const current = model.value ?? []\n if (checked) {\n if (current.includes(value)) return\n if (props.max !== undefined && current.length >= props.max) return\n model.value = [...current, value]\n } else {\n if (props.min !== undefined && current.length <= props.min) return\n model.value = current.filter((item) => item !== value)\n }\n emit('change', model.value)\n}\n\nprovide(checkboxGroupKey, {\n name: computed(() => props.name),\n modelValue: computed(() => model.value ?? []),\n disabled,\n size,\n toggle,\n})\n</script>\n\n<template>\n <div\n :class=\"['wx-checkbox-group', { 'wx-checkbox-group--inline': inline }]\"\n role=\"group\"\n :aria-labelledby=\"field.item ? `${field.item.id.value}-label` : undefined\"\n :aria-describedby=\"field.describedBy.value\"\n >\n <slot>\n <wx-checkbox\n v-for=\"option in options\"\n :key=\"String(option.value)\"\n :value=\"option.value\"\n :label=\"option.label\"\n :disabled=\"option.disabled\"\n />\n </slot>\n </div>\n</template>\n\n<style scoped>\n.wx-checkbox-group {\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-8);\n}\n\n.wx-checkbox-group--inline {\n flex-direction: row;\n flex-wrap: wrap;\n gap: var(--wx-space-16);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue'\nimport {\n ColorAreaArea,\n ColorAreaRoot,\n ColorAreaThumb,\n ColorSliderRoot,\n ColorSliderThumb,\n ColorSliderTrack,\n PopoverAnchor,\n PopoverContent,\n PopoverPortal,\n PopoverRoot,\n colorToHex,\n convertToHsb,\n getAreaBackgroundStyle,\n getSliderBackgroundStyle,\n parseColor,\n} from 'reka-ui'\nimport type { Color } from 'reka-ui'\nimport { useFormField } from '../../composables/useFormField'\nimport type { ColorPickerEmits, ColorPickerProps } from './types'\n\ndefineOptions({ name: 'WxColorPicker', inheritAttrs: false })\n\nconst HEX = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i\n\nconst props = withDefaults(defineProps<ColorPickerProps>(), {\n presets: () => [],\n clearable: false,\n placeholder: '#000000',\n teleport: true,\n disabled: undefined,\n readonly: false,\n size: undefined,\n status: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<ColorPickerEmits>()\n\nconst model = defineModel<string | null>({ default: null })\n\nconst field = useFormField(props)\nconst open = ref(false)\n\n/** What the text box shows. Kept separate so a half-typed hex is not thrown away. */\nconst text = ref(model.value ?? '')\n\nwatch(model, (value) => {\n text.value = value ?? ''\n})\n\n/**\n * A hex parses into an RGB colour, and the picker works in HSB. Both the gradients and\n * the primitives take the space from the object unless told otherwise, so an unconverted\n * colour draws an RGB area — where the brightness gradient runs the other way and the\n * square looks upside down until the first drag replaces the object.\n */\nfunction toWorking(hex: string): Color {\n return convertToHsb(parseColor(hex))\n}\n\n/**\n * The picker works on a colour object, not on the hex string.\n *\n * A grey has no hue to speak of, so parsing #919191 back into channels invents one —\n * and re-deriving it on every pointer move is what made the hue strip jump from blue\n * to teal to red as the pointer travelled into the desaturated corner. Holding the\n * object keeps the hue the user chose even where the colour cannot express it.\n */\nconst working = ref<Color>(\n toWorking(model.value && HEX.test(model.value) ? model.value : '#427edd'),\n)\n\nwatch(model, (value) => {\n const hex = value && HEX.test(value) ? value : null\n if (!hex || hex === colorToHex(working.value).toLowerCase()) return\n working.value = toWorking(hex)\n})\n\n// The space is stated rather than read off the colour, so the gradients cannot drift\n// away from the channels the area and the slider are pinned to.\nconst areaStyle = computed(() =>\n getAreaBackgroundStyle(working.value, 'saturation', 'brightness', 'hsb'),\n)\nconst hueStyle = computed(() => getSliderBackgroundStyle(working.value, 'hue', 'hsb'))\n\nconst swatch = computed(() => (model.value && HEX.test(model.value) ? model.value : null))\n\nconst classes = computed(() => [\n 'wx-color-picker',\n `wx-color-picker--${field.size.value}`,\n {\n [`wx-color-picker--${field.status.value}`]: field.status.value !== 'default',\n 'is-open': open.value,\n 'is-disabled': field.disabled.value,\n },\n])\n\nfunction commit(value: string | null) {\n if (model.value === value) return\n model.value = value\n emit('change', value)\n}\n\n/** Typing is free-form; only a complete hex reaches the model. */\nfunction onInput(event: Event) {\n const value = (event.target as HTMLInputElement).value\n text.value = value\n if (HEX.test(value)) commit(value.toLowerCase())\n else if (value === '') commit(null)\n}\n\n/** On blur the box either shows a valid colour or goes back to the last one. */\nfunction onBlur() {\n if (text.value === '') {\n commit(null)\n return\n }\n const candidate = text.value.startsWith('#') ? text.value : `#${text.value}`\n if (HEX.test(candidate)) {\n commit(candidate.toLowerCase())\n text.value = candidate.toLowerCase()\n } else {\n text.value = model.value ?? ''\n }\n}\n\n/**\n * The two primitives do not agree on which event carries the new colour: the hue\n * slider reports through `change`, the saturation area through `update:modelValue`.\n * Both are bound on both, and only string payloads are taken — the slider can also\n * hand back a colour object. Committing twice is harmless: an unchanged value is\n * dropped.\n */\nfunction onColor(color: Color) {\n working.value = convertToHsb(color)\n commit(colorToHex(color).toLowerCase())\n}\n\n/** Presets and typing come in as hex and have to be parsed back into the picker. */\nfunction onHex(value: string) {\n const hex = value.toLowerCase()\n working.value = toWorking(hex)\n commit(hex)\n}\n\nfunction clear() {\n commit(null)\n text.value = ''\n}\n\nfunction openPicker() {\n if (!field.disabled.value && !props.readonly) open.value = true\n}\n</script>\n\n<template>\n <popover-root v-model:open=\"open\">\n <div :class=\"classes\">\n <popover-anchor as-child>\n <div class=\"wx-color-picker__field\" @click=\"openPicker\">\n <button\n class=\"wx-color-picker__swatch\"\n type=\"button\"\n :disabled=\"field.disabled.value\"\n :aria-label=\"ariaLabel ?? 'Pick a colour'\"\n :style=\"swatch ? { background: swatch } : undefined\"\n :class=\"{ 'is-empty': !swatch }\"\n />\n\n <input\n :id=\"field.id.value\"\n v-bind=\"$attrs\"\n class=\"wx-color-picker__input\"\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n :value=\"text\"\n :name=\"name\"\n :placeholder=\"placeholder\"\n :disabled=\"field.disabled.value\"\n :readonly=\"readonly\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n :aria-invalid=\"field.status.value === 'error' || undefined\"\n @input=\"onInput\"\n @blur=\"onBlur\"\n />\n\n <button\n v-if=\"clearable && swatch && !field.disabled.value\"\n class=\"wx-color-picker__clear\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Clear\"\n @click.stop=\"clear\"\n >\n ✕\n </button>\n </div>\n </popover-anchor>\n\n <popover-portal :disabled=\"!teleport\">\n <popover-content class=\"wx-color-picker__panel\" :side-offset=\"4\" align=\"start\">\n <!-- Channels are stated: the defaults are RGB, which would move the hue as\n the pointer travels and disagree with the gradient drawn underneath. -->\n <color-area-root\n class=\"wx-color-picker__area\"\n color-space=\"hsb\"\n x-channel=\"saturation\"\n y-channel=\"brightness\"\n :model-value=\"working\"\n @update:color=\"onColor\"\n >\n <color-area-area class=\"wx-color-picker__area-surface\" :style=\"areaStyle\">\n <color-area-thumb class=\"wx-color-picker__thumb\" />\n </color-area-area>\n </color-area-root>\n\n <color-slider-root\n class=\"wx-color-picker__hue\"\n color-space=\"hsb\"\n channel=\"hue\"\n :model-value=\"working\"\n @update:color=\"onColor\"\n >\n <color-slider-track class=\"wx-color-picker__hue-track\" :style=\"hueStyle\">\n <color-slider-thumb class=\"wx-color-picker__thumb\" />\n </color-slider-track>\n </color-slider-root>\n\n <div v-if=\"presets.length\" class=\"wx-color-picker__presets\">\n <button\n v-for=\"preset in presets\"\n :key=\"preset\"\n class=\"wx-color-picker__preset\"\n type=\"button\"\n :style=\"{ background: preset }\"\n :aria-label=\"preset\"\n :aria-pressed=\"model === preset\"\n @click=\"onHex(preset)\"\n />\n </div>\n </popover-content>\n </popover-portal>\n </div>\n </popover-root>\n</template>\n\n<style scoped>\n.wx-color-picker {\n display: block;\n width: 100%;\n}\n\n.wx-color-picker__field {\n display: flex;\n align-items: center;\n gap: var(--wx-space-8);\n box-sizing: border-box;\n height: var(--wx-size-control-md);\n padding: 0 var(--wx-space-8) 0 var(--wx-space-6);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-control);\n color: var(--wx-text-default);\n font-size: var(--wx-font-size-md);\n cursor: text;\n transition: border-color var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-color-picker--sm .wx-color-picker__field {\n height: var(--wx-size-control-sm);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-color-picker--lg .wx-color-picker__field {\n height: var(--wx-size-control-lg);\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-color-picker__field:hover {\n border-color: var(--wx-border-strong);\n}\n\n.wx-color-picker.is-open .wx-color-picker__field,\n.wx-color-picker__field:focus-within {\n border-color: var(--wx-border-focus);\n}\n\n.wx-color-picker--error .wx-color-picker__field {\n border-color: var(--wx-color-danger);\n}\n\n.wx-color-picker--success .wx-color-picker__field {\n border-color: var(--wx-color-success);\n}\n\n.wx-color-picker--warning .wx-color-picker__field {\n border-color: var(--wx-color-warning);\n}\n\n.wx-color-picker.is-disabled .wx-color-picker__field {\n background: var(--wx-bg-disabled);\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-color-picker__swatch {\n flex: 0 0 auto;\n width: 22px;\n height: 22px;\n padding: 0;\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-xs);\n cursor: pointer;\n}\n\n/* A chequerboard says \"no colour\" more clearly than an empty box. */\n.wx-color-picker__swatch.is-empty {\n background-image:\n linear-gradient(45deg, var(--wx-bg-fill) 25%, transparent 25%),\n linear-gradient(-45deg, var(--wx-bg-fill) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, var(--wx-bg-fill) 75%),\n linear-gradient(-45deg, transparent 75%, var(--wx-bg-fill) 75%);\n background-size: 8px 8px;\n background-position:\n 0 0,\n 0 4px,\n 4px -4px,\n -4px 0;\n}\n\n.wx-color-picker__input {\n flex: 1 1 auto;\n min-width: 0;\n height: 100%;\n padding: 0;\n background: transparent;\n border: none;\n outline: none;\n color: inherit;\n font-family: var(--wx-font-family-mono);\n font-size: inherit;\n text-transform: lowercase;\n}\n\n.wx-color-picker__input::placeholder {\n color: var(--wx-text-placeholder);\n text-transform: none;\n}\n\n.wx-color-picker__clear {\n flex: 0 0 auto;\n width: 18px;\n height: 18px;\n padding: 0;\n background: transparent;\n border: none;\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-xs);\n line-height: 1;\n cursor: pointer;\n}\n\n.wx-color-picker__clear:hover {\n color: var(--wx-text-default);\n}\n</style>\n\n<style>\n/* Teleported panel. */\n.wx-color-picker__panel {\n z-index: var(--wx-z-index-popover);\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-10);\n width: 232px;\n padding: var(--wx-space-10);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-sm);\n box-shadow: var(--wx-shadow-popover);\n}\n\n.wx-color-picker__area,\n.wx-color-picker__area-surface {\n position: relative;\n width: 100%;\n height: 140px;\n border-radius: var(--wx-radius-xs);\n}\n\n.wx-color-picker__hue {\n position: relative;\n height: 14px;\n}\n\n.wx-color-picker__hue-track {\n /* Reka renders the track as an inline element, where width and height do nothing. */\n display: block;\n position: relative;\n width: 100%;\n height: 100%;\n border-radius: var(--wx-radius-full);\n}\n\n.wx-color-picker__thumb {\n width: 14px;\n height: 14px;\n background: transparent;\n border: 2px solid #fff;\n border-radius: var(--wx-radius-full);\n box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35);\n}\n\n.wx-color-picker__thumb:focus-visible {\n outline: none;\n box-shadow:\n 0 0 0 1px rgb(0 0 0 / 0.35),\n var(--wx-ring-focus);\n}\n\n.wx-color-picker__presets {\n display: flex;\n flex-wrap: wrap;\n gap: var(--wx-space-4);\n}\n\n.wx-color-picker__preset {\n width: 20px;\n height: 20px;\n padding: 0;\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-xs);\n cursor: pointer;\n}\n\n.wx-color-picker__preset[aria-pressed='true'] {\n box-shadow: 0 0 0 2px var(--wx-color-primary);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueDatePicker } from '@vuepic/vue-datepicker'\nimport { useFormField } from '../../composables/useFormField'\nimport '../../styles/datepicker.css'\nimport type { DatePickerEmits, DatePickerModelValue, DatePickerProps } from './types'\n\ndefineOptions({ name: 'WxDatePicker', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<DatePickerProps>(), {\n type: 'date',\n valueFormat: undefined,\n format: undefined,\n placeholder: undefined,\n clearable: true,\n minDate: undefined,\n maxDate: undefined,\n seconds: false,\n minutesIncrement: 1,\n is24: true,\n weekStart: 1,\n autoApply: true,\n textInput: false,\n teleport: true,\n disabled: undefined,\n readonly: false,\n size: undefined,\n status: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<DatePickerEmits>()\n\nconst model = defineModel<DatePickerModelValue>({ default: null })\n\nconst field = useFormField(props)\n\nconst hasTime = computed(() => props.type !== 'date')\n\n/**\n * What the model holds. Defaults match the column types a Laravel migration\n * produces, so the value can go to the API untouched; `'date'` opts out and keeps\n * `Date` objects.\n */\nconst modelType = computed(() => {\n if (props.valueFormat === 'date') return undefined\n if (props.valueFormat) return props.valueFormat\n if (props.type === 'time') return props.seconds ? 'HH:mm:ss' : 'HH:mm'\n if (props.type === 'datetime') return props.seconds ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd HH:mm'\n return 'yyyy-MM-dd'\n})\n\n/** What the field shows. Day-first, because this kit is aimed at European admins. */\nconst displayFormat = computed(() => {\n if (props.format) return props.format\n const time = props.seconds ? 'HH:mm:ss' : 'HH:mm'\n if (props.type === 'time') return time\n if (props.type === 'datetime') return `dd.MM.yyyy ${time}`\n return 'dd.MM.yyyy'\n})\n\n/**\n * The overlay is sized to a calendar (`modeHeight`, 255 by default) so switching\n * between panes does not resize the menu. A time-only picker has no calendar to\n * match, and the default leaves ~150px of empty space around the columns.\n */\nconst config = computed(() => (props.type === 'time' ? { modeHeight: 125 } : undefined))\n\nconst timeConfig = computed(() => ({\n enableTimePicker: hasTime.value,\n enableSeconds: props.seconds,\n is24: props.is24,\n minutesIncrement: props.minutesIncrement,\n}))\n\nconst inputAttrs = computed(() => ({\n id: field.id.value,\n name: props.name,\n clearable: props.clearable,\n // The library reads `state: false` as invalid; leaving it undefined means neutral.\n state: field.status.value === 'error' ? false : undefined,\n 'aria-label': props.ariaLabel,\n 'aria-describedby': field.describedBy.value,\n}))\n\nconst classes = computed(() => [\n 'wx-datepicker',\n `wx-datepicker--${field.size.value}`,\n {\n [`wx-datepicker--${field.status.value}`]: field.status.value !== 'default',\n 'is-disabled': field.disabled.value,\n },\n])\n\nfunction onUpdate(value: DatePickerModelValue) {\n model.value = value\n emit('change', value)\n}\n\nfunction onCleared() {\n model.value = null\n emit('change', null)\n emit('clear')\n}\n</script>\n\n<template>\n <div :class=\"classes\">\n <vue-date-picker\n :model-value=\"model\"\n :model-type=\"modelType\"\n :formats=\"{ input: displayFormat }\"\n :time-picker=\"type === 'time'\"\n :time-config=\"timeConfig\"\n :config=\"config\"\n :input-attrs=\"inputAttrs\"\n :ui=\"{ input: 'wx-datepicker__input', menu: 'wx-datepicker__menu' }\"\n :placeholder=\"placeholder\"\n :min-date=\"minDate\"\n :max-date=\"maxDate\"\n :week-start=\"weekStart\"\n :auto-apply=\"autoApply\"\n :text-input=\"textInput\"\n :teleport=\"teleport\"\n :disabled=\"field.disabled.value\"\n :readonly=\"readonly\"\n v-bind=\"$attrs\"\n @update:model-value=\"onUpdate\"\n @cleared=\"onCleared\"\n @open=\"emit('open')\"\n @closed=\"emit('close')\"\n >\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps ?? {}\" />\n </template>\n </vue-date-picker>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueDatePicker } from '@vuepic/vue-datepicker'\nimport { useFormField } from '../../composables/useFormField'\nimport '../../styles/datepicker.css'\nimport type { DateRangePickerEmits, DateRangePickerModelValue, DateRangePickerProps } from './types'\n\ndefineOptions({ name: 'WxDateRangePicker', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<DateRangePickerProps>(), {\n valueFormat: undefined,\n format: undefined,\n placeholder: undefined,\n clearable: true,\n minDate: undefined,\n maxDate: undefined,\n months: 2,\n weekStart: 1,\n autoApply: true,\n textInput: false,\n teleport: true,\n disabled: undefined,\n readonly: false,\n size: undefined,\n status: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<DateRangePickerEmits>()\n\nconst model = defineModel<DateRangePickerModelValue>({ default: null })\n\nconst field = useFormField(props)\n\nconst modelType = computed(() =>\n props.valueFormat === 'date' ? undefined : (props.valueFormat ?? 'yyyy-MM-dd'),\n)\nconst displayFormat = computed(() => props.format ?? 'dd.MM.yyyy')\n\nconst inputAttrs = computed(() => ({\n id: field.id.value,\n name: props.name,\n clearable: props.clearable,\n state: field.status.value === 'error' ? false : undefined,\n 'aria-label': props.ariaLabel,\n 'aria-describedby': field.describedBy.value,\n}))\n\nconst classes = computed(() => [\n 'wx-datepicker',\n 'wx-datepicker--range',\n `wx-datepicker--${field.size.value}`,\n {\n [`wx-datepicker--${field.status.value}`]: field.status.value !== 'default',\n 'is-disabled': field.disabled.value,\n },\n])\n\n/** The library hands back `null` while only the first date has been picked. */\nfunction onUpdate(value: DateRangePickerModelValue) {\n model.value = value\n emit('change', value)\n}\n\nfunction onCleared() {\n model.value = null\n emit('change', null)\n emit('clear')\n}\n</script>\n\n<template>\n <div :class=\"classes\">\n <vue-date-picker\n range\n :model-value=\"model\"\n :model-type=\"modelType\"\n :formats=\"{ input: displayFormat }\"\n :multi-calendars=\"months\"\n :input-attrs=\"inputAttrs\"\n :ui=\"{ input: 'wx-datepicker__input', menu: 'wx-datepicker__menu' }\"\n :placeholder=\"placeholder\"\n :min-date=\"minDate\"\n :max-date=\"maxDate\"\n :week-start=\"weekStart\"\n :auto-apply=\"autoApply\"\n :text-input=\"textInput\"\n :teleport=\"teleport\"\n :disabled=\"field.disabled.value\"\n :readonly=\"readonly\"\n v-bind=\"$attrs\"\n @update:model-value=\"onUpdate\"\n @cleared=\"onCleared\"\n @open=\"emit('open')\"\n @closed=\"emit('close')\"\n >\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps ?? {}\" />\n </template>\n </vue-date-picker>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport WxDatePicker from '../DatePicker/DatePicker.vue'\nimport type { DatePickerModelValue, DatePickerProps } from '../DatePicker/types'\n\ndefineOptions({ name: 'WxDateTimePicker' })\n\n/**\n * Every prop defaults to `undefined` on purpose. Vue casts an absent boolean prop\n * to `false`, and this preset forwards its whole prop object — without these the\n * preset would hand `WxDatePicker` an explicit `false` for `is24`, `clearable`,\n * `autoApply` and `teleport`, overriding that component's own defaults. Passing\n * `undefined` lets each default apply as if the prop had never been written.\n */\nwithDefaults(defineProps<Omit<DatePickerProps, 'type'>>(), {\n valueFormat: undefined,\n format: undefined,\n placeholder: undefined,\n clearable: undefined,\n minDate: undefined,\n maxDate: undefined,\n seconds: undefined,\n minutesIncrement: undefined,\n is24: undefined,\n weekStart: undefined,\n autoApply: undefined,\n textInput: undefined,\n teleport: undefined,\n disabled: undefined,\n readonly: undefined,\n size: undefined,\n status: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst model = defineModel<DatePickerModelValue>({ default: null })\n</script>\n\n<template>\n <wx-date-picker v-model=\"model\" type=\"datetime\" v-bind=\"$props\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps ?? {}\" />\n </template>\n </wx-date-picker>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, provide, toRef } from 'vue'\nimport { formContextKey, type ValidationErrors } from '../../composables/useFormField'\nimport type { FormEmits, FormProps } from './types'\n\ndefineOptions({ name: 'WxForm' })\n\nconst props = withDefaults(defineProps<FormProps>(), {\n errors: undefined,\n disabled: false,\n size: 'md',\n labelPosition: 'top',\n labelWidth: undefined,\n gap: 'md',\n})\n\nconst emit = defineEmits<FormEmits>()\n\nconst errors = computed<ValidationErrors>(() => props.errors ?? {})\n\nprovide(formContextKey, {\n errors,\n disabled: toRef(props, 'disabled'),\n size: toRef(props, 'size'),\n labelPosition: toRef(props, 'labelPosition'),\n labelWidth: toRef(props, 'labelWidth'),\n})\n\n/** Native submit is always prevented: forms here talk to a data adapter, not a URL. */\nfunction onSubmit(event: SubmitEvent) {\n event.preventDefault()\n emit('submit', event)\n}\n\nfunction onReset(event: Event) {\n emit('reset', event)\n}\n</script>\n\n<template>\n <form\n :class=\"['wx-form', `wx-form--gap-${gap}`, `wx-form--label-${labelPosition}`]\"\n novalidate\n @submit=\"onSubmit\"\n @reset=\"onReset\"\n >\n <slot />\n </form>\n</template>\n\n<style scoped>\n.wx-form {\n display: flex;\n flex-direction: column;\n}\n\n.wx-form--gap-sm {\n gap: var(--wx-space-8);\n}\n\n.wx-form--gap-md {\n gap: var(--wx-space-16);\n}\n\n.wx-form--gap-lg {\n gap: var(--wx-space-24);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, inject, ref } from 'vue'\nimport {\n formContextKey,\n provideFormItem,\n useId,\n type ControlSize,\n type ControlStatus,\n} from '../../composables/useFormField'\nimport type { FormItemProps } from './types'\n\ndefineOptions({ name: 'WxFormItem' })\n\nconst props = withDefaults(defineProps<FormItemProps>(), {\n label: undefined,\n name: undefined,\n required: false,\n error: undefined,\n help: undefined,\n disabled: false,\n size: undefined,\n labelWidth: undefined,\n reserveErrorSpace: false,\n})\n\nconst form = inject(formContextKey, null)\n\nconst baseId = useId('wx-field')\nconst errorId = `${baseId}-error`\nconst helpId = `${baseId}-help`\n\n/**\n * Grouped controls (checkbox and radio groups) cannot be targeted by `for`,\n * so they register themselves and the label becomes a plain span instead.\n */\nconst labelMode = ref<'control' | 'group'>('control')\nconst controlId = ref<string>(baseId)\n\nfunction registerLabelTarget(id: string | undefined) {\n if (id === undefined) {\n labelMode.value = 'group'\n return\n }\n labelMode.value = 'control'\n controlId.value = id\n}\n\nconst messages = computed<string[]>(() => {\n if (props.error !== undefined) {\n return Array.isArray(props.error) ? props.error : [props.error]\n }\n if (props.name && form) return form.errors.value[props.name] ?? []\n return []\n})\n\nconst hasError = computed(() => messages.value.length > 0)\nconst status = computed<ControlStatus>(() => (hasError.value ? 'error' : 'default'))\n\n/**\n * Only ever names nodes that are actually rendered — the help text gives way to the\n * error, and a dangling `aria-describedby` is worse than none.\n */\nconst describedBy = computed(() => {\n if (hasError.value) return errorId\n return props.help ? helpId : undefined\n})\n\nconst size = computed<ControlSize | undefined>(() => props.size)\nconst disabled = computed(() => props.disabled)\n\nconst labelWidth = computed(() => props.labelWidth ?? form?.labelWidth.value)\nconst isInline = computed(() => form?.labelPosition.value === 'left')\n\nprovideFormItem({\n id: computed(() => baseId),\n describedBy,\n status,\n disabled,\n size,\n registerLabelTarget,\n})\n\ndefineExpose({ messages, hasError })\n</script>\n\n<template>\n <div\n :class=\"[\n 'wx-form-item',\n { 'wx-form-item--inline': isInline, 'is-error': hasError, 'is-required': required },\n ]\"\n :style=\"isInline && labelWidth ? { '--wx-form-item-label-width': labelWidth } : undefined\"\n >\n <component\n :is=\"labelMode === 'group' ? 'span' : 'label'\"\n v-if=\"label || $slots.label\"\n :id=\"`${baseId}-label`\"\n class=\"wx-form-item__label\"\n :for=\"labelMode === 'group' ? undefined : controlId\"\n >\n <slot name=\"label\">{{ label }}</slot>\n <span v-if=\"required\" class=\"wx-form-item__required\" aria-hidden=\"true\">*</span>\n </component>\n\n <div class=\"wx-form-item__control\">\n <slot />\n\n <p v-if=\"hasError\" :id=\"errorId\" class=\"wx-form-item__error\" role=\"alert\">\n {{ messages[0] }}\n </p>\n <p v-else-if=\"help\" :id=\"helpId\" class=\"wx-form-item__help\">{{ help }}</p>\n <p v-else-if=\"reserveErrorSpace\" class=\"wx-form-item__error\" aria-hidden=\"true\"> </p>\n </div>\n </div>\n</template>\n\n<style scoped>\n.wx-form-item {\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-6);\n min-width: 0;\n}\n\n.wx-form-item--inline {\n flex-direction: row;\n align-items: flex-start;\n gap: var(--wx-space-16);\n}\n\n.wx-form-item--inline .wx-form-item__label {\n flex: 0 0 auto;\n width: var(--wx-form-item-label-width, 160px);\n /* Line the label up with the first line of a control's text. */\n padding-top: calc((var(--wx-size-control-md) - 1lh) / 2);\n}\n\n.wx-form-item--inline .wx-form-item__control {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.wx-form-item__label {\n color: var(--wx-text-default);\n font-size: var(--wx-font-size-sm);\n font-weight: var(--wx-font-weight-medium);\n line-height: var(--wx-font-line-height-normal);\n}\n\n.wx-form-item__required {\n margin-left: var(--wx-space-2);\n color: var(--wx-color-danger);\n}\n\n.wx-form-item__control {\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-4);\n min-width: 0;\n}\n\n.wx-form-item__error,\n.wx-form-item__help {\n margin: 0;\n font-size: var(--wx-font-size-sm);\n line-height: var(--wx-font-line-height-normal);\n}\n\n.wx-form-item__error {\n color: var(--wx-color-danger);\n}\n\n.wx-form-item__help {\n color: var(--wx-text-muted);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref } from 'vue'\nimport { useFormField } from '../../composables/useFormField'\nimport type { InputEmits, InputModelValue, InputProps } from './types'\n\ndefineOptions({ name: 'WxInput', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<InputProps>(), {\n type: 'text',\n size: undefined,\n status: undefined,\n id: undefined,\n placeholder: undefined,\n disabled: undefined,\n readonly: false,\n clearable: false,\n maxlength: undefined,\n showCount: false,\n autocomplete: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<InputEmits>()\n\nconst model = defineModel<InputModelValue>({ default: '' })\n\nconst field = useFormField(props)\nconst inputRef = ref<HTMLInputElement | null>(null)\nconst focused = ref(false)\n\nconst currentValue = computed(() => (model.value == null ? '' : String(model.value)))\n\nconst showClear = computed(\n () =>\n props.clearable && !field.disabled.value && !props.readonly && currentValue.value.length > 0,\n)\n\nconst counter = computed(() =>\n props.showCount && props.maxlength ? `${currentValue.value.length}/${props.maxlength}` : null,\n)\n\nconst classes = computed(() => [\n 'wx-input',\n `wx-input--${field.size.value}`,\n {\n [`wx-input--${field.status.value}`]: field.status.value !== 'default',\n 'is-focused': focused.value,\n 'is-disabled': field.disabled.value,\n 'is-readonly': props.readonly,\n },\n])\n\nfunction onInput(event: Event) {\n const value = (event.target as HTMLInputElement).value\n model.value = value\n emit('input', value)\n}\n\nfunction onChange(event: Event) {\n emit('change', (event.target as HTMLInputElement).value)\n}\n\nfunction onFocus(event: FocusEvent) {\n focused.value = true\n emit('focus', event)\n}\n\nfunction onBlur(event: FocusEvent) {\n focused.value = false\n emit('blur', event)\n}\n\nfunction clear() {\n model.value = ''\n emit('input', '')\n emit('change', '')\n emit('clear')\n inputRef.value?.focus()\n}\n\ndefineExpose({\n focus: () => inputRef.value?.focus(),\n blur: () => inputRef.value?.blur(),\n select: () => inputRef.value?.select(),\n input: inputRef,\n})\n</script>\n\n<template>\n <div :class=\"classes\">\n <span v-if=\"$slots.prefix\" class=\"wx-input__affix wx-input__affix--prefix\">\n <slot name=\"prefix\" />\n </span>\n\n <input\n :id=\"field.id.value\"\n ref=\"inputRef\"\n v-bind=\"$attrs\"\n class=\"wx-input__inner\"\n :type=\"type\"\n :value=\"currentValue\"\n :placeholder=\"placeholder\"\n :disabled=\"field.disabled.value\"\n :readonly=\"readonly\"\n :maxlength=\"maxlength\"\n :autocomplete=\"autocomplete\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n :aria-invalid=\"field.status.value === 'error' || undefined\"\n @input=\"onInput\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n />\n\n <button\n v-if=\"showClear\"\n class=\"wx-input__clear\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Clear\"\n @click=\"clear\"\n >\n ✕\n </button>\n\n <span v-if=\"counter\" class=\"wx-input__count\">{{ counter }}</span>\n\n <span v-if=\"$slots.suffix\" class=\"wx-input__affix wx-input__affix--suffix\">\n <slot name=\"suffix\" />\n </span>\n </div>\n</template>\n\n<style scoped>\n.wx-input {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-8);\n box-sizing: border-box;\n width: 100%;\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-control);\n color: var(--wx-text-default);\n transition:\n border-color var(--wx-duration-normal) var(--wx-easing-standard),\n background-color var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-input:hover:not(.is-disabled) {\n border-color: var(--wx-border-strong);\n}\n\n/* The reference marks focus with a tinted border rather than a ring. */\n.wx-input.is-focused {\n border-color: var(--wx-border-focus);\n}\n\n.wx-input--sm {\n height: var(--wx-size-control-sm);\n padding: 0 var(--wx-space-10);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-input--md {\n height: var(--wx-size-control-md);\n padding: 0 var(--wx-space-12);\n font-size: var(--wx-font-size-md);\n}\n\n.wx-input--lg {\n height: var(--wx-size-control-lg);\n padding: 0 var(--wx-space-16);\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-input--error,\n.wx-input--error.is-focused {\n border-color: var(--wx-color-danger);\n}\n\n.wx-input--success,\n.wx-input--success.is-focused {\n border-color: var(--wx-color-success);\n}\n\n.wx-input--warning,\n.wx-input--warning.is-focused {\n border-color: var(--wx-color-warning);\n}\n\n.wx-input.is-disabled {\n background: var(--wx-bg-disabled);\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-input__inner {\n flex: 1 1 auto;\n min-width: 0;\n height: 100%;\n padding: 0;\n background: transparent;\n border: none;\n outline: none;\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\n.wx-input__inner::placeholder {\n color: var(--wx-text-placeholder);\n}\n\n.wx-input__inner:disabled {\n cursor: not-allowed;\n}\n\n.wx-input__affix,\n.wx-input__count {\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n color: var(--wx-text-muted);\n}\n\n.wx-input__count {\n font-size: var(--wx-font-size-xs);\n font-variant-numeric: tabular-nums;\n}\n\n.wx-input__clear {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 18px;\n height: 18px;\n padding: 0;\n background: transparent;\n border: none;\n border-radius: var(--wx-radius-full);\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-xs);\n line-height: 1;\n cursor: pointer;\n transition: background-color var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-input__clear:hover {\n background: var(--wx-bg-fill);\n color: var(--wx-text-default);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue'\nimport { useFormField } from '../../composables/useFormField'\nimport type { InputNumberEmits, InputNumberModelValue, InputNumberProps } from './types'\n\ndefineOptions({ name: 'WxInputNumber', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<InputNumberProps>(), {\n min: undefined,\n max: undefined,\n step: 1,\n precision: undefined,\n controls: true,\n controlsPosition: 'sides',\n wheel: false,\n size: undefined,\n status: undefined,\n id: undefined,\n name: undefined,\n placeholder: undefined,\n disabled: undefined,\n readonly: false,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<InputNumberEmits>()\n\nconst model = defineModel<InputNumberModelValue>({ default: null })\n\nconst field = useFormField(props)\nconst inputRef = ref<HTMLInputElement | null>(null)\nconst focused = ref(false)\n\n/** Decimals to keep: explicit `precision`, otherwise whatever `step` implies. */\nconst precision = computed(() => {\n if (props.precision !== undefined) return props.precision\n const [, decimals = ''] = String(props.step).split('.')\n return decimals.length\n})\n\n/** Rounds through a scaled integer so 0.1 + 0.2 does not leak into the model. */\nfunction round(value: number): number {\n const factor = 10 ** precision.value\n return Math.round((value + Number.EPSILON) * factor) / factor\n}\n\nfunction clamp(value: number): number {\n let next = value\n if (props.min !== undefined) next = Math.max(next, props.min)\n if (props.max !== undefined) next = Math.min(next, props.max)\n return round(next)\n}\n\nconst current = computed<number | null>(() =>\n typeof model.value === 'number' && Number.isFinite(model.value) ? model.value : null,\n)\n\n/** What the user sees. Kept as text so a half-typed \"-\" or \"1.\" survives. */\nconst display = ref(current.value === null ? '' : current.value.toFixed(precision.value))\n\nwatch(current, (value) => {\n if (focused.value) return\n display.value = value === null ? '' : value.toFixed(precision.value)\n})\n\nconst disabled = computed(() => field.disabled.value)\nconst canDecrease = computed(\n () =>\n !disabled.value &&\n !props.readonly &&\n (props.min === undefined || (current.value ?? 0) > props.min),\n)\nconst canIncrease = computed(\n () =>\n !disabled.value &&\n !props.readonly &&\n (props.max === undefined || (current.value ?? 0) < props.max),\n)\n\nconst classes = computed(() => [\n 'wx-input-number',\n `wx-input-number--${field.size.value}`,\n `wx-input-number--controls-${props.controls ? props.controlsPosition : 'none'}`,\n {\n [`wx-input-number--${field.status.value}`]: field.status.value !== 'default',\n 'is-focused': focused.value,\n 'is-disabled': disabled.value,\n },\n])\n\nfunction commit(value: number | null) {\n if (model.value === value) return\n model.value = value\n emit('change', value)\n}\n\nfunction stepBy(direction: 1 | -1) {\n if (disabled.value || props.readonly) return\n const base = current.value ?? clamp(0)\n const next = clamp(base + direction * props.step)\n commit(next)\n display.value = next.toFixed(precision.value)\n}\n\nfunction onInput(event: Event) {\n display.value = (event.target as HTMLInputElement).value\n const parsed = Number.parseFloat(display.value)\n // While typing, only push through values that already make sense.\n if (display.value === '') commit(null)\n else if (Number.isFinite(parsed)) commit(round(parsed))\n}\n\n/** Clamping and formatting happen on blur, so typing 5 into a min=10 field is possible. */\nfunction normalize() {\n if (display.value.trim() === '') {\n commit(null)\n display.value = ''\n return\n }\n const parsed = Number.parseFloat(display.value)\n if (!Number.isFinite(parsed)) {\n display.value = current.value === null ? '' : current.value.toFixed(precision.value)\n return\n }\n const next = clamp(parsed)\n commit(next)\n display.value = next.toFixed(precision.value)\n}\n\nfunction onFocus(event: FocusEvent) {\n focused.value = true\n emit('focus', event)\n}\n\nfunction onBlur(event: FocusEvent) {\n focused.value = false\n normalize()\n emit('blur', event)\n}\n\n/**\n * Only ever acts on a focused field, and swallows the scroll while it does — a\n * hovered field must not steal the page's scrolling.\n */\nfunction onWheel(event: WheelEvent) {\n if (!props.wheel || !focused.value || disabled.value || props.readonly) return\n event.preventDefault()\n stepBy(event.deltaY < 0 ? 1 : -1)\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'ArrowUp') {\n event.preventDefault()\n stepBy(1)\n } else if (event.key === 'ArrowDown') {\n event.preventDefault()\n stepBy(-1)\n } else if (event.key === 'Enter') {\n normalize()\n }\n}\n\ndefineExpose({\n focus: () => inputRef.value?.focus(),\n blur: () => inputRef.value?.blur(),\n increase: () => stepBy(1),\n decrease: () => stepBy(-1),\n input: inputRef,\n})\n</script>\n\n<template>\n <div :class=\"classes\">\n <button\n v-if=\"controls\"\n class=\"wx-input-number__button wx-input-number__button--decrease\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Decrease\"\n :disabled=\"!canDecrease\"\n @click=\"stepBy(-1)\"\n >\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M3.5 8h9\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </button>\n\n <input\n :id=\"field.id.value\"\n ref=\"inputRef\"\n v-bind=\"$attrs\"\n class=\"wx-input-number__inner\"\n type=\"text\"\n inputmode=\"decimal\"\n autocomplete=\"off\"\n :name=\"name\"\n :value=\"display\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n :aria-invalid=\"field.status.value === 'error' || undefined\"\n role=\"spinbutton\"\n :aria-valuenow=\"current ?? undefined\"\n :aria-valuemin=\"min\"\n :aria-valuemax=\"max\"\n @input=\"onInput\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @keydown=\"onKeydown\"\n @wheel=\"onWheel\"\n />\n\n <button\n v-if=\"controls\"\n class=\"wx-input-number__button wx-input-number__button--increase\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Increase\"\n :disabled=\"!canIncrease\"\n @click=\"stepBy(1)\"\n >\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M8 3.5v9M3.5 8h9\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n </div>\n</template>\n\n<style scoped>\n.wx-input-number {\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n width: 100%;\n height: var(--wx-size-control-md);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-control);\n color: var(--wx-text-default);\n overflow: hidden;\n transition:\n border-color var(--wx-duration-normal) var(--wx-easing-standard),\n background-color var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-input-number--sm {\n height: var(--wx-size-control-sm);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-input-number--md {\n height: var(--wx-size-control-md);\n font-size: var(--wx-font-size-md);\n}\n\n.wx-input-number--lg {\n height: var(--wx-size-control-lg);\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-input-number:hover:not(.is-disabled) {\n border-color: var(--wx-border-strong);\n}\n\n.wx-input-number.is-focused {\n border-color: var(--wx-border-focus);\n}\n\n.wx-input-number--error,\n.wx-input-number--error.is-focused {\n border-color: var(--wx-color-danger);\n}\n\n.wx-input-number--success {\n border-color: var(--wx-color-success);\n}\n\n.wx-input-number--warning {\n border-color: var(--wx-color-warning);\n}\n\n.wx-input-number.is-disabled {\n background: var(--wx-bg-disabled);\n color: var(--wx-text-disabled);\n}\n\n.wx-input-number__inner {\n flex: 1 1 auto;\n min-width: 0;\n height: 100%;\n padding: 0 var(--wx-space-12);\n background: transparent;\n border: none;\n outline: none;\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n font-variant-numeric: tabular-nums;\n text-align: center;\n}\n\n.wx-input-number--controls-none .wx-input-number__inner {\n text-align: left;\n}\n\n.wx-input-number__inner::placeholder {\n color: var(--wx-text-placeholder);\n}\n\n.wx-input-number__inner:disabled {\n cursor: not-allowed;\n}\n\n.wx-input-number__button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: calc(var(--wx-size-control-md) - 8px);\n height: 100%;\n padding: 0;\n background: var(--wx-bg-fill);\n border: none;\n color: var(--wx-text-default);\n cursor: pointer;\n transition: background-color var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-input-number__button svg {\n width: 16px;\n height: 16px;\n}\n\n.wx-input-number__button:hover:not(:disabled) {\n background: var(--wx-bg-fill-hover);\n color: var(--wx-color-primary);\n}\n\n.wx-input-number__button:disabled {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n/*\n * Stacked layout: the DOM order stays decrease → input → increase (which is what a\n * screen reader and the tab order want); grid puts the buttons where they belong.\n */\n.wx-input-number--controls-right {\n display: grid;\n grid-template-columns: 1fr auto;\n grid-template-rows: 1fr 1fr;\n}\n\n.wx-input-number--controls-right .wx-input-number__inner {\n grid-column: 1;\n grid-row: 1 / span 2;\n text-align: left;\n}\n\n.wx-input-number--controls-right .wx-input-number__button {\n width: calc(var(--wx-size-control-md) - 16px);\n height: 100%;\n border-left: 1px solid var(--wx-border-default);\n}\n\n.wx-input-number--controls-right .wx-input-number__button--increase {\n grid-column: 2;\n grid-row: 1;\n}\n\n.wx-input-number--controls-right .wx-input-number__button--decrease {\n grid-column: 2;\n grid-row: 2;\n border-top: 1px solid var(--wx-border-default);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport type { PaginationEmits, PaginationProps } from './types'\n\ndefineOptions({ name: 'WxPagination' })\n\nconst props = withDefaults(defineProps<PaginationProps>(), {\n paginator: null,\n total: undefined,\n lastPage: undefined,\n siblings: 1,\n perPageOptions: () => [],\n showTotal: true,\n disabled: false,\n size: 'md',\n ariaLabel: 'Pagination',\n})\n\nconst emit = defineEmits<PaginationEmits>()\n\n/**\n * Both models fall back to the paginator, so `:paginator=\"page\"` alone is a working\n * component and `v-model:page` is there for state the caller would rather own.\n */\nconst page = defineModel<number | undefined>('page', { default: undefined })\nconst perPage = defineModel<number | undefined>('perPage', { default: undefined })\n\nconst currentPerPage = computed(() => perPage.value ?? props.paginator?.per_page ?? 15)\nconst total = computed(() => props.total ?? props.paginator?.total ?? 0)\n\nconst lastPage = computed(() => {\n if (props.lastPage !== undefined) return Math.max(1, props.lastPage)\n if (props.paginator) return Math.max(1, props.paginator.last_page)\n return Math.max(1, Math.ceil(total.value / currentPerPage.value))\n})\n\n/**\n * Clamped to what exists. A remembered page can outlive the result it belonged to —\n * a filter narrows eleven pages down to two — and a pagination with no page marked\n * current tells the reader they are nowhere.\n */\nconst currentPage = computed(() => {\n const asked = page.value ?? props.paginator?.current_page ?? 1\n return Math.min(Math.max(1, asked), lastPage.value)\n})\n\n/** Laravel counts these for us; without it they follow from the page and its size. */\nconst from = computed(() => {\n if (props.paginator) return props.paginator.from\n return total.value === 0 ? null : (currentPage.value - 1) * currentPerPage.value + 1\n})\n\nconst to = computed(() => {\n if (props.paginator) return props.paginator.to\n return total.value === 0 ? null : Math.min(total.value, currentPage.value * currentPerPage.value)\n})\n\ntype PageItem = { type: 'page'; value: number } | { type: 'gap'; value: string }\n\n/**\n * First and last are always reachable, the current page keeps `siblings` neighbours,\n * and what is skipped becomes an ellipsis. A gap of exactly one page is spelled out\n * instead — an ellipsis hiding a single number helps nobody.\n */\nconst items = computed<PageItem[]>(() => {\n const last = lastPage.value\n const current = currentPage.value\n const span = props.siblings\n\n const wanted = new Set<number>([1, last])\n for (let i = current - span; i <= current + span; i++) {\n if (i >= 1 && i <= last) wanted.add(i)\n }\n\n const numbers = [...wanted].sort((a, b) => a - b)\n const result: PageItem[] = []\n let previous = 0\n\n for (const value of numbers) {\n const distance = value - previous\n if (previous && distance === 2) result.push({ type: 'page', value: value - 1 })\n else if (previous && distance > 2) result.push({ type: 'gap', value: `gap-${value}` })\n result.push({ type: 'page', value })\n previous = value\n }\n\n return result\n})\n\nconst classes = computed(() => [\n 'wx-pagination',\n `wx-pagination--${props.size}`,\n { 'is-disabled': props.disabled },\n])\n\nfunction go(next: number) {\n const target = Math.min(Math.max(1, next), lastPage.value)\n if (props.disabled || target === currentPage.value) return\n page.value = target\n emit('change', { page: target, perPage: currentPerPage.value })\n}\n\n/**\n * A bigger page can put the current position past the end, so the size change also\n * moves back to the first page — the alternative is asking for a page that is not there.\n */\nfunction setPerPage(event: Event) {\n const value = Number((event.target as HTMLSelectElement).value)\n if (!Number.isFinite(value) || value === currentPerPage.value) return\n perPage.value = value\n page.value = 1\n emit('change', { page: 1, perPage: value })\n}\n</script>\n\n<template>\n <nav :class=\"classes\" :aria-label=\"ariaLabel\">\n <p v-if=\"showTotal\" class=\"wx-pagination__total\">\n <slot name=\"total\" :from=\"from\" :to=\"to\" :total=\"total\">\n <template v-if=\"from === null\">Nothing to show</template>\n <template v-else>{{ from }}–{{ to }} of {{ total }}</template>\n </slot>\n </p>\n\n <div class=\"wx-pagination__controls\">\n <label v-if=\"perPageOptions.length\" class=\"wx-pagination__per-page\">\n <span class=\"wx-pagination__per-page-label\">Per page</span>\n <select\n class=\"wx-pagination__select\"\n :value=\"currentPerPage\"\n :disabled=\"disabled\"\n @change=\"setPerPage\"\n >\n <option v-for=\"option in perPageOptions\" :key=\"option\" :value=\"option\">\n {{ option }}\n </option>\n </select>\n </label>\n\n <ul class=\"wx-pagination__list\">\n <li>\n <button\n class=\"wx-pagination__button wx-pagination__button--arrow\"\n type=\"button\"\n :disabled=\"disabled || currentPage <= 1\"\n aria-label=\"Previous page\"\n @click=\"go(currentPage - 1)\"\n >\n <svg viewBox=\"0 0 8 12\" aria-hidden=\"true\"><path d=\"M6.5 1 1.5 6l5 5\" /></svg>\n </button>\n </li>\n\n <li v-for=\"item in items\" :key=\"item.value\">\n <span v-if=\"item.type === 'gap'\" class=\"wx-pagination__gap\" aria-hidden=\"true\"\n >…</span\n >\n <button\n v-else\n class=\"wx-pagination__button\"\n type=\"button\"\n :class=\"{ 'is-current': item.value === currentPage }\"\n :disabled=\"disabled\"\n :aria-current=\"item.value === currentPage ? 'page' : undefined\"\n :aria-label=\"`Page ${item.value}`\"\n @click=\"go(item.value)\"\n >\n {{ item.value }}\n </button>\n </li>\n\n <li>\n <button\n class=\"wx-pagination__button wx-pagination__button--arrow\"\n type=\"button\"\n :disabled=\"disabled || currentPage >= lastPage\"\n aria-label=\"Next page\"\n @click=\"go(currentPage + 1)\"\n >\n <svg viewBox=\"0 0 8 12\" aria-hidden=\"true\"><path d=\"M1.5 1 6.5 6l-5 5\" /></svg>\n </button>\n </li>\n </ul>\n </div>\n </nav>\n</template>\n\n<style scoped>\n.wx-pagination {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: var(--wx-space-12);\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-pagination__total {\n margin: 0;\n padding: 0;\n}\n\n.wx-pagination__controls {\n display: flex;\n align-items: center;\n gap: var(--wx-space-12);\n margin-left: auto;\n}\n\n.wx-pagination__per-page {\n display: flex;\n align-items: center;\n gap: var(--wx-space-6);\n}\n\n.wx-pagination__select {\n height: var(--wx-pagination-size, 34px);\n padding: 0 var(--wx-space-8);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-control);\n color: var(--wx-text-default);\n font: inherit;\n cursor: pointer;\n}\n\n.wx-pagination__select:focus-visible {\n outline: none;\n border-color: var(--wx-border-focus);\n box-shadow: var(--wx-ring-focus);\n}\n\n/*\n * The same explicit resets the table needs. A host stylesheet that puts space between\n * consecutive list items — VitePress adds 8px, and every CSS framework has a rule of\n * its own — lands inside the row of buttons and steps them down one by one, because\n * the margin arrives on all but the first item.\n */\n.wx-pagination__list {\n display: flex;\n align-items: center;\n gap: var(--wx-space-4);\n margin: 0;\n padding: 0;\n border: 0;\n list-style: none;\n}\n\n.wx-pagination__list li {\n display: flex;\n align-items: center;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.wx-pagination__button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n min-width: var(--wx-pagination-size, 34px);\n height: var(--wx-pagination-size, 34px);\n padding: 0 var(--wx-space-8);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-control);\n color: var(--wx-text-default);\n font: inherit;\n cursor: pointer;\n transition:\n background var(--wx-duration-fast) var(--wx-easing-standard),\n border-color var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-pagination--sm {\n --wx-pagination-size: 28px;\n}\n\n.wx-pagination--lg {\n --wx-pagination-size: 42px;\n}\n\n.wx-pagination__button:hover:not(:disabled):not(.is-current) {\n border-color: var(--wx-border-strong);\n background: var(--wx-bg-fill);\n}\n\n.wx-pagination__button:focus-visible {\n outline: none;\n border-color: var(--wx-border-focus);\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-pagination__button.is-current {\n background: var(--wx-color-primary);\n border-color: var(--wx-color-primary);\n color: var(--wx-color-primary-contrast);\n cursor: default;\n}\n\n.wx-pagination__button:disabled {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-pagination__button--arrow svg {\n width: 8px;\n height: 12px;\n fill: none;\n stroke: currentColor;\n stroke-width: 1.5;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.wx-pagination__gap {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: var(--wx-space-24);\n color: var(--wx-text-muted);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, inject } from 'vue'\nimport { radioGroupKey, useFormField, type ChoiceValue } from '../../composables/useFormField'\nimport type { RadioEmits, RadioProps } from './types'\n\ndefineOptions({ name: 'WxRadio', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<RadioProps>(), {\n label: undefined,\n disabled: undefined,\n size: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<RadioEmits>()\n\nconst model = defineModel<ChoiceValue>({ default: null })\n\nconst group = inject(radioGroupKey, null)\nconst field = useFormField(props)\n\nconst checked = computed(() =>\n group ? group.modelValue.value === props.value : model.value === props.value,\n)\n\nconst disabled = computed(() => props.disabled || group?.disabled.value || field.disabled.value)\nconst size = computed(() => props.size ?? group?.size.value ?? field.size.value)\n\nconst classes = computed(() => [\n 'wx-radio',\n `wx-radio--${size.value}`,\n { 'is-checked': checked.value, 'is-disabled': disabled.value },\n])\n\nfunction onChange() {\n if (group) group.toggle(props.value, true)\n else model.value = props.value\n emit('change', props.value)\n}\n</script>\n\n<template>\n <label :class=\"classes\">\n <input\n :id=\"field.id.value\"\n v-bind=\"$attrs\"\n class=\"wx-radio__native\"\n type=\"radio\"\n :name=\"name ?? group?.name.value\"\n :checked=\"checked\"\n :disabled=\"disabled\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n @change=\"onChange\"\n />\n\n <span class=\"wx-radio__box\" aria-hidden=\"true\">\n <span class=\"wx-radio__dot\" />\n </span>\n\n <span v-if=\"label || $slots.default\" class=\"wx-radio__label\">\n <slot>{{ label }}</slot>\n </span>\n </label>\n</template>\n\n<style scoped>\n.wx-radio {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-8);\n cursor: pointer;\n user-select: none;\n color: var(--wx-text-default);\n}\n\n.wx-radio.is-disabled {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-radio__native {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n}\n\n.wx-radio__box {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n box-sizing: border-box;\n width: var(--wx-radio-size, 20px);\n height: var(--wx-radio-size, 20px);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-strong);\n border-radius: var(--wx-radius-full);\n transition:\n border-color var(--wx-duration-fast) var(--wx-easing-standard),\n box-shadow var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-radio--sm {\n --wx-radio-size: 16px;\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-radio--md {\n --wx-radio-size: 20px;\n font-size: var(--wx-font-size-md);\n}\n\n.wx-radio--lg {\n --wx-radio-size: 24px;\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-radio__dot {\n width: 50%;\n height: 50%;\n border-radius: var(--wx-radius-full);\n background: var(--wx-color-primary);\n transform: scale(0);\n transition: transform var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-radio:hover:not(.is-disabled) .wx-radio__box {\n border-color: var(--wx-color-primary);\n}\n\n.wx-radio.is-checked .wx-radio__box {\n border-color: var(--wx-color-primary);\n}\n\n.wx-radio.is-checked .wx-radio__dot {\n transform: scale(1);\n}\n\n.wx-radio.is-disabled .wx-radio__box {\n background: var(--wx-bg-disabled);\n border-color: var(--wx-border-default);\n}\n\n.wx-radio.is-disabled .wx-radio__dot {\n background: var(--wx-color-primary-disabled);\n}\n\n.wx-radio__native:focus-visible + .wx-radio__box {\n border-color: var(--wx-color-primary);\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-radio__label {\n line-height: var(--wx-font-line-height-normal);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wx-radio__box,\n .wx-radio__dot {\n transition: none;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, provide } from 'vue'\nimport {\n radioGroupKey,\n useFormField,\n useId,\n type ChoiceValue,\n} from '../../composables/useFormField'\nimport WxRadio from '../Radio/Radio.vue'\nimport type { RadioGroupEmits, RadioGroupProps } from './types'\n\ndefineOptions({ name: 'WxRadioGroup' })\n\nconst props = withDefaults(defineProps<RadioGroupProps>(), {\n options: undefined,\n disabled: undefined,\n size: undefined,\n name: undefined,\n inline: false,\n})\n\nconst emit = defineEmits<RadioGroupEmits>()\n\nconst model = defineModel<ChoiceValue>({ default: null })\n\nconst field = useFormField(props)\nconst fallbackName = useId('wx-radio-group')\n\n/** A group cannot be the target of a `for`, so the item label becomes a span. */\nfield.item?.registerLabelTarget(undefined)\n\nconst disabled = computed(() => props.disabled ?? field.disabled.value)\nconst size = computed(() => props.size ?? field.size.value)\n\n/**\n * Radios sharing a `name` are one roving-tabindex group in the browser, which is\n * what gives arrow-key navigation for free — so a name is always set.\n */\nconst name = computed(() => props.name ?? fallbackName)\n\nfunction toggle(value: ChoiceValue) {\n if (model.value === value) return\n model.value = value\n emit('change', value)\n}\n\nprovide(radioGroupKey, {\n name,\n modelValue: computed(() => model.value),\n disabled,\n size,\n toggle,\n})\n</script>\n\n<template>\n <div\n :class=\"['wx-radio-group', { 'wx-radio-group--inline': inline }]\"\n role=\"radiogroup\"\n :aria-labelledby=\"field.item ? `${field.item.id.value}-label` : undefined\"\n :aria-describedby=\"field.describedBy.value\"\n >\n <slot>\n <wx-radio\n v-for=\"option in options\"\n :key=\"String(option.value)\"\n :value=\"option.value\"\n :label=\"option.label\"\n :disabled=\"option.disabled\"\n />\n </slot>\n </div>\n</template>\n\n<style scoped>\n.wx-radio-group {\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-8);\n}\n\n.wx-radio-group--inline {\n flex-direction: row;\n flex-wrap: wrap;\n gap: var(--wx-space-16);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref } from 'vue'\nimport { useFormField } from '../../composables/useFormField'\nimport type { RateEmits, RateProps } from './types'\n\ndefineOptions({ name: 'WxRate', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<RateProps>(), {\n max: 5,\n allowHalf: false,\n clearable: true,\n showValue: false,\n readonly: false,\n disabled: undefined,\n size: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<RateEmits>()\n\nconst model = defineModel<number>({ default: 0 })\n\nconst field = useFormField(props)\nconst hovered = ref<number | null>(null)\n\nconst interactive = computed(() => !field.disabled.value && !props.readonly)\n\n/** What the stars show right now: the hovered value while pointing, the model otherwise. */\nconst shown = computed(() => hovered.value ?? model.value ?? 0)\n\nconst stars = computed(() =>\n Array.from({ length: props.max }, (_, index) => {\n const position = index + 1\n const fill = Math.min(Math.max(shown.value - index, 0), 1)\n return { position, full: fill >= 1, half: fill > 0 && fill < 1 }\n }),\n)\n\nconst classes = computed(() => [\n 'wx-rate',\n `wx-rate--${field.size.value}`,\n { 'is-disabled': field.disabled.value, 'is-readonly': props.readonly },\n])\n\n/** Halves come from the pointer landing on the left side of a star. */\nfunction valueAt(position: number, event: MouseEvent): number {\n if (!props.allowHalf) return position\n const target = event.currentTarget as HTMLElement\n const { left, width } = target.getBoundingClientRect()\n return event.clientX - left < width / 2 ? position - 0.5 : position\n}\n\n/** `toggle` is what makes clicking the current value clear it — the arrow keys must not. */\nfunction set(value: number, toggle = false) {\n const next = toggle && props.clearable && model.value === value ? 0 : value\n if (next === model.value) return\n model.value = next\n emit('change', next)\n}\n\nfunction onClick(position: number, event: MouseEvent) {\n if (!interactive.value) return\n set(valueAt(position, event), true)\n}\n\nfunction onHover(position: number, event: MouseEvent) {\n if (!interactive.value) return\n hovered.value = valueAt(position, event)\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (!interactive.value) return\n const step = props.allowHalf ? 0.5 : 1\n const current = model.value ?? 0\n\n if (event.key === 'ArrowRight' || event.key === 'ArrowUp') {\n event.preventDefault()\n set(Math.min(current + step, props.max))\n } else if (event.key === 'ArrowLeft' || event.key === 'ArrowDown') {\n event.preventDefault()\n set(Math.max(current - step, 0))\n } else if (event.key === 'Home') {\n event.preventDefault()\n set(0)\n } else if (event.key === 'End') {\n event.preventDefault()\n set(props.max)\n }\n}\n</script>\n\n<template>\n <div\n :id=\"field.id.value\"\n v-bind=\"$attrs\"\n :class=\"classes\"\n role=\"slider\"\n :tabindex=\"interactive ? 0 : -1\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n :aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n :aria-valuenow=\"model ?? 0\"\n :aria-readonly=\"readonly || undefined\"\n :aria-disabled=\"field.disabled.value || undefined\"\n @keydown=\"onKeydown\"\n @mouseleave=\"hovered = null\"\n >\n <span\n v-for=\"star in stars\"\n :key=\"star.position\"\n class=\"wx-rate__star\"\n :class=\"{ 'is-full': star.full, 'is-half': star.half }\"\n @click=\"onClick(star.position, $event)\"\n @mousemove=\"onHover(star.position, $event)\"\n >\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n class=\"wx-rate__outline\"\n d=\"M12 3.5l2.6 5.3 5.9.9-4.2 4.1 1 5.8-5.3-2.8-5.3 2.8 1-5.8-4.2-4.1 5.9-.9z\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linejoin=\"round\"\n />\n <path\n class=\"wx-rate__fill\"\n d=\"M12 3.5l2.6 5.3 5.9.9-4.2 4.1 1 5.8-5.3-2.8-5.3 2.8 1-5.8-4.2-4.1 5.9-.9z\"\n fill=\"currentColor\"\n />\n </svg>\n </span>\n\n <span v-if=\"showValue\" class=\"wx-rate__value\">{{ model ?? 0 }}</span>\n\n <input v-if=\"name\" type=\"hidden\" :name=\"name\" :value=\"model ?? 0\" />\n </div>\n</template>\n\n<style scoped>\n.wx-rate {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-2);\n color: var(--wx-border-strong);\n}\n\n.wx-rate:focus-visible {\n outline: none;\n border-radius: var(--wx-radius-xs);\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-rate--sm {\n --wx-rate-size: 18px;\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-rate--md {\n --wx-rate-size: 22px;\n font-size: var(--wx-font-size-md);\n}\n\n.wx-rate--lg {\n --wx-rate-size: 28px;\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-rate__star {\n display: inline-flex;\n width: var(--wx-rate-size, 22px);\n height: var(--wx-rate-size, 22px);\n cursor: pointer;\n}\n\n.wx-rate.is-disabled .wx-rate__star,\n.wx-rate.is-readonly .wx-rate__star {\n cursor: default;\n}\n\n.wx-rate.is-disabled {\n opacity: 0.6;\n}\n\n.wx-rate__star svg {\n width: 100%;\n height: 100%;\n overflow: visible;\n}\n\n/* The filled star is clipped to nothing, then revealed whole or by half. */\n.wx-rate__fill {\n color: var(--wx-color-warning);\n clip-path: inset(0 100% 0 0);\n transition: clip-path var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-rate__star.is-full .wx-rate__fill {\n clip-path: inset(0);\n}\n\n.wx-rate__star.is-half .wx-rate__fill {\n clip-path: inset(0 50% 0 0);\n}\n\n.wx-rate__star.is-full,\n.wx-rate__star.is-half {\n color: var(--wx-color-warning);\n}\n\n.wx-rate__value {\n margin-left: var(--wx-space-6);\n color: var(--wx-text-muted);\n font-variant-numeric: tabular-nums;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wx-rate__fill {\n transition: none;\n }\n}\n</style>\n","/**\n * Toolbar glyphs as raw path data, drawn on a 24×24 grid with a 1.7 stroke.\n * Inline rather than an icon package: it is a dozen paths, and a dependency for\n * that would be worse than the duplication.\n */\nexport const richTextIcons: Record<string, string> = {\n bold: 'M7 5h6a3.5 3.5 0 0 1 0 7H7zm0 7h7a3.5 3.5 0 0 1 0 7H7z',\n italic: 'M15 5h-5M14 19H9M13.5 5 10.5 19',\n strike:\n 'M5 12h14M8 8.5A3 3 0 0 1 11 6h2a3 3 0 0 1 3 2.5M16 15.5A3 3 0 0 1 13 18h-2a3 3 0 0 1-3-2.5',\n code: 'm9 8-5 4 5 4M15 8l5 4-5 4',\n bulletList: 'M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01',\n orderedList: 'M10 6h10M10 12h10M10 18h10M4 6h1v4M4 10h2M4 14h2v2H4v2h2',\n blockquote: 'M7 15V9h4v6H7l-2 3M15 15V9h4v6h-4l-2 3',\n hr: 'M4 12h16',\n link: 'M10 13a4 4 0 0 0 5.7.4l2.6-2.6a4 4 0 0 0-5.7-5.7l-1.5 1.5M14 11a4 4 0 0 0-5.7-.4l-2.6 2.6a4 4 0 0 0 5.7 5.7l1.5-1.5',\n table: 'M4 6h16v12H4zM4 10h16M10 10v8M4 14h16',\n image: 'M4 6h16v12H4zM4 15l4-4 4 4 3-3 5 5M9 9.5h.01',\n youtube:\n 'M3 8.5A2.5 2.5 0 0 1 5.5 6h13A2.5 2.5 0 0 1 21 8.5v7a2.5 2.5 0 0 1-2.5 2.5h-13A2.5 2.5 0 0 1 3 15.5zM10.5 9.5l4 2.5-4 2.5z',\n undo: 'M4 9h11a4.5 4.5 0 0 1 0 9h-4M4 9l4-4M4 9l4 4',\n redo: 'M20 9H9a4.5 4.5 0 0 0 0 9h4M20 9l-4-4M20 9l-4 4',\n rowAfter: 'M4 5h16M4 11h16M8 15v6M5 18h6',\n rowBefore: 'M4 19h16M4 13h16M8 3v6M5 6h6',\n columnAfter: 'M5 4v16M11 4v16M15 8h6M18 5v6',\n columnBefore: 'M19 4v16M13 4v16M3 8h6M6 5v6',\n deleteRow: 'M4 8h16M4 16h16M9 12h6',\n deleteColumn: 'M8 4v16M16 4v16M12 9v6',\n deleteTable: 'M5 7h14M9 7V5h6v2M7 7l1 12h8l1-12M10 11v4M14 11v4',\n mergeCells: 'M4 6h16v12H4zM12 6v3M12 15v3M9 12h6M9 12l2-2M9 12l2 2',\n check: 'm5 13 4 4L19 7',\n close: 'M6 6l12 12M18 6 6 18',\n}\n","<script setup lang=\"ts\">\nimport { richTextIcons } from './icons'\n\ndefineOptions({ name: 'WxRichTextToolbarButton' })\n\nwithDefaults(\n defineProps<{\n /** Key into the icon set. Omit it and the `text` shows instead. */\n icon?: string\n /** Short label used for headings, where a glyph reads worse than \"H2\". */\n text?: string\n label: string\n active?: boolean\n disabled?: boolean\n }>(),\n { icon: undefined, text: undefined, active: false, disabled: false },\n)\n\ndefineEmits<{ click: [] }>()\n</script>\n\n<template>\n <button\n type=\"button\"\n class=\"wx-rich-text__tool\"\n :class=\"{ 'is-active': active }\"\n :title=\"label\"\n :aria-label=\"label\"\n :aria-pressed=\"active\"\n :disabled=\"disabled\"\n @click=\"$emit('click')\"\n >\n <svg v-if=\"icon\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path\n :d=\"richTextIcons[icon]\"\n stroke=\"currentColor\"\n stroke-width=\"1.7\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <span v-else class=\"wx-rich-text__tool-text\">{{ text }}</span>\n </button>\n</template>\n\n<style scoped>\n.wx-rich-text__tool {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 30px;\n height: 30px;\n padding: 0;\n background: transparent;\n border: 1px solid transparent;\n border-radius: var(--wx-radius-xs);\n color: var(--wx-text-default);\n cursor: pointer;\n transition:\n background-color var(--wx-duration-fast) var(--wx-easing-standard),\n color var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-rich-text__tool svg {\n width: 18px;\n height: 18px;\n}\n\n.wx-rich-text__tool-text {\n font-size: var(--wx-font-size-sm);\n font-weight: var(--wx-font-weight-semibold);\n}\n\n.wx-rich-text__tool:hover:not(:disabled) {\n background: var(--wx-bg-fill);\n}\n\n.wx-rich-text__tool.is-active {\n background: var(--wx-color-primary-soft);\n color: var(--wx-color-primary);\n}\n\n.wx-rich-text__tool:focus-visible {\n outline: none;\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-rich-text__tool:disabled {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n</style>\n","import type { RichTextTool } from './types'\n\n/**\n * Kept out of the component because `withDefaults` cannot reference a binding\n * declared inside `<script setup>` — it is hoisted out of `setup()`.\n */\nexport const DEFAULT_TOOLS: RichTextTool[] = [\n 'bold',\n 'italic',\n 'strike',\n 'code',\n 'divider',\n 'h2',\n 'h3',\n 'h4',\n 'divider',\n 'bulletList',\n 'orderedList',\n 'blockquote',\n 'hr',\n 'divider',\n 'link',\n 'table',\n 'image',\n 'youtube',\n 'divider',\n 'undo',\n 'redo',\n]\n\nexport const DEFAULT_ACCEPT = [\n 'image/png',\n 'image/jpeg',\n 'image/gif',\n 'image/webp',\n 'image/svg+xml',\n]\n\nexport interface ToolMeta {\n label: string\n icon?: string\n text?: string\n}\n\nexport const TOOL_META: Record<Exclude<RichTextTool, 'divider'>, ToolMeta> = {\n bold: { label: 'Bold', icon: 'bold' },\n italic: { label: 'Italic', icon: 'italic' },\n strike: { label: 'Strikethrough', icon: 'strike' },\n code: { label: 'Inline code', icon: 'code' },\n h2: { label: 'Heading 2', text: 'H2' },\n h3: { label: 'Heading 3', text: 'H3' },\n h4: { label: 'Heading 4', text: 'H4' },\n bulletList: { label: 'Bulleted list', icon: 'bulletList' },\n orderedList: { label: 'Numbered list', icon: 'orderedList' },\n blockquote: { label: 'Quote', icon: 'blockquote' },\n hr: { label: 'Divider', icon: 'hr' },\n link: { label: 'Link', icon: 'link' },\n table: { label: 'Table', icon: 'table' },\n image: { label: 'Image', icon: 'image' },\n youtube: { label: 'YouTube video', icon: 'youtube' },\n undo: { label: 'Undo', icon: 'undo' },\n redo: { label: 'Redo', icon: 'redo' },\n}\n\n/** Shown as a second row while the caret sits inside a table. */\nexport const TABLE_TOOLS = [\n { key: 'addRowAfter', label: 'Row below', icon: 'rowAfter' },\n { key: 'addRowBefore', label: 'Row above', icon: 'rowBefore' },\n { key: 'addColumnAfter', label: 'Column after', icon: 'columnAfter' },\n { key: 'addColumnBefore', label: 'Column before', icon: 'columnBefore' },\n { key: 'deleteRow', label: 'Delete row', icon: 'deleteRow' },\n { key: 'deleteColumn', label: 'Delete column', icon: 'deleteColumn' },\n { key: 'mergeOrSplit', label: 'Merge or split cells', icon: 'mergeCells' },\n { key: 'deleteTable', label: 'Delete table', icon: 'deleteTable' },\n] as const\n\nexport type TableToolKey = (typeof TABLE_TOOLS)[number]['key']\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue'\nimport { EditorContent, useEditor } from '@tiptap/vue-3'\nimport StarterKit from '@tiptap/starter-kit'\nimport { TableKit } from '@tiptap/extension-table'\nimport Image from '@tiptap/extension-image'\nimport Youtube from '@tiptap/extension-youtube'\nimport FileHandler from '@tiptap/extension-file-handler'\nimport { useFormField } from '../../composables/useFormField'\nimport WxRichTextToolbarButton from './ToolbarButton.vue'\nimport { DEFAULT_ACCEPT, DEFAULT_TOOLS, TABLE_TOOLS, TOOL_META, type TableToolKey } from './tools'\nimport type { RichTextEmits, RichTextProps, RichTextTool } from './types'\n\ndefineOptions({ name: 'WxRichText', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<RichTextProps>(), {\n placeholder: undefined,\n disabled: undefined,\n readonly: false,\n size: undefined,\n status: undefined,\n id: undefined,\n ariaLabel: undefined,\n minHeight: '220px',\n tools: () => DEFAULT_TOOLS,\n upload: undefined,\n pickImage: undefined,\n accept: () => DEFAULT_ACCEPT,\n})\n\nconst emit = defineEmits<RichTextEmits>()\n\nconst model = defineModel<string>({ default: '' })\n\nconst field = useFormField(props)\nconst focused = ref(false)\nconst uploading = ref(0)\nconst fileInput = ref<HTMLInputElement | null>(null)\n\n/** The link and YouTube buttons open one shared bar rather than a `prompt()`. */\nconst prompt = ref<{ kind: 'link' | 'youtube'; value: string } | null>(null)\n\nconst editable = computed(() => !field.disabled.value && !props.readonly)\n\n/** Tiptap renders `<p></p>` for an empty document; a backend wants an empty string. */\nfunction readHtml(): string {\n const instance = editor.value\n if (!instance || instance.isEmpty) return ''\n return instance.getHTML()\n}\n\nconst editor = useEditor({\n content: model.value ?? '',\n editable: editable.value,\n extensions: [\n StarterKit.configure({\n link: {\n openOnClick: false,\n autolink: true,\n HTMLAttributes: { rel: 'noopener noreferrer nofollow', target: '_blank' },\n },\n }),\n TableKit.configure({ table: { resizable: true } }),\n Image.configure({ HTMLAttributes: { class: 'wx-rich-text__image' } }),\n Youtube.configure({ nocookie: true, width: 640, height: 360 }),\n FileHandler.configure({\n allowedMimeTypes: props.accept,\n onDrop: (_editor, files, pos) => void uploadFiles(files, pos),\n onPaste: (_editor, files) => void uploadFiles(files),\n }),\n ],\n onUpdate: () => {\n const html = readHtml()\n model.value = html\n emit('change', html)\n },\n onFocus: () => {\n focused.value = true\n emit('focus')\n },\n onBlur: () => {\n focused.value = false\n emit('blur')\n },\n})\n\n/** Only replaces the document when the value really differs, or the caret jumps. */\nwatch(model, (value) => {\n const instance = editor.value\n if (!instance) return\n if ((value ?? '') === readHtml()) return\n instance.commands.setContent(value ?? '', { emitUpdate: false })\n})\n\nwatch(editable, (value) => editor.value?.setEditable(value))\n\nconst isEmpty = computed(() => editor.value?.isEmpty ?? true)\nconst inTable = computed(() => editor.value?.isActive('table') ?? false)\n\nconst classes = computed(() => [\n 'wx-rich-text',\n `wx-rich-text--${field.size.value}`,\n {\n [`wx-rich-text--${field.status.value}`]: field.status.value !== 'default',\n 'is-focused': focused.value,\n 'is-disabled': field.disabled.value,\n 'is-readonly': props.readonly,\n },\n])\n\nfunction insertImage(url: string, alt?: string, pos?: number) {\n const instance = editor.value\n if (!instance) return\n const at = pos ?? instance.state.selection.anchor\n instance\n .chain()\n .focus()\n .insertContentAt(at, { type: 'image', attrs: { src: url, alt } })\n .run()\n}\n\n/**\n * Uploads happen one file at a time and insert only on success — a failed upload\n * leaves nothing behind to clean up.\n */\nasync function uploadFiles(files: File[], pos?: number) {\n if (!props.upload) return\n for (const file of files) {\n uploading.value += 1\n try {\n const result = await props.upload(file)\n insertImage(result.url, result.alt, pos)\n } catch (error) {\n emit('uploadError', error, file)\n } finally {\n uploading.value -= 1\n }\n }\n}\n\nasync function onImageButton() {\n if (props.pickImage) {\n const url = await props.pickImage()\n if (url) insertImage(url)\n return\n }\n fileInput.value?.click()\n}\n\nfunction onFilePicked(event: Event) {\n const input = event.target as HTMLInputElement\n const files = Array.from(input.files ?? [])\n input.value = ''\n void uploadFiles(files)\n}\n\nfunction openPrompt(kind: 'link' | 'youtube') {\n const current = kind === 'link' ? (editor.value?.getAttributes('link').href ?? '') : ''\n prompt.value = { kind, value: String(current) }\n}\n\nfunction applyPrompt() {\n const instance = editor.value\n const current = prompt.value\n if (!instance || !current) return\n const value = current.value.trim()\n\n if (current.kind === 'link') {\n if (value) instance.chain().focus().extendMarkRange('link').setLink({ href: value }).run()\n else instance.chain().focus().extendMarkRange('link').unsetLink().run()\n } else if (value) {\n instance.commands.setYoutubeVideo({ src: value })\n }\n\n prompt.value = null\n}\n\n/** Whether a tool should render at all — the image button needs somewhere to get a file. */\nfunction toolVisible(tool: RichTextTool): boolean {\n if (tool === 'image') return Boolean(props.upload || props.pickImage)\n return true\n}\n\nconst visibleTools = computed(() => props.tools.filter(toolVisible))\n\nfunction isActive(tool: RichTextTool): boolean {\n const instance = editor.value\n if (!instance) return false\n switch (tool) {\n case 'h2':\n return instance.isActive('heading', { level: 2 })\n case 'h3':\n return instance.isActive('heading', { level: 3 })\n case 'h4':\n return instance.isActive('heading', { level: 4 })\n default:\n return instance.isActive(tool)\n }\n}\n\nfunction run(tool: RichTextTool) {\n const instance = editor.value\n if (!instance) return\n const chain = instance.chain().focus()\n\n switch (tool) {\n case 'bold':\n chain.toggleBold().run()\n break\n case 'italic':\n chain.toggleItalic().run()\n break\n case 'strike':\n chain.toggleStrike().run()\n break\n case 'code':\n chain.toggleCode().run()\n break\n case 'h2':\n chain.toggleHeading({ level: 2 }).run()\n break\n case 'h3':\n chain.toggleHeading({ level: 3 }).run()\n break\n case 'h4':\n chain.toggleHeading({ level: 4 }).run()\n break\n case 'bulletList':\n chain.toggleBulletList().run()\n break\n case 'orderedList':\n chain.toggleOrderedList().run()\n break\n case 'blockquote':\n chain.toggleBlockquote().run()\n break\n case 'hr':\n chain.setHorizontalRule().run()\n break\n case 'undo':\n chain.undo().run()\n break\n case 'redo':\n chain.redo().run()\n break\n case 'table':\n chain.insertTable({ rows: 3, cols: 3, withHeaderRow: true }).run()\n break\n case 'link':\n openPrompt('link')\n break\n case 'youtube':\n openPrompt('youtube')\n break\n case 'image':\n void onImageButton()\n break\n }\n}\n\nfunction runTableCommand(key: TableToolKey) {\n const instance = editor.value\n if (!instance) return\n const chain = instance.chain().focus() as unknown as Record<string, () => { run: () => void }>\n chain[key]().run()\n}\n\ndefineExpose({\n editor,\n focus: () => editor.value?.commands.focus(),\n clear: () => editor.value?.commands.clearContent(true),\n})\n</script>\n\n<template>\n <div :class=\"classes\">\n <div class=\"wx-rich-text__toolbar\" role=\"toolbar\" :aria-label=\"ariaLabel ?? 'Text formatting'\">\n <template v-for=\"(tool, index) in visibleTools\" :key=\"`${tool}-${index}`\">\n <span v-if=\"tool === 'divider'\" class=\"wx-rich-text__divider\" aria-hidden=\"true\" />\n <wx-rich-text-toolbar-button\n v-else\n :icon=\"TOOL_META[tool].icon\"\n :text=\"TOOL_META[tool].text\"\n :label=\"TOOL_META[tool].label\"\n :active=\"isActive(tool)\"\n :disabled=\"!editable\"\n @click=\"run(tool)\"\n />\n </template>\n\n <span v-if=\"uploading > 0\" class=\"wx-rich-text__uploading\">Uploading…</span>\n </div>\n\n <div v-if=\"inTable && editable\" class=\"wx-rich-text__toolbar wx-rich-text__toolbar--table\">\n <wx-rich-text-toolbar-button\n v-for=\"tool in TABLE_TOOLS\"\n :key=\"tool.key\"\n :icon=\"tool.icon\"\n :label=\"tool.label\"\n @click=\"runTableCommand(tool.key)\"\n />\n </div>\n\n <form v-if=\"prompt\" class=\"wx-rich-text__prompt\" @submit.prevent=\"applyPrompt\">\n <label class=\"wx-rich-text__prompt-label\" :for=\"`${field.id.value}-prompt`\">\n {{ prompt.kind === 'link' ? 'Link address' : 'YouTube URL' }}\n </label>\n <input\n :id=\"`${field.id.value}-prompt`\"\n v-model=\"prompt.value\"\n class=\"wx-rich-text__prompt-input\"\n type=\"url\"\n :placeholder=\"prompt.kind === 'link' ? 'https://example.com' : 'https://youtu.be/…'\"\n @keydown.esc=\"prompt = null\"\n />\n <wx-rich-text-toolbar-button icon=\"check\" label=\"Apply\" @click=\"applyPrompt\" />\n <wx-rich-text-toolbar-button icon=\"close\" label=\"Cancel\" @click=\"prompt = null\" />\n </form>\n\n <div class=\"wx-rich-text__body\" :style=\"{ minHeight }\">\n <span v-if=\"placeholder && isEmpty\" class=\"wx-rich-text__placeholder\">{{ placeholder }}</span>\n <editor-content\n :editor=\"editor\"\n class=\"wx-rich-text__content\"\n :aria-describedby=\"field.describedBy.value\"\n />\n </div>\n\n <input\n v-if=\"upload && !pickImage\"\n ref=\"fileInput\"\n class=\"wx-rich-text__file\"\n type=\"file\"\n :accept=\"accept.join(',')\"\n multiple\n @change=\"onFilePicked\"\n />\n </div>\n</template>\n\n<style scoped>\n.wx-rich-text {\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n width: 100%;\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-control);\n color: var(--wx-text-default);\n transition: border-color var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-rich-text.is-focused {\n border-color: var(--wx-border-focus);\n}\n\n.wx-rich-text--error,\n.wx-rich-text--error.is-focused {\n border-color: var(--wx-color-danger);\n}\n\n.wx-rich-text--success {\n border-color: var(--wx-color-success);\n}\n\n.wx-rich-text--warning {\n border-color: var(--wx-color-warning);\n}\n\n.wx-rich-text.is-disabled {\n background: var(--wx-bg-disabled);\n color: var(--wx-text-disabled);\n}\n\n.wx-rich-text__toolbar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--wx-space-2);\n padding: var(--wx-space-6);\n border-bottom: 1px solid var(--wx-border-muted);\n}\n\n.wx-rich-text__toolbar--table {\n background: var(--wx-bg-subtle);\n}\n\n.wx-rich-text__divider {\n width: 1px;\n height: 18px;\n margin: 0 var(--wx-space-4);\n background: var(--wx-border-default);\n}\n\n.wx-rich-text__uploading {\n margin-left: auto;\n padding: 0 var(--wx-space-8);\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-rich-text__prompt {\n display: flex;\n align-items: center;\n gap: var(--wx-space-8);\n padding: var(--wx-space-8);\n background: var(--wx-bg-subtle);\n border-bottom: 1px solid var(--wx-border-muted);\n}\n\n.wx-rich-text__prompt-label {\n flex: 0 0 auto;\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-rich-text__prompt-input {\n flex: 1 1 auto;\n min-width: 0;\n height: var(--wx-size-control-sm);\n padding: 0 var(--wx-space-10);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-xs);\n outline: none;\n color: inherit;\n font-family: inherit;\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-rich-text__prompt-input:focus {\n border-color: var(--wx-border-focus);\n}\n\n.wx-rich-text__body {\n position: relative;\n flex: 1 1 auto;\n padding: var(--wx-space-12) var(--wx-space-16);\n}\n\n.wx-rich-text__placeholder {\n position: absolute;\n top: var(--wx-space-12);\n left: var(--wx-space-16);\n color: var(--wx-text-placeholder);\n pointer-events: none;\n}\n\n.wx-rich-text__file {\n display: none;\n}\n\n/* The editing surface itself is rendered by ProseMirror. */\n.wx-rich-text__content :deep(.ProseMirror) {\n outline: none;\n min-height: inherit;\n line-height: var(--wx-font-line-height-relaxed);\n}\n\n/*\n * Host applications decorate content tags globally — VitePress, which renders these\n * docs, gives every h2 a top border and 24px of padding, and turns tables into\n * `display: block`. The editing surface has to look the same wherever it is\n * embedded, so anything a host is likely to set is stated here instead of inherited.\n */\n.wx-rich-text__content :deep(h1),\n.wx-rich-text__content :deep(h2),\n.wx-rich-text__content :deep(h3),\n.wx-rich-text__content :deep(h4),\n.wx-rich-text__content :deep(h5),\n.wx-rich-text__content :deep(h6) {\n margin: var(--wx-space-18) 0 var(--wx-space-8);\n padding: 0;\n border: 0;\n color: var(--wx-text-strong);\n font-weight: var(--wx-font-weight-semibold);\n line-height: var(--wx-font-line-height-tight);\n}\n\n.wx-rich-text__content :deep(p) {\n margin: 0 0 var(--wx-space-12);\n}\n\n/* Nothing pushes the document away from the top or bottom edge of the field. */\n.wx-rich-text__content :deep(.ProseMirror > :first-child) {\n margin-top: 0;\n}\n\n.wx-rich-text__content :deep(.ProseMirror > :last-child) {\n margin-bottom: 0;\n}\n\n.wx-rich-text__content :deep(h2) {\n font-size: var(--wx-font-size-2xl);\n}\n\n.wx-rich-text__content :deep(h3) {\n font-size: var(--wx-font-size-xl);\n}\n\n.wx-rich-text__content :deep(h4) {\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-rich-text__content :deep(ul),\n.wx-rich-text__content :deep(ol) {\n margin: 0 0 var(--wx-space-12);\n padding-left: var(--wx-space-24);\n}\n\n.wx-rich-text__content :deep(blockquote) {\n margin: 0 0 var(--wx-space-12);\n padding-left: var(--wx-space-16);\n border-left: 3px solid var(--wx-color-primary-soft);\n color: var(--wx-text-muted);\n}\n\n.wx-rich-text__content :deep(a) {\n color: var(--wx-text-link);\n text-decoration: underline;\n}\n\n.wx-rich-text__content :deep(code) {\n padding: 2px var(--wx-space-4);\n background: var(--wx-bg-fill);\n border-radius: var(--wx-radius-xs);\n font-family: var(--wx-font-family-mono);\n font-size: 0.9em;\n}\n\n.wx-rich-text__content :deep(pre) {\n margin: 0 0 var(--wx-space-12);\n padding: var(--wx-space-12);\n background: var(--wx-bg-inverse);\n border-radius: var(--wx-radius-xs);\n color: var(--wx-text-inverse);\n overflow-x: auto;\n}\n\n.wx-rich-text__content :deep(hr) {\n margin: var(--wx-space-18) 0;\n border: none;\n border-top: 1px solid var(--wx-border-default);\n}\n\n.wx-rich-text__content :deep(img),\n.wx-rich-text__content :deep(iframe) {\n max-width: 100%;\n border-radius: var(--wx-radius-xs);\n}\n\n.wx-rich-text__content :deep(img.ProseMirror-selectednode) {\n outline: 2px solid var(--wx-color-primary);\n}\n\n.wx-rich-text__content :deep(table) {\n /* Stated because hosts turn tables into `display: block` for horizontal scrolling. */\n display: table;\n width: 100%;\n margin: 0 0 var(--wx-space-12);\n border-collapse: collapse;\n table-layout: fixed;\n overflow: hidden;\n}\n\n.wx-rich-text__content :deep(th),\n.wx-rich-text__content :deep(td) {\n position: relative;\n padding: var(--wx-space-6) var(--wx-space-10);\n border: 1px solid var(--wx-border-default);\n vertical-align: top;\n}\n\n.wx-rich-text__content :deep(th) {\n background: var(--wx-bg-fill);\n font-weight: var(--wx-font-weight-semibold);\n text-align: left;\n}\n\n.wx-rich-text__content :deep(.selectedCell::after) {\n content: '';\n position: absolute;\n inset: 0;\n background: var(--wx-color-primary-soft);\n pointer-events: none;\n}\n\n.wx-rich-text__content :deep(.column-resize-handle) {\n position: absolute;\n top: 0;\n right: -2px;\n bottom: 0;\n width: 4px;\n background: var(--wx-color-primary);\n cursor: col-resize;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue'\nimport {\n ComboboxAnchor,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxInput,\n ComboboxItem,\n ComboboxItemIndicator,\n ComboboxPortal,\n ComboboxRoot,\n ComboboxTrigger,\n ComboboxViewport,\n} from 'reka-ui'\nimport { useFormField } from '../../composables/useFormField'\nimport type { SelectEmits, SelectModelValue, SelectProps, SelectValue } from './types'\n\ndefineOptions({ name: 'WxSelect', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<SelectProps>(), {\n options: () => [],\n multiple: false,\n filterable: false,\n clearable: false,\n placeholder: undefined,\n emptyText: 'Nothing found',\n teleport: true,\n disabled: undefined,\n size: undefined,\n status: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<SelectEmits>()\n\nconst model = defineModel<SelectModelValue>({ default: null })\n\nconst field = useFormField(props)\nconst open = ref(false)\n\n/**\n * The text in the search field. Controlled here rather than left to the combobox:\n * with `multiple` the input has no display value to fall back on and renders the\n * model itself, so picking two tags leaves \"news,releases\" sitting in the box.\n */\nconst searchText = ref('')\n\n/** Reka wants an array for multiple and a bare value otherwise. */\nconst selection = computed({\n get: () => (props.multiple ? ((model.value as SelectValue[]) ?? []) : (model.value ?? null)),\n set: (value) => {\n model.value = value as SelectModelValue\n emit('change', value as SelectModelValue)\n },\n})\n\nconst labelOf = (value: SelectValue) =>\n props.options.find((option) => option.value === value)?.label ?? String(value)\n\nconst selectedOptions = computed(() => {\n if (!props.multiple) return []\n return ((model.value as SelectValue[]) ?? []).map((value) => ({ value, label: labelOf(value) }))\n})\n\nconst singleLabel = computed(() => {\n if (props.multiple) return ''\n const value = model.value as SelectValue | null\n return value === null || value === undefined ? '' : labelOf(value)\n})\n\nconst hasSelection = computed(() =>\n props.multiple\n ? selectedOptions.value.length > 0\n : model.value !== null && model.value !== undefined && model.value !== '',\n)\n\nconst showClear = computed(() => props.clearable && !field.disabled.value && hasSelection.value)\n\nconst classes = computed(() => [\n 'wx-select',\n `wx-select--${field.size.value}`,\n {\n [`wx-select--${field.status.value}`]: field.status.value !== 'default',\n 'is-open': open.value,\n 'is-disabled': field.disabled.value,\n 'is-multiple': props.multiple,\n },\n])\n\n/** A pick clears the search in multiple mode and shows the label in single mode. */\nwatch(\n () => model.value,\n () => {\n searchText.value = props.multiple ? '' : singleLabel.value\n },\n { immediate: true },\n)\n\nwatch(open, (value) => {\n if (value) {\n emit('open')\n return\n }\n searchText.value = props.multiple ? '' : singleLabel.value\n emit('close')\n})\n\n/** Clicking the field is how everyone expects a select to open. */\nfunction openList() {\n if (!field.disabled.value) open.value = true\n}\n\n/**\n * What a filterable field shows once a value is picked. Without it the input falls\n * back to the raw value, so choosing \"Maria Kovalenko\" leaves \"12\" in the box.\n */\nfunction displayValue(value: unknown): string {\n return value === null || value === undefined ? '' : labelOf(value as SelectValue)\n}\n\n/**\n * Reka filters the list itself and keeps no public search term, so the value is read\n * straight off the input — that is what a caller loading options from a backend needs.\n */\nfunction onSearch(event: Event) {\n emit('search', (event.target as HTMLInputElement).value)\n}\n\nfunction clear() {\n model.value = props.multiple ? [] : null\n emit('change', model.value)\n emit('clear')\n}\n\nfunction removeTag(value: SelectValue) {\n const next = ((model.value as SelectValue[]) ?? []).filter((item) => item !== value)\n model.value = next\n emit('change', next)\n}\n</script>\n\n<template>\n <combobox-root\n v-model=\"selection\"\n v-model:open=\"open\"\n :multiple=\"multiple\"\n :disabled=\"field.disabled.value\"\n :name=\"name\"\n :ignore-filter=\"!filterable\"\n :open-on-click=\"true\"\n :class=\"classes\"\n as=\"div\"\n >\n <combobox-anchor class=\"wx-select__anchor\" as=\"div\" @click=\"openList\">\n <div class=\"wx-select__value\">\n <template v-if=\"multiple\">\n <span\n v-for=\"option in selectedOptions\"\n :key=\"String(option.value)\"\n class=\"wx-select__tag\"\n >\n {{ option.label }}\n <button\n v-if=\"!field.disabled.value\"\n class=\"wx-select__tag-remove\"\n type=\"button\"\n tabindex=\"-1\"\n :aria-label=\"`Remove ${option.label}`\"\n @click.stop=\"removeTag(option.value)\"\n >\n ✕\n </button>\n </span>\n </template>\n\n <combobox-input\n v-if=\"filterable\"\n :id=\"field.id.value\"\n v-bind=\"$attrs\"\n v-model=\"searchText\"\n class=\"wx-select__input\"\n :placeholder=\"placeholder\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n :aria-invalid=\"field.status.value === 'error' || undefined\"\n :display-value=\"multiple ? undefined : displayValue\"\n auto-focus\n @input=\"onSearch\"\n />\n\n <template v-else>\n <span v-if=\"!multiple && hasSelection\" class=\"wx-select__single\">{{ singleLabel }}</span>\n <span v-else-if=\"!hasSelection\" class=\"wx-select__placeholder\">{{ placeholder }}</span>\n </template>\n </div>\n\n <button\n v-if=\"showClear\"\n class=\"wx-select__clear\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Clear\"\n @click.stop=\"clear\"\n >\n ✕\n </button>\n\n <combobox-trigger\n :id=\"filterable ? undefined : field.id.value\"\n class=\"wx-select__toggle\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n >\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"m4 6 4 4 4-4\"\n stroke=\"currentColor\"\n stroke-width=\"1.6\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </combobox-trigger>\n </combobox-anchor>\n\n <combobox-portal :disabled=\"!teleport\">\n <combobox-content class=\"wx-select__content\" position=\"popper\" :side-offset=\"4\">\n <combobox-viewport class=\"wx-select__viewport\">\n <combobox-empty class=\"wx-select__empty\">{{ emptyText }}</combobox-empty>\n\n <slot>\n <combobox-item\n v-for=\"option in options\"\n :key=\"String(option.value)\"\n class=\"wx-select__option\"\n :value=\"option.value\"\n :disabled=\"option.disabled\"\n >\n <span class=\"wx-select__option-label\">{{ option.label }}</span>\n <combobox-item-indicator class=\"wx-select__check\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"m3.5 8.5 3 3 6-6\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </combobox-item-indicator>\n </combobox-item>\n </slot>\n </combobox-viewport>\n </combobox-content>\n </combobox-portal>\n </combobox-root>\n</template>\n\n<style scoped>\n.wx-select {\n display: block;\n width: 100%;\n}\n\n.wx-select__anchor {\n display: flex;\n align-items: center;\n gap: var(--wx-space-6);\n box-sizing: border-box;\n min-height: var(--wx-size-control-md);\n padding: 0 var(--wx-space-6) 0 var(--wx-space-12);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-control);\n color: var(--wx-text-default);\n font-size: var(--wx-font-size-md);\n cursor: pointer;\n transition: border-color var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-select--sm .wx-select__anchor {\n min-height: var(--wx-size-control-sm);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-select--lg .wx-select__anchor {\n min-height: var(--wx-size-control-lg);\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-select__anchor:hover {\n border-color: var(--wx-border-strong);\n}\n\n.wx-select.is-open .wx-select__anchor {\n border-color: var(--wx-border-focus);\n}\n\n.wx-select--error .wx-select__anchor,\n.wx-select--error.is-open .wx-select__anchor {\n border-color: var(--wx-color-danger);\n}\n\n.wx-select--success .wx-select__anchor {\n border-color: var(--wx-color-success);\n}\n\n.wx-select--warning .wx-select__anchor {\n border-color: var(--wx-color-warning);\n}\n\n.wx-select.is-disabled .wx-select__anchor {\n background: var(--wx-bg-disabled);\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-select__value {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--wx-space-4);\n flex: 1 1 auto;\n min-width: 0;\n padding: var(--wx-space-4) 0;\n}\n\n.wx-select__single,\n.wx-select__placeholder {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.wx-select__placeholder {\n color: var(--wx-text-placeholder);\n}\n\n.wx-select__input {\n flex: 1 1 60px;\n min-width: 0;\n padding: 0;\n background: transparent;\n border: none;\n outline: none;\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n}\n\n.wx-select__input::placeholder {\n color: var(--wx-text-placeholder);\n}\n\n.wx-select__tag {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-4);\n padding: 2px var(--wx-space-6);\n background: var(--wx-bg-fill);\n border-radius: var(--wx-radius-xs);\n font-size: var(--wx-font-size-sm);\n line-height: var(--wx-font-line-height-tight);\n}\n\n.wx-select__tag-remove,\n.wx-select__clear {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n background: transparent;\n border: none;\n border-radius: var(--wx-radius-full);\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-xs);\n line-height: 1;\n cursor: pointer;\n}\n\n.wx-select__tag-remove:hover,\n.wx-select__clear:hover {\n color: var(--wx-text-default);\n}\n\n.wx-select__clear {\n flex: 0 0 auto;\n width: 18px;\n height: 18px;\n}\n\n.wx-select__toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 24px;\n height: 24px;\n padding: 0;\n background: transparent;\n border: none;\n color: var(--wx-text-muted);\n cursor: inherit;\n transition: transform var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-select__toggle svg {\n width: 16px;\n height: 16px;\n}\n\n.wx-select.is-open .wx-select__toggle {\n transform: rotate(180deg);\n}\n</style>\n\n<style>\n/* The list is teleported, so its styles cannot be scoped to the component. */\n.wx-select__content {\n z-index: var(--wx-z-index-dropdown);\n box-sizing: border-box;\n width: var(--reka-combobox-trigger-width);\n max-height: 280px;\n padding: var(--wx-space-4);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-sm);\n box-shadow: var(--wx-shadow-popover);\n color: var(--wx-text-default);\n font-family: var(--wx-font-family-sans);\n font-size: var(--wx-font-size-md);\n overflow: hidden;\n}\n\n.wx-select__viewport {\n max-height: 272px;\n overflow-y: auto;\n}\n\n.wx-select__option {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--wx-space-8);\n padding: var(--wx-space-6) var(--wx-space-10);\n border-radius: var(--wx-radius-xs);\n cursor: pointer;\n user-select: none;\n}\n\n.wx-select__option[data-highlighted] {\n background: var(--wx-bg-fill);\n outline: none;\n}\n\n.wx-select__option[data-state='checked'] {\n color: var(--wx-color-primary);\n font-weight: var(--wx-font-weight-medium);\n}\n\n.wx-select__option[data-disabled] {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-select__option-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.wx-select__check {\n display: inline-flex;\n flex: 0 0 auto;\n color: var(--wx-color-primary);\n}\n\n.wx-select__check svg {\n width: 16px;\n height: 16px;\n}\n\n.wx-select__empty {\n padding: var(--wx-space-10);\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-sm);\n text-align: center;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { SliderRange, SliderRoot, SliderThumb, SliderTrack } from 'reka-ui'\nimport { useFormField } from '../../composables/useFormField'\nimport type { SliderEmits, SliderModelValue, SliderProps } from './types'\n\ndefineOptions({ name: 'WxSlider', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<SliderProps>(), {\n min: 0,\n max: 100,\n step: 1,\n range: false,\n minStepsBetweenThumbs: 0,\n showValue: false,\n marks: undefined,\n disabled: undefined,\n size: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<SliderEmits>()\n\nconst model = defineModel<SliderModelValue>({ default: null })\n\nconst field = useFormField(props)\n\n/**\n * The underlying slider always works with an array. A single slider keeps a plain\n * number in the model, because that is what a caller wants to store.\n */\nconst values = computed<number[]>(() => {\n if (props.range) {\n const pair = Array.isArray(model.value) ? model.value : []\n return [pair[0] ?? props.min, pair[1] ?? props.max]\n }\n const single = Array.isArray(model.value) ? model.value[0] : model.value\n return [single ?? props.min]\n})\n\nfunction onUpdate(next: number[] | undefined) {\n if (!next) return\n const value = props.range ? [...next] : next[0]\n model.value = value\n emit('change', value)\n}\n\nconst marks = computed(() =>\n Object.entries(props.marks ?? {}).map(([value, label]) => ({\n value: Number(value),\n label,\n offset: ((Number(value) - props.min) / (props.max - props.min)) * 100,\n })),\n)\n\nconst classes = computed(() => [\n 'wx-slider',\n `wx-slider--${field.size.value}`,\n { 'is-disabled': field.disabled.value, 'is-range': props.range },\n])\n</script>\n\n<template>\n <div :class=\"classes\">\n <div class=\"wx-slider__row\">\n <slider-root\n :id=\"field.id.value\"\n v-bind=\"$attrs\"\n class=\"wx-slider__root\"\n :model-value=\"values\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :disabled=\"field.disabled.value\"\n :min-steps-between-thumbs=\"minStepsBetweenThumbs\"\n :name=\"name\"\n @update:model-value=\"onUpdate\"\n >\n <slider-track class=\"wx-slider__track\">\n <slider-range class=\"wx-slider__range\" />\n </slider-track>\n\n <slider-thumb\n v-for=\"index in values.length\"\n :key=\"index\"\n class=\"wx-slider__thumb\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n />\n </slider-root>\n\n <span v-if=\"showValue\" class=\"wx-slider__value\">\n {{ range ? `${values[0]} — ${values[1]}` : values[0] }}\n </span>\n </div>\n\n <div v-if=\"marks.length\" class=\"wx-slider__marks\" aria-hidden=\"true\">\n <span\n v-for=\"mark in marks\"\n :key=\"mark.value\"\n class=\"wx-slider__mark\"\n :style=\"{ left: `${mark.offset}%` }\"\n >\n {{ mark.label }}\n </span>\n </div>\n </div>\n</template>\n\n<style scoped>\n.wx-slider {\n display: block;\n width: 100%;\n}\n\n.wx-slider__row {\n display: flex;\n align-items: center;\n gap: var(--wx-space-16);\n}\n\n.wx-slider__root {\n position: relative;\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n height: var(--wx-size-control-md);\n touch-action: none;\n user-select: none;\n}\n\n.wx-slider--sm .wx-slider__root {\n height: var(--wx-size-control-sm);\n}\n\n.wx-slider--lg .wx-slider__root {\n height: var(--wx-size-control-lg);\n}\n\n.wx-slider__track {\n position: relative;\n flex: 1 1 auto;\n height: 4px;\n background: var(--wx-bg-fill-hover);\n border-radius: var(--wx-radius-full);\n}\n\n.wx-slider__range {\n position: absolute;\n height: 100%;\n background: var(--wx-color-primary);\n border-radius: var(--wx-radius-full);\n}\n\n.wx-slider__thumb {\n display: block;\n width: 18px;\n height: 18px;\n background: var(--wx-bg-surface);\n border: 2px solid var(--wx-color-primary);\n border-radius: var(--wx-radius-full);\n box-shadow: var(--wx-shadow-card);\n cursor: grab;\n transition: box-shadow var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-slider__thumb:focus-visible {\n outline: none;\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-slider__thumb:active {\n cursor: grabbing;\n}\n\n.wx-slider.is-disabled .wx-slider__range {\n background: var(--wx-color-primary-disabled);\n}\n\n.wx-slider.is-disabled .wx-slider__thumb {\n border-color: var(--wx-color-primary-disabled);\n cursor: not-allowed;\n}\n\n.wx-slider__value {\n flex: 0 0 auto;\n min-width: 4ch;\n color: var(--wx-text-default);\n font-size: var(--wx-font-size-sm);\n font-variant-numeric: tabular-nums;\n text-align: right;\n}\n\n.wx-slider__marks {\n position: relative;\n height: 18px;\n margin-top: calc(var(--wx-space-4) * -1);\n}\n\n.wx-slider__mark {\n position: absolute;\n transform: translateX(-50%);\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-xs);\n white-space: nowrap;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { useFormField, type ChoiceValue } from '../../composables/useFormField'\nimport type { SwitchEmits, SwitchProps } from './types'\n\ndefineOptions({ name: 'WxSwitch', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<SwitchProps>(), {\n activeValue: true,\n inactiveValue: false,\n label: undefined,\n disabled: undefined,\n size: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<SwitchEmits>()\n\nconst model = defineModel<ChoiceValue>({ default: false })\n\nconst field = useFormField(props)\n\nconst checked = computed(() => model.value === props.activeValue)\nconst size = computed(() => props.size ?? field.size.value)\n\nconst classes = computed(() => [\n 'wx-switch',\n `wx-switch--${size.value}`,\n { 'is-checked': checked.value, 'is-disabled': field.disabled.value },\n])\n\nfunction onChange(event: Event) {\n const next = (event.target as HTMLInputElement).checked ? props.activeValue : props.inactiveValue\n model.value = next\n emit('change', next)\n}\n</script>\n\n<template>\n <label :class=\"classes\">\n <input\n :id=\"field.id.value\"\n v-bind=\"$attrs\"\n class=\"wx-switch__native\"\n type=\"checkbox\"\n role=\"switch\"\n :name=\"name\"\n :checked=\"checked\"\n :disabled=\"field.disabled.value\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n @change=\"onChange\"\n />\n\n <span class=\"wx-switch__track\" aria-hidden=\"true\">\n <span class=\"wx-switch__thumb\" />\n </span>\n\n <span v-if=\"label || $slots.default\" class=\"wx-switch__label\">\n <slot>{{ label }}</slot>\n </span>\n </label>\n</template>\n\n<style scoped>\n.wx-switch {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-8);\n cursor: pointer;\n user-select: none;\n color: var(--wx-text-default);\n}\n\n.wx-switch.is-disabled {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-switch__native {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n}\n\n.wx-switch__track {\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n box-sizing: border-box;\n width: calc(var(--wx-switch-height) * 1.8);\n height: var(--wx-switch-height);\n padding: 2px;\n background: var(--wx-border-strong);\n border-radius: var(--wx-radius-full);\n transition:\n background-color var(--wx-duration-normal) var(--wx-easing-standard),\n box-shadow var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-switch--sm {\n --wx-switch-height: 18px;\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-switch--md {\n --wx-switch-height: 22px;\n font-size: var(--wx-font-size-md);\n}\n\n.wx-switch--lg {\n --wx-switch-height: 26px;\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-switch__thumb {\n width: calc(var(--wx-switch-height) - 4px);\n height: calc(var(--wx-switch-height) - 4px);\n background: var(--wx-bg-surface);\n border-radius: var(--wx-radius-full);\n box-shadow: var(--wx-shadow-card);\n transition: transform var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-switch.is-checked .wx-switch__track {\n background: var(--wx-color-primary);\n}\n\n.wx-switch.is-checked .wx-switch__thumb {\n transform: translateX(calc(var(--wx-switch-height) * 0.8));\n}\n\n.wx-switch.is-disabled .wx-switch__track {\n background: var(--wx-border-default);\n}\n\n.wx-switch.is-disabled.is-checked .wx-switch__track {\n background: var(--wx-color-primary-disabled);\n}\n\n.wx-switch__native:focus-visible + .wx-switch__track {\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-switch__label {\n line-height: var(--wx-font-line-height-normal);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wx-switch__track,\n .wx-switch__thumb {\n transition: none;\n }\n}\n</style>\n","<script setup lang=\"ts\" generic=\"T extends TableRow = TableRow\">\nimport { computed, onBeforeUnmount, onMounted, ref, useSlots, watch } from 'vue'\nimport WxCheckbox from '../Checkbox/Checkbox.vue'\nimport WxInput from '../Input/Input.vue'\nimport WxPagination from '../Pagination/Pagination.vue'\nimport type {\n RowKey,\n TableColumn,\n TableEmits,\n TableProps,\n TableRow,\n TableSort,\n TableState,\n TableSummaryRow,\n} from './types'\n\ndefineOptions({ name: 'WxTable' })\n\n/** The disclosure and checkbox columns are square and never resize. */\nconst UTILITY_WIDTH = 44\n\nconst props = withDefaults(defineProps<TableProps<T>>(), {\n data: null,\n rowKey: 'id',\n title: undefined,\n searchable: false,\n searchPlaceholder: 'Search',\n searchDebounce: 300,\n loading: false,\n emptyText: 'Nothing to show',\n stripe: false,\n bordered: false,\n hover: true,\n size: 'md',\n selectable: false,\n selectableIf: undefined,\n expandable: false,\n expandableIf: undefined,\n summary: () => [],\n pagination: undefined,\n perPageOptions: () => [],\n persist: undefined,\n maxHeight: undefined,\n rowClass: undefined,\n layout: 'auto',\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<TableEmits<T>>()\n\n/** Keys rather than rows: a selection outlives the page it was made on. */\nconst selected = defineModel<RowKey[]>('selected', { default: () => [] })\nconst expanded = defineModel<RowKey[]>('expanded', { default: () => [] })\nconst sort = defineModel<TableSort | null>('sort', { default: null })\nconst search = defineModel<string>('search', { default: '' })\nconst page = defineModel<number>('page', { default: 1 })\nconst perPage = defineModel<number>('perPage', { default: 15 })\n\n/** An array or a paginator; the table only ever needs the rows out of it. */\nconst rows = computed<T[]>(() => {\n const value = props.data\n if (!value) return []\n return Array.isArray(value) ? value : (value.data ?? [])\n})\n\n/** A paginated response is a promise that there are more pages to reach. */\nconst paginator = computed(() => (props.data && !Array.isArray(props.data) ? props.data : null))\n\nconst showPagination = computed(() => props.pagination ?? Boolean(paginator.value))\n\nconst visibleColumns = computed(() => props.columns.filter((column) => !column.hidden))\n\n/** Columns that carry no data of their own: the chevron and the checkbox. */\nconst utilityCount = computed(() => (props.expandable ? 1 : 0) + (props.selectable ? 1 : 0))\n\nconst columnCount = computed(() => visibleColumns.value.length + utilityCount.value)\n\nconst slots = useSlots()\n\nconst hasHeader = computed(() =>\n Boolean(props.title || props.searchable || slots.title || slots.actions),\n)\n\nconst classes = computed(() => [\n 'wx-table',\n `wx-table--${props.size}`,\n {\n 'wx-table--stripe': props.stripe,\n 'wx-table--bordered': props.bordered,\n 'wx-table--hover': props.hover,\n 'wx-table--sticky': props.maxHeight !== undefined,\n 'is-loading': props.loading,\n },\n])\n\nconst scrollStyle = computed(() =>\n props.maxHeight === undefined ? undefined : { maxHeight: length(props.maxHeight) },\n)\n\nfunction length(value: string | number): string {\n return typeof value === 'number' ? `${value}px` : value\n}\n\n/** Only a declared width can say where the column behind a pinned one begins. */\nfunction widthOf(column: TableColumn<T>): number {\n if (typeof column.width === 'number') return column.width\n if (typeof column.width === 'string') {\n const parsed = Number.parseFloat(column.width)\n return Number.isFinite(parsed) ? parsed : 0\n }\n return 0\n}\n\nfunction colStyle(column: TableColumn<T>) {\n return {\n width: column.width === undefined ? undefined : length(column.width),\n minWidth: column.minWidth === undefined ? undefined : length(column.minWidth),\n }\n}\n\n/**\n * Where every pinned column comes to rest, measured from its edge. The utility columns\n * are pinned too whenever anything else is: a checkbox that slides under a frozen name\n * column is worse than no freezing at all.\n */\nconst offsets = computed(() => {\n const map = new Map<string, { side: 'left' | 'right'; offset: number; edge: boolean }>()\n\n let left = utilityCount.value * UTILITY_WIDTH\n const lefts = visibleColumns.value.filter((column) => column.fixed === 'left')\n lefts.forEach((column, index) => {\n map.set(column.key, { side: 'left', offset: left, edge: index === lefts.length - 1 })\n left += widthOf(column)\n })\n\n let right = 0\n const rights = visibleColumns.value.filter((column) => column.fixed === 'right')\n for (let index = rights.length - 1; index >= 0; index--) {\n const column = rights[index]\n map.set(column.key, { side: 'right', offset: right, edge: index === 0 })\n right += widthOf(column)\n }\n\n return map\n})\n\nconst hasLeftFixed = computed(() => visibleColumns.value.some((column) => column.fixed === 'left'))\n\nconst hasFixed = computed(() => offsets.value.size > 0)\n\n/**\n * The resting place goes out as a custom property rather than as `left` itself. An\n * inline `left` would outrank every stylesheet rule, and the pinning has to be able to\n * switch itself off in CSS when the table is too narrow to afford it.\n */\nfunction fixedStyle(column: TableColumn<T>) {\n const pin = offsets.value.get(column.key)\n if (!pin) return undefined\n return { [`--wx-pin-${pin.side}`]: `${pin.offset}px` }\n}\n\nfunction fixedClass(column: TableColumn<T>) {\n const pin = offsets.value.get(column.key)\n if (!pin) return undefined\n return [`is-fixed-${pin.side}`, { 'is-fixed-edge': pin.edge }]\n}\n\n/** The utility columns ride along at the left edge once anything is pinned. */\nfunction utilityStyle(slot: 'expand' | 'select') {\n if (!hasFixed.value) return undefined\n const before = slot === 'select' && props.expandable ? UTILITY_WIDTH : 0\n return { '--wx-pin-left': `${before}px` }\n}\n\nconst utilityClass = computed(() =>\n hasFixed.value ? ['is-fixed-left', { 'is-fixed-edge': !hasLeftFixed.value }] : undefined,\n)\n\n/** A dotted key walks into the row, so an eager-loaded relation reads as `user.name`. */\nfunction read(row: T, path: string): unknown {\n if (!path.includes('.')) return (row as TableRow)[path]\n return path.split('.').reduce<unknown>((value, part) => {\n if (value === null || typeof value !== 'object') return undefined\n return (value as TableRow)[part]\n }, row)\n}\n\nfunction cellText(column: TableColumn<T>, row: T, index: number): string {\n const value = read(row, column.key)\n if (column.formatter) return column.formatter(value, row, index)\n return value === null || value === undefined ? '' : String(value)\n}\n\nfunction keyOf(row: T, index: number): RowKey {\n if (typeof props.rowKey === 'function') return props.rowKey(row, index)\n const value = read(row, props.rowKey)\n return typeof value === 'string' || typeof value === 'number' ? value : index\n}\n\nfunction canSelect(row: T): boolean {\n return props.selectableIf ? props.selectableIf(row) : true\n}\n\nfunction canExpand(row: T): boolean {\n return props.expandableIf ? props.expandableIf(row) : true\n}\n\nconst selectableRows = computed(() => rows.value.filter(canSelect))\n\nconst selectableKeys = computed(() =>\n selectableRows.value.map((row) => keyOf(row, rows.value.indexOf(row))),\n)\n\nconst selectedCount = computed(\n () => selectableKeys.value.filter((key) => selected.value.includes(key)).length,\n)\n\nconst allSelected = computed(\n () => selectableKeys.value.length > 0 && selectedCount.value === selectableKeys.value.length,\n)\n\nconst someSelected = computed(() => selectedCount.value > 0 && !allSelected.value)\n\nfunction rowsFor(keys: RowKey[]): T[] {\n return rows.value.filter((row, index) => keys.includes(keyOf(row, index)))\n}\n\nfunction announce(keys: RowKey[]) {\n selected.value = keys\n emit('selection-change', keys, rowsFor(keys))\n}\n\n/**\n * The header checkbox works on this page only. Keys picked on other pages stay put —\n * clearing someone's selection because they paged forward would be a surprise.\n */\nfunction toggleAll(checked: boolean) {\n const page = selectableKeys.value\n if (checked) announce([...selected.value, ...page.filter((key) => !selected.value.includes(key))])\n else announce(selected.value.filter((key) => !page.includes(key)))\n}\n\nfunction toggleRow(row: T, index: number, checked: boolean) {\n const key = keyOf(row, index)\n if (checked) {\n if (!selected.value.includes(key)) announce([...selected.value, key])\n } else {\n announce(selected.value.filter((item) => item !== key))\n }\n}\n\nfunction isSelected(row: T, index: number): boolean {\n return selected.value.includes(keyOf(row, index))\n}\n\nfunction isExpanded(row: T, index: number): boolean {\n return expanded.value.includes(keyOf(row, index))\n}\n\nfunction toggleExpand(row: T, index: number) {\n if (!canExpand(row)) return\n const key = keyOf(row, index)\n const keys = expanded.value.includes(key)\n ? expanded.value.filter((item) => item !== key)\n : [...expanded.value, key]\n\n expanded.value = keys\n emit('expand-change', keys, rowsFor(keys))\n}\n\n/**\n * Sorting is reported, never applied: the rows on screen are one page out of a query,\n * and reordering them here would only shuffle the page. Three states, because a column\n * has to be able to give the ordering back.\n */\nfunction onSort(column: TableColumn<T>) {\n if (!column.sortable) return\n const current = sort.value\n let next: TableSort | null\n if (current?.key !== column.key) next = { key: column.key, order: 'asc' }\n else if (current.order === 'asc') next = { key: column.key, order: 'desc' }\n else next = null\n\n sort.value = next\n page.value = 1\n emit('sort-change', next)\n}\n\nfunction ariaSort(column: TableColumn<T>) {\n if (!column.sortable) return undefined\n if (sort.value?.key !== column.key) return 'none'\n return sort.value.order === 'asc' ? 'ascending' : 'descending'\n}\n\nfunction sortState(column: TableColumn<T>) {\n return sort.value?.key === column.key ? sort.value.order : null\n}\n\nfunction alignClass(column: TableColumn<T>) {\n return column.align && column.align !== 'left' ? `wx-table__cell--${column.align}` : undefined\n}\n\nlet timer: ReturnType<typeof setTimeout> | undefined\n\n/**\n * The field answers at once; the backend hears about it when the typing settles. The\n * settled term is what the state is built from, so a burst of keystrokes is one change\n * rather than one per letter — and filtering changes what page one is, so the page goes\n * back to the first.\n */\nconst settledSearch = ref(search.value)\n\nfunction onSearch(value: string | number | undefined) {\n search.value = value === undefined ? '' : String(value)\n}\n\nfunction onSearchChanged(term: string) {\n clearTimeout(timer)\n const settle = () => {\n settledSearch.value = term\n page.value = 1\n emit('search', term)\n }\n if (!props.searchDebounce) settle()\n else timer = setTimeout(settle, props.searchDebounce)\n}\n\nonBeforeUnmount(() => clearTimeout(timer))\n\n/** Everything the backend needs, in one object, so there is one thing to watch. */\nconst state = computed<TableState>(() => ({\n page: page.value,\n perPage: perPage.value,\n sort: sort.value,\n search: settledSearch.value,\n}))\n\nconst STORAGE_PREFIX = 'wx-table:'\n\n/**\n * Reading happens after mount rather than during setup: this renders on a server too,\n * and markup built from one machine's localStorage would not match what the browser\n * then hydrates.\n */\nfunction restore() {\n if (!props.persist) return\n let saved: Partial<TableState> | null = null\n try {\n const raw = window.localStorage.getItem(STORAGE_PREFIX + props.persist)\n saved = raw ? (JSON.parse(raw) as Partial<TableState>) : null\n } catch {\n // Unavailable, full, or holding something we did not write. Defaults will do.\n return\n }\n if (!saved) return\n\n if (typeof saved.page === 'number' && saved.page > 0) page.value = saved.page\n if (typeof saved.perPage === 'number' && saved.perPage > 0) perPage.value = saved.perPage\n if (typeof saved.search === 'string') search.value = saved.search\n if (saved.sort === null) sort.value = null\n else if (saved.sort && typeof saved.sort.key === 'string') {\n sort.value = { key: saved.sort.key, order: saved.sort.order === 'desc' ? 'desc' : 'asc' }\n }\n}\n\nfunction save(value: TableState) {\n if (!props.persist) return\n try {\n window.localStorage.setItem(STORAGE_PREFIX + props.persist, JSON.stringify(value))\n } catch {\n // A private window or a full quota. Remembering is a convenience, not a feature.\n }\n}\n\nonMounted(() => {\n restore()\n settledSearch.value = search.value\n emit('state-change', state.value)\n\n // Both watchers start here, so the restore above counts as the first state rather\n // than as a change — one fetch on load, not two.\n watch(search, onSearchChanged)\n watch(state, (value) => {\n save(value)\n emit('state-change', value)\n })\n})\n\n/** Columns ahead of the first figure belong to the caption. */\nfunction summaryStart(row: TableSummaryRow): number {\n const cells = row.cells ?? {}\n const index = visibleColumns.value.findIndex((column) => column.key in cells)\n return index === -1 ? visibleColumns.value.length : index\n}\n\nfunction summarySpan(row: TableSummaryRow): number {\n return utilityCount.value + summaryStart(row)\n}\n\nfunction summaryColumns(row: TableSummaryRow): TableColumn<T>[] {\n return visibleColumns.value.slice(summaryStart(row))\n}\n\nfunction summaryValue(row: TableSummaryRow, column: TableColumn<T>): unknown {\n return row.cells?.[column.key]\n}\n\nfunction summaryText(row: TableSummaryRow, column: TableColumn<T>): string {\n const value = summaryValue(row, column)\n return value === null || value === undefined ? '' : String(value)\n}\n</script>\n\n<template>\n <div :class=\"classes\">\n <header v-if=\"hasHeader\" class=\"wx-table__header\">\n <div class=\"wx-table__title\">\n <slot name=\"title\">{{ title }}</slot>\n </div>\n\n <div class=\"wx-table__tools\">\n <slot name=\"actions\" />\n\n <div v-if=\"searchable\" class=\"wx-table__search\">\n <wx-input\n type=\"search\"\n :model-value=\"search\"\n :placeholder=\"searchPlaceholder\"\n :size=\"size\"\n clearable\n :aria-label=\"searchPlaceholder\"\n @update:model-value=\"onSearch\"\n />\n </div>\n </div>\n </header>\n\n <div class=\"wx-table__scroll\" :style=\"scrollStyle\">\n <table\n class=\"wx-table__table\"\n :class=\"{ 'wx-table__table--fixed': layout === 'fixed' }\"\n :aria-label=\"ariaLabel\"\n :aria-busy=\"loading || undefined\"\n >\n <colgroup>\n <col v-if=\"expandable\" :style=\"{ width: `${UTILITY_WIDTH}px` }\" />\n <col v-if=\"selectable\" :style=\"{ width: `${UTILITY_WIDTH}px` }\" />\n <col v-for=\"column in visibleColumns\" :key=\"column.key\" :style=\"colStyle(column)\" />\n </colgroup>\n\n <thead class=\"wx-table__head\">\n <tr>\n <th\n v-if=\"expandable\"\n scope=\"col\"\n class=\"wx-table__cell wx-table__cell--utility\"\n :class=\"utilityClass\"\n :style=\"utilityStyle('expand')\"\n >\n <span class=\"wx-table__sr-only\">Expand</span>\n </th>\n\n <th\n v-if=\"selectable\"\n scope=\"col\"\n class=\"wx-table__cell wx-table__cell--utility\"\n :class=\"utilityClass\"\n :style=\"utilityStyle('select')\"\n >\n <wx-checkbox\n :model-value=\"allSelected\"\n :indeterminate=\"someSelected\"\n :disabled=\"!selectableKeys.length\"\n aria-label=\"Select every row on this page\"\n @update:model-value=\"toggleAll\"\n />\n </th>\n\n <th\n v-for=\"column in visibleColumns\"\n :key=\"column.key\"\n scope=\"col\"\n class=\"wx-table__cell\"\n :class=\"[alignClass(column), fixedClass(column), column.headerClass]\"\n :style=\"fixedStyle(column)\"\n :aria-sort=\"ariaSort(column)\"\n >\n <button\n v-if=\"column.sortable\"\n class=\"wx-table__sort\"\n type=\"button\"\n @click=\"onSort(column)\"\n >\n <slot :name=\"`header-${column.key}`\" :column=\"column\">\n {{ column.label ?? column.key }}\n </slot>\n <svg\n class=\"wx-table__sort-icon\"\n :class=\"sortState(column) ? `is-${sortState(column)}` : undefined\"\n viewBox=\"0 0 8 12\"\n aria-hidden=\"true\"\n >\n <path class=\"wx-table__sort-up\" d=\"M4 1 7 5 1 5Z\" />\n <path class=\"wx-table__sort-down\" d=\"M4 11 1 7 7 7Z\" />\n </svg>\n </button>\n\n <slot v-else :name=\"`header-${column.key}`\" :column=\"column\">\n {{ column.label ?? column.key }}\n </slot>\n </th>\n </tr>\n </thead>\n\n <tbody class=\"wx-table__body\">\n <template v-for=\"(row, index) in rows\" :key=\"keyOf(row, index)\">\n <tr\n class=\"wx-table__row\"\n :class=\"[\n rowClass?.(row, index),\n {\n 'is-striped': index % 2 === 1,\n 'is-selected': selectable && isSelected(row, index),\n 'is-expanded': expandable && isExpanded(row, index),\n },\n ]\"\n @click=\"emit('row-click', row, index, $event)\"\n >\n <td\n v-if=\"expandable\"\n class=\"wx-table__cell wx-table__cell--utility\"\n :class=\"utilityClass\"\n :style=\"utilityStyle('expand')\"\n @click.stop\n >\n <button\n v-if=\"canExpand(row)\"\n class=\"wx-table__expander\"\n type=\"button\"\n :aria-expanded=\"isExpanded(row, index)\"\n :aria-label=\"isExpanded(row, index) ? 'Collapse row' : 'Expand row'\"\n @click=\"toggleExpand(row, index)\"\n >\n <svg viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n <path d=\"M4.5 2 8.5 6l-4 4\" />\n </svg>\n </button>\n </td>\n\n <td\n v-if=\"selectable\"\n class=\"wx-table__cell wx-table__cell--utility\"\n :class=\"utilityClass\"\n :style=\"utilityStyle('select')\"\n @click.stop\n >\n <wx-checkbox\n :model-value=\"isSelected(row, index)\"\n :disabled=\"!canSelect(row)\"\n aria-label=\"Select row\"\n @update:model-value=\"(checked: boolean) => toggleRow(row, index, checked)\"\n />\n </td>\n\n <td\n v-for=\"column in visibleColumns\"\n :key=\"column.key\"\n class=\"wx-table__cell\"\n :class=\"[alignClass(column), fixedClass(column), column.cellClass]\"\n :style=\"fixedStyle(column)\"\n >\n <slot\n :name=\"`cell-${column.key}`\"\n :row=\"row\"\n :value=\"read(row, column.key)\"\n :index=\"index\"\n :column=\"column\"\n >\n {{ cellText(column, row, index) }}\n </slot>\n </td>\n </tr>\n\n <tr v-if=\"expandable && isExpanded(row, index)\" class=\"wx-table__row--expansion\">\n <td class=\"wx-table__cell wx-table__expansion\" :colspan=\"columnCount\">\n <slot name=\"expanded\" :row=\"row\" :index=\"index\" />\n </td>\n </tr>\n </template>\n\n <tr v-if=\"!rows.length && !loading\" class=\"wx-table__row wx-table__row--empty\">\n <td class=\"wx-table__cell wx-table__empty\" :colspan=\"columnCount\">\n <slot name=\"empty\">{{ emptyText }}</slot>\n </td>\n </tr>\n </tbody>\n\n <tfoot v-if=\"summary.length || $slots.footer || showPagination\" class=\"wx-table__foot\">\n <tr\n v-for=\"(line, lineIndex) in summary\"\n :key=\"lineIndex\"\n class=\"wx-table__summary\"\n :class=\"[line.class, { 'is-strong': line.strong }]\"\n >\n <td\n v-if=\"summarySpan(line) > 0\"\n class=\"wx-table__cell wx-table__summary-label\"\n :colspan=\"summarySpan(line)\"\n >\n {{ line.label }}\n </td>\n\n <td\n v-for=\"column in summaryColumns(line)\"\n :key=\"column.key\"\n class=\"wx-table__cell\"\n :class=\"alignClass(column)\"\n >\n <slot :name=\"`summary-${column.key}`\" :row=\"line\" :value=\"summaryValue(line, column)\">\n {{ summaryText(line, column) }}\n </slot>\n </td>\n </tr>\n\n <tr v-if=\"$slots.footer || showPagination\" class=\"wx-table__footer-row\">\n <td class=\"wx-table__cell\" :colspan=\"columnCount\">\n <slot name=\"footer\">\n <wx-pagination\n v-model:page=\"page\"\n v-model:per-page=\"perPage\"\n :paginator=\"paginator\"\n :per-page-options=\"perPageOptions\"\n :size=\"size\"\n :disabled=\"loading\"\n />\n </slot>\n </td>\n </tr>\n </tfoot>\n </table>\n </div>\n\n <div v-if=\"loading\" class=\"wx-table__loading\">\n <slot name=\"loading\">\n <span class=\"wx-table__spinner\" aria-hidden=\"true\" />\n <span class=\"wx-table__loading-text\">Loading</span>\n </slot>\n </div>\n </div>\n</template>\n\n<style scoped>\n.wx-table {\n position: relative;\n z-index: 0;\n box-sizing: border-box;\n /*\n * A flex or grid item will not shrink below its content unless told to, and the\n * content here is a table that can be twice the width of the page. Without this the\n * inner scroller never scrolls and the whole document does instead.\n */\n min-width: 0;\n /*\n * Pinning asks about the table's own width, so the table is the thing being measured.\n * Containment means the width can no longer come from the contents, so it is stated:\n * inside a flex row the element would otherwise measure zero.\n */\n width: 100%;\n max-width: 100%;\n container-type: inline-size;\n background: var(--wx-bg-surface);\n border-radius: var(--wx-radius-md);\n color: var(--wx-text-default);\n\n --wx-table-padding-y: var(--wx-space-10);\n --wx-table-padding-x: var(--wx-space-16);\n /* What a pinned cell paints itself with; every row state restates it. */\n --wx-table-row-bg: var(--wx-bg-surface);\n}\n\n.wx-table--sm {\n --wx-table-padding-y: var(--wx-space-6);\n --wx-table-padding-x: var(--wx-space-12);\n}\n\n.wx-table--lg {\n --wx-table-padding-y: var(--wx-space-14);\n}\n\n.wx-table__header {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--wx-space-12);\n padding: var(--wx-space-12) var(--wx-table-padding-x);\n}\n\n.wx-table__title {\n min-width: 0;\n color: var(--wx-text-strong);\n font-size: var(--wx-font-size-lg);\n font-weight: var(--wx-font-weight-semibold);\n line-height: var(--wx-font-line-height-tight);\n}\n\n.wx-table__tools {\n display: flex;\n align-items: center;\n gap: var(--wx-space-8);\n margin-left: auto;\n}\n\n.wx-table__search {\n width: var(--wx-table-search-width, 240px);\n}\n\n.wx-table__scroll {\n overflow: auto;\n border-radius: inherit;\n}\n\n/*\n * Explicit resets rather than an assumption that nothing else styles a table. VitePress\n * turns every table into a scrolling block; Bootstrap and Tailwind's preflight have\n * opinions of their own. Left alone, a host stylesheet takes the layout away from the\n * table, the stickiness away from the header and the stripes away from the rows —\n * quietly, and only once the library is embedded somewhere real.\n */\n.wx-table__table {\n display: table;\n width: 100%;\n margin: 0;\n overflow: visible;\n border: 0;\n border-collapse: collapse;\n border-spacing: 0;\n font-size: var(--wx-font-size-md);\n}\n\n.wx-table__table thead {\n display: table-header-group;\n}\n\n.wx-table__table tbody {\n display: table-row-group;\n}\n\n.wx-table__table tfoot {\n display: table-footer-group;\n}\n\n.wx-table__table tr {\n display: table-row;\n background: none;\n border: 0;\n}\n\n/*\n * A row's colour reaches the eye by two routes: the row paints it behind cells that are\n * transparent, and a pinned cell paints it itself. They therefore have to change at the\n * same speed, and that speed has to be stated — VitePress fades a `tr` over half a\n * second, which left the pinned columns snapping to the hover colour while the rest of\n * the row was still on its way there.\n *\n * The shadow goes with it: it is the same colour, covering the seam beside the cell.\n */\n.wx-table__row,\n.wx-table__cell.is-fixed-left,\n.wx-table__cell.is-fixed-right {\n transition:\n background-color var(--wx-duration-fast) var(--wx-easing-standard),\n box-shadow var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wx-table__row,\n .wx-table__cell.is-fixed-left,\n .wx-table__cell.is-fixed-right {\n transition: none;\n }\n}\n\n.wx-table__table th,\n.wx-table__table td {\n display: table-cell;\n border: 0;\n}\n\n.wx-table__table--fixed {\n table-layout: fixed;\n}\n\n.wx-table--sm .wx-table__table {\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-table--lg .wx-table__table {\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-table__cell {\n box-sizing: border-box;\n padding: var(--wx-table-padding-y) var(--wx-table-padding-x);\n text-align: left;\n vertical-align: middle;\n}\n\n.wx-table__cell--center {\n text-align: center;\n}\n\n.wx-table__cell--right {\n text-align: right;\n}\n\n/*\n * The control is the whole content of a utility cell, and an inline-level box would sit\n * on a text baseline — three pixels above the middle of the row, which is exactly the\n * kind of misalignment that reads as sloppiness rather than as a bug.\n */\n.wx-table__cell--utility {\n width: 44px;\n padding-right: 0;\n line-height: 0;\n}\n\n.wx-table__cell--utility :deep(.wx-checkbox) {\n display: flex;\n}\n\n.wx-table__sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n\n.wx-table__head .wx-table__cell {\n --wx-table-row-bg: var(--wx-bg-subtle);\n\n background: var(--wx-bg-subtle);\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-sm);\n font-weight: var(--wx-font-weight-semibold);\n white-space: nowrap;\n}\n\n/* Sticky needs a painted background of its own, or the rows show through. */\n.wx-table--sticky .wx-table__head .wx-table__cell {\n position: sticky;\n top: 0;\n z-index: 2;\n}\n\n.wx-table--sticky .wx-table__foot .wx-table__cell {\n position: sticky;\n bottom: 0;\n z-index: 2;\n background: var(--wx-bg-surface);\n}\n\n/* A pinned column paints over the scrolling ones, and the header over both. The colour\n it paints with is whatever the row it belongs to is wearing. */\n.wx-table__cell.is-fixed-left,\n.wx-table__cell.is-fixed-right {\n position: sticky;\n z-index: 1;\n background: var(--wx-table-row-bg);\n}\n\n.wx-table__cell.is-fixed-left {\n left: var(--wx-pin-left, 0px);\n}\n\n.wx-table__cell.is-fixed-right {\n right: var(--wx-pin-right, 0px);\n}\n\n.wx-table__head .wx-table__cell.is-fixed-left,\n.wx-table__head .wx-table__cell.is-fixed-right,\n.wx-table--sticky .wx-table__foot .wx-table__cell.is-fixed-left,\n.wx-table--sticky .wx-table__foot .wx-table__cell.is-fixed-right {\n z-index: 3;\n}\n\n/*\n * A scrollport rarely begins on a whole pixel — at any display scale but 100% it begins\n * on a fraction of one — so the pinned cell is rasterised with its edge pixel only\n * partly covered, and a hairline of the scrolling column shows through it.\n *\n * The cover is a strip of its own rather than a box shadow: Firefox declines to paint a\n * shadow on a cell in a collapsed-border table, which is where the sliver was still\n * turning up. Two pixels wide and straddling the edge, so whichever pixel the boundary\n * falls in is covered outright instead of blended.\n */\n.wx-table__cell.is-fixed-left::before,\n.wx-table__cell.is-fixed-right::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n width: 2px;\n background: var(--wx-table-row-bg);\n pointer-events: none;\n}\n\n.wx-table__cell.is-fixed-left::before {\n left: -1px;\n}\n\n.wx-table__cell.is-fixed-right::before {\n right: -1px;\n}\n\n/* The edge of the frozen block, so it reads as floating over what slides beneath. */\n.wx-table__cell.is-fixed-left.is-fixed-edge {\n box-shadow: 6px 0 6px -6px rgb(0 0 0 / 0.18);\n}\n\n.wx-table__cell.is-fixed-right.is-fixed-edge {\n box-shadow: -6px 0 6px -6px rgb(0 0 0 / 0.18);\n}\n\n/*\n * Pinning is a luxury of width. On a phone the frozen columns take most of the screen\n * and the ones the reader came for have nowhere to scroll into view, so the table gives\n * up freezing and simply scrolls as a whole.\n *\n * The question is asked of the table rather than of the window: the same thing happens\n * to a table in a narrow panel on a wide desktop. The offsets are custom properties for\n * exactly this reason — an inline `left` could not be talked out of it.\n */\n@container (max-width: 600px) {\n .wx-table__cell.is-fixed-left,\n .wx-table__cell.is-fixed-right,\n .wx-table__cell.is-fixed-left.is-fixed-edge,\n .wx-table__cell.is-fixed-right.is-fixed-edge {\n left: auto;\n right: auto;\n z-index: auto;\n box-shadow: none;\n }\n\n .wx-table__cell.is-fixed-left::before,\n .wx-table__cell.is-fixed-right::before {\n display: none;\n }\n}\n\n.wx-table__body .wx-table__cell {\n border-top: 1px solid var(--wx-border-muted);\n}\n\n.wx-table--bordered .wx-table__cell + .wx-table__cell {\n border-left: 1px solid var(--wx-border-muted);\n}\n\n/* Striped by row index, not by position: an expansion row is a sibling too, and\n counting it would flip the pattern from wherever a row was opened. Each state names\n its colour once; the pinned cells read it back out of the variable. */\n.wx-table--stripe .wx-table__row.is-striped {\n --wx-table-row-bg: var(--wx-bg-subtle);\n\n background: var(--wx-bg-subtle);\n}\n\n.wx-table--hover .wx-table__row:hover {\n --wx-table-row-bg: var(--wx-bg-fill);\n\n background: var(--wx-bg-fill);\n}\n\n.wx-table__row.is-selected {\n --wx-table-row-bg: var(--wx-color-primary-soft);\n\n background: var(--wx-color-primary-soft);\n}\n\n.wx-table__expander {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n padding: 0;\n background: none;\n border: none;\n border-radius: var(--wx-radius-xs);\n color: var(--wx-text-muted);\n cursor: pointer;\n}\n\n.wx-table__expander:hover {\n background: var(--wx-bg-fill);\n color: var(--wx-text-default);\n}\n\n.wx-table__expander:focus-visible {\n outline: none;\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-table__expander svg {\n width: 12px;\n height: 12px;\n fill: none;\n stroke: currentColor;\n stroke-width: 1.5;\n stroke-linecap: round;\n stroke-linejoin: round;\n transition: transform var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-table__row.is-expanded .wx-table__expander svg {\n transform: rotate(90deg);\n}\n\n.wx-table__expansion {\n background: var(--wx-bg-subtle);\n}\n\n.wx-table__sort {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-6);\n padding: 0;\n background: none;\n border: none;\n color: inherit;\n font: inherit;\n cursor: pointer;\n}\n\n.wx-table__sort:hover {\n color: var(--wx-text-default);\n}\n\n.wx-table__sort:focus-visible {\n outline: none;\n box-shadow: var(--wx-ring-focus);\n border-radius: var(--wx-radius-xs);\n}\n\n.wx-table__sort-icon {\n flex: 0 0 auto;\n width: 8px;\n height: 12px;\n}\n\n.wx-table__sort-icon path {\n fill: var(--wx-border-strong);\n}\n\n.wx-table__sort-icon.is-asc .wx-table__sort-up,\n.wx-table__sort-icon.is-desc .wx-table__sort-down {\n fill: var(--wx-color-primary);\n}\n\n.wx-table__empty {\n padding: var(--wx-space-24) var(--wx-table-padding-x);\n color: var(--wx-text-muted);\n text-align: center;\n}\n\n.wx-table__foot .wx-table__cell {\n border-top: 1px solid var(--wx-border-muted);\n}\n\n.wx-table__summary .wx-table__cell {\n color: var(--wx-text-muted);\n}\n\n.wx-table__summary-label {\n text-align: right;\n}\n\n.wx-table__summary.is-strong .wx-table__cell {\n color: var(--wx-text-strong);\n font-weight: var(--wx-font-weight-semibold);\n}\n\n/* The rows stay readable underneath: a page that is being refreshed still says what it said. */\n.wx-table__loading {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--wx-space-8);\n background: color-mix(in srgb, var(--wx-bg-surface) 70%, transparent);\n border-radius: inherit;\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-table__spinner {\n width: 16px;\n height: 16px;\n border: 2px solid var(--wx-border-default);\n border-top-color: var(--wx-color-primary);\n border-radius: var(--wx-radius-full);\n animation: wx-table-spin var(--wx-duration-slow) linear infinite;\n}\n\n@keyframes wx-table-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wx-table__spinner {\n animation-duration: 3s;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue'\nimport { useFormField } from '../../composables/useFormField'\nimport type { TagsInputEmits, TagsInputProps } from './types'\n\ndefineOptions({ name: 'WxTagsInput', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<TagsInputProps>(), {\n suggestions: () => [],\n placeholder: undefined,\n emptyText: 'Nothing found',\n max: undefined,\n duplicates: false,\n allowCreate: true,\n disabled: undefined,\n size: undefined,\n status: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<TagsInputEmits>()\n\nconst model = defineModel<string[]>({ default: () => [] })\n\nconst field = useFormField(props)\nconst inputRef = ref<HTMLInputElement | null>(null)\nconst text = ref('')\nconst open = ref(false)\nconst highlighted = ref(-1)\n/** The tag Backspace has marked; the next Backspace removes it. */\nconst armed = ref(-1)\n\nconst tags = computed(() => model.value ?? [])\n\nconst suggestions = computed(() =>\n props.suggestions.filter((suggestion) => !tags.value.includes(suggestion)),\n)\n\nconst showList = computed(() => open.value && suggestions.value.length > 0)\n\nconst full = computed(() => props.max !== undefined && tags.value.length >= props.max)\n\nconst classes = computed(() => [\n 'wx-tags-input',\n `wx-tags-input--${field.size.value}`,\n {\n [`wx-tags-input--${field.status.value}`]: field.status.value !== 'default',\n 'is-open': showList.value,\n 'is-disabled': field.disabled.value,\n },\n])\n\nwatch(suggestions, () => {\n highlighted.value = -1\n})\n\nfunction commit(next: string[]) {\n model.value = next\n emit('change', next)\n}\n\nfunction add(tag: string) {\n const value = tag.trim()\n if (!value || full.value) return\n if (!props.duplicates && tags.value.includes(value)) {\n text.value = ''\n return\n }\n commit([...tags.value, value])\n text.value = ''\n open.value = false\n armed.value = -1\n}\n\nfunction remove(index: number) {\n commit(tags.value.filter((_, position) => position !== index))\n armed.value = -1\n}\n\nfunction onInput(event: Event) {\n const value = (event.target as HTMLInputElement).value\n text.value = value\n armed.value = -1\n highlighted.value = -1\n if (value) open.value = true\n emit('search', value)\n}\n\n/**\n * Backspace on an empty field marks the last tag first and removes it on the second\n * press — deleting something the user cannot see would be worse than one extra key.\n */\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n open.value = false\n armed.value = -1\n return\n }\n\n if (event.key === 'Backspace' && text.value === '' && tags.value.length > 0) {\n event.preventDefault()\n if (armed.value === tags.value.length - 1) remove(armed.value)\n else armed.value = tags.value.length - 1\n return\n }\n\n if (event.key === 'ArrowDown' && showList.value) {\n event.preventDefault()\n highlighted.value = (highlighted.value + 1) % suggestions.value.length\n return\n }\n\n if (event.key === 'ArrowUp' && showList.value) {\n event.preventDefault()\n highlighted.value =\n highlighted.value <= 0 ? suggestions.value.length - 1 : highlighted.value - 1\n return\n }\n\n if (event.key === 'Enter') {\n event.preventDefault()\n if (showList.value && highlighted.value >= 0) add(suggestions.value[highlighted.value])\n else if (props.allowCreate) add(text.value)\n }\n}\n\nfunction onBlur() {\n armed.value = -1\n // Let a click on a suggestion land before the list disappears.\n window.setTimeout(() => {\n open.value = false\n }, 120)\n}\n\ndefineExpose({ focus: () => inputRef.value?.focus() })\n</script>\n\n<template>\n <div :class=\"classes\">\n <div class=\"wx-tags-input__anchor\" @click=\"inputRef?.focus()\">\n <span\n v-for=\"(tag, index) in tags\"\n :key=\"tag\"\n class=\"wx-tags-input__tag\"\n :class=\"{ 'is-armed': index === armed }\"\n >\n {{ tag }}\n <button\n v-if=\"!field.disabled.value\"\n class=\"wx-tags-input__remove\"\n type=\"button\"\n tabindex=\"-1\"\n :aria-label=\"`Remove ${tag}`\"\n @click.stop=\"remove(index)\"\n >\n ✕\n </button>\n </span>\n\n <input\n :id=\"field.id.value\"\n ref=\"inputRef\"\n v-bind=\"$attrs\"\n class=\"wx-tags-input__field\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n :value=\"text\"\n :placeholder=\"placeholder\"\n :disabled=\"field.disabled.value\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n :aria-invalid=\"field.status.value === 'error' || undefined\"\n :aria-expanded=\"showList\"\n @input=\"onInput\"\n @keydown=\"onKeydown\"\n @focus=\"open = true\"\n @blur=\"onBlur\"\n />\n\n <ul v-if=\"showList\" class=\"wx-tags-input__list\" role=\"listbox\">\n <li\n v-for=\"(suggestion, index) in suggestions\"\n :key=\"suggestion\"\n class=\"wx-tags-input__option\"\n :class=\"{ 'is-highlighted': index === highlighted }\"\n role=\"option\"\n :aria-selected=\"index === highlighted\"\n @mousedown.prevent=\"add(suggestion)\"\n @mousemove=\"highlighted = index\"\n >\n {{ suggestion }}\n </li>\n </ul>\n </div>\n\n <select v-if=\"name\" class=\"wx-sr-only\" :name=\"name\" multiple tabindex=\"-1\" aria-hidden=\"true\">\n <option v-for=\"tag in tags\" :key=\"tag\" :value=\"tag\" selected>{{ tag }}</option>\n </select>\n </div>\n</template>\n\n<style scoped>\n.wx-tags-input {\n display: block;\n width: 100%;\n}\n\n.wx-tags-input__anchor {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--wx-space-4);\n box-sizing: border-box;\n min-height: var(--wx-size-control-md);\n padding: var(--wx-space-4) var(--wx-space-10);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-control);\n color: var(--wx-text-default);\n font-size: var(--wx-font-size-md);\n cursor: text;\n transition: border-color var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-tags-input--sm .wx-tags-input__anchor {\n min-height: var(--wx-size-control-sm);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-tags-input--lg .wx-tags-input__anchor {\n min-height: var(--wx-size-control-lg);\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-tags-input__anchor:hover {\n border-color: var(--wx-border-strong);\n}\n\n.wx-tags-input__anchor:focus-within {\n border-color: var(--wx-border-focus);\n}\n\n.wx-tags-input--error .wx-tags-input__anchor {\n border-color: var(--wx-color-danger);\n}\n\n.wx-tags-input--success .wx-tags-input__anchor {\n border-color: var(--wx-color-success);\n}\n\n.wx-tags-input--warning .wx-tags-input__anchor {\n border-color: var(--wx-color-warning);\n}\n\n.wx-tags-input.is-disabled .wx-tags-input__anchor {\n background: var(--wx-bg-disabled);\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-tags-input__tag {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-4);\n padding: 2px var(--wx-space-6);\n background: var(--wx-bg-fill);\n border-radius: var(--wx-radius-xs);\n font-size: var(--wx-font-size-sm);\n line-height: var(--wx-font-line-height-tight);\n}\n\n.wx-tags-input__tag.is-armed {\n background: var(--wx-color-danger-soft);\n color: var(--wx-color-danger);\n}\n\n.wx-tags-input__remove {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n background: transparent;\n border: none;\n color: currentcolor;\n font-size: var(--wx-font-size-xs);\n line-height: 1;\n opacity: 0.65;\n cursor: pointer;\n}\n\n.wx-tags-input__remove:hover {\n opacity: 1;\n}\n\n.wx-tags-input__field {\n flex: 1 1 80px;\n min-width: 0;\n padding: 0;\n background: transparent;\n border: none;\n outline: none;\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n}\n\n.wx-tags-input__field::placeholder {\n color: var(--wx-text-placeholder);\n}\n\n.wx-tags-input__list {\n position: absolute;\n top: calc(100% + var(--wx-space-4));\n left: 0;\n right: 0;\n z-index: var(--wx-z-index-dropdown);\n max-height: 220px;\n margin: 0;\n padding: var(--wx-space-4);\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-sm);\n box-shadow: var(--wx-shadow-popover);\n list-style: none;\n overflow-y: auto;\n}\n\n.wx-tags-input__option {\n padding: var(--wx-space-6) var(--wx-space-10);\n border-radius: var(--wx-radius-xs);\n cursor: pointer;\n}\n\n.wx-tags-input__option.is-highlighted {\n background: var(--wx-bg-fill);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, ref, watch } from 'vue'\nimport { useFormField } from '../../composables/useFormField'\nimport type { TextareaEmits, TextareaModelValue, TextareaProps } from './types'\n\ndefineOptions({ name: 'WxTextarea', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<TextareaProps>(), {\n size: undefined,\n status: undefined,\n id: undefined,\n placeholder: undefined,\n disabled: undefined,\n readonly: false,\n rows: 3,\n autosize: false,\n maxlength: undefined,\n showCount: false,\n resize: 'vertical',\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<TextareaEmits>()\n\nconst model = defineModel<TextareaModelValue>({ default: '' })\n\nconst field = useFormField(props)\nconst textareaRef = ref<HTMLTextAreaElement | null>(null)\nconst focused = ref(false)\n\nconst currentValue = computed(() => model.value ?? '')\n\nconst counter = computed(() =>\n props.showCount && props.maxlength ? `${currentValue.value.length}/${props.maxlength}` : null,\n)\n\nconst autosizeOptions = computed(() =>\n props.autosize === true ? {} : props.autosize === false ? null : props.autosize,\n)\n\nconst classes = computed(() => [\n 'wx-textarea',\n `wx-textarea--${field.size.value}`,\n {\n [`wx-textarea--${field.status.value}`]: field.status.value !== 'default',\n 'is-focused': focused.value,\n 'is-disabled': field.disabled.value,\n 'is-readonly': props.readonly,\n 'is-autosize': Boolean(autosizeOptions.value),\n },\n])\n\n/** Grows the field to fit its content, clamped by minRows / maxRows. */\nfunction syncHeight() {\n const options = autosizeOptions.value\n const el = textareaRef.value\n if (!options || !el) return\n\n el.style.height = 'auto'\n const styles = getComputedStyle(el)\n const lineHeight = Number.parseFloat(styles.lineHeight) || 20\n const vertical =\n Number.parseFloat(styles.paddingTop) +\n Number.parseFloat(styles.paddingBottom) +\n Number.parseFloat(styles.borderTopWidth) +\n Number.parseFloat(styles.borderBottomWidth)\n\n let height = el.scrollHeight\n if (options.minRows) height = Math.max(height, options.minRows * lineHeight + vertical)\n if (options.maxRows) height = Math.min(height, options.maxRows * lineHeight + vertical)\n\n el.style.height = `${height}px`\n el.style.overflowY = options.maxRows && el.scrollHeight > height ? 'auto' : 'hidden'\n}\n\nonMounted(() => nextTick(syncHeight))\nwatch([currentValue, autosizeOptions], () => nextTick(syncHeight))\n\nfunction onInput(event: Event) {\n const value = (event.target as HTMLTextAreaElement).value\n model.value = value\n emit('input', value)\n}\n\nfunction onChange(event: Event) {\n emit('change', (event.target as HTMLTextAreaElement).value)\n}\n\nfunction onFocus(event: FocusEvent) {\n focused.value = true\n emit('focus', event)\n}\n\nfunction onBlur(event: FocusEvent) {\n focused.value = false\n emit('blur', event)\n}\n\ndefineExpose({\n focus: () => textareaRef.value?.focus(),\n blur: () => textareaRef.value?.blur(),\n select: () => textareaRef.value?.select(),\n textarea: textareaRef,\n})\n</script>\n\n<template>\n <div :class=\"classes\">\n <textarea\n :id=\"field.id.value\"\n ref=\"textareaRef\"\n v-bind=\"$attrs\"\n class=\"wx-textarea__inner\"\n :value=\"currentValue\"\n :rows=\"rows\"\n :placeholder=\"placeholder\"\n :disabled=\"field.disabled.value\"\n :readonly=\"readonly\"\n :maxlength=\"maxlength\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n :aria-invalid=\"field.status.value === 'error' || undefined\"\n :style=\"{ resize }\"\n @input=\"onInput\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n />\n\n <span v-if=\"counter\" class=\"wx-textarea__count\">{{ counter }}</span>\n </div>\n</template>\n\n<style scoped>\n.wx-textarea {\n position: relative;\n display: block;\n box-sizing: border-box;\n width: 100%;\n background: var(--wx-bg-surface);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-control);\n color: var(--wx-text-default);\n transition:\n border-color var(--wx-duration-normal) var(--wx-easing-standard),\n background-color var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-textarea:hover:not(.is-disabled) {\n border-color: var(--wx-border-strong);\n}\n\n.wx-textarea.is-focused {\n border-color: var(--wx-border-focus);\n}\n\n.wx-textarea--error,\n.wx-textarea--error.is-focused {\n border-color: var(--wx-color-danger);\n}\n\n.wx-textarea--success,\n.wx-textarea--success.is-focused {\n border-color: var(--wx-color-success);\n}\n\n.wx-textarea--warning,\n.wx-textarea--warning.is-focused {\n border-color: var(--wx-color-warning);\n}\n\n.wx-textarea.is-disabled {\n background: var(--wx-bg-disabled);\n color: var(--wx-text-disabled);\n}\n\n.wx-textarea__inner {\n display: block;\n box-sizing: border-box;\n width: 100%;\n margin: 0;\n padding: var(--wx-space-8) var(--wx-space-12);\n background: transparent;\n border: none;\n outline: none;\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n line-height: var(--wx-font-line-height-normal);\n}\n\n.wx-textarea--sm {\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-textarea--md {\n font-size: var(--wx-font-size-md);\n}\n\n.wx-textarea--lg {\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-textarea.is-autosize .wx-textarea__inner {\n resize: none !important;\n overflow-y: hidden;\n}\n\n.wx-textarea__inner::placeholder {\n color: var(--wx-text-placeholder);\n}\n\n.wx-textarea__inner:disabled {\n cursor: not-allowed;\n}\n\n.wx-textarea__count {\n position: absolute;\n right: var(--wx-space-8);\n bottom: var(--wx-space-4);\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-xs);\n font-variant-numeric: tabular-nums;\n pointer-events: none;\n}\n</style>\n","<script setup lang=\"ts\">\nimport WxDatePicker from '../DatePicker/DatePicker.vue'\nimport type { DatePickerModelValue, DatePickerProps } from '../DatePicker/types'\n\ndefineOptions({ name: 'WxTimePicker' })\n\n/**\n * Every prop defaults to `undefined` on purpose. Vue casts an absent boolean prop\n * to `false`, and this preset forwards its whole prop object — without these the\n * preset would hand `WxDatePicker` an explicit `false` for `is24`, `clearable`,\n * `autoApply` and `teleport`, overriding that component's own defaults. Passing\n * `undefined` lets each default apply as if the prop had never been written.\n */\nwithDefaults(defineProps<Omit<DatePickerProps, 'type'>>(), {\n valueFormat: undefined,\n format: undefined,\n placeholder: undefined,\n clearable: undefined,\n minDate: undefined,\n maxDate: undefined,\n seconds: undefined,\n minutesIncrement: undefined,\n is24: undefined,\n weekStart: undefined,\n autoApply: undefined,\n textInput: undefined,\n teleport: undefined,\n disabled: undefined,\n readonly: undefined,\n size: undefined,\n status: undefined,\n id: undefined,\n name: undefined,\n ariaLabel: undefined,\n})\n\nconst model = defineModel<DatePickerModelValue>({ default: null })\n</script>\n\n<template>\n <wx-date-picker v-model=\"model\" type=\"time\" v-bind=\"$props\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps ?? {}\" />\n </template>\n </wx-date-picker>\n</template>\n","import type { App, Plugin } from 'vue'\nimport * as components from './components'\n\nexport interface WebxUiOptions {\n /**\n * Prefix used when registering components globally.\n * Components are declared as `WxButton`, so the default keeps that name.\n */\n prefix?: string\n}\n\n/**\n * Registers every component globally:\n *\n * ```ts\n * import { WebxUI } from '@webx-ui/core'\n * import '@webx-ui/core/style.css'\n *\n * app.use(WebxUI)\n * ```\n *\n * Prefer named imports when bundle size matters — they tree-shake.\n */\nexport const WebxUI: Plugin<[WebxUiOptions?]> = {\n install(app: App, options: WebxUiOptions = {}) {\n const { prefix = 'Wx' } = options\n\n for (const [name, component] of Object.entries(components)) {\n if (!name.startsWith('Wx')) continue\n const registeredName = prefix === 'Wx' ? name : `${prefix}${name.slice(2)}`\n app.component(registeredName, component)\n }\n },\n}\n\nexport default WebxUI\n"],"names":["props","__props","emit","__emit","isDisabled","computed","tag","classes","nativeAttrs","onClick","event","_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","$attrs","_createElementBlock","_hoisted_1","$slots","_hoisted_2","_renderSlot","_ctx","_hoisted_3","slots","useSlots","hasHeader","hasSidebar","_createElementVNode","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","formContextKey","formItemContextKey","uid","useId","prefix","useFormField","form","inject","item","fallbackId","id","disabled","size","status","describedBy","checkboxGroupKey","radioGroupKey","provideFormItem","context","provide","model","_useModel","group","field","inputRef","ref","checked","syncIndeterminate","onMounted","watch","onChange","next","_unref","toggle","value","current","_Fragment","_renderList","option","WxCheckbox","HEX","open","text","toWorking","hex","convertToHsb","parseColor","working","colorToHex","areaStyle","getAreaBackgroundStyle","hueStyle","getSliderBackgroundStyle","swatch","commit","onInput","onBlur","candidate","onColor","color","onHex","clear","openPicker","PopoverRoot","$event","_createVNode","PopoverAnchor","_normalizeClass","_normalizeStyle","PopoverPortal","PopoverContent","ColorAreaRoot","ColorAreaArea","ColorAreaThumb","ColorSliderRoot","ColorSliderTrack","ColorSliderThumb","preset","hasTime","modelType","displayFormat","time","config","timeConfig","inputAttrs","onUpdate","onCleared","_","name","_withCtx","slotProps","_normalizeProps","_guardReactiveProps","WxDatePicker","$props","_createSlots","errors","toRef","onSubmit","onReset","baseId","errorId","helpId","labelMode","controlId","registerLabelTarget","messages","hasError","labelWidth","isInline","__expose","focused","currentValue","showClear","counter","onFocus","_toDisplayString","precision","decimals","round","factor","clamp","display","canDecrease","canIncrease","stepBy","direction","base","parsed","normalize","onWheel","onKeydown","page","perPage","currentPerPage","total","lastPage","currentPage","asked","from","to","items","last","span","wanted","i","numbers","a","b","result","previous","distance","go","target","setPerPage","_createTextVNode","_cache","_hoisted_9","_hoisted_10","fallbackName","WxRadio","hovered","interactive","shown","stars","index","position","fill","valueAt","left","width","set","onHover","step","star","richTextIcons","$emit","DEFAULT_TOOLS","DEFAULT_ACCEPT","TOOL_META","TABLE_TOOLS","uploading","fileInput","prompt","editable","readHtml","instance","editor","useEditor","StarterKit","TableKit","Image","Youtube","FileHandler","_editor","files","pos","uploadFiles","html","isEmpty","inTable","insertImage","url","alt","at","file","error","onImageButton","onFilePicked","input","openPrompt","kind","applyPrompt","toolVisible","tool","visibleTools","isActive","run","chain","runTableCommand","key","WxRichTextToolbarButton","_vModelText","EditorContent","searchText","selection","labelOf","selectedOptions","singleLabel","hasSelection","openList","displayValue","onSearch","removeTag","ComboboxRoot","ComboboxAnchor","_withModifiers","ComboboxTrigger","ComboboxPortal","ComboboxContent","ComboboxViewport","ComboboxEmpty","ComboboxItem","ComboboxItemIndicator","values","pair","marks","label","SliderTrack","SliderRange","SliderThumb","mark","UTILITY_WIDTH","STORAGE_PREFIX","selected","expanded","sort","search","rows","paginator","showPagination","visibleColumns","column","utilityCount","columnCount","scrollStyle","length","widthOf","colStyle","offsets","map","lefts","right","rights","hasLeftFixed","hasFixed","fixedStyle","pin","fixedClass","utilityStyle","slot","utilityClass","read","row","path","part","cellText","keyOf","canSelect","canExpand","selectableRows","selectableKeys","selectedCount","allSelected","someSelected","rowsFor","keys","announce","toggleAll","toggleRow","isSelected","isExpanded","toggleExpand","onSort","ariaSort","sortState","alignClass","timer","settledSearch","onSearchChanged","term","settle","onBeforeUnmount","state","restore","saved","raw","save","summaryStart","cells","summarySpan","summaryColumns","summaryValue","summaryText","WxInput","_hoisted_12","_hoisted_14","_hoisted_16","line","lineIndex","_hoisted_17","_hoisted_18","WxPagination","_hoisted_20","highlighted","armed","tags","suggestions","suggestion","showList","full","add","remove","textareaRef","autosizeOptions","syncHeight","options","el","styles","lineHeight","vertical","height","nextTick","WebxUI","app","component","components","registeredName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,UAAMA,IAAQC,GAaRC,IAAOC,GAEPC,IAAaC,EAAS,MAAML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