@dotss/ui 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/Accordion/Accordion.cjs +1 -1
  2. package/Accordion/Accordion.es.js +1 -1
  3. package/CircularProgressIndicator/CircularProgressIndicator.cjs +7 -6
  4. package/CircularProgressIndicator/CircularProgressIndicator.es.js +19 -17
  5. package/Collapse/Collapse.cjs +1 -0
  6. package/Collapse/Collapse.d.ts +7 -0
  7. package/Collapse/Collapse.es.js +28 -0
  8. package/Collapse/Collapse.stories.d.ts +27 -0
  9. package/Collapse/index.cjs +1 -0
  10. package/Collapse/index.d.ts +4 -0
  11. package/Collapse/index.es.js +4 -0
  12. package/Select/Select.cjs +10 -10
  13. package/Select/Select.es.js +124 -121
  14. package/hooks/index.cjs +1 -1
  15. package/hooks/index.d.ts +5 -0
  16. package/hooks/index.es.js +9 -3
  17. package/hooks/interactions/useCollapse/useCollapse.cjs +1 -0
  18. package/hooks/interactions/useCollapse/useCollapse.d.ts +22 -0
  19. package/hooks/interactions/useCollapse/useCollapse.es.js +51 -0
  20. package/hooks/useFocusBoundary/useFocusBoundary.d.ts +1 -1
  21. package/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs +1 -0
  22. package/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +4 -0
  23. package/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.es.js +6 -0
  24. package/hooks/usePrefersReducedMotion/usePrefersReducedMotion.cjs +1 -0
  25. package/hooks/usePrefersReducedMotion/usePrefersReducedMotion.d.ts +3 -0
  26. package/hooks/usePrefersReducedMotion/usePrefersReducedMotion.es.js +15 -0
  27. package/index.cjs +1 -1
  28. package/index.d.ts +1 -0
  29. package/index.es.js +14 -12
  30. package/package.json +1 -1
  31. package/utils/isPrefersReducedMotion/isPrefersReducedMotion.cjs +1 -0
  32. package/utils/isPrefersReducedMotion/isPrefersReducedMotion.d.ts +1 -0
  33. package/utils/isPrefersReducedMotion/isPrefersReducedMotion.es.js +6 -0
  34. package/utils/isServer/isServer.cjs +1 -0
  35. package/utils/isServer/isServer.d.ts +1 -0
  36. package/utils/isServer/isServer.es.js +6 -0
@@ -37,4 +37,4 @@
37
37
  overflow: hidden;
38
38
  `,J=s.default.div`
39
39
  padding: ${({theme:{spacing:e}})=>`0 ${e.content(4)}px ${e.content(4)}px ${e.content(4)}px`};
40
- `,K=l.forwardRef(function({children:n,expand:t=!1,title:I,endAdornment:E,onChange:g,disabled:u=!1,inlineCSS:b,fullWidth:p=!1,headerProps:d,headerButtonProps:f,panelProps:m,...H},R){const _=l.useId(),q=l.useId(),y=(f==null?void 0:f.id)||_,$=(m==null?void 0:m.id)||q,[c,j]=l.useState(t),[h,x]=l.useState(t?"auto":"0px"),i=l.useRef(null),C=r=>{u||(typeof g=="function"?g(r):j(a=>!a))};return l.useEffect(()=>{j(t)},[t]),l.useEffect(()=>{var S,v;let r;const a=A.default(((S=i.current)==null?void 0:S.scrollHeight)||0),T=!c&&h==="auto",k=!c&&h!=="auto";return(v=i.current)!=null&&v.parentElement&&(c?(i.current.parentElement.style.height=a,r=setTimeout(()=>{var w;x("auto"),(w=i.current)!=null&&w.parentElement&&(i.current.parentElement.style.height="auto")},200)):T?(i.current.parentElement.style.height=a,x(a)):k&&(i.current.parentElement.style.height="0px",x("0px"))),()=>{r&&clearTimeout(r)}},[c,h]),o.jsxs(N,{ref:R,disabled:u,fullWidth:p,...H,css:b,children:[o.jsx(O,{as:(d==null?void 0:d.tag)||"h3",onClick:C,disabled:u,...d,children:o.jsxs(V,{id:y,"aria-disabled":u,"aria-expanded":c,"aria-controls":$,fullWidth:p,...f,children:[I,o.jsx(F,{expand:c,children:E||o.jsx(z.default,{name:"ChevronDownLine",size:"xSmall"})})]})}),o.jsx(G,{children:o.jsx(J,{role:"region",id:$,"aria-labelledby":y,ref:i,...m,children:n})})]})});exports.default=K;
40
+ `,K=l.forwardRef(function({children:n,expand:t=!1,title:I,endAdornment:E,onChange:g,disabled:u=!1,inlineCSS:b,fullWidth:y=!1,headerProps:d,headerButtonProps:f,panelProps:m,...H},R){const _=l.useId(),q=l.useId(),p=(f==null?void 0:f.id)||_,$=(m==null?void 0:m.id)||q,[c,j]=l.useState(t),[h,x]=l.useState(t?"auto":"0px"),i=l.useRef(null),C=r=>{u||(typeof g=="function"?g(r):j(a=>!a))};return l.useEffect(()=>{j(t)},[t]),l.useEffect(()=>{var S,v;let r;const a=A.default(((S=i.current)==null?void 0:S.scrollHeight)||0),T=!c&&h==="auto",k=!c&&h!=="auto";return(v=i.current)!=null&&v.parentElement&&(c?(i.current.parentElement.style.height=a,r=setTimeout(()=>{var w;x("auto"),(w=i.current)!=null&&w.parentElement&&(i.current.parentElement.style.height="auto")},200)):T?(i.current.parentElement.style.height=a,x(a)):k&&(i.current.parentElement.style.height="0px",x("0px"))),()=>{r&&clearTimeout(r)}},[c,h]),o.jsxs(N,{ref:R,disabled:u,fullWidth:y,...H,css:b,children:[o.jsx(O,{as:(d==null?void 0:d.tag)||"h3",onClick:C,disabled:u,...d,children:o.jsxs(V,{id:p,"aria-disabled":u,"aria-expanded":c,"aria-controls":$,fullWidth:y,...f,children:[I,o.jsx(F,{expand:c,children:E||o.jsx(z.default,{name:"ChevronDownLine",size:"xSmall"})})]})}),o.jsx(G,{style:{height:h},children:o.jsx(J,{role:"region",id:$,"aria-labelledby":p,ref:i,...m,children:n})})]})});exports.default=K;
@@ -118,7 +118,7 @@ const J = c.div`
118
118
  )
119
119
  }
120
120
  ),
121
- /* @__PURE__ */ a(U, { children: /* @__PURE__ */ a(
121
+ /* @__PURE__ */ a(U, { style: { height: m }, children: /* @__PURE__ */ a(
122
122
  W,
123
123
  {
124
124
  role: "region",
@@ -1,18 +1,19 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("@emotion/react/jsx-runtime"),h=require("react"),g=require("@emotion/react"),m=require("@emotion/styled"),y=e=>e&&e.__esModule?e:{default:e},i=y(m),k=g.keyframes`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("@emotion/react/jsx-runtime"),m=require("react"),g=require("@emotion/react"),k=require("@emotion/styled"),y=e=>e&&e.__esModule?e:{default:e},i=y(k),x=g.keyframes`
2
2
  100% {
3
3
  transform: rotate(270deg);
4
4
  }
5
- `,x=i.default.svg`
5
+ `,$=i.default.svg`
6
6
  ${({size:e})=>e==="large"?{width:120,height:120}:{width:40,height:40}};
7
7
 
8
8
  transform: rotate(-90deg);
9
9
 
10
- ${({loop:e})=>e?{animation:`${k} 1s infinite`}:{}};
11
- `,$=i.default.circle`
10
+ ${({loop:e})=>e?{animation:`${x} 1s infinite`}:{}};
11
+ `,_=i.default.circle`
12
12
  ${({size:e})=>e==="large"?{cx:60,cy:60,strokeWidth:16}:{cx:20,cy:20,strokeWidth:4}};
13
13
  stroke: ${({theme:{palette:{grey:e}}})=>e[10]};
14
- `,_=i.default.circle`
14
+ `,b=i.default.circle`
15
15
  transition: stroke-dashoffset ${({transitionDuration:e})=>e}ms linear 0s;
16
16
  ${({size:e})=>e==="large"?{cx:60,cy:60,strokeWidth:16}:{cx:20,cy:20,strokeWidth:4}};
17
17
  stroke: ${({theme:{palette:{brand:e}}})=>e.primary.main};
18
- `,b=h.forwardRef(function({size:r="small",value:c=0,transitionDuration:n=500,inlineCSS:d,loop:t,...a},u){const s=r==="large"?52:18,l=2*Math.PI*s,f=l*(1-(t?20:c)/100);return o.jsxs(x,{ref:u,viewBox:r==="large"?"0 0 120 120":"0 0 40 40",fill:"none",size:r,loop:t,role:"progressbar","aria-valuenow":t?void 0:c,"aria-label":a["aria-label"]?a["aria-label"]:"로딩 중",...a,css:d,children:[o.jsx($,{size:r,r:s}),o.jsx(_,{size:r,transitionDuration:n,r:s,strokeLinecap:"round",strokeDashoffset:f,strokeDasharray:l})]})});exports.default=b;
18
+ will-change: stroke-dashoffset;
19
+ `,w=m.forwardRef(function({size:r="small",value:c=0,transitionDuration:n=500,inlineCSS:d,loop:t,...a},u){const s=r==="large"?52:18,l=2*Math.PI*s,f=Math.min(100,Math.max(0,t?20:c)),h=l*(1-f/100);return o.jsxs($,{ref:u,viewBox:r==="large"?"0 0 120 120":"0 0 40 40",fill:"none",size:r,loop:t,role:"progressbar","aria-valuenow":t?void 0:c,"aria-label":a["aria-label"]?a["aria-label"]:"로딩 중",...a,css:d,children:[o.jsx(_,{size:r,r:s}),o.jsx(b,{className:"progress-indicator",size:r,transitionDuration:n,r:s,strokeLinecap:"round",strokeDashoffset:h,strokeDasharray:l})]})});exports.default=w;
@@ -1,12 +1,12 @@
1
- import { jsxs as h, jsx as n } from "@emotion/react/jsx-runtime";
2
- import { forwardRef as g } from "react";
3
- import { keyframes as k } from "@emotion/react";
1
+ import { jsxs as g, jsx as n } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as k } from "react";
3
+ import { keyframes as u } from "@emotion/react";
4
4
  import s from "@emotion/styled";
5
- const y = k`
5
+ const y = u`
6
6
  100% {
7
7
  transform: rotate(270deg);
8
8
  }
9
- `, u = s.svg`
9
+ `, x = s.svg`
10
10
  ${({ size: r }) => r === "large" ? {
11
11
  width: 120,
12
12
  height: 120
@@ -20,7 +20,7 @@ const y = k`
20
20
  ${({ loop: r }) => r ? {
21
21
  animation: `${y} 1s infinite`
22
22
  } : {}};
