@cognite/aura 0.1.7 → 0.3.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.
Files changed (232) hide show
  1. package/DESIGN.md +34 -92
  2. package/README.md +33 -0
  3. package/dist/colors.css +471 -214
  4. package/dist/components/index.d.ts +17 -33
  5. package/dist/components/index.js +315 -281
  6. package/dist/components/ui/core/accordion/accordion.d.ts +7 -7
  7. package/dist/components/ui/core/accordion/accordion.js +64 -62
  8. package/dist/components/ui/core/action-toolbar/action-toolbar.d.ts +41 -0
  9. package/dist/components/ui/core/action-toolbar/action-toolbar.js +176 -0
  10. package/dist/components/ui/core/alert/alert.d.ts +23 -12
  11. package/dist/components/ui/core/alert/alert.js +123 -120
  12. package/dist/components/ui/core/avatar/avatar.d.ts +12 -8
  13. package/dist/components/ui/core/avatar/avatar.js +10 -10
  14. package/dist/components/ui/core/badge/badge.d.ts +11 -8
  15. package/dist/components/ui/core/badge/badge.js +13 -13
  16. package/dist/components/ui/core/banner/banner.d.ts +18 -28
  17. package/dist/components/ui/core/banner/banner.js +6 -6
  18. package/dist/components/ui/core/breadcrumb/breadcrumb.d.ts +12 -0
  19. package/dist/components/ui/core/breadcrumb/breadcrumb.js +200 -0
  20. package/dist/components/ui/core/button/button.d.ts +8 -5
  21. package/dist/components/ui/core/button/button.js +22 -19
  22. package/dist/components/ui/core/button-group/button-group.d.ts +7 -6
  23. package/dist/components/ui/core/card/card.d.ts +18 -14
  24. package/dist/components/ui/core/card/card.js +131 -87
  25. package/dist/components/ui/core/chart/chart.d.ts +69 -0
  26. package/dist/components/ui/core/chart/chart.js +215 -0
  27. package/dist/components/ui/core/chart/index.d.ts +2 -0
  28. package/dist/components/ui/core/chart/index.js +8 -0
  29. package/dist/components/ui/core/checkbox/checkbox.d.ts +17 -0
  30. package/dist/components/ui/core/checkbox/checkbox.js +133 -0
  31. package/dist/components/ui/core/{badge/badge.metadata.d.ts → checkbox/checkbox.metadata.d.ts} +1 -1
  32. package/dist/components/ui/core/checkbox/checkbox.metadata.js +8 -0
  33. package/dist/components/ui/core/code-block/code-block.d.ts +6 -9
  34. package/dist/components/ui/core/code-block/code-block.js +52 -48
  35. package/dist/components/ui/core/collapsible/collapsible.d.ts +5 -3
  36. package/dist/components/ui/core/combobox/combobox.d.ts +2 -2
  37. package/dist/components/ui/core/command/command.d.ts +11 -78
  38. package/dist/components/ui/core/command/command.js +53 -52
  39. package/dist/components/ui/core/count/count.d.ts +9 -0
  40. package/dist/components/ui/core/count/count.js +32 -0
  41. package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.d.ts +15 -0
  42. package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +99 -0
  43. package/dist/components/ui/core/date-time-pickers/date-range-picker/index.d.ts +3 -0
  44. package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +25 -0
  45. package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.d.ts +4 -0
  46. package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +82 -0
  47. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.d.ts +17 -0
  48. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +190 -0
  49. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.d.ts +3 -0
  50. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +42 -0
  51. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.d.ts +3 -0
  52. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +161 -0
  53. package/dist/components/ui/core/date-time-pickers/index.d.ts +6 -0
  54. package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.d.ts +7 -0
  55. package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +57 -0
  56. package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.d.ts +13 -0
  57. package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +119 -0
  58. package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.d.ts +10 -0
  59. package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.js +93 -0
  60. package/dist/components/ui/core/date-time-pickers/shared/constants.d.ts +20 -0
  61. package/dist/components/ui/core/date-time-pickers/shared/constants.js +14 -0
  62. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.d.ts +19 -0
  63. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +99 -0
  64. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.d.ts +12 -0
  65. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +68 -0
  66. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.d.ts +12 -0
  67. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +40 -0
  68. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.d.ts +29 -0
  69. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +63 -0
  70. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.d.ts +8 -0
  71. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +19 -0
  72. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.d.ts +17 -0
  73. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +34 -0
  74. package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.d.ts +8 -0
  75. package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +7 -0
  76. package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.d.ts +13 -0
  77. package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +31 -0
  78. package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.d.ts +10 -0
  79. package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +52 -0
  80. package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.d.ts +48 -0
  81. package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +52 -0
  82. package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.d.ts +26 -0
  83. package/dist/components/ui/core/date-time-pickers/utils/format-utils.d.ts +37 -0
  84. package/dist/components/ui/core/date-time-pickers/utils/segment-utils.d.ts +34 -0
  85. package/dist/components/ui/core/date-time-pickers/utils/time-utils.d.ts +43 -0
  86. package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +15 -0
  87. package/dist/components/ui/core/date-time-pickers/utils/time-validation.d.ts +23 -0
  88. package/dist/components/ui/core/dialog/dialog.d.ts +10 -10
  89. package/dist/components/ui/core/dialog/dialog.js +12 -3
  90. package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +24 -47
  91. package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +125 -123
  92. package/dist/components/ui/core/empty-state/empty-state.context.d.ts +10 -0
  93. package/dist/components/ui/core/empty-state/empty-state.context.js +8 -0
  94. package/dist/components/ui/core/empty-state/empty-state.d.ts +18 -0
  95. package/dist/components/ui/core/empty-state/empty-state.js +139 -0
  96. package/dist/components/ui/core/helper-text/helper-text.d.ts +7 -5
  97. package/dist/components/ui/core/hover-card/hover-card.d.ts +5 -7
  98. package/dist/components/ui/core/hover-card/hover-card.js +26 -25
  99. package/dist/components/ui/core/inline-citation/inline-citation.d.ts +10 -10
  100. package/dist/components/ui/core/inline-citation/inline-citation.js +65 -57
  101. package/dist/components/ui/core/input/input.d.ts +2 -1
  102. package/dist/components/ui/core/input-group/input-group.d.ts +17 -13
  103. package/dist/components/ui/core/input-group/input-group.js +35 -36
  104. package/dist/components/ui/core/kbd/kbd.d.ts +4 -0
  105. package/dist/components/ui/core/kbd/kbd.js +36 -0
  106. package/dist/components/ui/core/label/label.d.ts +3 -2
  107. package/dist/components/ui/core/loader/loader.d.ts +11 -3
  108. package/dist/components/ui/core/loader/loader.js +106 -107
  109. package/dist/components/ui/core/message/message.d.ts +18 -17
  110. package/dist/components/ui/core/message/message.js +15 -13
  111. package/dist/components/ui/core/pagination/pagination-size-context.d.ts +5 -0
  112. package/dist/components/ui/core/pagination/pagination-size-context.js +6 -0
  113. package/dist/components/ui/core/pagination/pagination-teleport.d.ts +11 -0
  114. package/dist/components/ui/core/pagination/pagination-teleport.js +108 -0
  115. package/dist/components/ui/core/pagination/pagination-teleport.utils.d.ts +1 -0
  116. package/dist/components/ui/core/pagination/pagination-teleport.utils.js +7 -0
  117. package/dist/components/ui/core/pagination/pagination.d.ts +41 -0
  118. package/dist/components/ui/core/pagination/pagination.js +335 -0
  119. package/dist/components/ui/core/popover/popover.d.ts +12 -16
  120. package/dist/components/ui/core/popover/popover.js +52 -51
  121. package/dist/components/ui/core/progress/progress.d.ts +7 -4
  122. package/dist/components/ui/core/prompt-input/prompt-input.d.ts +36 -103
  123. package/dist/components/ui/core/prompt-input/prompt-input.js +193 -180
  124. package/dist/components/ui/core/radio-group/radio-group.d.ts +20 -0
  125. package/dist/components/ui/core/radio-group/radio-group.js +113 -0
  126. package/dist/components/ui/core/reasoning/reasoning.d.ts +5 -5
  127. package/dist/components/ui/core/reasoning/reasoning.js +1 -1
  128. package/dist/components/ui/core/scroll-area/scroll-area.d.ts +4 -2
  129. package/dist/components/ui/core/search/search.d.ts +10 -0
  130. package/dist/components/ui/core/search/search.js +99 -0
  131. package/dist/components/ui/core/segmented-control/segmented-control.d.ts +20 -0
  132. package/dist/components/ui/core/segmented-control/segmented-control.js +172 -0
  133. package/dist/components/ui/core/select/select.d.ts +13 -13
  134. package/dist/components/ui/core/select/select.js +13 -10
  135. package/dist/components/ui/core/separator/separator.d.ts +2 -4
  136. package/dist/components/ui/core/separator/separator.js +4 -5
  137. package/dist/components/ui/core/shimmer/shimmer.d.ts +3 -5
  138. package/dist/components/ui/core/shimmer/shimmer.js +25 -26
  139. package/dist/components/ui/core/skeleton/skeleton.d.ts +2 -1
  140. package/dist/components/ui/core/sonner-toast/sonner-toast.d.ts +4 -0
  141. package/dist/components/ui/core/sonner-toast/sonner-toast.js +48 -0
  142. package/dist/components/ui/core/sources/sources.d.ts +3 -3
  143. package/dist/components/ui/core/sources/sources.js +6 -1
  144. package/dist/components/ui/core/switch/switch.d.ts +11 -0
  145. package/dist/components/ui/core/{button/button.metadata.d.ts → switch/switch.metadata.d.ts} +1 -1
  146. package/dist/components/ui/core/tabs/tabs.d.ts +27 -0
  147. package/dist/components/ui/core/tabs/tabs.js +224 -0
  148. package/dist/components/ui/core/tabs/tabs.utils.d.ts +2 -0
  149. package/dist/components/ui/core/tabs/tabs.utils.js +9 -0
  150. package/dist/components/ui/core/textarea/textarea.d.ts +2 -1
  151. package/dist/components/ui/core/textarea/textarea.js +20 -18
  152. package/dist/components/ui/core/tool/tool.d.ts +7 -6
  153. package/dist/components/ui/core/tool/tool.js +48 -44
  154. package/dist/components/ui/core/tooltip/tooltip.d.ts +6 -5
  155. package/dist/components/ui/core/tooltip/tooltip.js +10 -8
  156. package/dist/components/ui/core/topbar/topbar.d.ts +28 -0
  157. package/dist/components/ui/core/topbar/topbar.js +190 -0
  158. package/dist/eslint/index.d.ts +2 -1
  159. package/dist/index.d.ts +1 -1
  160. package/dist/index.js +298 -273
  161. package/dist/lib/portal-container-context.d.ts +2 -1
  162. package/dist/lib/portal-container-context.js +1 -3
  163. package/dist/lib/utils.d.ts +11 -0
  164. package/dist/lib/utils.js +40 -29
  165. package/dist/styles.css +1 -1
  166. package/dist/styles.source.css +75 -8
  167. package/package.json +26 -5
  168. package/dist/components/ui/core/accordion/accordion.metadata.d.ts +0 -2
  169. package/dist/components/ui/core/accordion/accordion.metadata.js +0 -9
  170. package/dist/components/ui/core/alert/alert.metadata.d.ts +0 -2
  171. package/dist/components/ui/core/alert/alert.metadata.js +0 -9
  172. package/dist/components/ui/core/avatar/avatar.metadata.d.ts +0 -8
  173. package/dist/components/ui/core/avatar/avatar.metadata.js +0 -9
  174. package/dist/components/ui/core/badge/badge.metadata.js +0 -8
  175. package/dist/components/ui/core/banner/banner.metadata.d.ts +0 -2
  176. package/dist/components/ui/core/banner/banner.metadata.js +0 -9
  177. package/dist/components/ui/core/button/button.metadata.js +0 -9
  178. package/dist/components/ui/core/button-group/button-group.metadata.d.ts +0 -2
  179. package/dist/components/ui/core/button-group/button-group.metadata.js +0 -8
  180. package/dist/components/ui/core/card/card.metadata.d.ts +0 -8
  181. package/dist/components/ui/core/card/card.metadata.js +0 -9
  182. package/dist/components/ui/core/code-block/code-block.metadata.d.ts +0 -2
  183. package/dist/components/ui/core/code-block/code-block.metadata.js +0 -8
  184. package/dist/components/ui/core/collapsible/collapsible.metadata.d.ts +0 -2
  185. package/dist/components/ui/core/collapsible/collapsible.metadata.js +0 -9
  186. package/dist/components/ui/core/combobox/combobox.metadata.d.ts +0 -2
  187. package/dist/components/ui/core/command/command.metadata.d.ts +0 -2
  188. package/dist/components/ui/core/command/command.metadata.js +0 -9
  189. package/dist/components/ui/core/dialog/dialog.metadata.d.ts +0 -2
  190. package/dist/components/ui/core/dialog/dialog.metadata.js +0 -9
  191. package/dist/components/ui/core/dropdown-menu/dropdown-menu.metadata.d.ts +0 -2
  192. package/dist/components/ui/core/dropdown-menu/dropdown-menu.metadata.js +0 -9
  193. package/dist/components/ui/core/helper-text/helper-text.metadata.d.ts +0 -2
  194. package/dist/components/ui/core/helper-text/helper-text.metadata.js +0 -9
  195. package/dist/components/ui/core/hover-card/hover-card.metadata.d.ts +0 -2
  196. package/dist/components/ui/core/hover-card/hover-card.metadata.js +0 -8
  197. package/dist/components/ui/core/inline-citation/inline-citation.metadata.d.ts +0 -2
  198. package/dist/components/ui/core/inline-citation/inline-citation.metadata.js +0 -8
  199. package/dist/components/ui/core/input/input.metadata.d.ts +0 -2
  200. package/dist/components/ui/core/input/input.metadata.js +0 -9
  201. package/dist/components/ui/core/input-group/input-group.metadata.d.ts +0 -2
  202. package/dist/components/ui/core/input-group/input-group.metadata.js +0 -9
  203. package/dist/components/ui/core/label/label.metadata.d.ts +0 -2
  204. package/dist/components/ui/core/label/label.metadata.js +0 -9
  205. package/dist/components/ui/core/loader/loader.metadata.d.ts +0 -2
  206. package/dist/components/ui/core/loader/loader.metadata.js +0 -9
  207. package/dist/components/ui/core/message/message.metadata.d.ts +0 -2
  208. package/dist/components/ui/core/popover/popover.metadata.d.ts +0 -2
  209. package/dist/components/ui/core/popover/popover.metadata.js +0 -9
  210. package/dist/components/ui/core/progress/progress.metadata.d.ts +0 -2
  211. package/dist/components/ui/core/progress/progress.metadata.js +0 -9
  212. package/dist/components/ui/core/prompt-input/prompt-input.metadata.d.ts +0 -2
  213. package/dist/components/ui/core/prompt-input/prompt-input.metadata.js +0 -9
  214. package/dist/components/ui/core/reasoning/reasoning.metadata.d.ts +0 -2
  215. package/dist/components/ui/core/reasoning/reasoning.metadata.js +0 -8
  216. package/dist/components/ui/core/scroll-area/scroll-area.metadata.d.ts +0 -2
  217. package/dist/components/ui/core/scroll-area/scroll-area.metadata.js +0 -9
  218. package/dist/components/ui/core/select/select.metadata.d.ts +0 -2
  219. package/dist/components/ui/core/select/select.metadata.js +0 -9
  220. package/dist/components/ui/core/separator/separator.metadata.d.ts +0 -2
  221. package/dist/components/ui/core/separator/separator.metadata.js +0 -8
  222. package/dist/components/ui/core/shimmer/shimmer.metadata.d.ts +0 -2
  223. package/dist/components/ui/core/shimmer/shimmer.metadata.js +0 -9
  224. package/dist/components/ui/core/skeleton/skeleton.metadata.d.ts +0 -2
  225. package/dist/components/ui/core/skeleton/skeleton.metadata.js +0 -9
  226. package/dist/components/ui/core/sources/sources.metadata.d.ts +0 -2
  227. package/dist/components/ui/core/textarea/textarea.metadata.d.ts +0 -2
  228. package/dist/components/ui/core/textarea/textarea.metadata.js +0 -9
  229. package/dist/components/ui/core/tool/tool.metadata.d.ts +0 -2
  230. package/dist/components/ui/core/tool/tool.metadata.js +0 -8
  231. package/dist/components/ui/core/tooltip/tooltip.metadata.d.ts +0 -8
  232. package/dist/components/ui/core/tooltip/tooltip.metadata.js +0 -9
