@dotss/ui 1.7.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Button/Button.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"),M=require("react"),j=require("../Box/Box.cjs"),N=require("../CircularProgressIndicator/CircularProgressIndicator.cjs"),E=require("../hooks/useCheckHoverPossible/useCheckHoverPossible.cjs"),T=require("../utils/getIconLabel/getIconLabel.cjs"),F=require("@emotion/styled"),s=require("../utils/getContrastingTextColor/getContrastingTextColor.cjs"),V=l=>l&&l.__esModule?l:{default:l},G=V(F),J=G.default.button`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("@emotion/react/jsx-runtime"),M=require("react"),j=require("../Box/Box.cjs"),E=require("../CircularProgressIndicator/CircularProgressIndicator.cjs"),T=require("../hooks/useCheckHoverPossible/useCheckHoverPossible.cjs"),F=require("../utils/getIconLabel/getIconLabel.cjs"),V=require("@emotion/styled"),a=require("../utils/getContrastingTextColor/getContrastingTextColor.cjs"),D=p=>p&&p.__esModule?p:{default:p},G=D(V),J=G.default.button`
2
2
  display: inline-flex;
3
3
  align-items: center;
4
4
  justify-content: center;
@@ -7,19 +7,21 @@
7
7
  color: inherit;
8
8
  }
9
9
 
10
- ${({theme:{palette:{brand:l,grey:e}},variant:t,color:u})=>{let p={backgroundColor:l.primary.main,color:s.default(l.primary.main,[e.white,e[100]])};return t==="filled"&&u==="secondary"&&(p={backgroundColor:l.secondary,color:s.default(l.secondary,[e.white,e[100]])}),t==="filled"&&u==="tertiary"&&(p={backgroundColor:l.tertiary,color:s.default(l.tertiary,[e.white,e[100]])}),t==="outlined"&&(p={borderColor:e[50],backgroundColor:e.white,color:s.default(e.white,[e.white,e[100]])}),t==="text"&&u==="primary"&&(p={backgroundColor:"transparent",color:s.default("transparent",[e.white,e[100]])}),t==="text"&&u==="secondary"&&(p={backgroundColor:"transparent",color:e[70]}),p}};
10
+ ${({theme:{palette:{brand:p,grey:e}},variant:t,color:u})=>{let l={backgroundColor:p.primary.main,color:a.default(p.primary.main,[e.white,e[100]])};return t==="filled"&&u==="secondary"&&(l={backgroundColor:p.secondary,color:a.default(p.secondary,[e.white,e[100]])}),t==="filled"&&u==="tertiary"&&(l={backgroundColor:p.tertiary,color:a.default(p.tertiary,[e.white,e[100]])}),t==="outlined"&&(l={borderColor:e[50],backgroundColor:e.white,color:a.default(e.white,[e.white,e[100]])}),t==="text"&&u==="primary"&&(l={backgroundColor:"transparent",color:a.default("transparent",[e.white,e[100]])}),t==="text"&&u==="secondary"&&(l={backgroundColor:"transparent",color:e[70]}),l}};
11
11
 
