@ngrok/mantle 0.80.0 → 0.81.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 (172) hide show
  1. package/dist/accordion.d.ts +13 -31
  2. package/dist/accordion.js +1 -1
  3. package/dist/agent.json +5 -1
  4. package/dist/alert-dialog.d.ts +15 -48
  5. package/dist/alert-dialog.js +1 -1
  6. package/dist/alert.d.ts +8 -26
  7. package/dist/alert.js +1 -1
  8. package/dist/{anchor-_2meGDfj.js → anchor-DfeXTpKW.js} +1 -1
  9. package/dist/anchor.js +1 -1
  10. package/dist/area-chart.d.ts +504 -0
  11. package/dist/area-chart.js +1 -0
  12. package/dist/badge.js +1 -1
  13. package/dist/bar-chart.d.ts +491 -0
  14. package/dist/bar-chart.js +1 -0
  15. package/dist/breadcrumb.d.ts +6 -24
  16. package/dist/breadcrumb.js +1 -1
  17. package/dist/button-BAno7KIU.js +1 -0
  18. package/dist/{index-C2jj8U4a.d.ts → button-C-gMbPso.d.ts} +2 -2
  19. package/dist/{icon-button-C1AfGnQx.d.ts → button-C7vAl6lS.d.ts} +16 -3
  20. package/dist/{button-BPMwa2jN.d.ts → button-DARFK2KJ.d.ts} +1 -1
  21. package/dist/{button-5WsvzIQ6.js → button-DjpEKt2X.js} +1 -1
  22. package/dist/button-DvHMWAPl.js +1 -0
  23. package/dist/button.d.ts +5 -5
  24. package/dist/button.js +1 -1
  25. package/dist/calendar.js +1 -1
  26. package/dist/card.d.ts +5 -20
  27. package/dist/card.js +1 -1
  28. package/dist/centered-layout.d.ts +5 -20
  29. package/dist/centered-layout.js +1 -1
  30. package/dist/chart-BROa2gqt.js +2 -0
  31. package/dist/chart-BcOC6Qj0.d.ts +275 -0
  32. package/dist/checkbox-0EoxOyMA.js +1 -0
  33. package/dist/checkbox.d.ts +1 -1
  34. package/dist/checkbox.js +1 -1
  35. package/dist/choice-BHwFSSyv.js +1 -0
  36. package/dist/{choice-Ct0KK8jw.d.ts → choice-BNRQXszu.d.ts} +5 -20
  37. package/dist/choice.d.ts +1 -1
  38. package/dist/choice.js +1 -1
  39. package/dist/code-block.d.ts +14 -44
  40. package/dist/code-block.js +6 -6
  41. package/dist/code-block_highlight-utils.d.ts +1 -1
  42. package/dist/code-block_highlight-utils.js +1 -1
  43. package/dist/combobox.d.ts +9 -33
  44. package/dist/combobox.js +1 -1
  45. package/dist/command.d.ts +3 -9
  46. package/dist/command.js +1 -1
  47. package/dist/data-table.d.ts +6 -12
  48. package/dist/data-table.js +1 -1
  49. package/dist/description-list.d.ts +4 -16
  50. package/dist/description-list.js +1 -1
  51. package/dist/{primitive-CJRIlrLz.d.ts → dialog-BM4wPCft.d.ts} +9 -16
  52. package/dist/dialog-DWZWd5Jt.js +1 -0
  53. package/dist/dialog.d.ts +13 -43
  54. package/dist/dialog.js +1 -1
  55. package/dist/{dropdown-menu-CoyozLzy.d.ts → dropdown-menu-DZg-Cd69.d.ts} +18 -54
  56. package/dist/dropdown-menu-Dw-OtXPm.d.ts +1 -0
  57. package/dist/dropdown-menu-RyDWoKHx.js +1 -0
  58. package/dist/dropdown-menu.d.ts +2 -2
  59. package/dist/dropdown-menu.js +1 -1
  60. package/dist/empty.d.ts +6 -21
  61. package/dist/empty.js +1 -1
  62. package/dist/field-B1wqeZr4.js +1 -0
  63. package/dist/field.d.ts +15 -45
  64. package/dist/field.js +1 -1
  65. package/dist/hooks.js +1 -1
  66. package/dist/hover-card.d.ts +3 -12
  67. package/dist/hover-card.js +1 -1
  68. package/dist/{svg-only-CdI_v82i.d.ts → icon-CX_gj6sW.d.ts} +1 -1
  69. package/dist/{icon-BDqpcZ-n.d.ts → icon-k4E9yNWD.d.ts} +1 -1
  70. package/dist/icon-lZ48P8Nn.js +1 -0
  71. package/dist/icon.d.ts +3 -3
  72. package/dist/icon.js +1 -1
  73. package/dist/icons-DLCs1hLP.js +1 -0
  74. package/dist/icons.d.ts +2 -2
  75. package/dist/icons.js +1 -1
  76. package/dist/input-BnlpQF0c.js +1 -0
  77. package/dist/{input-DV9M6K4v.d.ts → input-BuYDU6CF.d.ts} +1 -1
  78. package/dist/input.d.ts +2 -2
  79. package/dist/input.js +1 -1
  80. package/dist/line-chart.d.ts +490 -0
  81. package/dist/line-chart.js +1 -0
  82. package/dist/{virtual-UrzmaSQm.js → list-51KQvENW.js} +1 -1
  83. package/dist/list.d.ts +5 -20
  84. package/dist/list.js +1 -1
  85. package/dist/llms.txt +5 -1
  86. package/dist/mantle-dark-high-contrast.css +17 -0
  87. package/dist/mantle-dark.css +13 -0
  88. package/dist/mantle-light-high-contrast.css +15 -0
  89. package/dist/mantle.css +29 -0
  90. package/dist/media-object.d.ts +3 -12
  91. package/dist/media-object.js +1 -1
  92. package/dist/multi-select.d.ts +14 -53
  93. package/dist/multi-select.js +1 -1
  94. package/dist/otp-input.d.ts +5 -17
  95. package/dist/otp-input.js +1 -1
  96. package/dist/pagination.d.ts +5 -14
  97. package/dist/pagination.js +1 -1
  98. package/dist/{index-B8mIWKIU.d.ts → popover-CE4OlWkd.d.ts} +1 -4
  99. package/dist/popover-CQ9s7jG5.js +1 -0
  100. package/dist/popover.d.ts +1 -1
  101. package/dist/popover.js +1 -1
  102. package/dist/primitive-trJDqIXJ.js +1 -0
  103. package/dist/progress.d.ts +2 -8
  104. package/dist/progress.js +1 -1
  105. package/dist/qr-code.d.ts +4 -16
  106. package/dist/qr-code.js +1 -1
  107. package/dist/radio-group.d.ts +10 -40
  108. package/dist/radio-group.js +1 -1
  109. package/dist/scatter-plot.d.ts +495 -0
  110. package/dist/scatter-plot.js +1 -0
  111. package/dist/{select-idm1jy7y.d.ts → select-0z7HVS6r.d.ts} +8 -29
  112. package/dist/select-BCHWvmyC.js +1 -0
  113. package/dist/select.d.ts +1 -1
  114. package/dist/select.js +1 -1
  115. package/dist/selectable-list.d.ts +11 -38
  116. package/dist/selectable-list.js +1 -1
  117. package/dist/sheet.d.ts +12 -39
  118. package/dist/sheet.js +1 -1
  119. package/dist/skip-to-main-link.js +1 -1
  120. package/dist/slider.js +1 -1
  121. package/dist/slot.d.ts +1 -1
  122. package/dist/split-button.d.ts +9 -24
  123. package/dist/split-button.js +1 -1
  124. package/dist/switch.d.ts +1 -1
  125. package/dist/switch.js +1 -1
  126. package/dist/{table-DUSvU_Jw.d.ts → table-Bo0vNxIJ.d.ts} +9 -36
  127. package/dist/table-CGxJwtbL.js +1 -0
  128. package/dist/table.d.ts +1 -1
  129. package/dist/table.js +1 -1
  130. package/dist/tabs.d.ts +21 -36
  131. package/dist/tabs.js +1 -1
  132. package/dist/text-area.d.ts +1 -1
  133. package/dist/text-area.js +1 -1
  134. package/dist/theme-C26-Xolp.js +1 -0
  135. package/dist/theme-switcher.d.ts +6 -15
  136. package/dist/theme-switcher.js +1 -1
  137. package/dist/theme.d.ts +1 -1
  138. package/dist/theme.js +1 -1
  139. package/dist/toast.d.ts +5 -17
  140. package/dist/toast.js +1 -1
  141. package/dist/tooltip.d.ts +26 -8
  142. package/dist/tooltip.js +1 -1
  143. package/package.json +7 -1
  144. package/dist/checkbox-Cq17y0-R.js +0 -1
  145. package/dist/choice-Cc8dA5r8.js +0 -1
  146. package/dist/dialog-CQ2C6vkE.js +0 -1
  147. package/dist/dropdown-menu-CSCDdA3K.js +0 -1
  148. package/dist/field-context-BR01g789.js +0 -1
  149. package/dist/icon-CGgMKpJg.js +0 -1
  150. package/dist/icon-button-DiOhreJD.js +0 -1
  151. package/dist/index-CdPXa9h1.d.ts +0 -1
  152. package/dist/input-CVyAVbim.js +0 -1
  153. package/dist/popover-CBMADtjV.js +0 -1
  154. package/dist/primitive-DCPHJsRs.js +0 -1
  155. package/dist/select-SR_9-bxA.js +0 -1
  156. package/dist/table-GDkapNFi.js +0 -1
  157. package/dist/theme-provider-BftkIiZn.js +0 -1
  158. package/dist/theme-wVnzzx2F.js +0 -1
  159. package/dist/toast-DKgMRv4F.js +0 -1
  160. /package/dist/{sizes-BCoI4bhP.d.ts → button-BCoI4bhP.d.ts} +0 -0
  161. /package/dist/{intents-DdSKSj1c.d.ts → button-DdSKSj1c.d.ts} +0 -0
  162. /package/dist/{resolve-pre-rendered-props-B6OlZrSI.d.ts → code-block-B6OlZrSI.d.ts} +0 -0
  163. /package/dist/{resolve-pre-rendered-props-C9uaM9-V.js → code-block-C9uaM9-V.js} +0 -0
  164. /package/dist/{validation-7QeiTFwl.d.ts → field-7QeiTFwl.d.ts} +0 -0
  165. /package/dist/{validation-Bpptk_9t.js → field-Bpptk_9t.js} +0 -0
  166. /package/dist/{types-D1RY5Tcj.d.ts → icon-D1RY5Tcj.d.ts} +0 -0
  167. /package/dist/{svg-only-d-nMCfAI.js → icon-d-nMCfAI.js} +0 -0
  168. /package/dist/{sort-B_DDQcVD.js → icons-B_DDQcVD.js} +0 -0
  169. /package/dist/{traffic-policy-file-CF1lbWtp.js → icons-CF1lbWtp.js} +0 -0
  170. /package/dist/{is-input-CXmS0OFN.js → input-CXmS0OFN.js} +0 -0
  171. /package/dist/{index-BtwKJTLq.d.ts → slot-BtwKJTLq.d.ts} +0 -0
  172. /package/dist/{themes-CYNpplwN.d.ts → theme-CYNpplwN.d.ts} +0 -0
