@webx-ui/core 0.2.0 → 0.3.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/Action/Action.d.ts +35 -0
- package/dist/components/Action/index.d.ts +2 -0
- package/dist/components/Action/types.d.ts +37 -0
- package/dist/components/Actions/Actions.d.ts +45 -0
- package/dist/components/Actions/index.d.ts +2 -0
- package/dist/components/Actions/types.d.ts +20 -0
- package/dist/components/Autocomplete/Autocomplete.d.ts +60 -0
- package/dist/components/Autocomplete/index.d.ts +2 -0
- package/dist/components/Autocomplete/types.d.ts +58 -0
- package/dist/components/Badge/Badge.d.ts +31 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/types.d.ts +21 -0
- package/dist/components/Button/Button.d.ts +5 -5
- package/dist/components/Button/types.d.ts +3 -2
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +26 -0
- package/dist/components/ButtonGroup/index.d.ts +2 -0
- package/dist/components/ButtonGroup/types.d.ts +20 -0
- package/dist/components/Cascader/Cascader.d.ts +62 -0
- package/dist/components/Cascader/index.d.ts +2 -0
- package/dist/components/Cascader/types.d.ts +55 -0
- package/dist/components/Checkbox/Checkbox.d.ts +3 -3
- package/dist/components/ColorPicker/ColorPicker.d.ts +5 -5
- package/dist/components/Countdown/Countdown.d.ts +42 -0
- package/dist/components/Countdown/format.d.ts +12 -0
- package/dist/components/Countdown/index.d.ts +3 -0
- package/dist/components/Countdown/types.d.ts +27 -0
- package/dist/components/DatePicker/DatePicker.d.ts +12 -12
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +11 -11
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +5 -5
- package/dist/components/Dropdown/Dropdown.d.ts +46 -0
- package/dist/components/Dropdown/index.d.ts +2 -0
- package/dist/components/Dropdown/types.d.ts +28 -0
- package/dist/components/DropdownItem/DropdownItem.d.ts +32 -0
- package/dist/components/DropdownItem/index.d.ts +2 -0
- package/dist/components/DropdownItem/types.d.ts +20 -0
- package/dist/components/EntityCard/EntityCard.d.ts +40 -0
- package/dist/components/EntityCard/index.d.ts +2 -0
- package/dist/components/EntityCard/types.d.ts +37 -0
- package/dist/components/FormItem/FormItem.d.ts +2 -2
- package/dist/components/Heading/Heading.d.ts +24 -0
- package/dist/components/Heading/index.d.ts +2 -0
- package/dist/components/Heading/types.d.ts +16 -0
- package/dist/components/Icon/Icon.d.ts +8 -0
- package/dist/components/Icon/icons.d.ts +85 -0
- package/dist/components/Icon/index.d.ts +4 -0
- package/dist/components/Icon/types.d.ts +25 -0
- package/dist/components/Indicator/Indicator.d.ts +29 -0
- package/dist/components/Indicator/index.d.ts +2 -0
- package/dist/components/Indicator/types.d.ts +21 -0
- package/dist/components/Input/Input.d.ts +6 -6
- package/dist/components/InputNumber/InputNumber.d.ts +3 -3
- package/dist/components/Link/Link.d.ts +34 -0
- package/dist/components/Link/index.d.ts +2 -0
- package/dist/components/Link/types.d.ts +26 -0
- package/dist/components/Prose/Prose.d.ts +22 -0
- package/dist/components/Prose/index.d.ts +2 -0
- package/dist/components/Prose/types.d.ts +13 -0
- package/dist/components/Radio/Radio.d.ts +2 -2
- package/dist/components/Rate/Rate.d.ts +2 -2
- package/dist/components/RichText/RichText.d.ts +4 -4
- package/dist/components/RichText/ToolbarButton.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +10 -10
- package/dist/components/Slider/Slider.d.ts +1 -1
- package/dist/components/Statistic/Statistic.d.ts +34 -0
- package/dist/components/Statistic/index.d.ts +2 -0
- package/dist/components/Statistic/types.d.ts +24 -0
- package/dist/components/Switch/Switch.d.ts +2 -2
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/TagsInput/TagsInput.d.ts +4 -4
- package/dist/components/Text/Text.d.ts +27 -0
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/Text/types.d.ts +21 -0
- package/dist/components/Textarea/Textarea.d.ts +3 -3
- package/dist/components/TimePicker/TimePicker.d.ts +5 -5
- package/dist/components/Timeline/Timeline.d.ts +20 -0
- package/dist/components/Timeline/index.d.ts +2 -0
- package/dist/components/Timeline/types.d.ts +6 -0
- package/dist/components/TimelineItem/TimelineItem.d.ts +29 -0
- package/dist/components/TimelineItem/index.d.ts +2 -0
- package/dist/components/TimelineItem/types.d.ts +21 -0
- package/dist/components/index.d.ts +19 -0
- package/dist/composables/useActions.d.ts +8 -0
- package/dist/composables/useButtonGroup.d.ts +15 -0
- package/dist/composables/useDropdown.d.ts +9 -0
- package/dist/composables/useTimeline.d.ts +8 -0
- package/dist/index.js +3226 -1602
- 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/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,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,EAAM;AAAA,QAC1B,sBAAsBA,EAAM;AAAA,QAC5B,eAAeI,EAAW;AAAA,MAAA;AAAA,IAC5B,CACD,GAEKI,IAAcH;AAAA,MAAS,MAC3BL,EAAM,OACF;AAAA,QACE,MAAMI,EAAW,QAAQ,SAAYJ,EAAM;AAAA,QAC3C,QAAQA,EAAM;AAAA,QACd,MAAM;AAAA,QACN,iBAAiBI,EAAW,QAAQ,SAAS;AAAA,QAC7C,UAAUA,EAAW,QAAQ,KAAK;AAAA,MAAA,IAEpC;AAAA,QACE,MAAMJ,EAAM;AAAA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G,GAAgBF,CAAS;AAAA,IACzC;AAAA,EACF;AACF;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/components/Icon/icons.ts","../src/components/Icon/Icon.vue","../src/composables/useActions.ts","../src/components/Action/Action.vue","../src/composables/useDropdown.ts","../src/components/Dropdown/Dropdown.vue","../src/components/Actions/Actions.vue","../src/composables/useFormField.ts","../src/components/Autocomplete/Autocomplete.vue","../src/components/Badge/Badge.vue","../src/composables/useButtonGroup.ts","../src/components/Button/Button.vue","../src/components/ButtonGroup/ButtonGroup.vue","../src/components/Card/Card.vue","../src/components/Cascader/Cascader.vue","../src/components/Checkbox/Checkbox.vue","../src/components/CheckboxGroup/CheckboxGroup.vue","../src/components/ColorPicker/ColorPicker.vue","../src/components/Statistic/Statistic.vue","../src/components/Countdown/format.ts","../src/components/Countdown/Countdown.vue","../src/components/DatePicker/DatePicker.vue","../src/components/DateRangePicker/DateRangePicker.vue","../src/components/DateTimePicker/DateTimePicker.vue","../src/components/DropdownItem/DropdownItem.vue","../src/components/EntityCard/EntityCard.vue","../src/components/Form/Form.vue","../src/components/FormItem/FormItem.vue","../src/components/Heading/Heading.vue","../src/components/Indicator/Indicator.vue","../src/components/Input/Input.vue","../src/components/InputNumber/InputNumber.vue","../src/components/Link/Link.vue","../src/components/Pagination/Pagination.vue","../src/components/Prose/Prose.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/Text/Text.vue","../src/components/Textarea/Textarea.vue","../src/composables/useTimeline.ts","../src/components/Timeline/Timeline.vue","../src/components/TimelineItem/TimelineItem.vue","../src/components/TimePicker/TimePicker.vue","../src/plugin.ts"],"sourcesContent":["/**\n * The built-in icon set.\n *\n * Every entry is the *inside* of a 24×24 `<svg>` drawn in `currentColor` with a\n * stroke — the wrapper in `Icon.vue` supplies the viewBox, the stroke width and the\n * colour, so an icon inherits the text it sits next to. Shapes that read better\n * filled (dots, pips) set `fill=\"currentColor\" stroke=\"none\"` themselves.\n */\nexport const builtinIcons = {\n // --- actions -------------------------------------------------------------\n check: '<path d=\"m5 13 4.5 4.5L19 7\"/>',\n 'check-circle': '<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"m8.2 12.2 2.6 2.6 5-5.2\"/>',\n close: '<path d=\"M18 6 6 18M6 6l12 12\"/>',\n 'close-circle': '<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"m9 9 6 6m0-6-6 6\"/>',\n plus: '<path d=\"M12 5v14M5 12h14\"/>',\n minus: '<path d=\"M5 12h14\"/>',\n edit: '<path d=\"M4 20h4L19.5 8.5a2.83 2.83 0 0 0-4-4L4 16v4Z\"/><path d=\"m14.5 5.5 4 4\"/>',\n trash:\n '<path d=\"M4 7h16M10 7V5.5A1.5 1.5 0 0 1 11.5 4h1A1.5 1.5 0 0 1 14 5.5V7M6.5 7l.8 11.6a2 2 0 0 0 2 1.9h5.4a2 2 0 0 0 2-1.9L17.5 7\"/><path d=\"M10 11v5.5M14 11v5.5\"/>',\n copy: '<rect x=\"8.5\" y=\"8.5\" width=\"11\" height=\"11\" rx=\"2.2\"/><path d=\"M15.5 8.5v-2a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h2\"/>',\n search: '<circle cx=\"11\" cy=\"11\" r=\"6.5\"/><path d=\"m16 16 4.5 4.5\"/>',\n filter: '<path d=\"M4 5.5h16l-6.2 7.2v5.1l-3.6 2v-7.1z\"/>',\n refresh:\n '<path d=\"M4 12a8 8 0 0 1 13.7-5.6L20 8.5\"/><path d=\"M20 4.5v4h-4\"/><path d=\"M20 12a8 8 0 0 1-13.7 5.6L4 15.5\"/><path d=\"M4 19.5v-4h4\"/>',\n upload:\n '<path d=\"M12 16V4m0 0-4.5 4.5M12 4l4.5 4.5\"/><path d=\"M4 15v3.5A1.5 1.5 0 0 0 5.5 20h13a1.5 1.5 0 0 0 1.5-1.5V15\"/>',\n download:\n '<path d=\"M12 4v12m0 0-4.5-4.5M12 16l4.5-4.5\"/><path d=\"M4 15v3.5A1.5 1.5 0 0 0 5.5 20h13a1.5 1.5 0 0 0 1.5-1.5V15\"/>',\n logout:\n '<path d=\"M14 6V5a1.5 1.5 0 0 0-1.5-1.5h-6A1.5 1.5 0 0 0 5 5v14a1.5 1.5 0 0 0 1.5 1.5h6A1.5 1.5 0 0 0 14 19v-1\"/><path d=\"M10 12h10m0 0-3-3m3 3-3 3\"/>',\n\n // --- direction -----------------------------------------------------------\n 'chevron-down': '<path d=\"m6 9.5 6 6 6-6\"/>',\n 'chevron-up': '<path d=\"m6 14.5 6-6 6 6\"/>',\n 'chevron-left': '<path d=\"m14.5 6-6 6 6 6\"/>',\n 'chevron-right': '<path d=\"m9.5 6 6 6-6 6\"/>',\n 'arrow-up': '<path d=\"M12 20V4m0 0 6 6m-6-6-6 6\"/>',\n 'arrow-down': '<path d=\"M12 4v16m0 0 6-6m-6 6-6-6\"/>',\n 'arrow-left': '<path d=\"M20 12H4m0 0 6-6m-6 6 6 6\"/>',\n 'arrow-right': '<path d=\"M4 12h16m0 0-6-6m6 6-6 6\"/>',\n menu: '<path d=\"M4 7h16M4 12h16M4 17h16\"/>',\n 'more-horizontal':\n '<circle cx=\"5.5\" cy=\"12\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"12\" cy=\"12\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"18.5\" cy=\"12\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\"/>',\n 'more-vertical':\n '<circle cx=\"12\" cy=\"5.5\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"12\" cy=\"12\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"12\" cy=\"18.5\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\"/>',\n drag: '<circle cx=\"9\" cy=\"6\" r=\"1.5\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"15\" cy=\"6\" r=\"1.5\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"9\" cy=\"12\" r=\"1.5\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"15\" cy=\"12\" r=\"1.5\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"9\" cy=\"18\" r=\"1.5\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"15\" cy=\"18\" r=\"1.5\" fill=\"currentColor\" stroke=\"none\"/>',\n\n // --- objects -------------------------------------------------------------\n user: '<circle cx=\"12\" cy=\"8\" r=\"3.75\"/><path d=\"M4.5 20a7.5 7.5 0 0 1 15 0\"/>',\n users:\n '<circle cx=\"9.5\" cy=\"8.5\" r=\"3.4\"/><path d=\"M2.5 20a7 7 0 0 1 14 0\"/><path d=\"M16 5.5a3.4 3.4 0 0 1 0 6.6M17.5 14.2A6.3 6.3 0 0 1 21.5 20\"/>',\n settings:\n '<circle cx=\"12\" cy=\"12\" r=\"3\"/><path d=\"M12 4v2.5M12 17.5V20M4 12h2.5M17.5 12H20M6.34 6.34l1.77 1.77M15.89 15.89l1.77 1.77M17.66 6.34l-1.77 1.77M6.34 17.66l1.77-1.77\"/>',\n sliders:\n '<path d=\"M4 7h9M17 7h3M4 17h3M11 17h9\"/><circle cx=\"15\" cy=\"7\" r=\"2\"/><circle cx=\"9\" cy=\"17\" r=\"2\"/>',\n home: '<path d=\"M4 10.5 12 4l8 6.5V19a1.5 1.5 0 0 1-1.5 1.5H15V14H9v6.5H5.5A1.5 1.5 0 0 1 4 19Z\"/>',\n file: '<path d=\"M13.5 3.5H7a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9zm0 0V9H19\"/>',\n folder:\n '<path d=\"M3.5 7a2 2 0 0 1 2-2h3.2a2 2 0 0 1 1.5.7l1.3 1.5h7a2 2 0 0 1 2 2v8.3a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2z\"/>',\n image:\n '<rect x=\"3.5\" y=\"4.5\" width=\"17\" height=\"15\" rx=\"2.5\"/><circle cx=\"8.75\" cy=\"9.75\" r=\"1.75\"/><path d=\"m4 17 4.5-4.2a2 2 0 0 1 2.7 0l3 2.8 1.6-1.5a2 2 0 0 1 2.7 0L20 16\"/>',\n calendar:\n '<rect x=\"3.5\" y=\"5.5\" width=\"17\" height=\"15\" rx=\"2.5\"/><path d=\"M3.5 10h17M8 3.5V7M16 3.5V7\"/>',\n clock: '<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"M12 7.5V12l3 2\"/>',\n mail: '<rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2.5\"/><path d=\"m4 7.5 6.9 5a2 2 0 0 0 2.2 0l6.9-5\"/>',\n phone:\n '<path d=\"M7 3.5 9.5 4l1.2 3.4-1.9 1.6a11 11 0 0 0 5.2 5.2l1.6-1.9 3.4 1.2.5 2.5a2 2 0 0 1-2 2.3A15.5 15.5 0 0 1 4.7 5.5a2 2 0 0 1 2.3-2Z\"/>',\n bell: '<path d=\"M7 10a5 5 0 0 1 10 0c0 4 1.5 5.5 1.5 5.5h-13S7 14 7 10Z\"/><path d=\"M10.2 18.5a2 2 0 0 0 3.6 0\"/>',\n cart: '<path d=\"M3 4.5h2.2l2.3 10.2a1.6 1.6 0 0 0 1.6 1.3h7.4a1.6 1.6 0 0 0 1.6-1.2L20 8H6\"/><circle cx=\"10\" cy=\"19.5\" r=\"1.5\"/><circle cx=\"17\" cy=\"19.5\" r=\"1.5\"/>',\n tag: '<path d=\"M4 11.2V5.5A1.5 1.5 0 0 1 5.5 4h5.7a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8l-5.2 5.2a2 2 0 0 1-2.8 0l-7-7a2 2 0 0 1-.6-1.4Z\"/><circle cx=\"8.5\" cy=\"8.5\" r=\"1.4\" fill=\"currentColor\" stroke=\"none\"/>',\n link: '<path d=\"M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7L11.5 7\"/><path d=\"M14 10a4 4 0 0 0-5.7 0l-3 3A4 4 0 0 0 11 18.7L12.5 17\"/>',\n 'external-link':\n '<path d=\"M13.5 4.5H20V11\"/><path d=\"m11 13 9-8.5\"/><path d=\"M19 14.5v4a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 5 18.5v-11A1.5 1.5 0 0 1 6.5 6h4\"/>',\n lock: '<rect x=\"4.5\" y=\"10\" width=\"15\" height=\"10\" rx=\"2.5\"/><path d=\"M8 10V7.8a4 4 0 0 1 8 0V10\"/>',\n unlock:\n '<rect x=\"4.5\" y=\"10\" width=\"15\" height=\"10\" rx=\"2.5\"/><path d=\"M8 10V7.8a4 4 0 0 1 7.6-1.8\"/>',\n grid: '<rect x=\"4\" y=\"4\" width=\"7\" height=\"7\" rx=\"1.8\"/><rect x=\"13\" y=\"4\" width=\"7\" height=\"7\" rx=\"1.8\"/><rect x=\"4\" y=\"13\" width=\"7\" height=\"7\" rx=\"1.8\"/><rect x=\"13\" y=\"13\" width=\"7\" height=\"7\" rx=\"1.8\"/>',\n list: '<path d=\"M9 6h11M9 12h11M9 18h11\"/><circle cx=\"5\" cy=\"6\" r=\"1.4\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"5\" cy=\"12\" r=\"1.4\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"5\" cy=\"18\" r=\"1.4\" fill=\"currentColor\" stroke=\"none\"/>',\n eye: '<path d=\"M2.5 12S6.8 5.5 12 5.5 21.5 12 21.5 12 17.2 18.5 12 18.5 2.5 12 2.5 12Z\"/><circle cx=\"12\" cy=\"12\" r=\"2.75\"/>',\n 'eye-off':\n '<path d=\"M10.2 6a9.9 9.9 0 0 1 1.8-.2c5.2 0 9.5 6.2 9.5 6.2a18 18 0 0 1-3.3 3.8M6.6 7.9A17.8 17.8 0 0 0 2.5 12s4.3 6.5 9.5 6.5a9.4 9.4 0 0 0 3.3-.6\"/><path d=\"m4 4 16 16\"/>',\n star: '<path d=\"m12 4 2.5 5.1 5.6.8-4 4 .9 5.6-5-2.7-5 2.7.9-5.6-4-4 5.6-.8z\"/>',\n heart:\n '<path d=\"M12 19.5S4 15 4 9.8A4.3 4.3 0 0 1 12 7.4 4.3 4.3 0 0 1 20 9.8c0 5.2-8 9.7-8 9.7Z\"/>',\n sun: '<circle cx=\"12\" cy=\"12\" r=\"4\"/><path d=\"M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6 7 7M17 17l1.4 1.4M18.4 5.6 17 7M7 17l-1.4 1.4\"/>',\n moon: '<path d=\"M20 14.5A8.5 8.5 0 0 1 9.5 4a8.5 8.5 0 1 0 10.5 10.5Z\"/>',\n\n // --- status --------------------------------------------------------------\n info: '<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"M12 11v5\"/><circle cx=\"12\" cy=\"7.75\" r=\"1.05\" fill=\"currentColor\" stroke=\"none\"/>',\n warning:\n '<path d=\"M10.3 4.9a2 2 0 0 1 3.4 0l7 12.1a2 2 0 0 1-1.7 3H5a2 2 0 0 1-1.7-3z\"/><path d=\"M12 9.5v4\"/><circle cx=\"12\" cy=\"16.6\" r=\"1.05\" fill=\"currentColor\" stroke=\"none\"/>',\n question:\n '<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"M9.6 9.4a2.5 2.5 0 0 1 4.9.6c0 1.7-2.5 2-2.5 3.5\"/><circle cx=\"12\" cy=\"16.6\" r=\"1.05\" fill=\"currentColor\" stroke=\"none\"/>',\n loader:\n '<path d=\"M12 3.5v4M12 16.5v4M3.5 12h4M16.5 12h4M6 6l2.8 2.8M15.2 15.2 18 18M18 6l-2.8 2.8M8.8 15.2 6 18\"/>',\n} as const satisfies Record<string, string>\n\n/** Every name the library ships with. */\nexport type BuiltinIconName = keyof typeof builtinIcons\n\nconst customIcons = new Map<string, string>()\n\n/**\n * Adds icons to the set, so `<wx-icon name=\"my-logo\" />` works anywhere in the app.\n *\n * ```ts\n * registerIcons({ 'my-logo': '<path d=\"M4 4h16v16H4z\" />' })\n * ```\n *\n * The markup is injected as-is, so register only icons you author or control —\n * never a string that arrived from a user or an API.\n */\nexport function registerIcons(icons: Record<string, string>): void {\n for (const [name, content] of Object.entries(icons)) customIcons.set(name, content)\n}\n\n/** The markup of an icon, or `undefined` when nothing is registered under that name. */\nexport function resolveIcon(name: string): string | undefined {\n return customIcons.get(name) ?? (builtinIcons as Record<string, string>)[name]\n}\n\n/** Names currently available, built-in plus registered — handy for a docs gallery. */\nexport function iconNames(): string[] {\n return [...new Set([...Object.keys(builtinIcons), ...customIcons.keys()])].sort()\n}\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { resolveIcon } from './icons'\nimport type { IconProps } from './types'\n\ndefineOptions({ name: 'WxIcon' })\n\nconst props = withDefaults(defineProps<IconProps>(), {\n size: undefined,\n strokeWidth: 1.7,\n spin: false,\n label: undefined,\n})\n\nconst keywordSizes: Record<string, string> = {\n sm: 'var(--wx-font-size-sm)',\n md: 'var(--wx-font-size-lg)',\n lg: 'var(--wx-font-size-2xl)',\n}\n\n/**\n * The markup is authored in `icons.ts` or handed to `registerIcons` by the app —\n * both are developer-controlled, which is what makes `v-html` safe here.\n */\nconst content = computed(() => resolveIcon(props.name))\n\nconst boxSize = computed(() => {\n const { size } = props\n if (size === undefined) return '1em'\n if (typeof size === 'number') return `${size}px`\n return keywordSizes[size] ?? size\n})\n\nconst classes = computed(() => ['wx-icon', { 'wx-icon--spin': props.spin }])\n</script>\n\n<template>\n <svg\n v-if=\"content\"\n :class=\"classes\"\n :style=\"{ '--wx-icon-size': boxSize }\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n :stroke-width=\"strokeWidth\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n :role=\"label ? 'img' : undefined\"\n :aria-label=\"label\"\n :aria-hidden=\"label ? undefined : 'true'\"\n focusable=\"false\"\n v-html=\"content\"\n />\n</template>\n\n<style scoped>\n.wx-icon {\n display: inline-block;\n flex: 0 0 auto;\n width: var(--wx-icon-size, 1em);\n height: var(--wx-icon-size, 1em);\n /* Sits on the text baseline rather than hanging below it. */\n vertical-align: -0.125em;\n overflow: visible;\n}\n\n/*\n * A turn a second. The duration tokens size transitions, not loops: even the slow one\n * is 320ms, which spins an icon three times a second and reads as a blur.\n */\n.wx-icon--spin {\n animation: wx-icon-spin var(--wx-icon-spin-duration, 1s) linear infinite;\n}\n\n@keyframes wx-icon-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wx-icon--spin {\n animation-duration: 2s;\n }\n}\n</style>\n","import { inject, type ComputedRef, type InjectionKey } from 'vue'\nimport type { ActionSize } from '../components/Action/types'\n\n/** What a `WxActions` row hands down to the actions inside it. */\nexport interface ActionsContext {\n size: ComputedRef<ActionSize | undefined>\n}\n\nexport const actionsKey: InjectionKey<ActionsContext> = Symbol('wx-actions')\n\nexport function useActions(): ActionsContext | null {\n return inject(actionsKey, null)\n}\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport WxIcon from '../Icon/Icon.vue'\nimport { useActions } from '../../composables/useActions'\nimport type { ActionEmits, ActionProps, ActionTone, ActionType } from './types'\nimport type { IconName } from '../Icon/types'\n\ndefineOptions({ name: 'WxAction', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<ActionProps>(), {\n type: 'edit',\n icon: undefined,\n tone: undefined,\n title: undefined,\n label: undefined,\n href: undefined,\n target: undefined,\n as: undefined,\n disabled: false,\n hidden: false,\n size: undefined,\n})\n\nconst emit = defineEmits<ActionEmits>()\n\n/** Icon, colour and English fallback name for each kind of action. */\nconst presets: Record<ActionType, { icon: IconName; tone: ActionTone; label: string }> = {\n add: { icon: 'plus', tone: 'primary', label: 'Add' },\n edit: { icon: 'edit', tone: 'primary', label: 'Edit' },\n remove: { icon: 'trash', tone: 'danger', label: 'Delete' },\n copy: { icon: 'copy', tone: 'primary', label: 'Copy' },\n link: { icon: 'link', tone: 'primary', label: 'Link' },\n goto: { icon: 'external-link', tone: 'primary', label: 'Open' },\n details: { icon: 'info', tone: 'primary', label: 'Details' },\n view: { icon: 'eye', tone: 'primary', label: 'View' },\n hide: { icon: 'eye-off', tone: 'neutral', label: 'Hide' },\n upload: { icon: 'upload', tone: 'primary', label: 'Upload' },\n download: { icon: 'download', tone: 'primary', label: 'Download' },\n sort: { icon: 'drag', tone: 'neutral', label: 'Reorder' },\n search: { icon: 'search', tone: 'primary', label: 'Search' },\n restore: { icon: 'refresh', tone: 'success', label: 'Restore' },\n settings: { icon: 'settings', tone: 'neutral', label: 'Settings' },\n send: { icon: 'mail', tone: 'primary', label: 'Send' },\n more: { icon: 'more-horizontal', tone: 'neutral', label: 'More' },\n}\n\nconst group = useActions()\n\nconst preset = computed(() => presets[props.type] ?? presets.edit)\nconst icon = computed(() => props.icon ?? preset.value.icon)\nconst tone = computed(() => props.tone ?? preset.value.tone)\nconst size = computed(() => props.size ?? group?.size.value ?? 'md')\nconst accessibleName = computed(() => props.label ?? props.title ?? preset.value.label)\n\nconst tag = computed(() => props.as ?? (props.href ? 'a' : 'button'))\n\nconst nativeAttrs = computed(() => {\n if (props.href) {\n return {\n href: props.disabled ? undefined : props.href,\n target: props.target,\n 'aria-disabled': props.disabled ? 'true' : undefined,\n tabindex: props.disabled ? -1 : undefined,\n }\n }\n if (props.as) return { 'aria-disabled': props.disabled ? 'true' : undefined }\n return { type: 'button' as const, disabled: props.disabled }\n})\n\nconst classes = computed(() => [\n 'wx-action',\n `wx-action--${size.value}`,\n `wx-action--${tone.value}`,\n { 'is-disabled': props.disabled },\n])\n\nfunction onClick(event: MouseEvent) {\n if (props.disabled) {\n event.preventDefault()\n event.stopPropagation()\n return\n }\n emit('click', event)\n}\n</script>\n\n<template>\n <span\n v-if=\"hidden\"\n class=\"wx-action wx-action--placeholder\"\n :class=\"`wx-action--${size}`\"\n aria-hidden=\"true\"\n />\n\n <component\n :is=\"tag\"\n v-else\n v-bind=\"{ ...nativeAttrs, ...$attrs }\"\n :class=\"classes\"\n :title=\"title\"\n :aria-label=\"accessibleName\"\n @click=\"onClick\"\n >\n <slot>\n <wx-icon :name=\"icon\" />\n </slot>\n </component>\n</template>\n\n<style scoped>\n.wx-action {\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-action-size, 36px);\n height: var(--wx-action-size, 36px);\n padding: 0;\n background: var(--wx-action-bg, var(--wx-bg-fill));\n border: 1px solid transparent;\n border-radius: var(--wx-radius-control);\n color: var(--wx-action-color, var(--wx-color-primary));\n font-size: var(--wx-action-icon, 18px);\n line-height: 1;\n text-decoration: none;\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-action:hover:not(.is-disabled) {\n background: var(--wx-bg-fill-hover);\n}\n\n.wx-action:focus-visible {\n outline: none;\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-action.is-disabled {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n/* An empty square: no background, no pointer, just the space. */\n.wx-action--placeholder {\n background: transparent;\n cursor: default;\n pointer-events: none;\n}\n\n/* sizes */\n.wx-action--sm {\n --wx-action-size: 30px;\n --wx-action-icon: 16px;\n}\n\n.wx-action--md {\n --wx-action-size: 36px;\n --wx-action-icon: 18px;\n}\n\n.wx-action--lg {\n --wx-action-size: 42px;\n --wx-action-icon: 20px;\n}\n\n/* tones */\n.wx-action--primary {\n --wx-action-color: var(--wx-color-primary);\n}\n\n.wx-action--danger {\n --wx-action-color: var(--wx-color-danger);\n}\n\n.wx-action--success {\n --wx-action-color: var(--wx-color-success-active);\n}\n\n.wx-action--warning {\n --wx-action-color: var(--wx-color-warning-active);\n}\n\n.wx-action--neutral {\n --wx-action-color: var(--wx-text-muted);\n}\n</style>\n","import { inject, type InjectionKey } from 'vue'\n\n/** What a `WxDropdown` hands down, so an item inside it can close the panel. */\nexport interface DropdownContext {\n close: () => void\n /** Whether a click on an item closes the panel — the dropdown's `closeOnClick`. */\n closeOnSelect: () => boolean\n}\n\nexport const dropdownKey: InjectionKey<DropdownContext> = Symbol('wx-dropdown')\n\nexport function useDropdown(): DropdownContext | null {\n return inject(dropdownKey, null)\n}\n","<script setup lang=\"ts\">\nimport { provide, watch } from 'vue'\nimport { PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger } from 'reka-ui'\nimport { dropdownKey } from '../../composables/useDropdown'\nimport type { DropdownEmits, DropdownProps } from './types'\n\ndefineOptions({ name: 'WxDropdown', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<DropdownProps>(), {\n side: 'bottom',\n align: 'start',\n offset: 6,\n alignOffset: 0,\n closeOnClick: true,\n matchTriggerWidth: false,\n teleport: true,\n modal: false,\n disabled: false,\n})\n\nconst emit = defineEmits<DropdownEmits>()\n\nconst open = defineModel<boolean>('open', { default: false })\n\nfunction close() {\n open.value = false\n}\n\nprovide(dropdownKey, { close, closeOnSelect: () => props.closeOnClick })\n\nwatch(open, (value) => {\n if (value) emit('open')\n else emit('close')\n})\n\n/**\n * A click anywhere in the panel closes it, the way a menu behaves. Items that run\n * their own logic still close through the same path, and a panel that should stay\n * open while it is worked in turns this off with `:close-on-click=\"false\"`.\n */\nfunction onPanelClick() {\n if (props.closeOnClick) close()\n}\n</script>\n\n<template>\n <popover-root v-model:open=\"open\" :modal=\"modal\">\n <!--\n `as-child` rather than a button of our own: the trigger is nearly always a\n control that is already a button — WxButton, WxAction — and nesting one button\n inside another is invalid HTML. The slot must hold exactly one element.\n -->\n <popover-trigger as-child :disabled=\"disabled\">\n <slot name=\"trigger\" :open=\"open\" />\n </popover-trigger>\n\n <popover-portal :disabled=\"!teleport\">\n <popover-content\n v-bind=\"$attrs\"\n class=\"wx-dropdown\"\n :class=\"{ 'wx-dropdown--match-width': matchTriggerWidth }\"\n :side=\"side\"\n :align=\"align\"\n :side-offset=\"offset\"\n :align-offset=\"alignOffset\"\n @click=\"onPanelClick\"\n >\n <slot :close=\"close\" />\n </popover-content>\n </popover-portal>\n </popover-root>\n</template>\n\n<style>\n/* The panel is teleported, so its styles cannot be scoped to the component. */\n.wx-dropdown {\n z-index: var(--wx-z-index-dropdown);\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 160px;\n max-width: min(90vw, 320px);\n padding: var(--wx-space-6);\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-sm);\n}\n\n.wx-dropdown:focus-visible {\n outline: none;\n}\n\n.wx-dropdown--match-width {\n min-width: var(--reka-popover-trigger-width);\n}\n\n/* A rule between groups of items. */\n.wx-dropdown hr,\n.wx-dropdown .wx-dropdown__divider {\n height: 0;\n margin: var(--wx-space-4) 0;\n border: none;\n border-top: 1px solid var(--wx-border-muted);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, onMounted, provide, ref, watch } from 'vue'\nimport WxAction from '../Action/Action.vue'\nimport WxDropdown from '../Dropdown/Dropdown.vue'\nimport { actionsKey } from '../../composables/useActions'\nimport type { ActionsEmits, ActionsProps } from './types'\n\ndefineOptions({ name: 'WxActions' })\n\nconst props = withDefaults(defineProps<ActionsProps>(), {\n align: 'start',\n size: undefined,\n collapse: false,\n ariaLabel: undefined,\n})\n\nconst emit = defineEmits<ActionsEmits>()\n\nprovide(actionsKey, { size: computed(() => props.size) })\n\nconst root = ref<HTMLElement | null>(null)\nconst row = ref<HTMLElement | null>(null)\nconst collapsed = ref(false)\n\n/**\n * The row is measured against the space its container gives it. When it collapses\n * the row is not unmounted, only taken out of the flow — it keeps its natural width,\n * which is the only way to know when there is room for it again.\n */\nfunction measure() {\n const rowEl = row.value\n const parent = root.value?.parentElement\n if (!props.collapse || !rowEl || !parent) return\n\n /* `|| 0`: a padding that was never set reads as an empty string, not as `0px`. */\n const style = getComputedStyle(parent)\n const padding = (parseFloat(style.paddingLeft) || 0) + (parseFloat(style.paddingRight) || 0)\n const available = parent.clientWidth - padding\n\n /* jsdom and a container that has not been laid out yet both report zero. */\n if (available <= 0) return\n\n collapsed.value = rowEl.scrollWidth > available\n}\n\nlet observer: ResizeObserver | undefined\n\nfunction observe() {\n observer?.disconnect()\n if (!props.collapse) return\n\n observer = new ResizeObserver(() => measure())\n if (root.value?.parentElement) observer.observe(root.value.parentElement)\n if (row.value) observer.observe(row.value)\n measure()\n}\n\nonMounted(observe)\nwatch(() => props.collapse, observe)\nwatch(collapsed, (value) => emit('collapse', value))\nonBeforeUnmount(() => observer?.disconnect())\n\nconst classes = computed(() => [\n 'wx-actions',\n `wx-actions--${props.align}`,\n { 'is-collapsed': collapsed.value },\n])\n\ndefineExpose({ collapsed, measure })\n</script>\n\n<template>\n <div ref=\"root\" :class=\"classes\" role=\"group\" :aria-label=\"ariaLabel\">\n <div ref=\"row\" class=\"wx-actions__row\">\n <slot />\n </div>\n\n <!-- The dropdown teleports its panel, so the class that hides it lives on a wrapper. -->\n <span v-if=\"collapse\" class=\"wx-actions__menu\">\n <wx-dropdown align=\"end\">\n <template #trigger>\n <slot name=\"trigger\">\n <wx-action type=\"more\" :size=\"size\" />\n </slot>\n </template>\n\n <!-- Falls back to the row itself, so a plain list of actions needs no second copy. -->\n <slot name=\"collapsed\">\n <slot />\n </slot>\n </wx-dropdown>\n </span>\n </div>\n</template>\n\n<style scoped>\n.wx-actions {\n display: flex;\n align-items: center;\n /* The row is taken out of the flow when collapsed, so it anchors here. */\n position: relative;\n}\n\n.wx-actions--start {\n justify-content: flex-start;\n}\n\n.wx-actions--center {\n justify-content: center;\n}\n\n.wx-actions--end {\n justify-content: flex-end;\n}\n\n.wx-actions__row {\n display: flex;\n align-items: center;\n gap: var(--wx-actions-gap, var(--wx-space-6));\n}\n\n/* Hidden, but still measurable: that is what lets the row come back. */\n.wx-actions.is-collapsed .wx-actions__row {\n position: absolute;\n z-index: -1;\n visibility: hidden;\n height: 0;\n overflow: hidden;\n pointer-events: none;\n}\n\n.wx-actions:not(.is-collapsed) .wx-actions__menu {\n display: none;\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, onBeforeUnmount, ref, watch } from 'vue'\nimport {\n AutocompleteAnchor,\n AutocompleteContent,\n AutocompleteEmpty,\n AutocompleteInput,\n AutocompleteItem,\n AutocompletePortal,\n AutocompleteRoot,\n AutocompleteViewport,\n} from 'reka-ui'\nimport WxIcon from '../Icon/Icon.vue'\nimport { useFormField } from '../../composables/useFormField'\nimport type { AutocompleteEmits, AutocompleteOption, AutocompleteProps } from './types'\n\ndefineOptions({ name: 'WxAutocomplete', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<AutocompleteProps>(), {\n options: () => [],\n remote: false,\n debounce: 300,\n loading: false,\n loadingText: 'Searching…',\n emptyText: 'Nothing found',\n minLength: 0,\n placeholder: undefined,\n clearable: false,\n openOnFocus: true,\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<AutocompleteEmits>()\n\n/** The model is the text in the field — an autocomplete suggests, it does not constrain. */\nconst model = defineModel<string>({ default: '' })\n\nconst field = useFormField(props)\nconst open = ref(false)\n\nlet debounceTimer: ReturnType<typeof setTimeout> | undefined\n/** Set while a pick is being applied, so choosing a suggestion does not search for it. */\nlet picking = false\n\nfunction cancelSearch() {\n if (debounceTimer === undefined) return\n clearTimeout(debounceTimer)\n debounceTimer = undefined\n}\n\nwatch(model, (value) => {\n emit('change', value)\n\n if (picking) {\n picking = false\n cancelSearch()\n return\n }\n\n cancelSearch()\n if (value.length < props.minLength) {\n open.value = false\n return\n }\n\n debounceTimer = setTimeout(() => {\n debounceTimer = undefined\n emit('search', value)\n }, props.debounce)\n})\n\nwatch(open, (value) => {\n if (value) emit('open')\n else emit('close')\n})\n\nonBeforeUnmount(cancelSearch)\n\nconst showClear = computed(() => props.clearable && !field.disabled.value && model.value.length > 0)\n\n/** Nothing to drop down yet: below `min-length`, or still waiting on the first response. */\nconst hasList = computed(\n () => props.options.length > 0 || props.loading || model.value.length >= props.minLength,\n)\n\nconst classes = computed(() => [\n 'wx-autocomplete',\n `wx-autocomplete--${field.size.value}`,\n {\n [`wx-autocomplete--${field.status.value}`]: field.status.value !== 'default',\n 'is-open': open.value,\n 'is-disabled': field.disabled.value,\n },\n])\n\nfunction onSelect(option: AutocompleteOption) {\n picking = true\n emit('select', option)\n}\n\nfunction clear() {\n picking = true\n model.value = ''\n open.value = false\n emit('clear')\n}\n</script>\n\n<template>\n <autocomplete-root\n v-model=\"model\"\n v-model:open=\"open\"\n as=\"div\"\n :class=\"classes\"\n :disabled=\"field.disabled.value\"\n :name=\"name\"\n :ignore-filter=\"remote\"\n :open-on-focus=\"openOnFocus\"\n :open-on-click=\"openOnFocus\"\n >\n <autocomplete-anchor class=\"wx-autocomplete__anchor\" as=\"div\">\n <span v-if=\"$slots.prefix\" class=\"wx-autocomplete__affix\">\n <slot name=\"prefix\" />\n </span>\n\n <autocomplete-input\n :id=\"field.id.value\"\n v-bind=\"$attrs\"\n class=\"wx-autocomplete__input\"\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 />\n\n <wx-icon v-if=\"loading\" class=\"wx-autocomplete__spinner\" name=\"loader\" spin />\n\n <button\n v-else-if=\"showClear\"\n class=\"wx-autocomplete__clear\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Clear\"\n @click=\"clear\"\n >\n <wx-icon name=\"close\" />\n </button>\n\n <span v-if=\"$slots.suffix\" class=\"wx-autocomplete__affix\">\n <slot name=\"suffix\" />\n </span>\n </autocomplete-anchor>\n\n <autocomplete-portal :disabled=\"!teleport\">\n <autocomplete-content\n v-if=\"hasList\"\n class=\"wx-autocomplete__content\"\n position=\"popper\"\n :side-offset=\"4\"\n >\n <autocomplete-viewport class=\"wx-autocomplete__viewport\">\n <div v-if=\"loading && options.length === 0\" class=\"wx-autocomplete__status\">\n {{ loadingText }}\n </div>\n <autocomplete-empty v-else class=\"wx-autocomplete__status\">\n {{ emptyText }}\n </autocomplete-empty>\n\n <autocomplete-item\n v-for=\"option in options\"\n :key=\"option.value\"\n class=\"wx-autocomplete__option\"\n :value=\"option.value\"\n :disabled=\"option.disabled\"\n @select=\"onSelect(option)\"\n >\n <slot name=\"option\" :option=\"option\">\n <span class=\"wx-autocomplete__option-label\">{{ option.label ?? option.value }}</span>\n <span v-if=\"option.description\" class=\"wx-autocomplete__option-description\">\n {{ option.description }}\n </span>\n </slot>\n </autocomplete-item>\n </autocomplete-viewport>\n </autocomplete-content>\n </autocomplete-portal>\n </autocomplete-root>\n</template>\n\n<style scoped>\n.wx-autocomplete {\n display: block;\n width: 100%;\n}\n\n.wx-autocomplete__anchor {\n display: flex;\n align-items: center;\n gap: var(--wx-space-6);\n box-sizing: border-box;\n height: var(--wx-size-control-md);\n padding: 0 var(--wx-space-10) 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 transition: border-color var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-autocomplete--sm .wx-autocomplete__anchor {\n height: var(--wx-size-control-sm);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-autocomplete--lg .wx-autocomplete__anchor {\n height: var(--wx-size-control-lg);\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-autocomplete__anchor:hover {\n border-color: var(--wx-border-strong);\n}\n\n.wx-autocomplete.is-open .wx-autocomplete__anchor,\n.wx-autocomplete__anchor:focus-within {\n border-color: var(--wx-border-focus);\n}\n\n.wx-autocomplete--error .wx-autocomplete__anchor,\n.wx-autocomplete--error.is-open .wx-autocomplete__anchor {\n border-color: var(--wx-color-danger);\n}\n\n.wx-autocomplete--success .wx-autocomplete__anchor {\n border-color: var(--wx-color-success);\n}\n\n.wx-autocomplete--warning .wx-autocomplete__anchor {\n border-color: var(--wx-color-warning);\n}\n\n.wx-autocomplete.is-disabled .wx-autocomplete__anchor {\n background: var(--wx-bg-disabled);\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-autocomplete__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: inherit;\n font-size: inherit;\n}\n\n.wx-autocomplete__input::placeholder {\n color: var(--wx-text-placeholder);\n}\n\n.wx-autocomplete__input:disabled {\n cursor: not-allowed;\n}\n\n.wx-autocomplete__affix,\n.wx-autocomplete__spinner {\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n color: var(--wx-text-muted);\n}\n\n.wx-autocomplete__clear {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 20px;\n height: 20px;\n padding: 0;\n background: transparent;\n border: none;\n border-radius: var(--wx-radius-full);\n color: var(--wx-text-muted);\n cursor: pointer;\n}\n\n.wx-autocomplete__clear:hover {\n color: var(--wx-text-default);\n}\n</style>\n\n<style>\n/* The list is teleported, so its styles cannot be scoped to the component. */\n.wx-autocomplete__content {\n z-index: var(--wx-z-index-dropdown);\n box-sizing: border-box;\n width: var(--reka-combobox-trigger-width);\n max-height: 300px;\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-autocomplete__viewport {\n max-height: 292px;\n overflow-y: auto;\n}\n\n.wx-autocomplete__option {\n display: flex;\n flex-direction: column;\n gap: 2px;\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-autocomplete__option[data-highlighted] {\n background: var(--wx-bg-fill);\n outline: none;\n}\n\n.wx-autocomplete__option[data-disabled] {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-autocomplete__option-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.wx-autocomplete__option-description {\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-xs);\n line-height: var(--wx-font-line-height-normal);\n}\n\n.wx-autocomplete__status {\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 WxIcon from '../Icon/Icon.vue'\nimport type { BadgeEmits, BadgeProps } from './types'\n\ndefineOptions({ name: 'WxBadge' })\n\nconst props = withDefaults(defineProps<BadgeProps>(), {\n type: 'default',\n variant: 'soft',\n size: 'md',\n round: false,\n dot: false,\n closable: false,\n closeLabel: 'Remove',\n})\n\nconst emit = defineEmits<BadgeEmits>()\n\nconst classes = computed(() => [\n 'wx-badge',\n `wx-badge--${props.type}`,\n `wx-badge--${props.variant}`,\n `wx-badge--${props.size}`,\n {\n 'wx-badge--round': props.round,\n 'wx-badge--closable': props.closable,\n },\n])\n</script>\n\n<template>\n <span :class=\"classes\">\n <span v-if=\"dot\" class=\"wx-badge__dot\" aria-hidden=\"true\" />\n <span v-if=\"$slots.icon\" class=\"wx-badge__icon\">\n <slot name=\"icon\" />\n </span>\n <span class=\"wx-badge__label\">\n <slot />\n </span>\n <button\n v-if=\"closable\"\n class=\"wx-badge__close\"\n type=\"button\"\n :aria-label=\"closeLabel\"\n @click=\"emit('close', $event)\"\n >\n <wx-icon name=\"close\" />\n </button>\n </span>\n</template>\n\n<style scoped>\n.wx-badge {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-4);\n box-sizing: border-box;\n max-width: 100%;\n border: 1px solid transparent;\n border-radius: var(--wx-radius-xs);\n font-family: inherit;\n font-weight: var(--wx-font-weight-medium);\n line-height: var(--wx-font-line-height-tight);\n white-space: nowrap;\n vertical-align: middle;\n}\n\n/* sizes */\n.wx-badge--sm {\n padding: 1px var(--wx-space-6);\n font-size: var(--wx-font-size-xs);\n}\n\n.wx-badge--md {\n padding: 3px var(--wx-space-8);\n font-size: var(--wx-font-size-xs);\n}\n\n.wx-badge--lg {\n padding: 5px var(--wx-space-10);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-badge--round {\n border-radius: var(--wx-radius-full);\n}\n\n/* Each type names its colours once; the variants below stay type-agnostic. */\n.wx-badge--default {\n --wx-badge-accent: var(--wx-text-muted);\n --wx-badge-soft: var(--wx-bg-fill);\n --wx-badge-solid: var(--wx-bg-inverse);\n --wx-badge-contrast: var(--wx-text-inverse);\n --wx-badge-border: var(--wx-border-default);\n}\n\n.wx-badge--primary {\n --wx-badge-accent: var(--wx-color-primary);\n --wx-badge-soft: var(--wx-color-primary-soft);\n --wx-badge-solid: var(--wx-color-primary);\n --wx-badge-contrast: var(--wx-color-primary-contrast);\n --wx-badge-border: var(--wx-color-primary);\n}\n\n.wx-badge--success {\n --wx-badge-accent: var(--wx-color-success-active);\n --wx-badge-soft: var(--wx-color-success-soft);\n --wx-badge-solid: var(--wx-color-success);\n --wx-badge-contrast: var(--wx-color-success-contrast);\n --wx-badge-border: var(--wx-color-success);\n}\n\n.wx-badge--warning {\n --wx-badge-accent: var(--wx-color-warning-active);\n --wx-badge-soft: var(--wx-color-warning-soft);\n --wx-badge-solid: var(--wx-color-warning);\n --wx-badge-contrast: var(--wx-color-warning-contrast);\n --wx-badge-border: var(--wx-color-warning);\n}\n\n.wx-badge--danger {\n --wx-badge-accent: var(--wx-color-danger);\n --wx-badge-soft: var(--wx-color-danger-soft);\n --wx-badge-solid: var(--wx-color-danger);\n --wx-badge-contrast: var(--wx-color-danger-contrast);\n --wx-badge-border: var(--wx-color-danger);\n}\n\n.wx-badge--info {\n --wx-badge-accent: var(--wx-color-info-active);\n --wx-badge-soft: var(--wx-color-info-soft);\n --wx-badge-solid: var(--wx-color-info);\n --wx-badge-contrast: var(--wx-color-info-contrast);\n --wx-badge-border: var(--wx-color-info);\n}\n\n/* variants */\n.wx-badge--soft {\n background: var(--wx-badge-soft);\n color: var(--wx-badge-accent);\n}\n\n.wx-badge--solid {\n background: var(--wx-badge-solid);\n color: var(--wx-badge-contrast);\n}\n\n.wx-badge--outline {\n background: transparent;\n border-color: var(--wx-badge-border);\n color: var(--wx-badge-accent);\n}\n\n.wx-badge__dot {\n width: 6px;\n height: 6px;\n flex: 0 0 auto;\n background: currentcolor;\n border-radius: var(--wx-radius-full);\n}\n\n.wx-badge__icon {\n display: inline-flex;\n align-items: center;\n}\n\n.wx-badge__label {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.wx-badge__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n /* Keeps the badge from growing taller than its text. */\n margin-right: -2px;\n padding: 0;\n background: transparent;\n border: none;\n border-radius: var(--wx-radius-full);\n color: inherit;\n font-size: 1em;\n line-height: 1;\n opacity: 0.65;\n cursor: pointer;\n}\n\n.wx-badge__close:hover {\n opacity: 1;\n}\n\n.wx-badge__close:focus-visible {\n outline: none;\n box-shadow: var(--wx-ring-focus);\n}\n</style>\n","import { inject, type ComputedRef, type InjectionKey } from 'vue'\nimport type { ButtonSize, ButtonType, ButtonVariant } from '../components/Button/types'\n\n/**\n * What a `WxButtonGroup` hands down to the buttons inside it. Every field is\n * optional: a button's own prop always wins, the group only fills the gaps.\n */\nexport interface ButtonGroupContext {\n type: ComputedRef<ButtonType | undefined>\n variant: ComputedRef<ButtonVariant | undefined>\n size: ComputedRef<ButtonSize | undefined>\n disabled: ComputedRef<boolean>\n vertical: ComputedRef<boolean>\n}\n\nexport const buttonGroupKey: InjectionKey<ButtonGroupContext> = Symbol('wx-button-group')\n\nexport function useButtonGroup(): ButtonGroupContext | null {\n return inject(buttonGroupKey, null)\n}\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { useButtonGroup } from '../../composables/useButtonGroup'\nimport type { ButtonEmits, ButtonProps } from './types'\n\ndefineOptions({ name: 'WxButton', inheritAttrs: false })\n\n/*\n * The look defaults to `undefined` rather than to its documented value: inside a\n * `WxButtonGroup` the button has to tell \"caller said default\" from \"caller said\n * nothing\", and a prop default would erase that difference.\n */\nconst props = withDefaults(defineProps<ButtonProps>(), {\n type: undefined,\n variant: undefined,\n size: undefined,\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 group = useButtonGroup()\n\nconst type = computed(() => props.type ?? group?.type.value ?? 'default')\nconst variant = computed(() => props.variant ?? group?.variant.value ?? 'solid')\nconst size = computed(() => props.size ?? group?.size.value ?? 'md')\n\nconst isDisabled = computed(() => props.disabled || props.loading || group?.disabled.value || false)\nconst tag = computed(() => (props.href ? 'a' : 'button'))\n\nconst classes = computed(() => [\n 'wx-button',\n `wx-button--${type.value}`,\n `wx-button--${variant.value}`,\n `wx-button--${size.value}`,\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 /* Same pace as a spinning WxIcon — a turn a second, not three. */\n animation: wx-button-spin var(--wx-button-spin-duration, 1s) 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, provide } from 'vue'\nimport { buttonGroupKey } from '../../composables/useButtonGroup'\nimport type { ButtonGroupProps } from './types'\n\ndefineOptions({ name: 'WxButtonGroup' })\n\nconst props = withDefaults(defineProps<ButtonGroupProps>(), {\n type: undefined,\n variant: undefined,\n size: undefined,\n disabled: false,\n vertical: false,\n attached: true,\n ariaLabel: undefined,\n})\n\nprovide(buttonGroupKey, {\n type: computed(() => props.type),\n variant: computed(() => props.variant),\n size: computed(() => props.size),\n disabled: computed(() => props.disabled),\n vertical: computed(() => props.vertical),\n})\n\nconst classes = computed(() => [\n 'wx-button-group',\n {\n 'wx-button-group--vertical': props.vertical,\n 'wx-button-group--attached': props.attached,\n },\n])\n</script>\n\n<template>\n <div :class=\"classes\" role=\"group\" :aria-label=\"ariaLabel\">\n <slot />\n </div>\n</template>\n\n<style scoped>\n.wx-button-group {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-8);\n vertical-align: middle;\n}\n\n.wx-button-group--vertical {\n flex-direction: column;\n align-items: stretch;\n}\n\n/* Joined: the buttons share one outline, so the gap goes and the borders overlap. */\n.wx-button-group--attached {\n gap: 0;\n}\n\n.wx-button-group--attached :deep(.wx-button) {\n position: relative;\n border-radius: 0;\n}\n\n.wx-button-group--attached :deep(.wx-button:first-child) {\n border-start-start-radius: var(--wx-radius-control);\n border-end-start-radius: var(--wx-radius-control);\n}\n\n.wx-button-group--attached :deep(.wx-button:last-child) {\n border-start-end-radius: var(--wx-radius-control);\n border-end-end-radius: var(--wx-radius-control);\n}\n\n.wx-button-group--attached :deep(.wx-button:not(:first-child)) {\n margin-left: -1px;\n}\n\n/* The hovered or focused button owns the shared border, so it is not half-covered. */\n.wx-button-group--attached :deep(.wx-button:hover),\n.wx-button-group--attached :deep(.wx-button:focus-visible),\n.wx-button-group--attached :deep(.wx-button:active) {\n z-index: 1;\n}\n\n.wx-button-group--attached.wx-button-group--vertical :deep(.wx-button) {\n border-radius: 0;\n}\n\n.wx-button-group--attached.wx-button-group--vertical :deep(.wx-button:first-child) {\n border-start-start-radius: var(--wx-radius-control);\n border-start-end-radius: var(--wx-radius-control);\n}\n\n.wx-button-group--attached.wx-button-group--vertical :deep(.wx-button:last-child) {\n border-end-start-radius: var(--wx-radius-control);\n border-end-end-radius: var(--wx-radius-control);\n}\n\n.wx-button-group--attached.wx-button-group--vertical :deep(.wx-button:not(:first-child)) {\n margin-left: 0;\n margin-top: -1px;\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","<script setup lang=\"ts\">\nimport { computed, nextTick, ref, watch } from 'vue'\nimport { PopoverAnchor, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger } from 'reka-ui'\nimport WxIcon from '../Icon/Icon.vue'\nimport { useFormField } from '../../composables/useFormField'\nimport type {\n CascaderEmits,\n CascaderModelValue,\n CascaderOption,\n CascaderProps,\n CascaderValue,\n} from './types'\n\ndefineOptions({ name: 'WxCascader', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<CascaderProps>(), {\n options: () => [],\n expandTrigger: 'click',\n checkStrictly: false,\n emitPath: true,\n showAllLevels: true,\n separator: ' / ',\n lazy: false,\n load: undefined,\n placeholder: undefined,\n emptyText: 'Nothing here',\n clearable: false,\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<CascaderEmits>()\n\nconst model = defineModel<CascaderModelValue>({ default: null })\n\nconst field = useFormField(props)\n\nconst open = ref(false)\n/** The chain of opened nodes — one column per entry, plus the root column. */\nconst activePath = ref<CascaderOption[]>([])\nconst panel = ref<HTMLElement | null>(null)\n\n/** Levels fetched by `load`, keyed by the path that asked for them. */\nconst loadedChildren = ref(new Map<string, CascaderOption[]>())\nconst loadingKeys = ref(new Set<string>())\n\n/**\n * A path is keyed by the values along it, serialised — no separator character to\n * clash with a value that happens to contain one. The root is the empty path.\n */\nfunction keyOf(path: CascaderOption[]): string {\n return JSON.stringify(path.map((option) => option.value))\n}\n\nconst rootOptions = computed<CascaderOption[]>(() =>\n props.options.length > 0 ? props.options : (loadedChildren.value.get(keyOf([])) ?? []),\n)\n\nfunction childrenOf(option: CascaderOption, parents: CascaderOption[]): CascaderOption[] {\n if (option.children?.length) return option.children\n return loadedChildren.value.get(keyOf([...parents, option])) ?? []\n}\n\nfunction isLeaf(option: CascaderOption, parents: CascaderOption[]): boolean {\n if (option.leaf === true) return true\n if (option.children?.length) return false\n if (!props.lazy) return true\n\n /* Lazily: a node is a leaf once its level came back empty, not before. */\n const loaded = loadedChildren.value.get(keyOf([...parents, option]))\n return loaded !== undefined && loaded.length === 0\n}\n\nfunction isLoading(option: CascaderOption, parents: CascaderOption[]): boolean {\n return loadingKeys.value.has(keyOf([...parents, option]))\n}\n\n/** The root column, then one column per opened node that has something under it. */\nconst columns = computed<CascaderOption[][]>(() => {\n const result: CascaderOption[][] = [rootOptions.value]\n\n activePath.value.forEach((option, index) => {\n const children = childrenOf(option, activePath.value.slice(0, index))\n if (children.length > 0) result.push(children)\n })\n\n return result\n})\n\n/** Walks a stored path of values back into the options they name. */\nfunction resolvePath(values: CascaderValue[]): CascaderOption[] {\n const path: CascaderOption[] = []\n let level = rootOptions.value\n\n for (const value of values) {\n const option = level.find((candidate) => candidate.value === value)\n if (!option) break\n path.push(option)\n level = childrenOf(option, path.slice(0, -1))\n }\n\n return path\n}\n\n/** Depth-first search, for a model that holds the last value alone. */\nfunction findPath(\n options: CascaderOption[],\n value: CascaderValue,\n parents: CascaderOption[] = [],\n): CascaderOption[] | undefined {\n for (const option of options) {\n const path = [...parents, option]\n if (option.value === value) return path\n\n const found = findPath(childrenOf(option, parents), value, path)\n if (found) return found\n }\n return undefined\n}\n\nconst selectedPath = computed<CascaderOption[]>(() => {\n const value = model.value\n if (value === null || value === undefined || value === '') return []\n if (Array.isArray(value)) return resolvePath(value)\n return findPath(rootOptions.value, value) ?? []\n})\n\nconst hasValue = computed(() => {\n const value = model.value\n if (value === null || value === undefined || value === '') return false\n /* An empty path is \"nothing picked\" — that is what `clear` leaves behind. */\n if (Array.isArray(value)) return value.length > 0\n return true\n})\n\nconst displayLabel = computed(() => {\n const path = selectedPath.value\n\n /* Nothing resolved — usually a lazy tree that has not loaded the branch yet. */\n if (path.length === 0) {\n const value = model.value\n if (!hasValue.value) return ''\n return Array.isArray(value) ? value.join(props.separator) : String(value)\n }\n\n if (!props.showAllLevels) return path[path.length - 1].label\n return path.map((option) => option.label).join(props.separator)\n})\n\nconst showClear = computed(() => props.clearable && !field.disabled.value && hasValue.value)\n\n/** What a plain form post carries: the path as `content,news`, or the single value. */\nconst formValue = computed(() => {\n const value = model.value\n if (!hasValue.value) return ''\n return Array.isArray(value) ? value.join(',') : String(value)\n})\n\nconst classes = computed(() => [\n 'wx-cascader',\n `wx-cascader--${field.size.value}`,\n {\n [`wx-cascader--${field.status.value}`]: field.status.value !== 'default',\n 'is-open': open.value,\n 'is-disabled': field.disabled.value,\n },\n])\n\nasync function loadLevel(path: CascaderOption[]): Promise<void> {\n if (!props.load) return\n\n const key = keyOf(path)\n if (loadedChildren.value.has(key) || loadingKeys.value.has(key)) return\n\n loadingKeys.value.add(key)\n try {\n const children = await props.load(path[path.length - 1] ?? null, path)\n loadedChildren.value.set(key, children)\n } finally {\n loadingKeys.value.delete(key)\n }\n}\n\nfunction expand(option: CascaderOption, level: number) {\n if (option.disabled) return\n\n const parents = activePath.value.slice(0, level)\n activePath.value = [...parents, option]\n emit('expand', activePath.value)\n\n if (props.lazy && !isLeaf(option, parents)) void loadLevel([...parents, option])\n}\n\nfunction select(path: CascaderOption[]) {\n const value: CascaderModelValue = props.emitPath\n ? path.map((option) => option.value)\n : (path[path.length - 1]?.value ?? null)\n\n model.value = value\n emit('change', value)\n}\n\nfunction onOptionClick(option: CascaderOption, level: number) {\n if (option.disabled) return\n\n const parents = activePath.value.slice(0, level)\n const path = [...parents, option]\n const leaf = isLeaf(option, parents)\n\n expand(option, level)\n\n if (leaf || props.checkStrictly) select(path)\n if (leaf) open.value = false\n}\n\nfunction onOptionHover(option: CascaderOption, level: number) {\n if (props.expandTrigger !== 'hover' || option.disabled) return\n if (isLeaf(option, activePath.value.slice(0, level))) return\n expand(option, level)\n}\n\nfunction clear() {\n model.value = props.emitPath ? [] : null\n activePath.value = []\n emit('change', model.value)\n emit('clear')\n}\n\nwatch(open, (value) => {\n if (value) {\n /* Reopening lands where the current value sits, not where the last poke left it. */\n activePath.value = selectedPath.value.slice(0, -1)\n if (props.lazy && rootOptions.value.length === 0) void loadLevel([])\n emit('open')\n return\n }\n emit('close')\n})\n\n// --- keyboard ---------------------------------------------------------------\n\nfunction optionsIn(level: number): HTMLButtonElement[] {\n if (!panel.value) return []\n return [\n ...panel.value.querySelectorAll<HTMLButtonElement>(\n `[data-column=\"${level}\"] .wx-cascader__option:not(:disabled)`,\n ),\n ]\n}\n\nfunction focusOption(level: number, index: number) {\n const items = optionsIn(level)\n if (items.length === 0) return\n const bounded = ((index % items.length) + items.length) % items.length\n items[bounded]?.focus()\n}\n\nfunction onPanelKeydown(event: KeyboardEvent) {\n const target = event.target as HTMLElement | null\n const column = target?.closest<HTMLElement>('[data-column]')\n\n /* The panel itself has focus right after opening: the first arrow enters the list. */\n if (!column) {\n if (event.key === 'ArrowDown' || event.key === 'ArrowRight') {\n event.preventDefault()\n focusOption(0, 0)\n }\n return\n }\n\n const level = Number(column.dataset.column)\n const items = optionsIn(level)\n const current = items.indexOf(target as HTMLButtonElement)\n const option = columns.value[level]?.[Number((target as HTMLElement).dataset.index)]\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault()\n focusOption(level, current + 1)\n break\n case 'ArrowUp':\n event.preventDefault()\n focusOption(level, current - 1)\n break\n case 'ArrowRight': {\n if (!option || isLeaf(option, activePath.value.slice(0, level))) return\n event.preventDefault()\n expand(option, level)\n void nextTick(() => focusOption(level + 1, 0))\n break\n }\n case 'ArrowLeft': {\n if (level === 0) return\n event.preventDefault()\n activePath.value = activePath.value.slice(0, level - 1)\n void nextTick(() => {\n const parent = columns.value[level - 1]?.findIndex(\n (candidate) => candidate.value === activePath.value[level - 1]?.value,\n )\n focusOption(level - 1, parent === undefined || parent < 0 ? 0 : parent)\n })\n break\n }\n default:\n break\n }\n}\n</script>\n\n<template>\n <popover-root v-model:open=\"open\">\n <div :class=\"classes\">\n <popover-anchor as=\"div\" class=\"wx-cascader__anchor\">\n <popover-trigger\n :id=\"field.id.value\"\n v-bind=\"$attrs\"\n class=\"wx-cascader__trigger\"\n type=\"button\"\n :disabled=\"field.disabled.value\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"field.describedBy.value\"\n :aria-invalid=\"field.status.value === 'error' || undefined\"\n >\n <span v-if=\"hasValue\" class=\"wx-cascader__value\">{{ displayLabel }}</span>\n <span v-else class=\"wx-cascader__placeholder\">{{ placeholder }}</span>\n <wx-icon class=\"wx-cascader__arrow\" name=\"chevron-down\" />\n </popover-trigger>\n\n <button\n v-if=\"showClear\"\n class=\"wx-cascader__clear\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Clear\"\n @click.stop=\"clear\"\n >\n <wx-icon name=\"close\" />\n </button>\n </popover-anchor>\n\n <input v-if=\"name\" type=\"hidden\" :name=\"name\" :value=\"formValue\" />\n </div>\n\n <popover-portal :disabled=\"!teleport\">\n <!--\n The panel itself takes focus when it opens — that is what makes the arrow keys\n work — so the key handler sits on it rather than on the columns inside.\n -->\n <popover-content\n class=\"wx-cascader__panel\"\n align=\"start\"\n :side-offset=\"4\"\n @keydown=\"onPanelKeydown\"\n >\n <div ref=\"panel\" class=\"wx-cascader__columns\">\n <div\n v-for=\"(column, level) in columns\"\n :key=\"level\"\n class=\"wx-cascader__column\"\n :data-column=\"level\"\n role=\"listbox\"\n :aria-label=\"`Level ${level + 1}`\"\n >\n <button\n v-for=\"(option, index) in column\"\n :key=\"String(option.value)\"\n class=\"wx-cascader__option\"\n type=\"button\"\n role=\"option\"\n :data-index=\"index\"\n :disabled=\"option.disabled\"\n :aria-selected=\"selectedPath[level]?.value === option.value\"\n :class=\"{\n 'is-active': activePath[level]?.value === option.value,\n 'is-selected': selectedPath[level]?.value === option.value,\n }\"\n @click=\"onOptionClick(option, level)\"\n @mouseenter=\"onOptionHover(option, level)\"\n >\n <span class=\"wx-cascader__label\">\n <slot name=\"option\" :option=\"option\" :level=\"level\">{{ option.label }}</slot>\n </span>\n\n <wx-icon\n v-if=\"isLoading(option, activePath.slice(0, level))\"\n class=\"wx-cascader__mark\"\n name=\"loader\"\n spin\n />\n <wx-icon\n v-else-if=\"!isLeaf(option, activePath.slice(0, level))\"\n class=\"wx-cascader__mark\"\n name=\"chevron-right\"\n />\n <wx-icon\n v-else-if=\"selectedPath[level]?.value === option.value\"\n class=\"wx-cascader__mark wx-cascader__mark--check\"\n name=\"check\"\n />\n </button>\n\n <p v-if=\"column.length === 0\" class=\"wx-cascader__empty\">{{ emptyText }}</p>\n </div>\n </div>\n </popover-content>\n </popover-portal>\n </popover-root>\n</template>\n\n<style scoped>\n.wx-cascader {\n display: block;\n width: 100%;\n}\n\n.wx-cascader__anchor {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n height: var(--wx-size-control-md);\n padding-right: 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-size: var(--wx-font-size-md);\n transition: border-color var(--wx-duration-normal) var(--wx-easing-standard);\n}\n\n.wx-cascader--sm .wx-cascader__anchor {\n height: var(--wx-size-control-sm);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-cascader--lg .wx-cascader__anchor {\n height: var(--wx-size-control-lg);\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-cascader__anchor:hover {\n border-color: var(--wx-border-strong);\n}\n\n.wx-cascader.is-open .wx-cascader__anchor,\n.wx-cascader__anchor:focus-within {\n border-color: var(--wx-border-focus);\n}\n\n.wx-cascader--error .wx-cascader__anchor,\n.wx-cascader--error.is-open .wx-cascader__anchor {\n border-color: var(--wx-color-danger);\n}\n\n.wx-cascader--success .wx-cascader__anchor {\n border-color: var(--wx-color-success);\n}\n\n.wx-cascader--warning .wx-cascader__anchor {\n border-color: var(--wx-color-warning);\n}\n\n.wx-cascader.is-disabled .wx-cascader__anchor {\n background: var(--wx-bg-disabled);\n color: var(--wx-text-disabled);\n}\n\n.wx-cascader__trigger {\n display: flex;\n align-items: center;\n gap: var(--wx-space-8);\n flex: 1 1 auto;\n min-width: 0;\n height: 100%;\n padding: 0 0 0 var(--wx-space-12);\n background: transparent;\n border: none;\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n text-align: start;\n cursor: pointer;\n}\n\n.wx-cascader__trigger:focus-visible {\n outline: none;\n}\n\n.wx-cascader.is-disabled .wx-cascader__trigger {\n cursor: not-allowed;\n}\n\n.wx-cascader__value,\n.wx-cascader__placeholder {\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.wx-cascader__placeholder {\n color: var(--wx-text-placeholder);\n}\n\n.wx-cascader__arrow {\n flex: 0 0 auto;\n color: var(--wx-text-muted);\n font-size: 16px;\n transition: transform var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-cascader.is-open .wx-cascader__arrow {\n transform: rotate(180deg);\n}\n\n.wx-cascader__clear {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 20px;\n height: 20px;\n padding: 0;\n background: transparent;\n border: none;\n border-radius: var(--wx-radius-full);\n color: var(--wx-text-muted);\n cursor: pointer;\n}\n\n.wx-cascader__clear:hover {\n color: var(--wx-text-default);\n}\n</style>\n\n<style>\n/* The panel is teleported, so its styles cannot be scoped to the component. */\n.wx-cascader__panel {\n z-index: var(--wx-z-index-dropdown);\n box-sizing: border-box;\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-cascader__columns {\n display: flex;\n align-items: stretch;\n max-width: min(90vw, 720px);\n /* Columns scroll sideways rather than push the panel off a narrow screen. */\n overflow-x: auto;\n}\n\n.wx-cascader__column {\n display: flex;\n flex-direction: column;\n flex: 0 0 auto;\n gap: 1px;\n min-width: 180px;\n max-height: 280px;\n padding: var(--wx-space-4);\n overflow-y: auto;\n}\n\n.wx-cascader__column + .wx-cascader__column {\n border-left: 1px solid var(--wx-border-muted);\n}\n\n.wx-cascader__option {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--wx-space-8);\n width: 100%;\n padding: var(--wx-space-6) var(--wx-space-10);\n background: transparent;\n border: none;\n border-radius: var(--wx-radius-xs);\n color: inherit;\n font-family: inherit;\n font-size: var(--wx-font-size-sm);\n text-align: start;\n cursor: pointer;\n}\n\n.wx-cascader__option:hover:not(:disabled),\n.wx-cascader__option:focus-visible {\n background: var(--wx-bg-fill);\n outline: none;\n}\n\n.wx-cascader__option.is-active {\n background: var(--wx-bg-fill);\n}\n\n.wx-cascader__option.is-selected {\n color: var(--wx-color-primary);\n font-weight: var(--wx-font-weight-semibold);\n}\n\n.wx-cascader__option:disabled {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-cascader__label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.wx-cascader__mark {\n flex: 0 0 auto;\n color: var(--wx-text-muted);\n font-size: 14px;\n}\n\n.wx-cascader__mark--check {\n color: var(--wx-color-primary);\n}\n\n.wx-cascader__empty {\n margin: 0;\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, 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 type { StatisticProps } from './types'\n\ndefineOptions({ name: 'WxStatistic' })\n\nconst props = withDefaults(defineProps<StatisticProps>(), {\n value: undefined,\n title: undefined,\n precision: undefined,\n locale: undefined,\n grouping: true,\n prefix: undefined,\n suffix: undefined,\n formatter: undefined,\n size: 'md',\n tone: 'strong',\n align: undefined,\n})\n\nconst display = computed(() => {\n if (props.formatter) return props.formatter(props.value)\n if (typeof props.value !== 'number') return props.value ?? ''\n\n /*\n * `Intl` rather than a hand-rolled separator: 268 500 in one locale is 268,500 in\n * another, and an admin panel that ships in several languages should not decide.\n */\n return new Intl.NumberFormat(props.locale, {\n useGrouping: props.grouping,\n minimumFractionDigits: props.precision,\n maximumFractionDigits: props.precision,\n }).format(props.value)\n})\n\nconst classes = computed(() => [\n 'wx-statistic',\n `wx-statistic--${props.size}`,\n `wx-statistic--tone-${props.tone}`,\n { [`wx-statistic--align-${props.align}`]: Boolean(props.align) },\n])\n</script>\n\n<template>\n <div :class=\"classes\">\n <div v-if=\"title || $slots.title\" class=\"wx-statistic__title\">\n <slot name=\"title\">{{ title }}</slot>\n </div>\n\n <div class=\"wx-statistic__value\">\n <span v-if=\"prefix || $slots.prefix\" class=\"wx-statistic__affix\">\n <slot name=\"prefix\">{{ prefix }}</slot>\n </span>\n\n <span class=\"wx-statistic__number\">\n <slot name=\"value\">{{ display }}</slot>\n </span>\n\n <span v-if=\"suffix || $slots.suffix\" class=\"wx-statistic__affix\">\n <slot name=\"suffix\">{{ suffix }}</slot>\n </span>\n </div>\n\n <div v-if=\"$slots.default\" class=\"wx-statistic__footer\">\n <slot />\n </div>\n </div>\n</template>\n\n<style scoped>\n.wx-statistic {\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-4);\n min-width: 0;\n color: var(--wx-text-default);\n font-family: var(--wx-font-family-sans);\n}\n\n.wx-statistic--align-center {\n text-align: center;\n align-items: center;\n}\n\n.wx-statistic--align-end {\n text-align: end;\n align-items: flex-end;\n}\n\n.wx-statistic--align-start {\n text-align: start;\n align-items: flex-start;\n}\n\n.wx-statistic--align-justify {\n text-align: justify;\n}\n\n.wx-statistic__title {\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-sm);\n line-height: var(--wx-font-line-height-normal);\n}\n\n.wx-statistic--sm .wx-statistic__title {\n font-size: var(--wx-font-size-xs);\n}\n\n.wx-statistic__value {\n display: flex;\n align-items: baseline;\n gap: var(--wx-space-4);\n color: var(--wx-statistic-color, var(--wx-text-strong));\n /* Digits of equal width, so a ticking number does not jitter. */\n font-variant-numeric: tabular-nums;\n font-weight: var(--wx-font-weight-semibold);\n line-height: var(--wx-font-line-height-tight);\n}\n\n.wx-statistic--sm .wx-statistic__value {\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-statistic--md .wx-statistic__value {\n font-size: var(--wx-font-size-2xl);\n}\n\n.wx-statistic--lg .wx-statistic__value {\n font-size: var(--wx-font-size-3xl);\n}\n\n.wx-statistic__number {\n min-width: 0;\n}\n\n.wx-statistic__affix {\n color: var(--wx-text-muted);\n font-size: 0.65em;\n font-weight: var(--wx-font-weight-medium);\n}\n\n.wx-statistic__footer {\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-xs);\n}\n\n/* tones */\n.wx-statistic--tone-default {\n --wx-statistic-color: var(--wx-text-default);\n}\n\n.wx-statistic--tone-strong {\n --wx-statistic-color: var(--wx-text-strong);\n}\n\n.wx-statistic--tone-muted {\n --wx-statistic-color: var(--wx-text-muted);\n}\n\n.wx-statistic--tone-placeholder {\n --wx-statistic-color: var(--wx-text-placeholder);\n}\n\n.wx-statistic--tone-primary {\n --wx-statistic-color: var(--wx-color-primary);\n}\n\n.wx-statistic--tone-success {\n --wx-statistic-color: var(--wx-color-success-active);\n}\n\n.wx-statistic--tone-warning {\n --wx-statistic-color: var(--wx-color-warning-active);\n}\n\n.wx-statistic--tone-danger {\n --wx-statistic-color: var(--wx-color-danger);\n}\n\n.wx-statistic--tone-info {\n --wx-statistic-color: var(--wx-color-info-active);\n}\n\n.wx-statistic--tone-inverse {\n --wx-statistic-color: var(--wx-text-inverse);\n}\n</style>\n","import type { CountdownTarget } from './types'\n\n/** Largest unit first: each token takes its share of what the previous ones left. */\nconst units: [token: string, ms: number][] = [\n ['DD', 86_400_000],\n ['HH', 3_600_000],\n ['mm', 60_000],\n ['ss', 1_000],\n ['SSS', 1],\n]\n\n/**\n * Renders a span of milliseconds against a pattern of `DD`, `HH`, `mm`, `ss`, `SSS`.\n *\n * Only the tokens the pattern actually contains consume time, so `mm:ss` on two hours\n * prints `120:00` rather than silently dropping the hours. Everything else in the\n * pattern is copied through — mind that a literal word containing a token (`ss` in\n * \"passed\") would be replaced.\n */\nexport function formatCountdown(ms: number, format = 'HH:mm:ss'): string {\n let remaining = Math.max(0, Math.floor(ms))\n let out = format\n\n for (const [token, unit] of units) {\n if (!out.includes(token)) continue\n const value = Math.floor(remaining / unit)\n remaining -= value * unit\n out = out.replace(token, String(value).padStart(token.length, '0'))\n }\n\n return out\n}\n\n/** Normalises whatever the caller passed as a target into a timestamp. */\nexport function toTimestamp(value: CountdownTarget): number {\n if (typeof value === 'number') return value\n if (value instanceof Date) return value.getTime()\n const parsed = Date.parse(value)\n return Number.isNaN(parsed) ? 0 : parsed\n}\n","<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport WxStatistic from '../Statistic/Statistic.vue'\nimport { formatCountdown, toTimestamp } from './format'\nimport type { CountdownEmits, CountdownProps } from './types'\n\ndefineOptions({ name: 'WxCountdown' })\n\nconst props = withDefaults(defineProps<CountdownProps>(), {\n format: 'HH:mm:ss',\n interval: 1000,\n title: undefined,\n prefix: undefined,\n suffix: undefined,\n size: 'md',\n tone: 'strong',\n align: undefined,\n})\n\nconst emit = defineEmits<CountdownEmits>()\n\nconst target = computed(() => toTimestamp(props.value))\nconst remaining = ref(Math.max(0, target.value - Date.now()))\n\nlet timer: ReturnType<typeof setInterval> | undefined\n\nfunction stop() {\n if (timer === undefined) return\n clearInterval(timer)\n timer = undefined\n}\n\nfunction tick() {\n const left = Math.max(0, target.value - Date.now())\n remaining.value = left\n emit('change', left)\n\n /* `finish` fires once: the timer stops before the next tick can repeat it. */\n if (left === 0) {\n stop()\n emit('finish')\n }\n}\n\nfunction start() {\n stop()\n if (remaining.value === 0) return\n timer = setInterval(tick, Math.max(16, props.interval))\n}\n\n/*\n * A new target — or a new tick rate — restarts the clock rather than letting it\n * drift. The value is recomputed either way; the timer only exists once the\n * component is mounted, which is what keeps it off the server: an interval started\n * during SSR is never cleared, and it holds the render process open forever.\n */\nlet running = false\n\nwatch(\n [target, () => props.interval],\n () => {\n remaining.value = Math.max(0, target.value - Date.now())\n if (running) start()\n },\n { immediate: true },\n)\n\nonMounted(() => {\n running = true\n start()\n})\n\nonBeforeUnmount(() => {\n running = false\n stop()\n})\n\nconst text = computed(() => formatCountdown(remaining.value, props.format))\n\ndefineExpose({ remaining })\n</script>\n\n<template>\n <wx-statistic\n class=\"wx-countdown\"\n :value=\"text\"\n :title=\"title\"\n :prefix=\"prefix\"\n :suffix=\"suffix\"\n :size=\"size\"\n :tone=\"tone\"\n :align=\"align\"\n >\n <template v-if=\"$slots.title\" #title><slot name=\"title\" /></template>\n <template v-if=\"$slots.prefix\" #prefix><slot name=\"prefix\" /></template>\n <template v-if=\"$slots.suffix\" #suffix><slot name=\"suffix\" /></template>\n <template v-if=\"$slots.value\" #value\n ><slot name=\"value\" :remaining=\"remaining\" :text=\"text\"\n /></template>\n <template v-if=\"$slots.default\" #default><slot /></template>\n </wx-statistic>\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 { 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 } from 'vue'\nimport WxIcon from '../Icon/Icon.vue'\nimport { useDropdown } from '../../composables/useDropdown'\nimport type { DropdownItemEmits, DropdownItemProps } from './types'\n\ndefineOptions({ name: 'WxDropdownItem', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<DropdownItemProps>(), {\n icon: undefined,\n href: undefined,\n target: undefined,\n as: undefined,\n tone: 'default',\n active: false,\n disabled: false,\n})\n\nconst emit = defineEmits<DropdownItemEmits>()\n\nconst dropdown = useDropdown()\n\nconst tag = computed(() => props.as ?? (props.href ? 'a' : 'button'))\n\nconst nativeAttrs = computed(() => {\n if (props.href) {\n return {\n href: props.disabled ? undefined : props.href,\n target: props.target,\n 'aria-disabled': props.disabled ? 'true' : undefined,\n tabindex: props.disabled ? -1 : undefined,\n }\n }\n if (props.as) return { 'aria-disabled': props.disabled ? 'true' : undefined }\n return { type: 'button' as const, disabled: props.disabled }\n})\n\nconst classes = computed(() => [\n 'wx-dropdown-item',\n `wx-dropdown-item--${props.tone}`,\n { 'is-active': props.active, 'is-disabled': props.disabled },\n])\n\nfunction onClick(event: MouseEvent) {\n if (props.disabled) {\n event.preventDefault()\n event.stopPropagation()\n return\n }\n\n emit('click', event)\n\n /*\n * The panel closes here as well as on its own click handler: an item rendered\n * outside the dropdown's panel — in a collapsed actions row, say — still behaves.\n */\n if (dropdown?.closeOnSelect()) dropdown.close()\n}\n</script>\n\n<template>\n <component :is=\"tag\" v-bind=\"{ ...nativeAttrs, ...$attrs }\" :class=\"classes\" @click=\"onClick\">\n <span v-if=\"icon || $slots.before\" class=\"wx-dropdown-item__before\">\n <slot name=\"before\">\n <wx-icon v-if=\"icon\" :name=\"icon\" />\n </slot>\n </span>\n\n <span class=\"wx-dropdown-item__label\"><slot /></span>\n\n <span v-if=\"$slots.after\" class=\"wx-dropdown-item__after\">\n <slot name=\"after\" />\n </span>\n </component>\n</template>\n\n<style scoped>\n.wx-dropdown-item {\n display: flex;\n align-items: center;\n gap: var(--wx-space-8);\n box-sizing: border-box;\n width: 100%;\n padding: var(--wx-space-6) var(--wx-space-10);\n background: none;\n border: none;\n border-radius: var(--wx-radius-xs);\n color: var(--wx-dropdown-item-color, var(--wx-text-default));\n font-family: inherit;\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 text-align: start;\n text-decoration: none;\n cursor: pointer;\n transition: background-color var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-dropdown-item:hover:not(.is-disabled),\n.wx-dropdown-item.is-active {\n background: var(--wx-dropdown-item-bg, var(--wx-bg-fill));\n}\n\n.wx-dropdown-item:focus-visible {\n outline: none;\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-dropdown-item--default {\n --wx-dropdown-item-color: var(--wx-text-default);\n}\n\n.wx-dropdown-item--default:hover:not(.is-disabled),\n.wx-dropdown-item--default.is-active {\n --wx-dropdown-item-color: var(--wx-color-primary);\n}\n\n.wx-dropdown-item--primary {\n --wx-dropdown-item-color: var(--wx-color-primary);\n --wx-dropdown-item-bg: var(--wx-color-primary-soft);\n}\n\n.wx-dropdown-item--danger {\n --wx-dropdown-item-color: var(--wx-color-danger);\n --wx-dropdown-item-bg: var(--wx-color-danger-soft);\n}\n\n.wx-dropdown-item--success {\n --wx-dropdown-item-color: var(--wx-color-success-active);\n --wx-dropdown-item-bg: var(--wx-color-success-soft);\n}\n\n.wx-dropdown-item--warning {\n --wx-dropdown-item-color: var(--wx-color-warning-active);\n --wx-dropdown-item-bg: var(--wx-color-warning-soft);\n}\n\n.wx-dropdown-item.is-disabled,\n.wx-dropdown-item:disabled {\n color: var(--wx-text-disabled);\n cursor: not-allowed;\n}\n\n.wx-dropdown-item__before,\n.wx-dropdown-item__after {\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n font-size: 16px;\n}\n\n.wx-dropdown-item__after {\n margin-left: auto;\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-xs);\n}\n\n.wx-dropdown-item__label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue'\nimport type { EntityCardEmits, EntityCardProps } from './types'\n\ndefineOptions({ name: 'WxEntityCard' })\n\nconst props = withDefaults(defineProps<EntityCardProps>(), {\n title: undefined,\n href: undefined,\n subtitle: undefined,\n image: undefined,\n imageAlt: undefined,\n shape: 'rounded',\n imageSize: undefined,\n meta: () => [],\n size: 'md',\n variant: 'card',\n bordered: false,\n selected: false,\n})\n\nconst emit = defineEmits<EntityCardEmits>()\n\nconst slots = useSlots()\n\nconst defaultImageSize: Record<string, string> = { sm: '32px', md: '44px', lg: '64px' }\n\nconst imageSize = computed(() => {\n if (props.imageSize === undefined) return defaultImageSize[props.size]\n return typeof props.imageSize === 'number' ? `${props.imageSize}px` : props.imageSize\n})\n\nconst hasMedia = computed(() => Boolean(props.image || slots.media))\n\n/** With no picture, the first letter stands in — a list of rows stays aligned. */\nconst initial = computed(() => props.title?.trim().charAt(0).toUpperCase() ?? '')\n\nconst hasMeta = computed(() => Boolean(slots.meta || props.meta.length > 0))\n\nconst classes = computed(() => [\n 'wx-entity-card',\n `wx-entity-card--${props.size}`,\n `wx-entity-card--${props.variant}`,\n {\n 'wx-entity-card--bordered': props.bordered,\n 'is-selected': props.selected,\n },\n])\n</script>\n\n<template>\n <div\n :class=\"classes\"\n :style=\"{ '--wx-entity-card-image': imageSize }\"\n @click=\"emit('click', $event)\"\n >\n <div v-if=\"hasMedia\" class=\"wx-entity-card__media\" :class=\"`wx-entity-card__media--${shape}`\">\n <slot name=\"media\">\n <img :src=\"image\" :alt=\"imageAlt ?? title ?? ''\" class=\"wx-entity-card__image\" />\n </slot>\n </div>\n <div\n v-else-if=\"title\"\n class=\"wx-entity-card__media wx-entity-card__media--empty\"\n :class=\"`wx-entity-card__media--${shape}`\"\n aria-hidden=\"true\"\n >\n {{ initial }}\n </div>\n\n <div class=\"wx-entity-card__body\">\n <component\n :is=\"href ? 'a' : 'span'\"\n v-if=\"title || $slots.title\"\n class=\"wx-entity-card__title\"\n :href=\"href\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </component>\n\n <span v-if=\"subtitle || $slots.subtitle\" class=\"wx-entity-card__subtitle\">\n <slot name=\"subtitle\">{{ subtitle }}</slot>\n </span>\n\n <div v-if=\"hasMeta\" class=\"wx-entity-card__meta\">\n <slot name=\"meta\">\n <span v-for=\"(item, index) in meta\" :key=\"index\" class=\"wx-entity-card__meta-item\">\n <span v-if=\"item.label\" class=\"wx-entity-card__meta-label\">{{ item.label }}:</span>\n <span v-if=\"item.text\" class=\"wx-entity-card__meta-text\">{{ item.text }}</span>\n </span>\n </slot>\n </div>\n\n <div v-if=\"$slots.default\" class=\"wx-entity-card__content\">\n <slot />\n </div>\n </div>\n\n <div v-if=\"$slots.actions\" class=\"wx-entity-card__actions\" @click.stop>\n <slot name=\"actions\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n.wx-entity-card {\n display: flex;\n align-items: center;\n /* Wrapping is what makes a narrow card work: the actions drop to their own line\n instead of squeezing the title into two characters. */\n flex-wrap: wrap;\n gap: var(--wx-space-12);\n box-sizing: border-box;\n padding: var(--wx-entity-card-padding, var(--wx-space-12));\n border: 1px solid transparent;\n border-radius: var(--wx-radius-md);\n color: var(--wx-text-default);\n font-family: var(--wx-font-family-sans);\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}\n\n.wx-entity-card--sm {\n --wx-entity-card-padding: var(--wx-space-8);\n gap: var(--wx-space-8);\n}\n\n.wx-entity-card--lg {\n --wx-entity-card-padding: var(--wx-space-16);\n gap: var(--wx-space-16);\n}\n\n.wx-entity-card--card {\n background: var(--wx-bg-surface);\n box-shadow: var(--wx-shadow-card);\n}\n\n.wx-entity-card--plain {\n padding: 0;\n background: transparent;\n}\n\n.wx-entity-card--bordered {\n border-color: var(--wx-border-default);\n}\n\n/*\n * A border needs something to enclose: without this a plain card — which drops its\n * padding so it can sit inside another one — glues the thumbnail and the actions to\n * the outline.\n */\n.wx-entity-card--plain.wx-entity-card--bordered,\n.wx-entity-card--plain.is-selected {\n padding: var(--wx-entity-card-padding, var(--wx-space-12));\n}\n\n.wx-entity-card.is-selected {\n border-color: var(--wx-color-primary);\n background: var(--wx-color-primary-soft);\n}\n\n.wx-entity-card__media {\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: var(--wx-entity-card-image, 44px);\n height: var(--wx-entity-card-image, 44px);\n overflow: hidden;\n background: var(--wx-bg-fill);\n}\n\n.wx-entity-card__media--rounded {\n border-radius: var(--wx-radius-xs);\n}\n\n.wx-entity-card__media--square {\n border-radius: 0;\n}\n\n.wx-entity-card__media--circle {\n border-radius: var(--wx-radius-full);\n}\n\n.wx-entity-card__media--empty {\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-lg);\n font-weight: var(--wx-font-weight-semibold);\n user-select: none;\n}\n\n.wx-entity-card__image {\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n\n.wx-entity-card__body {\n display: flex;\n flex-direction: column;\n gap: 2px;\n /* The basis is the point where the actions wrap; `min-width: 0` is what lets a long\n title be cut rather than stretch the row. */\n flex: 1 1 180px;\n min-width: 0;\n}\n\n.wx-entity-card__title {\n color: var(--wx-text-strong);\n font-size: var(--wx-font-size-md);\n font-weight: var(--wx-font-weight-semibold);\n line-height: var(--wx-font-line-height-tight);\n text-decoration: none;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.wx-entity-card--sm .wx-entity-card__title {\n font-size: var(--wx-font-size-sm);\n}\n\na.wx-entity-card__title:hover {\n color: var(--wx-text-link);\n}\n\n.wx-entity-card__subtitle {\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-sm);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.wx-entity-card__meta {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--wx-space-4) var(--wx-space-12);\n margin-top: 2px;\n color: var(--wx-text-default);\n font-size: var(--wx-font-size-xs);\n line-height: var(--wx-font-line-height-normal);\n}\n\n.wx-entity-card__meta-item {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-4);\n min-width: 0;\n}\n\n.wx-entity-card__meta-label {\n color: var(--wx-text-muted);\n}\n\n.wx-entity-card__meta-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.wx-entity-card__content {\n margin-top: var(--wx-space-8);\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-entity-card__actions {\n display: flex;\n align-items: center;\n gap: var(--wx-space-8);\n flex: 0 0 auto;\n margin-left: auto;\n}\n</style>\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 } from 'vue'\nimport type { HeadingLevel, HeadingProps, HeadingSize } from './types'\n\ndefineOptions({ name: 'WxHeading' })\n\nconst props = withDefaults(defineProps<HeadingProps>(), {\n level: 2,\n size: undefined,\n tone: 'strong',\n align: undefined,\n truncate: false,\n})\n\n/** What each level looks like when `size` is left alone. */\nconst sizeForLevel: Record<HeadingLevel, HeadingSize> = {\n 1: '3xl',\n 2: '2xl',\n 3: 'xl',\n 4: 'lg',\n 5: 'md',\n 6: 'sm',\n}\n\nconst size = computed(() => props.size ?? sizeForLevel[props.level])\n\nconst classes = computed(() => [\n 'wx-heading',\n `wx-heading--${size.value}`,\n `wx-heading--tone-${props.tone}`,\n {\n [`wx-heading--align-${props.align}`]: Boolean(props.align),\n 'wx-heading--truncate': props.truncate,\n },\n])\n</script>\n\n<template>\n <component :is=\"`h${level}`\" :class=\"classes\">\n <slot />\n </component>\n</template>\n\n<style scoped>\n/*\n * No margin: spacing belongs to the layout around the heading, not to the heading\n * itself. `WxProse` puts the rhythm back for free-flowing content.\n */\n.wx-heading {\n margin: 0;\n color: var(--wx-heading-color, var(--wx-text-strong));\n font-family: var(--wx-font-family-sans);\n font-weight: var(--wx-font-weight-semibold);\n line-height: var(--wx-font-line-height-tight);\n text-wrap: balance;\n}\n\n.wx-heading--sm {\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-heading--md {\n font-size: var(--wx-font-size-md);\n}\n\n.wx-heading--lg {\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-heading--xl {\n font-size: var(--wx-font-size-xl);\n}\n\n.wx-heading--2xl {\n font-size: var(--wx-font-size-2xl);\n}\n\n.wx-heading--3xl {\n font-size: var(--wx-font-size-3xl);\n font-weight: var(--wx-font-weight-bold);\n}\n\n.wx-heading--tone-default {\n --wx-heading-color: var(--wx-text-default);\n}\n\n.wx-heading--tone-strong {\n --wx-heading-color: var(--wx-text-strong);\n}\n\n.wx-heading--tone-muted {\n --wx-heading-color: var(--wx-text-muted);\n}\n\n.wx-heading--tone-placeholder {\n --wx-heading-color: var(--wx-text-placeholder);\n}\n\n.wx-heading--tone-primary {\n --wx-heading-color: var(--wx-color-primary);\n}\n\n.wx-heading--tone-success {\n --wx-heading-color: var(--wx-color-success-active);\n}\n\n.wx-heading--tone-warning {\n --wx-heading-color: var(--wx-color-warning-active);\n}\n\n.wx-heading--tone-danger {\n --wx-heading-color: var(--wx-color-danger);\n}\n\n.wx-heading--tone-info {\n --wx-heading-color: var(--wx-color-info-active);\n}\n\n.wx-heading--tone-inverse {\n --wx-heading-color: var(--wx-text-inverse);\n}\n\n.wx-heading--align-start {\n text-align: start;\n}\n\n.wx-heading--align-center {\n text-align: center;\n}\n\n.wx-heading--align-end {\n text-align: end;\n}\n\n.wx-heading--align-justify {\n text-align: justify;\n}\n\n.wx-heading--truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue'\nimport type { IndicatorProps } from './types'\n\ndefineOptions({ name: 'WxIndicator' })\n\nconst props = withDefaults(defineProps<IndicatorProps>(), {\n value: undefined,\n max: 99,\n dot: false,\n showZero: false,\n placement: 'top-right',\n offset: undefined,\n type: 'danger',\n hidden: false,\n label: undefined,\n})\n\nconst slots = useSlots()\n\n/** Without a wrapped element the mark is the whole component — a count in a menu row. */\nconst isAttached = computed(() => Boolean(slots.default))\n\nconst text = computed(() => {\n if (props.dot) return ''\n if (typeof props.value === 'number') {\n return props.value > props.max ? `${props.max}+` : String(props.value)\n }\n return props.value ?? ''\n})\n\nconst visible = computed(() => {\n if (props.hidden) return false\n if (props.dot) return true\n if (props.value === 0) return props.showZero\n return text.value !== ''\n})\n\nconst markClasses = computed(() => [\n 'wx-indicator__mark',\n `wx-indicator__mark--${props.type}`,\n {\n 'wx-indicator__mark--dot': props.dot,\n 'wx-indicator__mark--attached': isAttached.value,\n [`wx-indicator__mark--${props.placement}`]: isAttached.value,\n },\n])\n\nconst markStyle = computed(() => {\n if (!props.offset) return undefined\n const [x, y] = props.offset\n return { '--wx-indicator-offset-x': `${x}px`, '--wx-indicator-offset-y': `${y}px` }\n})\n</script>\n\n<template>\n <span class=\"wx-indicator\" :class=\"{ 'wx-indicator--attached': isAttached }\">\n <slot />\n <span v-if=\"visible\" :class=\"markClasses\" :style=\"markStyle\" :aria-label=\"label\">\n <slot name=\"mark\">{{ text }}</slot>\n </span>\n </span>\n</template>\n\n<style scoped>\n.wx-indicator {\n display: inline-flex;\n vertical-align: middle;\n}\n\n.wx-indicator--attached {\n position: relative;\n}\n\n.wx-indicator__mark {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n min-width: 18px;\n height: 18px;\n padding: 0 5px;\n border-radius: var(--wx-radius-full);\n color: var(--wx-indicator-fg);\n font-family: var(--wx-font-family-sans);\n font-size: var(--wx-font-size-xs);\n font-weight: var(--wx-font-weight-semibold);\n line-height: 1;\n white-space: nowrap;\n background: var(--wx-indicator-bg);\n}\n\n/*\n * The ring is the surface behind the mark, not a fixed white — a counter pinned to a\n * dark sidebar icon needs the sidebar's colour, which callers set on the wrapper.\n */\n.wx-indicator__mark--attached {\n position: absolute;\n z-index: 1;\n border: 2px solid var(--wx-indicator-ring, var(--wx-bg-surface));\n height: 20px;\n min-width: 20px;\n pointer-events: none;\n}\n\n.wx-indicator__mark--top-right {\n top: 0;\n right: 0;\n transform: translate(\n calc(50% + var(--wx-indicator-offset-x, 0px)),\n calc(-50% + var(--wx-indicator-offset-y, 0px))\n );\n}\n\n.wx-indicator__mark--top-left {\n top: 0;\n left: 0;\n transform: translate(\n calc(-50% + var(--wx-indicator-offset-x, 0px)),\n calc(-50% + var(--wx-indicator-offset-y, 0px))\n );\n}\n\n.wx-indicator__mark--bottom-right {\n bottom: 0;\n right: 0;\n transform: translate(\n calc(50% + var(--wx-indicator-offset-x, 0px)),\n calc(50% + var(--wx-indicator-offset-y, 0px))\n );\n}\n\n.wx-indicator__mark--bottom-left {\n bottom: 0;\n left: 0;\n transform: translate(\n calc(-50% + var(--wx-indicator-offset-x, 0px)),\n calc(50% + var(--wx-indicator-offset-y, 0px))\n );\n}\n\n.wx-indicator__mark--dot {\n min-width: 10px;\n width: 10px;\n height: 10px;\n padding: 0;\n}\n\n.wx-indicator__mark--dot.wx-indicator__mark--attached {\n min-width: 12px;\n width: 12px;\n height: 12px;\n}\n\n/* colours */\n.wx-indicator__mark--danger {\n --wx-indicator-bg: var(--wx-color-danger);\n --wx-indicator-fg: var(--wx-color-danger-contrast);\n}\n\n.wx-indicator__mark--primary {\n --wx-indicator-bg: var(--wx-color-primary);\n --wx-indicator-fg: var(--wx-color-primary-contrast);\n}\n\n.wx-indicator__mark--success {\n --wx-indicator-bg: var(--wx-color-success);\n --wx-indicator-fg: var(--wx-color-success-contrast);\n}\n\n.wx-indicator__mark--warning {\n --wx-indicator-bg: var(--wx-color-warning);\n --wx-indicator-fg: var(--wx-color-warning-contrast);\n}\n\n.wx-indicator__mark--info {\n --wx-indicator-bg: var(--wx-color-info);\n --wx-indicator-fg: var(--wx-color-info-contrast);\n}\n\n.wx-indicator__mark--neutral {\n --wx-indicator-bg: var(--wx-bg-fill-hover);\n --wx-indicator-fg: var(--wx-text-default);\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 WxIcon from '../Icon/Icon.vue'\nimport type { LinkEmits, LinkProps } from './types'\n\ndefineOptions({ name: 'WxLink', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<LinkProps>(), {\n href: undefined,\n target: undefined,\n rel: undefined,\n type: 'default',\n underline: 'hover',\n size: undefined,\n weight: undefined,\n disabled: false,\n external: false,\n as: undefined,\n})\n\nconst emit = defineEmits<LinkEmits>()\n\nconst tag = computed(() => props.as ?? 'a')\n\n/** `noopener` is not optional on a `_blank` link — the opened page can steal the tab. */\nconst linkAttrs = computed(() => {\n const target = props.target ?? (props.external ? '_blank' : undefined)\n const rel = props.rel ?? (target === '_blank' ? 'noopener noreferrer' : undefined)\n const href = props.disabled ? undefined : props.href\n\n /*\n * Only the attributes we actually have: rendering through `RouterLink`, a stray\n * `href: undefined` in the fallthrough would wipe out the href the router writes.\n */\n const attrs: Record<string, unknown> = {}\n if (href !== undefined) attrs.href = href\n if (target !== undefined) attrs.target = target\n if (rel !== undefined) attrs.rel = rel\n if (props.disabled) {\n attrs['aria-disabled'] = 'true'\n attrs.tabindex = -1\n }\n return attrs\n})\n\nconst classes = computed(() => [\n 'wx-link',\n `wx-link--${props.type}`,\n `wx-link--underline-${props.underline}`,\n {\n [`wx-link--${props.size}`]: Boolean(props.size),\n [`wx-link--weight-${props.weight}`]: Boolean(props.weight),\n 'is-disabled': props.disabled,\n },\n])\n\nfunction onClick(event: MouseEvent) {\n if (props.disabled) {\n event.preventDefault()\n event.stopPropagation()\n return\n }\n emit('click', event)\n}\n</script>\n\n<template>\n <component :is=\"tag\" v-bind=\"{ ...linkAttrs, ...$attrs }\" :class=\"classes\" @click=\"onClick\">\n <span v-if=\"$slots.icon\" class=\"wx-link__icon\">\n <slot name=\"icon\" />\n </span>\n <slot />\n <wx-icon v-if=\"external\" class=\"wx-link__external\" name=\"external-link\" size=\"0.85em\" />\n </component>\n</template>\n\n<style scoped>\n.wx-link {\n display: inline-flex;\n align-items: center;\n gap: var(--wx-space-4);\n color: var(--wx-link-color, var(--wx-text-link));\n font-family: inherit;\n font-size: inherit;\n text-decoration: none;\n cursor: pointer;\n transition: color var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-link:hover {\n color: var(--wx-link-hover, var(--wx-link-color));\n}\n\n.wx-link:focus-visible {\n outline: none;\n border-radius: var(--wx-radius-xs);\n box-shadow: var(--wx-ring-focus);\n}\n\n/* types */\n.wx-link--default {\n --wx-link-color: var(--wx-text-link);\n --wx-link-hover: var(--wx-color-primary-hover);\n}\n\n.wx-link--primary {\n --wx-link-color: var(--wx-color-primary);\n --wx-link-hover: var(--wx-color-primary-hover);\n}\n\n.wx-link--success {\n --wx-link-color: var(--wx-color-success-active);\n --wx-link-hover: var(--wx-color-success);\n}\n\n.wx-link--warning {\n --wx-link-color: var(--wx-color-warning-active);\n --wx-link-hover: var(--wx-color-warning);\n}\n\n.wx-link--danger {\n --wx-link-color: var(--wx-color-danger);\n --wx-link-hover: var(--wx-color-danger-hover);\n}\n\n.wx-link--info {\n --wx-link-color: var(--wx-color-info-active);\n --wx-link-hover: var(--wx-color-info);\n}\n\n.wx-link--muted {\n --wx-link-color: var(--wx-text-muted);\n --wx-link-hover: var(--wx-text-default);\n}\n\n/* underline */\n.wx-link--underline-always {\n text-decoration: underline;\n text-underline-offset: 0.2em;\n}\n\n.wx-link--underline-hover:hover {\n text-decoration: underline;\n text-underline-offset: 0.2em;\n}\n\n.wx-link--underline-never,\n.wx-link--underline-never:hover {\n text-decoration: none;\n}\n\n/* sizes */\n.wx-link--xs {\n font-size: var(--wx-font-size-xs);\n}\n\n.wx-link--sm {\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-link--md {\n font-size: var(--wx-font-size-md);\n}\n\n.wx-link--lg {\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-link--xl {\n font-size: var(--wx-font-size-xl);\n}\n\n.wx-link--weight-regular {\n font-weight: var(--wx-font-weight-regular);\n}\n\n.wx-link--weight-medium {\n font-weight: var(--wx-font-weight-medium);\n}\n\n.wx-link--weight-semibold {\n font-weight: var(--wx-font-weight-semibold);\n}\n\n.wx-link--weight-bold {\n font-weight: var(--wx-font-weight-bold);\n}\n\n.wx-link.is-disabled {\n color: var(--wx-text-disabled);\n text-decoration: none;\n cursor: not-allowed;\n}\n\n.wx-link__icon {\n display: inline-flex;\n align-items: center;\n}\n\n.wx-link__external {\n opacity: 0.75;\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/*\n * Everything below wraps rather than overflows. On a phone the row of buttons is wider\n * than the screen well before the page count gets interesting, and a nav that runs off\n * the edge takes the last pages with it — including, often enough, the next arrow.\n */\n.wx-pagination__controls {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: flex-end;\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__per-page-label {\n white-space: nowrap;\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 flex-wrap: wrap;\n align-items: center;\n justify-content: flex-end;\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 } from 'vue'\nimport type { ProseProps } from './types'\n\ndefineOptions({ name: 'WxProse' })\n\nconst props = withDefaults(defineProps<ProseProps>(), {\n html: undefined,\n size: 'md',\n as: 'div',\n})\n\nconst classes = computed(() => ['wx-prose', `wx-prose--${props.size}`])\n</script>\n\n<template>\n <component :is=\"as\" :class=\"classes\">\n <!--\n The markup goes into a plain element rather than onto the dynamic tag itself:\n `v-html` on `<component :is>` is meaningless when `as` names a component, and\n every rule below matches descendants, so the extra div changes nothing visually.\n -->\n <div v-if=\"html !== undefined\" class=\"wx-prose__content\" v-html=\"html\"></div>\n <slot v-else />\n </component>\n</template>\n\n<style scoped>\n/*\n * Every rule is a `:deep` one on purpose: the markup usually arrives through `v-html`\n * and therefore carries no scope attribute of its own.\n */\n.wx-prose {\n color: var(--wx-text-default);\n font-family: var(--wx-font-family-sans);\n font-size: var(--wx-prose-font-size, var(--wx-font-size-md));\n line-height: var(--wx-font-line-height-relaxed);\n /* The rhythm between blocks: one variable, so a caller can tighten the whole block. */\n --wx-prose-flow: var(--wx-space-16);\n}\n\n.wx-prose--sm {\n --wx-prose-font-size: var(--wx-font-size-sm);\n --wx-prose-flow: var(--wx-space-12);\n}\n\n.wx-prose--lg {\n --wx-prose-font-size: var(--wx-font-size-lg);\n --wx-prose-flow: var(--wx-space-18);\n}\n\n/* The rhythm: every block carries the gap below it, the last one drops it again. */\n.wx-prose :deep(p),\n.wx-prose :deep(ul),\n.wx-prose :deep(ol),\n.wx-prose :deep(dl),\n.wx-prose :deep(blockquote),\n.wx-prose :deep(pre),\n.wx-prose :deep(figure),\n.wx-prose :deep(table) {\n margin: 0 0 var(--wx-prose-flow);\n}\n\n.wx-prose :deep(:last-child) {\n margin-bottom: 0;\n}\n\n/* headings */\n.wx-prose :deep(h1),\n.wx-prose :deep(h2),\n.wx-prose :deep(h3),\n.wx-prose :deep(h4),\n.wx-prose :deep(h5),\n.wx-prose :deep(h6) {\n /* Air above a heading, tight to the paragraph it introduces. */\n margin: var(--wx-space-32) 0 var(--wx-space-12);\n color: var(--wx-text-strong);\n font-weight: var(--wx-font-weight-semibold);\n line-height: var(--wx-font-line-height-tight);\n text-wrap: balance;\n}\n\n.wx-prose :deep(h1) {\n font-size: var(--wx-font-size-3xl);\n font-weight: var(--wx-font-weight-bold);\n}\n\n.wx-prose :deep(h2) {\n font-size: var(--wx-font-size-2xl);\n}\n\n.wx-prose :deep(h3) {\n font-size: var(--wx-font-size-xl);\n}\n\n.wx-prose :deep(h4) {\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-prose :deep(h5),\n.wx-prose :deep(h6) {\n font-size: var(--wx-font-size-md);\n}\n\n.wx-prose :deep(:first-child) {\n margin-top: 0;\n}\n\n.wx-prose :deep(a) {\n color: var(--wx-text-link);\n text-decoration: underline;\n text-underline-offset: 0.2em;\n}\n\n.wx-prose :deep(a:hover) {\n color: var(--wx-color-primary-hover);\n}\n\n.wx-prose :deep(strong),\n.wx-prose :deep(b) {\n color: var(--wx-text-strong);\n font-weight: var(--wx-font-weight-semibold);\n}\n\n.wx-prose :deep(small) {\n font-size: var(--wx-font-size-sm);\n color: var(--wx-text-muted);\n}\n\n.wx-prose :deep(mark) {\n padding: 0 2px;\n background: var(--wx-color-warning-soft);\n border-radius: var(--wx-radius-none);\n color: inherit;\n}\n\n/* lists */\n.wx-prose :deep(ul),\n.wx-prose :deep(ol) {\n padding-left: var(--wx-space-24);\n}\n\n.wx-prose :deep(li + li) {\n margin-top: var(--wx-space-6);\n}\n\n.wx-prose :deep(li > ul),\n.wx-prose :deep(li > ol) {\n margin-top: var(--wx-space-6);\n}\n\n.wx-prose :deep(ul) {\n list-style: disc;\n}\n\n.wx-prose :deep(ol) {\n list-style: decimal;\n}\n\n.wx-prose :deep(li::marker) {\n color: var(--wx-text-muted);\n}\n\n.wx-prose :deep(dt) {\n color: var(--wx-text-strong);\n font-weight: var(--wx-font-weight-semibold);\n}\n\n.wx-prose :deep(dd) {\n margin: 0 0 var(--wx-space-8);\n color: var(--wx-text-muted);\n}\n\n/* quotes and rules */\n.wx-prose :deep(blockquote) {\n padding: var(--wx-space-4) var(--wx-space-16);\n border-left: 3px solid var(--wx-color-primary);\n color: var(--wx-text-muted);\n}\n\n.wx-prose :deep(hr) {\n height: 0;\n margin: var(--wx-space-24) 0;\n border: none;\n border-top: 1px solid var(--wx-border-default);\n}\n\n/* code */\n.wx-prose :deep(code) {\n padding: 1px 5px;\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-prose :deep(pre) {\n padding: var(--wx-space-14) var(--wx-space-16);\n background: var(--wx-bg-muted);\n border-radius: var(--wx-radius-sm);\n font-family: var(--wx-font-family-mono);\n font-size: var(--wx-font-size-sm);\n line-height: var(--wx-font-line-height-normal);\n overflow-x: auto;\n}\n\n.wx-prose :deep(pre code) {\n padding: 0;\n background: none;\n font-size: inherit;\n}\n\n/* media */\n.wx-prose :deep(img),\n.wx-prose :deep(video) {\n max-width: 100%;\n height: auto;\n border-radius: var(--wx-radius-sm);\n}\n\n.wx-prose :deep(figcaption) {\n margin-top: var(--wx-space-8);\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-sm);\n text-align: center;\n}\n\n.wx-prose :deep(iframe) {\n max-width: 100%;\n border: none;\n border-radius: var(--wx-radius-sm);\n}\n\n/*\n * A pasted table is usually wider than the column it lands in, so it scrolls inside\n * its own box instead of pushing the page sideways.\n */\n.wx-prose :deep(table) {\n display: block;\n width: 100%;\n max-width: 100%;\n border-collapse: collapse;\n font-size: var(--wx-font-size-sm);\n overflow-x: auto;\n}\n\n.wx-prose :deep(th),\n.wx-prose :deep(td) {\n padding: var(--wx-space-8) var(--wx-space-12);\n border: 1px solid var(--wx-border-default);\n text-align: start;\n vertical-align: top;\n}\n\n.wx-prose :deep(th) {\n background: var(--wx-bg-subtle);\n color: var(--wx-text-strong);\n font-weight: var(--wx-font-weight-semibold);\n white-space: nowrap;\n}\n\n.wx-prose :deep(caption) {\n margin-bottom: var(--wx-space-8);\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-sm);\n text-align: start;\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 <svg class=\"wx-radio__mark\" viewBox=\"0 0 20 20\">\n <circle class=\"wx-radio__ring\" cx=\"10\" cy=\"10\" r=\"9.5\" />\n <circle class=\"wx-radio__dot\" cx=\"10\" cy=\"10\" r=\"4\" />\n </svg>\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/*\n * The box only holds the size and the focus ring; the circles are drawn inside it. A CSS\n * border plus a centred child cannot stay concentric at a fractional device pixel ratio —\n * Windows at 125% or 150% rounds the 1px border to a whole device pixel on each side\n * independently, which moves the content box off the centre of the border box and takes\n * the dot with it. Ring and dot as two circles on one origin cannot drift apart: the\n * renderer resolves both against real geometry and antialiases, instead of snapping boxes.\n */\n.wx-radio__box {\n display: block;\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 border-radius: var(--wx-radius-full);\n transition: 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/* The ring's outer half of stroke sits on the viewport edge, so it must not be clipped. */\n.wx-radio__mark {\n display: block;\n width: 100%;\n height: 100%;\n overflow: visible;\n}\n\n/*\n * `non-scaling-stroke` keeps the ring one pixel wide at every size, the way the checkbox\n * border is, instead of thinning to 0.8px on `sm` and thickening to 1.2px on `lg`.\n */\n.wx-radio__ring {\n fill: var(--wx-bg-surface);\n stroke: var(--wx-border-strong);\n stroke-width: 1;\n vector-effect: non-scaling-stroke;\n transition: stroke var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-radio__dot {\n fill: var(--wx-color-primary);\n transform: scale(0);\n transform-box: fill-box;\n transform-origin: center;\n transition: transform var(--wx-duration-fast) var(--wx-easing-standard);\n}\n\n.wx-radio:hover:not(.is-disabled) .wx-radio__ring {\n stroke: var(--wx-color-primary);\n}\n\n.wx-radio.is-checked .wx-radio__ring {\n stroke: 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__ring {\n fill: var(--wx-bg-disabled);\n stroke: var(--wx-border-default);\n}\n\n.wx-radio.is-disabled .wx-radio__dot {\n fill: var(--wx-color-primary-disabled);\n}\n\n.wx-radio__native:focus-visible + .wx-radio__box {\n box-shadow: var(--wx-ring-focus);\n}\n\n.wx-radio__native:focus-visible + .wx-radio__box .wx-radio__ring {\n stroke: var(--wx-color-primary);\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__ring,\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 } from 'vue'\nimport type { TextProps } from './types'\n\ndefineOptions({ name: 'WxText' })\n\nconst props = withDefaults(defineProps<TextProps>(), {\n as: 'span',\n size: 'md',\n weight: 'regular',\n tone: 'default',\n align: undefined,\n truncate: false,\n italic: false,\n mono: false,\n})\n\nconst clampLines = computed(() => (typeof props.truncate === 'number' ? props.truncate : undefined))\n\nconst classes = computed(() => [\n 'wx-text',\n `wx-text--${props.size}`,\n `wx-text--${props.weight}`,\n `wx-text--tone-${props.tone}`,\n {\n [`wx-text--align-${props.align}`]: Boolean(props.align),\n 'wx-text--italic': props.italic,\n 'wx-text--mono': props.mono,\n 'wx-text--truncate': props.truncate === true,\n 'wx-text--clamp': clampLines.value !== undefined,\n },\n])\n\nconst style = computed(() =>\n clampLines.value === undefined ? undefined : { '--wx-text-lines': clampLines.value },\n)\n</script>\n\n<template>\n <component :is=\"as\" :class=\"classes\" :style=\"style\">\n <slot />\n </component>\n</template>\n\n<style scoped>\n.wx-text {\n margin: 0;\n font-family: var(--wx-font-family-sans);\n line-height: var(--wx-font-line-height-normal);\n color: var(--wx-text-color, var(--wx-text-default));\n}\n\n/* sizes */\n.wx-text--xs {\n font-size: var(--wx-font-size-xs);\n}\n\n.wx-text--sm {\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-text--md {\n font-size: var(--wx-font-size-md);\n}\n\n.wx-text--lg {\n font-size: var(--wx-font-size-lg);\n}\n\n.wx-text--xl {\n font-size: var(--wx-font-size-xl);\n}\n\n/* weights */\n.wx-text--regular {\n font-weight: var(--wx-font-weight-regular);\n}\n\n.wx-text--medium {\n font-weight: var(--wx-font-weight-medium);\n}\n\n.wx-text--semibold {\n font-weight: var(--wx-font-weight-semibold);\n}\n\n.wx-text--bold {\n font-weight: var(--wx-font-weight-bold);\n}\n\n/* tones */\n.wx-text--tone-default {\n --wx-text-color: var(--wx-text-default);\n}\n\n.wx-text--tone-strong {\n --wx-text-color: var(--wx-text-strong);\n}\n\n.wx-text--tone-muted {\n --wx-text-color: var(--wx-text-muted);\n}\n\n.wx-text--tone-placeholder {\n --wx-text-color: var(--wx-text-placeholder);\n}\n\n.wx-text--tone-primary {\n --wx-text-color: var(--wx-color-primary);\n}\n\n.wx-text--tone-success {\n --wx-text-color: var(--wx-color-success-active);\n}\n\n.wx-text--tone-warning {\n --wx-text-color: var(--wx-color-warning-active);\n}\n\n.wx-text--tone-danger {\n --wx-text-color: var(--wx-color-danger);\n}\n\n.wx-text--tone-info {\n --wx-text-color: var(--wx-color-info-active);\n}\n\n.wx-text--tone-inverse {\n --wx-text-color: var(--wx-text-inverse);\n}\n\n/* alignment */\n.wx-text--align-start {\n text-align: start;\n}\n\n.wx-text--align-center {\n text-align: center;\n}\n\n.wx-text--align-end {\n text-align: end;\n}\n\n.wx-text--align-justify {\n text-align: justify;\n}\n\n.wx-text--italic {\n font-style: italic;\n}\n\n.wx-text--mono {\n font-family: var(--wx-font-family-mono);\n font-variant-numeric: tabular-nums;\n}\n\n/* Truncation needs a block box: an inline span ignores overflow. */\n.wx-text--truncate {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.wx-text--clamp {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: var(--wx-text-lines, 2);\n line-clamp: var(--wx-text-lines, 2);\n overflow: hidden;\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","import { inject, type ComputedRef, type InjectionKey } from 'vue'\n\nexport type TimelineSize = 'sm' | 'md'\n\n/** What `WxTimeline` hands down to the items inside it. */\nexport interface TimelineContext {\n size: ComputedRef<TimelineSize>\n}\n\nexport const timelineKey: InjectionKey<TimelineContext> = Symbol('wx-timeline')\n\nexport function useTimeline(): TimelineContext | null {\n return inject(timelineKey, null)\n}\n","<script setup lang=\"ts\">\nimport { computed, provide } from 'vue'\nimport { timelineKey } from '../../composables/useTimeline'\nimport type { TimelineProps } from './types'\n\ndefineOptions({ name: 'WxTimeline' })\n\nconst props = withDefaults(defineProps<TimelineProps>(), {\n size: 'md',\n})\n\nprovide(timelineKey, { size: computed(() => props.size) })\n</script>\n\n<template>\n <ul class=\"wx-timeline\" :class=\"`wx-timeline--${size}`\">\n <slot />\n </ul>\n</template>\n\n<style scoped>\n.wx-timeline {\n --wx-timeline-dot: 12px;\n --wx-timeline-gap: var(--wx-space-18);\n\n margin: 0;\n padding: 0;\n list-style: none;\n color: var(--wx-text-default);\n font-family: var(--wx-font-family-sans);\n}\n\n.wx-timeline--sm {\n --wx-timeline-dot: 9px;\n --wx-timeline-gap: var(--wx-space-12);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue'\nimport WxIcon from '../Icon/Icon.vue'\nimport { useTimeline } from '../../composables/useTimeline'\nimport type { TimelineItemProps } from './types'\n\ndefineOptions({ name: 'WxTimelineItem' })\n\nconst props = withDefaults(defineProps<TimelineItemProps>(), {\n timestamp: undefined,\n datetime: undefined,\n timestampPlacement: 'top',\n title: undefined,\n type: 'default',\n hollow: false,\n icon: undefined,\n hideLine: false,\n})\n\nconst timeline = useTimeline()\nconst slots = useSlots()\n\nconst hasMark = computed(() => Boolean(props.icon || slots.dot))\n\nconst classes = computed(() => [\n 'wx-timeline-item',\n `wx-timeline-item--${timeline?.size.value ?? 'md'}`,\n {\n 'wx-timeline-item--no-line': props.hideLine,\n // A mark needs a bigger dot to sit in; the line and the indent follow it.\n 'wx-timeline-item--mark': hasMark.value,\n },\n])\n\nconst dotClasses = computed(() => [\n 'wx-timeline-item__dot',\n `wx-timeline-item__dot--${props.type}`,\n { 'wx-timeline-item__dot--hollow': props.hollow },\n])\n</script>\n\n<template>\n <li :class=\"classes\">\n <span class=\"wx-timeline-item__line\" aria-hidden=\"true\" />\n\n <span :class=\"dotClasses\" aria-hidden=\"true\">\n <slot name=\"dot\">\n <wx-icon v-if=\"icon\" :name=\"icon\" />\n </slot>\n </span>\n\n <div class=\"wx-timeline-item__content\">\n <time\n v-if=\"timestamp && timestampPlacement === 'top'\"\n class=\"wx-timeline-item__timestamp\"\n :datetime=\"datetime\"\n >\n {{ timestamp }}\n </time>\n\n <p v-if=\"title || $slots.title\" class=\"wx-timeline-item__title\">\n <slot name=\"title\">{{ title }}</slot>\n </p>\n\n <div v-if=\"$slots.default\" class=\"wx-timeline-item__body\">\n <slot />\n </div>\n\n <time\n v-if=\"timestamp && timestampPlacement === 'bottom'\"\n class=\"wx-timeline-item__timestamp wx-timeline-item__timestamp--bottom\"\n :datetime=\"datetime\"\n >\n {{ timestamp }}\n </time>\n </div>\n </li>\n</template>\n\n<style scoped>\n/*\n * Everything hangs off one vertical axis: the dot is centred on it, the line runs\n * down it, and the text starts a fixed gap to its right. Changing the dot size —\n * a small marker, or a 24px circle holding an icon — never moves the text.\n */\n.wx-timeline-item {\n --wx-timeline-axis: 12px;\n --wx-timeline-mark: var(--wx-timeline-dot, 12px);\n --wx-timeline-mark-top: 3px;\n\n position: relative;\n padding-left: calc(var(--wx-timeline-axis) + var(--wx-space-16));\n padding-bottom: var(--wx-timeline-gap, var(--wx-space-18));\n}\n\n.wx-timeline-item--sm {\n --wx-timeline-axis: 10px;\n}\n\n.wx-timeline-item--mark {\n --wx-timeline-mark: 24px;\n --wx-timeline-mark-top: 0px;\n}\n\n/* The last entry ends at its content: no trailing stub of line under it. */\n.wx-timeline-item:last-child {\n padding-bottom: 0;\n}\n\n.wx-timeline-item__line {\n position: absolute;\n top: calc(var(--wx-timeline-mark-top) + var(--wx-timeline-mark) + 4px);\n bottom: 0;\n left: calc(var(--wx-timeline-axis) - 0.5px);\n width: 1px;\n background: var(--wx-border-default);\n}\n\n.wx-timeline-item:last-child .wx-timeline-item__line,\n.wx-timeline-item--no-line .wx-timeline-item__line {\n display: none;\n}\n\n.wx-timeline-item__dot {\n position: absolute;\n top: var(--wx-timeline-mark-top);\n left: calc(var(--wx-timeline-axis) - var(--wx-timeline-mark) / 2);\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: var(--wx-timeline-mark);\n height: var(--wx-timeline-mark);\n background: var(--wx-timeline-dot-color, var(--wx-border-strong));\n border-radius: var(--wx-radius-full);\n color: var(--wx-timeline-dot-contrast, var(--wx-text-inverse));\n font-size: 14px;\n}\n\n.wx-timeline-item__dot--hollow {\n background: var(--wx-bg-surface);\n border: 2px solid var(--wx-timeline-dot-color, var(--wx-border-strong));\n color: var(--wx-timeline-dot-color, var(--wx-border-strong));\n}\n\n.wx-timeline-item__dot--default {\n --wx-timeline-dot-color: var(--wx-border-strong);\n --wx-timeline-dot-contrast: var(--wx-text-inverse);\n}\n\n.wx-timeline-item__dot--primary {\n --wx-timeline-dot-color: var(--wx-color-primary);\n --wx-timeline-dot-contrast: var(--wx-color-primary-contrast);\n}\n\n.wx-timeline-item__dot--success {\n --wx-timeline-dot-color: var(--wx-color-success);\n --wx-timeline-dot-contrast: var(--wx-color-success-contrast);\n}\n\n.wx-timeline-item__dot--warning {\n --wx-timeline-dot-color: var(--wx-color-warning);\n --wx-timeline-dot-contrast: var(--wx-color-warning-contrast);\n}\n\n.wx-timeline-item__dot--danger {\n --wx-timeline-dot-color: var(--wx-color-danger);\n --wx-timeline-dot-contrast: var(--wx-color-danger-contrast);\n}\n\n.wx-timeline-item__dot--info {\n --wx-timeline-dot-color: var(--wx-color-info);\n --wx-timeline-dot-contrast: var(--wx-color-info-contrast);\n}\n\n.wx-timeline-item__content {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n}\n\n.wx-timeline-item__timestamp {\n color: var(--wx-text-muted);\n font-size: var(--wx-font-size-xs);\n line-height: var(--wx-font-line-height-normal);\n}\n\n.wx-timeline-item__timestamp--bottom {\n margin-top: var(--wx-space-4);\n}\n\n.wx-timeline-item__title {\n margin: 0;\n color: var(--wx-text-strong);\n font-size: var(--wx-font-size-md);\n font-weight: var(--wx-font-weight-semibold);\n line-height: var(--wx-font-line-height-tight);\n}\n\n.wx-timeline-item--sm .wx-timeline-item__title {\n font-size: var(--wx-font-size-sm);\n}\n\n.wx-timeline-item__body {\n color: var(--wx-text-default);\n font-size: var(--wx-font-size-sm);\n line-height: var(--wx-font-line-height-normal);\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, Component, 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 /*\n * The barrel also exports helpers — the icon registry, the countdown formatter —\n * so the `Wx` prefix is what marks a component, and the cast follows that check.\n */\n for (const [name, exported] of Object.entries(components)) {\n if (!name.startsWith('Wx')) continue\n const registeredName = prefix === 'Wx' ? name : `${prefix}${name.slice(2)}`\n app.component(registeredName, exported as Component)\n }\n },\n}\n\nexport default WebxUI\n"],"names":["builtinIcons","customIcons","registerIcons","icons","name","content","resolveIcon","iconNames","props","__props","keywordSizes","computed","boxSize","size","classes","_createElementBlock","actionsKey","useActions","inject","emit","__emit","presets","group","preset","icon","tone","accessibleName","tag","nativeAttrs","onClick","event","_normalizeClass","_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","$attrs","_renderSlot","_ctx","_createVNode","WxIcon","dropdownKey","useDropdown","open","_useModel","close","provide","watch","value","onPanelClick","_unref","PopoverRoot","$event","PopoverTrigger","PopoverPortal","PopoverContent","root","ref","row","collapsed","measure","rowEl","parent","style","padding","available","observer","observe","onMounted","onBeforeUnmount","__expose","_createElementVNode","_hoisted_2","WxDropdown","WxAction","formContextKey","formItemContextKey","uid","useId","prefix","useFormField","form","item","fallbackId","id","disabled","status","describedBy","checkboxGroupKey","radioGroupKey","provideFormItem","context","model","field","debounceTimer","picking","cancelSearch","showClear","hasList","onSelect","option","clear","AutocompleteRoot","AutocompleteAnchor","$slots","_hoisted_1","AutocompletePortal","AutocompleteContent","AutocompleteViewport","_hoisted_3","_toDisplayString","AutocompleteEmpty","_Fragment","_renderList","AutocompleteItem","_hoisted_4","_hoisted_5","_cache","buttonGroupKey","useButtonGroup","type","variant","isDisabled","slots","useSlots","hasHeader","hasSidebar","_hoisted_6","_hoisted_7","_hoisted_8","activePath","panel","loadedChildren","loadingKeys","keyOf","path","rootOptions","childrenOf","parents","isLeaf","loaded","isLoading","columns","result","index","children","resolvePath","values","level","candidate","findPath","options","found","selectedPath","hasValue","displayLabel","formValue","loadLevel","key","expand","select","onOptionClick","leaf","onOptionHover","optionsIn","focusOption","items","bounded","onPanelKeydown","target","column","current","nextTick","PopoverAnchor","_createTextVNode","inputRef","checked","syncIndeterminate","onChange","next","toggle","WxCheckbox","HEX","text","toWorking","hex","convertToHsb","parseColor","working","colorToHex","areaStyle","getAreaBackgroundStyle","hueStyle","getSliderBackgroundStyle","swatch","commit","onInput","onBlur","onColor","color","onHex","openPicker","_normalizeStyle","ColorAreaRoot","ColorAreaArea","ColorAreaThumb","ColorSliderRoot","ColorSliderTrack","ColorSliderThumb","display","units","formatCountdown","ms","format","remaining","out","token","unit","toTimestamp","parsed","timer","stop","tick","left","start","running","WxStatistic","hasTime","modelType","displayFormat","time","config","timeConfig","inputAttrs","onUpdate","onCleared","_withCtx","slotProps","_normalizeProps","_guardReactiveProps","_","WxDatePicker","$props","_createSlots","dropdown","defaultImageSize","imageSize","hasMedia","initial","hasMeta","errors","toRef","onSubmit","onReset","baseId","errorId","helpId","labelMode","controlId","registerLabelTarget","messages","hasError","labelWidth","isInline","sizeForLevel","isAttached","visible","markClasses","markStyle","x","y","focused","currentValue","counter","onFocus","precision","decimals","round","factor","clamp","canDecrease","canIncrease","stepBy","direction","base","normalize","onWheel","onKeydown","linkAttrs","rel","href","attrs","page","perPage","currentPerPage","total","lastPage","currentPage","asked","from","to","last","span","wanted","i","numbers","a","b","previous","distance","go","setPerPage","_hoisted_9","_hoisted_10","fallbackName","WxRadio","hovered","interactive","shown","stars","position","fill","valueAt","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","WxRichTextToolbarButton","_vModelText","EditorContent","searchText","selection","labelOf","selectedOptions","singleLabel","hasSelection","openList","displayValue","onSearch","removeTag","ComboboxRoot","ComboboxAnchor","_withModifiers","ComboboxTrigger","ComboboxPortal","ComboboxContent","ComboboxViewport","ComboboxEmpty","ComboboxItem","ComboboxItemIndicator","pair","marks","label","SliderTrack","SliderRange","SliderThumb","mark","UTILITY_WIDTH","STORAGE_PREFIX","selected","expanded","sort","search","rows","paginator","showPagination","visibleColumns","utilityCount","columnCount","scrollStyle","length","widthOf","colStyle","offsets","map","lefts","right","rights","hasLeftFixed","hasFixed","fixedStyle","pin","fixedClass","utilityStyle","slot","utilityClass","read","part","cellText","canSelect","canExpand","selectableRows","selectableKeys","selectedCount","allSelected","someSelected","rowsFor","keys","announce","toggleAll","toggleRow","isSelected","isExpanded","toggleExpand","onSort","ariaSort","sortState","alignClass","settledSearch","onSearchChanged","term","settle","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","clampLines","textareaRef","autosizeOptions","syncHeight","el","styles","lineHeight","vertical","height","timelineKey","useTimeline","timeline","hasMark","dotClasses","WebxUI","app","exported","components","registeredName"],"mappings":";;;;;;;;;AAQO,MAAMA,KAAe;AAAA;AAAA,EAE1B,OAAO;AAAA,EACP,gBAAgB;AAAA,EAChB,OAAO;AAAA,EACP,gBAAgB;AAAA,EAChB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OACE;AAAA,EACF,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SACE;AAAA,EACF,QACE;AAAA,EACF,UACE;AAAA,EACF,QACE;AAAA;AAAA,EAGF,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,cAAc;AAAA,EACd,eAAe;AAAA,EACf,MAAM;AAAA,EACN,mBACE;AAAA,EACF,iBACE;AAAA,EACF,MAAM;AAAA;AAAA,EAGN,MAAM;AAAA,EACN,OACE;AAAA,EACF,UACE;AAAA,EACF,SACE;AAAA,EACF,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QACE;AAAA,EACF,OACE;AAAA,EACF,UACE;AAAA,EACF,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OACE;AAAA,EACF,MAAM;AAAA,EACN,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,iBACE;AAAA,EACF,MAAM;AAAA,EACN,QACE;AAAA,EACF,MAAM;AA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