12
- ${({theme:{spacing:l,typography:e},variant:t,size:u,startAdornment:p,endAdornment:o,iconOnly:f})=>{let r={gap:l.content(1),padding:10,borderRadius:8,fontSize:e.b4M.size,fontWeight:e.b4M.weight,lineHeight:e.b4M.lineHeight,letterSpacing:e.b4M.letterSpacing,"& svg":{width:20,height:20}};if(u==="2xLarge"){const{h0B:i}=e;let x="26px 24px";p&&(x=t==="text"?"26px 16px 26px 12px":"26px 36px 26px 24px"),o&&(x=t==="text"?"26px 12px 26px 16px":"26px 24px 26px 36px"),p&&o&&(x=t==="text"?"26px 12px":"26px 24px"),f&&(x="26px 25px"),r={gap:l.content(3),maxHeight:100,padding:x,borderRadius:20,fontSize:i.size,fontWeight:i.weight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,"& svg":{width:48,height:48}}}if(u==="xLarge"){const{h4B:i}=e;let x="16px 12px";p&&(x=t==="text"?"16px 8px 16px 4px":"16px 16px 16px 12px"),o&&(x=t==="text"?"16px 4px 16px 8px":"16px 12px 16px 16px"),p&&o&&(x=t==="text"?"16px 4px":"16px 12px"),f&&(x="16px 15px"),r={gap:l.content(2),maxHeight:56,padding:x,borderRadius:12,fontSize:i.size,fontWeight:i.weight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,"& svg":{width:24,height:24}}}if(u==="large"){const{b2M:i}=e;let x="12px 8px";p&&(x=t==="text"?"12px 8px 12px 4px":"12px 12px 12px 8px"),o&&(x=t==="text"?"12px 4px 12px 8px":"12px 8px 12px 12px"),p&&o&&(x=t==="text"?"12px 4px":"12px 8px"),f&&(x="12px 11px"),r={gap:6,maxHeight:48,padding:x,borderRadius:10,fontSize:i.size,fontWeight:i.weight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,"& svg":{width:24,height:24}}}if(u==="medium"){const{b4M:i}=e;let x="10px 8px";p&&(x=t==="text"?"10px 8px 10px 4px":"10px 10px 10px 8px"),o&&(x=t==="text"?"10px 4px 10px 8px":"10px 8px 10px 10px"),p&&o&&(x=t==="text"?"10px 4px":"10px 8px"),f&&(x="10px 9px"),r={gap:l.content(1),maxHeight:40,padding:x,borderRadius:8,fontSize:i.size,fontWeight:i.weight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,"& svg":{width:20,height:20}}}if(u==="small"){const{c3M:i}=e;let x="8px 6px";p&&(x=t==="text"?"8px 8px 8px 4px":"8px 8px 8px 6px"),o&&(x=t==="text"?"8px 4px 8px 8px":"8px 6px 8px 8px"),p&&o&&(x=t==="text"?"8px 6px":"8px 4px"),f&&(x="8px 7px"),r={gap:l.content(1),maxHeight:32,padding:x,borderRadius:6,fontSize:i.size,fontWeight:i.weight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,"& svg":{width:16,height:16}}}if(u==="xSmall"){const{c3M:i}=e;let x="4px 6px";p&&(x=t==="text"?"4px 8px 4px 4px":"4px 8px 4px 6px"),o&&(x=t==="text"?"4px 4px 4px 8px":"4px 6px 4px 8px"),p&&o&&(x=t==="text"?"4px":"4px 6px"),f&&(x="4px 3px"),f?r={gap:l.content(1),maxHeight:24,width:24,height:24,borderRadius:6,fontSize:i.size,fontWeight:i.weight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,"& svg":{width:16,height:16}}:r={gap:l.content(1),maxHeight:24,padding:x,borderRadius:6,fontSize:i.size,fontWeight:i.weight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,"& svg":{width:16,height:16}}}return t==="text"&&u==="xLarge"&&(r={...r,borderWidth:1.5}),r}};
12
+ ${({theme:{spacing:p,typography:e},variant:t,size:u,startAdornment:l,endAdornment:o,iconOnly:f})=>{let r={gap:p.content(1),padding:10,borderRadius:8,fontSize:e.b4M.size,fontWeight:e.b4M.weight,lineHeight:e.b4M.lineHeight,letterSpacing:e.b4M.letterSpacing,"& svg":{width:20,height:20}};if(u==="2xLarge"){const{h0B:i}=e;let x="26px 24px";l&&(x=t==="text"?"26px 16px 26px 12px":"26px 36px 26px 24px"),o&&(x=t==="text"?"26px 12px 26px 16px":"26px 24px 26px 36px"),l&&o&&(x=t==="text"?"26px 12px":"26px 24px"),f&&(x="26px 25px"),r={gap:p.content(3),maxHeight:100,padding:x,borderRadius:20,fontSize:i.size,fontWeight:i.weight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,"& svg":{width:48,height:48}}}if(u==="xLarge"){const{h4B:i}=e;let x="16px 12px";l&&(x=t==="text"?"16px 8px 16px 4px":"16px 16px 16px 12px"),o&&(x=t==="text"?"16px 4px 16px 8px":"16px 12px 16px 16px"),l&&o&&(x=t==="text"?"16px 4px":"16px 12px"),f&&(x="16px 15px"),r={gap:p.content(2),maxHeight:56,padding:x,borderRadius:12,fontSize:i.size,fontWeight:i.weight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,"& svg":{width:24,height:24}}}if(u==="large"){const{b2M:i}=e;let x="12px 8px";l&&(x=t==="text"?"12px 8px 12px 4px":"12px 12px 12px 8px"),o&&(x=t==="text"?"12px 4px 12px 8px":"12px 8px 12px 12px"),l&&o&&(x=t==="text"?"12px 4px":"12px 8px"),f&&(x="12px 11px"),r={gap:6,maxHeight:48,padding:x,borderRadius:10,fontSize:i.size,fontWeight:i.weight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,"& svg":{width:24,height:24}}}if(u==="medium"){const{b4M:i}=e;let x="10px 8px";l&&(x=t==="text"?"10px 8px 10px 4px":"10px 10px 10px 8px"),o&&(x=t==="text"?"10px 4px 10px 8px":"10px 8px 10px 10px"),l&&o&&(x=t==="text"?"10px 4px":"10px 8px"),f&&(x="10px 9px"),r={gap:p.content(1),maxHeight:40,padding:x,borderRadius:8,fontSize:i.size,fontWeight:i.weight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,"& svg":{width:20,height:20}}}if(u==="small"){const{c3M:i}=e;let x="8px 6px";l&&(x=t==="text"?"8px 8px 8px 4px":"8px 8px 8px 6px"),o&&(x=t==="text"?"8px 4px 8px 8px":"8px 6px 8px 8px"),l&&o&&(x=t==="text"?"8px 6px":"8px 4px"),f&&(x="8px 7px"),r={gap:p.content(1),maxHeight:32,padding:x,borderRadius:6,fontSize:i.size,fontWeight:i.weight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,"& svg":{width:16,height:16}}}if(u==="xSmall"){const{c3M:i}=e;let x="4px 6px";l&&(x=t==="text"?"4px 8px 4px 4px":"4px 8px 4px 6px"),o&&(x=t==="text"?"4px 4px 4px 8px":"4px 6px 4px 8px"),l&&o&&(x=t==="text"?"4px":"4px 6px"),f&&(x="4px 3px"),f?r={gap:p.content(1),maxHeight:24,width:24,height:24,borderRadius:6,fontSize:i.size,fontWeight:i.weight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,"& svg":{width:16,height:16}}:r={gap:p.content(1),maxHeight:24,padding:x,borderRadius:6,fontSize:i.size,fontWeight:i.weight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,"& svg":{width:16,height:16}}}return t==="text"&&u==="xLarge"&&(r={...r,borderWidth:1.5}),r}};
13
13
 
