@ngrok/mantle 0.80.0 → 0.81.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/dist/accordion.d.ts +19 -37
  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 +167 -83
  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 +505 -0
  11. package/dist/area-chart.js +1 -0
  12. package/dist/badge.js +1 -1
  13. package/dist/bar-chart.d.ts +492 -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-1cVjAcj8.d.ts +334 -0
  31. package/dist/chart-Do2qkrxl.js +2 -0
  32. package/dist/checkbox-0EoxOyMA.js +1 -0
  33. package/dist/checkbox.d.ts +13 -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 +60 -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 +70 -18
  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 +40 -32
  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-BbbQuae2.d.ts +1 -0
  56. package/dist/{dropdown-menu-CoyozLzy.d.ts → dropdown-menu-D6pMAY7I.d.ts} +156 -54
  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 +26 -53
  64. package/dist/field.js +1 -1
  65. package/dist/flag.d.ts +1 -1
  66. package/dist/hooks.js +1 -1
  67. package/dist/hover-card.d.ts +3 -12
  68. package/dist/hover-card.js +1 -1
  69. package/dist/{svg-only-CdI_v82i.d.ts → icon-CX_gj6sW.d.ts} +1 -1
  70. package/dist/{icon-BDqpcZ-n.d.ts → icon-k4E9yNWD.d.ts} +1 -1
  71. package/dist/icon-lZ48P8Nn.js +1 -0
  72. package/dist/icon.d.ts +3 -3
  73. package/dist/icon.js +1 -1
  74. package/dist/icons-DLCs1hLP.js +1 -0
  75. package/dist/icons.d.ts +53 -2
  76. package/dist/icons.js +1 -1
  77. package/dist/input-BnlpQF0c.js +1 -0
  78. package/dist/{input-DV9M6K4v.d.ts → input-BuYDU6CF.d.ts} +1 -1
  79. package/dist/input.d.ts +2 -2
  80. package/dist/input.js +1 -1
  81. package/dist/line-chart.d.ts +491 -0
  82. package/dist/line-chart.js +1 -0
  83. package/dist/{virtual-UrzmaSQm.js → list-51KQvENW.js} +1 -1
  84. package/dist/list.d.ts +5 -20
  85. package/dist/list.js +1 -1
  86. package/dist/llms.txt +5 -1
  87. package/dist/mantle-dark-high-contrast.css +17 -0
  88. package/dist/mantle-dark.css +13 -0
  89. package/dist/mantle-light-high-contrast.css +15 -0
  90. package/dist/mantle.css +29 -0
  91. package/dist/media-object.d.ts +45 -12
  92. package/dist/media-object.js +1 -1
  93. package/dist/multi-select.d.ts +14 -53
  94. package/dist/multi-select.js +1 -1
  95. package/dist/otp-input.d.ts +5 -17
  96. package/dist/otp-input.js +1 -1
  97. package/dist/pagination.d.ts +11 -21
  98. package/dist/pagination.js +1 -1
  99. package/dist/{index-B8mIWKIU.d.ts → popover-CE4OlWkd.d.ts} +1 -4
  100. package/dist/popover-CQ9s7jG5.js +1 -0
  101. package/dist/popover.d.ts +1 -1
  102. package/dist/popover.js +1 -1
  103. package/dist/primitive-trJDqIXJ.js +1 -0
  104. package/dist/progress.d.ts +2 -8
  105. package/dist/progress.js +1 -1
  106. package/dist/qr-code.d.ts +4 -16
  107. package/dist/qr-code.js +1 -1
  108. package/dist/radio-group.d.ts +129 -40
  109. package/dist/radio-group.js +1 -1
  110. package/dist/sandboxed-on-click.d.ts +2 -2
  111. package/dist/scatter-plot.d.ts +495 -0
  112. package/dist/scatter-plot.js +1 -0
  113. package/dist/{select-idm1jy7y.d.ts → select-0z7HVS6r.d.ts} +8 -29
  114. package/dist/select-BCHWvmyC.js +1 -0
  115. package/dist/select.d.ts +1 -1
  116. package/dist/select.js +1 -1
  117. package/dist/selectable-list.d.ts +11 -38
  118. package/dist/selectable-list.js +1 -1
  119. package/dist/sheet.d.ts +22 -49
  120. package/dist/sheet.js +1 -1
  121. package/dist/skip-to-main-link.js +1 -1
  122. package/dist/slider.js +1 -1
  123. package/dist/slot.d.ts +1 -1
  124. package/dist/split-button.d.ts +155 -31
  125. package/dist/split-button.js +1 -1
  126. package/dist/switch.d.ts +1 -1
  127. package/dist/switch.js +1 -1
  128. package/dist/table-CGxJwtbL.js +1 -0
  129. package/dist/{table-DUSvU_Jw.d.ts → table-CZBYEmyK.d.ts} +11 -38
  130. package/dist/table.d.ts +1 -1
  131. package/dist/table.js +1 -1
  132. package/dist/tabs.d.ts +21 -36
  133. package/dist/tabs.js +1 -1
  134. package/dist/text-area.d.ts +2 -2
  135. package/dist/text-area.js +1 -1
  136. package/dist/theme-C26-Xolp.js +1 -0
  137. package/dist/{themes-CYNpplwN.d.ts → theme-FbfjYiD3.d.ts} +16 -0
  138. package/dist/theme-switcher.d.ts +6 -15
  139. package/dist/theme-switcher.js +1 -1
  140. package/dist/theme.d.ts +42 -2
  141. package/dist/theme.js +1 -1
  142. package/dist/toast.d.ts +9 -17
  143. package/dist/toast.js +1 -1
  144. package/dist/tooltip.d.ts +26 -8
  145. package/dist/tooltip.js +1 -1
  146. package/dist/types.js +1 -1
  147. package/package.json +20 -14
  148. package/dist/checkbox-Cq17y0-R.js +0 -1
  149. package/dist/choice-Cc8dA5r8.js +0 -1
  150. package/dist/dialog-CQ2C6vkE.js +0 -1
  151. package/dist/dropdown-menu-CSCDdA3K.js +0 -1
  152. package/dist/field-context-BR01g789.js +0 -1
  153. package/dist/icon-CGgMKpJg.js +0 -1
  154. package/dist/icon-button-DiOhreJD.js +0 -1
  155. package/dist/index-CdPXa9h1.d.ts +0 -1
  156. package/dist/input-CVyAVbim.js +0 -1
  157. package/dist/popover-CBMADtjV.js +0 -1
  158. package/dist/primitive-DCPHJsRs.js +0 -1
  159. package/dist/select-SR_9-bxA.js +0 -1
  160. package/dist/table-GDkapNFi.js +0 -1
  161. package/dist/theme-provider-BftkIiZn.js +0 -1
  162. package/dist/theme-wVnzzx2F.js +0 -1
  163. package/dist/toast-DKgMRv4F.js +0 -1
  164. /package/dist/{sizes-BCoI4bhP.d.ts → button-BCoI4bhP.d.ts} +0 -0
  165. /package/dist/{intents-DdSKSj1c.d.ts → button-DdSKSj1c.d.ts} +0 -0
  166. /package/dist/{resolve-pre-rendered-props-B6OlZrSI.d.ts → code-block-B6OlZrSI.d.ts} +0 -0
  167. /package/dist/{resolve-pre-rendered-props-C9uaM9-V.js → code-block-C9uaM9-V.js} +0 -0
  168. /package/dist/{validation-7QeiTFwl.d.ts → field-7QeiTFwl.d.ts} +0 -0
  169. /package/dist/{validation-Bpptk_9t.js → field-Bpptk_9t.js} +0 -0
  170. /package/dist/{types-D1RY5Tcj.d.ts → icon-D1RY5Tcj.d.ts} +0 -0
  171. /package/dist/{svg-only-d-nMCfAI.js → icon-d-nMCfAI.js} +0 -0
  172. /package/dist/{sort-B_DDQcVD.js → icons-B_DDQcVD.js} +0 -0
  173. /package/dist/{traffic-policy-file-CF1lbWtp.js → icons-CF1lbWtp.js} +0 -0
  174. /package/dist/{is-input-CXmS0OFN.js → input-CXmS0OFN.js} +0 -0
  175. /package/dist/{index-BtwKJTLq.d.ts → slot-BtwKJTLq.d.ts} +0 -0
@@ -1,5 +1,5 @@
1
- import { t as Choice } from "./choice-Ct0KK8jw.js";
2
- import { t as Input } from "./input-DV9M6K4v.js";
1
+ import { t as Choice } from "./choice-BNRQXszu.js";
2
+ import { t as Input } from "./input-BuYDU6CF.js";
3
3
  import { ComponentProps, ReactElement, ReactNode } from "react";
4
4
  //#region src/components/selectable-list/selectable-list.d.ts