@@ -0,0 +1,69 @@
1
+ import { ComponentProps, CSSProperties, ReactNode } from 'react';
2
+ import { ResponsiveContainer, Tooltip, Legend } from 'recharts';
3
+ export type ChartConfig = {
4
+ [k in string]: {
5
+ label?: ReactNode;
6
+ icon?: ReactNode;
7
+ /** A CSS color or `var(--token)`. Use a token for light/dark theming. */
8
+ color?: string;
9
+ };
10
+ };
11
+ declare function colorVarsFromConfig(config: ChartConfig): CSSProperties;
12
+ type ChartA11yProps = {
13
+ 'aria-label': string;
14
+ 'aria-labelledby'?: never;
15
+ } | {
16
+ 'aria-labelledby': string;
17
+ 'aria-label'?: never;
18
+ };
19
+ type ChartContainerProps = Omit<ComponentProps<'div'>, 'aria-label' | 'aria-labelledby'> & ChartA11yProps & {
20
+ config: ChartConfig;
21
+ children: ComponentProps<typeof ResponsiveContainer>['children'];
22
+ };
23
+ declare function ChartContainer({ id, className, children, config, style, role, ...props }: ChartContainerProps): ReactNode;
24
+ declare const ChartTooltip: typeof Tooltip;
25
+ type TooltipPayloadItem = {
26
+ type?: string;
27
+ name?: string | number;
28
+ dataKey?: string | number;
29
+ value?: string | number;
30
+ color?: string;
31
+ payload?: Record<string, unknown>;
32
+ fill?: string;
33
+ [key: string]: unknown;
34
+ };
35
+ type ChartTooltipContentProps = Omit<ComponentProps<typeof Tooltip>, 'content' | 'formatter' | 'labelFormatter'> & {
36
+ className?: string;
37
+ labelClassName?: string;
38
+ hideLabel?: boolean;
39
+ hideIndicator?: boolean;
40
+ indicator?: 'line' | 'dot' | 'dashed';
41
+ nameKey?: string;
42
+ labelKey?: string;
43
+ payload?: TooltipPayloadItem[];
44
+ label?: string | number;
45
+ color?: string;
46
+ formatter?: (value: string | number, name: string | number, item: TooltipPayloadItem, index: number, payload: Record<string, unknown> | undefined) => ReactNode;
47
+ labelFormatter?: (value: ReactNode, payload: TooltipPayloadItem[]) => ReactNode;
48
+ /** Pass an i18n-aware formatter from your app's locale; defaults to the environment locale. */
49
+ valueFormatter?: (value: string | number) => string;
50
+ };
51
+ declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, valueFormatter, }: ChartTooltipContentProps): ReactNode;
52
+ declare const ChartLegend: typeof Legend;
53
+ type LegendPayloadItem = {
54
+ type?: string;
55
+ value?: string;
56
+ dataKey?: string | number;
57
+ color?: string;
58
+ [key: string]: unknown;
59
+ };
60
+ type ChartLegendContentProps = {
61
+ className?: string;
62
+ hideIcon?: boolean;
63
+ nameKey?: string;
64
+ payload?: LegendPayloadItem[];
65
+ verticalAlign?: 'top' | 'bottom' | 'middle';
66
+ };
67
+ declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: ChartLegendContentProps): ReactNode;
68
+ declare function getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string): ChartConfig[string] | undefined;
69
+ export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, colorVarsFromConfig, getPayloadConfigFromPayload, };
@@ -0,0 +1,215 @@
1
+ import { jsx as a, jsxs as g, Fragment as L } from "react/jsx-runtime";
2
+ import { useMemo as O, createContext as K, useContext as Y } from "react";
3
+ import { Legend as $, Tooltip as D, ResponsiveContainer as M } from "recharts";
4
+ import { cn as i } from "../../../../lib/utils.js";
5
+ function S(e) {
6
+ if (!e)
7
+ return;
8
+ const r = e.trim();
9
+ return { backgroundColor: r, borderColor: r };
10
+ }
11
+ const V = K(null);
12
+ function j() {
13
+ const e = Y(V);
14
+ if (!e)
15
+ throw new Error("useChart must be used within a <ChartContainer>");
16
+ return e;
17
+ }
18
+ function R(e) {
19
+ const r = {};
20
+ for (const [s, n] of Object.entries(e))
21
+ n.color && (r[`--color-${s}`] = n.color);
22
+ return r;
23
+ }
24
+ function Q({
25
+ id: e,
26
+ className: r,
27
+ children: s,
28
+ config: n,
29
+ style: d,
30
+ role: c = "img",
31
+ ...o
32
+ }) {
33
+ const l = O(() => ({ config: n }), [n]), f = R(n);
34
+ return /* @__PURE__ */ a(V.Provider, { value: l, children: /* @__PURE__ */ a(
35
+ "div",
36
+ {
37
+ role: c,
38
+ "data-slot": "chart",
39
+ "data-chart-id": e,
40
+ className: i(
41
+ "[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-chart-gridlines [&_.recharts-curve.recharts-tooltip-cursor]:stroke-chart-gridlines [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-chart-gridlines [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-chart-gridlines flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
42
+ r
43
+ ),
44
+ style: { ...f, ...d },
45
+ ...o,
46
+ children: /* @__PURE__ */ a(M, { children: s })
47
+ }
48
+ ) });
49
+ }
50
+ const U = D, G = [], H = (e) => typeof e == "number" ? e.toLocaleString() : String(e);
51
+ function W({
52
+ active: e,
53
+ payload: r = G,
54
+ className: s,
55
+ indicator: n = "dot",
56
+ hideLabel: d = !1,
57
+ hideIndicator: c = !1,
58
+ label: o,
59
+ labelFormatter: l,
60
+ labelClassName: f,
61
+ formatter: h,
62
+ color: y,
63
+ nameKey: T,
64
+ labelKey: _,
65
+ valueFormatter: A = H
66
+ }) {
67
+ const { config: x } = j(), k = (() => {
68
+ if (d || !r?.length)
69
+ return null;
70
+ const [t] = r, v = `${_ ?? t?.dataKey ?? t?.name ?? "value"}`, C = b(x, t, v), u = !_ && typeof o == "string" ? x[o]?.label ?? o : C?.label;
71
+ return l ? /* @__PURE__ */ a("div", { className: i("font-medium", f), children: l(u, r) }) : u ? /* @__PURE__ */ a("div", { className: i("font-medium", f), children: u }) : null;
72
+ })(), w = !e || !r.length, p = r.length === 1 && n !== "dot";
73
+ return /* @__PURE__ */ a(
74
+ "div",
75
+ {
76
+ className: i(
77
+ "bg-popover-background grid min-w-32 items-start gap-1 rounded-md p-2 text-sm shadow-md",
78
+ w && "invisible",
79
+ s
80
+ ),
81
+ children: w ? null : /* @__PURE__ */ g(L, { children: [
82
+ p ? null : k,
83
+ /* @__PURE__ */ a("div", { className: "grid gap-1.5", children: r.filter((t) => t.type !== "none").map((t, v) => {
84
+ const C = `${T ?? t.name ?? t.dataKey ?? "value"}`, u = b(
85
+ x,
86
+ t,
87
+ C
88
+ ), E = m(t.payload) && typeof t.payload.fill == "string" ? t.payload.fill : void 0, N = y ?? E ?? t.color, F = S(
89
+ typeof N == "string" ? N : void 0
90
+ );
91
+ return /* @__PURE__ */ a(
92
+ "div",
93
+ {
94
+ className: i(
95
+ "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
96
+ n === "dot" && "items-center"
97
+ ),
98
+ children: h && t.value != null && t.name != null ? h(
99
+ t.value,
100
+ t.name,
101
+ t,
102
+ v,
103
+ m(t.payload) ? t.payload : void 0
104
+ ) : /* @__PURE__ */ g(L, { children: [
105
+ u?.icon ? u.icon : !c && /* @__PURE__ */ a(
106
+ "div",
107
+ {
108
+ className: i("shrink-0 rounded-xs", {
109
+ "h-2 w-2": n === "dot",
110
+ "w-1": n === "line",
111
+ "w-0 border border-dashed bg-transparent": n === "dashed",
112
+ "my-0.5": p && n === "dashed"
113
+ }),
114
+ style: F
115
+ }
116
+ ),
117
+ /* @__PURE__ */ g(
118
+ "div",
119
+ {
120
+ className: i(
121
+ "flex flex-1 justify-between gap-4 leading-none",
122
+ p ? "items-end" : "items-center"
123
+ ),
124
+ children: [
125
+ /* @__PURE__ */ g("div", { className: "grid gap-1", children: [
126
+ p ? k : null,
127
+ /* @__PURE__ */ a("span", { className: "text-muted-foreground", children: u?.label ?? t.name })
128
+ ] }),
129
+ t.value !== void 0 && t.value !== null && /* @__PURE__ */ a("span", { className: "text-foreground tabular-nums", children: A(t.value) })
130
+ ]
131
+ }
132
+ )
133
+ ] })
134
+ },
135
+ t.dataKey ?? v
136
+ );
137
+ }) })
138
+ ] })
139
+ }
140
+ );
141
+ }
142
+ const X = $, I = [];
143
+ function Z({
144
+ className: e,
145
+ hideIcon: r = !1,
146
+ payload: s = I,
147
+ verticalAlign: n = "bottom",
148
+ nameKey: d
149
+ }) {
150
+ const { config: c } = j();
151
+ return s?.length ? /* @__PURE__ */ a(
152
+ "div",
153
+ {
154
+ className: i(
155
+ "flex items-center justify-center gap-4",
156
+ n === "top" ? "pb-3" : "pt-3",
157
+ e
158
+ ),
159
+ children: s.filter((o) => o.type !== "none").map((o, l) => {
160
+ const f = `${d ?? o.dataKey ?? "value"}`, h = b(c, o, f), y = S(
161
+ typeof o.color == "string" ? o.color : void 0
162
+ );
163
+ return /* @__PURE__ */ g(
164
+ "div",
165
+ {
166
+ className: i(
167
+ "[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"
168
+ ),
169
+ children: [
170
+ h?.icon && !r ? h.icon : /* @__PURE__ */ a(
171
+ "div",
172
+ {
173
+ className: "h-2 w-2 shrink-0 rounded-xs",
174
+ style: y
175
+ }
176
+ ),
177
+ h?.label ?? o.value
178
+ ]
179
+ },
180
+ o.value ?? l
181
+ );
182
+ })
183
+ }
184
+ ) : null;
185
+ }
186
+ function b(e, r, s) {
187
+ if (!m(r))
188
+ return;
189
+ const n = r, d = m(n.payload) ? n.payload : void 0;
190
+ let c = s;
191
+ const o = P(n, s);
192
+ if (o)
193
+ c = o;
194
+ else {
195
+ const l = d ? P(d, s) : void 0;
196
+ l && (c = l);
197
+ }
198
+ return e[c] ?? e[s];
199
+ }
200
+ function m(e) {
201
+ return typeof e == "object" && e !== null && !Array.isArray(e);
202
+ }
203
+ function P(e, r) {
204
+ const s = e[r];
205
+ return typeof s == "string" ? s : void 0;
206
+ }
207
+ export {
208
+ Q as ChartContainer,
209
+ X as ChartLegend,
210
+ Z as ChartLegendContent,
211
+ U as ChartTooltip,
212
+ W as ChartTooltipContent,
213
+ R as colorVarsFromConfig,
214
+ b as getPayloadConfigFromPayload
215
+ };
@@ -0,0 +1,2 @@
1
+ export { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, } from './chart';
2
+ export type { ChartConfig } from './chart';
@@ -0,0 +1,8 @@
1
+ import { ChartContainer as e, ChartLegend as n, ChartLegendContent as r, ChartTooltip as C, ChartTooltipContent as a } from "./chart.js";
2
+ export {
3
+ e as ChartContainer,
4
+ n as ChartLegend,
5
+ r as ChartLegendContent,
6
+ C as ChartTooltip,
7
+ a as ChartTooltipContent
8
+ };
@@ -0,0 +1,17 @@
1
+ import { ForwardRefExoticComponent, RefAttributes, HTMLAttributes } from 'react';
2
+ import { CheckboxRootProps } from '@base-ui/react/checkbox';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import { ClassProp } from 'class-variance-authority/types';
5
+ type Orientation = 'horizontal' | 'vertical';
6
+ declare const CheckboxGroup: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
7
+ orientation?: Orientation;
8
+ } & RefAttributes<HTMLDivElement>>;
9
+ interface CheckboxItemVariantProps {
10
+ variant?: 'default' | 'card' | null;
11
+ }
12
+ declare const checkboxItemVariants: (props?: (CheckboxItemVariantProps & ClassProp) | undefined) => string;
13
+ declare const CheckboxItem: ForwardRefExoticComponent<HTMLAttributes<HTMLLabelElement> & VariantProps<typeof checkboxItemVariants> & RefAttributes<HTMLLabelElement>>;
14
+ declare const CheckboxItemControl: ForwardRefExoticComponent<Omit<CheckboxRootProps, 'ref'> & RefAttributes<HTMLElement>>;
15
+ declare const CheckboxItemLabel: ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & RefAttributes<HTMLSpanElement>>;
16
+ declare const CheckboxItemDescription: ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & RefAttributes<HTMLSpanElement>>;
17
+ export { CheckboxGroup, CheckboxItem, CheckboxItemControl, CheckboxItemDescription, CheckboxItemLabel, };
@@ -0,0 +1,133 @@
1
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
2
+ import { forwardRef as r } from "react";
3
+ import { Checkbox as i } from "@base-ui/react/checkbox";
4
+ import { IconCheck as l, IconMinus as b } from "@tabler/icons-react";
5
+ import { cva as m } from "class-variance-authority";
6
+ import { cn as d, invalidState as h, focusState as k, selectionItemDescription as u, selectionItemLabel as x, selectionItemBase as p, selectionItemCard as g, selectionItemDefault as f } from "../../../../lib/utils.js";
7
+ const I = r(
8
+ ({ className: a, orientation: e = "vertical", role: t = "group", ...c }, n) => /* @__PURE__ */ o(
9
+ "div",
10
+ {
11
+ ref: n,
12
+ role: t,
13
+ "data-slot": "checkbox-group",
14
+ "data-orientation": e,
15
+ className: d(
16
+ e === "horizontal" ? "flex items-center gap-2" : "grid has-[[data-variant=card]]:gap-2",
17
+ a
18
+ ),
19
+ ...c
20
+ }
21
+ )
22
+ );
23
+ I.displayName = "CheckboxGroup";
24
+ const C = m(d("group/checkbox-item", p), {
25
+ variants: {
26
+ variant: {
27
+ default: f,
28
+ card: g
29
+ }
30
+ },
31
+ defaultVariants: {
32
+ variant: "default"
33
+ }
34
+ }), v = r(
35
+ ({ className: a, variant: e, ...t }, c) => /* @__PURE__ */ o(
36
+ "label",
37
+ {
38
+ ref: c,
39
+ "data-slot": "checkbox-item",
40
+ "data-variant": e ?? "default",
41
+ className: d(C({ variant: e }), a),
42
+ ...t
43
+ }
44
+ )
45
+ );
46
+ v.displayName = "CheckboxItem";
47
+ const N = r(({ className: a, ...e }, t) => /* @__PURE__ */ o(
48
+ i.Root,
49
+ {
50
+ ref: t,
51
+ "data-slot": "checkbox-item-control",
52
+ className: d(
53
+ "peer relative size-4 shrink-0 rounded-sm border-[1.5px] border-inactive-foreground bg-transparent text-foreground-on-primary outline-none transition-colors",
54
+ "[&:is([data-checked],[data-indeterminate]):not([data-disabled])]:border-transparent [&:is([data-checked],[data-indeterminate]):not([data-disabled])]:bg-primary-background",
55
+ "data-unchecked:not-data-disabled:hover:border-secondary-foreground group-hover/checkbox-item:data-unchecked:not-data-disabled:border-secondary-foreground",
56
+ "data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:border-transparent data-disabled:bg-disabled-background data-disabled:text-disabled-foreground data-disabled:data-unchecked:border-border",
57
+ "[&[data-checked]_[data-slot=checkbox-check]]:block [&[data-indeterminate]_[data-slot=checkbox-dash]]:block",
58
+ k,
59
+ h,
60
+ a
61
+ ),
62
+ ...e,
63
+ children: /* @__PURE__ */ s(
64
+ i.Indicator,
65
+ {
66
+ "data-slot": "checkbox-indicator",
67
+ className: "grid size-full place-content-center text-current transition-none",
68
+ children: [
69
+ /* @__PURE__ */ o(
70
+ l,
71
+ {
72
+ "aria-hidden": "true",
73
+ "data-slot": "checkbox-check",
74
+ className: "hidden size-3",
75
+ stroke: 3
76
+ }
77
+ ),
78
+ /* @__PURE__ */ o(
79
+ b,
80
+ {
81
+ "aria-hidden": "true",
82
+ "data-slot": "checkbox-dash",
83
+ className: "hidden size-3",
84
+ stroke: 3.5
85
+ }
86
+ )
87
+ ]
88
+ }
89
+ )
90
+ }
91
+ ));
92
+ N.displayName = "CheckboxItemControl";
93
+ const y = r(
94
+ ({ className: a, ...e }, t) => /* @__PURE__ */ o(
95
+ "span",
96
+ {
97
+ ref: t,
98
+ "data-slot": "checkbox-item-label",
99
+ className: d(
100
+ x,
101
+ "group-has-[[data-checked]]/checkbox-item:text-foreground",
102
+ "group-has-[[data-indeterminate]]/checkbox-item:text-foreground",
103
+ "group-has-[[data-disabled]]/checkbox-item:text-disabled-foreground",
104
+ a
105
+ ),
106
+ ...e
107
+ }
108
+ )
109
+ );
110
+ y.displayName = "CheckboxItemLabel";
111
+ const z = r(
112
+ ({ className: a, ...e }, t) => /* @__PURE__ */ o(
113
+ "span",
114
+ {
115
+ ref: t,
116
+ "data-slot": "checkbox-item-description",
117
+ className: d(
118
+ u,
119
+ "group-has-[[data-disabled]]/checkbox-item:text-disabled-foreground",
120
+ a
121
+ ),
122
+ ...e
123
+ }
124
+ )
125
+ );
126
+ z.displayName = "CheckboxItemDescription";
127
+ export {
128
+ I as CheckboxGroup,
129
+ v as CheckboxItem,
130
+ N as CheckboxItemControl,
131
+ z as CheckboxItemDescription,
132
+ y as CheckboxItemLabel
133
+ };
@@ -1,2 +1,2 @@
1
1
  import { ComponentMeta } from '../../../../lib/types';