14
- ${({rounded:l})=>l?{}:{borderRadius:"unset"}}
14
+ ${({rounded:p})=>p?{}:{borderRadius:"unset"}}
15
15
 
16
- ${({theme:{palette:{brand:l,grey:e}},variant:t,color:u,isHoverPossible:p})=>{let o={'&:active:not([aria-disabled="true"])':{backgroundColor:l.primary.press},...p?{'&:hover:not([aria-disabled="true"])':{backgroundColor:l.primary.press}}:{}};return t==="filled"&&u==="secondary"&&(o={'&:active:not([aria-disabled="true"])':{backgroundColor:e[100]},...p?{'&:hover:not([aria-disabled="true"])':{backgroundColor:e[100]}}:{}}),t==="filled"&&u==="tertiary"&&(o={'&:active:not([aria-disabled="true"])':{backgroundColor:e[70]},...p?{'&:hover:not([aria-disabled="true"])':{backgroundColor:e[70]}}:{}}),(t==="outlined"||t==="text")&&(o={'&:active:not([aria-disabled="true"])':{backgroundColor:e[10]},...p?{'&:hover:not([aria-disabled="true"])':{backgroundColor:e[10]}}:{}}),o}}
16
+ ${({underlined:p})=>p?{textDecoration:"underline"}:{}}
17
+
18
+ ${({theme:{palette:{brand:p,grey:e}},variant:t,color:u,isHoverPossible:l})=>{let o={'&:active:not([aria-disabled="true"])':{backgroundColor:p.primary.press},...l?{'&:hover:not([aria-disabled="true"])':{backgroundColor:p.primary.press}}:{}};return t==="filled"&&u==="secondary"&&(o={'&:active:not([aria-disabled="true"])':{backgroundColor:e[100]},...l?{'&:hover:not([aria-disabled="true"])':{backgroundColor:e[100]}}:{}}),t==="filled"&&u==="tertiary"&&(o={'&:active:not([aria-disabled="true"])':{backgroundColor:e[70]},...l?{'&:hover:not([aria-disabled="true"])':{backgroundColor:e[70]}}:{}}),(t==="outlined"||t==="text")&&(o={'&:active:not([aria-disabled="true"])':{backgroundColor:e[10]},...l?{'&:hover:not([aria-disabled="true"])':{backgroundColor:e[10]}}:{}}),o}}
17
19
 
