@ecoma-io/loom 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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
package/dist/styles/global.css
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
html {
|
|
41
|
+
color-scheme: light dark;
|
|
41
42
|
-webkit-font-smoothing: antialiased;
|
|
42
43
|
-moz-osx-font-smoothing: grayscale;
|
|
43
44
|
text-rendering: optimizeLegibility;
|
|
@@ -69,6 +70,56 @@
|
|
|
69
70
|
font-family: var(--font-mono);
|
|
70
71
|
}
|
|
71
72
|
|
|
73
|
+
/* ---- Vendor corrections ----------------------------------------------------
|
|
74
|
+
* Rules that exist only because a dependency renders something Loom cannot
|
|
75
|
+
* reach from its own markup. Each one is coupled to that dependency's DOM, so
|
|
76
|
+
* each names what it couples to and is pinned by an end-to-end test.
|
|
77
|
+
*
|
|
78
|
+
* `StepperRoot` renders its own position announcement — "Step 3 of 5" — as a
|
|
79
|
+
* text node inside its render function. There is no prop, no slot and no
|
|
80
|
+
* attribute for it, so it is the one string in this library that a binding on
|
|
81
|
+
* Loom's side cannot replace, and it is English however the host is localised.
|
|
82
|
+
* `Stepper.vue` renders a translatable one beside it and this takes Reka's out
|
|
83
|
+
* of the accessibility tree, leaving exactly one region to announce a step
|
|
84
|
+
* change instead of two saying it in two languages.
|
|
85
|
+
*
|
|
86
|
+
* `display: none` rather than `aria-hidden="true"`, and the difference is not
|
|
87
|
+
* stylistic. `aria-hidden` on an element that is *already* a live region is not
|
|
88
|
+
* something the ARIA specification settles — implementations differ on whether
|
|
89
|
+
* a region that was live at announcement time is silenced by it — and a fix
|
|
90
|
+
* whose correctness cannot be checked without a screen reader on every platform
|
|
91
|
+
* is not a fix. Removal from the box tree is unambiguous: an element that
|
|
92
|
+
* generates no box is in no accessibility tree, so nothing announces it.
|
|
93
|
+
*
|
|
94
|
+
* Scoped to `[data-loom-stepper]`, so a host mounting Reka's Stepper directly
|
|
95
|
+
* keeps its own behaviour. `:not([data-loom-live])` is what spares Loom's — the
|
|
96
|
+
* two are told apart by what Loom marked, not by which came first, so neither
|
|
97
|
+
* a change in Reka's render order nor one in Loom's can silence the wrong one. */
|
|
98
|
+
[data-loom-stepper] > [role="status"]:not([data-loom-live]) {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* ---- PWA window controls overlay ------------------------------------------
|
|
103
|
+
* When a PWA is installed and the `window-controls-overlay` feature is visible,
|
|
104
|
+
* the browser draws native minimize/maximize/close buttons over the app's title
|
|
105
|
+
* bar. The app must leave space for them. This is a PWA concern (not Electron
|
|
106
|
+
* or Tauri, which handle their own chrome), and it is CSS-only — no JavaScript
|
|
107
|
+
* runtime dependency.
|
|
108
|
+
*
|
|
109
|
+
* The overlay region is exposed through `env(titlebar-area-x)` and friends.
|
|
110
|
+
* The `[data-loom-titlebar]` attribute is set by TitleBar, which knows its own
|
|
111
|
+
* layout. When the overlay is active, the brand cluster's left padding expands
|
|
112
|
+
* to clear the native controls on the left edge (same corner as macOS), and
|
|
113
|
+
* the drag region continues to work over the full bar width. */
|
|
114
|
+
@supports (window-controls-overlay: visible) {
|
|
115
|
+
[data-loom-titlebar] {
|
|
116
|
+
/* Narrow the drag spacer so the title text is not pushed too far right.
|
|
117
|
+
* The brand cluster already handles its own left offset via the platform
|
|
118
|
+
* prop; this rule is for PWA installs where the host did not set macOS. */
|
|
119
|
+
padding-left: env(titlebar-area-x, 0px);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
72
123
|
/* ---- The motion keyframe library ------------------------------------------
|
|
73
124
|
* Named and reusable; `theme.css` maps each to an `animate-*` utility. All of
|
|
74
125
|
* them are short and purposeful, and nothing loops for decoration except the
|
|
@@ -109,36 +160,84 @@
|
|
|
109
160
|
}
|
|
110
161
|
}
|
|
111
162
|
|
|
112
|
-
|
|
163
|
+
/* ---- The exits. Each mirrors the entrance above it, and the pairing is the
|
|
164
|
+
* point: a surface that rose 4px on the way in falls 4px on the way out rather
|
|
165
|
+
* than dissolving in place, so the eye reads one gesture reversed instead of
|
|
166
|
+
* two unrelated ones. `theme.css` carries the timing argument for why they are
|
|
167
|
+
* not simply the entrances run backwards. */
|
|
168
|
+
|
|
169
|
+
@keyframes fade-out {
|
|
113
170
|
from {
|
|
114
|
-
|
|
171
|
+
opacity: 1;
|
|
115
172
|
}
|
|
116
173
|
to {
|
|
117
|
-
|
|
174
|
+
opacity: 0;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
@keyframes fade-fall {
|
|
179
|
+
from {
|
|
180
|
+
opacity: 1;
|
|
181
|
+
transform: translateY(0);
|
|
182
|
+
}
|
|
183
|
+
to {
|
|
184
|
+
opacity: 0;
|
|
185
|
+
transform: translateY(4px);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
@keyframes scale-out {
|
|
190
|
+
from {
|
|
191
|
+
opacity: 1;
|
|
192
|
+
transform: scale(1);
|
|
193
|
+
}
|
|
194
|
+
to {
|
|
195
|
+
opacity: 0;
|
|
196
|
+
transform: scale(0.97);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* An edge-anchored panel leaving along its own axis.
|
|
201
|
+
*
|
|
202
|
+
* These animate `translate`, not `transform`, and the distinction is the whole
|
|
203
|
+
* reason they are usable: Reka writes a live swipe onto a drawer as `transform`
|
|
204
|
+
* and leaves the rendering to the component, so a keyframe on `transform` would
|
|
205
|
+
* overwrite a gesture mid-drag. On `translate` the two properties compose, the
|
|
206
|
+
* same way the entry `@starting-style` transition already does.
|
|
207
|
+
*
|
|
208
|
+
* Only the `to` frame is declared. The implicit `from` is the element's own
|
|
209
|
+
* computed value, so a panel that is already part-way out under a finger leaves
|
|
210
|
+
* from where it actually sits rather than snapping back to the origin first. */
|
|
211
|
+
@keyframes slide-out-to-left {
|
|
212
|
+
to {
|
|
213
|
+
translate: -100% 0;
|
|
118
214
|
}
|
|
119
215
|
}
|
|
120
216
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
0%,
|
|
125
|
-
100% {
|
|
126
|
-
box-shadow: 0 0 0 0 transparent;
|
|
217
|
+
@keyframes slide-out-to-right {
|
|
218
|
+
to {
|
|
219
|
+
translate: 100% 0;
|
|
127
220
|
}
|
|
128
|
-
|
|
129
|
-
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@keyframes slide-out-to-top {
|
|
224
|
+
to {
|
|
225
|
+
translate: 0 -100%;
|
|
130
226
|
}
|
|
131
227
|
}
|
|
132
228
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
229
|
+
@keyframes slide-out-to-bottom {
|
|
230
|
+
to {
|
|
231
|
+
translate: 0 100%;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@keyframes shimmer {
|
|
137
236
|
from {
|
|
138
|
-
background-position:
|
|
237
|
+
background-position: -180% 0;
|
|
139
238
|
}
|
|
140
239
|
to {
|
|
141
|
-
background-position:
|
|
240
|
+
background-position: 180% 0;
|
|
142
241
|
}
|
|
143
242
|
}
|
|
144
243
|
|
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
// `import.meta.dirname` (Node 24) rather than `import.meta.url`, because the
|
|
5
|
+
// file is rewritten by Vitest's transform — `new URL(…, import.meta.url)`
|
|
6
|
+
// gets a bare path as its base and dies with a scheme error.
|
|
7
|
+
const THEME_CSS = `${import.meta.dirname}/theme.css`;
|
|
8
|
+
|
|
9
|
+
// ---- Token parsing ----------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
type TokenMap = Map<string, string>;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Every `--name: value;` declaration inside a given block of CSS.
|
|
15
|
+
* The regex is intentionally simple: it matches any `--custom-property: …;`
|
|
16
|
+
* line, and `parseHsl` below validates the shape of the value.
|
|
17
|
+
*/
|
|
18
|
+
function extractDeclarations(block: string): TokenMap {
|
|
19
|
+
const entries = [...block.matchAll(/--([\w-]+):\s*([^;]+);/g)]
|
|
20
|
+
.map((m): readonly [string, string] | null => {
|
|
21
|
+
const name = m[1];
|
|
22
|
+
const value = m[2];
|
|
23
|
+
if (name === undefined || value === undefined) return null;
|
|
24
|
+
return [name, value.trim()] as const;
|
|
25
|
+
})
|
|
26
|
+
.filter((e): e is readonly [string, string] => e !== null);
|
|
27
|
+
return new Map(entries);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Read the light tokens from the `@theme static { }` block. The regex is
|
|
32
|
+
* lazy (`*?`) so it stops at the first closing `}` on its own line — the
|
|
33
|
+
* `@theme static` block itself — rather than reaching past it into the
|
|
34
|
+
* dark-theme overrides that follow.
|
|
35
|
+
*/
|
|
36
|
+
async function readLightTokens(): Promise<TokenMap> {
|
|
37
|
+
const css = await readFile(THEME_CSS, "utf8");
|
|
38
|
+
const block = /@theme static \{([\s\S]*?)\n\}/.exec(css)?.[1];
|
|
39
|
+
if (block === undefined) throw new Error(`${THEME_CSS}: no "@theme static {" block found.`);
|
|
40
|
+
return extractDeclarations(block);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Read the dark tokens from the `:root[data-theme="dark"] { }` block.
|
|
45
|
+
* Uses brace-depth counting to find the matching close brace, because the
|
|
46
|
+
* block may contain nested comments or multi-line values that a simple
|
|
47
|
+
* regex cannot handle.
|
|
48
|
+
*
|
|
49
|
+
* The marker `:root[data-theme="dark"] {` (with the opening brace) is used
|
|
50
|
+
* rather than just the selector string, because the file's header comment
|
|
51
|
+
* also mentions `:root[data-theme="dark"]` in prose — and a bare `indexOf`
|
|
52
|
+
* would find that first and then latch onto the wrong opening brace.
|
|
53
|
+
*/
|
|
54
|
+
async function readDarkTokens(): Promise<TokenMap> {
|
|
55
|
+
const css = await readFile(THEME_CSS, "utf8");
|
|
56
|
+
const marker = ':root[data-theme="dark"] {';
|
|
57
|
+
const start = css.indexOf(marker);
|
|
58
|
+
if (start === -1) throw new Error(`${THEME_CSS}: no dark theme block found.`);
|
|
59
|
+
|
|
60
|
+
const openBrace = start + marker.length - 1;
|
|
61
|
+
if (openBrace === -1) throw new Error(`${THEME_CSS}: dark theme block has no opening brace.`);
|
|
62
|
+
|
|
63
|
+
let depth = 0;
|
|
64
|
+
let end = -1;
|
|
65
|
+
for (let i = openBrace; i < css.length; i++) {
|
|
66
|
+
if (css[i] === "{") depth++;
|
|
67
|
+
else if (css[i] === "}") {
|
|
68
|
+
depth--;
|
|
69
|
+
if (depth === 0) {
|
|
70
|
+
end = i;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (end === -1) throw new Error(`${THEME_CSS}: dark theme block is never closed.`);
|
|
76
|
+
|
|
77
|
+
return extractDeclarations(css.slice(openBrace + 1, end));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// ---- Colour math ------------------------------------------------------------
|
|
81
|
+
|
|
82
|
+
interface Rgb {
|
|
83
|
+
readonly r: number;
|
|
84
|
+
readonly g: number;
|
|
85
|
+
readonly b: number;
|
|
86
|
+
readonly a: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Parse `hsl(H S% L%)` and the `/ alpha` form. Returns null for values
|
|
91
|
+
* that are not a single HSL colour (shadows, durations, etc.).
|
|
92
|
+
*/
|
|
93
|
+
function parseHsl(value: string): Rgb | null {
|
|
94
|
+
const match =
|
|
95
|
+
/^hsl\(\s*(\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)%\s+(\d+(?:\.\d+)?)%\s*\)$/.exec(value) ??
|
|
96
|
+
/^hsl\(\s*(\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)%\s+(\d+(?:\.\d+)?)%\s*\/\s*(\d+(?:\.\d+)?)%\s*\)$/.exec(
|
|
97
|
+
value,
|
|
98
|
+
);
|
|
99
|
+
if (!match) return null;
|
|
100
|
+
const h = Number(match[1]);
|
|
101
|
+
const s = Number(match[2]) / 100;
|
|
102
|
+
const l = Number(match[3]) / 100;
|
|
103
|
+
const a = match[4] === undefined ? 1 : Number(match[4]) / 100;
|
|
104
|
+
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
105
|
+
const hPrime = h / 60;
|
|
106
|
+
const x = c * (1 - Math.abs((hPrime % 2) - 1));
|
|
107
|
+
const m = l - c / 2;
|
|
108
|
+
let rgb: [number, number, number];
|
|
109
|
+
if (hPrime < 1) rgb = [c, x, 0];
|
|
110
|
+
else if (hPrime < 2) rgb = [x, c, 0];
|
|
111
|
+
else if (hPrime < 3) rgb = [0, c, x];
|
|
112
|
+
else if (hPrime < 4) rgb = [0, x, c];
|
|
113
|
+
else if (hPrime < 5) rgb = [x, 0, c];
|
|
114
|
+
else rgb = [c, 0, x];
|
|
115
|
+
return {
|
|
116
|
+
r: Math.round((rgb[0] + m) * 255),
|
|
117
|
+
g: Math.round((rgb[1] + m) * 255),
|
|
118
|
+
b: Math.round((rgb[2] + m) * 255),
|
|
119
|
+
a,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function linear(v: number): number {
|
|
124
|
+
return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function luminance(c: Rgb): number {
|
|
128
|
+
return 0.2126 * linear(c.r / 255) + 0.7152 * linear(c.g / 255) + 0.0722 * linear(c.b / 255);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function contrastRatio(a: Rgb, b: Rgb): number {
|
|
132
|
+
const la = luminance(a);
|
|
133
|
+
const lb = luminance(b);
|
|
134
|
+
return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Resolve a token name to an opaque HSL colour, or throw. A missing or
|
|
139
|
+
* non-HSL token is a structural defect the test must not silently skip.
|
|
140
|
+
*/
|
|
141
|
+
function colorOf(tokens: TokenMap, name: string, theme: string): Rgb {
|
|
142
|
+
const value = tokens.get(name);
|
|
143
|
+
const color = value === undefined ? null : parseHsl(value);
|
|
144
|
+
if (!color) throw new Error(`"${name}" is not an opaque hsl token in the ${theme} theme`);
|
|
145
|
+
if (color.a !== 1) throw new Error(`"${name}" carries an alpha; its ratio depends on the page`);
|
|
146
|
+
return color;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// ---- Contrast floors --------------------------------------------------------
|
|
150
|
+
|
|
151
|
+
/** WCAG 1.4.3 AA for normal text. */
|
|
152
|
+
const TEXT_FLOOR = 4.5;
|
|
153
|
+
/** WCAG 1.4.11 AA for graphical objects and UI components. */
|
|
154
|
+
const GRAPHICAL_FLOOR = 3;
|
|
155
|
+
|
|
156
|
+
// ---- Pairings to verify -----------------------------------------------------
|
|
157
|
+
// Each pairing names a foreground (text/graphical) token against a background
|
|
158
|
+
// token. The same pairs are checked for both themes.
|
|
159
|
+
|
|
160
|
+
interface Pairing {
|
|
161
|
+
readonly fg: string;
|
|
162
|
+
readonly bg: string;
|
|
163
|
+
readonly floor: number;
|
|
164
|
+
readonly label: string;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const TEXT_PAIRINGS: Pairing[] = [
|
|
168
|
+
// Structural text-on-background
|
|
169
|
+
{ fg: "color-foreground", bg: "color-background", floor: TEXT_FLOOR, label: "body text" },
|
|
170
|
+
{ fg: "color-foreground", bg: "color-card", floor: TEXT_FLOOR, label: "card text" },
|
|
171
|
+
{ fg: "color-foreground", bg: "color-popover", floor: TEXT_FLOOR, label: "popover text" },
|
|
172
|
+
{
|
|
173
|
+
fg: "color-card-foreground",
|
|
174
|
+
bg: "color-card",
|
|
175
|
+
floor: TEXT_FLOOR,
|
|
176
|
+
label: "card-foreground on card",
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
fg: "color-popover-foreground",
|
|
180
|
+
bg: "color-popover",
|
|
181
|
+
floor: TEXT_FLOOR,
|
|
182
|
+
label: "popover-foreground on popover",
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
fg: "color-muted-foreground",
|
|
186
|
+
bg: "color-background",
|
|
187
|
+
floor: TEXT_FLOOR,
|
|
188
|
+
label: "secondary text",
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
fg: "color-muted-foreground",
|
|
192
|
+
bg: "color-card",
|
|
193
|
+
floor: TEXT_FLOOR,
|
|
194
|
+
label: "secondary text on card",
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
fg: "color-muted-foreground",
|
|
198
|
+
bg: "color-muted",
|
|
199
|
+
floor: TEXT_FLOOR,
|
|
200
|
+
label: "secondary text on muted",
|
|
201
|
+
},
|
|
202
|
+
{ fg: "color-subtle-foreground", bg: "color-subtle", floor: TEXT_FLOOR, label: "subtle text" },
|
|
203
|
+
{
|
|
204
|
+
fg: "color-secondary-foreground",
|
|
205
|
+
bg: "color-secondary",
|
|
206
|
+
floor: TEXT_FLOOR,
|
|
207
|
+
label: "secondary text on secondary",
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
// Action colour labels
|
|
211
|
+
{
|
|
212
|
+
fg: "color-primary-foreground",
|
|
213
|
+
bg: "color-primary",
|
|
214
|
+
floor: TEXT_FLOOR,
|
|
215
|
+
label: "primary button label",
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
fg: "color-accent-foreground",
|
|
219
|
+
bg: "color-accent",
|
|
220
|
+
floor: TEXT_FLOOR,
|
|
221
|
+
label: "accent button label",
|
|
222
|
+
},
|
|
223
|
+
|
|
224
|
+
// Functional colour labels
|
|
225
|
+
{
|
|
226
|
+
fg: "color-destructive-foreground",
|
|
227
|
+
bg: "color-destructive",
|
|
228
|
+
floor: TEXT_FLOOR,
|
|
229
|
+
label: "destructive button label",
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
fg: "color-success-foreground",
|
|
233
|
+
bg: "color-success",
|
|
234
|
+
floor: TEXT_FLOOR,
|
|
235
|
+
label: "success label",
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
fg: "color-warning-foreground",
|
|
239
|
+
bg: "color-warning",
|
|
240
|
+
floor: TEXT_FLOOR,
|
|
241
|
+
label: "warning label",
|
|
242
|
+
},
|
|
243
|
+
{ fg: "color-info-foreground", bg: "color-info", floor: TEXT_FLOOR, label: "info label" },
|
|
244
|
+
|
|
245
|
+
// Text on muted surfaces (foreground token, which should always be readable)
|
|
246
|
+
{
|
|
247
|
+
fg: "color-foreground",
|
|
248
|
+
bg: "color-primary-muted",
|
|
249
|
+
floor: TEXT_FLOOR,
|
|
250
|
+
label: "text on primary-muted",
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
fg: "color-foreground",
|
|
254
|
+
bg: "color-destructive-muted",
|
|
255
|
+
floor: TEXT_FLOOR,
|
|
256
|
+
label: "text on destructive-muted",
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
fg: "color-foreground",
|
|
260
|
+
bg: "color-success-muted",
|
|
261
|
+
floor: TEXT_FLOOR,
|
|
262
|
+
label: "text on success-muted",
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
fg: "color-foreground",
|
|
266
|
+
bg: "color-warning-muted",
|
|
267
|
+
floor: TEXT_FLOOR,
|
|
268
|
+
label: "text on warning-muted",
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
fg: "color-foreground",
|
|
272
|
+
bg: "color-info-muted",
|
|
273
|
+
floor: TEXT_FLOOR,
|
|
274
|
+
label: "text on info-muted",
|
|
275
|
+
},
|
|
276
|
+
];
|
|
277
|
+
|
|
278
|
+
const GRAPHICAL_PAIRINGS: Pairing[] = [
|
|
279
|
+
// Graphical-object tokens
|
|
280
|
+
{
|
|
281
|
+
fg: "color-muted-foreground-soft",
|
|
282
|
+
bg: "color-background",
|
|
283
|
+
floor: GRAPHICAL_FLOOR,
|
|
284
|
+
label: "muted-soft on background",
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
fg: "color-muted-foreground-soft",
|
|
288
|
+
bg: "color-card",
|
|
289
|
+
floor: GRAPHICAL_FLOOR,
|
|
290
|
+
label: "muted-soft on card",
|
|
291
|
+
},
|
|
292
|
+
|
|
293
|
+
// Functional colours as graphical indicators on their surfaces
|
|
294
|
+
{
|
|
295
|
+
fg: "color-primary",
|
|
296
|
+
bg: "color-background",
|
|
297
|
+
floor: GRAPHICAL_FLOOR,
|
|
298
|
+
label: "primary indicator",
|
|
299
|
+
},
|
|
300
|
+
{ fg: "color-accent", bg: "color-background", floor: GRAPHICAL_FLOOR, label: "accent indicator" },
|
|
301
|
+
{
|
|
302
|
+
fg: "color-destructive",
|
|
303
|
+
bg: "color-background",
|
|
304
|
+
floor: GRAPHICAL_FLOOR,
|
|
305
|
+
label: "destructive indicator",
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
fg: "color-success",
|
|
309
|
+
bg: "color-background",
|
|
310
|
+
floor: GRAPHICAL_FLOOR,
|
|
311
|
+
label: "success indicator",
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
fg: "color-warning",
|
|
315
|
+
bg: "color-background",
|
|
316
|
+
floor: GRAPHICAL_FLOOR,
|
|
317
|
+
label: "warning indicator",
|
|
318
|
+
},
|
|
319
|
+
{ fg: "color-info", bg: "color-background", floor: GRAPHICAL_FLOOR, label: "info indicator" },
|
|
320
|
+
|
|
321
|
+
// Focus ring
|
|
322
|
+
{ fg: "color-ring", bg: "color-background", floor: GRAPHICAL_FLOOR, label: "focus ring" },
|
|
323
|
+
|
|
324
|
+
// Functional hues on their own muted surface (icons, indicators)
|
|
325
|
+
{
|
|
326
|
+
fg: "color-primary",
|
|
327
|
+
bg: "color-primary-muted",
|
|
328
|
+
floor: GRAPHICAL_FLOOR,
|
|
329
|
+
label: "primary on primary-muted",
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
fg: "color-accent",
|
|
333
|
+
bg: "color-accent-muted",
|
|
334
|
+
floor: GRAPHICAL_FLOOR,
|
|
335
|
+
label: "accent on accent-muted",
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
fg: "color-destructive",
|
|
339
|
+
bg: "color-destructive-muted",
|
|
340
|
+
floor: GRAPHICAL_FLOOR,
|
|
341
|
+
label: "destructive on destructive-muted",
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
fg: "color-success",
|
|
345
|
+
bg: "color-success-muted",
|
|
346
|
+
floor: GRAPHICAL_FLOOR,
|
|
347
|
+
label: "success on success-muted",
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
fg: "color-warning",
|
|
351
|
+
bg: "color-warning-muted",
|
|
352
|
+
floor: GRAPHICAL_FLOOR,
|
|
353
|
+
label: "warning on warning-muted",
|
|
354
|
+
},
|
|
355
|
+
{ fg: "color-info", bg: "color-info-muted", floor: GRAPHICAL_FLOOR, label: "info on info-muted" },
|
|
356
|
+
];
|
|
357
|
+
|
|
358
|
+
const ALL_PAIRINGS = [...TEXT_PAIRINGS, ...GRAPHICAL_PAIRINGS];
|
|
359
|
+
|
|
360
|
+
// ---- Tests ------------------------------------------------------------------
|
|
361
|
+
|
|
362
|
+
describe("Light theme contrast", () => {
|
|
363
|
+
it("meets the contrast floor for every structural pairing", async () => {
|
|
364
|
+
const tokens = await readLightTokens();
|
|
365
|
+
for (const { fg, bg, floor, label } of ALL_PAIRINGS) {
|
|
366
|
+
const fgColor = colorOf(tokens, fg, "light");
|
|
367
|
+
const bgColor = colorOf(tokens, bg, "light");
|
|
368
|
+
const cr = contrastRatio(fgColor, bgColor);
|
|
369
|
+
expect(
|
|
370
|
+
cr,
|
|
371
|
+
`${label}: ${fg} on ${bg} = ${cr.toFixed(2)}:1 (needs ${String(floor)})`,
|
|
372
|
+
).toBeGreaterThanOrEqual(floor);
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
describe("Dark theme contrast", () => {
|
|
378
|
+
it("meets the contrast floor for every structural pairing", async () => {
|
|
379
|
+
const tokens = await readDarkTokens();
|
|
380
|
+
for (const { fg, bg, floor, label } of ALL_PAIRINGS) {
|
|
381
|
+
const fgColor = colorOf(tokens, fg, "dark");
|
|
382
|
+
const bgColor = colorOf(tokens, bg, "dark");
|
|
383
|
+
const cr = contrastRatio(fgColor, bgColor);
|
|
384
|
+
expect(
|
|
385
|
+
cr,
|
|
386
|
+
`${label}: ${fg} on ${bg} = ${cr.toFixed(2)}:1 (needs ${String(floor)})`,
|
|
387
|
+
).toBeGreaterThanOrEqual(floor);
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
describe("Elevation hierarchy", () => {
|
|
393
|
+
it("light: sunken < background < card <= popover (by lightness)", async () => {
|
|
394
|
+
const tokens = await readLightTokens();
|
|
395
|
+
// In light mode, higher elevation = higher lightness
|
|
396
|
+
const sunkenL = luminance(colorOf(tokens, "color-sunken", "light"));
|
|
397
|
+
const backgroundL = luminance(colorOf(tokens, "color-background", "light"));
|
|
398
|
+
const cardL = luminance(colorOf(tokens, "color-card", "light"));
|
|
399
|
+
const popoverL = luminance(colorOf(tokens, "color-popover", "light"));
|
|
400
|
+
expect(sunkenL, "sunken < background").toBeLessThan(backgroundL);
|
|
401
|
+
expect(backgroundL, "background < card").toBeLessThan(cardL);
|
|
402
|
+
expect(cardL, "card <= popover").toBeLessThanOrEqual(popoverL);
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
it("dark: sunken < background < card < popover (by lightness)", async () => {
|
|
406
|
+
const tokens = await readDarkTokens();
|
|
407
|
+
// In dark mode, higher elevation = higher lightness (lighter background)
|
|
408
|
+
const sunkenL = luminance(colorOf(tokens, "color-sunken", "dark"));
|
|
409
|
+
const backgroundL = luminance(colorOf(tokens, "color-background", "dark"));
|
|
410
|
+
const cardL = luminance(colorOf(tokens, "color-card", "dark"));
|
|
411
|
+
const popoverL = luminance(colorOf(tokens, "color-popover", "dark"));
|
|
412
|
+
expect(sunkenL, "sunken < background").toBeLessThan(backgroundL);
|
|
413
|
+
expect(backgroundL, "background < card").toBeLessThan(cardL);
|
|
414
|
+
expect(cardL, "card < popover").toBeLessThan(popoverL);
|
|
415
|
+
});
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
describe("Text prominence hierarchy", () => {
|
|
419
|
+
it("light: muted-foreground-soft < muted-foreground < foreground (by luminance)", async () => {
|
|
420
|
+
const tokens = await readLightTokens();
|
|
421
|
+
// In light mode, less prominent text = higher luminance (lighter on light)
|
|
422
|
+
const softL = luminance(colorOf(tokens, "color-muted-foreground-soft", "light"));
|
|
423
|
+
const mutedL = luminance(colorOf(tokens, "color-muted-foreground", "light"));
|
|
424
|
+
const fgL = luminance(colorOf(tokens, "color-foreground", "light"));
|
|
425
|
+
expect(softL, "soft > muted (lighter = less prominent)").toBeGreaterThan(mutedL);
|
|
426
|
+
expect(mutedL, "muted > foreground (lighter = less prominent)").toBeGreaterThan(fgL);
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
it("dark: muted-foreground-soft < muted-foreground < foreground (by luminance)", async () => {
|
|
430
|
+
const tokens = await readDarkTokens();
|
|
431
|
+
// In dark mode, less prominent text = lower luminance (darker on dark)
|
|
432
|
+
const softL = luminance(colorOf(tokens, "color-muted-foreground-soft", "dark"));
|
|
433
|
+
const mutedL = luminance(colorOf(tokens, "color-muted-foreground", "dark"));
|
|
434
|
+
const fgL = luminance(colorOf(tokens, "color-foreground", "dark"));
|
|
435
|
+
expect(softL, "soft < muted (darker = less prominent)").toBeLessThan(mutedL);
|
|
436
|
+
expect(mutedL, "muted < foreground (darker = less prominent)").toBeLessThan(fgL);
|
|
437
|
+
});
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
describe("Border visibility hierarchy", () => {
|
|
441
|
+
it("light: border < input < border-strong (by luminance)", async () => {
|
|
442
|
+
const tokens = await readLightTokens();
|
|
443
|
+
// In light mode, more visible border = lower luminance (darker on light)
|
|
444
|
+
const borderL = luminance(colorOf(tokens, "color-border", "light"));
|
|
445
|
+
const inputL = luminance(colorOf(tokens, "color-input", "light"));
|
|
446
|
+
const strongL = luminance(colorOf(tokens, "color-border-strong", "light"));
|
|
447
|
+
expect(borderL, "border > input (lighter = less visible)").toBeGreaterThan(inputL);
|
|
448
|
+
expect(inputL, "input > strong (lighter = less visible)").toBeGreaterThan(strongL);
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
it("dark: border < input < border-strong (by luminance)", async () => {
|
|
452
|
+
const tokens = await readDarkTokens();
|
|
453
|
+
// In dark mode, more visible border = higher luminance (lighter on dark)
|
|
454
|
+
const borderL = luminance(colorOf(tokens, "color-border", "dark"));
|
|
455
|
+
const inputL = luminance(colorOf(tokens, "color-input", "dark"));
|
|
456
|
+
const strongL = luminance(colorOf(tokens, "color-border-strong", "dark"));
|
|
457
|
+
expect(borderL, "border < input (darker = less visible)").toBeLessThan(inputL);
|
|
458
|
+
expect(inputL, "input < strong (darker = less visible)").toBeLessThan(strongL);
|
|
459
|
+
});
|
|
460
|
+
});
|