23
- `, x = s.circle`
23
+ `, $ = s.circle`
24
24
  ${({ size: r }) => r === "large" ? {
25
25
  cx: 60,
26
26
  cy: 60,
@@ -35,7 +35,7 @@ const y = k`
35
35
  palette: { grey: r }
36
36
  }
37
37
  }) => r[10]};
38
- `, $ = s.circle`
38
+ `, p = s.circle`
39
39
  transition: stroke-dashoffset ${({ transitionDuration: r }) => r}ms linear 0s;
40
40
  ${({ size: r }) => r === "large" ? {
41
41
  cx: 60,
@@ -51,13 +51,14 @@ const y = k`
51
51
  palette: { brand: r }
52
52
  }
53
53
  }) => r.primary.main};
54
- `, b = g(
55
- function({ size: e = "small", value: i = 0, transitionDuration: l = 500, inlineCSS: d, loop: t, ...a }, f) {
56
- const o = e === "large" ? 52 : 18, c = 2 * Math.PI * o, m = c * (1 - (t ? 20 : i) / 100);
57
- return /* @__PURE__ */ h(
58
- u,
54
+ will-change: stroke-dashoffset;
55
+ `, W = k(
56
+ function({ size: e = "small", value: i = 0, transitionDuration: l = 500, inlineCSS: d, loop: t, ...a }, m) {
57
+ const o = e === "large" ? 52 : 18, c = 2 * Math.PI * o, f = Math.min(100, Math.max(0, t ? 20 : i)), h = c * (1 - f / 100);
58
+ return /* @__PURE__ */ g(
59
+ x,
59
60
  {
60
- ref: f,
61
+ ref: m,
61
62
  viewBox: e === "large" ? "0 0 120 120" : "0 0 40 40",
62
63
  fill: "none",
63
64
  size: e,
@@ -68,15 +69,16 @@ const y = k`
68
69
  ...a,
69
70
  css: d,
70
71
  children: [
71
- /* @__PURE__ */ n(x, { size: e, r: o }),
72
+ /* @__PURE__ */ n($, { size: e, r: o }),
72
73
  /* @__PURE__ */ n(
73
- $,
74
+ p,
74
75
  {
76
+ className: "progress-indicator",
75
77
  size: e,
76
78
  transitionDuration: l,
77
79
  r: o,
78
80
  strokeLinecap: "round",
79
- strokeDashoffset: m,
81
+ strokeDashoffset: h,
80
82
  strokeDasharray: c
81
83
  }
82
84
  )
@@ -86,5 +88,5 @@ const y = k`
86
88
  }
87
89
  );
88
90
  export {
89
- b as default
91
+ W as default
90
92
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("@emotion/react/jsx-runtime"),t=require("react"),q=require("../Box/Box.cjs"),x=require("../hooks/interactions/useCollapse/useCollapse.cjs"),R=t.forwardRef(function({children:r,isCollapsed:s=!0,duration:u=200,delay:l=0,easing:o,onTransitionStart:a,onTransitionEnd:n,...i},c){t.useImperativeHandle(c,()=>e.current);const{targetRef:e,style:f,ariaProps:d}=x.default({isCollapsed:s,duration:u,delay:l,easing:o,onTransitionStart:a,onTransitionEnd:n});return p.jsx(q.default,{ref:e,style:{flexShrink:0,...f},...d,...i,children:r})});exports.default=R;
@@ -0,0 +1,7 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { UseCollapseProps } from '../hooks/interactions/useCollapse/useCollapse';
3
+ import { GeneralComponentProps } from '../typings/component';
4
+
5
+ export type CollapseProps = Omit<GeneralComponentProps<HTMLAttributes<HTMLDivElement>>, 'onTransitionStart' | 'onTransitionEnd'> & UseCollapseProps;
6
+ declare const Collapse: import('react').ForwardRefExoticComponent<Omit<GeneralComponentProps<HTMLAttributes<HTMLDivElement>>, "onTransitionEnd" | "onTransitionStart"> & UseCollapseProps & import('react').RefAttributes<HTMLDivElement>>;
7
+ export default Collapse;
@@ -0,0 +1,28 @@
1
+ import { jsx as u } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as c, useImperativeHandle as x } from "react";
3
+ import d from "../Box/Box.es.js";
4
+ import C from "../hooks/interactions/useCollapse/useCollapse.es.js";
5
+ const k = c(function({
6
+ children: e,
7
+ isCollapsed: o = !0,
8
+ duration: t = 200,
9
+ delay: s = 0,
10
+ easing: a,
11
+ onTransitionStart: f,
12
+ onTransitionEnd: l,
13
+ ...p
14
+ }, m) {
15
+ x(m, () => r.current);
16
+ const { targetRef: r, style: i, ariaProps: n } = C({
17
+ isCollapsed: o,
18
+ duration: t,
19
+ delay: s,
20
+ easing: a,
21
+ onTransitionStart: f,
22
+ onTransitionEnd: l
23
+ });
24
+ return /* @__PURE__ */ u(d, { ref: r, style: { flexShrink: 0, ...i }, ...n, ...p, children: e });
25
+ });
26
+ export {
27
+ k as default
28
+ };
@@ -0,0 +1,27 @@
1
+ import { StoryObj } from '@storybook/react';
2
+
3
+ declare const meta: {
4
+ title: string;
5
+ component: import('react').ForwardRefExoticComponent<Omit<import('../../typings/component').GeneralComponentProps<import('react').HTMLAttributes<HTMLDivElement>>, "onTransitionEnd" | "onTransitionStart"> & import('../../hooks').UseCollapseProps & import('react').RefAttributes<HTMLDivElement>>;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ argTypes: {
11
+ isCollapsed: {
12
+ control: "boolean";
13
+ };
14
+ duration: {
15
+ control: {
16
+ type: "number";
17
+ min: number;
18
+ max: number;
19
+ step: number;
20
+ };
21
+ };
22
+ };
23
+ };
24
+ export default meta;
25
+ type Story = StoryObj<typeof meta>;
26
+ export declare const Default: Story;
27
+ export declare const Custom: Story;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Collapse.cjs");exports.default=e.default;
@@ -0,0 +1,4 @@
1
+ import { default as Collapse } from './Collapse';
2
+
3
+ export type { CollapseProps } from './Collapse';
4
+ export default Collapse;
@@ -0,0 +1,4 @@
1
+ import a from "./Collapse.es.js";
2
+ export {
3
+ a as default
4
+ };
package/Select/Select.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("@emotion/react/jsx-runtime"),i=require("react"),P=require("../Backdrop/Backdrop.cjs"),T=require("../Box/Box.cjs"),K=require("../Flexbox/Flexbox.cjs"),U=require("../Icon/Icon.cjs"),X=require("@emotion/styled"),E=require("../utils/getSibling/getSibling.cjs"),G=e=>e&&e.__esModule?e:{default:e},m=G(X),J=m.default.div`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("@emotion/react/jsx-runtime"),r=require("react"),P=require("../Backdrop/Backdrop.cjs"),T=require("../Box/Box.cjs"),K=require("../Flexbox/Flexbox.cjs"),U=require("../Icon/Icon.cjs"),X=require("@emotion/styled"),E=require("../utils/getSibling/getSibling.cjs"),G=e=>e&&e.__esModule?e:{default:e},S=G(X),J=S.default.div`
2
2
  display: flex;
3
3
  justify-content: space-between;
4
4
  align-items: center;
@@ -12,12 +12,12 @@
12
12
  color: inherit;
13
13
  }
14
14
 
15
- ${({theme:{palette:{grey:e,background:r}},variant:g})=>{let s={};switch(g){case"outlined":s={border:`1px solid ${e[50]}`,"&[disabled]":{backgroundColor:e[10],border:`1px solid ${e[30]}`,color:e[30],pointerEvents:"none"}};break;case"filled":s={border:"1px solid transparent",backgroundColor:r.primary,"&[disabled]":{backgroundColor:e[10],color:e[30],pointerEvents:"none"}};break}return s}}
15
+ ${({theme:{palette:{grey:e,background:i}},variant:h})=>{let s={};switch(h){case"outlined":s={border:`1px solid ${e[50]}`,"&[disabled]":{backgroundColor:e[10],border:`1px solid ${e[30]}`,color:e[30],cursor:"not-allowed"}};break;case"filled":s={border:"1px solid transparent",backgroundColor:i.primary,"&[disabled]":{backgroundColor:e[10],color:e[30],cursor:"not-allowed"}};break}return s}}
16
16
 
17
- ${({theme:{palette:{brand:e}},isFocused:r})=>r?{border:`1px solid ${e.primary.line}`}:{}}
17
+ ${({theme:{palette:{brand:e}},isFocused:i})=>i?{border:`1px solid ${e.primary.line}`}:{}}
18
18
 
19
- ${({size:e})=>{let r={};switch(e){case"large":r={height:"48px"};break;case"xLarge":r={height:"56px"};break}return r}}
20
- `,N=m.default.div`
19
+ ${({size:e})=>{let i={};switch(e){case"large":i={height:"48px"};break;case"xLarge":i={height:"56px"};break}return i}}
20
+ `,N=S.default.div`
21
21
  display: flex;
22
22
  width: calc(100% - 24px - 8px);
23
23
  gap: ${({theme:e})=>`${e.spacing.content(2)}px`};
@@ -25,18 +25,18 @@
25
25
  color: inherit;
26
26
  }