2
- export declare const BadgeMetadata: ComponentMeta;
2
+ export declare const CheckboxMetadata: ComponentMeta;
@@ -0,0 +1,8 @@
1
+ const e = {
2
+ name: "Checkbox",
3
+ description: "A composable checkbox group with optional label and description slots, including a card-style item variant and support for checked, unchecked, and indeterminate states.",
4
+ llmUsage: 'Use `<CheckboxGroup>` with `<CheckboxItem>` wrapping `<CheckboxItemControl />`, plus optional `<CheckboxItemLabel>` and `<CheckboxItemDescription>`. Always pass an accessible name on `<CheckboxItemControl>` via `aria-label` (or `aria-labelledby` pointing to the label\'s id) — the wrapping `<label>` element names the underlying hidden form input, but does not name the visible `role="checkbox"` element that screen readers focus on. `<CheckboxItemDescription>` is a visual slot at this primitive layer; if you need it announced by screen readers, give it an `id` and pass `aria-describedby` to `<CheckboxItemControl>`. Use `variant="card"` on `<CheckboxItem>` for card-style options. `<CheckboxItemControl>` supports `checked`, `defaultChecked`, `indeterminate`, `onCheckedChange`, `disabled`, and `required` for form integration.'
5
+ };
6
+ export {
7
+ e as CheckboxMetadata
8
+ };
@@ -1,32 +1,29 @@
1
- import { ComponentProps, HTMLAttributes } from 'react';
1
+ import { ComponentProps, ForwardRefExoticComponent, HTMLAttributes, RefAttributes } from 'react';
2
2
  import { BundledLanguage } from 'shiki';