5
5
  /**
@@ -187,10 +187,7 @@ type SelectableListRootProps = Omit<ComponentProps<"div">, "onChange"> & {
187
187
  * </SelectableList.Root>
188
188
  * ```
189
189
  */
190
- declare const Root: {
191
- ({ className, defaultQuery, defaultValue, filter, onQueryChange, onValueChange, options, query: queryProp, ref, value, ...props }: SelectableListRootProps): import("react").JSX.Element;
192
- displayName: string;
193
- };
190
+ declare const Root: ({ className, defaultQuery, defaultValue, filter, onQueryChange, onValueChange, options, query: queryProp, ref, value, ...props }: SelectableListRootProps) => import("react").JSX.Element;
194
191
  /**
195
192
  * The filter/search box for a `SelectableList`. Renders the mantle `Input` with
196
193
  * a leading magnifying-glass icon and drives the list's filter query (a
@@ -209,10 +206,7 @@ declare const Root: {
209
206
  * </SelectableList.Root>
210
207
  * ```
211
208
  */
212
- declare const Filter: {
213
- ({ "aria-label": ariaLabel, ref, ...props }: Omit<ComponentProps<typeof Input>, "value" | "defaultValue" | "onChange" | "type" | "children">): import("react").JSX.Element;
214
- displayName: string;
215
- };
209
+ declare const Filter: ({ "aria-label": ariaLabel, ref, ...props }: Omit<ComponentProps<typeof Input>, "value" | "defaultValue" | "onChange" | "type" | "children">) => import("react").JSX.Element;
216
210
  /**
217
211
  * A tri-state "select all" header for a `SelectableList`. Reflects the selection
218
212
  * of the **currently filtered** options — checked when all are selected,
@@ -231,10 +225,7 @@ declare const Filter: {
231
225
  * </SelectableList.Root>
232
226
  * ```
233
227
  */
234
- declare const SelectAll: {
235
- ({ children, className, ref, ...props }: Omit<ComponentProps<"label">, "htmlFor">): import("react").JSX.Element;
236
- displayName: string;
237
- };
228
+ declare const SelectAll: ({ children, className, ref, ...props }: Omit<ComponentProps<"label">, "htmlFor">) => import("react").JSX.Element;
238
229
  /**
239
230
  * Props for `SelectableList.Item`. Extends `<div>` props with the option
240
231
  * `value` the row represents; selection and disabled state are read from the
@@ -291,10 +282,7 @@ type SelectableListItemProps = Omit<ComponentProps<"div">, "children" | "id"> &
291
282
  * </SelectableList.Root>
292
283
  * ```
293
284
  */
294
- declare const Item: {
295
- ({ children, className, ref, value, ...props }: SelectableListItemProps): import("react").JSX.Element;
296
- displayName: string;
297
- };
285
+ declare const Item: ({ children, className, ref, value, ...props }: SelectableListItemProps) => import("react").JSX.Element;
298
286
  /**
299
287
  * The emphasized title of a `SelectableList.Item`, rendered as `Choice.Label` —
300
288
  * a real `<label>` wired to the row's checkbox, so clicking it toggles the row
@@ -319,10 +307,7 @@ declare const Item: {
319
307
  * </SelectableList.Root>
320
308
  * ```
321
309
  */
322
- declare const ItemTitle: {
323
- (props: ComponentProps<typeof Choice.Label>): import("react").JSX.Element;
324
- displayName: string;
325
- };
310
+ declare const ItemTitle: (props: ComponentProps<typeof Choice.Label>) => import("react").JSX.Element;
326
311
  /**
327
312
  * The de-emphasized sub-line of a `SelectableList.Item`, rendered as
328
313
  * `Choice.Description` — wired to the row's checkbox via `aria-describedby`
@@ -347,10 +332,7 @@ declare const ItemTitle: {
347
332
  * </SelectableList.Root>
348
333
  * ```
349
334
  */
350
- declare const ItemDescription: {
351
- (props: ComponentProps<typeof Choice.Description>): import("react").JSX.Element;
352
- displayName: string;
353
- };
335
+ declare const ItemDescription: (props: ComponentProps<typeof Choice.Description>) => import("react").JSX.Element;
354
336
  /**
355
337
  * Props for `SelectableList.Viewport`. Extends `<div>` props (the scroll
356
338
  * viewport) with an optional render-prop child for custom row layouts.
@@ -393,10 +375,7 @@ type SelectableListViewportProps = Omit<ComponentProps<"div">, "children"> & {
393
375
  * </SelectableList.Root>
394
376
  * ```
395
377
  */
396
- declare const Viewport: {
397
- ({ children, ref, ...props }: SelectableListViewportProps): import("react").JSX.Element | null;
398
- displayName: string;
399
- };
378
+ declare const Viewport: ({ children, ref, ...props }: SelectableListViewportProps) => import("react").JSX.Element | null;
400
379
  /**
401
380
  * Props for `SelectableList.VirtualViewport` — the `Viewport` props plus the
402
381
  * virtualizer knobs.
@@ -433,10 +412,7 @@ type SelectableListVirtualViewportProps = SelectableListViewportProps & {
433
412
  * </SelectableList.Root>
434
413
  * ```
435
414
  */
436
- declare const VirtualViewport: {
437
- ({ children, ref, ...props }: SelectableListVirtualViewportProps): import("react").JSX.Element | null;
438
- displayName: string;
439
- };
415
+ declare const VirtualViewport: ({ children, ref, ...props }: SelectableListVirtualViewportProps) => import("react").JSX.Element | null;
440
416
  /**
441
417
  * Shown in place of the viewport when the active filter matches no options.
442
418
  * Renders its children (e.g. "No results found.") in muted, centered text.
@@ -456,10 +432,7 @@ declare const VirtualViewport: {
456
432
  * </SelectableList.Root>
457
433
  * ```
458
434
  */
