welcome-ui 1.0.0-beta.1 → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion.js +89 -0
- package/dist/Accordion.mjs +579 -0
- package/dist/Alert.js +1 -0
- package/dist/Alert.mjs +7 -0
- package/dist/AspectRatio.js +29 -0
- package/dist/AspectRatio.mjs +41 -0
- package/dist/Avatar.js +5 -0
- package/dist/Avatar.mjs +55 -0
- package/dist/Badge.js +17 -0
- package/dist/Badge.mjs +53 -0
- package/dist/Box.js +1 -0
- package/dist/Box.mjs +8 -0
- package/dist/Breadcrumb.js +54 -0
- package/dist/Breadcrumb.mjs +439 -0
- package/dist/Flex.js +1 -0
- package/dist/Flex.mjs +26 -0
- package/dist/System.js +1 -0
- package/dist/System.mjs +51 -0
- package/dist/X5NMLKT6-BC1Q56kB.mjs +1258 -0
- package/dist/X5NMLKT6-vrNG8i_R.js +14 -0
- package/dist/index-0MPAX4B5.mjs +320 -0
- package/dist/index-BNA_A0oa.js +155 -0
- package/dist/index-BXJQXgy9.js +13 -0
- package/dist/index-Bwrtxit1.mjs +84 -0
- package/dist/index-Ct2FOeyM.js +17 -0
- package/dist/index-DRNn5iIc.js +142 -0
- package/dist/index-Du8Nrf16.mjs +128 -0
- package/dist/index-MifIgNHW.mjs +47 -0
- package/dist/index-V28zHt_Z.js +68 -0
- package/dist/index-WmqrMIzg.mjs +19070 -0
- package/dist/index.js +147 -5
- package/dist/index.mjs +767 -217
- package/dist/types/components/Accordion/index.d.ts +16 -0
- package/dist/types/components/Accordion/styles.d.ts +6 -0
- package/dist/types/components/Accordion/theme.d.ts +10 -0
- package/dist/types/components/Alert/Title.d.ts +7 -0
- package/dist/types/components/Alert/index.d.ts +24 -0
- package/dist/types/components/Alert/styles.d.ts +6 -0
- package/dist/types/components/Alert/theme.d.ts +15 -0
- package/dist/types/components/AspectRatio/index.d.ts +6 -0
- package/dist/types/components/AspectRatio/styles.d.ts +2 -0
- package/dist/types/components/Avatar/index.d.ts +16 -0
- package/dist/types/components/Avatar/styles.d.ts +2 -0
- package/dist/types/components/Avatar/theme.d.ts +9 -0
- package/dist/types/components/Avatar/utils.d.ts +3 -0
- package/dist/types/components/Badge/index.d.ts +11 -0
- package/dist/types/components/Badge/styles.d.ts +8 -0
- package/dist/types/components/Badge/theme.d.ts +18 -0
- package/dist/types/components/Box/index.d.ts +3 -0
- package/dist/types/components/Breadcrumb/Item.d.ts +13 -0
- package/dist/types/components/Breadcrumb/Item.styles.d.ts +2 -0
- package/dist/types/components/Breadcrumb/index.d.ts +18 -0
- package/dist/types/components/Breadcrumb/styles.d.ts +6 -0
- package/dist/types/components/Breadcrumb/theme.d.ts +12 -0
- package/dist/types/components/Button/index.d.ts +21 -0
- package/dist/types/components/Button/styles.d.ts +2 -0
- package/dist/types/components/Button/theme.d.ts +13 -0
- package/dist/types/components/ButtonGroup/index.d.ts +15 -0
- package/dist/types/components/ButtonGroup/styles.d.ts +1 -0
- package/dist/types/components/Card/Cover.d.ts +10 -0
- package/dist/types/components/Card/Cover.styles.d.ts +1 -0
- package/dist/types/components/Card/index.d.ts +8 -0
- package/dist/types/components/Card/styles.d.ts +2 -0
- package/dist/types/components/Card/theme.d.ts +6 -0
- package/dist/types/components/ClearButton/index.d.ts +5 -0
- package/dist/types/components/ClearButton/styles.d.ts +1 -0
- package/dist/types/components/CloseButton/index.d.ts +3 -0
- package/dist/types/components/CloseButton/styles.d.ts +1 -0
- package/dist/types/components/Flex/index.d.ts +19 -0
- package/dist/types/components/System/index.d.ts +40 -0
- package/dist/types/components/WuiProvider/font.d.ts +16 -0
- package/dist/types/components/WuiProvider/hide-focus-rings-root.d.ts +8 -0
- package/dist/types/components/WuiProvider/index.d.ts +11 -0
- package/dist/types/components/WuiProvider/styles.d.ts +5 -0
- package/dist/types/components/index.d.ts +15 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/theme/borders.d.ts +6 -0
- package/dist/types/theme/colors.d.ts +346 -0
- package/dist/types/theme/dark.d.ts +7 -0
- package/dist/types/theme/focus.d.ts +10 -0
- package/dist/types/theme/fonts.d.ts +18 -0
- package/dist/types/theme/index.d.ts +76 -0
- package/dist/types/theme/radii.d.ts +12 -0
- package/dist/types/theme/screens.d.ts +13 -0
- package/dist/types/theme/selection.d.ts +4 -0
- package/dist/types/theme/shadows.d.ts +5 -0
- package/dist/types/theme/space.d.ts +18 -0
- package/dist/types/theme/transitions.d.ts +13 -0
- package/dist/types/theme/typography.d.ts +133 -0
- package/dist/types/theme/underline.d.ts +9 -0
- package/package.json +7 -2
- package/dist/Test.js +0 -3
- package/dist/Test.mjs +0 -9
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),ae=require("./index-Ct2FOeyM.js"),ie=require("./System.js"),P=require("@xstyled/styled-components"),o=require("./X5NMLKT6-vrNG8i_R.js"),ce=require("./index-DRNn5iIc.js");function le(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const q=le(g);function de(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function I(e,n){const t=e.__unstableInternals;return o.invariant(t,"Invalid store"),t[n]}function B(e,...n){let t=e,r=t,a=Symbol(),u=o.noop;const s=new Set,i=new Set,E=new Set,h=new Set,y=new Set,c=new WeakMap,m=new WeakMap,S=d=>(E.add(d),()=>E.delete(d)),b=()=>{const d=s.size,l=Symbol();s.add(l);const C=()=>{s.delete(l),!s.size&&u()};if(d)return C;const L=o.getKeys(t).map(R=>o.chain(...n.map(A=>{var O;const T=(O=A==null?void 0:A.getState)==null?void 0:O.call(A);if(T&&o.hasOwnProperty(T,R))return H(A,[R],N=>{_(R,N[R],!0)})}))),j=[];for(const R of E)j.push(R());const M=n.map(oe);return u=o.chain(...L,...j,...M),C},v=(d,l,C=h)=>(C.add(l),m.set(l,d),()=>{var L;(L=c.get(l))==null||L(),c.delete(l),m.delete(l),C.delete(l)}),x=(d,l)=>v(d,l),$=(d,l)=>(c.set(l,l(t,t)),v(d,l)),w=(d,l)=>(c.set(l,l(t,r)),v(d,l,y)),f=d=>B(o.pick(t,d),V),p=d=>B(o.omit(t,d),V),D=()=>t,_=(d,l,C=!1)=>{var L;if(!o.hasOwnProperty(t,d))return;const j=o.applyState(l,t[d]);if(j===t[d])return;if(!C)for(const O of n)(L=O==null?void 0:O.setState)==null||L.call(O,d,j);const M=t;t=o.__spreadProps(o.__spreadValues({},t),{[d]:j});const R=Symbol();a=R,i.add(d);const A=(O,T,N)=>{var J;const Q=m.get(O),ue=Z=>N?N.has(Z):Z===d;(!Q||Q.some(ue))&&((J=c.get(O))==null||J(),c.set(O,O(t,T)))};for(const O of h)A(O,M);queueMicrotask(()=>{if(a!==R)return;const O=t;for(const T of y)A(T,r,i);r=O,i.clear()})},V={getState:D,setState:_,__unstableInternals:{setup:S,init:b,subscribe:x,sync:$,batch:w,pick:f,omit:p}};return V}function K(e,...n){if(e)return I(e,"setup")(...n)}function oe(e,...n){if(e)return I(e,"init")(...n)}function se(e,...n){if(e)return I(e,"subscribe")(...n)}function H(e,...n){if(e)return I(e,"sync")(...n)}function fe(e,...n){if(e)return I(e,"batch")(...n)}function pe(e,...n){if(e)return I(e,"omit")(...n)}function me(...e){const n=e.reduce((r,a)=>{var u;const s=(u=a==null?void 0:a.getState)==null?void 0:u.call(a);return s?Object.assign(r,s):r},{}),t=B(n,...e);return Object.assign({},...e,t)}function Se(e,n){if(process.env.NODE_ENV==="production"||!n)return;const t=Object.entries(e).filter(([u,s])=>u.startsWith("default")&&s!==void 0).map(([u])=>{var s;const i=u.replace("default","");return`${((s=i[0])==null?void 0:s.toLowerCase())||""}${i.slice(1)}`});if(!t.length)return;const r=n.getState();if(t.filter(u=>o.hasOwnProperty(r,u)).length)throw new Error(`Passing a store prop in conjunction with a default state is not supported.
|
|
2
|
+
|
|
3
|
+
const store = useSelectStore();
|
|
4
|
+
<SelectProvider store={store} defaultValue="Apple" />
|
|
5
|
+
^ ^
|
|
6
|
+
|
|
7
|
+
Instead, pass the default state to the topmost store:
|
|
8
|
+
|
|
9
|
+
const store = useSelectStore({ defaultValue: "Apple" });
|
|
10
|
+
<SelectProvider store={store} />
|
|
11
|
+
|
|
12
|
+
See https://github.com/ariakit/ariakit/pull/2745 for more details.
|
|
13
|
+
|
|
14
|
+
If there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit
|
|
15
|
+
`)}var z={exports:{}},W={},ee;function ve(){if(ee)return W;ee=1;var e=g;function n(c,m){return c===m&&(c!==0||1/c===1/m)||c!==c&&m!==m}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,a=e.useEffect,u=e.useLayoutEffect,s=e.useDebugValue;function i(c,m){var S=m(),b=r({inst:{value:S,getSnapshot:m}}),v=b[0].inst,x=b[1];return u(function(){v.value=S,v.getSnapshot=m,E(v)&&x({inst:v})},[c,S,m]),a(function(){return E(v)&&x({inst:v}),c(function(){E(v)&&x({inst:v})})},[c]),s(S),S}function E(c){var m=c.getSnapshot;c=c.value;try{var S=m();return!t(c,S)}catch{return!0}}function h(c,m){return m()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:i;return W.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,W}var G={},te;function _e(){return te||(te=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=g,n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function t(f){{for(var p=arguments.length,D=new Array(p>1?p-1:0),_=1;_<p;_++)D[_-1]=arguments[_];r("error",f,D)}}function r(f,p,D){{var _=n.ReactDebugCurrentFrame,V=_.getStackAddendum();V!==""&&(p+="%s",D=D.concat([V]));var d=D.map(function(l){return String(l)});d.unshift("Warning: "+p),Function.prototype.apply.call(console[f],console,d)}}function a(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var u=typeof Object.is=="function"?Object.is:a,s=e.useState,i=e.useEffect,E=e.useLayoutEffect,h=e.useDebugValue,y=!1,c=!1;function m(f,p,D){y||e.startTransition!==void 0&&(y=!0,t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var _=p();if(!c){var V=p();u(_,V)||(t("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var d=s({inst:{value:_,getSnapshot:p}}),l=d[0].inst,C=d[1];return E(function(){l.value=_,l.getSnapshot=p,S(l)&&C({inst:l})},[f,_,p]),i(function(){S(l)&&C({inst:l});var L=function(){S(l)&&C({inst:l})};return f(L)},[f]),h(_),_}function S(f){var p=f.getSnapshot,D=f.value;try{var _=p();return!u(D,_)}catch{return!0}}function b(f,p,D){return p()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",x=!v,$=x?b:m,w=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:$;G.useSyncExternalStore=w,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),G}process.env.NODE_ENV==="production"?z.exports=ve():z.exports=_e();var Ee=z.exports;const ge=de(Ee);var{useSyncExternalStore:he}=ge,ye=()=>()=>{};function k(e,n=o.identity){const t=q.useCallback(a=>e?se(e,null,a):ye(),[e]),r=()=>{const a=typeof n=="string"?n:null,u=typeof n=="function"?n:null,s=e==null?void 0:e.getState();if(u)return u(s);if(s&&a&&o.hasOwnProperty(s,a))return s[a]};return he(t,r,r)}function F(e,n,t,r){const a=o.hasOwnProperty(n,t)?n[t]:void 0,u=r?n[r]:void 0,s=o.useLiveRef({value:a,setValue:u});o.useSafeLayoutEffect(()=>H(e,[t],(i,E)=>{const{value:h,setValue:y}=s.current;y&&i[t]!==E[t]&&i[t]!==h&&y(i[t])}),[e,t]),o.useSafeLayoutEffect(()=>{if(a!==void 0)return e.setState(t,a),fe(e,[t],()=>{a!==void 0&&e.setState(t,a)})})}function Oe(e,n){const[t,r]=q.useState(()=>e(n));o.useSafeLayoutEffect(()=>oe(t),[t]);const a=q.useCallback(i=>k(t,i),[t]),u=q.useMemo(()=>o.__spreadProps$1(o.__spreadValues$1({},t),{useState:a}),[t,a]),s=o.useEvent(()=>{r(i=>e(o.__spreadValues$1(o.__spreadValues$1({},n),i.getState())))});return[u,s]}function be(e={}){const n=me(e.store,pe(e.disclosure,["contentElement","disclosureElement"]));Se(e,n);const t=n==null?void 0:n.getState(),r=o.defaultValue(e.open,t==null?void 0:t.open,e.defaultOpen,!1),a=o.defaultValue(e.animated,t==null?void 0:t.animated,!1),u={open:r,animated:a,animating:!!a&&r,mounted:r,contentElement:o.defaultValue(t==null?void 0:t.contentElement,null),disclosureElement:o.defaultValue(t==null?void 0:t.disclosureElement,null)},s=B(u,n);return K(s,()=>H(s,["animated","animating"],i=>{i.animated||s.setState("animating",!1)})),K(s,()=>se(s,["open"],()=>{s.getState().animated&&s.setState("animating",!0)})),K(s,()=>H(s,["open","animating"],i=>{s.setState("mounted",i.open||i.animating)})),o.__spreadProps(o.__spreadValues({},s),{disclosure:e.disclosure,setOpen:i=>s.setState("open",i),show:()=>s.setState("open",!0),hide:()=>s.setState("open",!1),toggle:()=>s.setState("open",i=>!i),stopAnimation:()=>s.setState("animating",!1),setContentElement:i=>s.setState("contentElement",i),setDisclosureElement:i=>s.setState("disclosureElement",i)})}function De(e,n,t){return o.useUpdateEffect(n,[t.store,t.disclosure]),F(e,t,"open","setOpen"),F(e,t,"mounted","setMounted"),F(e,t,"animated"),Object.assign(e,{disclosure:t.disclosure})}function xe(e={}){const[n,t]=Oe(be,e);return De(n,t,e)}var Y=o.createStoreContext(),X=Y.useProviderContext,we=Y.ContextProvider,Ce=Y.ScopedContextProvider,Pe=o.createStoreContext([we],[Ce]),Ve=Pe.ScopedContextProvider;g.createContext(void 0);g.createContext(void 0);var Le="button",Re=Symbol("disclosure"),$e=o.createHook(function(n){var t=n,{store:r,toggleOnClick:a=!0}=t,u=o.__objRest(t,["store","toggleOnClick"]);const s=X();r=r||s,o.invariant(r,process.env.NODE_ENV!=="production"&&"Disclosure must receive a `store` prop or be wrapped in a DisclosureProvider component.");const i=g.useRef(null),[E,h]=g.useState(!1),y=r.useState("disclosureElement"),c=r.useState("open");g.useEffect(()=>{let w=y===i.current;y!=null&&y.isConnected||(r==null||r.setDisclosureElement(i.current),w=!0),h(c&&w)},[y,r,c]);const m=u.onClick,S=o.useBooleanEvent(a),[b,v]=o.useMetadataProps(u,Re,!0),x=o.useEvent(w=>{m==null||m(w),!w.defaultPrevented&&(b||S(w)&&(r==null||r.setDisclosureElement(w.currentTarget),r==null||r.toggle()))}),$=r.useState("contentElement");return u=o.__spreadProps$1(o.__spreadValues$1(o.__spreadValues$1({"aria-expanded":E,"aria-controls":$==null?void 0:$.id},v),u),{ref:o.useMergeRefs(i,u.ref),onClick:x}),u=o.useButton(u),u}),Ae=o.forwardRef2(function(n){const t=$e(n);return o.createElement(Le,t)}),je="div";function ne(e,n){const t=setTimeout(n,e);return()=>clearTimeout(t)}function Te(e){let n=requestAnimationFrame(()=>{n=requestAnimationFrame(e)});return()=>cancelAnimationFrame(n)}function re(...e){return e.join(", ").split(", ").reduce((n,t)=>{const r=t.endsWith("ms")?1:1e3,a=Number.parseFloat(t||"0s")*r;return a>n?a:n},0)}function Ie(e,n,t){return!t&&n!==!1&&(!e||!!n)}var Me=o.createHook(function(n){var t=n,{store:r,alwaysVisible:a}=t,u=o.__objRest(t,["store","alwaysVisible"]);const s=X();r=r||s,o.invariant(r,process.env.NODE_ENV!=="production"&&"DisclosureContent must receive a `store` prop or be wrapped in a DisclosureProvider component.");const i=g.useRef(null),E=o.useId(u.id),[h,y]=g.useState(null),c=r.useState("open"),m=r.useState("mounted"),S=r.useState("animated"),b=r.useState("contentElement"),v=k(r.disclosure,"contentElement");o.useSafeLayoutEffect(()=>{i.current&&(r==null||r.setContentElement(i.current))},[r]),o.useSafeLayoutEffect(()=>{let f;return r==null||r.setState("animated",p=>(f=p,!0)),()=>{f!==void 0&&(r==null||r.setState("animated",f))}},[r]),o.useSafeLayoutEffect(()=>{if(S){if(!(b!=null&&b.isConnected)){y(null);return}return Te(()=>{y(c?"enter":m?"leave":null)})}},[S,b,c,m]),o.useSafeLayoutEffect(()=>{if(!r||!S||!h||!b)return;const f=()=>r==null?void 0:r.setState("animating",!1),p=()=>ce.reactDomExports.flushSync(f);if(h==="leave"&&c||h==="enter"&&!c)return;if(typeof S=="number")return ne(S,p);const{transitionDuration:D,animationDuration:_,transitionDelay:V,animationDelay:d}=getComputedStyle(b),{transitionDuration:l="0",animationDuration:C="0",transitionDelay:L="0",animationDelay:j="0"}=v?getComputedStyle(v):{},M=re(V,d,L,j),R=re(D,_,l,C),A=M+R;if(!A){h==="enter"&&r.setState("animated",!1),f();return}const O=1e3/60,T=Math.max(A-O,0);return ne(T,p)},[r,S,b,v,c,h]),u=o.useWrapElement(u,f=>o.jsxRuntimeExports.jsx(Ve,{value:r,children:f}),[r]);const x=Ie(m,u.hidden,a),$=u.style,w=g.useMemo(()=>x?o.__spreadProps$1(o.__spreadValues$1({},$),{display:"none"}):$,[x,$]);return u=o.__spreadProps$1(o.__spreadValues$1({id:E,"data-open":c||void 0,"data-enter":h==="enter"||void 0,"data-leave":h==="leave"||void 0,hidden:x},u),{ref:o.useMergeRefs(E?r.setContentElement:null,i,u.ref),style:w}),o.removeUndefinedValues(u)}),Ne=o.forwardRef2(function(n){const t=Me(n);return o.createElement(je,t)}),qe=o.forwardRef2(function(n){var t=n,{unmountOnHide:r}=t,a=o.__objRest(t,["unmountOnHide"]);const u=X(),s=a.store||u;return k(s,E=>!r||(E==null?void 0:E.mounted))===!1?null:o.jsxRuntimeExports.jsx(Ne,o.__spreadValues$1({},a))});const Ue=P.div`
|
|
16
|
+
${P.th("accordions.wrapper")};
|
|
17
|
+
${P.system};
|
|
18
|
+
transition: medium;
|
|
19
|
+
|
|
20
|
+
&:hover {
|
|
21
|
+
border-color: neutral-50;
|
|
22
|
+
}
|
|
23
|
+
`,U=P.divBox`
|
|
24
|
+
flex-shrink: 0;
|
|
25
|
+
${P.th("accordions.icon")};
|
|
26
|
+
transform: rotate3d(0);
|
|
27
|
+
transition: medium;
|
|
28
|
+
width: 24;
|
|
29
|
+
height: 24;
|
|
30
|
+
color: inherit;
|
|
31
|
+
display: flex;
|
|
32
|
+
border-radius: 12;
|
|
33
|
+
|
|
34
|
+
& *:first-child {
|
|
35
|
+
margin: auto;
|
|
36
|
+
}
|
|
37
|
+
`,Be=P(Ae)`
|
|
38
|
+
${P.th("accordions.title")};
|
|
39
|
+
width: 100%;
|
|
40
|
+
padding: ${P.th("accordions.padding")};
|
|
41
|
+
background-color: transparent;
|
|
42
|
+
border: 0;
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: xxl;
|
|
47
|
+
|
|
48
|
+
&[aria-expanded='true'] {
|
|
49
|
+
${U} {
|
|
50
|
+
transform: rotate3d(0, 0, 1, 90deg);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:focus,
|
|
55
|
+
&:hover {
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
${U} {
|
|
58
|
+
background-color: neutral-30;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&:focus {
|
|
63
|
+
outline: 0;
|
|
64
|
+
${U} {
|
|
65
|
+
color: inherit;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
`,He=P(qe)`
|
|
69
|
+
display: grid;
|
|
70
|
+
grid-template-rows: 0fr;
|
|
71
|
+
transition-property: grid-template-rows;
|
|
72
|
+
transition-timing-function: linear;
|
|
73
|
+
transition-duration: 200ms;
|
|
74
|
+
animation-duration: 200ms;
|
|
75
|
+
|
|
76
|
+
> * {
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
padding: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&[data-enter] {
|
|
82
|
+
grid-template-rows: 1fr;
|
|
83
|
+
}
|
|
84
|
+
`,Ke=P.div`
|
|
85
|
+
${P.th("accordions.content")};
|
|
86
|
+
padding: ${P.th("accordions.padding")};
|
|
87
|
+
padding-top: 0;
|
|
88
|
+
color: neutral-70;
|
|
89
|
+
`,We=ie.forwardRef(({children:e,dataTestId:n,icon:t=g.createElement(ae.RightIcon,null),store:r,title:a,...u},s)=>g.createElement(Ue,{"data-testid":n,ref:s,...u},g.createElement(Be,{"data-testid":n?`${n}-title`:void 0,store:r},a,g.createElement(U,null,g.cloneElement(t,{size:"sm"}))),g.createElement(He,{"data-testid":n?`${n}-content`:void 0,store:r},g.createElement("div",null,g.createElement(Ke,null,e)))));function Ge(e){return xe({animated:!0,...e})}exports.Accordion=We;exports.useAccordion=Ge;
|
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as K from "react";
|
|
3
|
+
import L, { createContext as pe, useRef as me, useState as Se, useEffect as we, useMemo as Pe, cloneElement as Ae } from "react";
|
|
4
|
+
import { R as Re } from "./index-Bwrtxit1.mjs";
|
|
5
|
+
import { forwardRef as Le } from "./System.mjs";
|
|
6
|
+
import q, { th as I, system as Ve } from "@xstyled/styled-components";
|
|
7
|
+
import { i as Z, h as B, g as Te, c as ue, p as $e, o as je, a as Ie, _ as ve, b as Ee, n as Ne, d as Me, u as j, e as G, f as $, j as _e, k as Ue, l as H, m as Be, q as ge, r as he, s as ee, t as te, v as qe, w as He, x as ye, y as Ke, z as De, A as We, C as Ge, D as Fe, E as Oe } from "./X5NMLKT6-BC1Q56kB.mjs";
|
|
8
|
+
import { r as ze } from "./index-WmqrMIzg.mjs";
|
|
9
|
+
function Ye(e) {
|
|
10
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
11
|
+
}
|
|
12
|
+
function N(e, n) {
|
|
13
|
+
const t = e.__unstableInternals;
|
|
14
|
+
return Z(t, "Invalid store"), t[n];
|
|
15
|
+
}
|
|
16
|
+
function F(e, ...n) {
|
|
17
|
+
let t = e, r = t, a = Symbol(), s = Ne;
|
|
18
|
+
const o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), m = (l) => (E.add(l), () => E.delete(l)), y = () => {
|
|
19
|
+
const l = o.size, c = Symbol();
|
|
20
|
+
o.add(c);
|
|
21
|
+
const x = () => {
|
|
22
|
+
o.delete(c), !o.size && s();
|
|
23
|
+
};
|
|
24
|
+
if (l) return x;
|
|
25
|
+
const w = Te(t).map(
|
|
26
|
+
(P) => ue(
|
|
27
|
+
...n.map((R) => {
|
|
28
|
+
var h;
|
|
29
|
+
const T = (h = R == null ? void 0 : R.getState) == null ? void 0 : h.call(R);
|
|
30
|
+
if (T && B(T, P))
|
|
31
|
+
return z(R, [P], (U) => {
|
|
32
|
+
v(
|
|
33
|
+
P,
|
|
34
|
+
U[P],
|
|
35
|
+
// @ts-expect-error - Not public API. This is just to prevent
|
|
36
|
+
// infinite loops.
|
|
37
|
+
!0
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
})
|
|
41
|
+
)
|
|
42
|
+
), V = [];
|
|
43
|
+
for (const P of E)
|
|
44
|
+
V.push(P());
|
|
45
|
+
const M = n.map(be);
|
|
46
|
+
return s = ue(...w, ...V, ...M), x;
|
|
47
|
+
}, S = (l, c, x = _) => (x.add(c), p.set(c, l), () => {
|
|
48
|
+
var w;
|
|
49
|
+
(w = u.get(c)) == null || w(), u.delete(c), p.delete(c), x.delete(c);
|
|
50
|
+
}), O = (l, c) => S(l, c), A = (l, c) => (u.set(c, c(t, t)), S(l, c)), b = (l, c) => (u.set(c, c(t, r)), S(l, c, g)), d = (l) => F($e(t, l), C), f = (l) => F(je(t, l), C), D = () => t, v = (l, c, x = !1) => {
|
|
51
|
+
var w;
|
|
52
|
+
if (!B(t, l)) return;
|
|
53
|
+
const V = Ie(c, t[l]);
|
|
54
|
+
if (V === t[l]) return;
|
|
55
|
+
if (!x)
|
|
56
|
+
for (const h of n)
|
|
57
|
+
(w = h == null ? void 0 : h.setState) == null || w.call(h, l, V);
|
|
58
|
+
const M = t;
|
|
59
|
+
t = ve(Ee({}, t), { [l]: V });
|
|
60
|
+
const P = Symbol();
|
|
61
|
+
a = P, i.add(l);
|
|
62
|
+
const R = (h, T, U) => {
|
|
63
|
+
var se;
|
|
64
|
+
const ae = p.get(h), Ce = (ie) => U ? U.has(ie) : ie === l;
|
|
65
|
+
(!ae || ae.some(Ce)) && ((se = u.get(h)) == null || se(), u.set(h, h(t, T)));
|
|
66
|
+
};
|
|
67
|
+
for (const h of _)
|
|
68
|
+
R(h, M);
|
|
69
|
+
queueMicrotask(() => {
|
|
70
|
+
if (a !== P) return;
|
|
71
|
+
const h = t;
|
|
72
|
+
for (const T of g)
|
|
73
|
+
R(T, r, i);
|
|
74
|
+
r = h, i.clear();
|
|
75
|
+
});
|
|
76
|
+
}, C = {
|
|
77
|
+
getState: D,
|
|
78
|
+
setState: v,
|
|
79
|
+
__unstableInternals: {
|
|
80
|
+
setup: m,
|
|
81
|
+
init: y,
|
|
82
|
+
subscribe: O,
|
|
83
|
+
sync: A,
|
|
84
|
+
batch: b,
|
|
85
|
+
pick: d,
|
|
86
|
+
omit: f
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
return C;
|
|
90
|
+
}
|
|
91
|
+
function Y(e, ...n) {
|
|
92
|
+
if (e)
|
|
93
|
+
return N(e, "setup")(...n);
|
|
94
|
+
}
|
|
95
|
+
function be(e, ...n) {
|
|
96
|
+
if (e)
|
|
97
|
+
return N(e, "init")(...n);
|
|
98
|
+
}
|
|
99
|
+
function xe(e, ...n) {
|
|
100
|
+
if (e)
|
|
101
|
+
return N(e, "subscribe")(...n);
|
|
102
|
+
}
|
|
103
|
+
function z(e, ...n) {
|
|
104
|
+
if (e)
|
|
105
|
+
return N(e, "sync")(...n);
|
|
106
|
+
}
|
|
107
|
+
function ke(e, ...n) {
|
|
108
|
+
if (e)
|
|
109
|
+
return N(e, "batch")(...n);
|
|
110
|
+
}
|
|
111
|
+
function Je(e, ...n) {
|
|
112
|
+
if (e)
|
|
113
|
+
return N(e, "omit")(...n);
|
|
114
|
+
}
|
|
115
|
+
function Qe(...e) {
|
|
116
|
+
const n = e.reduce((r, a) => {
|
|
117
|
+
var s;
|
|
118
|
+
const o = (s = a == null ? void 0 : a.getState) == null ? void 0 : s.call(a);
|
|
119
|
+
return o ? Object.assign(r, o) : r;
|
|
120
|
+
}, {}), t = F(n, ...e);
|
|
121
|
+
return Object.assign({}, ...e, t);
|
|
122
|
+
}
|
|
123
|
+
function Xe(e, n) {
|
|
124
|
+
if (process.env.NODE_ENV === "production" || !n) return;
|
|
125
|
+
const t = Object.entries(e).filter(([s, o]) => s.startsWith("default") && o !== void 0).map(([s]) => {
|
|
126
|
+
var o;
|
|
127
|
+
const i = s.replace("default", "");
|
|
128
|
+
return `${((o = i[0]) == null ? void 0 : o.toLowerCase()) || ""}${i.slice(1)}`;
|
|
129
|
+
});
|
|
130
|
+
if (!t.length) return;
|
|
131
|
+
const r = n.getState();
|
|
132
|
+
if (t.filter(
|
|
133
|
+
(s) => B(r, s)
|
|
134
|
+
).length)
|
|
135
|
+
throw new Error(
|
|
136
|
+
`Passing a store prop in conjunction with a default state is not supported.
|
|
137
|
+
|
|
138
|
+
const store = useSelectStore();
|
|
139
|
+
<SelectProvider store={store} defaultValue="Apple" />
|
|
140
|
+
^ ^
|
|
141
|
+
|
|
142
|
+
Instead, pass the default state to the topmost store:
|
|
143
|
+
|
|
144
|
+
const store = useSelectStore({ defaultValue: "Apple" });
|
|
145
|
+
<SelectProvider store={store} />
|
|
146
|
+
|
|
147
|
+
See https://github.com/ariakit/ariakit/pull/2745 for more details.
|
|
148
|
+
|
|
149
|
+
If there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit
|
|
150
|
+
`
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
var X = { exports: {} }, k = {}, ce;
|
|
154
|
+
function Ze() {
|
|
155
|
+
if (ce) return k;
|
|
156
|
+
ce = 1;
|
|
157
|
+
var e = L;
|
|
158
|
+
function n(u, p) {
|
|
159
|
+
return u === p && (u !== 0 || 1 / u === 1 / p) || u !== u && p !== p;
|
|
160
|
+
}
|
|
161
|
+
var t = typeof Object.is == "function" ? Object.is : n, r = e.useState, a = e.useEffect, s = e.useLayoutEffect, o = e.useDebugValue;
|
|
162
|
+
function i(u, p) {
|
|
163
|
+
var m = p(), y = r({ inst: { value: m, getSnapshot: p } }), S = y[0].inst, O = y[1];
|
|
164
|
+
return s(function() {
|
|
165
|
+
S.value = m, S.getSnapshot = p, E(S) && O({ inst: S });
|
|
166
|
+
}, [u, m, p]), a(function() {
|
|
167
|
+
return E(S) && O({ inst: S }), u(function() {
|
|
168
|
+
E(S) && O({ inst: S });
|
|
169
|
+
});
|
|
170
|
+
}, [u]), o(m), m;
|
|
171
|
+
}
|
|
172
|
+
function E(u) {
|
|
173
|
+
var p = u.getSnapshot;
|
|
174
|
+
u = u.value;
|
|
175
|
+
try {
|
|
176
|
+
var m = p();
|
|
177
|
+
return !t(u, m);
|
|
178
|
+
} catch {
|
|
179
|
+
return !0;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function _(u, p) {
|
|
183
|
+
return p();
|
|
184
|
+
}
|
|
185
|
+
var g = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? _ : i;
|
|
186
|
+
return k.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : g, k;
|
|
187
|
+
}
|
|
188
|
+
var J = {}, le;
|
|
189
|
+
function et() {
|
|
190
|
+
return le || (le = 1, process.env.NODE_ENV !== "production" && function() {
|
|
191
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
192
|
+
var e = L, n = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
193
|
+
function t(d) {
|
|
194
|
+
{
|
|
195
|
+
for (var f = arguments.length, D = new Array(f > 1 ? f - 1 : 0), v = 1; v < f; v++)
|
|
196
|
+
D[v - 1] = arguments[v];
|
|
197
|
+
r("error", d, D);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function r(d, f, D) {
|
|
201
|
+
{
|
|
202
|
+
var v = n.ReactDebugCurrentFrame, C = v.getStackAddendum();
|
|
203
|
+
C !== "" && (f += "%s", D = D.concat([C]));
|
|
204
|
+
var l = D.map(function(c) {
|
|
205
|
+
return String(c);
|
|
206
|
+
});
|
|
207
|
+
l.unshift("Warning: " + f), Function.prototype.apply.call(console[d], console, l);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
function a(d, f) {
|
|
211
|
+
return d === f && (d !== 0 || 1 / d === 1 / f) || d !== d && f !== f;
|
|
212
|
+
}
|
|
213
|
+
var s = typeof Object.is == "function" ? Object.is : a, o = e.useState, i = e.useEffect, E = e.useLayoutEffect, _ = e.useDebugValue, g = !1, u = !1;
|
|
214
|
+
function p(d, f, D) {
|
|
215
|
+
g || e.startTransition !== void 0 && (g = !0, t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
|
|
216
|
+
var v = f();
|
|
217
|
+
if (!u) {
|
|
218
|
+
var C = f();
|
|
219
|
+
s(v, C) || (t("The result of getSnapshot should be cached to avoid an infinite loop"), u = !0);
|
|
220
|
+
}
|
|
221
|
+
var l = o({
|
|
222
|
+
inst: {
|
|
223
|
+
value: v,
|
|
224
|
+
getSnapshot: f
|
|
225
|
+
}
|
|
226
|
+
}), c = l[0].inst, x = l[1];
|
|
227
|
+
return E(function() {
|
|
228
|
+
c.value = v, c.getSnapshot = f, m(c) && x({
|
|
229
|
+
inst: c
|
|
230
|
+
});
|
|
231
|
+
}, [d, v, f]), i(function() {
|
|
232
|
+
m(c) && x({
|
|
233
|
+
inst: c
|
|
234
|
+
});
|
|
235
|
+
var w = function() {
|
|
236
|
+
m(c) && x({
|
|
237
|
+
inst: c
|
|
238
|
+
});
|
|
239
|
+
};
|
|
240
|
+
return d(w);
|
|
241
|
+
}, [d]), _(v), v;
|
|
242
|
+
}
|
|
243
|
+
function m(d) {
|
|
244
|
+
var f = d.getSnapshot, D = d.value;
|
|
245
|
+
try {
|
|
246
|
+
var v = f();
|
|
247
|
+
return !s(D, v);
|
|
248
|
+
} catch {
|
|
249
|
+
return !0;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
function y(d, f, D) {
|
|
253
|
+
return f();
|
|
254
|
+
}
|
|
255
|
+
var S = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", O = !S, A = O ? y : p, b = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : A;
|
|
256
|
+
J.useSyncExternalStore = b, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
257
|
+
}()), J;
|
|
258
|
+
}
|
|
259
|
+
process.env.NODE_ENV === "production" ? X.exports = Ze() : X.exports = et();
|
|
260
|
+
var tt = X.exports;
|
|
261
|
+
const nt = /* @__PURE__ */ Ye(tt);
|
|
262
|
+
var { useSyncExternalStore: rt } = nt, ot = () => () => {
|
|
263
|
+
};
|
|
264
|
+
function ne(e, n = Me) {
|
|
265
|
+
const t = K.useCallback(
|
|
266
|
+
(a) => e ? xe(e, null, a) : ot(),
|
|
267
|
+
[e]
|
|
268
|
+
), r = () => {
|
|
269
|
+
const a = typeof n == "string" ? n : null, s = typeof n == "function" ? n : null, o = e == null ? void 0 : e.getState();
|
|
270
|
+
if (s) return s(o);
|
|
271
|
+
if (o && a && B(o, a))
|
|
272
|
+
return o[a];
|
|
273
|
+
};
|
|
274
|
+
return rt(t, r, r);
|
|
275
|
+
}
|
|
276
|
+
function Q(e, n, t, r) {
|
|
277
|
+
const a = B(n, t) ? n[t] : void 0, s = r ? n[r] : void 0, o = Ue({ value: a, setValue: s });
|
|
278
|
+
j(() => z(e, [t], (i, E) => {
|
|
279
|
+
const { value: _, setValue: g } = o.current;
|
|
280
|
+
g && i[t] !== E[t] && i[t] !== _ && g(i[t]);
|
|
281
|
+
}), [e, t]), j(() => {
|
|
282
|
+
if (a !== void 0)
|
|
283
|
+
return e.setState(t, a), ke(e, [t], () => {
|
|
284
|
+
a !== void 0 && e.setState(t, a);
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
function st(e, n) {
|
|
289
|
+
const [t, r] = K.useState(() => e(n));
|
|
290
|
+
j(() => be(t), [t]);
|
|
291
|
+
const a = K.useCallback(
|
|
292
|
+
(i) => ne(t, i),
|
|
293
|
+
[t]
|
|
294
|
+
), s = K.useMemo(
|
|
295
|
+
() => G($({}, t), { useState: a }),
|
|
296
|
+
[t, a]
|
|
297
|
+
), o = _e(() => {
|
|
298
|
+
r((i) => e($($({}, n), i.getState())));
|
|
299
|
+
});
|
|
300
|
+
return [s, o];
|
|
301
|
+
}
|
|
302
|
+
function at(e = {}) {
|
|
303
|
+
const n = Qe(
|
|
304
|
+
e.store,
|
|
305
|
+
Je(e.disclosure, ["contentElement", "disclosureElement"])
|
|
306
|
+
);
|
|
307
|
+
Xe(e, n);
|
|
308
|
+
const t = n == null ? void 0 : n.getState(), r = H(
|
|
309
|
+
e.open,
|
|
310
|
+
t == null ? void 0 : t.open,
|
|
311
|
+
e.defaultOpen,
|
|
312
|
+
!1
|
|
313
|
+
), a = H(e.animated, t == null ? void 0 : t.animated, !1), s = {
|
|
314
|
+
open: r,
|
|
315
|
+
animated: a,
|
|
316
|
+
animating: !!a && r,
|
|
317
|
+
mounted: r,
|
|
318
|
+
contentElement: H(t == null ? void 0 : t.contentElement, null),
|
|
319
|
+
disclosureElement: H(t == null ? void 0 : t.disclosureElement, null)
|
|
320
|
+
}, o = F(s, n);
|
|
321
|
+
return Y(
|
|
322
|
+
o,
|
|
323
|
+
() => z(o, ["animated", "animating"], (i) => {
|
|
324
|
+
i.animated || o.setState("animating", !1);
|
|
325
|
+
})
|
|
326
|
+
), Y(
|
|
327
|
+
o,
|
|
328
|
+
() => xe(o, ["open"], () => {
|
|
329
|
+
o.getState().animated && o.setState("animating", !0);
|
|
330
|
+
})
|
|
331
|
+
), Y(
|
|
332
|
+
o,
|
|
333
|
+
() => z(o, ["open", "animating"], (i) => {
|
|
334
|
+
o.setState("mounted", i.open || i.animating);
|
|
335
|
+
})
|
|
336
|
+
), ve(Ee({}, o), {
|
|
337
|
+
disclosure: e.disclosure,
|
|
338
|
+
setOpen: (i) => o.setState("open", i),
|
|
339
|
+
show: () => o.setState("open", !0),
|
|
340
|
+
hide: () => o.setState("open", !1),
|
|
341
|
+
toggle: () => o.setState("open", (i) => !i),
|
|
342
|
+
stopAnimation: () => o.setState("animating", !1),
|
|
343
|
+
setContentElement: (i) => o.setState("contentElement", i),
|
|
344
|
+
setDisclosureElement: (i) => o.setState("disclosureElement", i)
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
function it(e, n, t) {
|
|
348
|
+
return Be(n, [t.store, t.disclosure]), Q(e, t, "open", "setOpen"), Q(e, t, "mounted", "setMounted"), Q(e, t, "animated"), Object.assign(e, { disclosure: t.disclosure });
|
|
349
|
+
}
|
|
350
|
+
function ut(e = {}) {
|
|
351
|
+
const [n, t] = st(at, e);
|
|
352
|
+
return it(n, t, e);
|
|
353
|
+
}
|
|
354
|
+
var re = ge(), oe = re.useProviderContext, ct = re.ContextProvider, lt = re.ScopedContextProvider, dt = ge(
|
|
355
|
+
[ct],
|
|
356
|
+
[lt]
|
|
357
|
+
), ft = dt.ScopedContextProvider;
|
|
358
|
+
pe(void 0);
|
|
359
|
+
pe(void 0);
|
|
360
|
+
var pt = "button", mt = Symbol("disclosure"), St = he(
|
|
361
|
+
function(n) {
|
|
362
|
+
var t = n, { store: r, toggleOnClick: a = !0 } = t, s = te(t, ["store", "toggleOnClick"]);
|
|
363
|
+
const o = oe();
|
|
364
|
+
r = r || o, Z(
|
|
365
|
+
r,
|
|
366
|
+
process.env.NODE_ENV !== "production" && "Disclosure must receive a `store` prop or be wrapped in a DisclosureProvider component."
|
|
367
|
+
);
|
|
368
|
+
const i = me(null), [E, _] = Se(!1), g = r.useState("disclosureElement"), u = r.useState("open");
|
|
369
|
+
we(() => {
|
|
370
|
+
let b = g === i.current;
|
|
371
|
+
g != null && g.isConnected || (r == null || r.setDisclosureElement(i.current), b = !0), _(u && b);
|
|
372
|
+
}, [g, r, u]);
|
|
373
|
+
const p = s.onClick, m = qe(a), [y, S] = He(s, mt, !0), O = _e((b) => {
|
|
374
|
+
p == null || p(b), !b.defaultPrevented && (y || m(b) && (r == null || r.setDisclosureElement(b.currentTarget), r == null || r.toggle()));
|
|
375
|
+
}), A = r.useState("contentElement");
|
|
376
|
+
return s = G($($({
|
|
377
|
+
"aria-expanded": E,
|
|
378
|
+
"aria-controls": A == null ? void 0 : A.id
|
|
379
|
+
}, S), s), {
|
|
380
|
+
ref: ye(i, s.ref),
|
|
381
|
+
onClick: O
|
|
382
|
+
}), s = Ke(s), s;
|
|
383
|
+
}
|
|
384
|
+
), vt = ee(function(n) {
|
|
385
|
+
const t = St(n);
|
|
386
|
+
return De(pt, t);
|
|
387
|
+
}), Et = "div";
|
|
388
|
+
function de(e, n) {
|
|
389
|
+
const t = setTimeout(n, e);
|
|
390
|
+
return () => clearTimeout(t);
|
|
391
|
+
}
|
|
392
|
+
function _t(e) {
|
|
393
|
+
let n = requestAnimationFrame(() => {
|
|
394
|
+
n = requestAnimationFrame(e);
|
|
395
|
+
});
|
|
396
|
+
return () => cancelAnimationFrame(n);
|
|
397
|
+
}
|
|
398
|
+
function fe(...e) {
|
|
399
|
+
return e.join(", ").split(", ").reduce((n, t) => {
|
|
400
|
+
const r = t.endsWith("ms") ? 1 : 1e3, a = Number.parseFloat(t || "0s") * r;
|
|
401
|
+
return a > n ? a : n;
|
|
402
|
+
}, 0);
|
|
403
|
+
}
|
|
404
|
+
function gt(e, n, t) {
|
|
405
|
+
return !t && n !== !1 && (!e || !!n);
|
|
406
|
+
}
|
|
407
|
+
var ht = he(function(n) {
|
|
408
|
+
var t = n, { store: r, alwaysVisible: a } = t, s = te(t, ["store", "alwaysVisible"]);
|
|
409
|
+
const o = oe();
|
|
410
|
+
r = r || o, Z(
|
|
411
|
+
r,
|
|
412
|
+
process.env.NODE_ENV !== "production" && "DisclosureContent must receive a `store` prop or be wrapped in a DisclosureProvider component."
|
|
413
|
+
);
|
|
414
|
+
const i = me(null), E = We(s.id), [_, g] = Se(null), u = r.useState("open"), p = r.useState("mounted"), m = r.useState("animated"), y = r.useState("contentElement"), S = ne(r.disclosure, "contentElement");
|
|
415
|
+
j(() => {
|
|
416
|
+
i.current && (r == null || r.setContentElement(i.current));
|
|
417
|
+
}, [r]), j(() => {
|
|
418
|
+
let d;
|
|
419
|
+
return r == null || r.setState("animated", (f) => (d = f, !0)), () => {
|
|
420
|
+
d !== void 0 && (r == null || r.setState("animated", d));
|
|
421
|
+
};
|
|
422
|
+
}, [r]), j(() => {
|
|
423
|
+
if (m) {
|
|
424
|
+
if (!(y != null && y.isConnected)) {
|
|
425
|
+
g(null);
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
return _t(() => {
|
|
429
|
+
g(u ? "enter" : p ? "leave" : null);
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
}, [m, y, u, p]), j(() => {
|
|
433
|
+
if (!r || !m || !_ || !y) return;
|
|
434
|
+
const d = () => r == null ? void 0 : r.setState("animating", !1), f = () => ze.flushSync(d);
|
|
435
|
+
if (_ === "leave" && u || _ === "enter" && !u) return;
|
|
436
|
+
if (typeof m == "number")
|
|
437
|
+
return de(m, f);
|
|
438
|
+
const {
|
|
439
|
+
transitionDuration: D,
|
|
440
|
+
animationDuration: v,
|
|
441
|
+
transitionDelay: C,
|
|
442
|
+
animationDelay: l
|
|
443
|
+
} = getComputedStyle(y), {
|
|
444
|
+
transitionDuration: c = "0",
|
|
445
|
+
animationDuration: x = "0",
|
|
446
|
+
transitionDelay: w = "0",
|
|
447
|
+
animationDelay: V = "0"
|
|
448
|
+
} = S ? getComputedStyle(S) : {}, M = fe(
|
|
449
|
+
C,
|
|
450
|
+
l,
|
|
451
|
+
w,
|
|
452
|
+
V
|
|
453
|
+
), P = fe(
|
|
454
|
+
D,
|
|
455
|
+
v,
|
|
456
|
+
c,
|
|
457
|
+
x
|
|
458
|
+
), R = M + P;
|
|
459
|
+
if (!R) {
|
|
460
|
+
_ === "enter" && r.setState("animated", !1), d();
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
const h = 1e3 / 60, T = Math.max(R - h, 0);
|
|
464
|
+
return de(T, f);
|
|
465
|
+
}, [r, m, y, S, u, _]), s = Ge(
|
|
466
|
+
s,
|
|
467
|
+
(d) => /* @__PURE__ */ Oe.jsx(ft, { value: r, children: d }),
|
|
468
|
+
[r]
|
|
469
|
+
);
|
|
470
|
+
const O = gt(p, s.hidden, a), A = s.style, b = Pe(() => O ? G($({}, A), { display: "none" }) : A, [O, A]);
|
|
471
|
+
return s = G($({
|
|
472
|
+
id: E,
|
|
473
|
+
"data-open": u || void 0,
|
|
474
|
+
"data-enter": _ === "enter" || void 0,
|
|
475
|
+
"data-leave": _ === "leave" || void 0,
|
|
476
|
+
hidden: O
|
|
477
|
+
}, s), {
|
|
478
|
+
ref: ye(E ? r.setContentElement : null, i, s.ref),
|
|
479
|
+
style: b
|
|
480
|
+
}), Fe(s);
|
|
481
|
+
}), yt = ee(function(n) {
|
|
482
|
+
const t = ht(n);
|
|
483
|
+
return De(Et, t);
|
|
484
|
+
}), Dt = ee(function(n) {
|
|
485
|
+
var t = n, {
|
|
486
|
+
unmountOnHide: r
|
|
487
|
+
} = t, a = te(t, [
|
|
488
|
+
"unmountOnHide"
|
|
489
|
+
]);
|
|
490
|
+
const s = oe(), o = a.store || s;
|
|
491
|
+
return ne(
|
|
492
|
+
o,
|
|
493
|
+
(E) => !r || (E == null ? void 0 : E.mounted)
|
|
494
|
+
) === !1 ? null : /* @__PURE__ */ Oe.jsx(yt, $({}, a));
|
|
495
|
+
});
|
|
496
|
+
const Ot = q.div`
|
|
497
|
+
${I("accordions.wrapper")};
|
|
498
|
+
${Ve};
|
|
499
|
+
transition: medium;
|
|
500
|
+
|
|
501
|
+
&:hover {
|
|
502
|
+
border-color: neutral-50;
|
|
503
|
+
}
|
|
504
|
+
`, W = q.divBox`
|
|
505
|
+
flex-shrink: 0;
|
|
506
|
+
${I("accordions.icon")};
|
|
507
|
+
transform: rotate3d(0);
|
|
508
|
+
transition: medium;
|
|
509
|
+
width: 24;
|
|
510
|
+
height: 24;
|
|
511
|
+
color: inherit;
|
|
512
|
+
display: flex;
|
|
513
|
+
border-radius: 12;
|
|
514
|
+
|
|
515
|
+
& *:first-child {
|
|
516
|
+
margin: auto;
|
|
517
|
+
}
|
|
518
|
+
`, bt = q(vt)`
|
|
519
|
+
${I("accordions.title")};
|
|
520
|
+
width: 100%;
|
|
521
|
+
padding: ${I("accordions.padding")};
|
|
522
|
+
background-color: transparent;
|
|
523
|
+
border: 0;
|
|
524
|
+
display: flex;
|
|
525
|
+
justify-content: space-between;
|
|
526
|
+
align-items: center;
|
|
527
|
+
gap: xxl;
|
|
528
|
+
|
|
529
|
+
&[aria-expanded='true'] {
|
|
530
|
+
${W} {
|
|
531
|
+
transform: rotate3d(0, 0, 1, 90deg);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
&:focus,
|
|
536
|
+
&:hover {
|
|
537
|
+
cursor: pointer;
|
|
538
|
+
${W} {
|
|
539
|
+
background-color: neutral-30;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
&:focus {
|
|
544
|
+
outline: 0;
|
|
545
|
+
${W} {
|
|
546
|
+
color: inherit;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
`, xt = q(Dt)`
|
|
550
|
+
display: grid;
|
|
551
|
+
grid-template-rows: 0fr;
|
|
552
|
+
transition-property: grid-template-rows;
|
|
553
|
+
transition-timing-function: linear;
|
|
554
|
+
transition-duration: 200ms;
|
|
555
|
+
animation-duration: 200ms;
|
|
556
|
+
|
|
557
|
+
> * {
|
|
558
|
+
overflow: hidden;
|
|
559
|
+
padding: 0;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
&[data-enter] {
|
|
563
|
+
grid-template-rows: 1fr;
|
|
564
|
+
}
|
|
565
|
+
`, Ct = q.div`
|
|
566
|
+
${I("accordions.content")};
|
|
567
|
+
padding: ${I("accordions.padding")};
|
|
568
|
+
padding-top: 0;
|
|
569
|
+
color: neutral-70;
|
|
570
|
+
`, Tt = Le(
|
|
571
|
+
({ children: e, dataTestId: n, icon: t = /* @__PURE__ */ L.createElement(Re, null), store: r, title: a, ...s }, o) => /* @__PURE__ */ L.createElement(Ot, { "data-testid": n, ref: o, ...s }, /* @__PURE__ */ L.createElement(bt, { "data-testid": n ? `${n}-title` : void 0, store: r }, a, /* @__PURE__ */ L.createElement(W, null, Ae(t, { size: "sm" }))), /* @__PURE__ */ L.createElement(xt, { "data-testid": n ? `${n}-content` : void 0, store: r }, /* @__PURE__ */ L.createElement("div", null, /* @__PURE__ */ L.createElement(Ct, null, e))))
|
|
572
|
+
);
|
|
573
|
+
function $t(e) {
|
|
574
|
+
return ut({ animated: !0, ...e });
|
|
575
|
+
}
|
|
576
|
+
export {
|
|
577
|
+
Tt as Accordion,
|
|
578
|
+
$t as useAccordion
|
|
579
|
+
};
|
package/dist/Alert.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react");const e=require("./index-BNA_A0oa.js");require("./System.js");require("./Box.js");exports.Alert=e.Alert;
|