3
3
  import { Button } from '../button/button';
4
4
  export declare function getCollapsedPreviewDisplay(code: string): string;
5
5
  export declare function isContentLargerThanPreview(code: string): boolean;
6
6
  export declare function shouldUsePlainTextInsteadOfShiki(code: string, lineCount: number): boolean;
7
7
  export declare function plainPreMarkup(code: string): string;
8
- declare const CodeBlock: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
8
+ declare const CodeBlock: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
9
9
  code: string;
10
10
  copyText?: string;
11
11
  collapsed?: boolean;
12
12
  language: BundledLanguage;
13
13
  showLineNumbers?: boolean;
14
- } & import('react').RefAttributes<HTMLDivElement>>;
14
+ } & RefAttributes<HTMLDivElement>>;
15
15
  type CodeBlockCopyButtonProps = ComponentProps<typeof Button> & {
16
16
  onCopy?: () => void;
17
17
  onError?: (error: Error) => void;
18
18
  timeout?: number;
19
19
  };
20
- declare const CodeBlockCopyButton: import('react').ForwardRefExoticComponent<Omit<CodeBlockCopyButtonProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
21
- declare const CodeBlockCollapseButton: import('react').ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').ButtonProps & import('class-variance-authority').VariantProps<(props?: ({
22
- variant?: "default" | "secondary" | "outline" | "ghost" | "destructive" | null | undefined;
23
- size?: "icon" | "default" | "sm" | "lg" | "icon-sm" | "icon-lg" | null | undefined;
24
- } & import('class-variance-authority/types').ClassProp) | undefined) => string>, "ref"> & import('react').RefAttributes<HTMLElement>, "ref"> & import('react').RefAttributes<HTMLElement>>;
20
+ declare const CodeBlockCopyButton: ForwardRefExoticComponent<Omit<CodeBlockCopyButtonProps, 'ref'> & RefAttributes<HTMLElement>>;
21
+ declare const CodeBlockCollapseButton: ForwardRefExoticComponent<Omit<ComponentProps<typeof Button>, 'ref'> & RefAttributes<HTMLElement>>;
25
22
  type CodeBlockDownloadButtonProps = ComponentProps<typeof Button> & {
26
23
  fileName?: string;
27
24
  mimeType?: string;
28
25
  onDownload?: () => void;
29
26
  onError?: (error: Error) => void;
30
27
  };
