@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/primitives/Progress/Progress.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { ProgressRoot, ProgressIndicator } from \"reka-ui\";\nimport { cn } from \"../../lib/cn\";\n\n/**\n * Progress — determinate progress bar for a task whose extent as a percentage\n * is known (upload %, step 3 of 5). `modelValue` null/undefined renders the\n * *indeterminate* state — an empty track, since there is no percentage yet to\n * paint. For a wait of unknown duration with no percentage at all, use\n * Spinner instead of guessing a Progress value.\n *\n * Built on Reka UI's Progress: role=\"progressbar\" + aria-valuenow/min/max set\n * on the root automatically. `ariaLabel`/`ariaLabelledby` are bound onto\n * ProgressRoot (fallthrough overrides Reka's own generated \"`NN%`\" label) so\n * the accessible name describes *what* is loading, not just how much.\n */\nconst props = withDefaults(\n defineProps<{\n /** The completed amount, 0–`max`; `null`/omitted renders indeterminate. */\n modelValue?: number | null;\n /** The value that reads as 100% complete. */\n max?: number;\n /** Accessible name describing the task, overriding Reka's default `NN%` label. */\n ariaLabel?: string;\n /** Accessible name sourced from another element's id, in place of `ariaLabel`. */\n ariaLabelledby?: string;\n }>(),\n {\n max: 100,\n },\n);\n\n/**\n * The value the bar itself is given, clamped into [0, max]; null while\n * indeterminate. The clamp has to happen here rather than only on the way to\n * the transform below: `aria-valuenow` is generated from whatever ProgressRoot\n * receives, so handing it the raw prop announces a number outside the range\n * `aria-valuemin`/`aria-valuemax` declare — \"150 percent\" read out over a bar\n * painted at 100.\n */\nconst value = computed<number | null>(() =>\n props.modelValue === null || props.modelValue === undefined\n ? null\n : Math.min(Math.max(props.modelValue, 0), props.max),\n);\n\n/** Percentage 0–100, derived from the clamped value; null while indeterminate. */\nconst pct = computed<number | null>(() =>\n value.value === null ? null : (value.value / props.max) * 100,\n);\n\ndefineExpose({ pct });\n</script>\n\n<template>\n <ProgressRoot\n :model-value=\"value\"\n :max=\"max\"\n :aria-label=\"ariaLabel\"\n :aria-labelledby=\"ariaLabelledby\"\n class=\"relative h-2 w-full overflow-hidden rounded-full bg-muted\"\n >\n <!-- Determinate: a full-width bar slid left by the remaining percentage\n (transform eased over --duration-slow). Indeterminate: a short segment\n sweeping the track on a loop, since there is no percentage to paint.\n Completion beat: at 100% the fill turns success (Loom dual-force\n law — a finished piece of work reads as done at a glance), eased in\n over the same --duration-slow lane via the background transition. -->\n <ProgressIndicator\n :class=\"\n cn(\n 'h-full',\n pct === 100 ? 'bg-success' : 'bg-primary',\n pct === null && 'w-1/3 animate-progress-indeterminate rounded-full',\n )\n \"\n :style=\"\n pct === null\n ? undefined\n : {\n transition:\n 'transform var(--duration-slow) var(--ease-out), background-color var(--duration-slow) var(--ease-out)',\n transform: `translateX(-${100 - pct}%)`,\n }\n \"\n />\n </ProgressRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,QAAQ;;;;;;;;;EAwBd,MAAM,QAAQ,eACZ,MAAM,eAAe,QAAQ,MAAM,eAAe,KAAA,IAC9C,OACA,KAAK,IAAI,KAAK,IAAI,MAAM,YAAY,CAAC,GAAG,MAAM,GAAG,CACvD;;EAGA,MAAM,MAAM,eACV,MAAM,UAAU,OAAO,OAAQ,MAAM,QAAQ,MAAM,MAAO,GAC5D;EAEA,SAAa,EAAE,IAAI,CAAC;;GAIlB,OAAA,UAAA,GAAA,YA+Be,MAAA,YAAA,GAAA;IA9BZ,eAAa,MAAA;IACb,KAAK,QAAA;IACL,cAAY,QAAA;IACZ,mBAAiB,QAAA;IAClB,OAAM;;IAQN,SAAA,cAiBE,CAjBF,YAiBE,MAAA,iBAAA,GAAA;KAhBC,OAAK,eAAW,MAAA,EAAA,CAAE,CAAA,UAAgC,IAAA,UAAG,MAAA,eAAA,cAAkD,IAAA,UAAG,QAAA,mDAAA,CAAA;KAO1G,OAAK,eAAW,IAAA,UAAG,OAAsB,KAAA,IAAA;;MAAyN,WAAA,eAAA,MAAA,IAAA,MAAG"}
|
|
1
|
+
{"version":3,"file":"Progress.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/primitives/Progress/Progress.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { cva } from \"class-variance-authority\";\nimport type { LabelOf } from \"../../lib/labels\";\n\n/**\n * The one thing this bar prints, and the placeholder it prints instead when\n * there is no percentage yet.\n *\n * **`value` takes both raw numbers and no formatting at all.** A hand-built\n * `${Math.round(pct)}%` has already decided three things a component cannot\n * know: that the sign trails the digits — Turkish writes `%42` — that the\n * digits are Western Arabic, and that a percentage is the right reading of the\n * pair at all. Handed `value` and `max`, a host reaches\n * `Intl.NumberFormat(locale, { style: \"percent\" })` for the first two and can\n * answer \"3 of 4 steps\" instead of \"75%\" for the third.\n *\n * The rounding therefore lives in Loom's default rather than in the component,\n * so it is a wording choice a host replaces along with the words.\n */\nexport interface ProgressLabels {\n /** The readout beside the track, from the clamped value and the scale it is out of. */\n readonly value: LabelOf<{ value: number; max: number }>;\n /** What the readout prints while there is no percentage — never a false zero. */\n readonly indeterminate: string;\n}\n\n/**\n * Loom's English, co-located with the component so it tree-shakes with it, and\n * exported so a host can build a partial vocabulary against the real thing.\n */\nexport const PROGRESS_LABELS: ProgressLabels = {\n value: ({ value, max }) => `${String(Math.round((value / max) * 100))}%`,\n indeterminate: \"—\",\n};\n\n/**\n * The track's thickness. Deliberately *not* the shared control-height scale a\n * Select or a TextField uses: a bar is a stroke laid under a heading or inside\n * a table row, never a control a person clicks into, so lining it up with a\n * 36px input would only make it a slab. `md` is the thickness every caller got\n * before this prop existed and stays the default for exactly that reason.\n */\nexport type ProgressSize = \"sm\" | \"md\" | \"lg\";\n\nexport const progressVariants = cva(\"relative w-full overflow-hidden rounded-full bg-muted\", {\n variants: {\n size: {\n sm: \"h-1\",\n md: \"h-2\",\n lg: \"h-3\",\n } satisfies Record<ProgressSize, string>,\n },\n defaultVariants: { size: \"md\" },\n});\n</script>\n\n<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { ProgressRoot, ProgressIndicator } from \"reka-ui\";\nimport { cn } from \"../../lib/cn\";\nimport { useSplitAttrs } from \"../../lib/attrs\";\nimport { useLabels, type LabelOverrides } from \"../../lib/labels\";\n\n/**\n * Progress — determinate progress bar for a task whose extent as a percentage\n * is known (upload %, step 3 of 5). `modelValue` null/undefined renders the\n * *indeterminate* state — an empty track, since there is no percentage yet to\n * paint. For a wait of unknown duration with no percentage at all, use\n * Spinner instead of guessing a Progress value. For the same number drawn as\n * a ring — a dashboard tile, a quota, a score where the circle is the visual\n * — use RadialProgress, which mirrors this contract exactly.\n *\n * Built on Reka UI's Progress: role=\"progressbar\" + aria-valuenow/min/max set\n * on the root automatically. `ariaLabel`/`ariaLabelledby` are bound onto\n * ProgressRoot (fallthrough overrides Reka's own generated \"`NN%`\" label) so\n * the accessible name describes *what* is loading, not just how much.\n */\nconst props = withDefaults(\n defineProps<{\n /** The completed amount, 0–`max`; `null`/omitted renders indeterminate. */\n modelValue?: number | null;\n /** The value that reads as 100% complete. */\n max?: number;\n /** Track thickness. Its own scale, not the control-height scale — a bar is a stroke, not a form control. */\n size?: ProgressSize;\n /** Print the rounded percentage as text beside the track. While indeterminate it prints an em dash, never a number. */\n showValue?: boolean;\n /** Accessible name describing the task, overriding Reka's default `NN%` label. */\n ariaLabel?: string;\n /** Accessible name sourced from another element's id, in place of `ariaLabel`. */\n ariaLabelledby?: string;\n /**\n * How the readout is written, as any subset of `ProgressLabels` — the rest\n * stay as the host's `provideLoomLabels` vocabulary left them, and then as\n * Loom's English.\n *\n * The per-instance case is a bar counting something a percentage is the\n * wrong reading of: `value: ({ value, max }) => \\`Step ${value} of ${max}\\``.\n */\n labels?: LabelOverrides<ProgressLabels>;\n }>(),\n {\n max: 100,\n size: \"md\",\n showValue: false,\n },\n);\n\n// `text`, not `labels`: the prop of that name is one of the three sources this\n// resolves, and a template reading the raw prop would be reading the overrides\n// rather than the answer.\nconst text = useLabels(\"progress\", PROGRESS_LABELS, () => props.labels);\n\n/** The readout tracks the track: a 1px bar with 14px digits beside it is not one object. */\nconst VALUE_TEXT = {\n sm: \"text-micro\",\n md: \"text-xs\",\n lg: \"text-sm\",\n} satisfies Record<ProgressSize, string>;\n\n// `showValue` changes which node is outermost, so fallthrough can no longer be\n// left to Vue: `class` goes to whatever the caller sees as the component's box\n// — the flex row when there is a readout, the track itself when the track is\n// all there is — and everything else (aria-describedby, data-testid) goes to\n// ProgressRoot, which is the element carrying role=\"progressbar\" and therefore\n// the one those attributes are describing.\n//\n// The two branches are written out rather than always wrapping the track in a\n// row, because a bare Progress has to keep the exact box it had before\n// `showValue` existed — a wrapper, even an empty one, changes how it sits in\n// a flex or grid parent.\n//\n// Nothing may sit beside those two branches at the top level of the template,\n// comments included: a second root node turns the component into a fragment,\n// and the attributes routed by hand above then have nowhere single to land.\n//\n// Routing `class` through `cn()` also settles a fight that used to be decided\n// by stylesheet order: Vue's own fallthrough merge concatenates, so a caller's\n// `bg-primary` sat alongside the track's `bg-muted` rather than replacing it.\ndefineOptions({ inheritAttrs: false });\nconst { attrs, rest } = useSplitAttrs();\n\n/**\n * The value the bar itself is given, clamped into [0, max]; null while\n * indeterminate. The clamp has to happen here rather than only on the way to\n * the transform below: `aria-valuenow` is generated from whatever ProgressRoot\n * receives, so handing it the raw prop announces a number outside the range\n * `aria-valuemin`/`aria-valuemax` declare — \"150 percent\" read out over a bar\n * painted at 100.\n */\nconst value = computed<number | null>(() =>\n props.modelValue === null || props.modelValue === undefined\n ? null\n : Math.min(Math.max(props.modelValue, 0), props.max),\n);\n\n/** Percentage 0–100, derived from the clamped value; null while indeterminate. */\nconst pct = computed<number | null>(() =>\n value.value === null ? null : (value.value / props.max) * 100,\n);\n\n/**\n * Everything ProgressRoot is given in both branches of the template. `rest`\n * lands last so a caller passing a bare `aria-label` attribute still wins over\n * the prop, which is the precedence Vue's own fallthrough gave before this\n * component took the attributes over by hand.\n */\nconst rootAttrs = computed(() => ({\n modelValue: value.value,\n max: props.max,\n \"aria-label\": props.ariaLabel,\n \"aria-labelledby\": props.ariaLabelledby,\n ...rest.value,\n}));\n\n// Determinate: a full-width bar slid left by the remaining percentage\n// (transform eased over --duration-slow). Indeterminate: a short segment\n// sweeping the track on a loop, since there is no percentage to paint.\n// Completion beat: at 100% the fill turns success (Loom law — a\n// finished piece of work reads as done at a glance), eased in over the same\n// --duration-slow lane via the background transition.\nconst indicatorClass = computed(() =>\n cn(\n \"h-full\",\n pct.value === 100 ? \"bg-success\" : \"bg-primary\",\n pct.value === null && \"w-1/3 animate-progress-indeterminate rounded-full\",\n ),\n);\n\nconst indicatorStyle = computed(() =>\n pct.value === null\n ? undefined\n : {\n transition:\n \"transform var(--duration-slow) var(--ease-out), background-color var(--duration-slow) var(--ease-out)\",\n transform: `translateX(-${100 - pct.value}%)`,\n },\n);\n\n/**\n * An indeterminate bar has no percentage, so the readout prints the placeholder\n * rather than the `0%` a naive `pct ?? 0` would produce — \"we do not know yet\"\n * and \"none of it is done\" are different facts, and only one of them is true.\n *\n * The determinate branch hands over `value` and `max` rather than the\n * percentage it already computed for the transform: rounding, the position of\n * the per-cent sign and the shape of the digits are all the host's, and `pct`\n * is a division this component happens to need for the paint.\n */\nconst readout = computed(() =>\n value.value === null\n ? text.value.indeterminate\n : text.value.value({ value: value.value, max: props.max }),\n);\n\ndefineExpose({ pct });\n</script>\n\n<template>\n <ProgressRoot\n v-if=\"!showValue\"\n v-bind=\"rootAttrs\"\n :class=\"cn(progressVariants({ size }), attrs.class as string)\"\n >\n <ProgressIndicator :class=\"indicatorClass\" :style=\"indicatorStyle\" />\n </ProgressRoot>\n\n <div v-else :class=\"cn('flex w-full items-center gap-3', attrs.class as string)\">\n <ProgressRoot\n v-bind=\"rootAttrs\"\n :class=\"cn(progressVariants({ size }), 'w-auto min-w-0 flex-1')\"\n >\n <ProgressIndicator :class=\"indicatorClass\" :style=\"indicatorStyle\" />\n </ProgressRoot>\n <!-- Hidden from assistive tech: the progressbar already announces this\n number through `aria-valuenow`, and a visible copy beside it is read\n out a second time as loose text. Fixed width so the track does not\n resize itself every time the digit count changes. -->\n <span\n aria-hidden=\"true\"\n :class=\"cn('tabular w-10 shrink-0 text-right text-muted-foreground', VALUE_TEXT[size])\"\n >{{ readout }}</span\n >\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAa,kBAAkC;CAC7C,QAAQ,EAAE,OAAO,UAAU,GAAG,OAAO,KAAK,MAAO,QAAQ,MAAO,GAAG,CAAC,EAAE;CACtE,eAAe;AACjB;AAWA,IAAa,mBAAmB,IAAI,yDAAyD;CAC3F,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;CACN,EACF;CACA,iBAAiB,EAAE,MAAM,KAAK;AAChC,CAAC;;;;;;;;;;;;;;;;;EAwBD,MAAM,QAAQ;EAkCd,MAAM,OAAO,UAAU,YAAY,uBAAuB,MAAM,MAAM;;EAGtE,MAAM,aAAa;GACjB,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;EAsBA,MAAM,EAAE,OAAO,SAAS,cAAc;;;;;;;;;EAUtC,MAAM,QAAQ,eACZ,MAAM,eAAe,QAAQ,MAAM,eAAe,KAAA,IAC9C,OACA,KAAK,IAAI,KAAK,IAAI,MAAM,YAAY,CAAC,GAAG,MAAM,GAAG,CACvD;;EAGA,MAAM,MAAM,eACV,MAAM,UAAU,OAAO,OAAQ,MAAM,QAAQ,MAAM,MAAO,GAC5D;;;;;;;EAQA,MAAM,YAAY,gBAAgB;GAChC,YAAY,MAAM;GAClB,KAAK,MAAM;GACX,cAAc,MAAM;GACpB,mBAAmB,MAAM;GACzB,GAAG,KAAK;EACV,EAAE;EAQF,MAAM,iBAAiB,eACrB,GACE,UACA,IAAI,UAAU,MAAM,eAAe,cACnC,IAAI,UAAU,QAAQ,mDACxB,CACF;EAEA,MAAM,iBAAiB,eACrB,IAAI,UAAU,OACV,KAAA,IACA;GACE,YACE;GACF,WAAW,eAAe,MAAM,IAAI,MAAM;EAC5C,CACN;;;;;;;;;;;EAYA,MAAM,UAAU,eACd,MAAM,UAAU,OACZ,KAAK,MAAM,gBACX,KAAK,MAAM,MAAM;GAAE,OAAO,MAAM;GAAO,KAAK,MAAM;EAAI,CAAC,CAC7D;EAEA,SAAa,EAAE,IAAI,CAAC;;GAKT,OAAA,CAAA,QAAA,aADT,UAAA,GAAA,YAMe,MAAA,YAAA,GANf,WAMe,EAAA,KAAA,EAAA,GAJL,UAAA,OAAS,EAChB,OAAO,MAAA,EAAA,CAAE,CAAC,MAAA,gBAAA,CAAgB,CAAA,EAAA,MAAG,QAAA,KAAI,CAAA,GAAK,MAAA,KAAA,CAAK,CAAC,KAAK,EAAA,CAAA,GAAA;IAElD,SAAA,cAAqE,CAArE,YAAqE,MAAA,iBAAA,GAAA;KAAjD,OAAK,eAAE,eAAA,KAAc;KAAG,OAAK,eAAE,eAAA,KAAc;;;GAGnE,GAAA,IAAA,CAAA,OAAA,CAAA,MAAA,UAAA,GAAA,mBAgBM,OAAA;;IAhBO,OAAK,eAAE,MAAA,EAAA,CAAE,CAAA,kCAAmC,MAAA,KAAA,CAAK,CAAC,KAAK,CAAA;GAClE,GAAA,CAAA,YAKe,MAAA,YAAA,GALf,WACU,UAIK,OAJI,EAChB,OAAO,MAAA,EAAA,CAAE,CAAC,MAAA,gBAAA,CAAgB,CAAA,EAAA,MAAG,QAAA,KAAI,CAAA,GAAA,uBAAA,EAAA,CAAA,GAAA;IAElC,SAAA,cAAqE,CAArE,YAAqE,MAAA,iBAAA,GAAA;KAAjD,OAAK,eAAE,eAAA,KAAc;KAAG,OAAK,eAAE,eAAA,KAAc;;;GAMnE,GAAA,IAAA,CAAA,OAAA,CAAA,GAAA,mBAIC,QAAA;IAHC,eAAY;IACX,OAAK,eAAE,MAAA,EAAA,CAAE,CAAA,0DAA2D,WAAW,QAAA,KAAI,CAAA;GAChF,GAAA,gBAAA,QAAA,KAAO,GAAA,CAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import RadialProgress_vue_vue_type_script_setup_true_lang_default, { RADIAL_PROGRESS_LABELS, radialProgressVariants } from "./RadialProgress.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/primitives/RadialProgress/RadialProgress.vue
|
|
3
|
+
var RadialProgress_default = RadialProgress_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { RADIAL_PROGRESS_LABELS, RadialProgress_default as default, radialProgressVariants };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=RadialProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadialProgress.js","names":[],"sources":["../../../src/primitives/RadialProgress/RadialProgress.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { cva } from \"class-variance-authority\";\nimport type { LabelOf } from \"../../lib/labels\";\n\n/**\n * The one thing this ring prints, and the placeholder it prints instead when\n * there is no percentage yet. `Progress`'s keys, for the reason its whole\n * contract is `Progress`'s — see `ProgressLabels` for why both raw numbers go\n * over and nothing is formatted first.\n *\n * A separate slot rather than a shared one, though, and that is deliberate:\n * the readout beside a bar has a line to itself, where this one sits inside a\n * 40px circle at `text-micro`. \"42% uploaded\" fits the first and overflows the\n * second, and one shared slot would leave a host no way to say so.\n */\nexport interface RadialProgressLabels {\n /** The readout in the ring's centre, from the clamped value and the scale it is out of. */\n readonly value: LabelOf<{ value: number; max: number }>;\n /** What the readout prints while there is no percentage — never a false zero. */\n readonly indeterminate: string;\n}\n\n/**\n * Loom's English, co-located with the component so it tree-shakes with it, and\n * exported so a host can build a partial vocabulary against the real thing.\n */\nexport const RADIAL_PROGRESS_LABELS: RadialProgressLabels = {\n value: ({ value, max }) => `${String(Math.round((value / max) * 100))}%`,\n indeterminate: \"—\",\n};\n\n/**\n * The ring's outer diameter. `sm` is a table-row or list-item marker, `md` a\n * card corner, `lg` the one on a dashboard tile where the ring is the whole\n * visual. Its own scale rather than the control-height scale a Select uses: a\n * ring is not a form control and never has to line up beside a text input.\n */\nexport type RadialProgressSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * How heavy the ring's stroke is. Measured in the SVG's own units, so the\n * proportion of stroke to diameter holds at every `size` — a `thick` ring\n * reads as thick whether it is 40px or 96px across.\n */\nexport type RadialProgressThickness = \"thin\" | \"regular\" | \"thick\";\n\nexport const radialProgressVariants = cva(\n \"relative inline-flex shrink-0 items-center justify-center\",\n {\n variants: {\n size: {\n sm: \"h-10 w-10\",\n md: \"h-16 w-16\",\n lg: \"h-24 w-24\",\n } satisfies Record<RadialProgressSize, string>,\n },\n defaultVariants: { size: \"md\" },\n },\n);\n</script>\n\n<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { ProgressRoot } from \"reka-ui\";\nimport { cn } from \"../../lib/cn\";\nimport { useSplitAttrs } from \"../../lib/attrs\";\nimport { useLabels, type LabelOverrides } from \"../../lib/labels\";\n\n/**\n * RadialProgress — the same information Progress carries, drawn as a ring: a\n * dashboard tile, a quota, a score out of 100 where the circle *is* the\n * visual. Reach for Progress instead wherever the bar sits in a row of text\n * and its length is doing the comparing, and for Spinner when there is no\n * percentage at all — a ring with nothing to fill is a spinner wearing a\n * gauge's clothes.\n *\n * Its contract is Progress's, deliberately and to the letter: `null`/omitted\n * `modelValue` is indeterminate, the value is clamped into [0, max] for the\n * same reason, the arc turns `success` at 100%, and the accessible name comes\n * from `ariaLabel`/`ariaLabelledby`. Two components answering the same\n * question differently is worse than either answer.\n *\n * Reka's ProgressRoot is kept as the wrapper even though the fill below is an\n * SVG arc rather than a ProgressIndicator: the root is what emits\n * `role=\"progressbar\"` and `aria-valuenow`/`aria-valuemin`/`aria-valuemax`,\n * and it is the only way this component and Progress cannot drift into\n * announcing the same number two different ways. ProgressIndicator is left out\n * because it exists to be translated inside an overflow-hidden track, which is\n * not how an arc is painted.\n */\nconst props = withDefaults(\n defineProps<{\n /** The completed amount, 0–`max`; `null`/omitted renders indeterminate. */\n modelValue?: number | null;\n /** The value that reads as 100% complete. */\n max?: number;\n /** The ring's outer diameter. */\n size?: RadialProgressSize;\n /** The weight of the ring's stroke, in proportion to its diameter. */\n thickness?: RadialProgressThickness;\n /** Print the rounded percentage in the ring's centre. On by default — an empty ring is a spinner. While indeterminate it prints an em dash, never a number. */\n showValue?: boolean;\n /** Accessible name describing the task, overriding Reka's default `NN%` label. */\n ariaLabel?: string;\n /** Accessible name sourced from another element's id, in place of `ariaLabel`. */\n ariaLabelledby?: string;\n /**\n * How the centre readout is written, as any subset of\n * `RadialProgressLabels` — the rest stay as the host's `provideLoomLabels`\n * vocabulary left them, and then as Loom's English.\n */\n labels?: LabelOverrides<RadialProgressLabels>;\n }>(),\n {\n max: 100,\n size: \"md\",\n thickness: \"regular\",\n // On, unlike Progress's opt-in: a bar has a length a reader can compare\n // against its own track, and a ring does not — 70% and 80% are the same\n // arc to the eye. The number is what makes the ring readable.\n showValue: true,\n },\n);\n\n/**\n * The drawing is done in a fixed 100×100 user-unit box and scaled to whatever\n * `size` renders, so every number below is a proportion rather than a pixel\n * count and none of them has to be recomputed per size.\n */\nconst VIEW = 100;\nconst CENTRE = VIEW / 2;\n\nconst STROKE = {\n thin: 6,\n regular: 10,\n thick: 14,\n} satisfies Record<RadialProgressThickness, number>;\n\n/** The centre readout scales with the ring, or it overflows it at `sm`. */\nconst VALUE_TEXT = {\n sm: \"text-micro\",\n md: \"text-sm\",\n lg: \"text-lg\",\n} satisfies Record<RadialProgressSize, string>;\n\n// One rendered node, but `class` is still routed by hand: Vue's fallthrough\n// merge concatenates, so a caller's `h-20 w-20` only beat the size variant's\n// `h-16 w-16` if Tailwind happened to emit it later. `cn()` decides it. The\n// rest of the fallthrough (aria-describedby, data-testid) lands on the same\n// node, which is the one carrying role=\"progressbar\".\ndefineOptions({ inheritAttrs: false });\nconst { attrs, rest } = useSplitAttrs();\n\n/**\n * Clamped into [0, max] for the reason Progress's own comment gives:\n * `aria-valuenow` is generated from whatever ProgressRoot receives, so an\n * unclamped 150 is announced against an `aria-valuemax` of 100 while the arc\n * is painted full.\n */\nconst value = computed<number | null>(() =>\n props.modelValue === null || props.modelValue === undefined\n ? null\n : Math.min(Math.max(props.modelValue, 0), props.max),\n);\n\n/** Percentage 0–100, derived from the clamped value; null while indeterminate. */\nconst pct = computed<number | null>(() =>\n value.value === null ? null : (value.value / props.max) * 100,\n);\n\nconst strokeWidth = computed(() => STROKE[props.thickness]);\n\n/**\n * An SVG stroke is centred on its path, so half of it falls outside the\n * circle's own radius. A radius of `CENTRE` therefore paints the outer half of\n * the stroke past the viewBox edge and the browser clips it — the flat top\n * that makes a radial progress look broken. Half the stroke width comes off\n * the radius so the ring's outer edge lands exactly on the box.\n */\nconst radius = computed(() => CENTRE - strokeWidth.value / 2);\n\n/**\n * The dash pattern is measured along the path, so it depends on the radius —\n * which depends on `thickness`. Hard-coding a circumference works for exactly\n * one thickness and silently mis-fills every other one.\n */\nconst circumference = computed(() => 2 * Math.PI * radius.value);\n\n/**\n * Determinate: one dash as long as the whole path, pushed back by the fraction\n * still to do. Indeterminate: a fixed quarter-turn segment, with the gap set\n * to the full circumference so nothing wraps round behind it while it spins.\n */\nconst dashArray = computed(() =>\n pct.value === null\n ? `${circumference.value * 0.25} ${circumference.value}`\n : `${circumference.value}`,\n);\n\nconst dashOffset = computed(() =>\n pct.value === null ? 0 : circumference.value * (1 - pct.value / 100),\n);\n\n/**\n * A round cap at exactly 0% still paints a dot at twelve o'clock — a ring\n * showing nothing that reads as a couple of percent. Nothing done draws\n * nothing, so the cap squares off for that one value.\n */\nconst lineCap = computed(() => (pct.value === 0 ? \"butt\" : \"round\"));\n\n// `text`, not `labels`: the prop of that name is one of the three sources this\n// resolves, and a template reading the raw prop would be reading the overrides\n// rather than the answer.\nconst text = useLabels(\"radialProgress\", RADIAL_PROGRESS_LABELS, () => props.labels);\n\n/**\n * Matches Progress: a placeholder for \"no percentage yet\", never a false `0%`,\n * and both raw numbers handed over rather than a percentage already written in\n * English.\n */\nconst readout = computed(() =>\n value.value === null\n ? text.value.indeterminate\n : text.value.value({ value: value.value, max: props.max }),\n);\n\ndefineExpose({ pct });\n</script>\n\n<template>\n <ProgressRoot\n :model-value=\"value\"\n :max=\"max\"\n :aria-label=\"ariaLabel\"\n :aria-labelledby=\"ariaLabelledby\"\n v-bind=\"rest\"\n :class=\"cn(radialProgressVariants({ size }), attrs.class as string)\"\n >\n <!-- Hidden from assistive tech in one piece: everything it draws is\n already announced by the progressbar above it, and the centre readout\n would otherwise be read a second time as loose text.\n\n Indeterminate spins the whole SVG rather than the arc inside it. The\n rotation is then an ordinary CSS transform on an HTML-positioned box,\n whose transform-origin is its own centre at every size — where a\n transform on an SVG child resolves against the viewBox and needs\n `transform-box` reasoning to stay centred. It is a CSS animation and\n not a JS ticker so the global prefers-reduced-motion rule in\n global.css collapses it, which a requestAnimationFrame loop would\n escape. The readout sits outside the SVG for the same reason: it must\n not spin with it. -->\n <svg\n :viewBox=\"`0 0 ${VIEW} ${VIEW}`\"\n fill=\"none\"\n aria-hidden=\"true\"\n :class=\"cn('absolute inset-0 h-full w-full', pct === null && 'animate-spin')\"\n >\n <circle\n :cx=\"CENTRE\"\n :cy=\"CENTRE\"\n :r=\"radius\"\n :stroke-width=\"strokeWidth\"\n class=\"stroke-muted\"\n />\n <!-- Rotated by the SVG `transform` attribute about the box's centre\n rather than a CSS `-rotate-90`: the attribute is expressed in\n viewBox units, so twelve o'clock stays twelve o'clock at any\n rendered size, with no dependency on how the engine resolves\n transform-origin for an SVG child. An unrotated circle starts at\n three. -->\n <circle\n :cx=\"CENTRE\"\n :cy=\"CENTRE\"\n :r=\"radius\"\n :stroke-width=\"strokeWidth\"\n :stroke-dasharray=\"dashArray\"\n :stroke-dashoffset=\"dashOffset\"\n :stroke-linecap=\"lineCap\"\n :transform=\"`rotate(-90 ${CENTRE} ${CENTRE})`\"\n :class=\"pct === 100 ? 'stroke-success' : 'stroke-primary'\"\n :style=\"\n pct === null\n ? undefined\n : {\n transition:\n 'stroke-dashoffset var(--duration-slow) var(--ease-out), stroke var(--duration-slow) var(--ease-out)',\n }\n \"\n />\n </svg>\n <span\n v-if=\"showValue\"\n aria-hidden=\"true\"\n :class=\"cn('tabular text-foreground', VALUE_TEXT[size])\"\n >{{ readout }}</span\n >\n </ProgressRoot>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { type LabelOverrides } from "../../lib/labels";
|
|
2
|
+
import type { LabelOf } from "../../lib/labels";
|
|
3
|
+
/**
|
|
4
|
+
* The one thing this ring prints, and the placeholder it prints instead when
|
|
5
|
+
* there is no percentage yet. `Progress`'s keys, for the reason its whole
|
|
6
|
+
* contract is `Progress`'s — see `ProgressLabels` for why both raw numbers go
|
|
7
|
+
* over and nothing is formatted first.
|
|
8
|
+
*
|
|
9
|
+
* A separate slot rather than a shared one, though, and that is deliberate:
|
|
10
|
+
* the readout beside a bar has a line to itself, where this one sits inside a
|
|
11
|
+
* 40px circle at `text-micro`. "42% uploaded" fits the first and overflows the
|
|
12
|
+
* second, and one shared slot would leave a host no way to say so.
|
|
13
|
+
*/
|
|
14
|
+
export interface RadialProgressLabels {
|
|
15
|
+
/** The readout in the ring's centre, from the clamped value and the scale it is out of. */
|
|
16
|
+
readonly value: LabelOf<{
|
|
17
|
+
value: number;
|
|
18
|
+
max: number;
|
|
19
|
+
}>;
|
|
20
|
+
/** What the readout prints while there is no percentage — never a false zero. */
|
|
21
|
+
readonly indeterminate: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Loom's English, co-located with the component so it tree-shakes with it, and
|
|
25
|
+
* exported so a host can build a partial vocabulary against the real thing.
|
|
26
|
+
*/
|
|
27
|
+
export declare const RADIAL_PROGRESS_LABELS: RadialProgressLabels;
|
|
28
|
+
/**
|
|
29
|
+
* The ring's outer diameter. `sm` is a table-row or list-item marker, `md` a
|
|
30
|
+
* card corner, `lg` the one on a dashboard tile where the ring is the whole
|
|
31
|
+
* visual. Its own scale rather than the control-height scale a Select uses: a
|
|
32
|
+
* ring is not a form control and never has to line up beside a text input.
|
|
33
|
+
*/
|
|
34
|
+
export type RadialProgressSize = "sm" | "md" | "lg";
|
|
35
|
+
/**
|
|
36
|
+
* How heavy the ring's stroke is. Measured in the SVG's own units, so the
|
|
37
|
+
* proportion of stroke to diameter holds at every `size` — a `thick` ring
|
|
38
|
+
* reads as thick whether it is 40px or 96px across.
|
|
39
|
+
*/
|
|
40
|
+
export type RadialProgressThickness = "thin" | "regular" | "thick";
|
|
41
|
+
export declare const radialProgressVariants: (props?: ({
|
|
42
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
43
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
44
|
+
declare const _default: typeof __VLS_export;
|
|
45
|
+
export default _default;
|
|
46
|
+
declare const __VLS_export: import("vue").DefineComponent<{
|
|
47
|
+
/** The completed amount, 0–`max`; `null`/omitted renders indeterminate. */
|
|
48
|
+
modelValue?: number | null;
|
|
49
|
+
/** The value that reads as 100% complete. */
|
|
50
|
+
max?: number;
|
|
51
|
+
/** The ring's outer diameter. */
|
|
52
|
+
size?: RadialProgressSize;
|
|
53
|
+
/** The weight of the ring's stroke, in proportion to its diameter. */
|
|
54
|
+
thickness?: RadialProgressThickness;
|
|
55
|
+
/** Print the rounded percentage in the ring's centre. On by default — an empty ring is a spinner. While indeterminate it prints an em dash, never a number. */
|
|
56
|
+
showValue?: boolean;
|
|
57
|
+
/** Accessible name describing the task, overriding Reka's default `NN%` label. */
|
|
58
|
+
ariaLabel?: string;
|
|
59
|
+
/** Accessible name sourced from another element's id, in place of `ariaLabel`. */
|
|
60
|
+
ariaLabelledby?: string;
|
|
61
|
+
/**
|
|
62
|
+
* How the centre readout is written, as any subset of
|
|
63
|
+
* `RadialProgressLabels` — the rest stay as the host's `provideLoomLabels`
|
|
64
|
+
* vocabulary left them, and then as Loom's English.
|
|
65
|
+
*/
|
|
66
|
+
labels?: LabelOverrides<RadialProgressLabels>;
|
|
67
|
+
}, {
|
|
68
|
+
pct: import("vue").ComputedRef<number | null>;
|
|
69
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
70
|
+
/** The completed amount, 0–`max`; `null`/omitted renders indeterminate. */
|
|
71
|
+
modelValue?: number | null;
|
|
72
|
+
/** The value that reads as 100% complete. */
|
|
73
|
+
max?: number;
|
|
74
|
+
/** The ring's outer diameter. */
|
|
75
|
+
size?: RadialProgressSize;
|
|
76
|
+
/** The weight of the ring's stroke, in proportion to its diameter. */
|
|
77
|
+
thickness?: RadialProgressThickness;
|
|
78
|
+
/** Print the rounded percentage in the ring's centre. On by default — an empty ring is a spinner. While indeterminate it prints an em dash, never a number. */
|
|
79
|
+
showValue?: boolean;
|
|
80
|
+
/** Accessible name describing the task, overriding Reka's default `NN%` label. */
|
|
81
|
+
ariaLabel?: string;
|
|
82
|
+
/** Accessible name sourced from another element's id, in place of `ariaLabel`. */
|
|
83
|
+
ariaLabelledby?: string;
|
|
84
|
+
/**
|
|
85
|
+
* How the centre readout is written, as any subset of
|
|
86
|
+
* `RadialProgressLabels` — the rest stay as the host's `provideLoomLabels`
|
|
87
|
+
* vocabulary left them, and then as Loom's English.
|
|
88
|
+
*/
|
|
89
|
+
labels?: LabelOverrides<RadialProgressLabels>;
|
|
90
|
+
}> & Readonly<{}>, {
|
|
91
|
+
size: RadialProgressSize;
|
|
92
|
+
max: number;
|
|
93
|
+
showValue: boolean;
|
|
94
|
+
thickness: RadialProgressThickness;
|
|
95
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
96
|
+
//# sourceMappingURL=RadialProgress.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadialProgress.vue.d.ts","sourceRoot":"","sources":["../../../src/primitives/RadialProgress/RadialProgress.vue"],"names":[],"mappings":"AAiTA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,oBAAoB;IACnC,2FAA2F;IAC3F,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,iFAAiF;IACjF,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,oBAGpC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEnE,eAAO,MAAM,sBAAsB;;8EAYlC,CAAC;wBACmB,OAAO,YAAY;AAAxC,wBAAyC;AACzC,QAAA,MAAM,YAAY;IAwBd,2EAA2E;iBAC9D,MAAM,GAAG,IAAI;IAC1B,6CAA6C;UACvC,MAAM;IACZ,iCAAiC;WAC1B,kBAAkB;IACzB,sEAAsE;gBAC1D,uBAAuB;IACnC,+JAA+J;gBACnJ,OAAO;IACnB,kFAAkF;gBACtE,MAAM;IAClB,kFAAkF;qBACjE,MAAM;IACvB;;;;OAIG;aACM,cAAc,CAAC,oBAAoB,CAAC;;;;IAnB7C,2EAA2E;iBAC9D,MAAM,GAAG,IAAI;IAC1B,6CAA6C;UACvC,MAAM;IACZ,iCAAiC;WAC1B,kBAAkB;IACzB,sEAAsE;gBAC1D,uBAAuB;IACnC,+JAA+J;gBACnJ,OAAO;IACnB,kFAAkF;gBACtE,MAAM;IAClB,kFAAkF;qBACjE,MAAM;IACvB;;;;OAIG;aACM,cAAc,CAAC,oBAAoB,CAAC;;UAdtC,kBAAkB;SAFnB,MAAM;eAMA,OAAO;eAFP,uBAAuB;6EAuPnC,CAAC"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { useLabels } from "../../lib/labels.js";
|
|
3
|
+
import { useSplitAttrs } from "../../lib/attrs.js";
|
|
4
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, toDisplayString, unref, withCtx } from "vue";
|
|
5
|
+
import { ProgressRoot } from "reka-ui";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
//#region src/primitives/RadialProgress/RadialProgress.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
+
/**
|
|
9
|
+
* RadialProgress — the same information Progress carries, drawn as a ring: a
|
|
10
|
+
* dashboard tile, a quota, a score out of 100 where the circle *is* the
|
|
11
|
+
* visual. Reach for Progress instead wherever the bar sits in a row of text
|
|
12
|
+
* and its length is doing the comparing, and for Spinner when there is no
|
|
13
|
+
* percentage at all — a ring with nothing to fill is a spinner wearing a
|
|
14
|
+
* gauge's clothes.
|
|
15
|
+
*
|
|
16
|
+
* Its contract is Progress's, deliberately and to the letter: `null`/omitted
|
|
17
|
+
* `modelValue` is indeterminate, the value is clamped into [0, max] for the
|
|
18
|
+
* same reason, the arc turns `success` at 100%, and the accessible name comes
|
|
19
|
+
* from `ariaLabel`/`ariaLabelledby`. Two components answering the same
|
|
20
|
+
* question differently is worse than either answer.
|
|
21
|
+
*
|
|
22
|
+
* Reka's ProgressRoot is kept as the wrapper even though the fill below is an
|
|
23
|
+
* SVG arc rather than a ProgressIndicator: the root is what emits
|
|
24
|
+
* `role="progressbar"` and `aria-valuenow`/`aria-valuemin`/`aria-valuemax`,
|
|
25
|
+
* and it is the only way this component and Progress cannot drift into
|
|
26
|
+
* announcing the same number two different ways. ProgressIndicator is left out
|
|
27
|
+
* because it exists to be translated inside an overflow-hidden track, which is
|
|
28
|
+
* not how an arc is painted.
|
|
29
|
+
*/
|
|
30
|
+
var _hoisted_1 = ["viewBox"];
|
|
31
|
+
var _hoisted_2 = ["r", "stroke-width"];
|
|
32
|
+
var _hoisted_3 = [
|
|
33
|
+
"r",
|
|
34
|
+
"stroke-width",
|
|
35
|
+
"stroke-dasharray",
|
|
36
|
+
"stroke-dashoffset",
|
|
37
|
+
"stroke-linecap",
|
|
38
|
+
"transform"
|
|
39
|
+
];
|
|
40
|
+
/**
|
|
41
|
+
* Loom's English, co-located with the component so it tree-shakes with it, and
|
|
42
|
+
* exported so a host can build a partial vocabulary against the real thing.
|
|
43
|
+
*/
|
|
44
|
+
var RADIAL_PROGRESS_LABELS = {
|
|
45
|
+
value: ({ value, max }) => `${String(Math.round(value / max * 100))}%`,
|
|
46
|
+
indeterminate: "—"
|
|
47
|
+
};
|
|
48
|
+
var radialProgressVariants = cva("relative inline-flex shrink-0 items-center justify-center", {
|
|
49
|
+
variants: { size: {
|
|
50
|
+
sm: "h-10 w-10",
|
|
51
|
+
md: "h-16 w-16",
|
|
52
|
+
lg: "h-24 w-24"
|
|
53
|
+
} },
|
|
54
|
+
defaultVariants: { size: "md" }
|
|
55
|
+
});
|
|
56
|
+
var RadialProgress_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
57
|
+
inheritAttrs: false,
|
|
58
|
+
__name: "RadialProgress",
|
|
59
|
+
props: {
|
|
60
|
+
modelValue: {},
|
|
61
|
+
max: { default: 100 },
|
|
62
|
+
size: { default: "md" },
|
|
63
|
+
thickness: { default: "regular" },
|
|
64
|
+
showValue: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: true
|
|
67
|
+
},
|
|
68
|
+
ariaLabel: {},
|
|
69
|
+
ariaLabelledby: {},
|
|
70
|
+
labels: {}
|
|
71
|
+
},
|
|
72
|
+
setup(__props, { expose: __expose }) {
|
|
73
|
+
const props = __props;
|
|
74
|
+
/**
|
|
75
|
+
* The drawing is done in a fixed 100×100 user-unit box and scaled to whatever
|
|
76
|
+
* `size` renders, so every number below is a proportion rather than a pixel
|
|
77
|
+
* count and none of them has to be recomputed per size.
|
|
78
|
+
*/
|
|
79
|
+
const VIEW = 100;
|
|
80
|
+
const CENTRE = VIEW / 2;
|
|
81
|
+
const STROKE = {
|
|
82
|
+
thin: 6,
|
|
83
|
+
regular: 10,
|
|
84
|
+
thick: 14
|
|
85
|
+
};
|
|
86
|
+
/** The centre readout scales with the ring, or it overflows it at `sm`. */
|
|
87
|
+
const VALUE_TEXT = {
|
|
88
|
+
sm: "text-micro",
|
|
89
|
+
md: "text-sm",
|
|
90
|
+
lg: "text-lg"
|
|
91
|
+
};
|
|
92
|
+
const { attrs, rest } = useSplitAttrs();
|
|
93
|
+
/**
|
|
94
|
+
* Clamped into [0, max] for the reason Progress's own comment gives:
|
|
95
|
+
* `aria-valuenow` is generated from whatever ProgressRoot receives, so an
|
|
96
|
+
* unclamped 150 is announced against an `aria-valuemax` of 100 while the arc
|
|
97
|
+
* is painted full.
|
|
98
|
+
*/
|
|
99
|
+
const value = computed(() => props.modelValue === null || props.modelValue === void 0 ? null : Math.min(Math.max(props.modelValue, 0), props.max));
|
|
100
|
+
/** Percentage 0–100, derived from the clamped value; null while indeterminate. */
|
|
101
|
+
const pct = computed(() => value.value === null ? null : value.value / props.max * 100);
|
|
102
|
+
const strokeWidth = computed(() => STROKE[props.thickness]);
|
|
103
|
+
/**
|
|
104
|
+
* An SVG stroke is centred on its path, so half of it falls outside the
|
|
105
|
+
* circle's own radius. A radius of `CENTRE` therefore paints the outer half of
|
|
106
|
+
* the stroke past the viewBox edge and the browser clips it — the flat top
|
|
107
|
+
* that makes a radial progress look broken. Half the stroke width comes off
|
|
108
|
+
* the radius so the ring's outer edge lands exactly on the box.
|
|
109
|
+
*/
|
|
110
|
+
const radius = computed(() => CENTRE - strokeWidth.value / 2);
|
|
111
|
+
/**
|
|
112
|
+
* The dash pattern is measured along the path, so it depends on the radius —
|
|
113
|
+
* which depends on `thickness`. Hard-coding a circumference works for exactly
|
|
114
|
+
* one thickness and silently mis-fills every other one.
|
|
115
|
+
*/
|
|
116
|
+
const circumference = computed(() => 2 * Math.PI * radius.value);
|
|
117
|
+
/**
|
|
118
|
+
* Determinate: one dash as long as the whole path, pushed back by the fraction
|
|
119
|
+
* still to do. Indeterminate: a fixed quarter-turn segment, with the gap set
|
|
120
|
+
* to the full circumference so nothing wraps round behind it while it spins.
|
|
121
|
+
*/
|
|
122
|
+
const dashArray = computed(() => pct.value === null ? `${circumference.value * .25} ${circumference.value}` : `${circumference.value}`);
|
|
123
|
+
const dashOffset = computed(() => pct.value === null ? 0 : circumference.value * (1 - pct.value / 100));
|
|
124
|
+
/**
|
|
125
|
+
* A round cap at exactly 0% still paints a dot at twelve o'clock — a ring
|
|
126
|
+
* showing nothing that reads as a couple of percent. Nothing done draws
|
|
127
|
+
* nothing, so the cap squares off for that one value.
|
|
128
|
+
*/
|
|
129
|
+
const lineCap = computed(() => pct.value === 0 ? "butt" : "round");
|
|
130
|
+
const text = useLabels("radialProgress", RADIAL_PROGRESS_LABELS, () => props.labels);
|
|
131
|
+
/**
|
|
132
|
+
* Matches Progress: a placeholder for "no percentage yet", never a false `0%`,
|
|
133
|
+
* and both raw numbers handed over rather than a percentage already written in
|
|
134
|
+
* English.
|
|
135
|
+
*/
|
|
136
|
+
const readout = computed(() => value.value === null ? text.value.indeterminate : text.value.value({
|
|
137
|
+
value: value.value,
|
|
138
|
+
max: props.max
|
|
139
|
+
}));
|
|
140
|
+
__expose({ pct });
|
|
141
|
+
return (_ctx, _cache) => {
|
|
142
|
+
return openBlock(), createBlock(unref(ProgressRoot), mergeProps({
|
|
143
|
+
"model-value": value.value,
|
|
144
|
+
max: __props.max,
|
|
145
|
+
"aria-label": __props.ariaLabel,
|
|
146
|
+
"aria-labelledby": __props.ariaLabelledby
|
|
147
|
+
}, unref(rest), { class: unref(cn)(unref(radialProgressVariants)({ size: __props.size }), unref(attrs).class) }), {
|
|
148
|
+
default: withCtx(() => [(openBlock(), createElementBlock("svg", {
|
|
149
|
+
viewBox: `0 0 ${VIEW} ${VIEW}`,
|
|
150
|
+
fill: "none",
|
|
151
|
+
"aria-hidden": "true",
|
|
152
|
+
class: normalizeClass(unref(cn)("absolute inset-0 h-full w-full", pct.value === null && "animate-spin"))
|
|
153
|
+
}, [createElementVNode("circle", {
|
|
154
|
+
cx: CENTRE,
|
|
155
|
+
cy: CENTRE,
|
|
156
|
+
r: radius.value,
|
|
157
|
+
"stroke-width": strokeWidth.value,
|
|
158
|
+
class: "stroke-muted"
|
|
159
|
+
}, null, 8, _hoisted_2), createElementVNode("circle", {
|
|
160
|
+
cx: CENTRE,
|
|
161
|
+
cy: CENTRE,
|
|
162
|
+
r: radius.value,
|
|
163
|
+
"stroke-width": strokeWidth.value,
|
|
164
|
+
"stroke-dasharray": dashArray.value,
|
|
165
|
+
"stroke-dashoffset": dashOffset.value,
|
|
166
|
+
"stroke-linecap": lineCap.value,
|
|
167
|
+
transform: `rotate(-90 ${CENTRE} ${CENTRE})`,
|
|
168
|
+
class: normalizeClass(pct.value === 100 ? "stroke-success" : "stroke-primary"),
|
|
169
|
+
style: normalizeStyle(pct.value === null ? void 0 : { transition: "stroke-dashoffset var(--duration-slow) var(--ease-out), stroke var(--duration-slow) var(--ease-out)" })
|
|
170
|
+
}, null, 14, _hoisted_3)], 10, _hoisted_1)), __props.showValue ? (openBlock(), createElementBlock("span", {
|
|
171
|
+
key: 0,
|
|
172
|
+
"aria-hidden": "true",
|
|
173
|
+
class: normalizeClass(unref(cn)("tabular text-foreground", VALUE_TEXT[__props.size]))
|
|
174
|
+
}, toDisplayString(readout.value), 3)) : createCommentVNode("", true)]),
|
|
175
|
+
_: 1
|
|
176
|
+
}, 16, [
|
|
177
|
+
"model-value",
|
|
178
|
+
"max",
|
|
179
|
+
"aria-label",
|
|
180
|
+
"aria-labelledby",
|
|
181
|
+
"class"
|
|
182
|
+
]);
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
//#endregion
|
|
187
|
+
export { RADIAL_PROGRESS_LABELS, RadialProgress_vue_vue_type_script_setup_true_lang_default as default, radialProgressVariants };
|
|
188
|
+
|
|
189
|
+
//# sourceMappingURL=RadialProgress.vue_vue_type_script_setup_true_lang.js.map
|
package/dist/primitives/RadialProgress/RadialProgress.vue_vue_type_script_setup_true_lang.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadialProgress.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/primitives/RadialProgress/RadialProgress.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { cva } from \"class-variance-authority\";\nimport type { LabelOf } from \"../../lib/labels\";\n\n/**\n * The one thing this ring prints, and the placeholder it prints instead when\n * there is no percentage yet. `Progress`'s keys, for the reason its whole\n * contract is `Progress`'s — see `ProgressLabels` for why both raw numbers go\n * over and nothing is formatted first.\n *\n * A separate slot rather than a shared one, though, and that is deliberate:\n * the readout beside a bar has a line to itself, where this one sits inside a\n * 40px circle at `text-micro`. \"42% uploaded\" fits the first and overflows the\n * second, and one shared slot would leave a host no way to say so.\n */\nexport interface RadialProgressLabels {\n /** The readout in the ring's centre, from the clamped value and the scale it is out of. */\n readonly value: LabelOf<{ value: number; max: number }>;\n /** What the readout prints while there is no percentage — never a false zero. */\n readonly indeterminate: string;\n}\n\n/**\n * Loom's English, co-located with the component so it tree-shakes with it, and\n * exported so a host can build a partial vocabulary against the real thing.\n */\nexport const RADIAL_PROGRESS_LABELS: RadialProgressLabels = {\n value: ({ value, max }) => `${String(Math.round((value / max) * 100))}%`,\n indeterminate: \"—\",\n};\n\n/**\n * The ring's outer diameter. `sm` is a table-row or list-item marker, `md` a\n * card corner, `lg` the one on a dashboard tile where the ring is the whole\n * visual. Its own scale rather than the control-height scale a Select uses: a\n * ring is not a form control and never has to line up beside a text input.\n */\nexport type RadialProgressSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * How heavy the ring's stroke is. Measured in the SVG's own units, so the\n * proportion of stroke to diameter holds at every `size` — a `thick` ring\n * reads as thick whether it is 40px or 96px across.\n */\nexport type RadialProgressThickness = \"thin\" | \"regular\" | \"thick\";\n\nexport const radialProgressVariants = cva(\n \"relative inline-flex shrink-0 items-center justify-center\",\n {\n variants: {\n size: {\n sm: \"h-10 w-10\",\n md: \"h-16 w-16\",\n lg: \"h-24 w-24\",\n } satisfies Record<RadialProgressSize, string>,\n },\n defaultVariants: { size: \"md\" },\n },\n);\n</script>\n\n<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { ProgressRoot } from \"reka-ui\";\nimport { cn } from \"../../lib/cn\";\nimport { useSplitAttrs } from \"../../lib/attrs\";\nimport { useLabels, type LabelOverrides } from \"../../lib/labels\";\n\n/**\n * RadialProgress — the same information Progress carries, drawn as a ring: a\n * dashboard tile, a quota, a score out of 100 where the circle *is* the\n * visual. Reach for Progress instead wherever the bar sits in a row of text\n * and its length is doing the comparing, and for Spinner when there is no\n * percentage at all — a ring with nothing to fill is a spinner wearing a\n * gauge's clothes.\n *\n * Its contract is Progress's, deliberately and to the letter: `null`/omitted\n * `modelValue` is indeterminate, the value is clamped into [0, max] for the\n * same reason, the arc turns `success` at 100%, and the accessible name comes\n * from `ariaLabel`/`ariaLabelledby`. Two components answering the same\n * question differently is worse than either answer.\n *\n * Reka's ProgressRoot is kept as the wrapper even though the fill below is an\n * SVG arc rather than a ProgressIndicator: the root is what emits\n * `role=\"progressbar\"` and `aria-valuenow`/`aria-valuemin`/`aria-valuemax`,\n * and it is the only way this component and Progress cannot drift into\n * announcing the same number two different ways. ProgressIndicator is left out\n * because it exists to be translated inside an overflow-hidden track, which is\n * not how an arc is painted.\n */\nconst props = withDefaults(\n defineProps<{\n /** The completed amount, 0–`max`; `null`/omitted renders indeterminate. */\n modelValue?: number | null;\n /** The value that reads as 100% complete. */\n max?: number;\n /** The ring's outer diameter. */\n size?: RadialProgressSize;\n /** The weight of the ring's stroke, in proportion to its diameter. */\n thickness?: RadialProgressThickness;\n /** Print the rounded percentage in the ring's centre. On by default — an empty ring is a spinner. While indeterminate it prints an em dash, never a number. */\n showValue?: boolean;\n /** Accessible name describing the task, overriding Reka's default `NN%` label. */\n ariaLabel?: string;\n /** Accessible name sourced from another element's id, in place of `ariaLabel`. */\n ariaLabelledby?: string;\n /**\n * How the centre readout is written, as any subset of\n * `RadialProgressLabels` — the rest stay as the host's `provideLoomLabels`\n * vocabulary left them, and then as Loom's English.\n */\n labels?: LabelOverrides<RadialProgressLabels>;\n }>(),\n {\n max: 100,\n size: \"md\",\n thickness: \"regular\",\n // On, unlike Progress's opt-in: a bar has a length a reader can compare\n // against its own track, and a ring does not — 70% and 80% are the same\n // arc to the eye. The number is what makes the ring readable.\n showValue: true,\n },\n);\n\n/**\n * The drawing is done in a fixed 100×100 user-unit box and scaled to whatever\n * `size` renders, so every number below is a proportion rather than a pixel\n * count and none of them has to be recomputed per size.\n */\nconst VIEW = 100;\nconst CENTRE = VIEW / 2;\n\nconst STROKE = {\n thin: 6,\n regular: 10,\n thick: 14,\n} satisfies Record<RadialProgressThickness, number>;\n\n/** The centre readout scales with the ring, or it overflows it at `sm`. */\nconst VALUE_TEXT = {\n sm: \"text-micro\",\n md: \"text-sm\",\n lg: \"text-lg\",\n} satisfies Record<RadialProgressSize, string>;\n\n// One rendered node, but `class` is still routed by hand: Vue's fallthrough\n// merge concatenates, so a caller's `h-20 w-20` only beat the size variant's\n// `h-16 w-16` if Tailwind happened to emit it later. `cn()` decides it. The\n// rest of the fallthrough (aria-describedby, data-testid) lands on the same\n// node, which is the one carrying role=\"progressbar\".\ndefineOptions({ inheritAttrs: false });\nconst { attrs, rest } = useSplitAttrs();\n\n/**\n * Clamped into [0, max] for the reason Progress's own comment gives:\n * `aria-valuenow` is generated from whatever ProgressRoot receives, so an\n * unclamped 150 is announced against an `aria-valuemax` of 100 while the arc\n * is painted full.\n */\nconst value = computed<number | null>(() =>\n props.modelValue === null || props.modelValue === undefined\n ? null\n : Math.min(Math.max(props.modelValue, 0), props.max),\n);\n\n/** Percentage 0–100, derived from the clamped value; null while indeterminate. */\nconst pct = computed<number | null>(() =>\n value.value === null ? null : (value.value / props.max) * 100,\n);\n\nconst strokeWidth = computed(() => STROKE[props.thickness]);\n\n/**\n * An SVG stroke is centred on its path, so half of it falls outside the\n * circle's own radius. A radius of `CENTRE` therefore paints the outer half of\n * the stroke past the viewBox edge and the browser clips it — the flat top\n * that makes a radial progress look broken. Half the stroke width comes off\n * the radius so the ring's outer edge lands exactly on the box.\n */\nconst radius = computed(() => CENTRE - strokeWidth.value / 2);\n\n/**\n * The dash pattern is measured along the path, so it depends on the radius —\n * which depends on `thickness`. Hard-coding a circumference works for exactly\n * one thickness and silently mis-fills every other one.\n */\nconst circumference = computed(() => 2 * Math.PI * radius.value);\n\n/**\n * Determinate: one dash as long as the whole path, pushed back by the fraction\n * still to do. Indeterminate: a fixed quarter-turn segment, with the gap set\n * to the full circumference so nothing wraps round behind it while it spins.\n */\nconst dashArray = computed(() =>\n pct.value === null\n ? `${circumference.value * 0.25} ${circumference.value}`\n : `${circumference.value}`,\n);\n\nconst dashOffset = computed(() =>\n pct.value === null ? 0 : circumference.value * (1 - pct.value / 100),\n);\n\n/**\n * A round cap at exactly 0% still paints a dot at twelve o'clock — a ring\n * showing nothing that reads as a couple of percent. Nothing done draws\n * nothing, so the cap squares off for that one value.\n */\nconst lineCap = computed(() => (pct.value === 0 ? \"butt\" : \"round\"));\n\n// `text`, not `labels`: the prop of that name is one of the three sources this\n// resolves, and a template reading the raw prop would be reading the overrides\n// rather than the answer.\nconst text = useLabels(\"radialProgress\", RADIAL_PROGRESS_LABELS, () => props.labels);\n\n/**\n * Matches Progress: a placeholder for \"no percentage yet\", never a false `0%`,\n * and both raw numbers handed over rather than a percentage already written in\n * English.\n */\nconst readout = computed(() =>\n value.value === null\n ? text.value.indeterminate\n : text.value.value({ value: value.value, max: props.max }),\n);\n\ndefineExpose({ pct });\n</script>\n\n<template>\n <ProgressRoot\n :model-value=\"value\"\n :max=\"max\"\n :aria-label=\"ariaLabel\"\n :aria-labelledby=\"ariaLabelledby\"\n v-bind=\"rest\"\n :class=\"cn(radialProgressVariants({ size }), attrs.class as string)\"\n >\n <!-- Hidden from assistive tech in one piece: everything it draws is\n already announced by the progressbar above it, and the centre readout\n would otherwise be read a second time as loose text.\n\n Indeterminate spins the whole SVG rather than the arc inside it. The\n rotation is then an ordinary CSS transform on an HTML-positioned box,\n whose transform-origin is its own centre at every size — where a\n transform on an SVG child resolves against the viewBox and needs\n `transform-box` reasoning to stay centred. It is a CSS animation and\n not a JS ticker so the global prefers-reduced-motion rule in\n global.css collapses it, which a requestAnimationFrame loop would\n escape. The readout sits outside the SVG for the same reason: it must\n not spin with it. -->\n <svg\n :viewBox=\"`0 0 ${VIEW} ${VIEW}`\"\n fill=\"none\"\n aria-hidden=\"true\"\n :class=\"cn('absolute inset-0 h-full w-full', pct === null && 'animate-spin')\"\n >\n <circle\n :cx=\"CENTRE\"\n :cy=\"CENTRE\"\n :r=\"radius\"\n :stroke-width=\"strokeWidth\"\n class=\"stroke-muted\"\n />\n <!-- Rotated by the SVG `transform` attribute about the box's centre\n rather than a CSS `-rotate-90`: the attribute is expressed in\n viewBox units, so twelve o'clock stays twelve o'clock at any\n rendered size, with no dependency on how the engine resolves\n transform-origin for an SVG child. An unrotated circle starts at\n three. -->\n <circle\n :cx=\"CENTRE\"\n :cy=\"CENTRE\"\n :r=\"radius\"\n :stroke-width=\"strokeWidth\"\n :stroke-dasharray=\"dashArray\"\n :stroke-dashoffset=\"dashOffset\"\n :stroke-linecap=\"lineCap\"\n :transform=\"`rotate(-90 ${CENTRE} ${CENTRE})`\"\n :class=\"pct === 100 ? 'stroke-success' : 'stroke-primary'\"\n :style=\"\n pct === null\n ? undefined\n : {\n transition:\n 'stroke-dashoffset var(--duration-slow) var(--ease-out), stroke var(--duration-slow) var(--ease-out)',\n }\n \"\n />\n </svg>\n <span\n v-if=\"showValue\"\n aria-hidden=\"true\"\n :class=\"cn('tabular text-foreground', VALUE_TEXT[size])\"\n >{{ readout }}</span\n >\n </ProgressRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAa,yBAA+C;CAC1D,QAAQ,EAAE,OAAO,UAAU,GAAG,OAAO,KAAK,MAAO,QAAQ,MAAO,GAAG,CAAC,EAAE;CACtE,eAAe;AACjB;AAiBA,IAAa,yBAAyB,IACpC,6DACA;CACE,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;CACN,EACF;CACA,iBAAiB,EAAE,MAAM,KAAK;AAChC,CACF;;;;;;;;;;;;;;;;;;EAgCA,MAAM,QAAQ;;;;;;EAuCd,MAAM,OAAO;EACb,MAAM,SAAS,OAAO;EAEtB,MAAM,SAAS;GACb,MAAM;GACN,SAAS;GACT,OAAO;EACT;;EAGA,MAAM,aAAa;GACjB,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;EAQA,MAAM,EAAE,OAAO,SAAS,cAAc;;;;;;;EAQtC,MAAM,QAAQ,eACZ,MAAM,eAAe,QAAQ,MAAM,eAAe,KAAA,IAC9C,OACA,KAAK,IAAI,KAAK,IAAI,MAAM,YAAY,CAAC,GAAG,MAAM,GAAG,CACvD;;EAGA,MAAM,MAAM,eACV,MAAM,UAAU,OAAO,OAAQ,MAAM,QAAQ,MAAM,MAAO,GAC5D;EAEA,MAAM,cAAc,eAAe,OAAO,MAAM,UAAU;;;;;;;;EAS1D,MAAM,SAAS,eAAe,SAAS,YAAY,QAAQ,CAAC;;;;;;EAO5D,MAAM,gBAAgB,eAAe,IAAI,KAAK,KAAK,OAAO,KAAK;;;;;;EAO/D,MAAM,YAAY,eAChB,IAAI,UAAU,OACV,GAAG,cAAc,QAAQ,IAAK,GAAG,cAAc,UAC/C,GAAG,cAAc,OACvB;EAEA,MAAM,aAAa,eACjB,IAAI,UAAU,OAAO,IAAI,cAAc,SAAS,IAAI,IAAI,QAAQ,IAClE;;;;;;EAOA,MAAM,UAAU,eAAgB,IAAI,UAAU,IAAI,SAAS,OAAQ;EAKnE,MAAM,OAAO,UAAU,kBAAkB,8BAA8B,MAAM,MAAM;;;;;;EAOnF,MAAM,UAAU,eACd,MAAM,UAAU,OACZ,KAAK,MAAM,gBACX,KAAK,MAAM,MAAM;GAAE,OAAO,MAAM;GAAO,KAAK,MAAM;EAAI,CAAC,CAC7D;EAEA,SAAa,EAAE,IAAI,CAAC;;GAIlB,OAAA,UAAA,GAAA,YAkEe,MAAA,YAAA,GAlEf,WAkEe;IAjEZ,eAAa,MAAA;IACb,KAAK,QAAA;IACL,cAAY,QAAA;IACZ,mBAAiB,QAAA;GACV,GAAA,MAAA,IAAA,GAAI,EACX,OAAO,MAAA,EAAA,CAAE,CAAC,MAAA,sBAAA,CAAsB,CAAA,EAAA,MAAG,QAAA,KAAI,CAAA,GAAK,MAAA,KAAA,CAAK,CAAC,KAAK,EAAA,CAAA,GAAA;IAexD,SAAA,cAsCM,EAtCN,UAAA,GAAA,mBAsCM,OAAA;KArCH,SAAO,OAAS,KAAI,GAAI;KACzB,MAAK;KACL,eAAY;KACX,OAAK,eAAE,MAAA,EAAA,CAAE,CAAA,kCAAmC,IAAA,UAAG,QAAA,cAAA,CAAA;IAEhD,GAAA,CAAA,mBAME,UAAA;KALC,IAAI;KACJ,IAAI;KACJ,GAAG,OAAA;KACH,gBAAc,YAAA;KACf,OAAM;IAQR,GAAA,MAAA,GAAA,UAAA,GAAA,mBAkBE,UAAA;KAjBC,IAAI;KACJ,IAAI;KACJ,GAAG,OAAA;KACH,gBAAc,YAAA;KACd,oBAAkB,UAAA;KAClB,qBAAmB,WAAA;KACnB,kBAAgB,QAAA;KAChB,WAAS,cAAgB,OAAM,GAAI,OAAM;KACzC,OAAK,eAAE,IAAA,UAAG,MAAA,mBAAA,gBAAA;KACV,OAAK,eAAa,IAAA,UAAG,OAAwB,KAAA,IAAA,EAAA,YAAA,sGAAA,CAAA;IAW1C,GAAA,MAAA,IAAA,UAAA,CAAA,GAAA,IAAA,UAAA,IAAA,QAAA,aADR,UAAA,GAAA,mBAKC,QAAA;;KAHC,eAAY;KACX,OAAK,eAAE,MAAA,EAAA,CAAE,CAAA,2BAA4B,WAAW,QAAA,KAAI,CAAA;IACjD,GAAA,gBAAA,QAAA,KAAO,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","names":[],"sources":["../../../src/primitives/RadioGroup/RadioGroup.vue"],"sourcesContent":["<script lang=\"ts\">\n/** One selectable row in a {@link RadioGroup}. */\nexport interface RadioOption {\n /** Matched against `modelValue`. */\n value: string;\n /** Visible label, rendered beside the control. */\n label: string;\n /** Secondary text, rendered small under the label. */\n description?: string;\n /** Disables this row alone, leaving its siblings pickable. */\n disabled?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { RadioGroupIndicator, RadioGroupItem, RadioGroupRoot } from \"reka-ui\";\nimport { cn } from \"../../lib/cn\";\nimport { optional } from \"../../lib/props\";\n\n/**\n * RadioGroup — a vertical list of mutually exclusive options, each with a\n * visible (and optionally described) label — for longer or explained\n * choices and settings lists. For a compact horizontal toggle among 2-5\n * short options that are all visible at once, reach for SegmentedControl\n * instead. Built on Reka UI's RadioGroup: roving tabindex (the group is one\n * Tab stop, not N) with arrow-key navigation between items.\n */\
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","names":[],"sources":["../../../src/primitives/RadioGroup/RadioGroup.vue"],"sourcesContent":["<script lang=\"ts\">\n/** One selectable row in a {@link RadioGroup}. */\nexport interface RadioOption {\n /** Matched against `modelValue`. */\n value: string;\n /** Visible label, rendered beside the control. */\n label: string;\n /** Secondary text, rendered small under the label. */\n description?: string;\n /** Disables this row alone, leaving its siblings pickable. */\n disabled?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { RadioGroupIndicator, RadioGroupItem, RadioGroupRoot } from \"reka-ui\";\nimport { cn } from \"../../lib/cn\";\nimport { optional } from \"../../lib/props\";\nimport { useSplitAttrs } from \"../../lib/attrs\";\nimport { useFieldControl } from \"../../lib/field-context\";\n\n/**\n * RadioGroup — a vertical list of mutually exclusive options, each with a\n * visible (and optionally described) label — for longer or explained\n * choices and settings lists. For a compact horizontal toggle among 2-5\n * short options that are all visible at once, reach for SegmentedControl\n * instead. Built on Reka UI's RadioGroup: roving tabindex (the group is one\n * Tab stop, not N) with arrow-key navigation between items.\n *\n * Inside a [Field](../Field/Field.vue) the row's description, `name`,\n * `required` and `invalid` reach the group through `useFieldControl()`, and\n * `name` below still wins wherever it is set — the row and this prop are one\n * concept, not two that can disagree.\n *\n * **A row's label does not name this group.** `<label for>` names a labelable\n * element and this renders a `div[role=\"radiogroup\"]`, so the row's label\n * resolves to the element and names nobody. Name it with a\n * [Fieldset](../Fieldset/Fieldset.vue)'s real `<legend>`, or with an\n * `aria-label`/`aria-labelledby` of its own.\n *\n * There is no `readonly`, and a row's is ignored rather than approximated: each\n * option is a `<button role=\"radio\">` with no native read-only state to put it\n * in, and a group whose options cannot be picked is a disabled group.\n */\nconst props = withDefaults(\n defineProps<{\n /** The selected option's `value`. */\n modelValue?: string;\n /** The rows to render, in order. */\n options: RadioOption[];\n /** Disables every row at once, distinct from a single option's own `disabled`. Unset defers to a wrapping Field. */\n disabled?: boolean | undefined;\n /** Set when this group posts inside a real `<form>` — becomes the submitted field name. Unset defers to a wrapping Field. */\n name?: string;\n }>(),\n {\n // Not `false`: absent has to stay tellable from `false` for a Field above\n // to disable the group and for `:disabled=\"false\"` to overrule one that\n // does. Vue casts an absent Boolean prop with no declared default to\n // `false`, which would leave the context wired and inert.\n disabled: undefined,\n },\n);\n\ndefineEmits<{ \"update:modelValue\": [value: string] }>();\n\ndefineOptions({ inheritAttrs: false });\nconst { attrs, rest: groupAttrs } = useSplitAttrs();\n\n// One rendered node, so the split is only about `class` — a caller's class\n// needs a Tailwind-aware merge rather than Vue's concatenating fallthrough.\n//\n// `id` and `aria-describedby` arrive as fallthrough attrs rather than props, so\n// they are handed in as this caller's own values; `field.attrs` then spreads\n// **after** `groupAttrs`, and that position is the contract (see TextField.vue).\n// `name` leaves `optional()` below with it: resolved once here, it reaches\n// RadioGroupRoot's own `name` prop, which is what mints the hidden input a\n// `<form>` submits.\n//\n// `required` and `invalid` are omitted because this component has no prop for\n// either — the row's answer stands unopposed. `readonly` is omitted for the\n// reason the docblock gives.\n//\n// The resolved `required` then reaches the group through Reka's own prop rather\n// than the `aria-required` in `field.attrs`: RadioGroupRoot writes that\n// attribute itself, so leaving it to the bag is a race with a `false` — see\n// Checkbox.vue, where the merge order makes the same race a certainty.\nconst field = useFieldControl(() => ({\n id: attrs.id as string | undefined,\n describedBy: attrs[\"aria-describedby\"] as string | undefined,\n name: props.name,\n disabled: props.disabled,\n}));\n</script>\n\n<template>\n <RadioGroupRoot\n v-bind=\"{ ...optional({ modelValue }), ...groupAttrs, ...field.attrs }\"\n :disabled=\"field.disabled\"\n :required=\"field.required\"\n orientation=\"vertical\"\n :class=\"cn('flex flex-col gap-3', attrs.class as string)\"\n @update:model-value=\"$emit('update:modelValue', String($event))\"\n >\n <!-- RadioGroupItem is a labelable <button role=\"radio\">, so wrapping it in\n <label> names it exactly like a native control; the rule's\n nesting/id heuristic just doesn't recognize reka-ui's custom element\n as a \"control\". -->\n <!-- eslint-disable-next-line vuejs-accessibility/label-has-for -->\n <label\n v-for=\"opt in options\"\n :key=\"opt.value\"\n :class=\"\n cn(\n 'flex items-start gap-2 text-sm text-foreground',\n // Disabled text stays readable (AA on the light ground) — only the\n // control glyph dims; quiet, not illegible.\n field.disabled || opt.disabled\n ? 'cursor-not-allowed text-muted-foreground'\n : 'cursor-pointer',\n )\n \"\n >\n <RadioGroupItem\n :value=\"opt.value\"\n :class=\"\n cn(\n 'mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-input bg-background',\n // Springy transform (press squish), steady color — the transform\n // rides --ease-spring while border stays instant --ease-out (style\n // below), same press language as Button/Switch/Checkbox.\n 'active:scale-90',\n // Selected = a decision (Loom law): the ring turns primary.\n 'data-[state=checked]:border-primary',\n // Focus draws the weave tight: the brand ring blooms.\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:shadow-halo',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n )\n \"\n :disabled=\"opt.disabled ?? false\"\n style=\"\n transition:\n transform var(--duration-fast) var(--ease-spring),\n border-color var(--duration-instant) var(--ease-out),\n box-shadow var(--duration-fast) var(--ease-out);\n \"\n >\n <!-- The dot pops in with scale-in — a small causal \"it's selected now\". -->\n <RadioGroupIndicator class=\"flex animate-scale-in items-center justify-center\">\n <span class=\"h-2 w-2 rounded-full bg-primary\" />\n </RadioGroupIndicator>\n </RadioGroupItem>\n <span class=\"flex flex-col gap-0.5\">\n <span>{{ opt.label }}</span>\n <span v-if=\"opt.description\" class=\"text-xs text-muted-foreground\">{{\n opt.description\n }}</span>\n </span>\n </label>\n </RadioGroupRoot>\n</template>\n"],"mappings":""}
|
|
@@ -16,9 +16,9 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
16
16
|
modelValue?: string;
|
|
17
17
|
/** The rows to render, in order. */
|
|
18
18
|
options: RadioOption[];
|
|
19
|
-
/** Disables every row at once, distinct from a single option's own `disabled`. */
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
/** Set when this group posts inside a real `<form>` — becomes the submitted field name. */
|
|
19
|
+
/** Disables every row at once, distinct from a single option's own `disabled`. Unset defers to a wrapping Field. */
|
|
20
|
+
disabled?: boolean | undefined;
|
|
21
|
+
/** Set when this group posts inside a real `<form>` — becomes the submitted field name. Unset defers to a wrapping Field. */
|
|
22
22
|
name?: string;
|
|
23
23
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
24
24
|
"update:modelValue": (value: string) => any;
|
|
@@ -27,13 +27,13 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
27
27
|
modelValue?: string;
|
|
28
28
|
/** The rows to render, in order. */
|
|
29
29
|
options: RadioOption[];
|
|
30
|
-
/** Disables every row at once, distinct from a single option's own `disabled`. */
|
|
31
|
-
disabled?: boolean;
|
|
32
|
-
/** Set when this group posts inside a real `<form>` — becomes the submitted field name. */
|
|
30
|
+
/** Disables every row at once, distinct from a single option's own `disabled`. Unset defers to a wrapping Field. */
|
|
31
|
+
disabled?: boolean | undefined;
|
|
32
|
+
/** Set when this group posts inside a real `<form>` — becomes the submitted field name. Unset defers to a wrapping Field. */
|
|
33
33
|
name?: string;
|
|
34
34
|
}> & Readonly<{
|
|
35
35
|
"onUpdate:modelValue"?: (value: string) => any;
|
|
36
36
|
}>, {
|
|
37
|
-
disabled: boolean;
|
|
37
|
+
disabled: boolean | undefined;
|
|
38
38
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
39
|
//# sourceMappingURL=RadioGroup.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/primitives/RadioGroup/RadioGroup.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RadioGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/primitives/RadioGroup/RadioGroup.vue"],"names":[],"mappings":"AA2KA,kDAAkD;AAClD,MAAM,WAAW,WAAW;IAC1B,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;wBACoB,OAAO,YAAY;AAAxC,wBAAyC;AACzC,QAAA,MAAM,YAAY;IAyBd,qCAAqC;iBACxB,MAAM;IACnB,oCAAoC;aAC3B,WAAW,EAAE;IACtB,oHAAoH;eACzG,OAAO,GAAG,SAAS;IAC9B,6HAA6H;WACtH,MAAM;;;;IAPb,qCAAqC;iBACxB,MAAM;IACnB,oCAAoC;aAC3B,WAAW,EAAE;IACtB,oHAAoH;eACzG,OAAO,GAAG,SAAS;IAC9B,6HAA6H;WACtH,MAAM;;;;cAFF,OAAO,GAAG,SAAS;6EAsO9B,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { cn } from "../../lib/cn.js";
|
|
2
2
|
import { optional } from "../../lib/props.js";
|
|
3
|
+
import { useSplitAttrs } from "../../lib/attrs.js";
|
|
4
|
+
import { useFieldControl } from "../../lib/field-context.js";
|
|
3
5
|
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
|
|
4
6
|
import { RadioGroupIndicator, RadioGroupItem, RadioGroupRoot } from "reka-ui";
|
|
5
7
|
//#region src/primitives/RadioGroup/RadioGroup.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -9,32 +11,43 @@ var _hoisted_2 = {
|
|
|
9
11
|
class: "text-xs text-muted-foreground"
|
|
10
12
|
};
|
|
11
13
|
var RadioGroup_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
14
|
+
inheritAttrs: false,
|
|
12
15
|
__name: "RadioGroup",
|
|
13
16
|
props: {
|
|
14
17
|
modelValue: {},
|
|
15
18
|
options: {},
|
|
16
19
|
disabled: {
|
|
17
20
|
type: Boolean,
|
|
18
|
-
default:
|
|
21
|
+
default: void 0
|
|
19
22
|
},
|
|
20
23
|
name: {}
|
|
21
24
|
},
|
|
22
25
|
emits: ["update:modelValue"],
|
|
23
26
|
setup(__props) {
|
|
27
|
+
const props = __props;
|
|
28
|
+
const { attrs, rest: groupAttrs } = useSplitAttrs();
|
|
29
|
+
const field = useFieldControl(() => ({
|
|
30
|
+
id: attrs.id,
|
|
31
|
+
describedBy: attrs["aria-describedby"],
|
|
32
|
+
name: props.name,
|
|
33
|
+
disabled: props.disabled
|
|
34
|
+
}));
|
|
24
35
|
return (_ctx, _cache) => {
|
|
25
|
-
return openBlock(), createBlock(unref(RadioGroupRoot), mergeProps(
|
|
26
|
-
modelValue: __props.modelValue,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
return openBlock(), createBlock(unref(RadioGroupRoot), mergeProps({
|
|
37
|
+
...unref(optional)({ modelValue: __props.modelValue }),
|
|
38
|
+
...unref(groupAttrs),
|
|
39
|
+
...unref(field).attrs
|
|
40
|
+
}, {
|
|
41
|
+
disabled: unref(field).disabled,
|
|
42
|
+
required: unref(field).required,
|
|
30
43
|
orientation: "vertical",
|
|
31
|
-
class: "flex flex-col gap-3",
|
|
44
|
+
class: unref(cn)("flex flex-col gap-3", unref(attrs).class),
|
|
32
45
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", String($event)))
|
|
33
46
|
}), {
|
|
34
47
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (opt) => {
|
|
35
48
|
return openBlock(), createElementBlock("label", {
|
|
36
49
|
key: opt.value,
|
|
37
|
-
class: normalizeClass(unref(cn)("flex items-start gap-2 text-sm text-foreground",
|
|
50
|
+
class: normalizeClass(unref(cn)("flex items-start gap-2 text-sm text-foreground", unref(field).disabled || opt.disabled ? "cursor-not-allowed text-muted-foreground" : "cursor-pointer"))
|
|
38
51
|
}, [createVNode(unref(RadioGroupItem), {
|
|
39
52
|
value: opt.value,
|
|
40
53
|
class: normalizeClass(unref(cn)("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-input bg-background", "active:scale-90", "data-[state=checked]:border-primary", "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:shadow-halo", "disabled:cursor-not-allowed disabled:opacity-50")),
|
|
@@ -53,7 +66,11 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
53
66
|
]), createElementVNode("span", _hoisted_1, [createElementVNode("span", null, toDisplayString(opt.label), 1), opt.description ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(opt.description), 1)) : createCommentVNode("", true)])], 2);
|
|
54
67
|
}), 128))]),
|
|
55
68
|
_: 1
|
|
56
|
-
}, 16, [
|
|
69
|
+
}, 16, [
|
|
70
|
+
"disabled",
|
|
71
|
+
"required",
|
|
72
|
+
"class"
|
|
73
|
+
]);
|
|
57
74
|
};
|
|
58
75
|
}
|
|
59
76
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.vue_vue_type_script_setup_true_lang.js","names":["$emit"],"sources":["../../../src/primitives/RadioGroup/RadioGroup.vue"],"sourcesContent":["<script lang=\"ts\">\n/** One selectable row in a {@link RadioGroup}. */\nexport interface RadioOption {\n /** Matched against `modelValue`. */\n value: string;\n /** Visible label, rendered beside the control. */\n label: string;\n /** Secondary text, rendered small under the label. */\n description?: string;\n /** Disables this row alone, leaving its siblings pickable. */\n disabled?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { RadioGroupIndicator, RadioGroupItem, RadioGroupRoot } from \"reka-ui\";\nimport { cn } from \"../../lib/cn\";\nimport { optional } from \"../../lib/props\";\n\n/**\n * RadioGroup — a vertical list of mutually exclusive options, each with a\n * visible (and optionally described) label — for longer or explained\n * choices and settings lists. For a compact horizontal toggle among 2-5\n * short options that are all visible at once, reach for SegmentedControl\n * instead. Built on Reka UI's RadioGroup: roving tabindex (the group is one\n * Tab stop, not N) with arrow-key navigation between items.\n */\
|
|
1
|
+
{"version":3,"file":"RadioGroup.vue_vue_type_script_setup_true_lang.js","names":["$emit"],"sources":["../../../src/primitives/RadioGroup/RadioGroup.vue"],"sourcesContent":["<script lang=\"ts\">\n/** One selectable row in a {@link RadioGroup}. */\nexport interface RadioOption {\n /** Matched against `modelValue`. */\n value: string;\n /** Visible label, rendered beside the control. */\n label: string;\n /** Secondary text, rendered small under the label. */\n description?: string;\n /** Disables this row alone, leaving its siblings pickable. */\n disabled?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { RadioGroupIndicator, RadioGroupItem, RadioGroupRoot } from \"reka-ui\";\nimport { cn } from \"../../lib/cn\";\nimport { optional } from \"../../lib/props\";\nimport { useSplitAttrs } from \"../../lib/attrs\";\nimport { useFieldControl } from \"../../lib/field-context\";\n\n/**\n * RadioGroup — a vertical list of mutually exclusive options, each with a\n * visible (and optionally described) label — for longer or explained\n * choices and settings lists. For a compact horizontal toggle among 2-5\n * short options that are all visible at once, reach for SegmentedControl\n * instead. Built on Reka UI's RadioGroup: roving tabindex (the group is one\n * Tab stop, not N) with arrow-key navigation between items.\n *\n * Inside a [Field](../Field/Field.vue) the row's description, `name`,\n * `required` and `invalid` reach the group through `useFieldControl()`, and\n * `name` below still wins wherever it is set — the row and this prop are one\n * concept, not two that can disagree.\n *\n * **A row's label does not name this group.** `<label for>` names a labelable\n * element and this renders a `div[role=\"radiogroup\"]`, so the row's label\n * resolves to the element and names nobody. Name it with a\n * [Fieldset](../Fieldset/Fieldset.vue)'s real `<legend>`, or with an\n * `aria-label`/`aria-labelledby` of its own.\n *\n * There is no `readonly`, and a row's is ignored rather than approximated: each\n * option is a `<button role=\"radio\">` with no native read-only state to put it\n * in, and a group whose options cannot be picked is a disabled group.\n */\nconst props = withDefaults(\n defineProps<{\n /** The selected option's `value`. */\n modelValue?: string;\n /** The rows to render, in order. */\n options: RadioOption[];\n /** Disables every row at once, distinct from a single option's own `disabled`. Unset defers to a wrapping Field. */\n disabled?: boolean | undefined;\n /** Set when this group posts inside a real `<form>` — becomes the submitted field name. Unset defers to a wrapping Field. */\n name?: string;\n }>(),\n {\n // Not `false`: absent has to stay tellable from `false` for a Field above\n // to disable the group and for `:disabled=\"false\"` to overrule one that\n // does. Vue casts an absent Boolean prop with no declared default to\n // `false`, which would leave the context wired and inert.\n disabled: undefined,\n },\n);\n\ndefineEmits<{ \"update:modelValue\": [value: string] }>();\n\ndefineOptions({ inheritAttrs: false });\nconst { attrs, rest: groupAttrs } = useSplitAttrs();\n\n// One rendered node, so the split is only about `class` — a caller's class\n// needs a Tailwind-aware merge rather than Vue's concatenating fallthrough.\n//\n// `id` and `aria-describedby` arrive as fallthrough attrs rather than props, so\n// they are handed in as this caller's own values; `field.attrs` then spreads\n// **after** `groupAttrs`, and that position is the contract (see TextField.vue).\n// `name` leaves `optional()` below with it: resolved once here, it reaches\n// RadioGroupRoot's own `name` prop, which is what mints the hidden input a\n// `<form>` submits.\n//\n// `required` and `invalid` are omitted because this component has no prop for\n// either — the row's answer stands unopposed. `readonly` is omitted for the\n// reason the docblock gives.\n//\n// The resolved `required` then reaches the group through Reka's own prop rather\n// than the `aria-required` in `field.attrs`: RadioGroupRoot writes that\n// attribute itself, so leaving it to the bag is a race with a `false` — see\n// Checkbox.vue, where the merge order makes the same race a certainty.\nconst field = useFieldControl(() => ({\n id: attrs.id as string | undefined,\n describedBy: attrs[\"aria-describedby\"] as string | undefined,\n name: props.name,\n disabled: props.disabled,\n}));\n</script>\n\n<template>\n <RadioGroupRoot\n v-bind=\"{ ...optional({ modelValue }), ...groupAttrs, ...field.attrs }\"\n :disabled=\"field.disabled\"\n :required=\"field.required\"\n orientation=\"vertical\"\n :class=\"cn('flex flex-col gap-3', attrs.class as string)\"\n @update:model-value=\"$emit('update:modelValue', String($event))\"\n >\n <!-- RadioGroupItem is a labelable <button role=\"radio\">, so wrapping it in\n <label> names it exactly like a native control; the rule's\n nesting/id heuristic just doesn't recognize reka-ui's custom element\n as a \"control\". -->\n <!-- eslint-disable-next-line vuejs-accessibility/label-has-for -->\n <label\n v-for=\"opt in options\"\n :key=\"opt.value\"\n :class=\"\n cn(\n 'flex items-start gap-2 text-sm text-foreground',\n // Disabled text stays readable (AA on the light ground) — only the\n // control glyph dims; quiet, not illegible.\n field.disabled || opt.disabled\n ? 'cursor-not-allowed text-muted-foreground'\n : 'cursor-pointer',\n )\n \"\n >\n <RadioGroupItem\n :value=\"opt.value\"\n :class=\"\n cn(\n 'mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-input bg-background',\n // Springy transform (press squish), steady color — the transform\n // rides --ease-spring while border stays instant --ease-out (style\n // below), same press language as Button/Switch/Checkbox.\n 'active:scale-90',\n // Selected = a decision (Loom law): the ring turns primary.\n 'data-[state=checked]:border-primary',\n // Focus draws the weave tight: the brand ring blooms.\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:shadow-halo',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n )\n \"\n :disabled=\"opt.disabled ?? false\"\n style=\"\n transition:\n transform var(--duration-fast) var(--ease-spring),\n border-color var(--duration-instant) var(--ease-out),\n box-shadow var(--duration-fast) var(--ease-out);\n \"\n >\n <!-- The dot pops in with scale-in — a small causal \"it's selected now\". -->\n <RadioGroupIndicator class=\"flex animate-scale-in items-center justify-center\">\n <span class=\"h-2 w-2 rounded-full bg-primary\" />\n </RadioGroupIndicator>\n </RadioGroupItem>\n <span class=\"flex flex-col gap-0.5\">\n <span>{{ opt.label }}</span>\n <span v-if=\"opt.description\" class=\"text-xs text-muted-foreground\">{{\n opt.description\n }}</span>\n </span>\n </label>\n </RadioGroupRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EA4CA,MAAM,QAAQ;EAuBd,MAAM,EAAE,OAAO,MAAM,eAAe,cAAc;EAoBlD,MAAM,QAAQ,uBAAuB;GACnC,IAAI,MAAM;GACV,aAAa,MAAM;GACnB,MAAM,MAAM;GACZ,UAAU,MAAM;EAClB,EAAE;;GAIA,OAAA,UAAA,GAAA,YA+DiB,MAAA,cAAA,GA/DjB,WA+DiB;IAAA,GA9DF,MAAA,QAAA,CAAQ,CAAA,EAAA,YAAG,QAAA,WAAU,CAAA;IAAA,GAAQ,MAAA,UAAA;IAAU,GAAK,MAAA,KAAA,CAAK,CAAC;GAAK,GAAA;IACnE,UAAU,MAAA,KAAA,CAAK,CAAC;IAChB,UAAU,MAAA,KAAA,CAAK,CAAC;IACjB,aAAY;IACX,OAAO,MAAA,EAAA,CAAE,CAAA,uBAAwB,MAAA,KAAA,CAAK,CAAC,KAAK;IAC5C,uBAAkB,OAAA,OAAA,OAAA,MAAA,WAAEA,KAAAA,MAAK,qBAAsB,OAAO,MAAM,CAAA;;IAQ3D,SAAA,cAAsB,EADxB,UAAA,IAAA,GAAA,mBAiDQ,UAAA,MAAA,WAhDQ,QAAA,UAAP,QAAG;KADZ,OAAA,UAAA,GAAA,mBAiDQ,SAAA;MA/CL,KAAK,IAAI;MACT,OAAK,eAAW,MAAA,EAAA,CAAE,CAAA,kDAA6M,MAAA,KAAA,CAAK,CAAC,YAAY,IAAI,WAAA,6CAAA,gBAAA,CAAA;KAWtP,GAAA,CAAA,YA4BiB,MAAA,cAAA,GAAA;MA3Bd,OAAO,IAAI;MACX,OAAK,eAAa,MAAA,EAAA,CAAE,CAAA,2GAAA,mBAAA,uCAAA,+GAAA,iDAAA,CAAA;MAcpB,UAAU,IAAI,YAAQ;MACvB,OAAA,EAAA,cAAA,qLAAA;;MAQA,SAAA,cAEsB,CAFtB,YAEsB,MAAA,mBAAA,GAAA,EAFD,OAAM,oDAAmD,GAAA;OAC5E,SAAA,cAAgD,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAhD,mBAAgD,QAAA,EAA1C,OAAM,kCAAiC,GAAA,MAAA,EAAA,CAAA,EAAA,CAAA;;;;;;;;KAGjD,CAAA,GAAA,mBAKO,QALP,YAKO,CAJL,mBAA4B,QAAA,MAAA,gBAAnB,IAAI,KAAK,GAAA,CAAA,GACN,IAAI,eAAhB,UAAA,GAAA,mBAES,QAFT,YAES,gBADP,IAAI,WAAW,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Rating_vue_vue_type_script_setup_true_lang_default, { RATING_LABELS } from "./Rating.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/primitives/Rating/Rating.vue
|
|
3
|
+
var Rating_default = Rating_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { RATING_LABELS, Rating_default as default };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=Rating.js.map
|