27
27
 
28
- ${({theme:{typography:e,palette:{grey:r}},value:g})=>{const s={fontSize:e.b2R.size,fontWeight:e.b2R.size,lineHeight:e.b2R.lineHeight,letterSpacing:e.b2R.letterSpacing,"&[disabled]":{color:r[30]}};return g?{...s,color:r[100]}:{...s,color:r[50]}}}
29
- `,Q=m.default.div`
28
+ ${({theme:{typography:e,palette:{grey:i}},value:h})=>{const s={fontSize:e.b2R.size,fontWeight:e.b2R.size,lineHeight:e.b2R.lineHeight,letterSpacing:e.b2R.letterSpacing,"&[disabled]":{color:i[30]}};return h?{...s,color:i[100]}:{...s,color:i[50]}}}
29
+ `,Q=S.default.div`
30
30
  overflow: hidden;
31
31
  text-overflow: ellipsis;
32
32
  white-space: nowrap;
33
- `,Y=m.default.div`
33
+ `,Y=S.default.div`
34
34
  display: flex;
35
35
  align-items: center;
36
36
  justify-content: center;
37
37
  transform: ${({isFocused:e})=>e?"rotate(180deg)":"rotate(0deg)"};
38
38
  transition: transform 200ms linear;
39
- `,Z=m.default.ul`
39
+ `,Z=S.default.ul`
40
40
  position: fixed;
41
41
  max-height: 476px;
42
42
  overflow-y: auto;
@@ -50,4 +50,4 @@
50
50
  box-shadow: ${({theme:{elevation:e}})=>e[4]};
51
51
  transition: opacity 200ms linear;
52
52
  opacity: ${({isFocused:e})=>e?1:0};
53
- `,ee=i.forwardRef(function({value:r,onChange:g,open:s,onOpen:v,onClose:C,variant:O="outlined",size:q="large",startAdornment:j,placeholder:W="TEXT",disabled:k=!1,fullWidth:D,children:h,inlineCSS:z,...S},V){const _=i.useId(),b=i.useRef(null),w=i.useRef(null),x=i.useRef(""),[d,u]=i.useState(s||!1),[f,c]=i.useState(""),[$,y]=i.useState({top:0,bottom:0,left:0,width:0}),p=(S==null?void 0:S.id)||_,H=()=>{s===void 0?u(t=>!t):s===!1&&v&&typeof v=="function"&&v()},I=t=>()=>{g(t.toString()),R()},R=()=>{s===void 0?(u(!1),c("")):s===!0&&C&&typeof C=="function"&&C()},B=t=>{if(t.preventDefault(),t.code==="Escape"&&u(!1),t.code==="Space"||t.code==="Enter")if(x.current?c(x.current):f||c(`${p}-0`),d){if(f){const n=document.querySelector(`#${CSS.escape(f)}`);n&&n.hasAttribute("value")&&(x.current=n==null?void 0:n.id,I(n.value)())}u(!1)}else u(!0);if(t.code==="ArrowDown"||t.code==="ArrowUp"){if(d||u(!0),x.current?c(x.current):c(`${p}-0`),!w.current||!f)return;const n=w.current.querySelector(`#${CSS.escape(f)}`);if(!n)return;if(t.code==="ArrowDown"){const o=E.default(n,"next",{skipDisabled:!0});if(o&&o.id)c(o.id),o.scrollIntoView({block:"end"});else{const l=w.current.firstElementChild;l&&(c(l.id),l.scrollIntoView({block:"start"}))}}if(t.code==="ArrowUp"){const o=E.default(n,"prev",{skipDisabled:!0});if(o&&o.id)c(o.id),o.scrollIntoView({block:"end"});else{const l=w.current.lastElementChild;l&&(c(l.id),l.scrollIntoView({block:"end"}))}}}if(t.code==="Home"&&c(`${p}-0`),t.code==="End"){const n=i.Children.count(h);c(`${p}-${n-1}`)}},L=t=>{const n=i.Children.map(t,o=>i.isValidElement(o)&&o&&o.props.value===r?o.props.children:null);return n&&n.length?n[0]:""};return i.useEffect(()=>{const t=()=>{if(b.current){const n=b.current.getBoundingClientRect(),o=i.Children.count(h),l=40,A=24,F=l*o>476?476:l*o,M=b.current.getBoundingClientRect().bottom+F+A>window.innerHeight;y(M?{bottom:24,left:n.left,width:b.current.offsetWidth}:{top:n.top+n.height,left:n.left,width:b.current.offsetWidth})}};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[h]),i.useEffect(()=>{s!==void 0&&u(s)},[s]),a.jsxs(T.default,{ref:V,inlineCSS:{position:"relative"},children:[a.jsxs(J,{role:"combobox",ref:b,tabIndex:0,variant:O,size:q,disabled:k,fullWidth:D,isFocused:d,onClick:H,onKeyDown:B,"aria-controls":p,"aria-expanded":d,"aria-haspopup":"listbox","aria-activedescendant":f,...S,css:z,children:[a.jsxs(N,{value:r==="0"||!!r,disabled:k,children:[j&&a.jsx(K.default,{justifyContent:"center",alignItems:"center",children:j}),a.jsx(Q,{children:L(h)||W})]}),a.jsx(Y,{isFocused:d,children:a.jsx(U.default,{name:"ChevronDownLine",size:"small",color:k?"grey.30":"grey.100"})})]}),a.jsx(P.default,{open:d,onClose:R,inlineCSS:{backgroundColor:"transparent"},children:a.jsx(Z,{id:p,role:"listbox",ref:w,tabIndex:-1,isFocused:d,style:{top:$.top,bottom:$.bottom,left:$.left,width:$.width},children:i.Children.map(h,(t,n)=>{if(!i.isValidElement(t)||!t.props.value)return null;const o=`${p}-${n}`,l=r===t.props.value;return l&&(x.current=o),i.cloneElement(t,{id:o,selected:l,focused:o===f,onClick:I(t.props.value),...t.props})})})})]})});exports.default=ee;
53
+ `,ee=r.forwardRef(function({value:i,onChange:h,open:s,onOpen:C,onClose:k,variant:O="outlined",size:q="large",startAdornment:j,placeholder:W="TEXT",disabled:d=!1,fullWidth:D,children:w,inlineCSS:z,...$},V){const _=r.useId(),g=r.useRef(null),m=r.useRef(null),b=r.useRef(""),[u,f]=r.useState(s||!1),[p,c]=r.useState(""),[v,y]=r.useState({top:0,bottom:0,left:0,width:0}),x=($==null?void 0:$.id)||_,H=()=>{d||(s===void 0?f(t=>!t):s===!1&&C&&typeof C=="function"&&C())},I=t=>()=>{d||(h(t.toString()),R())},R=()=>{d||(s===void 0?(f(!1),c("")):s===!0&&k&&typeof k=="function"&&k())},B=t=>{if(!d){if(t.preventDefault(),t.code==="Escape"&&f(!1),t.code==="Space"||t.code==="Enter")if(b.current?c(b.current):p||c(`${x}-0`),u){if(p){const n=document.querySelector(`#${CSS.escape(p)}`);n&&n.hasAttribute("value")&&(b.current=n==null?void 0:n.id,I(n.value)())}f(!1)}else f(!0);if(t.code==="ArrowDown"||t.code==="ArrowUp"){if(u||f(!0),b.current?c(b.current):c(`${x}-0`),!m.current||!p)return;const n=m.current.querySelector(`#${CSS.escape(p)}`);if(!n)return;if(t.code==="ArrowDown"){const o=E.default(n,"next",{skipDisabled:!0});if(o&&o.id)c(o.id),o.scrollIntoView({block:"end"});else{const l=m.current.firstElementChild;l&&(c(l.id),l.scrollIntoView({block:"start"}))}}if(t.code==="ArrowUp"){const o=E.default(n,"prev",{skipDisabled:!0});if(o&&o.id)c(o.id),o.scrollIntoView({block:"end"});else{const l=m.current.lastElementChild;l&&(c(l.id),l.scrollIntoView({block:"end"}))}}}if(t.code==="Home"&&c(`${x}-0`),t.code==="End"){const n=r.Children.count(w);c(`${x}-${n-1}`)}}},L=t=>{const n=r.Children.map(t,o=>r.isValidElement(o)&&o&&o.props.value===i?o.props.children:null);return n&&n.length?n[0]:""};return r.useEffect(()=>{const t=()=>{if(g.current){const n=g.current.getBoundingClientRect(),o=r.Children.count(w),l=40,A=24,F=l*o>476?476:l*o,M=g.current.getBoundingClientRect().bottom+F+A>window.innerHeight;y(M?{bottom:24,left:n.left,width:g.current.offsetWidth}:{top:n.top+n.height,left:n.left,width:g.current.offsetWidth})}};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[w]),r.useEffect(()=>{s!==void 0&&f(s)},[s]),a.jsxs(T.default,{ref:V,inlineCSS:{position:"relative"},children:[a.jsxs(J,{role:"combobox",ref:g,tabIndex:0,variant:O,size:q,disabled:d,fullWidth:D,isFocused:u,onClick:H,onKeyDown:B,"aria-controls":x,"aria-expanded":u,"aria-haspopup":"listbox","aria-activedescendant":p,"aria-disabled":d,...$,css:z,children:[a.jsxs(N,{value:i==="0"||!!i,disabled:d,children:[j&&a.jsx(K.default,{justifyContent:"center",alignItems:"center",children:j}),a.jsx(Q,{children:L(w)||W})]}),a.jsx(Y,{isFocused:u,children:a.jsx(U.default,{name:"ChevronDownLine",size:"small",color:d?"grey.30":"grey.100"})})]}),a.jsx(P.default,{open:u,onClose:R,inlineCSS:{backgroundColor:"transparent"},children:a.jsx(Z,{id:x,role:"listbox",ref:m,tabIndex:-1,isFocused:u,style:{top:v.top,bottom:v.bottom,left:v.left,width:v.width},children:r.Children.map(w,(t,n)=>{if(!r.isValidElement(t)||!t.props.value)return null;const o=`${x}-${n}`,l=i===t.props.value;return l&&(b.current=o),r.cloneElement(t,{id:o,selected:l,focused:o===p,onClick:I(t.props.value),...t.props})})})})]})});exports.default=ee;
@@ -1,12 +1,12 @@
1
- import { jsxs as I, jsx as b } from "@emotion/react/jsx-runtime";
2
- import { forwardRef as J, useId as N, useRef as y, useState as E, useEffect as z, Children as v, isValidElement as D, cloneElement as Q } from "react";
1
+ import { jsxs as I, jsx as g } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as J, useId as N, useRef as y, useState as R, useEffect as z, Children as v, isValidElement as D, cloneElement as Q } from "react";
3
3
  import Y from "../Backdrop/Backdrop.es.js";