31
- declare const CodeBlockDownloadButton: import('react').ForwardRefExoticComponent<Omit<CodeBlockDownloadButtonProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
28
+ declare const CodeBlockDownloadButton: ForwardRefExoticComponent<Omit<CodeBlockDownloadButtonProps, 'ref'> & RefAttributes<HTMLElement>>;
32
29
  export { CodeBlock, CodeBlockCollapseButton, CodeBlockCopyButton, CodeBlockDownloadButton, };
@@ -1,9 +1,9 @@
1
1
  import { jsxs as L, jsx as r } from "react/jsx-runtime";
2
- import { createContext as F, forwardRef as w, useState as x, useMemo as D, useEffect as O, useContext as H } from "react";
3
- import { IconCheck as K, IconCopy as V, IconSelector as $, IconDownload as q } from "@tabler/icons-react";
2
+ import { forwardRef as w, useState as x, useMemo as D, useEffect as F, useContext as H, createContext as O } from "react";
3
+ import { IconSelector as K, IconCheck as V, IconCopy as $, IconDownload as q } from "@tabler/icons-react";
4
4
  import { isStorybookTestEnv as v, highlightCode as M, cn as f } from "../../../../lib/utils.js";
5
5
  import { Button as S } from "../button/button.js";
6
- const I = F({
6
+ const I = O({
7
7
  code: "",
8
8
  copyText: "",
9
9
  isCollapsed: !1,
@@ -48,7 +48,7 @@ const ee = "min(60vh, 32rem)", oe = "dark:hidden [&>pre]:m-0 [&>pre]:min-h-10 [&
48
48
  () => v ? `<pre><code>${P(s)}</code></pre>` : "",
49
49
  [s]
50
50
  );
51
- O(() => {
51
+ F(() => {
52
52
  if (v) return;
53
53
  let g = !1;
54
54
  const B = (u) => {
@@ -169,51 +169,55 @@ const ee = "min(60vh, 32rem)", oe = "dark:hidden [&>pre]:m-0 [&>pre]:min-h-10 [&
169
169
  }
170
170
  );
171
171
  ne.displayName = "CodeBlock";
172
- const re = w(({ onCopy: e, onError: t, timeout: n = 2e3, children: o, className: a, ...h }, i) => {
173
- const [C, k] = x(!1), { copyText: b } = H(I), d = async () => {
174
- if (typeof window > "u" || !navigator?.clipboard?.writeText) {
175
- t?.(new Error("Clipboard API not available"));
176
- return;
177
- }
178
- try {
179
- await navigator.clipboard.writeText(b), k(!0), e?.(), setTimeout(() => k(!1), n);
180
- } catch (c) {
181
- console.warn("Clipboard write failed:", c), t?.(
182
- c instanceof Error ? c : new Error("Clipboard write failed")
183
- );
184
- }
185
- }, p = C ? K : V;
186
- return /* @__PURE__ */ r(
187
- S,
188
- {
189
- ref: i,
190
- "data-slot": "code-block-copy-button",
191
- className: f("shrink-0", a),
192
- onClick: d,
193
- size: "icon-sm",
194
- variant: "secondary",
195
- ...h,
196
- children: o ?? /* @__PURE__ */ r(p, { size: 14 })
197
- }
198
- );
199
- });
172
+ const re = w(
173
+ ({ onCopy: e, onError: t, timeout: n = 2e3, children: o, className: a, ...h }, i) => {
174
+ const [C, k] = x(!1), { copyText: b } = H(I), d = async () => {
175
+ if (typeof window > "u" || !navigator?.clipboard?.writeText) {
176
+ t?.(new Error("Clipboard API not available"));
177
+ return;
178
+ }
179
+ try {
180
+ await navigator.clipboard.writeText(b), k(!0), e?.(), setTimeout(() => k(!1), n);
181
+ } catch (c) {
182
+ console.warn("Clipboard write failed:", c), t?.(
183
+ c instanceof Error ? c : new Error("Clipboard write failed")
184
+ );
185
+ }
186
+ }, p = C ? V : $;
187
+ return /* @__PURE__ */ r(
188
+ S,
189
+ {
190
+ ref: i,
191
+ "data-slot": "code-block-copy-button",
192
+ className: f("shrink-0", a),
193
+ onClick: d,
194
+ size: "icon-sm",
195
+ variant: "secondary",
196
+ ...h,
197
+ children: o ?? /* @__PURE__ */ r(p, { size: 14 })
198
+ }
199
+ );
200
+ }
201
+ );
200
202
  re.displayName = "CodeBlockCopyButton";
201
- const le = w(({ children: e, className: t, ...n }, o) => {
202
- const { isCollapsed: a, setIsCollapsed: h, lineCount: i } = H(I);
203
- return i <= 1 ? null : /* @__PURE__ */ r(
204
- S,
205
- {
206
- ref: o,
207
- "data-slot": "code-block-collapse-button",
208
- className: f("shrink-0", t),
209
- onClick: () => h(!a),
210
- size: "icon-sm",
211
- variant: "secondary",
212
- ...n,
213
- children: e ?? /* @__PURE__ */ r($, { size: 14 })
214
- }
215
- );
216
- });
203
+ const le = w(
204
+ ({ children: e, className: t, ...n }, o) => {
205
+ const { isCollapsed: a, setIsCollapsed: h, lineCount: i } = H(I);
206
+ return i <= 1 ? null : /* @__PURE__ */ r(
207
+ S,
208
+ {
209
+ ref: o,
210
+ "data-slot": "code-block-collapse-button",
211
+ className: f("shrink-0", t),
212
+ onClick: () => h(!a),
213
+ size: "icon-sm",
214
+ variant: "secondary",
215
+ ...n,
216
+ children: e ?? /* @__PURE__ */ r(K, { size: 14 })
217
+ }
218
+ );
219
+ }
220
+ );
217
221
  le.displayName = "CodeBlockCollapseButton";
218
222
  const ae = w(
219
223
  ({
@@ -1,4 +1,6 @@
1
- declare const Collapsible: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').CollapsibleRootProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
2
- declare const CollapsibleTrigger: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').CollapsibleTriggerProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
3
- declare const CollapsibleContent: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').CollapsiblePanelProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
1
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
2
+ import { CollapsiblePanelProps, CollapsibleRootProps, CollapsibleTriggerProps } from '@base-ui/react/collapsible';
3
+ declare const Collapsible: ForwardRefExoticComponent<Omit<CollapsibleRootProps, 'ref'> & RefAttributes<HTMLDivElement>>;
4
+ declare const CollapsibleTrigger: ForwardRefExoticComponent<Omit<CollapsibleTriggerProps, 'ref'> & RefAttributes<HTMLButtonElement>>;
5
+ declare const CollapsibleContent: ForwardRefExoticComponent<Omit<CollapsiblePanelProps, 'ref'> & RefAttributes<HTMLDivElement>>;
4
6
  export { Collapsible, CollapsibleContent, CollapsibleTrigger };
@@ -1,4 +1,4 @@
1
- import { ComponentProps } from 'react';
1
+ import { ForwardRefExoticComponent, RefAttributes, ComponentProps } from 'react';
2
2
  import { Button } from '../button/button';
3
3
  type ComboboxProps = Omit<ComponentProps<typeof Button>, 'value' | 'onChange'> & {
4
4
  options: Array<{
@@ -11,5 +11,5 @@ type ComboboxProps = Omit<ComponentProps<typeof Button>, 'value' | 'onChange'> &
11
11
  searchPlaceholder?: string;
12
12
  emptyText?: string;
13
13
  };
14
- declare const Combobox: import('react').ForwardRefExoticComponent<Omit<ComboboxProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
14
+ declare const Combobox: ForwardRefExoticComponent<Omit<ComboboxProps, 'ref'> & RefAttributes<HTMLElement>>;
15
15
  export { Combobox };