@leitware/composables 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 +387 -0
- package/dist/presets/brutalist.css +298 -0
- package/dist/presets/default.css +298 -0
- package/dist/presets/signal-pop.css +369 -0
- package/dist/styles.css +2 -0
- package/package.json +216 -0
- package/rules/composables.md +244 -0
- package/src/_internal/accordion.tsx +93 -0
- package/src/_internal/ai-elements/attachments.tsx +385 -0
- package/src/_internal/ai-elements/chain-of-thought.tsx +197 -0
- package/src/_internal/ai-elements/code-block.tsx +516 -0
- package/src/_internal/ai-elements/confirmation.tsx +150 -0
- package/src/_internal/ai-elements/conversation.tsx +148 -0
- package/src/_internal/ai-elements/inline-citation.tsx +248 -0
- package/src/_internal/ai-elements/message.tsx +292 -0
- package/src/_internal/ai-elements/plan.tsx +126 -0
- package/src/_internal/ai-elements/prompt-input.tsx +1285 -0
- package/src/_internal/ai-elements/reasoning.tsx +208 -0
- package/src/_internal/ai-elements/shimmer.tsx +72 -0
- package/src/_internal/ai-elements/sources.tsx +53 -0
- package/src/_internal/ai-elements/suggestion.tsx +48 -0
- package/src/_internal/ai-elements/task.tsx +64 -0
- package/src/_internal/ai-elements/tool.tsx +156 -0
- package/src/_internal/alert-dialog.tsx +159 -0
- package/src/_internal/alert.tsx +88 -0
- package/src/_internal/aspect-ratio.tsx +23 -0
- package/src/_internal/avatar.tsx +58 -0
- package/src/_internal/badge.tsx +60 -0
- package/src/_internal/breadcrumb.tsx +104 -0
- package/src/_internal/bubble.tsx +125 -0
- package/src/_internal/button-group.tsx +78 -0
- package/src/_internal/button.tsx +62 -0
- package/src/_internal/calendar.tsx +179 -0
- package/src/_internal/card.tsx +83 -0
- package/src/_internal/carousel.tsx +215 -0
- package/src/_internal/checkbox.tsx +26 -0
- package/src/_internal/code-block.tsx +53 -0
- package/src/_internal/collapsible.tsx +15 -0
- package/src/_internal/combobox.tsx +264 -0
- package/src/_internal/command.tsx +155 -0
- package/src/_internal/container.tsx +35 -0
- package/src/_internal/dialog.tsx +132 -0
- package/src/_internal/direction.tsx +12 -0
- package/src/_internal/divider.tsx +162 -0
- package/src/_internal/dropdown-menu.tsx +247 -0
- package/src/_internal/dropzone.tsx +481 -0
- package/src/_internal/empty.tsx +94 -0
- package/src/_internal/field.tsx +221 -0
- package/src/_internal/grid-overlay.tsx +48 -0
- package/src/_internal/grid.tsx +109 -0
- package/src/_internal/hover-card.tsx +47 -0
- package/src/_internal/icon.tsx +45 -0
- package/src/_internal/input-group.tsx +146 -0
- package/src/_internal/input.tsx +24 -0
- package/src/_internal/item.tsx +187 -0
- package/src/_internal/kbd.tsx +28 -0
- package/src/_internal/label.tsx +18 -0
- package/src/_internal/layout-bento.tsx +386 -0
- package/src/_internal/layout.tsx +174 -0
- package/src/_internal/marker.tsx +66 -0
- package/src/_internal/message.tsx +85 -0
- package/src/_internal/native-select.tsx +50 -0
- package/src/_internal/pagination.tsx +108 -0
- package/src/_internal/popover.tsx +83 -0
- package/src/_internal/progress.tsx +59 -0
- package/src/_internal/radio-group.tsx +36 -0
- package/src/_internal/resizable.tsx +44 -0
- package/src/_internal/scroll-area.tsx +48 -0
- package/src/_internal/select.tsx +187 -0
- package/src/_internal/separator.tsx +19 -0
- package/src/_internal/sheet.tsx +122 -0
- package/src/_internal/sidebar.tsx +687 -0
- package/src/_internal/skeleton.tsx +13 -0
- package/src/_internal/slider.tsx +60 -0
- package/src/_internal/sonner.tsx +51 -0
- package/src/_internal/spacer.tsx +42 -0
- package/src/_internal/spinner.tsx +16 -0
- package/src/_internal/stack.tsx +78 -0
- package/src/_internal/switch.tsx +31 -0
- package/src/_internal/table.tsx +84 -0
- package/src/_internal/tabs.tsx +74 -0
- package/src/_internal/textarea.tsx +19 -0
- package/src/_internal/toggle-group.tsx +99 -0
- package/src/_internal/toggle.tsx +42 -0
- package/src/_internal/tooltip.tsx +55 -0
- package/src/_internal/typography.tsx +129 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/hooks/use-numeric-input.ts +119 -0
- package/src/index.ts +443 -0
- package/src/lib/numeric-input.ts +88 -0
- package/src/lib/utils.ts +39 -0
- package/src/opinionated/accordion.tsx +92 -0
- package/src/opinionated/ai/attachments.tsx +27 -0
- package/src/opinionated/ai/chain-of-thought.tsx +16 -0
- package/src/opinionated/ai/code-block.tsx +22 -0
- package/src/opinionated/ai/confirmation.tsx +16 -0
- package/src/opinionated/ai/conversation.tsx +13 -0
- package/src/opinionated/ai/index.ts +15 -0
- package/src/opinionated/ai/inline-citation.tsx +30 -0
- package/src/opinionated/ai/message.tsx +26 -0
- package/src/opinionated/ai/plan.tsx +18 -0
- package/src/opinionated/ai/prompt-input.tsx +29 -0
- package/src/opinionated/ai/reasoning.tsx +9 -0
- package/src/opinionated/ai/shimmer.tsx +4 -0
- package/src/opinionated/ai/sources.tsx +10 -0
- package/src/opinionated/ai/suggestion.tsx +6 -0
- package/src/opinionated/ai/task.tsx +12 -0
- package/src/opinionated/ai/tool.tsx +14 -0
- package/src/opinionated/alert-dialog.tsx +143 -0
- package/src/opinionated/alert.tsx +99 -0
- package/src/opinionated/aspect-ratio.tsx +12 -0
- package/src/opinionated/avatar.tsx +59 -0
- package/src/opinionated/badge.tsx +33 -0
- package/src/opinionated/breadcrumb.tsx +99 -0
- package/src/opinionated/bubble.tsx +9 -0
- package/src/opinionated/button.tsx +59 -0
- package/src/opinionated/calendar.tsx +20 -0
- package/src/opinionated/card.tsx +83 -0
- package/src/opinionated/carousel.tsx +99 -0
- package/src/opinionated/checkbox.tsx +11 -0
- package/src/opinionated/code-block.tsx +12 -0
- package/src/opinionated/collapsible.tsx +123 -0
- package/src/opinionated/combobox.tsx +123 -0
- package/src/opinionated/container.tsx +12 -0
- package/src/opinionated/dialog.tsx +124 -0
- package/src/opinionated/direction.tsx +6 -0
- package/src/opinionated/divider.tsx +13 -0
- package/src/opinionated/dropdown-menu.tsx +131 -0
- package/src/opinionated/dropzone.tsx +39 -0
- package/src/opinionated/empty.tsx +191 -0
- package/src/opinionated/field.tsx +26 -0
- package/src/opinionated/form-calendar-popover.tsx +138 -0
- package/src/opinionated/form-checkbox.tsx +107 -0
- package/src/opinionated/form-combobox.tsx +181 -0
- package/src/opinionated/form-date-of-birth.tsx +193 -0
- package/src/opinionated/form-dropzone.tsx +126 -0
- package/src/opinionated/form-input-group.tsx +184 -0
- package/src/opinionated/form-input.tsx +118 -0
- package/src/opinionated/form-multi-combobox.tsx +213 -0
- package/src/opinionated/form-multi-dropzone.tsx +141 -0
- package/src/opinionated/form-radiogroup.tsx +116 -0
- package/src/opinionated/form-select.tsx +176 -0
- package/src/opinionated/form-slider.tsx +100 -0
- package/src/opinionated/form-switch.tsx +117 -0
- package/src/opinionated/form-textarea.tsx +79 -0
- package/src/opinionated/grid-overlay.tsx +11 -0
- package/src/opinionated/grid.tsx +14 -0
- package/src/opinionated/hover-card.tsx +59 -0
- package/src/opinionated/icon.tsx +14 -0
- package/src/opinionated/input-group.tsx +20 -0
- package/src/opinionated/input.tsx +11 -0
- package/src/opinionated/item.tsx +182 -0
- package/src/opinionated/kbd.tsx +16 -0
- package/src/opinionated/label.tsx +11 -0
- package/src/opinionated/layout-bento.tsx +29 -0
- package/src/opinionated/layout.tsx +26 -0
- package/src/opinionated/list.tsx +94 -0
- package/src/opinionated/marker.tsx +7 -0
- package/src/opinionated/message.tsx +8 -0
- package/src/opinionated/native-select.tsx +51 -0
- package/src/opinionated/pagination.tsx +204 -0
- package/src/opinionated/popover.tsx +68 -0
- package/src/opinionated/progress.tsx +48 -0
- package/src/opinionated/radio-group.tsx +13 -0
- package/src/opinionated/resizable.tsx +2 -0
- package/src/opinionated/scroll-area.tsx +82 -0
- package/src/opinionated/select.tsx +101 -0
- package/src/opinionated/separator.tsx +11 -0
- package/src/opinionated/sheet.tsx +120 -0
- package/src/opinionated/sidebar.tsx +68 -0
- package/src/opinionated/skeleton.tsx +246 -0
- package/src/opinionated/slider.tsx +11 -0
- package/src/opinionated/sonner.tsx +15 -0
- package/src/opinionated/spacer.tsx +11 -0
- package/src/opinionated/stack.tsx +18 -0
- package/src/opinionated/switch.tsx +11 -0
- package/src/opinionated/table.tsx +11 -0
- package/src/opinionated/tabs.tsx +68 -0
- package/src/opinionated/textarea.tsx +11 -0
- package/src/opinionated/theme-injector.tsx +31 -0
- package/src/opinionated/toggle-group.tsx +63 -0
- package/src/opinionated/toggle.tsx +75 -0
- package/src/opinionated/token-config-panel/color-editor.tsx +85 -0
- package/src/opinionated/token-config-panel/helpers.ts +31 -0
- package/src/opinionated/token-config-panel/index.tsx +398 -0
- package/src/opinionated/token-config-panel/json-import-export.tsx +89 -0
- package/src/opinionated/token-config-panel/preset-manager.ts +31 -0
- package/src/opinionated/token-config-panel/presets-data.ts +23 -0
- package/src/opinionated/token-config-panel/spacing-editor.tsx +325 -0
- package/src/opinionated/token-config-panel/types.ts +39 -0
- package/src/opinionated/token-config-panel/typography-editor.tsx +145 -0
- package/src/opinionated/tooltip.tsx +62 -0
- package/src/opinionated/typography.tsx +7 -0
- package/src/scripts/lint-no-arbitrary.ts +155 -0
- package/src/styles/composable.css +68 -0
- package/src/styles/presets/brutalist.css +298 -0
- package/src/styles/presets/default.css +298 -0
- package/src/styles/presets/signal-pop.css +369 -0
- package/src/styles/presets-data/brutalist.ts +325 -0
- package/src/styles/presets-data/default.ts +315 -0
- package/src/styles/presets-data/index.ts +45 -0
- package/src/styles/presets-data/signal-pop.ts +393 -0
- package/src/styles/tokens/base.css +71 -0
- package/src/styles/tokens/components.css +150 -0
- package/src/styles/tokens/palette.css +795 -0
- package/src/styles/tokens/registry.ts +324 -0
- package/src/styles/tokens/semantic.css +266 -0
- package/src/styles/tokens/tailwind-theme.css +247 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Button as ButtonPrimitive } from '@base-ui/react/button'
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
3
|
+
import { cn, FOCUS_RING, FOCUS_RING_DESTRUCTIVE, HOVER_RING } from '../lib/utils'
|
|
4
|
+
|
|
5
|
+
const buttonVariants = cva(
|
|
6
|
+
`${FOCUS_RING} ${HOVER_RING} rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-[opacity,box-shadow,transform] active:scale-[var(--active-scale)] disabled:pointer-events-none disabled:opacity-disabled [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none`,
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: 'bg-primary text-primary-foreground',
|
|
11
|
+
outline:
|
|
12
|
+
'border-stroke hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground',
|
|
13
|
+
secondary:
|
|
14
|
+
'bg-secondary text-secondary-foreground aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
|
|
15
|
+
ghost: 'hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground',
|
|
16
|
+
destructive: `bg-surface-critical ${FOCUS_RING_DESTRUCTIVE} text-danger border-stroke-critical`,
|
|
17
|
+
success: 'bg-surface-success text-success border-stroke-success',
|
|
18
|
+
warning: 'bg-surface-warning text-warning border-stroke-warning',
|
|
19
|
+
info: 'bg-surface-info text-info border-stroke-info',
|
|
20
|
+
brand: 'bg-surface-brand text-brand border-stroke-brand',
|
|
21
|
+
'brand-2': 'bg-surface-brand-2 text-brand-2 border-stroke-brand-2',
|
|
22
|
+
'brand-3': 'bg-surface-brand-3 text-brand-3 border-stroke-brand-3',
|
|
23
|
+
'brand-4': 'bg-surface-brand-4 text-brand-4 border-stroke-brand-4',
|
|
24
|
+
'brand-5': 'bg-surface-brand-5 text-brand-5 border-stroke-brand-5',
|
|
25
|
+
emphasis: 'bg-surface-emphasis text-emphasis border-stroke-emphasis',
|
|
26
|
+
link: 'text-primary underline-offset-4 hover:underline hover:ring-0',
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
default:
|
|
30
|
+
"h-7 gap-1 px-3 text-xs/relaxed has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
31
|
+
xs: "h-5 gap-1 rounded-sm px-2.5 text-2xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-2.5",
|
|
32
|
+
sm: "h-6 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
|
|
33
|
+
lg: "h-8 gap-1 px-3.5 text-xs/relaxed has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg:not([class*='size-'])]:size-4",
|
|
34
|
+
icon: "size-7 [&_svg:not([class*='size-'])]:size-3.5",
|
|
35
|
+
'icon-xs': "size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5",
|
|
36
|
+
'icon-sm': "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
37
|
+
'icon-lg': "size-8 [&_svg:not([class*='size-'])]:size-4",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
variant: 'default',
|
|
42
|
+
size: 'default',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
function Button({
|
|
48
|
+
className,
|
|
49
|
+
variant = 'default',
|
|
50
|
+
size = 'default',
|
|
51
|
+
...props
|
|
52
|
+
}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
|
|
53
|
+
return (
|
|
54
|
+
<ButtonPrimitive
|
|
55
|
+
data-slot="button"
|
|
56
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
57
|
+
{...props}
|
|
58
|
+
/>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { Button, buttonVariants }
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react'
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import { type DayButton, DayPicker, getDefaultClassNames } from 'react-day-picker'
|
|
4
|
+
import { Button, buttonVariants } from './button'
|
|
5
|
+
import { cn } from '../lib/utils'
|
|
6
|
+
|
|
7
|
+
function Calendar({
|
|
8
|
+
className,
|
|
9
|
+
classNames,
|
|
10
|
+
showOutsideDays = true,
|
|
11
|
+
captionLayout = 'label',
|
|
12
|
+
buttonVariant = 'ghost',
|
|
13
|
+
formatters,
|
|
14
|
+
components,
|
|
15
|
+
...props
|
|
16
|
+
}: React.ComponentProps<typeof DayPicker> & {
|
|
17
|
+
buttonVariant?: React.ComponentProps<typeof Button>['variant']
|
|
18
|
+
}) {
|
|
19
|
+
const defaultClassNames = getDefaultClassNames()
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<DayPicker
|
|
23
|
+
showOutsideDays={showOutsideDays}
|
|
24
|
+
className={cn(
|
|
25
|
+
'p-3 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(8)] bg-page rounded-lg border shadow-sm group/calendar [[data-slot=card-content]_&]:bg-transparent [[data-slot=card-content]_&]:border-0 [[data-slot=card-content]_&]:shadow-none [[data-slot=popover-content]_&]:bg-transparent [[data-slot=popover-content]_&]:border-0 [[data-slot=popover-content]_&]:shadow-none [[data-slot=popover-content]_&]:[--cell-size:--spacing(6)]',
|
|
26
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
27
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
28
|
+
className,
|
|
29
|
+
)}
|
|
30
|
+
captionLayout={captionLayout}
|
|
31
|
+
formatters={{
|
|
32
|
+
formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),
|
|
33
|
+
...formatters,
|
|
34
|
+
}}
|
|
35
|
+
classNames={{
|
|
36
|
+
root: cn('w-fit', defaultClassNames.root),
|
|
37
|
+
months: cn('flex gap-4 flex-col md:flex-row relative', defaultClassNames.months),
|
|
38
|
+
month: cn('flex flex-col w-full gap-2', defaultClassNames.month),
|
|
39
|
+
nav: cn(
|
|
40
|
+
'flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between',
|
|
41
|
+
defaultClassNames.nav,
|
|
42
|
+
),
|
|
43
|
+
button_previous: cn(
|
|
44
|
+
buttonVariants({ variant: buttonVariant }),
|
|
45
|
+
'size-(--cell-size) aria-disabled:opacity-disabled p-0 select-none',
|
|
46
|
+
defaultClassNames.button_previous,
|
|
47
|
+
),
|
|
48
|
+
button_next: cn(
|
|
49
|
+
buttonVariants({ variant: buttonVariant }),
|
|
50
|
+
'size-(--cell-size) aria-disabled:opacity-disabled p-0 select-none',
|
|
51
|
+
defaultClassNames.button_next,
|
|
52
|
+
),
|
|
53
|
+
month_caption: cn(
|
|
54
|
+
'flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)',
|
|
55
|
+
defaultClassNames.month_caption,
|
|
56
|
+
),
|
|
57
|
+
dropdowns: cn(
|
|
58
|
+
'w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5',
|
|
59
|
+
defaultClassNames.dropdowns,
|
|
60
|
+
),
|
|
61
|
+
dropdown_root: cn(
|
|
62
|
+
'relative cn-calendar-dropdown-root rounded-(--cell-radius)',
|
|
63
|
+
defaultClassNames.dropdown_root,
|
|
64
|
+
),
|
|
65
|
+
dropdown: cn('absolute bg-popover inset-0 opacity-0', defaultClassNames.dropdown),
|
|
66
|
+
caption_label: cn(
|
|
67
|
+
'select-none font-medium',
|
|
68
|
+
captionLayout === 'label'
|
|
69
|
+
? 'text-sm'
|
|
70
|
+
: 'cn-calendar-caption-label rounded-(--cell-radius) flex items-center gap-1 text-sm [&>svg]:text-muted-foreground [&>svg]:size-3.5',
|
|
71
|
+
defaultClassNames.caption_label,
|
|
72
|
+
),
|
|
73
|
+
month_grid: 'w-full border-collapse',
|
|
74
|
+
weekdays: cn('flex', defaultClassNames.weekdays),
|
|
75
|
+
weekday: cn(
|
|
76
|
+
'text-muted-foreground rounded-(--cell-radius) flex-1 font-medium text-xs select-none size-(--cell-size) flex items-center justify-center',
|
|
77
|
+
defaultClassNames.weekday,
|
|
78
|
+
),
|
|
79
|
+
week: cn('flex w-full mt-1', defaultClassNames.week),
|
|
80
|
+
week_number_header: cn('select-none w-(--cell-size)', defaultClassNames.week_number_header),
|
|
81
|
+
week_number: cn('text-xs select-none text-muted-foreground', defaultClassNames.week_number),
|
|
82
|
+
day: cn(
|
|
83
|
+
'relative w-full rounded-(--cell-radius) h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius) group/day aspect-square select-none',
|
|
84
|
+
props.showWeekNumber
|
|
85
|
+
? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)'
|
|
86
|
+
: '[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)',
|
|
87
|
+
defaultClassNames.day,
|
|
88
|
+
),
|
|
89
|
+
range_start: cn(
|
|
90
|
+
'rounded-l-(--cell-radius) bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:right-0 -z-0 isolate',
|
|
91
|
+
defaultClassNames.range_start,
|
|
92
|
+
),
|
|
93
|
+
range_middle: cn('rounded-none', defaultClassNames.range_middle),
|
|
94
|
+
range_end: cn(
|
|
95
|
+
'rounded-r-(--cell-radius) bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:left-0 -z-0 isolate',
|
|
96
|
+
defaultClassNames.range_end,
|
|
97
|
+
),
|
|
98
|
+
today: cn(
|
|
99
|
+
'bg-muted text-foreground rounded-(--cell-radius) data-[selected=true]:rounded-none',
|
|
100
|
+
defaultClassNames.today,
|
|
101
|
+
),
|
|
102
|
+
outside: cn(
|
|
103
|
+
'text-muted-foreground aria-selected:text-muted-foreground',
|
|
104
|
+
defaultClassNames.outside,
|
|
105
|
+
),
|
|
106
|
+
disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),
|
|
107
|
+
hidden: cn('invisible', defaultClassNames.hidden),
|
|
108
|
+
...classNames,
|
|
109
|
+
}}
|
|
110
|
+
components={{
|
|
111
|
+
Root: ({ className, rootRef, ...props }) => {
|
|
112
|
+
return <div data-slot="calendar" ref={rootRef} className={cn(className)} {...props} />
|
|
113
|
+
},
|
|
114
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
115
|
+
if (orientation === 'left') {
|
|
116
|
+
return <ChevronLeftIcon className={cn('size-4', className)} {...props} />
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (orientation === 'right') {
|
|
120
|
+
return <ChevronRightIcon className={cn('size-4', className)} {...props} />
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return <ChevronDownIcon className={cn('size-4', className)} {...props} />
|
|
124
|
+
},
|
|
125
|
+
DayButton: CalendarDayButton,
|
|
126
|
+
WeekNumber: ({ children, ...props }) => {
|
|
127
|
+
return (
|
|
128
|
+
<td {...props}>
|
|
129
|
+
<div className="flex size-(--cell-size) items-center justify-center text-center">
|
|
130
|
+
{children}
|
|
131
|
+
</div>
|
|
132
|
+
</td>
|
|
133
|
+
)
|
|
134
|
+
},
|
|
135
|
+
...components,
|
|
136
|
+
}}
|
|
137
|
+
{...props}
|
|
138
|
+
/>
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function CalendarDayButton({
|
|
143
|
+
className,
|
|
144
|
+
day,
|
|
145
|
+
modifiers,
|
|
146
|
+
...props
|
|
147
|
+
}: React.ComponentProps<typeof DayButton>) {
|
|
148
|
+
const defaultClassNames = getDefaultClassNames()
|
|
149
|
+
|
|
150
|
+
const ref = React.useRef<HTMLButtonElement>(null)
|
|
151
|
+
React.useEffect(() => {
|
|
152
|
+
if (modifiers.focused) ref.current?.focus()
|
|
153
|
+
}, [modifiers.focused])
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<Button
|
|
157
|
+
variant="ghost"
|
|
158
|
+
size="icon"
|
|
159
|
+
data-day={day.date.toLocaleDateString()}
|
|
160
|
+
data-selected-single={
|
|
161
|
+
modifiers.selected &&
|
|
162
|
+
!modifiers.range_start &&
|
|
163
|
+
!modifiers.range_end &&
|
|
164
|
+
!modifiers.range_middle
|
|
165
|
+
}
|
|
166
|
+
data-range-start={modifiers.range_start}
|
|
167
|
+
data-range-end={modifiers.range_end}
|
|
168
|
+
data-range-middle={modifiers.range_middle}
|
|
169
|
+
className={cn(
|
|
170
|
+
'data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[selected-single=true]:hover:bg-primary/90 data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[color:var(--focus-ring-color)]/50 dark:hover:text-foreground relative isolate z-10 flex aspect-square size-(--cell-size) w-full flex-col gap-1 rounded-(--cell-radius) border-0 text-xs leading-none font-normal transition-colors group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[length:var(--focus-ring-width)] data-[range-end=true]:rounded-r-(--cell-radius) data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-l-(--cell-radius) [&>span]:text-xs [&>span]:opacity-70',
|
|
171
|
+
defaultClassNames.day,
|
|
172
|
+
className,
|
|
173
|
+
)}
|
|
174
|
+
{...props}
|
|
175
|
+
/>
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export { Calendar, CalendarDayButton }
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type * as React from 'react'
|
|
2
|
+
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
|
|
5
|
+
function Card({
|
|
6
|
+
className,
|
|
7
|
+
size = 'default',
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<'div'> & { size?: 'default' | 'sm' }) {
|
|
10
|
+
return (
|
|
11
|
+
<div
|
|
12
|
+
data-slot="card"
|
|
13
|
+
data-size={size}
|
|
14
|
+
className={cn(
|
|
15
|
+
'border border-stroke bg-card text-card-foreground gap-4 overflow-hidden rounded-lg py-4 text-xs/relaxed has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg group/card flex flex-col',
|
|
16
|
+
className,
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
24
|
+
return (
|
|
25
|
+
<div
|
|
26
|
+
data-slot="card-header"
|
|
27
|
+
className={cn(
|
|
28
|
+
'gap-1 rounded-t-lg px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]',
|
|
29
|
+
className,
|
|
30
|
+
)}
|
|
31
|
+
{...props}
|
|
32
|
+
/>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function CardTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
37
|
+
return <div data-slot="card-title" className={cn('text-sm font-medium', className)} {...props} />
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function CardDescription({ className, ...props }: React.ComponentProps<'div'>) {
|
|
41
|
+
return (
|
|
42
|
+
<div
|
|
43
|
+
data-slot="card-description"
|
|
44
|
+
className={cn('text-muted-foreground text-xs/relaxed', className)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function CardAction({ className, ...props }: React.ComponentProps<'div'>) {
|
|
51
|
+
return (
|
|
52
|
+
<div
|
|
53
|
+
data-slot="card-action"
|
|
54
|
+
className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function CardContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
61
|
+
return (
|
|
62
|
+
<div
|
|
63
|
+
data-slot="card-content"
|
|
64
|
+
className={cn('px-4 group-data-[size=sm]/card:px-3', className)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
71
|
+
return (
|
|
72
|
+
<div
|
|
73
|
+
data-slot="card-footer"
|
|
74
|
+
className={cn(
|
|
75
|
+
'rounded-b-lg px-4 group-data-[size=sm]/card:px-3 [.border-t]:pt-4 group-data-[size=sm]/card:[.border-t]:pt-3 flex items-center',
|
|
76
|
+
className,
|
|
77
|
+
)}
|
|
78
|
+
{...props}
|
|
79
|
+
/>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent }
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react'
|
|
2
|
+
import { ArrowLeftIcon, ArrowRightIcon } from 'lucide-react'
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
|
|
5
|
+
import { Button } from './button'
|
|
6
|
+
import { cn } from '../lib/utils'
|
|
7
|
+
|
|
8
|
+
type CarouselApi = UseEmblaCarouselType[1]
|
|
9
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
|
|
10
|
+
type CarouselOptions = UseCarouselParameters[0]
|
|
11
|
+
type CarouselPlugin = UseCarouselParameters[1]
|
|
12
|
+
|
|
13
|
+
type CarouselProps = {
|
|
14
|
+
opts?: CarouselOptions
|
|
15
|
+
plugins?: CarouselPlugin
|
|
16
|
+
orientation?: 'horizontal' | 'vertical'
|
|
17
|
+
setApi?: (api: CarouselApi) => void
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type CarouselContextProps = {
|
|
21
|
+
carouselRef: ReturnType<typeof useEmblaCarousel>[0]
|
|
22
|
+
api: ReturnType<typeof useEmblaCarousel>[1]
|
|
23
|
+
scrollPrev: () => void
|
|
24
|
+
scrollNext: () => void
|
|
25
|
+
canScrollPrev: boolean
|
|
26
|
+
canScrollNext: boolean
|
|
27
|
+
} & CarouselProps
|
|
28
|
+
|
|
29
|
+
const CarouselContext = React.createContext<CarouselContextProps | null>(null)
|
|
30
|
+
|
|
31
|
+
function useCarousel() {
|
|
32
|
+
const context = React.useContext(CarouselContext)
|
|
33
|
+
if (!context) {
|
|
34
|
+
throw new Error('useCarousel must be used within a <Carousel />')
|
|
35
|
+
}
|
|
36
|
+
return context
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function Carousel({
|
|
40
|
+
orientation = 'horizontal',
|
|
41
|
+
opts,
|
|
42
|
+
setApi,
|
|
43
|
+
plugins,
|
|
44
|
+
className,
|
|
45
|
+
children,
|
|
46
|
+
...props
|
|
47
|
+
}: React.ComponentProps<'div'> & CarouselProps) {
|
|
48
|
+
const [carouselRef, api] = useEmblaCarousel(
|
|
49
|
+
{
|
|
50
|
+
...opts,
|
|
51
|
+
axis: orientation === 'horizontal' ? 'x' : 'y',
|
|
52
|
+
},
|
|
53
|
+
plugins,
|
|
54
|
+
)
|
|
55
|
+
const [canScrollPrev, setCanScrollPrev] = React.useState(false)
|
|
56
|
+
const [canScrollNext, setCanScrollNext] = React.useState(false)
|
|
57
|
+
|
|
58
|
+
const onSelect = React.useCallback((api: CarouselApi) => {
|
|
59
|
+
if (!api) return
|
|
60
|
+
setCanScrollPrev(api.canScrollPrev())
|
|
61
|
+
setCanScrollNext(api.canScrollNext())
|
|
62
|
+
}, [])
|
|
63
|
+
|
|
64
|
+
const scrollPrev = React.useCallback(() => {
|
|
65
|
+
api?.scrollPrev()
|
|
66
|
+
}, [api])
|
|
67
|
+
|
|
68
|
+
const scrollNext = React.useCallback(() => {
|
|
69
|
+
api?.scrollNext()
|
|
70
|
+
}, [api])
|
|
71
|
+
|
|
72
|
+
const handleKeyDown = React.useCallback(
|
|
73
|
+
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
74
|
+
if (event.key === 'ArrowLeft') {
|
|
75
|
+
event.preventDefault()
|
|
76
|
+
scrollPrev()
|
|
77
|
+
} else if (event.key === 'ArrowRight') {
|
|
78
|
+
event.preventDefault()
|
|
79
|
+
scrollNext()
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
[scrollPrev, scrollNext],
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
React.useEffect(() => {
|
|
86
|
+
if (!api || !setApi) return
|
|
87
|
+
setApi(api)
|
|
88
|
+
}, [api, setApi])
|
|
89
|
+
|
|
90
|
+
React.useEffect(() => {
|
|
91
|
+
if (!api) return
|
|
92
|
+
onSelect(api)
|
|
93
|
+
api.on('reInit', onSelect)
|
|
94
|
+
api.on('select', onSelect)
|
|
95
|
+
return () => {
|
|
96
|
+
api?.off('select', onSelect)
|
|
97
|
+
}
|
|
98
|
+
}, [api, onSelect])
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<CarouselContext.Provider
|
|
102
|
+
value={{
|
|
103
|
+
carouselRef,
|
|
104
|
+
api,
|
|
105
|
+
opts,
|
|
106
|
+
orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),
|
|
107
|
+
scrollPrev,
|
|
108
|
+
scrollNext,
|
|
109
|
+
canScrollPrev,
|
|
110
|
+
canScrollNext,
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
<div
|
|
114
|
+
data-slot="carousel"
|
|
115
|
+
onKeyDownCapture={handleKeyDown}
|
|
116
|
+
className={cn('relative', className)}
|
|
117
|
+
role="region"
|
|
118
|
+
aria-roledescription="carousel"
|
|
119
|
+
{...props}
|
|
120
|
+
>
|
|
121
|
+
{children}
|
|
122
|
+
</div>
|
|
123
|
+
</CarouselContext.Provider>
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
128
|
+
const { carouselRef, orientation } = useCarousel()
|
|
129
|
+
return (
|
|
130
|
+
<div ref={carouselRef} className="-m-2 overflow-hidden p-2">
|
|
131
|
+
<div
|
|
132
|
+
data-slot="carousel-content"
|
|
133
|
+
className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)}
|
|
134
|
+
{...props}
|
|
135
|
+
/>
|
|
136
|
+
</div>
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function CarouselItem({ className, ...props }: React.ComponentProps<'div'>) {
|
|
141
|
+
const { orientation } = useCarousel()
|
|
142
|
+
return (
|
|
143
|
+
<div
|
|
144
|
+
data-slot="carousel-item"
|
|
145
|
+
role="group"
|
|
146
|
+
aria-roledescription="slide"
|
|
147
|
+
className={cn(
|
|
148
|
+
'min-w-0 shrink-0 grow-0 basis-full',
|
|
149
|
+
orientation === 'horizontal' ? 'pl-4' : 'pt-4',
|
|
150
|
+
className,
|
|
151
|
+
)}
|
|
152
|
+
{...props}
|
|
153
|
+
/>
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function CarouselPrevious({
|
|
158
|
+
className,
|
|
159
|
+
variant = 'outline',
|
|
160
|
+
size = 'icon',
|
|
161
|
+
...props
|
|
162
|
+
}: React.ComponentProps<typeof Button>) {
|
|
163
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel()
|
|
164
|
+
return (
|
|
165
|
+
<Button
|
|
166
|
+
data-slot="carousel-previous"
|
|
167
|
+
variant={variant}
|
|
168
|
+
size={size}
|
|
169
|
+
className={cn(
|
|
170
|
+
'absolute rounded-full',
|
|
171
|
+
orientation === 'horizontal'
|
|
172
|
+
? '-left-10 top-1/2 -translate-y-1/2'
|
|
173
|
+
: '-top-10 left-1/2 -translate-x-1/2 rotate-90',
|
|
174
|
+
className,
|
|
175
|
+
)}
|
|
176
|
+
disabled={!canScrollPrev}
|
|
177
|
+
onClick={scrollPrev}
|
|
178
|
+
{...props}
|
|
179
|
+
>
|
|
180
|
+
<ArrowLeftIcon />
|
|
181
|
+
<span className="sr-only">Previous slide</span>
|
|
182
|
+
</Button>
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function CarouselNext({
|
|
187
|
+
className,
|
|
188
|
+
variant = 'outline',
|
|
189
|
+
size = 'icon',
|
|
190
|
+
...props
|
|
191
|
+
}: React.ComponentProps<typeof Button>) {
|
|
192
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel()
|
|
193
|
+
return (
|
|
194
|
+
<Button
|
|
195
|
+
data-slot="carousel-next"
|
|
196
|
+
variant={variant}
|
|
197
|
+
size={size}
|
|
198
|
+
className={cn(
|
|
199
|
+
'absolute rounded-full',
|
|
200
|
+
orientation === 'horizontal'
|
|
201
|
+
? '-right-10 top-1/2 -translate-y-1/2'
|
|
202
|
+
: '-bottom-10 left-1/2 -translate-x-1/2 rotate-90',
|
|
203
|
+
className,
|
|
204
|
+
)}
|
|
205
|
+
disabled={!canScrollNext}
|
|
206
|
+
onClick={scrollNext}
|
|
207
|
+
{...props}
|
|
208
|
+
>
|
|
209
|
+
<ArrowRightIcon />
|
|
210
|
+
<span className="sr-only">Next slide</span>
|
|
211
|
+
</Button>
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext }
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox'
|
|
2
|
+
import { CheckIcon } from 'lucide-react'
|
|
3
|
+
import { cn, FOCUS_RING } from '../lib/utils'
|
|
4
|
+
|
|
5
|
+
function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
|
|
6
|
+
return (
|
|
7
|
+
<CheckboxPrimitive.Root
|
|
8
|
+
data-slot="checkbox"
|
|
9
|
+
className={cn(
|
|
10
|
+
FOCUS_RING,
|
|
11
|
+
'border-field dark:bg-field/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary hover:border-foreground/50 flex size-4 items-center justify-center rounded-sm border transition-shadow group-has-disabled/field:opacity-disabled peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-disabled',
|
|
12
|
+
className,
|
|
13
|
+
)}
|
|
14
|
+
{...props}
|
|
15
|
+
>
|
|
16
|
+
<CheckboxPrimitive.Indicator
|
|
17
|
+
data-slot="checkbox-indicator"
|
|
18
|
+
className="[&>svg]:size-3.5 grid place-content-center text-current transition-none"
|
|
19
|
+
>
|
|
20
|
+
<CheckIcon />
|
|
21
|
+
</CheckboxPrimitive.Indicator>
|
|
22
|
+
</CheckboxPrimitive.Root>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { Checkbox }
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CodeBlock
|
|
3
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
4
|
+
* Monospace code display with line numbers and overflow scrolling.
|
|
5
|
+
* Uses composables semantic tokens (bg-muted / bg-page) rather than
|
|
6
|
+
* raw CSS variable references.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* <CodeBlock>{`const x = 1\nconsole.log(x)`}</CodeBlock>
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import * as React from 'react'
|
|
13
|
+
import { cn, FOCUS_RING, leftPad } from '../lib/utils'
|
|
14
|
+
|
|
15
|
+
export interface CodeBlockProps extends Omit<React.HTMLAttributes<HTMLPreElement>, 'children'> {
|
|
16
|
+
children: string | number
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const CodeBlock = React.forwardRef<HTMLPreElement, CodeBlockProps>(
|
|
20
|
+
({ children, className, ...props }, ref) => {
|
|
21
|
+
return (
|
|
22
|
+
<pre
|
|
23
|
+
data-slot="code-block"
|
|
24
|
+
ref={ref}
|
|
25
|
+
className={cn(
|
|
26
|
+
'block w-full max-w-full min-w-0 overflow-auto bg-muted font-mono text-sm font-normal scrollbar-none rounded-lg border border-[length:var(--border-width)] border-stroke focus-visible:outline-none',
|
|
27
|
+
FOCUS_RING,
|
|
28
|
+
className,
|
|
29
|
+
)}
|
|
30
|
+
{...props}
|
|
31
|
+
>
|
|
32
|
+
{String(children)
|
|
33
|
+
.split('\n')
|
|
34
|
+
.map((line, index) => (
|
|
35
|
+
<div key={index} className="flex min-w-max items-start">
|
|
36
|
+
<span
|
|
37
|
+
aria-hidden="true"
|
|
38
|
+
className="inline-flex w-[3ch] shrink-0 select-none bg-page pr-[1ch] text-right text-muted-foreground"
|
|
39
|
+
>
|
|
40
|
+
{leftPad(String(index + 1), 3)}
|
|
41
|
+
</span>
|
|
42
|
+
<span className="min-w-[10%] whitespace-pre bg-muted pl-[2ch] text-foreground">
|
|
43
|
+
{line}
|
|
44
|
+
</span>
|
|
45
|
+
</div>
|
|
46
|
+
))}
|
|
47
|
+
</pre>
|
|
48
|
+
)
|
|
49
|
+
},
|
|
50
|
+
)
|
|
51
|
+
CodeBlock.displayName = 'CodeBlock'
|
|
52
|
+
|
|
53
|
+
export { CodeBlock }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Collapsible as CollapsiblePrimitive } from '@base-ui/react/collapsible'
|
|
2
|
+
|
|
3
|
+
function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props) {
|
|
4
|
+
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props) {
|
|
8
|
+
return <CollapsiblePrimitive.Trigger data-slot="collapsible-trigger" {...props} />
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props) {
|
|
12
|
+
return <CollapsiblePrimitive.Panel data-slot="collapsible-content" {...props} />
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent }
|