@hewnui/ui 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +69 -2
- package/dist/chart/axes.d.ts +31 -0
- package/dist/chart/axes.js +20 -0
- package/dist/chart/colors.d.ts +1 -0
- package/dist/chart/colors.js +13 -0
- package/dist/chart/frame.d.ts +13 -0
- package/dist/chart/frame.js +17 -0
- package/dist/chart/interaction.d.ts +22 -0
- package/dist/chart/interaction.js +22 -0
- package/dist/chart/path.d.ts +10 -0
- package/dist/chart/path.js +24 -0
- package/dist/chart/scales.d.ts +34 -0
- package/dist/chart/scales.js +66 -0
- package/dist/chart/status.d.ts +3 -0
- package/dist/chart/status.js +15 -0
- package/dist/chart/types.d.ts +34 -0
- package/dist/chart/types.js +6 -0
- package/dist/components/area-chart/area-chart.d.ts +17 -0
- package/dist/components/area-chart/area-chart.js +54 -0
- package/dist/components/area-chart/index.d.ts +1 -0
- package/dist/components/area-chart/index.js +1 -0
- package/dist/components/badge/badge.d.ts +2 -0
- package/dist/components/badge/badge.js +5 -0
- package/dist/components/badge/badge.styles.d.ts +8 -0
- package/dist/components/badge/badge.styles.js +57 -0
- package/dist/components/badge/badge.types.d.ts +11 -0
- package/dist/components/badge/badge.types.js +1 -0
- package/dist/components/badge/index.d.ts +3 -0
- package/dist/components/badge/index.js +2 -0
- package/dist/components/bar-chart/bar-chart.d.ts +17 -0
- package/dist/components/bar-chart/bar-chart.js +73 -0
- package/dist/components/bar-chart/index.d.ts +1 -0
- package/dist/components/bar-chart/index.js +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +3 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +13 -0
- package/dist/components/breadcrumbs/breadcrumbs.styles.d.ts +5 -0
- package/dist/components/breadcrumbs/breadcrumbs.styles.js +10 -0
- package/dist/components/breadcrumbs/breadcrumbs.types.d.ts +16 -0
- package/dist/components/breadcrumbs/breadcrumbs.types.js +1 -0
- package/dist/components/breadcrumbs/index.d.ts +2 -0
- package/dist/components/breadcrumbs/index.js +1 -0
- package/dist/components/button/button.d.ts +2 -0
- package/dist/components/button/button.js +18 -0
- package/dist/components/button/button.motion.d.ts +23 -0
- package/dist/components/button/button.motion.js +11 -0
- package/dist/components/button/button.styles.d.ts +10 -0
- package/dist/components/button/button.styles.js +24 -0
- package/dist/components/button/button.types.d.ts +11 -0
- package/dist/components/button/button.types.js +1 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/card/card.d.ts +21 -0
- package/dist/components/card/card.js +19 -0
- package/dist/components/card/card.styles.d.ts +4 -0
- package/dist/components/card/card.styles.js +13 -0
- package/dist/components/card/card.types.d.ts +4 -0
- package/dist/components/card/card.types.js +1 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/checkbox/checkbox.d.ts +2 -0
- package/dist/components/checkbox/checkbox.js +17 -0
- package/dist/components/checkbox/checkbox.styles.d.ts +3 -0
- package/dist/components/checkbox/checkbox.styles.js +6 -0
- package/dist/components/checkbox/checkbox.types.d.ts +6 -0
- package/dist/components/checkbox/checkbox.types.js +1 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/checkbox-group/checkbox-group.d.ts +2 -0
- package/dist/components/checkbox-group/checkbox-group.js +8 -0
- package/dist/components/checkbox-group/checkbox-group.styles.d.ts +2 -0
- package/dist/components/checkbox-group/checkbox-group.styles.js +5 -0
- package/dist/components/checkbox-group/checkbox-group.types.d.ts +9 -0
- package/dist/components/checkbox-group/checkbox-group.types.js +1 -0
- package/dist/components/checkbox-group/index.d.ts +2 -0
- package/dist/components/checkbox-group/index.js +1 -0
- package/dist/components/color-picker/color-picker.d.ts +2 -0
- package/dist/components/color-picker/color-picker.js +27 -0
- package/dist/components/color-picker/color-picker.oklch.d.ts +2 -0
- package/dist/components/color-picker/color-picker.oklch.js +54 -0
- package/dist/components/color-picker/color-picker.panel.d.ts +2 -0
- package/dist/components/color-picker/color-picker.panel.js +15 -0
- package/dist/components/color-picker/color-picker.styles.d.ts +16 -0
- package/dist/components/color-picker/color-picker.styles.js +28 -0
- package/dist/components/color-picker/color-picker.types.d.ts +36 -0
- package/dist/components/color-picker/color-picker.types.js +1 -0
- package/dist/components/color-picker/index.d.ts +4 -0
- package/dist/components/color-picker/index.js +3 -0
- package/dist/components/combobox/combobox.d.ts +15 -0
- package/dist/components/combobox/combobox.js +11 -0
- package/dist/components/combobox/index.d.ts +1 -0
- package/dist/components/combobox/index.js +1 -0
- package/dist/components/command-palette/command-palette-items.d.ts +4 -0
- package/dist/components/command-palette/command-palette-items.js +14 -0
- package/dist/components/command-palette/command-palette.d.ts +15 -0
- package/dist/components/command-palette/command-palette.hotkey.d.ts +8 -0
- package/dist/components/command-palette/command-palette.hotkey.js +51 -0
- package/dist/components/command-palette/command-palette.js +33 -0
- package/dist/components/command-palette/command-palette.styles.d.ts +13 -0
- package/dist/components/command-palette/command-palette.styles.js +25 -0
- package/dist/components/command-palette/command-palette.types.d.ts +65 -0
- package/dist/components/command-palette/command-palette.types.js +1 -0
- package/dist/components/command-palette/index.d.ts +14 -0
- package/dist/components/command-palette/index.js +13 -0
- package/dist/components/data-table/data-table.d.ts +7 -0
- package/dist/components/data-table/data-table.js +31 -0
- package/dist/components/data-table/index.d.ts +1 -0
- package/dist/components/data-table/index.js +1 -0
- package/dist/components/date-picker/date-picker.d.ts +7 -0
- package/dist/components/date-picker/date-picker.js +8 -0
- package/dist/components/date-picker/index.d.ts +1 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/date-range-picker/date-range-picker.calendar.d.ts +5 -0
- package/dist/components/date-range-picker/date-range-picker.calendar.js +21 -0
- package/dist/components/date-range-picker/date-range-picker.d.ts +2 -0
- package/dist/components/date-range-picker/date-range-picker.js +9 -0
- package/dist/components/date-range-picker/date-range-picker.presets.d.ts +3 -0
- package/dist/components/date-range-picker/date-range-picker.presets.js +53 -0
- package/dist/components/date-range-picker/date-range-picker.styles.d.ts +11 -0
- package/dist/components/date-range-picker/date-range-picker.styles.js +14 -0
- package/dist/components/date-range-picker/date-range-picker.types.d.ts +28 -0
- package/dist/components/date-range-picker/date-range-picker.types.js +1 -0
- package/dist/components/date-range-picker/index.d.ts +2 -0
- package/dist/components/date-range-picker/index.js +1 -0
- package/dist/components/dialog/dialog.d.ts +18 -0
- package/dist/components/dialog/dialog.js +16 -0
- package/dist/components/dialog/dialog.styles.d.ts +6 -0
- package/dist/components/dialog/dialog.styles.js +9 -0
- package/dist/components/dialog/index.d.ts +7 -0
- package/dist/components/dialog/index.js +7 -0
- package/dist/components/donut-chart/donut-chart.d.ts +17 -0
- package/dist/components/donut-chart/donut-chart.js +65 -0
- package/dist/components/donut-chart/index.d.ts +1 -0
- package/dist/components/donut-chart/index.js +1 -0
- package/dist/components/drawer/drawer.d.ts +13 -0
- package/dist/components/drawer/drawer.js +14 -0
- package/dist/components/drawer/index.d.ts +1 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/empty/empty.d.ts +7 -0
- package/dist/components/empty/empty.js +5 -0
- package/dist/components/empty/index.d.ts +1 -0
- package/dist/components/empty/index.js +1 -0
- package/dist/components/file-upload/file-upload.d.ts +2 -0
- package/dist/components/file-upload/file-upload.js +44 -0
- package/dist/components/file-upload/file-upload.styles.d.ts +12 -0
- package/dist/components/file-upload/file-upload.styles.js +14 -0
- package/dist/components/file-upload/file-upload.types.d.ts +16 -0
- package/dist/components/file-upload/file-upload.types.js +1 -0
- package/dist/components/file-upload/index.d.ts +2 -0
- package/dist/components/file-upload/index.js +1 -0
- package/dist/components/form/form.d.ts +2 -0
- package/dist/components/form/form.js +7 -0
- package/dist/components/form/form.styles.d.ts +1 -0
- package/dist/components/form/form.styles.js +4 -0
- package/dist/components/form/form.types.d.ts +6 -0
- package/dist/components/form/form.types.js +1 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +1 -0
- package/dist/components/input-group/index.d.ts +2 -0
- package/dist/components/input-group/index.js +1 -0
- package/dist/components/input-group/input-group.d.ts +14 -0
- package/dist/components/input-group/input-group.js +24 -0
- package/dist/components/input-group/input-group.styles.d.ts +8 -0
- package/dist/components/input-group/input-group.styles.js +9 -0
- package/dist/components/input-group/input-group.types.d.ts +22 -0
- package/dist/components/input-group/input-group.types.js +1 -0
- package/dist/components/input-otp/index.d.ts +2 -0
- package/dist/components/input-otp/index.js +1 -0
- package/dist/components/input-otp/input-otp.d.ts +2 -0
- package/dist/components/input-otp/input-otp.js +76 -0
- package/dist/components/input-otp/input-otp.styles.d.ts +8 -0
- package/dist/components/input-otp/input-otp.styles.js +11 -0
- package/dist/components/input-otp/input-otp.types.d.ts +23 -0
- package/dist/components/input-otp/input-otp.types.js +1 -0
- package/dist/components/line-chart/index.d.ts +1 -0
- package/dist/components/line-chart/index.js +1 -0
- package/dist/components/line-chart/line-chart.d.ts +17 -0
- package/dist/components/line-chart/line-chart.js +53 -0
- package/dist/components/link/index.d.ts +2 -0
- package/dist/components/link/index.js +1 -0
- package/dist/components/link/link.d.ts +2 -0
- package/dist/components/link/link.js +7 -0
- package/dist/components/link/link.styles.d.ts +5 -0
- package/dist/components/link/link.styles.js +9 -0
- package/dist/components/link/link.types.d.ts +8 -0
- package/dist/components/link/link.types.js +1 -0
- package/dist/components/menu/index.d.ts +8 -0
- package/dist/components/menu/index.js +8 -0
- package/dist/components/menu/menu.d.ts +20 -0
- package/dist/components/menu/menu.js +26 -0
- package/dist/components/number-field/index.d.ts +2 -0
- package/dist/components/number-field/index.js +1 -0
- package/dist/components/number-field/number-field.d.ts +2 -0
- package/dist/components/number-field/number-field.js +14 -0
- package/dist/components/number-field/number-field.styles.d.ts +8 -0
- package/dist/components/number-field/number-field.styles.js +7 -0
- package/dist/components/number-field/number-field.types.d.ts +14 -0
- package/dist/components/number-field/number-field.types.js +1 -0
- package/dist/components/pagination/index.d.ts +3 -0
- package/dist/components/pagination/index.js +2 -0
- package/dist/components/pagination/pagination.d.ts +2 -0
- package/dist/components/pagination/pagination.js +49 -0
- package/dist/components/pagination/pagination.styles.d.ts +8 -0
- package/dist/components/pagination/pagination.styles.js +19 -0
- package/dist/components/pagination/pagination.types.d.ts +35 -0
- package/dist/components/pagination/pagination.types.js +1 -0
- package/dist/components/pagination/pagination.utils.d.ts +6 -0
- package/dist/components/pagination/pagination.utils.js +51 -0
- package/dist/components/password-field/index.d.ts +2 -0
- package/dist/components/password-field/index.js +1 -0
- package/dist/components/password-field/password-field.d.ts +2 -0
- package/dist/components/password-field/password-field.js +17 -0
- package/dist/components/password-field/password-field.styles.d.ts +8 -0
- package/dist/components/password-field/password-field.styles.js +7 -0
- package/dist/components/password-field/password-field.types.d.ts +16 -0
- package/dist/components/password-field/password-field.types.js +1 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/popover/popover.d.ts +10 -0
- package/dist/components/popover/popover.js +16 -0
- package/dist/components/popover/popover.styles.d.ts +3 -0
- package/dist/components/popover/popover.styles.js +7 -0
- package/dist/components/popover/popover.types.d.ts +14 -0
- package/dist/components/popover/popover.types.js +1 -0
- package/dist/components/progress/index.d.ts +2 -0
- package/dist/components/progress/index.js +1 -0
- package/dist/components/progress/progress.d.ts +12 -0
- package/dist/components/progress/progress.js +26 -0
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/index.js +1 -0
- package/dist/components/radio-group/radio-group.d.ts +3 -0
- package/dist/components/radio-group/radio-group.js +21 -0
- package/dist/components/radio-group/radio-group.styles.d.ts +5 -0
- package/dist/components/radio-group/radio-group.styles.js +14 -0
- package/dist/components/radio-group/radio-group.types.d.ts +14 -0
- package/dist/components/radio-group/radio-group.types.js +1 -0
- package/dist/components/search-field/index.d.ts +2 -0
- package/dist/components/search-field/index.js +1 -0
- package/dist/components/search-field/search-field.d.ts +2 -0
- package/dist/components/search-field/search-field.js +15 -0
- package/dist/components/search-field/search-field.styles.d.ts +8 -0
- package/dist/components/search-field/search-field.styles.js +7 -0
- package/dist/components/search-field/search-field.types.d.ts +15 -0
- package/dist/components/search-field/search-field.types.js +1 -0
- package/dist/components/select/index.d.ts +5 -0
- package/dist/components/select/index.js +5 -0
- package/dist/components/select/select.d.ts +16 -0
- package/dist/components/select/select.js +11 -0
- package/dist/components/select/select.styles.d.ts +5 -0
- package/dist/components/select/select.styles.js +13 -0
- package/dist/components/skeleton/index.d.ts +1 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/skeleton/skeleton.d.ts +3 -0
- package/dist/components/skeleton/skeleton.js +5 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/slider/slider.d.ts +2 -0
- package/dist/components/slider/slider.js +8 -0
- package/dist/components/slider/slider.styles.d.ts +6 -0
- package/dist/components/slider/slider.styles.js +9 -0
- package/dist/components/slider/slider.types.d.ts +8 -0
- package/dist/components/slider/slider.types.js +1 -0
- package/dist/components/sparkline/index.d.ts +1 -0
- package/dist/components/sparkline/index.js +1 -0
- package/dist/components/sparkline/sparkline.d.ts +11 -0
- package/dist/components/sparkline/sparkline.js +34 -0
- package/dist/components/spinner/index.d.ts +1 -0
- package/dist/components/spinner/index.js +1 -0
- package/dist/components/spinner/spinner.d.ts +4 -0
- package/dist/components/spinner/spinner.js +6 -0
- package/dist/components/stepper/index.d.ts +3 -0
- package/dist/components/stepper/index.js +2 -0
- package/dist/components/stepper/stepper-step.d.ts +15 -0
- package/dist/components/stepper/stepper-step.js +46 -0
- package/dist/components/stepper/stepper.d.ts +4 -0
- package/dist/components/stepper/stepper.js +17 -0
- package/dist/components/stepper/stepper.styles.d.ts +10 -0
- package/dist/components/stepper/stepper.styles.js +37 -0
- package/dist/components/stepper/stepper.types.d.ts +50 -0
- package/dist/components/stepper/stepper.types.js +1 -0
- package/dist/components/stepper/use-stepper.d.ts +6 -0
- package/dist/components/stepper/use-stepper.js +40 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/switch/switch.d.ts +2 -0
- package/dist/components/switch/switch.js +7 -0
- package/dist/components/switch/switch.styles.d.ts +3 -0
- package/dist/components/switch/switch.styles.js +6 -0
- package/dist/components/switch/switch.types.d.ts +6 -0
- package/dist/components/switch/switch.types.js +1 -0
- package/dist/components/table/index.d.ts +11 -0
- package/dist/components/table/index.js +11 -0
- package/dist/components/table/table-sort-glyph.d.ts +3 -0
- package/dist/components/table/table-sort-glyph.js +5 -0
- package/dist/components/table/table.d.ts +33 -0
- package/dist/components/table/table.js +31 -0
- package/dist/components/table/table.styles.d.ts +8 -0
- package/dist/components/table/table.styles.js +19 -0
- package/dist/components/tabs/index.d.ts +7 -0
- package/dist/components/tabs/index.js +7 -0
- package/dist/components/tabs/tabs.d.ts +20 -0
- package/dist/components/tabs/tabs.js +29 -0
- package/dist/components/tabs/tabs.styles.d.ts +5 -0
- package/dist/components/tabs/tabs.styles.js +30 -0
- package/dist/components/tag-field/index.d.ts +2 -0
- package/dist/components/tag-field/index.js +1 -0
- package/dist/components/tag-field/tag-field-icons.d.ts +2 -0
- package/dist/components/tag-field/tag-field-icons.js +7 -0
- package/dist/components/tag-field/tag-field-tags.d.ts +7 -0
- package/dist/components/tag-field/tag-field-tags.js +19 -0
- package/dist/components/tag-field/tag-field.d.ts +6 -0
- package/dist/components/tag-field/tag-field.js +46 -0
- package/dist/components/tag-field/tag-field.styles.d.ts +14 -0
- package/dist/components/tag-field/tag-field.styles.js +42 -0
- package/dist/components/tag-field/tag-field.types.d.ts +32 -0
- package/dist/components/tag-field/tag-field.types.js +1 -0
- package/dist/components/text-area/index.d.ts +2 -0
- package/dist/components/text-area/index.js +1 -0
- package/dist/components/text-area/text-area.d.ts +2 -0
- package/dist/components/text-area/text-area.js +9 -0
- package/dist/components/text-area/text-area.styles.d.ts +6 -0
- package/dist/components/text-area/text-area.styles.js +5 -0
- package/dist/components/text-area/text-area.types.d.ts +16 -0
- package/dist/components/text-area/text-area.types.js +1 -0
- package/dist/components/text-field/index.d.ts +2 -0
- package/dist/components/text-field/index.js +1 -0
- package/dist/components/text-field/text-field.d.ts +2 -0
- package/dist/components/text-field/text-field.js +8 -0
- package/dist/components/text-field/text-field.styles.d.ts +1 -0
- package/dist/components/text-field/text-field.styles.js +1 -0
- package/dist/components/text-field/text-field.types.d.ts +15 -0
- package/dist/components/text-field/text-field.types.js +1 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/index.js +1 -0
- package/dist/components/toast/toast-glyph.d.ts +4 -0
- package/dist/components/toast/toast-glyph.js +23 -0
- package/dist/components/toast/toast-item.d.ts +14 -0
- package/dist/components/toast/toast-item.js +21 -0
- package/dist/components/toast/toast.d.ts +16 -0
- package/dist/components/toast/toast.js +50 -0
- package/dist/components/toast/toast.styles.d.ts +13 -0
- package/dist/components/toast/toast.styles.js +50 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/tooltip/tooltip.d.ts +3 -0
- package/dist/components/tooltip/tooltip.js +10 -0
- package/dist/components/tooltip/tooltip.styles.d.ts +1 -0
- package/dist/components/tooltip/tooltip.styles.js +6 -0
- package/dist/components/tooltip/tooltip.types.d.ts +18 -0
- package/dist/components/tooltip/tooltip.types.js +1 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +51 -0
- package/dist/providers/material-provider.d.ts +12 -0
- package/dist/providers/material-provider.js +30 -0
- package/dist/providers/motion-provider.d.ts +20 -0
- package/dist/providers/motion-provider.js +45 -0
- package/dist/providers/radius-provider.d.ts +13 -0
- package/dist/providers/radius-provider.js +73 -0
- package/dist/providers/theme-provider.d.ts +25 -0
- package/dist/providers/theme-provider.js +66 -0
- package/dist/styles/field.d.ts +24 -0
- package/dist/styles/field.js +36 -0
- package/dist/styles/overlays.d.ts +3 -0
- package/dist/styles/overlays.js +4 -0
- package/dist/utils/cn.d.ts +1 -0
- package/dist/utils/cn.js +3 -0
- package/package.json +468 -4
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn";
|
|
2
|
+
export function colorPickerClassName(className) {
|
|
3
|
+
return cn("flex w-full max-w-sm flex-col gap-1.5 text-sm text-foreground", className);
|
|
4
|
+
}
|
|
5
|
+
export const colorPickerTriggerClass = cn("inline-flex min-h-11 w-full items-center gap-3", "rounded-[var(--kp-radius-md)] border bg-surface px-3 text-sm", "shadow-[var(--kp-shadow-surface)] outline-none", "transition-[transform,background-color,border-color]", "duration-[var(--kp-motion-duration)] ease-[cubic-bezier(0.2,0,0,1)]", "data-[pressed]:scale-[0.96] data-[disabled]:opacity-45", "data-[focus-visible]:ring-2 data-[focus-visible]:ring-ring");
|
|
6
|
+
export const colorPickerSwatchPreviewClass = cn("size-8 shrink-0 rounded-[var(--kp-radius-sm)] border", "border-[color-mix(in_oklch,var(--kp-foreground)_18%,transparent)]", "shadow-[inset_0_1px_0_oklch(1_0_0/35%)]");
|
|
7
|
+
export const colorPickerPopoverClass = cn("overflow-auto rounded-[var(--kp-radius-panel)] border bg-surface-raised p-3", "shadow-[var(--kp-shadow-surface)] outline-none");
|
|
8
|
+
export const colorPickerPanelClass = "flex w-[16.5rem] flex-col gap-3 outline-none";
|
|
9
|
+
export const colorAreaClass = cn("h-36 w-full rounded-[var(--kp-radius-md)]", "shadow-[inset_0_0_0_1px_color-mix(in_oklch,var(--kp-foreground)_12%,transparent)]", "forced-color-adjust-none");
|
|
10
|
+
export const colorThumbClass = cn("size-5 rounded-full border-2 border-white", "shadow-[0_1px_2px_oklch(0_0_0/35%)] outline-none", "transition-[transform]", "duration-[var(--kp-motion-duration)] ease-[cubic-bezier(0.2,0,0,1)]", "data-[focus-visible]:ring-2 data-[focus-visible]:ring-ring", "data-[dragging]:scale-[0.96]");
|
|
11
|
+
export const colorSliderClass = "flex flex-col gap-1.5";
|
|
12
|
+
export const colorSliderTrackClass = cn("relative h-10 w-full rounded-full", "bg-[var(--react-aria-color-slider-track-background)]", "forced-color-adjust-none");
|
|
13
|
+
export const colorFieldClass = "flex flex-col gap-1.5";
|
|
14
|
+
export const colorFieldInputClass = cn("min-h-10 w-full rounded-[var(--kp-radius-md)] border bg-surface px-3", "font-mono text-sm tabular-nums outline-none", "transition-[border-color,box-shadow]", "duration-[var(--kp-motion-duration)] ease-[cubic-bezier(0.2,0,0,1)]", "focus-visible:ring-2 focus-visible:ring-ring/30");
|
|
15
|
+
export const colorSwatchPickerClass = "flex flex-wrap gap-2";
|
|
16
|
+
export const colorSwatchItemClass = cn("inline-flex min-h-10 min-w-10 items-center justify-center rounded-[var(--kp-radius-sm)]", "outline-none transition-[transform,box-shadow]", "duration-[var(--kp-motion-duration)] ease-[cubic-bezier(0.2,0,0,1)]", "data-[selected]:ring-2 data-[selected]:ring-ring", "data-[focus-visible]:ring-2 data-[focus-visible]:ring-ring", "data-[pressed]:scale-[0.96]");
|
|
17
|
+
export const colorSwatchClass = cn("size-8 rounded-[var(--kp-radius-sm)] border", "border-[color-mix(in_oklch,var(--kp-foreground)_16%,transparent)]");
|
|
18
|
+
export const colorOklchReadoutClass = "font-mono text-xs tabular-nums text-muted-foreground";
|
|
19
|
+
export const defaultColorPresets = [
|
|
20
|
+
"#1a6b4a",
|
|
21
|
+
"#0f766e",
|
|
22
|
+
"#334155",
|
|
23
|
+
"#b45309",
|
|
24
|
+
"#9a3412",
|
|
25
|
+
"#e7e5e4",
|
|
26
|
+
"#0c0a09",
|
|
27
|
+
"#f8fafc",
|
|
28
|
+
];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type ColorPickerVariant = "popover" | "inline";
|
|
3
|
+
export type ColorPickerProps = {
|
|
4
|
+
/** Accessible label for the picker. */
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
errorMessage?: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Popover trigger or always-visible panel. Defaults to "popover". */
|
|
10
|
+
variant?: ColorPickerVariant;
|
|
11
|
+
/** Controlled hex value (e.g. "#1a6b4a"). */
|
|
12
|
+
value?: string;
|
|
13
|
+
/** Uncontrolled initial hex value. Defaults to "#1a6b4a". */
|
|
14
|
+
defaultValue?: string;
|
|
15
|
+
/** Called with a normalized hex string when the color changes. */
|
|
16
|
+
onChange?: (hex: string) => void;
|
|
17
|
+
/** Swatch preset hex colors. */
|
|
18
|
+
presets?: string[];
|
|
19
|
+
/** Show the alpha channel slider. Defaults to true. */
|
|
20
|
+
showAlpha?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Show a read-only OKLCH readout beside hex.
|
|
23
|
+
* React Aria color spaces are rgb/hsl/hsb; OKLCH is display-only.
|
|
24
|
+
*/
|
|
25
|
+
showOklch?: boolean;
|
|
26
|
+
isDisabled?: boolean;
|
|
27
|
+
isRequired?: boolean;
|
|
28
|
+
/** Hidden input name for HTML form submission of the hex value. */
|
|
29
|
+
name?: string;
|
|
30
|
+
};
|
|
31
|
+
export type ColorPickerPanelProps = {
|
|
32
|
+
showAlpha: boolean;
|
|
33
|
+
showOklch: boolean;
|
|
34
|
+
presets: string[];
|
|
35
|
+
isDisabled?: boolean | undefined;
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type ComboBoxProps } from "react-aria-components";
|
|
3
|
+
type ComboboxProps = Omit<ComboBoxProps<object>, "children" | "className"> & {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string | undefined;
|
|
6
|
+
label?: ReactNode;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function Combobox({ children, className, label, placeholder, ...props }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function ComboboxItem({ children, id, textValue, }: {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
id: string;
|
|
13
|
+
textValue?: string;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button, ComboBox as AriaComboBox, Input, Label, ListBox, ListBoxItem, Popover, } from "react-aria-components";
|
|
4
|
+
import { fieldTriggerClass, menuItemClass, popoverSurfaceClass, } from "../../styles/overlays";
|
|
5
|
+
import { cn } from "../../utils/cn";
|
|
6
|
+
export function Combobox({ children, className, label, placeholder = "Search…", ...props }) {
|
|
7
|
+
return (_jsxs(AriaComboBox, { ...props, className: cn("flex w-full max-w-sm flex-col gap-1.5 text-sm", className), children: [label ? _jsx(Label, { className: "font-medium", children: label }) : null, _jsxs("div", { className: fieldTriggerClass, "data-kp-surface": true, children: [_jsx(Input, { placeholder: placeholder, className: "min-w-0 flex-1 bg-transparent outline-none placeholder:text-muted-foreground" }), _jsx(Button, { className: "min-h-10 min-w-10 text-muted-foreground outline-none data-[pressed]:scale-[0.96]", children: "\u25BE" })] }), _jsx(Popover, { className: cn(popoverSurfaceClass, "min-w-[var(--trigger-width)]"), "data-kp-surface": true, children: _jsx(ListBox, { className: "outline-none", children: children }) })] }));
|
|
8
|
+
}
|
|
9
|
+
export function ComboboxItem({ children, id, textValue, }) {
|
|
10
|
+
return (_jsx(ListBoxItem, { id: id, className: menuItemClass, ...(textValue !== undefined ? { textValue } : {}), children: children }));
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Combobox, ComboboxItem } from "./combobox";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Combobox, ComboboxItem } from "./combobox";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CommandPaletteGroupProps, CommandPaletteItemProps, CommandPaletteRecentProps } from "./command-palette.types";
|
|
2
|
+
export declare function CommandPaletteGroup({ children, className, heading, id, }: CommandPaletteGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function CommandPaletteRecent({ children, className, heading, }: CommandPaletteRecentProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function CommandPaletteItem({ children, className, icon, id, isDisabled, onAction, shortcut, textValue, }: CommandPaletteItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Header, Keyboard, MenuItem as AriaMenuItem, MenuSection, Text, } from "react-aria-components";
|
|
4
|
+
import { commandGroupClass, commandGroupHeadingClass, commandItemClass, commandItemIconClass, commandItemLabelClass, commandShortcutClass, } from "./command-palette.styles";
|
|
5
|
+
export function CommandPaletteGroup({ children, className, heading, id, }) {
|
|
6
|
+
return (_jsxs(MenuSection, { className: commandGroupClass(className), ...(id !== undefined ? { id } : {}), children: [_jsx(Header, { className: commandGroupHeadingClass, children: heading }), children] }));
|
|
7
|
+
}
|
|
8
|
+
export function CommandPaletteRecent({ children, className, heading = "Recent", }) {
|
|
9
|
+
return (_jsx(CommandPaletteGroup, { heading: heading, id: "kp-command-recent", ...(className !== undefined ? { className } : {}), children: children }));
|
|
10
|
+
}
|
|
11
|
+
export function CommandPaletteItem({ children, className, icon, id, isDisabled, onAction, shortcut, textValue, }) {
|
|
12
|
+
const resolvedText = textValue ?? (typeof children === "string" ? children : undefined);
|
|
13
|
+
return (_jsxs(AriaMenuItem, { id: id, className: commandItemClass(className), ...(resolvedText !== undefined ? { textValue: resolvedText } : {}), ...(isDisabled !== undefined ? { isDisabled } : {}), ...(onAction !== undefined ? { onAction } : {}), children: [_jsxs("span", { className: commandItemLabelClass, children: [icon ? _jsx("span", { className: commandItemIconClass, children: icon }) : null, _jsx(Text, { slot: "label", children: children })] }), shortcut ? (_jsx(Keyboard, { className: commandShortcutClass, children: shortcut })) : null] }));
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { CommandPaletteGroup, CommandPaletteItem, CommandPaletteRecent } from "./command-palette-items";
|
|
3
|
+
import type { CommandPaletteInputProps, CommandPaletteListProps, CommandPaletteProps, CommandPaletteTriggerProps } from "./command-palette.types";
|
|
4
|
+
export { CommandPaletteGroup, CommandPaletteItem, CommandPaletteRecent, };
|
|
5
|
+
export declare function CommandPaletteTrigger(props: CommandPaletteTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function CommandPalette({ children, className, "aria-label": ariaLabel, }: CommandPaletteProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function CommandPaletteInput({ "aria-label": ariaLabel, autoFocus, className, placeholder, }: CommandPaletteInputProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function CommandPaletteList({ "aria-label": ariaLabel, children, className, emptyLabel, isLoading, }: CommandPaletteListProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
/** Presentational empty slot for custom empty UI outside Menu filtering. */
|
|
10
|
+
export declare function CommandPaletteEmpty({ children }: {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function CommandPaletteLoading({ children }: {
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UseCommandPaletteHotkeyOptions } from "./command-palette.types";
|
|
2
|
+
/**
|
|
3
|
+
* Optional global ⌘K / Ctrl+K listener for opening a command palette.
|
|
4
|
+
* Platform-aware (meta on Apple, ctrl elsewhere). Skips composing IME events.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useCommandPaletteHotkey({ onOpenChange, isEnabled, key, enableOnFormTags, }: UseCommandPaletteHotkeyOptions): void;
|
|
7
|
+
/** Display string for the platform hotkey (⌘K or Ctrl+K). */
|
|
8
|
+
export declare function commandPaletteHotkeyLabel(key?: string): string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
function isApplePlatform() {
|
|
4
|
+
if (typeof navigator === "undefined")
|
|
5
|
+
return false;
|
|
6
|
+
const platform = navigator.platform || "";
|
|
7
|
+
const ua = navigator.userAgent || "";
|
|
8
|
+
return /Mac|iPhone|iPad|iPod/i.test(platform) || /Mac OS|iPhone|iPad|iPod/i.test(ua);
|
|
9
|
+
}
|
|
10
|
+
function isEditableTarget(target) {
|
|
11
|
+
if (!(target instanceof HTMLElement))
|
|
12
|
+
return false;
|
|
13
|
+
if (target.isContentEditable)
|
|
14
|
+
return true;
|
|
15
|
+
const tag = target.tagName;
|
|
16
|
+
if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT")
|
|
17
|
+
return true;
|
|
18
|
+
return target.getAttribute("role") === "textbox";
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Optional global ⌘K / Ctrl+K listener for opening a command palette.
|
|
22
|
+
* Platform-aware (meta on Apple, ctrl elsewhere). Skips composing IME events.
|
|
23
|
+
*/
|
|
24
|
+
export function useCommandPaletteHotkey({ onOpenChange, isEnabled = true, key = "k", enableOnFormTags = true, }) {
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!isEnabled)
|
|
27
|
+
return;
|
|
28
|
+
const apple = isApplePlatform();
|
|
29
|
+
const letter = key.toLowerCase();
|
|
30
|
+
function onKeyDown(event) {
|
|
31
|
+
if (event.defaultPrevented || event.repeat || event.isComposing)
|
|
32
|
+
return;
|
|
33
|
+
if (event.key.toLowerCase() !== letter)
|
|
34
|
+
return;
|
|
35
|
+
const modifier = apple ? event.metaKey : event.ctrlKey;
|
|
36
|
+
if (!modifier || event.altKey)
|
|
37
|
+
return;
|
|
38
|
+
if (!enableOnFormTags && isEditableTarget(event.target))
|
|
39
|
+
return;
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
onOpenChange(true);
|
|
42
|
+
}
|
|
43
|
+
document.addEventListener("keydown", onKeyDown);
|
|
44
|
+
return () => document.removeEventListener("keydown", onKeyDown);
|
|
45
|
+
}, [enableOnFormTags, isEnabled, key, onOpenChange]);
|
|
46
|
+
}
|
|
47
|
+
/** Display string for the platform hotkey (⌘K or Ctrl+K). */
|
|
48
|
+
export function commandPaletteHotkeyLabel(key = "k") {
|
|
49
|
+
const letter = key.toUpperCase();
|
|
50
|
+
return isApplePlatform() ? `⌘${letter}` : `Ctrl+${letter}`;
|
|
51
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Autocomplete, Dialog as AriaDialog, DialogTrigger as AriaDialogTrigger, Input, Menu, Modal, ModalOverlay, SearchField, useFilter, } from "react-aria-components";
|
|
4
|
+
import { Spinner } from "../spinner";
|
|
5
|
+
import { CommandPaletteGroup, CommandPaletteItem, CommandPaletteRecent, } from "./command-palette-items";
|
|
6
|
+
import { commandEmptyClass, commandInputClass, commandInputWrapClass, commandListClass, commandLoadingClass, commandOverlayClass, commandPanelClass, } from "./command-palette.styles";
|
|
7
|
+
export { CommandPaletteGroup, CommandPaletteItem, CommandPaletteRecent, };
|
|
8
|
+
export function CommandPaletteTrigger(props) {
|
|
9
|
+
return _jsx(AriaDialogTrigger, { ...props });
|
|
10
|
+
}
|
|
11
|
+
function SearchGlyph() {
|
|
12
|
+
return (_jsxs("svg", { viewBox: "0 0 16 16", className: "size-4 shrink-0 text-muted-foreground", "aria-hidden": true, children: [_jsx("circle", { cx: "7", cy: "7", r: "4.25", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }), _jsx("path", { d: "M10.2 10.2 13.5 13.5", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })] }));
|
|
13
|
+
}
|
|
14
|
+
export function CommandPalette({ children, className, "aria-label": ariaLabel = "Command palette", }) {
|
|
15
|
+
const { contains } = useFilter({ sensitivity: "base" });
|
|
16
|
+
return (_jsx(ModalOverlay, { className: commandOverlayClass, isDismissable: true, children: _jsx(Modal, { className: "outline-none", "aria-label": ariaLabel, children: _jsx(AriaDialog, { "aria-label": ariaLabel, className: commandPanelClass(className), "data-kp-surface": true, "data-kp-control": "command-palette", children: _jsx(Autocomplete, { filter: contains, children: children }) }) }) }));
|
|
17
|
+
}
|
|
18
|
+
export function CommandPaletteInput({ "aria-label": ariaLabel = "Search commands", autoFocus = true, className, placeholder = "Type a command…", }) {
|
|
19
|
+
return (_jsxs(SearchField, { "aria-label": ariaLabel, autoFocus: autoFocus, className: commandInputWrapClass(className), children: [_jsx(SearchGlyph, {}), _jsx(Input, { placeholder: placeholder, className: commandInputClass })] }));
|
|
20
|
+
}
|
|
21
|
+
export function CommandPaletteList({ "aria-label": ariaLabel = "Commands", children, className, emptyLabel = "No commands found.", isLoading = false, }) {
|
|
22
|
+
if (isLoading) {
|
|
23
|
+
return (_jsxs("div", { className: commandLoadingClass, role: "status", "aria-live": "polite", children: [_jsx(Spinner, {}), _jsx("span", { children: "Loading commands\u2026" })] }));
|
|
24
|
+
}
|
|
25
|
+
return (_jsx(Menu, { "aria-label": ariaLabel, className: commandListClass(className), renderEmptyState: () => (_jsx("div", { className: commandEmptyClass, role: "status", children: emptyLabel })), children: children }));
|
|
26
|
+
}
|
|
27
|
+
/** Presentational empty slot for custom empty UI outside Menu filtering. */
|
|
28
|
+
export function CommandPaletteEmpty({ children }) {
|
|
29
|
+
return _jsx("div", { className: commandEmptyClass, children: children });
|
|
30
|
+
}
|
|
31
|
+
export function CommandPaletteLoading({ children }) {
|
|
32
|
+
return (_jsxs("div", { className: commandLoadingClass, role: "status", "aria-live": "polite", children: [_jsx(Spinner, {}), _jsx("span", { children: children ?? "Loading commands…" })] }));
|
|
33
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const commandOverlayClass: string;
|
|
2
|
+
export declare function commandPanelClass(className?: string | undefined): string;
|
|
3
|
+
export declare function commandInputWrapClass(className?: string | undefined): string;
|
|
4
|
+
export declare const commandInputClass: string;
|
|
5
|
+
export declare function commandListClass(className?: string | undefined): string;
|
|
6
|
+
export declare function commandGroupClass(className?: string | undefined): string;
|
|
7
|
+
export declare const commandGroupHeadingClass: string;
|
|
8
|
+
export declare function commandItemClass(className?: string | undefined): string;
|
|
9
|
+
export declare const commandItemLabelClass = "inline-flex min-w-0 items-center gap-2 text-pretty";
|
|
10
|
+
export declare const commandItemIconClass = "inline-flex size-4 shrink-0 items-center justify-center text-muted-foreground";
|
|
11
|
+
export declare const commandShortcutClass: string;
|
|
12
|
+
export declare const commandEmptyClass = "px-3 py-8 text-center text-sm text-muted-foreground text-pretty";
|
|
13
|
+
export declare const commandLoadingClass = "flex items-center justify-center gap-2 px-3 py-8 text-sm text-muted-foreground";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn";
|
|
2
|
+
import { menuItemClass } from "../../styles/overlays";
|
|
3
|
+
export const commandOverlayClass = cn("fixed inset-0 z-50 flex items-start justify-center", "bg-[color-mix(in_oklch,var(--kp-foreground)_28%,transparent)]", "px-4 pt-[min(20vh,8rem)]", "transition-[opacity] duration-[var(--kp-motion-duration)]", "ease-[cubic-bezier(0.2,0,0,1)]", "entering:opacity-100 exiting:opacity-0", "data-[entering]:opacity-100 data-[exiting]:opacity-0");
|
|
4
|
+
export function commandPanelClass(className) {
|
|
5
|
+
return cn("flex w-full max-w-lg flex-col overflow-hidden", "rounded-[var(--kp-radius-panel)] border bg-surface-raised", "shadow-[var(--kp-shadow-surface)] outline-none", "transition-[opacity,transform] duration-[var(--kp-motion-duration)]", "ease-[cubic-bezier(0.2,0,0,1)]", "data-[entering]:opacity-100 data-[entering]:translate-y-0", "data-[exiting]:opacity-0 data-[exiting]:-translate-y-1", "motion-reduce:transition-none motion-reduce:transform-none", className);
|
|
6
|
+
}
|
|
7
|
+
export function commandInputWrapClass(className) {
|
|
8
|
+
return cn("flex min-h-11 items-center gap-2 border-b px-3", "border-[color-mix(in_oklch,var(--kp-foreground)_12%,transparent)]", className);
|
|
9
|
+
}
|
|
10
|
+
export const commandInputClass = cn("min-w-0 flex-1 bg-transparent py-2.5 text-sm outline-none", "placeholder:text-muted-foreground");
|
|
11
|
+
export function commandListClass(className) {
|
|
12
|
+
return cn("max-h-[min(50vh,22rem)] overflow-auto p-1.5 outline-none", className);
|
|
13
|
+
}
|
|
14
|
+
export function commandGroupClass(className) {
|
|
15
|
+
return cn("mt-1 first:mt-0", className);
|
|
16
|
+
}
|
|
17
|
+
export const commandGroupHeadingClass = cn("px-2.5 py-1.5 font-mono text-[10px] uppercase tracking-[0.14em]", "text-muted-foreground");
|
|
18
|
+
export function commandItemClass(className) {
|
|
19
|
+
return cn(menuItemClass, "min-h-10 justify-between gap-3", "transition-[transform,background-color] duration-[var(--kp-motion-duration)]", "ease-[cubic-bezier(0.2,0,0,1)]", "data-[pressed]:scale-[0.96]", className);
|
|
20
|
+
}
|
|
21
|
+
export const commandItemLabelClass = "inline-flex min-w-0 items-center gap-2 text-pretty";
|
|
22
|
+
export const commandItemIconClass = "inline-flex size-4 shrink-0 items-center justify-center text-muted-foreground";
|
|
23
|
+
export const commandShortcutClass = cn("ms-auto shrink-0 rounded-[var(--kp-radius-sm)] border px-1.5 py-0.5", "border-[color-mix(in_oklch,var(--kp-foreground)_14%,transparent)]", "font-mono text-[10px] tabular-nums text-muted-foreground");
|
|
24
|
+
export const commandEmptyClass = "px-3 py-8 text-center text-sm text-muted-foreground text-pretty";
|
|
25
|
+
export const commandLoadingClass = "flex items-center justify-center gap-2 px-3 py-8 text-sm text-muted-foreground";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { Key } from "react-aria-components";
|
|
3
|
+
export type CommandPaletteTriggerProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
isOpen?: boolean;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
8
|
+
};
|
|
9
|
+
export type CommandPaletteProps = {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Accessible name for the dialog. Defaults to "Command palette". */
|
|
13
|
+
"aria-label"?: string;
|
|
14
|
+
};
|
|
15
|
+
export type CommandPaletteInputProps = {
|
|
16
|
+
className?: string;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
"aria-label"?: string;
|
|
19
|
+
autoFocus?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type CommandPaletteListProps = {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
className?: string;
|
|
24
|
+
/** Shown while async results load. */
|
|
25
|
+
isLoading?: boolean;
|
|
26
|
+
/** Empty copy when the filter matches nothing. */
|
|
27
|
+
emptyLabel?: ReactNode;
|
|
28
|
+
/** Accessible name for the command list. */
|
|
29
|
+
"aria-label"?: string;
|
|
30
|
+
};
|
|
31
|
+
export type CommandPaletteGroupProps = {
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
heading: ReactNode;
|
|
34
|
+
className?: string;
|
|
35
|
+
id?: Key;
|
|
36
|
+
};
|
|
37
|
+
export type CommandPaletteItemProps = {
|
|
38
|
+
children: ReactNode;
|
|
39
|
+
id: string;
|
|
40
|
+
textValue?: string;
|
|
41
|
+
icon?: ReactNode;
|
|
42
|
+
shortcut?: ReactNode;
|
|
43
|
+
isDisabled?: boolean;
|
|
44
|
+
onAction?: () => void;
|
|
45
|
+
className?: string;
|
|
46
|
+
};
|
|
47
|
+
export type CommandPaletteRecentProps = {
|
|
48
|
+
children: ReactNode;
|
|
49
|
+
heading?: ReactNode;
|
|
50
|
+
className?: string;
|
|
51
|
+
};
|
|
52
|
+
export type UseCommandPaletteHotkeyOptions = {
|
|
53
|
+
/** Called with `true` when the hotkey fires. */
|
|
54
|
+
onOpenChange: (isOpen: boolean) => void;
|
|
55
|
+
/** Defaults to `true`. */
|
|
56
|
+
isEnabled?: boolean;
|
|
57
|
+
/** Letter key, defaults to `"k"`. */
|
|
58
|
+
key?: string;
|
|
59
|
+
/**
|
|
60
|
+
* When `false`, the hotkey is ignored while focus is in an input,
|
|
61
|
+
* textarea, select, or contenteditable. Defaults to `true` so ⌘/Ctrl+K
|
|
62
|
+
* still opens from form fields (common command-palette UX).
|
|
63
|
+
*/
|
|
64
|
+
enableOnFormTags?: boolean;
|
|
65
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CommandPalette, CommandPaletteEmpty, CommandPaletteGroup, CommandPaletteInput, CommandPaletteItem, CommandPaletteList, CommandPaletteLoading, CommandPaletteRecent, CommandPaletteTrigger } from "./command-palette";
|
|
2
|
+
export declare const CommandPaletteRoot: typeof CommandPaletteTrigger & {
|
|
3
|
+
Content: typeof CommandPalette;
|
|
4
|
+
Input: typeof CommandPaletteInput;
|
|
5
|
+
List: typeof CommandPaletteList;
|
|
6
|
+
Group: typeof CommandPaletteGroup;
|
|
7
|
+
Item: typeof CommandPaletteItem;
|
|
8
|
+
Recent: typeof CommandPaletteRecent;
|
|
9
|
+
Empty: typeof CommandPaletteEmpty;
|
|
10
|
+
Loading: typeof CommandPaletteLoading;
|
|
11
|
+
};
|
|
12
|
+
export { CommandPalette, CommandPaletteEmpty, CommandPaletteGroup, CommandPaletteInput, CommandPaletteItem, CommandPaletteList, CommandPaletteLoading, CommandPaletteRecent, CommandPaletteTrigger, };
|
|
13
|
+
export { commandPaletteHotkeyLabel, useCommandPaletteHotkey, } from "./command-palette.hotkey";
|
|
14
|
+
export type { CommandPaletteGroupProps, CommandPaletteInputProps, CommandPaletteItemProps, CommandPaletteListProps, CommandPaletteProps, CommandPaletteRecentProps, CommandPaletteTriggerProps, UseCommandPaletteHotkeyOptions, } from "./command-palette.types";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CommandPalette, CommandPaletteEmpty, CommandPaletteGroup, CommandPaletteInput, CommandPaletteItem, CommandPaletteList, CommandPaletteLoading, CommandPaletteRecent, CommandPaletteTrigger, } from "./command-palette";
|
|
2
|
+
export const CommandPaletteRoot = Object.assign(CommandPaletteTrigger, {
|
|
3
|
+
Content: CommandPalette,
|
|
4
|
+
Input: CommandPaletteInput,
|
|
5
|
+
List: CommandPaletteList,
|
|
6
|
+
Group: CommandPaletteGroup,
|
|
7
|
+
Item: CommandPaletteItem,
|
|
8
|
+
Recent: CommandPaletteRecent,
|
|
9
|
+
Empty: CommandPaletteEmpty,
|
|
10
|
+
Loading: CommandPaletteLoading,
|
|
11
|
+
});
|
|
12
|
+
export { CommandPalette, CommandPaletteEmpty, CommandPaletteGroup, CommandPaletteInput, CommandPaletteItem, CommandPaletteList, CommandPaletteLoading, CommandPaletteRecent, CommandPaletteTrigger, };
|
|
13
|
+
export { commandPaletteHotkeyLabel, useCommandPaletteHotkey, } from "./command-palette.hotkey";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ColumnDef } from "@tanstack/react-table";
|
|
2
|
+
export declare function DataTable<T extends object>({ "aria-label": ariaLabel, columns, data, getRowId, }: {
|
|
3
|
+
"aria-label": string;
|
|
4
|
+
columns: ColumnDef<T, unknown>[];
|
|
5
|
+
data: T[];
|
|
6
|
+
getRowId?: (row: T, index: number) => string;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { flexRender, getCoreRowModel, getSortedRowModel, useReactTable, } from "@tanstack/react-table";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { Table, TableBody, TableCell, TableColumn, TableHeader, TableRow, } from "../table";
|
|
6
|
+
export function DataTable({ "aria-label": ariaLabel, columns, data, getRowId, }) {
|
|
7
|
+
const [sorting, setSorting] = useState([]);
|
|
8
|
+
const table = useReactTable({
|
|
9
|
+
data,
|
|
10
|
+
columns,
|
|
11
|
+
state: { sorting },
|
|
12
|
+
onSortingChange: setSorting,
|
|
13
|
+
getCoreRowModel: getCoreRowModel(),
|
|
14
|
+
getSortedRowModel: getSortedRowModel(),
|
|
15
|
+
...(getRowId ? { getRowId } : {}),
|
|
16
|
+
});
|
|
17
|
+
const active = sorting[0];
|
|
18
|
+
return (_jsxs(Table, { "aria-label": ariaLabel, ...(active
|
|
19
|
+
? {
|
|
20
|
+
sortDescriptor: {
|
|
21
|
+
column: active.id,
|
|
22
|
+
direction: active.desc ? "descending" : "ascending",
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
: {}), onSortChange: (descriptor) => setSorting([
|
|
26
|
+
{
|
|
27
|
+
id: String(descriptor.column),
|
|
28
|
+
desc: descriptor.direction === "descending",
|
|
29
|
+
},
|
|
30
|
+
]), children: [_jsx(TableHeader, { children: table.getHeaderGroups()[0]?.headers.map((header) => (_jsx(TableColumn, { id: header.id, isRowHeader: header.index === 0, allowsSorting: header.column.getCanSort(), children: flexRender(header.column.columnDef.header, header.getContext()) }, header.id))) }), _jsx(TableBody, { children: table.getRowModel().rows.map((row) => (_jsx(TableRow, { id: row.id, children: row.getVisibleCells().map((cell) => (_jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id))) })] }));
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DataTable } from "./data-table";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DataTable } from "./data-table";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button, Calendar, CalendarCell, CalendarGrid, CalendarGridBody, CalendarGridHeader, CalendarHeaderCell, DateInput, DatePicker as AriaDatePicker, DateSegment, Dialog, Group, Heading, Label, Popover, } from "react-aria-components";
|
|
4
|
+
import { fieldTriggerClass, popoverSurfaceClass } from "../../styles/overlays";
|
|
5
|
+
import { cn } from "../../utils/cn";
|
|
6
|
+
export function DatePicker({ className, label = "Date", ...props }) {
|
|
7
|
+
return (_jsxs(AriaDatePicker, { ...props, className: cn("flex w-full max-w-sm flex-col gap-1.5 text-sm", className), children: [_jsx(Label, { className: "font-medium", children: label }), _jsxs(Group, { className: fieldTriggerClass, "data-kp-surface": true, children: [_jsx(DateInput, { className: "flex flex-1 gap-0.5 tabular-nums outline-none", children: (segment) => (_jsx(DateSegment, { segment: segment, className: "rounded px-0.5 outline-none data-[placeholder]:text-muted-foreground data-[focused]:bg-muted" })) }), _jsx(Button, { className: "min-h-10 min-w-10 rounded-[var(--kp-radius-sm)] text-muted-foreground outline-none data-[pressed]:scale-[0.96] data-[focus-visible]:ring-2 data-[focus-visible]:ring-ring", children: "\u25A2" })] }), _jsx(Popover, { className: cn(popoverSurfaceClass, "p-3"), "data-kp-surface": true, children: _jsx(Dialog, { className: "outline-none", children: _jsxs(Calendar, { className: "text-sm", children: [_jsxs("header", { className: "mb-3 flex items-center justify-between gap-2", children: [_jsx(Button, { slot: "previous", className: "min-h-10 min-w-10 rounded-[var(--kp-radius-sm)] outline-none data-[pressed]:scale-[0.96] data-[focus-visible]:ring-2 data-[focus-visible]:ring-ring", children: "\u2039" }), _jsx(Heading, { className: "text-sm font-semibold" }), _jsx(Button, { slot: "next", className: "min-h-10 min-w-10 rounded-[var(--kp-radius-sm)] outline-none data-[pressed]:scale-[0.96] data-[focus-visible]:ring-2 data-[focus-visible]:ring-ring", children: "\u203A" })] }), _jsxs(CalendarGrid, { className: "w-full border-separate border-spacing-1", children: [_jsx(CalendarGridHeader, { children: (day) => (_jsx(CalendarHeaderCell, { className: "size-9 text-xs font-medium text-muted-foreground", children: day })) }), _jsx(CalendarGridBody, { children: (date) => (_jsx(CalendarCell, { date: date, className: "size-9 rounded-[var(--kp-radius-sm)] text-center outline-none tabular-nums data-[hovered]:bg-muted data-[selected]:bg-accent data-[selected]:text-accent-foreground data-[disabled]:opacity-35 data-[focus-visible]:ring-2 data-[focus-visible]:ring-ring" })) })] })] }) }) })] }));
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DatePicker } from "./date-picker";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DatePicker } from "./date-picker";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DateRangePreset, DateRangePresetId } from "./date-range-picker.types";
|
|
2
|
+
export declare function DateRangePickerPopoverBody({ showPresets, presets, }: {
|
|
3
|
+
showPresets: boolean;
|
|
4
|
+
presets: DateRangePresetId[] | DateRangePreset[] | undefined;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button, CalendarCell, CalendarGrid, CalendarGridBody, CalendarGridHeader, CalendarHeaderCell, DateRangePickerStateContext, Heading, RangeCalendar, } from "react-aria-components";
|
|
4
|
+
import { useContext } from "react";
|
|
5
|
+
import { resolvePresets } from "./date-range-picker.presets";
|
|
6
|
+
import { dateRangeCellClass, dateRangeDialogClass, dateRangeNavButtonClass, dateRangePresetButtonClass, dateRangePresetsClass, } from "./date-range-picker.styles";
|
|
7
|
+
function PresetList({ presets, }) {
|
|
8
|
+
const state = useContext(DateRangePickerStateContext);
|
|
9
|
+
const items = resolvePresets(presets);
|
|
10
|
+
if (items.length === 0) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return (_jsx("div", { className: dateRangePresetsClass, role: "list", children: items.map((preset) => (_jsx(Button, { slot: null, className: dateRangePresetButtonClass, onPress: () => {
|
|
14
|
+
const range = preset.getRange();
|
|
15
|
+
state?.setValue(range);
|
|
16
|
+
state?.close();
|
|
17
|
+
}, children: preset.label }, preset.id))) }));
|
|
18
|
+
}
|
|
19
|
+
export function DateRangePickerPopoverBody({ showPresets, presets, }) {
|
|
20
|
+
return (_jsxs("div", { className: dateRangeDialogClass, children: [showPresets ? _jsx(PresetList, { presets: presets }) : null, _jsxs(RangeCalendar, { className: "text-sm", children: [_jsxs("header", { className: "mb-3 flex items-center justify-between gap-2", children: [_jsx(Button, { slot: "previous", className: dateRangeNavButtonClass, children: "\u2039" }), _jsx(Heading, { className: "text-sm font-semibold" }), _jsx(Button, { slot: "next", className: dateRangeNavButtonClass, children: "\u203A" })] }), _jsxs(CalendarGrid, { className: "w-full border-separate border-spacing-1", children: [_jsx(CalendarGridHeader, { children: (day) => (_jsx(CalendarHeaderCell, { className: "size-9 text-xs font-medium text-muted-foreground", children: day })) }), _jsx(CalendarGridBody, { children: (date) => (_jsx(CalendarCell, { date: date, className: dateRangeCellClass })) })] })] })] }));
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button, DateInput, DateRangePicker as AriaDateRangePicker, DateSegment, Dialog, FieldError, Group, Label, Popover, Text, } from "react-aria-components";
|
|
4
|
+
import { fieldDescriptionClass, fieldErrorClass, fieldLabelClass, } from "../../styles/field";
|
|
5
|
+
import { DateRangePickerPopoverBody } from "./date-range-picker.calendar";
|
|
6
|
+
import { dateRangeGroupClass, dateRangeInputClass, dateRangePickerClassName, dateRangePopoverClass, dateRangeSegmentClass, dateRangeTriggerClass, } from "./date-range-picker.styles";
|
|
7
|
+
export function DateRangePicker({ className, description, errorMessage, label, presets, showPresets = true, ...props }) {
|
|
8
|
+
return (_jsxs(AriaDateRangePicker, { ...props, className: dateRangePickerClassName(className), children: [label ? _jsx(Label, { className: fieldLabelClass, children: label }) : null, _jsxs(Group, { className: dateRangeGroupClass, "data-kp-surface": true, children: [_jsx(DateInput, { slot: "start", className: dateRangeInputClass, children: (segment) => (_jsx(DateSegment, { segment: segment, className: dateRangeSegmentClass })) }), _jsx("span", { "aria-hidden": "true", className: "px-0.5 text-muted-foreground", children: "\u2013" }), _jsx(DateInput, { slot: "end", className: dateRangeInputClass, children: (segment) => (_jsx(DateSegment, { segment: segment, className: dateRangeSegmentClass })) }), _jsx(Button, { className: dateRangeTriggerClass, "aria-label": "Open calendar", children: "\u25A2" })] }), description ? (_jsx(Text, { slot: "description", className: fieldDescriptionClass, children: description })) : null, _jsx(FieldError, { className: fieldErrorClass, children: errorMessage }), _jsx(Popover, { className: dateRangePopoverClass, "data-kp-surface": true, children: _jsx(Dialog, { className: "outline-none", "aria-label": "Choose date range", children: _jsx(DateRangePickerPopoverBody, { showPresets: showPresets, presets: presets }) }) })] }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { endOfMonth, getLocalTimeZone, startOfMonth, today, } from "@internationalized/date";
|
|
2
|
+
const builtin = {
|
|
3
|
+
today: {
|
|
4
|
+
id: "today",
|
|
5
|
+
label: "Today",
|
|
6
|
+
getRange: () => {
|
|
7
|
+
const day = today(getLocalTimeZone());
|
|
8
|
+
return { start: day, end: day };
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
"last-7-days": {
|
|
12
|
+
id: "last-7-days",
|
|
13
|
+
label: "Last 7 days",
|
|
14
|
+
getRange: () => {
|
|
15
|
+
const end = today(getLocalTimeZone());
|
|
16
|
+
return { start: end.subtract({ days: 6 }), end };
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
"last-30-days": {
|
|
20
|
+
id: "last-30-days",
|
|
21
|
+
label: "Last 30 days",
|
|
22
|
+
getRange: () => {
|
|
23
|
+
const end = today(getLocalTimeZone());
|
|
24
|
+
return { start: end.subtract({ days: 29 }), end };
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
"this-month": {
|
|
28
|
+
id: "this-month",
|
|
29
|
+
label: "This month",
|
|
30
|
+
getRange: () => {
|
|
31
|
+
const day = today(getLocalTimeZone());
|
|
32
|
+
return { start: startOfMonth(day), end: endOfMonth(day) };
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
export const defaultPresetIds = [
|
|
37
|
+
"today",
|
|
38
|
+
"last-7-days",
|
|
39
|
+
"last-30-days",
|
|
40
|
+
"this-month",
|
|
41
|
+
];
|
|
42
|
+
export function resolvePresets(presets) {
|
|
43
|
+
if (!presets) {
|
|
44
|
+
return defaultPresetIds.map((id) => builtin[id]);
|
|
45
|
+
}
|
|
46
|
+
if (presets.length === 0) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
if (typeof presets[0] === "string") {
|
|
50
|
+
return presets.map((id) => builtin[id]);
|
|
51
|
+
}
|
|
52
|
+
return presets;
|
|
53
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function dateRangePickerClassName(className?: string | undefined): string;
|
|
2
|
+
export declare const dateRangeGroupClass: string;
|
|
3
|
+
export declare const dateRangeInputClass = "flex flex-1 gap-0.5 tabular-nums outline-none";
|
|
4
|
+
export declare const dateRangeSegmentClass: string;
|
|
5
|
+
export declare const dateRangeTriggerClass: string;
|
|
6
|
+
export declare const dateRangePopoverClass: string;
|
|
7
|
+
export declare const dateRangeDialogClass = "flex flex-col gap-3 outline-none sm:flex-row";
|
|
8
|
+
export declare const dateRangePresetsClass: string;
|
|
9
|
+
export declare const dateRangePresetButtonClass: string;
|
|
10
|
+
export declare const dateRangeNavButtonClass: string;
|
|
11
|
+
export declare const dateRangeCellClass: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn";
|
|
2
|
+
export function dateRangePickerClassName(className) {
|
|
3
|
+
return cn("flex w-full max-w-md flex-col gap-1.5 text-sm text-foreground", className);
|
|
4
|
+
}
|
|
5
|
+
export const dateRangeGroupClass = cn("inline-flex min-h-11 w-full items-center gap-1", "rounded-[var(--kp-radius-md)] border bg-surface px-2 text-sm", "shadow-[var(--kp-shadow-surface)] outline-none", "transition-[transform,background-color,border-color]", "duration-[var(--kp-motion-duration)] ease-[cubic-bezier(0.2,0,0,1)]", "data-[disabled]:opacity-45", "data-[focus-within]:ring-2 data-[focus-within]:ring-ring");
|
|
6
|
+
export const dateRangeInputClass = "flex flex-1 gap-0.5 tabular-nums outline-none";
|
|
7
|
+
export const dateRangeSegmentClass = cn("rounded px-0.5 outline-none", "data-[placeholder]:text-muted-foreground", "data-[focused]:bg-muted");
|
|
8
|
+
export const dateRangeTriggerClass = cn("inline-flex min-h-10 min-w-10 items-center justify-center", "rounded-[var(--kp-radius-sm)] text-muted-foreground outline-none", "transition-[transform,color]", "duration-[var(--kp-motion-duration)] ease-[cubic-bezier(0.2,0,0,1)]", "data-[pressed]:scale-[0.96]", "data-[focus-visible]:ring-2 data-[focus-visible]:ring-ring");
|
|
9
|
+
export const dateRangePopoverClass = cn("overflow-auto rounded-[var(--kp-radius-panel)] border bg-surface-raised p-3", "shadow-[var(--kp-shadow-surface)] outline-none");
|
|
10
|
+
export const dateRangeDialogClass = "flex flex-col gap-3 outline-none sm:flex-row";
|
|
11
|
+
export const dateRangePresetsClass = cn("flex shrink-0 flex-row flex-wrap gap-1 sm:w-36 sm:flex-col");
|
|
12
|
+
export const dateRangePresetButtonClass = cn("inline-flex min-h-10 items-center justify-start rounded-[var(--kp-radius-sm)]", "px-3 text-left text-sm text-foreground outline-none", "transition-[transform,background-color]", "duration-[var(--kp-motion-duration)] ease-[cubic-bezier(0.2,0,0,1)]", "hover:bg-muted data-[pressed]:scale-[0.96]", "data-[focus-visible]:ring-2 data-[focus-visible]:ring-ring");
|
|
13
|
+
export const dateRangeNavButtonClass = cn("inline-flex min-h-10 min-w-10 items-center justify-center", "rounded-[var(--kp-radius-sm)] outline-none", "transition-[transform]", "duration-[var(--kp-motion-duration)] ease-[cubic-bezier(0.2,0,0,1)]", "data-[pressed]:scale-[0.96]", "data-[focus-visible]:ring-2 data-[focus-visible]:ring-ring");
|
|
14
|
+
export const dateRangeCellClass = cn("size-9 rounded-[var(--kp-radius-sm)] text-center outline-none tabular-nums", "transition-[background-color,color,transform]", "duration-[var(--kp-motion-duration)] ease-[cubic-bezier(0.2,0,0,1)]", "data-[hovered]:bg-muted", "data-[selected]:bg-[color-mix(in_oklch,var(--kp-accent)_22%,transparent)]", "data-[selected]:text-foreground", "data-[selection-start]:bg-accent data-[selection-start]:text-accent-foreground", "data-[selection-end]:bg-accent data-[selection-end]:text-accent-foreground", "data-[disabled]:opacity-35 data-[unavailable]:opacity-35", "data-[focus-visible]:ring-2 data-[focus-visible]:ring-ring", "data-[pressed]:scale-[0.96]");
|