@ecoma-io/loom 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -57
- package/dist/blocks/AppHeader/AppHeader.js.map +1 -1
- package/dist/blocks/AppHeader/AppHeader.vue.d.ts +5 -6
- package/dist/blocks/AppHeader/AppHeader.vue.d.ts.map +1 -1
- package/dist/blocks/AppHeader/AppHeader.vue_vue_type_script_setup_true_lang.js +6 -7
- package/dist/blocks/AppHeader/AppHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/blocks/DashboardGrid/DashboardGrid.vue.d.ts +1 -1
- package/dist/blocks/DashboardGrid/DashboardGrid.vue.d.ts.map +1 -1
- package/dist/blocks/DesktopAppShell/DesktopAppShell.js +7 -0
- package/dist/blocks/DesktopAppShell/DesktopAppShell.js.map +1 -0
- package/dist/blocks/DesktopAppShell/DesktopAppShell.vue.d.ts +102 -0
- package/dist/blocks/DesktopAppShell/DesktopAppShell.vue.d.ts.map +1 -0
- package/dist/blocks/DesktopAppShell/DesktopAppShell.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/blocks/DesktopAppShell/DesktopAppShell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/blocks/ErrorState/ErrorState.js +7 -0
- package/dist/blocks/ErrorState/ErrorState.js.map +1 -0
- package/dist/blocks/ErrorState/ErrorState.vue.d.ts +44 -0
- package/dist/blocks/ErrorState/ErrorState.vue.d.ts.map +1 -0
- package/dist/blocks/ErrorState/ErrorState.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/blocks/ErrorState/ErrorState.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/blocks/FormActions/FormActions.js +7 -0
- package/dist/blocks/FormActions/FormActions.js.map +1 -0
- package/dist/blocks/FormActions/FormActions.vue.d.ts +51 -0
- package/dist/blocks/FormActions/FormActions.vue.d.ts.map +1 -0
- package/dist/blocks/FormActions/FormActions.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/blocks/FormActions/FormActions.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/blocks/FormSection/FormSection.js +7 -0
- package/dist/blocks/FormSection/FormSection.js.map +1 -0
- package/dist/blocks/FormSection/FormSection.vue.d.ts +85 -0
- package/dist/blocks/FormSection/FormSection.vue.d.ts.map +1 -0
- package/dist/blocks/FormSection/FormSection.vue_vue_type_script_setup_true_lang.js +62 -0
- package/dist/blocks/FormSection/FormSection.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/blocks/LoadingState/LoadingState.js +7 -0
- package/dist/blocks/LoadingState/LoadingState.js.map +1 -0
- package/dist/blocks/LoadingState/LoadingState.vue.d.ts +22 -0
- package/dist/blocks/LoadingState/LoadingState.vue.d.ts.map +1 -0
- package/dist/blocks/LoadingState/LoadingState.vue_vue_type_script_setup_true_lang.js +57 -0
- package/dist/blocks/LoadingState/LoadingState.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/blocks/MetricCard/MetricCard.js +7 -0
- package/dist/blocks/MetricCard/MetricCard.js.map +1 -0
- package/dist/blocks/MetricCard/MetricCard.vue.d.ts +59 -0
- package/dist/blocks/MetricCard/MetricCard.vue.d.ts.map +1 -0
- package/dist/blocks/MetricCard/MetricCard.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/blocks/MetricCard/MetricCard.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/blocks/SidebarNav/SidebarNav.js.map +1 -1
- package/dist/blocks/SidebarNav/SidebarNav.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/blocks/TitleBar/TitleBar.js.map +1 -1
- package/dist/blocks/TitleBar/TitleBar.vue.d.ts +37 -3
- package/dist/blocks/TitleBar/TitleBar.vue.d.ts.map +1 -1
- package/dist/blocks/TitleBar/TitleBar.vue_vue_type_script_setup_true_lang.js +14 -14
- package/dist/blocks/TitleBar/TitleBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/blocks/ToastStack/ToastStack.js.map +1 -1
- package/dist/blocks/ToastStack/ToastStack.vue.d.ts +20 -0
- package/dist/blocks/ToastStack/ToastStack.vue.d.ts.map +1 -1
- package/dist/blocks/ToastStack/ToastStack.vue_vue_type_script_setup_true_lang.js +16 -5
- package/dist/blocks/ToastStack/ToastStack.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/composition/Center/Center.js +7 -0
- package/dist/composition/Center/Center.js.map +1 -0
- package/dist/composition/Center/Center.vue.d.ts +40 -0
- package/dist/composition/Center/Center.vue.d.ts.map +1 -0
- package/dist/composition/Center/Center.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/composition/Center/Center.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/composition/Frame/Frame.js +7 -0
- package/dist/composition/Frame/Frame.js.map +1 -0
- package/dist/composition/Frame/Frame.vue.d.ts +35 -0
- package/dist/composition/Frame/Frame.vue.d.ts.map +1 -0
- package/dist/composition/Frame/Frame.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/composition/Frame/Frame.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/composition/Grid/Grid.js +7 -0
- package/dist/composition/Grid/Grid.js.map +1 -0
- package/dist/composition/Grid/Grid.vue.d.ts +41 -0
- package/dist/composition/Grid/Grid.vue.d.ts.map +1 -0
- package/dist/composition/Grid/Grid.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/composition/Grid/Grid.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/composition/Inline/Inline.js +7 -0
- package/dist/composition/Inline/Inline.js.map +1 -0
- package/dist/composition/Inline/Inline.vue.d.ts +46 -0
- package/dist/composition/Inline/Inline.vue.d.ts.map +1 -0
- package/dist/composition/Inline/Inline.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/composition/Inline/Inline.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/composition/ScrollReel/ScrollReel.js +7 -0
- package/dist/composition/ScrollReel/ScrollReel.js.map +1 -0
- package/dist/composition/ScrollReel/ScrollReel.vue.d.ts +42 -0
- package/dist/composition/ScrollReel/ScrollReel.vue.d.ts.map +1 -0
- package/dist/composition/ScrollReel/ScrollReel.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/composition/ScrollReel/ScrollReel.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/composition/Sidebar/Sidebar.js +7 -0
- package/dist/composition/Sidebar/Sidebar.js.map +1 -0
- package/dist/composition/Sidebar/Sidebar.vue.d.ts +52 -0
- package/dist/composition/Sidebar/Sidebar.vue.d.ts.map +1 -0
- package/dist/composition/Sidebar/Sidebar.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/composition/Sidebar/Sidebar.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/composition/Split/Split.js +7 -0
- package/dist/composition/Split/Split.js.map +1 -0
- package/dist/composition/Split/Split.vue.d.ts +58 -0
- package/dist/composition/Split/Split.vue.d.ts.map +1 -0
- package/dist/composition/Split/Split.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/composition/Split/Split.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/composition/Stack/Stack.js +7 -0
- package/dist/composition/Stack/Stack.js.map +1 -0
- package/dist/composition/Stack/Stack.vue.d.ts +43 -0
- package/dist/composition/Stack/Stack.vue.d.ts.map +1 -0
- package/dist/composition/Stack/Stack.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/composition/Stack/Stack.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/index.d.ts +119 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +83 -5
- package/dist/layouts/AppShell/AppShell.js +7 -0
- package/dist/layouts/AppShell/AppShell.js.map +1 -0
- package/dist/layouts/AppShell/AppShell.vue.d.ts +51 -0
- package/dist/layouts/AppShell/AppShell.vue.d.ts.map +1 -0
- package/dist/layouts/AppShell/AppShell.vue_vue_type_script_setup_true_lang.js +47 -0
- package/dist/layouts/AppShell/AppShell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/layouts/Centered/Centered.js +7 -0
- package/dist/layouts/Centered/Centered.js.map +1 -0
- package/dist/layouts/Centered/Centered.vue.d.ts +48 -0
- package/dist/layouts/Centered/Centered.vue.d.ts.map +1 -0
- package/dist/layouts/Centered/Centered.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/layouts/Centered/Centered.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/layouts/Dashboard/Dashboard.js +7 -0
- package/dist/layouts/Dashboard/Dashboard.js.map +1 -0
- package/dist/layouts/Dashboard/Dashboard.vue.d.ts +60 -0
- package/dist/layouts/Dashboard/Dashboard.vue.d.ts.map +1 -0
- package/dist/layouts/Dashboard/Dashboard.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/layouts/Dashboard/Dashboard.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/layouts/FormLayout/FormLayout.js +7 -0
- package/dist/layouts/FormLayout/FormLayout.js.map +1 -0
- package/dist/layouts/FormLayout/FormLayout.vue.d.ts +46 -0
- package/dist/layouts/FormLayout/FormLayout.vue.d.ts.map +1 -0
- package/dist/layouts/FormLayout/FormLayout.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/layouts/FormLayout/FormLayout.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/layouts/MasterDetail/MasterDetail.js +7 -0
- package/dist/layouts/MasterDetail/MasterDetail.js.map +1 -0
- package/dist/layouts/MasterDetail/MasterDetail.vue.d.ts +49 -0
- package/dist/layouts/MasterDetail/MasterDetail.vue.d.ts.map +1 -0
- package/dist/layouts/MasterDetail/MasterDetail.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/layouts/MasterDetail/MasterDetail.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/layouts/Reading/Reading.js +7 -0
- package/dist/layouts/Reading/Reading.js.map +1 -0
- package/dist/layouts/Reading/Reading.vue.d.ts +24 -0
- package/dist/layouts/Reading/Reading.vue.d.ts.map +1 -0
- package/dist/layouts/Reading/Reading.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/layouts/Reading/Reading.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/layouts/Settings/Settings.js +7 -0
- package/dist/layouts/Settings/Settings.js.map +1 -0
- package/dist/layouts/Settings/Settings.vue.d.ts +39 -0
- package/dist/layouts/Settings/Settings.vue.d.ts.map +1 -0
- package/dist/layouts/Settings/Settings.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/layouts/Settings/Settings.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/layouts/SplitLayout/SplitLayout.js +7 -0
- package/dist/layouts/SplitLayout/SplitLayout.js.map +1 -0
- package/dist/layouts/SplitLayout/SplitLayout.vue.d.ts +63 -0
- package/dist/layouts/SplitLayout/SplitLayout.vue.d.ts.map +1 -0
- package/dist/layouts/SplitLayout/SplitLayout.vue_vue_type_script_setup_true_lang.js +46 -0
- package/dist/layouts/SplitLayout/SplitLayout.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/lib/ancestor-disabled.d.ts +35 -0
- package/dist/lib/ancestor-disabled.d.ts.map +1 -0
- package/dist/lib/ancestor-disabled.js +86 -0
- package/dist/lib/ancestor-disabled.js.map +1 -0
- package/dist/lib/cn.d.ts.map +1 -1
- package/dist/lib/cn.js +46 -1
- package/dist/lib/cn.js.map +1 -1
- package/dist/lib/count-labels.d.ts +78 -0
- package/dist/lib/count-labels.d.ts.map +1 -0
- package/dist/lib/count-labels.js +29 -0
- package/dist/lib/count-labels.js.map +1 -0
- package/dist/lib/date-labels.d.ts +278 -0
- package/dist/lib/date-labels.d.ts.map +1 -0
- package/dist/lib/date-labels.js +157 -0
- package/dist/lib/date-labels.js.map +1 -0
- package/dist/lib/field-context.d.ts +178 -0
- package/dist/lib/field-context.d.ts.map +1 -0
- package/dist/lib/field-context.js +106 -0
- package/dist/lib/field-context.js.map +1 -0
- package/dist/lib/label-registry.d.ts +75 -0
- package/dist/lib/label-registry.d.ts.map +1 -0
- package/dist/lib/labels.d.ts +116 -0
- package/dist/lib/labels.d.ts.map +1 -0
- package/dist/lib/labels.js +84 -0
- package/dist/lib/labels.js.map +1 -0
- package/dist/lib/theme.d.ts +68 -0
- package/dist/lib/theme.d.ts.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/CalendarDate.js +236 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/CalendarDate.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js +117 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/conversion.js +142 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/conversion.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/manipulation.js +280 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/manipulation.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/queries.js +40 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/queries.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/string.js +69 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/string.js.map +1 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/utils.js +8 -0
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/utils.js.map +1 -0
- package/dist/primitives/Accordion/Accordion.js +7 -0
- package/dist/primitives/Accordion/Accordion.js.map +1 -0
- package/dist/primitives/Accordion/Accordion.vue.d.ts +68 -0
- package/dist/primitives/Accordion/Accordion.vue.d.ts.map +1 -0
- package/dist/primitives/Accordion/Accordion.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/primitives/Accordion/Accordion.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/AlertDialog/AlertDialog.js +7 -0
- package/dist/primitives/AlertDialog/AlertDialog.js.map +1 -0
- package/dist/primitives/AlertDialog/AlertDialog.vue.d.ts +94 -0
- package/dist/primitives/AlertDialog/AlertDialog.vue.d.ts.map +1 -0
- package/dist/primitives/AlertDialog/AlertDialog.vue_vue_type_script_setup_true_lang.js +99 -0
- package/dist/primitives/AlertDialog/AlertDialog.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/Avatar/Avatar.js +2 -2
- package/dist/primitives/Avatar/Avatar.js.map +1 -1
- package/dist/primitives/Avatar/Avatar.vue.d.ts +30 -3
- package/dist/primitives/Avatar/Avatar.vue.d.ts.map +1 -1
- package/dist/primitives/Avatar/Avatar.vue_vue_type_script_setup_true_lang.js +95 -14
- package/dist/primitives/Avatar/Avatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/AvatarGroup/AvatarGroup.js +7 -0
- package/dist/primitives/AvatarGroup/AvatarGroup.js.map +1 -0
- package/dist/primitives/AvatarGroup/AvatarGroup.vue.d.ts +104 -0
- package/dist/primitives/AvatarGroup/AvatarGroup.vue.d.ts.map +1 -0
- package/dist/primitives/AvatarGroup/AvatarGroup.vue_vue_type_script_setup_true_lang.js +139 -0
- package/dist/primitives/AvatarGroup/AvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/Badge/Badge.js.map +1 -1
- package/dist/primitives/Badge/Badge.vue.d.ts +6 -6
- package/dist/primitives/Badge/Badge.vue.d.ts.map +1 -1
- package/dist/primitives/Badge/Badge.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/primitives/Badge/Badge.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/Breadcrumb/Breadcrumb.js +7 -0
- package/dist/primitives/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/primitives/Breadcrumb/Breadcrumb.vue.d.ts +25 -0
- package/dist/primitives/Breadcrumb/Breadcrumb.vue.d.ts.map +1 -0
- package/dist/primitives/Breadcrumb/Breadcrumb.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/primitives/Breadcrumb/Breadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/Button/Button.js +2 -2
- package/dist/primitives/Button/Button.js.map +1 -1
- package/dist/primitives/Button/Button.vue.d.ts +31 -8
- package/dist/primitives/Button/Button.vue.d.ts.map +1 -1
- package/dist/primitives/Button/Button.vue_vue_type_script_setup_true_lang.js +32 -16
- package/dist/primitives/Button/Button.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/Checkbox/Checkbox.js.map +1 -1
- package/dist/primitives/Checkbox/Checkbox.vue.d.ts +18 -3
- package/dist/primitives/Checkbox/Checkbox.vue.d.ts.map +1 -1
- package/dist/primitives/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +46 -7
- package/dist/primitives/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/Chip/Chip.js +7 -0
- package/dist/primitives/Chip/Chip.js.map +1 -0
- package/dist/primitives/Chip/Chip.vue.d.ts +79 -0
- package/dist/primitives/Chip/Chip.vue.d.ts.map +1 -0
- package/dist/primitives/Chip/Chip.vue_vue_type_script_setup_true_lang.js +139 -0
- package/dist/primitives/Chip/Chip.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/ColorPicker/ColorPicker.js +7 -0
- package/dist/primitives/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/primitives/ColorPicker/ColorPicker.vue.d.ts +125 -0
- package/dist/primitives/ColorPicker/ColorPicker.vue.d.ts.map +1 -0
- package/dist/primitives/ColorPicker/ColorPicker.vue_vue_type_script_setup_true_lang.js +301 -0
- package/dist/primitives/ColorPicker/ColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/Combobox/Combobox.js +7 -0
- package/dist/primitives/Combobox/Combobox.js.map +1 -0
- package/dist/primitives/Combobox/Combobox.vue.d.ts +205 -0
- package/dist/primitives/Combobox/Combobox.vue.d.ts.map +1 -0
- package/dist/primitives/Combobox/Combobox.vue_vue_type_script_setup_true_lang.js +345 -0
- package/dist/primitives/Combobox/Combobox.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/ContextMenu/ContextMenu.js +7 -0
- package/dist/primitives/ContextMenu/ContextMenu.js.map +1 -0
- package/dist/primitives/ContextMenu/ContextMenu.vue.d.ts +55 -0
- package/dist/primitives/ContextMenu/ContextMenu.vue.d.ts.map +1 -0
- package/dist/primitives/ContextMenu/ContextMenu.vue_vue_type_script_setup_true_lang.js +82 -0
- package/dist/primitives/ContextMenu/ContextMenu.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/DatePicker/DatePicker.js +7 -0
- package/dist/primitives/DatePicker/DatePicker.js.map +1 -0
- package/dist/primitives/DatePicker/DatePicker.vue.d.ts +102 -0
- package/dist/primitives/DatePicker/DatePicker.vue.d.ts.map +1 -0
- package/dist/primitives/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js +292 -0
- package/dist/primitives/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/DateRangePicker/DateRangePicker.js +7 -0
- package/dist/primitives/DateRangePicker/DateRangePicker.js.map +1 -0
- package/dist/primitives/DateRangePicker/DateRangePicker.vue.d.ts +173 -0
- package/dist/primitives/DateRangePicker/DateRangePicker.vue.d.ts.map +1 -0
- package/dist/primitives/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +412 -0
- package/dist/primitives/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/DateTimePicker/DateTimePicker.js +7 -0
- package/dist/primitives/DateTimePicker/DateTimePicker.js.map +1 -0
- package/dist/primitives/DateTimePicker/DateTimePicker.vue.d.ts +113 -0
- package/dist/primitives/DateTimePicker/DateTimePicker.vue.d.ts.map +1 -0
- package/dist/primitives/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +358 -0
- package/dist/primitives/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/DateTimeRangePicker/DateTimeRangePicker.js +7 -0
- package/dist/primitives/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -0
- package/dist/primitives/DateTimeRangePicker/DateTimeRangePicker.vue.d.ts +181 -0
- package/dist/primitives/DateTimeRangePicker/DateTimeRangePicker.vue.d.ts.map +1 -0
- package/dist/primitives/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +562 -0
- package/dist/primitives/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/Dialog/Dialog.js +2 -2
- package/dist/primitives/Dialog/Dialog.js.map +1 -1
- package/dist/primitives/Dialog/Dialog.vue.d.ts +39 -0
- package/dist/primitives/Dialog/Dialog.vue.d.ts.map +1 -1
- package/dist/primitives/Dialog/Dialog.vue_vue_type_script_setup_true_lang.js +14 -5
- package/dist/primitives/Dialog/Dialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/Drawer/Drawer.js +7 -0
- package/dist/primitives/Drawer/Drawer.js.map +1 -0
- package/dist/primitives/Drawer/Drawer.vue.d.ts +110 -0
- package/dist/primitives/Drawer/Drawer.vue.d.ts.map +1 -0
- package/dist/primitives/Drawer/Drawer.vue_vue_type_script_setup_true_lang.js +223 -0
- package/dist/primitives/Drawer/Drawer.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/DropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/primitives/DropdownMenu/DropdownMenu.vue.d.ts.map +1 -1
- package/dist/primitives/DropdownMenu/DropdownMenu.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/primitives/DropdownMenu/DropdownMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/Editable/Editable.js +7 -0
- package/dist/primitives/Editable/Editable.js.map +1 -0
- package/dist/primitives/Editable/Editable.vue.d.ts +200 -0
- package/dist/primitives/Editable/Editable.vue.d.ts.map +1 -0
- package/dist/primitives/Editable/Editable.vue_vue_type_script_setup_true_lang.js +275 -0
- package/dist/primitives/Editable/Editable.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/Field/Field.js.map +1 -1
- package/dist/primitives/Field/Field.vue.d.ts +32 -17
- package/dist/primitives/Field/Field.vue.d.ts.map +1 -1
- package/dist/primitives/Field/Field.vue_vue_type_script_setup_true_lang.js +51 -18
- package/dist/primitives/Field/Field.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/Fieldset/Fieldset.js +7 -0
- package/dist/primitives/Fieldset/Fieldset.js.map +1 -0
- package/dist/primitives/Fieldset/Fieldset.vue.d.ts +91 -0
- package/dist/primitives/Fieldset/Fieldset.vue.d.ts.map +1 -0
- package/dist/primitives/Fieldset/Fieldset.vue_vue_type_script_setup_true_lang.js +138 -0
- package/dist/primitives/Fieldset/Fieldset.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/FileUpload/FileUpload.js +7 -0
- package/dist/primitives/FileUpload/FileUpload.js.map +1 -0
- package/dist/primitives/FileUpload/FileUpload.vue.d.ts +132 -0
- package/dist/primitives/FileUpload/FileUpload.vue.d.ts.map +1 -0
- package/dist/primitives/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +359 -0
- package/dist/primitives/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/HoverCard/HoverCard.js +7 -0
- package/dist/primitives/HoverCard/HoverCard.js.map +1 -0
- package/dist/primitives/HoverCard/HoverCard.vue.d.ts +68 -0
- package/dist/primitives/HoverCard/HoverCard.vue.d.ts.map +1 -0
- package/dist/primitives/HoverCard/HoverCard.vue_vue_type_script_setup_true_lang.js +62 -0
- package/dist/primitives/HoverCard/HoverCard.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/IconButton/IconButton.js +7 -0
- package/dist/primitives/IconButton/IconButton.js.map +1 -0
- package/dist/primitives/IconButton/IconButton.vue.d.ts +45 -0
- package/dist/primitives/IconButton/IconButton.vue.d.ts.map +1 -0
- package/dist/primitives/IconButton/IconButton.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/primitives/IconButton/IconButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/Indicator/Indicator.js +7 -0
- package/dist/primitives/Indicator/Indicator.js.map +1 -0
- package/dist/primitives/Indicator/Indicator.vue.d.ts +144 -0
- package/dist/primitives/Indicator/Indicator.vue.d.ts.map +1 -0
- package/dist/primitives/Indicator/Indicator.vue_vue_type_script_setup_true_lang.js +198 -0
- package/dist/primitives/Indicator/Indicator.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/Link/Link.js +7 -0
- package/dist/primitives/Link/Link.js.map +1 -0
- package/dist/primitives/Link/Link.vue.d.ts +46 -0
- package/dist/primitives/Link/Link.vue.d.ts.map +1 -0
- package/dist/primitives/Link/Link.vue_vue_type_script_setup_true_lang.js +85 -0
- package/dist/primitives/Link/Link.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/Menubar/Menubar.js.map +1 -1
- package/dist/primitives/Menubar/Menubar.vue.d.ts.map +1 -1
- package/dist/primitives/Menubar/Menubar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/primitives/Menubar/Menubar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/NumberField/NumberField.js +2 -2
- package/dist/primitives/NumberField/NumberField.js.map +1 -1
- package/dist/primitives/NumberField/NumberField.vue.d.ts +86 -25
- package/dist/primitives/NumberField/NumberField.vue.d.ts.map +1 -1
- package/dist/primitives/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +83 -39
- package/dist/primitives/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/OtpInput/OtpInput.js +7 -0
- package/dist/primitives/OtpInput/OtpInput.js.map +1 -0
- package/dist/primitives/OtpInput/OtpInput.vue.d.ts +110 -0
- package/dist/primitives/OtpInput/OtpInput.vue.d.ts.map +1 -0
- package/dist/primitives/OtpInput/OtpInput.vue_vue_type_script_setup_true_lang.js +130 -0
- package/dist/primitives/OtpInput/OtpInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/Pagination/Pagination.js +7 -0
- package/dist/primitives/Pagination/Pagination.js.map +1 -0
- package/dist/primitives/Pagination/Pagination.vue.d.ts +143 -0
- package/dist/primitives/Pagination/Pagination.vue.d.ts.map +1 -0
- package/dist/primitives/Pagination/Pagination.vue_vue_type_script_setup_true_lang.js +231 -0
- package/dist/primitives/Pagination/Pagination.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/Progress/Progress.js +2 -2
- package/dist/primitives/Progress/Progress.js.map +1 -1
- package/dist/primitives/Progress/Progress.vue.d.ts +81 -15
- package/dist/primitives/Progress/Progress.vue.d.ts.map +1 -1
- package/dist/primitives/Progress/Progress.vue_vue_type_script_setup_true_lang.js +88 -22
- package/dist/primitives/Progress/Progress.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/RadialProgress/RadialProgress.js +7 -0
- package/dist/primitives/RadialProgress/RadialProgress.js.map +1 -0
- package/dist/primitives/RadialProgress/RadialProgress.vue.d.ts +96 -0
- package/dist/primitives/RadialProgress/RadialProgress.vue.d.ts.map +1 -0
- package/dist/primitives/RadialProgress/RadialProgress.vue_vue_type_script_setup_true_lang.js +189 -0
- package/dist/primitives/RadialProgress/RadialProgress.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/primitives/RadioGroup/RadioGroup.vue.d.ts +7 -7
- package/dist/primitives/RadioGroup/RadioGroup.vue.d.ts.map +1 -1
- package/dist/primitives/RadioGroup/RadioGroup.vue_vue_type_script_setup_true_lang.js +26 -9
- package/dist/primitives/RadioGroup/RadioGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/Rating/Rating.js +7 -0
- package/dist/primitives/Rating/Rating.js.map +1 -0
- package/dist/primitives/Rating/Rating.vue.d.ts +113 -0
- package/dist/primitives/Rating/Rating.vue.d.ts.map +1 -0
- package/dist/primitives/Rating/Rating.vue_vue_type_script_setup_true_lang.js +282 -0
- package/dist/primitives/Rating/Rating.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/ScrollArea/ScrollArea.js +7 -0
- package/dist/primitives/ScrollArea/ScrollArea.js.map +1 -0
- package/dist/primitives/ScrollArea/ScrollArea.vue.d.ts +25 -0
- package/dist/primitives/ScrollArea/ScrollArea.vue.d.ts.map +1 -0
- package/dist/primitives/ScrollArea/ScrollArea.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/primitives/ScrollArea/ScrollArea.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/primitives/SegmentedControl/SegmentedControl.vue.d.ts +5 -5
- package/dist/primitives/SegmentedControl/SegmentedControl.vue.d.ts.map +1 -1
- package/dist/primitives/SegmentedControl/SegmentedControl.vue_vue_type_script_setup_true_lang.js +51 -8
- package/dist/primitives/SegmentedControl/SegmentedControl.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/Select/Select.js.map +1 -1
- package/dist/primitives/Select/Select.vue.d.ts +10 -10
- package/dist/primitives/Select/Select.vue.d.ts.map +1 -1
- package/dist/primitives/Select/Select.vue_vue_type_script_setup_true_lang.js +105 -52
- package/dist/primitives/Select/Select.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/Skeleton/Skeleton.vue.d.ts +1 -1
- package/dist/primitives/Slider/Slider.js.map +1 -1
- package/dist/primitives/Slider/Slider.vue.d.ts +24 -4
- package/dist/primitives/Slider/Slider.vue.d.ts.map +1 -1
- package/dist/primitives/Slider/Slider.vue_vue_type_script_setup_true_lang.js +79 -9
- package/dist/primitives/Slider/Slider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/SpeedDial/SpeedDial.js +7 -0
- package/dist/primitives/SpeedDial/SpeedDial.js.map +1 -0
- package/dist/primitives/SpeedDial/SpeedDial.vue.d.ts +58 -0
- package/dist/primitives/SpeedDial/SpeedDial.vue.d.ts.map +1 -0
- package/dist/primitives/SpeedDial/SpeedDial.vue_vue_type_script_setup_true_lang.js +175 -0
- package/dist/primitives/SpeedDial/SpeedDial.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/Stepper/Stepper.js +7 -0
- package/dist/primitives/Stepper/Stepper.js.map +1 -0
- package/dist/primitives/Stepper/Stepper.vue.d.ts +119 -0
- package/dist/primitives/Stepper/Stepper.vue.d.ts.map +1 -0
- package/dist/primitives/Stepper/Stepper.vue_vue_type_script_setup_true_lang.js +202 -0
- package/dist/primitives/Stepper/Stepper.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/Switch/Switch.js.map +1 -1
- package/dist/primitives/Switch/Switch.vue.d.ts +13 -3
- package/dist/primitives/Switch/Switch.vue.d.ts.map +1 -1
- package/dist/primitives/Switch/Switch.vue_vue_type_script_setup_true_lang.js +34 -5
- package/dist/primitives/Switch/Switch.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/Tabs/Tabs.js.map +1 -1
- package/dist/primitives/Tabs/Tabs.vue.d.ts.map +1 -1
- package/dist/primitives/Tabs/Tabs.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/primitives/Tabs/Tabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/TagsInput/TagsInput.js +7 -0
- package/dist/primitives/TagsInput/TagsInput.js.map +1 -0
- package/dist/primitives/TagsInput/TagsInput.vue.d.ts +156 -0
- package/dist/primitives/TagsInput/TagsInput.vue.d.ts.map +1 -0
- package/dist/primitives/TagsInput/TagsInput.vue_vue_type_script_setup_true_lang.js +387 -0
- package/dist/primitives/TagsInput/TagsInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/TextField/TextField.js +2 -2
- package/dist/primitives/TextField/TextField.js.map +1 -1
- package/dist/primitives/TextField/TextField.vue.d.ts +119 -10
- package/dist/primitives/TextField/TextField.vue.d.ts.map +1 -1
- package/dist/primitives/TextField/TextField.vue_vue_type_script_setup_true_lang.js +270 -21
- package/dist/primitives/TextField/TextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/Textarea/Textarea.js +2 -2
- package/dist/primitives/Textarea/Textarea.js.map +1 -1
- package/dist/primitives/Textarea/Textarea.vue.d.ts +114 -14
- package/dist/primitives/Textarea/Textarea.vue.d.ts.map +1 -1
- package/dist/primitives/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js +216 -20
- package/dist/primitives/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/TimePicker/TimePicker.js +7 -0
- package/dist/primitives/TimePicker/TimePicker.js.map +1 -0
- package/dist/primitives/TimePicker/TimePicker.vue.d.ts +111 -0
- package/dist/primitives/TimePicker/TimePicker.vue.d.ts.map +1 -0
- package/dist/primitives/TimePicker/TimePicker.vue_vue_type_script_setup_true_lang.js +185 -0
- package/dist/primitives/TimePicker/TimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primitives/Toast/Toast.js +2 -1
- package/dist/primitives/Toast/Toast.js.map +1 -1
- package/dist/primitives/Toast/Toast.vue.d.ts +29 -3
- package/dist/primitives/Toast/Toast.vue.d.ts.map +1 -1
- package/dist/primitives/Toast/Toast.vue_vue_type_script_setup_true_lang.js +17 -7
- package/dist/primitives/Toast/Toast.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/Toast/ToastItem.js +2 -2
- package/dist/primitives/Toast/ToastItem.js.map +1 -1
- package/dist/primitives/Toast/ToastItem.vue.d.ts +69 -12
- package/dist/primitives/Toast/ToastItem.vue.d.ts.map +1 -1
- package/dist/primitives/Toast/ToastItem.vue_vue_type_script_setup_true_lang.js +23 -23
- package/dist/primitives/Toast/ToastItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/primitives/Tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/primitives/Tooltip/Tooltip.vue.d.ts.map +1 -1
- package/dist/primitives/WindowControls/WindowControls.js +2 -2
- package/dist/primitives/WindowControls/WindowControls.js.map +1 -1
- package/dist/primitives/WindowControls/WindowControls.vue.d.ts +66 -10
- package/dist/primitives/WindowControls/WindowControls.vue.d.ts.map +1 -1
- package/dist/primitives/WindowControls/WindowControls.vue_vue_type_script_setup_true_lang.js +23 -13
- package/dist/primitives/WindowControls/WindowControls.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/styles/global.css +116 -17
- package/dist/styles/theme.contrast.test.ts +460 -0
- package/dist/styles/theme.css +239 -41
- package/dist/theme.js +171 -0
- package/dist/theme.js.map +1 -0
- package/package.json +14 -4
- package/dist/icons/BrandMark.d.ts +0 -18
- package/dist/icons/BrandMark.d.ts.map +0 -1
- package/dist/icons/BrandMark.js +0 -47
- package/dist/icons/BrandMark.js.map +0 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { LabelOf } from "./labels";
|
|
2
|
+
/**
|
|
3
|
+
* The five counter keys shared by TextField and Textarea — the ones a host
|
|
4
|
+
* worded for one can copy across unchanged to the other. The keys match by
|
|
5
|
+
* name and by argument shape; the slots are separate in `LoomLabels` only
|
|
6
|
+
* because `textField` also carries `reveal`.
|
|
7
|
+
*
|
|
8
|
+
* The four counting keys take the **numbers**, never a formatted string, for
|
|
9
|
+
* the reason `./labels.ts` gives at length: `${count}/${max}` is a punctuation
|
|
10
|
+
* choice made in one language, and "3 characters left" has one plural form in
|
|
11
|
+
* Vietnamese, two in English and six in Arabic. A host handed the integers
|
|
12
|
+
* reaches `Intl.PluralRules` for the category and `Intl.NumberFormat` for the
|
|
13
|
+
* digits; a host handed "3/20" can do neither.
|
|
14
|
+
*
|
|
15
|
+
* There are three visible counter strings rather than one with a conditional
|
|
16
|
+
* inside it, because the three say different things: a running total against
|
|
17
|
+
* no limit, a total against a limit, and a limit already passed. The last is
|
|
18
|
+
* the one that must not read as merely a redder version of the second — see
|
|
19
|
+
* `countOverMax`.
|
|
20
|
+
*/
|
|
21
|
+
export interface CountLabels {
|
|
22
|
+
/** The counter when the field has no maximum: a running total, nothing more. */
|
|
23
|
+
readonly count: LabelOf<{
|
|
24
|
+
count: number;
|
|
25
|
+
}>;
|
|
26
|
+
/** The counter when the field has a maximum and is within it. */
|
|
27
|
+
readonly countOfMax: LabelOf<{
|
|
28
|
+
count: number;
|
|
29
|
+
max: number;
|
|
30
|
+
}>;
|
|
31
|
+
/**
|
|
32
|
+
* The counter once the value is past the maximum.
|
|
33
|
+
*
|
|
34
|
+
* Loom's English adds words rather than only digits, and that is the
|
|
35
|
+
* accessibility requirement rather than a flourish: over-limit is painted
|
|
36
|
+
* `text-destructive`, and a state carried by colour alone fails WCAG 1.4.1.
|
|
37
|
+
* An override that returns the same shape as `countOfMax` puts that failure
|
|
38
|
+
* back.
|
|
39
|
+
*/
|
|
40
|
+
readonly countOverMax: LabelOf<{
|
|
41
|
+
count: number;
|
|
42
|
+
max: number;
|
|
43
|
+
over: number;
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Announced **once**, as the value crosses into the last stretch of its
|
|
47
|
+
* allowance — not on every keystroke after it. The numbers are true at the
|
|
48
|
+
* moment it is spoken; the visible counter is what carries them afterwards.
|
|
49
|
+
*/
|
|
50
|
+
readonly approachingLimit: LabelOf<{
|
|
51
|
+
remaining: number;
|
|
52
|
+
max: number;
|
|
53
|
+
}>;
|
|
54
|
+
/** Announced once, as the value crosses the maximum. */
|
|
55
|
+
readonly limitExceeded: LabelOf<{
|
|
56
|
+
over: number;
|
|
57
|
+
max: number;
|
|
58
|
+
}>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Loom's English defaults for the counter vocabulary, co-located here so the
|
|
62
|
+
* two components that share it tree-shake together and an importing host can
|
|
63
|
+
* build a partial vocabulary against the real thing rather than a transcription.
|
|
64
|
+
*/
|
|
65
|
+
export declare const COUNT_LABELS: CountLabels;
|
|
66
|
+
/**
|
|
67
|
+
* How close to the maximum the warning fires: the last quarter of a short
|
|
68
|
+
* allowance, or the last ten characters of a long one, whichever is smaller.
|
|
69
|
+
*
|
|
70
|
+
* Ten is about a word, and a warning is only worth anything while there is
|
|
71
|
+
* still room to act on it — a fixed tenth would give a 280-character field
|
|
72
|
+
* twenty-eight characters of notice and a twenty-character field two, which is
|
|
73
|
+
* either too early to mean anything or too late to be a warning.
|
|
74
|
+
*/
|
|
75
|
+
export declare function warningWindow(max: number): number;
|
|
76
|
+
/** Where the value sits against its maximum, and the only thing the announcement watches. */
|
|
77
|
+
export type CountBand = "under" | "near" | "over";
|
|
78
|
+
//# sourceMappingURL=count-labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"count-labels.d.ts","sourceRoot":"","sources":["../../src/lib/count-labels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,WAAW;IAC1B,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3C,iEAAiE;IACjE,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7D;;;;;;;;OAQG;IACH,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7E;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE,wDAAwD;IACxD,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChE;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,WAQ1B,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,6FAA6F;AAC7F,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/lib/count-labels.ts
|
|
2
|
+
/**
|
|
3
|
+
* Loom's English defaults for the counter vocabulary, co-located here so the
|
|
4
|
+
* two components that share it tree-shake together and an importing host can
|
|
5
|
+
* build a partial vocabulary against the real thing rather than a transcription.
|
|
6
|
+
*/
|
|
7
|
+
var COUNT_LABELS = {
|
|
8
|
+
count: ({ count }) => String(count),
|
|
9
|
+
countOfMax: ({ count, max }) => `${String(count)}/${String(max)}`,
|
|
10
|
+
countOverMax: ({ count, max }) => `${String(count)}/${String(max)} over limit`,
|
|
11
|
+
approachingLimit: ({ remaining }) => `${String(remaining)} ${remaining === 1 ? "character" : "characters"} left`,
|
|
12
|
+
limitExceeded: ({ over, max }) => `${String(over)} ${over === 1 ? "character" : "characters"} over the limit of ${String(max)}`
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* How close to the maximum the warning fires: the last quarter of a short
|
|
16
|
+
* allowance, or the last ten characters of a long one, whichever is smaller.
|
|
17
|
+
*
|
|
18
|
+
* Ten is about a word, and a warning is only worth anything while there is
|
|
19
|
+
* still room to act on it — a fixed tenth would give a 280-character field
|
|
20
|
+
* twenty-eight characters of notice and a twenty-character field two, which is
|
|
21
|
+
* either too early to mean anything or too late to be a warning.
|
|
22
|
+
*/
|
|
23
|
+
function warningWindow(max) {
|
|
24
|
+
return Math.min(10, Math.ceil(max / 4));
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { COUNT_LABELS, warningWindow };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=count-labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"count-labels.js","names":[],"sources":["../../src/lib/count-labels.ts"],"sourcesContent":["import type { LabelOf } from \"./labels\";\n\n/**\n * The five counter keys shared by TextField and Textarea — the ones a host\n * worded for one can copy across unchanged to the other. The keys match by\n * name and by argument shape; the slots are separate in `LoomLabels` only\n * because `textField` also carries `reveal`.\n *\n * The four counting keys take the **numbers**, never a formatted string, for\n * the reason `./labels.ts` gives at length: `${count}/${max}` is a punctuation\n * choice made in one language, and \"3 characters left\" has one plural form in\n * Vietnamese, two in English and six in Arabic. A host handed the integers\n * reaches `Intl.PluralRules` for the category and `Intl.NumberFormat` for the\n * digits; a host handed \"3/20\" can do neither.\n *\n * There are three visible counter strings rather than one with a conditional\n * inside it, because the three say different things: a running total against\n * no limit, a total against a limit, and a limit already passed. The last is\n * the one that must not read as merely a redder version of the second — see\n * `countOverMax`.\n */\nexport interface CountLabels {\n /** The counter when the field has no maximum: a running total, nothing more. */\n readonly count: LabelOf<{ count: number }>;\n /** The counter when the field has a maximum and is within it. */\n readonly countOfMax: LabelOf<{ count: number; max: number }>;\n /**\n * The counter once the value is past the maximum.\n *\n * Loom's English adds words rather than only digits, and that is the\n * accessibility requirement rather than a flourish: over-limit is painted\n * `text-destructive`, and a state carried by colour alone fails WCAG 1.4.1.\n * An override that returns the same shape as `countOfMax` puts that failure\n * back.\n */\n readonly countOverMax: LabelOf<{ count: number; max: number; over: number }>;\n /**\n * Announced **once**, as the value crosses into the last stretch of its\n * allowance — not on every keystroke after it. The numbers are true at the\n * moment it is spoken; the visible counter is what carries them afterwards.\n */\n readonly approachingLimit: LabelOf<{ remaining: number; max: number }>;\n /** Announced once, as the value crosses the maximum. */\n readonly limitExceeded: LabelOf<{ over: number; max: number }>;\n}\n\n/**\n * Loom's English defaults for the counter vocabulary, co-located here so the\n * two components that share it tree-shake together and an importing host can\n * build a partial vocabulary against the real thing rather than a transcription.\n */\nexport const COUNT_LABELS: CountLabels = {\n count: ({ count }) => String(count),\n countOfMax: ({ count, max }) => `${String(count)}/${String(max)}`,\n countOverMax: ({ count, max }) => `${String(count)}/${String(max)} over limit`,\n approachingLimit: ({ remaining }) =>\n `${String(remaining)} ${remaining === 1 ? \"character\" : \"characters\"} left`,\n limitExceeded: ({ over, max }) =>\n `${String(over)} ${over === 1 ? \"character\" : \"characters\"} over the limit of ${String(max)}`,\n};\n\n/**\n * How close to the maximum the warning fires: the last quarter of a short\n * allowance, or the last ten characters of a long one, whichever is smaller.\n *\n * Ten is about a word, and a warning is only worth anything while there is\n * still room to act on it — a fixed tenth would give a 280-character field\n * twenty-eight characters of notice and a twenty-character field two, which is\n * either too early to mean anything or too late to be a warning.\n */\nexport function warningWindow(max: number): number {\n return Math.min(10, Math.ceil(max / 4));\n}\n\n/** Where the value sits against its maximum, and the only thing the announcement watches. */\nexport type CountBand = \"under\" | \"near\" | \"over\";\n"],"mappings":";;;;;;AAmDA,IAAa,eAA4B;CACvC,QAAQ,EAAE,YAAY,OAAO,KAAK;CAClC,aAAa,EAAE,OAAO,UAAU,GAAG,OAAO,KAAK,EAAE,GAAG,OAAO,GAAG;CAC9D,eAAe,EAAE,OAAO,UAAU,GAAG,OAAO,KAAK,EAAE,GAAG,OAAO,GAAG,EAAE;CAClE,mBAAmB,EAAE,gBACnB,GAAG,OAAO,SAAS,EAAE,GAAG,cAAc,IAAI,cAAc,aAAa;CACvE,gBAAgB,EAAE,MAAM,UACtB,GAAG,OAAO,IAAI,EAAE,GAAG,SAAS,IAAI,cAAc,aAAa,qBAAqB,OAAO,GAAG;AAC9F;;;;;;;;;;AAWA,SAAgB,cAAc,KAAqB;CACjD,OAAO,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,CAAC,CAAC;AACxC"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { type DateValue } from "@internationalized/date";
|
|
2
|
+
import type { LabelOf } from "./labels";
|
|
3
|
+
/**
|
|
4
|
+
* The four slices the five date and time controls share, and the one decision
|
|
5
|
+
* behind putting them here rather than five times over.
|
|
6
|
+
*
|
|
7
|
+
* Every other component in the library declares its own bag beside its own
|
|
8
|
+
* markup, because its vocabulary is its own. These five do not have five
|
|
9
|
+
* vocabularies: `DatePicker`, `DateTimePicker`, `DateRangePicker` and
|
|
10
|
+
* `DateTimeRangePicker` all say *Open calendar*, *Previous month* and *Next
|
|
11
|
+
* month*, and all five name the parts of a segmented field with the same
|
|
12
|
+
* words — the words are Reka UI's `useDateField` and `CalendarRoot` speaking,
|
|
13
|
+
* one implementation underneath all five. Declared per component that would be
|
|
14
|
+
* fifty-two keys with the same twelve strings written four times, and a
|
|
15
|
+
* translator doing the same work four times to make one language complete.
|
|
16
|
+
*
|
|
17
|
+
* **Sliced by what a control actually says, not merged into one family bag.**
|
|
18
|
+
* A `TimePicker` has no calendar and never renders a month or a year, so it
|
|
19
|
+
* registers `timeSegments` alone: its documented vocabulary is four keys, and a
|
|
20
|
+
* consumer importing only that control ships only those four strings. One
|
|
21
|
+
* shared bag for the whole family would have made every one of the five carry
|
|
22
|
+
* all twenty, and would have printed keys on `TimePicker`'s API page that it
|
|
23
|
+
* has no element to put them on.
|
|
24
|
+
*
|
|
25
|
+
* What is deliberately *not* shared is the two range controls' half-group names
|
|
26
|
+
* and status lines. They name the same concepts with different words (`Start
|
|
27
|
+
* date` against `Start date and time`) and from different facts (a count of
|
|
28
|
+
* whole days against a signed duration in minutes), so a shared key would have
|
|
29
|
+
* to be a sentence that is never true of both. Their calendar cells' names are
|
|
30
|
+
* shared, because those differ in neither.
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* The names Reka UI's `useDateField` writes onto the day, month, year and era
|
|
34
|
+
* segments — `"day,"`, `"month, "`, `"year, "`, `"era"`, each with the spacing
|
|
35
|
+
* of a string it meant to concatenate.
|
|
36
|
+
*
|
|
37
|
+
* There is no prop for any of them. A binding on Loom's side reaches the
|
|
38
|
+
* segment as a fallthrough attribute, which Vue merges onto the rendered vnode
|
|
39
|
+
* *after* Reka's own render function produced it, and `mergeProps` is
|
|
40
|
+
* last-write-wins for everything that is not `class`, `style` or `on*` — so
|
|
41
|
+
* these replace Reka's rather than competing with it. Leave one unset and the
|
|
42
|
+
* segment is not unnamed, it is named in English, which is the failure this
|
|
43
|
+
* seam exists to close.
|
|
44
|
+
*
|
|
45
|
+
* Loom's defaults differ from Reka's by their capitalisation, which is what
|
|
46
|
+
* lets a test assert *whose* string reached the DOM rather than merely what it
|
|
47
|
+
* said.
|
|
48
|
+
*/
|
|
49
|
+
export interface DateSegmentLabels {
|
|
50
|
+
/** The month segment of a date field. */
|
|
51
|
+
readonly month: string;
|
|
52
|
+
/** The day-of-month segment. */
|
|
53
|
+
readonly day: string;
|
|
54
|
+
/** The year segment. */
|
|
55
|
+
readonly year: string;
|
|
56
|
+
/**
|
|
57
|
+
* The era segment, which most locales never render — `ja-JP-u-ca-japanese`
|
|
58
|
+
* is the ordinary case that does.
|
|
59
|
+
*/
|
|
60
|
+
readonly era: string;
|
|
61
|
+
/**
|
|
62
|
+
* What a segment with nothing in it yet reports as its value, replacing the
|
|
63
|
+
* `aria-valuetext="Empty"` Reka writes on an unfilled day, month or year.
|
|
64
|
+
*
|
|
65
|
+
* A segment shows the locale's own placeholder — `mm`, `jj`, `aaaa` — while
|
|
66
|
+
* announcing this instead, so it is the one word standing between a fully
|
|
67
|
+
* localised date field and a reader who is told "Empty" in English.
|
|
68
|
+
*
|
|
69
|
+
* Present on this slice *and* on `TimeSegmentLabels` rather than shared
|
|
70
|
+
* between them, for the reason the slices exist at all: a `TimePicker`
|
|
71
|
+
* registers no `dateSegments`, and a key it could only reach through the
|
|
72
|
+
* date half would be a key it could not set.
|
|
73
|
+
*/
|
|
74
|
+
readonly empty: string;
|
|
75
|
+
/**
|
|
76
|
+
* What a filled month segment announces as its value, replacing the
|
|
77
|
+
* `aria-valuetext` Reka builds inside `useDateField`.
|
|
78
|
+
*
|
|
79
|
+
* Reka writes `"5 - May"` — the numeric month, a hard-coded `" - "`, and
|
|
80
|
+
* the month name from `Intl.DateTimeFormat`. The name is locale-aware, but
|
|
81
|
+
* the format is not: Japanese writes `"5月"`, Vietnamese `"tháng 5"`, and
|
|
82
|
+
* neither separates the two parts with a hyphen. A `LabelOf` hands the
|
|
83
|
+
* host the month number and the locale so they can compose the string their
|
|
84
|
+
* language needs, using `Intl.DateTimeFormat` for the name and arranging the
|
|
85
|
+
* parts in the right order.
|
|
86
|
+
*
|
|
87
|
+
* A `LabelOf` rather than a plain string, for the same reason
|
|
88
|
+
* `RangeCellLabels.cell` is one: the month name depends on the locale, and
|
|
89
|
+
* a string that did not receive the locale could not produce it. The host
|
|
90
|
+
* decides the format — Loom's English default matches Reka's output so that
|
|
91
|
+
* nothing changes for a consumer who does not override it.
|
|
92
|
+
*/
|
|
93
|
+
readonly filledMonth: LabelOf<{
|
|
94
|
+
value: number;
|
|
95
|
+
locale: string;
|
|
96
|
+
}>;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Loom's English for the date segments, co-located so it tree-shakes with the
|
|
100
|
+
* controls that use it, and exported so a host can build a partial vocabulary
|
|
101
|
+
* against the real thing rather than a transcription of it.
|
|
102
|
+
*/
|
|
103
|
+
export declare const DATE_SEGMENT_LABELS: DateSegmentLabels;
|
|
104
|
+
/**
|
|
105
|
+
* The same, for the clock half of a segmented field: Reka writes `"hour, "`,
|
|
106
|
+
* `"minute, "`, `"second, "` and `"AM/PM"`, and offers a prop for none of them.
|
|
107
|
+
*
|
|
108
|
+
* `dayPeriod` is spelled `AM or PM` rather than `AM/PM` so that it reads as
|
|
109
|
+
* words when it is spoken, and so the capitalisation trick above still works on
|
|
110
|
+
* the one segment whose name Reka already capitalises.
|
|
111
|
+
*/
|
|
112
|
+
export interface TimeSegmentLabels {
|
|
113
|
+
/** The hour segment. */
|
|
114
|
+
readonly hour: string;
|
|
115
|
+
/** The minute segment. */
|
|
116
|
+
readonly minute: string;
|
|
117
|
+
/** The seconds segment, which only a control at second granularity renders. */
|
|
118
|
+
readonly second: string;
|
|
119
|
+
/** The AM/PM segment, which only a 12-hour field renders. */
|
|
120
|
+
readonly dayPeriod: string;
|
|
121
|
+
/** What an hour, minute or second with nothing in it yet reports. See `DateSegmentLabels.empty`. */
|
|
122
|
+
readonly empty: string;
|
|
123
|
+
/**
|
|
124
|
+
* What a filled day-period segment announces as its value, replacing the
|
|
125
|
+
* `aria-valuetext` Reka writes inside `useDateField`.
|
|
126
|
+
*
|
|
127
|
+
* Reka writes `segmentValues.dayPeriod ?? "AM"` — always `"AM"` or `"PM"`,
|
|
128
|
+
* produced by its own hour-cycle logic (`hour >= 12 ? "PM" : "AM"`) rather
|
|
129
|
+
* than by `Intl.DateTimeFormat`. A host who has localised every other string
|
|
130
|
+
* in the library still hears Latin-script "AM"/"PM" from this segment, which
|
|
131
|
+
* is the defect this key exists to close.
|
|
132
|
+
*
|
|
133
|
+
* A `LabelOf` rather than a plain string, because the period name depends on
|
|
134
|
+
* the locale: Arabic writes `"ص"`/`"م"`, Japanese `"午前"`/`"午後"`, and a
|
|
135
|
+
* plain string could not carry that decision. Loom's English default returns
|
|
136
|
+
* `dayPeriod` unchanged, which is correct for Latin-script locales.
|
|
137
|
+
*/
|
|
138
|
+
readonly filledDayPeriod: LabelOf<{
|
|
139
|
+
dayPeriod: string;
|
|
140
|
+
}>;
|
|
141
|
+
}
|
|
142
|
+
/** Loom's English for the time segments. See `DATE_SEGMENT_LABELS`. */
|
|
143
|
+
export declare const TIME_SEGMENT_LABELS: TimeSegmentLabels;
|
|
144
|
+
/**
|
|
145
|
+
* The parts each slice actually names — every key of its bag except `empty`,
|
|
146
|
+
* which is a message *about* a segment rather than the name of one.
|
|
147
|
+
*
|
|
148
|
+
* Both the type and the set below are written out rather than derived from the
|
|
149
|
+
* bags, which is what they were before `empty` joined them. Derived, the guards
|
|
150
|
+
* would answer `true` for `"empty"` and narrow a part to a key that names no
|
|
151
|
+
* element, and `segmentLabel` would happily return the empty message as a
|
|
152
|
+
* segment's accessible name.
|
|
153
|
+
*/
|
|
154
|
+
export type DateSegmentName = Exclude<keyof DateSegmentLabels, "empty" | "filledMonth">;
|
|
155
|
+
export type TimeSegmentName = Exclude<keyof TimeSegmentLabels, "empty" | "filledDayPeriod">;
|
|
156
|
+
/**
|
|
157
|
+
* The `aria-valuetext` override for one segment, as an object to `v-bind`
|
|
158
|
+
* rather than a string to bind directly — and that is the whole point of it.
|
|
159
|
+
*
|
|
160
|
+
* Reka writes `aria-valuetext="Empty"` on an unfilled segment and the number
|
|
161
|
+
* on a filled one, and only the first is a hard-coded English literal: the
|
|
162
|
+
* second is `${valueNow}`, and the month's `"3 - March"` takes its month name
|
|
163
|
+
* from the field's own `locale`. So this replaces exactly the empty case and
|
|
164
|
+
* leaves the rest alone. Binding `:aria-valuetext` directly could not do that
|
|
165
|
+
* — Vue merges a fallthrough `undefined` over Reka's value and *removes* the
|
|
166
|
+
* attribute, so a filled segment would lose the number it is there to read
|
|
167
|
+
* out. An absent key merges as nothing at all, which is what `optional()`
|
|
168
|
+
* exists for elsewhere and what returning `{}` does here.
|
|
169
|
+
*
|
|
170
|
+
* Emptiness is read off the digits in the segment's own displayed value, which
|
|
171
|
+
* is sound in both directions for these six parts: every locale's placeholder
|
|
172
|
+
* for them is letters (`mm`, `jj`, `aaaa`) and every value they can hold is
|
|
173
|
+
* digits. The two parts where that would not hold are the two excluded above.
|
|
174
|
+
*/
|
|
175
|
+
export declare function emptySegmentValueText(part: string, value: string, empty: string): {
|
|
176
|
+
"aria-valuetext"?: string;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Whether a part named by Reka's `segments` slot is one this slice names.
|
|
180
|
+
*
|
|
181
|
+
* A guard rather than an index, because the slot also yields `literal` — the
|
|
182
|
+
* slashes and colons between the segments, which Reka renders `aria-hidden`
|
|
183
|
+
* and which must stay unnamed — and `timeZoneName`, which none of these five
|
|
184
|
+
* controls can produce: their values parse through `parseDate`, `parseTime` and
|
|
185
|
+
* `parseDateTime`, none of which yields a zoned value, and no prop on any of
|
|
186
|
+
* them accepts a zone. Reka's `"timezone, "` is therefore unreachable from
|
|
187
|
+
* here, and a key for it would be a key nothing could ever render.
|
|
188
|
+
*/
|
|
189
|
+
export declare function isDateSegmentPart(part: string): part is DateSegmentName;
|
|
190
|
+
/** Whether a part named by Reka's `segments` slot belongs to the clock half. */
|
|
191
|
+
export declare function isTimeSegmentPart(part: string): part is TimeSegmentName;
|
|
192
|
+
/**
|
|
193
|
+
* Everything the calendar popover says that is not a date: the panel's own
|
|
194
|
+
* name, the button that opens it, and the two that page the months.
|
|
195
|
+
*
|
|
196
|
+
* `calendar` is Reka's `CalendarRoot`/`RangeCalendarRoot` `calendarLabel` prop,
|
|
197
|
+
* whose default is the string `"Event Date"` — a name for somebody else's
|
|
198
|
+
* application, published both as the grid container's `aria-label` and inside a
|
|
199
|
+
* visually-hidden live region that a screen reader reads on every month change.
|
|
200
|
+
* It is a documented prop rather than a hard-coded literal, so it is the one
|
|
201
|
+
* name in this file that is set rather than overridden.
|
|
202
|
+
*
|
|
203
|
+
* `previousMonth` and `nextMonth` do replace literals: Reka writes
|
|
204
|
+
* `"Previous page"` and `"Next page"` on those two buttons, which is both
|
|
205
|
+
* English and wrong — what they move is a month.
|
|
206
|
+
*/
|
|
207
|
+
export interface CalendarPanelLabels {
|
|
208
|
+
/** The calendar's own name, read before the month and year on entering it. */
|
|
209
|
+
readonly calendar: string;
|
|
210
|
+
/** The button in the field that opens the calendar popover. */
|
|
211
|
+
readonly openCalendar: string;
|
|
212
|
+
/** The button that pages the calendar back one month. */
|
|
213
|
+
readonly previousMonth: string;
|
|
214
|
+
/** The button that pages the calendar on one month. */
|
|
215
|
+
readonly nextMonth: string;
|
|
216
|
+
}
|
|
217
|
+
/** Loom's English for the calendar popover. See `DATE_SEGMENT_LABELS`. */
|
|
218
|
+
export declare const CALENDAR_PANEL_LABELS: CalendarPanelLabels;
|
|
219
|
+
/**
|
|
220
|
+
* Which part of a chosen span one calendar cell plays, handed to the cell's
|
|
221
|
+
* label rather than resolved into words by the control.
|
|
222
|
+
*
|
|
223
|
+
* Four sibling keys and a joiner would be four phrases a translator cannot
|
|
224
|
+
* reorder around the date they qualify — and in several languages the qualifier
|
|
225
|
+
* does not follow the date at all. One argument carrying the variant is what
|
|
226
|
+
* keeps the whole cell name one sentence the host writes.
|
|
227
|
+
*/
|
|
228
|
+
export type RangeCellPart = "start" | "end" | "both" | "within";
|
|
229
|
+
/**
|
|
230
|
+
* The accessible name of one day in a range calendar, shared by both range
|
|
231
|
+
* controls because they say it identically and from identical facts — a day
|
|
232
|
+
* and its part in the span. `DateTimeRangePicker`'s cells carry no time: the
|
|
233
|
+
* cell *is* a day, and choosing it moves only the day.
|
|
234
|
+
*
|
|
235
|
+
* The two controls' other strings are not shared, because they differ in words
|
|
236
|
+
* and in facts. This one does neither, and a translator writing it twice would
|
|
237
|
+
* be writing it twice for no reason.
|
|
238
|
+
*/
|
|
239
|
+
export interface RangeCellLabels {
|
|
240
|
+
/**
|
|
241
|
+
* One calendar cell's accessible name, which replaces the one Reka writes
|
|
242
|
+
* rather than adding to it: a cell's part in the range has to arrive *with*
|
|
243
|
+
* the date, and an element has no second slot for a name.
|
|
244
|
+
*
|
|
245
|
+
* `part` is `undefined` for a day with no part in the range at all.
|
|
246
|
+
*/
|
|
247
|
+
readonly cell: LabelOf<{
|
|
248
|
+
locale: string;
|
|
249
|
+
date: DateValue;
|
|
250
|
+
part: RangeCellPart | undefined;
|
|
251
|
+
}>;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Loom's English for a range calendar's cells. The three fills that carry the
|
|
255
|
+
* first day, the last and the ones between are three shades of one colour,
|
|
256
|
+
* which survives neither a colour deficiency nor forced-colors mode — naming
|
|
257
|
+
* the part is what tells them apart, and it is what makes a one-day span say so
|
|
258
|
+
* once rather than announce itself twice as two different things.
|
|
259
|
+
*/
|
|
260
|
+
export declare const RANGE_CELL_LABELS: RangeCellLabels;
|
|
261
|
+
/**
|
|
262
|
+
* A month name in the control's locale, for use in `aria-valuetext`.
|
|
263
|
+
*
|
|
264
|
+
* Exported so a host building a partial vocabulary can call it from their own
|
|
265
|
+
* `filledMonth` override rather than formatting from scratch — the same reason
|
|
266
|
+
* `formatFullDay` is exported.
|
|
267
|
+
*/
|
|
268
|
+
export declare function monthName(locale: string, month: number): string;
|
|
269
|
+
/**
|
|
270
|
+
* 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.
|
|
272
|
+
*
|
|
273
|
+
* Exported because both range controls' English defaults need it and neither
|
|
274
|
+
* should own it; a host replacing those defaults formats with whatever their
|
|
275
|
+
* own application already uses and never calls this.
|
|
276
|
+
*/
|
|
277
|
+
export declare function formatFullDay(locale: string, date: DateValue): string;
|
|
278
|
+
//# sourceMappingURL=date-labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-labels.d.ts","sourceRoot":"","sources":["../../src/lib/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,MAAM,CAAC;IACvB,gCAAgC;IAChC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,wBAAwB;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClE;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,iBAkBjC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,wBAAwB;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0BAA0B;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,6DAA6D;IAC7D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,oGAAoG;IACpG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1D;AAED,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,EAAE,iBAUjC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,iBAAiB,EAAE,OAAO,GAAG,aAAa,CAAC,CAAC;AACxF,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,iBAAiB,EAAE,OAAO,GAAG,iBAAiB,CAAC,CAAC;AAqB5F;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ;IAAE,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,CAE/B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,eAAe,CAEvE;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,eAAe,CAEvE;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,mBAAmB;IAClC,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,+DAA+D;IAC/D,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,yDAAyD;IACzD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,uDAAuD;IACvD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,0EAA0E;AAC1E,eAAO,MAAM,qBAAqB,EAAE,mBAKnC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEhE;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,SAAS,CAAC;QAChB,IAAI,EAAE,aAAa,GAAG,SAAS,CAAC;KACjC,CAAC,CAAC;CACJ;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,eAQ/B,CAAC;AAaF;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQ/D;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,CAYrE"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { getLocalTimeZone as $ad063034c8620db8$export$aa8b41735afcabd2 } from "../node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/queries.js";
|
|
2
|
+
//#region src/lib/date-labels.ts
|
|
3
|
+
/**
|
|
4
|
+
* Loom's English for the date segments, co-located so it tree-shakes with the
|
|
5
|
+
* controls that use it, and exported so a host can build a partial vocabulary
|
|
6
|
+
* against the real thing rather than a transcription of it.
|
|
7
|
+
*/
|
|
8
|
+
var DATE_SEGMENT_LABELS = {
|
|
9
|
+
month: "Month",
|
|
10
|
+
day: "Day",
|
|
11
|
+
year: "Year",
|
|
12
|
+
era: "Era",
|
|
13
|
+
empty: "Not set",
|
|
14
|
+
filledMonth: ({ value, locale }) => {
|
|
15
|
+
const name = monthName(locale, value);
|
|
16
|
+
return `${String(value)} - ${name}`;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
/** Loom's English for the time segments. See `DATE_SEGMENT_LABELS`. */
|
|
20
|
+
var TIME_SEGMENT_LABELS = {
|
|
21
|
+
hour: "Hour",
|
|
22
|
+
minute: "Minute",
|
|
23
|
+
second: "Second",
|
|
24
|
+
dayPeriod: "AM or PM",
|
|
25
|
+
empty: "Not set",
|
|
26
|
+
filledDayPeriod: ({ dayPeriod }) => dayPeriod
|
|
27
|
+
};
|
|
28
|
+
var DATE_SEGMENT_PARTS = /* @__PURE__ */ new Set([
|
|
29
|
+
"month",
|
|
30
|
+
"day",
|
|
31
|
+
"year",
|
|
32
|
+
"era"
|
|
33
|
+
]);
|
|
34
|
+
var TIME_SEGMENT_PARTS = /* @__PURE__ */ new Set([
|
|
35
|
+
"hour",
|
|
36
|
+
"minute",
|
|
37
|
+
"second",
|
|
38
|
+
"dayPeriod"
|
|
39
|
+
]);
|
|
40
|
+
/**
|
|
41
|
+
* The six segments Reka reports as `aria-valuetext="Empty"` when they hold
|
|
42
|
+
* nothing — and, not by coincidence, the six that render as digits when they
|
|
43
|
+
* hold something. `dayPeriod` and `era` are absent because Reka never writes
|
|
44
|
+
* "Empty" on either: an unset `dayPeriod` reads `AM` and an unset `era` reads
|
|
45
|
+
* the placeholder's own era, both of which are already the locale's words.
|
|
46
|
+
*/
|
|
47
|
+
var EMPTIABLE_SEGMENT_PARTS = /* @__PURE__ */ new Set([
|
|
48
|
+
"day",
|
|
49
|
+
"month",
|
|
50
|
+
"year",
|
|
51
|
+
"hour",
|
|
52
|
+
"minute",
|
|
53
|
+
"second"
|
|
54
|
+
]);
|
|
55
|
+
/**
|
|
56
|
+
* The `aria-valuetext` override for one segment, as an object to `v-bind`
|
|
57
|
+
* rather than a string to bind directly — and that is the whole point of it.
|
|
58
|
+
*
|
|
59
|
+
* Reka writes `aria-valuetext="Empty"` on an unfilled segment and the number
|
|
60
|
+
* on a filled one, and only the first is a hard-coded English literal: the
|
|
61
|
+
* second is `${valueNow}`, and the month's `"3 - March"` takes its month name
|
|
62
|
+
* from the field's own `locale`. So this replaces exactly the empty case and
|
|
63
|
+
* leaves the rest alone. Binding `:aria-valuetext` directly could not do that
|
|
64
|
+
* — Vue merges a fallthrough `undefined` over Reka's value and *removes* the
|
|
65
|
+
* attribute, so a filled segment would lose the number it is there to read
|
|
66
|
+
* out. An absent key merges as nothing at all, which is what `optional()`
|
|
67
|
+
* exists for elsewhere and what returning `{}` does here.
|
|
68
|
+
*
|
|
69
|
+
* Emptiness is read off the digits in the segment's own displayed value, which
|
|
70
|
+
* is sound in both directions for these six parts: every locale's placeholder
|
|
71
|
+
* for them is letters (`mm`, `jj`, `aaaa`) and every value they can hold is
|
|
72
|
+
* digits. The two parts where that would not hold are the two excluded above.
|
|
73
|
+
*/
|
|
74
|
+
function emptySegmentValueText(part, value, empty) {
|
|
75
|
+
return EMPTIABLE_SEGMENT_PARTS.has(part) && !/\d/.test(value) ? { "aria-valuetext": empty } : {};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Whether a part named by Reka's `segments` slot is one this slice names.
|
|
79
|
+
*
|
|
80
|
+
* A guard rather than an index, because the slot also yields `literal` — the
|
|
81
|
+
* slashes and colons between the segments, which Reka renders `aria-hidden`
|
|
82
|
+
* and which must stay unnamed — and `timeZoneName`, which none of these five
|
|
83
|
+
* controls can produce: their values parse through `parseDate`, `parseTime` and
|
|
84
|
+
* `parseDateTime`, none of which yields a zoned value, and no prop on any of
|
|
85
|
+
* them accepts a zone. Reka's `"timezone, "` is therefore unreachable from
|
|
86
|
+
* here, and a key for it would be a key nothing could ever render.
|
|
87
|
+
*/
|
|
88
|
+
function isDateSegmentPart(part) {
|
|
89
|
+
return DATE_SEGMENT_PARTS.has(part);
|
|
90
|
+
}
|
|
91
|
+
/** Whether a part named by Reka's `segments` slot belongs to the clock half. */
|
|
92
|
+
function isTimeSegmentPart(part) {
|
|
93
|
+
return TIME_SEGMENT_PARTS.has(part);
|
|
94
|
+
}
|
|
95
|
+
/** Loom's English for the calendar popover. See `DATE_SEGMENT_LABELS`. */
|
|
96
|
+
var CALENDAR_PANEL_LABELS = {
|
|
97
|
+
calendar: "Calendar",
|
|
98
|
+
openCalendar: "Open calendar",
|
|
99
|
+
previousMonth: "Previous month",
|
|
100
|
+
nextMonth: "Next month"
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Loom's English for a range calendar's cells. The three fills that carry the
|
|
104
|
+
* first day, the last and the ones between are three shades of one colour,
|
|
105
|
+
* which survives neither a colour deficiency nor forced-colors mode — naming
|
|
106
|
+
* the part is what tells them apart, and it is what makes a one-day span say so
|
|
107
|
+
* once rather than announce itself twice as two different things.
|
|
108
|
+
*/
|
|
109
|
+
var RANGE_CELL_LABELS = { cell: ({ locale, date, part }) => {
|
|
110
|
+
const full = formatFullDay(locale, date);
|
|
111
|
+
if (part === "both") return `${full}, the whole range, first and last day`;
|
|
112
|
+
if (part === "start") return `${full}, first day of the range`;
|
|
113
|
+
if (part === "end") return `${full}, last day of the range`;
|
|
114
|
+
return part === "within" ? `${full}, within the range` : full;
|
|
115
|
+
} };
|
|
116
|
+
var dayFormatters = /* @__PURE__ */ new Map();
|
|
117
|
+
var monthFormatters = /* @__PURE__ */ new Map();
|
|
118
|
+
/**
|
|
119
|
+
* A month name in the control's locale, for use in `aria-valuetext`.
|
|
120
|
+
*
|
|
121
|
+
* Exported so a host building a partial vocabulary can call it from their own
|
|
122
|
+
* `filledMonth` override rather than formatting from scratch — the same reason
|
|
123
|
+
* `formatFullDay` is exported.
|
|
124
|
+
*/
|
|
125
|
+
function monthName(locale, month) {
|
|
126
|
+
let formatter = monthFormatters.get(locale);
|
|
127
|
+
if (!formatter) {
|
|
128
|
+
formatter = new Intl.DateTimeFormat(locale, { month: "long" });
|
|
129
|
+
monthFormatters.set(locale, formatter);
|
|
130
|
+
}
|
|
131
|
+
return formatter.format(new Date(2026, month - 1, 1));
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* 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.
|
|
136
|
+
*
|
|
137
|
+
* Exported because both range controls' English defaults need it and neither
|
|
138
|
+
* should own it; a host replacing those defaults formats with whatever their
|
|
139
|
+
* own application already uses and never calls this.
|
|
140
|
+
*/
|
|
141
|
+
function formatFullDay(locale, date) {
|
|
142
|
+
let formatter = dayFormatters.get(locale);
|
|
143
|
+
if (!formatter) {
|
|
144
|
+
formatter = new Intl.DateTimeFormat(locale, {
|
|
145
|
+
weekday: "long",
|
|
146
|
+
day: "numeric",
|
|
147
|
+
month: "long",
|
|
148
|
+
year: "numeric"
|
|
149
|
+
});
|
|
150
|
+
dayFormatters.set(locale, formatter);
|
|
151
|
+
}
|
|
152
|
+
return formatter.format(date.toDate($ad063034c8620db8$export$aa8b41735afcabd2()));
|
|
153
|
+
}
|
|
154
|
+
//#endregion
|
|
155
|
+
export { CALENDAR_PANEL_LABELS, DATE_SEGMENT_LABELS, RANGE_CELL_LABELS, TIME_SEGMENT_LABELS, emptySegmentValueText, formatFullDay, isDateSegmentPart, isTimeSegmentPart, monthName };
|
|
156
|
+
|
|
157
|
+
//# sourceMappingURL=date-labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-labels.js","names":[],"sources":["../../src/lib/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;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;;AA6BA,IAAa,wBAA6C;CACxD,UAAU;CACV,cAAc;CACd,eAAe;CACf,WAAW;AACb;;;;;;;;AA6CA,IAAa,oBAAqC,EAChD,OAAO,EAAE,QAAQ,MAAM,WAAW;CAChC,MAAM,OAAO,cAAc,QAAQ,IAAI;CACvC,IAAI,SAAS,QAAQ,OAAO,GAAG,KAAK;CACpC,IAAI,SAAS,SAAS,OAAO,GAAG,KAAK;CACrC,IAAI,SAAS,OAAO,OAAO,GAAG,KAAK;CACnC,OAAO,SAAS,WAAW,GAAG,KAAK,sBAAsB;AAC3D,EACF;AAMA,IAAM,gCAAgB,IAAI,IAAiC;AAK3D,IAAM,kCAAkB,IAAI,IAAiC;;;;;;;;AAS7D,SAAgB,UAAU,QAAgB,OAAuB;CAC/D,IAAI,YAAY,gBAAgB,IAAI,MAAM;CAC1C,IAAI,CAAC,WAAW;EACd,YAAY,IAAI,KAAK,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"}
|