dgz-ui-shared 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +0 -0
- package/dist/DateRangePicker-SMIL2r00.cjs +11 -0
- package/dist/DateRangePicker-SaQJQ9ba.js +3397 -0
- package/dist/Empty-BINT6CbW.js +27 -0
- package/dist/Empty-VUaePYiO.cjs +6 -0
- package/dist/FilterWrapper-7Ls7u2Kr.js +235 -0
- package/dist/FilterWrapper-8kzo6OTD.cjs +21 -0
- package/dist/MyBreadcrumb-DFGKR9aK.js +1492 -0
- package/dist/MyBreadcrumb-JMFSq6B5.cjs +17 -0
- package/dist/MyLimitSelect-BDvVJ796.cjs +11 -0
- package/dist/MyLimitSelect-t7KGF-ET.js +196 -0
- package/dist/PasswordConfirm-CCTmtd2l.js +2942 -0
- package/dist/PasswordConfirm-Dyk7QmeW.cjs +7 -0
- package/dist/ScrollArea-D04nVJdb.js +15 -0
- package/dist/ScrollArea-D_wmeopf.cjs +1 -0
- package/dist/SortOrder-81BrXp3i.cjs +1 -0
- package/dist/SortOrder-CwuehjY1.js +4 -0
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +1 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/components/breadcrumb/index.es.js +4 -0
- package/dist/components/breadcrumb/index.umd.js +1 -0
- package/dist/components/confirm/index.es.js +5 -0
- package/dist/components/confirm/index.umd.js +1 -0
- package/dist/components/datatable/index.es.js +1941 -0
- package/dist/components/datatable/index.umd.js +26 -0
- package/dist/components/datepicker/index.es.js +4 -0
- package/dist/components/datepicker/index.umd.js +1 -0
- package/dist/components/empty/index.es.js +4 -0
- package/dist/components/empty/index.umd.js +1 -0
- package/dist/components/filters/index.es.js +16 -0
- package/dist/components/filters/index.umd.js +1 -0
- package/dist/components/modal/index.es.js +134 -0
- package/dist/components/modal/index.umd.js +6 -0
- package/dist/components/pagination/index.es.js +5 -0
- package/dist/components/pagination/index.umd.js +1 -0
- package/dist/components/scroll/index.es.js +4 -0
- package/dist/components/scroll/index.umd.js +1 -0
- package/dist/components/title/index.es.js +9 -0
- package/dist/components/title/index.umd.js +1 -0
- package/dist/components/tooltip/index.es.js +301 -0
- package/dist/components/tooltip/index.umd.js +1 -0
- package/dist/createLucideIcon-B950nf2d.js +94 -0
- package/dist/createLucideIcon-BnAj0RnC.cjs +21 -0
- package/dist/dayjs.min-C0f7f7oH.js +303 -0
- package/dist/dayjs.min-DiHYRps1.cjs +1 -0
- package/dist/dgz-ui-shared.css +1 -0
- package/dist/enums/index.es.js +6 -0
- package/dist/enums/index.umd.js +1 -0
- package/dist/hooks/index.es.js +162 -0
- package/dist/hooks/index.umd.js +1 -0
- package/dist/index-BK3FjXZk-BJsYf2Fo.cjs +5 -0
- package/dist/index-BK3FjXZk-DJCoobY6.js +243 -0
- package/dist/index-BQvmdFI2-C9dgS3w9.cjs +61 -0
- package/dist/index-BQvmdFI2-DQderQyE.js +771 -0
- package/dist/index-Br4MVOGV-BTDQ_Wwy.js +11 -0
- package/dist/index-Br4MVOGV-_x7Q_qhf.cjs +1 -0
- package/dist/index-C5JzSjdD-BlvcNArV.cjs +1 -0
- package/dist/index-C5JzSjdD-BmvOu3HF.js +1578 -0
- package/dist/index-CAkEtOXa-CHx6pQfS.cjs +1 -0
- package/dist/index-CAkEtOXa-Z1UCiJrG.js +373 -0
- package/dist/index-D2atLuzC-BfjqpKEo.js +83 -0
- package/dist/index-D2atLuzC-CgVmKI0O.cjs +1 -0
- package/dist/index.es.js +1 -0
- package/dist/index.esm-BS2kCDgX.cjs +139 -0
- package/dist/index.esm-dkp4Vz3y.js +13864 -0
- package/dist/index.umd.js +1 -0
- package/dist/jsx-runtime-C5mzlN2N.js +284 -0
- package/dist/jsx-runtime-DUiatUiq.cjs +22 -0
- package/dist/popover-CBRr00GV--XTgMs23.js +237 -0
- package/dist/popover-CBRr00GV-1hN6Nqs4.cjs +1 -0
- package/dist/react-CKdwtE7C.cjs +1 -0
- package/dist/react-Db707vNX.js +167 -0
- package/dist/select-Cwb1akIr-DmdZdXTc.cjs +61 -0
- package/dist/select-Cwb1akIr-HJSi7km3.js +8901 -0
- package/dist/stores/index.es.js +6 -0
- package/dist/stores/index.umd.js +1 -0
- package/dist/types/components/breadcrumb/MyBreadcrumb.d.ts +6 -0
- package/dist/types/components/breadcrumb/MyBreadcrumb.d.ts.map +1 -0
- package/dist/types/components/breadcrumb/index.d.ts +2 -0
- package/dist/types/components/breadcrumb/index.d.ts.map +1 -0
- package/dist/types/components/confirm/Confirm.d.ts +10 -0
- package/dist/types/components/confirm/Confirm.d.ts.map +1 -0
- package/dist/types/components/confirm/PasswordConfirm.d.ts +7 -0
- package/dist/types/components/confirm/PasswordConfirm.d.ts.map +1 -0
- package/dist/types/components/confirm/index.d.ts +3 -0
- package/dist/types/components/confirm/index.d.ts.map +1 -0
- package/dist/types/components/datatable/DataTable.d.ts +27 -0
- package/dist/types/components/datatable/DataTable.d.ts.map +1 -0
- package/dist/types/components/datatable/MyTable.d.ts +18 -0
- package/dist/types/components/datatable/MyTable.d.ts.map +1 -0
- package/dist/types/components/datatable/index.d.ts +3 -0
- package/dist/types/components/datatable/index.d.ts.map +1 -0
- package/dist/types/components/datepicker/DateRangePicker.d.ts +12 -0
- package/dist/types/components/datepicker/DateRangePicker.d.ts.map +1 -0
- package/dist/types/components/datepicker/index.d.ts +2 -0
- package/dist/types/components/datepicker/index.d.ts.map +1 -0
- package/dist/types/components/empty/Empty.d.ts +7 -0
- package/dist/types/components/empty/Empty.d.ts.map +1 -0
- package/dist/types/components/empty/index.d.ts +2 -0
- package/dist/types/components/empty/index.d.ts.map +1 -0
- package/dist/types/components/filters/DateRangeFilter.d.ts +6 -0
- package/dist/types/components/filters/DateRangeFilter.d.ts.map +1 -0
- package/dist/types/components/filters/FilterWrapper.d.ts +21 -0
- package/dist/types/components/filters/FilterWrapper.d.ts.map +1 -0
- package/dist/types/components/filters/Search.d.ts +7 -0
- package/dist/types/components/filters/Search.d.ts.map +1 -0
- package/dist/types/components/filters/SearchWithCtrl.d.ts +8 -0
- package/dist/types/components/filters/SearchWithCtrl.d.ts.map +1 -0
- package/dist/types/components/filters/index.d.ts +5 -0
- package/dist/types/components/filters/index.d.ts.map +1 -0
- package/dist/types/components/form/MyCheckbox.d.ts +5 -0
- package/dist/types/components/form/MyCheckbox.d.ts.map +1 -0
- package/dist/types/components/form/MyDatePicker.d.ts +7 -0
- package/dist/types/components/form/MyDatePicker.d.ts.map +1 -0
- package/dist/types/components/form/MyFilepond.d.ts +11 -0
- package/dist/types/components/form/MyFilepond.d.ts.map +1 -0
- package/dist/types/components/form/MyInput.d.ts +5 -0
- package/dist/types/components/form/MyInput.d.ts.map +1 -0
- package/dist/types/components/form/MySelect.d.ts +7 -0
- package/dist/types/components/form/MySelect.d.ts.map +1 -0
- package/dist/types/components/form/MySwitch.d.ts +5 -0
- package/dist/types/components/form/MySwitch.d.ts.map +1 -0
- package/dist/types/components/form/MyTextarea.d.ts +5 -0
- package/dist/types/components/form/MyTextarea.d.ts.map +1 -0
- package/dist/types/components/form/MyTimePicker.d.ts +9 -0
- package/dist/types/components/form/MyTimePicker.d.ts.map +1 -0
- package/dist/types/components/form/index.d.ts +8 -0
- package/dist/types/components/form/index.d.ts.map +1 -0
- package/dist/types/components/modal/MyModal.d.ts +11 -0
- package/dist/types/components/modal/MyModal.d.ts.map +1 -0
- package/dist/types/components/modal/index.d.ts +2 -0
- package/dist/types/components/modal/index.d.ts.map +1 -0
- package/dist/types/components/pagination/MyLimitSelect.d.ts +9 -0
- package/dist/types/components/pagination/MyLimitSelect.d.ts.map +1 -0
- package/dist/types/components/pagination/MyPagination.d.ts +8 -0
- package/dist/types/components/pagination/MyPagination.d.ts.map +1 -0
- package/dist/types/components/pagination/index.d.ts +4 -0
- package/dist/types/components/pagination/index.d.ts.map +1 -0
- package/dist/types/components/scroll/ScrollArea.d.ts +3 -0
- package/dist/types/components/scroll/ScrollArea.d.ts.map +1 -0
- package/dist/types/components/scroll/index.d.ts +2 -0
- package/dist/types/components/scroll/index.d.ts.map +1 -0
- package/dist/types/components/title/PageTitle.d.ts +7 -0
- package/dist/types/components/title/PageTitle.d.ts.map +1 -0
- package/dist/types/components/title/index.d.ts +2 -0
- package/dist/types/components/title/index.d.ts.map +1 -0
- package/dist/types/components/tooltip/MyTooltip.d.ts +9 -0
- package/dist/types/components/tooltip/MyTooltip.d.ts.map +1 -0
- package/dist/types/components/tooltip/index.d.ts +2 -0
- package/dist/types/components/tooltip/index.d.ts.map +1 -0
- package/dist/types/enums/Keyboard.d.ts +4 -0
- package/dist/types/enums/Keyboard.d.ts.map +1 -0
- package/dist/types/enums/SortOrder.d.ts +5 -0
- package/dist/types/enums/SortOrder.d.ts.map +1 -0
- package/dist/types/enums/index.d.ts +3 -0
- package/dist/types/enums/index.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +8 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/useColumns.d.ts +13 -0
- package/dist/types/hooks/useColumns.d.ts.map +1 -0
- package/dist/types/hooks/useConfirm.d.ts +10 -0
- package/dist/types/hooks/useConfirm.d.ts.map +1 -0
- package/dist/types/hooks/useDataTable.d.ts +13 -0
- package/dist/types/hooks/useDataTable.d.ts.map +1 -0
- package/dist/types/hooks/useDateRange.d.ts +6 -0
- package/dist/types/hooks/useDateRange.d.ts.map +1 -0
- package/dist/types/hooks/useFilter.d.ts +8 -0
- package/dist/types/hooks/useFilter.d.ts.map +1 -0
- package/dist/types/hooks/useQueryParams.d.ts +10 -0
- package/dist/types/hooks/useQueryParams.d.ts.map +1 -0
- package/dist/types/hooks/useSortable.d.ts +14 -0
- package/dist/types/hooks/useSortable.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.es.js +1 -0
- package/dist/types/index.umd.js +1 -0
- package/dist/types/schemas/createConfirmPasswordSchema.d.ts +12 -0
- package/dist/types/schemas/createConfirmPasswordSchema.d.ts.map +1 -0
- package/dist/types/schemas/index.d.ts +2 -0
- package/dist/types/schemas/index.d.ts.map +1 -0
- package/dist/types/setupTests.d.ts +2 -0
- package/dist/types/setupTests.d.ts.map +1 -0
- package/dist/types/stores/index.d.ts +3 -0
- package/dist/types/stores/index.d.ts.map +1 -0
- package/dist/types/stores/useColumnsStore.d.ts +16 -0
- package/dist/types/stores/useColumnsStore.d.ts.map +1 -0
- package/dist/types/stores/useDateRangeStore.d.ts +17 -0
- package/dist/types/stores/useDateRangeStore.d.ts.map +1 -0
- package/dist/types/types/column.type.d.ts +14 -0
- package/dist/types/types/column.type.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +3 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/translation-args.type.d.ts +7 -0
- package/dist/types/types/translation-args.type.d.ts.map +1 -0
- package/dist/useColumnsStore-C3poJ3hB.cjs +1 -0
- package/dist/useColumnsStore-CUWnqxpS.js +17 -0
- package/dist/useDateRange-E_fB9biv.js +1491 -0
- package/dist/useDateRange-YGn1ZvSX.cjs +12 -0
- package/dist/useDateRangeStore-BQDedoTk.js +18 -0
- package/dist/useDateRangeStore-DUQ6Akf6.cjs +1 -0
- package/dist/useFilter-0HNR8ewo.js +16 -0
- package/dist/useFilter-CwmfhUFk.cjs +1 -0
- package/dist/useSortable-BeqwkB5Z.js +133 -0
- package/dist/useSortable-q46kVK_x.cjs +1 -0
- package/dist/useTranslation-CZf20ucv.cjs +1 -0
- package/dist/useTranslation-dH-uwymc.js +147 -0
- package/dist/utils-PffWk1Lg-Bm8mmArS.cjs +22 -0
- package/dist/utils-PffWk1Lg-CZY16h3s.js +3027 -0
- package/package.json +179 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const q=require("react"),O=require("./index-D2atLuzC-CgVmKI0O.cjs"),h=require("./utils-PffWk1Lg-Bm8mmArS.cjs"),K=require("react-dom");function _(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const o=_(q),H=_(K);function V(e,t){const n=o.createContext(t),r=u=>{const{children:i,...l}=u,d=o.useMemo(()=>l,Object.values(l));return h.yr.jsx(n.Provider,{value:d,children:i})};r.displayName=e+"Provider";function s(u){const i=o.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${u}\` must be used within \`${e}\``)}return[r,s]}function X(e,t=[]){let n=[];function r(u,i){const l=o.createContext(i),d=n.length;n=[...n,i];const c=v=>{var f;const{scope:p,children:E,...y}=v,P=((f=p==null?void 0:p[e])==null?void 0:f[d])||l,C=o.useMemo(()=>y,Object.values(y));return h.yr.jsx(P.Provider,{value:C,children:E})};c.displayName=u+"Provider";function a(v,f){var p;const E=((p=f==null?void 0:f[e])==null?void 0:p[d])||l,y=o.useContext(E);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${v}\` must be used within \`${u}\``)}return[c,a]}const s=()=>{const u=n.map(i=>o.createContext(i));return function(i){const l=(i==null?void 0:i[e])||u;return o.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return s.scopeName=e,[r,Y(s,...t)]}function Y(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(s){const u=r.reduce((i,{useScope:l,scopeName:d})=>{const c=l(s)[`__scope${d}`];return{...i,...c}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var b=globalThis!=null&&globalThis.document?o.useLayoutEffect:()=>{};function N(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function w(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function G(e,t){return o.useReducer((n,r)=>t[n][r]??n,e)}var I=e=>{const{present:t,children:n}=e,r=J(t),s=typeof n=="function"?n({present:r.isPresent}):o.Children.only(n),u=O.x(r.ref,Q(s));return typeof n=="function"||r.isPresent?o.cloneElement(s,{ref:u}):null};I.displayName="Presence";function J(e){const[t,n]=o.useState(),r=o.useRef(null),s=o.useRef(e),u=o.useRef("none"),i=e?"mounted":"unmounted",[l,d]=G(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return o.useEffect(()=>{const c=g(r.current);u.current=l==="mounted"?c:"none"},[l]),b(()=>{const c=r.current,a=s.current;if(a!==e){const v=u.current,f=g(c);e?d("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?d("UNMOUNT"):d(a&&v!==f?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),b(()=>{if(t){let c;const a=t.ownerDocument.defaultView??window,v=p=>{const E=g(r.current).includes(p.animationName);if(p.target===t&&E&&(d("ANIMATION_END"),!s.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=a.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=p=>{p.target===t&&(u.current=g(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{a.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:o.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function g(e){return(e==null?void 0:e.animationName)||"none"}function Q(e){var t,n;let r=(t=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:t.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var Z=o[" useId ".trim().toString()]||(()=>{}),ee=0;function te(e){const[t,n]=o.useState(Z());return b(()=>{n(r=>r??String(ee++))},[e]),e||(t?`radix-${t}`:"")}var ne=o[" useInsertionEffect ".trim().toString()]||b;function re({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,u,i]=oe({defaultProp:t,onChange:n}),l=e!==void 0,d=l?e:s;{const a=o.useRef(e!==void 0);o.useEffect(()=>{const v=a.current;v!==l&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),a.current=l},[l,r])}const c=o.useCallback(a=>{var v;if(l){const f=se(a)?a(e):a;f!==e&&((v=i.current)==null||v.call(i,f))}else u(a)},[l,e,u,i]);return[d,c]}function oe({defaultProp:e,onChange:t}){const[n,r]=o.useState(e),s=o.useRef(n),u=o.useRef(t);return ne(()=>{u.current=t},[t]),o.useEffect(()=>{var i;s.current!==n&&((i=u.current)==null||i.call(u,n),s.current=n)},[n,s]),[n,r,u]}function se(e){return typeof e=="function"}var ue=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],M=ue.reduce((e,t)=>{const n=O.g(`Primitive.${t}`),r=o.forwardRef((s,u)=>{const{asChild:i,...l}=s,d=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.yr.jsx(d,{...l,ref:u})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function k(e,t){e&&H.flushSync(()=>e.dispatchEvent(t))}function ie(e,t=globalThis==null?void 0:globalThis.document){const n=N(e);o.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ce="DismissableLayer",L="dismissableLayer.update",le="dismissableLayer.pointerDownOutside",ae="dismissableLayer.focusOutside",x,W=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),A=o.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:u,onInteractOutside:i,onDismiss:l,...d}=e,c=o.useContext(W),[a,v]=o.useState(null),f=(a==null?void 0:a.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=o.useState({}),E=O.x(t,m=>v(m)),y=Array.from(c.layers),[P]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),C=y.indexOf(P),$=a?y.indexOf(a):-1,F=c.layersWithOutsidePointerEventsDisabled.size>0,R=$>=C,z=ve(m=>{const D=m.target,T=[...c.branches].some(B=>B.contains(D));!R||T||(s==null||s(m),i==null||i(m),m.defaultPrevented||l==null||l())},f),S=me(m=>{const D=m.target;[...c.branches].some(T=>T.contains(D))||(u==null||u(m),i==null||i(m),m.defaultPrevented||l==null||l())},f);return ie(m=>{$===c.layers.size-1&&(r==null||r(m),!m.defaultPrevented&&l&&(m.preventDefault(),l()))},f),o.useEffect(()=>{if(a)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(x=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(a)),c.layers.add(a),j(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=x)}},[a,f,n,c]),o.useEffect(()=>()=>{a&&(c.layers.delete(a),c.layersWithOutsidePointerEventsDisabled.delete(a),j())},[a,c]),o.useEffect(()=>{const m=()=>p({});return document.addEventListener(L,m),()=>document.removeEventListener(L,m)},[]),h.yr.jsx(M.div,{...d,ref:E,style:{pointerEvents:F?R?"auto":"none":void 0,...e.style},onFocusCapture:w(e.onFocusCapture,S.onFocusCapture),onBlurCapture:w(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:w(e.onPointerDownCapture,z.onPointerDownCapture)})});A.displayName=ce;var de="DismissableLayerBranch",fe=o.forwardRef((e,t)=>{const n=o.useContext(W),r=o.useRef(null),s=O.x(t,r);return o.useEffect(()=>{const u=r.current;if(u)return n.branches.add(u),()=>{n.branches.delete(u)}},[n.branches]),h.yr.jsx(M.div,{...e,ref:s})});fe.displayName=de;function ve(e,t=globalThis==null?void 0:globalThis.document){const n=N(e),r=o.useRef(!1),s=o.useRef(()=>{});return o.useEffect(()=>{const u=l=>{if(l.target&&!r.current){let d=function(){U(le,n,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=d,t.addEventListener("click",s.current,{once:!0})):d()}else t.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",u),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function me(e,t=globalThis==null?void 0:globalThis.document){const n=N(e),r=o.useRef(!1);return o.useEffect(()=>{const s=u=>{u.target&&!r.current&&U(ae,n,{originalEvent:u},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function j(){const e=new CustomEvent(L);document.dispatchEvent(e)}function U(e,t,n,{discrete:r}){const s=n.originalEvent.target,u=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?k(s,u):s.dispatchEvent(u)}exports.E=N;exports.M=A;exports.R=I;exports.b=V;exports.g=te;exports.h=M;exports.j=X;exports.w=b;exports.w$1=k;exports.y=re;exports.y$1=w;
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
import { x as D, g as F } from "./index-D2atLuzC-BfjqpKEo.js";
|
|
3
|
+
import { y as h } from "./utils-PffWk1Lg-CZY16h3s.js";
|
|
4
|
+
import * as _ from "react-dom";
|
|
5
|
+
function de(e, n) {
|
|
6
|
+
const r = o.createContext(n), t = (u) => {
|
|
7
|
+
const { children: i, ...c } = u, d = o.useMemo(() => c, Object.values(c));
|
|
8
|
+
return /* @__PURE__ */ h.jsx(r.Provider, { value: d, children: i });
|
|
9
|
+
};
|
|
10
|
+
t.displayName = e + "Provider";
|
|
11
|
+
function s(u) {
|
|
12
|
+
const i = o.useContext(r);
|
|
13
|
+
if (i) return i;
|
|
14
|
+
if (n !== void 0) return n;
|
|
15
|
+
throw new Error(`\`${u}\` must be used within \`${e}\``);
|
|
16
|
+
}
|
|
17
|
+
return [t, s];
|
|
18
|
+
}
|
|
19
|
+
function fe(e, n = []) {
|
|
20
|
+
let r = [];
|
|
21
|
+
function t(u, i) {
|
|
22
|
+
const c = o.createContext(i), d = r.length;
|
|
23
|
+
r = [...r, i];
|
|
24
|
+
const a = (m) => {
|
|
25
|
+
var f;
|
|
26
|
+
const { scope: p, children: y, ...E } = m, g = ((f = p == null ? void 0 : p[e]) == null ? void 0 : f[d]) || c, N = o.useMemo(() => E, Object.values(E));
|
|
27
|
+
return /* @__PURE__ */ h.jsx(g.Provider, { value: N, children: y });
|
|
28
|
+
};
|
|
29
|
+
a.displayName = u + "Provider";
|
|
30
|
+
function l(m, f) {
|
|
31
|
+
var p;
|
|
32
|
+
const y = ((p = f == null ? void 0 : f[e]) == null ? void 0 : p[d]) || c, E = o.useContext(y);
|
|
33
|
+
if (E) return E;
|
|
34
|
+
if (i !== void 0) return i;
|
|
35
|
+
throw new Error(`\`${m}\` must be used within \`${u}\``);
|
|
36
|
+
}
|
|
37
|
+
return [a, l];
|
|
38
|
+
}
|
|
39
|
+
const s = () => {
|
|
40
|
+
const u = r.map((i) => o.createContext(i));
|
|
41
|
+
return function(i) {
|
|
42
|
+
const c = (i == null ? void 0 : i[e]) || u;
|
|
43
|
+
return o.useMemo(
|
|
44
|
+
() => ({ [`__scope${e}`]: { ...i, [e]: c } }),
|
|
45
|
+
[i, c]
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
return s.scopeName = e, [t, B(s, ...n)];
|
|
50
|
+
}
|
|
51
|
+
function B(...e) {
|
|
52
|
+
const n = e[0];
|
|
53
|
+
if (e.length === 1) return n;
|
|
54
|
+
const r = () => {
|
|
55
|
+
const t = e.map((s) => ({
|
|
56
|
+
useScope: s(),
|
|
57
|
+
scopeName: s.scopeName
|
|
58
|
+
}));
|
|
59
|
+
return function(s) {
|
|
60
|
+
const u = t.reduce((i, { useScope: c, scopeName: d }) => {
|
|
61
|
+
const a = c(s)[`__scope${d}`];
|
|
62
|
+
return { ...i, ...a };
|
|
63
|
+
}, {});
|
|
64
|
+
return o.useMemo(() => ({ [`__scope${n.scopeName}`]: u }), [u]);
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
return r.scopeName = n.scopeName, r;
|
|
68
|
+
}
|
|
69
|
+
var w = globalThis != null && globalThis.document ? o.useLayoutEffect : () => {
|
|
70
|
+
};
|
|
71
|
+
function L(e) {
|
|
72
|
+
const n = o.useRef(e);
|
|
73
|
+
return o.useEffect(() => {
|
|
74
|
+
n.current = e;
|
|
75
|
+
}), o.useMemo(() => (...r) => {
|
|
76
|
+
var t;
|
|
77
|
+
return (t = n.current) == null ? void 0 : t.call(n, ...r);
|
|
78
|
+
}, []);
|
|
79
|
+
}
|
|
80
|
+
function C(e, n, { checkForDefaultPrevented: r = !0 } = {}) {
|
|
81
|
+
return function(t) {
|
|
82
|
+
if (e == null || e(t), r === !1 || !t.defaultPrevented)
|
|
83
|
+
return n == null ? void 0 : n(t);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function z(e, n) {
|
|
87
|
+
return o.useReducer((r, t) => n[r][t] ?? r, e);
|
|
88
|
+
}
|
|
89
|
+
var K = (e) => {
|
|
90
|
+
const { present: n, children: r } = e, t = q(n), s = typeof r == "function" ? r({ present: t.isPresent }) : o.Children.only(r), u = D(t.ref, H(s));
|
|
91
|
+
return typeof r == "function" || t.isPresent ? o.cloneElement(s, { ref: u }) : null;
|
|
92
|
+
};
|
|
93
|
+
K.displayName = "Presence";
|
|
94
|
+
function q(e) {
|
|
95
|
+
const [n, r] = o.useState(), t = o.useRef(null), s = o.useRef(e), u = o.useRef("none"), i = e ? "mounted" : "unmounted", [c, d] = z(i, {
|
|
96
|
+
mounted: {
|
|
97
|
+
UNMOUNT: "unmounted",
|
|
98
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
99
|
+
},
|
|
100
|
+
unmountSuspended: {
|
|
101
|
+
MOUNT: "mounted",
|
|
102
|
+
ANIMATION_END: "unmounted"
|
|
103
|
+
},
|
|
104
|
+
unmounted: {
|
|
105
|
+
MOUNT: "mounted"
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return o.useEffect(() => {
|
|
109
|
+
const a = b(t.current);
|
|
110
|
+
u.current = c === "mounted" ? a : "none";
|
|
111
|
+
}, [c]), w(() => {
|
|
112
|
+
const a = t.current, l = s.current;
|
|
113
|
+
if (l !== e) {
|
|
114
|
+
const m = u.current, f = b(a);
|
|
115
|
+
e ? d("MOUNT") : f === "none" || (a == null ? void 0 : a.display) === "none" ? d("UNMOUNT") : d(l && m !== f ? "ANIMATION_OUT" : "UNMOUNT"), s.current = e;
|
|
116
|
+
}
|
|
117
|
+
}, [e, d]), w(() => {
|
|
118
|
+
if (n) {
|
|
119
|
+
let a;
|
|
120
|
+
const l = n.ownerDocument.defaultView ?? window, m = (p) => {
|
|
121
|
+
const y = b(t.current).includes(p.animationName);
|
|
122
|
+
if (p.target === n && y && (d("ANIMATION_END"), !s.current)) {
|
|
123
|
+
const E = n.style.animationFillMode;
|
|
124
|
+
n.style.animationFillMode = "forwards", a = l.setTimeout(() => {
|
|
125
|
+
n.style.animationFillMode === "forwards" && (n.style.animationFillMode = E);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}, f = (p) => {
|
|
129
|
+
p.target === n && (u.current = b(t.current));
|
|
130
|
+
};
|
|
131
|
+
return n.addEventListener("animationstart", f), n.addEventListener("animationcancel", m), n.addEventListener("animationend", m), () => {
|
|
132
|
+
l.clearTimeout(a), n.removeEventListener("animationstart", f), n.removeEventListener("animationcancel", m), n.removeEventListener("animationend", m);
|
|
133
|
+
};
|
|
134
|
+
} else
|
|
135
|
+
d("ANIMATION_END");
|
|
136
|
+
}, [n, d]), {
|
|
137
|
+
isPresent: ["mounted", "unmountSuspended"].includes(c),
|
|
138
|
+
ref: o.useCallback((a) => {
|
|
139
|
+
t.current = a ? getComputedStyle(a) : null, r(a);
|
|
140
|
+
}, [])
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function b(e) {
|
|
144
|
+
return (e == null ? void 0 : e.animationName) || "none";
|
|
145
|
+
}
|
|
146
|
+
function H(e) {
|
|
147
|
+
var n, r;
|
|
148
|
+
let t = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, s = t && "isReactWarning" in t && t.isReactWarning;
|
|
149
|
+
return s ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, s = t && "isReactWarning" in t && t.isReactWarning, s ? e.props.ref : e.props.ref || e.ref);
|
|
150
|
+
}
|
|
151
|
+
var V = o[" useId ".trim().toString()] || (() => {
|
|
152
|
+
}), X = 0;
|
|
153
|
+
function me(e) {
|
|
154
|
+
const [n, r] = o.useState(V());
|
|
155
|
+
return w(() => {
|
|
156
|
+
r((t) => t ?? String(X++));
|
|
157
|
+
}, [e]), e || (n ? `radix-${n}` : "");
|
|
158
|
+
}
|
|
159
|
+
var Y = o[" useInsertionEffect ".trim().toString()] || w;
|
|
160
|
+
function ve({
|
|
161
|
+
prop: e,
|
|
162
|
+
defaultProp: n,
|
|
163
|
+
onChange: r = () => {
|
|
164
|
+
},
|
|
165
|
+
caller: t
|
|
166
|
+
}) {
|
|
167
|
+
const [s, u, i] = G({
|
|
168
|
+
defaultProp: n,
|
|
169
|
+
onChange: r
|
|
170
|
+
}), c = e !== void 0, d = c ? e : s;
|
|
171
|
+
{
|
|
172
|
+
const l = o.useRef(e !== void 0);
|
|
173
|
+
o.useEffect(() => {
|
|
174
|
+
const m = l.current;
|
|
175
|
+
m !== c && console.warn(
|
|
176
|
+
`${t} is changing from ${m ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
177
|
+
), l.current = c;
|
|
178
|
+
}, [c, t]);
|
|
179
|
+
}
|
|
180
|
+
const a = o.useCallback(
|
|
181
|
+
(l) => {
|
|
182
|
+
var m;
|
|
183
|
+
if (c) {
|
|
184
|
+
const f = J(l) ? l(e) : l;
|
|
185
|
+
f !== e && ((m = i.current) == null || m.call(i, f));
|
|
186
|
+
} else
|
|
187
|
+
u(l);
|
|
188
|
+
},
|
|
189
|
+
[c, e, u, i]
|
|
190
|
+
);
|
|
191
|
+
return [d, a];
|
|
192
|
+
}
|
|
193
|
+
function G({
|
|
194
|
+
defaultProp: e,
|
|
195
|
+
onChange: n
|
|
196
|
+
}) {
|
|
197
|
+
const [r, t] = o.useState(e), s = o.useRef(r), u = o.useRef(n);
|
|
198
|
+
return Y(() => {
|
|
199
|
+
u.current = n;
|
|
200
|
+
}, [n]), o.useEffect(() => {
|
|
201
|
+
var i;
|
|
202
|
+
s.current !== r && ((i = u.current) == null || i.call(u, r), s.current = r);
|
|
203
|
+
}, [r, s]), [r, t, u];
|
|
204
|
+
}
|
|
205
|
+
function J(e) {
|
|
206
|
+
return typeof e == "function";
|
|
207
|
+
}
|
|
208
|
+
var Q = [
|
|
209
|
+
"a",
|
|
210
|
+
"button",
|
|
211
|
+
"div",
|
|
212
|
+
"form",
|
|
213
|
+
"h2",
|
|
214
|
+
"h3",
|
|
215
|
+
"img",
|
|
216
|
+
"input",
|
|
217
|
+
"label",
|
|
218
|
+
"li",
|
|
219
|
+
"nav",
|
|
220
|
+
"ol",
|
|
221
|
+
"p",
|
|
222
|
+
"select",
|
|
223
|
+
"span",
|
|
224
|
+
"svg",
|
|
225
|
+
"ul"
|
|
226
|
+
], I = Q.reduce((e, n) => {
|
|
227
|
+
const r = F(`Primitive.${n}`), t = o.forwardRef((s, u) => {
|
|
228
|
+
const { asChild: i, ...c } = s, d = i ? r : n;
|
|
229
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ h.jsx(d, { ...c, ref: u });
|
|
230
|
+
});
|
|
231
|
+
return t.displayName = `Primitive.${n}`, { ...e, [n]: t };
|
|
232
|
+
}, {});
|
|
233
|
+
function Z(e, n) {
|
|
234
|
+
e && _.flushSync(() => e.dispatchEvent(n));
|
|
235
|
+
}
|
|
236
|
+
function ee(e, n = globalThis == null ? void 0 : globalThis.document) {
|
|
237
|
+
const r = L(e);
|
|
238
|
+
o.useEffect(() => {
|
|
239
|
+
const t = (s) => {
|
|
240
|
+
s.key === "Escape" && r(s);
|
|
241
|
+
};
|
|
242
|
+
return n.addEventListener("keydown", t, { capture: !0 }), () => n.removeEventListener("keydown", t, { capture: !0 });
|
|
243
|
+
}, [r, n]);
|
|
244
|
+
}
|
|
245
|
+
var ne = "DismissableLayer", T = "dismissableLayer.update", te = "dismissableLayer.pointerDownOutside", re = "dismissableLayer.focusOutside", S, j = o.createContext({
|
|
246
|
+
layers: /* @__PURE__ */ new Set(),
|
|
247
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
248
|
+
branches: /* @__PURE__ */ new Set()
|
|
249
|
+
}), oe = o.forwardRef(
|
|
250
|
+
(e, n) => {
|
|
251
|
+
const {
|
|
252
|
+
disableOutsidePointerEvents: r = !1,
|
|
253
|
+
onEscapeKeyDown: t,
|
|
254
|
+
onPointerDownOutside: s,
|
|
255
|
+
onFocusOutside: u,
|
|
256
|
+
onInteractOutside: i,
|
|
257
|
+
onDismiss: c,
|
|
258
|
+
...d
|
|
259
|
+
} = e, a = o.useContext(j), [l, m] = o.useState(null), f = (l == null ? void 0 : l.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = o.useState({}), y = D(n, (v) => m(v)), E = Array.from(a.layers), [g] = [...a.layersWithOutsidePointerEventsDisabled].slice(-1), N = E.indexOf(g), $ = l ? E.indexOf(l) : -1, U = a.layersWithOutsidePointerEventsDisabled.size > 0, M = $ >= N, W = ie((v) => {
|
|
260
|
+
const O = v.target, P = [...a.branches].some((k) => k.contains(O));
|
|
261
|
+
!M || P || (s == null || s(v), i == null || i(v), v.defaultPrevented || c == null || c());
|
|
262
|
+
}, f), R = ae((v) => {
|
|
263
|
+
const O = v.target;
|
|
264
|
+
[...a.branches].some((P) => P.contains(O)) || (u == null || u(v), i == null || i(v), v.defaultPrevented || c == null || c());
|
|
265
|
+
}, f);
|
|
266
|
+
return ee((v) => {
|
|
267
|
+
$ === a.layers.size - 1 && (t == null || t(v), !v.defaultPrevented && c && (v.preventDefault(), c()));
|
|
268
|
+
}, f), o.useEffect(() => {
|
|
269
|
+
if (l)
|
|
270
|
+
return r && (a.layersWithOutsidePointerEventsDisabled.size === 0 && (S = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), a.layersWithOutsidePointerEventsDisabled.add(l)), a.layers.add(l), x(), () => {
|
|
271
|
+
r && a.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = S);
|
|
272
|
+
};
|
|
273
|
+
}, [l, f, r, a]), o.useEffect(() => () => {
|
|
274
|
+
l && (a.layers.delete(l), a.layersWithOutsidePointerEventsDisabled.delete(l), x());
|
|
275
|
+
}, [l, a]), o.useEffect(() => {
|
|
276
|
+
const v = () => p({});
|
|
277
|
+
return document.addEventListener(T, v), () => document.removeEventListener(T, v);
|
|
278
|
+
}, []), /* @__PURE__ */ h.jsx(
|
|
279
|
+
I.div,
|
|
280
|
+
{
|
|
281
|
+
...d,
|
|
282
|
+
ref: y,
|
|
283
|
+
style: {
|
|
284
|
+
pointerEvents: U ? M ? "auto" : "none" : void 0,
|
|
285
|
+
...e.style
|
|
286
|
+
},
|
|
287
|
+
onFocusCapture: C(e.onFocusCapture, R.onFocusCapture),
|
|
288
|
+
onBlurCapture: C(e.onBlurCapture, R.onBlurCapture),
|
|
289
|
+
onPointerDownCapture: C(
|
|
290
|
+
e.onPointerDownCapture,
|
|
291
|
+
W.onPointerDownCapture
|
|
292
|
+
)
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
oe.displayName = ne;
|
|
298
|
+
var se = "DismissableLayerBranch", ue = o.forwardRef((e, n) => {
|
|
299
|
+
const r = o.useContext(j), t = o.useRef(null), s = D(n, t);
|
|
300
|
+
return o.useEffect(() => {
|
|
301
|
+
const u = t.current;
|
|
302
|
+
if (u)
|
|
303
|
+
return r.branches.add(u), () => {
|
|
304
|
+
r.branches.delete(u);
|
|
305
|
+
};
|
|
306
|
+
}, [r.branches]), /* @__PURE__ */ h.jsx(I.div, { ...e, ref: s });
|
|
307
|
+
});
|
|
308
|
+
ue.displayName = se;
|
|
309
|
+
function ie(e, n = globalThis == null ? void 0 : globalThis.document) {
|
|
310
|
+
const r = L(e), t = o.useRef(!1), s = o.useRef(() => {
|
|
311
|
+
});
|
|
312
|
+
return o.useEffect(() => {
|
|
313
|
+
const u = (c) => {
|
|
314
|
+
if (c.target && !t.current) {
|
|
315
|
+
let d = function() {
|
|
316
|
+
A(
|
|
317
|
+
te,
|
|
318
|
+
r,
|
|
319
|
+
a,
|
|
320
|
+
{ discrete: !0 }
|
|
321
|
+
);
|
|
322
|
+
};
|
|
323
|
+
const a = { originalEvent: c };
|
|
324
|
+
c.pointerType === "touch" ? (n.removeEventListener("click", s.current), s.current = d, n.addEventListener("click", s.current, { once: !0 })) : d();
|
|
325
|
+
} else
|
|
326
|
+
n.removeEventListener("click", s.current);
|
|
327
|
+
t.current = !1;
|
|
328
|
+
}, i = window.setTimeout(() => {
|
|
329
|
+
n.addEventListener("pointerdown", u);
|
|
330
|
+
}, 0);
|
|
331
|
+
return () => {
|
|
332
|
+
window.clearTimeout(i), n.removeEventListener("pointerdown", u), n.removeEventListener("click", s.current);
|
|
333
|
+
};
|
|
334
|
+
}, [n, r]), {
|
|
335
|
+
// ensures we check React component tree (not just DOM tree)
|
|
336
|
+
onPointerDownCapture: () => t.current = !0
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
function ae(e, n = globalThis == null ? void 0 : globalThis.document) {
|
|
340
|
+
const r = L(e), t = o.useRef(!1);
|
|
341
|
+
return o.useEffect(() => {
|
|
342
|
+
const s = (u) => {
|
|
343
|
+
u.target && !t.current && A(re, r, { originalEvent: u }, {
|
|
344
|
+
discrete: !1
|
|
345
|
+
});
|
|
346
|
+
};
|
|
347
|
+
return n.addEventListener("focusin", s), () => n.removeEventListener("focusin", s);
|
|
348
|
+
}, [n, r]), {
|
|
349
|
+
onFocusCapture: () => t.current = !0,
|
|
350
|
+
onBlurCapture: () => t.current = !1
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
function x() {
|
|
354
|
+
const e = new CustomEvent(T);
|
|
355
|
+
document.dispatchEvent(e);
|
|
356
|
+
}
|
|
357
|
+
function A(e, n, r, { discrete: t }) {
|
|
358
|
+
const s = r.originalEvent.target, u = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: r });
|
|
359
|
+
n && s.addEventListener(e, n, { once: !0 }), t ? Z(s, u) : s.dispatchEvent(u);
|
|
360
|
+
}
|
|
361
|
+
export {
|
|
362
|
+
L as E,
|
|
363
|
+
oe as M,
|
|
364
|
+
K as R,
|
|
365
|
+
C as a,
|
|
366
|
+
de as b,
|
|
367
|
+
Z as c,
|
|
368
|
+
me as g,
|
|
369
|
+
I as h,
|
|
370
|
+
fe as j,
|
|
371
|
+
w,
|
|
372
|
+
ve as y
|
|
373
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { y as u } from "./utils-PffWk1Lg-CZY16h3s.js";
|
|
3
|
+
function p(n, e) {
|
|
4
|
+
if (typeof n == "function")
|
|
5
|
+
return n(e);
|
|
6
|
+
n != null && (n.current = e);
|
|
7
|
+
}
|
|
8
|
+
function y(...n) {
|
|
9
|
+
return (e) => {
|
|
10
|
+
let l = !1;
|
|
11
|
+
const t = n.map((r) => {
|
|
12
|
+
const o = p(r, e);
|
|
13
|
+
return !l && typeof o == "function" && (l = !0), o;
|
|
14
|
+
});
|
|
15
|
+
if (l)
|
|
16
|
+
return () => {
|
|
17
|
+
for (let r = 0; r < t.length; r++) {
|
|
18
|
+
const o = t[r];
|
|
19
|
+
typeof o == "function" ? o() : p(n[r], null);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function R(...n) {
|
|
25
|
+
return i.useCallback(y(...n), n);
|
|
26
|
+
}
|
|
27
|
+
// @__NO_SIDE_EFFECTS__
|
|
28
|
+
function g(n) {
|
|
29
|
+
const e = /* @__PURE__ */ x(n), l = i.forwardRef((t, r) => {
|
|
30
|
+
const { children: o, ...c } = t, s = i.Children.toArray(o), f = s.find(C);
|
|
31
|
+
if (f) {
|
|
32
|
+
const a = f.props.children, h = s.map((d) => d === f ? i.Children.count(a) > 1 ? i.Children.only(null) : i.isValidElement(a) ? a.props.children : null : d);
|
|
33
|
+
return /* @__PURE__ */ u.jsx(e, { ...c, ref: r, children: i.isValidElement(a) ? i.cloneElement(a, void 0, h) : null });
|
|
34
|
+
}
|
|
35
|
+
return /* @__PURE__ */ u.jsx(e, { ...c, ref: r, children: o });
|
|
36
|
+
});
|
|
37
|
+
return l.displayName = `${n}.Slot`, l;
|
|
38
|
+
}
|
|
39
|
+
var _ = /* @__PURE__ */ g("Slot");
|
|
40
|
+
// @__NO_SIDE_EFFECTS__
|
|
41
|
+
function x(n) {
|
|
42
|
+
const e = i.forwardRef((l, t) => {
|
|
43
|
+
const { children: r, ...o } = l;
|
|
44
|
+
if (i.isValidElement(r)) {
|
|
45
|
+
const c = j(r), s = b(o, r.props);
|
|
46
|
+
return r.type !== i.Fragment && (s.ref = t ? y(t, c) : c), i.cloneElement(r, s);
|
|
47
|
+
}
|
|
48
|
+
return i.Children.count(r) > 1 ? i.Children.only(null) : null;
|
|
49
|
+
});
|
|
50
|
+
return e.displayName = `${n}.SlotClone`, e;
|
|
51
|
+
}
|
|
52
|
+
var m = Symbol("radix.slottable");
|
|
53
|
+
// @__NO_SIDE_EFFECTS__
|
|
54
|
+
function v(n) {
|
|
55
|
+
const e = ({ children: l }) => /* @__PURE__ */ u.jsx(u.Fragment, { children: l });
|
|
56
|
+
return e.displayName = `${n}.Slottable`, e.__radixId = m, e;
|
|
57
|
+
}
|
|
58
|
+
function C(n) {
|
|
59
|
+
return i.isValidElement(n) && typeof n.type == "function" && "__radixId" in n.type && n.type.__radixId === m;
|
|
60
|
+
}
|
|
61
|
+
function b(n, e) {
|
|
62
|
+
const l = { ...e };
|
|
63
|
+
for (const t in e) {
|
|
64
|
+
const r = n[t], o = e[t];
|
|
65
|
+
/^on[A-Z]/.test(t) ? r && o ? l[t] = (...c) => {
|
|
66
|
+
const s = o(...c);
|
|
67
|
+
return r(...c), s;
|
|
68
|
+
} : r && (l[t] = r) : t === "style" ? l[t] = { ...r, ...o } : t === "className" && (l[t] = [r, o].filter(Boolean).join(" "));
|
|
69
|
+
}
|
|
70
|
+
return { ...n, ...l };
|
|
71
|
+
}
|
|
72
|
+
function j(n) {
|
|
73
|
+
var e, l;
|
|
74
|
+
let t = (e = Object.getOwnPropertyDescriptor(n.props, "ref")) == null ? void 0 : e.get, r = t && "isReactWarning" in t && t.isReactWarning;
|
|
75
|
+
return r ? n.ref : (t = (l = Object.getOwnPropertyDescriptor(n, "ref")) == null ? void 0 : l.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? n.props.ref : n.props.ref || n.ref);
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
v as _,
|
|
79
|
+
g,
|
|
80
|
+
_ as j,
|
|
81
|
+
y as m,
|
|
82
|
+
R as x
|
|
83
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const b=require("react"),a=require("./utils-PffWk1Lg-Bm8mmArS.cjs");function j(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const l in n)if(l!=="default"){const t=Object.getOwnPropertyDescriptor(n,l);Object.defineProperty(e,l,t.get?t:{enumerable:!0,get:()=>n[l]})}}return e.default=n,Object.freeze(e)}const i=j(b);function y(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function d(...n){return e=>{let l=!1;const t=n.map(r=>{const o=y(r,e);return!l&&typeof o=="function"&&(l=!0),o});if(l)return()=>{for(let r=0;r<t.length;r++){const o=t[r];typeof o=="function"?o():y(n[r],null)}}}}function _(...n){return i.useCallback(d(...n),n)}function m(n){const e=O(n),l=i.forwardRef((t,r)=>{const{children:o,...c}=t,u=i.Children.toArray(o),f=u.find(S);if(f){const s=f.props.children,h=u.map(p=>p===f?i.Children.count(s)>1?i.Children.only(null):i.isValidElement(s)?s.props.children:null:p);return a.yr.jsx(e,{...c,ref:r,children:i.isValidElement(s)?i.cloneElement(s,void 0,h):null})}return a.yr.jsx(e,{...c,ref:r,children:o})});return l.displayName=`${n}.Slot`,l}var x=m("Slot");function O(n){const e=i.forwardRef((l,t)=>{const{children:r,...o}=l;if(i.isValidElement(r)){const c=E(r),u=v(o,r.props);return r.type!==i.Fragment&&(u.ref=t?d(t,c):c),i.cloneElement(r,u)}return i.Children.count(r)>1?i.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var g=Symbol("radix.slottable");function C(n){const e=({children:l})=>a.yr.jsx(a.yr.Fragment,{children:l});return e.displayName=`${n}.Slottable`,e.__radixId=g,e}function S(n){return i.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===g}function v(n,e){const l={...e};for(const t in e){const r=n[t],o=e[t];/^on[A-Z]/.test(t)?r&&o?l[t]=(...c)=>{const u=o(...c);return r(...c),u}:r&&(l[t]=r):t==="style"?l[t]={...r,...o}:t==="className"&&(l[t]=[r,o].filter(Boolean).join(" "))}return{...n,...l}}function E(n){var e,l;let t=(e=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:e.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?n.ref:(t=(l=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:l.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?n.props.ref:n.props.ref||n.ref)}exports._=C;exports.g=m;exports.j=x;exports.m=d;exports.x=_;
|
package/dist/index.es.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|