18
20
  &[aria-disabled="true"], &[aria-busy="true"] {
19
21
  cursor: not-allowed;
20
22
 
21
- ${({theme:{palette:{brand:l,grey:e}},variant:t,color:u})=>{let p={backgroundColor:l.primary.disable,color:s.default(l.primary.disable,[e[30],e.white])};return t==="filled"&&u==="secondary"&&(p={backgroundColor:e[10],color:s.default(e[10],[e[30],e.white])}),t==="outlined"&&(p={borderColor:e[30],backgroundColor:e[10],color:s.default(e[30],[e[30],e.white])}),t==="text"&&(p={color:s.default(e[30],[e[30],e.white])}),p}};
23
+ ${({theme:{palette:{brand:p,grey:e}},variant:t,color:u})=>{let l={backgroundColor:p.primary.disable,color:a.default(p.primary.disable,[e[30],e.white])};return t==="filled"&&u==="secondary"&&(l={backgroundColor:e[10],color:a.default(e[10],[e[30],e.white])}),t==="outlined"&&(l={borderColor:e[30],backgroundColor:e[10],color:a.default(e[30],[e[30],e.white])}),t==="text"&&(l={color:a.default(e[30],[e[30],e.white])}),l}};
22
24
  }
23
25
 
24
- ${({fullWidth:l})=>l?{width:"100%"}:null};
25
- `,P=M.forwardRef(function({tag:e="button",children:t,variant:u="filled",size:p="medium",color:o="primary",startAdornment:f,endAdornment:r,iconOnly:i,fullWidth:x,inlineCSS:z,rounded:W=!0,disabled:w,onClick:S,onKeyDown:H,loading:c,loadingPosition:R,loadingIndicator:h,...C},q){const{isHoverPossible:m}=E.default(),_=()=>{if(!i)return;if(C["aria-label"])return C["aria-label"];const d=f||r||t;if(M.isValidElement(d))return T.default(d.props.name)},$=d=>{w||c||S==null||S(d)},B=d=>{w||c||H==null||H(d)},L=!!c,k=h?a.jsx(a.Fragment,{children:h}):a.jsx(N.default,{loop:!0});let g=f,b=i?null:t,n=r;return L&&(R?R==="start"?(g=a.jsx(j.default,{children:k}),n=h?null:r,b=i||h?null:t):(g=h?null:f,n=a.jsx(j.default,{children:k}),b=i||h?null:t):(g=null,n=null,b=i?null:k)),a.jsxs(J,{as:e,ref:q,type:e==="button"?"button":void 0,variant:u,size:p,color:o,fullWidth:x,rounded:W,startAdornment:f,endAdornment:r,iconOnly:i,isHoverPossible:m,"aria-disabled":w||c,"aria-busy":c,"aria-label":_(),onClick:$,onKeyDown:B,...C,css:z,children:[g,b,n,c&&a.jsx(j.default,{visuallyHidden:!0,role:"status","aria-live":"polite","aria-atomic":"true",children:typeof t=="string"?`${t} 중`:"로딩 중"})]})});exports.default=P;
26
+ ${({fullWidth:p})=>p?{width:"100%"}:null};
27
+ `,P=M.forwardRef(function({tag:e="button",children:t,variant:u="filled",size:l="medium",color:o="primary",startAdornment:f,endAdornment:r,iconOnly:i,fullWidth:x,inlineCSS:z,rounded:W=!0,underlined:q=!1,disabled:w,onClick:S,onKeyDown:H,loading:c,loadingPosition:R,loadingIndicator:h,...C},$){const{isHoverPossible:m}=T.default(),_=()=>{if(!i)return;if(C["aria-label"])return C["aria-label"];const d=f||r||t;if(M.isValidElement(d))return F.default(d.props.name)},B=d=>{w||c||S==null||S(d)},L=d=>{w||c||H==null||H(d)},N=!!c,k=h?s.jsx(s.Fragment,{children:h}):s.jsx(E.default,{loop:!0});let g=f,b=i?null:t,n=r;return N&&(R?R==="start"?(g=s.jsx(j.default,{children:k}),n=h?null:r,b=i||h?null:t):(g=h?null:f,n=s.jsx(j.default,{children:k}),b=i||h?null:t):(g=null,n=null,b=i?null:k)),s.jsxs(J,{as:e,ref:$,type:e==="button"?"button":void 0,variant:u,size:l,color:o,fullWidth:x,rounded:W,underlined:q,startAdornment:f,endAdornment:r,iconOnly:i,isHoverPossible:m,"aria-disabled":w||c,"aria-busy":c,"aria-label":_(),onClick:B,onKeyDown:L,...C,css:z,children:[g,b,n,c&&s.jsx(j.default,{visuallyHidden:!0,role:"status","aria-live":"polite","aria-atomic":"true",children:typeof t=="string"?`${t} 중`:"로딩 중"})]})});exports.default=P;
@@ -11,6 +11,7 @@ export type ButtonProps<T extends ElementType = 'button'> = PolymorphicComponent
11
11
  iconOnly?: boolean;
