@ngrok/mantle 0.94.0 → 0.94.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/dist/accordion.d.ts +61 -21
- package/dist/accordion.js +1 -1
- package/dist/agent.json +61 -56
- package/dist/alert-BkJHDx9X.js +1 -0
- package/dist/{alert-HffaioZM.d.ts → alert-D0zRRUHV.d.ts} +6 -6
- package/dist/alert-center.d.ts +53 -53
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +22 -10
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-Dc6IgvXV.js +1 -0
- package/dist/anchor.d.ts +5 -5
- package/dist/anchor.js +1 -1
- package/dist/app-layout.d.ts +18 -18
- package/dist/app-layout.js +1 -1
- package/dist/area-chart.d.ts +13 -13
- package/dist/area-chart.js +1 -1
- package/dist/avatar.d.ts +24 -24
- package/dist/avatar.js +1 -1
- package/dist/badge.d.ts +7 -7
- package/dist/badge.js +1 -1
- package/dist/bar-chart.d.ts +12 -12
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.d.ts +36 -36
- package/dist/breadcrumb.js +1 -1
- package/dist/browser-only-CZfkNw5A.js +1 -0
- package/dist/browser-only-ymFoM3Ya.js +1 -0
- package/dist/browser-only.js +1 -1
- package/dist/{button-K0pKc3GN.d.ts → button-5Pc7Mby_.d.ts} +3 -3
- package/dist/button-B9bChDgl.js +1 -0
- package/dist/button-D8jixIbH.js +1 -0
- package/dist/button-DNLTJ32M.js +1 -0
- package/dist/{button-Cgf2IcEC.d.ts → button-Ddj6yr10.d.ts} +26 -26
- package/dist/{button-BGwOPjGV.d.ts → button-DnYv7IOT.d.ts} +22 -21
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +1 -1
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +23 -23
- package/dist/centered-layout.js +1 -1
- package/dist/{chart-CE5Uaqz9.js → chart-BLCqzt56.js} +1 -1
- package/dist/{chart-DCTGGlWL.js → chart-CChZiCrt.js} +1 -1
- package/dist/{chart-BO9EwQ60.js → chart-CUmSu9d7.js} +1 -1
- package/dist/{chart-jitNqimS.d.ts → chart-Dl8gFo_D.d.ts} +22 -22
- package/dist/chart-DtgZBAas.js +2 -0
- package/dist/checkbox-Cu5cgZmk.js +1 -0
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/choice-CCVG2hb9.js +1 -0
- package/dist/{choice-BwfmbepO.d.ts → choice-CNiOSzqV.d.ts} +20 -20
- package/dist/choice.d.ts +1 -1
- package/dist/choice.js +1 -1
- package/dist/code-BPKNY1_w.js +1 -0
- package/dist/{code-block-BGdV4Yty.d.ts → code-block-BDw6MEwH.d.ts} +9 -9
- package/dist/{code-block-W3kWPxCJ.js → code-block-CKzsAMzj.js} +3 -3
- package/dist/code-block.d.ts +15 -17
- package/dist/code-block.js +1 -1
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +3 -3
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +15 -15
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +47 -47
- package/dist/command.js +1 -1
- package/dist/compose-refs-BdRUneoc.js +1 -0
- package/dist/{copy-to-clipboard-DInu78k_.js → copy-to-clipboard-Dd83caRw.js} +1 -1
- package/dist/cx.d.ts +4 -4
- package/dist/{data-slot-B-LqAcBB.d.ts → data-slot-BW8KQ9Xo.d.ts} +2 -2
- package/dist/data-table.d.ts +36 -36
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +1 -1
- package/dist/description-list.js +1 -1
- package/dist/{dialog-DD5H3EH1.d.ts → dialog-CIEuwNys.d.ts} +24 -8
- package/dist/{dialog-B9JAGy_x.d.ts → dialog-CbEEA0fl.d.ts} +7 -3
- package/dist/dialog-DmzoDfY3.js +1 -0
- package/dist/dialog.d.ts +2 -2
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-DmDxYPde.d.ts → dropdown-menu-CeY498yk.d.ts} +10 -10
- package/dist/dropdown-menu-uheL0prz.js +1 -0
- package/dist/dropdown-menu.d.ts +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +2 -2
- package/dist/empty.js +1 -1
- package/dist/field-Bpvn4tQp.js +1 -0
- package/dist/field-Cai_4c1l.js +1 -0
- package/dist/field.d.ts +41 -41
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +3 -3
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +30 -10
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +3 -3
- package/dist/hover-card.js +1 -1
- package/dist/{icon-CgNqu-fl.d.ts → icon--purqHRo.d.ts} +1 -1
- package/dist/{icon-NYvyyRMG.d.ts → icon-DuIYoyft.d.ts} +2 -2
- package/dist/{icon-DXDyhy2N.d.ts → icon-QCm1ui29.d.ts} +2 -2
- package/dist/icon-xb7d9M7X.js +1 -0
- package/dist/icon.d.ts +3 -3
- package/dist/icon.js +1 -1
- package/dist/icons-DEDCLZ8B.js +1 -0
- package/dist/icons-DXadFwpo.js +1 -0
- package/dist/icons-DcesO4Ng.js +1 -0
- package/dist/icons.d.ts +2 -2
- package/dist/icons.js +1 -1
- package/dist/{in-view-B3nMAzfE.d.ts → in-view-C_daNafg.d.ts} +4 -23
- package/dist/{input-q8o5uMhW.d.ts → input-DC4nW0Sr.d.ts} +1 -1
- package/dist/input-fW8QSZEO.js +1 -0
- package/dist/input.d.ts +4 -4
- package/dist/input.js +1 -1
- package/dist/kbd-P1nQshWo.js +1 -0
- package/dist/kbd.d.ts +5 -5
- package/dist/kbd.js +1 -1
- package/dist/label-DO1RlMKl.js +1 -0
- package/dist/{label-r2sJcSQ4.d.ts → label-epgtywRz.d.ts} +8 -8
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/layer-container-DL4yclOu.js +1 -0
- package/dist/layer-container.d.ts +2 -2
- package/dist/layer-container.js +1 -1
- package/dist/line-chart.d.ts +12 -12
- package/dist/line-chart.js +1 -1
- package/dist/list-cQZPSjfz.js +1 -0
- package/dist/list.d.ts +17 -17
- package/dist/list.js +1 -1
- package/dist/live-region-Dhapu8a5.js +1 -0
- package/dist/live-region.d.ts +1 -1
- package/dist/live-region.js +1 -1
- package/dist/llms.txt +23 -22
- package/dist/main-CHyWYDak.js +1 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.js +1 -1
- package/dist/mantle.css +25 -25
- package/dist/media-object.d.ts +4 -4
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +28 -28
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +3 -3
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +4 -4
- package/dist/pagination.js +1 -1
- package/dist/{popover-lwkwWcRW.d.ts → popover-Bei0jyfH.d.ts} +73 -7
- package/dist/popover-DhgunktK.js +1 -0
- package/dist/popover-T2EyaqGK.d.ts +1 -0
- package/dist/popover.d.ts +2 -2
- package/dist/popover.js +1 -1
- package/dist/primitive-D8CzV_Ft.js +1 -0
- package/dist/progress.d.ts +1 -1
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +3 -3
- package/dist/qr-code.js +1 -1
- package/dist/query-filter.d.ts +6 -6
- package/dist/query.d.ts +8 -3
- package/dist/query.js +1 -1
- package/dist/{radio-group-sLz5AA9I.d.ts → radio-group-BJQ6EOqh.d.ts} +1 -1
- package/dist/radio-group-BliblUqe.js +1 -0
- package/dist/radio-group-ggEkCi0V.js +1 -0
- package/dist/radio-group.d.ts +2 -2
- package/dist/radio-group.js +1 -1
- package/dist/sandbar.d.ts +30 -30
- package/dist/sandbar.js +1 -1
- package/dist/sandboxed-on-click-D4PL5_GR.js +1 -0
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/scatter-plot.d.ts +13 -14
- package/dist/scatter-plot.js +1 -1
- package/dist/segmented-control.d.ts +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/select-1xuUx_os.js +1 -0
- package/dist/{select-BqmpVJJT.d.ts → select-BpaXHxJm.d.ts} +6 -6
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +18 -18
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-QfH0ot5K.d.ts → separator-Ck4sPrdN.d.ts} +1 -1
- package/dist/separator-DnvhwY2J.js +1 -0
- package/dist/separator.d.ts +1 -1
- package/dist/separator.js +1 -1
- package/dist/{shake-DL6WhMXM.js → shake-CAUpKBHe.js} +1 -1
- package/dist/sheet-DHy_vlme.js +1 -0
- package/dist/sheet.d.ts +23 -7
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +37 -37
- package/dist/sidebar.js +1 -1
- package/dist/skeleton-DHfyjuQi.js +1 -0
- package/dist/skeleton.d.ts +4 -4
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +1 -1
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +1 -1
- package/dist/slider.js +1 -1
- package/dist/slot-B7rwscwd.js +1 -0
- package/dist/{slot-D12N_fZJ.d.ts → slot-BEMQMbk3.d.ts} +4 -4
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/source-all.css +5 -1
- package/dist/split-button.d.ts +9 -9
- package/dist/split-button.js +1 -1
- package/dist/strata.d.ts +22 -22
- package/dist/strata.js +1 -1
- package/dist/{suggestions-NkqYTT49.d.ts → suggestions-BJeGvwDa.d.ts} +7 -7
- package/dist/switch.d.ts +1 -1
- package/dist/switch.js +1 -1
- package/dist/table-BnLdXUai.js +1 -0
- package/dist/{table-rWiVWEgB.d.ts → table-Ii9hHUWN.d.ts} +5 -5
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +2 -2
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +1 -1
- package/dist/text-area.js +1 -1
- package/dist/theme-BNdZl352.js +1 -0
- package/dist/theme-switcher.d.ts +4 -4
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.d.ts +14 -12
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +2 -2
- package/dist/toast.js +1 -1
- package/dist/tokens.dark.json +3261 -0
- package/dist/tokens.json +4933 -0
- package/dist/tokens.resolver.json +37 -0
- package/dist/{tooltip-CpK3XTor.d.ts → tooltip-CstGDKwy.d.ts} +4 -4
- package/dist/tooltip-DQO40Mrq.js +1 -0
- package/dist/tooltip.d.ts +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/truncated-text.d.ts +1 -1
- package/dist/truncated-text.js +1 -1
- package/dist/use-breakpoint-B4Kh0xE6.js +1 -0
- package/dist/use-callback-ref-DiOXFQzM.js +1 -0
- package/dist/use-composed-refs-DPYmLDSe.js +1 -0
- package/dist/use-copy-to-clipboard-hBL6_65i.js +1 -0
- package/dist/use-inert-siblings-C4RHXrZc.js +1 -0
- package/dist/use-is-apple-platform-Bq6_KbVX.js +1 -0
- package/dist/use-is-hydrated-BeLOGKwE.js +1 -0
- package/dist/use-is-hydrated-after-paint-CrHt3OHw.js +1 -0
- package/dist/use-isomorphic-layout-effect-CL6iq0Bj.js +1 -0
- package/dist/use-matches-media-query-FfvtNKQe.js +1 -0
- package/dist/use-prefers-reduced-motion-Ck6dnOM9.js +1 -0
- package/dist/use-swipe-to-dismiss-BYdlca8r.js +1 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/visually-hidden.d.ts +1 -1
- package/dist/visually-hidden.js +1 -1
- package/dist/well.d.ts +1 -1
- package/dist/well.js +1 -1
- package/package.json +16 -2
- package/dist/alert-CH99Rw-R.js +0 -1
- package/dist/anchor-CgcbWEUs.js +0 -1
- package/dist/browser-only-BTSrYWLj.js +0 -1
- package/dist/button-69InNC_m.js +0 -1
- package/dist/button-BWGUuWnu.js +0 -1
- package/dist/button-Cu9e3SM7.js +0 -1
- package/dist/chart-DudCw24t.js +0 -2
- package/dist/checkbox-CS504fKk.js +0 -1
- package/dist/choice-uyYccm0A.js +0 -1
- package/dist/code-DUJzSl4K.js +0 -1
- package/dist/compose-refs-sFdxsL7k.js +0 -1
- package/dist/dialog-CsugEt2A.js +0 -1
- package/dist/dropdown-menu-DHdgaw4P.js +0 -1
- package/dist/field-Bihblt8U.js +0 -1
- package/dist/field-CPvjazWN.js +0 -1
- package/dist/icon-kK0c-POG.js +0 -1
- package/dist/icons-4JA-SGfv.js +0 -1
- package/dist/icons-CDLz5lpI.js +0 -1
- package/dist/icons-CSwTVV2m.js +0 -1
- package/dist/input-DHovzBjS.js +0 -1
- package/dist/kbd-CLHsJ99p.js +0 -1
- package/dist/label-DmDwzPD8.js +0 -1
- package/dist/layer-container-kEQiE4zV.js +0 -1
- package/dist/list-CO_yLdln.js +0 -1
- package/dist/live-region-DQ1QLv3L.js +0 -1
- package/dist/main-CC1L9IsH.js +0 -1
- package/dist/popover-BhTFutCz.d.ts +0 -1
- package/dist/popover-DxOqLKxy.js +0 -1
- package/dist/primitive-Dz9Al-us.js +0 -1
- package/dist/radio-group-HDVxTNPi.js +0 -1
- package/dist/radio-group-jj2abc0t.js +0 -1
- package/dist/sandboxed-on-click-C7pPu-2M.js +0 -1
- package/dist/select-C6Su0dU0.js +0 -1
- package/dist/separator-DfzxVutO.js +0 -1
- package/dist/sheet-Bd2LIhzF.js +0 -1
- package/dist/skeleton-DBpI-ko5.js +0 -1
- package/dist/slot-DdYN1L1C.js +0 -1
- package/dist/table-CFHiDBW8.js +0 -1
- package/dist/theme-DdZgLvKH.js +0 -1
- package/dist/tooltip-b6oiTaWq.js +0 -1
- package/dist/use-breakpoint--mo7kr9d.js +0 -1
- package/dist/use-callback-ref-BvVyI5K1.js +0 -1
- package/dist/use-copy-to-clipboard-Dy_0Qzb7.js +0 -1
- package/dist/use-inert-siblings-CNmNuS2h.js +0 -1
- package/dist/use-is-apple-platform-D4nifHMx.js +0 -1
- package/dist/use-is-hydrated-after-paint-r9Cl2mGp.js +0 -1
- package/dist/use-isomorphic-layout-effect-CLSmHzo4.js +0 -1
- package/dist/use-matches-media-query-m860lols.js +0 -1
- package/dist/use-prefers-reduced-motion-CU6mWmOe.js +0 -1
- package/dist/use-swipe-to-dismiss-i__cTF2v.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{t as e}from"./cx-CK7o_rVv.js";import{i as t,s as n}from"./layer-container-DL4yclOu.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as i}from"./icon-xb7d9M7X.js";import{n as a}from"./separator-DnvhwY2J.js";import{c as o}from"react/compiler-runtime";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{Slottable as l}from"@radix-ui/react-slot";import{CheckIcon as u}from"@phosphor-icons/react/Check";import{CaretRightIcon as d}from"@phosphor-icons/react/CaretRight";import{CheckboxItem as f,Content as p,Group as m,Item as h,ItemIndicator as g,Label as _,Portal as v,RadioGroup as y,RadioItem as b,Root as x,Sub as S,SubContent as C,SubTrigger as w,Trigger as T}from"@radix-ui/react-dropdown-menu";const E=x,D=e=>{let t=o(8),n,i;t[0]===e?(n=t[1],i=t[2]):({"data-slot":n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let a;t[3]===n?a=t[4]:(a=r(n,`dropdown-menu-trigger`),t[3]=n,t[4]=a);let c;return t[5]!==i||t[6]!==a?(c=/* @__PURE__ */ s(T,{"data-slot":a,...i}),t[5]=i,t[6]=a,t[7]=c):c=t[7],c},O=t=>{let n=o(12),i,a,c;n[0]===t?(i=n[1],a=n[2],c=n[3]):({"data-slot":a,className:i,...c}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=c);let l;n[4]===a?l=n[5]:(l=r(a,`dropdown-menu-group`),n[4]=a,n[5]=l);let u;n[6]===i?u=n[7]:(u=e(`space-y-px`,i),n[6]=i,n[7]=u);let d;return n[8]!==c||n[9]!==l||n[10]!==u?(d=/* @__PURE__ */ s(m,{"data-slot":l,className:u,...c}),n[8]=c,n[9]=l,n[10]=u,n[11]=d):d=n[11],d},k=e=>{let t=o(6),r,i;t[0]===e?(r=t[1],i=t[2]):({container:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a=n(),c=r??a,l;return t[3]!==i||t[4]!==c?(l=/* @__PURE__ */ s(v,{container:c,...i}),t[3]=i,t[4]=c,t[5]=l):l=t[5],l},A={Root:E,CheckboxItem:t=>{let n=o(19),a,d,p,m,h;n[0]===t?(a=n[1],d=n[2],p=n[3],m=n[4],h=n[5]):({"data-slot":m,className:p,children:d,checked:a,...h}=t,n[0]=t,n[1]=a,n[2]=d,n[3]=p,n[4]=m,n[5]=h);let _;n[6]===m?_=n[7]:(_=r(m,`dropdown-menu-checkbox-item`),n[6]=m,n[7]=_);let v;n[8]===p?v=n[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),n[8]=p,n[9]=v);let y;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=/* @__PURE__ */ s(`span`,{className:`absolute right-2 flex items-center`,children:/* @__PURE__ */ s(g,{children:/* @__PURE__ */ s(i,{svg:/* @__PURE__ */ s(u,{weight:`bold`}),className:`size-4 text-accent-600`})})}),n[10]=y):y=n[10];let b;n[11]===d?b=n[12]:(b=/* @__PURE__ */ s(l,{child:d,children:M}),n[11]=d,n[12]=b);let x;return n[13]!==a||n[14]!==h||n[15]!==_||n[16]!==v||n[17]!==b?(x=/* @__PURE__ */ c(f,{"data-slot":_,className:v,checked:a,...h,children:[y,b]}),n[13]=a,n[14]=h,n[15]=_,n[16]=v,n[17]=b,n[18]=x):x=n[18],x},Content:n=>{let i=o(22),a,c,l,u,d,f,m;i[0]===n?(a=i[1],c=i[2],l=i[3],u=i[4],d=i[5],f=i[6],m=i[7]):({className:a,"data-slot":c,onClick:l,onEscapeKeyDown:u,loop:f,width:m,...d}=n,i[0]=n,i[1]=a,i[2]=c,i[3]=l,i[4]=u,i[5]=d,i[6]=f,i[7]=m);let h=f===void 0||f,g=t(u),_;i[8]===c?_=i[9]:(_=r(c,`dropdown-menu-content`),i[8]=c,i[9]=_);let v=m===`trigger`&&`w-(--radix-dropdown-menu-trigger-width)`,y;i[10]!==a||i[11]!==v?(y=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`,v,a),i[10]=a,i[11]=v,i[12]=y):y=i[12];let b;i[13]===l?b=i[14]:(b=e=>{e.stopPropagation(),l?.(e)},i[13]=l,i[14]=b);let x;return i[15]!==g||i[16]!==h||i[17]!==d||i[18]!==_||i[19]!==y||i[20]!==b?(x=/* @__PURE__ */ s(k,{children:/* @__PURE__ */ s(p,{"data-slot":_,className:y,loop:h,onClick:b,onEscapeKeyDown:g,...d})}),i[15]=g,i[16]=h,i[17]=d,i[18]=_,i[19]=y,i[20]=b,i[21]=x):x=i[21],x},Group:O,Item:t=>{let n=o(14),i,a,c,l;n[0]===t?(i=n[1],a=n[2],c=n[3],l=n[4]):({"data-slot":a,className:i,inset:c,...l}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=c,n[4]=l);let u;n[5]===a?u=n[6]:(u=r(a,`dropdown-menu-item`),n[5]=a,n[6]=u);let d=c&&`pl-8`,f;n[7]!==i||n[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),n[7]=i,n[8]=d,n[9]=f):f=n[9];let p;return n[10]!==l||n[11]!==u||n[12]!==f?(p=/* @__PURE__ */ s(h,{"data-slot":u,className:f,...l}),n[10]=l,n[11]=u,n[12]=f,n[13]=p):p=n[13],p},Label:t=>{let n=o(14),i,a,c,l;n[0]===t?(i=n[1],a=n[2],c=n[3],l=n[4]):({"data-slot":a,className:i,inset:c,...l}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=c,n[4]=l);let u;n[5]===a?u=n[6]:(u=r(a,`dropdown-menu-label`),n[5]=a,n[6]=u);let d=c&&`pl-8`,f;n[7]!==i||n[8]!==d?(f=e(`px-2 py-1.5 text-sm font-medium`,d,i),n[7]=i,n[8]=d,n[9]=f):f=n[9];let p;return n[10]!==l||n[11]!==u||n[12]!==f?(p=/* @__PURE__ */ s(_,{"data-slot":u,className:f,...l}),n[10]=l,n[11]=u,n[12]=f,n[13]=p):p=n[13],p},RadioGroup:t=>{let n=o(12),i,a,c;n[0]===t?(i=n[1],a=n[2],c=n[3]):({"data-slot":a,className:i,...c}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=c);let l;n[4]===a?l=n[5]:(l=r(a,`dropdown-menu-radio-group`),n[4]=a,n[5]=l);let u;n[6]===i?u=n[7]:(u=e(`space-y-px`,i),n[6]=i,n[7]=u);let d;return n[8]!==c||n[9]!==l||n[10]!==u?(d=/* @__PURE__ */ s(y,{"data-slot":l,className:u,...c}),n[8]=c,n[9]=l,n[10]=u,n[11]=d):d=n[11],d},RadioItem:t=>{let n=o(17),a,d,f,p;n[0]===t?(a=n[1],d=n[2],f=n[3],p=n[4]):({"data-slot":f,className:d,children:a,...p}=t,n[0]=t,n[1]=a,n[2]=d,n[3]=f,n[4]=p);let m;n[5]===f?m=n[6]:(m=r(f,`dropdown-menu-radio-item`),n[5]=f,n[6]=m);let h;n[7]===d?h=n[8]:(h=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),n[7]=d,n[8]=h);let _;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=/* @__PURE__ */ s(`span`,{className:`absolute right-2 items-center hidden group-aria-checked/dropdown-menu-radio-item:flex`,children:/* @__PURE__ */ s(g,{children:/* @__PURE__ */ s(i,{svg:/* @__PURE__ */ s(u,{weight:`bold`}),className:`size-4 text-accent-600`})})}),n[9]=_):_=n[9];let v;n[10]===a?v=n[11]:(v=/* @__PURE__ */ s(l,{child:a,children:N}),n[10]=a,n[11]=v);let y;return n[12]!==p||n[13]!==m||n[14]!==h||n[15]!==v?(y=/* @__PURE__ */ c(b,{"data-slot":m,className:h,...p,children:[_,v]}),n[12]=p,n[13]=m,n[14]=h,n[15]=v,n[16]=y):y=n[16],y},Separator:t=>{let n=o(12),i,c,l;n[0]===t?(i=n[1],c=n[2],l=n[3]):({"data-slot":c,className:i,...l}=t,n[0]=t,n[1]=i,n[2]=c,n[3]=l);let u;n[4]===c?u=n[5]:(u=r(c,`dropdown-menu-separator`),n[4]=c,n[5]=u);let d;n[6]===i?d=n[7]:(d=e(`-mx-1.25 my-1 w-auto`,i),n[6]=i,n[7]=d);let f;return n[8]!==l||n[9]!==u||n[10]!==d?(f=/* @__PURE__ */ s(a,{"data-slot":u,className:d,...l}),n[8]=l,n[9]=u,n[10]=d,n[11]=f):f=n[11],f},Shortcut:t=>{let n=o(12),i,a,c;n[0]===t?(i=n[1],a=n[2],c=n[3]):({"data-slot":a,className:i,...c}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=c);let l;n[4]===a?l=n[5]:(l=r(a,`dropdown-menu-shortcut`),n[4]=a,n[5]=l);let u;n[6]===i?u=n[7]:(u=e(`ml-auto text-xs tracking-widest opacity-60`,i),n[6]=i,n[7]=u);let d;return n[8]!==c||n[9]!==l||n[10]!==u?(d=/* @__PURE__ */ s(`span`,{"data-slot":l,className:u,...c,translate:`no`}),n[8]=c,n[9]=l,n[10]=u,n[11]=d):d=n[11],d},Sub:S,SubContent:n=>{let i=o(16),a,c,l,u,d;i[0]===n?(a=i[1],c=i[2],l=i[3],u=i[4],d=i[5]):({"data-slot":c,className:a,loop:d,onEscapeKeyDown:l,...u}=n,i[0]=n,i[1]=a,i[2]=c,i[3]=l,i[4]=u,i[5]=d);let f=d===void 0||d,p=t(l),m;i[6]===c?m=i[7]:(m=r(c,`dropdown-menu-sub-content`),i[6]=c,i[7]=m);let h;i[8]===a?h=i[9]:(h=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`,a),i[8]=a,i[9]=h);let g;return i[10]!==p||i[11]!==f||i[12]!==u||i[13]!==m||i[14]!==h?(g=/* @__PURE__ */ s(k,{children:/* @__PURE__ */ s(C,{"data-slot":m,className:h,loop:f,onEscapeKeyDown:p,...u})}),i[10]=p,i[11]=f,i[12]=u,i[13]=m,i[14]=h,i[15]=g):g=i[15],g},SubTrigger:t=>{let n=o(19),a,u,f,p,m;n[0]===t?(a=n[1],u=n[2],f=n[3],p=n[4],m=n[5]):({"data-slot":f,className:u,inset:p,children:a,...m}=t,n[0]=t,n[1]=a,n[2]=u,n[3]=f,n[4]=p,n[5]=m);let h;n[6]===f?h=n[7]:(h=r(f,`dropdown-menu-sub-trigger`),n[6]=f,n[7]=h);let g=p&&`pl-8`,_;n[8]!==u||n[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,u),n[8]=u,n[9]=g,n[10]=_):_=n[10];let v;n[11]===a?v=n[12]:(v=/* @__PURE__ */ s(l,{child:a,children:j}),n[11]=a,n[12]=v);let y;n[13]===Symbol.for(`react.memo_cache_sentinel`)?(y=/* @__PURE__ */ s(`span`,{className:`absolute right-2 flex items-center`,children:/* @__PURE__ */ s(i,{svg:/* @__PURE__ */ s(d,{weight:`bold`}),className:`size-4`})}),n[13]=y):y=n[13];let b;return n[14]!==m||n[15]!==h||n[16]!==_||n[17]!==v?(b=/* @__PURE__ */ c(w,{"data-slot":h,className:_,...m,children:[v,y]}),n[14]=m,n[15]=h,n[16]=_,n[17]=v,n[18]=b):b=n[18],b},Trigger:D};function j(e){return/* @__PURE__ */ s(`span`,{"data-slot":`dropdown-menu-sub-trigger-label`,className:`contents`,children:e})}function M(e){return/* @__PURE__ */ s(`span`,{"data-slot":`dropdown-menu-checkbox-item-label`,className:`contents`,children:e})}function N(e){return/* @__PURE__ */ s(`span`,{"data-slot":`dropdown-menu-radio-item-label`,className:`contents`,children:e})}export{A as t};
|
package/dist/dropdown-menu.d.ts
CHANGED
package/dist/dropdown-menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as DropdownMenu}from"./dropdown-menu-
|
|
1
|
+
export{t as DropdownMenu}from"./dropdown-menu-uheL0prz.js";
|
package/dist/empty.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @see https://mantle.ngrok.com/components/feedback/empty
|
|
5
5
|
*/
|
|
6
6
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
7
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
8
|
-
import { t as SvgAttributes } from "./icon
|
|
7
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
8
|
+
import { t as SvgAttributes } from "./icon--purqHRo.js";
|
|
9
9
|
import { ComponentProps, ReactNode } from "react";
|
|
10
10
|
/**
|
|
11
11
|
* The root container for an empty state. Centers content horizontally
|
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-
|
|
1
|
+
"use client";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-B7rwscwd.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{createContext as e,createElement as t,useContext as n}from"react";const r=e(void 0),i=({children:e,validation:n})=>t(r.Provider,{value:n},e),a=()=>n(r),o=e=>e!=null&&e!==!1&&e!==`false`,s=e=>(typeof e==`function`?e():e)||void 0,c=({validation:e,defaultAriaInvalid:t})=>e===`error`||!t&&void 0,l=({"aria-invalid":e,defaultAriaInvalid:t=!0,validation:n})=>{let r=o(e)?`error`:s(n),i=e??c({validation:r,defaultAriaInvalid:t});return{isInvalid:o(i),ariaInvalid:i,validation:r}};export{a,s as i,o as n,l as r,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{r as e}from"./field-Bpvn4tQp.js";import{createContext as t}from"react";const n=t(null),r=t(null),i=({context:t})=>{if(!t)return{ariaProps:{},validation:void 0};let n=e({defaultAriaInvalid:!1,validation:t.validation});return{ariaProps:{"aria-describedby":`${t.descriptionId} ${t.errorId}`,"aria-errormessage":n.isInvalid?t.errorId:void 0,"aria-invalid":n.ariaInvalid,id:t.controlId,name:t.name},validation:n.validation}};export{n,i as r,r as t};
|
package/dist/field.d.ts
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* @see https://mantle.ngrok.com/components/forms/field
|
|
5
5
|
*/
|
|
6
6
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
7
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
8
|
-
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance } from "./button-
|
|
9
|
-
import { t as Label } from "./label-
|
|
10
|
-
import "./popover-
|
|
11
|
-
import { t as Slot } from "./slot-
|
|
12
|
-
import { t as Popover } from "./popover-
|
|
7
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
8
|
+
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance } from "./button-DnYv7IOT.js";
|
|
9
|
+
import { t as Label } from "./label-epgtywRz.js";
|
|
10
|
+
import "./popover-T2EyaqGK.js";
|
|
11
|
+
import { t as Slot } from "./slot-BEMQMbk3.js";
|
|
12
|
+
import { t as Popover } from "./popover-Bei0jyfH.js";
|
|
13
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";
|
|
14
14
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
15
15
|
/**
|
|
@@ -53,7 +53,7 @@ type FieldErrorMessage = string | null | undefined | false;
|
|
|
53
53
|
* `Field.Legend` and `Field.Group`. Always renders a real `<fieldset>` so
|
|
54
54
|
* the grouping semantics cannot be accidentally removed.
|
|
55
55
|
*
|
|
56
|
-
* Reach for `Field.Set` when the grouping carries semantic weight
|
|
56
|
+
* Reach for `Field.Set` when the grouping carries semantic weight: most
|
|
57
57
|
* commonly a `RadioGroup` (where the legend names the question the radios
|
|
58
58
|
* answer) or a set of related checkboxes. For laying out unrelated fields
|
|
59
59
|
* with consistent spacing, prefer `Field.Group` on its own.
|
|
@@ -79,7 +79,7 @@ declare const FieldSet: ({ "data-slot": dataSlot, className, ref, ...props }: Co
|
|
|
79
79
|
* (e.g. "Notification frequency, group, Daily").
|
|
80
80
|
*
|
|
81
81
|
* **Spacing.** Has a default `mb-1.5` so the legend sits 6px above the next
|
|
82
|
-
* sibling
|
|
82
|
+
* sibling, as in the figma. We use a margin (not the parent `Field.Set`'s
|
|
83
83
|
* flex `gap`) because `<legend>` has special browser rendering inside a
|
|
84
84
|
* `<fieldset>` that ignores the parent's flex `gap`. Override the default
|
|
85
85
|
* with any `mb-*` utility on `Field.Legend`.
|
|
@@ -97,7 +97,7 @@ declare const FieldSet: ({ "data-slot": dataSlot, className, ref, ...props }: Co
|
|
|
97
97
|
* </Field.Set>
|
|
98
98
|
* ```
|
|
99
99
|
*/
|
|
100
|
-
declare const Legend: ({ className, ref, ...props }: ComponentProps<"legend">) => import("react").JSX.Element;
|
|
100
|
+
declare const Legend: ({ className, "data-slot": dataSlot, ref, ...props }: ComponentProps<"legend"> & WithDataSlot) => import("react").JSX.Element;
|
|
101
101
|
/**
|
|
102
102
|
* Props for `Field.Label`: the Mantle `Label` props without `htmlFor`.
|
|
103
103
|
*/
|
|
@@ -145,7 +145,7 @@ type FieldLabelProps = Omit<ComponentProps<typeof Label>, "htmlFor">;
|
|
|
145
145
|
* </Field.Item>
|
|
146
146
|
* ```
|
|
147
147
|
*/
|
|
148
|
-
declare const FieldLabel: ({ ref, ...props }: FieldLabelProps) => import("react").JSX.Element;
|
|
148
|
+
declare const FieldLabel: ({ "data-slot": dataSlot, ref, ...props }: FieldLabelProps) => import("react").JSX.Element;
|
|
149
149
|
/**
|
|
150
150
|
* Static, label-styled text for a `Field.Item` row that does **not** caption a
|
|
151
151
|
* focusable form control. Renders a `<p>` (not a `<label>`) with the same
|
|
@@ -160,15 +160,15 @@ declare const FieldLabel: ({ ref, ...props }: FieldLabelProps) => import("react"
|
|
|
160
160
|
* - Read-only summary rows inside a sheet or detail panel that should
|
|
161
161
|
* visually align with sibling `Field.Item`s but have no editable control.
|
|
162
162
|
* - Anywhere you would otherwise hand-roll a `<p>` styled to mimic
|
|
163
|
-
* `Field.Label` typography
|
|
163
|
+
* `Field.Label` typography. Prefer this so intent is explicit at the call site.
|
|
164
164
|
*
|
|
165
165
|
* **When not to use**
|
|
166
166
|
* - The row has a focusable control (input, select, checkbox, switch,
|
|
167
167
|
* button trigger). Use `Field.Label` so the click-to-focus and
|
|
168
168
|
* accessible-name association are wired correctly.
|
|
169
169
|
* - For body copy, section headings, or any text whose typography happens
|
|
170
|
-
* to look similar by accident
|
|
171
|
-
* directly. `Field.LabelText` exists specifically to slot into the
|
|
170
|
+
* to look similar by accident. Use the appropriate heading or `<p>`
|
|
171
|
+
* directly instead. `Field.LabelText` exists specifically to slot into the
|
|
172
172
|
* `Field.Label` position of a `Field.Item`.
|
|
173
173
|
*
|
|
174
174
|
* @see https://mantle.ngrok.com/components/forms/field
|
|
@@ -187,15 +187,15 @@ declare const LabelText: ({ "data-slot": dataSlot, asChild, className, ref, ...p
|
|
|
187
187
|
* Horizontal layout container for the label area of a field. Aligns a
|
|
188
188
|
* `<Field.Label>` (which may contain `Field.Optional`) with adjacent affordances
|
|
189
189
|
* like a help-icon `Popover.Trigger` on a shared center line with a tight
|
|
190
|
-
* `gap-1`. Center-alignment is used (not baseline) so SVG icon buttons
|
|
191
|
-
* which have no text baseline
|
|
190
|
+
* `gap-1`. Center-alignment is used (not baseline) so SVG icon buttons,
|
|
191
|
+
* which have no text baseline, sit visually centered next to the label
|
|
192
192
|
* text rather than dropping to the box bottom.
|
|
193
193
|
*
|
|
194
194
|
* Use this when the label needs sibling decorations that can't live inside
|
|
195
|
-
* the `<Field.Label>` itself (e.g. an interactive help button
|
|
195
|
+
* the `<Field.Label>` itself (e.g. an interactive help button: clicking inside a
|
|
196
196
|
* `<label>` would forward focus to the associated control). For a label
|
|
197
197
|
* with only an `(Optional)` suffix, place `Field.Optional` directly inside
|
|
198
|
-
* the `<Field.Label>` instead
|
|
198
|
+
* the `<Field.Label>` instead, with no `LabelRow`.
|
|
199
199
|
*
|
|
200
200
|
* @see https://mantle.ngrok.com/components/forms/field
|
|
201
201
|
*
|
|
@@ -228,9 +228,9 @@ declare const LabelRow: ({ "data-slot": dataSlot, asChild, className, ref, ...pr
|
|
|
228
228
|
*/
|
|
229
229
|
type FieldHelpTriggerProps = Partial<Omit<IconButtonProps, "appearance" | "icon" | "intent" | "label">> & Pick<IconButtonProps, "label"> & {
|
|
230
230
|
/**
|
|
231
|
-
* The visual style of the trigger button. Optional here
|
|
232
|
-
*
|
|
233
|
-
*
|
|
231
|
+
* The visual style of the trigger button. Optional here: `Field.HelpTrigger`
|
|
232
|
+
* defaults to `"ghost"` so the help affordance reads as subtle metadata
|
|
233
|
+
* next to the label.
|
|
234
234
|
*
|
|
235
235
|
* @default "ghost"
|
|
236
236
|
*/
|
|
@@ -241,7 +241,7 @@ type FieldHelpTriggerProps = Partial<Omit<IconButtonProps, "appearance" | "icon"
|
|
|
241
241
|
*/
|
|
242
242
|
icon?: ReactNode;
|
|
243
243
|
/**
|
|
244
|
-
* The tone of the trigger button. Optional here
|
|
244
|
+
* The tone of the trigger button. Optional here: `Field.HelpTrigger`
|
|
245
245
|
* defaults to `"neutral"` because opening contextual help is a routine
|
|
246
246
|
* action, and it is the only tone `IconButton` draws.
|
|
247
247
|
*
|
|
@@ -250,7 +250,7 @@ type FieldHelpTriggerProps = Partial<Omit<IconButtonProps, "appearance" | "icon"
|
|
|
250
250
|
intent?: IconButtonIntent;
|
|
251
251
|
};
|
|
252
252
|
/**
|
|
253
|
-
* The trigger for a `Field.Help` popover
|
|
253
|
+
* The trigger for a `Field.Help` popover: a `Popover.Trigger` wired to a
|
|
254
254
|
* ghost-appearance `IconButton` with a default Phosphor `QuestionIcon`.
|
|
255
255
|
* Requires a contextual screen-reader label, and accepts `icon` or other
|
|
256
256
|
* `IconButton` props for visual customization.
|
|
@@ -259,7 +259,7 @@ type FieldHelpTriggerProps = Partial<Omit<IconButtonProps, "appearance" | "icon"
|
|
|
259
259
|
* subtle metadata at rest; `IconButton`'s ghost `hover:text-strong` still
|
|
260
260
|
* brightens it on interaction. Carries a default `-my-0.5` so the 24px
|
|
261
261
|
* `xs` button keeps a full click target while contributing only 20px to
|
|
262
|
-
* the `Field.LabelRow` flex line
|
|
262
|
+
* the `Field.LabelRow` flex line. That matches the label's text line-height,
|
|
263
263
|
* so the label text is not pushed off-center.
|
|
264
264
|
*
|
|
265
265
|
* @see https://mantle.ngrok.com/components/forms/field
|
|
@@ -286,7 +286,7 @@ type FieldHelpTriggerProps = Partial<Omit<IconButtonProps, "appearance" | "icon"
|
|
|
286
286
|
* </Field.Group>
|
|
287
287
|
* ```
|
|
288
288
|
*/
|
|
289
|
-
declare const HelpTrigger: ({ appearance, className, icon, intent, label, ref, size, type, ...props }: FieldHelpTriggerProps) => import("react").JSX.Element;
|
|
289
|
+
declare const HelpTrigger: ({ appearance, className, "data-slot": dataSlot, icon, intent, label, ref, size, type, ...props }: FieldHelpTriggerProps) => import("react").JSX.Element;
|
|
290
290
|
/**
|
|
291
291
|
* The popover body for a `Field.Help`. Wraps `Popover.Content` so all
|
|
292
292
|
* positioning / sizing options (`side`, `align`, `preferredWidth`, etc.)
|
|
@@ -322,7 +322,7 @@ declare const HelpContent: ({ "data-slot": dataSlot, ref, ...props }: ComponentP
|
|
|
322
322
|
/**
|
|
323
323
|
* Inline "(Optional)" suffix to mark a field as optional. Defaults to the
|
|
324
324
|
* literal string `(Optional)` so the common case is `<Field.Optional />` with
|
|
325
|
-
* no children
|
|
325
|
+
* no children. Pass children to translate or replace the text. Renders a
|
|
326
326
|
* `<span>` in `text-muted` at `text-sm` / `font-normal` so it reads as
|
|
327
327
|
* secondary metadata next to the bolder Label text.
|
|
328
328
|
*
|
|
@@ -357,8 +357,8 @@ declare const HelpContent: ({ "data-slot": dataSlot, ref, ...props }: ComponentP
|
|
|
357
357
|
declare const Optional: ({ "data-slot": dataSlot, asChild, children, className, ref, ...props }: ComponentProps<"span"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
358
358
|
/**
|
|
359
359
|
* Layout container that stacks multiple `Field.Item`s vertically with
|
|
360
|
-
* `gap-4` between them. This is the default way to compose multiple fields
|
|
361
|
-
*
|
|
360
|
+
* `gap-4` between them. This is the default way to compose multiple fields:
|
|
361
|
+
* most forms only need a `Field.Group` of `Field.Item`s. Reach for
|
|
362
362
|
* `Field.Set` + `Field.Legend` only when the grouping carries semantic
|
|
363
363
|
* weight (e.g. a `RadioGroup` or related checkboxes).
|
|
364
364
|
*
|
|
@@ -407,12 +407,12 @@ type FieldItemProps = Omit<ComponentProps<"div">, "id"> & WithAsChild & WithVali
|
|
|
407
407
|
name: string;
|
|
408
408
|
} & WithDataSlot;
|
|
409
409
|
/**
|
|
410
|
-
* A single form field
|
|
410
|
+
* A single form field: `Label`, a control (`Input`, `Select`, `Checkbox`,
|
|
411
411
|
* etc.), and any `Field.Description`, `Field.Errors`, or `Field.ErrorList` siblings stacked
|
|
412
412
|
* vertically with a consistent `gap-1.5` so help and error messaging sit
|
|
413
413
|
* tightly under the input.
|
|
414
414
|
*
|
|
415
|
-
* Renders a plain `<div
|
|
415
|
+
* Renders a plain `<div>`: the `<label htmlFor>` ↔ control association
|
|
416
416
|
* already carries the right semantics for a single field, so it adds no
|
|
417
417
|
* implicit `role`. `Field.Item` owns the contextual description/error IDs
|
|
418
418
|
* that `Field.Control` applies to the focusable control. Rendered errors
|
|
@@ -466,7 +466,7 @@ declare const Item: ({ "data-slot": dataSlot, asChild, children, className, id:
|
|
|
466
466
|
type FieldControlSlotProps = Omit<ComponentProps<typeof Slot>, "aria-describedby" | "aria-errormessage" | "aria-invalid" | "children" | "id">;
|
|
467
467
|
/**
|
|
468
468
|
* Element-child form of `Field.Control`. Renders via `Slot`, so it accepts
|
|
469
|
-
* any HTML/Slot props, including `ref
|
|
469
|
+
* any HTML/Slot props, including `ref`. Those land on the single child
|
|
470
470
|
* element along with the generated ARIA props. `id` is not a prop here;
|
|
471
471
|
* `Field.Item` owns the control id.
|
|
472
472
|
*/
|
|
@@ -478,7 +478,7 @@ type FieldControlElementProps = FieldControlSlotProps & {
|
|
|
478
478
|
};
|
|
479
479
|
/**
|
|
480
480
|
* Render-prop form of `Field.Control`. The caller owns the rendered element,
|
|
481
|
-
* so `Field.Control` itself renders nothing
|
|
481
|
+
* so `Field.Control` itself renders nothing. Extra DOM props and `ref` have
|
|
482
482
|
* no element to attach to and are intentionally not part of this variant.
|
|
483
483
|
* Slot props are marked `never` so passing e.g. `className` alongside a
|
|
484
484
|
* render-prop child is a type error rather than a silently ignored prop.
|
|
@@ -495,24 +495,24 @@ type FieldControlRenderProps = {
|
|
|
495
495
|
* Props for `Field.Control`. A discriminated union over how the caller
|
|
496
496
|
* supplies the focusable element:
|
|
497
497
|
*
|
|
498
|
-
* - `FieldControlElementProps
|
|
498
|
+
* - `FieldControlElementProps`: pass a single React element child and
|
|
499
499
|
* `Field.Control` clones the generated ARIA props onto it via `Slot`.
|
|
500
500
|
* Accepts the full Slot prop surface, including `ref`.
|
|
501
|
-
* - `FieldControlRenderProps
|
|
501
|
+
* - `FieldControlRenderProps`: pass a render function that receives the
|
|
502
502
|
* ARIA props and places them on a control of the caller's choosing. The
|
|
503
503
|
* caller owns the rendered element, so DOM/Slot props and `ref` are
|
|
504
504
|
* excluded from this variant at the type level.
|
|
505
505
|
*
|
|
506
506
|
* @example
|
|
507
507
|
* ```tsx
|
|
508
|
-
* // Element form
|
|
508
|
+
* // Element form: Slot splats id, name, and ARIA props onto <Input/>
|
|
509
509
|
* <Field.Item name="email">
|
|
510
510
|
* <Field.Control>
|
|
511
511
|
* <Input type="email" />
|
|
512
512
|
* </Field.Control>
|
|
513
513
|
* </Field.Item>
|
|
514
514
|
*
|
|
515
|
-
* // Render-prop form
|
|
515
|
+
* // Render-prop form: caller spreads the props onto its own element
|
|
516
516
|
* <Field.Item name="acceptTerms">
|
|
517
517
|
* <Field.Control>
|
|
518
518
|
* {(controlProps) => (
|
|
@@ -535,7 +535,7 @@ type FieldControlProps = FieldControlElementProps | FieldControlRenderProps;
|
|
|
535
535
|
* composition; otherwise use the render-prop form to place the generated props
|
|
536
536
|
* on the actual focusable element.
|
|
537
537
|
*
|
|
538
|
-
* `Field.Item` owns the full control contract
|
|
538
|
+
* `Field.Item` owns the full control contract: `id`, `name`, `aria-*`, and
|
|
539
539
|
* `validation` all flow down from the surrounding `Field.Item` and overwrite
|
|
540
540
|
* anything passed on the child. To override these values, set them on
|
|
541
541
|
* `Field.Item` itself (`<Field.Item id="password">`,
|
|
@@ -580,7 +580,7 @@ declare const Control: ({ children, ref, ...props }: FieldControlProps) => impor
|
|
|
580
580
|
* `Field.Errors` or `Field.ErrorList` output, the parent's `gap-1.5`
|
|
581
581
|
* collapses via a matching negative top margin so error list + helper read as
|
|
582
582
|
* one tight block. Pass any margin utility (`mt-1`, `mt-0`, etc.) to override
|
|
583
|
-
*
|
|
583
|
+
* it. The rule's specificity is flattened to `(0,1,0)`, so a single user class wins.
|
|
584
584
|
*
|
|
585
585
|
* @see https://mantle.ngrok.com/components/forms/field
|
|
586
586
|
*
|
|
@@ -825,7 +825,7 @@ declare const Field: {
|
|
|
825
825
|
* Applies generated field ARIA props and validation state to a single
|
|
826
826
|
* focusable control. Accepts either a single React element child (cloned
|
|
827
827
|
* via `Slot`) or a render-prop child that receives the ARIA props for
|
|
828
|
-
* cases where `Slot` cannot reach the focusable element
|
|
828
|
+
* cases where `Slot` cannot reach the focusable element, for example a
|
|
829
829
|
* `<label>`-wrapped native checkbox, or a third-party component that
|
|
830
830
|
* needs the props placed manually on an inner input.
|
|
831
831
|
*
|
|
@@ -833,7 +833,7 @@ declare const Field: {
|
|
|
833
833
|
*
|
|
834
834
|
* @example
|
|
835
835
|
* ```tsx
|
|
836
|
-
* // Element child
|
|
836
|
+
* // Element child: Slot splats id, name, and ARIA props onto <Input/>.
|
|
837
837
|
* <Field.Item name="apiKey">
|
|
838
838
|
* <Field.Label>API key</Field.Label>
|
|
839
839
|
* <Field.Control>
|
|
@@ -845,7 +845,7 @@ declare const Field: {
|
|
|
845
845
|
*
|
|
846
846
|
* @example
|
|
847
847
|
* ```tsx
|
|
848
|
-
* // Render-prop child
|
|
848
|
+
* // Render-prop child: caller spreads the props onto an inner element
|
|
849
849
|
* // when the focusable target is nested (e.g. inside a <label>).
|
|
850
850
|
* <Field.Item name="acceptTerms">
|
|
851
851
|
* <Field.Control>
|
|
@@ -1040,7 +1040,7 @@ declare const Field: {
|
|
|
1040
1040
|
*/
|
|
1041
1041
|
readonly Help: import("react").FC<import("@radix-ui/react-popover").PopoverProps>;
|
|
1042
1042
|
/**
|
|
1043
|
-
* Trigger for a `Field.Help` popover
|
|
1043
|
+
* Trigger for a `Field.Help` popover: a ghost `IconButton` with a default
|
|
1044
1044
|
* `QuestionIcon`. Requires a contextual `label`; pass `icon` to swap the
|
|
1045
1045
|
* glyph, or other `IconButton` props (`size`, `appearance`, etc.) to customize.
|
|
1046
1046
|
*
|
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"./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};
|
|
1
|
+
"use client";import{t as e}from"./use-isomorphic-layout-effect-CL6iq0Bj.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./button-B9bChDgl.js";import{t as i}from"./label-DO1RlMKl.js";import{t as a}from"./popover-DhgunktK.js";import{t as o}from"./slot-B7rwscwd.js";import{n as s,r as c,t as l}from"./field-Cai_4c1l.js";import{i as u,n as d,r as f,t as p}from"./field-Bpvn4tQp.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 r=m(14),i,a,o,s;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4]):({className:i,"data-slot":a,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-legend`),r[5]=a,r[6]=c);let l;r[7]===i?l=r[8]:(l=t(`text-strong mb-1.5 text-sm font-medium font-sans`,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(`legend`,{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},A=e=>{let t=m(11),r,a,o;t[0]===e?(r=t[1],a=t[2],o=t[3]):({"data-slot":r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=o);let c=y(s),l;t[4]===r?l=t[5]:(l=n(r,`field-label`),t[4]=r,t[5]=l);let u=c?.controlId,d;return t[6]!==a||t[7]!==o||t[8]!==l||t[9]!==u?(d=/* @__PURE__ */ C(i,{ref:o,"data-slot":l,...a,htmlFor:u}),t[6]=a,t[7]=o,t[8]=l,t[9]=u,t[10]=d):d=t[10],d},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 i=m(28),o,s,c,l,u,d,f,p,h,g;i[0]===e?(o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],h=i[9],g=i[10]):({appearance:d,className:o,"data-slot":s,icon:f,intent:p,label:c,ref:u,size:h,type:g,...l}=e,i[0]=e,i[1]=o,i[2]=s,i[3]=c,i[4]=l,i[5]=u,i[6]=d,i[7]=f,i[8]=p,i[9]=h,i[10]=g);let _=d===void 0?`ghost`:d,v=f===void 0?P:f,y=p===void 0?`neutral`:p,b=h===void 0?`xs`:h,x=g===void 0?`button`:g,S;i[11]===s?S=i[12]:(S=n(s,`field-help-trigger`),i[11]=s,i[12]=S);let w;i[13]===o?w=i[14]:(w=t(`text-body -my-0.5`,o),i[13]=o,i[14]=w);let T;i[15]!==_||i[16]!==v||i[17]!==y||i[18]!==c||i[19]!==l||i[20]!==u||i[21]!==b||i[22]!==w||i[23]!==x?(T=/* @__PURE__ */ C(r,{ref:u,appearance:_,className:w,icon:v,intent:y,label:c,size:b,type:x,...l}),i[15]=_,i[16]=v,i[17]=y,i[18]=c,i[19]=l,i[20]=u,i[21]=b,i[22]=w,i[23]=x,i[24]=T):T=i[24];let E;return i[25]!==S||i[26]!==T?(E=/* @__PURE__ */ C(a.Trigger,{asChild:!0,"data-slot":S,children:T}),i[25]=S,i[26]=T,i[27]=E):E=i[27],E},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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/components/data-display/flag
|
|
5
5
|
*/
|
|
6
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
6
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
7
7
|
import { ComponentProps } from "react";
|
|
8
8
|
/** All valid values for a flag
|
|
9
9
|
* @see https://www.flagpack.xyz/docs/flag-index
|
|
@@ -52,8 +52,8 @@ type Props = Omit<ComponentProps<"div">, "children"> & {
|
|
|
52
52
|
* - Inside a select option, list row, or status pill that needs a quick visual cue.
|
|
53
53
|
*
|
|
54
54
|
* **When not to use**
|
|
55
|
-
* - As a stand-in for language. Flags
|
|
56
|
-
* not "Portugal", Spanish is not just "Spain". Use a language label instead.
|
|
55
|
+
* - As a stand-in for language. Flags are not languages: Brazilian Portuguese is
|
|
56
|
+
* not "Portugal", and Spanish is not just "Spain". Use a language label instead.
|
|
57
57
|
* - As decoration where the country isn't meaningful to the user.
|
|
58
58
|
*
|
|
59
59
|
* **Sizing.** `"s"` (16×12), `"m"` (20×15), and `"l"` (32×24, default) match
|
package/dist/flag.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{c as n}from"react/compiler-runtime";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";const o=a(``,{variants:{size:{s:`rounded-[0.0625rem]`,m:`rounded-[0.09375rem]`,l:`rounded-xs`}}}),s=a(``,{variants:{size:{s:`w-4 h-3`,m:`w-5 h-3.75`,l:`w-8 h-6`}}});function c(a){let c=n(31),l,u,d,f,p,m;c[0]===a?(l=c[1],u=c[2],d=c[3],f=c[4],p=c[5],m=c[6]):({"data-slot":d,className:l,code:u,size:p,loading:m,...f}=a,c[0]=a,c[1]=l,c[2]=u,c[3]=d,c[4]=f,c[5]=p,c[6]=m);let h=p===void 0?`l`:p,g=m===void 0?`lazy`:m,_,v,y,b,x;if(c[7]!==l||c[8]!==d||c[9]!==f||c[10]!==h){let n=o({size:h}),r=s({size:h});c[16]===d?y=c[17]:(y=t(d,`flag`),c[16]=d,c[17]=y),b=e(`flag relative overflow-hidden`,n,r,l),x=f,_=!0,v=e(`absolute inset-0 border border-[#000]/10`,n),c[7]=l,c[8]=d,c[9]=f,c[10]=h,c[11]=_,c[12]=v,c[13]=y,c[14]=b,c[15]=x}else _=c[11],v=c[12],y=c[13],b=c[14],x=c[15];let S;c[18]!==_||c[19]!==v?(S=/* @__PURE__ */ r(`div`,{"aria-hidden":_,className:v}),c[18]=_,c[19]=v,c[20]=S):S=c[20];let C=`https://assets.ngrok.com/flags/${h}/${u}.svg`,w=`flag for ${u}`,T;c[21]!==g||c[22]!==w||c[23]!==C?(T=/* @__PURE__ */ r(`img`,{className:`h-full w-full block object-cover`,src:C,alt:w,loading:g}),c[21]=g,c[22]=w,c[23]=C,c[24]=T):T=c[24];let E;return c[25]!==T||c[26]!==y||c[27]!==b||c[28]!==x||c[29]!==S?(E=/* @__PURE__ */ i(`div`,{"data-slot":y,className:b,...x,children:[S,T]}),c[25]=T,c[26]=y,c[27]=b,c[28]=x,c[29]=S,c[30]=E):E=c[30],E}const l=/* @__PURE__ */ `004.008.010.016.020.024.028.031.032.040.044.048.050.051.052.056.060.064.068.070.072.074.076.084.086.090.092.096.100.104.108.112.116.120.124.132.136.140.144.148.152.156.158.162.166.170.174.178.180.184.188.191.192.196.203.204.208.212.214.218.222.226.231.232.233.234.238.239.242.246.248.250.254.258.260.262.266.268.270.275.276.288.292.296.300.304.308.312.316.320.324.328.332.334.336.340.344.348.352.356.360.364.368.372.376.380.384.388.392.398.400.404.408.410.414.417.418.422.426.428.430.434.438.440.442.446.450.454.458.462.466.470.474.478.480.484.492.496.498.499.500.504.508.512.516.520.524.528.531.533.534.540.548.554.558.562.566.570.574.578.580.581.583.584.585.586.591.598.600.604.608.612.616.620.624.626.630.634.638.642.643.646.652.654.659.660.662.663.666.670.674.678.682.686.688.690.694.702.703.704.705.706.710.716.724.728.729.732.740.744.748.752.756.760.762.764.768.772.776.780.784.788.792.795.796.798.800.804.807.818.831.832.833.834.836.840.850.854.858.860.862.876.882.887.894.ABW.AD.AE.AF.AFG.AFRUN.AG.AGO.AI.AIA.AL.ALA.ALB.AM.AMS.AND.AO.AQ.AR.ARE.ARG.ARM.AS.ASM.AT.ATA.ATF.ATG.AU.AUS.AUT.AW.AX.AZ.AZE.BA.BB.BD.BDI.BE.BEL.BEN.BF.BFA.BG.BGD.BGR.BH.BHR.BHS.BI.BIH.BJ.BL.BLM.BLR.BLZ.BM.BMU.BN.BO.BOL.BQ-BO.BQ-SA.BQ-SE.BR.BRA.BRB.BRN.BS.BT.BTN.BV.BVT.BW.BWA.BY.BZ.CA.CAF.CAN.CC.CCK.CD.CF.CG.CH.CHE.CHL.CHN.CI.CIV.CK.CL.CM.CMR.CN.CO.COD.COG.COK.COL.COM.CPV.CR.CRI.CU.CUB.CUW.CV.CW.CX.CXR.CY.CYM.CYP.CZ.CZE.DE.DEU.DJ.DJI.DK.DM.DMA.DNK.DO.DOM.EC.ECU.EE.EG.EGY.EH.ER.ERI.ES.ESH.ESP.EST.ET.ETH.EU.FI.FIN.FJ.FJI.FK.FLK.FM.FO.FR.FRA.FRO.FSM.GA.GAB.GB-ENG.GB-NIR.GB-SCT.GB-UKM.GB-WLS.GB.GBR.GD.GE.GEO.GF.GG.GGY.GH.GHA.GI.GIB.GIN.GL.GLP.GM.GMB.GN.GNB.GNQ.GP.GQ.GR.GRC.GRD.GRL.GS.GT.GTM.GU.GUF.GUM.GUY.GW.GY.HK.HKG.HM.HMD.HN.HND.HR.HRV.HT.HTI.HU.HUN.ID.IDN.IE.IL.IM.IMN.IN.IND.IO.IOT.IQ.IR.IRL.IRN.IRQ.IS.ISL.ISR.IT.ITA.JAM.JE.JEY.JM.JO.JOR.JP.JPN.KAZ.KE.KEN.KG.KGZ.KH.KHM.KI.KIR.KM.KN-SK.KNA.KOR.KP.KR.KW.KWT.KY.KZ.LA.LAO.LB.LBN.LBR.LBY.LC.LCA.LI.LIE.LK.LKA.LR.LS.LSO.LT.LTU.LU.LUX.LV.LVA.LY.MA.MAC.MAF.MAR.MC.MCO.MD.MDA.MDG.MDV.ME.MEX.MF.MG.MH.MHL.MK.MKD.ML.MLI.MLT.MM.MMR.MN.MNE.MNG.MNP.MO.MOZ.MP.MQ.MR.MRT.MS.MSR.MT.MTQ.MU.MUS.MV.MW.MWI.MX.MY.MYS.MZ.NA.NAM.NC.NCL.NE.NER.NF.NFK.NG.NGA.NI.NIC.NIU.NL.NLD.NO.NOR.NP.NPL.NR.NRU.NU.NZ.NZL.OM.OMN.PA.PAK.PAN.PCN.PE.PER.PF.PG.PH.PHL.PK.PL.PLW.PM.PN.PNG.POL.PR.PRI.PRK.PRT.PRY.PS.PSE.PT.PW.PY.PYF.QA.QAT.RAINBOW.RE.REU.RO.ROU.RS.RU.RUS.RW.RWA.SA.SAU.SB.SC.SD.SDN.SE.SEN.SG.SGP.SGS.SH.SHN.SI.SJ.SJM.SK.SL.SLB.SLE.SLV.SM.SMR.SN.SO.SOM.SPM.SR.SRB.SS.SSD.ST.STP.SUR.SV.SVK.SVN.SWE.SWZ.SX.SXM.SY.SYC.SYR.SZ.TC.TCA.TCD.TD.TF.TG.TGO.TH.THA.TJ.TJK.TK.TKL.TKM.TL.TLS.TM.TN.TO.TON.TR.TT.TTO.TUN.TUR.TUV.TV.TW.TWN.TZ.TZA.UA.UG.UGA.UKR.UM.UMI.UNASUR.URY.US.USA.UY.UZ.UZB.VA.VAT.VC.VCT.VE.VEN.VG.VGB.VI.VIR.VN.VNM.VU.VUT.WF.WLF.WS.WSM.YE.YEM.ZA.ZAF.ZM.ZMB.ZW.ZWE`.split(`.`),u=new Set(l);function d(e){return typeof e==`string`&&u.has(e)}export{c as Flag,l as countryCodes,d as isCountryCode};
|
|
1
|
+
"use client";import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{c as n}from"react/compiler-runtime";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";const o=a(``,{variants:{size:{s:`rounded-[0.0625rem]`,m:`rounded-[0.09375rem]`,l:`rounded-xs`}}}),s=a(``,{variants:{size:{s:`w-4 h-3`,m:`w-5 h-3.75`,l:`w-8 h-6`}}});function c(a){let c=n(31),l,u,d,f,p,m;c[0]===a?(l=c[1],u=c[2],d=c[3],f=c[4],p=c[5],m=c[6]):({"data-slot":d,className:l,code:u,size:p,loading:m,...f}=a,c[0]=a,c[1]=l,c[2]=u,c[3]=d,c[4]=f,c[5]=p,c[6]=m);let h=p===void 0?`l`:p,g=m===void 0?`lazy`:m,_,v,y,b,x;if(c[7]!==l||c[8]!==d||c[9]!==f||c[10]!==h){let n=o({size:h}),r=s({size:h});c[16]===d?y=c[17]:(y=t(d,`flag`),c[16]=d,c[17]=y),b=e(`flag relative overflow-hidden`,n,r,l),x=f,_=!0,v=e(`absolute inset-0 border border-[#000]/10`,n),c[7]=l,c[8]=d,c[9]=f,c[10]=h,c[11]=_,c[12]=v,c[13]=y,c[14]=b,c[15]=x}else _=c[11],v=c[12],y=c[13],b=c[14],x=c[15];let S;c[18]!==_||c[19]!==v?(S=/* @__PURE__ */ r(`div`,{"aria-hidden":_,className:v}),c[18]=_,c[19]=v,c[20]=S):S=c[20];let C=`https://assets.ngrok.com/flags/${h}/${u}.svg`,w=`flag for ${u}`,T;c[21]!==g||c[22]!==w||c[23]!==C?(T=/* @__PURE__ */ r(`img`,{className:`h-full w-full block object-cover`,src:C,alt:w,loading:g}),c[21]=g,c[22]=w,c[23]=C,c[24]=T):T=c[24];let E;return c[25]!==T||c[26]!==y||c[27]!==b||c[28]!==x||c[29]!==S?(E=/* @__PURE__ */ i(`div`,{"data-slot":y,className:b,...x,children:[S,T]}),c[25]=T,c[26]=y,c[27]=b,c[28]=x,c[29]=S,c[30]=E):E=c[30],E}const l=/* @__PURE__ */ `004.008.010.016.020.024.028.031.032.040.044.048.050.051.052.056.060.064.068.070.072.074.076.084.086.090.092.096.100.104.108.112.116.120.124.132.136.140.144.148.152.156.158.162.166.170.174.178.180.184.188.191.192.196.203.204.208.212.214.218.222.226.231.232.233.234.238.239.242.246.248.250.254.258.260.262.266.268.270.275.276.288.292.296.300.304.308.312.316.320.324.328.332.334.336.340.344.348.352.356.360.364.368.372.376.380.384.388.392.398.400.404.408.410.414.417.418.422.426.428.430.434.438.440.442.446.450.454.458.462.466.470.474.478.480.484.492.496.498.499.500.504.508.512.516.520.524.528.531.533.534.540.548.554.558.562.566.570.574.578.580.581.583.584.585.586.591.598.600.604.608.612.616.620.624.626.630.634.638.642.643.646.652.654.659.660.662.663.666.670.674.678.682.686.688.690.694.702.703.704.705.706.710.716.724.728.729.732.740.744.748.752.756.760.762.764.768.772.776.780.784.788.792.795.796.798.800.804.807.818.831.832.833.834.836.840.850.854.858.860.862.876.882.887.894.ABW.AD.AE.AF.AFG.AFRUN.AG.AGO.AI.AIA.AL.ALA.ALB.AM.AMS.AND.AO.AQ.AR.ARE.ARG.ARM.AS.ASM.AT.ATA.ATF.ATG.AU.AUS.AUT.AW.AX.AZ.AZE.BA.BB.BD.BDI.BE.BEL.BEN.BF.BFA.BG.BGD.BGR.BH.BHR.BHS.BI.BIH.BJ.BL.BLM.BLR.BLZ.BM.BMU.BN.BO.BOL.BQ-BO.BQ-SA.BQ-SE.BR.BRA.BRB.BRN.BS.BT.BTN.BV.BVT.BW.BWA.BY.BZ.CA.CAF.CAN.CC.CCK.CD.CF.CG.CH.CHE.CHL.CHN.CI.CIV.CK.CL.CM.CMR.CN.CO.COD.COG.COK.COL.COM.CPV.CR.CRI.CU.CUB.CUW.CV.CW.CX.CXR.CY.CYM.CYP.CZ.CZE.DE.DEU.DJ.DJI.DK.DM.DMA.DNK.DO.DOM.EC.ECU.EE.EG.EGY.EH.ER.ERI.ES.ESH.ESP.EST.ET.ETH.EU.FI.FIN.FJ.FJI.FK.FLK.FM.FO.FR.FRA.FRO.FSM.GA.GAB.GB-ENG.GB-NIR.GB-SCT.GB-UKM.GB-WLS.GB.GBR.GD.GE.GEO.GF.GG.GGY.GH.GHA.GI.GIB.GIN.GL.GLP.GM.GMB.GN.GNB.GNQ.GP.GQ.GR.GRC.GRD.GRL.GS.GT.GTM.GU.GUF.GUM.GUY.GW.GY.HK.HKG.HM.HMD.HN.HND.HR.HRV.HT.HTI.HU.HUN.ID.IDN.IE.IL.IM.IMN.IN.IND.IO.IOT.IQ.IR.IRL.IRN.IRQ.IS.ISL.ISR.IT.ITA.JAM.JE.JEY.JM.JO.JOR.JP.JPN.KAZ.KE.KEN.KG.KGZ.KH.KHM.KI.KIR.KM.KN-SK.KNA.KOR.KP.KR.KW.KWT.KY.KZ.LA.LAO.LB.LBN.LBR.LBY.LC.LCA.LI.LIE.LK.LKA.LR.LS.LSO.LT.LTU.LU.LUX.LV.LVA.LY.MA.MAC.MAF.MAR.MC.MCO.MD.MDA.MDG.MDV.ME.MEX.MF.MG.MH.MHL.MK.MKD.ML.MLI.MLT.MM.MMR.MN.MNE.MNG.MNP.MO.MOZ.MP.MQ.MR.MRT.MS.MSR.MT.MTQ.MU.MUS.MV.MW.MWI.MX.MY.MYS.MZ.NA.NAM.NC.NCL.NE.NER.NF.NFK.NG.NGA.NI.NIC.NIU.NL.NLD.NO.NOR.NP.NPL.NR.NRU.NU.NZ.NZL.OM.OMN.PA.PAK.PAN.PCN.PE.PER.PF.PG.PH.PHL.PK.PL.PLW.PM.PN.PNG.POL.PR.PRI.PRK.PRT.PRY.PS.PSE.PT.PW.PY.PYF.QA.QAT.RAINBOW.RE.REU.RO.ROU.RS.RU.RUS.RW.RWA.SA.SAU.SB.SC.SD.SDN.SE.SEN.SG.SGP.SGS.SH.SHN.SI.SJ.SJM.SK.SL.SLB.SLE.SLV.SM.SMR.SN.SO.SOM.SPM.SR.SRB.SS.SSD.ST.STP.SUR.SV.SVK.SVN.SWE.SWZ.SX.SXM.SY.SYC.SYR.SZ.TC.TCA.TCD.TD.TF.TG.TGO.TH.THA.TJ.TJK.TK.TKL.TKM.TL.TLS.TM.TN.TO.TON.TR.TT.TTO.TUN.TUR.TUV.TV.TW.TWN.TZ.TZA.UA.UG.UGA.UKR.UM.UMI.UNASUR.URY.US.USA.UY.UZ.UZB.VA.VAT.VC.VCT.VE.VEN.VG.VGB.VI.VIR.VN.VNM.VU.VUT.WF.WLF.WS.WSM.YE.YEM.ZA.ZAF.ZM.ZMB.ZW.ZWE`.split(`.`),u=new Set(l);function d(e){return typeof e==`string`&&u.has(e)}export{c as Flag,l as countryCodes,d as isCountryCode};
|
package/dist/hooks.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/hooks
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import { RefObject, useLayoutEffect } from "react";
|
|
6
|
+
import { a as PossibleRef, n as MarginType, s as copyToClipboard } from "./in-view-C_daNafg.js";
|
|
7
|
+
import { RefCallback, RefObject, useLayoutEffect } from "react";
|
|
8
8
|
/**
|
|
9
9
|
* Tailwind CSS breakpoints in descending order (largest → smallest).
|
|
10
10
|
*
|
|
@@ -150,7 +150,7 @@ declare function useCallbackRef<T extends (...args: never[]) => unknown>(callbac
|
|
|
150
150
|
* The returned function uses the Clipboard API when available and falls back
|
|
151
151
|
* to a `document.execCommand("copy")` polyfill for older browsers. `await`
|
|
152
152
|
* the call (or attach a `.then()` / `.catch()`) to observe whether the copy
|
|
153
|
-
* succeeded
|
|
153
|
+
* succeeded: the function throws when both the Clipboard API and the
|
|
154
154
|
* polyfill fail, or when called outside of a DOM environment.
|
|
155
155
|
*
|
|
156
156
|
* Inspired by: https://usehooks.com/usecopytoclipboard
|
|
@@ -372,7 +372,7 @@ type UseInertSiblingsOptions = {
|
|
|
372
372
|
declare function useInertSiblings(ref: RefObject<HTMLElement | null>, { active }?: UseInertSiblingsOptions): void;
|
|
373
373
|
/**
|
|
374
374
|
* Returns `false` during server rendering and the initial hydration render,
|
|
375
|
-
* then `true` on the client
|
|
375
|
+
* then `true` on the client, without hydration mismatches, because React
|
|
376
376
|
* uses the server snapshot for the hydration pass and re-renders once with
|
|
377
377
|
* the client snapshot afterwards.
|
|
378
378
|
*
|
|
@@ -438,7 +438,7 @@ declare function useIsHydratedAfterPaint(): boolean;
|
|
|
438
438
|
* by other Mantle hooks and components.
|
|
439
439
|
*
|
|
440
440
|
* @param effect - The imperative function that may return a cleanup
|
|
441
|
-
* function
|
|
441
|
+
* function, with the same signature as React's `useLayoutEffect` / `useEffect`.
|
|
442
442
|
* @param deps - Optional dependency list, same semantics as
|
|
443
443
|
* `useLayoutEffect`.
|
|
444
444
|
* @returns Nothing.
|
|
@@ -564,7 +564,7 @@ declare function useSessionStorage(key: string, defaultValue: string): readonly
|
|
|
564
564
|
*
|
|
565
565
|
* Useful in event handlers, animation entrypoints, or plain functions where
|
|
566
566
|
* a React hook cannot be called. Prefer {@link usePrefersReducedMotion}
|
|
567
|
-
* inside components
|
|
567
|
+
* inside components: it subscribes to live changes.
|
|
568
568
|
*
|
|
569
569
|
* @returns `true` when the user has opted out of animations or when called
|
|
570
570
|
* outside a browser environment (SSR), `false` when motion is allowed.
|
|
@@ -617,8 +617,8 @@ export declare function usePrefersReducedMotion(): boolean;
|
|
|
617
617
|
/**
|
|
618
618
|
* `scroll-behavior` values:
|
|
619
619
|
*
|
|
620
|
-
* - `"auto"
|
|
621
|
-
* - `"smooth"
|
|
620
|
+
* - `"auto"`: scrolling happens instantly (no animation).
|
|
621
|
+
* - `"smooth"`: scrolling animates smoothly using a user-agent–defined easing and duration.
|
|
622
622
|
*
|
|
623
623
|
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior#values
|
|
624
624
|
*/
|
|
@@ -794,6 +794,26 @@ type UseSwipeToDismissOptions = {
|
|
|
794
794
|
* ```
|
|
795
795
|
*/
|
|
796
796
|
declare function useSwipeToDismiss(handle: RefObject<HTMLElement | null>, options: UseSwipeToDismissOptions): void;
|
|
797
|
+
/**
|
|
798
|
+
* A custom hook that composes up to three refs into a single callback ref.
|
|
799
|
+
* Accepts callback refs and RefObject(s). The callback keeps one identity
|
|
800
|
+
* while the refs it composes keep theirs, so React attaches it once per
|
|
801
|
+
* mount. If you pass a new ref on a later render, React detaches the old
|
|
802
|
+
* callback and attaches the new one, so the new ref receives the node at
|
|
803
|
+
* once. A consumer callback ref fires once per mount when the consumer
|
|
804
|
+
* passes the same function each render, and on every render when the
|
|
805
|
+
* consumer passes a new function, as it does on a plain element. Any
|
|
806
|
+
* cleanup the composed ref returns targets the refs it composed (see
|
|
807
|
+
* {@link composeRefs} for the cleanup propagation contract).
|
|
808
|
+
*
|
|
809
|
+
* @example
|
|
810
|
+
* function MyInput({ ref, ...props }: ComponentProps<"input">) {
|
|
811
|
+
* const internalRef = useRef<HTMLInputElement>(null);
|
|
812
|
+
* const composedRef = useComposedRefs(internalRef, ref);
|
|
813
|
+
* return <input ref={composedRef} {...props} />;
|
|
814
|
+
* }
|
|
815
|
+
*/
|
|
816
|
+
declare function useComposedRefs<T>(firstRef: PossibleRef<T>, secondRef: PossibleRef<T>, thirdRef?: PossibleRef<T>): RefCallback<T>;
|
|
797
817
|
/**
|
|
798
818
|
* Options for the `useInView` hook.
|
|
799
819
|
*/
|
|
@@ -882,7 +902,7 @@ type UseUndoRedoReturn<T> = {
|
|
|
882
902
|
/**
|
|
883
903
|
* Generic undo/redo hook that maintains two history stacks (undo and redo).
|
|
884
904
|
*
|
|
885
|
-
* The hook does not own your application state
|
|
905
|
+
* The hook does not own your application state; instead it helps you
|
|
886
906
|
* snapshot it. Call `push(snapshot)` *before* mutating state to capture
|
|
887
907
|
* the current value, then call `undo(current)` or `redo(current)` to swap
|
|
888
908
|
* `current` with the previous/next snapshot. Both `undo` and `redo` return
|
|
@@ -890,7 +910,7 @@ type UseUndoRedoReturn<T> = {
|
|
|
890
910
|
* new snapshot clears the redo stack, matching standard editor semantics.
|
|
891
911
|
*
|
|
892
912
|
* `push`, `undo`, and `redo` operate on the live history, so calling them
|
|
893
|
-
* multiple times within a single event handler works as expected
|
|
913
|
+
* multiple times within a single event handler works as expected: each
|
|
894
914
|
* call sees the result of the previous one.
|
|
895
915
|
*
|
|
896
916
|
* @typeParam T - The type of the value being snapshotted (e.g. a list of
|
package/dist/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./use-breakpoint
|
|
1
|
+
"use client";import{n as e,r as t,t as n}from"./use-breakpoint-B4Kh0xE6.js";import{t as r}from"./use-callback-ref-DiOXFQzM.js";import{t as i}from"./use-copy-to-clipboard-hBL6_65i.js";import{n as a,t as o}from"./use-inert-siblings-C4RHXrZc.js";import{t as s}from"./use-is-hydrated-BeLOGKwE.js";import{t as c}from"./use-is-hydrated-after-paint-CrHt3OHw.js";import{t as l}from"./use-isomorphic-layout-effect-CL6iq0Bj.js";import{t as u}from"./use-matches-media-query-FfvtNKQe.js";import{n as d,t as f}from"./use-prefers-reduced-motion-Ck6dnOM9.js";import{n as p}from"./use-swipe-to-dismiss-BYdlca8r.js";import{t as m}from"./use-composed-refs-DPYmLDSe.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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/components/overlays/hover-card
|
|
5
5
|
*/
|
|
6
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
6
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
7
7
|
import { ComponentProps } from "react";
|
|
8
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";
|
|
9
9
|
/**
|
|
@@ -113,7 +113,7 @@ declare const Portal: ({ container, ...props }: ComponentProps<typeof Portal$1>)
|
|
|
113
113
|
* </HoverCard.Root>
|
|
114
114
|
* ```
|
|
115
115
|
*/
|
|
116
|
-
declare const Content: ({ "data-slot": dataSlot, className, onClick, align, sideOffset, ...props }: ComponentProps<typeof Content$1> & WithDataSlot) => import("react").JSX.Element;
|
|
116
|
+
declare const Content: ({ "data-slot": dataSlot, className, onClick, onEscapeKeyDown, align, sideOffset, ...props }: ComponentProps<typeof Content$1> & WithDataSlot) => import("react").JSX.Element;
|
|
117
117
|
type HoverCardArrowProps = Omit<ComponentProps<typeof Arrow$1>, "asChild" | "children"> & WithDataSlot;
|
|
118
118
|
/**
|
|
119
119
|
* An optional tip that points from `HoverCard.Content` at its trigger. Render it
|
|
@@ -142,7 +142,7 @@ declare const Arrow: ({ "data-slot": dataSlot, className, height, width, ...prop
|
|
|
142
142
|
/**
|
|
143
143
|
* A floating card that appears when a user hovers over a trigger element.
|
|
144
144
|
*
|
|
145
|
-
* Use `HoverCard` for non-essential preview content shown on HOVER
|
|
145
|
+
* Use `HoverCard` for non-essential preview content shown on HOVER: user
|
|
146
146
|
* cards, repo previews, rich link previews. Because hover is not reachable
|
|
147
147
|
* via keyboard, all content inside a `HoverCard` must be supplemental,
|
|
148
148
|
* never the only path to information; the trigger is typically a link that
|