4
4
  import Z from "../Box/Box.es.js";
5
5
  import _ from "../Flexbox/Flexbox.es.js";
6
6
  import ee from "../Icon/Icon.es.js";
7
- import h from "@emotion/styled";
7
+ import w from "@emotion/styled";
8
8
  import H from "../utils/getSibling/getSibling.es.js";
9
- const te = h.div`
9
+ const te = w.div`
10
10
  display: flex;
11
11
  justify-content: space-between;
12
12
  align-items: center;
@@ -22,64 +22,64 @@ const te = h.div`
22
22
 
23
23
  ${({
24
24
  theme: {
25
- palette: { grey: e, background: i }
25
+ palette: { grey: e, background: r }
26
26
  },
27
- variant: m
27
+ variant: b
28
28
  }) => {
29
- let r = {};
30
- switch (m) {
29
+ let i = {};
30
+ switch (b) {
31
31
  case "outlined":
32
- r = {
32
+ i = {
33
33
  border: `1px solid ${e[50]}`,
34
34
  "&[disabled]": {
35
35
  backgroundColor: e[10],
36
36
  border: `1px solid ${e[30]}`,
37
37
  color: e[30],
38
- pointerEvents: "none"
38
+ cursor: "not-allowed"
39
39
  }
40
40
  };
41
41
  break;
42
42
  case "filled":
43
- r = {
43
+ i = {
44
44
  border: "1px solid transparent",
45
- backgroundColor: i.primary,
45
+ backgroundColor: r.primary,
46
46
  "&[disabled]": {
47
47
  backgroundColor: e[10],
48
48
  color: e[30],
49
- pointerEvents: "none"
49
+ cursor: "not-allowed"
50
50
  }
51
51
  };
52
52
  break;
53
53
  }
54
- return r;
54
+ return i;
55
55
  }}
56
56
 
57
57
  ${({
58
58
  theme: {
59
59
  palette: { brand: e }
60
60
  },
61
- isFocused: i
62
- }) => i ? {
61
+ isFocused: r
62
+ }) => r ? {
63
63
  border: `1px solid ${e.primary.line}`
64
64
  } : {}}
65
65
 
66
66
  ${({ size: e }) => {
67
- let i = {};
67
+ let r = {};
68
68
  switch (e) {
69
69
  case "large":
70
- i = {
70
+ r = {
71
71
  height: "48px"
72
72
  };
73
73
  break;
74
74
  case "xLarge":
75
- i = {
75
+ r = {
76
76
  height: "56px"
77
77
  };
78
78
  break;
79
79
  }
80
- return i;
80
+ return r;
81
81
  }}
82
- `, ne = h.div`
82
+ `, oe = w.div`
83
83
  display: flex;
84
84
  width: calc(100% - 24px - 8px);
85
85
  gap: ${({ theme: e }) => `${e.spacing.content(2)}px`};
@@ -90,38 +90,38 @@ const te = h.div`
90
90
  ${({
91
91
  theme: {
92
92
  typography: e,
93
- palette: { grey: i }
93
+ palette: { grey: r }
94
94
  },
95
- value: m
95
+ value: b
96
96
  }) => {
97
- const r = {
97
+ const i = {
98
98
  fontSize: e.b2R.size,
99
99
  fontWeight: e.b2R.size,
100
100
  lineHeight: e.b2R.lineHeight,
101
101
  letterSpacing: e.b2R.letterSpacing,
102
102
  "&[disabled]": {
103
- color: i[30]
103
+ color: r[30]
104
104
  }
105
105
  };
106
- return m ? {
107
- ...r,
108
- color: i[100]
106
+ return b ? {
107
+ ...i,
108
+ color: r[100]
109
109
  } : {
110
- ...r,
111
- color: i[50]
110
+ ...i,
111
+ color: r[50]
112
112
  };
113
113
  }}
114
- `, oe = h.div`
114
+ `, ne = w.div`
115
115
  overflow: hidden;
116
116
  text-overflow: ellipsis;
117
117
  white-space: nowrap;
118
- `, ie = h.div`
118
+ `, re = w.div`
119
119
  display: flex;
120
120
  align-items: center;
121
121
  justify-content: center;
122
122
  transform: ${({ isFocused: e }) => e ? "rotate(180deg)" : "rotate(0deg)"};
123
123
  transition: transform 200ms linear;
124
- `, re = h.ul`
124
+ `, ie = w.ul`
125
125
  position: fixed;
126
126
  max-height: 476px;
127
127
  overflow-y: auto;
@@ -135,150 +135,153 @@ const te = h.div`
135
135
  box-shadow: ${({ theme: { elevation: e } }) => e[4]};
136
136
  transition: opacity 200ms linear;
137
137
  opacity: ${({ isFocused: e }) => e ? 1 : 0};
138
- `, be = J(function({
139
- value: i,
140
- onChange: m,
141
- open: r,
142
- onOpen: S,
143
- onClose: C,
138
+ `, me = J(function({
139
+ value: r,
140
+ onChange: b,
141
+ open: i,
142
+ onOpen: C,
143
+ onClose: k,
144
144
  variant: V = "outlined",
145
145
  size: B = "large",
146
- startAdornment: R,
146
+ startAdornment: E,
147
147
  placeholder: L = "TEXT",
148
- disabled: k = !1,
148
+ disabled: c = !1,
149
149
  fullWidth: A,
150
- children: g,
150
+ children: x,
151
151
  inlineCSS: F,
152
- ...w
152
+ ...$
153
153
  }, q) {
154
- const K = N(), f = y(null), x = y(null), u = y(""), [c, a] = E(r || !1), [d, l] = E(""), [$, O] = E({ top: 0, bottom: 0, left: 0, width: 0 }), p = (w == null ? void 0 : w.id) || K, P = () => {
155
- r === void 0 ? a((t) => !t) : r === !1 && S && typeof S == "function" && S();
154
+ const K = N(), u = y(null), h = y(null), m = y(""), [a, d] = R(i || !1), [f, s] = R(""), [S, O] = R({ top: 0, bottom: 0, left: 0, width: 0 }), p = ($ == null ? void 0 : $.id) || K, P = () => {
155
+ c || (i === void 0 ? d((t) => !t) : i === !1 && C && typeof C == "function" && C());
156
156
  }, W = (t) => () => {
157
- m(t.toString()), j();
157
+ c || (b(t.toString()), j());
158
158
  }, j = () => {
159
- r === void 0 ? (a(!1), l("")) : r === !0 && C && typeof C == "function" && C();
159
+ c || (i === void 0 ? (d(!1), s("")) : i === !0 && k && typeof k == "function" && k());
160
160
  }, T = (t) => {
161
- if (t.preventDefault(), t.code === "Escape" && a(!1), t.code === "Space" || t.code === "Enter")
162
- if (u.current ? l(u.current) : d || l(`${p}-0`), c) {
163
- if (d) {
164
- const n = document.querySelector(
165
- `#${CSS.escape(d)}`
166
- );
167
- n && n.hasAttribute("value") && (u.current = n == null ? void 0 : n.id, W(n.value)());
161
+ if (!c) {
162
+ if (t.preventDefault(), t.code === "Escape" && d(!1), t.code === "Space" || t.code === "Enter")
163
+ if (m.current ? s(m.current) : f || s(`${p}-0`), a) {
164
+ if (f) {
165
+ const o = document.querySelector(
166
+ `#${CSS.escape(f)}`
167
+ );
168
+ o && o.hasAttribute("value") && (m.current = o == null ? void 0 : o.id, W(o.value)());
169
+ }
170
+ d(!1);
171
+ } else
172
+ d(!0);
173
+ if (t.code === "ArrowDown" || t.code === "ArrowUp") {
174
+ if (a || d(!0), m.current ? s(m.current) : s(`${p}-0`), !h.current || !f) return;
175
+ const o = h.current.querySelector(
176
+ `#${CSS.escape(f)}`
177
+ );
178
+ if (!o) return;
179
+ if (t.code === "ArrowDown") {
180
+ const n = H(o, "next", { skipDisabled: !0 });
181
+ if (n && n.id)
182
+ s(n.id), n.scrollIntoView({ block: "end" });
183
+ else {
184
+ const l = h.current.firstElementChild;
185
+ l && (s(l.id), l.scrollIntoView({ block: "start" }));
186
+ }
168
187
  }
169
- a(!1);
170
- } else
171
- a(!0);
172
- if (t.code === "ArrowDown" || t.code === "ArrowUp") {
173
- if (c || a(!0), u.current ? l(u.current) : l(`${p}-0`), !x.current || !d) return;
174
- const n = x.current.querySelector(
175
- `#${CSS.escape(d)}`
176
- );
177
- if (!n) return;
178
- if (t.code === "ArrowDown") {
179
- const o = H(n, "next", { skipDisabled: !0 });
180
- if (o && o.id)
181
- l(o.id), o.scrollIntoView({ block: "end" });
182
- else {
183
- const s = x.current.firstElementChild;
184
- s && (l(s.id), s.scrollIntoView({ block: "start" }));
188
+ if (t.code === "ArrowUp") {
189
+ const n = H(o, "prev", { skipDisabled: !0 });
190
+ if (n && n.id)
191
+ s(n.id), n.scrollIntoView({ block: "end" });
192
+ else {
193
+ const l = h.current.lastElementChild;
194
+ l && (s(l.id), l.scrollIntoView({ block: "end" }));
195
+ }
185
196
  }
186
197
  }
187
- if (t.code === "ArrowUp") {
188
- const o = H(n, "prev", { skipDisabled: !0 });
189
- if (o && o.id)
190
- l(o.id), o.scrollIntoView({ block: "end" });
191
- else {
192
- const s = x.current.lastElementChild;
193
- s && (l(s.id), s.scrollIntoView({ block: "end" }));
194
- }
198
+ if (t.code === "Home" && s(`${p}-0`), t.code === "End") {
199
+ const o = v.count(x);
200
+ s(`${p}-${o - 1}`);
195
201
  }
196
202
  }
197
- if (t.code === "Home" && l(`${p}-0`), t.code === "End") {
198
- const n = v.count(g);
199
- l(`${p}-${n - 1}`);
200
- }
201
203
  }, U = (t) => {
202
- const n = v.map(t, (o) => D(o) && o && o.props.value === i ? o.props.children : null);
203
- return n && n.length ? n[0] : "";
204
+ const o = v.map(t, (n) => D(n) && n && n.props.value === r ? n.props.children : null);
205
+ return o && o.length ? o[0] : "";
204
206
  };
205
207
  return z(() => {
206
208
  const t = () => {
207
- if (f.current) {
208
- const n = f.current.getBoundingClientRect(), o = v.count(g), s = 40, M = 24, X = s * o > 476 ? 476 : s * o, G = f.current.getBoundingClientRect().bottom + X + M > window.innerHeight;
209
+ if (u.current) {
210
+ const o = u.current.getBoundingClientRect(), n = v.count(x), l = 40, M = 24, X = l * n > 476 ? 476 : l * n, G = u.current.getBoundingClientRect().bottom + X + M > window.innerHeight;
209
211
  O(G ? {
210
212
  bottom: 24,
211
- left: n.left,
212
- width: f.current.offsetWidth
213
+ left: o.left,
214
+ width: u.current.offsetWidth
213
215
  } : {
214
- top: n.top + n.height,
215
- left: n.left,
216
- width: f.current.offsetWidth
216
+ top: o.top + o.height,
217
+ left: o.left,
218
+ width: u.current.offsetWidth
217
219
  });
218
220
  }
219
221
  };
220
222
  return t(), window.addEventListener("resize", t), () => {
221
223
  window.removeEventListener("resize", t);
222
224
  };
223
- }, [g]), z(() => {
224
- r !== void 0 && a(r);
225
- }, [r]), /* @__PURE__ */ I(Z, { ref: q, inlineCSS: { position: "relative" }, children: [
225
+ }, [x]), z(() => {
226
+ i !== void 0 && d(i);
227
+ }, [i]), /* @__PURE__ */ I(Z, { ref: q, inlineCSS: { position: "relative" }, children: [
226
228
  /* @__PURE__ */ I(
227
229
  te,
228
230
  {
229
231
  role: "combobox",
230
- ref: f,
232
+ ref: u,
231
233
  tabIndex: 0,
232
234
  variant: V,
233
235
  size: B,
234
- disabled: k,
236
+ disabled: c,
235
237
  fullWidth: A,
236
- isFocused: c,
238
+ isFocused: a,
237
239
  onClick: P,
238
240
  onKeyDown: T,
239
241
  "aria-controls": p,
240
- "aria-expanded": c,
242
+ "aria-expanded": a,
241
243
  "aria-haspopup": "listbox",
242
- "aria-activedescendant": d,
243
- ...w,
244
+ "aria-activedescendant": f,
245
+ "aria-disabled": c,
246
+ ...$,
244
247
  css: F,
245
248
  children: [
246
- /* @__PURE__ */ I(ne, { value: i === "0" || !!i, disabled: k, children: [
247
- R && /* @__PURE__ */ b(_, { justifyContent: "center", alignItems: "center", children: R }),
248
- /* @__PURE__ */ b(oe, { children: U(g) || L })
249
+ /* @__PURE__ */ I(oe, { value: r === "0" || !!r, disabled: c, children: [
250
+ E && /* @__PURE__ */ g(_, { justifyContent: "center", alignItems: "center", children: E }),
251
+ /* @__PURE__ */ g(ne, { children: U(x) || L })
249
252
  ] }),
250
- /* @__PURE__ */ b(ie, { isFocused: c, children: /* @__PURE__ */ b(ee, { name: "ChevronDownLine", size: "small", color: k ? "grey.30" : "grey.100" }) })
253
+ /* @__PURE__ */ g(re, { isFocused: a, children: /* @__PURE__ */ g(ee, { name: "ChevronDownLine", size: "small", color: c ? "grey.30" : "grey.100" }) })
251
254
  ]
252
255
  }
253
256
  ),
254
- /* @__PURE__ */ b(
257
+ /* @__PURE__ */ g(
255
258
  Y,
256
259
  {
257
- open: c,
260
+ open: a,
258
261
  onClose: j,
259
262
  inlineCSS: { backgroundColor: "transparent" },
260
- children: /* @__PURE__ */ b(
261
- re,
263
+ children: /* @__PURE__ */ g(
264
+ ie,
262
265
  {
263
266
  id: p,
264
267
  role: "listbox",
265
- ref: x,
268
+ ref: h,
266
269
  tabIndex: -1,
267
- isFocused: c,
270
+ isFocused: a,
268
271
  style: {
269
- top: $.top,
270
- bottom: $.bottom,
271
- left: $.left,
272
- width: $.width
272
+ top: S.top,
273
+ bottom: S.bottom,
274
+ left: S.left,
275
+ width: S.width
273
276
  },
274
- children: v.map(g, (t, n) => {
277
+ children: v.map(x, (t, o) => {
275
278
  if (!D(t) || !t.props.value)
276
279
  return null;
277
- const o = `${p}-${n}`, s = i === t.props.value;
278
- return s && (u.current = o), Q(t, {
279
- id: o,
280
- selected: s,
281
- focused: o === d,
280
+ const n = `${p}-${o}`, l = r === t.props.value;
281
+ return l && (m.current = n), Q(t, {
282
+ id: n,
283
+ selected: l,
284
+ focused: n === f,
282
285
  onClick: W(t.props.value),
283
286
  ...t.props
284
287
  });
@@ -290,5 +293,5 @@ const te = h.div`
290
293
  ] });
291
294
  });
292
295
  export {
293
- be as default
296
+ me as default
294
297
  };
package/hooks/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useCheckHoverPossible/useCheckHoverPossible.cjs"),u=require("./useCheckKeyboardMode/useCheckKeyboardMode.cjs"),s=require("./useCheckHasFocus/useCheckHasFocus.cjs"),o=require("./useFocusBoundary/useFocusBoundary.cjs");exports.useCheckHoverPossible=e.default;exports.useCheckKeyboardMode=u.default;exports.useCheckHasFocus=s.default;exports.useFocusBoundary=o.default;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useCheckHoverPossible/useCheckHoverPossible.cjs"),u=require("./useCheckKeyboardMode/useCheckKeyboardMode.cjs"),s=require("./useCheckHasFocus/useCheckHasFocus.cjs"),o=require("./useFocusBoundary/useFocusBoundary.cjs"),r=require("./interactions/useCollapse/useCollapse.cjs"),t=require("./useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs"),c=require("./usePrefersReducedMotion/usePrefersReducedMotion.cjs");exports.useCheckHoverPossible=e.default;exports.useCheckKeyboardMode=u.default;exports.useCheckHasFocus=s.default;exports.useFocusBoundary=o.default;exports.useCollapse=r.default;exports.useIsomorphicLayoutEffect=t.default;exports.usePrefersReducedMotion=c.default;
package/hooks/index.d.ts CHANGED
@@ -2,3 +2,8 @@ export { default as useCheckHoverPossible } from './useCheckHoverPossible/useChe
2
2
  export { default as useCheckKeyboardMode } from './useCheckKeyboardMode/useCheckKeyboardMode';
3
3
  export { default as useCheckHasFocus } from './useCheckHasFocus/useCheckHasFocus';
4
4
  export { default as useFocusBoundary } from './useFocusBoundary/useFocusBoundary';
5
+ export { default as useCollapse } from './interactions/useCollapse/useCollapse';
6
+ export { default as useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect/useIsomorphicLayoutEffect';
7
+ export { default as usePrefersReducedMotion } from './usePrefersReducedMotion/usePrefersReducedMotion';
8
+ export type { UseFocusBoundaryProps } from './useFocusBoundary/useFocusBoundary';
9
+ export type { UseCollapseProps } from './interactions/useCollapse/useCollapse';
package/hooks/index.es.js CHANGED
@@ -1,10 +1,16 @@
1
1
  import { default as s } from "./useCheckHoverPossible/useCheckHoverPossible.es.js";
2
- import { default as r } from "./useCheckKeyboardMode/useCheckKeyboardMode.es.js";
2
+ import { default as a } from "./useCheckKeyboardMode/useCheckKeyboardMode.es.js";
3
3
  import { default as f } from "./useCheckHasFocus/useCheckHasFocus.es.js";
4
4
  import { default as d } from "./useFocusBoundary/useFocusBoundary.es.js";
5
+ import { default as p } from "./interactions/useCollapse/useCollapse.es.js";
6
+ import { default as m } from "./useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.es.js";
7
+ import { default as h } from "./usePrefersReducedMotion/usePrefersReducedMotion.es.js";
5
8
  export {
6
9
  f as useCheckHasFocus,
7
10
  s as useCheckHoverPossible,
8
- r as useCheckKeyboardMode,
9
- d as useFocusBoundary
11
+ a as useCheckKeyboardMode,
12
+ p as useCollapse,
13
+ d as useFocusBoundary,
14
+ m as useIsomorphicLayoutEffect,
15
+ h as usePrefersReducedMotion
10
16
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react"),v=require("../../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs"),y=require("../../usePrefersReducedMotion/usePrefersReducedMotion.cjs");function P({isCollapsed:t=!0,duration:s=200,delay:f=0,easing:o="ease-in-out",onTransitionStart:i,onTransitionEnd:l}={}){const{prefersReducedMotion:x}=y.default(),h=r.useRef(null),e=r.useRef(null),u=r.useRef(i),c=r.useRef(l),a=r.useRef(!0);u.current=i,c.current=l;const[g,H]=r.useState(t?"0px":"auto");return v.default(()=>{var d;if(a.current){a.current=!1;return}const n=h.current;if(!n)return;e.current&&(e.current.cancel(),e.current=null);const R=n.scrollHeight,M=t?[{height:`${R}px`},{height:"0px"}]:[{height:"0px"},{height:`${R}px`}],q=t?"0px":"auto";return(d=u.current)==null||d.call(u),e.current=n.animate(M,{duration:x?0:s,easing:o,delay:f,fill:"forwards"}),e.current.onfinish=()=>{var m,p;(m=e.current)==null||m.commitStyles(),H(q),(p=c.current)==null||p.call(c),e.current=null},()=>{e.current&&(e.current.cancel(),e.current=null)}},[t,s,f,o]),{targetRef:h,isCollapsed:t,height:g,style:{height:g,overflow:"hidden"},ariaProps:{"aria-hidden":t}}}exports.default=P;
@@ -0,0 +1,22 @@
1
+ import { CSSValue } from '../../../typings/utility';
2
+
3
+ export interface UseCollapseProps {
4
+ isCollapsed?: boolean;
5
+ duration?: number;
6
+ delay?: number;
7
+ easing?: string;
8
+ onTransitionStart?: () => void;
9
+ onTransitionEnd?: () => void;
10
+ }
11
+ export default function useCollapse({ isCollapsed, duration, delay, easing, onTransitionStart, onTransitionEnd }?: UseCollapseProps): {
12
+ targetRef: import('react').RefObject<HTMLDivElement>;
13
+ isCollapsed: boolean;
14
+ height: CSSValue;
15
+ style: {
16
+ height: CSSValue;
17
+ overflow: string;
18
+ };
19
+ ariaProps: {
20
+ 'aria-hidden': boolean;
21
+ };
22
+ };
@@ -0,0 +1,51 @@
1
+ import { useRef as r, useState as M } from "react";
2
+ import P from "../../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.es.js";
3
+ import $ from "../../usePrefersReducedMotion/usePrefersReducedMotion.es.js";
4
+ function L({
5
+ isCollapsed: t = !0,
6
+ duration: o = 200,
7
+ delay: f = 0,
8
+ easing: i = "ease-in-out",
9
+ onTransitionStart: s,
10
+ onTransitionEnd: h
11
+ } = {}) {
12
+ const { prefersReducedMotion: H } = $(), l = r(null), e = r(null), u = r(s), c = r(h), m = r(!0);
13
+ u.current = s, c.current = h;
14
+ const [p, d] = M(t ? "0px" : "auto");
15
+ return P(() => {
16
+ var g;
17
+ if (m.current) {
18
+ m.current = !1;
19
+ return;
20
+ }
21
+ const n = l.current;
22
+ if (!n) return;
23
+ e.current && (e.current.cancel(), e.current = null);
24
+ const a = n.scrollHeight, w = t ? [{ height: `${a}px` }, { height: "0px" }] : [{ height: "0px" }, { height: `${a}px` }], y = t ? "0px" : "auto";
25
+ return (g = u.current) == null || g.call(u), e.current = n.animate(w, {
26
+ duration: H ? 0 : o,
27
+ easing: i,
28
+ delay: f,
29
+ fill: "forwards"
30
+ }), e.current.onfinish = () => {
31
+ var x, R;
32
+ (x = e.current) == null || x.commitStyles(), d(y), (R = c.current) == null || R.call(c), e.current = null;
33
+ }, () => {
34
+ e.current && (e.current.cancel(), e.current = null);
35
+ };
36
+ }, [t, o, f, i]), {
37
+ targetRef: l,
38
+ isCollapsed: t,
39
+ height: p,
40
+ style: {
41
+ height: p,
42
+ overflow: "hidden"
43
+ },
44
+ ariaProps: {
45
+ "aria-hidden": t
46
+ }
47
+ };
48
+ }
49
+ export {
50
+ L as default
51
+ };
@@ -1,6 +1,6 @@
1
1
  import { RefObject } from 'react';
2
2
 
3
- interface UseFocusBoundaryProps {
3
+ export interface UseFocusBoundaryProps {
4
4
  ref: RefObject<HTMLElement>;
5
5
  active?: boolean;
6
6
  disabled?: boolean;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react"),t=require("../../utils/isServer/isServer.cjs"),u=t.default()?e.useEffect:e.useLayoutEffect;exports.default=u;
@@ -0,0 +1,4 @@
1
+ import { useEffect } from 'react';
2
+
3
+ declare const useIsomorphicLayoutEffect: typeof useEffect;
4
+ export default useIsomorphicLayoutEffect;
@@ -0,0 +1,6 @@
1
+ import { useLayoutEffect as e, useEffect as o } from "react";
2
+ import t from "../../utils/isServer/isServer.es.js";
3
+ const s = t() ? o : e;
4
+ export {
5
+ s as default
6
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react"),o=require("../../utils/isPrefersReducedMotion/isPrefersReducedMotion.cjs");function c(){const[n,r]=d.useState(()=>o.default());return d.useEffect(()=>{if(typeof window>"u"||!(window!=null&&window.matchMedia))return;const e=window.matchMedia("(prefers-reduced-motion: reduce)"),t=u=>r(u.matches);return e.addEventListener("change",t),()=>{e.removeEventListener("change",t)}},[]),{prefersReducedMotion:n}}exports.default=c;
@@ -0,0 +1,3 @@
1
+ export default function usePrefersReducedMotion(): {
2
+ prefersReducedMotion: boolean;
3
+ };
@@ -0,0 +1,15 @@
1
+ import { useState as o, useEffect as i } from "react";
2
+ import c from "../../utils/isPrefersReducedMotion/isPrefersReducedMotion.es.js";
3
+ function a() {
4
+ const [d, n] = o(() => c());
5
+ return i(() => {
6
+ if (typeof window > "u" || !(window != null && window.matchMedia)) return;
7
+ const e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = (r) => n(r.matches);
8
+ return e.addEventListener("change", t), () => {
9
+ e.removeEventListener("change", t);
10
+ };
11
+ }, []), { prefersReducedMotion: d };
12
+ }
13
+ export {
14
+ a as default
15
+ };
package/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Button/Button.cjs"),t=require("./Icon/Icon.cjs"),o=require("./Label/Label.cjs"),r=require("./Typography/Typography.cjs"),u=require("./Box/Box.cjs"),n=require("./Flexbox/Flexbox.cjs"),i=require("./TextField/TextField.cjs"),a=require("./TextArea/TextArea.cjs"),l=require("./IconButton/IconButton.cjs"),c=require("./PageControl/PageControl.cjs"),d=require("./Checkbox/Checkbox.cjs"),s=require("./Radio/Radio.cjs"),f=require("./Chip/Chip.cjs"),q=require("./SegmentedButton/SegmentedButton.cjs"),B=require("./SegmentedButton/SegmentedButtonBlock/SegmentedButtonBlock.cjs"),g=require("./Backdrop/Backdrop.cjs"),S=require("./Dialog/Dialog.cjs"),T=require("./Dialog/DialogTitle/DialogTitle.cjs"),k=require("./Dialog/DialogContent/DialogContent.cjs"),m=require("./Dialog/DialogAction/DialogAction.cjs"),p=require("./Dialog/DialogText/DialogText.cjs"),h=require("./Tooltip/Tooltip.cjs"),C=require("./Select/Select.cjs"),b=require("./Select/Option/Option.cjs"),x=require("./Menu/Menu.cjs"),D=require("./Menu/MenuBlock/MenuBlock.cjs");require("./Menu/MenuButton/MenuButton.cjs");const y=require("./Skeleton/Skeleton.cjs"),P=require("./Switch/Switch.cjs"),A=require("./BottomSheet/BottomSheet.cjs"),F=require("./BottomSheet/BottomSheetTitle/BottomSheetTitle.cjs"),I=require("./BottomSheet/BottomSheetContent/BottomSheetContent.cjs"),L=require("./BottomSheet/BottomSheetAction/BottomSheetAction.cjs"),v=require("./BottomSheet/BottomSheetText/BottomSheetText.cjs"),M=require("./Snackbar/Snackbar.cjs"),w=require("./ChainPicker/ChainPicker.cjs"),E=require("./DatePicker/DatePicker.cjs"),G=require("./DatePicker/EventDot/EventDot.cjs"),K=require("./DatePicker/EventDotGroup/EventDotGroup.cjs"),N=require("./FormControlText/FormControlText.cjs"),R=require("./ClickAwayListener/ClickAwayListener.cjs"),O=require("./Card/Card.cjs"),j=require("./LineProgressIndicator/LineProgressIndicator.cjs"),z=require("./CircularProgressIndicator/CircularProgressIndicator.cjs"),H=require("./NumberKeypad/NumberKeypad.cjs"),J=require("./NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.cjs"),Q=require("./FocusBoundary/FocusBoundary.cjs"),U=require("./Badge/Badge.cjs"),V=require("./Tab/Tab.cjs"),W=require("./Tab/TabBlock/TabBlock.cjs"),X=require("./Slider/Slider.cjs"),Y=require("./Accordion/Accordion.cjs"),Z=require("./RadioGroup/RadioGroup.cjs");exports.Button=e.default;exports.Icon=t.default;exports.Label=o.default;exports.Typography=r.default;exports.Box=u.default;exports.Flexbox=n.default;exports.TextField=i.default;exports.TextArea=a.default;exports.IconButton=l.default;exports.PageControl=c.default;exports.Checkbox=d.default;exports.Radio=s.default;exports.Chip=f.default;exports.SegmentedButton=q.default;exports.SegmentedButtonBlock=B.default;exports.Backdrop=g.default;exports.Dialog=S.default;exports.DialogTitle=T.default;exports.DialogContent=k.default;exports.DialogAction=m.default;exports.DialogText=p.default;exports.Tooltip=h.default;exports.Select=C.default;exports.Option=b.default;exports.Menu=x.default;exports.MenuBlock=D.default;exports.Skeleton=y.default;exports.Switch=P.default;exports.BottomSheet=A.default;exports.BottomSheetTitle=F.default;exports.BottomSheetContent=I.default;exports.BottomSheetAction=L.default;exports.BottomSheetText=v.default;exports.Snackbar=M.default;exports.ChainPicker=w.default;exports.DatePicker=E.default;exports.EventDot=G.default;exports.EventDotGroup=K.default;exports.FormControlText=N.default;exports.ClickAwayListener=R.default;exports.Card=O.default;exports.LineProgressIndicator=j.default;exports.CircularProgressIndicator=z.default;exports.NumberKeypad=H.default;exports.NumberKeypadBlock=J.default;exports.FocusBoundary=Q.default;exports.Badge=U.default;exports.Tab=V.default;exports.TabBlock=W.default;exports.Slider=X.default;exports.Accordion=Y.default;exports.RadioGroup=Z.default;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Button/Button.cjs"),t=require("./Icon/Icon.cjs"),o=require("./Label/Label.cjs"),r=require("./Typography/Typography.cjs"),u=require("./Box/Box.cjs"),n=require("./Flexbox/Flexbox.cjs"),a=require("./TextField/TextField.cjs"),i=require("./TextArea/TextArea.cjs"),l=require("./IconButton/IconButton.cjs"),c=require("./PageControl/PageControl.cjs"),d=require("./Checkbox/Checkbox.cjs"),s=require("./Radio/Radio.cjs"),f=require("./Chip/Chip.cjs"),q=require("./SegmentedButton/SegmentedButton.cjs"),B=require("./SegmentedButton/SegmentedButtonBlock/SegmentedButtonBlock.cjs"),g=require("./Backdrop/Backdrop.cjs"),S=require("./Dialog/Dialog.cjs"),p=require("./Dialog/DialogTitle/DialogTitle.cjs"),T=require("./Dialog/DialogContent/DialogContent.cjs"),k=require("./Dialog/DialogAction/DialogAction.cjs"),C=require("./Dialog/DialogText/DialogText.cjs"),m=require("./Tooltip/Tooltip.cjs"),h=require("./Select/Select.cjs"),b=require("./Select/Option/Option.cjs"),x=require("./Menu/Menu.cjs"),D=require("./Menu/MenuBlock/MenuBlock.cjs");require("./Menu/MenuButton/MenuButton.cjs");const y=require("./Skeleton/Skeleton.cjs"),P=require("./Switch/Switch.cjs"),A=require("./BottomSheet/BottomSheet.cjs"),F=require("./BottomSheet/BottomSheetTitle/BottomSheetTitle.cjs"),I=require("./BottomSheet/BottomSheetContent/BottomSheetContent.cjs"),L=require("./BottomSheet/BottomSheetAction/BottomSheetAction.cjs"),v=require("./BottomSheet/BottomSheetText/BottomSheetText.cjs"),M=require("./Snackbar/Snackbar.cjs"),w=require("./ChainPicker/ChainPicker.cjs"),E=require("./DatePicker/DatePicker.cjs"),G=require("./DatePicker/EventDot/EventDot.cjs"),K=require("./DatePicker/EventDotGroup/EventDotGroup.cjs"),N=require("./FormControlText/FormControlText.cjs"),R=require("./ClickAwayListener/ClickAwayListener.cjs"),O=require("./Card/Card.cjs"),j=require("./LineProgressIndicator/LineProgressIndicator.cjs"),z=require("./CircularProgressIndicator/CircularProgressIndicator.cjs"),H=require("./NumberKeypad/NumberKeypad.cjs"),J=require("./NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.cjs"),Q=require("./FocusBoundary/FocusBoundary.cjs"),U=require("./Badge/Badge.cjs"),V=require("./Tab/Tab.cjs"),W=require("./Tab/TabBlock/TabBlock.cjs"),X=require("./Slider/Slider.cjs"),Y=require("./Accordion/Accordion.cjs"),Z=require("./RadioGroup/RadioGroup.cjs"),_=require("./Collapse/Collapse.cjs");exports.Button=e.default;exports.Icon=t.default;exports.Label=o.default;exports.Typography=r.default;exports.Box=u.default;exports.Flexbox=n.default;exports.TextField=a.default;exports.TextArea=i.default;exports.IconButton=l.default;exports.PageControl=c.default;exports.Checkbox=d.default;exports.Radio=s.default;exports.Chip=f.default;exports.SegmentedButton=q.default;exports.SegmentedButtonBlock=B.default;exports.Backdrop=g.default;exports.Dialog=S.default;exports.DialogTitle=p.default;exports.DialogContent=T.default;exports.DialogAction=k.default;exports.DialogText=C.default;exports.Tooltip=m.default;exports.Select=h.default;exports.Option=b.default;exports.Menu=x.default;exports.MenuBlock=D.default;exports.Skeleton=y.default;exports.Switch=P.default;exports.BottomSheet=A.default;exports.BottomSheetTitle=F.default;exports.BottomSheetContent=I.default;exports.BottomSheetAction=L.default;exports.BottomSheetText=v.default;exports.Snackbar=M.default;exports.ChainPicker=w.default;exports.DatePicker=E.default;exports.EventDot=G.default;exports.EventDotGroup=K.default;exports.FormControlText=N.default;exports.ClickAwayListener=R.default;exports.Card=O.default;exports.LineProgressIndicator=j.default;exports.CircularProgressIndicator=z.default;exports.NumberKeypad=H.default;exports.NumberKeypadBlock=J.default;exports.FocusBoundary=Q.default;exports.Badge=U.default;exports.Tab=V.default;exports.TabBlock=W.default;exports.Slider=X.default;exports.Accordion=Y.default;exports.RadioGroup=Z.default;exports.Collapse=_.default;
package/index.d.ts CHANGED
@@ -37,3 +37,4 @@ export { default as Tab, TabBlock } from './Tab';
37
37
  export { default as Slider } from './Slider';
38
38
  export { default as Accordion } from './Accordion';
39
39
  export { default as RadioGroup } from './RadioGroup';
40
+ export { default as Collapse } from './Collapse';
package/index.es.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { default as a } from "./Button/Button.es.js";
2
2
  import { default as f } from "./Icon/Icon.es.js";
3
3
  import { default as d } from "./Label/Label.es.js";
4
- import { default as m } from "./Typography/Typography.es.js";
4
+ import { default as p } from "./Typography/Typography.es.js";
5
5
  import { default as x } from "./Box/Box.es.js";
6
6
  import { default as n } from "./Flexbox/Flexbox.es.js";
7
7
  import { default as c } from "./TextField/TextField.es.js";
8
8
  import { default as g } from "./TextArea/TextArea.es.js";
9
9
  import { default as k } from "./IconButton/IconButton.es.js";
10
- import { default as h } from "./PageControl/PageControl.es.js";
10
+ import { default as T } from "./PageControl/PageControl.es.js";
11
11
  import { default as b } from "./Checkbox/Checkbox.es.js";
12
12
  import { default as y } from "./Radio/Radio.es.js";
13
13
  import { default as P } from "./Chip/Chip.es.js";
@@ -25,17 +25,17 @@ import { default as X } from "./Select/Option/Option.es.js";
25
25
  import { default as Z } from "./Menu/Menu.es.js";
26
26
  import { default as $ } from "./Menu/MenuBlock/MenuBlock.es.js";
27
27
  import "./Menu/MenuButton/MenuButton.es.js";
28
- import { default as to } from "./Skeleton/Skeleton.es.js";
28
+ import { default as eo } from "./Skeleton/Skeleton.es.js";
29
29
  import { default as ao } from "./Switch/Switch.es.js";
30
30
  import { default as fo } from "./BottomSheet/BottomSheet.es.js";
31
31
  import { default as uo } from "./BottomSheet/BottomSheetTitle/BottomSheetTitle.es.js";
32
- import { default as po } from "./BottomSheet/BottomSheetContent/BottomSheetContent.es.js";
32
+ import { default as mo } from "./BottomSheet/BottomSheetContent/BottomSheetContent.es.js";
33
33
  import { default as so } from "./BottomSheet/BottomSheetAction/BottomSheetAction.es.js";
34
34
  import { default as io } from "./BottomSheet/BottomSheetText/BottomSheetText.es.js";
35
35
  import { default as Bo } from "./Snackbar/Snackbar.es.js";
36
36
  import { default as So } from "./ChainPicker/ChainPicker.es.js";
37
- import { default as To } from "./DatePicker/DatePicker.es.js";
38
- import { default as Co } from "./DatePicker/EventDot/EventDot.es.js";
37
+ import { default as Co } from "./DatePicker/DatePicker.es.js";
38
+ import { default as ho } from "./DatePicker/EventDot/EventDot.es.js";
39
39
  import { default as Do } from "./DatePicker/EventDotGroup/EventDotGroup.es.js";
40
40
  import { default as Ao } from "./FormControlText/FormControlText.es.js";
41
41
  import { default as Fo } from "./ClickAwayListener/ClickAwayListener.es.js";
@@ -51,13 +51,14 @@ import { default as Uo } from "./Tab/TabBlock/TabBlock.es.js";
51
51
  import { default as Wo } from "./Slider/Slider.es.js";
52
52
  import { default as Yo } from "./Accordion/Accordion.es.js";
53
53
  import { default as _o } from "./RadioGroup/RadioGroup.es.js";
54
+ import { default as oe } from "./Collapse/Collapse.es.js";
54
55
  export {
55
56
  Yo as Accordion,
56
57
  E as Backdrop,
57
58
  zo as Badge,
58
59
  fo as BottomSheet,
59
60
  so as BottomSheetAction,
60
- po as BottomSheetContent,
61
+ mo as BottomSheetContent,
61
62
  io as BottomSheetText,
62
63
  uo as BottomSheetTitle,
63
64
  x as Box,
@@ -68,13 +69,14 @@ export {
68
69
  P as Chip,
69
70
  Go as CircularProgressIndicator,
70
71
  Fo as ClickAwayListener,
71
- To as DatePicker,
72
+ oe as Collapse,
73
+ Co as DatePicker,
72
74
  K as Dialog,
73
75
  q as DialogAction,
74
76
  O as DialogContent,
75
77
  H as DialogText,
76
78
  N as DialogTitle,
77
- Co as EventDot,
79
+ ho as EventDot,
78
80
  Do as EventDotGroup,
79
81
  n as Flexbox,
80
82
  jo as FocusBoundary,
@@ -88,13 +90,13 @@ export {
88
90
  Mo as NumberKeypad,
89
91
  Ro as NumberKeypadBlock,
90
92
  X as Option,
91
- h as PageControl,
93
+ T as PageControl,
92
94
  y as Radio,
93
95
  _o as RadioGroup,
94
96
  I as SegmentedButton,
95
97
  v as SegmentedButtonBlock,
96
98
  V as Select,
97
- to as Skeleton,
99
+ eo as Skeleton,
98
100
  Wo as Slider,
99
101
  Bo as Snackbar,
100
102
  ao as Switch,
@@ -103,5 +105,5 @@ export {
103
105
  g as TextArea,
104
106
  c as TextField,
105
107
  Q as Tooltip,
106
- m as Typography
108
+ p as Typography
107
109
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotss/ui",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "React UI components for Dotss",
5
5
  "type": "module",
6
6
  "main": "./index.cjs",
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function e(){return window!=null&&window.matchMedia?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1}exports.default=e;
@@ -0,0 +1 @@
1
+ export default function isPrefersReducedMotion(): boolean;
@@ -0,0 +1,6 @@
1
+ function e() {
2
+ return window != null && window.matchMedia ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1;
3
+ }
4
+ export {
5
+ e as default
6
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function e(){return typeof document>"u"}exports.default=e;
@@ -0,0 +1 @@
1
+ export default function isServer(): boolean;
@@ -0,0 +1,6 @@
1
+ function e() {
2
+ return typeof document > "u";
3
+ }
4
+ export {
5
+ e as default
6
+ };