12
12
  fullWidth?: boolean;
13
13
  rounded?: boolean;
14
+ underlined?: boolean;
14
15
  loading?: boolean;
15
16
  loadingPosition?: 'start' | 'end';
16
17
  loadingIndicator?: ReactNode;
@@ -1,12 +1,12 @@
1
- import { jsxs as E, jsx as g, Fragment as F } from "@emotion/react/jsx-runtime";
2
- import { forwardRef as T, isValidElement as V } from "react";
1
+ import { jsxs as F, jsx as g, Fragment as T } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as V, isValidElement as q } from "react";
3
3
  import k from "../Box/Box.es.js";
4
- import q from "../CircularProgressIndicator/CircularProgressIndicator.es.js";
5
- import G from "../hooks/useCheckHoverPossible/useCheckHoverPossible.es.js";
6
- import J from "../utils/getIconLabel/getIconLabel.es.js";
7
- import Q from "@emotion/styled";
4
+ import G from "../CircularProgressIndicator/CircularProgressIndicator.es.js";
5
+ import J from "../hooks/useCheckHoverPossible/useCheckHoverPossible.es.js";
6
+ import Q from "../utils/getIconLabel/getIconLabel.es.js";
7
+ import U from "@emotion/styled";
8
8
  import h from "../utils/getContrastingTextColor/getContrastingTextColor.es.js";
9
- const U = Q.button`
9
+ const X = U.button`
10
10
  display: inline-flex;
11
11
  align-items: center;
12
12
  justify-content: center;
@@ -198,6 +198,10 @@ const U = Q.button`
198
198
  borderRadius: "unset"
199
199
  }}
200
200
 
201
+ ${({ underlined: l }) => l ? {
202
+ textDecoration: "underline"
203
+ } : {}}
204
+
201
205
  ${({
202
206
  theme: {
203
207
  palette: { brand: l, grey: e }
@@ -252,7 +256,7 @@ const U = Q.button`
252
256
  ${({ fullWidth: l }) => l ? {
253
257
  width: "100%"
254
258
  } : null};