459
- declare const Empty: {
460
- ({ children, className, ref, ...props }: ComponentProps<"div">): import("react").JSX.Element;
461
- displayName: string;
462
- };
435
+ declare const Empty: ({ children, className, ref, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
463
436
  /**
464
437
  * A filterable, multi-select **grid** of checkbox rows — the inline
465
438
  * (non-popover) counterpart to `MultiSelect`/`Combobox`. Map your data into
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{n as t,t as n}from"./checkbox-Cq17y0-R.js";import{t as r}from"./choice-Cc8dA5r8.js";import{n as i,t as a}from"./input-CVyAVbim.js";import{n as o,r as s,t as c}from"./virtual-UrzmaSQm.js";import{cloneElement as l,createContext as u,isValidElement as d,useCallback as f,useContext as p,useId as m,useMemo as h,useState as g}from"react";import _ from"tiny-invariant";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{MagnifyingGlassIcon as b}from"@phosphor-icons/react/MagnifyingGlass";function x(e){return e.labelText==null?typeof e.label==`string`?e.label:``:e.labelText}function S(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>x(e).toLowerCase().includes(n))}function C(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function w(e,t){let n=0,r=0;for(let i of e)i.disabled||(n+=1,t.has(i.value)&&(r+=1));return n===0?{allSelected:!1,someSelected:!1}:{allSelected:r===n,someSelected:r>0}}const T=u(null);function E(e){let t=p(T);return _(t,`SelectableList.${e} must be rendered inside SelectableList.Root.`),t}const D=[],O=({className:t,defaultQuery:n,defaultValue:r,filter:i,onQueryChange:a,onValueChange:o,options:s,query:c,ref:l,value:u,...d})=>{let p=m(),_=u!=null,[y,b]=g(r??D),x=_?u:y,w=c!=null,[E,O]=g(n??``),k=w?c:E,A=f(e=>{_||b(e),o?.(e)},[_,o]),j=f(e=>{w||O(e),a?.(e)},[w,a]),M=h(()=>new Set(x),[x]),N=h(()=>new Set(s.filter(e=>e.disabled).map(e=>e.value)),[s]),P=h(()=>i==null?S(s,k):s.filter(e=>i(e,k)),[s,k,i]),F=h(()=>({listId:p,filteredOptions:P,query:k,setQuery:j,selectedValues:x,selectedSet:M,disabledSet:N,toggle:e=>{N.has(e)||A(C(x,e))},setSelection:A}),[p,P,k,j,x,M,N,A]);return v(T.Provider,{value:F,children:v(`div`,{ref:l,"data-slot":`selectable-list`,className:e(`flex w-full flex-col gap-3`,t),...d})})};O.displayName=`SelectableListRoot`;const k=({"aria-label":e=`Filter`,ref:t,...n})=>{let{query:r,setQuery:o}=E(`Filter`);return y(a,{ref:t,type:`text`,"data-slot":`selectable-list-filter`,"aria-label":e,value:r,onChange:e=>o(e.target.value),...n,children:[v(b,{}),v(i,{})]})};k.displayName=`SelectableListFilter`;const A=({children:r,className:i,ref:a,...o})=>{let{filteredOptions:s,selectedValues:c,selectedSet:l,setSelection:u}=E(`SelectAll`),d=m(),{allSelected:f,someSelected:p}=w(s,l),h=t({allSelected:f,someSelected:p}),g=s.some(e=>!e.disabled),_=()=>{let e=s.filter(e=>!e.disabled).map(e=>e.value);if(f){let t=new Set(e);u(c.filter(e=>!t.has(e)));return}u([...new Set([...c,...e])])};return y(`label`,{ref:a,htmlFor:d,"data-slot":`selectable-list-select-all`,className:e(`text-strong flex cursor-pointer items-center gap-2 text-sm font-medium font-sans`,i),...o,children:[v(n,{id:d,checked:h,onChange:_,disabled:!g}),r]})};A.displayName=`SelectableListSelectAll`;function j(e,t){return`${e}-control-${encodeURIComponent(t)}`}const M=({children:t,className:i,ref:a,value:s,...c})=>{let{listId:l,selectedSet:u,disabledSet:d,toggle:f}=E(`Item`),p=j(l,s),m=u.has(s),h=d.has(s);return v(o,{ref:a,asChild:!0,selected:m,disabled:h,className:e(`px-2 py-1.5 text-sm`,`cursor-pointer aria-disabled:cursor-default`,i),...c,"data-slot":`selectable-list-item`,"data-value":s,children:y(r.Root,{id:p,disabled:h,children:[v(r.Indicator,{role:`gridcell`,children:v(n,{checked:m,onChange:()=>f(s),tabIndex:-1})}),v(r.Content,{role:`gridcell`,children:t})]})})};M.displayName=`SelectableListItem`;const N=e=>v(r.Label,{"data-slot":`selectable-list-item-title`,...e});N.displayName=`SelectableListItemTitle`;const P=e=>v(r.Description,{"data-slot":`selectable-list-item-description`,...e});P.displayName=`SelectableListItemDescription`;function F(e){return y(M,{value:e.value,children:[v(N,{children:e.label}),e.description!=null&&v(P,{children:e.description})]})}function I(e,t){let n=[],r=[];for(let i of e){let e=t(i);d(e)&&(n.push(l(e,{key:i.value})),r.push(i))}return{items:n,options:r}}function L(e,t){let{filteredOptions:n,listId:r,toggle:i}=E(e),a=t??F,{items:o,options:s}=h(()=>I(n,a),[n,a]),c=f(e=>{let t=s[e];t!=null&&i(t.value)},[s,i]),l=f(e=>{let t=s[e];return t==null?``:j(r,t.value)},[s,r]),u=f(e=>s[e]?.disabled===!0,[s]);return{isEmpty:o.length===0,isItemDisabled:u,onActivate:c,itemId:l,items:o}}const R=({children:e,ref:t,...n})=>{let{isEmpty:r,isItemDisabled:i,onActivate:a,itemId:o,items:c}=L(`Viewport`,e);return r?null:v(s,{ref:t,"data-slot":`selectable-list-viewport`,semantics:`grid`,...n,"aria-multiselectable":!0,isItemDisabled:i,onActivate:a,itemId:o,children:c})};R.displayName=`SelectableListViewport`;const z=({children:e,ref:t,...n})=>{let{isEmpty:r,isItemDisabled:i,onActivate:a,itemId:o,items:s}=L(`VirtualViewport`,e);return r?null:v(c,{ref:t,"data-slot":`selectable-list-viewport`,semantics:`grid`,...n,"aria-multiselectable":!0,isItemDisabled:i,onActivate:a,itemId:o,children:s})};z.displayName=`SelectableListVirtualViewport`;const B=({children:t,className:n,ref:r,...i})=>{let{filteredOptions:a}=E(`Empty`),o=a.length===0;return v(`div`,{ref:r,"data-slot":`selectable-list-empty`,role:`status`,className:e(!o&&`sr-only`,o&&`text-muted border-popover bg-popover flex items-center justify-center rounded-md border px-3 py-8 text-center text-sm`,n),...i,children:o?t:null})};B.displayName=`SelectableListEmpty`;const V={Root:O,Filter:k,SelectAll:A,Viewport:R,VirtualViewport:z,Item:M,ItemTitle:N,ItemDescription:P,Empty:B};export{V as SelectableList,S as filterSelectableOptions,x as optionLabelText,w as summarizeSelection,C as toggleSelectionValue};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{n as t,t as n}from"./checkbox-0EoxOyMA.js";import{t as r}from"./choice-BHwFSSyv.js";import{n as i,t as a}from"./input-BnlpQF0c.js";import{n as o,r as s,t as c}from"./list-51KQvENW.js";import{cloneElement as l,createContext as u,isValidElement as d,useCallback as f,useContext as p,useId as m,useMemo as h,useState as g}from"react";import _ from"tiny-invariant";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{MagnifyingGlassIcon as b}from"@phosphor-icons/react/MagnifyingGlass";function x(e){return e.labelText==null?typeof e.label==`string`?e.label:``:e.labelText}function S(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>x(e).toLowerCase().includes(n))}function C(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function w(e,t){let n=0,r=0;for(let i of e)i.disabled||(n+=1,t.has(i.value)&&(r+=1));return n===0?{allSelected:!1,someSelected:!1}:{allSelected:r===n,someSelected:r>0}}const T=u(null);function E(e){let t=p(T);return _(t,`SelectableList.${e} must be rendered inside SelectableList.Root.`),t}const D=[],O=({className:t,defaultQuery:n,defaultValue:r,filter:i,onQueryChange:a,onValueChange:o,options:s,query:c,ref:l,value:u,...d})=>{let p=m(),_=u!=null,[y,b]=g(r??D),x=_?u:y,w=c!=null,[E,O]=g(n??``),k=w?c:E,A=f(e=>{_||b(e),o?.(e)},[_,o]),j=f(e=>{w||O(e),a?.(e)},[w,a]),M=h(()=>new Set(x),[x]),N=h(()=>new Set(s.filter(e=>e.disabled).map(e=>e.value)),[s]),P=h(()=>i==null?S(s,k):s.filter(e=>i(e,k)),[s,k,i]),F=h(()=>({listId:p,filteredOptions:P,query:k,setQuery:j,selectedValues:x,selectedSet:M,disabledSet:N,toggle:e=>{N.has(e)||A(C(x,e))},setSelection:A}),[p,P,k,j,x,M,N,A]);return v(T.Provider,{value:F,children:v(`div`,{ref:l,"data-slot":`selectable-list`,className:e(`flex w-full flex-col gap-3`,t),...d})})},k=({"aria-label":e=`Filter`,ref:t,...n})=>{let{query:r,setQuery:o}=E(`Filter`);return y(a,{ref:t,type:`text`,"data-slot":`selectable-list-filter`,"aria-label":e,value:r,onChange:e=>o(e.target.value),...n,children:[v(b,{}),v(i,{})]})},A=({children:r,className:i,ref:a,...o})=>{let{filteredOptions:s,selectedValues:c,selectedSet:l,setSelection:u}=E(`SelectAll`),d=m(),{allSelected:f,someSelected:p}=w(s,l),h=t({allSelected:f,someSelected:p}),g=s.some(e=>!e.disabled),_=()=>{let e=s.filter(e=>!e.disabled).map(e=>e.value);if(f){let t=new Set(e);u(c.filter(e=>!t.has(e)));return}u([...new Set([...c,...e])])};return y(`label`,{ref:a,htmlFor:d,"data-slot":`selectable-list-select-all`,className:e(`text-strong flex cursor-pointer items-center gap-2 text-sm font-medium font-sans`,i),...o,children:[v(n,{id:d,checked:h,onChange:_,disabled:!g}),r]})};function j(e,t){return`${e}-control-${encodeURIComponent(t)}`}const M=({children:t,className:i,ref:a,value:s,...c})=>{let{listId:l,selectedSet:u,disabledSet:d,toggle:f}=E(`Item`),p=j(l,s),m=u.has(s),h=d.has(s);return v(o,{ref:a,asChild:!0,selected:m,disabled:h,className:e(`px-2 py-1.5 text-sm`,`cursor-pointer aria-disabled:cursor-default`,i),...c,"data-slot":`selectable-list-item`,"data-value":s,children:y(r.Root,{id:p,disabled:h,children:[v(r.Indicator,{role:`gridcell`,children:v(n,{checked:m,onChange:()=>f(s),tabIndex:-1})}),v(r.Content,{role:`gridcell`,children:t})]})})},N=e=>v(r.Label,{"data-slot":`selectable-list-item-title`,...e}),P=e=>v(r.Description,{"data-slot":`selectable-list-item-description`,...e});function F(e){return y(M,{value:e.value,children:[v(N,{children:e.label}),e.description!=null&&v(P,{children:e.description})]})}function I(e,t){let n=[],r=[];for(let i of e){let e=t(i);d(e)&&(n.push(l(e,{key:i.value})),r.push(i))}return{items:n,options:r}}function L(e,t){let{filteredOptions:n,listId:r,toggle:i}=E(e),a=t??F,{items:o,options:s}=h(()=>I(n,a),[n,a]),c=f(e=>{let t=s[e];t!=null&&i(t.value)},[s,i]),l=f(e=>{let t=s[e];return t==null?``:j(r,t.value)},[s,r]),u=f(e=>s[e]?.disabled===!0,[s]);return{isEmpty:o.length===0,isItemDisabled:u,onActivate:c,itemId:l,items:o}}const R={Root:O,Filter:k,SelectAll:A,Viewport:({children:e,ref:t,...n})=>{let{isEmpty:r,isItemDisabled:i,onActivate:a,itemId:o,items:c}=L(`Viewport`,e);return r?null:v(s,{ref:t,"data-slot":`selectable-list-viewport`,semantics:`grid`,...n,"aria-multiselectable":!0,isItemDisabled:i,onActivate:a,itemId:o,children:c})},VirtualViewport:({children:e,ref:t,...n})=>{let{isEmpty:r,isItemDisabled:i,onActivate:a,itemId:o,items:s}=L(`VirtualViewport`,e);return r?null:v(c,{ref:t,"data-slot":`selectable-list-viewport`,semantics:`grid`,...n,"aria-multiselectable":!0,isItemDisabled:i,onActivate:a,itemId:o,children:s})},Item:M,ItemTitle:N,ItemDescription:P,Empty:({children:t,className:n,ref:r,...i})=>{let{filteredOptions:a}=E(`Empty`),o=a.length===0;return v(`div`,{ref:r,"data-slot":`selectable-list-empty`,role:`status`,className:e(!o&&`sr-only`,o&&`text-muted border-popover bg-popover flex items-center justify-center rounded-md border px-3 py-8 text-center text-sm`,n),...i,children:o?t:null})}};export{R as SelectableList,S as filterSelectableOptions,x as optionLabelText,w as summarizeSelection,C as toggleSelectionValue};
package/dist/sheet.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { t as ButtonIntent } from "./intents-DdSKSj1c.js";
2
- import { a as Root, n as Content$1, o as Title$1, r as Description$1 } from "./primitive-CJRIlrLz.js";
3
- import { n as IconButtonAppearance, r as IconButtonProps } from "./icon-button-C1AfGnQx.js";
1
+ import { t as ButtonIntent } from "./button-DdSKSj1c.js";
2
+ import { a as Root, n as Content$1, o as Title$1, r as Description$1 } from "./dialog-BM4wPCft.js";
3
+ import { n as IconButtonProps, r as IconButtonAppearance } from "./button-C7vAl6lS.js";
4
4
  import { ComponentProps, HTMLAttributes } from "react";
5
5
  import { VariantProps } from "class-variance-authority";
6
6
  //#region src/components/sheet/sheet.d.ts
@@ -33,7 +33,7 @@ type SheetContentProps = ComponentProps<typeof Content$1> & VariantProps<typeof
33
33
  * @example
34
34
  * ```tsx
35
35
  * // Sheet without a trigger (e.g. router controlled)
36
- * <Sheet open onOpenChange={() => onClose()}>
36
+ * <Sheet.Root open onOpenChange={() => onClose()}>
37
37
  * <Sheet.Content>
38
38
  * <Sheet.Header>
39
39
  * <Sheet.TitleGroup>
@@ -74,10 +74,7 @@ type SheetContentProps = ComponentProps<typeof Content$1> & VariantProps<typeof
74
74
  * </Sheet.Root>
75
75
  * ```
76
76
  */
77
- declare const Content: {
78
- ({ children, className, preferredWidth, side, ref, ...props }: SheetContentProps): import("react").JSX.Element;
79
- displayName: string;
80
- };
77
+ declare const Content: ({ children, className, preferredWidth, side, ref, ...props }: SheetContentProps) => import("react").JSX.Element;
81
78
  type SheetCloseIconButtonProps = Partial<Omit<IconButtonProps, "icon" | "appearance" | "intent">> & {
82
79
  /**
83
80
  * The visual style of the close icon button. Optional here —
@@ -107,7 +104,7 @@ type SheetCloseIconButtonProps = Partial<Omit<IconButtonProps, "icon" | "appeara
107
104
  * @example
108
105
  * ```tsx
109
106
  * // Sheet without a trigger (e.g. router controlled)
110
- * <Sheet open onOpenChange={() => onClose()}>
107
+ * <Sheet.Root open onOpenChange={() => onClose()}>
111
108
  * <Sheet.Content>
112
109
  * <Sheet.Header>
113
110
  * <Sheet.TitleGroup>
@@ -148,10 +145,7 @@ type SheetCloseIconButtonProps = Partial<Omit<IconButtonProps, "icon" | "appeara
148
145
  * </Sheet.Root>
149
146
  * ```
150
147
  */
151
- declare const CloseIconButton: {
152
- ({ size, type, label, appearance, intent, ...props }: SheetCloseIconButtonProps): import("react").JSX.Element;
153
- displayName: string;
154
- };
148
+ declare const CloseIconButton: ({ size, type, label, appearance, intent, ...props }: SheetCloseIconButtonProps) => import("react").JSX.Element;
155
149
  /**
156
150
  * The body container for a `Sheet`. This is where you would typically place the main content of the sheet, such as forms or text.
157
151
  * Should be rendered as a child of `Sheet.Content`.
@@ -161,7 +155,7 @@ declare const CloseIconButton: {
161
155
  * @example
162
156
  * ```tsx
163
157
  * // Sheet without a trigger (e.g. router controlled)
164
- * <Sheet open onOpenChange={() => onClose()}>
158
+ * <Sheet.Root open onOpenChange={() => onClose()}>
165
159
  * <Sheet.Content>
166
160
  * <Sheet.Header>
167
161
  * <Sheet.TitleGroup>
@@ -202,10 +196,7 @@ declare const CloseIconButton: {
202
196
  * </Sheet.Root>
203
197
  * ```
204
198
  */
205
- declare const Body: {
206
- ({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
207
- displayName: string;
208
- };
199
+ declare const Body: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => import("react").JSX.Element;
209
200
  /**
210
201
  * The header container for a `Sheet`. This is where you would typically place the title, description, and actions.
211
202
  * Should be rendered as a child of `Sheet.Content`.
@@ -215,7 +206,7 @@ declare const Body: {
215
206
  * @example
216
207
  * ```tsx
217
208
  * // Sheet without a trigger (e.g. router controlled)
218
- * <Sheet open onOpenChange={() => onClose()}>
209
+ * <Sheet.Root open onOpenChange={() => onClose()}>
219
210
  * <Sheet.Content>
220
211
  * <Sheet.Header>
221
212
  * <Sheet.TitleGroup>
@@ -256,10 +247,7 @@ declare const Body: {
256
247
  * </Sheet.Root>
257
248
  * ```
258
249
  */
259
- declare const Header: {
260
- ({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
261
- displayName: string;
262
- };
250
+ declare const Header: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => import("react").JSX.Element;
263
251
  /**
264
252
  * The footer container for a `Sheet`. This is where you would typically place close and submit buttons.
265
253
  * Should be rendered as a child of `Sheet.Content`.
@@ -269,7 +257,7 @@ declare const Header: {
269
257
  * @example
270
258
  * ```tsx
271
259
  * // Sheet without a trigger (e.g. router controlled)
272
- * <Sheet open onOpenChange={() => onClose()}>
260
+ * <Sheet.Root open onOpenChange={() => onClose()}>
273
261
  * <Sheet.Content>
274
262
  * <Sheet.Header>
275
263
  * <Sheet.TitleGroup>
@@ -310,10 +298,7 @@ declare const Header: {
310
298
  * </Sheet.Root>
311
299
  * ```
312
300
  */
313
- declare const Footer: {
314
- ({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
315
- displayName: string;
316
- };
301
+ declare const Footer: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => import("react").JSX.Element;
317
302
  /**
318
303
  * The title for a `Sheet`. Typically rendered as a child of `Sheet.TitleGroup`.
319
304
  * Defaults to an `h2` element, but can be changed via the `asChild` prop.
@@ -323,7 +308,7 @@ declare const Footer: {
323
308
  * @example
324
309
  * ```tsx
325
310
  * // Sheet without a trigger (e.g. router controlled)
326
- * <Sheet open onOpenChange={() => onClose()}>
311
+ * <Sheet.Root open onOpenChange={() => onClose()}>
327
312
  * <Sheet.Content>
328
313
  * <Sheet.Header>
329
314
  * <Sheet.TitleGroup>
@@ -364,10 +349,7 @@ declare const Footer: {
364
349
  * </Sheet.Root>
365
350
  * ```
366
351
  */
367
- declare const Title: {
368
- ({ className, ref, ...props }: ComponentProps<typeof Title$1>): import("react").JSX.Element;
369
- displayName: string | undefined;
370
- };
352
+ declare const Title: ({ className, ref, ...props }: ComponentProps<typeof Title$1>) => import("react").JSX.Element;
371
353
  /**
372
354
  * A group container for the title and actions of a sheet. Typically rendered as a child of `Sheet.Header`.
373
355
  *
@@ -376,7 +358,7 @@ declare const Title: {
376
358
  * @example
377
359
  * ```tsx
378
360
  * // Sheet without a trigger (e.g. router controlled)
379
- * <Sheet open onOpenChange={() => onClose()}>
361
+ * <Sheet.Root open onOpenChange={() => onClose()}>
380
362
  * <Sheet.Content>
381
363
  * <Sheet.Header>
382
364
  * <Sheet.TitleGroup>
@@ -417,10 +399,7 @@ declare const Title: {
417
399
  * </Sheet.Root>
418
400
  * ```
419
401
  */
420
- declare const TitleGroup: {
421
- ({ children, className, ref, ...props }: ComponentProps<"div">): import("react").JSX.Element;
422
- displayName: string;
423
- };
402
+ declare const TitleGroup: ({ children, className, ref, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
424
403
  /**
425
404
  * A description for a sheet. Typically rendered as a child of `Sheet.Header`.
426
405
  *
@@ -429,7 +408,7 @@ declare const TitleGroup: {
429
408
  * @example
430
409
  * ```tsx
431
410
  * // Sheet without a trigger (e.g. router controlled)
432
- * <Sheet open onOpenChange={() => onClose()}>
411
+ * <Sheet.Root open onOpenChange={() => onClose()}>
433
412
  * <Sheet.Content>
434
413
  * <Sheet.Header>
435
414
  * <Sheet.TitleGroup>
@@ -470,10 +449,7 @@ declare const TitleGroup: {
470
449
  * </Sheet.Root>
471
450
  * ```
472
451
  */
473
- declare const Description: {
474
- ({ className, ref, ...props }: ComponentProps<typeof Description$1>): import("react").JSX.Element;
475
- displayName: string;
476
- };
452
+ declare const Description: ({ className, ref, ...props }: ComponentProps<typeof Description$1>) => import("react").JSX.Element;
477
453
  /**
478
454
  * A group container for the actions of a `Sheet`. Typically rendered as a child of `Sheet.TitleGroup`.
479
455
  *
@@ -482,7 +458,7 @@ declare const Description: {
482
458
  * @example
483
459
  * ```tsx
484
460
  * // Sheet without a trigger (e.g. router controlled)
485
- * <Sheet open onOpenChange={() => onClose()}>
461
+ * <Sheet.Root open onOpenChange={() => onClose()}>
486
462
  * <Sheet.Content>
487
463
  * <Sheet.Header>
488
464
  * <Sheet.TitleGroup>
@@ -523,10 +499,7 @@ declare const Description: {
523
499
  * </Sheet.Root>
524
500
  * ```
525
501
  */
526
- declare const Actions: {
527
- ({ children, className, ref, ...props }: ComponentProps<"div">): import("react").JSX.Element;
528
- displayName: string;
529
- };
502
+ declare const Actions: ({ children, className, ref, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
530
503
  /**
531
504
  * A container that overlays the current view from the edge of the screen.
532
505
  * It is a lightweight way of allowing users to complete a task without losing
@@ -610,7 +583,7 @@ declare const Actions: {
610
583
  * @example
611
584
  * ```tsx
612
585
  * // Sheet without a trigger (e.g. router controlled)
613
- * <Sheet open onOpenChange={() => onClose()}>
586
+ * <Sheet.Root open onOpenChange={() => onClose()}>
614
587
  * <Sheet.Content>
615
588
  * <Sheet.Header>
616
589
  * <Sheet.TitleGroup>
package/dist/sheet.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-button-DiOhreJD.js";import{a as n,c as r,i,n as a,o,r as s,s as c,t as l}from"./primitive-DCPHJsRs.js";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{XIcon as f}from"@phosphor-icons/react/X";import{cva as p}from"class-variance-authority";const m=o;m.displayName=`Sheet`;const h=r;h.displayName=`SheetTrigger`;const g=l;g.displayName=`SheetClose`;const _=n;_.displayName=`SheetPortal`;const v=({className:t,ref:n,...r})=>u(i,{"data-slot":`sheet-overlay`,className:e(`bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-50 backdrop-blur-xs`,t),...r,ref:n});v.displayName=i.displayName;const y=p(`bg-dialog border-dialog inset-y-0 h-full w-full fixed z-50 flex flex-col shadow-lg outline-hidden transition ease-in-out focus-within:outline-hidden data-state-closed:duration-100 data-state-closed:animate-out data-state-open:duration-100 data-state-open:animate-in`,{variants:{side:{left:`data-state-closed:slide-out-to-left data-state-open:slide-in-from-left left-0 border-r`,right:`data-state-closed:slide-out-to-right data-state-open:slide-in-from-right right-0 border-l`}},defaultVariants:{side:`right`}}),b=({children:t,className:n,preferredWidth:r=`sm:max-w-[30rem]`,side:i=`right`,ref:o,...s})=>d(_,{children:[u(v,{}),u(a,{"data-slot":`sheet-content`,"data-mantle-modal-content":!0,className:e(y({side:i}),r,n),ref:o,...s,children:t})]});b.displayName=a.displayName;const x=({size:e=`md`,type:n=`button`,label:r=`Close Sheet`,appearance:i=`ghost`,intent:a=`neutral`,...o})=>u(l,{asChild:!0,children:u(t,{"data-slot":`sheet-close-icon-button`,appearance:i,icon:u(f,{}),intent:a,label:r,size:e,type:n,...o})});x.displayName=`SheetCloseIconButton`;const S=({className:t,...n})=>u(`div`,{"data-slot":`sheet-body`,className:e(`scrollbar scrollbar-gutter-stable text-body flex-1 overflow-y-auto p-6`,t),...n});S.displayName=`SheetBody`;const C=({className:t,...n})=>u(`div`,{"data-slot":`sheet-header`,className:e(`border-dialog-muted flex shrink-0 flex-col gap-2 border-b py-4 pl-6 pr-4`,`has-[.icon-button]:pr-4`,t),...n});C.displayName=`SheetHeader`;const w=({className:t,...n})=>u(`div`,{"data-slot":`sheet-footer`,className:e(`border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-2.5`,t),...n});w.displayName=`SheetFooter`;const T=({className:t,ref:n,...r})=>u(c,{"data-slot":`sheet-title`,ref:n,className:e(`text-strong flex-1 truncate text-lg font-medium`,t),...r});T.displayName=c.displayName;const E=({children:t,className:n,ref:r,...i})=>u(`div`,{"data-slot":`sheet-title-group`,className:e(`flex items-center justify-between gap-2`,n),...i,ref:r,children:t});E.displayName=`SheetTitleGroup`;const D=({className:t,ref:n,...r})=>u(s,{"data-slot":`sheet-description`,ref:n,className:e(`text-body text-sm`,t),...r});D.displayName=s.displayName;const O=({children:t,className:n,ref:r,...i})=>u(`div`,{"data-slot":`sheet-actions`,className:e(`flex h-full items-center gap-2`,n),...i,ref:r,children:t});O.displayName=`SheetActions`;const k={Root:m,Actions:O,Body:S,Close:g,CloseIconButton:x,Content:b,Description:D,Footer:w,Header:C,Title:T,TitleGroup:E,Trigger:h};export{k as Sheet};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./button-BAno7KIU.js";import{a as n,c as r,i,n as a,o,r as s,s as c,t as l}from"./primitive-trJDqIXJ.js";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{XIcon as f}from"@phosphor-icons/react/X";import{cva as p}from"class-variance-authority";const m=o,h=r,g=l,_=n,v=({className:t,ref:n,...r})=>u(i,{"data-slot":`sheet-overlay`,className:e(`bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-50 backdrop-blur-xs`,t),...r,ref:n}),y=p(`bg-dialog border-dialog inset-y-0 h-full w-full fixed z-50 flex flex-col shadow-lg outline-hidden transition ease-in-out focus-within:outline-hidden data-state-closed:duration-100 data-state-closed:animate-out data-state-open:duration-100 data-state-open:animate-in`,{variants:{side:{left:`data-state-closed:slide-out-to-left data-state-open:slide-in-from-left left-0 border-r`,right:`data-state-closed:slide-out-to-right data-state-open:slide-in-from-right right-0 border-l`}},defaultVariants:{side:`right`}}),b={Root:m,Actions:({children:t,className:n,ref:r,...i})=>u(`div`,{"data-slot":`sheet-actions`,className:e(`flex h-full items-center gap-2`,n),...i,ref:r,children:t}),Body:({className:t,...n})=>u(`div`,{"data-slot":`sheet-body`,className:e(`scrollbar scrollbar-gutter-stable text-body flex-1 overflow-y-auto p-6`,t),...n}),Close:g,CloseIconButton:({size:e=`md`,type:n=`button`,label:r=`Close Sheet`,appearance:i=`ghost`,intent:a=`neutral`,...o})=>u(l,{asChild:!0,children:u(t,{"data-slot":`sheet-close-icon-button`,appearance:i,icon:u(f,{}),intent:a,label:r,size:e,type:n,...o})}),Content:({children:t,className:n,preferredWidth:r=`sm:max-w-[30rem]`,side:i=`right`,ref:o,...s})=>d(_,{children:[u(v,{}),u(a,{"data-slot":`sheet-content`,"data-mantle-modal-content":!0,className:e(y({side:i}),r,n),ref:o,...s,children:t})]}),Description:({className:t,ref:n,...r})=>u(s,{"data-slot":`sheet-description`,ref:n,className:e(`text-body text-sm`,t),...r}),Footer:({className:t,...n})=>u(`div`,{"data-slot":`sheet-footer`,className:e(`border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-2.5`,t),...n}),Header:({className:t,...n})=>u(`div`,{"data-slot":`sheet-header`,className:e(`border-dialog-muted flex shrink-0 flex-col gap-2 border-b py-4 pl-6 pr-4`,`has-[.icon-button]:pr-4`,t),...n}),Title:({className:t,ref:n,...r})=>u(c,{"data-slot":`sheet-title`,ref:n,className:e(`text-strong flex-1 truncate text-lg font-medium`,t),...r}),TitleGroup:({children:t,className:n,ref:r,...i})=>u(`div`,{"data-slot":`sheet-title-group`,className:e(`flex items-center justify-between gap-2`,n),...i,ref:r,children:t}),Trigger:h};export{b as Sheet};
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./anchor-_2meGDfj.js";import{jsx as n}from"react/jsx-runtime";const r=({children:r=`Skip to main content`,className:i,onClick:a,targetId:o=`main`,...s})=>n(t,{...s,"data-slot":`skip-to-main-link`,href:`#${o}`,onClick:e=>{e.preventDefault(),window.history.replaceState(null,``,`#${o}`),document.getElementById(o)?.focus({preventScroll:!0}),a?.(e)},className:e(`not-focus:sr-only bg-card fixed top-2 left-2 z-max px-4 py-2 shadow-lg`,i),children:r});export{r as SkipToMainLink};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./anchor-DfeXTpKW.js";import{jsx as n}from"react/jsx-runtime";const r=({children:r=`Skip to main content`,className:i,onClick:a,targetId:o=`main`,...s})=>n(t,{...s,"data-slot":`skip-to-main-link`,href:`#${o}`,onClick:e=>{e.preventDefault(),window.history.replaceState(null,``,`#${o}`),document.getElementById(o)?.focus({preventScroll:!0}),a?.(e)},className:e(`not-focus:sr-only bg-card fixed top-2 left-2 z-max px-4 py-2 shadow-lg`,i),children:r});export{r as SkipToMainLink};
package/dist/slider.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./field-context-BR01g789.js";import{useContext as n}from"react";import{jsx as r,jsxs as i}from"react/jsx-runtime";import*as a from"@radix-ui/react-slider";function o({"aria-describedby":o,"aria-errormessage":l,"aria-invalid":u,"aria-label":d,"aria-labelledby":f,className:p,color:m=`bg-accent-600`,defaultValue:h,id:g,max:_=100,min:v=0,minStepsBetweenThumbs:y=1,name:b,step:x=1,showTicks:S=!1,value:C,...w}){let T=n(t),E=C==null?void 0:Array.isArray(C)?C:[C],D=h==null?void 0:Array.isArray(h)?h:[h],O=E??D??[v],k=s(S,v,_,x);return i(a.Root,{"data-slot":`slider`,defaultValue:D,value:E,...T?{}:{"aria-describedby":o,"aria-errormessage":l,"aria-invalid":u,id:g},min:v,minStepsBetweenThumbs:y,max:_,name:b,step:x,className:e(`[--slider-thumb-size:--spacing(4.5)]`,`data-orientation-vertical:min-h-40 relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-orientation-vertical:h-full data-orientation-vertical:w-auto data-orientation-vertical:flex-col`,k>0&&`mb-3`,p),...w,children:[r(a.Track,{"data-slot":`slider-track`,className:e(`bg-neutral-300 rounded-full relative grow overflow-hidden`,`data-orientation-horizontal:h-1.5 data-orientation-horizontal:w-full`,`data-orientation-vertical:w-1.5 data-orientation-vertical:h-full`),children:r(a.Range,{"data-slot":`slider-range`,className:e(`absolute select-none data-orientation-horizontal:h-full data-orientation-vertical:w-full`,m)})}),Array.from({length:O.length},(t,n)=>r(a.Thumb,{"data-slot":`slider-thumb`,"aria-describedby":T?.[`aria-describedby`]??o,"aria-errormessage":T?.[`aria-errormessage`]??l,"aria-invalid":T?.[`aria-invalid`]??u,"aria-label":c({ariaLabel:d,index:n,thumbCount:O.length}),"aria-labelledby":f,id:n===0?T?.id:void 0,className:e(`bg-card border-card relative size-(--slider-thumb-size) rounded-full border`,`shadow-md transition-[color,box-shadow]`,`after:absolute after:-inset-2`,`focus-visible:ring-3 focus-visible:ring-accent-500/20 focus-visible:outline-hidden`,`block shrink-0 cursor-pointer select-none`,`data-disabled:pointer-events-none data-disabled:cursor-default`)},n)),k>0&&r(`div`,{"data-slot":`slider-ticks`,className:`absolute top-full mt-1.5 flex w-full justify-between px-[calc(var(--slider-thumb-size)/2)]`,"aria-hidden":`true`,children:Array.from({length:k},(e,t)=>r(`span`,{"data-slot":`slider-tick`,className:`bg-card-border h-1.5 w-px`},t))})]})}function s(e,t,n,r){let i=n-t;return!e||!Number.isFinite(i)||!Number.isFinite(r)||r<=0||i<=0?0:Math.floor(i/r)+1}function c({ariaLabel:e,index:t,thumbCount:n}){if(e)return n===1?e:n===2?`${t===0?`Minimum`:`Maximum`} ${e}`:`${e} ${t+1} of ${n}`}export{o as Slider};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./field-B1wqeZr4.js";import{useContext as n}from"react";import{jsx as r,jsxs as i}from"react/jsx-runtime";import*as a from"@radix-ui/react-slider";function o({"aria-describedby":o,"aria-errormessage":l,"aria-invalid":u,"aria-label":d,"aria-labelledby":f,className:p,color:m=`bg-accent-600`,defaultValue:h,id:g,max:_=100,min:v=0,minStepsBetweenThumbs:y=1,name:b,step:x=1,showTicks:S=!1,value:C,...w}){let T=n(t),E=C==null?void 0:Array.isArray(C)?C:[C],D=h==null?void 0:Array.isArray(h)?h:[h],O=E??D??[v],k=s(S,v,_,x);return i(a.Root,{"data-slot":`slider`,defaultValue:D,value:E,...T?{}:{"aria-describedby":o,"aria-errormessage":l,"aria-invalid":u,id:g},min:v,minStepsBetweenThumbs:y,max:_,name:b,step:x,className:e(`[--slider-thumb-size:--spacing(4.5)]`,`data-orientation-vertical:min-h-40 relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-orientation-vertical:h-full data-orientation-vertical:w-auto data-orientation-vertical:flex-col`,k>0&&`mb-3`,p),...w,children:[r(a.Track,{"data-slot":`slider-track`,className:e(`bg-neutral-300 rounded-full relative grow overflow-hidden`,`data-orientation-horizontal:h-1.5 data-orientation-horizontal:w-full`,`data-orientation-vertical:w-1.5 data-orientation-vertical:h-full`),children:r(a.Range,{"data-slot":`slider-range`,className:e(`absolute select-none data-orientation-horizontal:h-full data-orientation-vertical:w-full`,m)})}),Array.from({length:O.length},(t,n)=>r(a.Thumb,{"data-slot":`slider-thumb`,"aria-describedby":T?.[`aria-describedby`]??o,"aria-errormessage":T?.[`aria-errormessage`]??l,"aria-invalid":T?.[`aria-invalid`]??u,"aria-label":c({ariaLabel:d,index:n,thumbCount:O.length}),"aria-labelledby":f,id:n===0?T?.id:void 0,className:e(`bg-card border-card relative size-(--slider-thumb-size) rounded-full border`,`shadow-md transition-[color,box-shadow]`,`after:absolute after:-inset-2`,`focus-visible:ring-3 focus-visible:ring-accent-500/20 focus-visible:outline-hidden`,`block shrink-0 cursor-pointer select-none`,`data-disabled:pointer-events-none data-disabled:cursor-default`)},n)),k>0&&r(`div`,{"data-slot":`slider-ticks`,className:`absolute top-full mt-1.5 flex w-full justify-between px-[calc(var(--slider-thumb-size)/2)]`,"aria-hidden":`true`,children:Array.from({length:k},(e,t)=>r(`span`,{"data-slot":`slider-tick`,className:`bg-card-border h-1.5 w-px`},t))})]})}function s(e,t,n,r){let i=n-t;return!e||!Number.isFinite(i)||!Number.isFinite(r)||r<=0||i<=0?0:Math.floor(i/r)+1}function c({ariaLabel:e,index:t,thumbCount:n}){if(e)return n===1?e:n===2?`${t===0?`Minimum`:`Maximum`} ${e}`:`${e} ${t+1} of ${n}`}export{o as Slider};
package/dist/slot.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { t as Slot } from "./index-BtwKJTLq.js";
1
+ import { t as Slot } from "./slot-BtwKJTLq.js";
2
2
  export { Slot };
@@ -1,7 +1,7 @@
1
- import { t as Button } from "./button-BPMwa2jN.js";
2
- import { t as IconButton } from "./icon-button-C1AfGnQx.js";
3
- import { t as ButtonSize } from "./sizes-BCoI4bhP.js";
4
- import { t as DropdownMenu } from "./dropdown-menu-CoyozLzy.js";
1
+ import { t as Button } from "./button-DARFK2KJ.js";
2
+ import { t as IconButton } from "./button-C7vAl6lS.js";
3
+ import { t as ButtonSize } from "./button-BCoI4bhP.js";
4
+ import { t as DropdownMenu } from "./dropdown-menu-D6pMAY7I.js";
5
5
  import { ComponentProps, ReactNode } from "react";
6
6
  //#region src/components/split-button/split-button.d.ts
7
7
  type RootProps = ComponentProps<typeof DropdownMenu.Root> & ComponentProps<"div"> & {
@@ -13,36 +13,160 @@ type RootProps = ComponentProps<typeof DropdownMenu.Root> & ComponentProps<"div"
13
13
  */
14
14
  size?: ButtonSize;
15
15
  };
16
- declare const Root: {
17
- ({ className, children, dir, open, defaultOpen, onOpenChange, modal, size, ref, ...props }: RootProps): import("react").JSX.Element;
18
- displayName: string;
19
- };
16
+ /**
17
+ * A button group which provides a default action with one click while revealing
18
+ * related alternatives through a dropdown menu. Best for when users typically
19
+ * want one action but occasionally need variants.
20
+ *
21
+ * @see https://mantle.ngrok.com/components/actions/split-button#splitbuttonroot
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * <SplitButton.Root>
26
+ * <SplitButton.PrimaryAction icon={<CopyIcon />} onClick={copyMarkdownPage}>
27
+ * Copy page
28
+ * </SplitButton.PrimaryAction>
29
+ * <SplitButton.MenuTrigger label="Open doc actions menu" />
30
+ * <SplitButton.MenuContent>
31
+ * <SplitButton.MenuItem onClick={copyMarkdownPage}>
32
+ * Copy page
33
+ * <Icon svg={<CopyIcon />} />
34
+ * </SplitButton.MenuItem>
35
+ * <SplitButton.MenuItem asChild onClick={copyMarkdownPage}>
36
+ * <a href={markdownUrl} target="_blank" rel="noopener noreferrer">
37
+ * View as Markdown
38
+ * <Icon svg={<FileTextIcon />} />
39
+ * </a>
40
+ * </SplitButton.MenuItem>
41
+ * </SplitButton.MenuContent>
42
+ * </SplitButton.Root>
43
+ * ```
44
+ */
45
+ declare const Root: ({ className, children, dir, open, defaultOpen, onOpenChange, modal, size, ref, ...props }: RootProps) => import("react").JSX.Element;
20
46
  type PrimaryActionProps = Omit<ComponentProps<typeof Button>, "appearance" | "intent" | "size">;
21
- declare const PrimaryAction: {
22
- (props: PrimaryActionProps): import("react").JSX.Element;
23
- displayName: string;
24
- };
47
+ /**
48
+ * The most common action users can trigger with a single click.
49
+ *
50
+ * @see https://mantle.ngrok.com/components/actions/split-button#splitbuttonprimaryaction
51
+ *
52
+ * @example
53
+ * ```tsx
54
+ * <SplitButton.Root>
55
+ * <SplitButton.PrimaryAction icon={<CopyIcon />} onClick={copyMarkdownPage}>
56
+ * Copy page
57
+ * </SplitButton.PrimaryAction>
58
+ * <SplitButton.MenuTrigger label="Open doc actions menu" />
59
+ * <SplitButton.MenuContent>
60
+ * <SplitButton.MenuItem onClick={copyMarkdownPage}>
61
+ * Copy page
62
+ * <Icon svg={<CopyIcon />} />
63
+ * </SplitButton.MenuItem>
64
+ * <SplitButton.MenuItem asChild onClick={copyMarkdownPage}>
65
+ * <a href={markdownUrl} target="_blank" rel="noopener noreferrer">
66
+ * View as Markdown
67
+ * <Icon svg={<FileTextIcon />} />
68
+ * </a>
69
+ * </SplitButton.MenuItem>
70
+ * </SplitButton.MenuContent>
71
+ * </SplitButton.Root>
72
+ * ```
73
+ */
74
+ declare const PrimaryAction: (props: PrimaryActionProps) => import("react").JSX.Element;
25
75
  type MenuTriggerProps = Omit<ComponentProps<typeof IconButton>, "appearance" | "intent" | "size" | "asChild" | "icon"> & {
26
76
  icon?: ReactNode;
27
77
  };
28
- declare const MenuTrigger: {
29
- ({ icon, ...props }: MenuTriggerProps): import("react").JSX.Element;
30
- displayName: string;
31
- };
32
- declare const MenuContent: {
33
- ({ align, ...props }: ComponentProps<typeof DropdownMenu.Content>): import("react").JSX.Element;
34
- displayName: string;
35
- };
36
- declare const MenuItem: {
37
- ({ className, ...props }: ComponentProps<typeof DropdownMenu.Item>): import("react").JSX.Element;
38
- displayName: string;
39
- };
78
+ /**
79
+ * The button that opens the split button dropdown menu.
80
+ *
81
+ * @see https://mantle.ngrok.com/components/actions/split-button#splitbuttonmenutrigger
82
+ *
83
+ * @example
84
+ * ```tsx
85
+ * <SplitButton.Root>
86
+ * <SplitButton.PrimaryAction icon={<CopyIcon />} onClick={copyMarkdownPage}>
87
+ * Copy page
88
+ * </SplitButton.PrimaryAction>
89
+ * <SplitButton.MenuTrigger label="Open doc actions menu" />
90
+ * <SplitButton.MenuContent>
91
+ * <SplitButton.MenuItem onClick={copyMarkdownPage}>
92
+ * Copy page
93
+ * <Icon svg={<CopyIcon />} />
94
+ * </SplitButton.MenuItem>
95
+ * <SplitButton.MenuItem asChild onClick={copyMarkdownPage}>
96
+ * <a href={markdownUrl} target="_blank" rel="noopener noreferrer">
97
+ * View as Markdown
98
+ * <Icon svg={<FileTextIcon />} />
99
+ * </a>
100
+ * </SplitButton.MenuItem>
101
+ * </SplitButton.MenuContent>
102
+ * </SplitButton.Root>
103
+ * ```
104
+ */
105
+ declare const MenuTrigger: ({ icon, ...props }: MenuTriggerProps) => import("react").JSX.Element;
106
+ /**
107
+ * The container for the split button dropdown menu content. Appears in a
108
+ * portal with scrolling and animations.
109
+ *
110
+ * @see https://mantle.ngrok.com/components/actions/split-button#splitbuttonmenucontent
111
+ *
112
+ * @example
113
+ * ```tsx
114
+ * <SplitButton.Root>
115
+ * <SplitButton.PrimaryAction icon={<CopyIcon />} onClick={copyMarkdownPage}>
116
+ * Copy page
117
+ * </SplitButton.PrimaryAction>
118
+ * <SplitButton.MenuTrigger label="Open doc actions menu" />
119
+ * <SplitButton.MenuContent>
120
+ * <SplitButton.MenuItem onClick={copyMarkdownPage}>
121
+ * Copy page
122
+ * <Icon svg={<CopyIcon />} />
123
+ * </SplitButton.MenuItem>
124
+ * <SplitButton.MenuItem asChild onClick={copyMarkdownPage}>
125
+ * <a href={markdownUrl} target="_blank" rel="noopener noreferrer">
126
+ * View as Markdown
127
+ * <Icon svg={<FileTextIcon />} />
128
+ * </a>
129
+ * </SplitButton.MenuItem>
130
+ * </SplitButton.MenuContent>
131
+ * </SplitButton.Root>
132
+ * ```
133
+ */
134
+ declare const MenuContent: ({ align, ...props }: ComponentProps<typeof DropdownMenu.Content>) => import("react").JSX.Element;
135
+ /**
136
+ * A standard item in the split button dropdown menu that can be selected or
137
+ * activated.
138
+ *
139
+ * @see https://mantle.ngrok.com/components/actions/split-button#splitbuttonmenuitem
140
+ *
141
+ * @example
142
+ * ```tsx
143
+ * <SplitButton.Root>
144
+ * <SplitButton.PrimaryAction icon={<CopyIcon />} onClick={copyMarkdownPage}>
145
+ * Copy page
146
+ * </SplitButton.PrimaryAction>
147
+ * <SplitButton.MenuTrigger label="Open doc actions menu" />
148
+ * <SplitButton.MenuContent>
149
+ * <SplitButton.MenuItem onClick={copyMarkdownPage}>
150
+ * Copy page
151
+ * <Icon svg={<CopyIcon />} />
152
+ * </SplitButton.MenuItem>
153
+ * <SplitButton.MenuItem asChild onClick={copyMarkdownPage}>
154
+ * <a href={markdownUrl} target="_blank" rel="noopener noreferrer">
155
+ * View as Markdown
156
+ * <Icon svg={<FileTextIcon />} />
157
+ * </a>
158
+ * </SplitButton.MenuItem>
159
+ * </SplitButton.MenuContent>
160
+ * </SplitButton.Root>
161
+ * ```
162
+ */
163
+ declare const MenuItem: ({ className, ...props }: ComponentProps<typeof DropdownMenu.Item>) => import("react").JSX.Element;
40
164
  /**
41
165
  * A button group which provides a default action with one click while revealing
42
166
  * related alternatives through a dropdown menu. Best for when users typically
43
167
  * want one action but occasionally need variants.
44
168
  *
45
- * @see https://mantle.ngrok.com/components/actions/split-button#splitbuttonroot
169
+ * @see https://mantle.ngrok.com/components/actions/split-button
46
170
  *
47
171
  * @example
48
172
  * Composition:
@@ -67,7 +191,7 @@ declare const MenuItem: {
67
191
  * Copy page
68
192
  * </SplitButton.MenuItem>
69
193
  * <SplitButton.MenuItem asChild onClick={copyMarkdownPage}>
70
- * <a href={markdownUrl} target="_blank">
194
+ * <a href={markdownUrl} target="_blank" rel="noopener noreferrer">
71
195
  * <Icon svg={<FileTextIcon />} />
72
196
  * View as Markdown
73
197
  * </a>
@@ -97,7 +221,7 @@ declare const SplitButton: {
97
221
  * <Icon svg={<CopyIcon />} />
98
222
  * </SplitButton.MenuItem>
99
223
  * <SplitButton.MenuItem asChild onClick={copyMarkdownPage}>
100
- * <a href={markdownUrl} target="_blank">
224
+ * <a href={markdownUrl} target="_blank" rel="noopener noreferrer">
101
225
  * View as Markdown
102
226
  * <Icon svg={<FileTextIcon />} />
103
227
  * </a>
@@ -125,7 +249,7 @@ declare const SplitButton: {
125
249
  * <Icon svg={<CopyIcon />} />
126
250
  * </SplitButton.MenuItem>
127
251
  * <SplitButton.MenuItem asChild onClick={copyMarkdownPage}>
128
- * <a href={markdownUrl} target="_blank">
252
+ * <a href={markdownUrl} target="_blank" rel="noopener noreferrer">
129
253
  * View as Markdown
130
254
  * <Icon svg={<FileTextIcon />} />
131
255
  * </a>
@@ -153,7 +277,7 @@ declare const SplitButton: {
153
277
  * <Icon svg={<CopyIcon />} />
154
278
  * </SplitButton.MenuItem>
155
279
  * <SplitButton.MenuItem asChild onClick={copyMarkdownPage}>
156
- * <a href={markdownUrl} target="_blank">
280
+ * <a href={markdownUrl} target="_blank" rel="noopener noreferrer">
157
281
  * View as Markdown
158
282
  * <Icon svg={<FileTextIcon />} />
159
283
  * </a>
@@ -182,7 +306,7 @@ declare const SplitButton: {
182
306
  * <Icon svg={<CopyIcon />} />
183
307
  * </SplitButton.MenuItem>
184
308
  * <SplitButton.MenuItem asChild onClick={copyMarkdownPage}>
185
- * <a href={markdownUrl} target="_blank">
309
+ * <a href={markdownUrl} target="_blank" rel="noopener noreferrer">
186
310
  * View as Markdown
187
311
  * <Icon svg={<FileTextIcon />} />
188
312
  * </a>
@@ -211,7 +335,7 @@ declare const SplitButton: {
211
335
  * <Icon svg={<CopyIcon />} />
212
336
  * </SplitButton.MenuItem>
213
337
  * <SplitButton.MenuItem asChild onClick={copyMarkdownPage}>
214
- * <a href={markdownUrl} target="_blank">
338
+ * <a href={markdownUrl} target="_blank" rel="noopener noreferrer">
215
339
  * View as Markdown
216
340
  * <Icon svg={<FileTextIcon />} />
217
341
  * </a>
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CGgMKpJg.js";import{t as n}from"./icon-button-DiOhreJD.js";import{t as r}from"./button-5WsvzIQ6.js";import{t as i}from"./dropdown-menu-CSCDdA3K.js";import{CaretDownIcon as a}from"@phosphor-icons/react/CaretDown";import{createContext as o,useContext as s,useMemo as c}from"react";import{jsx as l}from"react/jsx-runtime";const u=o({size:`md`}),d=({className:t,children:n,dir:r,open:a,defaultOpen:o,onOpenChange:s,modal:d,size:f=`md`,ref:p,...m})=>{let h=c(()=>({size:f}),[f]);return l(i.Root,{dir:r,open:a,defaultOpen:o,onOpenChange:s,modal:d,children:l(u.Provider,{value:h,children:l(`div`,{"data-slot":`split-button`,"data-size":f,className:e(`flex flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ml-px [&>*:focus]:relative [&>*:focus]:z-10 [&>*:hover]:relative [&>*:hover]:z-10 *:active:scale-100!`,t),ref:p,...m,children:n})})})};d.displayName=`SplitButton`;const f=e=>{let{size:t}=s(u);return l(r,{appearance:`outlined`,intent:`neutral`,size:t,...e})};f.displayName=`SplitButtonPrimaryAction`;const p=({icon:e,...r})=>{let{size:o}=s(u);return l(i.Trigger,{asChild:!0,className:`group`,children:l(n,{icon:e??l(t,{svg:l(a,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform ease-out duration-150`})}),appearance:`outlined`,intent:`neutral`,size:o,...r})})};p.displayName=`SplitButtonMenuTrigger`;const m=({align:e=`end`,...t})=>l(i.Content,{align:e,...t});m.displayName=`SplitButtonMenuContent`;const h=({className:t,...n})=>l(i.Item,{className:e(`gap-2`,t),...n});h.displayName=`SplitButtonMenuItem`;const g={Root:d,PrimaryAction:f,MenuTrigger:p,MenuContent:m,MenuItem:h};export{g as SplitButton};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-lZ48P8Nn.js";import{t as n}from"./button-DjpEKt2X.js";import{t as r}from"./button-BAno7KIU.js";import{t as i}from"./dropdown-menu-RyDWoKHx.js";import{CaretDownIcon as a}from"@phosphor-icons/react/CaretDown";import{createContext as o,useContext as s,useMemo as c}from"react";import{jsx as l}from"react/jsx-runtime";const u=o({size:`md`}),d={Root:({className:t,children:n,dir:r,open:a,defaultOpen:o,onOpenChange:s,modal:d,size:f=`md`,ref:p,...m})=>{let h=c(()=>({size:f}),[f]);return l(i.Root,{dir:r,open:a,defaultOpen:o,onOpenChange:s,modal:d,children:l(u.Provider,{value:h,children:l(`div`,{"data-slot":`split-button`,"data-size":f,className:e(`flex flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ml-px [&>*:focus]:relative [&>*:focus]:z-10 [&>*:hover]:relative [&>*:hover]:z-10 *:active:scale-100!`,t),ref:p,...m,children:n})})})},PrimaryAction:e=>{let{size:t}=s(u);return l(n,{appearance:`outlined`,intent:`neutral`,size:t,...e})},MenuTrigger:({icon:e,...n})=>{let{size:o}=s(u);return l(i.Trigger,{asChild:!0,className:`group`,children:l(r,{icon:e??l(t,{svg:l(a,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform ease-out duration-150`})}),appearance:`outlined`,intent:`neutral`,size:o,...n})})},MenuContent:({align:e=`end`,...t})=>l(i.Content,{align:e,...t}),MenuItem:({className:t,...n})=>l(i.Item,{className:e(`gap-2`,t),...n})};export{d as SplitButton};