@vendure-io/ui 2.2.0 → 3.0.0-next.1

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.
Files changed (120) hide show
  1. package/package.json +19 -5
  2. package/src/components/atoms/accordion.tsx +21 -6
  3. package/src/components/atoms/alert-dialog.tsx +31 -6
  4. package/src/components/atoms/alert.tsx +72 -18
  5. package/src/components/atoms/avatar.tsx +12 -4
  6. package/src/components/atoms/badge.tsx +7 -2
  7. package/src/components/atoms/breadcrumb.tsx +493 -4
  8. package/src/components/atoms/button-group.tsx +30 -6
  9. package/src/components/atoms/button.tsx +128 -18
  10. package/src/components/atoms/calendar.tsx +6 -6
  11. package/src/components/atoms/card.tsx +130 -16
  12. package/src/components/atoms/carousel.tsx +16 -9
  13. package/src/components/atoms/chart.tsx +87 -1
  14. package/src/components/atoms/checkbox.tsx +85 -7
  15. package/src/components/atoms/collapsible.tsx +2 -1
  16. package/src/components/atoms/combobox.tsx +358 -29
  17. package/src/components/atoms/command.tsx +336 -13
  18. package/src/components/atoms/context-menu.tsx +28 -23
  19. package/src/components/atoms/dialog.tsx +173 -29
  20. package/src/components/atoms/direction.tsx +23 -2
  21. package/src/components/atoms/drawer.tsx +15 -10
  22. package/src/components/atoms/dropdown-menu.tsx +43 -28
  23. package/src/components/atoms/empty.tsx +5 -1
  24. package/src/components/atoms/field.tsx +41 -15
  25. package/src/components/atoms/hover-card.tsx +61 -8
  26. package/src/components/atoms/input-group.tsx +19 -11
  27. package/src/components/atoms/input-otp.tsx +6 -6
  28. package/src/components/atoms/input.tsx +7 -1
  29. package/src/components/atoms/item.tsx +3 -3
  30. package/src/components/atoms/kbd.tsx +32 -3
  31. package/src/components/atoms/label-swap.tsx +113 -0
  32. package/src/components/atoms/label.tsx +1 -1
  33. package/src/components/atoms/menubar.tsx +28 -26
  34. package/src/components/atoms/native-select.tsx +3 -2
  35. package/src/components/atoms/navigation-menu.tsx +13 -8
  36. package/src/components/atoms/pagination.tsx +2 -2
  37. package/src/components/atoms/popover.tsx +29 -6
  38. package/src/components/atoms/progress.tsx +46 -33
  39. package/src/components/atoms/radio-group.tsx +9 -4
  40. package/src/components/atoms/resizable.tsx +1 -1
  41. package/src/components/atoms/scroll-area.tsx +2 -2
  42. package/src/components/atoms/select.tsx +258 -19
  43. package/src/components/atoms/sheet.tsx +76 -23
  44. package/src/components/atoms/sidebar.tsx +405 -23
  45. package/src/components/atoms/skeleton.tsx +1 -1
  46. package/src/components/atoms/slider.tsx +1 -1
  47. package/src/components/atoms/sonner.tsx +128 -38
  48. package/src/components/atoms/spinner.tsx +1 -1
  49. package/src/components/atoms/switch.tsx +10 -5
  50. package/src/components/atoms/table.tsx +147 -7
  51. package/src/components/atoms/tabs.tsx +3 -3
  52. package/src/components/atoms/textarea.tsx +3 -1
  53. package/src/components/atoms/toggle-group.tsx +4 -2
  54. package/src/components/atoms/toggle.tsx +28 -6
  55. package/src/components/atoms/tooltip.tsx +85 -15
  56. package/src/components/molecules/anonymized-token.tsx +24 -8
  57. package/src/components/molecules/app-shell.tsx +53 -20
  58. package/src/components/molecules/arrow-link.tsx +40 -0
  59. package/src/components/molecules/chip.tsx +43 -4
  60. package/src/components/molecules/code-block.tsx +54 -31
  61. package/src/components/molecules/collapsible-section.tsx +129 -0
  62. package/src/components/molecules/confirm-dialog.tsx +122 -9
  63. package/src/components/molecules/copyable-text.tsx +75 -11
  64. package/src/components/molecules/count-badge.tsx +115 -0
  65. package/src/components/molecules/data-table/data-table-bulk-actions.tsx +32 -4
  66. package/src/components/molecules/data-table/data-table-column-header.tsx +20 -3
  67. package/src/components/molecules/data-table/data-table-filters.tsx +62 -22
  68. package/src/components/molecules/data-table/data-table-helpers.tsx +88 -1
  69. package/src/components/molecules/data-table/data-table-selection-storage.tsx +115 -0
  70. package/src/components/molecules/data-table/data-table-types.tsx +160 -4
  71. package/src/components/molecules/data-table/data-table-view-options.tsx +2 -2
  72. package/src/components/molecules/data-table/data-table.tsx +869 -81
  73. package/src/components/molecules/data-table/table-pagination.tsx +2 -2
  74. package/src/components/molecules/date-picker.tsx +13 -7
  75. package/src/components/molecules/date-range-picker.tsx +13 -6
  76. package/src/components/molecules/date-time-picker.tsx +13 -7
  77. package/src/components/molecules/date-time.tsx +8 -1
  78. package/src/components/molecules/direction-link.tsx +130 -0
  79. package/src/components/molecules/elapsed-time.tsx +223 -0
  80. package/src/components/molecules/file-dropzone.tsx +2 -2
  81. package/src/components/molecules/id-chip.tsx +169 -32
  82. package/src/components/molecules/inline-code.tsx +4 -0
  83. package/src/components/molecules/issued-secret.tsx +318 -0
  84. package/src/components/molecules/list-row.tsx +349 -0
  85. package/src/components/molecules/live-indicator.tsx +83 -0
  86. package/src/components/molecules/page-header.tsx +117 -5
  87. package/src/components/molecules/password-input.tsx +2 -2
  88. package/src/components/molecules/relative-time.tsx +85 -56
  89. package/src/components/molecules/search-trigger.tsx +111 -0
  90. package/src/components/molecules/secret-value.tsx +29 -9
  91. package/src/components/molecules/skip-link.tsx +1 -1
  92. package/src/components/molecules/stat-card.tsx +4 -4
  93. package/src/components/molecules/state-views/empty-state.tsx +35 -17
  94. package/src/components/molecules/state-views/error-state.tsx +32 -14
  95. package/src/components/molecules/status-badge.tsx +415 -49
  96. package/src/components/molecules/time-tooltip.tsx +140 -0
  97. package/src/components/molecules/timeline.tsx +246 -0
  98. package/src/components/molecules/visibility-icon.tsx +89 -0
  99. package/src/hooks/use-active-label-size.ts +66 -0
  100. package/src/hooks/use-apple-platform.ts +26 -0
  101. package/src/hooks/use-pinned-height.ts +55 -0
  102. package/src/hooks/use-scrolled.ts +27 -0
  103. package/src/lib/content-inset.ts +17 -0
  104. package/src/lib/control-name.ts +55 -0
  105. package/src/lib/dialog-padding.ts +48 -0
  106. package/src/lib/field-surface.ts +31 -0
  107. package/src/lib/format-elapsed.ts +67 -0
  108. package/src/lib/format-relative.ts +29 -1
  109. package/src/lib/highlight.ts +3 -3
  110. package/src/lib/menu-item.tsx +72 -0
  111. package/src/lib/outline-edge.ts +21 -0
  112. package/src/lib/popup-align.ts +67 -0
  113. package/src/lib/popup-direction.ts +22 -0
  114. package/src/lib/popup-motion.ts +19 -0
  115. package/src/lib/state-dictionary.ts +42 -6
  116. package/src/lib/syntax-colors.ts +8 -0
  117. package/src/lib/tint-recipes.ts +68 -0
  118. package/src/lib/tone-icons.ts +24 -0
  119. package/src/lib/trigger-slot.ts +16 -0
  120. package/src/lib/utils.ts +97 -1
