@flikk/ui 1.0.0-beta.30 → 1.0.0-beta.31
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/CHANGELOG.md +97 -0
- package/dist/components/ai/AgentStatus/AgentStatus.d.ts +3 -0
- package/dist/components/ai/AgentStatus/AgentStatus.js +144 -0
- package/dist/components/ai/AgentStatus/AgentStatus.theme.d.ts +2 -0
- package/dist/components/ai/AgentStatus/AgentStatus.theme.js +37 -0
- package/dist/components/ai/AgentStatus/AgentStatus.types.d.ts +116 -0
- package/dist/components/ai/AgentStatus/index.d.ts +3 -0
- package/dist/components/ai/CodeBlock/CodeBlock.js +3 -3
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +1 -1
- package/dist/components/ai/PromptInput/PromptInput.js +13 -14
- package/dist/components/ai/PromptInput/PromptInput.theme.js +1 -1
- package/dist/components/ai/PromptInput/VoiceRecorder.js +3 -3
- package/dist/components/ai/Reasoning/Reasoning.d.ts +5 -0
- package/dist/components/ai/Reasoning/Reasoning.js +16 -0
- package/dist/components/ai/Reasoning/Reasoning.types.d.ts +20 -0
- package/dist/components/ai/Reasoning/index.d.ts +2 -0
- package/dist/components/ai/SourceCitation/SourceCitation.d.ts +4 -0
- package/dist/components/ai/SourceCitation/SourceCitation.js +29 -0
- package/dist/components/ai/SourceCitation/SourceCitation.theme.d.ts +2 -0
- package/dist/components/ai/SourceCitation/SourceCitation.theme.js +23 -0
- package/dist/components/ai/SourceCitation/SourceCitation.types.d.ts +55 -0
- package/dist/components/ai/SourceCitation/index.d.ts +3 -0
- package/dist/components/ai/StreamingResponse/ErrorDisplay.js +2 -2
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +1 -3
- package/dist/components/ai/StreamingResponse/StreamingResponse.theme.js +3 -1
- package/dist/components/ai/TokenCounter/TokenCounter.js +2 -2
- package/dist/components/ai/index.d.ts +3 -0
- package/dist/components/ai/index.js +6 -3
- package/dist/components/ai/shared/StatusIndicator.d.ts +8 -0
- package/dist/components/ai/shared/StatusIndicator.js +34 -0
- package/dist/components/canvas/CanvasToolbar.js +2 -2
- package/dist/components/canvas/NodeControls.js +2 -2
- package/dist/components/canvas/NodeRenderer.js +2 -2
- package/dist/components/charts/ActivityRings/ActivityRings.js +2 -2
- package/dist/components/charts/AreaChart/AreaChart.js +21 -32
- package/dist/components/charts/AreaChart/AreaChart.theme.d.ts +1 -6
- package/dist/components/charts/AreaChart/AreaChart.theme.js +7 -19
- package/dist/components/charts/AreaChart/AreaChart.types.d.ts +18 -11
- package/dist/components/charts/AreaChart/AreaChart.types.js +10 -3
- package/dist/components/charts/AreaChart/index.d.ts +1 -1
- package/dist/components/charts/BarChart/BarChart.js +9 -28
- package/dist/components/charts/BarChart/BarChart.types.d.ts +20 -16
- package/dist/components/charts/BarChart/BarChart.types.js +11 -4
- package/dist/components/charts/ComboChart/BarRenderer.js +8 -5
- package/dist/components/charts/ComboChart/ComboChart.js +11 -24
- package/dist/components/charts/ComboChart/ComboChart.types.d.ts +15 -13
- package/dist/components/charts/ComboChart/ComboChart.types.js +14 -2
- package/dist/components/charts/ComboChart/LineRenderer.js +15 -10
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.d.ts +16 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.js +237 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.types.d.ts +62 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.types.js +21 -0
- package/dist/components/charts/HorizontalBarChart/index.d.ts +3 -0
- package/dist/components/charts/LineChart/LineChart.js +9 -26
- package/dist/components/charts/LineChart/LineChart.types.d.ts +11 -14
- package/dist/components/charts/LineChart/LineChart.types.js +11 -3
- package/dist/components/charts/LollipopChart/LollipopChart.d.ts +3 -0
- package/dist/components/charts/LollipopChart/LollipopChart.js +361 -0
- package/dist/components/charts/LollipopChart/LollipopChart.types.d.ts +42 -0
- package/dist/components/charts/LollipopChart/LollipopChart.types.js +12 -0
- package/dist/components/charts/LollipopChart/index.d.ts +3 -0
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +5 -4
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.d.ts +14 -19
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.js +9 -2
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +150 -132
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.d.ts +20 -18
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.js +10 -4
- package/dist/components/charts/hooks/useChartAccessibility.d.ts +1 -1
- package/dist/components/charts/hooks/useChartAccessibility.js +3 -0
- package/dist/components/charts/hooks/useTooltipPosition.js +18 -6
- package/dist/components/charts/index.d.ts +6 -0
- package/dist/components/charts/index.js +6 -0
- package/dist/components/charts/shared/ChartAxis/CategoryYAxis.d.ts +14 -0
- package/dist/components/charts/shared/ChartAxis/CategoryYAxis.js +35 -0
- package/dist/components/charts/shared/ChartAxis/ChartAxis.types.d.ts +69 -8
- package/dist/components/charts/shared/ChartAxis/ValueXAxis.d.ts +14 -0
- package/dist/components/charts/shared/ChartAxis/ValueXAxis.js +64 -0
- package/dist/components/charts/shared/ChartAxis/XAxis.js +1 -1
- package/dist/components/charts/shared/ChartAxis/YAxis.js +2 -2
- package/dist/components/charts/shared/ChartAxis/index.d.ts +3 -1
- package/dist/components/charts/shared/ChartGrid/HorizontalGrid.d.ts +0 -2
- package/dist/components/charts/shared/ChartGrid/HorizontalGrid.js +1 -1
- package/dist/components/charts/shared/ChartGrid/VerticalGrid.d.ts +29 -0
- package/dist/components/charts/shared/ChartGrid/VerticalGrid.js +26 -0
- package/dist/components/charts/shared/ChartGrid/index.d.ts +2 -0
- package/dist/components/charts/shared/ChartMarker/ChartMarker.js +7 -1
- package/dist/components/charts/theme/chart.theme.js +18 -23
- package/dist/components/charts/types/chart.types.d.ts +9 -5
- package/dist/components/charts/types/chart.types.js +1 -7
- package/dist/components/charts/utils/animation-utils.js +1 -3
- package/dist/components/charts/utils/bar-emphasis.d.ts +32 -3
- package/dist/components/charts/utils/bar-emphasis.js +24 -8
- package/dist/components/charts/utils/index.d.ts +1 -0
- package/dist/components/charts/utils/series-color.d.ts +7 -0
- package/dist/components/charts/utils/series-color.js +20 -0
- package/dist/components/core/Accordion/Accordion.theme.js +2 -2
- package/dist/components/core/Accordion/AccordionTrigger.js +2 -2
- package/dist/components/core/Alert/Alert.animations.d.ts +2 -1
- package/dist/components/core/Alert/Alert.animations.js +21 -6
- package/dist/components/core/Alert/Alert.js +7 -7
- package/dist/components/core/Avatar/Avatar.js +50 -42
- package/dist/components/core/Avatar/Avatar.theme.d.ts +8 -4
- package/dist/components/core/Avatar/Avatar.theme.js +64 -8
- package/dist/components/core/Avatar/Avatar.types.d.ts +13 -2
- package/dist/components/core/Avatar/index.d.ts +1 -1
- package/dist/components/core/AvatarGroup/AvatarGroup.js +6 -8
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.d.ts +1 -2
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +2 -6
- package/dist/components/core/AvatarGroup/AvatarGroup.types.d.ts +0 -6
- package/dist/components/core/AvatarGroup/index.d.ts +1 -1
- package/dist/components/core/Badge/Badge.animations.js +4 -2
- package/dist/components/core/Badge/Badge.js +9 -4
- package/dist/components/core/Badge/Badge.theme.js +18 -12
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.d.ts +1 -4
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.js +2 -2
- package/dist/components/core/Button/Button.js +9 -17
- package/dist/components/core/Button/Button.ripple.js +2 -2
- package/dist/components/core/Button/Button.theme.d.ts +2 -0
- package/dist/components/core/Button/Button.theme.js +34 -21
- package/dist/components/core/Button/Button.types.d.ts +18 -1
- package/dist/components/core/Calendar/Calendar.js +20 -5
- package/dist/components/core/Calendar/Calendar.theme.js +14 -22
- package/dist/components/core/Calendar/Calendar.types.d.ts +0 -1
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.js +3 -3
- package/dist/components/core/Card/Card.theme.js +12 -4
- package/dist/components/core/Card/CardBody.js +1 -1
- package/dist/components/core/Card/CardFooter.js +1 -1
- package/dist/components/core/Card/CardHeader.js +1 -1
- package/dist/components/core/Carousel/CarouselNext.js +2 -2
- package/dist/components/core/Carousel/CarouselPrevious.js +2 -2
- package/dist/components/core/CommandPalette/CommandPalette.js +5 -4
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +3 -7
- package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +2 -0
- package/dist/components/core/ContextMenu/ContextMenuItem.js +2 -2
- package/dist/components/core/ContextMenu/ContextMenuSubTrigger.js +2 -2
- package/dist/components/core/Drawer/Drawer.theme.js +7 -4
- package/dist/components/core/Drawer/DrawerHeader.js +2 -2
- package/dist/components/core/Dropdown/Dropdown.theme.js +3 -1
- package/dist/components/core/Dropdown/DropdownItem.js +2 -2
- package/dist/components/core/Dropdown/DropdownTrigger.js +16 -5
- package/dist/components/core/HeroCard/HeroCard.theme.js +5 -2
- package/dist/components/core/Kbd/Kbd.theme.js +4 -2
- package/dist/components/core/Link/Link.js +6 -4
- package/dist/components/core/Message/Message.js +2 -2
- package/dist/components/core/Message/Message.theme.js +5 -7
- package/dist/components/core/Message/MessageAudio.js +2 -2
- package/dist/components/core/Message/MessageFile.js +2 -2
- package/dist/components/core/Message/MessageLink.js +2 -2
- package/dist/components/core/Message/MessageStatusIndicator.js +5 -5
- package/dist/components/core/Modal/Modal.d.ts +1 -1
- package/dist/components/core/Modal/Modal.js +2 -2
- package/dist/components/core/Modal/Modal.theme.js +9 -4
- package/dist/components/core/Modal/ModalHeader.js +2 -2
- package/dist/components/core/ModalStack/ModalStackModal.js +2 -2
- package/dist/components/core/NavItem/NavItem.js +6 -6
- package/dist/components/core/OfflineIndicator/OfflineIndicator.animations.d.ts +22 -0
- package/dist/components/core/OfflineIndicator/OfflineIndicator.animations.js +54 -0
- package/dist/components/core/OfflineIndicator/OfflineIndicator.js +23 -24
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +25 -6
- package/dist/components/core/OfflineIndicator/OfflineIndicator.types.d.ts +17 -0
- package/dist/components/core/PageHeading/PageHeading.theme.js +1 -1
- package/dist/components/core/PageHeading/PageHeadingBackButton.js +2 -2
- package/dist/components/core/Pagination/Pagination.js +3 -3
- package/dist/components/core/Pagination/Pagination.theme.js +3 -3
- package/dist/components/core/Pill/Pill.js +4 -2
- package/dist/components/core/Pill/Pill.theme.js +6 -4
- package/dist/components/core/Rating/Rating.js +4 -5
- package/dist/components/core/Rating/Rating.theme.js +1 -1
- package/dist/components/core/Segmented/Segmented.theme.js +9 -6
- package/dist/components/core/Sidebar/Sidebar.types.d.ts +4 -2
- package/dist/components/core/Sidebar/SidebarHeader.js +2 -2
- package/dist/components/core/Sidebar/SidebarMobileTrigger.js +2 -2
- package/dist/components/core/Sidebar/SidebarSearch.js +3 -3
- package/dist/components/core/Sidebar/SidebarToggle.js +3 -3
- package/dist/components/core/Sidebar/SidebarUserProfile.js +2 -2
- package/dist/components/core/Sortable/Sortable.js +2 -2
- package/dist/components/core/Tag/Tag.js +2 -2
- package/dist/components/core/Tag/Tag.theme.js +4 -2
- package/dist/components/core/Toast/Toast.js +3 -3
- package/dist/components/core/Toast/Toast.types.d.ts +1 -1
- package/dist/components/core/Toast/useToast.js +5 -5
- package/dist/components/core/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/core/Tooltip/Tooltip.js +42 -10
- package/dist/components/core/Tooltip/Tooltip.types.d.ts +25 -0
- package/dist/components/core/Tree/Tree.js +2 -2
- package/dist/components/core/shared/interaction.animations.d.ts +51 -0
- package/dist/components/core/shared/interaction.animations.js +59 -0
- package/dist/components/data-display/Feed/Feed.js +2 -2
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +1 -1
- package/dist/components/data-display/GanttChart/GanttChartPanel.js +2 -2
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.js +3 -3
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.js +2 -2
- package/dist/components/data-display/GanttChart/GanttToolbar.js +2 -2
- package/dist/components/data-display/KPI/KPI.js +2 -2
- package/dist/components/data-display/KPI/KPI.theme.js +4 -4
- package/dist/components/data-display/Metric/Metric.js +2 -2
- package/dist/components/data-display/Metric/Metric.theme.js +25 -8
- package/dist/components/data-display/Metric/Metric.types.d.ts +1 -1
- package/dist/components/data-display/Table/Table.theme.js +9 -9
- package/dist/components/data-display/Table/TableActions.js +2 -2
- package/dist/components/data-display/Table/TableActionsMenu.js +1 -1
- package/dist/components/data-display/Table/TableColumnManager.js +2 -2
- package/dist/components/data-display/Table/TableDeclarative.js +3 -3
- package/dist/components/data-display/Table/TableFilter.js +4 -4
- package/dist/components/data-display/Table/TableHeader.js +3 -3
- package/dist/components/data-display/Table/TableRow.js +2 -2
- package/dist/components/data-display/Table/TableSelectionHeader.js +3 -3
- package/dist/components/data-display/Timeline/TimelineMarker.js +2 -2
- package/dist/components/effects/CustomCursor/CustomCursor.js +2 -2
- package/dist/components/effects/CustomCursor/CustomCursor.theme.js +2 -2
- package/dist/components/effects/DotPattern/DotPattern.js +6 -0
- package/dist/components/effects/DotPattern/DotPattern.types.d.ts +4 -2
- package/dist/components/effects/MeshGradient/MeshGradient.utils.d.ts +1 -1
- package/dist/components/effects/MeshGradient/MeshGradient.utils.js +1 -1
- package/dist/components/forms/Checkbox/Checkbox.js +2 -1
- package/dist/components/forms/Checkbox/Checkbox.theme.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerEyeDropper.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerGradient.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerHeader.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerImage.js +3 -3
- package/dist/components/forms/ColorPicker/ColorPickerInput.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerPresets.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerSavedColors.js +2 -2
- package/dist/components/forms/Combobox/Combobox.js +3 -3
- package/dist/components/forms/Combobox/Combobox.theme.js +2 -2
- package/dist/components/forms/DatePicker/DatePicker.animations.js +16 -25
- package/dist/components/forms/DatePicker/DatePicker.theme.js +2 -2
- package/dist/components/forms/DatePicker/DatePickerBody.js +1 -1
- package/dist/components/forms/DatePicker/DatePickerTrigger.js +2 -2
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +3 -3
- package/dist/components/forms/DateRangePicker/DateRangePickerBody.js +1 -1
- package/dist/components/forms/DateRangePicker/DateRangePickerPresets.js +2 -2
- package/dist/components/forms/DateRangePicker/DateRangePickerTrigger.js +2 -2
- package/dist/components/forms/FileUpload/FileUpload.js +4 -4
- package/dist/components/forms/FileUpload/FileUpload.theme.js +5 -1
- package/dist/components/forms/FileUpload/FileUploadProgress.js +7 -7
- package/dist/components/forms/Input/Input.js +6 -7
- package/dist/components/forms/Input/Input.theme.js +19 -15
- package/dist/components/forms/InputAddress/InputAddress.js +10 -3
- package/dist/components/forms/InputCounter/InputCounter.js +3 -3
- package/dist/components/forms/InputOTP/InputOTP.d.ts +3 -12
- package/dist/components/forms/InputOTP/InputOTP.js +140 -151
- package/dist/components/forms/InputOTP/InputOTP.theme.d.ts +5 -1
- package/dist/components/forms/InputOTP/InputOTP.theme.js +40 -5
- package/dist/components/forms/InputOTP/InputOTP.types.d.ts +45 -2
- package/dist/components/forms/InputOTP/index.d.ts +1 -1
- package/dist/components/forms/InputTag/InputTag.js +5 -5
- package/dist/components/forms/InputTag/InputTag.theme.js +1 -2
- package/dist/components/forms/Mention/Mention.theme.js +3 -5
- package/dist/components/forms/Radio/Radio.js +3 -2
- package/dist/components/forms/Radio/Radio.theme.js +2 -2
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +22 -23
- package/dist/components/forms/Select/Select.d.ts +5 -1
- package/dist/components/forms/Select/Select.js +12 -11
- package/dist/components/forms/Select/Select.theme.js +4 -4
- package/dist/components/forms/Select/Select.types.d.ts +4 -1
- package/dist/components/forms/SelectableCard/SelectableCard.animations.d.ts +1 -2
- package/dist/components/forms/SelectableCard/SelectableCard.animations.js +6 -7
- package/dist/components/forms/SelectableCard/SelectableCard.js +1 -1
- package/dist/components/forms/Signature/Signature.js +1 -1
- package/dist/components/forms/Slider/Slider.js +24 -11
- package/dist/components/forms/Slider/Slider.theme.js +9 -3
- package/dist/components/forms/Switch/Switch.theme.js +1 -1
- package/dist/components/forms/TimePicker/TimePicker.theme.js +6 -7
- package/dist/components/forms/TimePicker/TimePickerContent.js +1 -1
- package/dist/components/forms/TimePicker/TimePickerTrigger.js +3 -3
- package/dist/components/forms/forms.theme.js +23 -12
- package/dist/components/forms/index.js +1 -1
- package/dist/components/generative/registry.js +195 -2
- package/dist/components/generative/resolvers.js +16 -16
- package/dist/components/generative/schema.generated.js +2687 -379
- package/dist/components/layout/Section/Section.theme.js +1 -1
- package/dist/generative.schema.json +2687 -379
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useElapsedTime.d.ts +28 -0
- package/dist/hooks/useElapsedTime.js +37 -0
- package/dist/hooks/useSelectPortal.d.ts +10 -2
- package/dist/hooks/useSelectPortal.js +6 -3
- package/dist/index.js +1 -1
- package/dist/registry.json +835 -261
- package/dist/shadcn-compat.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +5 -1
- package/dist/themes/ember.css +131 -0
- package/dist/themes/iris.css +94 -0
- package/dist/themes/jade.css +139 -0
- package/dist/tools.json +2705 -361
- package/dist/utils/colorUtils.d.ts +6 -6
- package/dist/utils/colorUtils.js +8 -8
- package/package.json +9 -6
- package/src/global.scss +15 -4
- package/src/styles/theme.css +440 -152
- package/tailwind.preset.cjs +52 -34
- package/dist/components/core/Pill/Pill.animations.d.ts +0 -32
- package/dist/components/core/Pill/Pill.animations.js +0 -16
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
* Uses variant-first color organization for reliable dark mode and className overrides
|
|
4
4
|
*/
|
|
5
5
|
const badgeTheme = {
|
|
6
|
-
// Base styles applied to all badges
|
|
6
|
+
// Base styles applied to all badges.
|
|
7
|
+
// No `leading-*` here: `sizes` applies `text-xs` AFTER this string, and tailwind-merge
|
|
8
|
+
// treats font-size as owning line-height, so any leading class here is silently dropped.
|
|
9
|
+
// The badge therefore uses the `text-xs` ramp line-height (16px) → 22px tall.
|
|
10
|
+
// To change it, put the leading class in `sizes`, after `text-xs`.
|
|
7
11
|
baseStyle: "inline-flex items-center align-middle select-none whitespace-nowrap transition-all duration-300 h-fit w-fit tracking-tight font-medium border",
|
|
8
12
|
// Visual style variants (structure only, no colors)
|
|
9
13
|
// All variants keep the 1px `border` from baseStyle so every variant is the
|
|
@@ -22,8 +26,8 @@ const badgeTheme = {
|
|
|
22
26
|
variantColors: {
|
|
23
27
|
// Filled variant - solid backgrounds, no visible border
|
|
24
28
|
filled: {
|
|
25
|
-
|
|
26
|
-
"dark:bg-[var(--color-
|
|
29
|
+
mono: "bg-[var(--color-mono-900)] text-white " +
|
|
30
|
+
"dark:bg-[var(--color-mono-700)]",
|
|
27
31
|
// Background drives from the themed base var (mode-aware) so the
|
|
28
32
|
// auto-derived -contrast text always matches. Do NOT pin a fixed step
|
|
29
33
|
// (e.g. dark:bg-primary-600) — that decouples the fill from -contrast and
|
|
@@ -39,7 +43,7 @@ const badgeTheme = {
|
|
|
39
43
|
},
|
|
40
44
|
// Outline variant - transparent bg with colored border
|
|
41
45
|
outline: {
|
|
42
|
-
|
|
46
|
+
mono: "text-[var(--color-text-primary)] border-[var(--color-border-secondary)] " + "",
|
|
43
47
|
primary: "text-[var(--color-primary)] border-[var(--color-primary-600)] " +
|
|
44
48
|
"dark:text-[var(--color-primary-400)] dark:border-[var(--color-primary-400)]",
|
|
45
49
|
success: "text-[var(--color-success)] border-[var(--color-success-600)] " +
|
|
@@ -52,8 +56,8 @@ const badgeTheme = {
|
|
|
52
56
|
// Soft variant - subtle background tints, NO visible border (the transparent
|
|
53
57
|
// 1px border from `variants.soft` only reserves height; the fill shows through it).
|
|
54
58
|
soft: {
|
|
55
|
-
|
|
56
|
-
"dark:bg-[var(--color-
|
|
59
|
+
mono: "bg-[var(--color-mono-100)] text-[var(--color-text-primary)] " +
|
|
60
|
+
"dark:bg-[var(--color-mono-900)]",
|
|
57
61
|
primary: "bg-[var(--color-primary-50)] text-[var(--color-primary-700)] " +
|
|
58
62
|
"dark:bg-[var(--color-primary-400)]/20 dark:text-[var(--color-primary-300)]",
|
|
59
63
|
success: "bg-[var(--color-success-100)]/70 text-[var(--color-success-700)] " +
|
|
@@ -64,16 +68,18 @@ const badgeTheme = {
|
|
|
64
68
|
"dark:bg-[var(--color-danger-400)]/20 dark:text-[var(--color-danger-400)]",
|
|
65
69
|
},
|
|
66
70
|
},
|
|
67
|
-
// Flat size structure (no nested objects)
|
|
71
|
+
// Flat size structure (no nested objects).
|
|
72
|
+
// Paddings are tokenised (--badge-px-*/--badge-py-*) so a theme can grow the
|
|
73
|
+
// chip tier — defaults are px-1/px-1.5 + py-0/py-0.5. See theme.css.
|
|
68
74
|
sizes: {
|
|
69
|
-
sm: "text-xs px-
|
|
70
|
-
md: "text-xs px-
|
|
75
|
+
sm: "text-xs px-[var(--badge-px-sm)] py-[var(--badge-py-sm)] gap-1",
|
|
76
|
+
md: "text-xs px-[var(--badge-px-md)] py-[var(--badge-py-md)] gap-1",
|
|
71
77
|
},
|
|
72
78
|
// Additional padding for pill shape — must clear the rounded-full cap radius
|
|
73
79
|
// (≈ height/2), otherwise content sits inside the curve and hugs the edge.
|
|
74
80
|
pillSizes: {
|
|
75
|
-
sm: "px-
|
|
76
|
-
md: "px-
|
|
81
|
+
sm: "px-[var(--badge-pill-px-sm)]",
|
|
82
|
+
md: "px-[var(--badge-pill-px-md)]",
|
|
77
83
|
},
|
|
78
84
|
// Icon sizes — applies to wrapper span; [&>svg] selector ensures SVG scales to fit
|
|
79
85
|
iconSizes: {
|
|
@@ -93,7 +99,7 @@ const badgeTheme = {
|
|
|
93
99
|
},
|
|
94
100
|
// Dot inherits text color via currentColor — works across all variants/colors
|
|
95
101
|
dotColors: {
|
|
96
|
-
|
|
102
|
+
mono: "bg-current",
|
|
97
103
|
primary: "bg-current",
|
|
98
104
|
success: "bg-current",
|
|
99
105
|
warning: "bg-current",
|
|
@@ -13,7 +13,4 @@ export declare const breadcrumbsVariants: Record<BreadcrumbsVariant, Partial<Bre
|
|
|
13
13
|
/**
|
|
14
14
|
* Default chevron separator element
|
|
15
15
|
*/
|
|
16
|
-
export declare const defaultSeparator: React.FunctionComponentElement<
|
|
17
|
-
title?: string;
|
|
18
|
-
titleId?: string;
|
|
19
|
-
} & React.RefAttributes<SVGSVGElement>>;
|
|
16
|
+
export declare const defaultSeparator: React.FunctionComponentElement<import("@phosphor-icons/react").IconProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { CaretRight } from '@phosphor-icons/react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Default theme configuration for Breadcrumbs component
|
|
@@ -27,6 +27,6 @@ const breadcrumbsVariants = {
|
|
|
27
27
|
/**
|
|
28
28
|
* Default chevron separator element
|
|
29
29
|
*/
|
|
30
|
-
const defaultSeparator = React__default.createElement(
|
|
30
|
+
const defaultSeparator = React__default.createElement(CaretRight, { className: "size-4" });
|
|
31
31
|
|
|
32
32
|
export { breadcrumbsTheme, breadcrumbsVariants, defaultSeparator };
|
|
@@ -6,21 +6,12 @@ import { buttonTheme } from './Button.theme.js';
|
|
|
6
6
|
import { cn } from '../../../utils/cn.js';
|
|
7
7
|
import { Spinner } from '../Spinner/Spinner.js';
|
|
8
8
|
import { useRipple, getRippleAnimation, getRippleColorClass } from './Button.ripple.js';
|
|
9
|
+
import { createPressVariants } from '../shared/interaction.animations.js';
|
|
9
10
|
|
|
10
|
-
//
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
transition: {
|
|
15
|
-
duration: 0.1,
|
|
16
|
-
type: "spring",
|
|
17
|
-
stiffness: 400,
|
|
18
|
-
damping: 10,
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
const Button = React__default.forwardRef(({ children, className = "", iconOnly = false, state = "default", size = "md", color, variant, block = false, onClick, enableRipple = true, rippleEffect = "default", rippleClassName, rippleScale = 10, showReflection = true, darkMode = false, disabled: disabledProp, "aria-label": ariaLabelProp, onAnimationStart: _onAnimationStart, onAnimationEnd: _onAnimationEnd, onDrag: _onDrag, onDragStart: _onDragStart, onDragEnd: _onDragEnd, ...restProps }, ref) => {
|
|
23
|
-
var _a, _b, _c, _d, _e, _f;
|
|
11
|
+
// Shared press physics (module-level constant)
|
|
12
|
+
const BUTTON_PRESS_VARIANTS = createPressVariants(0.97);
|
|
13
|
+
const Button = React__default.forwardRef(({ children, iconStart, iconEnd, className = "", iconOnly = false, state = "default", size = "md", color, variant, block = false, onClick, enableRipple = true, rippleEffect = "default", rippleClassName, rippleScale = 10, showReflection = true, darkMode = false, disabled: disabledProp, "aria-label": ariaLabelProp, onAnimationStart: _onAnimationStart, onAnimationEnd: _onAnimationEnd, onDrag: _onDrag, onDragStart: _onDragStart, onDragEnd: _onDragEnd, ...restProps }, ref) => {
|
|
14
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
24
15
|
const shouldReduceMotion = useReducedMotion();
|
|
25
16
|
const shouldDisableAnimations = !!shouldReduceMotion;
|
|
26
17
|
// Initialize ripple hook
|
|
@@ -78,8 +69,9 @@ const Button = React__default.forwardRef(({ children, className = "", iconOnly =
|
|
|
78
69
|
const animationProps = shouldDisableAnimations
|
|
79
70
|
? {}
|
|
80
71
|
: {
|
|
81
|
-
|
|
82
|
-
|
|
72
|
+
animate: "rest",
|
|
73
|
+
whileTap: !isDisabled ? "press" : undefined,
|
|
74
|
+
variants: BUTTON_PRESS_VARIANTS,
|
|
83
75
|
};
|
|
84
76
|
// Spinner inherits the button's text color (the `-contrast` token on filled
|
|
85
77
|
// variants, the semantic color on outline/soft/ghost) so it always contrasts
|
|
@@ -113,7 +105,7 @@ const Button = React__default.forwardRef(({ children, className = "", iconOnly =
|
|
|
113
105
|
}, [buttonRef]);
|
|
114
106
|
return (jsxs(motion.button, { type: "button", ...restProps, ...animationProps, ref: mergedRef, className: cn(buttonTheme.baseStyle, colorClasses, variantClasses, sizeClasses, blockStyle, stateClasses, darkMode && "dark", className), disabled: isDisabled, "data-state": consumerDataState !== null && consumerDataState !== void 0 ? consumerDataState : state, "data-color": resolvedColor, "data-variant": resolvedVariant, "data-size": size, "data-icon-only": iconOnly ? "true" : "false", "data-block": block ? "true" : "false", "aria-disabled": isDisabled || undefined, "aria-busy": isLoading || undefined, "aria-label": ariaLabel, onClick: handleClick, children: [showReflection &&
|
|
115
107
|
resolvedVariant !== "ghost" &&
|
|
116
|
-
resolvedVariant !== "outline" && (jsx("div", { className: "pointer-events-none absolute inset-px border-t-[0.5px] border-white/50 rounded-[inherit] blur-[0.75px]" })), isLoading && (jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: jsx(Spinner, { size: "sm", color: color, className: spinnerClassName }) })),
|
|
108
|
+
resolvedVariant !== "outline" && (jsx("div", { className: "pointer-events-none absolute inset-px border-t-[0.5px] border-white/50 rounded-[inherit] blur-[0.75px]" })), isLoading && (jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: jsx(Spinner, { size: "sm", color: color, className: spinnerClassName }) })), jsxs("span", { className: cn("inline-flex items-center gap-2 whitespace-nowrap", isLoading && "opacity-0"), children: [iconStart && (jsx("span", { className: cn("inline-flex shrink-0 items-center justify-center", (_g = buttonTheme.iconSizes) === null || _g === void 0 ? void 0 : _g[size]), "aria-hidden": "true", children: iconStart })), children, iconEnd && (jsx("span", { className: cn("inline-flex shrink-0 items-center justify-center", (_h = buttonTheme.iconSizes) === null || _h === void 0 ? void 0 : _h[size]), "aria-hidden": "true", children: iconEnd }))] }), enableRipple &&
|
|
117
109
|
ripples.map((ripple) => {
|
|
118
110
|
const animation = getRippleAnimation(effect, ripple, rippleScale);
|
|
119
111
|
return (jsx(motion.span, { initial: animation.initial, animate: animation.animate, transition: animation.transition, className: cn("absolute rounded-full size-5 pointer-events-none ", animation.className, rippleClassName ||
|
|
@@ -127,8 +127,8 @@ function getRippleColorClass(variant, color) {
|
|
|
127
127
|
return "bg-[var(--color-primary)]/20";
|
|
128
128
|
case "danger":
|
|
129
129
|
return "bg-[var(--color-danger)]/20";
|
|
130
|
-
case "
|
|
131
|
-
return "bg-[var(--color-
|
|
130
|
+
case "mono":
|
|
131
|
+
return "bg-[var(--color-mono-500)]/20";
|
|
132
132
|
default:
|
|
133
133
|
return "bg-[var(--color-primary)]/20";
|
|
134
134
|
}
|
|
@@ -16,6 +16,8 @@ export interface ButtonTheme {
|
|
|
16
16
|
default: string;
|
|
17
17
|
iconOnly: string;
|
|
18
18
|
}>;
|
|
19
|
+
/** Wrapper sizing for the `iconStart`/`iconEnd` slots, per button size. */
|
|
20
|
+
iconSizes: Record<ButtonSize, string>;
|
|
19
21
|
states: Partial<Record<ButtonState, string>>;
|
|
20
22
|
blockStyle: string;
|
|
21
23
|
}
|
|
@@ -3,32 +3,37 @@
|
|
|
3
3
|
*/
|
|
4
4
|
const buttonTheme = {
|
|
5
5
|
// Base styles for the button element
|
|
6
|
-
baseStyle: "relative inline-flex items-center justify-center gap-2 focus:outline-none rounded-[var(--button-radius)] overflow-hidden cursor-pointer transition-
|
|
6
|
+
baseStyle: "relative inline-flex items-center justify-center gap-2 focus:outline-none rounded-[var(--button-radius)] overflow-hidden cursor-pointer transition-[color,background-color,border-color,box-shadow,filter,opacity] duration-150 ease-out min-w-fit flex-shrink-0 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 cursor-pointer backdrop-blur-sm",
|
|
7
7
|
// Visual style variants - STRUCTURE only (no colors)
|
|
8
8
|
variantStyles: {
|
|
9
|
-
filled: "border border-black/
|
|
9
|
+
filled: "border border-black/15 hover:brightness-[0.9] dark:hover:brightness-[1.15]",
|
|
10
10
|
outline: "bg-transparent border",
|
|
11
11
|
soft: "border-transparent",
|
|
12
12
|
ghost: "bg-transparent border-transparent",
|
|
13
13
|
},
|
|
14
14
|
// Color styles organized BY VARIANT for reliable dark: prefixes
|
|
15
15
|
variantColors: {
|
|
16
|
-
// Filled variant - solid backgrounds
|
|
16
|
+
// Filled variant - solid backgrounds.
|
|
17
|
+
// Border split: LIGHT edge is the universal `border-black/25` from
|
|
18
|
+
// variantStyles.filled (later in the stylesheet, it beats any light
|
|
19
|
+
// border-* set here — don't add one). DARK keeps color-matched
|
|
20
|
+
// `dark:border-*` per color (dark variants compile after black/25 and
|
|
21
|
+
// win; a black edge would be invisible on dark fills).
|
|
17
22
|
filled: {
|
|
18
|
-
|
|
19
|
-
"focus-visible:outline-[var(--color-
|
|
20
|
-
"dark:
|
|
21
|
-
primary: "bg-[var(--color-primary)] text-[var(--color-primary-contrast)]
|
|
23
|
+
mono: "bg-[var(--color-mono)] text-[var(--color-mono-contrast)] " +
|
|
24
|
+
"focus-visible:outline-[var(--color-mono-800)] " +
|
|
25
|
+
"dark:border-[var(--color-mono)]",
|
|
26
|
+
primary: "bg-[var(--color-primary)] text-[var(--color-primary-contrast)] " +
|
|
22
27
|
"focus-visible:outline-[var(--color-primary-600)] " +
|
|
23
|
-
"dark:
|
|
24
|
-
danger: "bg-[var(--color-danger)] text-[var(--color-danger-contrast)]
|
|
28
|
+
"dark:border-[var(--color-primary-600)]",
|
|
29
|
+
danger: "bg-[var(--color-danger)] text-[var(--color-danger-contrast)] " +
|
|
25
30
|
"focus-visible:outline-[var(--color-danger-600)] " +
|
|
26
31
|
"dark:bg-[var(--color-danger-600)] dark:border-[var(--color-danger-600)]",
|
|
27
32
|
},
|
|
28
33
|
// Outline variant - transparent bg with colored border
|
|
29
34
|
outline: {
|
|
30
|
-
|
|
31
|
-
"hover:bg-[var(--color-
|
|
35
|
+
mono: "text-[var(--color-text-primary)] border-[var(--color-border-secondary)] " +
|
|
36
|
+
"hover:bg-[var(--color-mono-100)] " +
|
|
32
37
|
"focus-visible:outline-[var(--color-text-secondary)] " +
|
|
33
38
|
"dark:hover:bg-[var(--color-background-secondary)]",
|
|
34
39
|
primary: "text-[var(--color-text-primary)] border-[var(--color-primary-600)]/30 " +
|
|
@@ -44,11 +49,11 @@ const buttonTheme = {
|
|
|
44
49
|
},
|
|
45
50
|
// Soft variant - subtle background tints
|
|
46
51
|
soft: {
|
|
47
|
-
|
|
48
|
-
"hover:bg-[var(--color-
|
|
52
|
+
mono: "text-[var(--color-text-primary)] bg-[var(--color-mono-100)] " +
|
|
53
|
+
"hover:bg-[var(--color-mono-200)] " +
|
|
49
54
|
"focus-visible:outline-[var(--color-text-secondary)] " +
|
|
50
|
-
"dark:text-[var(--color-text-primary)] dark:bg-[var(--color-
|
|
51
|
-
"dark:hover:bg-[var(--color-
|
|
55
|
+
"dark:text-[var(--color-text-primary)] dark:bg-[var(--color-mono-900)] " +
|
|
56
|
+
"dark:hover:bg-[var(--color-mono-800)]",
|
|
52
57
|
primary: "text-[var(--color-primary-600)] bg-[var(--color-primary)]/10 " +
|
|
53
58
|
"hover:bg-[var(--color-primary-50)] " +
|
|
54
59
|
"focus-visible:outline-[var(--color-primary-600)] " +
|
|
@@ -62,10 +67,10 @@ const buttonTheme = {
|
|
|
62
67
|
},
|
|
63
68
|
// Ghost variant - transparent bg, subtle hover, full padding
|
|
64
69
|
ghost: {
|
|
65
|
-
|
|
66
|
-
"hover:bg-[var(--color-
|
|
70
|
+
mono: "text-[var(--color-text-primary)] " +
|
|
71
|
+
"hover:bg-[var(--color-mono-100)] " +
|
|
67
72
|
"focus-visible:outline-[var(--color-text-secondary)] " +
|
|
68
|
-
"dark:text-[var(--color-text-primary)] dark:hover:bg-[var(--color-
|
|
73
|
+
"dark:text-[var(--color-text-primary)] dark:hover:bg-[var(--color-mono-800)]",
|
|
69
74
|
primary: "text-[var(--color-primary-600)] " +
|
|
70
75
|
"hover:bg-[var(--color-primary-50)] " +
|
|
71
76
|
"focus-visible:outline-[var(--color-primary-600)] " +
|
|
@@ -81,18 +86,26 @@ const buttonTheme = {
|
|
|
81
86
|
sm: {
|
|
82
87
|
// Tighten the corner radius at sm so a short button doesn't read as a pill
|
|
83
88
|
// (overrides baseStyle's rounded-[var(--button-radius)] via twMerge).
|
|
84
|
-
default: "font-medium min-h-[var(--button-min-h-sm)] px-[var(--button-px-sm)] py-[var(--button-py-sm)] text-sm rounded-[calc(var(--button-radius)*0.75)]",
|
|
89
|
+
default: "font-medium min-h-[var(--button-min-h-sm)] px-[var(--button-px-sm)] py-[var(--button-py-sm)] text-[length:var(--button-text-size-sm)]/[var(--button-line-height-sm)] rounded-[calc(var(--button-radius)*0.75)]",
|
|
85
90
|
iconOnly: "size-[var(--button-icon-size-sm)] p-[var(--button-icon-p-sm)] rounded-[calc(var(--button-radius)*0.75)]",
|
|
86
91
|
},
|
|
87
92
|
md: {
|
|
88
|
-
default: "font-medium min-h-[var(--button-min-h-md)] px-[var(--button-px-md)] py-[var(--button-py-md)] text-
|
|
93
|
+
default: "font-medium min-h-[var(--button-min-h-md)] px-[var(--button-px-md)] py-[var(--button-py-md)] text-[length:var(--button-text-size-md)]/[var(--button-line-height-md)]",
|
|
89
94
|
iconOnly: "size-[var(--button-icon-size-md)] p-[var(--button-icon-p-md)]",
|
|
90
95
|
},
|
|
91
96
|
lg: {
|
|
92
|
-
default: "font-medium min-h-[var(--button-min-h-lg)] px-[var(--button-px-lg)] py-[var(--button-py-lg)] text-
|
|
97
|
+
default: "font-medium min-h-[var(--button-min-h-lg)] px-[var(--button-px-lg)] py-[var(--button-py-lg)] text-[length:var(--button-text-size-lg)]/[var(--button-line-height-lg)]",
|
|
93
98
|
iconOnly: "size-[var(--button-icon-size-lg)] p-[var(--button-icon-p-lg)]",
|
|
94
99
|
},
|
|
95
100
|
},
|
|
101
|
+
// Icon slot sizing. `[&>svg]:size-*` sizes the icon itself, so a caller passing a bare
|
|
102
|
+
// <SearchIcon /> with no className still lands at the right size — mirrors Badge's
|
|
103
|
+
// iconSizes. A caller's own className on the icon still wins.
|
|
104
|
+
iconSizes: {
|
|
105
|
+
sm: "size-3.5 [&>svg]:size-3.5",
|
|
106
|
+
md: "size-4 [&>svg]:size-4",
|
|
107
|
+
lg: "size-5 [&>svg]:size-5",
|
|
108
|
+
},
|
|
96
109
|
// State styles
|
|
97
110
|
states: {
|
|
98
111
|
disabled: "opacity-60 cursor-not-allowed pointer-events-none saturate-0",
|
|
@@ -26,6 +26,23 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
26
26
|
iconOnly?: boolean;
|
|
27
27
|
/** Whether the button should be full width */
|
|
28
28
|
block?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Small decorative icon before the label, auto-sized to the button's `size`.
|
|
31
|
+
*
|
|
32
|
+
* The SERIALIZABLE front door — composing the icon into `children` stays the
|
|
33
|
+
* idiomatic hand-written form (`<Button><SearchIcon className="size-4" />Search</Button>`)
|
|
34
|
+
* and is unchanged. This slot exists because a generative UI spec is JSON: it can name
|
|
35
|
+
* an icon but cannot pass a React element, so `children` alone leaves an LLM unable to
|
|
36
|
+
* put an icon on a button at all. Same "one contract, two front doors" shape as Card's
|
|
37
|
+
* `title`/`subtitle` slot-props and the collection `items` APIs (CLAUDE.md §2).
|
|
38
|
+
*
|
|
39
|
+
* Deliberately NO `contentStart`/`contentEnd` counterpart: those take arbitrary
|
|
40
|
+
* ReactNode, which is not serializable, so they would buy the generative path nothing
|
|
41
|
+
* — compose those into `children`.
|
|
42
|
+
*/
|
|
43
|
+
iconStart?: React.ReactNode;
|
|
44
|
+
/** Small decorative icon after the label, auto-sized to the button's `size`. See `iconStart`. */
|
|
45
|
+
iconEnd?: React.ReactNode;
|
|
29
46
|
/** Button contents */
|
|
30
47
|
children?: React.ReactNode;
|
|
31
48
|
/** Additional class names */
|
|
@@ -49,7 +66,7 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
49
66
|
*/
|
|
50
67
|
darkMode?: boolean;
|
|
51
68
|
}
|
|
52
|
-
export type ButtonColor = "
|
|
69
|
+
export type ButtonColor = "mono" | "primary" | "danger";
|
|
53
70
|
export type ButtonVariant = "filled" | "outline" | "soft" | "ghost";
|
|
54
71
|
export type ButtonSize = "sm" | "md" | "lg";
|
|
55
72
|
export type ButtonState = "default" | "disabled" | "loading";
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import React__default, { useState, useCallback, useEffect, useMemo } from 'react';
|
|
4
4
|
import { useReducedMotion, motion } from 'motion/react';
|
|
5
|
-
import {
|
|
5
|
+
import { CaretLeft, CaretRight } from '@phosphor-icons/react';
|
|
6
6
|
import { calendarTheme } from './Calendar.theme.js';
|
|
7
7
|
import { calendarAnimations } from './Calendar.animations.js';
|
|
8
8
|
import { cn } from '../../../utils/cn.js';
|
|
9
|
+
import '../../../theme/ThemeContext.js';
|
|
10
|
+
import '../../../theme/SurfaceContext.js';
|
|
11
|
+
import { springs } from '../../../theme/animations.js';
|
|
9
12
|
import { Select } from '../../forms/Select/Select.js';
|
|
10
13
|
import '../../forms/Select/Select.theme.js';
|
|
11
14
|
import { Button } from '../Button/Button.js';
|
|
@@ -113,7 +116,9 @@ const generateCalendarDays = (year, month, selectedValue, mode = 'single', today
|
|
|
113
116
|
}
|
|
114
117
|
return days;
|
|
115
118
|
};
|
|
116
|
-
const Calendar = React__default.forwardRef(({ mode = 'single', value, defaultValue, onChange, minDate, maxDate, isDateDisabled: customIsDateDisabled, showToday = true, selectTodayByDefault = false, weekdays = ["M", "T", "W", "T", "F", "S", "S"], months, size = "md", headerMode, enableMonthDropdown = true, enableYearDropdown = true, yearRange, viewDate: externalViewDate, onViewDateChange, onNavigatePrev, onNavigateNext, showOtherMonthDays = true, className,
|
|
119
|
+
const Calendar = React__default.forwardRef(({ mode = 'single', value, defaultValue, onChange, minDate, maxDate, isDateDisabled: customIsDateDisabled, showToday = true, selectTodayByDefault = false, weekdays = ["M", "T", "W", "T", "F", "S", "S"], months, size = "md", headerMode, enableMonthDropdown = true, enableYearDropdown = true, yearRange, viewDate: externalViewDate, onViewDateChange, onNavigatePrev, onNavigateNext, showOtherMonthDays = true, className,
|
|
120
|
+
// Destructure motion-conflicting props to avoid type issues
|
|
121
|
+
onAnimationStart: _onAnimationStart, onAnimationEnd: _onAnimationEnd, onDrag: _onDrag, onDragStart: _onDragStart, onDragEnd: _onDragEnd, ...props }, ref) => {
|
|
117
122
|
// Determine initial view date from value/defaultValue
|
|
118
123
|
const getInitialViewDate = () => {
|
|
119
124
|
if (value) {
|
|
@@ -298,6 +303,16 @@ const Calendar = React__default.forwardRef(({ mode = 'single', value, defaultVal
|
|
|
298
303
|
maxDate,
|
|
299
304
|
customIsDateDisabled,
|
|
300
305
|
]);
|
|
306
|
+
// Calculate days grid height dynamically to animate height smoothly without layout scale distortion
|
|
307
|
+
const gridHeight = useMemo(() => {
|
|
308
|
+
const rowCount = calendarDays.length / 7;
|
|
309
|
+
// Must mirror calendarTheme.dayButtonSizes (size-8/10/12 → 32/40/48px)
|
|
310
|
+
const rowHeight = size === 'sm' ? 32 : size === 'lg' ? 48 : 40;
|
|
311
|
+
// Row height * number of rows + gap-y (2px) * (number of rows - 1),
|
|
312
|
+
// plus the grid's py-1 (4px top + bottom) that keeps focus rings
|
|
313
|
+
// visible inside the overflow-hidden clip.
|
|
314
|
+
return rowCount * rowHeight + (rowCount - 1) * 2 + 8;
|
|
315
|
+
}, [calendarDays.length, size]);
|
|
301
316
|
// Reset the roving tabindex target whenever the visible month changes —
|
|
302
317
|
// prefer the selected day, then today, then the first day of the month.
|
|
303
318
|
// Deliberately does NOT depend on `selectedValue`/`calendarDays` so that
|
|
@@ -446,9 +461,9 @@ const Calendar = React__default.forwardRef(({ mode = 'single', value, defaultVal
|
|
|
446
461
|
}
|
|
447
462
|
}
|
|
448
463
|
}, [minDate, maxDate, customIsDateDisabled, currentMonth, currentYear, onViewDateChange, mode, value, onChange, selectedValue, rangeSelectionState]);
|
|
449
|
-
return (jsxs("div", { ref: ref, className: cn(calendarTheme.baseStyle, className), ...props, children: [jsxs("div", { className: calendarTheme.headerStyle, children: [onNavigatePrev !== null && (jsx(Button, { onClick: navigateToPreviousMonth, "aria-label": "Previous month", disabled: !canNavigateToPrev, iconOnly: true, variant: "ghost", color: "
|
|
464
|
+
return (jsxs("div", { ref: ref, className: cn(calendarTheme.baseStyle, className), ...props, children: [jsxs("div", { className: calendarTheme.headerStyle, children: [onNavigatePrev !== null && (jsx(Button, { onClick: navigateToPreviousMonth, "aria-label": "Previous month", disabled: !canNavigateToPrev, iconOnly: true, variant: "ghost", color: "mono", size: "sm", children: jsx(CaretLeft, { className: "size-4", weight: "bold" }) })), onNavigatePrev === null && jsx("div", { className: "w-8" }), resolvedHeaderMode === 'static' ? (jsxs("h2", { className: calendarTheme.titleStyle, children: [getMonthName(viewDate, months), " ", currentYear] })) : (jsxs("div", { className: calendarTheme.headerDropdownsStyle, children: [(resolvedHeaderMode === 'dropdown' || (resolvedHeaderMode === 'mixed' && enableMonthDropdown)) && (jsx(Select, { value: currentMonth.toString(), onChange: handleMonthChange, options: monthOptions, displayValue: currentAbbreviatedMonth, size: "sm", className: "font-medium" })), (resolvedHeaderMode === 'dropdown' || (resolvedHeaderMode === 'mixed' && enableYearDropdown)) && (jsx(Select, { value: currentYear.toString(), onChange: handleYearChange, options: yearOptions, size: "sm", className: "font-medium" }))] })), onNavigateNext !== null && (jsx(Button, { onClick: navigateToNextMonth, "aria-label": "Next month", disabled: !canNavigateToNext, iconOnly: true, variant: "ghost", color: "mono", size: "sm", children: jsx(CaretRight, { className: "size-4", weight: "bold" }) })), onNavigateNext === null && jsx("div", { className: "w-8" })] }), jsx("div", { className: calendarTheme.weekdaysStyle, children: weekdays.map((day, i) => (
|
|
450
465
|
// Index in the key: default labels (e.g. M,T,W,T,F,S,S) repeat, so `day` alone is not unique.
|
|
451
|
-
jsx("div", { className: calendarTheme.weekdayStyle, children: day }, `${day}-${i}`))) }), jsx(
|
|
466
|
+
jsx("div", { className: calendarTheme.weekdayStyle, children: day }, `${day}-${i}`))) }), jsx(motion.div, { animate: { height: gridHeight }, transition: springs.smooth, className: cn(calendarTheme.daysGridStyle, "content-start overflow-hidden py-1 -my-1"), children: calendarDays.map((day, index) => {
|
|
452
467
|
var _a;
|
|
453
468
|
const dayNumber = day.date.getDate();
|
|
454
469
|
const isInStrip = day.isRangeStart || day.isRangeEnd || day.isInRange;
|
|
@@ -483,7 +498,7 @@ const Calendar = React__default.forwardRef(({ mode = 'single', value, defaultVal
|
|
|
483
498
|
// the onFocus round-trip.
|
|
484
499
|
setFocusedIndex(index);
|
|
485
500
|
handleDateSelect(day.date);
|
|
486
|
-
}, onKeyDown: (e) => handleDayKeyDown(e, index), onFocus: () => setFocusedIndex(index), tabIndex: index === focusedIndex ? 0 : -1, disabled: day.isDisabled, className: cn(calendarTheme.dayButtonStyle, (_a = calendarTheme.dayButtonSizes) === null || _a === void 0 ? void 0 : _a[size]), "data-selected": day.isSelected, "data-range-start": day.isRangeStart, "data-range-end": day.isRangeEnd, "data-in-range": day.isInRange, "data-today": day.isToday && !day.isSelected && !day.isRangeStart && !day.isRangeEnd, "data-disabled": day.isDisabled, "data-other-month": !day.isCurrentMonth, "aria-label": `Select ${day.date.toLocaleDateString()}`, variants: shouldReduceMotion ? {} : calendarAnimations.dayButton, whileHover: shouldReduceMotion ? undefined : (!day.isDisabled ? "hover" : undefined), whileTap: shouldReduceMotion ? undefined : (!day.isDisabled ? "tap" : undefined), children: [jsx("time", { dateTime: day.date.toISOString().split("T")[0], children: dayNumber }), day.isToday && (jsx(motion.span, { className: "absolute z-10 bottom-1 left-1/2 -translate-x-1/2 w-1 h-1 bg-[var(--color-primary)] rounded-full", variants: shouldReduceMotion ? {} : calendarAnimations.todayDot, initial: shouldReduceMotion ? undefined : "initial", animate: shouldReduceMotion ? undefined : "animate" }))] }) }, day.date.toISOString()));
|
|
501
|
+
}, onKeyDown: (e) => handleDayKeyDown(e, index), onFocus: () => setFocusedIndex(index), tabIndex: index === focusedIndex ? 0 : -1, disabled: day.isDisabled, className: cn(calendarTheme.dayButtonStyle, (_a = calendarTheme.dayButtonSizes) === null || _a === void 0 ? void 0 : _a[size]), "data-selected": day.isSelected || day.isRangeStart || day.isRangeEnd, "data-range-start": day.isRangeStart, "data-range-end": day.isRangeEnd, "data-in-range": day.isInRange, "data-today": day.isToday && !day.isSelected && !day.isRangeStart && !day.isRangeEnd, "data-disabled": day.isDisabled, "data-other-month": !day.isCurrentMonth, "aria-label": `Select ${day.date.toLocaleDateString()}`, variants: shouldReduceMotion ? {} : calendarAnimations.dayButton, whileHover: shouldReduceMotion ? undefined : (!day.isDisabled ? "hover" : undefined), whileTap: shouldReduceMotion ? undefined : (!day.isDisabled ? "tap" : undefined), children: [jsx("time", { dateTime: day.date.toISOString().split("T")[0], children: dayNumber }), day.isToday && (jsx(motion.span, { className: "absolute z-10 bottom-1 left-1/2 -translate-x-1/2 w-1 h-1 bg-[var(--color-primary)] rounded-full", variants: shouldReduceMotion ? {} : calendarAnimations.todayDot, initial: shouldReduceMotion ? undefined : "initial", animate: shouldReduceMotion ? undefined : "animate" }))] }) }, day.date.toISOString()));
|
|
487
502
|
}) })] }));
|
|
488
503
|
});
|
|
489
504
|
Calendar.displayName = "Calendar";
|
|
@@ -7,47 +7,39 @@ const calendarTheme = {
|
|
|
7
7
|
headerStyle: "flex items-center justify-between mb-4",
|
|
8
8
|
titleStyle: "text-sm font-semibold text-[var(--color-text-primary)] " + "",
|
|
9
9
|
headerDropdownsStyle: "grid grid-cols-2 items-center gap-2 flex-1 justify-center mx-3",
|
|
10
|
-
navButtonStyle: "inline-flex items-center justify-center size-8 rounded-[calc(var(--radius-base)*0.75)] border-0 bg-transparent " +
|
|
11
|
-
"text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)] hover:bg-[var(--color-primary-50)] " +
|
|
12
|
-
"focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 " +
|
|
13
|
-
"transition-colors disabled:opacity-50 disabled:cursor-not-allowed " +
|
|
14
|
-
// Dark mode
|
|
15
|
-
"dark:text-[var(--color-neutral-500)] dark:hover:text-[var(--color-neutral-200)] dark:hover:bg-[var(--color-neutral-800)] " +
|
|
16
|
-
"dark:focus-visible:ring-offset-[var(--color-neutral-900)]",
|
|
17
10
|
weekdaysStyle: "grid grid-cols-7 mb-2",
|
|
18
|
-
weekdayStyle: "flex items-center justify-center h-8 text-xs font-medium text-[var(--color-text-muted)]
|
|
19
|
-
"dark:text-[var(--color-neutral-500)]",
|
|
11
|
+
weekdayStyle: "flex items-center justify-center h-8 text-xs font-medium text-[var(--color-text-muted)]",
|
|
20
12
|
daysGridStyle: "grid grid-cols-7 gap-y-0.5 gap-x-0",
|
|
21
|
-
rangeCellStyle: "bg-[var(--color-primary-50)]/
|
|
13
|
+
rangeCellStyle: "bg-[var(--color-primary-300)]/50 dark:bg-[var(--color-primary-500)]/20 " +
|
|
22
14
|
"data-[range-pos=start]:rounded-l-full " +
|
|
23
15
|
"data-[range-pos=end]:rounded-r-full " +
|
|
24
|
-
"data-[range-pos=single]:rounded-full
|
|
25
|
-
"dark:bg-[var(--color-primary-900)]/50",
|
|
16
|
+
"data-[range-pos=single]:rounded-full",
|
|
26
17
|
dayButtonStyle: "relative z-10 flex items-center justify-center rounded-full border-0 bg-transparent font-medium cursor-pointer " +
|
|
27
18
|
"transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 " +
|
|
28
19
|
// Base text color
|
|
29
|
-
"text-[var(--color-text-primary)]
|
|
20
|
+
"text-[var(--color-text-primary)] " +
|
|
30
21
|
// Hover state
|
|
31
|
-
"hover:bg-[var(--color-primary-50)] dark:hover:bg-[var(--color-
|
|
22
|
+
"hover:bg-[var(--color-primary-50)] dark:hover:bg-[var(--color-primary)]/30 " +
|
|
32
23
|
// Selected state
|
|
33
24
|
"data-[selected=true]:bg-[var(--color-primary)] data-[selected=true]:text-[var(--color-primary-contrast)] " +
|
|
34
|
-
"data-[selected=true]:hover:bg-[var(--color-primary-600)] data-[selected=true]:border-t data-[selected=true]:border-white/30 " +
|
|
25
|
+
"data-[selected=true]:hover:bg-[var(--color-primary-600)] data-[selected=true]:dark:hover:bg-[var(--color-primary)]/80 data-[selected=true]:border-t data-[selected=true]:border-white/30 " +
|
|
35
26
|
// Today indicator
|
|
36
27
|
"data-[today=true]:text-[var(--color-primary)] dark:data-[today=true]:text-[var(--color-primary-400)] " +
|
|
37
28
|
// Disabled state
|
|
38
29
|
"data-[disabled=true]:text-[var(--color-text-muted)] data-[disabled=true]:opacity-50 " +
|
|
39
30
|
"data-[disabled=true]:cursor-not-allowed data-[disabled=true]:hover:bg-transparent " +
|
|
40
|
-
"dark:data-[disabled=true]:text-[var(--color-neutral-600)] " +
|
|
41
31
|
// Other month state
|
|
42
32
|
"data-[other-month=true]:text-[var(--color-text-muted)] data-[other-month=true]:opacity-60 " +
|
|
43
|
-
|
|
44
|
-
//
|
|
45
|
-
|
|
46
|
-
|
|
33
|
+
// Range mode: endpoints (start/end) reuse the single-selected styling via
|
|
34
|
+
// data-selected (set in Calendar.tsx) — ONE source of truth for a selected
|
|
35
|
+
// day (fill, text, border, hover). In-range (between) days only override
|
|
36
|
+
// text colour for readability on the strip; their hover intentionally falls
|
|
37
|
+
// through to the base day-hover above, so a hovered day looks identical
|
|
38
|
+
// whether or not it sits inside a range.
|
|
47
39
|
"data-[in-range=true]:text-[var(--color-text-primary)] " +
|
|
48
|
-
"dark:data-[in-range=true]:text-[var(--color-
|
|
40
|
+
"dark:data-[in-range=true]:text-[var(--color-mono-200)] " +
|
|
49
41
|
// Focus offset for dark mode
|
|
50
|
-
"dark:focus-visible:ring-offset-[var(--color-
|
|
42
|
+
"dark:focus-visible:ring-offset-[var(--color-mono-900)]",
|
|
51
43
|
dayButtonSizes: {
|
|
52
44
|
sm: "size-8 text-sm",
|
|
53
45
|
md: "size-10 text-sm",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { CaretLeft, CaretRight } from '@phosphor-icons/react';
|
|
4
4
|
import { useReducedMotion, motion, AnimatePresence } from 'motion/react';
|
|
5
5
|
import React__default, { useMemo, useState, useRef, useEffect, useCallback } from 'react';
|
|
6
6
|
import { cn } from '../../../../utils/cn.js';
|
|
@@ -199,7 +199,7 @@ const CalendarMini = React__default.forwardRef(({ selectedDate, currentMonth, on
|
|
|
199
199
|
};
|
|
200
200
|
const MonthRow = enableAnimations ? motion.div : "div";
|
|
201
201
|
const DateItem = enableAnimations ? motion.button : "button";
|
|
202
|
-
return (jsxs("div", { ref: ref, className: cn(mergedTheme.baseStyle, className), role: "region", "aria-label": "Mini calendar", ...rest, children: [jsx(Button, { iconOnly: true, color: "
|
|
202
|
+
return (jsxs("div", { ref: ref, className: cn(mergedTheme.baseStyle, className), role: "region", "aria-label": "Mini calendar", ...rest, children: [jsx(Button, { iconOnly: true, color: "mono", variant: "soft", className: "!flex-shrink !flex-grow-0 !w-fit self-stretch !h-auto !min-h-0 px-0.5", onClick: handlePrevMonth, "aria-label": "Previous month", children: jsx(CaretLeft, { className: "size-5 text-[var(--color-text-primary)]" }) }), jsxs("div", { className: "flex flex-col gap-1 relative", children: [jsxs("div", { className: "flex items-center gap-1", children: [jsx("div", { className: "flex flex-col relative overflow-hidden flex-1", style: {
|
|
203
203
|
maskImage: "linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent)",
|
|
204
204
|
WebkitMaskImage: "linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent)",
|
|
205
205
|
}, children: jsx("div", { ref: monthScrollRef, className: cn(mergedTheme.monthRowStyle), role: "tablist", "aria-label": "Month selection", children: jsx(AnimatePresence, { mode: "popLayout", initial: false, custom: direction, children: jsx(MonthRow, { custom: direction, ...(enableAnimations && {
|
|
@@ -247,7 +247,7 @@ const CalendarMini = React__default.forwardRef(({ selectedDate, currentMonth, on
|
|
|
247
247
|
}), "aria-selected": isSelected, "aria-current": isToday ? "date" : undefined, "aria-disabled": disabled, type: "button", ...(enableAnimations && {
|
|
248
248
|
whileTap: !disabled ? { scale: 0.95 } : undefined,
|
|
249
249
|
}), children: [jsx("div", { className: "text-sm font-medium opacity-60", children: formatDayName(date) }), jsx("time", { dateTime: date.toISOString(), className: cn("font-semibold"), children: formatDateNumber(date) })] }, date.toISOString()));
|
|
250
|
-
}) }, `${startDate.getTime()}-dates`) }) }) })] }), jsx(Button, { iconOnly: true, color: "
|
|
250
|
+
}) }, `${startDate.getTime()}-dates`) }) }) })] }), jsx(Button, { iconOnly: true, color: "mono", variant: "soft", className: "!flex-shrink !flex-grow-0 !w-fit self-stretch !h-auto !min-h-0 px-0.5", onClick: handleNextMonth, "aria-label": "Next month", children: jsx(CaretRight, { className: "size-5 text-[var(--color-text-primary)]" }) })] }));
|
|
251
251
|
});
|
|
252
252
|
CalendarMini.displayName = "CalendarMini";
|
|
253
253
|
|
|
@@ -2,11 +2,19 @@ const cardTheme = {
|
|
|
2
2
|
// bg comes from the relative-elevation engine (surfaceClasses) at runtime so a card
|
|
3
3
|
// nested in a higher surface (e.g. a Modal) lifts; keep radius + overflow + border here.
|
|
4
4
|
baseStyle: "rounded-[var(--card-radius)] overflow-hidden border-0 border-[var(--color-border)]",
|
|
5
|
-
headerStyle: "flex flex-col
|
|
6
|
-
|
|
5
|
+
headerStyle: "flex flex-col px-[var(--card-px)] py-[var(--card-py)] items-start",
|
|
6
|
+
// text-[length:...] (not bare text-[var(...)]) is required — see TYPE ROLE
|
|
7
|
+
// SYSTEM in theme.css for why a bare var() would resolve to color instead.
|
|
8
|
+
titleStyle: "text-[length:var(--card-title-size)] font-semibold leading-none text-[var(--color-text-primary)]",
|
|
7
9
|
subtitleStyle: "text-sm text-[var(--color-text-secondary)] mt-2",
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
// Default to full py (top included). [[data-card-region]~&]:pt-0 zeroes the seam
|
|
11
|
+
// ONLY when an actual region (Header/Body) precedes this one — a general-sibling
|
|
12
|
+
// selector keyed off data-card-region, not `:first-child`. `:first-child` broke
|
|
13
|
+
// when a decorative absolutely-positioned sibling (e.g. DotPattern) sat before
|
|
14
|
+
// Body in the DOM: it still counts as a structural first child even though it
|
|
15
|
+
// takes no layout space, so Body silently lost its top padding.
|
|
16
|
+
bodyStyle: "px-[var(--card-px)] py-[var(--card-py)] [[data-card-region]~&]:pt-0",
|
|
17
|
+
footerStyle: "flex items-center px-[var(--card-px)] py-[var(--card-py)] [[data-card-region]~&]:pt-0",
|
|
10
18
|
};
|
|
11
19
|
|
|
12
20
|
export { cardTheme };
|
|
@@ -4,7 +4,7 @@ import { cn } from '../../../utils/cn.js';
|
|
|
4
4
|
import { cardTheme } from './Card.theme.js';
|
|
5
5
|
|
|
6
6
|
const CardBody = React__default.forwardRef(({ children, className, ...props }, ref) => {
|
|
7
|
-
return (jsx("div", { ref: ref, className: cn(cardTheme.bodyStyle, className), ...props, children: children }));
|
|
7
|
+
return (jsx("div", { ref: ref, "data-card-region": "", className: cn(cardTheme.bodyStyle, className), ...props, children: children }));
|
|
8
8
|
});
|
|
9
9
|
CardBody.displayName = 'Card.Body';
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ import { cn } from '../../../utils/cn.js';
|
|
|
4
4
|
import { cardTheme } from './Card.theme.js';
|
|
5
5
|
|
|
6
6
|
const CardFooter = React__default.forwardRef(({ children, className, ...props }, ref) => {
|
|
7
|
-
return (jsx("div", { ref: ref, className: cn(cardTheme.footerStyle, className), ...props, children: children }));
|
|
7
|
+
return (jsx("div", { ref: ref, "data-card-region": "", className: cn(cardTheme.footerStyle, className), ...props, children: children }));
|
|
8
8
|
});
|
|
9
9
|
CardFooter.displayName = 'CardFooter';
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ import { cn } from '../../../utils/cn.js';
|
|
|
4
4
|
import { cardTheme } from './Card.theme.js';
|
|
5
5
|
|
|
6
6
|
const CardHeader = React__default.forwardRef(({ children, className, ...props }, ref) => {
|
|
7
|
-
return (jsx("div", { ref: ref, className: cn(cardTheme.headerStyle, className), ...props, children: children }));
|
|
7
|
+
return (jsx("div", { ref: ref, "data-card-region": "", className: cn(cardTheme.headerStyle, className), ...props, children: children }));
|
|
8
8
|
});
|
|
9
9
|
CardHeader.displayName = 'CardHeader';
|
|
10
10
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { CaretRight, CaretDown } from '@phosphor-icons/react';
|
|
5
5
|
import { cn } from '../../../utils/cn.js';
|
|
6
6
|
import { useCarouselContext } from './CarouselContext.js';
|
|
7
7
|
import { carouselTheme } from './Carousel.theme.js';
|
|
@@ -9,7 +9,7 @@ import { carouselTheme } from './Carousel.theme.js';
|
|
|
9
9
|
const CarouselNext = React__default.forwardRef(({ className, icon, 'aria-label': ariaLabel, ...props }, ref) => {
|
|
10
10
|
const { scrollNext, canScrollNext, orientation } = useCarouselContext();
|
|
11
11
|
return (jsx("button", { ref: ref, type: "button", onClick: scrollNext, disabled: !canScrollNext, "aria-label": ariaLabel || 'Next slide', className: cn(carouselTheme.button, className), ...props, children: icon ||
|
|
12
|
-
(orientation === 'horizontal' ? (jsx(
|
|
12
|
+
(orientation === 'horizontal' ? (jsx(CaretRight, { className: carouselTheme.buttonIcon, "aria-hidden": "true" })) : (jsx(CaretDown, { className: carouselTheme.buttonIcon, "aria-hidden": "true" }))) }));
|
|
13
13
|
});
|
|
14
14
|
CarouselNext.displayName = 'Carousel.Next';
|
|
15
15
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { CaretLeft, CaretUp } from '@phosphor-icons/react';
|
|
5
5
|
import { cn } from '../../../utils/cn.js';
|
|
6
6
|
import { useCarouselContext } from './CarouselContext.js';
|
|
7
7
|
import { carouselTheme } from './Carousel.theme.js';
|
|
@@ -9,7 +9,7 @@ import { carouselTheme } from './Carousel.theme.js';
|
|
|
9
9
|
const CarouselPrevious = React__default.forwardRef(({ className, icon, 'aria-label': ariaLabel, ...props }, ref) => {
|
|
10
10
|
const { scrollPrev, canScrollPrev, orientation } = useCarouselContext();
|
|
11
11
|
return (jsx("button", { ref: ref, type: "button", onClick: scrollPrev, disabled: !canScrollPrev, "aria-label": ariaLabel || 'Previous slide', className: cn(carouselTheme.button, className), ...props, children: icon ||
|
|
12
|
-
(orientation === 'horizontal' ? (jsx(
|
|
12
|
+
(orientation === 'horizontal' ? (jsx(CaretLeft, { className: carouselTheme.buttonIcon, "aria-hidden": "true" })) : (jsx(CaretUp, { className: carouselTheme.buttonIcon, "aria-hidden": "true" }))) }));
|
|
13
13
|
});
|
|
14
14
|
CarouselPrevious.displayName = 'Carousel.Previous';
|
|
15
15
|
|