@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
@@ -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
@@ -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 —
@@ -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`.
@@ -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`.
@@ -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`.
@@ -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.
@@ -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
  *
@@ -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
  *
@@ -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
  *
@@ -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
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-DZg-Cd69.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,30 +13,15 @@ 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
+ declare const Root: ({ className, children, dir, open, defaultOpen, onOpenChange, modal, size, ref, ...props }: RootProps) => import("react").JSX.Element;
20
17
  type PrimaryActionProps = Omit<ComponentProps<typeof Button>, "appearance" | "intent" | "size">;
21
- declare const PrimaryAction: {
22
- (props: PrimaryActionProps): import("react").JSX.Element;
23
- displayName: string;
24
- };
18
+ declare const PrimaryAction: (props: PrimaryActionProps) => import("react").JSX.Element;
25
19
  type MenuTriggerProps = Omit<ComponentProps<typeof IconButton>, "appearance" | "intent" | "size" | "asChild" | "icon"> & {
26
20
  icon?: ReactNode;
27
21
  };
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
- };
22
+ declare const MenuTrigger: ({ icon, ...props }: MenuTriggerProps) => import("react").JSX.Element;
23
+ declare const MenuContent: ({ align, ...props }: ComponentProps<typeof DropdownMenu.Content>) => import("react").JSX.Element;
24
+ declare const MenuItem: ({ className, ...props }: ComponentProps<typeof DropdownMenu.Item>) => import("react").JSX.Element;
40
25
  /**
41
26
  * A button group which provides a default action with one click while revealing
42
27
  * related alternatives through a dropdown menu. Best for when users typically
@@ -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-BAno7KIU.js";import{t as r}from"./button-DjpEKt2X.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(r,{appearance:`outlined`,intent:`neutral`,size:t,...e})},MenuTrigger:({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})})},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};
package/dist/switch.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { o as WithValidation } from "./validation-7QeiTFwl.js";
1
+ import { o as WithValidation } from "./field-7QeiTFwl.js";
2
2
  import { ComponentProps } from "react";
3
3
  import { Root } from "@radix-ui/react-switch";
4
4
  //#region src/components/switch/switch.d.ts
package/dist/switch.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./booleanish-BfvnW6vy.js";import{t as n}from"./clsx-DUGZgXfJ.js";import{a as r,r as i}from"./validation-Bpptk_9t.js";import{jsx as a}from"react/jsx-runtime";import{Root as o,Thumb as s}from"@radix-ui/react-switch";const c=({"aria-invalid":c,"aria-readonly":l,className:u,readOnly:d,onClick:f,ref:p,validation:m,...h})=>{let g=t(d??l),_=r(),{ariaInvalid:v,validation:y}=i({"aria-invalid":c,validation:m??_});return a(o,{"aria-invalid":v,"aria-readonly":g,"data-slot":`switch`,"data-validation":y||void 0,className:e(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full outline-hidden`,`disabled:cursor-default disabled:opacity-50`,`focus-visible:border-accent-600 focus-visible:ring-focus-accent focus-visible:outline-hidden focus-visible:ring-4`,`data-state-checked:bg-accent-600 data-state-unchecked:bg-gray-400`,`data-validation-success:data-state-checked:bg-success-600 focus-visible:data-validation-success:ring-focus-success`,`data-validation-warning:data-state-checked:bg-warning-600 focus-visible:data-validation-warning:ring-focus-warning`,`data-validation-error:data-state-checked:bg-danger-600 focus-visible:data-validation-error:ring-focus-danger`,u),onClick:e=>{if(g){e.preventDefault(),e.stopPropagation();return}f?.(e)},ref:p,...h,children:a(s,{className:n(`pointer-events-none block size-4 rounded-full bg-[#fff] shadow-md ring-0 transition-transform`,`data-state-checked:translate-x-4.5 data-state-unchecked:translate-x-0.5`)})})};export{c as Switch};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./booleanish-BfvnW6vy.js";import{t as n}from"./clsx-DUGZgXfJ.js";import{a as r,r as i}from"./field-Bpptk_9t.js";import{jsx as a}from"react/jsx-runtime";import{Root as o,Thumb as s}from"@radix-ui/react-switch";const c=({"aria-invalid":c,"aria-readonly":l,className:u,readOnly:d,onClick:f,ref:p,validation:m,...h})=>{let g=t(d??l),_=r(),{ariaInvalid:v,validation:y}=i({"aria-invalid":c,validation:m??_});return a(o,{"aria-invalid":v,"aria-readonly":g,"data-slot":`switch`,"data-validation":y||void 0,className:e(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full outline-hidden`,`disabled:cursor-default disabled:opacity-50`,`focus-visible:border-accent-600 focus-visible:ring-focus-accent focus-visible:outline-hidden focus-visible:ring-4`,`data-state-checked:bg-accent-600 data-state-unchecked:bg-gray-400`,`data-validation-success:data-state-checked:bg-success-600 focus-visible:data-validation-success:ring-focus-success`,`data-validation-warning:data-state-checked:bg-warning-600 focus-visible:data-validation-warning:ring-focus-warning`,`data-validation-error:data-state-checked:bg-danger-600 focus-visible:data-validation-error:ring-focus-danger`,u),onClick:e=>{if(g){e.preventDefault(),e.stopPropagation();return}f?.(e)},ref:p,...h,children:a(s,{className:n(`pointer-events-none block size-4 rounded-full bg-[#fff] shadow-md ring-0 transition-transform`,`data-state-checked:translate-x-4.5 data-state-unchecked:translate-x-0.5`)})})};export{c as Switch};
@@ -42,10 +42,7 @@ import { ComponentProps } from "react";
42
42
  *