@@ -34,6 +34,89 @@ function useChart() {
34
34
  return context
35
35
  }
36
36
 
37
+ // recharts marks some shapes as images (`role="img"`): the slices of a pie and
38
+ // a radial bar, scatter symbols, funnel trapezoids, treemap cells and sankey
39
+ // nodes. An image needs an accessible name. The chart gives each one a name from
40
+ // what it already has: the shape's `name` (a pie slice has its `nameKey` value),
41
+ // else the config key in its colour (`var(--color-card)`), through that key's
42
+ // config `label`. A shape that already has a name keeps it, so a consumer's
43
+ // `aria-label` (a `Cell`'s, say) wins and can carry the value too.
44
+ const CHART_SHAPES = '[role="img"]:not([aria-label]):not([aria-labelledby])'
45
+
46
+ function configLabel(config: ChartConfig, key: string | null | undefined) {
47
+ if (!key) return undefined
48
+ const label = config[key]?.label
49
+ return typeof label === "string" ? label : undefined
50
+ }
51
+
52
+ // Backgrounds that carry no data: the track behind a radial bar and the
53
+ // treemap's root rectangle. They are hidden from assistive technology.
54
+ const DECORATIVE_SHAPES =
55
+ ".recharts-radial-bar-background-sector, .recharts-treemap-depth-0 > * > * > [role=img]"
56
+
57
+ function nameChartShapes(root: HTMLElement, config: ChartConfig) {
58
+ for (const shape of Array.from(root.querySelectorAll<SVGElement>(CHART_SHAPES))) {
59
+ if (shape.querySelector("title")) continue
60
+ if (shape.matches(DECORATIVE_SHAPES)) {
61
+ shape.setAttribute("aria-hidden", "true")
62
+ continue
63
+ }
64
+ // A scatter symbol and a funnel step are groups: the name and the colour
65
+ // sit on the path inside.
66
+ const source =
67
+ shape.getAttribute("name") || shape.getAttribute("fill")
68
+ ? shape
69
+ : shape.querySelector("[name], [fill]")
70
+ if (!source) {
71
+ // A group that holds nothing yet, such as a funnel step before its first
72
+ // frame. There is nothing to describe: hide it until its path arrives.
73
+ if (shape instanceof SVGGElement) {
74
+ shape.setAttribute("aria-hidden", "true")
75
+ shape.setAttribute("data-chart-pending", "")
76
+ }
77
+ continue
78
+ }
79
+ const name = source.getAttribute("name")
80
+ const color = /--color-([\w-]+)/.exec(
81
+ source.getAttribute("fill") ?? source.getAttribute("stroke") ?? ""
82
+ )?.[1]
83
+ const label = configLabel(config, name) ?? name ?? configLabel(config, color)
84
+ if (label) {
85
+ shape.setAttribute("aria-label", label)
86
+ if (shape.hasAttribute("data-chart-pending")) {
87
+ shape.removeAttribute("data-chart-pending")
88
+ shape.removeAttribute("aria-hidden")
89
+ }
90
+ }
91
+ }
92
+ }
93
+
94
+ /**
95
+ * Names the chart's image shapes, now and as the chart draws (recharts replaces
96
+ * shapes while it animates). It watches only the tree below the container, and
97
+ * setting `aria-label` or `aria-hidden` does not trigger it again.
98
+ */
99
+ function useChartShapeNames(
100
+ ref: React.RefObject<HTMLElement | null>,
101
+ config: ChartConfig
102
+ ) {
103
+ React.useLayoutEffect(() => {
104
+ const root = ref.current
105
+ if (!root) return
106
+ nameChartShapes(root, config)
107
+ if (typeof MutationObserver === "undefined") return
108
+ const observer = new MutationObserver(() => nameChartShapes(root, config))
109
+ observer.observe(root, {
110
+ childList: true,
111
+ subtree: true,
112
+ // A funnel step gets its name and colour after it is drawn.
113
+ attributes: true,
114
+ attributeFilter: ["name", "fill", "stroke"],
115
+ })
116
+ return () => observer.disconnect()
117
+ }, [ref, config])
118
+ }
119
+
37
120
  function ChartContainer({
38
121
  id,
39
122
  className,
@@ -48,10 +131,13 @@ function ChartContainer({
48
131
  }) {
49
132
  const uniqueId = React.useId()
50
133
  const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`
134
+ const ref = React.useRef<HTMLDivElement>(null)
135
+ useChartShapeNames(ref, config)
51
136
 
52
137
  return (
53
138
  <ChartContext.Provider value={{ config }}>
54
139
  <div
140
+ ref={ref}
55
141
  data-slot="chart"
56
142
  data-chart={chartId}
57
143
  className={cn(
@@ -173,7 +259,7 @@ function ChartTooltipContent({
173
259
  return (
174
260
  <div
175
261
  className={cn(
176
- "border-border/50 bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",
262
+ "bg-popover text-popover-foreground grid min-w-32 items-start gap-1.5 rounded-xl px-2.5 py-1.5 text-xs shadow-overlay",
177
263
  className
178
264
  )}
179
265
  >
@@ -3,25 +3,103 @@
3
3
  import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox"
4
4
 
5
5
  import { cn } from "@vendure-io/ui/lib/utils"
6
- import { useFieldControlProps } from "@vendure-io/ui/components/atoms/field"
7
- import { CheckIcon, MinusIcon } from "lucide-react"
6
+ import {
7
+ useFieldControlProps,
8
+ useFieldLabelCheckedClass,
9
+ } from "@vendure-io/ui/components/atoms/field"
10
+
11
+ // Checking animates; unchecking plays back quicker.
12
+ // - The fill is the root's ::before, over the border. It closes in from the
13
+ // corners and edges to the middle: an even-odd clip-path is the box with a
14
+ // round hole, and the hole shrinks from just around the box (nothing shows)
15
+ // to a point in the middle (all of it shows). The corners fill first.
16
+ // Checking takes `moderate` on `ease-out`; unchecking opens the hole again
17
+ // in `fast`.
18
+ // - The fill reveals the mark: the mark is always drawn, in the fill's
19
+ // foreground, and its indicator takes the same clip with the same timing.
20
+ // So the mark shows only where the fill already is, and the hole hides it
21
+ // while it is open, on any background.
22
+ // - The check and the indeterminate line are two paths; only the one for the
23
+ // current state shows. Checking or going indeterminate swaps them at once
24
+ // (the hole hides the swap, or the fill is already whole). Unchecking keeps
25
+ // the mark until the hole has opened, then swaps.
26
+ // - A press shrinks the box to 95% (`fast`, `ease-press`).
27
+ // Checking ends after `moderate` (150ms), unchecking after `fast` (100ms).
28
+ // Only transitions, no keyframes, so a fast toggle or a range selection
29
+ // reverses from wherever it is. Reduced motion keeps fades only: the fill and
30
+ // the mark are whole and fade in and out together. The root also transitions
31
+ // opacity, so a caller that fades the box in (the DataTable's hidden
32
+ // checkboxes) needs no transition of its own, which would replace this list.
33
+ // The DataTable delays the root, the ::before and the indicator for its
34
+ // select-all ripple.
35
+ const rootTransition =
36
+ "[transition:border-color_var(--transition-duration-fast)_var(--ease-soft),box-shadow_var(--transition-duration-fast)_var(--ease-soft),opacity_var(--transition-duration-moderate)_var(--ease-default),scale_var(--transition-duration-fast)_var(--ease-press)] data-checked:[transition:border-color_var(--transition-duration-normal)_var(--ease-out),box-shadow_var(--transition-duration-fast)_var(--ease-soft),opacity_var(--transition-duration-moderate)_var(--ease-default),scale_var(--transition-duration-fast)_var(--ease-press)] data-indeterminate:[transition:border-color_var(--transition-duration-normal)_var(--ease-out),box-shadow_var(--transition-duration-fast)_var(--ease-soft),opacity_var(--transition-duration-moderate)_var(--ease-default),scale_var(--transition-duration-fast)_var(--ease-press)] not-data-disabled:active:scale-95 motion-reduce:active:scale-100"
37
+
38
+ // `--checkbox-hole` is how far open the hole is: 1 leaves no fill, 0 a full
39
+ // box. The root sets it and builds `--checkbox-clip` from it once; the fill
40
+ // and the mark's indicator both clip to that, each over the box plus its 1px
41
+ // border, and each transitions its own clip-path. The hole is a circle around
42
+ // the middle. At 1 its radius is half the box's diagonal plus 1px, so the
43
+ // corners are empty too; on the box's own edge, the clip's anti-aliasing left
44
+ // a hairline of fill at rest. The circle is a `shape()` with two half-circle
45
+ // arcs; their 1px radius is too small for the chord, so the browser scales it
46
+ // up to half the chord, a true circle at any size. A browser without `shape()`
47
+ // keeps a square hole that closes in from the edges over the same time.
48
+ const hole =
49
+ "[--checkbox-hole:1] data-checked:[--checkbox-hole:0] data-indeterminate:[--checkbox-hole:0] motion-reduce:[--checkbox-hole:0] [--checkbox-clip:polygon(evenodd,-1px_-1px,calc(100%_+_1px)_-1px,calc(100%_+_1px)_calc(100%_+_1px),-1px_calc(100%_+_1px),-1px_-1px,calc(50%_-_var(--checkbox-hole)*(50%_+_1px))_calc(50%_-_var(--checkbox-hole)*(50%_+_1px)),calc(50%_+_var(--checkbox-hole)*(50%_+_1px))_calc(50%_-_var(--checkbox-hole)*(50%_+_1px)),calc(50%_+_var(--checkbox-hole)*(50%_+_1px))_calc(50%_+_var(--checkbox-hole)*(50%_+_1px)),calc(50%_-_var(--checkbox-hole)*(50%_+_1px))_calc(50%_+_var(--checkbox-hole)*(50%_+_1px)),calc(50%_-_var(--checkbox-hole)*(50%_+_1px))_calc(50%_-_var(--checkbox-hole)*(50%_+_1px)))] supports-[clip-path:shape(from_0_0,line_to_1px_1px)]:[--checkbox-clip:shape(evenodd_from_-1px_-1px,line_to_calc(100%_+_1px)_-1px,line_to_calc(100%_+_1px)_calc(100%_+_1px),line_to_-1px_calc(100%_+_1px),close,move_to_calc(50%_-_var(--checkbox-hole)*(70.711%_+_1px))_50%,arc_to_calc(50%_+_var(--checkbox-hole)*(70.711%_+_1px))_50%_of_1px_cw,arc_to_calc(50%_-_var(--checkbox-hole)*(70.711%_+_1px))_50%_of_1px_cw,close)]"
50
+
51
+ const fill =
52
+ "before:absolute before:-inset-px before:rounded-[inherit] before:bg-primary before:[clip-path:var(--checkbox-clip)] before:[transition:clip-path_var(--transition-duration-fast)_var(--ease-soft)] data-checked:before:[transition:clip-path_var(--transition-duration-moderate)_var(--ease-out)] data-indeterminate:before:[transition:clip-path_var(--transition-duration-moderate)_var(--ease-out)] motion-reduce:before:opacity-0 motion-reduce:data-checked:before:opacity-100 motion-reduce:data-indeterminate:before:opacity-100 motion-reduce:before:[transition:opacity_var(--transition-duration-fast)_var(--ease-soft)] motion-reduce:data-checked:before:[transition:opacity_var(--transition-duration-normal)_var(--ease-soft)] motion-reduce:data-indeterminate:before:[transition:opacity_var(--transition-duration-normal)_var(--ease-soft)]"
53
+
54
+ // The indicator keys on its own state attributes, which Base UI sets to match the root's.
55
+ const indicator =
56
+ "absolute -inset-px grid place-content-center text-primary-foreground [clip-path:var(--checkbox-clip)] [transition:clip-path_var(--transition-duration-fast)_var(--ease-soft)] data-checked:[transition:clip-path_var(--transition-duration-moderate)_var(--ease-out)] data-indeterminate:[transition:clip-path_var(--transition-duration-moderate)_var(--ease-out)] motion-reduce:opacity-0 motion-reduce:data-checked:opacity-100 motion-reduce:data-indeterminate:opacity-100 motion-reduce:[transition:opacity_var(--transition-duration-fast)_var(--ease-soft)] motion-reduce:data-checked:[transition:opacity_var(--transition-duration-normal)_var(--ease-soft)] motion-reduce:data-indeterminate:[transition:opacity_var(--transition-duration-normal)_var(--ease-soft)]"
57
+
58
+ // The swap waits `fast` while unchecking, so the leaving mark stays until the
59
+ // hole has opened. A 0s transition with a delay is a step at the end.
60
+ const markSwap =
61
+ "[stroke-dasharray:1] [transition:opacity_0s_linear_var(--transition-duration-fast)] group-data-[checked]/checkbox:[transition-delay:0s] group-data-indeterminate/checkbox:[transition-delay:0s]"
62
+
63
+ // The check shows unless indeterminate (unchecked, the hole hides it), the line only while indeterminate.
64
+ const checkMark = "group-data-indeterminate/checkbox:opacity-0"
65
+ const lineMark = "opacity-0 group-data-indeterminate/checkbox:opacity-100"
8
66
 
9
67
  function Checkbox({ className, indeterminate, ...props }: CheckboxPrimitive.Root.Props) {
68
+ const fieldLabelChecked = useFieldLabelCheckedClass()
10
69
  return (
11
70
  <CheckboxPrimitive.Root
12
71
  data-slot="checkbox"
13
- className={cn(
14
- "border-control-border dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground dark:data-indeterminate:bg-primary data-indeterminate:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",
15
- className
72
+ className={(state) => cn(
73
+ "group/checkbox border-control-border dark:bg-input/30 data-checked:text-primary-foreground data-checked:border-primary data-indeterminate:text-primary-foreground data-indeterminate:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring aria-invalid:focus-visible:outline-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 aria-invalid:ring-3",
74
+ rootTransition,
75
+ hole,
76
+ fill,
77
+ fieldLabelChecked(state.checked && !state.indeterminate),
78
+ typeof className === "function" ? className(state) : className
16
79
  )}
17
80
  indeterminate={indeterminate}
18
81
  {...useFieldControlProps(props)}
19
82
  >
83
+ {/* Kept mounted: the fill reveals the mark while checking and hides it
84
+ again while unchecking. */}
20
85
  <CheckboxPrimitive.Indicator
86
+ keepMounted
21
87
  data-slot="checkbox-indicator"
22
- className="grid place-content-center text-current transition-none [&>svg]:size-3.5"
88
+ className={indicator}
23
89
  >
24
- {indeterminate ? <MinusIcon /> : <CheckIcon />}
90
+ <svg
91
+ viewBox="0 0 24 24"
92
+ fill="none"
93
+ stroke="currentColor"
94
+ strokeWidth="2"
95
+ strokeLinecap="round"
96
+ strokeLinejoin="round"
97
+ aria-hidden="true"
98
+ className="size-3.5"
99
+ >
100
+ <path d="M4 12l5 5L20 6" pathLength={1} className={`${markSwap} ${checkMark}`} />
101
+ <path d="M5 12h14" pathLength={1} className={`${markSwap} ${lineMark}`} />
102
+ </svg>
25
103
  </CheckboxPrimitive.Indicator>
26
104
  </CheckboxPrimitive.Root>
27
105
  )
@@ -1,6 +1,7 @@
1
1
  "use client"
2
2
 
3
3
  import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible"
4
+ import { triggerSlot } from "../../lib/trigger-slot.ts"
4
5
 
5
6
  function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props) {
6
7
  return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />
@@ -8,7 +9,7 @@ function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props) {
8
9
 
9
10
  function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props) {
10
11
  return (
11
- <CollapsiblePrimitive.Trigger data-slot="collapsible-trigger" {...props} />
12
+ <CollapsiblePrimitive.Trigger {...triggerSlot("collapsible-trigger", props.render)} {...props} />
12
13
  )
13
14
  }
14
15