@@ -61,10 +61,7 @@ type ChoiceRootProps = Omit<ComponentProps<"div">, "id"> & {
61
61
  * </Choice.Root>
62
62
  * ```
63
63
  */
64
- declare const Root: {
65
- ({ "aria-describedby": ariaDescribedBy, "aria-errormessage": ariaErrorMessage, "aria-invalid": ariaInvalid, children, className, disabled, id, name, ref, ...props }: ChoiceRootProps): import("react").JSX.Element;
66
- displayName: string;
67
- };
64
+ declare const Root: ({ "aria-describedby": ariaDescribedBy, "aria-errormessage": ariaErrorMessage, "aria-invalid": ariaInvalid, children, className, disabled, id, name, ref, ...props }: ChoiceRootProps) => import("react").JSX.Element;
68
65
  type ChoiceIndicatorProps = ComponentProps<"span">;
69
66
  /**
70
67
  * The left control slot of a `Choice` — drop the control here (a `Checkbox`, a
@@ -92,10 +89,7 @@ type ChoiceIndicatorProps = ComponentProps<"span">;
92
89
  * </Choice.Root>
93
90
  * ```
94
91
  */
95
- declare const Indicator: {
96
- ({ children, className, ref, ...props }: ChoiceIndicatorProps): import("react").JSX.Element;
97
- displayName: string;
98
- };
92
+ declare const Indicator: ({ children, className, ref, ...props }: ChoiceIndicatorProps) => import("react").JSX.Element;
99
93
  type ChoiceContentProps = ComponentProps<"div"> & WithAsChild;
100
94
  /**
101
95
  * The right column of a `Choice` — stacks a `Choice.Label` / `Choice.Title` over
@@ -117,10 +111,7 @@ type ChoiceContentProps = ComponentProps<"div"> & WithAsChild;
117
111
  * </Choice.Root>
118
112
  * ```
119
113
  */
120
- declare const Content: {
121
- ({ asChild, className, ref, ...props }: ChoiceContentProps): import("react").JSX.Element;
122
- displayName: string;
123
- };
114
+ declare const Content: ({ asChild, className, ref, ...props }: ChoiceContentProps) => import("react").JSX.Element;
124
115
  /**
125
116
  * Props for `Choice.Label`. The mantle `Label` props, minus `htmlFor` and
126
117
  * `disabled` — those are owned by `Choice.Root` (the control id and the choice's
@@ -181,10 +172,7 @@ declare const ChoiceLabel: ({ className, ref, ...props }: ChoiceLabelProps) => i
181
172
  * </Choice.Root>
182
173
  * ```
183
174
  */
184
- declare const Title: {
185
- ({ asChild, className, ref, ...props }: ComponentProps<"p"> & WithAsChild): import("react").JSX.Element;
186
- displayName: string;
187
- };
175
+ declare const Title: ({ asChild, className, ref, ...props }: ComponentProps<"p"> & WithAsChild) => import("react").JSX.Element;
188
176
  /**
189
177
  * The de-emphasized supplementary line of a `Choice`, in the muted body color
190
178
  * and wired to the control via `aria-describedby` (never a second label).
@@ -205,10 +193,7 @@ declare const Title: {
205
193
  * </Choice.Root>
206
194
  * ```
207
195
  */
208
- declare const Description: {
209
- ({ asChild, className, ref, ...props }: ComponentProps<"p"> & WithAsChild): import("react").JSX.Element;
210
- displayName: string;
211
- };
196
+ declare const Description: ({ asChild, className, ref, ...props }: ComponentProps<"p"> & WithAsChild) => import("react").JSX.Element;
212
197
  /**
213
198
  * A reusable indicator-left / content-right layout for a single choice: a
214
199
  * control (checkbox, radio, switch) beside an emphasized title and an optional
package/dist/choice.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as ChoiceRootProps, t as Choice } from "./choice-Ct0KK8jw.js";
1
+ import { n as ChoiceRootProps, t as Choice } from "./choice-BNRQXszu.js";
2
2
  export { Choice, type ChoiceRootProps };
package/dist/choice.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./choice-Cc8dA5r8.js";export{e as Choice};
1
+ import{t as e}from"./choice-BHwFSSyv.js";export{e as Choice};
@@ -1,6 +1,6 @@
1
1
  import { n as WithAsChild, t as SelfClosingWithAsChild } from "./as-child-D23mGo4f.js";
2
- import { t as SvgAttributes } from "./types-D1RY5Tcj.js";
3
- import { A as FoldStrategy, B as computeJsonFoldRanges, C as Indentation, D as FoldExplanation, E as ComputeFoldRangesInput, F as isSupportedLanguage, H as finalizeFoldRanges, I as parseLanguage, L as supportedLanguages, M as computeFoldRanges, N as foldStrategyFor, O as FoldLine, P as SupportedLanguage, S as normalizeIndentation, T as isIndentation, U as LineRange, V as FoldableRange, _ as MantleCodeBlockValue, a as Mode, c as ResolvedPreRenderedCodeBlockProps, d as parseMetastring, f as resolvePreRenderedCodeBlockProps, g as parseCodeBlockShowLineNumbers, h as parseCodeBlockLineNumberStart, i as MetaInput, j as FoldToken, k as FoldScope, l as defaultMeta, m as parseCodeBlockHighlightLines, n as DefaultMeta, o as ResolvePreRenderedCodeBlockPropsInput, p as tokenizeMetastring, r as Meta, s as ResolvePreRenderedCodeBlockPropsResult, t as CodeBlockPreElementInput, u as normalizeValue, v as MantleCodeOptions, w as inferIndentation, x as mantleCode, y as createMantleCodeBlockValue, z as decorateHighlightedHtml } from "./resolve-pre-rendered-props-B6OlZrSI.js";
2
+ import { t as SvgAttributes } from "./icon-D1RY5Tcj.js";
3
+ import { A as FoldStrategy, B as computeJsonFoldRanges, C as Indentation, D as FoldExplanation, E as ComputeFoldRangesInput, F as isSupportedLanguage, H as finalizeFoldRanges, I as parseLanguage, L as supportedLanguages, M as computeFoldRanges, N as foldStrategyFor, O as FoldLine, P as SupportedLanguage, S as normalizeIndentation, T as isIndentation, U as LineRange, V as FoldableRange, _ as MantleCodeBlockValue, a as Mode, c as ResolvedPreRenderedCodeBlockProps, d as parseMetastring, f as resolvePreRenderedCodeBlockProps, g as parseCodeBlockShowLineNumbers, h as parseCodeBlockLineNumberStart, i as MetaInput, j as FoldToken, k as FoldScope, l as defaultMeta, m as parseCodeBlockHighlightLines, n as DefaultMeta, o as ResolvePreRenderedCodeBlockPropsInput, p as tokenizeMetastring, r as Meta, s as ResolvePreRenderedCodeBlockPropsResult, t as CodeBlockPreElementInput, u as normalizeValue, v as MantleCodeOptions, w as inferIndentation, x as mantleCode, y as createMantleCodeBlockValue, z as decorateHighlightedHtml } from "./code-block-B6OlZrSI.js";
4
4
  import { ComponentProps, ReactNode } from "react";
5
5
  import { Content, List, Trigger } from "@radix-ui/react-tabs";
6
6
  //#region src/components/code-block/code-block.d.ts
@@ -43,10 +43,7 @@ type CodeBlockRootProps = Omit<ComponentProps<"div">, "align"> & WithAsChild & {
43
43
  * </CodeBlock.Root>
44
44
  * ```
45
45
  */
46
- declare const Root$1: {
47
- ({ asChild, className, defaultTab, activeTab, onActiveTabChange, ref, ...props }: CodeBlockRootProps): import("react").JSX.Element;
48
- displayName: string;
49
- };
46
+ declare const Root$1: ({ asChild, className, defaultTab, activeTab, onActiveTabChange, ref, ...props }: CodeBlockRootProps) => import("react").JSX.Element;
50
47
  /**
51
48
  * The body of the `CodeBlock`. This is where `CodeBlock.Code` and
52
49
  * the optional `CodeBlock.CopyButton` are rendered.
@@ -66,10 +63,7 @@ declare const Root$1: {
66
63
  * </CodeBlock.Root>
67
64
  * ```
68
65
  */
69
- declare const Body: {
70
- ({ asChild, className, ref, ...props }: ComponentProps<"div"> & WithAsChild): import("react").JSX.Element;
71
- displayName: string;
72
- };
66
+ declare const Body: ({ asChild, className, ref, ...props }: ComponentProps<"div"> & WithAsChild) => import("react").JSX.Element;
73
67
  type CodeBlockCodeProps = Omit<ComponentProps<"pre">, "children"> & {
74
68
  /**
75
69
  * The code value produced by `mantleCode("lang")` tagged template.
@@ -99,10 +93,7 @@ type CodeBlockCodeProps = Omit<ComponentProps<"pre">, "children"> & {
99
93
  * </CodeBlock.Root>
100
94
  * ```
101
95
  */
102
- declare const Code: {
103
- ({ className, style, value, ref, ...props }: CodeBlockCodeProps): import("react").JSX.Element;
104
- displayName: string;
105
- };
96
+ declare const Code: ({ className, style, value, ref, ...props }: CodeBlockCodeProps) => import("react").JSX.Element;
106
97
  /**
107
98
  * The (optional) header slot of the `CodeBlock`. This is where
108
99
  * `CodeBlock.Icon` and `CodeBlock.Title` are rendered.
@@ -122,10 +113,7 @@ declare const Code: {
122
113
  * </CodeBlock.Root>
123
114
  * ```
124
115
  */
125
- declare const Header: {
126
- ({ asChild, className, ref, ...props }: ComponentProps<"div"> & WithAsChild): import("react").JSX.Element;
127
- displayName: string;
128
- };
116
+ declare const Header: ({ asChild, className, ref, ...props }: ComponentProps<"div"> & WithAsChild) => import("react").JSX.Element;
129
117
  /**
130
118
  * The (optional) title of the `CodeBlock`. Renders as `h3` by default;
131
119
  * use `asChild` to render a different element.
@@ -145,12 +133,9 @@ declare const Header: {
145
133
  * </CodeBlock.Root>
146
134
  * ```
147
135
  */
148
- declare const Title: {
149
- ({ asChild, className, ref, ...props }: ComponentProps<"h3"> & {
150
- asChild?: boolean;
151
- }): import("react").JSX.Element;
152
- displayName: string;
153
- };
136
+ declare const Title: ({ asChild, className, ref, ...props }: ComponentProps<"h3"> & {
137
+ asChild?: boolean;
138
+ }) => import("react").JSX.Element;
154
139
  type CodeBlockCopyButtonProps = Omit<ComponentProps<"button">, "children" | "type"> & SelfClosingWithAsChild & {
155
140
  /**
156
141
  * The accessible label for the copy button. This label will be visually hidden but announced to screen reader users, similar to alt text for img tags.
@@ -186,10 +171,7 @@ type CodeBlockCopyButtonProps = Omit<ComponentProps<"button">, "children" | "typ
186
171
  * </CodeBlock.Root>
187
172
  * ```
188
173
  */
189
- declare const CopyButton: {
190
- ({ className, label, onCopy, onCopyError, onClick, ref, ...props }: CodeBlockCopyButtonProps): import("react").JSX.Element;
191
- displayName: string;
192
- };
174
+ declare const CopyButton: ({ className, label, onCopy, onCopyError, onClick, ref, ...props }: CodeBlockCopyButtonProps) => import("react").JSX.Element;
193
175
  type CodeBlockExpanderButtonProps = Omit<ComponentProps<"button">, "children" | "aria-controls" | "aria-expanded"> & WithAsChild;
194
176
  /**
195
177
  * The (optional) expander button of the `CodeBlock`. Toggles the expanded
@@ -210,10 +192,7 @@ type CodeBlockExpanderButtonProps = Omit<ComponentProps<"button">, "children" |
210
192
  * </CodeBlock.Root>
211
193
  * ```
212
194
  */
213
- declare const ExpanderButton: {
214
- ({ asChild, className, onClick, ref, ...props }: CodeBlockExpanderButtonProps): import("react").JSX.Element;
215
- displayName: string;
216
- };
195
+ declare const ExpanderButton: ({ asChild, className, onClick, ref, ...props }: CodeBlockExpanderButtonProps) => import("react").JSX.Element;
217
196
  type CodeBlockIconProps = Omit<SvgAttributes, "children"> & ({
218
197
  /**
219
198
  * A custom icon SVG to display in the code block header.
@@ -290,10 +269,7 @@ type CodeBlockTabListProps = Omit<ComponentProps<typeof List>, "asChild" | "loop
290
269
  * </CodeBlock.Root>
291
270
  * ```
292
271
  */
293
- declare const TabList: {
294
- ({ className, ref, ...props }: CodeBlockTabListProps): import("react").JSX.Element;
295
- displayName: string;
296
- };
272
+ declare const TabList: ({ className, ref, ...props }: CodeBlockTabListProps) => import("react").JSX.Element;
297
273
  type CodeBlockTabTriggerProps = Omit<ComponentProps<typeof Trigger>, "asChild">;
298
274
  /**
299
275
  * A pill-styled tab trigger for the `CodeBlock` header.
@@ -307,10 +283,7 @@ type CodeBlockTabTriggerProps = Omit<ComponentProps<typeof Trigger>, "asChild">;
307
283
  * </CodeBlock.TabList>
308
284
  * ```
309
285
  */
310
- declare const TabTrigger: {
311
- ({ className, ref, ...props }: CodeBlockTabTriggerProps): import("react").JSX.Element;
312
- displayName: string;
313
- };
286
+ declare const TabTrigger: ({ className, ref, ...props }: CodeBlockTabTriggerProps) => import("react").JSX.Element;
314
287
  type CodeBlockTabContentProps = Omit<ComponentProps<typeof Content>, "asChild" | "forceMount">;
315
288
  /**
316
289
  * Conditionally renders its children when the associated tab is active.
@@ -330,10 +303,7 @@ type CodeBlockTabContentProps = Omit<ComponentProps<typeof Content>, "asChild" |
330
303
  * </CodeBlock.Body>
331
304
  * ```
332
305
  */
333
- declare const TabContent: {
334
- (props: CodeBlockTabContentProps): import("react").JSX.Element;
335
- displayName: string;
336
- };
306
+ declare const TabContent: (props: CodeBlockTabContentProps) => import("react").JSX.Element;
337
307
  /**
338
308
  * Shiki-powered code blocks with build-time syntax highlighting and zero browser bundle.
339
309
  *
@@ -1,7 +1,7 @@
1
- import{t as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./icon-CGgMKpJg.js";import{t as r}from"./slot-CDk0Bb9z.js";import{t as i}from"./icon-button-DiOhreJD.js";import{t as a}from"./use-copy-to-clipboard-DqQ0_N3E.js";import{t as o}from"./traffic-policy-file-CF1lbWtp.js";import{S as s,_ as c,a as l,b as u,c as d,d as f,f as p,g as m,h,i as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as T,v as E,y as D}from"./resolve-pre-rendered-props-C9uaM9-V.js";import{CaretDownIcon as O}from"@phosphor-icons/react/CaretDown";import{createContext as k,useCallback as A,useContext as ee,useEffect as j,useId as te,useLayoutEffect as ne,useMemo as M,useRef as N,useState as P}from"react";import F from"tiny-invariant";import{jsx as I,jsxs as re}from"react/jsx-runtime";import{CheckIcon as ie}from"@phosphor-icons/react/Check";import{CopyIcon as ae}from"@phosphor-icons/react/Copy";import{FileTextIcon as oe}from"@phosphor-icons/react/FileText";import{TerminalIcon as se}from"@phosphor-icons/react/Terminal";import{Content as ce,List as le,Root as ue,Trigger as de}from"@radix-ui/react-tabs";function L(e){let t=-1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`&`||r===`<`||r===`>`||r===`"`||r===`'`){t=n;break}}if(t===-1)return e;let n=e.slice(0,t);for(let r=t;r<e.length;r++){let t=e[r];switch(t){case`&`:n+=`&amp;`;break;case`<`:n+=`&lt;`;break;case`>`:n+=`&gt;`;break;case`"`:n+=`&quot;`;break;case`'`:n+=`&#39;`;break;default:n+=t}}return n}const R=new WeakMap;function fe(e){let t=new Set;if(e==null||e===``)return t;for(let n of e.split(` `))n!==``&&t.add(n);return t}function pe(e){let t=R.get(e);if(t!=null&&ge(t))return t;let n=new Map,r=new WeakMap,i=e.querySelectorAll(`[data-fold-regions]`);for(let e=0;e<i.length;e+=1){let t=i[e];if(!(t instanceof HTMLElement))continue;let a=fe(t.dataset.foldRegions);if(a.size!==0){r.set(t,a);for(let e of a){let r=n.get(e);r??(r=[],n.set(e,r)),r.push(t)}}}let a={regionToLines:n,lineToRegions:r};return R.set(e,a),a}function me(e){R.delete(e)}function he(e){me(e),e.removeAttribute(`data-folded-regions`)}function ge(e){for(let t of e.regionToLines.values()){if(t.length===0)continue;let e=t[0];if(e!=null)return e.isConnected}return!0}function _e(e,t,n){let r=!1;for(let e of n)if(t.has(e)){r=!0;break}r?e.dataset.foldHidden=`true`:delete e.dataset.foldHidden}function ve(e){let t=e.dataset.foldLine;if(t==null||t===``)return!1;let n=e.closest(`[data-slot='code-block-code']`)?.querySelector(`code`);if(n==null)return!1;let r=fe(n.getAttribute(`data-folded-regions`)),i=!r.has(t);i?r.add(t):r.delete(t),r.size===0?n.removeAttribute(`data-folded-regions`):n.setAttribute(`data-folded-regions`,[...r].join(` `)),e.setAttribute(`aria-expanded`,i?`false`:`true`);let{regionToLines:a,lineToRegions:o}=pe(n),s=a.get(t);if(s!=null)for(let e of s){let t=o.get(e);t!=null&&_e(e,r,t)}return!0}function ye(e){let t=e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`.mantle-code-fold-toggle`);n instanceof HTMLButtonElement&&ve(n)};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}}const z=k(null);function B(){let e=ee(z);return F(e!=null,`CodeBlock subcomponents must be rendered within a <CodeBlock.Root>.`),e}const V=({asChild:e=!1,className:n,defaultTab:i,activeTab:a,onActiveTabChange:o,ref:s,...c})=>{let l=N(``),[u,d]=P(!1),[f,p]=P(!1),[m,h]=P(void 0),g=A(e=>{h(t=>(F(t==null,`You can only render a single CodeBlock.Code within a CodeBlock.`),e))},[]),_=A(e=>{h(t=>{F(t===e,`You can only render a single CodeBlock.Code within a CodeBlock.`)})},[]),v=M(()=>({codeId:m,copyTextRef:l,hasCodeExpander:u,isCodeExpanded:f,registerCodeId:g,setHasCodeExpander:d,setIsCodeExpanded:p,unregisterCodeId:_}),[m,u,f,g,_]),y=i!=null||a!=null,b=I(e?r:`div`,{"data-slot":`code-block`,className:t(`text-mono w-full overflow-hidden rounded-md border border-gray-300 bg-base font-mono`,`[&_svg]:shrink-0`,n),ref:s,...c});return I(z.Provider,{value:v,children:y?I(ue,{asChild:!0,defaultValue:i,value:a,onValueChange:o,children:b}):b})};V.displayName=`CodeBlock`;const H=({asChild:e=!1,className:n,ref:i,...a})=>I(e?r:`div`,{"data-slot":`code-block-body`,className:t(`relative`,n),ref:i,...a});H.displayName=`CodeBlockBody`;const be=/SHIKI_VAL_(\d+)/g;function xe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}const U=new Map;function Se(e){if(e==null||e.length===0)return be;let t=U.get(e);return t??(U.size>=500&&U.clear(),t=RegExp(`${xe(e)}(\\d+)__`,`g`),U.set(e,t)),t}function W(e,t,n,r){if(n==null){if(!e.includes(`SHIKI_VAL_`))return e}else if(!e.includes(n))return e;return e.replaceAll(Se(n),(e,n)=>{let i=Number.parseInt(n,10);return Number.isNaN(i)||i<0||i>=t.length?e:r(t[i])})}function Ce(e,t,n){return W(e,t,n,e=>L(String(e)))}function we(e,t,n){return W(e,t,n,e=>String(e))}const G=({className:n,style:r,value:i,ref:a,...o})=>{let s=te(),c=N(null),{copyTextRef:l,hasCodeExpander:u,isCodeExpanded:d,registerCodeId:f,unregisterCodeId:p}=B(),{language:m,code:h,"~preValToken":g,"~preVals":_,"~highlightLines":v,"~lineNumberStart":y,"~preHtml":b,"~showLineNumbers":x}=i,S=v,C=y??1,w=x??!1,T=M(()=>_!=null&&_.length>0?we(h,_,g):h,[g,_,h]);ne(()=>{l.current=T},[l,T]),j(()=>(f(s),()=>{p(s)}),[s,f,p]);let E=M(()=>{if(b!=null)return _!=null&&_.length>0?Ce(b,_,g):b},[b,g,_]);j(()=>{let e=c.current;if(e==null)return;let t=e.querySelector(`code`);return t!=null&&he(t),ye(e)},[E]);let D=E!=null,O=E??L(T),k=M(()=>({__html:O}),[O]);return I(`pre`,{"data-slot":`code-block-code`,"aria-expanded":u?d:void 0,className:t(`scrollbar overflow-x-auto overflow-y-hidden py-4`,!D&&`pr-14`,`data-[mantle-line-numbers~='false']:pl-4`,`text-mono m-0 font-mono outline-hidden`,`aria-collapsed:max-h-[13.6rem]`,n),"data-highlighted":D?`true`:`false`,"data-lang":m,"data-mantle-highlight-lines":D&&S!=null&&S.length>0?S.join(`,`):void 0,"data-mantle-line-number-start":D&&w?String(C):`1`,"data-mantle-line-numbers":D&&w?`true`:`false`,id:s,ref:e(c,a),style:{...r,"--mantle-line-number-start":String(C),tabSize:2,MozTabSize:2},...o,children:I(`code`,{className:`text-size-inherit block min-w-full w-max`,dangerouslySetInnerHTML:k})})};G.displayName=`CodeBlockCode`;const K=({asChild:e=!1,className:n,ref:i,...a})=>I(e?r:`div`,{"data-slot":`code-block-header`,className:t(`flex items-center gap-1 border-b border-gray-300 bg-base px-4 py-2 text-gray-700`,n),ref:i,...a});K.displayName=`CodeBlockHeader`;const q=({asChild:e=!1,className:n,ref:i,...a})=>I(e?r:`h3`,{"data-slot":`code-block-title`,ref:i,className:t(`m-0 font-sans text-xs font-medium`,n),...a});q.displayName=`CodeBlockTitle`;const J=({className:e,label:n=`Copy code`,onCopy:r,onCopyError:o,onClick:s,ref:c,...l})=>{let{copyTextRef:u}=B(),d=a(),[f,p]=P(!1),m=N(void 0);return j(()=>()=>{m.current!=null&&clearTimeout(m.current)},[]),I(`span`,{"data-slot":`code-block-copy-button`,className:`absolute right-3 top-3 z-10 inline-flex size-7 items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] bg-base`,children:I(i,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,label:n,icon:I(f?ie:ae,{}),className:t(`bg-base not-disabled:hover:bg-neutral-500/15`,e),ref:c,onClick:async e=>{try{if(s?.(e),e.defaultPrevented){m.current!=null&&clearTimeout(m.current);return}let t=u.current;await d(t),r?.(t),p(!0),m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{p(!1)},2e3)}catch(e){o?.(e)}},...l})})};J.displayName=`CodeBlockCopyButton`;const Y=({asChild:e=!1,className:i,onClick:a,ref:o,...s})=>{let{codeId:c,isCodeExpanded:l,setIsCodeExpanded:u,setHasCodeExpander:d}=B();return j(()=>(d(!0),()=>{d(!1)}),[d]),re(e?r:`button`,{...s,"data-slot":`code-block-expander-button`,"aria-controls":c,"aria-expanded":l,className:t(`flex w-full items-center justify-center gap-0.5 border-t border-gray-300 bg-base px-4 py-2 font-sans text-gray-700 hover:bg-base-hover`,i),ref:o,type:`button`,onClick:e=>{u(e=>!e),a?.(e)},children:[l?`Show less`:`Show more`,` `,I(n,{svg:I(O,{weight:`bold`}),className:t(`size-4`,l&&`rotate-180`,`transition-all duration-150`)})]})};Y.displayName=`CodeBlockExpanderButton`;function X({className:e,preset:r,svg:i,...a}){let s=i;if(r!=null)switch(r){case`file`:s=I(oe,{weight:`fill`});break;case`cli`:s=I(se,{weight:`fill`});break;case`traffic-policy`:s=I(o,{});break}return I(n,{"data-slot":`code-block-icon`,className:t(`size-5`,e),svg:s,...a})}X.displayName=`CodeBlockIcon`;const Z=({className:e,ref:n,...r})=>I(le,{"data-slot":`code-block-tab-list`,className:t(`scroll-fade-x flex min-w-0 items-center gap-1 overflow-x-auto overscroll-x-none`,`-m-1 p-1`,e),ref:n,...r});Z.displayName=`CodeBlockTabList`;const Q=({className:e,ref:n,...r})=>I(de,{"data-slot":`code-block-tab-trigger`,className:t(`shrink-0 cursor-pointer rounded px-1.5 py-0.5 font-sans text-xs font-medium whitespace-nowrap`,`text-gray-600 outline-hidden`,`hover:text-gray-900`,`data-[state=active]:bg-neutral-500/15 data-[state=active]:text-strong`,`focus-visible:ring-focus-accent focus-visible:ring-4`,e),ref:n,...r});Q.displayName=`CodeBlockTabTrigger`;const $=e=>I(ce,{"data-slot":`code-block-tab-content`,...e});$.displayName=`CodeBlockTabContent`;const Te={Root:V,Body:H,Code:G,CopyButton:J,ExpanderButton:Y,Header:K,Icon:X,TabContent:$,TabList:Z,TabTrigger:Q,Title:q},Ee=`var(--shiki-foreground)`;function De(e){return e.replace(/[&<]/g,e=>e===`&`?`&#x26;`:`&#x3C;`)}function Oe(e){return e===` `||e===` `||e===`
2
- `||e===`\r`||e===`{`||e===`}`||e===`[`||e===`]`||e===`:`||e===`,`||e===`"`}function ke(e,t,n){let r=e.length,i=[],a=`"`,o=t+1;for(;o<r;){let t=e[o];if(t===`\\`){let t=e[o+1]===`u`&&/^[0-9a-fA-F]{4}$/.test(e.slice(o+2,o+6))?6:2;a!==``&&(i.push({text:a,isEscape:!1}),a=``),i.push({text:e.slice(o,o+t),isEscape:!0}),o+=t;continue}if(t===`"`){a+=`"`,o+=1;break}a+=t,o+=1}a!==``&&i.push({text:a,isEscape:!1});let s=o;for(;s<r;){let t=e[s];if(t===` `||t===` `||t===`
3
- `||t===`\r`){s+=1;continue}break}let c=e[s]===`:`?`var(--shiki-token-keyword)`:`var(--shiki-token-string-expression)`;for(let e of i)n(e.text,e.isEscape?`var(--shiki-token-escape, var(--shiki-token-constant))`:c);return o}function Ae(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n!=null&&n.color==null){let r=Ee;for(let n=t+1;n<e.length;n+=1){let t=e[n];if(t!=null&&t.color!=null){r=t.color;break}}n.color=r}}let t=``,n=``,r=null,i=()=>{r!=null&&(t+=`<span style="color:${r}">${De(n)}</span>`),n=``,r=null};for(let t of e)t!=null&&(t.color===r?n+=t.text:(i(),n=t.text,r=t.color));return i(),`<span class="line">${t}</span>`}function je(e){let t=[[]],n=t[0]??[],r=e.length,i=0,a=(e,t)=>{n.push({text:e,color:t})};for(;i<r;){let o=e[i];if(o===`
1
+ import{t as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./icon-lZ48P8Nn.js";import{t as r}from"./slot-CDk0Bb9z.js";import{t as i}from"./button-BAno7KIU.js";import{t as a}from"./use-copy-to-clipboard-DqQ0_N3E.js";import{t as o}from"./icons-CF1lbWtp.js";import{S as s,_ as c,a as l,b as u,c as d,d as f,f as p,g as m,h,i as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as T,v as E,y as D}from"./code-block-C9uaM9-V.js";import{CaretDownIcon as O}from"@phosphor-icons/react/CaretDown";import{createContext as k,useCallback as A,useContext as j,useEffect as M,useId as N,useLayoutEffect as P,useMemo as F,useRef as I,useState as L}from"react";import R from"tiny-invariant";import{jsx as z,jsxs as ee}from"react/jsx-runtime";import{CheckIcon as te}from"@phosphor-icons/react/Check";import{CopyIcon as ne}from"@phosphor-icons/react/Copy";import{FileTextIcon as re}from"@phosphor-icons/react/FileText";import{TerminalIcon as ie}from"@phosphor-icons/react/Terminal";import{Content as ae,List as oe,Root as se,Trigger as B}from"@radix-ui/react-tabs";function V(e){let t=-1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`&`||r===`<`||r===`>`||r===`"`||r===`'`){t=n;break}}if(t===-1)return e;let n=e.slice(0,t);for(let r=t;r<e.length;r++){let t=e[r];switch(t){case`&`:n+=`&amp;`;break;case`<`:n+=`&lt;`;break;case`>`:n+=`&gt;`;break;case`"`:n+=`&quot;`;break;case`'`:n+=`&#39;`;break;default:n+=t}}return n}const H=new WeakMap;function U(e){let t=new Set;if(e==null||e===``)return t;for(let n of e.split(` `))n!==``&&t.add(n);return t}function W(e){let t=H.get(e);if(t!=null&&ce(t))return t;let n=new Map,r=new WeakMap,i=e.querySelectorAll(`[data-fold-regions]`);for(let e=0;e<i.length;e+=1){let t=i[e];if(!(t instanceof HTMLElement))continue;let a=U(t.dataset.foldRegions);if(a.size!==0){r.set(t,a);for(let e of a){let r=n.get(e);r??(r=[],n.set(e,r)),r.push(t)}}}let a={regionToLines:n,lineToRegions:r};return H.set(e,a),a}function G(e){H.delete(e)}function K(e){G(e),e.removeAttribute(`data-folded-regions`)}function ce(e){for(let t of e.regionToLines.values()){if(t.length===0)continue;let e=t[0];if(e!=null)return e.isConnected}return!0}function le(e,t,n){let r=!1;for(let e of n)if(t.has(e)){r=!0;break}r?e.dataset.foldHidden=`true`:delete e.dataset.foldHidden}function ue(e){let t=e.dataset.foldLine;if(t==null||t===``)return!1;let n=e.closest(`[data-slot='code-block-code']`)?.querySelector(`code`);if(n==null)return!1;let r=U(n.getAttribute(`data-folded-regions`)),i=!r.has(t);i?r.add(t):r.delete(t),r.size===0?n.removeAttribute(`data-folded-regions`):n.setAttribute(`data-folded-regions`,[...r].join(` `)),e.setAttribute(`aria-expanded`,i?`false`:`true`);let{regionToLines:a,lineToRegions:o}=W(n),s=a.get(t);if(s!=null)for(let e of s){let t=o.get(e);t!=null&&le(e,r,t)}return!0}function de(e){let t=e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`.mantle-code-fold-toggle`);n instanceof HTMLButtonElement&&ue(n)};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}}const q=k(null);function J(){let e=j(q);return R(e!=null,`CodeBlock subcomponents must be rendered within a <CodeBlock.Root>.`),e}const fe=({asChild:e=!1,className:n,defaultTab:i,activeTab:a,onActiveTabChange:o,ref:s,...c})=>{let l=I(``),[u,d]=L(!1),[f,p]=L(!1),[m,h]=L(void 0),g=A(e=>{h(t=>(R(t==null,`You can only render a single CodeBlock.Code within a CodeBlock.`),e))},[]),_=A(e=>{h(t=>{R(t===e,`You can only render a single CodeBlock.Code within a CodeBlock.`)})},[]),v=F(()=>({codeId:m,copyTextRef:l,hasCodeExpander:u,isCodeExpanded:f,registerCodeId:g,setHasCodeExpander:d,setIsCodeExpanded:p,unregisterCodeId:_}),[m,u,f,g,_]),y=i!=null||a!=null,b=z(e?r:`div`,{"data-slot":`code-block`,className:t(`text-mono w-full overflow-hidden rounded-md border border-gray-300 bg-base font-mono`,`[&_svg]:shrink-0`,n),ref:s,...c});return z(q.Provider,{value:v,children:y?z(se,{asChild:!0,defaultValue:i,value:a,onValueChange:o,children:b}):b})},pe=({asChild:e=!1,className:n,ref:i,...a})=>z(e?r:`div`,{"data-slot":`code-block-body`,className:t(`relative`,n),ref:i,...a}),me=/SHIKI_VAL_(\d+)/g;function he(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}const Y=new Map;function ge(e){if(e==null||e.length===0)return me;let t=Y.get(e);return t??(Y.size>=500&&Y.clear(),t=RegExp(`${he(e)}(\\d+)__`,`g`),Y.set(e,t)),t}function X(e,t,n,r){if(n==null){if(!e.includes(`SHIKI_VAL_`))return e}else if(!e.includes(n))return e;return e.replaceAll(ge(n),(e,n)=>{let i=Number.parseInt(n,10);return Number.isNaN(i)||i<0||i>=t.length?e:r(t[i])})}function _e(e,t,n){return X(e,t,n,e=>V(String(e)))}function ve(e,t,n){return X(e,t,n,e=>String(e))}const ye=({className:n,style:r,value:i,ref:a,...o})=>{let s=N(),c=I(null),{copyTextRef:l,hasCodeExpander:u,isCodeExpanded:d,registerCodeId:f,unregisterCodeId:p}=J(),{language:m,code:h,"~preValToken":g,"~preVals":_,"~highlightLines":v,"~lineNumberStart":y,"~preHtml":b,"~showLineNumbers":x}=i,S=v,C=y??1,w=x??!1,T=F(()=>_!=null&&_.length>0?ve(h,_,g):h,[g,_,h]);P(()=>{l.current=T},[l,T]),M(()=>(f(s),()=>{p(s)}),[s,f,p]);let E=F(()=>{if(b!=null)return _!=null&&_.length>0?_e(b,_,g):b},[b,g,_]);M(()=>{let e=c.current;if(e==null)return;let t=e.querySelector(`code`);return t!=null&&K(t),de(e)},[E]);let D=E!=null,O=E??V(T),k=F(()=>({__html:O}),[O]);return z(`pre`,{"data-slot":`code-block-code`,"aria-expanded":u?d:void 0,className:t(`scrollbar overflow-x-auto overflow-y-hidden py-4`,!D&&`pr-14`,`data-[mantle-line-numbers~='false']:pl-4`,`text-mono m-0 font-mono outline-hidden`,`aria-collapsed:max-h-[13.6rem]`,n),"data-highlighted":D?`true`:`false`,"data-lang":m,"data-mantle-highlight-lines":D&&S!=null&&S.length>0?S.join(`,`):void 0,"data-mantle-line-number-start":D&&w?String(C):`1`,"data-mantle-line-numbers":D&&w?`true`:`false`,id:s,ref:e(c,a),style:{...r,"--mantle-line-number-start":String(C),tabSize:2,MozTabSize:2},...o,children:z(`code`,{className:`text-size-inherit block min-w-full w-max`,dangerouslySetInnerHTML:k})})},be=({asChild:e=!1,className:n,ref:i,...a})=>z(e?r:`div`,{"data-slot":`code-block-header`,className:t(`flex items-center gap-1 border-b border-gray-300 bg-base px-4 py-2 text-gray-700`,n),ref:i,...a}),xe=({asChild:e=!1,className:n,ref:i,...a})=>z(e?r:`h3`,{"data-slot":`code-block-title`,ref:i,className:t(`m-0 font-sans text-xs font-medium`,n),...a}),Se=({className:e,label:n=`Copy code`,onCopy:r,onCopyError:o,onClick:s,ref:c,...l})=>{let{copyTextRef:u}=J(),d=a(),[f,p]=L(!1),m=I(void 0);return M(()=>()=>{m.current!=null&&clearTimeout(m.current)},[]),z(`span`,{"data-slot":`code-block-copy-button`,className:`absolute right-3 top-3 z-10 inline-flex size-7 items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] bg-base`,children:z(i,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,label:n,icon:z(f?te:ne,{}),className:t(`bg-base not-disabled:hover:bg-neutral-500/15`,e),ref:c,onClick:async e=>{try{if(s?.(e),e.defaultPrevented){m.current!=null&&clearTimeout(m.current);return}let t=u.current;await d(t),r?.(t),p(!0),m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{p(!1)},2e3)}catch(e){o?.(e)}},...l})})},Z=({asChild:e=!1,className:i,onClick:a,ref:o,...s})=>{let{codeId:c,isCodeExpanded:l,setIsCodeExpanded:u,setHasCodeExpander:d}=J();return M(()=>(d(!0),()=>{d(!1)}),[d]),ee(e?r:`button`,{...s,"data-slot":`code-block-expander-button`,"aria-controls":c,"aria-expanded":l,className:t(`flex w-full items-center justify-center gap-0.5 border-t border-gray-300 bg-base px-4 py-2 font-sans text-gray-700 hover:bg-base-hover`,i),ref:o,type:`button`,onClick:e=>{u(e=>!e),a?.(e)},children:[l?`Show less`:`Show more`,` `,z(n,{svg:z(O,{weight:`bold`}),className:t(`size-4`,l&&`rotate-180`,`transition-all duration-150`)})]})};function Ce({className:e,preset:r,svg:i,...a}){let s=i;if(r!=null)switch(r){case`file`:s=z(re,{weight:`fill`});break;case`cli`:s=z(ie,{weight:`fill`});break;case`traffic-policy`:s=z(o,{});break}return z(n,{"data-slot":`code-block-icon`,className:t(`size-5`,e),svg:s,...a})}const we={Root:fe,Body:pe,Code:ye,CopyButton:Se,ExpanderButton:Z,Header:be,Icon:Ce,TabContent:e=>z(ae,{"data-slot":`code-block-tab-content`,...e}),TabList:({className:e,ref:n,...r})=>z(oe,{"data-slot":`code-block-tab-list`,className:t(`scroll-fade-x flex min-w-0 items-center gap-1 overflow-x-auto overscroll-x-none`,`-m-1 p-1`,e),ref:n,...r}),TabTrigger:({className:e,ref:n,...r})=>z(B,{"data-slot":`code-block-tab-trigger`,className:t(`shrink-0 cursor-pointer rounded px-1.5 py-0.5 font-sans text-xs font-medium whitespace-nowrap`,`text-gray-600 outline-hidden`,`hover:text-gray-900`,`data-[state=active]:bg-neutral-500/15 data-[state=active]:text-strong`,`focus-visible:ring-focus-accent focus-visible:ring-4`,e),ref:n,...r}),Title:xe},Q=`var(--shiki-foreground)`;function Te(e){return e.replace(/[&<]/g,e=>e===`&`?`&#x26;`:`&#x3C;`)}function Ee(e){return e===` `||e===` `||e===`
2
+ `||e===`\r`||e===`{`||e===`}`||e===`[`||e===`]`||e===`:`||e===`,`||e===`"`}function De(e,t,n){let r=e.length,i=[],a=`"`,o=t+1;for(;o<r;){let t=e[o];if(t===`\\`){let t=e[o+1]===`u`&&/^[0-9a-fA-F]{4}$/.test(e.slice(o+2,o+6))?6:2;a!==``&&(i.push({text:a,isEscape:!1}),a=``),i.push({text:e.slice(o,o+t),isEscape:!0}),o+=t;continue}if(t===`"`){a+=`"`,o+=1;break}a+=t,o+=1}a!==``&&i.push({text:a,isEscape:!1});let s=o;for(;s<r;){let t=e[s];if(t===` `||t===` `||t===`
3
+ `||t===`\r`){s+=1;continue}break}let c=e[s]===`:`?`var(--shiki-token-keyword)`:`var(--shiki-token-string-expression)`;for(let e of i)n(e.text,e.isEscape?`var(--shiki-token-escape, var(--shiki-token-constant))`:c);return o}function Oe(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n!=null&&n.color==null){let r=Q;for(let n=t+1;n<e.length;n+=1){let t=e[n];if(t!=null&&t.color!=null){r=t.color;break}}n.color=r}}let t=``,n=``,r=null,i=()=>{r!=null&&(t+=`<span style="color:${r}">${Te(n)}</span>`),n=``,r=null};for(let t of e)t!=null&&(t.color===r?n+=t.text:(i(),n=t.text,r=t.color));return i(),`<span class="line">${t}</span>`}function $(e){let t=[[]],n=t[0]??[],r=e.length,i=0,a=(e,t)=>{n.push({text:e,color:t})};for(;i<r;){let o=e[i];if(o===`
4
4
  `||o===`\r`){o===`\r`&&e[i+1]===`
5
- `&&(i+=1);let r=[];t.push(r),n=r,i+=1;continue}if(o===` `||o===` `){let t=i+1;for(;t<r;){let n=e[t];if(n!==` `&&n!==` `)break;t+=1}a(e.slice(i,t),null),i=t;continue}if(o===`{`||o===`}`||o===`[`||o===`]`){a(o,Ee),i+=1;continue}if(o===`:`||o===`,`){a(o,`var(--shiki-token-punctuation)`),i+=1;continue}if(o===`"`){i=ke(e,i,a);continue}let s=i+1;for(;s<r&&!Oe(e[s]??``);)s+=1;a(e.slice(i,s),`var(--shiki-token-constant)`),i=s}return t.map(Ae).join(`
6
- `)}function Me(e){let t=new WeakSet;try{return JSON.stringify(e,(e,n)=>{if(typeof n==`bigint`)return n.toString();if(typeof n==`object`&&n){if(t.has(n))return`[Circular]`;t.add(n)}return n},2)??``}catch{try{return String(e)}catch{return``}}}function Ne(e,{showLineNumbers:t=!1,foldable:n=!0}={}){let r=Me(e);return u({language:`json`,code:r,preHtml:c({html:je(r),foldableRanges:n?E(r):void 0,showLineNumbers:t}),showLineNumbers:t})}function Pe(e,t){let n=1;if(n>t)return!0;for(let r=0;r<e.length;r++)if(e[r]===`
7
- `&&(n+=1,n>t))return!0;return!1}export{Te as CodeBlock,h as computeFoldRanges,E as computeJsonFoldRanges,u as createMantleCodeBlockValue,c as decorateHighlightedHtml,w as defaultMeta,L as escapeHtml,D as finalizeFoldRanges,m as foldStrategyFor,Pe as hasMoreThanNLines,x as inferIndentation,v as isIndentation,_ as isSupportedLanguage,Ne as jsonCodeBlockValue,je as jsonToShikiHtml,s as mantleCode,p as normalizeIndentation,y as normalizeValue,b as parseCodeBlockHighlightLines,C as parseCodeBlockLineNumberStart,d as parseCodeBlockShowLineNumbers,T as parseLanguage,S as parseMetastring,g as resolvePreRenderedCodeBlockProps,f as supportedLanguages,l as tokenizeMetastring};
5
+ `&&(i+=1);let r=[];t.push(r),n=r,i+=1;continue}if(o===` `||o===` `){let t=i+1;for(;t<r;){let n=e[t];if(n!==` `&&n!==` `)break;t+=1}a(e.slice(i,t),null),i=t;continue}if(o===`{`||o===`}`||o===`[`||o===`]`){a(o,Q),i+=1;continue}if(o===`:`||o===`,`){a(o,`var(--shiki-token-punctuation)`),i+=1;continue}if(o===`"`){i=De(e,i,a);continue}let s=i+1;for(;s<r&&!Ee(e[s]??``);)s+=1;a(e.slice(i,s),`var(--shiki-token-constant)`),i=s}return t.map(Oe).join(`
6
+ `)}function ke(e){let t=new WeakSet;try{return JSON.stringify(e,(e,n)=>{if(typeof n==`bigint`)return n.toString();if(typeof n==`object`&&n){if(t.has(n))return`[Circular]`;t.add(n)}return n},2)??``}catch{try{return String(e)}catch{return``}}}function Ae(e,{showLineNumbers:t=!1,foldable:n=!0}={}){let r=ke(e);return u({language:`json`,code:r,preHtml:c({html:$(r),foldableRanges:n?E(r):void 0,showLineNumbers:t}),showLineNumbers:t})}function je(e,t){let n=1;if(n>t)return!0;for(let r=0;r<e.length;r++)if(e[r]===`
7
+ `&&(n+=1,n>t))return!0;return!1}export{we as CodeBlock,h as computeFoldRanges,E as computeJsonFoldRanges,u as createMantleCodeBlockValue,c as decorateHighlightedHtml,w as defaultMeta,V as escapeHtml,D as finalizeFoldRanges,m as foldStrategyFor,je as hasMoreThanNLines,x as inferIndentation,v as isIndentation,_ as isSupportedLanguage,Ae as jsonCodeBlockValue,$ as jsonToShikiHtml,s as mantleCode,p as normalizeIndentation,y as normalizeValue,b as parseCodeBlockHighlightLines,C as parseCodeBlockLineNumberStart,d as parseCodeBlockShowLineNumbers,T as parseLanguage,S as parseMetastring,g as resolvePreRenderedCodeBlockProps,f as supportedLanguages,l as tokenizeMetastring};
@@ -1,2 +1,2 @@
1
- import { A as FoldStrategy, B as computeJsonFoldRanges, C as Indentation, D as FoldExplanation, E as ComputeFoldRangesInput, F as isSupportedLanguage, H as finalizeFoldRanges, I as parseLanguage, L as supportedLanguages, M as computeFoldRanges, N as foldStrategyFor, O as FoldLine, P as SupportedLanguage, R as DecorateHighlightedHtmlInput, S as normalizeIndentation, T as isIndentation, U as LineRange, V as FoldableRange, b as defaultShowLineNumbers, g as parseCodeBlockShowLineNumbers, h as parseCodeBlockLineNumberStart, j as FoldToken, k as FoldScope, m as parseCodeBlockHighlightLines, p as tokenizeMetastring, u as normalizeValue, w as inferIndentation, z as decorateHighlightedHtml } from "./resolve-pre-rendered-props-B6OlZrSI.js";
1
+ import { A as FoldStrategy, B as computeJsonFoldRanges, C as Indentation, D as FoldExplanation, E as ComputeFoldRangesInput, F as isSupportedLanguage, H as finalizeFoldRanges, I as parseLanguage, L as supportedLanguages, M as computeFoldRanges, N as foldStrategyFor, O as FoldLine, P as SupportedLanguage, R as DecorateHighlightedHtmlInput, S as normalizeIndentation, T as isIndentation, U as LineRange, V as FoldableRange, b as defaultShowLineNumbers, g as parseCodeBlockShowLineNumbers, h as parseCodeBlockLineNumberStart, j as FoldToken, k as FoldScope, m as parseCodeBlockHighlightLines, p as tokenizeMetastring, u as normalizeValue, w as inferIndentation, z as decorateHighlightedHtml } from "./code-block-B6OlZrSI.js";
2
2
  export { type ComputeFoldRangesInput, type DecorateHighlightedHtmlInput, type FoldExplanation, type FoldLine, type FoldScope, type FoldStrategy, type FoldToken, type FoldableRange, type Indentation, type LineRange, type SupportedLanguage, computeFoldRanges, computeJsonFoldRanges, decorateHighlightedHtml, defaultShowLineNumbers, finalizeFoldRanges, foldStrategyFor, inferIndentation, isIndentation, isSupportedLanguage, normalizeIndentation, normalizeValue, parseCodeBlockHighlightLines, parseCodeBlockLineNumberStart, parseCodeBlockShowLineNumbers, parseLanguage, supportedLanguages, tokenizeMetastring };
@@ -1 +1 @@
1
- import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,l as s,m as c,n as l,o as u,p as d,s as f,u as p,v as m,x as h,y as g}from"./resolve-pre-rendered-props-C9uaM9-V.js";export{o as computeFoldRanges,m as computeJsonFoldRanges,e as decorateHighlightedHtml,h as defaultShowLineNumbers,g as finalizeFoldRanges,a as foldStrategyFor,d as inferIndentation,c as isIndentation,s as isSupportedLanguage,i as normalizeIndentation,l as normalizeValue,u as parseCodeBlockHighlightLines,f as parseCodeBlockLineNumberStart,n as parseCodeBlockShowLineNumbers,p as parseLanguage,r as supportedLanguages,t as tokenizeMetastring};
1
+ import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,l as s,m as c,n as l,o as u,p as d,s as f,u as p,v as m,x as h,y as g}from"./code-block-C9uaM9-V.js";export{o as computeFoldRanges,m as computeJsonFoldRanges,e as decorateHighlightedHtml,h as defaultShowLineNumbers,g as finalizeFoldRanges,a as foldStrategyFor,d as inferIndentation,c as isIndentation,s as isSupportedLanguage,i as normalizeIndentation,l as normalizeValue,u as parseCodeBlockHighlightLines,f as parseCodeBlockLineNumberStart,n as parseCodeBlockShowLineNumbers,p as parseLanguage,r as supportedLanguages,t as tokenizeMetastring};
@@ -1,5 +1,5 @@
1
1
  import { n as WithAsChild } from "./as-child-D23mGo4f.js";
2
- import { o as WithValidation } from "./validation-7QeiTFwl.js";
2
+ import { o as WithValidation } from "./field-7QeiTFwl.js";
3
3
  import { n as Separator } from "./separator-B5UmkVRL.js";
4
4
  import { ComponentProps } from "react";
5
5
  import * as Primitive from "@ariakit/react";
@@ -29,10 +29,7 @@ type ComboboxProps = Primitive.ComboboxProviderProps;
29
29
  * </Combobox.Root>
30
30
  * ```
31
31
  */
32
- declare const Root: {
33
- ({ children, ...props }: ComboboxProps): import("react").JSX.Element;
34
- displayName: string;
35
- };
32
+ declare const Root: ({ children, ...props }: ComboboxProps) => import("react").JSX.Element;
36
33
  type ComboboxInputProps = Omit<Primitive.ComboboxProps, "render"> & WithValidation;
37
34
  /**
38
35
  * Renders a combobox input element that can be used to filter a list of items.
@@ -50,10 +47,7 @@ type ComboboxInputProps = Omit<Primitive.ComboboxProps, "render"> & WithValidati
50
47
  * </Combobox.Root>
51
48
  * ```
52
49
  */
53
- declare const Input: {
54
- ({ "aria-invalid": _ariaInvalid, autoComplete, autoSelect, className, ref, validation: _validation, ...props }: ComboboxInputProps): import("react").JSX.Element;
55
- displayName: string;
56
- };
50
+ declare const Input: ({ "aria-invalid": _ariaInvalid, autoComplete, autoSelect, className, ref, validation: _validation, ...props }: ComboboxInputProps) => import("react").JSX.Element;
57
51
  type ComboboxContentProps = Omit<Primitive.ComboboxPopoverProps, "render"> & WithAsChild;
58
52
  /**
59
53
  * Renders a popover that contains combobox content, e.g. Combobox.Items, Combobox.Groups, and Combobox.Separators.
@@ -75,10 +69,7 @@ type ComboboxContentProps = Omit<Primitive.ComboboxPopoverProps, "render"> & Wit
75
69
  * </Combobox.Root>
76
70
  * ```
77
71
  */
78
- declare const Content: {
79
- ({ asChild, children, className, ref, sameWidth, unmountOnHide, ...props }: ComboboxContentProps): import("react").JSX.Element;
80
- displayName: string;
81
- };
72
+ declare const Content: ({ asChild, children, className, ref, sameWidth, unmountOnHide, ...props }: ComboboxContentProps) => import("react").JSX.Element;
82
73
  type ComboboxItemProps = Omit<Primitive.ComboboxItemProps, "render"> & WithAsChild;
83
74
  /**
84
75
  * Renders a combobox item inside a Combobox.Content component.
@@ -97,10 +88,7 @@ type ComboboxItemProps = Omit<Primitive.ComboboxItemProps, "render"> & WithAsChi
97
88
  * </Combobox.Root>
98
89
  * ```
99
90
  */
100
- declare const Item: {
101
- ({ asChild, children, className, focusOnHover, ref, value, ...props }: ComboboxItemProps): import("react").JSX.Element;
102
- displayName: string;
103
- };
91
+ declare const Item: ({ asChild, children, className, focusOnHover, ref, value, ...props }: ComboboxItemProps) => import("react").JSX.Element;
104
92
  type ComboboxGroupProps = Omit<Primitive.ComboboxGroupProps, "render"> & WithAsChild;
105
93
  /**
106
94
  * Renders a group for Combobox.Item elements.
@@ -125,10 +113,7 @@ type ComboboxGroupProps = Omit<Primitive.ComboboxGroupProps, "render"> & WithAsC
125
113
  * </Combobox.Root>
126
114
  * ```
127
115
  */
128
- declare const Group: {
129
- ({ asChild, children, className, ref, ...props }: ComboboxGroupProps): import("react").JSX.Element;
130
- displayName: string;
131
- };
116
+ declare const Group: ({ asChild, children, className, ref, ...props }: ComboboxGroupProps) => import("react").JSX.Element;
132
117
  type ComboboxGroupLabelProps = Omit<Primitive.ComboboxGroupLabelProps, "render"> & WithAsChild;
133
118
  /**
134
119
  * Renders a label in a combobox group.
@@ -153,10 +138,7 @@ type ComboboxGroupLabelProps = Omit<Primitive.ComboboxGroupLabelProps, "render">
153
138
  * </Combobox.Root>
154
139
  * ```
155
140
  */
156
- declare const GroupLabel: {
157
- ({ asChild, children, className, ref, ...props }: ComboboxGroupLabelProps): import("react").JSX.Element;
158
- displayName: string;
159
- };
141
+ declare const GroupLabel: ({ asChild, children, className, ref, ...props }: ComboboxGroupLabelProps) => import("react").JSX.Element;
160
142
  type ComboboxItemValueProps = Omit<Primitive.ComboboxItemValueProps<"span">, "render"> & WithAsChild;
161
143
  /**
162
144
  * Highlights the match between the current Combobox.Input value (userValue) and parent Combobox.Item value.
@@ -189,10 +171,7 @@ type ComboboxItemValueProps = Omit<Primitive.ComboboxItemValueProps<"span">, "re
189
171
  * </Combobox.Root>
190
172
  * ```
191
173
  */
192
- declare const ItemValue: {
193
- ({ asChild, className, ref, ...props }: ComboboxItemValueProps): import("react").JSX.Element;
194
- displayName: string;
195
- };
174
+ declare const ItemValue: ({ asChild, className, ref, ...props }: ComboboxItemValueProps) => import("react").JSX.Element;
196
175
  /**
197
176
  * Renders a separator between Combobox.Items or Combobox.Groups.
198
177
  *
@@ -215,10 +194,7 @@ declare const ItemValue: {
215
194
  * </Combobox.Root>
216
195
  * ```
217
196
  */
218
- declare const ComboboxSeparatorComponent: {
219
- ({ className, ref, ...props }: ComponentProps<typeof Separator>): import("react").JSX.Element;
220
- displayName: string;
221
- };
197
+ declare const ComboboxSeparatorComponent: ({ className, ref, ...props }: ComponentProps<typeof Separator>) => import("react").JSX.Element;
222
198
  /**
223
199
  * Fill in a React input field with autocomplete & autosuggest functionalities.
224
200
  * Choose from a list of suggested values with full keyboard support.
package/dist/combobox.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CDk0Bb9z.js";import{a as n,r}from"./validation-Bpptk_9t.js";import{n as i}from"./separator-bpE_kooz.js";import{createContext as a}from"react";import{jsx as o}from"react/jsx-runtime";import*as s from"@ariakit/react";const c=({children:e,...t})=>o(s.ComboboxProvider,{...t,children:e});c.displayName=`Combobox`;const l=({"aria-invalid":t,autoComplete:i=`list`,autoSelect:a=`always`,className:c,ref:l,validation:u,...d})=>{let f=n(),{ariaInvalid:p,validation:m}=r({"aria-invalid":t,validation:u??f});return o(s.Combobox,{"aria-invalid":p,autoComplete:i,autoSelect:a,"data-slot":`combobox-input`,className:e(`pointer-coarse:text-base h-9 text-sm`,`bg-form relative block w-full rounded-md border px-3 py-2 border-form text-strong font-sans`,`placeholder:text-placeholder`,`aria-disabled:opacity-50`,`hover:border-neutral-400`,`focus:outline-hidden focus:ring-4 aria-expanded:ring-4`,`focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent`,`data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success`,`data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning`,`data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger`,`autofill:shadow-(--color-blue-50) autofill:bg-blue-50 autofill:[-webkit-text-fill-color:var(--text-color-strong)]`,c),"data-validation":m||void 0,ref:l,...d})};l.displayName=`ComboboxInput`;const u=({asChild:n=!1,children:r,className:i,ref:a,sameWidth:c=!0,unmountOnHide:l=!0,...u})=>o(s.ComboboxPopover,{"data-slot":`combobox-content`,className:e(`border-popover bg-popover relative z-50 max-h-96 min-w-32 scrollbar overflow-y-scroll overflow-x-hidden rounded-md border shadow-md p-1 my-2 space-y-px font-sans focus:outline-hidden`,i),ref:a,render:n?({ref:e,...n})=>o(t,{ref:e,...n}):void 0,sameWidth:c,unmountOnHide:l,...u,children:r});u.displayName=`ComboboxContent`;const d=a(void 0),f=({asChild:n=!1,children:r,className:i,focusOnHover:a=!0,ref:c,value:l,...u})=>o(d.Provider,{value:l,children:o(s.ComboboxItem,{"data-slot":`combobox-item`,className:e(`cursor-pointer rounded-md px-2 py-1.5 text-strong text-sm flex min-w-0 gap-2 items-center [&>svg]:size-5 [&_svg]:shrink-0`,`data-active-item:bg-active-menu-item`,`aria-disabled:opacity-50`,i),focusOnHover:a,ref:c,render:n?({ref:e,...n})=>o(t,{ref:e,...n}):void 0,value:l,...u,children:r})});f.displayName=`ComboboxItem`;const p=({asChild:n=!1,children:r,className:i,ref:a,...c})=>o(s.ComboboxGroup,{"data-slot":`combobox-group`,className:e(`space-y-px`,i),ref:a,render:n?({ref:e,...n})=>o(t,{ref:e,...n}):void 0,...c,children:r});p.displayName=`ComboboxGroup`;const m=({asChild:n=!1,children:r,className:i,ref:a,...c})=>o(s.ComboboxGroupLabel,{"data-slot":`combobox-group-label`,className:e(`text-muted px-2 py-1 text-xs font-medium`,i),ref:a,render:n?({ref:e,...n})=>o(t,{ref:e,...n}):void 0,...c,children:r});m.displayName=`ComboboxGroupLabel`;const h=({asChild:n=!1,className:r,ref:i,...a})=>o(s.ComboboxItemValue,{"data-slot":`combobox-item-value`,className:e(`*:data-user-value:font-medium flex-1 shrink-0 text-strong font-normal`,r),ref:i,render:n?({ref:e,...n})=>o(t,{ref:e,...n}):void 0,...a});h.displayName=`ComboboxItemValue`;const g=({className:t,ref:n,...r})=>o(i,{ref:n,"data-slot":`combobox-separator`,className:e(`-mx-1.25 my-1 w-auto`,t),...r});g.displayName=`ComboboxSeparator`;const _={Root:c,Content:u,Group:p,GroupLabel:m,Input:l,Item:f,ItemValue:h,Separator:g};export{_ as Combobox};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CDk0Bb9z.js";import{a as n,r}from"./field-Bpptk_9t.js";import{n as i}from"./separator-bpE_kooz.js";import{createContext as a}from"react";import{jsx as o}from"react/jsx-runtime";import*as s from"@ariakit/react";const c=({children:e,...t})=>o(s.ComboboxProvider,{...t,children:e}),l=({"aria-invalid":t,autoComplete:i=`list`,autoSelect:a=`always`,className:c,ref:l,validation:u,...d})=>{let f=n(),{ariaInvalid:p,validation:m}=r({"aria-invalid":t,validation:u??f});return o(s.Combobox,{"aria-invalid":p,autoComplete:i,autoSelect:a,"data-slot":`combobox-input`,className:e(`pointer-coarse:text-base h-9 text-sm`,`bg-form relative block w-full rounded-md border px-3 py-2 border-form text-strong font-sans`,`placeholder:text-placeholder`,`aria-disabled:opacity-50`,`hover:border-neutral-400`,`focus:outline-hidden focus:ring-4 aria-expanded:ring-4`,`focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent`,`data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success`,`data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning`,`data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger`,`autofill:shadow-(--color-blue-50) autofill:bg-blue-50 autofill:[-webkit-text-fill-color:var(--text-color-strong)]`,c),"data-validation":m||void 0,ref:l,...d})},u=({asChild:n=!1,children:r,className:i,ref:a,sameWidth:c=!0,unmountOnHide:l=!0,...u})=>o(s.ComboboxPopover,{"data-slot":`combobox-content`,className:e(`border-popover bg-popover relative z-50 max-h-96 min-w-32 scrollbar overflow-y-scroll overflow-x-hidden rounded-md border shadow-md p-1 my-2 space-y-px font-sans focus:outline-hidden`,i),ref:a,render:n?({ref:e,...n})=>o(t,{ref:e,...n}):void 0,sameWidth:c,unmountOnHide:l,...u,children:r}),d=a(void 0),f={Root:c,Content:u,Group:({asChild:n=!1,children:r,className:i,ref:a,...c})=>o(s.ComboboxGroup,{"data-slot":`combobox-group`,className:e(`space-y-px`,i),ref:a,render:n?({ref:e,...n})=>o(t,{ref:e,...n}):void 0,...c,children:r}),GroupLabel:({asChild:n=!1,children:r,className:i,ref:a,...c})=>o(s.ComboboxGroupLabel,{"data-slot":`combobox-group-label`,className:e(`text-muted px-2 py-1 text-xs font-medium`,i),ref:a,render:n?({ref:e,...n})=>o(t,{ref:e,...n}):void 0,...c,children:r}),Input:l,Item:({asChild:n=!1,children:r,className:i,focusOnHover:a=!0,ref:c,value:l,...u})=>o(d.Provider,{value:l,children:o(s.ComboboxItem,{"data-slot":`combobox-item`,className:e(`cursor-pointer rounded-md px-2 py-1.5 text-strong text-sm flex min-w-0 gap-2 items-center [&>svg]:size-5 [&_svg]:shrink-0`,`data-active-item:bg-active-menu-item`,`aria-disabled:opacity-50`,i),focusOnHover:a,ref:c,render:n?({ref:e,...n})=>o(t,{ref:e,...n}):void 0,value:l,...u,children:r})}),ItemValue:({asChild:n=!1,className:r,ref:i,...a})=>o(s.ComboboxItemValue,{"data-slot":`combobox-item-value`,className:e(`*:data-user-value:font-medium flex-1 shrink-0 text-strong font-normal`,r),ref:i,render:n?({ref:e,...n})=>o(t,{ref:e,...n}):void 0,...a}),Separator:({className:t,ref:n,...r})=>o(i,{ref:n,"data-slot":`combobox-separator`,className:e(`-mx-1.25 my-1 w-auto`,t),...r})};export{f as Combobox};
package/dist/command.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as Root } from "./primitive-CJRIlrLz.js";
1
+ import { a as Root } from "./dialog-BM4wPCft.js";
2
2
  import { ComponentProps, ComponentPropsWithoutRef, ReactNode, Ref } from "react";
3
3
  import { Command as Command$1, useCommandState } from "cmdk";
4
4
  //#region src/components/command/command.d.ts
@@ -35,10 +35,7 @@ type CommandRootProps = ComponentProps<typeof Command$1>;
35
35
  * </Command.DialogRoot>
36
36
  * ```
37
37
  */
38
- declare const CommandRoot: {
39
- ({ className, ...props }: CommandRootProps): import("react").JSX.Element;
40
- displayName: string;
41
- };
38
+ declare const CommandRoot: ({ className, ...props }: CommandRootProps) => import("react").JSX.Element;
42
39
  /**
43
40
  * The props for the CommandDialog.Content component.
44
41
  *
@@ -465,10 +462,7 @@ declare const Command: {
465
462
  * </Command.DialogTrigger>
466
463
  * ```
467
464
  */
468
- readonly DialogTrigger: {
469
- (props: ComponentProps<import("react").ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>>): import("react").JSX.Element;
470
- displayName: string;
471
- };
465
+ readonly DialogTrigger: (props: ComponentProps<import("react").ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>>) => import("react").JSX.Element;
472
466
  /**
473
467
  * The visible content of the Command dialog. Renders inside the dialog portal.
474
468
  *
package/dist/command.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{n as t}from"./separator-bpE_kooz.js";import{t as n}from"./dialog-CQ2C6vkE.js";import{t as r}from"./kbd-K8iaZ-Ti.js";import{useEffect as i,useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{MagnifyingGlassIcon as c}from"@phosphor-icons/react/MagnifyingGlass";import{Command as l,useCommandState as u}from"cmdk";const d=({className:t,...n})=>o(l,{"data-slot":`command`,className:e(`bg-popover flex h-full w-full flex-col overflow-hidden rounded-md`,t),...n});d.displayName=`Command`;const f={Root:d,DialogRoot:n.Root,DialogTrigger:n.Trigger,DialogContent:({children:t,className:r,description:i=`Search for a command to run...`,filter:a,shouldFilter:c,showCloseButton:l=!0,title:u=`Command Palette`})=>s(n.Content,{className:e(`overflow-hidden p-0 relative`,r),children:[s(n.Header,{className:`sr-only absolute`,children:[o(n.Title,{children:u}),o(n.Description,{children:i})]}),o(d,{className:`**:data-[slot=command-input-wrapper]:h-12 **:[[cmdk-input]]:h-12 **:data-[slot=command-group]:px-2 **:data-[slot=command-list]:pb-1`,filter:a,shouldFilter:c,children:t}),l&&o(`div`,{className:`absolute top-1.5 right-1.5`,children:o(n.CloseIconButton,{})})]}),Input:({className:t,ref:n,...r})=>s(`div`,{ref:n,"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b border-popover px-3`,children:[o(c,{className:`size-5 shrink-0 opacity-50`}),o(l.Input,{"data-slot":`command-input`,className:e(`placeholder:text-muted flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,t),...r})]}),List:({className:t,...n})=>o(l.List,{"data-slot":`command-list`,className:e(`max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto scrollbar`,t),...n}),Empty:({className:t,...n})=>o(l.Empty,{"data-slot":`command-empty`,className:e(`py-6 text-center text-sm`,t),...n}),Group:({className:t,...n})=>o(l.Group,{"data-slot":`command-group`,className:e(`[&>[cmdk-group-heading]]:text-muted overflow-hidden p-1 [&>[cmdk-group-heading]]:px-2 [&>[cmdk-group-heading]]:py-1.5 [&>[cmdk-group-heading]]:text-xs [&>[cmdk-group-heading]]:font-medium`,t),...n}),Item:({className:t,...n})=>o(l.Item,{"data-slot":`command-item`,className:e(`data-[selected=true]:bg-active-menu-item [:where(&_svg)]:text-muted relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [:where(&_svg)]:size-5`,t),...n}),Shortcut:({className:t,...n})=>o(`span`,{"data-slot":`command-shortcut`,className:e(`text-muted ml-auto text-xs tracking-widest`,t),...n}),Separator:({className:n,...r})=>o(l.Separator,{"data-slot":`command-separator`,asChild:!0,...r,children:o(t,{className:e(`-mx-1 my-1 w-auto`,n)})})};function p({className:t,...n}){let[c,l]=a(`⌃`);i(()=>{l(h())},[]);let u=c===`⌘`?`Command`:`Control`;return s(r,{...n,suppressHydrationWarning:!0,"data-slot":`meta-key`,className:e(c===`⌃`&&`font-medium`,t),children:[o(`span`,{className:`sr-only`,children:u}),c]})}function m(e){return`userAgentData`in e}function h(){if(typeof navigator>`u`)return`⌃`;let e=``;return m(navigator)&&(e=navigator.userAgentData.platform??``),e||=navigator.platform||navigator.userAgent||``,/mac|iphone|ipad|ipod/i.test(e)?`⌘`:`⌃`}export{f as Command,p as MetaKey,u as useCommandState};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{n as t}from"./separator-bpE_kooz.js";import{t as n}from"./dialog-DWZWd5Jt.js";import{t as r}from"./kbd-K8iaZ-Ti.js";import{useEffect as i,useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{MagnifyingGlassIcon as c}from"@phosphor-icons/react/MagnifyingGlass";import{Command as l,useCommandState as u}from"cmdk";const d=({className:t,...n})=>o(l,{"data-slot":`command`,className:e(`bg-popover flex h-full w-full flex-col overflow-hidden rounded-md`,t),...n}),f={Root:d,DialogRoot:n.Root,DialogTrigger:n.Trigger,DialogContent:({children:t,className:r,description:i=`Search for a command to run...`,filter:a,shouldFilter:c,showCloseButton:l=!0,title:u=`Command Palette`})=>s(n.Content,{className:e(`overflow-hidden p-0 relative`,r),children:[s(n.Header,{className:`sr-only absolute`,children:[o(n.Title,{children:u}),o(n.Description,{children:i})]}),o(d,{className:`**:data-[slot=command-input-wrapper]:h-12 **:[[cmdk-input]]:h-12 **:data-[slot=command-group]:px-2 **:data-[slot=command-list]:pb-1`,filter:a,shouldFilter:c,children:t}),l&&o(`div`,{className:`absolute top-1.5 right-1.5`,children:o(n.CloseIconButton,{})})]}),Input:({className:t,ref:n,...r})=>s(`div`,{ref:n,"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b border-popover px-3`,children:[o(c,{className:`size-5 shrink-0 opacity-50`}),o(l.Input,{"data-slot":`command-input`,className:e(`placeholder:text-muted flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,t),...r})]}),List:({className:t,...n})=>o(l.List,{"data-slot":`command-list`,className:e(`max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto scrollbar`,t),...n}),Empty:({className:t,...n})=>o(l.Empty,{"data-slot":`command-empty`,className:e(`py-6 text-center text-sm`,t),...n}),Group:({className:t,...n})=>o(l.Group,{"data-slot":`command-group`,className:e(`[&>[cmdk-group-heading]]:text-muted overflow-hidden p-1 [&>[cmdk-group-heading]]:px-2 [&>[cmdk-group-heading]]:py-1.5 [&>[cmdk-group-heading]]:text-xs [&>[cmdk-group-heading]]:font-medium`,t),...n}),Item:({className:t,...n})=>o(l.Item,{"data-slot":`command-item`,className:e(`data-[selected=true]:bg-active-menu-item [:where(&_svg)]:text-muted relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [:where(&_svg)]:size-5`,t),...n}),Shortcut:({className:t,...n})=>o(`span`,{"data-slot":`command-shortcut`,className:e(`text-muted ml-auto text-xs tracking-widest`,t),...n}),Separator:({className:n,...r})=>o(l.Separator,{"data-slot":`command-separator`,asChild:!0,...r,children:o(t,{className:e(`-mx-1 my-1 w-auto`,n)})})};function p({className:t,...n}){let[c,l]=a(`⌃`);i(()=>{l(h())},[]);let u=c===`⌘`?`Command`:`Control`;return s(r,{...n,suppressHydrationWarning:!0,"data-slot":`meta-key`,className:e(c===`⌃`&&`font-medium`,t),children:[o(`span`,{className:`sr-only`,children:u}),c]})}function m(e){return`userAgentData`in e}function h(){if(typeof navigator>`u`)return`⌃`;let e=``;return m(navigator)&&(e=navigator.userAgentData.platform??``),e||=navigator.platform||navigator.userAgent||``,/mac|iphone|ipad|ipod/i.test(e)?`⌘`:`⌃`}export{f as Command,p as MetaKey,u as useCommandState};
@@ -1,8 +1,8 @@
1
- import { t as ButtonIntent } from "./intents-DdSKSj1c.js";
2
- import { n as ButtonAppearance, t as Button } from "./button-BPMwa2jN.js";
3
- import { n as IconButtonAppearance, t as IconButton } from "./icon-button-C1AfGnQx.js";
1
+ import { t as ButtonIntent } from "./button-DdSKSj1c.js";
2
+ import { n as ButtonAppearance, t as Button } from "./button-DARFK2KJ.js";
3
+ import { r as IconButtonAppearance, t as IconButton } from "./button-C7vAl6lS.js";
4
4
  import { s as SortingMode } from "./direction-BjU0bPST.js";
5
- import { t as Table$1 } from "./table-DUSvU_Jw.js";
5
+ import { t as Table$1 } from "./table-Bo0vNxIJ.js";
6
6
  import { ComponentProps, ReactNode } from "react";
7
7
  import { HeaderContext, Row, Table } from "@tanstack/react-table";
8
8
  export * from "@tanstack/react-table";
@@ -179,10 +179,7 @@ declare function Header({ children, className, ...props }: DataTableHeaderProps)
179
179
  * </DataTable.Root>
180
180
  * ```
181
181
  */
182
- declare const Body: {
183
- (props: ComponentProps<typeof Table$1.Body>): import("react").JSX.Element;
184
- displayName: string;
185
- };
182
+ declare const Body: (props: ComponentProps<typeof Table$1.Body>) => import("react").JSX.Element;
186
183
  type DataTableHeadProps = Omit<ComponentProps<typeof Table$1.Head>, "children">;
187
184
  /**
188
185
  * The `<thead>` container that renders column headers automatically from
@@ -951,10 +948,7 @@ declare const DataTable: {
951
948
  * });
952
949
  * ```
953
950
  */
954
- readonly Cell: {
955
- ({ children, className, ref, ...props }: ComponentProps<"td">): import("react").JSX.Element;
956
- displayName: string;
957
- };
951
+ readonly Cell: ({ children, className, ref, ...props }: ComponentProps<"td">) => import("react").JSX.Element;
958
952
  /**
959
953
  * The `<tbody>` container for rows of data. Typically wraps a map of
960
954
  * `DataTable.Row`, with a `DataTable.EmptyRow` fallback when there is
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-button-DiOhreJD.js";import{t as n}from"./button-5WsvzIQ6.js";import{i as r}from"./direction-Wa9W2F61.js";import{t as i}from"./sort-B_DDQcVD.js";import{t as a}from"./table-GDkapNFi.js";import{Fragment as o,createContext as s,useContext as c,useMemo as l}from"react";import u from"tiny-invariant";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";import{flexRender as m}from"@tanstack/react-table";import{MinusIcon as h}from"@phosphor-icons/react/Minus";import{PlusIcon as g}from"@phosphor-icons/react/Plus";export*from"@tanstack/react-table";const _=[`unsorted`,`asc`,`desc`],v=[`unsorted`,`desc`,`asc`];function y(e,t){return b(t===`alphanumeric`?_:v,e)??`unsorted`}function b(e,t,n){if(e.length===0)return n;let r=e.findIndex(e=>e===t);if(r===-1)return n;let i=(r+1)%e.length;return e.at(i)??n}const x=s(null);function S(){let e=c(x);return u(e,`useDataTableContext should only be used within a DataTable child component`),e}function C({children:e,table:t,...n}){let r=l(()=>({table:t}),[t]);return f(x.Provider,{value:r,children:f(a.Root,{"data-slot":`data-table`,...n,children:f(a.Element,{children:e})})})}function w({appearance:t=`ghost`,children:i,className:a,column:o,disableSorting:s=!1,iconPlacement:c=`end`,intent:l=`neutral`,sortingMode:u,sortIcon:d,onClick:m,...h}){let g=o.getIsSorted(),_=!s&&o.getCanSort(),v=_&&typeof g==`string`?g:`unsorted`,y=d?.(v)??f(B,{mode:u,direction:v});return p(n,{appearance:t,"data-slot":`data-table-header-sort-button`,className:e(`flex justify-start w-full h-full rounded-none not-disabled:active:scale-none`,t===`ghost`&&l===`neutral`&&`text-muted`,a),"data-sort-direction":v,"data-table-header-action":!0,icon:y,iconPlacement:c,onClick:e=>{m?.(e),!e.defaultPrevented&&(!_||s||u===void 0||V(o,u))},intent:l,type:`button`,...h,children:[_&&v!==`unsorted`&&p(`span`,{className:`sr-only`,children:[`Column sorted in`,` `,u===`alphanumeric`?v===`asc`?`ascending`:`descending`:r(v),` `,`order`]}),i]})}function T({children:t,className:n,...r}){return f(a.Header,{"data-slot":`data-table-header`,className:e(`has-data-table-header-action:px-0`,n),...r,children:t})}const E=e=>f(a.Body,{"data-slot":`data-table-body`,...e});function D(e){let{table:t}=S();return f(a.Head,{"data-slot":`data-table-head`,...e,children:t.getHeaderGroups().map(e=>f(a.Row,{children:e.headers.map(e=>f(o,{children:e.isPlaceholder?f(a.Header,{},e.id):m(e.column.columnDef.header,e.getContext())},e.id))},e.id))})}function O({className:t,renderExpanded:n,row:r,...i}){let s=f(a.Row,{"data-slot":`data-table-row`,"data-expanded":r.getIsExpanded()||void 0,className:e(i.onClick&&`cursor-pointer`,t),...i,children:r.getVisibleCells().map(e=>f(o,{children:m(e.column.columnDef.cell,e.getContext())},e.id))});return n==null?s:p(d,{children:[s,r.getIsExpanded()&&f(R,{row:r,children:n(r)})]})}function k({children:e,...t}){let{table:n}=S(),r=n.getAllColumns().length;return f(a.Row,{"data-slot":`data-table-empty-row`,...t,children:f(a.Cell,{colSpan:r,children:e})})}function A(){return f(`span`,{"aria-hidden":!0,className:e(`pointer-events-none absolute -inset-y-px -left-1.5 w-1.5`,`opacity-0 transition-opacity group-data-sticky-active/table:opacity-100`,`shadow-[1px_0_0_0_var(--border-color-card-muted)]`,`bg-linear-to-l to-transparent`,`from-[color-mix(in_oklab,var(--shadow-color)_var(--shadow-second-opacity),transparent)]`)})}function j({children:t,className:n,...r}){return p(a.Cell,{"data-mantle-table-sticky-right":!0,"data-slot":`data-table-action-cell`,className:e(`sticky z-10 right-0 text-end align-middle bg-inherit p-2`,n),...r,children:[f(A,{}),t]})}function M({children:t,className:n,...r}){let{table:i}=S(),o=i.getRowModel().rows.length>0;return p(a.Header,{...o?{"data-mantle-table-sticky-right":!0}:{},"data-slot":`data-table-action-header`,className:e(o&&`sticky z-10 right-0 bg-inherit`,n),...r,children:[o&&f(A,{}),t]})}function N(e){return`data-table-expanded-row-${encodeURIComponent(e.id)}`}function P({children:t,className:n,...r}){return f(a.Header,{"data-slot":`data-table-expand-header`,className:e(`w-9 px-0 text-center`,n),...r,children:t??f(`span`,{className:`sr-only`,children:`Row details`})})}const F=f(g,{weight:`bold`,className:`size-3.5`}),I=f(h,{weight:`bold`,className:`size-3.5`});function L({appearance:n=`ghost`,className:r,collapseIcon:i=I,expandIcon:a=F,intent:o=`neutral`,label:s,onClick:c,row:l,size:u=`sm`,...d}){if(!l.getCanExpand())return null;let p=l.getIsExpanded(),m=l.getToggleExpandedHandler();return f(t,{type:`button`,"data-slot":`data-table-row-expand-button`,appearance:n,intent:o,size:u,className:e(`rounded`,r),"aria-expanded":p,"aria-controls":p?N(l):void 0,icon:p?i:a,label:`${p?`Hide`:`Show`} details for ${s}`,onClick:e=>{e.stopPropagation(),c?.(e),!e.defaultPrevented&&m()},...d})}function R({children:t,className:n,colSpan:r,row:i,...o}){return f(a.Row,{"data-slot":`data-table-expanded-row`,"data-expanded-content":!0,className:e(`[&>td]:border-t-0`,n),...o,children:f(a.Cell,{id:N(i),colSpan:r??i.getVisibleCells().length,className:`bg-card font-sans text-body`,children:t})})}C.displayName=`DataTable`,j.displayName=`DataTableActionCell`,M.displayName=`DataTableActionHeader`,E.displayName=`DataTableBody`,k.displayName=`DataTableEmptyRow`,P.displayName=`DataTableExpandHeader`,R.displayName=`DataTableExpandedRow`,D.displayName=`DataTableHead`,T.displayName=`DataTableHeader`,w.displayName=`DataTableHeaderSortButton`,O.displayName=`DataTableRow`,L.displayName=`DataTableRowExpandButton`;const z={Root:C,ActionCell:j,ActionHeader:M,Cell:a.Cell,Body:E,EmptyRow:k,Head:D,Header:T,HeaderSortButton:w,Row:O,ExpandHeader:P,RowExpandButton:L,ExpandedRow:R};function B({direction:e,mode:t,...n}){return e===`unsorted`||!t||!e?f(`svg`,{"aria-hidden":!0,...n}):f(i,{mode:t,direction:e,...n})}function V(e,t){if(!e.getCanSort())return;let n=e.getIsSorted();switch(y(typeof n==`string`?n:`unsorted`,t)){case`unsorted`:e.clearSorting();return;case`asc`:e.toggleSorting(!1);return;case`desc`:e.toggleSorting(!0);return;default:return}}export{z as DataTable,N as expandedRowId};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./button-BAno7KIU.js";import{t as n}from"./button-DjpEKt2X.js";import{i as r}from"./direction-Wa9W2F61.js";import{t as i}from"./icons-B_DDQcVD.js";import{t as a}from"./table-CGxJwtbL.js";import{Fragment as o,createContext as s,useContext as c,useMemo as l}from"react";import u from"tiny-invariant";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";import{flexRender as m}from"@tanstack/react-table";import{MinusIcon as h}from"@phosphor-icons/react/Minus";import{PlusIcon as g}from"@phosphor-icons/react/Plus";export*from"@tanstack/react-table";const _=[`unsorted`,`asc`,`desc`],v=[`unsorted`,`desc`,`asc`];function y(e,t){return b(t===`alphanumeric`?_:v,e)??`unsorted`}function b(e,t,n){if(e.length===0)return n;let r=e.findIndex(e=>e===t);if(r===-1)return n;let i=(r+1)%e.length;return e.at(i)??n}const x=s(null);function S(){let e=c(x);return u(e,`useDataTableContext should only be used within a DataTable child component`),e}function C({children:e,table:t,...n}){let r=l(()=>({table:t}),[t]);return f(x.Provider,{value:r,children:f(a.Root,{"data-slot":`data-table`,...n,children:f(a.Element,{children:e})})})}function w({appearance:t=`ghost`,children:i,className:a,column:o,disableSorting:s=!1,iconPlacement:c=`end`,intent:l=`neutral`,sortingMode:u,sortIcon:d,onClick:m,...h}){let g=o.getIsSorted(),_=!s&&o.getCanSort(),v=_&&typeof g==`string`?g:`unsorted`,y=d?.(v)??f(B,{mode:u,direction:v});return p(n,{appearance:t,"data-slot":`data-table-header-sort-button`,className:e(`flex justify-start w-full h-full rounded-none not-disabled:active:scale-none`,t===`ghost`&&l===`neutral`&&`text-muted`,a),"data-sort-direction":v,"data-table-header-action":!0,icon:y,iconPlacement:c,onClick:e=>{m?.(e),!e.defaultPrevented&&(!_||s||u===void 0||V(o,u))},intent:l,type:`button`,...h,children:[_&&v!==`unsorted`&&p(`span`,{className:`sr-only`,children:[`Column sorted in`,` `,u===`alphanumeric`?v===`asc`?`ascending`:`descending`:r(v),` `,`order`]}),i]})}function T({children:t,className:n,...r}){return f(a.Header,{"data-slot":`data-table-header`,className:e(`has-data-table-header-action:px-0`,n),...r,children:t})}const E=e=>f(a.Body,{"data-slot":`data-table-body`,...e});function D(e){let{table:t}=S();return f(a.Head,{"data-slot":`data-table-head`,...e,children:t.getHeaderGroups().map(e=>f(a.Row,{children:e.headers.map(e=>f(o,{children:e.isPlaceholder?f(a.Header,{},e.id):m(e.column.columnDef.header,e.getContext())},e.id))},e.id))})}function O({className:t,renderExpanded:n,row:r,...i}){let s=f(a.Row,{"data-slot":`data-table-row`,"data-expanded":r.getIsExpanded()||void 0,className:e(i.onClick&&`cursor-pointer`,t),...i,children:r.getVisibleCells().map(e=>f(o,{children:m(e.column.columnDef.cell,e.getContext())},e.id))});return n==null?s:p(d,{children:[s,r.getIsExpanded()&&f(R,{row:r,children:n(r)})]})}function k({children:e,...t}){let{table:n}=S(),r=n.getAllColumns().length;return f(a.Row,{"data-slot":`data-table-empty-row`,...t,children:f(a.Cell,{colSpan:r,children:e})})}function A(){return f(`span`,{"aria-hidden":!0,className:e(`pointer-events-none absolute -inset-y-px -left-1.5 w-1.5`,`opacity-0 transition-opacity group-data-sticky-active/table:opacity-100`,`shadow-[1px_0_0_0_var(--border-color-card-muted)]`,`bg-linear-to-l to-transparent`,`from-[color-mix(in_oklab,var(--shadow-color)_var(--shadow-second-opacity),transparent)]`)})}function j({children:t,className:n,...r}){return p(a.Cell,{"data-mantle-table-sticky-right":!0,"data-slot":`data-table-action-cell`,className:e(`sticky z-10 right-0 text-end align-middle bg-inherit p-2`,n),...r,children:[f(A,{}),t]})}function M({children:t,className:n,...r}){let{table:i}=S(),o=i.getRowModel().rows.length>0;return p(a.Header,{...o?{"data-mantle-table-sticky-right":!0}:{},"data-slot":`data-table-action-header`,className:e(o&&`sticky z-10 right-0 bg-inherit`,n),...r,children:[o&&f(A,{}),t]})}function N(e){return`data-table-expanded-row-${encodeURIComponent(e.id)}`}function P({children:t,className:n,...r}){return f(a.Header,{"data-slot":`data-table-expand-header`,className:e(`w-9 px-0 text-center`,n),...r,children:t??f(`span`,{className:`sr-only`,children:`Row details`})})}const F=f(g,{weight:`bold`,className:`size-3.5`}),I=f(h,{weight:`bold`,className:`size-3.5`});function L({appearance:n=`ghost`,className:r,collapseIcon:i=I,expandIcon:a=F,intent:o=`neutral`,label:s,onClick:c,row:l,size:u=`sm`,...d}){if(!l.getCanExpand())return null;let p=l.getIsExpanded(),m=l.getToggleExpandedHandler();return f(t,{type:`button`,"data-slot":`data-table-row-expand-button`,appearance:n,intent:o,size:u,className:e(`rounded`,r),"aria-expanded":p,"aria-controls":p?N(l):void 0,icon:p?i:a,label:`${p?`Hide`:`Show`} details for ${s}`,onClick:e=>{e.stopPropagation(),c?.(e),!e.defaultPrevented&&m()},...d})}function R({children:t,className:n,colSpan:r,row:i,...o}){return f(a.Row,{"data-slot":`data-table-expanded-row`,"data-expanded-content":!0,className:e(`[&>td]:border-t-0`,n),...o,children:f(a.Cell,{id:N(i),colSpan:r??i.getVisibleCells().length,className:`bg-card font-sans text-body`,children:t})})}const z={Root:C,ActionCell:j,ActionHeader:M,Cell:a.Cell,Body:E,EmptyRow:k,Head:D,Header:T,HeaderSortButton:w,Row:O,ExpandHeader:P,RowExpandButton:L,ExpandedRow:R};function B({direction:e,mode:t,...n}){return e===`unsorted`||!t||!e?f(`svg`,{"aria-hidden":!0,...n}):f(i,{mode:t,direction:e,...n})}function V(e,t){if(!e.getCanSort())return;let n=e.getIsSorted();switch(y(typeof n==`string`?n:`unsorted`,t)){case`unsorted`:e.clearSorting();return;case`asc`:e.toggleSorting(!1);return;case`desc`:e.toggleSorting(!0);return;default:return}}export{z as DataTable,N as expandedRowId};
@@ -21,10 +21,7 @@ type DescriptionListProps = ComponentProps<"dl"> & WithAsChild;
21
21
  * </DescriptionList.Root>
22
22
  * ```
23
23
  */
24
- declare const Root: {
25
- ({ asChild, className, children, ref, ...rest }: DescriptionListProps): import("react").JSX.Element;
26
- displayName: string;
27
- };
24
+ declare const Root: ({ asChild, className, children, ref, ...rest }: DescriptionListProps) => import("react").JSX.Element;
28
25
  type DescriptionListItemProps = ComponentProps<"div"> & WithAsChild;
29
26
  /**
30
27
  * A wrapper that groups a `DescriptionList.Label` and `DescriptionList.Value`
@@ -41,10 +38,7 @@ type DescriptionListItemProps = ComponentProps<"div"> & WithAsChild;
41
38
  * </DescriptionList.Item>
42
39
  * ```
43
40
  */
44
- declare const Item: {
45
- ({ asChild, className, children, ref, ...rest }: DescriptionListItemProps): import("react").JSX.Element;
46
- displayName: string;
47
- };
41
+ declare const Item: ({ asChild, className, children, ref, ...rest }: DescriptionListItemProps) => import("react").JSX.Element;
48
42
  type DescriptionListLabelProps = ComponentProps<"dt"> & WithAsChild;
49
43
  /**
50
44
  * The label for a description list item. Renders as a `<dt>` element.
@@ -56,10 +50,7 @@ type DescriptionListLabelProps = ComponentProps<"dt"> & WithAsChild;
56
50
  * <DescriptionList.Label>Name</DescriptionList.Label>
57
51
  * ```
58
52
  */
59
- declare const Label: {
60
- ({ asChild, className, children, ref, ...rest }: DescriptionListLabelProps): import("react").JSX.Element;
61
- displayName: string;
62
- };
53
+ declare const Label: ({ asChild, className, children, ref, ...rest }: DescriptionListLabelProps) => import("react").JSX.Element;
63
54
  type DescriptionListValueProps = ComponentProps<"dd"> & WithAsChild;
64
55
  /**
65
56
  * The value for a description list item. Renders as a `<dd>` element.
@@ -75,10 +66,7 @@ type DescriptionListValueProps = ComponentProps<"dd"> & WithAsChild;
75
66
  * </DescriptionList.Value>
76
67
  * ```
77
68
  */
78
- declare const Value: {
79
- ({ asChild, className, children, ref, ...rest }: DescriptionListValueProps): import("react").JSX.Element;
80
- displayName: string;
81
- };
69
+ declare const Value: ({ asChild, className, children, ref, ...rest }: DescriptionListValueProps) => import("react").JSX.Element;
82
70
  /**
83
71
  * A semantically correct description list built on the HTML `<dl>` element.
84
72
  * Renders a list of label/value pairs with alternating row backgrounds,
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CDk0Bb9z.js";import{jsx as n}from"react/jsx-runtime";const r=({asChild:r=!1,className:i,children:a,ref:o,...s})=>n(r?t:`dl`,{ref:o,"data-slot":`description-list`,className:e(`relative scrollbar overflow-x-auto overscroll-x-none rounded-lg border border-card grid grid-cols-[auto_1fr] gap-x-4 [&>*:nth-child(odd)]:bg-neutral-500/5 p-1`,i),...s,children:a});r.displayName=`DescriptionList`;const i=({asChild:r=!1,className:i,children:a,ref:o,...s})=>n(r?t:`div`,{ref:o,"data-slot":`description-list-item`,className:e(`rounded-sm col-span-full grid grid-cols-subgrid items-center`,i),...s,children:a});i.displayName=`DescriptionListItem`;const a=({asChild:r=!1,className:i,children:a,ref:o,...s})=>n(r?t:`dt`,{ref:o,"data-slot":`description-list-label`,className:e(`text-muted text-sm font-sans font-medium min-w-36 p-2`,i),...s,children:a});a.displayName=`DescriptionListLabel`;const o=({asChild:r=!1,className:i,children:a,ref:o,...s})=>n(r?t:`dd`,{ref:o,"data-slot":`description-list-value`,className:e(`text-body font-mono text-mono py-2 px-3`,i),...s,children:a});o.displayName=`DescriptionListValue`;const s={Root:r,Item:i,Label:a,Value:o};export{s as DescriptionList};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CDk0Bb9z.js";import{jsx as n}from"react/jsx-runtime";const r={Root:({asChild:r=!1,className:i,children:a,ref:o,...s})=>n(r?t:`dl`,{ref:o,"data-slot":`description-list`,className:e(`relative scrollbar overflow-x-auto overscroll-x-none rounded-lg border border-card grid grid-cols-[auto_1fr] gap-x-4 [&>*:nth-child(odd)]:bg-neutral-500/5 p-1`,i),...s,children:a}),Item:({asChild:r=!1,className:i,children:a,ref:o,...s})=>n(r?t:`div`,{ref:o,"data-slot":`description-list-item`,className:e(`rounded-sm col-span-full grid grid-cols-subgrid items-center`,i),...s,children:a}),Label:({asChild:r=!1,className:i,children:a,ref:o,...s})=>n(r?t:`dt`,{ref:o,"data-slot":`description-list-label`,className:e(`text-muted text-sm font-sans font-medium min-w-36 p-2`,i),...s,children:a}),Value:({asChild:r=!1,className:i,children:a,ref:o,...s})=>n(r?t:`dd`,{ref:o,"data-slot":`description-list-value`,className:e(`text-body font-mono text-mono py-2 px-3`,i),...s,children:a})};export{r as DescriptionList};