255
- `, v = T(function({
259
+ `, O = V(function({
256
260
  tag: e = "button",
257
261
  children: t,
258
262
  variant: o = "filled",
@@ -264,6 +268,7 @@ const U = Q.button`
264
268
  fullWidth: x,
265
269
  inlineCSS: R,
266
270
  rounded: W = !0,
271
+ underlined: M = !1,
267
272
  disabled: w,
268
273
  onClick: S,
269
274
  onKeyDown: H,
@@ -271,39 +276,40 @@ const U = Q.button`
271
276
  loadingPosition: z,
272
277
  loadingIndicator: c,
273
278
  ...m
274
- }, M) {
275
- const { isHoverPossible: j } = G(), $ = () => {
279
+ }, $) {
280
+ const { isHoverPossible: j } = J(), B = () => {
276
281
  if (!i) return;
277
282
  if (m["aria-label"]) return m["aria-label"];
278
283
  const a = u || f || t;
279
- if (V(a))
280
- return J(a.props.name);
281
- }, B = (a) => {
282
- w || s || S == null || S(a);
284
+ if (q(a))
285
+ return Q(a.props.name);
283
286
  }, L = (a) => {
287
+ w || s || S == null || S(a);
288
+ }, N = (a) => {
284
289
  w || s || H == null || H(a);
285
- }, N = !!s, C = c ? /* @__PURE__ */ g(F, { children: c }) : /* @__PURE__ */ g(q, { loop: !0 });
290
+ }, E = !!s, C = c ? /* @__PURE__ */ g(T, { children: c }) : /* @__PURE__ */ g(G, { loop: !0 });
286
291
  let d = u, b = i ? null : t, n = f;
287
- return N && (z ? z === "start" ? (d = /* @__PURE__ */ g(k, { children: C }), n = c ? null : f, b = i || c ? null : t) : (d = c ? null : u, n = /* @__PURE__ */ g(k, { children: C }), b = i || c ? null : t) : (d = null, n = null, b = i ? null : C)), /* @__PURE__ */ E(
288
- U,
292
+ return E && (z ? z === "start" ? (d = /* @__PURE__ */ g(k, { children: C }), n = c ? null : f, b = i || c ? null : t) : (d = c ? null : u, n = /* @__PURE__ */ g(k, { children: C }), b = i || c ? null : t) : (d = null, n = null, b = i ? null : C)), /* @__PURE__ */ F(
293
+ X,
289
294
  {
290
295
  as: e,
291
- ref: M,
296
+ ref: $,
292
297
  type: e === "button" ? "button" : void 0,
293
298
  variant: o,
294
299
  size: p,
295
300
  color: r,
296
301
  fullWidth: x,
297
302
  rounded: W,
303
+ underlined: M,
298
304
  startAdornment: u,
299
305
  endAdornment: f,
300
306
  iconOnly: i,
301
307
  isHoverPossible: j,
302
308
  "aria-disabled": w || s,
303
309
  "aria-busy": s,
304
- "aria-label": $(),
305
- onClick: B,
306
- onKeyDown: L,
310
+ "aria-label": B(),
311
+ onClick: L,
312
+ onKeyDown: N,
307
313
  ...m,
308
314
  css: R,
309
315
  children: [
@@ -317,5 +323,5 @@ const U = Q.button`
317
323
  );
318
324
  });
319
325
  export {
320
- v as default
326
+ O as default
321
327
  };
@@ -30,6 +30,7 @@ type Story = StoryObj<typeof meta>;
30
30
  export declare const Filled: Story;
31
31
  export declare const Outlined: Story;
32
32
  export declare const Text: Story;
33
+ export declare const Underlined: Story;
33
34
  export declare const FullWidth: Story;
34
35
  export declare const StartAdornment: Story;
35
36
  export declare const EndAdornment: Story;
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @dotss/ui
2
2
 
3
+ ## 1.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5dc7122: feat(ui): Button.underlined 추가
8
+
9
+ ## 1.7.2
10
+
11
+ ### Patch Changes
12
+
13
+ - 7a94bcd: fix(ui): useCollapse 애니메이션 발생 관련 부수효과함수 로직 수정
14
+
3
15
  ## 1.7.1
4
16
 
5
17
  ### Patch Changes
package/Icon/Icon.cjs CHANGED
@@ -1,5 +1,7 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("@emotion/react/jsx-runtime"),t=require("react"),S=require("../resources/tictoccroc/icons/index.ts-B8qwAe9y.cjs"),b=require("@emotion/styled"),h=require("../utils/getPaletteColor/getPaletteColor.cjs"),I=r=>r&&r.__esModule?r:{default:r},w=I(b),$=r=>w.default(r)`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("@emotion/react/jsx-runtime"),t=require("react"),y=require("../resources/tictoccroc/icons/index.ts-B8qwAe9y.cjs"),S=require("@emotion/styled"),b=require("../utils/getPaletteColor/getPaletteColor.cjs"),I=r=>r&&r.__esModule?r:{default:r},w=I(S),$=r=>w.default(r)`
2
+ flex-shrink: 0;
3
+
2
4
  ${({size:o,width:s,height:a})=>{let n={width:s,height:a};switch(o){case"large":n={width:32,height:32};break;case"medium":n={width:24,height:24};break;case"small":n={width:20,height:20};break;case"xSmall":n={width:16,height:16};break}return n}};
3
5
 
4
- color: ${({theme:o,color:s="grey.100"})=>h.default(s,{theme:o})};
5
- `,q=t.forwardRef(function({id:o,name:s,width:a=24,height:n=24,size:i,color:p="grey.100",inlineCSS:d,...f},m){const _=$(k=>t.Children.map(S.SvgIcons[s](),c=>t.isValidElement(c)?t.cloneElement(c,{focusable:!1,"aria-hidden":!0,...c.props,...k,children:t.Children.map(c.props.children,e=>{var u;if(!t.isValidElement(e))return null;if(e.type==="mask"){const l=`${e.props.id}-${o||0}`;return t.cloneElement(e,{...e.props,id:l})}return e.type==="path"&&!!e.props.mask?t.cloneElement(e,{...e.props,mask:`${(u=e.props.mask)==null?void 0:u.replace(/\)$/,`-${o||0})`)}`}):e})}):null));return y.jsx(_,{ref:m,width:a,height:n,size:i,color:p,...f,css:d})});exports.default=q;
6
+ color: ${({theme:o,color:s="grey.100"})=>b.default(s,{theme:o})};
7
+ `,q=t.forwardRef(function({id:o,name:s,width:a=24,height:n=24,size:i,color:p="grey.100",inlineCSS:d,...f},m){const k=$(_=>t.Children.map(y.SvgIcons[s](),c=>t.isValidElement(c)?t.cloneElement(c,{focusable:!1,"aria-hidden":!0,...c.props,..._,children:t.Children.map(c.props.children,e=>{var l;if(!t.isValidElement(e))return null;if(e.type==="mask"){const u=`${e.props.id}-${o||0}`;return t.cloneElement(e,{...e.props,id:u})}return e.type==="path"&&!!e.props.mask?t.cloneElement(e,{...e.props,mask:`${(l=e.props.mask)==null?void 0:l.replace(/\)$/,`-${o||0})`)}`}):e})}):null));return h.jsx(k,{ref:m,width:a,height:n,size:i,color:p,...f,css:d})});exports.default=q;
package/Icon/Icon.es.js CHANGED
@@ -4,6 +4,8 @@ import { S as $ } from "../resources/tictoccroc/icons/index.ts-B4Sh1uNq.js";
4
4
  import b from "@emotion/styled";
5
5
  import x from "../utils/getPaletteColor/getPaletteColor.es.js";
6
6
  const g = (p) => b(p)`
7
+ flex-shrink: 0;
8
+
7
9
  ${({ size: t, width: o, height: a }) => {
8
10
  let r = {
9
11
  width: o,
@@ -41,12 +43,12 @@ const g = (p) => b(p)`
41
43
  color: ${({ theme: t, color: o = "grey.100" }) => x(o, {
42
44
  theme: t
43
45
  })};
44
- `, V = y(function({ id: t, name: o, width: a = 24, height: r = 24, size: u, color: l = "grey.100", inlineCSS: k, ...I }, S) {
45
- const d = g((h) => f.map($[o](), (n) => i(n) ? s(n, {
46
+ `, V = y(function({ id: t, name: o, width: a = 24, height: r = 24, size: l, color: u = "grey.100", inlineCSS: k, ...h }, I) {
47
+ const S = g((d) => f.map($[o](), (n) => i(n) ? s(n, {
46
48
  focusable: !1,
47
49
  "aria-hidden": !0,
48
50
  ...n.props,
49
- ...h,
51
+ ...d,
50
52
  children: f.map(n.props.children, (e) => {
51
53
  var c;
52
54
  if (!i(e))
@@ -65,14 +67,14 @@ const g = (p) => b(p)`
65
67
  })
66
68
  }) : null));
67
69
  return /* @__PURE__ */ w(
68
- d,
70
+ S,
69
71
  {
70
- ref: S,
72
+ ref: I,
71
73
  width: a,
72
74
  height: r,
73
- size: u,
74
- color: l,
75
- ...I,
75
+ size: l,
76
+ color: u,
77
+ ...h,
76
78
  css: k
77
79
  }
78
80
  );
@@ -1 +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;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react"),P=require("../../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs"),q=require("../../usePrefersReducedMotion/usePrefersReducedMotion.cjs");function y({isCollapsed:t=!0,duration:f=200,delay:o=0,easing:s="ease-in-out",onTransitionStart:i,onTransitionEnd:h}={}){const{prefersReducedMotion:p}=q.default(),l=r.useRef(null),e=r.useRef(null),u=r.useRef(i),c=r.useRef(h),a=r.useRef(t);u.current=i,c.current=h;const[g,v]=r.useState(t?"0px":"auto");return P.default(()=>{var m;if(a.current===t)return;a.current=t;const n=l.current;if(!n)return;e.current&&(e.current.cancel(),e.current=null);const R=n.scrollHeight,H=t?[{height:`${R}px`},{height:"0px"}]:[{height:"0px"},{height:`${R}px`}],M=t?"0px":"auto";return(m=u.current)==null||m.call(u),e.current=n.animate(H,{duration:p?0:f,easing:s,delay:o,fill:"forwards"}),e.current.onfinish=()=>{var x,d;(x=e.current)==null||x.commitStyles(),v(M),(d=c.current)==null||d.call(c),e.current=null},()=>{e.current&&(e.current.cancel(),e.current=null)}},[t,f,o,s]),{targetRef:l,isCollapsed:t,height:g,style:{height:g,overflow:"hidden"},ariaProps:{"aria-hidden":t}}}exports.default=y;
@@ -1,51 +1,50 @@
1
- import { useRef as r, useState as M } from "react";
2
- import P from "../../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.es.js";
1
+ import { useRef as t, useState as y } from "react";
2
+ import M from "../../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.es.js";
3
3
  import $ from "../../usePrefersReducedMotion/usePrefersReducedMotion.es.js";
4
- function L({
5
- isCollapsed: t = !0,
4
+ function d({
5
+ isCollapsed: r = !0,
6
6
  duration: o = 200,
7
7
  delay: f = 0,
8
- easing: i = "ease-in-out",
9
- onTransitionStart: s,
10
- onTransitionEnd: h
8
+ easing: h = "ease-in-out",
9
+ onTransitionStart: i,
10
+ onTransitionEnd: m
11
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;
12
+ const { prefersReducedMotion: R } = $(), s = t(null), e = t(null), u = t(i), c = t(m), g = t(r);
13
+ u.current = i, c.current = m;
14
+ const [l, P] = y(r ? "0px" : "auto");
15
+ return M(() => {
16
+ var x;
17
+ if (g.current === r)
19
18
  return;
20
- }
21
- const n = l.current;
19
+ g.current = r;
20
+ const n = s.current;
22
21
  if (!n) return;
23
22
  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,
23
+ const p = n.scrollHeight, v = r ? [{ height: `${p}px` }, { height: "0px" }] : [{ height: "0px" }, { height: `${p}px` }], w = r ? "0px" : "auto";
24
+ return (x = u.current) == null || x.call(u), e.current = n.animate(v, {
25
+ duration: R ? 0 : o,
26
+ easing: h,
28
27
  delay: f,
29
28
  fill: "forwards"
30
29
  }), 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;
30
+ var a, H;
31
+ (a = e.current) == null || a.commitStyles(), P(w), (H = c.current) == null || H.call(c), e.current = null;
33
32
  }, () => {
34
33
  e.current && (e.current.cancel(), e.current = null);
35
34
  };
36
- }, [t, o, f, i]), {
37
- targetRef: l,
38
- isCollapsed: t,
39
- height: p,
35
+ }, [r, o, f, h]), {
36
+ targetRef: s,
37
+ isCollapsed: r,
38
+ height: l,
40
39
  style: {
41
- height: p,
40
+ height: l,
42
41
  overflow: "hidden"
43
42
  },
44
43
  ariaProps: {
45
- "aria-hidden": t
44
+ "aria-hidden": r
46
45
  }
47
46
  };
48
47
  }
49
48
  export {
50
- L as default
49
+ d as default
51
50
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotss/ui",
3
- "version": "1.7.1",
3
+ "version": "1.8.0",
4
4
  "description": "React UI components for Dotss",
5
5
  "type": "module",
6
6
  "main": "./index.cjs",