@ecoma-io/loom 0.3.0 → 0.5.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/README.md +11 -9
- package/dist/a11y.js +2 -2
- package/dist/index.js +73 -6
- package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/CalendarDate.js +1 -1
- package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/CalendarDate.js.map +1 -1
- package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js +1 -1
- package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js.map +1 -1
- package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/conversion.js +1 -1
- package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/conversion.js.map +1 -1
- package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/manipulation.js +1 -1
- package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/manipulation.js.map +1 -1
- package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/queries.js +1 -1
- package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/queries.js.map +1 -1
- package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/string.js +1 -1
- package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/string.js.map +1 -1
- package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/utils.js +1 -1
- package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/utils.js.map +1 -1
- package/dist/packages/blocks/app-header/src/AppHeader.js.map +1 -1
- package/dist/packages/blocks/app-header/src/AppHeader.vue.d.ts.map +1 -1
- package/dist/packages/blocks/app-header/src/AppHeader.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/packages/blocks/app-header/src/AppHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/blocks/desktop-app-shell/src/DesktopAppShell.vue.d.ts +3 -3
- package/dist/packages/blocks/empty-state/src/EmptyState.js.map +1 -1
- package/dist/packages/blocks/empty-state/src/EmptyState.vue.d.ts.map +1 -1
- package/dist/packages/blocks/empty-state/src/EmptyState.vue_vue_type_script_setup_true_lang.js +5 -6
- package/dist/packages/blocks/empty-state/src/EmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/blocks/error-summary/src/ErrorSummary.js +7 -0
- package/dist/packages/blocks/error-summary/src/ErrorSummary.js.map +1 -0
- package/dist/packages/blocks/error-summary/src/ErrorSummary.vue.d.ts +31 -0
- package/dist/packages/blocks/error-summary/src/ErrorSummary.vue_vue_type_script_setup_true_lang.js +90 -0
- package/dist/packages/blocks/error-summary/src/ErrorSummary.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/blocks/error-summary/src/index.d.ts +4 -0
- package/dist/packages/blocks/error-summary/src/index.js +3 -0
- package/dist/packages/blocks/metric-card/src/MetricCard.js.map +1 -1
- package/dist/packages/blocks/metric-card/src/MetricCard.vue.d.ts +22 -4
- package/dist/packages/blocks/metric-card/src/MetricCard.vue.d.ts.map +1 -1
- package/dist/packages/blocks/metric-card/src/MetricCard.vue_vue_type_script_setup_true_lang.js +38 -15
- package/dist/packages/blocks/metric-card/src/MetricCard.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/blocks/title-bar/src/TitleBar.vue.d.ts +3 -3
- package/dist/packages/blocks/toast-stack/src/ToastStack.vue.d.ts +3 -3
- package/dist/packages/composition/scroll-reel/src/ScrollReel.js +2 -2
- package/dist/packages/composition/scroll-reel/src/ScrollReel.js.map +1 -1
- package/dist/packages/composition/scroll-reel/src/ScrollReel.vue.d.ts +26 -0
- package/dist/packages/composition/scroll-reel/src/ScrollReel.vue_vue_type_script_setup_true_lang.js +28 -7
- package/dist/packages/composition/scroll-reel/src/ScrollReel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/composition/scroll-reel/src/index.d.ts +2 -1
- package/dist/packages/composition/scroll-reel/src/index.js +2 -1
- package/dist/packages/composition/sidebar/src/Sidebar.js.map +1 -1
- package/dist/packages/composition/sidebar/src/Sidebar.vue.d.ts +4 -0
- package/dist/packages/composition/sidebar/src/Sidebar.vue.d.ts.map +1 -1
- package/dist/packages/composition/sidebar/src/Sidebar.vue_vue_type_script_setup_true_lang.js +13 -4
- package/dist/packages/composition/sidebar/src/Sidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/composition/split/src/Split.js.map +1 -1
- package/dist/packages/composition/split/src/Split.vue.d.ts +11 -12
- package/dist/packages/composition/split/src/Split.vue.d.ts.map +1 -1
- package/dist/packages/composition/split/src/Split.vue_vue_type_script_setup_true_lang.js +15 -5
- package/dist/packages/composition/split/src/Split.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/core/src/a11y-scope.d.ts +71 -5
- package/dist/packages/core/src/a11y-scope.d.ts.map +1 -1
- package/dist/packages/core/src/a11y-scope.js +126 -6
- package/dist/packages/core/src/a11y-scope.js.map +1 -1
- package/dist/packages/core/src/index.d.ts +2 -2
- package/dist/packages/core/src/index.d.ts.map +1 -1
- package/dist/packages/core/src/index.js +3 -3
- package/dist/packages/core/src/motion.d.ts +13 -0
- package/dist/packages/core/src/motion.d.ts.map +1 -1
- package/dist/packages/core/src/motion.js +20 -13
- package/dist/packages/core/src/motion.js.map +1 -1
- package/dist/packages/core/src/theme.d.ts +9 -0
- package/dist/packages/core/src/theme.d.ts.map +1 -1
- package/dist/packages/core/src/theme.js +36 -10
- package/dist/packages/core/src/theme.js.map +1 -1
- package/dist/packages/labels/src/ancestor-disabled.d.ts +5 -1
- package/dist/packages/labels/src/ancestor-disabled.d.ts.map +1 -1
- package/dist/packages/labels/src/ancestor-disabled.js +5 -1
- package/dist/packages/labels/src/ancestor-disabled.js.map +1 -1
- package/dist/packages/labels/src/component-shapes.d.ts +236 -1
- package/dist/packages/labels/src/component-shapes.d.ts.map +1 -1
- package/dist/packages/labels/src/date-labels.d.ts +86 -7
- package/dist/packages/labels/src/date-labels.d.ts.map +1 -1
- package/dist/packages/labels/src/date-labels.js +58 -9
- package/dist/packages/labels/src/date-labels.js.map +1 -1
- package/dist/packages/labels/src/field-context.d.ts +2 -2
- package/dist/packages/labels/src/field-context.js.map +1 -1
- package/dist/packages/labels/src/index.d.ts +3 -3
- package/dist/packages/labels/src/index.d.ts.map +1 -1
- package/dist/packages/labels/src/index.js +2 -2
- package/dist/packages/labels/src/label-registry.d.ts +15 -1
- package/dist/packages/labels/src/label-registry.d.ts.map +1 -1
- package/dist/packages/layouts/dashboard/src/Dashboard.js.map +1 -1
- package/dist/packages/layouts/dashboard/src/Dashboard.vue.d.ts +4 -4
- package/dist/packages/layouts/dashboard/src/Dashboard.vue.d.ts.map +1 -1
- package/dist/packages/layouts/dashboard/src/Dashboard.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/layouts/reading/src/Reading.js.map +1 -1
- package/dist/packages/layouts/reading/src/Reading.vue.d.ts +16 -15
- package/dist/packages/layouts/reading/src/Reading.vue.d.ts.map +1 -1
- package/dist/packages/layouts/reading/src/Reading.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/layouts/reading/src/index.d.ts +1 -0
- package/dist/packages/layouts/reading/src/index.d.ts.map +1 -1
- package/dist/packages/layouts/settings/src/Settings.js.map +1 -1
- package/dist/packages/layouts/settings/src/Settings.vue.d.ts +3 -3
- package/dist/packages/layouts/settings/src/Settings.vue.d.ts.map +1 -1
- package/dist/packages/layouts/settings/src/Settings.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/layouts/split-layout/src/SplitLayout.js.map +1 -1
- package/dist/packages/layouts/split-layout/src/SplitLayout.vue.d.ts +4 -6
- package/dist/packages/layouts/split-layout/src/SplitLayout.vue.d.ts.map +1 -1
- package/dist/packages/layouts/split-layout/src/SplitLayout.vue_vue_type_script_setup_true_lang.js +20 -5
- package/dist/packages/layouts/split-layout/src/SplitLayout.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/layouts/split-layout/src/index.d.ts +1 -1
- package/dist/packages/layouts/split-layout/src/index.d.ts.map +1 -1
- package/dist/packages/loom/src/a11y.d.ts +1 -1
- package/dist/packages/loom/src/index.d.ts +217 -174
- package/dist/packages/loom/src/theme.d.ts +3 -0
- package/dist/packages/primitives/alert/src/Alert.js +7 -0
- package/dist/packages/primitives/alert/src/Alert.js.map +1 -0
- package/dist/packages/primitives/alert/src/Alert.vue.d.ts +91 -0
- package/dist/packages/primitives/alert/src/Alert.vue_vue_type_script_setup_true_lang.js +130 -0
- package/dist/packages/primitives/alert/src/Alert.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/alert/src/index.d.ts +4 -0
- package/dist/packages/primitives/alert/src/index.js +3 -0
- package/dist/packages/primitives/alert-dialog/src/AlertDialog.js.map +1 -1
- package/dist/packages/primitives/alert-dialog/src/AlertDialog.vue.d.ts +2 -2
- package/dist/packages/primitives/alert-dialog/src/AlertDialog.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/packages/primitives/alert-dialog/src/AlertDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/alert-dialog/src/index.d.ts +1 -1
- package/dist/packages/primitives/avatar/src/Avatar.js.map +1 -1
- package/dist/packages/primitives/avatar/src/Avatar.vue.d.ts +2 -2
- package/dist/packages/primitives/avatar/src/Avatar.vue.d.ts.map +1 -1
- package/dist/packages/primitives/avatar/src/Avatar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/packages/primitives/avatar/src/Avatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/avatar-group/src/AvatarGroup.vue.d.ts +3 -3
- package/dist/packages/primitives/avatar-group/src/index.d.ts +1 -1
- package/dist/packages/primitives/badge/src/Badge.js.map +1 -1
- package/dist/packages/primitives/badge/src/Badge.vue.d.ts.map +1 -1
- package/dist/packages/primitives/badge/src/Badge.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/packages/primitives/badge/src/Badge.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/breadcrumb/src/Breadcrumb.js +2 -2
- package/dist/packages/primitives/breadcrumb/src/Breadcrumb.js.map +1 -1
- package/dist/packages/primitives/breadcrumb/src/Breadcrumb.vue.d.ts +28 -0
- package/dist/packages/primitives/breadcrumb/src/Breadcrumb.vue_vue_type_script_setup_true_lang.js +16 -5
- package/dist/packages/primitives/breadcrumb/src/Breadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/breadcrumb/src/index.d.ts +2 -1
- package/dist/packages/primitives/breadcrumb/src/index.js +2 -1
- package/dist/packages/primitives/button/src/Button.js.map +1 -1
- package/dist/packages/primitives/button/src/Button.vue.d.ts.map +1 -1
- package/dist/packages/primitives/button/src/Button.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/button/src/index.js +2 -2
- package/dist/packages/primitives/calendar/src/Calendar.js +7 -0
- package/dist/packages/primitives/calendar/src/Calendar.js.map +1 -0
- package/dist/packages/primitives/calendar/src/Calendar.vue.d.ts +95 -0
- package/dist/packages/primitives/calendar/src/Calendar.vue_vue_type_script_setup_true_lang.js +204 -0
- package/dist/packages/primitives/calendar/src/Calendar.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/calendar/src/index.d.ts +3 -0
- package/dist/packages/primitives/calendar/src/index.js +3 -0
- package/dist/packages/primitives/card/src/Card.js +7 -0
- package/dist/packages/primitives/card/src/Card.js.map +1 -0
- package/dist/packages/primitives/card/src/Card.vue.d.ts +72 -0
- package/dist/packages/primitives/card/src/Card.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/packages/primitives/card/src/Card.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/card/src/index.d.ts +3 -0
- package/dist/packages/primitives/card/src/index.d.ts.map +1 -0
- package/dist/packages/primitives/card/src/index.js +2 -0
- package/dist/packages/primitives/carousel/src/Carousel.js +7 -0
- package/dist/packages/primitives/carousel/src/Carousel.js.map +1 -0
- package/dist/packages/primitives/carousel/src/Carousel.vue.d.ts +34 -0
- package/dist/packages/primitives/carousel/src/Carousel.vue_vue_type_script_setup_true_lang.js +175 -0
- package/dist/packages/primitives/carousel/src/Carousel.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/carousel/src/index.d.ts +3 -0
- package/dist/packages/primitives/carousel/src/index.js +3 -0
- package/dist/packages/primitives/checkbox/src/Checkbox.js.map +1 -1
- package/dist/packages/primitives/checkbox/src/Checkbox.vue.d.ts +1 -1
- package/dist/packages/primitives/checkbox/src/Checkbox.vue.d.ts.map +1 -1
- package/dist/packages/primitives/checkbox/src/Checkbox.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/packages/primitives/checkbox/src/Checkbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/chip/src/Chip.js.map +1 -1
- package/dist/packages/primitives/chip/src/Chip.vue.d.ts.map +1 -1
- package/dist/packages/primitives/chip/src/Chip.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/packages/primitives/chip/src/Chip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/collapse/src/Collapse.js +7 -0
- package/dist/packages/primitives/collapse/src/Collapse.js.map +1 -0
- package/dist/packages/primitives/collapse/src/Collapse.vue.d.ts +56 -0
- package/dist/packages/primitives/collapse/src/Collapse.vue.d.ts.map +1 -0
- package/dist/packages/primitives/collapse/src/Collapse.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/packages/primitives/collapse/src/Collapse.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/collapse/src/index.d.ts +2 -0
- package/dist/packages/primitives/collapse/src/index.d.ts.map +1 -0
- package/dist/packages/primitives/collapse/src/index.js +2 -0
- package/dist/packages/primitives/color-picker/src/ColorPicker.js.map +1 -1
- package/dist/packages/primitives/color-picker/src/ColorPicker.vue.d.ts +4 -4
- package/dist/packages/primitives/color-picker/src/ColorPicker.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/packages/primitives/color-picker/src/ColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/color-picker/src/index.d.ts +1 -1
- package/dist/packages/primitives/combobox/src/Combobox.js.map +1 -1
- package/dist/packages/primitives/combobox/src/Combobox.vue.d.ts +3 -3
- package/dist/packages/primitives/combobox/src/Combobox.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/packages/primitives/combobox/src/Combobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/combobox/src/index.d.ts +1 -1
- package/dist/packages/primitives/command/src/Command.js +7 -0
- package/dist/packages/primitives/command/src/Command.js.map +1 -0
- package/dist/packages/primitives/command/src/Command.vue.d.ts +77 -0
- package/dist/packages/primitives/command/src/Command.vue_vue_type_script_setup_true_lang.js +333 -0
- package/dist/packages/primitives/command/src/Command.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/command/src/index.d.ts +4 -0
- package/dist/packages/primitives/command/src/index.js +3 -0
- package/dist/packages/primitives/context-menu/src/ContextMenu.js.map +1 -1
- package/dist/packages/primitives/context-menu/src/ContextMenu.vue.d.ts +12 -0
- package/dist/packages/primitives/context-menu/src/ContextMenu.vue.d.ts.map +1 -1
- package/dist/packages/primitives/context-menu/src/ContextMenu.vue_vue_type_script_setup_true_lang.js +7 -3
- package/dist/packages/primitives/context-menu/src/ContextMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/copy-button/src/CopyButton.js +7 -0
- package/dist/packages/primitives/copy-button/src/CopyButton.js.map +1 -0
- package/dist/packages/primitives/copy-button/src/CopyButton.vue.d.ts +64 -0
- package/dist/packages/primitives/copy-button/src/CopyButton.vue_vue_type_script_setup_true_lang.js +113 -0
- package/dist/packages/primitives/copy-button/src/CopyButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/copy-button/src/index.d.ts +4 -0
- package/dist/packages/primitives/copy-button/src/index.js +3 -0
- package/dist/packages/primitives/data-grid/src/DataGrid.js +7 -0
- package/dist/packages/primitives/data-grid/src/DataGrid.js.map +1 -0
- package/dist/packages/primitives/data-grid/src/DataGrid.vue.d.ts +128 -0
- package/dist/packages/primitives/data-grid/src/DataGrid.vue_vue_type_script_setup_true_lang.js +347 -0
- package/dist/packages/primitives/data-grid/src/DataGrid.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/data-grid/src/index.d.ts +4 -0
- package/dist/packages/primitives/data-grid/src/index.js +3 -0
- package/dist/packages/primitives/date-picker/src/DatePicker.js.map +1 -1
- package/dist/packages/primitives/date-picker/src/DatePicker.vue.d.ts +2 -2
- package/dist/packages/primitives/date-picker/src/DatePicker.vue_vue_type_script_setup_true_lang.js +14 -14
- package/dist/packages/primitives/date-picker/src/DatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/date-range-picker/src/DateRangePicker.js.map +1 -1
- package/dist/packages/primitives/date-range-picker/src/DateRangePicker.vue.d.ts +3 -3
- package/dist/packages/primitives/date-range-picker/src/DateRangePicker.vue_vue_type_script_setup_true_lang.js +22 -19
- package/dist/packages/primitives/date-range-picker/src/DateRangePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/date-range-picker/src/index.d.ts +1 -1
- package/dist/packages/primitives/date-time-picker/src/DateTimePicker.js.map +1 -1
- package/dist/packages/primitives/date-time-picker/src/DateTimePicker.vue.d.ts +2 -2
- package/dist/packages/primitives/date-time-picker/src/DateTimePicker.vue_vue_type_script_setup_true_lang.js +18 -17
- package/dist/packages/primitives/date-time-picker/src/DateTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/date-time-range-picker/src/DateTimeRangePicker.js.map +1 -1
- package/dist/packages/primitives/date-time-range-picker/src/DateTimeRangePicker.vue.d.ts +3 -3
- package/dist/packages/primitives/date-time-range-picker/src/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +18 -17
- package/dist/packages/primitives/date-time-range-picker/src/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/date-time-range-picker/src/index.d.ts +1 -1
- package/dist/packages/primitives/dialog/src/Dialog.js.map +1 -1
- package/dist/packages/primitives/dialog/src/Dialog.vue.d.ts +27 -11
- package/dist/packages/primitives/dialog/src/Dialog.vue_vue_type_script_setup_true_lang.js +6 -4
- package/dist/packages/primitives/dialog/src/Dialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/dialog/src/index.d.ts +1 -1
- package/dist/packages/primitives/drawer/src/Drawer.js.map +1 -1
- package/dist/packages/primitives/drawer/src/Drawer.vue.d.ts +12 -4
- package/dist/packages/primitives/drawer/src/Drawer.vue_vue_type_script_setup_true_lang.js +13 -5
- package/dist/packages/primitives/drawer/src/Drawer.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/drawer/src/index.d.ts +1 -1
- package/dist/packages/primitives/dropdown-menu/src/DropdownMenu.js.map +1 -1
- package/dist/packages/primitives/dropdown-menu/src/DropdownMenu.vue.d.ts +26 -0
- package/dist/packages/primitives/dropdown-menu/src/DropdownMenu.vue.d.ts.map +1 -1
- package/dist/packages/primitives/dropdown-menu/src/DropdownMenu.vue_vue_type_script_setup_true_lang.js +10 -4
- package/dist/packages/primitives/dropdown-menu/src/DropdownMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/editable/src/Editable.js.map +1 -1
- package/dist/packages/primitives/editable/src/Editable.vue.d.ts +2 -2
- package/dist/packages/primitives/editable/src/Editable.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/packages/primitives/editable/src/Editable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/editable/src/index.d.ts +1 -1
- package/dist/packages/primitives/file-upload/src/FileUpload.js.map +1 -1
- package/dist/packages/primitives/file-upload/src/FileUpload.vue.d.ts +2 -2
- package/dist/packages/primitives/file-upload/src/FileUpload.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/packages/primitives/file-upload/src/FileUpload.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/file-upload/src/index.d.ts +1 -1
- package/dist/packages/primitives/hover-card/src/HoverCard.js.map +1 -1
- package/dist/packages/primitives/hover-card/src/HoverCard.vue.d.ts.map +1 -1
- package/dist/packages/primitives/hover-card/src/HoverCard.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/packages/primitives/hover-card/src/HoverCard.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/hover-card/src/index.d.ts.map +1 -1
- package/dist/packages/primitives/icon-button/src/IconButton.js.map +1 -1
- package/dist/packages/primitives/icon-button/src/IconButton.vue.d.ts +10 -4
- package/dist/packages/primitives/icon-button/src/IconButton.vue.d.ts.map +1 -1
- package/dist/packages/primitives/icon-button/src/IconButton.vue_vue_type_script_setup_true_lang.js +18 -6
- package/dist/packages/primitives/icon-button/src/IconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/indicator/src/Indicator.vue.d.ts +2 -2
- package/dist/packages/primitives/indicator/src/index.d.ts +1 -1
- package/dist/packages/primitives/kbd/src/Kbd.js +7 -0
- package/dist/packages/primitives/kbd/src/Kbd.js.map +1 -0
- package/dist/packages/primitives/kbd/src/Kbd.vue.d.ts +30 -0
- package/dist/packages/primitives/kbd/src/Kbd.vue.d.ts.map +1 -0
- package/dist/packages/primitives/kbd/src/Kbd.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/packages/primitives/kbd/src/Kbd.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/kbd/src/index.d.ts +3 -0
- package/dist/packages/primitives/kbd/src/index.d.ts.map +1 -0
- package/dist/packages/primitives/kbd/src/index.js +3 -0
- package/dist/packages/primitives/link/src/Link.js.map +1 -1
- package/dist/packages/primitives/link/src/Link.vue.d.ts.map +1 -1
- package/dist/packages/primitives/link/src/Link.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/packages/primitives/link/src/Link.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/list/src/List.js +7 -0
- package/dist/packages/primitives/list/src/List.js.map +1 -0
- package/dist/packages/primitives/list/src/List.vue.d.ts +22 -0
- package/dist/packages/primitives/list/src/List.vue.d.ts.map +1 -0
- package/dist/packages/primitives/list/src/List.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/packages/primitives/list/src/List.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/list/src/ListItem.js +7 -0
- package/dist/packages/primitives/list/src/ListItem.js.map +1 -0
- package/dist/packages/primitives/list/src/ListItem.vue.d.ts +75 -0
- package/dist/packages/primitives/list/src/ListItem.vue.d.ts.map +1 -0
- package/dist/packages/primitives/list/src/ListItem.vue_vue_type_script_setup_true_lang.js +101 -0
- package/dist/packages/primitives/list/src/ListItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/list/src/index.d.ts +4 -0
- package/dist/packages/primitives/list/src/index.d.ts.map +1 -0
- package/dist/packages/primitives/list/src/index.js +3 -0
- package/dist/packages/primitives/live-region/src/LiveRegion.js +7 -0
- package/dist/packages/primitives/live-region/src/LiveRegion.js.map +1 -0
- package/dist/packages/primitives/live-region/src/LiveRegion.vue.d.ts +36 -0
- package/dist/packages/primitives/live-region/src/LiveRegion.vue.d.ts.map +1 -0
- package/dist/packages/primitives/live-region/src/LiveRegion.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/packages/primitives/live-region/src/LiveRegion.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/live-region/src/context.d.ts +40 -0
- package/dist/packages/primitives/live-region/src/context.d.ts.map +1 -0
- package/dist/packages/primitives/live-region/src/context.js +85 -0
- package/dist/packages/primitives/live-region/src/context.js.map +1 -0
- package/dist/packages/primitives/live-region/src/index.d.ts +4 -0
- package/dist/packages/primitives/live-region/src/index.d.ts.map +1 -0
- package/dist/packages/primitives/live-region/src/index.js +3 -0
- package/dist/packages/primitives/live-region/src/useAnnounce.d.ts +17 -0
- package/dist/packages/primitives/live-region/src/useAnnounce.d.ts.map +1 -0
- package/dist/packages/primitives/live-region/src/useAnnounce.js +25 -0
- package/dist/packages/primitives/live-region/src/useAnnounce.js.map +1 -0
- package/dist/packages/primitives/menubar/src/Menubar.js.map +1 -1
- package/dist/packages/primitives/menubar/src/Menubar.vue.d.ts +20 -6
- package/dist/packages/primitives/menubar/src/Menubar.vue.d.ts.map +1 -1
- package/dist/packages/primitives/menubar/src/Menubar.vue_vue_type_script_setup_true_lang.js +211 -64
- package/dist/packages/primitives/menubar/src/Menubar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/meter/src/Meter.js +7 -0
- package/dist/packages/primitives/meter/src/Meter.js.map +1 -0
- package/dist/packages/primitives/meter/src/Meter.vue.d.ts +87 -0
- package/dist/packages/primitives/meter/src/Meter.vue_vue_type_script_setup_true_lang.js +236 -0
- package/dist/packages/primitives/meter/src/Meter.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/meter/src/index.d.ts +4 -0
- package/dist/packages/primitives/meter/src/index.js +3 -0
- package/dist/packages/primitives/navigation-menu/src/NavigationMenu.js +7 -0
- package/dist/packages/primitives/navigation-menu/src/NavigationMenu.js.map +1 -0
- package/dist/packages/primitives/navigation-menu/src/NavigationMenu.vue.d.ts +69 -0
- package/dist/packages/primitives/navigation-menu/src/NavigationMenu.vue.d.ts.map +1 -0
- package/dist/packages/primitives/navigation-menu/src/NavigationMenu.vue_vue_type_script_setup_true_lang.js +118 -0
- package/dist/packages/primitives/navigation-menu/src/NavigationMenu.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/navigation-menu/src/index.d.ts +3 -0
- package/dist/packages/primitives/navigation-menu/src/index.d.ts.map +1 -0
- package/dist/packages/primitives/navigation-menu/src/index.js +2 -0
- package/dist/packages/primitives/number-field/src/NumberField.js.map +1 -1
- package/dist/packages/primitives/number-field/src/NumberField.vue.d.ts +2 -2
- package/dist/packages/primitives/number-field/src/NumberField.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/packages/primitives/number-field/src/NumberField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/number-field/src/index.d.ts +1 -1
- package/dist/packages/primitives/otp-input/src/OtpInput.vue.d.ts +2 -2
- package/dist/packages/primitives/otp-input/src/index.d.ts +1 -1
- package/dist/packages/primitives/pagination/src/Pagination.js.map +1 -1
- package/dist/packages/primitives/pagination/src/Pagination.vue.d.ts +3 -3
- package/dist/packages/primitives/pagination/src/Pagination.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/packages/primitives/pagination/src/Pagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/pagination/src/index.d.ts +1 -1
- package/dist/packages/primitives/popover/src/Popover.js.map +1 -1
- package/dist/packages/primitives/popover/src/Popover.vue.d.ts.map +1 -1
- package/dist/packages/primitives/popover/src/Popover.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/packages/primitives/popover/src/Popover.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/progress/src/Progress.vue.d.ts +2 -2
- package/dist/packages/primitives/progress/src/index.d.ts +1 -1
- package/dist/packages/primitives/radial-progress/src/RadialProgress.vue.d.ts +2 -2
- package/dist/packages/primitives/radial-progress/src/index.d.ts +1 -1
- package/dist/packages/primitives/radio-group/src/RadioGroup.js.map +1 -1
- package/dist/packages/primitives/radio-group/src/RadioGroup.vue.d.ts.map +1 -1
- package/dist/packages/primitives/radio-group/src/RadioGroup.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/packages/primitives/radio-group/src/RadioGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/rating/src/Rating.vue.d.ts +2 -2
- package/dist/packages/primitives/rating/src/index.d.ts +1 -1
- package/dist/packages/primitives/segmented-control/src/SegmentedControl.js.map +1 -1
- package/dist/packages/primitives/segmented-control/src/SegmentedControl.vue.d.ts.map +1 -1
- package/dist/packages/primitives/segmented-control/src/SegmentedControl.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/packages/primitives/segmented-control/src/SegmentedControl.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/select/src/Select.js.map +1 -1
- package/dist/packages/primitives/select/src/Select.vue.d.ts.map +1 -1
- package/dist/packages/primitives/select/src/Select.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/packages/primitives/select/src/Select.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/skip-link/src/SkipLink.js +7 -0
- package/dist/packages/primitives/skip-link/src/SkipLink.js.map +1 -0
- package/dist/packages/primitives/skip-link/src/SkipLink.vue.d.ts +62 -0
- package/dist/packages/primitives/skip-link/src/SkipLink.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/packages/primitives/skip-link/src/SkipLink.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/skip-link/src/index.d.ts +3 -0
- package/dist/packages/primitives/skip-link/src/index.js +3 -0
- package/dist/packages/primitives/slider/src/Slider.js.map +1 -1
- package/dist/packages/primitives/slider/src/Slider.vue.d.ts +6 -3
- package/dist/packages/primitives/slider/src/Slider.vue.d.ts.map +1 -1
- package/dist/packages/primitives/slider/src/Slider.vue_vue_type_script_setup_true_lang.js +15 -10
- package/dist/packages/primitives/slider/src/Slider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/stepper/src/Stepper.js.map +1 -1
- package/dist/packages/primitives/stepper/src/Stepper.vue.d.ts +2 -2
- package/dist/packages/primitives/stepper/src/Stepper.vue_vue_type_script_setup_true_lang.js +7 -5
- package/dist/packages/primitives/stepper/src/Stepper.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/stepper/src/index.d.ts +1 -1
- package/dist/packages/primitives/switch/src/Switch.js.map +1 -1
- package/dist/packages/primitives/switch/src/Switch.vue.d.ts +1 -1
- package/dist/packages/primitives/switch/src/Switch.vue.d.ts.map +1 -1
- package/dist/packages/primitives/switch/src/Switch.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/packages/primitives/switch/src/Switch.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/table/src/Table.js +7 -0
- package/dist/packages/primitives/table/src/Table.js.map +1 -0
- package/dist/packages/primitives/table/src/Table.vue.d.ts +45 -0
- package/dist/packages/primitives/table/src/Table.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/packages/primitives/table/src/Table.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/table/src/TableCell.js +7 -0
- package/dist/packages/primitives/table/src/TableCell.js.map +1 -0
- package/dist/packages/primitives/table/src/TableCell.vue.d.ts +19 -0
- package/dist/packages/primitives/table/src/TableCell.vue.d.ts.map +1 -0
- package/dist/packages/primitives/table/src/TableCell.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/packages/primitives/table/src/TableCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/table/src/TableHead.js +7 -0
- package/dist/packages/primitives/table/src/TableHead.js.map +1 -0
- package/dist/packages/primitives/table/src/TableHead.vue.d.ts +56 -0
- package/dist/packages/primitives/table/src/TableHead.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/packages/primitives/table/src/TableHead.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/table/src/TableRow.js +7 -0
- package/dist/packages/primitives/table/src/TableRow.js.map +1 -0
- package/dist/packages/primitives/table/src/TableRow.vue.d.ts +39 -0
- package/dist/packages/primitives/table/src/TableRow.vue.d.ts.map +1 -0
- package/dist/packages/primitives/table/src/TableRow.vue_vue_type_script_setup_true_lang.js +61 -0
- package/dist/packages/primitives/table/src/TableRow.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/table/src/index.d.ts +10 -0
- package/dist/packages/primitives/table/src/index.js +8 -0
- package/dist/packages/primitives/tabs/src/Tabs.js.map +1 -1
- package/dist/packages/primitives/tabs/src/Tabs.vue.d.ts.map +1 -1
- package/dist/packages/primitives/tabs/src/Tabs.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/packages/primitives/tabs/src/Tabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/tags-input/src/TagsInput.js.map +1 -1
- package/dist/packages/primitives/tags-input/src/TagsInput.vue.d.ts +2 -2
- package/dist/packages/primitives/tags-input/src/TagsInput.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/packages/primitives/tags-input/src/TagsInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/tags-input/src/index.d.ts +1 -1
- package/dist/packages/primitives/text-field/src/TextField.js.map +1 -1
- package/dist/packages/primitives/text-field/src/TextField.vue.d.ts +2 -2
- package/dist/packages/primitives/text-field/src/TextField.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/packages/primitives/text-field/src/TextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/text-field/src/index.d.ts +1 -1
- package/dist/packages/primitives/text-field/src/index.js +2 -2
- package/dist/packages/primitives/textarea/src/Textarea.js.map +1 -1
- package/dist/packages/primitives/textarea/src/Textarea.vue.d.ts +2 -2
- package/dist/packages/primitives/textarea/src/Textarea.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/packages/primitives/textarea/src/Textarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/textarea/src/index.d.ts +1 -1
- package/dist/packages/primitives/textarea/src/index.js +2 -2
- package/dist/packages/primitives/time-picker/src/TimePicker.js.map +1 -1
- package/dist/packages/primitives/time-picker/src/TimePicker.vue.d.ts +2 -2
- package/dist/packages/primitives/time-picker/src/TimePicker.vue_vue_type_script_setup_true_lang.js +10 -8
- package/dist/packages/primitives/time-picker/src/TimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/timeline/src/Timeline.js +7 -0
- package/dist/packages/primitives/timeline/src/Timeline.js.map +1 -0
- package/dist/packages/primitives/timeline/src/Timeline.vue.d.ts +37 -0
- package/dist/packages/primitives/timeline/src/Timeline.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/packages/primitives/timeline/src/Timeline.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/timeline/src/TimelineItem.js +7 -0
- package/dist/packages/primitives/timeline/src/TimelineItem.js.map +1 -0
- package/dist/packages/primitives/timeline/src/TimelineItem.vue.d.ts +50 -0
- package/dist/packages/primitives/timeline/src/TimelineItem.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/packages/primitives/timeline/src/TimelineItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/timeline/src/index.d.ts +5 -0
- package/dist/packages/primitives/timeline/src/index.js +5 -0
- package/dist/packages/primitives/toast/src/Toast.vue.d.ts +2 -2
- package/dist/packages/primitives/toast/src/ToastItem.js.map +1 -1
- package/dist/packages/primitives/toast/src/ToastItem.vue.d.ts +2 -2
- package/dist/packages/primitives/toast/src/ToastItem.vue_vue_type_script_setup_true_lang.js +5 -3
- package/dist/packages/primitives/toast/src/ToastItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/toast/src/index.d.ts +1 -1
- package/dist/packages/primitives/toggle-group/src/ToggleGroup.js +7 -0
- package/dist/packages/primitives/toggle-group/src/ToggleGroup.js.map +1 -0
- package/dist/packages/primitives/toggle-group/src/ToggleGroup.vue.d.ts +53 -0
- package/dist/packages/primitives/toggle-group/src/ToggleGroup.vue.d.ts.map +1 -0
- package/dist/packages/primitives/toggle-group/src/ToggleGroup.vue_vue_type_script_setup_true_lang.js +111 -0
- package/dist/packages/primitives/toggle-group/src/ToggleGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/toggle-group/src/index.d.ts +3 -0
- package/dist/packages/primitives/toggle-group/src/index.d.ts.map +1 -0
- package/dist/packages/primitives/toggle-group/src/index.js +2 -0
- package/dist/packages/primitives/toolbar/src/Toolbar.js +7 -0
- package/dist/packages/primitives/toolbar/src/Toolbar.js.map +1 -0
- package/dist/packages/primitives/toolbar/src/Toolbar.vue.d.ts +31 -0
- package/dist/packages/primitives/toolbar/src/Toolbar.vue.d.ts.map +1 -0
- package/dist/packages/primitives/toolbar/src/Toolbar.vue_vue_type_script_setup_true_lang.js +149 -0
- package/dist/packages/primitives/toolbar/src/Toolbar.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/toolbar/src/ToolbarSeparator.js +7 -0
- package/dist/packages/primitives/toolbar/src/ToolbarSeparator.js.map +1 -0
- package/dist/packages/primitives/toolbar/src/ToolbarSeparator.vue.d.ts +24 -0
- package/dist/packages/primitives/toolbar/src/ToolbarSeparator.vue.d.ts.map +1 -0
- package/dist/packages/primitives/toolbar/src/ToolbarSeparator.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/packages/primitives/toolbar/src/ToolbarSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/toolbar/src/index.d.ts +4 -0
- package/dist/packages/primitives/toolbar/src/index.d.ts.map +1 -0
- package/dist/packages/primitives/toolbar/src/index.js +3 -0
- package/dist/packages/primitives/tooltip/src/Tooltip.js.map +1 -1
- package/dist/packages/primitives/tooltip/src/Tooltip.vue.d.ts.map +1 -1
- package/dist/packages/primitives/tooltip/src/Tooltip.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/packages/primitives/tooltip/src/Tooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/packages/primitives/tree-view/src/TreeView.js +7 -0
- package/dist/packages/primitives/tree-view/src/TreeView.js.map +1 -0
- package/dist/packages/primitives/tree-view/src/TreeView.vue.d.ts +99 -0
- package/dist/packages/primitives/tree-view/src/TreeView.vue_vue_type_script_setup_true_lang.js +310 -0
- package/dist/packages/primitives/tree-view/src/TreeView.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/tree-view/src/TreeViewNode.js +7 -0
- package/dist/packages/primitives/tree-view/src/TreeViewNode.js.map +1 -0
- package/dist/packages/primitives/tree-view/src/TreeViewNode.vue.d.ts +15 -0
- package/dist/packages/primitives/tree-view/src/TreeViewNode.vue.d.ts.map +1 -0
- package/dist/packages/primitives/tree-view/src/TreeViewNode.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/packages/primitives/tree-view/src/TreeViewNode.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/tree-view/src/context.d.ts +39 -0
- package/dist/packages/primitives/tree-view/src/context.d.ts.map +1 -0
- package/dist/packages/primitives/tree-view/src/context.js +6 -0
- package/dist/packages/primitives/tree-view/src/context.js.map +1 -0
- package/dist/packages/primitives/tree-view/src/index.d.ts +4 -0
- package/dist/packages/primitives/tree-view/src/index.js +3 -0
- package/dist/packages/primitives/visually-hidden/src/VisuallyHidden.js +7 -0
- package/dist/packages/primitives/visually-hidden/src/VisuallyHidden.js.map +1 -0
- package/dist/packages/primitives/visually-hidden/src/VisuallyHidden.vue.d.ts +21 -0
- package/dist/packages/primitives/visually-hidden/src/VisuallyHidden.vue.d.ts.map +1 -0
- package/dist/packages/primitives/visually-hidden/src/VisuallyHidden.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/packages/primitives/visually-hidden/src/VisuallyHidden.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/packages/primitives/visually-hidden/src/index.d.ts +3 -0
- package/dist/packages/primitives/visually-hidden/src/index.d.ts.map +1 -0
- package/dist/packages/primitives/visually-hidden/src/index.js +2 -0
- package/dist/packages/primitives/window-controls/src/WindowControls.vue.d.ts +2 -2
- package/dist/packages/primitives/window-controls/src/index.d.ts +1 -1
- package/dist/styles/global.css +59 -0
- package/dist/styles/theme.css +13 -0
- package/dist/theme.js +3 -0
- package/package.json +37 -30
- package/dist/packages/blocks/desktop-app-shell/src/DesktopAppShell.vue.d.ts.map +0 -1
- package/dist/packages/blocks/title-bar/src/TitleBar.vue.d.ts.map +0 -1
- package/dist/packages/blocks/toast-stack/src/ToastStack.vue.d.ts.map +0 -1
- package/dist/packages/composition/scroll-reel/src/ScrollReel.vue.d.ts.map +0 -1
- package/dist/packages/composition/scroll-reel/src/index.d.ts.map +0 -1
- package/dist/packages/loom/src/a11y.d.ts.map +0 -1
- package/dist/packages/loom/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/alert-dialog/src/AlertDialog.vue.d.ts.map +0 -1
- package/dist/packages/primitives/alert-dialog/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/avatar-group/src/AvatarGroup.vue.d.ts.map +0 -1
- package/dist/packages/primitives/avatar-group/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/breadcrumb/src/Breadcrumb.vue.d.ts.map +0 -1
- package/dist/packages/primitives/breadcrumb/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/color-picker/src/ColorPicker.vue.d.ts.map +0 -1
- package/dist/packages/primitives/color-picker/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/combobox/src/Combobox.vue.d.ts.map +0 -1
- package/dist/packages/primitives/combobox/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/date-picker/src/DatePicker.vue.d.ts.map +0 -1
- package/dist/packages/primitives/date-range-picker/src/DateRangePicker.vue.d.ts.map +0 -1
- package/dist/packages/primitives/date-range-picker/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/date-time-picker/src/DateTimePicker.vue.d.ts.map +0 -1
- package/dist/packages/primitives/date-time-range-picker/src/DateTimeRangePicker.vue.d.ts.map +0 -1
- package/dist/packages/primitives/date-time-range-picker/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/dialog/src/Dialog.vue.d.ts.map +0 -1
- package/dist/packages/primitives/dialog/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/drawer/src/Drawer.vue.d.ts.map +0 -1
- package/dist/packages/primitives/drawer/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/editable/src/Editable.vue.d.ts.map +0 -1
- package/dist/packages/primitives/editable/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/file-upload/src/FileUpload.vue.d.ts.map +0 -1
- package/dist/packages/primitives/file-upload/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/indicator/src/Indicator.vue.d.ts.map +0 -1
- package/dist/packages/primitives/indicator/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/number-field/src/NumberField.vue.d.ts.map +0 -1
- package/dist/packages/primitives/number-field/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/otp-input/src/OtpInput.vue.d.ts.map +0 -1
- package/dist/packages/primitives/otp-input/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/pagination/src/Pagination.vue.d.ts.map +0 -1
- package/dist/packages/primitives/pagination/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/progress/src/Progress.vue.d.ts.map +0 -1
- package/dist/packages/primitives/progress/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/radial-progress/src/RadialProgress.vue.d.ts.map +0 -1
- package/dist/packages/primitives/radial-progress/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/rating/src/Rating.vue.d.ts.map +0 -1
- package/dist/packages/primitives/rating/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/stepper/src/Stepper.vue.d.ts.map +0 -1
- package/dist/packages/primitives/stepper/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/tags-input/src/TagsInput.vue.d.ts.map +0 -1
- package/dist/packages/primitives/tags-input/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/text-field/src/TextField.vue.d.ts.map +0 -1
- package/dist/packages/primitives/text-field/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/textarea/src/Textarea.vue.d.ts.map +0 -1
- package/dist/packages/primitives/textarea/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/time-picker/src/TimePicker.vue.d.ts.map +0 -1
- package/dist/packages/primitives/toast/src/Toast.vue.d.ts.map +0 -1
- package/dist/packages/primitives/toast/src/ToastItem.vue.d.ts.map +0 -1
- package/dist/packages/primitives/toast/src/index.d.ts.map +0 -1
- package/dist/packages/primitives/window-controls/src/WindowControls.vue.d.ts.map +0 -1
- package/dist/packages/primitives/window-controls/src/index.d.ts.map +0 -1
- package/dist/styles/theme.contrast.test.ts +0 -460
|
@@ -189,6 +189,80 @@ export declare function emptySegmentValueText(part: string, value: string, empty
|
|
|
189
189
|
export declare function isDateSegmentPart(part: string): part is DateSegmentName;
|
|
190
190
|
/** Whether a part named by Reka's `segments` slot belongs to the clock half. */
|
|
191
191
|
export declare function isTimeSegmentPart(part: string): part is TimeSegmentName;
|
|
192
|
+
/**
|
|
193
|
+
* The one or both vocabularies a segmented field resolves its strings through,
|
|
194
|
+
* as `useLabels` handed them to the control.
|
|
195
|
+
*
|
|
196
|
+
* A shape per control rather than one required parameter set, because this
|
|
197
|
+
* serves three shapes of control at once: a date-only one resolves through
|
|
198
|
+
* `date` alone, a time-only one through `time` alone, and the two datetime
|
|
199
|
+
* controls through both. That spread is exactly why this pair lives here
|
|
200
|
+
* rather than five times over — five hand-copied `segmentLabel`/
|
|
201
|
+
* `segmentValueText` pairs had already drifted in their comments, and the only
|
|
202
|
+
* step left was drifting in the emitted strings themselves, which are
|
|
203
|
+
* assistive technology's entire view of these fields.
|
|
204
|
+
*/
|
|
205
|
+
export interface SegmentVocabularies {
|
|
206
|
+
/** The date half's vocabulary, when the control renders date segments. */
|
|
207
|
+
readonly date?: DateSegmentLabels | undefined;
|
|
208
|
+
/** The clock half's vocabulary, when the control renders time segments. */
|
|
209
|
+
readonly time?: TimeSegmentLabels | undefined;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* The accessible name of one segment, replacing the English name Reka writes
|
|
213
|
+
* inside `useDateField`'s own render function — see `DATE_SEGMENT_LABELS`.
|
|
214
|
+
*
|
|
215
|
+
* The half that owns the part names it: a date part is answered by the date
|
|
216
|
+
* vocabulary and a clock part by the time one, which is what lets a host
|
|
217
|
+
* localising only `timeSegments` still reach the clock segments of a datetime
|
|
218
|
+
* control. `undefined` for everything else — the `literal` separators, which
|
|
219
|
+
* Reka renders `aria-hidden` and which must stay unnamed, and any part neither
|
|
220
|
+
* vocabulary knows.
|
|
221
|
+
*/
|
|
222
|
+
export declare function segmentAriaLabel(vocabularies: SegmentVocabularies, part: string): string | undefined;
|
|
223
|
+
/** What `segmentAriaValueText` resolves one segment's value announcement from. */
|
|
224
|
+
export interface SegmentAriaValueTextArgs extends SegmentVocabularies {
|
|
225
|
+
/** The segment's part name, as Reka's `segments` slot yields it. */
|
|
226
|
+
readonly part: string;
|
|
227
|
+
/**
|
|
228
|
+
* The segment's displayed value, whose emptiness decides whether the field's
|
|
229
|
+
* own word replaces Reka's — read off digits by `emptySegmentValueText`.
|
|
230
|
+
*/
|
|
231
|
+
readonly value: string;
|
|
232
|
+
/**
|
|
233
|
+
* The field's locale, composed into the filled month's value text. Every
|
|
234
|
+
* other branch ignores it, but a control always has one to give.
|
|
235
|
+
*/
|
|
236
|
+
readonly locale: string;
|
|
237
|
+
/**
|
|
238
|
+
* The numeric month of the model value the control parsed itself, and never
|
|
239
|
+
* of `value`: the displayed text is locale-formatted and may carry no
|
|
240
|
+
* parseable number, so the caller reads the month off what it parsed.
|
|
241
|
+
* Absent while no full date is chosen, and unused by a time-only control.
|
|
242
|
+
*/
|
|
243
|
+
readonly month?: number | undefined;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* The `aria-valuetext` override for one segment, as an object to `v-bind` —
|
|
247
|
+
* the shape `emptySegmentValueText` returns and the reason is recorded there.
|
|
248
|
+
*
|
|
249
|
+
* This composes the branches the five segmented controls each used to carry by
|
|
250
|
+
* hand, in the order they must apply: the empty case first, because it is the
|
|
251
|
+
* only one replacing what Reka wrote; then the filled month, announced through
|
|
252
|
+
* `filledMonth` so a host can compose `"5 - May"` the way their language
|
|
253
|
+
* needs; then the filled day period through `filledDayPeriod`, for the same
|
|
254
|
+
* reason. Anything else returns `{}`, which merges as nothing and leaves
|
|
255
|
+
* Reka's own value text — a number — exactly as it wrote it.
|
|
256
|
+
*
|
|
257
|
+
* The empty message comes from whichever half owns the part, so a host
|
|
258
|
+
* localising only `timeSegments` still reaches the clock segments of a
|
|
259
|
+
* datetime control. The fallback to `""` is unreachable for every real caller
|
|
260
|
+
* — a control always resolves at least its own half — and exists to keep the
|
|
261
|
+
* function total rather than to be exercised.
|
|
262
|
+
*/
|
|
263
|
+
export declare function segmentAriaValueText({ date, time, part, value, locale, month, }: SegmentAriaValueTextArgs): {
|
|
264
|
+
"aria-valuetext"?: string;
|
|
265
|
+
};
|
|
192
266
|
/**
|
|
193
267
|
* Everything the calendar popover says that is not a date: the panel's own
|
|
194
268
|
* name, the button that opens it, and the two that page the months.
|
|
@@ -261,18 +335,23 @@ export declare const RANGE_CELL_LABELS: RangeCellLabels;
|
|
|
261
335
|
/**
|
|
262
336
|
* A month name in the control's locale, for use in `aria-valuetext`.
|
|
263
337
|
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
338
|
+
* A building block of the defaults below, not public surface — it stays off
|
|
339
|
+
* the package barrel, because a host wording an override formats however
|
|
340
|
+
* their application already does. Exported from the module so its own tests
|
|
341
|
+
* can pin it directly.
|
|
267
342
|
*/
|
|
268
343
|
export declare function monthName(locale: string, month: number): string;
|
|
269
344
|
/**
|
|
270
345
|
* A whole day written out — weekday, day, month and year — in the control's
|
|
271
|
-
* locale, which is the half of a range cell's name that is not a qualifier
|
|
346
|
+
* locale, which is the half of a range cell's name that is not a qualifier,
|
|
347
|
+
* and the whole of a standalone calendar cell's name: a surface with no field
|
|
348
|
+
* echoing the value has its cells carry the full date themselves.
|
|
272
349
|
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
350
|
+
* Both range controls' English defaults need it and neither should own it;
|
|
351
|
+
* the Calendar reaches it through this module for the same reason, so one
|
|
352
|
+
* formatter cache serves every grid in the library. A host replacing those
|
|
353
|
+
* defaults formats with whatever their own application already uses and never
|
|
354
|
+
* calls this. Like `monthName`, it stays off the public facade.
|
|
276
355
|
*/
|
|
277
356
|
export declare function formatFullDay(locale: string, date: DateValue): string;
|
|
278
357
|
//# sourceMappingURL=date-labels.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-labels.d.ts","sourceRoot":"","sources":["../../../../packages/labels/src/date-labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,iBAAiB;IAChC,yCAAyC;IACzC,QAAQ,CAAC,KAAK,EAAE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$aa8b41735afcabd2 } from "../../../node_modules/.pnpm/@internationalized_date@3.12.
|
|
1
|
+
import { getLocalTimeZone as $ad063034c8620db8$export$aa8b41735afcabd2 } from "../../../node_modules/.pnpm/@internationalized_date@3.12.4/node_modules/@internationalized/date/dist/private/queries.js";
|
|
2
2
|
//#region packages/labels/src/date-labels.ts
|
|
3
3
|
/**
|
|
4
4
|
* Loom's English for the date segments, co-located so it tree-shakes with the
|
|
@@ -92,6 +92,50 @@ function isDateSegmentPart(part) {
|
|
|
92
92
|
function isTimeSegmentPart(part) {
|
|
93
93
|
return TIME_SEGMENT_PARTS.has(part);
|
|
94
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* The accessible name of one segment, replacing the English name Reka writes
|
|
97
|
+
* inside `useDateField`'s own render function — see `DATE_SEGMENT_LABELS`.
|
|
98
|
+
*
|
|
99
|
+
* The half that owns the part names it: a date part is answered by the date
|
|
100
|
+
* vocabulary and a clock part by the time one, which is what lets a host
|
|
101
|
+
* localising only `timeSegments` still reach the clock segments of a datetime
|
|
102
|
+
* control. `undefined` for everything else — the `literal` separators, which
|
|
103
|
+
* Reka renders `aria-hidden` and which must stay unnamed, and any part neither
|
|
104
|
+
* vocabulary knows.
|
|
105
|
+
*/
|
|
106
|
+
function segmentAriaLabel(vocabularies, part) {
|
|
107
|
+
const { date, time } = vocabularies;
|
|
108
|
+
if (date && isDateSegmentPart(part)) return date[part];
|
|
109
|
+
return time && isTimeSegmentPart(part) ? time[part] : void 0;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The `aria-valuetext` override for one segment, as an object to `v-bind` —
|
|
113
|
+
* the shape `emptySegmentValueText` returns and the reason is recorded there.
|
|
114
|
+
*
|
|
115
|
+
* This composes the branches the five segmented controls each used to carry by
|
|
116
|
+
* hand, in the order they must apply: the empty case first, because it is the
|
|
117
|
+
* only one replacing what Reka wrote; then the filled month, announced through
|
|
118
|
+
* `filledMonth` so a host can compose `"5 - May"` the way their language
|
|
119
|
+
* needs; then the filled day period through `filledDayPeriod`, for the same
|
|
120
|
+
* reason. Anything else returns `{}`, which merges as nothing and leaves
|
|
121
|
+
* Reka's own value text — a number — exactly as it wrote it.
|
|
122
|
+
*
|
|
123
|
+
* The empty message comes from whichever half owns the part, so a host
|
|
124
|
+
* localising only `timeSegments` still reaches the clock segments of a
|
|
125
|
+
* datetime control. The fallback to `""` is unreachable for every real caller
|
|
126
|
+
* — a control always resolves at least its own half — and exists to keep the
|
|
127
|
+
* function total rather than to be exercised.
|
|
128
|
+
*/
|
|
129
|
+
function segmentAriaValueText({ date, time, part, value, locale, month }) {
|
|
130
|
+
const empty = emptySegmentValueText(part, value, (isTimeSegmentPart(part) ? time ?? date : date ?? time)?.empty ?? "");
|
|
131
|
+
if (empty["aria-valuetext"]) return empty;
|
|
132
|
+
if (date && part === "month" && month !== void 0) return { "aria-valuetext": date.filledMonth({
|
|
133
|
+
value: month,
|
|
134
|
+
locale
|
|
135
|
+
}) };
|
|
136
|
+
if (time && part === "dayPeriod") return { "aria-valuetext": time.filledDayPeriod({ dayPeriod: value }) };
|
|
137
|
+
return {};
|
|
138
|
+
}
|
|
95
139
|
/** Loom's English for the calendar popover. See `DATE_SEGMENT_LABELS`. */
|
|
96
140
|
var CALENDAR_PANEL_LABELS = {
|
|
97
141
|
calendar: "Calendar",
|
|
@@ -118,9 +162,10 @@ var monthFormatters = /* @__PURE__ */ new Map();
|
|
|
118
162
|
/**
|
|
119
163
|
* A month name in the control's locale, for use in `aria-valuetext`.
|
|
120
164
|
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
165
|
+
* A building block of the defaults below, not public surface — it stays off
|
|
166
|
+
* the package barrel, because a host wording an override formats however
|
|
167
|
+
* their application already does. Exported from the module so its own tests
|
|
168
|
+
* can pin it directly.
|
|
124
169
|
*/
|
|
125
170
|
function monthName(locale, month) {
|
|
126
171
|
let formatter = monthFormatters.get(locale);
|
|
@@ -132,11 +177,15 @@ function monthName(locale, month) {
|
|
|
132
177
|
}
|
|
133
178
|
/**
|
|
134
179
|
* A whole day written out — weekday, day, month and year — in the control's
|
|
135
|
-
* locale, which is the half of a range cell's name that is not a qualifier
|
|
180
|
+
* locale, which is the half of a range cell's name that is not a qualifier,
|
|
181
|
+
* and the whole of a standalone calendar cell's name: a surface with no field
|
|
182
|
+
* echoing the value has its cells carry the full date themselves.
|
|
136
183
|
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
184
|
+
* Both range controls' English defaults need it and neither should own it;
|
|
185
|
+
* the Calendar reaches it through this module for the same reason, so one
|
|
186
|
+
* formatter cache serves every grid in the library. A host replacing those
|
|
187
|
+
* defaults formats with whatever their own application already uses and never
|
|
188
|
+
* calls this. Like `monthName`, it stays off the public facade.
|
|
140
189
|
*/
|
|
141
190
|
function formatFullDay(locale, date) {
|
|
142
191
|
let formatter = dayFormatters.get(locale);
|
|
@@ -152,6 +201,6 @@ function formatFullDay(locale, date) {
|
|
|
152
201
|
return formatter.format(date.toDate($ad063034c8620db8$export$aa8b41735afcabd2()));
|
|
153
202
|
}
|
|
154
203
|
//#endregion
|
|
155
|
-
export { CALENDAR_PANEL_LABELS, DATE_SEGMENT_LABELS, RANGE_CELL_LABELS, TIME_SEGMENT_LABELS, emptySegmentValueText, formatFullDay, isDateSegmentPart, isTimeSegmentPart, monthName };
|
|
204
|
+
export { CALENDAR_PANEL_LABELS, DATE_SEGMENT_LABELS, RANGE_CELL_LABELS, TIME_SEGMENT_LABELS, emptySegmentValueText, formatFullDay, isDateSegmentPart, isTimeSegmentPart, monthName, segmentAriaLabel, segmentAriaValueText };
|
|
156
205
|
|
|
157
206
|
//# sourceMappingURL=date-labels.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-labels.js","names":[],"sources":["../../../../packages/labels/src/date-labels.ts"],"sourcesContent":["import { getLocalTimeZone, type DateValue } from \"@internationalized/date\";\nimport type { LabelOf } from \"./labels\";\n\n/**\n * The four slices the five date and time controls share, and the one decision\n * behind putting them here rather than five times over.\n *\n * Every other component in the library declares its own bag beside its own\n * markup, because its vocabulary is its own. These five do not have five\n * vocabularies: `DatePicker`, `DateTimePicker`, `DateRangePicker` and\n * `DateTimeRangePicker` all say *Open calendar*, *Previous month* and *Next\n * month*, and all five name the parts of a segmented field with the same\n * words — the words are Reka UI's `useDateField` and `CalendarRoot` speaking,\n * one implementation underneath all five. Declared per component that would be\n * fifty-two keys with the same twelve strings written four times, and a\n * translator doing the same work four times to make one language complete.\n *\n * **Sliced by what a control actually says, not merged into one family bag.**\n * A `TimePicker` has no calendar and never renders a month or a year, so it\n * registers `timeSegments` alone: its documented vocabulary is four keys, and a\n * consumer importing only that control ships only those four strings. One\n * shared bag for the whole family would have made every one of the five carry\n * all twenty, and would have printed keys on `TimePicker`'s API page that it\n * has no element to put them on.\n *\n * What is deliberately *not* shared is the two range controls' half-group names\n * and status lines. They name the same concepts with different words (`Start\n * date` against `Start date and time`) and from different facts (a count of\n * whole days against a signed duration in minutes), so a shared key would have\n * to be a sentence that is never true of both. Their calendar cells' names are\n * shared, because those differ in neither.\n */\n\n/**\n * The names Reka UI's `useDateField` writes onto the day, month, year and era\n * segments — `\"day,\"`, `\"month, \"`, `\"year, \"`, `\"era\"`, each with the spacing\n * of a string it meant to concatenate.\n *\n * There is no prop for any of them. A binding on Loom's side reaches the\n * segment as a fallthrough attribute, which Vue merges onto the rendered vnode\n * *after* Reka's own render function produced it, and `mergeProps` is\n * last-write-wins for everything that is not `class`, `style` or `on*` — so\n * these replace Reka's rather than competing with it. Leave one unset and the\n * segment is not unnamed, it is named in English, which is the failure this\n * seam exists to close.\n *\n * Loom's defaults differ from Reka's by their capitalisation, which is what\n * lets a test assert *whose* string reached the DOM rather than merely what it\n * said.\n */\nexport interface DateSegmentLabels {\n /** The month segment of a date field. */\n readonly month: string;\n /** The day-of-month segment. */\n readonly day: string;\n /** The year segment. */\n readonly year: string;\n /**\n * The era segment, which most locales never render — `ja-JP-u-ca-japanese`\n * is the ordinary case that does.\n */\n readonly era: string;\n /**\n * What a segment with nothing in it yet reports as its value, replacing the\n * `aria-valuetext=\"Empty\"` Reka writes on an unfilled day, month or year.\n *\n * A segment shows the locale's own placeholder — `mm`, `jj`, `aaaa` — while\n * announcing this instead, so it is the one word standing between a fully\n * localised date field and a reader who is told \"Empty\" in English.\n *\n * Present on this slice *and* on `TimeSegmentLabels` rather than shared\n * between them, for the reason the slices exist at all: a `TimePicker`\n * registers no `dateSegments`, and a key it could only reach through the\n * date half would be a key it could not set.\n */\n readonly empty: string;\n /**\n * What a filled month segment announces as its value, replacing the\n * `aria-valuetext` Reka builds inside `useDateField`.\n *\n * Reka writes `\"5 - May\"` — the numeric month, a hard-coded `\" - \"`, and\n * the month name from `Intl.DateTimeFormat`. The name is locale-aware, but\n * the format is not: Japanese writes `\"5月\"`, Vietnamese `\"tháng 5\"`, and\n * neither separates the two parts with a hyphen. A `LabelOf` hands the\n * host the month number and the locale so they can compose the string their\n * language needs, using `Intl.DateTimeFormat` for the name and arranging the\n * parts in the right order.\n *\n * A `LabelOf` rather than a plain string, for the same reason\n * `RangeCellLabels.cell` is one: the month name depends on the locale, and\n * a string that did not receive the locale could not produce it. The host\n * decides the format — Loom's English default matches Reka's output so that\n * nothing changes for a consumer who does not override it.\n */\n readonly filledMonth: LabelOf<{ value: number; locale: string }>;\n}\n\n/**\n * Loom's English for the date segments, co-located so it tree-shakes with the\n * controls that use it, and exported so a host can build a partial vocabulary\n * against the real thing rather than a transcription of it.\n */\nexport const DATE_SEGMENT_LABELS: DateSegmentLabels = {\n month: \"Month\",\n day: \"Day\",\n year: \"Year\",\n era: \"Era\",\n // \"Not set\" rather than Reka's own \"Empty\", and the difference is load-bearing\n // in the same way the capitalisation of the names above is: it is what lets a\n // test assert whose string reached the DOM. It also reads better spoken — a\n // reader is being told this field has no value yet, not that it is blank.\n empty: \"Not set\",\n // Matches Reka's `\"5 - May\"` format for English. The month name comes from\n // `Intl.DateTimeFormat` via the cached `monthFormatters` map, which avoids\n // reconstructing the formatter on every render. A host overrides this to\n // change the format — Japanese `\"5月\"`, Vietnamese `\"tháng 5\"`, etc.\n filledMonth: ({ value, locale }) => {\n const name = monthName(locale, value);\n return `${String(value)} - ${name}`;\n },\n};\n\n/**\n * The same, for the clock half of a segmented field: Reka writes `\"hour, \"`,\n * `\"minute, \"`, `\"second, \"` and `\"AM/PM\"`, and offers a prop for none of them.\n *\n * `dayPeriod` is spelled `AM or PM` rather than `AM/PM` so that it reads as\n * words when it is spoken, and so the capitalisation trick above still works on\n * the one segment whose name Reka already capitalises.\n */\nexport interface TimeSegmentLabels {\n /** The hour segment. */\n readonly hour: string;\n /** The minute segment. */\n readonly minute: string;\n /** The seconds segment, which only a control at second granularity renders. */\n readonly second: string;\n /** The AM/PM segment, which only a 12-hour field renders. */\n readonly dayPeriod: string;\n /** What an hour, minute or second with nothing in it yet reports. See `DateSegmentLabels.empty`. */\n readonly empty: string;\n /**\n * What a filled day-period segment announces as its value, replacing the\n * `aria-valuetext` Reka writes inside `useDateField`.\n *\n * Reka writes `segmentValues.dayPeriod ?? \"AM\"` — always `\"AM\"` or `\"PM\"`,\n * produced by its own hour-cycle logic (`hour >= 12 ? \"PM\" : \"AM\"`) rather\n * than by `Intl.DateTimeFormat`. A host who has localised every other string\n * in the library still hears Latin-script \"AM\"/\"PM\" from this segment, which\n * is the defect this key exists to close.\n *\n * A `LabelOf` rather than a plain string, because the period name depends on\n * the locale: Arabic writes `\"ص\"`/`\"م\"`, Japanese `\"午前\"`/`\"午後\"`, and a\n * plain string could not carry that decision. Loom's English default returns\n * `dayPeriod` unchanged, which is correct for Latin-script locales.\n */\n readonly filledDayPeriod: LabelOf<{ dayPeriod: string }>;\n}\n\n/** Loom's English for the time segments. See `DATE_SEGMENT_LABELS`. */\nexport const TIME_SEGMENT_LABELS: TimeSegmentLabels = {\n hour: \"Hour\",\n minute: \"Minute\",\n second: \"Second\",\n dayPeriod: \"AM or PM\",\n empty: \"Not set\",\n // The identity function for English: Reka's `\"AM\"`/`\"PM\"` are correct for\n // Latin-script locales. A host localising to Arabic, Japanese, etc. overrides\n // this to return the locale's own period names.\n filledDayPeriod: ({ dayPeriod }) => dayPeriod,\n};\n\n/**\n * The parts each slice actually names — every key of its bag except `empty`,\n * which is a message *about* a segment rather than the name of one.\n *\n * Both the type and the set below are written out rather than derived from the\n * bags, which is what they were before `empty` joined them. Derived, the guards\n * would answer `true` for `\"empty\"` and narrow a part to a key that names no\n * element, and `segmentLabel` would happily return the empty message as a\n * segment's accessible name.\n */\nexport type DateSegmentName = Exclude<keyof DateSegmentLabels, \"empty\" | \"filledMonth\">;\nexport type TimeSegmentName = Exclude<keyof TimeSegmentLabels, \"empty\" | \"filledDayPeriod\">;\n\nconst DATE_SEGMENT_PARTS = new Set<DateSegmentName>([\"month\", \"day\", \"year\", \"era\"]);\nconst TIME_SEGMENT_PARTS = new Set<TimeSegmentName>([\"hour\", \"minute\", \"second\", \"dayPeriod\"]);\n\n/**\n * The six segments Reka reports as `aria-valuetext=\"Empty\"` when they hold\n * nothing — and, not by coincidence, the six that render as digits when they\n * hold something. `dayPeriod` and `era` are absent because Reka never writes\n * \"Empty\" on either: an unset `dayPeriod` reads `AM` and an unset `era` reads\n * the placeholder's own era, both of which are already the locale's words.\n */\nconst EMPTIABLE_SEGMENT_PARTS = new Set<string>([\n \"day\",\n \"month\",\n \"year\",\n \"hour\",\n \"minute\",\n \"second\",\n]);\n\n/**\n * The `aria-valuetext` override for one segment, as an object to `v-bind`\n * rather than a string to bind directly — and that is the whole point of it.\n *\n * Reka writes `aria-valuetext=\"Empty\"` on an unfilled segment and the number\n * on a filled one, and only the first is a hard-coded English literal: the\n * second is `${valueNow}`, and the month's `\"3 - March\"` takes its month name\n * from the field's own `locale`. So this replaces exactly the empty case and\n * leaves the rest alone. Binding `:aria-valuetext` directly could not do that\n * — Vue merges a fallthrough `undefined` over Reka's value and *removes* the\n * attribute, so a filled segment would lose the number it is there to read\n * out. An absent key merges as nothing at all, which is what `optional()`\n * exists for elsewhere and what returning `{}` does here.\n *\n * Emptiness is read off the digits in the segment's own displayed value, which\n * is sound in both directions for these six parts: every locale's placeholder\n * for them is letters (`mm`, `jj`, `aaaa`) and every value they can hold is\n * digits. The two parts where that would not hold are the two excluded above.\n */\nexport function emptySegmentValueText(\n part: string,\n value: string,\n empty: string,\n): { \"aria-valuetext\"?: string } {\n return EMPTIABLE_SEGMENT_PARTS.has(part) && !/\\d/.test(value) ? { \"aria-valuetext\": empty } : {};\n}\n\n/**\n * Whether a part named by Reka's `segments` slot is one this slice names.\n *\n * A guard rather than an index, because the slot also yields `literal` — the\n * slashes and colons between the segments, which Reka renders `aria-hidden`\n * and which must stay unnamed — and `timeZoneName`, which none of these five\n * controls can produce: their values parse through `parseDate`, `parseTime` and\n * `parseDateTime`, none of which yields a zoned value, and no prop on any of\n * them accepts a zone. Reka's `\"timezone, \"` is therefore unreachable from\n * here, and a key for it would be a key nothing could ever render.\n */\nexport function isDateSegmentPart(part: string): part is DateSegmentName {\n return DATE_SEGMENT_PARTS.has(part as DateSegmentName);\n}\n\n/** Whether a part named by Reka's `segments` slot belongs to the clock half. */\nexport function isTimeSegmentPart(part: string): part is TimeSegmentName {\n return TIME_SEGMENT_PARTS.has(part as TimeSegmentName);\n}\n\n/**\n * Everything the calendar popover says that is not a date: the panel's own\n * name, the button that opens it, and the two that page the months.\n *\n * `calendar` is Reka's `CalendarRoot`/`RangeCalendarRoot` `calendarLabel` prop,\n * whose default is the string `\"Event Date\"` — a name for somebody else's\n * application, published both as the grid container's `aria-label` and inside a\n * visually-hidden live region that a screen reader reads on every month change.\n * It is a documented prop rather than a hard-coded literal, so it is the one\n * name in this file that is set rather than overridden.\n *\n * `previousMonth` and `nextMonth` do replace literals: Reka writes\n * `\"Previous page\"` and `\"Next page\"` on those two buttons, which is both\n * English and wrong — what they move is a month.\n */\nexport interface CalendarPanelLabels {\n /** The calendar's own name, read before the month and year on entering it. */\n readonly calendar: string;\n /** The button in the field that opens the calendar popover. */\n readonly openCalendar: string;\n /** The button that pages the calendar back one month. */\n readonly previousMonth: string;\n /** The button that pages the calendar on one month. */\n readonly nextMonth: string;\n}\n\n/** Loom's English for the calendar popover. See `DATE_SEGMENT_LABELS`. */\nexport const CALENDAR_PANEL_LABELS: CalendarPanelLabels = {\n calendar: \"Calendar\",\n openCalendar: \"Open calendar\",\n previousMonth: \"Previous month\",\n nextMonth: \"Next month\",\n};\n\n/**\n * Which part of a chosen span one calendar cell plays, handed to the cell's\n * label rather than resolved into words by the control.\n *\n * Four sibling keys and a joiner would be four phrases a translator cannot\n * reorder around the date they qualify — and in several languages the qualifier\n * does not follow the date at all. One argument carrying the variant is what\n * keeps the whole cell name one sentence the host writes.\n */\nexport type RangeCellPart = \"start\" | \"end\" | \"both\" | \"within\";\n\n/**\n * The accessible name of one day in a range calendar, shared by both range\n * controls because they say it identically and from identical facts — a day\n * and its part in the span. `DateTimeRangePicker`'s cells carry no time: the\n * cell *is* a day, and choosing it moves only the day.\n *\n * The two controls' other strings are not shared, because they differ in words\n * and in facts. This one does neither, and a translator writing it twice would\n * be writing it twice for no reason.\n */\nexport interface RangeCellLabels {\n /**\n * One calendar cell's accessible name, which replaces the one Reka writes\n * rather than adding to it: a cell's part in the range has to arrive *with*\n * the date, and an element has no second slot for a name.\n *\n * `part` is `undefined` for a day with no part in the range at all.\n */\n readonly cell: LabelOf<{\n locale: string;\n date: DateValue;\n part: RangeCellPart | undefined;\n }>;\n}\n\n/**\n * Loom's English for a range calendar's cells. The three fills that carry the\n * first day, the last and the ones between are three shades of one colour,\n * which survives neither a colour deficiency nor forced-colors mode — naming\n * the part is what tells them apart, and it is what makes a one-day span say so\n * once rather than announce itself twice as two different things.\n */\nexport const RANGE_CELL_LABELS: RangeCellLabels = {\n cell: ({ locale, date, part }) => {\n const full = formatFullDay(locale, date);\n if (part === \"both\") return `${full}, the whole range, first and last day`;\n if (part === \"start\") return `${full}, first day of the range`;\n if (part === \"end\") return `${full}, last day of the range`;\n return part === \"within\" ? `${full}, within the range` : full;\n },\n};\n\n// One formatter per locale, kept, because a range calendar's cell label runs\n// forty-two to eighty-four times per render and `Intl.DateTimeFormat`'s\n// constructor is the expensive half of it. The map is bounded by the number of\n// locales an application actually renders, which is one in nearly every case.\nconst dayFormatters = new Map<string, Intl.DateTimeFormat>();\n\n// Same pattern, for the filled month segment's `aria-valuetext`. The default\n// `filledMonth` label calls this on every render, so caching the formatter\n// avoids the `Intl.DateTimeFormat` constructor cost each time.\nconst monthFormatters = new Map<string, Intl.DateTimeFormat>();\n\n/**\n * A month name in the control's locale, for use in `aria-valuetext`.\n *\n * Exported so a host building a partial vocabulary can call it from their own\n * `filledMonth` override rather than formatting from scratch — the same reason\n * `formatFullDay` is exported.\n */\nexport function monthName(locale: string, month: number): string {\n let formatter = monthFormatters.get(locale);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(locale, { month: \"long\" });\n monthFormatters.set(locale, formatter);\n }\n // `Date` months are 0-indexed; Loom months are 1-indexed (as in `DateValue.month`).\n return formatter.format(new Date(2026, month - 1, 1));\n}\n\n/**\n * A whole day written out — weekday, day, month and year — in the control's\n * locale, which is the half of a range cell's name that is not a qualifier.\n *\n * Exported because both range controls' English defaults need it and neither\n * should own it; a host replacing those defaults formats with whatever their\n * own application already uses and never calls this.\n */\nexport function formatFullDay(locale: string, date: DateValue): string {\n let formatter = dayFormatters.get(locale);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(locale, {\n weekday: \"long\",\n day: \"numeric\",\n month: \"long\",\n year: \"numeric\",\n });\n dayFormatters.set(locale, formatter);\n }\n return formatter.format(date.toDate(getLocalTimeZone()));\n}\n"],"mappings":";;;;;;;AAsGA,IAAa,sBAAyC;CACpD,OAAO;CACP,KAAK;CACL,MAAM;CACN,KAAK;CAKL,OAAO;CAKP,cAAc,EAAE,OAAO,aAAa;EAClC,MAAM,OAAO,UAAU,QAAQ,KAAK;EACpC,OAAO,GAAG,OAAO,KAAK,EAAE,KAAK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AK,eAAe,QAAQ,EAAE,OAAO,OAAO,CAAC;EAC7D,gBAAgB,IAAI,QAAQ,SAAS;CACvC;CAEA,OAAO,UAAU,OAAO,IAAI,KAAK,MAAM,QAAQ,GAAG,CAAC,CAAC;AACtD;;;;;;;;;AAUA,SAAgB,cAAc,QAAgB,MAAyB;CACrE,IAAI,YAAY,cAAc,IAAI,MAAM;CACxC,IAAI,CAAC,WAAW;EACd,YAAY,IAAI,KAAK,eAAe,QAAQ;GAC1C,SAAS;GACT,KAAK;GACL,OAAO;GACP,MAAM;EACR,CAAC;EACD,cAAc,IAAI,QAAQ,SAAS;CACrC;CACA,OAAO,UAAU,OAAO,KAAK,OAAO,0CAAiB,CAAC,CAAC;AACzD"}
|
|
1
|
+
{"version":3,"file":"date-labels.js","names":[],"sources":["../../../../packages/labels/src/date-labels.ts"],"sourcesContent":["import { getLocalTimeZone, type DateValue } from \"@internationalized/date\";\nimport type { LabelOf } from \"./labels\";\n\n/**\n * The four slices the five date and time controls share, and the one decision\n * behind putting them here rather than five times over.\n *\n * Every other component in the library declares its own bag beside its own\n * markup, because its vocabulary is its own. These five do not have five\n * vocabularies: `DatePicker`, `DateTimePicker`, `DateRangePicker` and\n * `DateTimeRangePicker` all say *Open calendar*, *Previous month* and *Next\n * month*, and all five name the parts of a segmented field with the same\n * words — the words are Reka UI's `useDateField` and `CalendarRoot` speaking,\n * one implementation underneath all five. Declared per component that would be\n * fifty-two keys with the same twelve strings written four times, and a\n * translator doing the same work four times to make one language complete.\n *\n * **Sliced by what a control actually says, not merged into one family bag.**\n * A `TimePicker` has no calendar and never renders a month or a year, so it\n * registers `timeSegments` alone: its documented vocabulary is four keys, and a\n * consumer importing only that control ships only those four strings. One\n * shared bag for the whole family would have made every one of the five carry\n * all twenty, and would have printed keys on `TimePicker`'s API page that it\n * has no element to put them on.\n *\n * What is deliberately *not* shared is the two range controls' half-group names\n * and status lines. They name the same concepts with different words (`Start\n * date` against `Start date and time`) and from different facts (a count of\n * whole days against a signed duration in minutes), so a shared key would have\n * to be a sentence that is never true of both. Their calendar cells' names are\n * shared, because those differ in neither.\n */\n\n/**\n * The names Reka UI's `useDateField` writes onto the day, month, year and era\n * segments — `\"day,\"`, `\"month, \"`, `\"year, \"`, `\"era\"`, each with the spacing\n * of a string it meant to concatenate.\n *\n * There is no prop for any of them. A binding on Loom's side reaches the\n * segment as a fallthrough attribute, which Vue merges onto the rendered vnode\n * *after* Reka's own render function produced it, and `mergeProps` is\n * last-write-wins for everything that is not `class`, `style` or `on*` — so\n * these replace Reka's rather than competing with it. Leave one unset and the\n * segment is not unnamed, it is named in English, which is the failure this\n * seam exists to close.\n *\n * Loom's defaults differ from Reka's by their capitalisation, which is what\n * lets a test assert *whose* string reached the DOM rather than merely what it\n * said.\n */\nexport interface DateSegmentLabels {\n /** The month segment of a date field. */\n readonly month: string;\n /** The day-of-month segment. */\n readonly day: string;\n /** The year segment. */\n readonly year: string;\n /**\n * The era segment, which most locales never render — `ja-JP-u-ca-japanese`\n * is the ordinary case that does.\n */\n readonly era: string;\n /**\n * What a segment with nothing in it yet reports as its value, replacing the\n * `aria-valuetext=\"Empty\"` Reka writes on an unfilled day, month or year.\n *\n * A segment shows the locale's own placeholder — `mm`, `jj`, `aaaa` — while\n * announcing this instead, so it is the one word standing between a fully\n * localised date field and a reader who is told \"Empty\" in English.\n *\n * Present on this slice *and* on `TimeSegmentLabels` rather than shared\n * between them, for the reason the slices exist at all: a `TimePicker`\n * registers no `dateSegments`, and a key it could only reach through the\n * date half would be a key it could not set.\n */\n readonly empty: string;\n /**\n * What a filled month segment announces as its value, replacing the\n * `aria-valuetext` Reka builds inside `useDateField`.\n *\n * Reka writes `\"5 - May\"` — the numeric month, a hard-coded `\" - \"`, and\n * the month name from `Intl.DateTimeFormat`. The name is locale-aware, but\n * the format is not: Japanese writes `\"5月\"`, Vietnamese `\"tháng 5\"`, and\n * neither separates the two parts with a hyphen. A `LabelOf` hands the\n * host the month number and the locale so they can compose the string their\n * language needs, using `Intl.DateTimeFormat` for the name and arranging the\n * parts in the right order.\n *\n * A `LabelOf` rather than a plain string, for the same reason\n * `RangeCellLabels.cell` is one: the month name depends on the locale, and\n * a string that did not receive the locale could not produce it. The host\n * decides the format — Loom's English default matches Reka's output so that\n * nothing changes for a consumer who does not override it.\n */\n readonly filledMonth: LabelOf<{ value: number; locale: string }>;\n}\n\n/**\n * Loom's English for the date segments, co-located so it tree-shakes with the\n * controls that use it, and exported so a host can build a partial vocabulary\n * against the real thing rather than a transcription of it.\n */\nexport const DATE_SEGMENT_LABELS: DateSegmentLabels = {\n month: \"Month\",\n day: \"Day\",\n year: \"Year\",\n era: \"Era\",\n // \"Not set\" rather than Reka's own \"Empty\", and the difference is load-bearing\n // in the same way the capitalisation of the names above is: it is what lets a\n // test assert whose string reached the DOM. It also reads better spoken — a\n // reader is being told this field has no value yet, not that it is blank.\n empty: \"Not set\",\n // Matches Reka's `\"5 - May\"` format for English. The month name comes from\n // `Intl.DateTimeFormat` via the cached `monthFormatters` map, which avoids\n // reconstructing the formatter on every render. A host overrides this to\n // change the format — Japanese `\"5月\"`, Vietnamese `\"tháng 5\"`, etc.\n filledMonth: ({ value, locale }) => {\n const name = monthName(locale, value);\n return `${String(value)} - ${name}`;\n },\n};\n\n/**\n * The same, for the clock half of a segmented field: Reka writes `\"hour, \"`,\n * `\"minute, \"`, `\"second, \"` and `\"AM/PM\"`, and offers a prop for none of them.\n *\n * `dayPeriod` is spelled `AM or PM` rather than `AM/PM` so that it reads as\n * words when it is spoken, and so the capitalisation trick above still works on\n * the one segment whose name Reka already capitalises.\n */\nexport interface TimeSegmentLabels {\n /** The hour segment. */\n readonly hour: string;\n /** The minute segment. */\n readonly minute: string;\n /** The seconds segment, which only a control at second granularity renders. */\n readonly second: string;\n /** The AM/PM segment, which only a 12-hour field renders. */\n readonly dayPeriod: string;\n /** What an hour, minute or second with nothing in it yet reports. See `DateSegmentLabels.empty`. */\n readonly empty: string;\n /**\n * What a filled day-period segment announces as its value, replacing the\n * `aria-valuetext` Reka writes inside `useDateField`.\n *\n * Reka writes `segmentValues.dayPeriod ?? \"AM\"` — always `\"AM\"` or `\"PM\"`,\n * produced by its own hour-cycle logic (`hour >= 12 ? \"PM\" : \"AM\"`) rather\n * than by `Intl.DateTimeFormat`. A host who has localised every other string\n * in the library still hears Latin-script \"AM\"/\"PM\" from this segment, which\n * is the defect this key exists to close.\n *\n * A `LabelOf` rather than a plain string, because the period name depends on\n * the locale: Arabic writes `\"ص\"`/`\"م\"`, Japanese `\"午前\"`/`\"午後\"`, and a\n * plain string could not carry that decision. Loom's English default returns\n * `dayPeriod` unchanged, which is correct for Latin-script locales.\n */\n readonly filledDayPeriod: LabelOf<{ dayPeriod: string }>;\n}\n\n/** Loom's English for the time segments. See `DATE_SEGMENT_LABELS`. */\nexport const TIME_SEGMENT_LABELS: TimeSegmentLabels = {\n hour: \"Hour\",\n minute: \"Minute\",\n second: \"Second\",\n dayPeriod: \"AM or PM\",\n empty: \"Not set\",\n // The identity function for English: Reka's `\"AM\"`/`\"PM\"` are correct for\n // Latin-script locales. A host localising to Arabic, Japanese, etc. overrides\n // this to return the locale's own period names.\n filledDayPeriod: ({ dayPeriod }) => dayPeriod,\n};\n\n/**\n * The parts each slice actually names — every key of its bag except `empty`,\n * which is a message *about* a segment rather than the name of one.\n *\n * Both the type and the set below are written out rather than derived from the\n * bags, which is what they were before `empty` joined them. Derived, the guards\n * would answer `true` for `\"empty\"` and narrow a part to a key that names no\n * element, and `segmentLabel` would happily return the empty message as a\n * segment's accessible name.\n */\nexport type DateSegmentName = Exclude<keyof DateSegmentLabels, \"empty\" | \"filledMonth\">;\nexport type TimeSegmentName = Exclude<keyof TimeSegmentLabels, \"empty\" | \"filledDayPeriod\">;\n\nconst DATE_SEGMENT_PARTS = new Set<DateSegmentName>([\"month\", \"day\", \"year\", \"era\"]);\nconst TIME_SEGMENT_PARTS = new Set<TimeSegmentName>([\"hour\", \"minute\", \"second\", \"dayPeriod\"]);\n\n/**\n * The six segments Reka reports as `aria-valuetext=\"Empty\"` when they hold\n * nothing — and, not by coincidence, the six that render as digits when they\n * hold something. `dayPeriod` and `era` are absent because Reka never writes\n * \"Empty\" on either: an unset `dayPeriod` reads `AM` and an unset `era` reads\n * the placeholder's own era, both of which are already the locale's words.\n */\nconst EMPTIABLE_SEGMENT_PARTS = new Set<string>([\n \"day\",\n \"month\",\n \"year\",\n \"hour\",\n \"minute\",\n \"second\",\n]);\n\n/**\n * The `aria-valuetext` override for one segment, as an object to `v-bind`\n * rather than a string to bind directly — and that is the whole point of it.\n *\n * Reka writes `aria-valuetext=\"Empty\"` on an unfilled segment and the number\n * on a filled one, and only the first is a hard-coded English literal: the\n * second is `${valueNow}`, and the month's `\"3 - March\"` takes its month name\n * from the field's own `locale`. So this replaces exactly the empty case and\n * leaves the rest alone. Binding `:aria-valuetext` directly could not do that\n * — Vue merges a fallthrough `undefined` over Reka's value and *removes* the\n * attribute, so a filled segment would lose the number it is there to read\n * out. An absent key merges as nothing at all, which is what `optional()`\n * exists for elsewhere and what returning `{}` does here.\n *\n * Emptiness is read off the digits in the segment's own displayed value, which\n * is sound in both directions for these six parts: every locale's placeholder\n * for them is letters (`mm`, `jj`, `aaaa`) and every value they can hold is\n * digits. The two parts where that would not hold are the two excluded above.\n */\nexport function emptySegmentValueText(\n part: string,\n value: string,\n empty: string,\n): { \"aria-valuetext\"?: string } {\n return EMPTIABLE_SEGMENT_PARTS.has(part) && !/\\d/.test(value) ? { \"aria-valuetext\": empty } : {};\n}\n\n/**\n * Whether a part named by Reka's `segments` slot is one this slice names.\n *\n * A guard rather than an index, because the slot also yields `literal` — the\n * slashes and colons between the segments, which Reka renders `aria-hidden`\n * and which must stay unnamed — and `timeZoneName`, which none of these five\n * controls can produce: their values parse through `parseDate`, `parseTime` and\n * `parseDateTime`, none of which yields a zoned value, and no prop on any of\n * them accepts a zone. Reka's `\"timezone, \"` is therefore unreachable from\n * here, and a key for it would be a key nothing could ever render.\n */\nexport function isDateSegmentPart(part: string): part is DateSegmentName {\n return DATE_SEGMENT_PARTS.has(part as DateSegmentName);\n}\n\n/** Whether a part named by Reka's `segments` slot belongs to the clock half. */\nexport function isTimeSegmentPart(part: string): part is TimeSegmentName {\n return TIME_SEGMENT_PARTS.has(part as TimeSegmentName);\n}\n\n/**\n * The one or both vocabularies a segmented field resolves its strings through,\n * as `useLabels` handed them to the control.\n *\n * A shape per control rather than one required parameter set, because this\n * serves three shapes of control at once: a date-only one resolves through\n * `date` alone, a time-only one through `time` alone, and the two datetime\n * controls through both. That spread is exactly why this pair lives here\n * rather than five times over — five hand-copied `segmentLabel`/\n * `segmentValueText` pairs had already drifted in their comments, and the only\n * step left was drifting in the emitted strings themselves, which are\n * assistive technology's entire view of these fields.\n */\nexport interface SegmentVocabularies {\n /** The date half's vocabulary, when the control renders date segments. */\n readonly date?: DateSegmentLabels | undefined;\n /** The clock half's vocabulary, when the control renders time segments. */\n readonly time?: TimeSegmentLabels | undefined;\n}\n\n/**\n * The accessible name of one segment, replacing the English name Reka writes\n * inside `useDateField`'s own render function — see `DATE_SEGMENT_LABELS`.\n *\n * The half that owns the part names it: a date part is answered by the date\n * vocabulary and a clock part by the time one, which is what lets a host\n * localising only `timeSegments` still reach the clock segments of a datetime\n * control. `undefined` for everything else — the `literal` separators, which\n * Reka renders `aria-hidden` and which must stay unnamed, and any part neither\n * vocabulary knows.\n */\nexport function segmentAriaLabel(\n vocabularies: SegmentVocabularies,\n part: string,\n): string | undefined {\n const { date, time } = vocabularies;\n if (date && isDateSegmentPart(part)) return date[part];\n return time && isTimeSegmentPart(part) ? time[part] : undefined;\n}\n\n/** What `segmentAriaValueText` resolves one segment's value announcement from. */\nexport interface SegmentAriaValueTextArgs extends SegmentVocabularies {\n /** The segment's part name, as Reka's `segments` slot yields it. */\n readonly part: string;\n /**\n * The segment's displayed value, whose emptiness decides whether the field's\n * own word replaces Reka's — read off digits by `emptySegmentValueText`.\n */\n readonly value: string;\n /**\n * The field's locale, composed into the filled month's value text. Every\n * other branch ignores it, but a control always has one to give.\n */\n readonly locale: string;\n /**\n * The numeric month of the model value the control parsed itself, and never\n * of `value`: the displayed text is locale-formatted and may carry no\n * parseable number, so the caller reads the month off what it parsed.\n * Absent while no full date is chosen, and unused by a time-only control.\n */\n readonly month?: number | undefined;\n}\n\n/**\n * The `aria-valuetext` override for one segment, as an object to `v-bind` —\n * the shape `emptySegmentValueText` returns and the reason is recorded there.\n *\n * This composes the branches the five segmented controls each used to carry by\n * hand, in the order they must apply: the empty case first, because it is the\n * only one replacing what Reka wrote; then the filled month, announced through\n * `filledMonth` so a host can compose `\"5 - May\"` the way their language\n * needs; then the filled day period through `filledDayPeriod`, for the same\n * reason. Anything else returns `{}`, which merges as nothing and leaves\n * Reka's own value text — a number — exactly as it wrote it.\n *\n * The empty message comes from whichever half owns the part, so a host\n * localising only `timeSegments` still reaches the clock segments of a\n * datetime control. The fallback to `\"\"` is unreachable for every real caller\n * — a control always resolves at least its own half — and exists to keep the\n * function total rather than to be exercised.\n */\nexport function segmentAriaValueText({\n date,\n time,\n part,\n value,\n locale,\n month,\n}: SegmentAriaValueTextArgs): { \"aria-valuetext\"?: string } {\n const owner = isTimeSegmentPart(part) ? (time ?? date) : (date ?? time);\n const empty = emptySegmentValueText(part, value, owner?.empty ?? \"\");\n if (empty[\"aria-valuetext\"]) return empty;\n if (date && part === \"month\" && month !== undefined) {\n return { \"aria-valuetext\": date.filledMonth({ value: month, locale }) };\n }\n if (time && part === \"dayPeriod\") {\n return { \"aria-valuetext\": time.filledDayPeriod({ dayPeriod: value }) };\n }\n return {};\n}\n\n/**\n * Everything the calendar popover says that is not a date: the panel's own\n * name, the button that opens it, and the two that page the months.\n *\n * `calendar` is Reka's `CalendarRoot`/`RangeCalendarRoot` `calendarLabel` prop,\n * whose default is the string `\"Event Date\"` — a name for somebody else's\n * application, published both as the grid container's `aria-label` and inside a\n * visually-hidden live region that a screen reader reads on every month change.\n * It is a documented prop rather than a hard-coded literal, so it is the one\n * name in this file that is set rather than overridden.\n *\n * `previousMonth` and `nextMonth` do replace literals: Reka writes\n * `\"Previous page\"` and `\"Next page\"` on those two buttons, which is both\n * English and wrong — what they move is a month.\n */\nexport interface CalendarPanelLabels {\n /** The calendar's own name, read before the month and year on entering it. */\n readonly calendar: string;\n /** The button in the field that opens the calendar popover. */\n readonly openCalendar: string;\n /** The button that pages the calendar back one month. */\n readonly previousMonth: string;\n /** The button that pages the calendar on one month. */\n readonly nextMonth: string;\n}\n\n/** Loom's English for the calendar popover. See `DATE_SEGMENT_LABELS`. */\nexport const CALENDAR_PANEL_LABELS: CalendarPanelLabels = {\n calendar: \"Calendar\",\n openCalendar: \"Open calendar\",\n previousMonth: \"Previous month\",\n nextMonth: \"Next month\",\n};\n\n/**\n * Which part of a chosen span one calendar cell plays, handed to the cell's\n * label rather than resolved into words by the control.\n *\n * Four sibling keys and a joiner would be four phrases a translator cannot\n * reorder around the date they qualify — and in several languages the qualifier\n * does not follow the date at all. One argument carrying the variant is what\n * keeps the whole cell name one sentence the host writes.\n */\nexport type RangeCellPart = \"start\" | \"end\" | \"both\" | \"within\";\n\n/**\n * The accessible name of one day in a range calendar, shared by both range\n * controls because they say it identically and from identical facts — a day\n * and its part in the span. `DateTimeRangePicker`'s cells carry no time: the\n * cell *is* a day, and choosing it moves only the day.\n *\n * The two controls' other strings are not shared, because they differ in words\n * and in facts. This one does neither, and a translator writing it twice would\n * be writing it twice for no reason.\n */\nexport interface RangeCellLabels {\n /**\n * One calendar cell's accessible name, which replaces the one Reka writes\n * rather than adding to it: a cell's part in the range has to arrive *with*\n * the date, and an element has no second slot for a name.\n *\n * `part` is `undefined` for a day with no part in the range at all.\n */\n readonly cell: LabelOf<{\n locale: string;\n date: DateValue;\n part: RangeCellPart | undefined;\n }>;\n}\n\n/**\n * Loom's English for a range calendar's cells. The three fills that carry the\n * first day, the last and the ones between are three shades of one colour,\n * which survives neither a colour deficiency nor forced-colors mode — naming\n * the part is what tells them apart, and it is what makes a one-day span say so\n * once rather than announce itself twice as two different things.\n */\nexport const RANGE_CELL_LABELS: RangeCellLabels = {\n cell: ({ locale, date, part }) => {\n const full = formatFullDay(locale, date);\n if (part === \"both\") return `${full}, the whole range, first and last day`;\n if (part === \"start\") return `${full}, first day of the range`;\n if (part === \"end\") return `${full}, last day of the range`;\n return part === \"within\" ? `${full}, within the range` : full;\n },\n};\n\n// One formatter per locale, kept, because a range calendar's cell label runs\n// forty-two to eighty-four times per render and `Intl.DateTimeFormat`'s\n// constructor is the expensive half of it. The map is bounded by the number of\n// locales an application actually renders, which is one in nearly every case.\nconst dayFormatters = new Map<string, Intl.DateTimeFormat>();\n\n// Same pattern, for the filled month segment's `aria-valuetext`. The default\n// `filledMonth` label calls this on every render, so caching the formatter\n// avoids the `Intl.DateTimeFormat` constructor cost each time.\nconst monthFormatters = new Map<string, Intl.DateTimeFormat>();\n\n/**\n * A month name in the control's locale, for use in `aria-valuetext`.\n *\n * A building block of the defaults below, not public surface — it stays off\n * the package barrel, because a host wording an override formats however\n * their application already does. Exported from the module so its own tests\n * can pin it directly.\n */\nexport function monthName(locale: string, month: number): string {\n let formatter = monthFormatters.get(locale);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(locale, { month: \"long\" });\n monthFormatters.set(locale, formatter);\n }\n // `Date` months are 0-indexed; Loom months are 1-indexed (as in `DateValue.month`).\n return formatter.format(new Date(2026, month - 1, 1));\n}\n\n/**\n * A whole day written out — weekday, day, month and year — in the control's\n * locale, which is the half of a range cell's name that is not a qualifier,\n * and the whole of a standalone calendar cell's name: a surface with no field\n * echoing the value has its cells carry the full date themselves.\n *\n * Both range controls' English defaults need it and neither should own it;\n * the Calendar reaches it through this module for the same reason, so one\n * formatter cache serves every grid in the library. A host replacing those\n * defaults formats with whatever their own application already uses and never\n * calls this. Like `monthName`, it stays off the public facade.\n */\nexport function formatFullDay(locale: string, date: DateValue): string {\n let formatter = dayFormatters.get(locale);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(locale, {\n weekday: \"long\",\n day: \"numeric\",\n month: \"long\",\n year: \"numeric\",\n });\n dayFormatters.set(locale, formatter);\n }\n return formatter.format(date.toDate(getLocalTimeZone()));\n}\n"],"mappings":";;;;;;;AAsGA,IAAa,sBAAyC;CACpD,OAAO;CACP,KAAK;CACL,MAAM;CACN,KAAK;CAKL,OAAO;CAKP,cAAc,EAAE,OAAO,aAAa;EAClC,MAAM,OAAO,UAAU,QAAQ,KAAK;EACpC,OAAO,GAAG,OAAO,KAAK,EAAE,KAAK;CAC/B;AACF;;AAwCA,IAAa,sBAAyC;CACpD,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,WAAW;CACX,OAAO;CAIP,kBAAkB,EAAE,gBAAgB;AACtC;AAeA,IAAM,qCAAqB,IAAI,IAAqB;CAAC;CAAS;CAAO;CAAQ;AAAK,CAAC;AACnF,IAAM,qCAAqB,IAAI,IAAqB;CAAC;CAAQ;CAAU;CAAU;AAAW,CAAC;;;;;;;;AAS7F,IAAM,0CAA0B,IAAI,IAAY;CAC9C;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;;;;;;;;;;;;;;;AAqBD,SAAgB,sBACd,MACA,OACA,OAC+B;CAC/B,OAAO,wBAAwB,IAAI,IAAI,KAAK,CAAC,KAAK,KAAK,KAAK,IAAI,EAAE,kBAAkB,MAAM,IAAI,CAAC;AACjG;;;;;;;;;;;;AAaA,SAAgB,kBAAkB,MAAuC;CACvE,OAAO,mBAAmB,IAAI,IAAuB;AACvD;;AAGA,SAAgB,kBAAkB,MAAuC;CACvE,OAAO,mBAAmB,IAAI,IAAuB;AACvD;;;;;;;;;;;;AAiCA,SAAgB,iBACd,cACA,MACoB;CACpB,MAAM,EAAE,MAAM,SAAS;CACvB,IAAI,QAAQ,kBAAkB,IAAI,GAAG,OAAO,KAAK;CACjD,OAAO,QAAQ,kBAAkB,IAAI,IAAI,KAAK,QAAQ,KAAA;AACxD;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,qBAAqB,EACnC,MACA,MACA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AAI,KAAK,eAAe,QAAQ;GAC1C,SAAS;GACT,KAAK;GACL,OAAO;GACP,MAAM;EACR,CAAC;EACD,cAAc,IAAI,QAAQ,SAAS;CACrC;CACA,OAAO,UAAU,OAAO,KAAK,OAAO,0CAAiB,CAAC,CAAC;AACzD"}
|
|
@@ -45,8 +45,8 @@ export interface FieldContext {
|
|
|
45
45
|
* and without a claim both inputs adopt the same generated id — a duplicate
|
|
46
46
|
* id, and a `<label for>` that resolves to whichever the browser reaches
|
|
47
47
|
* first. The `axe` gate cannot be the backstop: `duplicate-id-active` is
|
|
48
|
-
* tagged `wcag2a-obsolete`/`deprecated` in axe-core, not `wcag2a`, so it
|
|
49
|
-
*
|
|
48
|
+
* tagged `wcag2a-obsolete`/`deprecated` in axe-core, not `wcag2a`, so it is
|
|
49
|
+
* in neither runtime list and `e2e/accessibility.e2e.ts` never runs it.
|
|
50
50
|
*
|
|
51
51
|
* Reactive rather than a plain boolean because the claim can move: a `v-if`
|
|
52
52
|
* swapping the first control for the second must promote the second, or the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-context.js","names":[],"sources":["../../../../packages/labels/src/field-context.ts"],"sourcesContent":["import {\n computed,\n inject,\n onScopeDispose,\n provide,\n reactive,\n ref,\n watchEffect,\n type ComputedRef,\n type InjectionKey,\n} from \"vue\";\nimport { optional } from \"@ecoma-io/loom-core\";\n\n/**\n * What a form-row wrapper (Field, Fieldset) knows about the control inside it.\n *\n * A wrapper renders a `<label for>` and a hint-or-error line, and it is the\n * only thing in the tree that knows the id it pointed that label at, the id of\n * the message, and whether the row is mandatory or in error. None of that can\n * reach a slotted control through props — the wrapper never rendered it — so\n * before this existed the caller copied three attributes by hand at every call\n * site, and forgetting one was a silent accessibility defect.\n *\n * Every member is a `ComputedRef` rather than a value. A row's `error` arrives\n * and clears while the control stays mounted, so the context has to move with\n * it; and a per-key ref is what lets one wrapper inherit a single key from\n * another (Field reads `readonly` off a Fieldset above it) without a hidden\n * whole-object merge.\n *\n * On the booleans, `undefined` means \"this wrapper has no opinion\" and never\n * \"false\". That is the whole precedence story — see `useFieldControl` — and it\n * is the same distinction `./props.ts` exists to explain, arriving from the\n * other side: there, a key is dropped so a child sees an absence; here, an\n * absence is a value a wrapper is allowed to hold.\n */\nexport interface FieldContext {\n /** The id the primary control adopts, so the wrapper's `<label for>` names it. */\n readonly controlId: ComputedRef<string | undefined>;\n /** The id of the wrapper's `<label>`, for group controls to reference via `aria-labelledby`. */\n readonly labelledBy: ComputedRef<string | undefined>;\n /** The id of the hint-or-error line, and `undefined` while no message is rendered. */\n readonly describedBy: ComputedRef<string | undefined>;\n /** The form field name the control submits under. */\n readonly name: ComputedRef<string | undefined>;\n /** Whether the wrapper marks the row mandatory. Becomes `aria-required`. */\n readonly required: ComputedRef<boolean | undefined>;\n /** Whether the wrapper is showing an error, which is the same fact as the control being invalid. */\n readonly invalid: ComputedRef<boolean | undefined>;\n /** Whether the wrapper disables what is inside it. */\n readonly disabled: ComputedRef<boolean | undefined>;\n /** Whether the wrapper renders what is inside it read-only. */\n readonly readonly: ComputedRef<boolean | undefined>;\n /**\n * Claims the row's single control id, and reports whether this control won it.\n *\n * `<Field><TextField /><TextField /></Field>` is a shape somebody will write,\n * and without a claim both inputs adopt the same generated id — a duplicate\n * id, and a `<label for>` that resolves to whichever the browser reaches\n * first. The `axe` gate cannot be the backstop: `duplicate-id-active` is\n * tagged `wcag2a-obsolete`/`deprecated` in axe-core, not `wcag2a`, so it does\n * not match `WCAG_TAGS` and `e2e/accessibility.e2e.ts` never runs it.\n *\n * Reactive rather than a plain boolean because the claim can move: a `v-if`\n * swapping the first control for the second must promote the second, or the\n * label points at an id no longer in the document.\n */\n claimControlId(): ComputedRef<boolean>;\n}\n\n/**\n * What a wrapper hands `provideFieldContext`, as getters rather than values —\n * the wrapper writes plain expressions over its own props and this file does\n * the wrapping, so a wrapper never has to remember which of its answers are\n * derived.\n */\nexport interface FieldContextSource {\n controlId: () => string | undefined;\n labelledBy?: () => string | undefined;\n describedBy: () => string | undefined;\n name: () => string | undefined;\n required: () => boolean | undefined;\n invalid: () => boolean | undefined;\n disabled: () => boolean | undefined;\n readonly: () => boolean | undefined;\n}\n\n/**\n * The control's own side of the contract: what this control was told directly,\n * with `undefined` for everything the caller left unset.\n *\n * Each key is `?: T | undefined` rather than `?: T`. Under\n * `exactOptionalPropertyTypes` that is the form that accepts both an omitted\n * key and an explicit `undefined` — and an explicit `undefined` is exactly what\n * a control passes when its own prop is unset.\n */\nexport interface FieldControlProps {\n /** The caller's `id`, which reaches a bare control as a fallthrough attr rather than a prop. */\n readonly id?: string | undefined;\n /** The caller's `aria-describedby`, likewise a fallthrough attr. */\n readonly describedBy?: string | undefined;\n /** The caller's `aria-labelledby`, for group controls that name themselves rather than being named by `label for`. */\n readonly ariaLabelledby?: string | undefined;\n readonly name?: string | undefined;\n readonly required?: boolean | undefined;\n readonly invalid?: boolean | undefined;\n readonly disabled?: boolean | undefined;\n readonly readonly?: boolean | undefined;\n}\n\n/**\n * The resolved attributes, ready to spread onto whichever node carries the\n * control's ARIA.\n *\n * A key whose value resolved to `undefined` is **absent**, not present-and-\n * undefined — `optional()` drops it. That is what makes the spread purely\n * additive: `v-bind=\"{ ...rest, ...field.attrs }\"` can never blank out an\n * attribute the caller passed through fallthrough, so a control renders exactly\n * what it renders today whenever there is no wrapper above it.\n *\n * `aria-required` and `aria-invalid` are omitted rather than set to `\"false\"`.\n * Both are legal and both say nothing, and the absent attribute already means\n * the same thing — the house `x || undefined` idiom, moved one layer in.\n */\nexport interface FieldControlAttrs {\n readonly id?: string;\n readonly name?: string;\n readonly \"aria-describedby\"?: string;\n // Narrowed to the literal rather than `string`: Vue types `aria-invalid` on a\n // native element as `Booleanish | \"grammar\" | \"spelling\"`, so a widened\n // `string` here fails to spread onto the very `<input>` this exists for.\n readonly \"aria-required\"?: \"true\";\n readonly \"aria-invalid\"?: \"true\";\n}\n\n/**\n * What `useFieldControl` resolved, after the control's own props won.\n *\n * Returned `reactive` rather than as a bag of refs, which is the one place in\n * `src/lib/` that does so. A template unwraps only a *top-level* ref, and a\n * control needs four of these at once under names — `disabled`, `invalid`,\n * `readonly`, `required` — that each shadow a prop of the same name. `reactive`\n * gives `field.invalid` in both the script and the template, and the shadowing\n * question never arises. Destructuring it does lose reactivity; read through\n * `field.` and there is nothing to get wrong.\n */\nexport interface FieldControl {\n /** Spread onto the node that carries the control's ARIA, **after** the fallthrough attrs. */\n readonly attrs: FieldControlAttrs;\n readonly id: string | undefined;\n readonly labelledBy: string | undefined;\n readonly name: string | undefined;\n readonly disabled: boolean;\n readonly invalid: boolean;\n readonly readonly: boolean;\n readonly required: boolean;\n}\n\n/**\n * A `Symbol`, and not exported from `src/index.ts`: a consumer pinned to the\n * key is pinned to a shape that moves whenever a wrapper does. `useFieldControl`\n * is the supported way in.\n */\nconst FIELD_CONTEXT: InjectionKey<FieldContext> = Symbol(\"loom.field\");\n\n/**\n * The wrapper above this one, for a wrapper that composes over another.\n *\n * Only Field needs it, and only for `readonly`: Vue resolves `inject` to the\n * nearest provider **wholesale**, not per key, so a Field shadows the Fieldset\n * above it entirely. Any key both wrappers answer has to be merged by hand, and\n * reading the outer context here rather than merging inside\n * `provideFieldContext` keeps that decision visible in Field.vue, where the\n * reason for it lives.\n */\nexport function useOuterFieldContext(): FieldContext | undefined {\n return inject(FIELD_CONTEXT, undefined);\n}\n\n/** Called by a wrapper — Field and Fieldset — from its own `setup`. */\nexport function provideFieldContext(source: FieldContextSource): void {\n const claims = ref<symbol[]>([]);\n\n provide(FIELD_CONTEXT, {\n controlId: computed(source.controlId),\n labelledBy: computed(source.labelledBy ?? (() => undefined)),\n describedBy: computed(source.describedBy),\n name: computed(source.name),\n required: computed(source.required),\n invalid: computed(source.invalid),\n disabled: computed(source.disabled),\n readonly: computed(source.readonly),\n claimControlId() {\n const token = Symbol(\"loom.field.control\");\n claims.value = [...claims.value, token];\n // The claiming scope is the control's, not the wrapper's, so this fires\n // when that one control unmounts and the next in document order is\n // promoted.\n onScopeDispose(() => {\n claims.value = claims.value.filter((held) => held !== token);\n });\n return computed(() => claims.value[0] === token);\n },\n });\n}\n\n/**\n * Opt a control into the wrapper around it. One call, one spread — see\n * `TextField.vue`, which is the worked example the rest of the family copies.\n *\n * **The rule is `own ?? wrapper ?? false`.** `??` and not `||`, so an explicit\n * `false` on the control beats a `true` from the wrapper: one control inside a\n * row that is showing an error can declare itself individually fine, and one\n * inside a clean row can declare itself individually invalid.\n *\n * That rule is worth nothing unless \"unset\" and \"set to `false`\" are still\n * different values by the time they arrive here, and by default they are not:\n * Vue resolves an absent `Boolean` prop with no declared default to `false`, so\n * `props.invalid ?? field` would short-circuit forever and the context would be\n * inert while looking perfectly wired. **Every participating prop must be\n * declared `boolean | undefined` with an explicit `undefined` default** — the\n * `| undefined` is what `exactOptionalPropertyTypes` needs to let `withDefaults`\n * take that default at all, and the default is what beats the Boolean cast.\n *\n * With no wrapper above, every chain falls through to the control's own props\n * and the `?? false` at the end is the same `false` the control's `withDefaults`\n * used to supply. Nothing about a control standing alone changes.\n *\n * The argument is a **getter**, not a props object, for the reason\n * `./attrs.ts` takes `useAttrs()` rather than a snapshot: a control feeds this a\n * mix of props and fallthrough attrs and both have to stay live.\n */\nexport function useFieldControl(own: () => FieldControlProps): FieldControl {\n const field = inject(FIELD_CONTEXT, undefined);\n const holdsControlId = field?.claimControlId();\n\n const id = computed(\n () => own().id ?? (holdsControlId?.value === true ? field?.controlId.value : undefined),\n );\n const name = computed(() => own().name ?? field?.name.value);\n const labelledBy = computed(() => own().ariaLabelledby ?? field?.labelledBy.value);\n\n // The one attribute whose rule is merge rather than replace, because\n // `aria-describedby` is a token list: the row's message is additional to\n // whatever else the caller pointed at, not an alternative to it. Replacing\n // would silently drop the row's hint the moment a caller described their\n // control for some other reason — which is the defect this file exists to\n // remove, reintroduced from the other end. The control's own id reads first:\n // a control that has something to say about itself is saying the more\n // specific thing, and a screen reader reads the list in order.\n const describedBy = computed(() => {\n const ids = [own().describedBy, field?.describedBy.value].filter(\n (candidate): candidate is string => candidate !== undefined && candidate.length > 0,\n );\n return ids.length > 0 ? ids.join(\" \") : undefined;\n });\n\n const required = computed(() => own().required ?? field?.required.value ?? false);\n const invalid = computed(() => own().invalid ?? field?.invalid.value ?? false);\n const disabled = computed(() => own().disabled ?? field?.disabled.value ?? false);\n const readonly = computed(() => own().readonly ?? field?.readonly.value ?? false);\n\n // A development-mode safety net for the one context key a control can\n // deliberately decline. When a wrapper sets `readonly` but the control did\n // not pass that key in its `FieldControlProps`, the wrapper's instruction is\n // silently dropped — and without this warning the consumer has no signal\n // that it was. The `\"readonly\" in own()` check distinguishes \"I defer to the\n // wrapper\" (key present, value `undefined`) from \"I don't participate\" (key\n // absent), which is the same distinction `exactOptionalPropertyTypes` makes\n // at the type level.\n if (import.meta.env.DEV && field) {\n watchEffect(() => {\n if (field.readonly.value && !(\"readonly\" in own())) {\n console.warn(\"[Loom] readonly was set on the Field, but this control does not claim it.\");\n }\n });\n }\n\n const attrs = computed<FieldControlAttrs>(() =>\n optional({\n id: id.value,\n name: name.value,\n \"aria-describedby\": describedBy.value,\n \"aria-required\": required.value ? (\"true\" as const) : undefined,\n \"aria-invalid\": invalid.value ? (\"true\" as const) : undefined,\n }),\n );\n\n return reactive({ attrs, id, labelledBy, name, disabled, invalid, readonly, required });\n}\n"],"mappings":";;;;;;;;;AAkKA,IAAM,gBAA4C,OAAO,YAAY;;;;;;;;;;;AAYrE,SAAgB,uBAAiD;CAC/D,OAAO,OAAO,eAAe,KAAA,CAAS;AACxC;;AAGA,SAAgB,oBAAoB,QAAkC;CACpE,MAAM,SAAS,IAAc,CAAC,CAAC;CAE/B,QAAQ,eAAe;EACrB,WAAW,SAAS,OAAO,SAAS;EACpC,YAAY,SAAS,OAAO,qBAAqB,KAAA,EAAU;EAC3D,aAAa,SAAS,OAAO,WAAW;EACxC,MAAM,SAAS,OAAO,IAAI;EAC1B,UAAU,SAAS,OAAO,QAAQ;EAClC,SAAS,SAAS,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ACZ,SAAS;EACP,IAAI,GAAG;EACP,MAAM,KAAK;EACX,oBAAoB,YAAY;EAChC,iBAAiB,SAAS,QAAS,SAAmB,KAAA;EACtD,gBAAgB,QAAQ,QAAS,SAAmB,KAAA;CACtD,CAAC,CACH;CAEA,OAAO,SAAS;EAAE;EAAO;EAAI;EAAY;EAAM;EAAU;EAAS;EAAU;CAAS,CAAC;AACxF"}
|
|
1
|
+
{"version":3,"file":"field-context.js","names":[],"sources":["../../../../packages/labels/src/field-context.ts"],"sourcesContent":["import {\n computed,\n inject,\n onScopeDispose,\n provide,\n reactive,\n ref,\n watchEffect,\n type ComputedRef,\n type InjectionKey,\n} from \"vue\";\nimport { optional } from \"@ecoma-io/loom-core\";\n\n/**\n * What a form-row wrapper (Field, Fieldset) knows about the control inside it.\n *\n * A wrapper renders a `<label for>` and a hint-or-error line, and it is the\n * only thing in the tree that knows the id it pointed that label at, the id of\n * the message, and whether the row is mandatory or in error. None of that can\n * reach a slotted control through props — the wrapper never rendered it — so\n * before this existed the caller copied three attributes by hand at every call\n * site, and forgetting one was a silent accessibility defect.\n *\n * Every member is a `ComputedRef` rather than a value. A row's `error` arrives\n * and clears while the control stays mounted, so the context has to move with\n * it; and a per-key ref is what lets one wrapper inherit a single key from\n * another (Field reads `readonly` off a Fieldset above it) without a hidden\n * whole-object merge.\n *\n * On the booleans, `undefined` means \"this wrapper has no opinion\" and never\n * \"false\". That is the whole precedence story — see `useFieldControl` — and it\n * is the same distinction `./props.ts` exists to explain, arriving from the\n * other side: there, a key is dropped so a child sees an absence; here, an\n * absence is a value a wrapper is allowed to hold.\n */\nexport interface FieldContext {\n /** The id the primary control adopts, so the wrapper's `<label for>` names it. */\n readonly controlId: ComputedRef<string | undefined>;\n /** The id of the wrapper's `<label>`, for group controls to reference via `aria-labelledby`. */\n readonly labelledBy: ComputedRef<string | undefined>;\n /** The id of the hint-or-error line, and `undefined` while no message is rendered. */\n readonly describedBy: ComputedRef<string | undefined>;\n /** The form field name the control submits under. */\n readonly name: ComputedRef<string | undefined>;\n /** Whether the wrapper marks the row mandatory. Becomes `aria-required`. */\n readonly required: ComputedRef<boolean | undefined>;\n /** Whether the wrapper is showing an error, which is the same fact as the control being invalid. */\n readonly invalid: ComputedRef<boolean | undefined>;\n /** Whether the wrapper disables what is inside it. */\n readonly disabled: ComputedRef<boolean | undefined>;\n /** Whether the wrapper renders what is inside it read-only. */\n readonly readonly: ComputedRef<boolean | undefined>;\n /**\n * Claims the row's single control id, and reports whether this control won it.\n *\n * `<Field><TextField /><TextField /></Field>` is a shape somebody will write,\n * and without a claim both inputs adopt the same generated id — a duplicate\n * id, and a `<label for>` that resolves to whichever the browser reaches\n * first. The `axe` gate cannot be the backstop: `duplicate-id-active` is\n * tagged `wcag2a-obsolete`/`deprecated` in axe-core, not `wcag2a`, so it is\n * in neither runtime list and `e2e/accessibility.e2e.ts` never runs it.\n *\n * Reactive rather than a plain boolean because the claim can move: a `v-if`\n * swapping the first control for the second must promote the second, or the\n * label points at an id no longer in the document.\n */\n claimControlId(): ComputedRef<boolean>;\n}\n\n/**\n * What a wrapper hands `provideFieldContext`, as getters rather than values —\n * the wrapper writes plain expressions over its own props and this file does\n * the wrapping, so a wrapper never has to remember which of its answers are\n * derived.\n */\nexport interface FieldContextSource {\n controlId: () => string | undefined;\n labelledBy?: () => string | undefined;\n describedBy: () => string | undefined;\n name: () => string | undefined;\n required: () => boolean | undefined;\n invalid: () => boolean | undefined;\n disabled: () => boolean | undefined;\n readonly: () => boolean | undefined;\n}\n\n/**\n * The control's own side of the contract: what this control was told directly,\n * with `undefined` for everything the caller left unset.\n *\n * Each key is `?: T | undefined` rather than `?: T`. Under\n * `exactOptionalPropertyTypes` that is the form that accepts both an omitted\n * key and an explicit `undefined` — and an explicit `undefined` is exactly what\n * a control passes when its own prop is unset.\n */\nexport interface FieldControlProps {\n /** The caller's `id`, which reaches a bare control as a fallthrough attr rather than a prop. */\n readonly id?: string | undefined;\n /** The caller's `aria-describedby`, likewise a fallthrough attr. */\n readonly describedBy?: string | undefined;\n /** The caller's `aria-labelledby`, for group controls that name themselves rather than being named by `label for`. */\n readonly ariaLabelledby?: string | undefined;\n readonly name?: string | undefined;\n readonly required?: boolean | undefined;\n readonly invalid?: boolean | undefined;\n readonly disabled?: boolean | undefined;\n readonly readonly?: boolean | undefined;\n}\n\n/**\n * The resolved attributes, ready to spread onto whichever node carries the\n * control's ARIA.\n *\n * A key whose value resolved to `undefined` is **absent**, not present-and-\n * undefined — `optional()` drops it. That is what makes the spread purely\n * additive: `v-bind=\"{ ...rest, ...field.attrs }\"` can never blank out an\n * attribute the caller passed through fallthrough, so a control renders exactly\n * what it renders today whenever there is no wrapper above it.\n *\n * `aria-required` and `aria-invalid` are omitted rather than set to `\"false\"`.\n * Both are legal and both say nothing, and the absent attribute already means\n * the same thing — the house `x || undefined` idiom, moved one layer in.\n */\nexport interface FieldControlAttrs {\n readonly id?: string;\n readonly name?: string;\n readonly \"aria-describedby\"?: string;\n // Narrowed to the literal rather than `string`: Vue types `aria-invalid` on a\n // native element as `Booleanish | \"grammar\" | \"spelling\"`, so a widened\n // `string` here fails to spread onto the very `<input>` this exists for.\n readonly \"aria-required\"?: \"true\";\n readonly \"aria-invalid\"?: \"true\";\n}\n\n/**\n * What `useFieldControl` resolved, after the control's own props won.\n *\n * Returned `reactive` rather than as a bag of refs, which is the one place in\n * `src/lib/` that does so. A template unwraps only a *top-level* ref, and a\n * control needs four of these at once under names — `disabled`, `invalid`,\n * `readonly`, `required` — that each shadow a prop of the same name. `reactive`\n * gives `field.invalid` in both the script and the template, and the shadowing\n * question never arises. Destructuring it does lose reactivity; read through\n * `field.` and there is nothing to get wrong.\n */\nexport interface FieldControl {\n /** Spread onto the node that carries the control's ARIA, **after** the fallthrough attrs. */\n readonly attrs: FieldControlAttrs;\n readonly id: string | undefined;\n readonly labelledBy: string | undefined;\n readonly name: string | undefined;\n readonly disabled: boolean;\n readonly invalid: boolean;\n readonly readonly: boolean;\n readonly required: boolean;\n}\n\n/**\n * A `Symbol`, and not exported from `src/index.ts`: a consumer pinned to the\n * key is pinned to a shape that moves whenever a wrapper does. `useFieldControl`\n * is the supported way in.\n */\nconst FIELD_CONTEXT: InjectionKey<FieldContext> = Symbol(\"loom.field\");\n\n/**\n * The wrapper above this one, for a wrapper that composes over another.\n *\n * Only Field needs it, and only for `readonly`: Vue resolves `inject` to the\n * nearest provider **wholesale**, not per key, so a Field shadows the Fieldset\n * above it entirely. Any key both wrappers answer has to be merged by hand, and\n * reading the outer context here rather than merging inside\n * `provideFieldContext` keeps that decision visible in Field.vue, where the\n * reason for it lives.\n */\nexport function useOuterFieldContext(): FieldContext | undefined {\n return inject(FIELD_CONTEXT, undefined);\n}\n\n/** Called by a wrapper — Field and Fieldset — from its own `setup`. */\nexport function provideFieldContext(source: FieldContextSource): void {\n const claims = ref<symbol[]>([]);\n\n provide(FIELD_CONTEXT, {\n controlId: computed(source.controlId),\n labelledBy: computed(source.labelledBy ?? (() => undefined)),\n describedBy: computed(source.describedBy),\n name: computed(source.name),\n required: computed(source.required),\n invalid: computed(source.invalid),\n disabled: computed(source.disabled),\n readonly: computed(source.readonly),\n claimControlId() {\n const token = Symbol(\"loom.field.control\");\n claims.value = [...claims.value, token];\n // The claiming scope is the control's, not the wrapper's, so this fires\n // when that one control unmounts and the next in document order is\n // promoted.\n onScopeDispose(() => {\n claims.value = claims.value.filter((held) => held !== token);\n });\n return computed(() => claims.value[0] === token);\n },\n });\n}\n\n/**\n * Opt a control into the wrapper around it. One call, one spread — see\n * `TextField.vue`, which is the worked example the rest of the family copies.\n *\n * **The rule is `own ?? wrapper ?? false`.** `??` and not `||`, so an explicit\n * `false` on the control beats a `true` from the wrapper: one control inside a\n * row that is showing an error can declare itself individually fine, and one\n * inside a clean row can declare itself individually invalid.\n *\n * That rule is worth nothing unless \"unset\" and \"set to `false`\" are still\n * different values by the time they arrive here, and by default they are not:\n * Vue resolves an absent `Boolean` prop with no declared default to `false`, so\n * `props.invalid ?? field` would short-circuit forever and the context would be\n * inert while looking perfectly wired. **Every participating prop must be\n * declared `boolean | undefined` with an explicit `undefined` default** — the\n * `| undefined` is what `exactOptionalPropertyTypes` needs to let `withDefaults`\n * take that default at all, and the default is what beats the Boolean cast.\n *\n * With no wrapper above, every chain falls through to the control's own props\n * and the `?? false` at the end is the same `false` the control's `withDefaults`\n * used to supply. Nothing about a control standing alone changes.\n *\n * The argument is a **getter**, not a props object, for the reason\n * `./attrs.ts` takes `useAttrs()` rather than a snapshot: a control feeds this a\n * mix of props and fallthrough attrs and both have to stay live.\n */\nexport function useFieldControl(own: () => FieldControlProps): FieldControl {\n const field = inject(FIELD_CONTEXT, undefined);\n const holdsControlId = field?.claimControlId();\n\n const id = computed(\n () => own().id ?? (holdsControlId?.value === true ? field?.controlId.value : undefined),\n );\n const name = computed(() => own().name ?? field?.name.value);\n const labelledBy = computed(() => own().ariaLabelledby ?? field?.labelledBy.value);\n\n // The one attribute whose rule is merge rather than replace, because\n // `aria-describedby` is a token list: the row's message is additional to\n // whatever else the caller pointed at, not an alternative to it. Replacing\n // would silently drop the row's hint the moment a caller described their\n // control for some other reason — which is the defect this file exists to\n // remove, reintroduced from the other end. The control's own id reads first:\n // a control that has something to say about itself is saying the more\n // specific thing, and a screen reader reads the list in order.\n const describedBy = computed(() => {\n const ids = [own().describedBy, field?.describedBy.value].filter(\n (candidate): candidate is string => candidate !== undefined && candidate.length > 0,\n );\n return ids.length > 0 ? ids.join(\" \") : undefined;\n });\n\n const required = computed(() => own().required ?? field?.required.value ?? false);\n const invalid = computed(() => own().invalid ?? field?.invalid.value ?? false);\n const disabled = computed(() => own().disabled ?? field?.disabled.value ?? false);\n const readonly = computed(() => own().readonly ?? field?.readonly.value ?? false);\n\n // A development-mode safety net for the one context key a control can\n // deliberately decline. When a wrapper sets `readonly` but the control did\n // not pass that key in its `FieldControlProps`, the wrapper's instruction is\n // silently dropped — and without this warning the consumer has no signal\n // that it was. The `\"readonly\" in own()` check distinguishes \"I defer to the\n // wrapper\" (key present, value `undefined`) from \"I don't participate\" (key\n // absent), which is the same distinction `exactOptionalPropertyTypes` makes\n // at the type level.\n if (import.meta.env.DEV && field) {\n watchEffect(() => {\n if (field.readonly.value && !(\"readonly\" in own())) {\n console.warn(\"[Loom] readonly was set on the Field, but this control does not claim it.\");\n }\n });\n }\n\n const attrs = computed<FieldControlAttrs>(() =>\n optional({\n id: id.value,\n name: name.value,\n \"aria-describedby\": describedBy.value,\n \"aria-required\": required.value ? (\"true\" as const) : undefined,\n \"aria-invalid\": invalid.value ? (\"true\" as const) : undefined,\n }),\n );\n\n return reactive({ attrs, id, labelledBy, name, disabled, invalid, readonly, required });\n}\n"],"mappings":";;;;;;;;;AAkKA,IAAM,gBAA4C,OAAO,YAAY;;;;;;;;;;;AAYrE,SAAgB,uBAAiD;CAC/D,OAAO,OAAO,eAAe,KAAA,CAAS;AACxC;;AAGA,SAAgB,oBAAoB,QAAkC;CACpE,MAAM,SAAS,IAAc,CAAC,CAAC;CAE/B,QAAQ,eAAe;EACrB,WAAW,SAAS,OAAO,SAAS;EACpC,YAAY,SAAS,OAAO,qBAAqB,KAAA,EAAU;EAC3D,aAAa,SAAS,OAAO,WAAW;EACxC,MAAM,SAAS,OAAO,IAAI;EAC1B,UAAU,SAAS,OAAO,QAAQ;EAClC,SAAS,SAAS,OAAO,OAAO;EAChC,UAAU,SAAS,OAAO,QAAQ;EAClC,UAAU,SAAS,OAAO,QAAQ;EAClC,iBAAiB;GACf,MAAM,QAAQ,OAAO,oBAAoB;GACzC,OAAO,QAAQ,CAAC,GAAG,OAAO,OAAO,KAAK;GAItC,qBAAqB;IACnB,OAAO,QAAQ,OAAO,MAAM,QAAQ,SAAS,SAAS,KAAK;GAC7D,CAAC;GACD,OAAO,eAAe,OAAO,MAAM,OAAO,KAAK;EACjD;CACF,CAAC;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAgB,gBAAgB,KAA4C;CAC1E,MAAM,QAAQ,OAAO,eAAe,KAAA,CAAS;CAC7C,MAAM,iBAAiB,OAAO,eAAe;CAE7C,MAAM,KAAK,eACH,IAAI,CAAC,CAAC,OAAO,gBAAgB,UAAU,OAAO,OAAO,UAAU,QAAQ,KAAA,EAC/E;CACA,MAAM,OAAO,eAAe,IAAI,CAAC,CAAC,QAAQ,OAAO,KAAK,KAAK;CAC3D,MAAM,aAAa,eAAe,IAAI,CAAC,CAAC,kBAAkB,OAAO,WAAW,KAAK;CAUjF,MAAM,cAAc,eAAe;EACjC,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC,aAAa,OAAO,YAAY,KAAK,CAAC,CAAC,QACvD,cAAmC,cAAc,KAAA,KAAa,UAAU,SAAS,CACpF;EACA,OAAO,IAAI,SAAS,IAAI,IAAI,KAAK,GAAG,IAAI,KAAA;CAC1C,CAAC;CAED,MAAM,WAAW,eAAe,IAAI,CAAC,CAAC,YAAY,OAAO,SAAS,SAAS,KAAK;CAChF,MAAM,UAAU,eAAe,IAAI,CAAC,CAAC,WAAW,OAAO,QAAQ,SAAS,KAAK;CAC7E,MAAM,WAAW,eAAe,IAAI,CAAC,CAAC,YAAY,OAAO,SAAS,SAAS,KAAK;CAChF,MAAM,WAAW,eAAe,IAAI,CAAC,CAAC,YAAY,OAAO,SAAS,SAAS,KAAK;CAkBhF,MAAM,QAAQ,eACZ,SAAS;EACP,IAAI,GAAG;EACP,MAAM,KAAK;EACX,oBAAoB,YAAY;EAChC,iBAAiB,SAAS,QAAS,SAAmB,KAAA;EACtD,gBAAgB,QAAQ,QAAS,SAAmB,KAAA;CACtD,CAAC,CACH;CAEA,OAAO,SAAS;EAAE;EAAO;EAAI;EAAY;EAAM;EAAU;EAAS;EAAU;CAAS,CAAC;AACxF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { provideLoomLabels, useLabels } from "./labels";
|
|
2
2
|
export type { LabelOf, LabelOverrides, LoomLabelOverrides } from "./labels";
|
|
3
3
|
export type { LoomLabels } from "./label-registry";
|
|
4
|
-
export type { AlertDialogLabels, AvatarGroupLabels, ColorPickerLabels, ComboboxLabels, DateRangeLabels, DateTimeRangeLabels, DialogLabels, DrawerLabels, EditableLabels, FileUploadLabels, FileUploadRejectReason, FileUploadRejection, IndicatorLabels, NumberFieldLabels, OtpInputLabels, OtpInputType, PaginationLabels, ProgressLabels, RadialProgressLabels, RatingLabels, StepperLabels, TagsInputLabels, TagsInputRejectReason, TagsInputRejection, TextFieldLabels, TextareaLabels, ToastLabels, WindowControlsLabels, } from "./component-shapes";
|
|
5
|
-
export { CALENDAR_PANEL_LABELS, DATE_SEGMENT_LABELS, RANGE_CELL_LABELS, TIME_SEGMENT_LABELS, emptySegmentValueText, formatFullDay, isDateSegmentPart, isTimeSegmentPart,
|
|
6
|
-
export type { CalendarPanelLabels, DateSegmentLabels, DateSegmentName, RangeCellLabels, RangeCellPart, TimeSegmentLabels, TimeSegmentName, } from "./date-labels";
|
|
4
|
+
export type { AlertLabels, AlertDialogLabels, AvatarGroupLabels, BreadcrumbLabels, CalendarLabels, CarouselLabels, CopyButtonLabels, ColorPickerLabels, ComboboxLabels, CommandLabels, DataGridLabels, DateRangeLabels, DateTimeRangeLabels, DialogLabels, DrawerLabels, EditableLabels, ErrorSummaryLabels, FileUploadLabels, FileUploadRejectReason, FileUploadRejection, IndicatorLabels, MeterLabels, NumberFieldLabels, OtpInputLabels, OtpInputType, PaginationLabels, ProgressLabels, RadialProgressLabels, RatingLabels, ScrollReelLabels, SkipLinkLabels, TableLabels, TimelineLabels, StepperLabels, TagsInputLabels, TagsInputRejectReason, TagsInputRejection, TextFieldLabels, TextareaLabels, ToastLabels, TreeViewLabels, WindowControlsLabels, } from "./component-shapes";
|
|
5
|
+
export { CALENDAR_PANEL_LABELS, DATE_SEGMENT_LABELS, RANGE_CELL_LABELS, TIME_SEGMENT_LABELS, emptySegmentValueText, formatFullDay, isDateSegmentPart, isTimeSegmentPart, segmentAriaLabel, segmentAriaValueText, } from "./date-labels";
|
|
6
|
+
export type { CalendarPanelLabels, DateSegmentLabels, DateSegmentName, RangeCellLabels, RangeCellPart, SegmentAriaValueTextArgs, SegmentVocabularies, TimeSegmentLabels, TimeSegmentName, } from "./date-labels";
|
|
7
7
|
export { COUNT_LABELS, warningWindow } from "./count-labels";
|
|
8
8
|
export type { CountBand, CountLabels } from "./count-labels";
|
|
9
9
|
export { provideFieldContext, useFieldControl, useOuterFieldContext } from "./field-context";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/labels/src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACxD,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG5E,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAInD,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,WAAW,EACX,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/labels/src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACxD,YAAY,EAAE,OA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BAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { provideLoomLabels, useLabels } from "./labels.js";
|
|
2
|
-
import { CALENDAR_PANEL_LABELS, DATE_SEGMENT_LABELS, RANGE_CELL_LABELS, TIME_SEGMENT_LABELS,
|
|
2
|
+
import { CALENDAR_PANEL_LABELS, DATE_SEGMENT_LABELS, RANGE_CELL_LABELS, TIME_SEGMENT_LABELS, formatFullDay, segmentAriaLabel, segmentAriaValueText } from "./date-labels.js";
|
|
3
3
|
import { COUNT_LABELS, warningWindow } from "./count-labels.js";
|
|
4
4
|
import { provideFieldContext, useFieldControl, useOuterFieldContext } from "./field-context.js";
|
|
5
5
|
import { useAncestorDisabled } from "./ancestor-disabled.js";
|
|
6
|
-
export { CALENDAR_PANEL_LABELS, COUNT_LABELS, DATE_SEGMENT_LABELS, RANGE_CELL_LABELS, TIME_SEGMENT_LABELS,
|
|
6
|
+
export { CALENDAR_PANEL_LABELS, COUNT_LABELS, DATE_SEGMENT_LABELS, RANGE_CELL_LABELS, TIME_SEGMENT_LABELS, formatFullDay, provideFieldContext, provideLoomLabels, segmentAriaLabel, segmentAriaValueText, useAncestorDisabled, useFieldControl, useLabels, useOuterFieldContext, warningWindow };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CalendarPanelLabels, DateSegmentLabels, RangeCellLabels, TimeSegmentLabels } from "./date-labels";
|
|
2
|
-
import type { AlertDialogLabels, AvatarGroupLabels, ColorPickerLabels, ComboboxLabels, DateRangeLabels, DateTimeRangeLabels, DialogLabels, DrawerLabels, EditableLabels, FileUploadLabels, IndicatorLabels, NumberFieldLabels, OtpInputLabels, PaginationLabels, ProgressLabels, RadialProgressLabels, RatingLabels, StepperLabels, TagsInputLabels, TextFieldLabels, TextareaLabels, ToastLabels, WindowControlsLabels } from "./component-shapes";
|
|
2
|
+
import type { AlertLabels, CalendarLabels, CarouselLabels, CopyButtonLabels, TableLabels, TimelineLabels, AlertDialogLabels, AvatarGroupLabels, BreadcrumbLabels, ColorPickerLabels, ComboboxLabels, CommandLabels, DataGridLabels, DateRangeLabels, DateTimeRangeLabels, DialogLabels, DrawerLabels, ErrorSummaryLabels, EditableLabels, FileUploadLabels, IndicatorLabels, MeterLabels, NumberFieldLabels, OtpInputLabels, PaginationLabels, ProgressLabels, RadialProgressLabels, RatingLabels, ScrollReelLabels, SkipLinkLabels, StepperLabels, TagsInputLabels, TextFieldLabels, TextareaLabels, ToastLabels, TreeViewLabels, WindowControlsLabels } from "./component-shapes";
|
|
3
3
|
/**
|
|
4
4
|
* Every slot a host can localise, and nothing else. One line per component that
|
|
5
5
|
* speaks; the keys themselves live with the component that says them.
|
|
@@ -24,21 +24,33 @@ import type { AlertDialogLabels, AvatarGroupLabels, ColorPickerLabels, ComboboxL
|
|
|
24
24
|
* a compile error at that component's own `useLabels` call, not here.
|
|
25
25
|
*/
|
|
26
26
|
export interface LoomLabels {
|
|
27
|
+
readonly alert: AlertLabels;
|
|
28
|
+
readonly table: TableLabels;
|
|
29
|
+
readonly dataGrid: DataGridLabels;
|
|
30
|
+
readonly timeline: TimelineLabels;
|
|
31
|
+
readonly carousel: CarouselLabels;
|
|
27
32
|
readonly pagination: PaginationLabels;
|
|
28
33
|
readonly windowControls: WindowControlsLabels;
|
|
34
|
+
readonly breadcrumb: BreadcrumbLabels;
|
|
35
|
+
readonly scrollReel: ScrollReelLabels;
|
|
36
|
+
readonly skipLink: SkipLinkLabels;
|
|
37
|
+
readonly copyButton: CopyButtonLabels;
|
|
29
38
|
readonly dateSegments: DateSegmentLabels;
|
|
30
39
|
readonly timeSegments: TimeSegmentLabels;
|
|
31
40
|
readonly calendarPanel: CalendarPanelLabels;
|
|
32
41
|
readonly rangeCell: RangeCellLabels;
|
|
33
42
|
readonly dateRange: DateRangeLabels;
|
|
34
43
|
readonly dateTimeRange: DateTimeRangeLabels;
|
|
44
|
+
readonly calendar: CalendarLabels;
|
|
35
45
|
readonly numberField: NumberFieldLabels;
|
|
36
46
|
readonly combobox: ComboboxLabels;
|
|
47
|
+
readonly command: CommandLabels;
|
|
37
48
|
readonly otpInput: OtpInputLabels;
|
|
38
49
|
readonly fileUpload: FileUploadLabels;
|
|
39
50
|
readonly rating: RatingLabels;
|
|
40
51
|
readonly tagsInput: TagsInputLabels;
|
|
41
52
|
readonly editable: EditableLabels;
|
|
53
|
+
readonly errorSummary: ErrorSummaryLabels;
|
|
42
54
|
readonly textField: TextFieldLabels;
|
|
43
55
|
readonly textarea: TextareaLabels;
|
|
44
56
|
readonly dialog: DialogLabels;
|
|
@@ -50,6 +62,8 @@ export interface LoomLabels {
|
|
|
50
62
|
readonly avatarGroup: AvatarGroupLabels;
|
|
51
63
|
readonly progress: ProgressLabels;
|
|
52
64
|
readonly radialProgress: RadialProgressLabels;
|
|
65
|
+
readonly meter: MeterLabels;
|
|
53
66
|
readonly colorPicker: ColorPickerLabels;
|
|
67
|
+
readonly treeView: TreeViewLabels;
|
|
54
68
|
}
|
|
55
69
|
//# sourceMappingURL=label-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label-registry.d.ts","sourceRoot":"","sources":["../../../../packages/labels/src/label-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,eAAe,EACf,cAAc,EACd,WAAW,EACX,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"label-registry.d.ts","sourceRoot":"","sources":["../../../../packages/labels/src/label-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,eAAe,EACf,eAAe,EACf,cAAc,EACd,WAAW,EACX,cAAc,EACd,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ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,EAAE,WAAW,CAAC;IAM5B,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IAIxC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IAGxC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;CACnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dashboard.js","names":[],"sources":["../../../../../packages/layouts/dashboard/src/Dashboard.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Dashboard — a dashboard shell: optional sidebar + auto-reflowing tile grid\n * for panels, with an optional aside for supplementary metrics on ultrawide\n * viewports.\n *\n * The layout composes three composition patterns into a single responsive\n * shell. The innermost is the auto-fit grid from DashboardGrid/Grid: the tile\n * column count derives from the container's own width, so the same grid\n * reflows inside a sidebar-narrowed workspace and full-bleed on an ultra-wide\n * monitor, with zero Tailwind breakpoints authored here or at the call site.\n *\n * The sidebar and aside use the Every Layout \"Sidebar\" flex-wrap technique:\n * each panel gets a fixed flex-basis and the grid area gets `flex-grow: 999`,\n * so when the container cannot fit the content's minimum,
|
|
1
|
+
{"version":3,"file":"Dashboard.js","names":[],"sources":["../../../../../packages/layouts/dashboard/src/Dashboard.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Dashboard — a dashboard shell: optional sidebar + auto-reflowing tile grid\n * for panels, with an optional aside for supplementary metrics on ultrawide\n * viewports.\n *\n * The layout composes three composition patterns into a single responsive\n * shell. The innermost is the auto-fit grid from DashboardGrid/Grid: the tile\n * column count derives from the container's own width, so the same grid\n * reflows inside a sidebar-narrowed workspace and full-bleed on an ultra-wide\n * monitor, with zero Tailwind breakpoints authored here or at the call site.\n *\n * The sidebar and aside use the Every Layout \"Sidebar\" flex-wrap technique:\n * each panel gets a fixed flex-basis and the grid area gets `flex-grow: 999`,\n * so when the container cannot fit the content's minimum, each panel takes\n * its own line at its declared width — the sidebar stacks above the grid, and\n * the aside below it. No media query, no JavaScript — the layout derives its\n * own breakpoints from the container's width.\n *\n * The `#aside` slot is gated behind a `2xl` breakpoint because supplementary\n * metrics are a luxury that only wide desktops can afford: the aside is hidden\n * below that width and the grid takes the full width, preventing a cramped\n * two-panel layout where neither panel has room to breathe.\n *\n * The header slot is full-width, above the sidebar+grid row, so a top\n * navigation bar or title row never competes for horizontal space with the\n * sidebar.\n */\nexport type DashboardMinTileWidth = string;\n\nconst gapClass: Record<string, string> = {\n sm: \"gap-2 sm:gap-3\",\n md: \"gap-3 sm:gap-4\",\n lg: \"gap-4 sm:gap-6\",\n} as const;\n\nexport { gapClass };\n</script>\n\n<script setup lang=\"ts\">\nimport { cn } from \"@ecoma-io/loom-core\";\n\nwithDefaults(\n defineProps<{\n /** Narrowest a tile may get before the grid drops to fewer columns. */\n minTileWidth?: DashboardMinTileWidth;\n /** Grid gap step. Tightens one notch below sm. */\n gap?: \"sm\" | \"md\" | \"lg\";\n }>(),\n { minTileWidth: \"16rem\", gap: \"md\" },\n);\n</script>\n\n<template>\n <div :class=\"cn('min-h-dvh flex flex-col')\">\n <!--\n The header is full-width and above the sidebar+grid row, so a\n navigation bar or title row never competes for horizontal space.\n -->\n <header v-if=\"$slots.header\">\n <slot name=\"header\" />\n </header>\n\n <!--\n The sidebar+grid row uses flex-wrap. The sidebar gets a fixed\n flex-basis (~16rem) and the grid area gets `flex-grow: 999`, so\n when the container is too narrow each panel takes its own line —\n the sidebar keeps its declared width on the line above the grid.\n No media query; the layout derives its own breakpoint from the\n container's width.\n -->\n <div\n :style=\"{ flexWrap: 'wrap' }\"\n :class=\"cn('flex flex-1', $slots.sidebar ? 'flex-row' : undefined)\"\n >\n <!--\n The sidebar panel. Fixed-basis, no growth — it recedes into the\n sunken elevation layer when present, matching the AppShell pattern.\n -->\n <aside\n v-if=\"$slots.sidebar\"\n :style=\"{\n flexBasis: '16rem',\n flexGrow: 0,\n flexShrink: 1,\n }\"\n :class=\"cn('bg-sunken w-full')\"\n >\n <slot name=\"sidebar\" />\n </aside>\n\n <!--\n The main area: the auto-fit tile grid + an optional aside for\n supplementary metrics on ultrawide viewports.\n\n `flex-grow: 999` ensures this area takes all remaining space\n when the container is wide enough. Its `min-width: 50%` triggers\n wrapping below tablet-like widths, making the sidebar stack above.\n\n Gutters widen at wider breakpoints so ultrawide viewports add\n whitespace rails rather than stretching lines.\n -->\n <div\n :style=\"{\n flexBasis: 0,\n flexGrow: 999,\n flexShrink: 1,\n minWidth: '50%',\n }\"\n :class=\"cn('flex min-w-0 flex-col')\"\n >\n <div\n :class=\"\n cn(\n 'flex-1 px-4 sm:px-6 3xl:px-8',\n $slots.aside ? 'flex flex-row 2xl:flex-row max-2xl:flex-col' : undefined,\n )\n \"\n :style=\"$slots.aside ? { flexWrap: 'wrap' } : undefined\"\n >\n <!--\n The tile grid. `auto-fit` + `minmax` recomputes the column\n count from the container's own width — it reflows inside a\n sidebar-narrowed workspace and full-bleed on an ultra-wide\n monitor, with zero Tailwind breakpoints authored here. The\n `minmax` lower bound is wrapped in `min(100%, …)` so a tile\n never forces horizontal overflow on a container narrower than\n `minTileWidth` itself.\n -->\n <div\n :class=\"\n cn('grid', gapClass[gap], $slots.aside ? 'flex-grow-[999] flex-shrink-1' : undefined)\n \"\n :style=\"{\n gridTemplateColumns: `repeat(auto-fit, minmax(min(100%, ${minTileWidth}), 1fr))`,\n ...($slots.aside ? { flexBasis: 0, minWidth: '60%' } : {}),\n }\"\n >\n <slot />\n </div>\n\n <!--\n The aside slot: supplementary metrics/info panels visible only\n on wide desktops (from `2xl` breakpoint). Uses the same\n flex-wrap Sidebar pattern: the aside gets a fixed basis and\n the grid area grows to fill the remaining space. Below `2xl`,\n the aside is hidden entirely — metrics are a luxury that only\n wide desktops can afford.\n -->\n <aside\n v-if=\"$slots.aside\"\n :style=\"{\n flexBasis: '14rem',\n flexGrow: 0,\n flexShrink: 1,\n }\"\n :class=\"cn('hidden w-full 2xl:block')\"\n >\n <slot name=\"aside\" />\n </aside>\n </div>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
*
|
|
12
12
|
* The sidebar and aside use the Every Layout "Sidebar" flex-wrap technique:
|
|
13
13
|
* each panel gets a fixed flex-basis and the grid area gets `flex-grow: 999`,
|
|
14
|
-
* so when the container cannot fit the content's minimum,
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* breakpoints from the container's width.
|
|
14
|
+
* so when the container cannot fit the content's minimum, each panel takes
|
|
15
|
+
* its own line at its declared width — the sidebar stacks above the grid, and
|
|
16
|
+
* the aside below it. No media query, no JavaScript — the layout derives its
|
|
17
|
+
* own breakpoints from the container's width.
|
|
18
18
|
*
|
|
19
19
|
* The `#aside` slot is gated behind a `2xl` breakpoint because supplementary
|
|
20
20
|
* metrics are a luxury that only wide desktops can afford: the aside is hidden
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dashboard.vue.d.ts","sourceRoot":"","sources":["../../../../../packages/layouts/dashboard/src/Dashboard.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dashboard.vue.d.ts","sourceRoot":"","sources":["../../../../../packages/layouts/dashboard/src/Dashboard.vue"],"names":[],"mappings":"AA2KA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C,QAAA,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAI3B,CAAC;AAEX,OAAO,EAAE,QAAQ,EAAE,CAAC;wBACC,OAAO,YAAY;AAAxC,wBAAyC;AACzC,QAAA,MAAM,YAAY;IAEd,uEAAuE;mBACxD,qBAAqB;IACpC,kDAAkD;UAC5C,IAAI,GAAG,IAAI,GAAG,IAAI;;IAHxB,uEAAuE;mBACxD,qBAAqB;IACpC,kDAAkD;UAC5C,IAAI,GAAG,IAAI,GAAG,IAAI;;SAAlB,IAAI,GAAG,IAAI,GAAG,IAAI;kBAFT,qBAAqB;;aAiG3B,CAAC,KAAK,IAAgB,KAAK,GAAG;;cAC7B,CAAC,KAAK,IAAgB,KAAK,GAAG;;cAC9B,CAAC,KAAK,IAAgB,KAAK,GAAG;;YAChC,CAAC,KAAK,IAAgB,KAAK,GAAG;EAUtC,CAAC;AAWL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|