@ngrok/mantle 0.93.6 → 0.94.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.
- package/dist/accordion.d.ts +13 -1
- package/dist/accordion.js +1 -1
- package/dist/agent.json +1181 -36
- package/dist/alert-CH99Rw-R.js +1 -0
- package/dist/{alert-BcSBNR3S.d.ts → alert-HffaioZM.d.ts} +31 -21
- package/dist/alert-center.d.ts +15 -3
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +15 -2
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +6 -1
- package/dist/alert.js +1 -1
- package/dist/anchor.d.ts +12 -0
- package/dist/app-layout.d.ts +16 -1
- package/dist/app-layout.js +1 -1
- package/dist/area-chart.d.ts +144 -88
- package/dist/area-chart.js +1 -1
- package/dist/avatar.d.ts +12 -0
- package/dist/badge.d.ts +13 -1
- package/dist/bar-chart.d.ts +144 -89
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.d.ts +11 -0
- package/dist/breadcrumb.js +1 -1
- package/dist/browser-only.d.ts +8 -0
- package/dist/{button-Yxyu1XMd.d.ts → button-BGwOPjGV.d.ts} +7 -1
- package/dist/{button-B8k98Pby.js → button-BWGUuWnu.js} +1 -1
- package/dist/{button-CPsKGDK0.d.ts → button-Cgf2IcEC.d.ts} +8 -1
- package/dist/button-Cu9e3SM7.js +1 -0
- package/dist/{button-BX-4lYUn.d.ts → button-K0pKc3GN.d.ts} +3 -3
- package/dist/button.d.ts +9 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +7 -0
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +6 -1
- package/dist/centered-layout.d.ts +11 -0
- package/dist/chart-BO9EwQ60.js +1 -0
- package/dist/chart-CE5Uaqz9.js +1 -0
- package/dist/chart-DCTGGlWL.js +1 -0
- package/dist/chart-DudCw24t.js +2 -0
- package/dist/{chart-BpfbtOUN.d.ts → chart-jitNqimS.d.ts} +99 -103
- package/dist/{checkbox-DmSQXs26.js → checkbox-CS504fKk.js} +1 -1
- package/dist/checkbox.d.ts +14 -1
- package/dist/checkbox.js +1 -1
- package/dist/{choice-BLR0_MeB.d.ts → choice-BwfmbepO.d.ts} +7 -1
- package/dist/choice-uyYccm0A.js +1 -0
- package/dist/choice.d.ts +6 -1
- package/dist/choice.js +1 -1
- package/dist/code-block.d.ts +13 -2
- package/dist/code-block.js +1 -1
- package/dist/code-block_highlight-utils.d.ts +5 -0
- package/dist/code.d.ts +13 -0
- package/dist/color-CHZbU1Ww.js +1 -0
- package/dist/color.js +1 -1
- package/dist/combobox.d.ts +28 -14
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +14 -2
- package/dist/command.js +1 -1
- package/dist/cx.js +1 -1
- package/dist/data-table.d.ts +50 -19
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +12 -1
- package/dist/dialog-B9JAGy_x.d.ts +28 -0
- package/dist/{dialog-7TUgiSzX.js → dialog-CsugEt2A.js} +1 -1
- package/dist/{dialog-2fRO4ca4.d.ts → dialog-DD5H3EH1.d.ts} +10 -2
- package/dist/dialog.d.ts +7 -2
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-DHdgaw4P.js +1 -0
- package/dist/{dropdown-menu-CpjRwMWe.d.ts → dropdown-menu-DmDxYPde.d.ts} +34 -26
- package/dist/dropdown-menu.d.ts +6 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +5 -0
- package/dist/empty.js +1 -1
- package/dist/{field-V_gnkcmN.d.ts → field-BshcNVe_.d.ts} +1 -1
- package/dist/field.d.ts +17 -6
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +8 -0
- package/dist/hooks.d.ts +5 -0
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +23 -12
- package/dist/{icon-ByLVhdYq.d.ts → icon-NYvyyRMG.d.ts} +6 -0
- package/dist/icon.d.ts +7 -2
- package/dist/icon.js +1 -1
- package/dist/{icons-DP3lQw5O.js → icons-4JA-SGfv.js} +1 -1
- package/dist/icons.d.ts +13 -1
- package/dist/icons.js +1 -1
- package/dist/{index-BhfgyurF.d.ts → index-KJ06KK6t.d.ts} +3 -3
- package/dist/input-BjCDSOPA.js +1 -0
- package/dist/input-DHovzBjS.js +1 -0
- package/dist/{input-Dx5owTCc.d.ts → input-q8o5uMhW.d.ts} +11 -1
- package/dist/input.d.ts +34 -2
- package/dist/input.js +1 -1
- package/dist/kbd.d.ts +12 -0
- package/dist/{label-nHqqYS7e.js → label-DmDwzPD8.js} +1 -1
- package/dist/{label-Dn5CPJUj.d.ts → label-r2sJcSQ4.d.ts} +6 -0
- package/dist/label.d.ts +6 -1
- package/dist/label.js +1 -1
- package/dist/line-chart.d.ts +139 -82
- package/dist/line-chart.js +1 -1
- package/dist/{list-RFRIQxU2.js → list-CO_yLdln.js} +1 -1
- package/dist/list.d.ts +19 -1
- package/dist/list.js +1 -1
- package/dist/live-region.d.ts +14 -1
- package/dist/llms.txt +78 -76
- package/dist/main.d.ts +12 -0
- package/dist/mantle.css +110 -65
- package/dist/media-object.d.ts +12 -0
- package/dist/migrations/0014-chart-named-colors.yml +1389 -0
- package/dist/migrations/0015-segmented-control.yml +788 -0
- package/dist/multi-select.d.ts +15 -2
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +17 -5
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +92 -3
- package/dist/pagination.js +1 -1
- package/dist/popover-BhTFutCz.d.ts +1 -0
- package/dist/{popover-BfB2I9G0.d.ts → popover-lwkwWcRW.d.ts} +16 -7
- package/dist/popover.d.ts +7 -2
- package/dist/progress.d.ts +27 -10
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +9 -1
- package/dist/query.d.ts +2 -2
- package/dist/query.js +1 -1
- package/dist/radio-group-jj2abc0t.js +1 -0
- package/dist/radio-group-sLz5AA9I.d.ts +27 -0
- package/dist/radio-group.d.ts +20 -99
- package/dist/radio-group.js +1 -1
- package/dist/sandbar.d.ts +14 -1
- package/dist/sandbar.js +1 -1
- package/dist/sandboxed-on-click.d.ts +8 -0
- package/dist/scatter-plot.d.ts +126 -64
- package/dist/scatter-plot.js +1 -1
- package/dist/segmented-control.d.ts +136 -0
- package/dist/segmented-control.js +1 -0
- package/dist/{select-BkhBxtOT.d.ts → select-BqmpVJJT.d.ts} +29 -21
- package/dist/select-C6Su0dU0.js +1 -0
- package/dist/select.d.ts +6 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +13 -2
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-D9AWEkcJ.d.ts → separator-QfH0ot5K.d.ts} +3 -1
- package/dist/separator.d.ts +6 -1
- package/dist/{sheet-CSJc_sB4.js → sheet-Bd2LIhzF.js} +1 -1
- package/dist/sheet.d.ts +15 -2
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +19 -3
- package/dist/sidebar.js +1 -1
- package/dist/skeleton.d.ts +11 -0
- package/dist/skip-to-main-link.d.ts +11 -0
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +10 -0
- package/dist/{slot-C0OCJjdJ.d.ts → slot-D12N_fZJ.d.ts} +3 -1
- package/dist/slot.d.ts +6 -1
- package/dist/split-button.d.ts +14 -3
- package/dist/split-button.js +1 -1
- package/dist/strata.d.ts +13 -0
- package/dist/switch.d.ts +13 -1
- package/dist/switch.js +1 -1
- package/dist/{table-vT6Okwfa.d.ts → table-rWiVWEgB.d.ts} +79 -0
- package/dist/table.d.ts +6 -1
- package/dist/tabs.d.ts +23 -11
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +11 -1
- package/dist/theme-DdZgLvKH.js +1 -0
- package/dist/theme-switcher.d.ts +16 -2
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.d.ts +12 -0
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +14 -1
- package/dist/toast.js +1 -1
- package/dist/{tooltip-NcLIeBy5.d.ts → tooltip-CpK3XTor.d.ts} +15 -8
- package/dist/tooltip.d.ts +6 -1
- package/dist/truncated-text.d.ts +27 -13
- package/dist/truncated-text.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/use-inert-siblings-CNmNuS2h.js +1 -0
- package/dist/use-swipe-to-dismiss-i__cTF2v.js +1 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/visually-hidden.d.ts +13 -0
- package/dist/well.d.ts +6 -1
- package/package.json +7 -7
- package/src/components/chart/d3-license.md +25 -0
- package/dist/alert-P9lwn25X.js +0 -1
- package/dist/button-Dge0D5bl.js +0 -1
- package/dist/chart-BpWfQAwf.js +0 -2
- package/dist/choice-2Lrv8_nl.js +0 -1
- package/dist/dialog-Dp0QGWwo.d.ts +0 -28
- package/dist/dropdown-menu-BHBzCDSZ.js +0 -1
- package/dist/input-CpQ6jlpI.js +0 -1
- package/dist/popover-C96V8SXi.d.ts +0 -1
- package/dist/select-CAAYk4Yj.js +0 -1
- package/dist/theme-C-glc5Q-.js +0 -1
- package/dist/use-swipe-to-dismiss-DceYk1Id.js +0 -1
package/dist/dialog.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports for the Dialog component.
|
|
3
|
+
*
|
|
4
|
+
* @see https://mantle.ngrok.com/components/overlays/dialog
|
|
5
|
+
*/
|
|
6
|
+
import { t as Dialog } from "./dialog-DD5H3EH1.js";
|
|
7
|
+
import { l as isDialogOverlayTarget } from "./dialog-B9JAGy_x.js";
|
|
3
8
|
export { Dialog, isDialogOverlayTarget };
|
package/dist/dialog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as e}from"./dialog-CsugEt2A.js";import{d as t}from"./primitive-Dz9Al-us.js";export{e as Dialog,t as isDialogOverlayTarget};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{i as t}from"./layer-container-kEQiE4zV.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./icon-kK0c-POG.js";import{n as i}from"./separator-DfzxVutO.js";import{c as a}from"react/compiler-runtime";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{Slottable as c}from"@radix-ui/react-slot";import{CheckIcon as l}from"@phosphor-icons/react/Check";import{CaretRightIcon as u}from"@phosphor-icons/react/CaretRight";import{CheckboxItem as d,Content as f,Group as p,Item as m,ItemIndicator as h,Label as g,Portal as _,RadioGroup as v,RadioItem as y,Root as b,Sub as x,SubContent as S,SubTrigger as C,Trigger as w}from"@radix-ui/react-dropdown-menu";const T=b,E=e=>{let t=a(8),r,i;t[0]===e?(r=t[1],i=t[2]):({"data-slot":r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let s;t[3]===r?s=t[4]:(s=n(r,`dropdown-menu-trigger`),t[3]=r,t[4]=s);let c;return t[5]!==i||t[6]!==s?(c=/* @__PURE__ */ o(w,{"data-slot":s,...i}),t[5]=i,t[6]=s,t[7]=c):c=t[7],c},D=t=>{let r=a(12),i,s,c;r[0]===t?(i=r[1],s=r[2],c=r[3]):({"data-slot":s,className:i,...c}=t,r[0]=t,r[1]=i,r[2]=s,r[3]=c);let l;r[4]===s?l=r[5]:(l=n(s,`dropdown-menu-group`),r[4]=s,r[5]=l);let u;r[6]===i?u=r[7]:(u=e(`space-y-px`,i),r[6]=i,r[7]=u);let d;return r[8]!==c||r[9]!==l||r[10]!==u?(d=/* @__PURE__ */ o(p,{"data-slot":l,className:u,...c}),r[8]=c,r[9]=l,r[10]=u,r[11]=d):d=r[11],d},O=e=>{let n=a(6),r,i;n[0]===e?(r=n[1],i=n[2]):({container:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let s=t(),c=r??s,l;return n[3]!==i||n[4]!==c?(l=/* @__PURE__ */ o(_,{container:c,...i}),n[3]=i,n[4]=c,n[5]=l):l=n[5],l},k={Root:T,CheckboxItem:t=>{let i=a(19),u,f,p,m,g;i[0]===t?(u=i[1],f=i[2],p=i[3],m=i[4],g=i[5]):({"data-slot":m,className:p,children:f,checked:u,...g}=t,i[0]=t,i[1]=u,i[2]=f,i[3]=p,i[4]=m,i[5]=g);let _;i[6]===m?_=i[7]:(_=n(m,`dropdown-menu-checkbox-item`),i[6]=m,i[7]=_);let v;i[8]===p?v=i[9]:(v=e(`text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded-md py-1.5 pl-2 pr-9 text-sm font-normal outline-hidden`,`data-highlighted:bg-active-menu-item`,`aria-checked:bg-selected-menu-item`,`data-highlighted:aria-checked:bg-active-selected-menu-item!`,`[&>[data-slot=dropdown-menu-checkbox-item-label]>svg]:size-5 [&_svg]:shrink-0`,p),i[8]=p,i[9]=v);let y;i[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=/* @__PURE__ */ o(`span`,{className:`absolute right-2 flex items-center`,children:/* @__PURE__ */ o(h,{children:/* @__PURE__ */ o(r,{svg:/* @__PURE__ */ o(l,{weight:`bold`}),className:`size-4 text-accent-600`})})}),i[10]=y):y=i[10];let b;i[11]===f?b=i[12]:(b=/* @__PURE__ */ o(c,{child:f,children:j}),i[11]=f,i[12]=b);let x;return i[13]!==u||i[14]!==g||i[15]!==_||i[16]!==v||i[17]!==b?(x=/* @__PURE__ */ s(d,{"data-slot":_,className:v,checked:u,...g,children:[y,b]}),i[13]=u,i[14]=g,i[15]=_,i[16]=v,i[17]=b,i[18]=x):x=i[18],x},Content:t=>{let r=a(20),i,s,c,l,u,d;r[0]===t?(i=r[1],s=r[2],c=r[3],l=r[4],u=r[5],d=r[6]):({className:i,"data-slot":s,onClick:c,loop:u,width:d,...l}=t,r[0]=t,r[1]=i,r[2]=s,r[3]=c,r[4]=l,r[5]=u,r[6]=d);let p=u===void 0||u,m;r[7]===s?m=r[8]:(m=n(s,`dropdown-menu-content`),r[7]=s,r[8]=m);let h=d===`trigger`&&`w-(--radix-dropdown-menu-trigger-width)`,g;r[9]!==i||r[10]!==h?(g=e(`scrollbar`,`text-popover-foreground border-popover bg-popover p-1.25 z-50 min-w-32 overflow-hidden rounded-md border shadow-xl outline-hidden space-y-px font-sans`,`data-side-bottom:slide-in-from-top-1 data-side-left:slide-in-from-right-1 data-side-right:slide-in-from-left-1 data-side-top:slide-in-from-bottom-1 data-side-bottom:slide-out-to-top-1 data-side-left:slide-out-to-right-1 data-side-right:slide-out-to-left-1 data-side-top:slide-out-to-bottom-1 duration-200 ease-out-strong data-state-closed:duration-150 motion-reduce:animate-none! data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95`,`my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)-16px)] overflow-auto`,h,i),r[9]=i,r[10]=h,r[11]=g):g=r[11];let _;r[12]===c?_=r[13]:(_=e=>{e.stopPropagation(),c?.(e)},r[12]=c,r[13]=_);let v;return r[14]!==p||r[15]!==l||r[16]!==m||r[17]!==g||r[18]!==_?(v=/* @__PURE__ */ o(O,{children:/* @__PURE__ */ o(f,{"data-slot":m,className:g,loop:p,onClick:_,...l})}),r[14]=p,r[15]=l,r[16]=m,r[17]=g,r[18]=_,r[19]=v):v=r[19],v},Group:D,Item:t=>{let r=a(14),i,s,c,l;r[0]===t?(i=r[1],s=r[2],c=r[3],l=r[4]):({"data-slot":s,className:i,inset:c,...l}=t,r[0]=t,r[1]=i,r[2]=s,r[3]=c,r[4]=l);let u;r[5]===s?u=r[6]:(u=n(s,`dropdown-menu-item`),r[5]=s,r[6]=u);let d=c&&`pl-8`,f;r[7]!==i||r[8]!==d?(f=e(`relative flex cursor-pointer select-none items-center rounded-md px-2 py-1.5 text-strong text-sm font-normal outline-hidden transition-colors`,`data-highlighted:bg-active-menu-item`,`focus:bg-accent focus:text-accent-foreground`,`data-disabled:cursor-default data-disabled:opacity-50`,`[&>svg]:size-5 [&_svg]:shrink-0`,d,i),r[7]=i,r[8]=d,r[9]=f):f=r[9];let p;return r[10]!==l||r[11]!==u||r[12]!==f?(p=/* @__PURE__ */ o(m,{"data-slot":u,className:f,...l}),r[10]=l,r[11]=u,r[12]=f,r[13]=p):p=r[13],p},Label:t=>{let r=a(14),i,s,c,l;r[0]===t?(i=r[1],s=r[2],c=r[3],l=r[4]):({"data-slot":s,className:i,inset:c,...l}=t,r[0]=t,r[1]=i,r[2]=s,r[3]=c,r[4]=l);let u;r[5]===s?u=r[6]:(u=n(s,`dropdown-menu-label`),r[5]=s,r[6]=u);let d=c&&`pl-8`,f;r[7]!==i||r[8]!==d?(f=e(`px-2 py-1.5 text-sm font-medium`,d,i),r[7]=i,r[8]=d,r[9]=f):f=r[9];let p;return r[10]!==l||r[11]!==u||r[12]!==f?(p=/* @__PURE__ */ o(g,{"data-slot":u,className:f,...l}),r[10]=l,r[11]=u,r[12]=f,r[13]=p):p=r[13],p},RadioGroup:t=>{let r=a(12),i,s,c;r[0]===t?(i=r[1],s=r[2],c=r[3]):({"data-slot":s,className:i,...c}=t,r[0]=t,r[1]=i,r[2]=s,r[3]=c);let l;r[4]===s?l=r[5]:(l=n(s,`dropdown-menu-radio-group`),r[4]=s,r[5]=l);let u;r[6]===i?u=r[7]:(u=e(`space-y-px`,i),r[6]=i,r[7]=u);let d;return r[8]!==c||r[9]!==l||r[10]!==u?(d=/* @__PURE__ */ o(v,{"data-slot":l,className:u,...c}),r[8]=c,r[9]=l,r[10]=u,r[11]=d):d=r[11],d},RadioItem:t=>{let i=a(17),u,d,f,p;i[0]===t?(u=i[1],d=i[2],f=i[3],p=i[4]):({"data-slot":f,className:d,children:u,...p}=t,i[0]=t,i[1]=u,i[2]=d,i[3]=f,i[4]=p);let m;i[5]===f?m=i[6]:(m=n(f,`dropdown-menu-radio-item`),i[5]=f,i[6]=m);let g;i[7]===d?g=i[8]:(g=e(`group/dropdown-menu-radio-item`,`text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded-md py-1.5 px-2 text-sm font-normal outline-none`,`data-highlighted:bg-active-menu-item`,`aria-checked:bg-selected-menu-item aria-checked:pr-9`,`data-highlighted:aria-checked:bg-active-selected-menu-item!`,`[&>[data-slot=dropdown-menu-radio-item-label]>svg]:size-5 [&_svg]:shrink-0`,d),i[7]=d,i[8]=g);let _;i[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=/* @__PURE__ */ o(`span`,{className:`absolute right-2 items-center hidden group-aria-checked/dropdown-menu-radio-item:flex`,children:/* @__PURE__ */ o(h,{children:/* @__PURE__ */ o(r,{svg:/* @__PURE__ */ o(l,{weight:`bold`}),className:`size-4 text-accent-600`})})}),i[9]=_):_=i[9];let v;i[10]===u?v=i[11]:(v=/* @__PURE__ */ o(c,{child:u,children:M}),i[10]=u,i[11]=v);let b;return i[12]!==p||i[13]!==m||i[14]!==g||i[15]!==v?(b=/* @__PURE__ */ s(y,{"data-slot":m,className:g,...p,children:[_,v]}),i[12]=p,i[13]=m,i[14]=g,i[15]=v,i[16]=b):b=i[16],b},Separator:t=>{let r=a(12),s,c,l;r[0]===t?(s=r[1],c=r[2],l=r[3]):({"data-slot":c,className:s,...l}=t,r[0]=t,r[1]=s,r[2]=c,r[3]=l);let u;r[4]===c?u=r[5]:(u=n(c,`dropdown-menu-separator`),r[4]=c,r[5]=u);let d;r[6]===s?d=r[7]:(d=e(`-mx-1.25 my-1 w-auto`,s),r[6]=s,r[7]=d);let f;return r[8]!==l||r[9]!==u||r[10]!==d?(f=/* @__PURE__ */ o(i,{"data-slot":u,className:d,...l}),r[8]=l,r[9]=u,r[10]=d,r[11]=f):f=r[11],f},Shortcut:t=>{let r=a(12),i,s,c;r[0]===t?(i=r[1],s=r[2],c=r[3]):({"data-slot":s,className:i,...c}=t,r[0]=t,r[1]=i,r[2]=s,r[3]=c);let l;r[4]===s?l=r[5]:(l=n(s,`dropdown-menu-shortcut`),r[4]=s,r[5]=l);let u;r[6]===i?u=r[7]:(u=e(`ml-auto text-xs tracking-widest opacity-60`,i),r[6]=i,r[7]=u);let d;return r[8]!==c||r[9]!==l||r[10]!==u?(d=/* @__PURE__ */ o(`span`,{"data-slot":l,className:u,...c,translate:`no`}),r[8]=c,r[9]=l,r[10]=u,r[11]=d):d=r[11],d},Sub:x,SubContent:t=>{let r=a(14),i,s,c,l;r[0]===t?(i=r[1],s=r[2],c=r[3],l=r[4]):({"data-slot":s,className:i,loop:l,...c}=t,r[0]=t,r[1]=i,r[2]=s,r[3]=c,r[4]=l);let u=l===void 0||l,d;r[5]===s?d=r[6]:(d=n(s,`dropdown-menu-sub-content`),r[5]=s,r[6]=d);let f;r[7]===i?f=r[8]:(f=e(`scrollbar`,`text-popover-foreground border-popover bg-popover p-1.25 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 data-side-bottom:slide-in-from-top-1 data-side-left:slide-in-from-right-1 data-side-right:slide-in-from-left-1 data-side-top:slide-in-from-bottom-1 data-side-bottom:slide-out-to-top-1 data-side-left:slide-out-to-right-1 data-side-right:slide-out-to-left-1 data-side-top:slide-out-to-bottom-1 duration-200 ease-out-strong data-state-closed:duration-150 motion-reduce:animate-none! z-50 min-w-32 overflow-hidden rounded-md border shadow-xl space-y-px font-sans`,`my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)-16px)] overflow-auto`,i),r[7]=i,r[8]=f);let p;return r[9]!==u||r[10]!==c||r[11]!==d||r[12]!==f?(p=/* @__PURE__ */ o(O,{children:/* @__PURE__ */ o(S,{"data-slot":d,className:f,loop:u,...c})}),r[9]=u,r[10]=c,r[11]=d,r[12]=f,r[13]=p):p=r[13],p},SubTrigger:t=>{let i=a(19),l,d,f,p,m;i[0]===t?(l=i[1],d=i[2],f=i[3],p=i[4],m=i[5]):({"data-slot":f,className:d,inset:p,children:l,...m}=t,i[0]=t,i[1]=l,i[2]=d,i[3]=f,i[4]=p,i[5]=m);let h;i[6]===f?h=i[7]:(h=n(f,`dropdown-menu-sub-trigger`),i[6]=f,i[7]=h);let g=p&&`pl-8`,_;i[8]!==d||i[9]!==g?(_=e(`focus:bg-accent data-state-open:bg-accent relative flex select-none items-center rounded-md py-1.5 pl-2 pr-9 text-sm outline-hidden`,`data-highlighted:bg-active-menu-item data-state-open:bg-active-menu-item`,`[&>[data-slot=dropdown-menu-sub-trigger-label]>svg]:size-5 [&_svg]:shrink-0`,g,d),i[8]=d,i[9]=g,i[10]=_):_=i[10];let v;i[11]===l?v=i[12]:(v=/* @__PURE__ */ o(c,{child:l,children:A}),i[11]=l,i[12]=v);let y;i[13]===Symbol.for(`react.memo_cache_sentinel`)?(y=/* @__PURE__ */ o(`span`,{className:`absolute right-2 flex items-center`,children:/* @__PURE__ */ o(r,{svg:/* @__PURE__ */ o(u,{weight:`bold`}),className:`size-4`})}),i[13]=y):y=i[13];let b;return i[14]!==m||i[15]!==h||i[16]!==_||i[17]!==v?(b=/* @__PURE__ */ s(C,{"data-slot":h,className:_,...m,children:[v,y]}),i[14]=m,i[15]=h,i[16]=_,i[17]=v,i[18]=b):b=i[18],b},Trigger:E};function A(e){return/* @__PURE__ */ o(`span`,{"data-slot":`dropdown-menu-sub-trigger-label`,className:`contents`,children:e})}function j(e){return/* @__PURE__ */ o(`span`,{"data-slot":`dropdown-menu-checkbox-item-label`,className:`contents`,children:e})}function M(e){return/* @__PURE__ */ o(`span`,{"data-slot":`dropdown-menu-radio-item-label`,className:`contents`,children:e})}export{k as t};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
|
|
2
|
-
import { n as Separator } from "./separator-
|
|
2
|
+
import { n as Separator } from "./separator-QfH0ot5K.js";
|
|
3
3
|
import { ComponentProps } from "react";
|
|
4
|
-
import { CheckboxItem, Content, Group, Item, Label, RadioGroup, RadioItem, SubContent, SubTrigger, Trigger } from "@radix-ui/react-dropdown-menu";
|
|
4
|
+
import { CheckboxItem as CheckboxItem$1, Content as Content$1, Group as Group$1, Item as Item$1, Label as Label$1, RadioGroup as RadioGroup$1, RadioItem as RadioItem$1, SubContent as SubContent$1, SubTrigger as SubTrigger$1, Trigger as Trigger$1 } from "@radix-ui/react-dropdown-menu";
|
|
5
5
|
/**
|
|
6
6
|
* The trigger button that opens the dropdown menu.
|
|
7
7
|
*
|
|
@@ -21,7 +21,7 @@ import { CheckboxItem, Content, Group, Item, Label, RadioGroup, RadioItem, SubCo
|
|
|
21
21
|
* </DropdownMenu.Root>
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
declare const Trigger
|
|
24
|
+
declare const Trigger: ({ "data-slot": dataSlot, ...props }: ComponentProps<typeof Trigger$1> & WithDataSlot) => import("react").JSX.Element;
|
|
25
25
|
/**
|
|
26
26
|
* A group container for organizing related dropdown menu items.
|
|
27
27
|
*
|
|
@@ -41,7 +41,7 @@ declare const Trigger$1: ({ "data-slot": dataSlot, ...props }: ComponentProps<ty
|
|
|
41
41
|
* </DropdownMenu.Root>
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
|
-
declare const Group
|
|
44
|
+
declare const Group: ({ "data-slot": dataSlot, className, ...props }: ComponentProps<typeof Group$1> & WithDataSlot) => import("react").JSX.Element;
|
|
45
45
|
/**
|
|
46
46
|
* A radio group container for exclusive selection within the dropdown menu.
|
|
47
47
|
*
|
|
@@ -60,11 +60,11 @@ declare const Group$1: ({ "data-slot": dataSlot, className, ...props }: Componen
|
|
|
60
60
|
* </DropdownMenu.Root>
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
63
|
-
declare const RadioGroup
|
|
63
|
+
declare const RadioGroup: ({ "data-slot": dataSlot, className, ...props }: ComponentProps<typeof RadioGroup$1> & WithDataSlot) => import("react").JSX.Element;
|
|
64
64
|
/**
|
|
65
65
|
* Props for `DropdownMenu.SubTrigger`.
|
|
66
66
|
*/
|
|
67
|
-
type DropdownMenuSubTriggerProps = ComponentProps<typeof SubTrigger> & {
|
|
67
|
+
type DropdownMenuSubTriggerProps = ComponentProps<typeof SubTrigger$1> & {
|
|
68
68
|
inset?: boolean;
|
|
69
69
|
} & WithDataSlot;
|
|
70
70
|
/**
|
|
@@ -111,7 +111,7 @@ type DropdownMenuSubTriggerProps = ComponentProps<typeof SubTrigger> & {
|
|
|
111
111
|
* </DropdownMenu.Root>
|
|
112
112
|
* ```
|
|
113
113
|
*/
|
|
114
|
-
declare const SubTrigger
|
|
114
|
+
declare const SubTrigger: ({ "data-slot": dataSlot, className, inset, children, ...props }: DropdownMenuSubTriggerProps) => import("react").JSX.Element;
|
|
115
115
|
/**
|
|
116
116
|
* The content container for a dropdown menu sub-menu.
|
|
117
117
|
*
|
|
@@ -140,8 +140,8 @@ declare const SubTrigger$1: ({ "data-slot": dataSlot, className, inset, children
|
|
|
140
140
|
* </DropdownMenu.Root>
|
|
141
141
|
* ```
|
|
142
142
|
*/
|
|
143
|
-
declare const SubContent
|
|
144
|
-
type DropdownMenuContentProps = ComponentProps<typeof Content> & WithDataSlot & {
|
|
143
|
+
declare const SubContent: ({ "data-slot": dataSlot, className, loop, ...props }: ComponentProps<typeof SubContent$1> & WithDataSlot) => import("react").JSX.Element;
|
|
144
|
+
type DropdownMenuContentProps = ComponentProps<typeof Content$1> & WithDataSlot & {
|
|
145
145
|
/**
|
|
146
146
|
* Whether the DropdownMenuContent should match the width of the trigger or use the intrinsic content width.
|
|
147
147
|
*/
|
|
@@ -174,7 +174,7 @@ type DropdownMenuContentProps = ComponentProps<typeof Content> & WithDataSlot &
|
|
|
174
174
|
* </DropdownMenu.Root>
|
|
175
175
|
* ```
|
|
176
176
|
*/
|
|
177
|
-
declare const Content
|
|
177
|
+
declare const Content: ({ className, "data-slot": dataSlot, onClick, loop, width, ...props }: DropdownMenuContentProps) => import("react").JSX.Element;
|
|
178
178
|
/**
|
|
179
179
|
* An item in the dropdown menu.
|
|
180
180
|
*
|
|
@@ -195,13 +195,13 @@ declare const Content$1: ({ className, "data-slot": dataSlot, onClick, loop, wid
|
|
|
195
195
|
* </DropdownMenu.Root>
|
|
196
196
|
* ```
|
|
197
197
|
*/
|
|
198
|
-
declare const Item
|
|
198
|
+
declare const Item: ({ "data-slot": dataSlot, className, inset, ...props }: ComponentProps<typeof Item$1> & {
|
|
199
199
|
inset?: boolean;
|
|
200
200
|
} & WithDataSlot) => import("react").JSX.Element;
|
|
201
201
|
/**
|
|
202
202
|
* Props for `DropdownMenu.CheckboxItem`.
|
|
203
203
|
*/
|
|
204
|
-
type DropdownMenuCheckboxItemProps = ComponentProps<typeof CheckboxItem> & WithDataSlot;
|
|
204
|
+
type DropdownMenuCheckboxItemProps = ComponentProps<typeof CheckboxItem$1> & WithDataSlot;
|
|
205
205
|
/**
|
|
206
206
|
* A menu item with a checkbox that can be controlled or uncontrolled.
|
|
207
207
|
*
|
|
@@ -241,11 +241,11 @@ type DropdownMenuCheckboxItemProps = ComponentProps<typeof CheckboxItem> & WithD
|
|
|
241
241
|
* </DropdownMenu.Root>
|
|
242
242
|
* ```
|
|
243
243
|
*/
|
|
244
|
-
declare const CheckboxItem
|
|
244
|
+
declare const CheckboxItem: ({ "data-slot": dataSlot, className, children, checked, ...props }: DropdownMenuCheckboxItemProps) => import("react").JSX.Element;
|
|
245
245
|
/**
|
|
246
246
|
* Props for `DropdownMenu.RadioItem`.
|
|
247
247
|
*/
|
|
248
|
-
type DropdownMenuRadioItemProps = ComponentProps<typeof RadioItem> & {
|
|
248
|
+
type DropdownMenuRadioItemProps = ComponentProps<typeof RadioItem$1> & {
|
|
249
249
|
name?: string;
|
|
250
250
|
id?: string;
|
|
251
251
|
} & WithDataSlot;
|
|
@@ -291,7 +291,7 @@ type DropdownMenuRadioItemProps = ComponentProps<typeof RadioItem> & {
|
|
|
291
291
|
* </DropdownMenu.Root>
|
|
292
292
|
* ```
|
|
293
293
|
*/
|
|
294
|
-
declare const RadioItem
|
|
294
|
+
declare const RadioItem: ({ "data-slot": dataSlot, className, children, ...props }: DropdownMenuRadioItemProps) => import("react").JSX.Element;
|
|
295
295
|
/**
|
|
296
296
|
* A label for a group of dropdown menu items.
|
|
297
297
|
*
|
|
@@ -309,7 +309,7 @@ declare const RadioItem$1: ({ "data-slot": dataSlot, className, children, ...pro
|
|
|
309
309
|
* </DropdownMenu.Root>
|
|
310
310
|
* ```
|
|
311
311
|
*/
|
|
312
|
-
declare const Label
|
|
312
|
+
declare const Label: ({ "data-slot": dataSlot, className, inset, ...props }: ComponentProps<typeof Label$1> & {
|
|
313
313
|
inset?: boolean;
|
|
314
314
|
} & WithDataSlot) => import("react").JSX.Element;
|
|
315
315
|
/**
|
|
@@ -361,6 +361,14 @@ declare const Shortcut: ({ "data-slot": dataSlot, className, ...props }: Omit<Co
|
|
|
361
361
|
* `document.body`, below the overlay tier (`z-60`). When sibling floats share a
|
|
362
362
|
* container, the most recently mounted float paints on top.
|
|
363
363
|
*
|
|
364
|
+
* @useWhen Show a menu of actions or options when the user clicks a button.
|
|
365
|
+
*
|
|
366
|
+
* @siblings
|
|
367
|
+
* - `Select`: the user picks one value for a form field.
|
|
368
|
+
* - `SplitButton`: a default action runs on one click, and the menu holds its alternatives.
|
|
369
|
+
* - `Command`: the user searches many actions or pages from the keyboard.
|
|
370
|
+
* - `Popover`: the floating content is a small form or other content, not a menu.
|
|
371
|
+
*
|
|
364
372
|
* @see https://mantle.ngrok.com/components/overlays/dropdown-menu
|
|
365
373
|
*
|
|
366
374
|
* @example
|
|
@@ -464,7 +472,7 @@ declare const DropdownMenu: {
|
|
|
464
472
|
* </DropdownMenu.Root>
|
|
465
473
|
* ```
|
|
466
474
|
*/
|
|
467
|
-
readonly CheckboxItem: typeof CheckboxItem
|
|
475
|
+
readonly CheckboxItem: typeof CheckboxItem;
|
|
468
476
|
/**
|
|
469
477
|
* The container for the dropdown menu content. Appears in a portal with scrolling and animations.
|
|
470
478
|
*
|
|
@@ -488,7 +496,7 @@ declare const DropdownMenu: {
|
|
|
488
496
|
* </DropdownMenu.Root>
|
|
489
497
|
* ```
|
|
490
498
|
*/
|
|
491
|
-
readonly Content: typeof Content
|
|
499
|
+
readonly Content: typeof Content;
|
|
492
500
|
/**
|
|
493
501
|
* A group container for organizing related dropdown menu items.
|
|
494
502
|
*
|
|
@@ -508,7 +516,7 @@ declare const DropdownMenu: {
|
|
|
508
516
|
* </DropdownMenu.Root>
|
|
509
517
|
* ```
|
|
510
518
|
*/
|
|
511
|
-
readonly Group: typeof Group
|
|
519
|
+
readonly Group: typeof Group;
|
|
512
520
|
/**
|
|
513
521
|
* A standard item in the dropdown menu that can be selected or activated.
|
|
514
522
|
*
|
|
@@ -529,7 +537,7 @@ declare const DropdownMenu: {
|
|
|
529
537
|
* </DropdownMenu.Root>
|
|
530
538
|
* ```
|
|
531
539
|
*/
|
|
532
|
-
readonly Item: typeof Item
|
|
540
|
+
readonly Item: typeof Item;
|
|
533
541
|
/**
|
|
534
542
|
* A label for grouping and describing sections within the dropdown menu.
|
|
535
543
|
*
|
|
@@ -547,7 +555,7 @@ declare const DropdownMenu: {
|
|
|
547
555
|
* </DropdownMenu.Root>
|
|
548
556
|
* ```
|
|
549
557
|
*/
|
|
550
|
-
readonly Label: typeof Label
|
|
558
|
+
readonly Label: typeof Label;
|
|
551
559
|
/**
|
|
552
560
|
* A radio group container for exclusive selection within the dropdown menu.
|
|
553
561
|
*
|
|
@@ -566,7 +574,7 @@ declare const DropdownMenu: {
|
|
|
566
574
|
* </DropdownMenu.Root>
|
|
567
575
|
* ```
|
|
568
576
|
*/
|
|
569
|
-
readonly RadioGroup: typeof RadioGroup
|
|
577
|
+
readonly RadioGroup: typeof RadioGroup;
|
|
570
578
|
/**
|
|
571
579
|
* A radio item in the dropdown menu where only one item in the group can be selected.
|
|
572
580
|
*
|
|
@@ -608,7 +616,7 @@ declare const DropdownMenu: {
|
|
|
608
616
|
* </DropdownMenu.Root>
|
|
609
617
|
* ```
|
|
610
618
|
*/
|
|
611
|
-
readonly RadioItem: typeof RadioItem
|
|
619
|
+
readonly RadioItem: typeof RadioItem;
|
|
612
620
|
/**
|
|
613
621
|
* A visual separator for dividing sections within the dropdown menu.
|
|
614
622
|
*
|
|
@@ -697,7 +705,7 @@ declare const DropdownMenu: {
|
|
|
697
705
|
* </DropdownMenu.Root>
|
|
698
706
|
* ```
|
|
699
707
|
*/
|
|
700
|
-
readonly SubContent: typeof SubContent
|
|
708
|
+
readonly SubContent: typeof SubContent;
|
|
701
709
|
/**
|
|
702
710
|
* A trigger for a dropdown menu sub-menu. It opens the submenu on hover, or on
|
|
703
711
|
* ArrowRight or Enter.
|
|
@@ -742,7 +750,7 @@ declare const DropdownMenu: {
|
|
|
742
750
|
* </DropdownMenu.Root>
|
|
743
751
|
* ```
|
|
744
752
|
*/
|
|
745
|
-
readonly SubTrigger: typeof SubTrigger
|
|
753
|
+
readonly SubTrigger: typeof SubTrigger;
|
|
746
754
|
/**
|
|
747
755
|
* The trigger button that opens the dropdown menu.
|
|
748
756
|
*
|
|
@@ -762,6 +770,6 @@ declare const DropdownMenu: {
|
|
|
762
770
|
* </DropdownMenu.Root>
|
|
763
771
|
* ```
|
|
764
772
|
*/
|
|
765
|
-
readonly Trigger: typeof Trigger
|
|
773
|
+
readonly Trigger: typeof Trigger;
|
|
766
774
|
};
|
|
767
775
|
export { DropdownMenu as t };
|
package/dist/dropdown-menu.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports for the Dropdown Menu component.
|
|
3
|
+
*
|
|
4
|
+
* @see https://mantle.ngrok.com/components/overlays/dropdown-menu
|
|
5
|
+
*/
|
|
6
|
+
import { t as DropdownMenu } from "./dropdown-menu-DmDxYPde.js";
|
|
2
7
|
export { DropdownMenu };
|
package/dist/dropdown-menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as DropdownMenu}from"./dropdown-menu-
|
|
1
|
+
export{t as DropdownMenu}from"./dropdown-menu-DHdgaw4P.js";
|
package/dist/empty.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports for the Empty component.
|
|
3
|
+
*
|
|
4
|
+
* @see https://mantle.ngrok.com/components/feedback/empty
|
|
5
|
+
*/
|
|
1
6
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
7
|
import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
|
|
3
8
|
import { t as SvgAttributes } from "./icon-CgNqu-fl.js";
|
package/dist/empty.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-BudQMD2S.js";import{t as r}from"./slot-DdYN1L1C.js";import{c as i}from"react/compiler-runtime";import{jsx as a}from"react/jsx-runtime";const o={Root:n=>{let o=i(16),s,c,l,u,d;o[0]===n?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({"data-slot":u,asChild:s,children:c,className:l,...d}=n,o[0]=n,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?r:`div`,p;o[6]===u?p=o[7]:(p=t(u,`empty`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`mx-auto flex max-w-lg flex-col items-center p-6 text-center`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ a(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Icon:r=>{let o=i(14),s,c,l,u;o[0]===r?(s=o[1],c=o[2],l=o[3],u=o[4]):({"data-slot":c,className:s,svg:u,...l}=r,o[0]=r,o[1]=s,o[2]=c,o[3]=l,o[4]=u);let d;o[5]===c?d=o[6]:(d=t(c,`empty-icon`),o[5]=c,o[6]=d);let f;o[7]===s?f=o[8]:(f=e(`mb-1 size-10 text-neutral-400`,s),o[7]=s,o[8]=f);let p;return o[9]!==l||o[10]!==u||o[11]!==d||o[12]!==f?(p=/* @__PURE__ */ a(n,{"data-slot":d,className:f,svg:u,...l}),o[9]=l,o[10]=u,o[11]=d,o[12]=f,o[13]=p):p=o[13],p},Title:n=>{let o=i(16),s,c,l,u,d;o[0]===n?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({"data-slot":u,asChild:s,children:c,className:l,...d}=n,o[0]=n,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?r:`h3`,p;o[6]===u?p=o[7]:(p=t(u,`empty-title`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`text-strong text-sm font-medium font-sans`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ a(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Description:n=>{let o=i(16),s,c,l,u,d;o[0]===n?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({"data-slot":u,asChild:s,children:c,className:l,...d}=n,o[0]=n,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?r:`div`,p;o[6]===u?p=o[7]:(p=t(u,`empty-description`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`text-muted space-y-4 text-sm font-sans`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ a(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Actions:n=>{let o=i(16),s,c,l,u,d;o[0]===n?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({"data-slot":u,asChild:s,children:c,className:l,...d}=n,o[0]=n,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?r:`div`,p;o[6]===u?p=o[7]:(p=t(u,`empty-actions`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`mt-4 flex items-center gap-2`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ a(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h}};export{o as Empty};
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-BudQMD2S.js";import{t as r}from"./slot-DdYN1L1C.js";import{c as i}from"react/compiler-runtime";import{jsx as a}from"react/jsx-runtime";const o={Root:n=>{let o=i(16),s,c,l,u,d;o[0]===n?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({"data-slot":u,asChild:s,children:c,className:l,...d}=n,o[0]=n,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?r:`div`,p;o[6]===u?p=o[7]:(p=t(u,`empty`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`mx-auto flex max-w-lg flex-col items-center p-6 text-center`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ a(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Icon:r=>{let o=i(14),s,c,l,u;o[0]===r?(s=o[1],c=o[2],l=o[3],u=o[4]):({"data-slot":c,className:s,svg:u,...l}=r,o[0]=r,o[1]=s,o[2]=c,o[3]=l,o[4]=u);let d;o[5]===c?d=o[6]:(d=t(c,`empty-icon`),o[5]=c,o[6]=d);let f;o[7]===s?f=o[8]:(f=e(`mb-1 size-10 text-neutral-400`,s),o[7]=s,o[8]=f);let p;return o[9]!==l||o[10]!==u||o[11]!==d||o[12]!==f?(p=/* @__PURE__ */ a(n,{"data-slot":d,className:f,svg:u,...l}),o[9]=l,o[10]=u,o[11]=d,o[12]=f,o[13]=p):p=o[13],p},Title:n=>{let o=i(16),s,c,l,u,d;o[0]===n?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({"data-slot":u,asChild:s,children:c,className:l,...d}=n,o[0]=n,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?r:`h3`,p;o[6]===u?p=o[7]:(p=t(u,`empty-title`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`text-strong text-pretty text-sm font-medium font-sans`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ a(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Description:n=>{let o=i(16),s,c,l,u,d;o[0]===n?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({"data-slot":u,asChild:s,children:c,className:l,...d}=n,o[0]=n,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?r:`div`,p;o[6]===u?p=o[7]:(p=t(u,`empty-description`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`text-muted space-y-4 text-pretty text-sm font-sans`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ a(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Actions:n=>{let o=i(16),s,c,l,u,d;o[0]===n?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({"data-slot":u,asChild:s,children:c,className:l,...d}=n,o[0]=n,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?r:`div`,p;o[6]===u?p=o[7]:(p=t(u,`empty-actions`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`mt-4 flex items-center gap-2`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ a(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h}};export{o as Empty};
|
package/dist/field.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports for the Field component.
|
|
3
|
+
*
|
|
4
|
+
* @see https://mantle.ngrok.com/components/forms/field
|
|
5
|
+
*/
|
|
1
6
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
7
|
import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
|
|
3
|
-
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance } from "./button-
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { t as Slot } from "./slot-
|
|
7
|
-
import { t as Popover } from "./popover-
|
|
8
|
-
import "./
|
|
8
|
+
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance } from "./button-BGwOPjGV.js";
|
|
9
|
+
import { t as Label } from "./label-r2sJcSQ4.js";
|
|
10
|
+
import "./popover-BhTFutCz.js";
|
|
11
|
+
import { t as Slot } from "./slot-D12N_fZJ.js";
|
|
12
|
+
import { t as Popover } from "./popover-lwkwWcRW.js";
|
|
13
|
+
import { a as ValidationState, c as parseValidation, i as ValidationProp, l as resolveValidation, n as ParsedValidation, o as WithValidation, r as Validation, s as isAriaInvalid, t as AriaInvalid } from "./field-BshcNVe_.js";
|
|
9
14
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
10
15
|
/**
|
|
11
16
|
* ARIA and identity props that `Field.Control` applies to the field's
|
|
@@ -734,6 +739,12 @@ declare const FieldErrorList: ({ "data-slot": dataSlot, asChild, children, class
|
|
|
734
739
|
* `Field.Group`; use `Field.Set` + `Field.Legend` for radios / related
|
|
735
740
|
* checkboxes that share one accessible name.
|
|
736
741
|
*
|
|
742
|
+
* @useWhen Group one form control with its label, its description, and its validation errors.
|
|
743
|
+
*
|
|
744
|
+
* @siblings
|
|
745
|
+
* - `Label`: the control needs only a caption, with no description or errors.
|
|
746
|
+
* - `Choice`: a checkbox, a radio, or a switch sits beside a title and a description.
|
|
747
|
+
*
|
|
737
748
|
* @see https://mantle.ngrok.com/components/forms/field
|
|
738
749
|
*
|
|
739
750
|
* @example
|
package/dist/field.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-CLSmHzo4.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./slot-DdYN1L1C.js";import{t as i}from"./button-B8k98Pby.js";import{i as a,n as o,r as s,t as c}from"./field-CPvjazWN.js";import{n as l,r as u,t as d}from"./field-Bihblt8U.js";import{t as f}from"./label-nHqqYS7e.js";import{t as p}from"./popover-DxOqLKxy.js";import{c as m}from"react/compiler-runtime";import{Children as h,Fragment as g,cloneElement as _,isValidElement as v,useContext as y,useId as b,useState as x}from"react";import S from"tiny-invariant";import{jsx as C}from"react/jsx-runtime";import{QuestionIcon as w}from"@phosphor-icons/react/Question";const T=e=>{let t=[],n=/* @__PURE__ */ new Set;for(let r of e??[]){if(typeof r!=`string`)continue;let e=r.trim();e.length===0||n.has(e)||(n.add(e),t.push(e))}return t},E=e=>!(e==null||typeof e==`boolean`||typeof e==`string`&&e.trim().length===0),D=({children:e,errorItemType:t})=>{let n=!1;return h.forEach(e,e=>{n||e==null||typeof e==`boolean`||(typeof e==`string`?e.trim().length>0&&(n=!0):n=v(e)?e.type===t?E(e.props.children):e.type!==g||D({children:e.props.children,errorItemType:t}):!0)}),n},O=e=>{let r=m(14),i,a,o,s;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4]):({"data-slot":a,className:i,ref:s,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c;r[5]===a?c=r[6]:(c=n(a,`field-set`),r[5]=a,r[6]=c);let l;r[7]===i?l=r[8]:(l=t(`flex w-full min-w-0 flex-col gap-4 border-0 p-0`,i),r[7]=i,r[8]=l);let u;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==l?(u=/* @__PURE__ */ C(`fieldset`,{ref:s,"data-slot":c,className:l,...o}),r[9]=o,r[10]=s,r[11]=c,r[12]=l,r[13]=u):u=r[13],u},k=e=>{let n=m(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(`text-strong mb-1.5 text-sm font-medium font-sans`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==a||n[8]!==o?(s=/* @__PURE__ */ C(`legend`,{ref:a,"data-slot":`field-legend`,className:o,...i}),n[6]=i,n[7]=a,n[8]=o,n[9]=s):s=n[9],s},A=e=>{let t=m(7),n,r;t[0]===e?(n=t[1],r=t[2]):({ref:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=y(l)?.controlId,a;return t[3]!==n||t[4]!==r||t[5]!==i?(a=/* @__PURE__ */ C(f,{ref:r,...n,htmlFor:i}),t[3]=n,t[4]=r,t[5]=i,t[6]=a):a=t[6],a},j=e=>{let i=m(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({"data-slot":s,asChild:a,className:o,ref:l,...c}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`p`,d;i[6]===s?d=i[7]:(d=n(s,`field-label-text`),i[6]=s,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`text-strong text-sm font-medium font-sans`,o),i[8]=o,i[9]=f);let p;return i[10]!==u||i[11]!==c||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ C(u,{ref:l,"data-slot":d,className:f,...c}),i[10]=u,i[11]=c,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},M=e=>{let i=m(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({"data-slot":s,asChild:a,className:o,ref:l,...c}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===s?d=i[7]:(d=n(s,`field-label-row`),i[6]=s,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`flex items-center gap-1`,o),i[8]=o,i[9]=f);let p;return i[10]!==u||i[11]!==c||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ C(u,{ref:l,"data-slot":d,className:f,...c}),i[10]=u,i[11]=c,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},N=p.Root,P=/* @__PURE__ */ C(w,{}),F=e=>{let n=m(22),r,a,o,s,c,l,u,d,f;n[0]===e?(r=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7],d=n[8],f=n[9]):({appearance:c,className:r,icon:l,intent:u,label:a,ref:s,size:d,type:f,...o}=e,n[0]=e,n[1]=r,n[2]=a,n[3]=o,n[4]=s,n[5]=c,n[6]=l,n[7]=u,n[8]=d,n[9]=f);let h=c===void 0?`ghost`:c,g=l===void 0?P:l,_=u===void 0?`neutral`:u,v=d===void 0?`xs`:d,y=f===void 0?`button`:f,b;n[10]===r?b=n[11]:(b=t(`text-body -my-0.5`,r),n[10]=r,n[11]=b);let x;return n[12]!==h||n[13]!==g||n[14]!==_||n[15]!==a||n[16]!==o||n[17]!==s||n[18]!==v||n[19]!==b||n[20]!==y?(x=/* @__PURE__ */ C(p.Trigger,{asChild:!0,children:/* @__PURE__ */ C(i,{ref:s,appearance:h,className:b,icon:g,intent:_,label:a,size:v,type:y,...o})}),n[12]=h,n[13]=g,n[14]=_,n[15]=a,n[16]=o,n[17]=s,n[18]=v,n[19]=b,n[20]=y,n[21]=x):x=n[21],x},I=e=>{let t=m(10),r,i,a;t[0]===e?(r=t[1],i=t[2],a=t[3]):({"data-slot":r,ref:a,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a);let o;t[4]===r?o=t[5]:(o=n(r,`field-help-content`),t[4]=r,t[5]=o);let s;return t[6]!==i||t[7]!==a||t[8]!==o?(s=/* @__PURE__ */ C(p.Content,{ref:a,"data-slot":o,...i}),t[6]=i,t[7]=a,t[8]=o,t[9]=s):s=t[9],s},L=e=>{let i=m(18),a,o,s,c,l,u;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({"data-slot":c,asChild:a,children:o,className:s,ref:u,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=a?r:`span`,f;i[7]===c?f=i[8]:(f=n(c,`field-optional`),i[7]=c,i[8]=f);let p;i[9]===s?p=i[10]:(p=t(`text-muted text-sm font-normal font-sans`,s),i[9]=s,i[10]=p);let h=o??`(Optional)`,g;return i[11]!==d||i[12]!==l||i[13]!==u||i[14]!==f||i[15]!==p||i[16]!==h?(g=/* @__PURE__ */ C(d,{ref:u,"data-slot":f,className:p,...l,children:h}),i[11]=d,i[12]=l,i[13]=u,i[14]=f,i[15]=p,i[16]=h,i[17]=g):g=i[17],g},R=e=>{let i=m(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({"data-slot":s,asChild:a,className:o,ref:l,...c}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===s?d=i[7]:(d=n(s,`field-group`),i[6]=s,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`flex w-full flex-col gap-4`,o),i[8]=o,i[9]=f);let p;return i[10]!==u||i[11]!==c||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ C(u,{ref:l,"data-slot":d,className:f,...c}),i[10]=u,i[11]=c,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},z=e=>{let i=m(37),o,s,u,d,f,p,h,g,_;i[0]===e?(o=i[1],s=i[2],u=i[3],d=i[4],f=i[5],p=i[6],h=i[7],g=i[8],_=i[9]):({"data-slot":d,asChild:o,children:s,className:u,id:f,name:p,ref:g,validation:_,...h}=e,i[0]=e,i[1]=o,i[2]=s,i[3]=u,i[4]=d,i[5]=f,i[6]=p,i[7]=h,i[8]=g,i[9]=_);let v=o?r:`div`,y=b(),S=f??y,w=b(),T=b(),[E,D]=x(!1),O=_??(E?`error`:void 0),k;i[10]===O?k=i[11]:(k=a(O),i[10]=O,i[11]=k);let A=k,j;i[12]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>(D(!0),()=>{D(!1)}),i[12]=j):j=i[12];let M=j,N;i[13]!==S||i[14]!==w||i[15]!==T||i[16]!==p||i[17]!==A?(N={controlId:S,descriptionId:w,errorId:T,name:p,registerError:M,validation:A},i[13]=S,i[14]=w,i[15]=T,i[16]=p,i[17]=A,i[18]=N):N=i[18];let P=N,F;i[19]===d?F=i[20]:(F=n(d,`field-item`),i[19]=d,i[20]=F);let I;i[21]===u?I=i[22]:(I=t(`flex w-full flex-col gap-1.5`,u),i[21]=u,i[22]=I);let L;i[23]!==v||i[24]!==s||i[25]!==h||i[26]!==g||i[27]!==F||i[28]!==I||i[29]!==A?(L=/* @__PURE__ */ C(v,{ref:g,"data-slot":F,"data-validation":A,className:I,...h,children:s}),i[23]=v,i[24]=s,i[25]=h,i[26]=g,i[27]=F,i[28]=I,i[29]=A,i[30]=L):L=i[30];let R;i[31]!==L||i[32]!==A?(R=/* @__PURE__ */ C(c,{validation:A,children:L}),i[31]=L,i[32]=A,i[33]=R):R=i[33];let z;return i[34]!==P||i[35]!==R?(z=/* @__PURE__ */ C(l.Provider,{value:P,children:R}),i[34]=P,i[35]=R,i[36]=z):z=i[36],z},B=e=>{let t=m(30),n,i,a;t[0]===e?(n=t[1],i=t[2],a=t[3]):({children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a);let o=y(l),s,f,p,h,g,b,x,w,T;if(t[4]!==n||t[5]!==o||t[6]!==i||t[7]!==a){T=Symbol.for(`react.early_return_sentinel`);bb0:{let e=u({context:o});if(typeof n==`function`){T=/* @__PURE__ */ C(c,{validation:e.validation,children:/* @__PURE__ */ C(d.Provider,{value:o?e.ariaProps:null,children:n(e.ariaProps)})});break bb0}S(v(n),`Field.Control expects a single React element child (or a render-prop function). Got a non-element value (string, array, fragment, null, or undefined). Wrap the control in a single element, or use the function child form: <Field.Control>{(props) => <YourControl {...props} />}</Field.Control>.`),p=c,w=e.validation,f=d.Provider,x=o?e.ariaProps:null,s=r,h=a,g=i,b=_(n,e.ariaProps)}t[4]=n,t[5]=o,t[6]=i,t[7]=a,t[8]=s,t[9]=f,t[10]=p,t[11]=h,t[12]=g,t[13]=b,t[14]=x,t[15]=w,t[16]=T}else s=t[8],f=t[9],p=t[10],h=t[11],g=t[12],b=t[13],x=t[14],w=t[15],T=t[16];if(T!==Symbol.for(`react.early_return_sentinel`))return T;let E;t[17]!==s||t[18]!==h||t[19]!==g||t[20]!==b?(E=/* @__PURE__ */ C(s,{ref:h,...g,children:b}),t[17]=s,t[18]=h,t[19]=g,t[20]=b,t[21]=E):E=t[21];let D;t[22]!==f||t[23]!==x||t[24]!==E?(D=/* @__PURE__ */ C(f,{value:x,children:E}),t[22]=f,t[23]=x,t[24]=E,t[25]=D):D=t[25];let O;return t[26]!==p||t[27]!==w||t[28]!==D?(O=/* @__PURE__ */ C(p,{validation:w,children:D}),t[26]=p,t[27]=w,t[28]=D,t[29]=O):O=t[29],O},V=e=>{let i=m(17),a,o,s,c,u;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5]):({"data-slot":s,asChild:a,className:o,ref:u,...c}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u);let d=a?r:`p`,f=y(l),p;i[6]===s?p=i[7]:(p=n(s,`field-description`),i[6]=s,i[7]=p);let h=f?.descriptionId,g;i[8]===o?g=i[9]:(g=t(`text-body text-sm leading-4`,`[:where([data-slot=field-error-list]+&)]:-mt-1.5`,o),i[8]=o,i[9]=g);let _;return i[10]!==d||i[11]!==c||i[12]!==u||i[13]!==p||i[14]!==h||i[15]!==g?(_=/* @__PURE__ */ C(d,{ref:u,"data-slot":p,id:h,className:g,...c}),i[10]=d,i[11]=c,i[12]=u,i[13]=p,i[14]=h,i[15]=g,i[16]=_):_=i[16],_},H=e=>{let r=m(16),i,a,o,s,c;if(r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5]):({"data-slot":o,children:i,className:a,ref:c,...s}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c),!E(i))return null;let l;r[6]===o?l=r[7]:(l=n(o,`field-error`),r[6]=o,r[7]=l);let u;r[8]===a?u=r[9]:(u=t(`text-danger-600 text-sm leading-4`,a),r[8]=a,r[9]=u);let d;return r[10]!==i||r[11]!==s||r[12]!==c||r[13]!==l||r[14]!==u?(d=/* @__PURE__ */ C(`li`,{ref:c,"data-slot":l,className:u,...s,children:i}),r[10]=i,r[11]=s,r[12]=c,r[13]=l,r[14]=u,r[15]=d):d=r[15],d},U=e=>{let t=m(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({messages:n,ref:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=T(n).map(K),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=/* @__PURE__ */ C(W,{ref:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o},W=i=>{let a=m(25),o,s,c,u,d,f;a[0]===i?(o=a[1],s=a[2],c=a[3],u=a[4],d=a[5],f=a[6]):({"data-slot":u,asChild:o,children:s,className:c,ref:f,...d}=i,a[0]=i,a[1]=o,a[2]=s,a[3]=c,a[4]=u,a[5]=d,a[6]=f);let p;a[7]===s?p=a[8]:(p=D({children:s,errorItemType:H}),a[7]=s,a[8]=p);let h=p,g=y(l),_=g?.registerError,v,b;if(a[9]!==h||a[10]!==_?(v=()=>{if(h&&_!=null)return _()},b=[h,_],a[9]=h,a[10]=_,a[11]=v,a[12]=b):(v=a[11],b=a[12]),e(v,b),!h)return null;let x=o?r:`ul`,S;a[13]===u?S=a[14]:(S=n(u,`field-error-list`),a[13]=u,a[14]=S);let w=g?.errorId,T;a[15]===c?T=a[16]:(T=t(`m-0 flex w-full flex-col list-none p-0`,c),a[15]=c,a[16]=T);let E;return a[17]!==x||a[18]!==s||a[19]!==d||a[20]!==f||a[21]!==S||a[22]!==w||a[23]!==T?(E=/* @__PURE__ */ C(x,{ref:f,"data-slot":S,id:w,role:`list`,className:T,...d,children:s}),a[17]=x,a[18]=s,a[19]=d,a[20]=f,a[21]=S,a[22]=w,a[23]=T,a[24]=E):E=a[24],E},G={Item:z,Control:B,Group:R,Set:O,Legend:k,Label:A,LabelText:j,LabelRow:M,Help:N,HelpTrigger:F,HelpContent:I,Optional:L,Description:V,Errors:U,ErrorList:W,ErrorItem:H};function K(e){return/* @__PURE__ */ C(H,{children:e},e)}const q=e=>T(e?.map(e=>typeof e==`string`||!e?e:e.message));export{G as Field,o as isAriaInvalid,s as parseValidation,a as resolveValidation,q as toErrorMessages};
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-CLSmHzo4.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./button-BWGUuWnu.js";import{t as i}from"./label-DmDwzPD8.js";import{t as a}from"./popover-DxOqLKxy.js";import{t as o}from"./slot-DdYN1L1C.js";import{n as s,r as c,t as l}from"./field-Bihblt8U.js";import{i as u,n as d,r as f,t as p}from"./field-CPvjazWN.js";import{c as m}from"react/compiler-runtime";import{Children as h,Fragment as g,cloneElement as _,isValidElement as v,useContext as y,useId as b,useState as x}from"react";import S from"tiny-invariant";import{jsx as C}from"react/jsx-runtime";import{QuestionIcon as w}from"@phosphor-icons/react/Question";const T=e=>{let t=[],n=/* @__PURE__ */ new Set;for(let r of e??[]){if(typeof r!=`string`)continue;let e=r.trim();e.length===0||n.has(e)||(n.add(e),t.push(e))}return t},E=e=>!(e==null||typeof e==`boolean`||typeof e==`string`&&e.trim().length===0),D=({children:e,errorItemType:t})=>{let n=!1;return h.forEach(e,e=>{n||e==null||typeof e==`boolean`||(typeof e==`string`?e.trim().length>0&&(n=!0):n=v(e)?e.type===t?E(e.props.children):e.type!==g||D({children:e.props.children,errorItemType:t}):!0)}),n},O=e=>{let r=m(14),i,a,o,s;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4]):({"data-slot":a,className:i,ref:s,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c;r[5]===a?c=r[6]:(c=n(a,`field-set`),r[5]=a,r[6]=c);let l;r[7]===i?l=r[8]:(l=t(`flex w-full min-w-0 flex-col gap-4 border-0 p-0`,i),r[7]=i,r[8]=l);let u;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==l?(u=/* @__PURE__ */ C(`fieldset`,{ref:s,"data-slot":c,className:l,...o}),r[9]=o,r[10]=s,r[11]=c,r[12]=l,r[13]=u):u=r[13],u},k=e=>{let n=m(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(`text-strong mb-1.5 text-sm font-medium font-sans`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==a||n[8]!==o?(s=/* @__PURE__ */ C(`legend`,{ref:a,"data-slot":`field-legend`,className:o,...i}),n[6]=i,n[7]=a,n[8]=o,n[9]=s):s=n[9],s},A=e=>{let t=m(7),n,r;t[0]===e?(n=t[1],r=t[2]):({ref:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let a=y(s)?.controlId,o;return t[3]!==n||t[4]!==r||t[5]!==a?(o=/* @__PURE__ */ C(i,{ref:r,...n,htmlFor:a}),t[3]=n,t[4]=r,t[5]=a,t[6]=o):o=t[6],o},j=e=>{let r=m(16),i,a,s,c,l;r[0]===e?(i=r[1],a=r[2],s=r[3],c=r[4],l=r[5]):({"data-slot":s,asChild:i,className:a,ref:l,...c}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=s,r[4]=c,r[5]=l);let u=i?o:`p`,d;r[6]===s?d=r[7]:(d=n(s,`field-label-text`),r[6]=s,r[7]=d);let f;r[8]===a?f=r[9]:(f=t(`text-strong text-sm font-medium font-sans`,a),r[8]=a,r[9]=f);let p;return r[10]!==u||r[11]!==c||r[12]!==l||r[13]!==d||r[14]!==f?(p=/* @__PURE__ */ C(u,{ref:l,"data-slot":d,className:f,...c}),r[10]=u,r[11]=c,r[12]=l,r[13]=d,r[14]=f,r[15]=p):p=r[15],p},M=e=>{let r=m(16),i,a,s,c,l;r[0]===e?(i=r[1],a=r[2],s=r[3],c=r[4],l=r[5]):({"data-slot":s,asChild:i,className:a,ref:l,...c}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=s,r[4]=c,r[5]=l);let u=i?o:`div`,d;r[6]===s?d=r[7]:(d=n(s,`field-label-row`),r[6]=s,r[7]=d);let f;r[8]===a?f=r[9]:(f=t(`flex items-center gap-1`,a),r[8]=a,r[9]=f);let p;return r[10]!==u||r[11]!==c||r[12]!==l||r[13]!==d||r[14]!==f?(p=/* @__PURE__ */ C(u,{ref:l,"data-slot":d,className:f,...c}),r[10]=u,r[11]=c,r[12]=l,r[13]=d,r[14]=f,r[15]=p):p=r[15],p},N=a.Root,P=/* @__PURE__ */ C(w,{}),F=e=>{let n=m(22),i,o,s,c,l,u,d,f,p;n[0]===e?(i=n[1],o=n[2],s=n[3],c=n[4],l=n[5],u=n[6],d=n[7],f=n[8],p=n[9]):({appearance:l,className:i,icon:u,intent:d,label:o,ref:c,size:f,type:p,...s}=e,n[0]=e,n[1]=i,n[2]=o,n[3]=s,n[4]=c,n[5]=l,n[6]=u,n[7]=d,n[8]=f,n[9]=p);let h=l===void 0?`ghost`:l,g=u===void 0?P:u,_=d===void 0?`neutral`:d,v=f===void 0?`xs`:f,y=p===void 0?`button`:p,b;n[10]===i?b=n[11]:(b=t(`text-body -my-0.5`,i),n[10]=i,n[11]=b);let x;return n[12]!==h||n[13]!==g||n[14]!==_||n[15]!==o||n[16]!==s||n[17]!==c||n[18]!==v||n[19]!==b||n[20]!==y?(x=/* @__PURE__ */ C(a.Trigger,{asChild:!0,children:/* @__PURE__ */ C(r,{ref:c,appearance:h,className:b,icon:g,intent:_,label:o,size:v,type:y,...s})}),n[12]=h,n[13]=g,n[14]=_,n[15]=o,n[16]=s,n[17]=c,n[18]=v,n[19]=b,n[20]=y,n[21]=x):x=n[21],x},I=e=>{let t=m(10),r,i,o;t[0]===e?(r=t[1],i=t[2],o=t[3]):({"data-slot":r,ref:o,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=o);let s;t[4]===r?s=t[5]:(s=n(r,`field-help-content`),t[4]=r,t[5]=s);let c;return t[6]!==i||t[7]!==o||t[8]!==s?(c=/* @__PURE__ */ C(a.Content,{ref:o,"data-slot":s,...i}),t[6]=i,t[7]=o,t[8]=s,t[9]=c):c=t[9],c},L=e=>{let r=m(18),i,a,s,c,l,u;r[0]===e?(i=r[1],a=r[2],s=r[3],c=r[4],l=r[5],u=r[6]):({"data-slot":c,asChild:i,children:a,className:s,ref:u,...l}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=s,r[4]=c,r[5]=l,r[6]=u);let d=i?o:`span`,f;r[7]===c?f=r[8]:(f=n(c,`field-optional`),r[7]=c,r[8]=f);let p;r[9]===s?p=r[10]:(p=t(`text-muted text-sm font-normal font-sans`,s),r[9]=s,r[10]=p);let h=a??`(Optional)`,g;return r[11]!==d||r[12]!==l||r[13]!==u||r[14]!==f||r[15]!==p||r[16]!==h?(g=/* @__PURE__ */ C(d,{ref:u,"data-slot":f,className:p,...l,children:h}),r[11]=d,r[12]=l,r[13]=u,r[14]=f,r[15]=p,r[16]=h,r[17]=g):g=r[17],g},R=e=>{let r=m(16),i,a,s,c,l;r[0]===e?(i=r[1],a=r[2],s=r[3],c=r[4],l=r[5]):({"data-slot":s,asChild:i,className:a,ref:l,...c}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=s,r[4]=c,r[5]=l);let u=i?o:`div`,d;r[6]===s?d=r[7]:(d=n(s,`field-group`),r[6]=s,r[7]=d);let f;r[8]===a?f=r[9]:(f=t(`flex w-full flex-col gap-4`,a),r[8]=a,r[9]=f);let p;return r[10]!==u||r[11]!==c||r[12]!==l||r[13]!==d||r[14]!==f?(p=/* @__PURE__ */ C(u,{ref:l,"data-slot":d,className:f,...c}),r[10]=u,r[11]=c,r[12]=l,r[13]=d,r[14]=f,r[15]=p):p=r[15],p},z=e=>{let r=m(37),i,a,c,l,d,f,h,g,_;r[0]===e?(i=r[1],a=r[2],c=r[3],l=r[4],d=r[5],f=r[6],h=r[7],g=r[8],_=r[9]):({"data-slot":l,asChild:i,children:a,className:c,id:d,name:f,ref:g,validation:_,...h}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=c,r[4]=l,r[5]=d,r[6]=f,r[7]=h,r[8]=g,r[9]=_);let v=i?o:`div`,y=b(),S=d??y,w=b(),T=b(),[E,D]=x(!1),O=_??(E?`error`:void 0),k;r[10]===O?k=r[11]:(k=u(O),r[10]=O,r[11]=k);let A=k,j;r[12]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>(D(!0),()=>{D(!1)}),r[12]=j):j=r[12];let M=j,N;r[13]!==S||r[14]!==w||r[15]!==T||r[16]!==f||r[17]!==A?(N={controlId:S,descriptionId:w,errorId:T,name:f,registerError:M,validation:A},r[13]=S,r[14]=w,r[15]=T,r[16]=f,r[17]=A,r[18]=N):N=r[18];let P=N,F;r[19]===l?F=r[20]:(F=n(l,`field-item`),r[19]=l,r[20]=F);let I;r[21]===c?I=r[22]:(I=t(`flex w-full flex-col gap-1.5`,c),r[21]=c,r[22]=I);let L;r[23]!==v||r[24]!==a||r[25]!==h||r[26]!==g||r[27]!==F||r[28]!==I||r[29]!==A?(L=/* @__PURE__ */ C(v,{ref:g,"data-slot":F,"data-validation":A,className:I,...h,children:a}),r[23]=v,r[24]=a,r[25]=h,r[26]=g,r[27]=F,r[28]=I,r[29]=A,r[30]=L):L=r[30];let R;r[31]!==L||r[32]!==A?(R=/* @__PURE__ */ C(p,{validation:A,children:L}),r[31]=L,r[32]=A,r[33]=R):R=r[33];let z;return r[34]!==P||r[35]!==R?(z=/* @__PURE__ */ C(s.Provider,{value:P,children:R}),r[34]=P,r[35]=R,r[36]=z):z=r[36],z},B=e=>{let t=m(30),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,ref:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=y(s),u,d,f,h,g,b,x,w,T;if(t[4]!==n||t[5]!==a||t[6]!==r||t[7]!==i){T=Symbol.for(`react.early_return_sentinel`);bb0:{let e=c({context:a});if(typeof n==`function`){T=/* @__PURE__ */ C(p,{validation:e.validation,children:/* @__PURE__ */ C(l.Provider,{value:a?e.ariaProps:null,children:n(e.ariaProps)})});break bb0}S(v(n),`Field.Control expects a single React element child (or a render-prop function). Got a non-element value (string, array, fragment, null, or undefined). Wrap the control in a single element, or use the function child form: <Field.Control>{(props) => <YourControl {...props} />}</Field.Control>.`),f=p,w=e.validation,d=l.Provider,x=a?e.ariaProps:null,u=o,h=i,g=r,b=_(n,e.ariaProps)}t[4]=n,t[5]=a,t[6]=r,t[7]=i,t[8]=u,t[9]=d,t[10]=f,t[11]=h,t[12]=g,t[13]=b,t[14]=x,t[15]=w,t[16]=T}else u=t[8],d=t[9],f=t[10],h=t[11],g=t[12],b=t[13],x=t[14],w=t[15],T=t[16];if(T!==Symbol.for(`react.early_return_sentinel`))return T;let E;t[17]!==u||t[18]!==h||t[19]!==g||t[20]!==b?(E=/* @__PURE__ */ C(u,{ref:h,...g,children:b}),t[17]=u,t[18]=h,t[19]=g,t[20]=b,t[21]=E):E=t[21];let D;t[22]!==d||t[23]!==x||t[24]!==E?(D=/* @__PURE__ */ C(d,{value:x,children:E}),t[22]=d,t[23]=x,t[24]=E,t[25]=D):D=t[25];let O;return t[26]!==f||t[27]!==w||t[28]!==D?(O=/* @__PURE__ */ C(f,{validation:w,children:D}),t[26]=f,t[27]=w,t[28]=D,t[29]=O):O=t[29],O},V=e=>{let r=m(17),i,a,c,l,u;r[0]===e?(i=r[1],a=r[2],c=r[3],l=r[4],u=r[5]):({"data-slot":c,asChild:i,className:a,ref:u,...l}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=c,r[4]=l,r[5]=u);let d=i?o:`p`,f=y(s),p;r[6]===c?p=r[7]:(p=n(c,`field-description`),r[6]=c,r[7]=p);let h=f?.descriptionId,g;r[8]===a?g=r[9]:(g=t(`text-body text-sm leading-4`,`[:where([data-slot=field-error-list]+&)]:-mt-1.5`,a),r[8]=a,r[9]=g);let _;return r[10]!==d||r[11]!==l||r[12]!==u||r[13]!==p||r[14]!==h||r[15]!==g?(_=/* @__PURE__ */ C(d,{ref:u,"data-slot":p,id:h,className:g,...l}),r[10]=d,r[11]=l,r[12]=u,r[13]=p,r[14]=h,r[15]=g,r[16]=_):_=r[16],_},H=e=>{let r=m(16),i,a,o,s,c;if(r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5]):({"data-slot":o,children:i,className:a,ref:c,...s}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c),!E(i))return null;let l;r[6]===o?l=r[7]:(l=n(o,`field-error`),r[6]=o,r[7]=l);let u;r[8]===a?u=r[9]:(u=t(`text-danger-600 text-sm leading-4`,a),r[8]=a,r[9]=u);let d;return r[10]!==i||r[11]!==s||r[12]!==c||r[13]!==l||r[14]!==u?(d=/* @__PURE__ */ C(`li`,{ref:c,"data-slot":l,className:u,...s,children:i}),r[10]=i,r[11]=s,r[12]=c,r[13]=l,r[14]=u,r[15]=d):d=r[15],d},U=e=>{let t=m(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({messages:n,ref:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=T(n).map(K),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=/* @__PURE__ */ C(W,{ref:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o},W=r=>{let i=m(25),a,c,l,u,d,f;i[0]===r?(a=i[1],c=i[2],l=i[3],u=i[4],d=i[5],f=i[6]):({"data-slot":u,asChild:a,children:c,className:l,ref:f,...d}=r,i[0]=r,i[1]=a,i[2]=c,i[3]=l,i[4]=u,i[5]=d,i[6]=f);let p;i[7]===c?p=i[8]:(p=D({children:c,errorItemType:H}),i[7]=c,i[8]=p);let h=p,g=y(s),_=g?.registerError,v,b;if(i[9]!==h||i[10]!==_?(v=()=>{if(h&&_!=null)return _()},b=[h,_],i[9]=h,i[10]=_,i[11]=v,i[12]=b):(v=i[11],b=i[12]),e(v,b),!h)return null;let x=a?o:`ul`,S;i[13]===u?S=i[14]:(S=n(u,`field-error-list`),i[13]=u,i[14]=S);let w=g?.errorId,T;i[15]===l?T=i[16]:(T=t(`m-0 flex w-full flex-col list-none p-0`,l),i[15]=l,i[16]=T);let E;return i[17]!==x||i[18]!==c||i[19]!==d||i[20]!==f||i[21]!==S||i[22]!==w||i[23]!==T?(E=/* @__PURE__ */ C(x,{ref:f,"data-slot":S,id:w,role:`list`,className:T,...d,children:c}),i[17]=x,i[18]=c,i[19]=d,i[20]=f,i[21]=S,i[22]=w,i[23]=T,i[24]=E):E=i[24],E},G={Item:z,Control:B,Group:R,Set:O,Legend:k,Label:A,LabelText:j,LabelRow:M,Help:N,HelpTrigger:F,HelpContent:I,Optional:L,Description:V,Errors:U,ErrorList:W,ErrorItem:H};function K(e){return/* @__PURE__ */ C(H,{children:e},e)}const q=e=>T(e?.map(e=>typeof e==`string`||!e?e:e.message));export{G as Field,d as isAriaInvalid,f as parseValidation,u as resolveValidation,q as toErrorMessages};
|
package/dist/flag.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports for the Flag component.
|
|
3
|
+
*
|
|
4
|
+
* @see https://mantle.ngrok.com/components/data-display/flag
|
|
5
|
+
*/
|
|
1
6
|
import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
|
|
2
7
|
import { ComponentProps } from "react";
|
|
3
8
|
/** All valid values for a flag
|
|
@@ -63,6 +68,9 @@ type Props = Omit<ComponentProps<"div">, "children"> & {
|
|
|
63
68
|
* **Loading.** Defaults to `loading="lazy"`. Use `loading="eager"` for flags
|
|
64
69
|
* above the fold or in critical content.
|
|
65
70
|
*
|
|
71
|
+
* @useWhen Show the country of a region, an IP address, or a billing address as a flag, from its
|
|
72
|
+
* two-letter country code.
|
|
73
|
+
*
|
|
66
74
|
* @see https://mantle.ngrok.com/components/data-display/flag
|
|
67
75
|
*
|
|
68
76
|
* @example
|
package/dist/hooks.d.ts
CHANGED
package/dist/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as
|
|
1
|
+
import{n as e,r as t,t as n}from"./use-breakpoint--mo7kr9d.js";import{t as r}from"./use-callback-ref-BvVyI5K1.js";import{t as i}from"./use-copy-to-clipboard-Dy_0Qzb7.js";import{n as a,t as o}from"./use-inert-siblings-CNmNuS2h.js";import{r as s}from"./browser-only-BTSrYWLj.js";import{t as c}from"./use-is-hydrated-after-paint-r9Cl2mGp.js";import{t as l}from"./use-isomorphic-layout-effect-CLSmHzo4.js";import{t as u}from"./use-matches-media-query-m860lols.js";import{n as d,t as f}from"./use-prefers-reduced-motion-CU6mWmOe.js";import{n as p}from"./use-swipe-to-dismiss-i__cTF2v.js";import{n as m}from"./compose-refs-sFdxsL7k.js";import{t as h}from"./in-view-Dxv_GrUU.js";import{c as g}from"react/compiler-runtime";import{useEffect as _,useRef as v,useState as y,useSyncExternalStore as b}from"react";function x(e,t){let n=g(4),[r,i]=y(e),a,o;return n[0]!==t.waitMs||n[1]!==e?(a=()=>{let n=window.setTimeout(()=>{i(e)},t.waitMs);return()=>{window.clearTimeout(n)}},o=[e,t.waitMs],n[0]=t.waitMs,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),_(a,o),r}function S(e,t){let n=g(5),i=r(e),a=v(0),o,s;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>()=>window.clearTimeout(a.current),s=[],n[0]=o,n[1]=s):(o=n[0],s=n[1]),_(o,s);let c;return n[2]!==t.waitMs||n[3]!==i?(c=(...e)=>{let n=e;window.clearTimeout(a.current),a.current=window.setTimeout(()=>i(...n),t.waitMs)},n[2]=t.waitMs,n[3]=i,n[4]=c):c=n[4],c}const C=/* @__PURE__ */ new Map;function w(e){e.key==null?C.clear():C.has(e.key)&&(e.newValue==null?C.delete(e.key):C.set(e.key,e.newValue))}function T(){try{return window.localStorage}catch{return null}}function E(e){return function(t){function n(n){let r=n.storageArea==null||n.storageArea===T(),i=n.key==null||n.key===e;r&&i&&(w(n),t())}return window.addEventListener(`storage`,n),()=>{window.removeEventListener(`storage`,n)}}}function D(){return null}function O(e){let t=C.get(e);if(t!=null)return t;try{return window.localStorage.getItem(e)}catch{return null}}function k(e,t){try{window.localStorage.setItem(e,t),C.delete(e)}catch{C.set(e,t)}}function A(e,t){try{let n=JSON.parse(e);return typeof n==`string`?n:t}catch{return t}}function j(e,t){let n=g(12),r;n[0]===e?r=n[1]:(r=E(e),n[0]=e,n[1]=r);let i=r,a;n[2]===e?a=n[3]:(a=()=>O(e),n[2]=e,n[3]=a);let o=b(i,a,D),s;n[4]!==t||n[5]!==o?(s=o==null?t:A(o,t),n[4]=t,n[5]=o,n[6]=s):s=n[6];let c=s,l;n[7]===e?l=n[8]:(l=t=>{let n=JSON.stringify(t);k(e,n),window.dispatchEvent(new StorageEvent(`storage`,{key:e,newValue:n,storageArea:T()}))},n[7]=e,n[8]=l);let u=l,d;return n[9]!==u||n[10]!==c?(d=[c,u],n[9]=u,n[10]=c,n[11]=d):d=n[11],d}const M=/* @__PURE__ */ new Map;function N(e){e.key==null?M.clear():M.has(e.key)&&(e.newValue==null?M.delete(e.key):M.set(e.key,e.newValue))}function P(){try{return window.sessionStorage}catch{return null}}function F(e){return function(t){function n(n){let r=n.storageArea==null||n.storageArea===P(),i=n.key==null||n.key===e;r&&i&&(N(n),t())}return window.addEventListener(`storage`,n),()=>{window.removeEventListener(`storage`,n)}}}function I(){return null}function L(e){let t=M.get(e);if(t!=null)return t;try{return window.sessionStorage.getItem(e)}catch{return null}}function R(e,t){try{window.sessionStorage.setItem(e,t),M.delete(e)}catch{M.set(e,t)}}function z(e,t){try{let n=JSON.parse(e);return typeof n==`string`?n:t}catch{return t}}function B(e,t){let n=g(12),r;n[0]===e?r=n[1]:(r=F(e),n[0]=e,n[1]=r);let i=r,a;n[2]===e?a=n[3]:(a=()=>L(e),n[2]=e,n[3]=a);let o=b(i,a,I),s;n[4]!==t||n[5]!==o?(s=o==null?t:z(o,t),n[4]=t,n[5]=o,n[6]=s):s=n[6];let c=s,l;n[7]===e?l=n[8]:(l=t=>{let n=JSON.stringify(t);R(e,n),window.dispatchEvent(new StorageEvent(`storage`,{key:e,newValue:n,storageArea:P()}))},n[7]=e,n[8]=l);let u=l,d;return n[9]!==u||n[10]!==c?(d=[c,u],n[9]=u,n[10]=c,n[11]=d):d=n[11],d}function V(){return d()?`auto`:`smooth`}function H(e,t){let n=g(9),r;n[0]===t?r=n[1]:(r=t===void 0?{}:t,n[0]=t,n[1]=r);let{root:i,margin:a,amount:o,once:s,initial:c}=r,l=s!==void 0&&s,u=c!==void 0&&c,[d,f]=y(u),p=v(u),m,b;return n[2]!==o||n[3]!==a||n[4]!==l||n[5]!==e||n[6]!==i?(m=()=>{let t=e.current;if(t==null||l&&p.current)return;let n=function(){if(p.current=!0,f(!0),!l)return()=>{p.current=!1,f(!1)}},r={root:i?.current??void 0,margin:a,amount:o};return h(t,n,r)},b=[i,e,a,l,o],n[2]=o,n[3]=a,n[4]=l,n[5]=e,n[6]=i,n[7]=m,n[8]=b):(m=n[7],b=n[8]),_(m,b),d}function U(){let e=g(9),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let n=v(t),r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[1]=r):r=e[1];let i=v(r),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={undo:0,redo:0},e[2]=a):a=e[2];let[o,s]=y(a),c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>{n.current.push(e),i.current=[],s({undo:n.current.length,redo:0})},e[3]=c):c=e[3];let l=c,u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{let t=n.current[n.current.length-1];if(t!==void 0)return n.current.pop(),i.current.push(e),s({undo:n.current.length,redo:i.current.length}),t},e[4]=u):u=e[4];let d=u,f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{let t=i.current[i.current.length-1];if(t!==void 0)return i.current.pop(),n.current.push(e),s({undo:n.current.length,redo:i.current.length}),t},e[5]=f):f=e[5];let p=f,m=o.undo>0,h=o.redo>0,_;return e[6]!==h||e[7]!==m?(_={canUndo:m,canRedo:h,push:l,undo:d,redo:p},e[6]=h,e[7]=m,e[8]=_):_=e[8],_}export{n as breakpoints,f as getPrefersReducedMotion,e as useBreakpoint,r as useCallbackRef,m as useComposedRefs,i as useCopyToClipboard,x as useDebounce,S as useDebouncedCallback,a as useFocusTrap,H as useInView,o as useInertSiblings,t as useIsBelowBreakpoint,s as useIsHydrated,c as useIsHydratedAfterPaint,l as useIsomorphicLayoutEffect,j as useLocalStorage,u as useMatchesMediaQuery,d as usePrefersReducedMotion,V as useScrollBehavior,B as useSessionStorage,p as useSwipeToDismiss,U as useUndoRedo};
|
package/dist/hover-card.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports for the Hover Card component.
|
|
3
|
+
*
|
|
4
|
+
* @see https://mantle.ngrok.com/components/overlays/hover-card
|
|
5
|
+
*/
|
|
1
6
|
import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
|
|
2
7
|
import { ComponentProps } from "react";
|
|
3
|
-
import { Arrow, Content, Portal, Root, Trigger } from "@radix-ui/react-hover-card";
|
|
8
|
+
import { Arrow as Arrow$1, Content as Content$1, Portal as Portal$1, Root as Root$1, Trigger as Trigger$1 } from "@radix-ui/react-hover-card";
|
|
4
9
|
/**
|
|
5
10
|
* A floating card that appears when a user hovers over a trigger element.
|
|
6
11
|
* This is the root, stateful component that manages the open/closed state of the hover card.
|
|
@@ -28,7 +33,7 @@ import { Arrow, Content, Portal, Root, Trigger } from "@radix-ui/react-hover-car
|
|
|
28
33
|
* </HoverCard.Root>
|
|
29
34
|
* ```
|
|
30
35
|
*/
|
|
31
|
-
declare const Root
|
|
36
|
+
declare const Root: ({ closeDelay, openDelay, ...props }: ComponentProps<typeof Root$1>) => import("react").JSX.Element;
|
|
32
37
|
/**
|
|
33
38
|
* The trigger element that opens the hover card when hovered.
|
|
34
39
|
*
|
|
@@ -48,7 +53,7 @@ declare const Root$1: ({ closeDelay, openDelay, ...props }: ComponentProps<typeo
|
|
|
48
53
|
* </HoverCard.Root>
|
|
49
54
|
* ```
|
|
50
55
|
*/
|
|
51
|
-
declare const Trigger
|
|
56
|
+
declare const Trigger: ({ "data-slot": dataSlot, ...props }: ComponentProps<typeof Trigger$1> & WithDataSlot) => import("react").JSX.Element;
|
|
52
57
|
/**
|
|
53
58
|
* The portal container for rendering hover card content outside the normal DOM tree.
|
|
54
59
|
* `HoverCard.Content` already renders inside this portal internally, so you typically
|
|
@@ -77,7 +82,7 @@ declare const Trigger$1: ({ "data-slot": dataSlot, ...props }: ComponentProps<ty
|
|
|
77
82
|
* </HoverCard.Root>
|
|
78
83
|
* ```
|
|
79
84
|
*/
|
|
80
|
-
declare const Portal
|
|
85
|
+
declare const Portal: ({ container, ...props }: ComponentProps<typeof Portal$1>) => import("react").JSX.Element;
|
|
81
86
|
/**
|
|
82
87
|
* The content to render inside the hover card.
|
|
83
88
|
*
|
|
@@ -108,8 +113,8 @@ declare const Portal$1: ({ container, ...props }: ComponentProps<typeof Portal>)
|
|
|
108
113
|
* </HoverCard.Root>
|
|
109
114
|
* ```
|
|
110
115
|
*/
|
|
111
|
-
declare const Content
|
|
112
|
-
type HoverCardArrowProps = Omit<ComponentProps<typeof Arrow>, "asChild" | "children"> & WithDataSlot;
|
|
116
|
+
declare const Content: ({ "data-slot": dataSlot, className, onClick, align, sideOffset, ...props }: ComponentProps<typeof Content$1> & WithDataSlot) => import("react").JSX.Element;
|
|
117
|
+
type HoverCardArrowProps = Omit<ComponentProps<typeof Arrow$1>, "asChild" | "children"> & WithDataSlot;
|
|
113
118
|
/**
|
|
114
119
|
* An optional tip that points from `HoverCard.Content` at its trigger. Render it
|
|
115
120
|
* as a child of `HoverCard.Content`. Radix positions it with floating-ui's arrow
|
|
@@ -133,7 +138,7 @@ type HoverCardArrowProps = Omit<ComponentProps<typeof Arrow>, "asChild" | "child
|
|
|
133
138
|
* </HoverCard.Root>
|
|
134
139
|
* ```
|
|
135
140
|
*/
|
|
136
|
-
declare const Arrow
|
|
141
|
+
declare const Arrow: ({ "data-slot": dataSlot, className, height, width, ...props }: HoverCardArrowProps) => import("react").JSX.Element;
|
|
137
142
|
/**
|
|
138
143
|
* A floating card that appears when a user hovers over a trigger element.
|
|
139
144
|
*
|
|
@@ -152,6 +157,12 @@ declare const Arrow$1: ({ "data-slot": dataSlot, className, height, width, ...pr
|
|
|
152
157
|
* (`z-60`). When sibling floats share a container, the most recently mounted
|
|
153
158
|
* float paints on top.
|
|
154
159
|
*
|
|
160
|
+
* @useWhen Preview the content behind a link on hover, such as a user card or a repository preview.
|
|
161
|
+
*
|
|
162
|
+
* @siblings
|
|
163
|
+
* - `Tooltip`: the content is a short label or hint with no interactive content.
|
|
164
|
+
* - `Popover`: the user opens interactive content on purpose, with a click or a key.
|
|
165
|
+
*
|
|
155
166
|
* @see https://mantle.ngrok.com/components/overlays/hover-card
|
|
156
167
|
*
|
|
157
168
|
* @example
|
|
@@ -204,7 +215,7 @@ declare const HoverCard: {
|
|
|
204
215
|
* </HoverCard.Root>
|
|
205
216
|
* ```
|
|
206
217
|
*/
|
|
207
|
-
readonly Root: typeof Root
|
|
218
|
+
readonly Root: typeof Root;
|
|
208
219
|
/**
|
|
209
220
|
* An optional tip that points from `HoverCard.Content` at its trigger. It stays
|
|
210
221
|
* centered on the trigger when collision detection shifts or flips the content,
|
|
@@ -228,7 +239,7 @@ declare const HoverCard: {
|
|
|
228
239
|
* </HoverCard.Root>
|
|
229
240
|
* ```
|
|
230
241
|
*/
|
|
231
|
-
readonly Arrow: typeof Arrow
|
|
242
|
+
readonly Arrow: typeof Arrow;
|
|
232
243
|
/**
|
|
233
244
|
* The content to render inside the hover card.
|
|
234
245
|
*
|
|
@@ -261,7 +272,7 @@ declare const HoverCard: {
|
|
|
261
272
|
* </HoverCard.Root>
|
|
262
273
|
* ```
|
|
263
274
|
*/
|
|
264
|
-
readonly Content: typeof Content
|
|
275
|
+
readonly Content: typeof Content;
|
|
265
276
|
/**
|
|
266
277
|
* The portal container for rendering hover card content outside the normal DOM tree.
|
|
267
278
|
* `HoverCard.Content` already renders inside this portal internally, so you typically
|
|
@@ -290,7 +301,7 @@ declare const HoverCard: {
|
|
|
290
301
|
* </HoverCard.Root>
|
|
291
302
|
* ```
|
|
292
303
|
*/
|
|
293
|
-
readonly Portal: typeof Portal
|
|
304
|
+
readonly Portal: typeof Portal;
|
|
294
305
|
/**
|
|
295
306
|
* The trigger element that opens the hover card when hovered.
|
|
296
307
|
*
|
|
@@ -313,6 +324,6 @@ declare const HoverCard: {
|
|
|
313
324
|
* </HoverCard.Root>
|
|
314
325
|
* ```
|
|
315
326
|
*/
|
|
316
|
-
readonly Trigger: typeof Trigger
|
|
327
|
+
readonly Trigger: typeof Trigger;
|
|
317
328
|
};
|
|
318
329
|
export { HoverCard };
|
|
@@ -16,6 +16,12 @@ type IconProps = Omit<SvgAttributes, "children"> & {
|
|
|
16
16
|
* `aria-hidden`. Pass `role="img"` and `aria-label` when the icon is the only
|
|
17
17
|
* thing that conveys its meaning.
|
|
18
18
|
*
|
|
19
|
+
* @useWhen Show an SVG icon, such as a Phosphor icon, beside text or inside a control.
|
|
20
|
+
*
|
|
21
|
+
* @siblings
|
|
22
|
+
* - `IconButton`: the icon is the only content of a button.
|
|
23
|
+
* - `Avatar`: the image represents a person or an account.
|
|
24
|
+
*
|
|
19
25
|
* @see https://mantle.ngrok.com/components/data-display/icon
|
|
20
26
|
*
|
|
21
27
|
* @example
|
package/dist/icon.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports for the Icon component.
|
|
3
|
+
*
|
|
4
|
+
* @see https://mantle.ngrok.com/components/data-display/icon
|
|
5
|
+
*/
|
|
6
|
+
import { n as IconProps, t as Icon } from "./icon-NYvyyRMG.js";
|
|
3
7
|
import { n as SvgOnlyProps, t as SvgOnly } from "./icon-DXDyhy2N.js";
|
|
8
|
+
import { t as SvgAttributes } from "./icon-CgNqu-fl.js";
|
|
4
9
|
export { Icon, type IconProps, type SvgAttributes, SvgOnly, type SvgOnlyProps };
|
package/dist/icon.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./icon-
|
|
1
|
+
import{t as e}from"./icon-kK0c-POG.js";import{t}from"./icon-BudQMD2S.js";export{e as Icon,t as SvgOnly};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./theme-
|
|
1
|
+
import{s as e}from"./theme-DdZgLvKH.js";import{c as t}from"react/compiler-runtime";import{jsx as n}from"react/jsx-runtime";import{DesktopIcon as r}from"@phosphor-icons/react/Desktop";import{MoonIcon as i}from"@phosphor-icons/react/Moon";import{SunIcon as a}from"@phosphor-icons/react/Sun";function o(r){let i=t(3),a=e(),o;return i[0]!==a||i[1]!==r?(o=/* @__PURE__ */ n(s,{theme:a,...r}),i[0]=a,i[1]=r,i[2]=o):o=i[2],o}function s(e){let o=t(9),s,c;switch(o[0]===e?(s=o[1],c=o[2]):({theme:c,...s}=e,o[0]=e,o[1]=s,o[2]=c),c){case`system`:{let e;return o[3]===s?e=o[4]:(e=/* @__PURE__ */ n(r,{...s}),o[3]=s,o[4]=e),e}case`light`:{let e;return o[5]===s?e=o[6]:(e=/* @__PURE__ */ n(a,{...s}),o[5]=s,o[6]=e),e}case`dark`:{let e;return o[7]===s?e=o[8]:(e=/* @__PURE__ */ n(i,{...s}),o[7]=s,o[8]=e),e}}}export{s as n,o as t};
|