43
43
  * @see https://mantle.ngrok.com/components/data-display/table#tableroot
44
44
  */
45
- declare const Root: {
46
- ({ children, className, ref, ...props }: ComponentProps<"div">): import("react").JSX.Element;
47
- displayName: string;
48
- };
45
+ declare const Root: ({ children, className, ref, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
49
46
  /**
50
47
  * The `<Table.Element>` is a structured way to display data in rows and columns. The API
51
48
  * matches the HTML `<table>` element 1:1.
@@ -111,10 +108,7 @@ declare const Root: {
111
108
  *
112
109
  * @see https://mantle.ngrok.com/components/data-display/table#tableelement
113
110
  */
114
- declare const Element: {
115
- ({ children, className, ref, ...props }: ComponentProps<"table">): import("react").JSX.Element;
116
- displayName: string;
117
- };
111
+ declare const Element: ({ children, className, ref, ...props }: ComponentProps<"table">) => import("react").JSX.Element;
118
112
  /**
119
113
  * The `<Table.Head>` is a container for the table's column headers.
120
114
  * Encapsulates a set of `<Table.Row>`s, indicating that they comprise the head
@@ -162,10 +156,7 @@ declare const Element: {
162
156
  *
163
157
  * @see https://mantle.ngrok.com/components/data-display/table#tableheader
164
158
  */
165
- declare const Head: {
166
- ({ children, className, ref, ...props }: ComponentProps<"thead">): import("react").JSX.Element;
167
- displayName: string;
168
- };
159
+ declare const Head: ({ children, className, ref, ...props }: ComponentProps<"thead">) => import("react").JSX.Element;
169
160
  /**
170
161
  * The `<Table.Body>` encapsulates a set of `<Table.Row>`s, indicating that they
171
162
  * comprise the body of a table's (main) data.
@@ -211,10 +202,7 @@ declare const Head: {
211
202
  *
212
203
  * @see https://mantle.ngrok.com/components/data-display/table#tablebody
213
204
  */
214
- declare const Body: {
215
- ({ children, className, ref, ...props }: ComponentProps<"tbody">): import("react").JSX.Element;
216
- displayName: string;
217
- };
205
+ declare const Body: ({ children, className, ref, ...props }: ComponentProps<"tbody">) => import("react").JSX.Element;
218
206
  /**
219
207
  * The `<Table.Foot>` encapsulates a set of `<Table.Row>`s, indicating that they
220
208
  * comprise the foot of a table with information about the table's columns. This
@@ -262,10 +250,7 @@ declare const Body: {
262
250
  *
263
251
  * @see https://mantle.ngrok.com/components/data-display/table#tablefoot
264
252
  */
265
- declare const Foot: {
266
- ({ children, className, ref, ...props }: ComponentProps<"tfoot">): import("react").JSX.Element;
267
- displayName: string;
268
- };
253
+ declare const Foot: ({ children, className, ref, ...props }: ComponentProps<"tfoot">) => import("react").JSX.Element;
269
254
  /**
270
255
  * The `<Table.Row>` defines a row of cells in a table. The row's cells can then
271
256
  * be established using a mix of `<Table.Cell>` and `<Table.Header>` components.
@@ -310,10 +295,7 @@ declare const Foot: {
310
295
  *
311
296
  * @see https://mantle.ngrok.com/components/data-display/table#tablerow
312
297
  */
313
- declare const Row: {
314
- ({ children, className, ref, ...props }: ComponentProps<"tr">): import("react").JSX.Element;
315
- displayName: string;
316
- };
298
+ declare const Row: ({ children, className, ref, ...props }: ComponentProps<"tr">) => import("react").JSX.Element;
317
299
  /**
318
300
  * The `<Table.Header>` defines a cell as the header of a group of table cells
319
301
  * and may be used as a child of a `<Table.Row>`. The exact nature of this group
@@ -360,10 +342,7 @@ declare const Row: {
360
342
  *
361
343
  * @see https://mantle.ngrok.com/components/data-display/table#tableheader
362
344
  */
363
- declare const Header: {
364
- ({ children, className, ref, ...props }: ComponentProps<"th">): import("react").JSX.Element;
365
- displayName: string;
366
- };
345
+ declare const Header: ({ children, className, ref, ...props }: ComponentProps<"th">) => import("react").JSX.Element;
367
346
  /**
368
347
  * The `<Table.Cell>` defines a cell of a table that contains data and may be
369
348
  * used as a child of a `<Table.Row>`.
@@ -408,10 +387,7 @@ declare const Header: {
408
387
  *
409
388
  * @see https://mantle.ngrok.com/components/data-display/table#tablecell
410
389
  */
411
- declare const Cell: {
412
- ({ children, className, ref, ...props }: ComponentProps<"td">): import("react").JSX.Element;
413
- displayName: string;
414
- };
390
+ declare const Cell: ({ children, className, ref, ...props }: ComponentProps<"td">) => import("react").JSX.Element;
415
391
  /**
416
392
  * The optional `<Table.Caption>` specifies the caption (or title) of a table,
417
393
  * providing the table an accessible description.
@@ -456,10 +432,7 @@ declare const Cell: {
456
432
  *
457
433
  * @see https://mantle.ngrok.com/components/data-display/table#tablecaption
458
434
  */
459
- declare const Caption: {
460
- ({ children, className, ref, ...props }: ComponentProps<"caption">): import("react").JSX.Element;
461
- displayName: string;
462
- };
435
+ declare const Caption: ({ children, className, ref, ...props }: ComponentProps<"caption">) => import("react").JSX.Element;
463
436
  /**
464
437
  * Use `Table` for STATIC, layout-driven tabular data — read-only data dumps,
465
438
  * simple key/value displays, plain markup tables. The API matches the HTML
@@ -0,0 +1 @@
1
+ import{t as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{useLayoutEffect as n,useMemo as r,useRef as i,useState as a}from"react";import{jsx as o}from"react/jsx-runtime";const s={Body:({children:e,className:n,ref:r,...i})=>o(`tbody`,{"data-slot":`table-body`,className:t(`[&>tr+tr>*]:border-t [&>tr+tr>*]:border-card-muted`,`text-body`,`[&>tr]:bg-card [&>tr]:not-only:hover:bg-card-hover`,n),ref:r,...i,children:e}),Caption:({children:e,className:n,ref:r,...i})=>o(`caption`,{"data-slot":`table-caption`,ref:r,className:t(`py-4 text-sm text-gray-500`,`border-t border-card-muted`,n),...i,children:e}),Cell:({children:e,className:n,ref:r,...i})=>o(`td`,{"data-slot":`table-cell`,ref:r,className:t(`p-3 align-middle [&:has([role=checkbox])]:pr-0 font-mono text-mono`,n),...i,children:e}),Element:({children:e,className:n,ref:r,...i})=>o(`table`,{"data-slot":`table-element`,ref:r,className:t(`table-auto border-separate border-spacing-0 caption-bottom w-full min-w-full text-left`,n),...i,children:e}),Foot:({children:e,className:n,ref:r,...i})=>o(`tfoot`,{"data-slot":`table-foot`,ref:r,className:t(`font-medium text-body`,`[&>tr:first-child>*]:border-t [&>tr:first-child>*]:border-card-muted`,`[&>tr+tr>*]:border-t [&>tr+tr>*]:border-card-muted`,`[&>tr]:bg-gray-50/50 [&>tr]:hover:bg-card-hover`,n),...i,children:e}),Head:({children:e,className:n,ref:r,...i})=>o(`thead`,{"data-slot":`table-head`,ref:r,className:t(`[&>tr:last-child>*]:border-b [&>tr:last-child>*]:border-card-muted`,`[&>tr+tr>*]:border-t [&>tr+tr>*]:border-card-muted`,`text-muted bg-base`,`[&>tr]:bg-base`,n),...i,children:e}),Header:({children:e,className:n,ref:r,...i})=>o(`th`,{"data-slot":`table-header`,ref:r,className:t(`h-11 px-4 text-left align-middle text-sm font-medium [&:has([role=checkbox])]:pr-0`,n),...i,children:e}),Root:({children:n,className:r,ref:i,...a})=>{let s=c();return o(`div`,{"data-slot":`table`,className:t(`group/table relative w-full overflow-hidden rounded-lg border border-card bg-white dark:bg-gray-100`,r),"data-sticky-active":s.state.hasOverflow&&!s.state.scrolledToEnd||void 0,"data-x-overflow":s.state.hasOverflow,"data-x-scroll-end":s.state.hasOverflow&&s.state.scrolledToEnd,...a,children:o(`div`,{className:t(`scrollbar scroll-fade-x overflow-x-auto overflow-y-clip overscroll-x-none`,`has-data-mantle-table-sticky-right:[--_fade-right:black]`),ref:e(s.ref,i),children:n})})},Row:({children:e,className:n,ref:r,...i})=>o(`tr`,{"data-slot":`table-row`,ref:r,className:t(n),...i,children:e})};function c(){let e=i(null),[t,o]=a({hasOverflow:!1,scrolledToStart:!0,scrolledToEnd:!1});return n(()=>{let t=e.current;if(!t)return;let n=0,r=()=>{let e=t.scrollWidth>t.clientWidth,n=t.scrollLeft<1,r=Math.abs(t.scrollWidth-t.scrollLeft-t.clientWidth)<1;o(t=>t.hasOverflow!==e||t.scrolledToStart!==n||t.scrolledToEnd!==r?{hasOverflow:e,scrolledToStart:n,scrolledToEnd:r}:t)},i=()=>{n===0&&(n=requestAnimationFrame(()=>{n=0,r()}))},a=new ResizeObserver(i);a.observe(t);let s=new MutationObserver(i);return s.observe(t,{childList:!0,subtree:!0}),t.addEventListener(`scroll`,i,{passive:!0}),r(),()=>{cancelAnimationFrame(n),a.disconnect(),s.disconnect(),t.removeEventListener(`scroll`,i)}},[]),r(()=>({ref:e,state:t}),[t])}export{s as t};
package/dist/table.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { t as Table } from "./table-DUSvU_Jw.js";
1
+ import { t as Table } from "./table-Bo0vNxIJ.js";
2
2
  export { Table };
package/dist/table.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./table-GDkapNFi.js";export{e as Table};
1
+ import{t as e}from"./table-CGxJwtbL.js";export{e as Table};
package/dist/tabs.d.ts CHANGED
@@ -23,17 +23,14 @@ import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
23
23
  * </Tabs.Root>
24
24
  * ```
25
25
  */
26
- declare const Root$1: {
27
- ({ className, children, orientation, appearance, ...props }: ComponentProps<typeof Root> & {
28
- /**
29
- * The appearance of the tabs. Classic appearance shows the tab
30
- * list with an underline; pill appearance shows each tab as a pill.
31
- * @default "classic"
32
- */
33
- appearance?: "classic" | "pill";
34
- }): import("react").JSX.Element;
35
- displayName: string;
36
- };
26
+ declare const Root$1: ({ className, children, orientation, appearance, ...props }: ComponentProps<typeof Root> & {
27
+ /**
28
+ * The appearance of the tabs. Classic appearance shows the tab
29
+ * list with an underline; pill appearance shows each tab as a pill.
30
+ * @default "classic"
31
+ */
32
+ appearance?: "classic" | "pill";
33
+ }) => import("react").JSX.Element;
37
34
  /**
38
35
  * Contains the triggers that are aligned along the edge of the active content.
39
36
  * The container for tab triggers that provides the visual layout for tab navigation.
@@ -67,19 +64,16 @@ declare const Root$1: {
67
64
  * </Tabs.List>
68
65
  * ```
69
66
  */
70
- declare const List$1: {
71
- ({ className, hideBorder, ref, ...props }: ComponentProps<typeof List> & {
72
- /**
73
- * Hide the tablist's border the bottom border of a horizontal classic
74
- * tablist, or the side border of a vertical one. Also rendered as a
75
- * `data-hide-border` attribute on the tablist element. Has no effect on
76
- * the pill appearance, which never draws a border.
77
- * @default false
78
- */
79
- hideBorder?: boolean;
80
- }): import("react").JSX.Element;
81
- displayName: string;
82
- };
67
+ declare const List$1: ({ className, hideBorder, ref, ...props }: ComponentProps<typeof List> & {
68
+ /**
69
+ * Hide the tablist's border — the bottom border of a horizontal classic
70
+ * tablist, or the side border of a vertical one. Also rendered as a
71
+ * `data-hide-border` attribute on the tablist element. Has no effect on
72
+ * the pill appearance, which never draws a border.
73
+ * @default false
74
+ */
75
+ hideBorder?: boolean;
76
+ }) => import("react").JSX.Element;
83
77
  type TabsTriggerProps = ComponentProps<typeof Trigger>;
84
78
  /**
85
79
  * The button that activates its associated content.
@@ -100,10 +94,7 @@ type TabsTriggerProps = ComponentProps<typeof Trigger>;
100
94
  * </Tabs.Root>
101
95
  * ```
102
96
  */
103
- declare const Trigger$1: {
104
- ({ "aria-disabled": _ariaDisabled, asChild, children, className, disabled: _disabled, ref, ...props }: TabsTriggerProps): import("react").JSX.Element;
105
- displayName: string;
106
- };
97
+ declare const Trigger$1: ({ "aria-disabled": _ariaDisabled, asChild, children, className, disabled: _disabled, ref, ...props }: TabsTriggerProps) => import("react").JSX.Element;
107
98
  /**
108
99
  * A badge component that can be used inside tab triggers to display additional information.
109
100
  * Typically used to show counts or status indicators within tab headers.
@@ -122,10 +113,7 @@ declare const Trigger$1: {
122
113
  * </Tabs.Root>
123
114
  * ```
124
115
  */
125
- declare const Badge: {
126
- ({ className, children, ...props }: HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
127
- displayName: string;
128
- };
116
+ declare const Badge: ({ className, children, ...props }: HTMLAttributes<HTMLSpanElement>) => import("react").JSX.Element;
129
117
  /**
130
118
  * Contains the content associated with each trigger.
131
119
  * The content panel that displays when its corresponding tab trigger is active.
@@ -148,10 +136,7 @@ declare const Badge: {
148
136
  * </Tabs.Root>
149
137
  * ```
150
138
  */
151
- declare const Content$1: {
152
- ({ className, ...props }: ComponentProps<typeof Content>): import("react").JSX.Element;
153
- displayName: string;
154
- };
139
+ declare const Content$1: ({ className, ...props }: ComponentProps<typeof Content>) => import("react").JSX.Element;
155
140
  /**
156
141
  * A set of layered sections of content—known as tab panels—that are displayed one at a time.
157
142
  * The root component that provides context for all tab components.
package/dist/tabs.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./booleanish-BfvnW6vy.js";import{t as r}from"./clsx-DUGZgXfJ.js";import{t as i}from"./use-prefers-reduced-motion-CagaNRgm.js";import{Children as a,cloneElement as o,createContext as s,isValidElement as c,useContext as l,useEffect as u,useMemo as d,useRef as f}from"react";import p from"tiny-invariant";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{cva as _}from"class-variance-authority";import{Content as v,List as y,Root as b,Trigger as x}from"@radix-ui/react-tabs";const S=s({orientation:`horizontal`,appearance:`classic`}),C=({className:e,children:n,orientation:r=`horizontal`,appearance:i=`classic`,...a})=>{let o=d(()=>({orientation:r,appearance:i}),[r,i]);return h(b,{"data-slot":`tabs`,"data-appearance":i,className:t(`flex gap-4`,r===`horizontal`?`flex-col`:`flex-row`,e),orientation:r,...a,children:h(S.Provider,{value:o,children:n})})};C.displayName=`Tabs`;const w=_(`flex`,{variants:{orientation:{horizontal:`scroll-fade-x flex-row items-center overflow-x-auto overscroll-x-none w-full min-w-0 pt-1 -mt-1 px-1 -mx-1`,vertical:`flex-col items-end gap-3.5 self-stretch`},appearance:{classic:``,pill:``},hideBorder:{true:``,false:``}},compoundVariants:[{orientation:`horizontal`,appearance:`pill`,className:`gap-1 pb-1 -mb-1`},{orientation:`horizontal`,appearance:`classic`,className:`gap-6`},{orientation:`horizontal`,appearance:`classic`,hideBorder:!1,className:t(`pb-px bg-origin-content bg-no-repeat bg-size-[100%_1px] bg-position-[0_calc(100%+1px)]`,`bg-[image:linear-gradient(var(--color-separator),var(--color-separator))]`,`[--_fade-bottom-border:black]`)},{orientation:`vertical`,appearance:`classic`,hideBorder:!1,className:`border-r border-separator`}],defaultVariants:{hideBorder:!1}}),T=({className:n,hideBorder:r=!1,ref:a,...o})=>{let{orientation:s,appearance:c}=l(S),d=f(null);return u(()=>{let e=d.current;if(!e||s!==`horizontal`)return;let t=new AbortController;return e.addEventListener(`focusin`,t=>{if(t.target instanceof Element&&t.target!==e){let e=i()?`auto`:`smooth`;t.target.scrollIntoView({behavior:e,inline:`center`,block:`nearest`})}},{signal:t.signal}),()=>{t.abort()}},[s]),h(y,{"aria-orientation":s,"data-slot":`tabs-list`,"data-hide-border":r?``:void 0,className:t(w({orientation:s,appearance:c,hideBorder:r}),n),ref:e(d,a),...o})};T.displayName=`TabsList`;const E=_(`absolute z-0`,{variants:{orientation:{horizontal:`bottom-0 left-0 right-0 h-0.75`,vertical:`-right-px bottom-0 top-0 w-0.75`},appearance:{classic:`group-data-state-active/tab-trigger:bg-neutral-950`,pill:`hidden`}}}),D=()=>{let{orientation:e,appearance:t}=l(S);return h(`span`,{"aria-hidden":!0,className:r(E({orientation:e,appearance:t}))})},O=_(t(`group/tab-trigger relative flex cursor-pointer items-center gap-1 whitespace-nowrap py-3 text-sm font-medium text-gray-600`,`ring-focus-accent outline-hidden`,`aria-disabled:cursor-default aria-disabled:opacity-50`,`focus-visible:ring-4`,`[&>svg]:shrink-0 [&>svg]:size-5`,`not-aria-disabled:hover:text-gray-900`),{variants:{orientation:{horizontal:`rounded-tl-md rounded-tr-md`,vertical:`rounded-bl-md rounded-tl-md pr-3`},appearance:{classic:t(`not-aria-disabled:hover:data-state-active:text-strong`,`data-state-active:text-strong`),pill:t(`not-aria-disabled:hover:data-state-active:text-strong`,`not-aria-disabled:hover:data-state-active:bg-neutral-500/15`,`data-state-active:text-strong`,`data-state-active:bg-neutral-500/15`,`rounded-full py-2 px-3`)}}}),k=({"aria-disabled":e,asChild:r=!1,children:i,className:s,disabled:u,ref:d,...f})=>{let{orientation:_,appearance:v}=l(S),y=n(e??u),b={"aria-disabled":e??u,className:t(O({orientation:_,appearance:v}),s),disabled:y,...f};if(r){let e=a.only(i);p(c(e),"When using `asChild`, TabsTrigger must be passed a single child as a JSX tag.");let t=e.props?.children,n=y?{href:void 0,to:void 0}:{tabIndex:0};return h(x,{asChild:!0,"data-slot":`tabs-trigger`,...b,ref:d,children:o(y?h(`button`,{type:`button`}):e,n,g(m,{children:[h(D,{}),t]}))})}return g(x,{"data-slot":`tabs-trigger`,ref:d,...b,children:[h(D,{}),i]})};k.displayName=`TabsTrigger`;const A=({className:e,children:n,...r})=>h(`span`,{"data-slot":`tabs-badge`,className:t(`rounded-full bg-neutral-500/20 px-1.5 text-xs font-medium text-gray-600`,`group-data-state-active/tab-trigger:bg-neutral-950/10 group-data-state-active/tab-trigger:text-strong group-hover/tab-trigger:group-enabled/tab-trigger:group-data-state-active/tab-trigger:text-strong`,`group-hover/tab-trigger:group-enabled/tab-trigger:text-gray-700`,e),...r,children:n});A.displayName=`TabBadge`;const j=({className:e,...n})=>h(v,{"data-slot":`tabs-content`,className:t(`focus-visible:ring-focus-accent outline-hidden focus-visible:ring-4`,e),...n});j.displayName=`TabsContent`;const M={Root:C,Content:j,List:T,Trigger:k,Badge:A};export{M as Tabs};
1
+ import{t as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./booleanish-BfvnW6vy.js";import{t as r}from"./clsx-DUGZgXfJ.js";import{t as i}from"./use-prefers-reduced-motion-CagaNRgm.js";import{Children as a,cloneElement as o,createContext as s,isValidElement as c,useContext as l,useEffect as u,useMemo as d,useRef as f}from"react";import p from"tiny-invariant";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{cva as _}from"class-variance-authority";import{Content as v,List as y,Root as b,Trigger as x}from"@radix-ui/react-tabs";const S=s({orientation:`horizontal`,appearance:`classic`}),C=({className:e,children:n,orientation:r=`horizontal`,appearance:i=`classic`,...a})=>{let o=d(()=>({orientation:r,appearance:i}),[r,i]);return h(b,{"data-slot":`tabs`,"data-appearance":i,className:t(`flex gap-4`,r===`horizontal`?`flex-col`:`flex-row`,e),orientation:r,...a,children:h(S.Provider,{value:o,children:n})})},w=_(`flex`,{variants:{orientation:{horizontal:`scroll-fade-x flex-row items-center overflow-x-auto overscroll-x-none w-full min-w-0 pt-1 -mt-1 px-1 -mx-1`,vertical:`flex-col items-end gap-3.5 self-stretch`},appearance:{classic:``,pill:``},hideBorder:{true:``,false:``}},compoundVariants:[{orientation:`horizontal`,appearance:`pill`,className:`gap-1 pb-1 -mb-1`},{orientation:`horizontal`,appearance:`classic`,className:`gap-6`},{orientation:`horizontal`,appearance:`classic`,hideBorder:!1,className:t(`pb-px bg-origin-content bg-no-repeat bg-size-[100%_1px] bg-position-[0_calc(100%+1px)]`,`bg-[image:linear-gradient(var(--color-separator),var(--color-separator))]`,`[--_fade-bottom-border:black]`)},{orientation:`vertical`,appearance:`classic`,hideBorder:!1,className:`border-r border-separator`}],defaultVariants:{hideBorder:!1}}),T=({className:n,hideBorder:r=!1,ref:a,...o})=>{let{orientation:s,appearance:c}=l(S),d=f(null);return u(()=>{let e=d.current;if(!e||s!==`horizontal`)return;let t=new AbortController;return e.addEventListener(`focusin`,t=>{if(t.target instanceof Element&&t.target!==e){let e=i()?`auto`:`smooth`;t.target.scrollIntoView({behavior:e,inline:`center`,block:`nearest`})}},{signal:t.signal}),()=>{t.abort()}},[s]),h(y,{"aria-orientation":s,"data-slot":`tabs-list`,"data-hide-border":r?``:void 0,className:t(w({orientation:s,appearance:c,hideBorder:r}),n),ref:e(d,a),...o})},E=_(`absolute z-0`,{variants:{orientation:{horizontal:`bottom-0 left-0 right-0 h-0.75`,vertical:`-right-px bottom-0 top-0 w-0.75`},appearance:{classic:`group-data-state-active/tab-trigger:bg-neutral-950`,pill:`hidden`}}}),D=()=>{let{orientation:e,appearance:t}=l(S);return h(`span`,{"aria-hidden":!0,className:r(E({orientation:e,appearance:t}))})},O=_(t(`group/tab-trigger relative flex cursor-pointer items-center gap-1 whitespace-nowrap py-3 text-sm font-medium text-gray-600`,`ring-focus-accent outline-hidden`,`aria-disabled:cursor-default aria-disabled:opacity-50`,`focus-visible:ring-4`,`[&>svg]:shrink-0 [&>svg]:size-5`,`not-aria-disabled:hover:text-gray-900`),{variants:{orientation:{horizontal:`rounded-tl-md rounded-tr-md`,vertical:`rounded-bl-md rounded-tl-md pr-3`},appearance:{classic:t(`not-aria-disabled:hover:data-state-active:text-strong`,`data-state-active:text-strong`),pill:t(`not-aria-disabled:hover:data-state-active:text-strong`,`not-aria-disabled:hover:data-state-active:bg-neutral-500/15`,`data-state-active:text-strong`,`data-state-active:bg-neutral-500/15`,`rounded-full py-2 px-3`)}}}),k={Root:C,Content:({className:e,...n})=>h(v,{"data-slot":`tabs-content`,className:t(`focus-visible:ring-focus-accent outline-hidden focus-visible:ring-4`,e),...n}),List:T,Trigger:({"aria-disabled":e,asChild:r=!1,children:i,className:s,disabled:u,ref:d,...f})=>{let{orientation:_,appearance:v}=l(S),y=n(e??u),b={"aria-disabled":e??u,className:t(O({orientation:_,appearance:v}),s),disabled:y,...f};if(r){let e=a.only(i);p(c(e),"When using `asChild`, TabsTrigger must be passed a single child as a JSX tag.");let t=e.props?.children,n=y?{href:void 0,to:void 0}:{tabIndex:0};return h(x,{asChild:!0,"data-slot":`tabs-trigger`,...b,ref:d,children:o(y?h(`button`,{type:`button`}):e,n,g(m,{children:[h(D,{}),t]}))})}return g(x,{"data-slot":`tabs-trigger`,ref:d,...b,children:[h(D,{}),i]})},Badge:({className:e,children:n,...r})=>h(`span`,{"data-slot":`tabs-badge`,className:t(`rounded-full bg-neutral-500/20 px-1.5 text-xs font-medium text-gray-600`,`group-data-state-active/tab-trigger:bg-neutral-950/10 group-data-state-active/tab-trigger:text-strong group-hover/tab-trigger:group-enabled/tab-trigger:group-data-state-active/tab-trigger:text-strong`,`group-hover/tab-trigger:group-enabled/tab-trigger:text-gray-700`,e),...r,children:n})};export{k as Tabs};