@dotss/ui 0.0.10 → 0.0.11
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/Accordion/Accordion.cjs +13 -7
- package/Accordion/Accordion.d.ts +2 -0
- package/Accordion/Accordion.es.js +86 -65
- package/Autocomplete/Autocomplete.cjs +1 -1
- package/Autocomplete/Autocomplete.d.ts +1 -1
- package/Autocomplete/Autocomplete.es.js +235 -80
- package/BottomSheet/BottomSheet.cjs +5 -5
- package/BottomSheet/BottomSheet.d.ts +3 -0
- package/BottomSheet/BottomSheet.es.js +88 -70
- package/BottomSheet/BottomSheetText/BottomSheetText.cjs +2 -2
- package/BottomSheet/BottomSheetText/BottomSheetText.es.js +18 -6
- package/BottomSheet/BottomSheetTitle/BottomSheetTitle.cjs +6 -6
- package/BottomSheet/BottomSheetTitle/BottomSheetTitle.d.ts +2 -1
- package/BottomSheet/BottomSheetTitle/BottomSheetTitle.es.js +26 -15
- package/Button/Button.cjs +6 -6
- package/Button/Button.es.js +35 -29
- package/ChainPicker/ChainPicker.cjs +16 -6
- package/ChainPicker/ChainPicker.d.ts +4 -2
- package/ChainPicker/ChainPicker.es.js +155 -110
- package/ChainPicker/ChainPicker.stories.d.ts +1 -1
- package/Checkbox/Checkbox.cjs +3 -3
- package/Checkbox/Checkbox.es.js +12 -10
- package/CircularProgressIndicator/CircularProgressIndicator.cjs +5 -5
- package/CircularProgressIndicator/CircularProgressIndicator.es.js +26 -23
- package/DatePicker/DatePicker.cjs +37 -20
- package/DatePicker/DatePicker.d.ts +2 -1
- package/DatePicker/DatePicker.es.js +345 -320
- package/DatePicker/DatePicker.stories.d.ts +1 -0
- package/DatePicker/EventDot/EventDot.cjs +8 -0
- package/DatePicker/EventDot/EventDot.d.ts +8 -0
- package/DatePicker/EventDot/EventDot.es.js +19 -0
- package/DatePicker/EventDot/index.cjs +1 -0
- package/DatePicker/EventDot/index.d.ts +3 -0
- package/DatePicker/EventDot/index.es.js +4 -0
- package/DatePicker/EventDotGroup/EventDotGroup.cjs +8 -0
- package/DatePicker/EventDotGroup/EventDotGroup.d.ts +8 -0
- package/DatePicker/EventDotGroup/EventDotGroup.es.js +39 -0
- package/DatePicker/EventDotGroup/index.cjs +1 -0
- package/DatePicker/EventDotGroup/index.d.ts +3 -0
- package/DatePicker/EventDotGroup/index.es.js +4 -0
- package/DatePicker/index.cjs +1 -1
- package/DatePicker/index.d.ts +2 -0
- package/DatePicker/index.es.js +6 -2
- package/Dialog/Dialog.cjs +2 -2
- package/Dialog/Dialog.d.ts +2 -0
- package/Dialog/Dialog.es.js +45 -40
- package/Dialog/Dialog.stories.d.ts +10 -0
- package/Dialog/DialogText/DialogText.cjs +1 -1
- package/Dialog/DialogText/DialogText.es.js +1 -1
- package/Dialog/DialogTitle/DialogTitle.cjs +4 -4
- package/Dialog/DialogTitle/DialogTitle.d.ts +2 -1
- package/Dialog/DialogTitle/DialogTitle.es.js +17 -17
- package/FocusBoundary/FocusBoundary.cjs +1 -1
- package/FocusBoundary/FocusBoundary.d.ts +3 -1
- package/FocusBoundary/FocusBoundary.es.js +49 -42
- package/FormControlText/FormControlText.cjs +7 -5
- package/FormControlText/FormControlText.d.ts +2 -0
- package/FormControlText/FormControlText.es.js +50 -40
- package/Icon/Icon.cjs +1 -1
- package/Icon/Icon.es.js +1 -1
- package/IconButton/IconButton.cjs +8 -8
- package/IconButton/IconButton.es.js +32 -25
- package/LineProgressIndicator/LineProgressIndicator.cjs +6 -6
- package/LineProgressIndicator/LineProgressIndicator.es.js +35 -23
- package/Menu/Menu.cjs +16 -16
- package/Menu/Menu.d.ts +3 -2
- package/Menu/Menu.es.js +115 -81
- package/Menu/Menu.stories.d.ts +1 -0
- package/Menu/MenuBlock/MenuBlock.cjs +14 -7
- package/Menu/MenuBlock/MenuBlock.d.ts +1 -0
- package/Menu/MenuBlock/MenuBlock.es.js +47 -35
- package/Menu/MenuButton/MenuButton.cjs +1 -0
- package/Menu/MenuButton/MenuButton.d.ts +10 -0
- package/Menu/MenuButton/MenuButton.es.js +44 -0
- package/Menu/MenuButton/index.cjs +1 -0
- package/Menu/MenuButton/index.d.ts +3 -0
- package/Menu/MenuButton/index.es.js +4 -0
- package/Menu/index.cjs +1 -1
- package/Menu/index.d.ts +1 -0
- package/Menu/index.es.js +4 -2
- package/NumberKeypad/NumberKeypad.cjs +2 -2
- package/NumberKeypad/NumberKeypad.es.js +18 -16
- package/NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.cjs +1 -1
- package/NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.es.js +10 -1
- package/PageControl/PageControl.cjs +16 -5
- package/PageControl/PageControl.d.ts +3 -0
- package/PageControl/PageControl.es.js +77 -24
- package/PageControl/PageControl.stories.d.ts +1 -0
- package/Radio/Radio.cjs +3 -3
- package/Radio/Radio.es.js +22 -20
- package/RadioGroup/RadioGroup.cjs +1 -0
- package/RadioGroup/RadioGroup.d.ts +8 -0
- package/RadioGroup/RadioGroup.es.js +28 -0
- package/RadioGroup/RadioGroup.stories.d.ts +14 -0
- package/RadioGroup/index.cjs +1 -0
- package/RadioGroup/index.d.ts +3 -0
- package/RadioGroup/index.es.js +4 -0
- package/SegmentedButton/SegmentedButton.cjs +14 -3
- package/SegmentedButton/SegmentedButton.es.js +108 -34
- package/Select/Select.cjs +4 -4
- package/Select/Select.es.js +95 -86
- package/Slider/Slider.cjs +27 -12
- package/Slider/Slider.d.ts +1 -0
- package/Slider/Slider.es.js +177 -90
- package/Switch/Switch.cjs +28 -11
- package/Switch/Switch.d.ts +2 -0
- package/Switch/Switch.es.js +185 -65
- package/Switch/Switch.stories.d.ts +1 -0
- package/Tab/Tab.es.js +2 -4
- package/TextArea/TextArea.cjs +42 -34
- package/TextArea/TextArea.es.js +116 -82
- package/TextArea/TextArea.stories.d.ts +1 -1
- package/TextField/TextField.cjs +29 -13
- package/TextField/TextField.d.ts +2 -1
- package/TextField/TextField.es.js +122 -79
- package/TextField/TextField.stories.d.ts +1 -0
- package/Tooltip/Tooltip.cjs +7 -6
- package/Tooltip/Tooltip.d.ts +8 -3
- package/Tooltip/Tooltip.es.js +248 -146
- package/Tooltip/Tooltip.stories.d.ts +1 -0
- package/hooks/index.cjs +1 -1
- package/hooks/index.d.ts +3 -0
- package/hooks/index.es.js +7 -1
- package/hooks/useCheckHasFocus/useCheckHasFocus.cjs +1 -0
- package/hooks/useCheckHasFocus/useCheckHasFocus.d.ts +9 -0
- package/hooks/useCheckHasFocus/useCheckHasFocus.es.js +21 -0
- package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.cjs +1 -0
- package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.d.ts +4 -0
- package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.es.js +30 -0
- package/hooks/useFocusBoundary/useFocusBoundary.cjs +1 -0
- package/hooks/useFocusBoundary/useFocusBoundary.d.ts +12 -0
- package/hooks/useFocusBoundary/useFocusBoundary.es.js +63 -0
- package/index.cjs +1 -1
- package/index.d.ts +2 -1
- package/index.es.js +97 -90
- package/package.json +3 -3
- package/resources/tictoccroc/icons/fill/certified-fill.svg-B_RVx6K_.cjs +1 -0
- package/resources/tictoccroc/icons/fill/certified-fill.svg-CK7UqYft.js +5 -0
- package/resources/tictoccroc/icons/fill/index.d.ts +3 -0
- package/resources/tictoccroc/icons/fill/location-fill.svg-DfSHAnsd.js +5 -0
- package/resources/tictoccroc/icons/fill/location-fill.svg-Die9mxQH.cjs +1 -0
- package/resources/tictoccroc/icons/fill/send-fill.svg-CItD_2L1.js +5 -0
- package/resources/tictoccroc/icons/fill/send-fill.svg-D197Lwl0.cjs +1 -0
- package/resources/tictoccroc/icons/index.ts-BmqvB_n6.cjs +1 -0
- package/resources/tictoccroc/icons/index.ts-CzTh-XsD.js +228 -0
- package/resources/tictoccroc/icons/line/index.d.ts +4 -0
- package/resources/tictoccroc/icons/line/list-line.svg-r5d5htjN.cjs +1 -0
- package/resources/tictoccroc/icons/line/list-line.svg-yFfhZxUp.js +5 -0
- package/resources/tictoccroc/icons/line/monthly-line.svg-BdyaJ1t_.cjs +1 -0
- package/resources/tictoccroc/icons/line/monthly-line.svg-DY5-Xv34.js +5 -0
- package/resources/tictoccroc/icons/line/review-line.svg-B4rfJrsO.js +5 -0
- package/resources/tictoccroc/icons/line/review-line.svg-DYUuUybx.cjs +1 -0
- package/resources/tictoccroc/icons/line/weekly-line.svg-BCO-LS_a.cjs +1 -0
- package/resources/tictoccroc/icons/line/weekly-line.svg-BUPmmgeE.js +5 -0
- package/utils/getIconLabel/getIconLabel.cjs +1 -1
- package/utils/getIconLabel/getIconLabel.es.js +8 -1
- package/utils/getSibling/getSibling.es.js +1 -2
- package/resources/tictoccroc/icons/index.ts-CarI_z7q.js +0 -214
- package/resources/tictoccroc/icons/index.ts-IVJAK4qr.cjs +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as l } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
const a =
|
|
2
|
+
import { forwardRef as s, useId as f } from "react";
|
|
3
|
+
import m from "@emotion/styled";
|
|
4
|
+
const a = m.div`
|
|
5
5
|
text-align: ${({ textAlign: i }) => i};
|
|
6
6
|
|
|
7
7
|
${({
|
|
@@ -22,9 +22,21 @@ const a = f.div`
|
|
|
22
22
|
lineHeight: t.lineHeight,
|
|
23
23
|
letterSpacing: t.letterSpacing
|
|
24
24
|
}}
|
|
25
|
-
`,
|
|
26
|
-
|
|
25
|
+
`, d = s(function({ children: t, type: e = "main", textAlign: o = "center", inlineCSS: n, ...r }, g) {
|
|
26
|
+
const h = f();
|
|
27
|
+
return /* @__PURE__ */ l(
|
|
28
|
+
a,
|
|
29
|
+
{
|
|
30
|
+
ref: g,
|
|
31
|
+
type: e,
|
|
32
|
+
textAlign: o,
|
|
33
|
+
id: `bottom-sheet-text-${h}`,
|
|
34
|
+
...r,
|
|
35
|
+
css: n,
|
|
36
|
+
children: t
|
|
37
|
+
}
|
|
38
|
+
);
|
|
27
39
|
});
|
|
28
40
|
export {
|
|
29
|
-
|
|
41
|
+
d as default
|
|
30
42
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@emotion/react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@emotion/react/jsx-runtime"),n=require("react"),f=require("../../Icon/Icon.cjs"),m=require("@emotion/styled"),x=e=>e&&e.__esModule?e:{default:e},o=x(m),g=o.default.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: center;
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
min-height: 48px;
|
|
10
10
|
max-height: 48px;
|
|
11
11
|
border-bottom: 1px solid
|
|
12
|
-
${({theme:{palette:{grey:e}},hideLine:
|
|
13
|
-
`,
|
|
12
|
+
${({theme:{palette:{grey:e}},hideLine:i})=>i?"transparent":e[10]};
|
|
13
|
+
`,S=o.default.div`
|
|
14
14
|
flex-grow: 1;
|
|
15
15
|
text-align: center;
|
|
16
16
|
text-overflow: ellipsis;
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
overflow: hidden;
|
|
19
19
|
|
|
20
20
|
${({theme:{typography:{h4B:e}}})=>({fontSize:e.size,fontWeight:e.weight,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing})};
|
|
21
|
-
`,
|
|
21
|
+
`,j=o.default.button`
|
|
22
22
|
position: absolute;
|
|
23
23
|
top: 50%;
|
|
24
24
|
right: 16px;
|
|
25
25
|
transform: translateY(-50%);
|
|
26
|
-
`,
|
|
26
|
+
`,s=o.default.div`
|
|
27
27
|
min-width: 24px;
|
|
28
|
-
`,
|
|
28
|
+
`,y=n.forwardRef(function({children:i,onClose:l,hideCloseButton:a,hideLine:r,tag:c="h2",inlineCSS:d,...u},p){const h=n.useId();return t.jsxs(g,{ref:p,hideLine:r,id:`bottom-sheet-title-${h}`,...u,css:d,children:[t.jsx(s,{}),t.jsx(S,{as:c,children:i}),t.jsx(s,{}),!a&&t.jsx(j,{className:"closeButton",onClick:l,"aria-label":"닫기",children:t.jsx(f.default,{name:"CloseLine"})})]})});exports.default=y;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
1
|
+
import { ElementType, HTMLAttributes } from 'react';
|
|
2
2
|
import { GeneralComponentProps } from '../../typings/component';
|
|
3
3
|
|
|
4
4
|
export interface BottomSheetTitleProps extends GeneralComponentProps<HTMLAttributes<HTMLDivElement>> {
|
|
5
5
|
onClose?: () => void;
|
|
6
6
|
hideCloseButton?: boolean;
|
|
7
7
|
hideLine?: boolean;
|
|
8
|
+
tag?: ElementType;
|
|
8
9
|
}
|
|
9
10
|
declare const BottomSheetTitle: import('react').ForwardRefExoticComponent<BottomSheetTitleProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
11
|
export default BottomSheetTitle;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as d, jsx as e } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as f, useId as x } from "react";
|
|
3
|
+
import g from "../../Icon/Icon.es.js";
|
|
4
4
|
import o from "@emotion/styled";
|
|
5
|
-
const
|
|
5
|
+
const u = o.div`
|
|
6
6
|
position: relative;
|
|
7
7
|
display: flex;
|
|
8
8
|
align-items: center;
|
|
@@ -19,7 +19,7 @@ const f = o.div`
|
|
|
19
19
|
},
|
|
20
20
|
hideLine: i
|
|
21
21
|
}) => i ? "transparent" : t[10]};
|
|
22
|
-
`,
|
|
22
|
+
`, w = o.div`
|
|
23
23
|
flex-grow: 1;
|
|
24
24
|
text-align: center;
|
|
25
25
|
text-overflow: ellipsis;
|
|
@@ -36,23 +36,34 @@ const f = o.div`
|
|
|
36
36
|
lineHeight: t.lineHeight,
|
|
37
37
|
letterSpacing: t.letterSpacing
|
|
38
38
|
})};
|
|
39
|
-
`,
|
|
39
|
+
`, S = o.button`
|
|
40
40
|
position: absolute;
|
|
41
41
|
top: 50%;
|
|
42
42
|
right: 16px;
|
|
43
43
|
transform: translateY(-50%);
|
|
44
44
|
`, n = o.div`
|
|
45
45
|
min-width: 24px;
|
|
46
|
-
`,
|
|
47
|
-
function({ children: i, onClose:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
`, T = f(
|
|
47
|
+
function({ children: i, onClose: l, hideCloseButton: r, hideLine: s, tag: a = "h2", inlineCSS: p, ...m }, c) {
|
|
48
|
+
const h = x();
|
|
49
|
+
return /* @__PURE__ */ d(
|
|
50
|
+
u,
|
|
51
|
+
{
|
|
52
|
+
ref: c,
|
|
53
|
+
hideLine: s,
|
|
54
|
+
id: `bottom-sheet-title-${h}`,
|
|
55
|
+
...m,
|
|
56
|
+
css: p,
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ e(n, {}),
|
|
59
|
+
/* @__PURE__ */ e(w, { as: a, children: i }),
|
|
60
|
+
/* @__PURE__ */ e(n, {}),
|
|
61
|
+
!r && /* @__PURE__ */ e(S, { className: "closeButton", onClick: l, "aria-label": "닫기", children: /* @__PURE__ */ e(g, { name: "CloseLine" }) })
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
);
|
|
54
65
|
}
|
|
55
66
|
);
|
|
56
67
|
export {
|
|
57
|
-
|
|
68
|
+
T as default
|
|
58
69
|
};
|
package/Button/Button.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const R=require("@emotion/react/jsx-runtime"),b=require("react"),M=require("../hooks/useCheckHoverPossible/useCheckHoverPossible.cjs"),z=require("../utils/getIconLabel/getIconLabel.cjs"),W=require("@emotion/styled"),a=require("../utils/getContrastingTextColor/getContrastingTextColor.cjs"),j=l=>l&&l.__esModule?l:{default:l},m=j(W),_=m.default.button`
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -7,18 +7,18 @@
|
|
|
7
7
|
color: inherit;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
${({theme:{palette:{brand:l,grey:e}},variant:i,color:
|
|
10
|
+
${({theme:{palette:{brand:l,grey:e}},variant:i,color:r})=>{let p={backgroundColor:l.primary.main,color:a.default(l.primary.main,[e.white,e[100]])};return i==="filled"&&r==="secondary"&&(p={backgroundColor:l.secondary,color:a.default(l.secondary,[e.white,e[100]])}),i==="filled"&&r==="tertiary"&&(p={backgroundColor:l.tertiary,color:a.default(l.tertiary,[e.white,e[100]])}),i==="outlined"&&(p={borderColor:e[50],backgroundColor:e.white,color:a.default(e.white,[e.white,e[100]])}),i==="text"&&r==="primary"&&(p={backgroundColor:"transparent",color:a.default("transparent",[e.white,e[100]])}),i==="text"&&r==="secondary"&&(p={backgroundColor:"transparent",color:e[70]}),p}};
|
|
11
11
|
|
|
12
|
-
${({theme:{spacing:l,typography:e},variant:i,size:
|
|
12
|
+
${({theme:{spacing:l,typography:e},variant:i,size:r,startAdornment:p,endAdornment:o,iconOnly:f})=>{let u={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(r==="2xLarge"){const{h0B:x}=e;let t="26px 24px";p&&(t=i==="text"?"26px 16px 26px 12px":"26px 36px 26px 24px"),o&&(t=i==="text"?"26px 12px 26px 16px":"26px 24px 26px 36px"),p&&o&&(t=i==="text"?"26px 12px":"26px 24px"),f&&(t="26px 25px"),u={gap:l.content(3),maxHeight:100,padding:t,borderRadius:20,fontSize:x.size,fontWeight:x.weight,lineHeight:x.lineHeight,letterSpacing:x.letterSpacing,"& svg":{width:48,height:48}}}if(r==="xLarge"){const{h4B:x}=e;let t="16px 12px";p&&(t=i==="text"?"16px 8px 16px 4px":"16px 16px 16px 12px"),o&&(t=i==="text"?"16px 4px 16px 8px":"16px 12px 16px 16px"),p&&o&&(t=i==="text"?"16px 4px":"16px 12px"),f&&(t="16px 15px"),u={gap:l.content(2),maxHeight:56,padding:t,borderRadius:12,fontSize:x.size,fontWeight:x.weight,lineHeight:x.lineHeight,letterSpacing:x.letterSpacing,"& svg":{width:24,height:24}}}if(r==="large"){const{b2M:x}=e;let t="12px 8px";p&&(t=i==="text"?"12px 8px 12px 4px":"12px 12px 12px 8px"),o&&(t=i==="text"?"12px 4px 12px 8px":"12px 8px 12px 12px"),p&&o&&(t=i==="text"?"12px 4px":"12px 8px"),f&&(t="12px 11px"),u={gap:6,maxHeight:48,padding:t,borderRadius:10,fontSize:x.size,fontWeight:x.weight,lineHeight:x.lineHeight,letterSpacing:x.letterSpacing,"& svg":{width:24,height:24}}}if(r==="medium"){const{b4M:x}=e;let t="10px 8px";p&&(t=i==="text"?"10px 8px 10px 4px":"10px 10px 10px 8px"),o&&(t=i==="text"?"10px 4px 10px 8px":"10px 8px 10px 10px"),p&&o&&(t=i==="text"?"10px 4px":"10px 8px"),f&&(t="10px 9px"),u={gap:l.content(1),maxHeight:40,padding:t,borderRadius:8,fontSize:x.size,fontWeight:x.weight,lineHeight:x.lineHeight,letterSpacing:x.letterSpacing,"& svg":{width:20,height:20}}}if(r==="small"){const{c3M:x}=e;let t="8px 6px";p&&(t=i==="text"?"8px 8px 8px 4px":"8px 8px 8px 6px"),o&&(t=i==="text"?"8px 4px 8px 8px":"8px 6px 8px 8px"),p&&o&&(t=i==="text"?"8px 6px":"8px 4px"),f&&(t="8px 7px"),u={gap:l.content(1),maxHeight:32,padding:t,borderRadius:6,fontSize:x.size,fontWeight:x.weight,lineHeight:x.lineHeight,letterSpacing:x.letterSpacing,"& svg":{width:16,height:16}}}if(r==="xSmall"){const{c3M:x}=e;let t="4px 6px";p&&(t=i==="text"?"4px 8px 4px 4px":"4px 8px 4px 6px"),o&&(t=i==="text"?"4px 4px 4px 8px":"4px 6px 4px 8px"),p&&o&&(t=i==="text"?"4px":"4px 6px"),f&&(t="4px 3px"),f?u={gap:l.content(1),maxHeight:24,width:24,height:24,borderRadius:6,fontSize:x.size,fontWeight:x.weight,lineHeight:x.lineHeight,letterSpacing:x.letterSpacing,"& svg":{width:16,height:16}}:u={gap:l.content(1),maxHeight:24,padding:t,borderRadius:6,fontSize:x.size,fontWeight:x.weight,lineHeight:x.lineHeight,letterSpacing:x.letterSpacing,"& svg":{width:16,height:16}}}return i==="text"&&r==="xLarge"&&(u={...u,borderWidth:1.5}),u}};
|
|
13
13
|
|
|
14
14
|
${({rounded:l})=>l?{}:{borderRadius:"unset"}}
|
|
15
15
|
|
|
16
|
-
${({theme:{palette:{brand:l,grey:e}},variant:i,color:
|
|
16
|
+
${({theme:{palette:{brand:l,grey:e}},variant:i,color:r,isHoverPossible:p})=>{let o={'&:active:not([aria-disabled="true"])':{backgroundColor:l.primary.press},...p?{'&:hover:not([aria-disabled="true"])':{backgroundColor:l.primary.press}}:{}};return i==="filled"&&r==="secondary"&&(o={'&:active:not([aria-disabled="true"])':{backgroundColor:e[100]},...p?{'&:hover:not([aria-disabled="true"])':{backgroundColor:e[100]}}:{}}),i==="filled"&&r==="tertiary"&&(o={'&:active:not([aria-disabled="true"])':{backgroundColor:e[70]},...p?{'&:hover:not([aria-disabled="true"])':{backgroundColor:e[70]}}:{}}),(i==="outlined"||i==="text")&&(o={'&:active:not([aria-disabled="true"])':{backgroundColor:e[10]},...p?{'&:hover:not([aria-disabled="true"])':{backgroundColor:e[10]}}:{}}),o}}
|
|
17
17
|
|
|
18
18
|
&[aria-disabled="true"] {
|
|
19
19
|
cursor: not-allowed;
|
|
20
|
-
${({theme:{palette:{brand:l,grey:e}},variant:i,color:
|
|
20
|
+
${({theme:{palette:{brand:l,grey:e}},variant:i,color:r})=>{let p={backgroundColor:l.primary.disable,color:a.default(l.primary.disable,[e[30],e.white])};return i==="filled"&&r==="secondary"&&(p={backgroundColor:e[10],color:a.default(e[10],[e[30],e.white])}),i==="outlined"&&(p={borderColor:e[30],backgroundColor:e[10],color:a.default(e[30],[e[30],e.white])}),i==="text"&&(p={color:a.default(e[30],[e[30],e.white])}),p}};
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
${({fullWidth:l})=>l?{width:"100%"}:null};
|
|
24
|
-
`,
|
|
24
|
+
`,q=b.forwardRef(function({children:e,variant:i="filled",size:r="medium",color:p="primary",startAdornment:o,endAdornment:f,iconOnly:u,fullWidth:x,inlineCSS:t,rounded:n=!0,disabled:h,onClick:c,onKeyDown:s,...g},w){const{isHoverPossible:S}=M.default(),H=()=>{if(!u)return;if(g["aria-label"])return g["aria-label"];const d=o||f||e;if(b.isValidElement(d))return z.default(d.props.name)},C=d=>{h||c==null||c(d)},k=d=>{h||s==null||s(d)};return R.jsxs(_,{ref:w,variant:i,size:r,color:p,fullWidth:x,rounded:n,startAdornment:o,endAdornment:f,iconOnly:u,isHoverPossible:S,"aria-disabled":h,"aria-label":H(),onClick:C,onKeyDown:k,...g,css:t,children:[o,!u&&e,f]})});exports.default=q;
|
package/Button/Button.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as m } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as k, isValidElement as z } from "react";
|
|
3
|
+
import R from "../hooks/useCheckHoverPossible/useCheckHoverPossible.es.js";
|
|
4
|
+
import W from "../utils/getIconLabel/getIconLabel.es.js";
|
|
5
|
+
import M from "@emotion/styled";
|
|
6
6
|
import c from "../utils/getContrastingTextColor/getContrastingTextColor.es.js";
|
|
7
|
-
const
|
|
7
|
+
const j = M.button`
|
|
8
8
|
display: inline-flex;
|
|
9
9
|
align-items: center;
|
|
10
10
|
justify-content: center;
|
|
@@ -249,7 +249,7 @@ const m = k.button`
|
|
|
249
249
|
${({ fullWidth: l }) => l ? {
|
|
250
250
|
width: "100%"
|
|
251
251
|
} : null};
|
|
252
|
-
`,
|
|
252
|
+
`, V = k(function({
|
|
253
253
|
children: e,
|
|
254
254
|
variant: i = "filled",
|
|
255
255
|
size: r = "medium",
|
|
@@ -259,35 +259,41 @@ const m = k.button`
|
|
|
259
259
|
iconOnly: h,
|
|
260
260
|
fullWidth: x,
|
|
261
261
|
inlineCSS: t,
|
|
262
|
-
rounded:
|
|
263
|
-
disabled:
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
262
|
+
rounded: b = !0,
|
|
263
|
+
disabled: g,
|
|
264
|
+
onClick: d,
|
|
265
|
+
onKeyDown: u,
|
|
266
|
+
...s
|
|
267
|
+
}, n) {
|
|
268
|
+
const { isHoverPossible: w } = R(), S = () => {
|
|
269
|
+
if (!h) return;
|
|
270
|
+
if (s["aria-label"]) return s["aria-label"];
|
|
271
|
+
const a = o || f || e;
|
|
272
|
+
if (z(a))
|
|
273
|
+
return W(a.props.name);
|
|
274
|
+
}, H = (a) => {
|
|
275
|
+
g || d == null || d(a);
|
|
276
|
+
}, C = (a) => {
|
|
277
|
+
g || u == null || u(a);
|
|
278
|
+
};
|
|
279
|
+
return /* @__PURE__ */ m(
|
|
280
|
+
j,
|
|
269
281
|
{
|
|
270
|
-
ref:
|
|
282
|
+
ref: n,
|
|
271
283
|
variant: i,
|
|
272
284
|
size: r,
|
|
273
285
|
color: p,
|
|
274
286
|
fullWidth: x,
|
|
275
|
-
rounded:
|
|
287
|
+
rounded: b,
|
|
276
288
|
startAdornment: o,
|
|
277
289
|
endAdornment: f,
|
|
278
290
|
iconOnly: h,
|
|
279
|
-
isHoverPossible:
|
|
280
|
-
"aria-disabled":
|
|
281
|
-
"aria-label": (
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
return a["aria-label"];
|
|
286
|
-
const g = o || f || e;
|
|
287
|
-
if (S(g))
|
|
288
|
-
return H(g.props.name);
|
|
289
|
-
})(),
|
|
290
|
-
...a,
|
|
291
|
+
isHoverPossible: w,
|
|
292
|
+
"aria-disabled": g,
|
|
293
|
+
"aria-label": S(),
|
|
294
|
+
onClick: H,
|
|
295
|
+
onKeyDown: C,
|
|
296
|
+
...s,
|
|
291
297
|
css: t,
|
|
292
298
|
children: [
|
|
293
299
|
o,
|
|
@@ -298,5 +304,5 @@ const m = k.button`
|
|
|
298
304
|
);
|
|
299
305
|
});
|
|
300
306
|
export {
|
|
301
|
-
|
|
307
|
+
V as default
|
|
302
308
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("@emotion/react/jsx-runtime"),l=require("react"),B=require("@emotion/styled"),G=require("../hooks/useCheckHasFocus/useCheckHasFocus.cjs"),J=require("../hooks/useCheckHoverPossible/useCheckHoverPossible.cjs"),Q=require("../hooks/useCheckKeyboardMode/useCheckKeyboardMode.cjs"),X=s=>s&&s.__esModule?s:{default:s},H=X(B),Z=H.default.div`
|
|
2
2
|
list-style-type: none;
|
|
3
3
|
margin: 0;
|
|
4
4
|
padding: 0;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
position: relative;
|
|
9
9
|
cursor: grab;
|
|
10
10
|
transition: transform 0.3s ease-out;
|
|
11
|
-
`,
|
|
11
|
+
`,ee=H.default.div`
|
|
12
12
|
position: relative;
|
|
13
13
|
width: auto;
|
|
14
14
|
height: fit-content;
|
|
@@ -30,7 +30,17 @@
|
|
|
30
30
|
);
|
|
31
31
|
pointer-events: none;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
|
|
34
|
+
@supports selector(:has(:focus-visible)) {
|
|
35
|
+
&:has(:focus-visible) {
|
|
36
|
+
outline: ${({theme:s})=>s.palette.grey[100]} solid 2px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@supports not selector(:has(:focus-visible)) {
|
|
41
|
+
${({focusWithin:s,theme:t})=>s?{outline:`${t.palette.grey[100]} solid 2px`}:{}}
|
|
42
|
+
}
|
|
43
|
+
`,m=H.default.div`
|
|
34
44
|
height: 54px;
|
|
35
45
|
display: flex;
|
|
36
46
|
align-items: center;
|
|
@@ -38,7 +48,7 @@
|
|
|
38
48
|
scroll-snap-align: start;
|
|
39
49
|
position: relative;
|
|
40
50
|
|
|
41
|
-
${({theme:{palette:{grey:
|
|
51
|
+
${({theme:{palette:{grey:s},typography:{h2M:t},spacing:{content:r}}})=>({fontSize:t.size,fontWeight:t.weight,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,color:s[100],padding:r(3)})};
|
|
42
52
|
|
|
43
|
-
${({selected:
|
|
44
|
-
`,
|
|
53
|
+
${({selected:s,theme:{palette:{grey:t},typography:{h4M:r}}})=>s?{"&, & *":{color:`${t[100]} !important`}}:{color:`${t[30]} !important`,fontSize:`${r.size} !important`,fontWeight:`${r.weight} !important`,lineHeight:`${r.lineHeight} !important`,letterSpacing:`${r.letterSpacing} !important`,"& *":{color:`${t[30]} !important`}}}
|
|
54
|
+
`,_=3,te=l.forwardRef(function({column:t,value:r=t[0].value,onChange:y,renderLabel:k,inlineCSS:C,wrapperProps:g,thumbProps:R,...j},q){const T=t.findIndex(i=>i.value===r),p=l.useRef(T),o=l.useRef(null),[f,S]=l.useState(T*54),[w,P]=l.useState(!1),[D,E]=l.useState(0),[L,O]=l.useState(0),Y=l.useId(),{isHoverPossible:N}=J.default(),{isKeyboardMode:W}=Q.default(),{hasFocus:F}=G.default({ref:o}),I=i=>{P(!0),O(i),E(f)},M=i=>{if(!w)return;const e=L-i;let n=D+e;const a=54*(t.length-1);n<0?n=0:n>a&&(n=a),S(n),o.current&&(o.current.children[0].scrollTop=n)},z=i=>{var n,a;i.stopPropagation();let e=p.current;i.key==="ArrowUp"?(e+=1,e>t.length-1&&(e=0)):i.key==="ArrowDown"?(e-=1,e<0&&(e=t.length-1)):i.key==="PageUp"?(e+=5,e>t.length-1&&(e=0)):i.key==="PageDown"?(e-=5,e<0&&(e=t.length-1)):i.key==="Home"?e=0:i.key==="End"&&(e=t.length-1),y(t[e].value),p.current=e,(a=(n=o.current)==null?void 0:n.querySelector(`.chain-picker-item[data-index="${p.current}"]`))==null||a.focus()},A=i=>I(i.clientY),K=i=>I(i.touches[0].clientY),U=i=>M(i.clientY),V=i=>M(i.touches[0].clientY),v=i=>{if(!w||(P(!1),!N&&i.type==="mouseup"))return;if(Math.abs(D-f)<_){const u=i.target.closest("[data-index]");if(u){const x=Number(u.dataset.index);if(t[x]&&o.current){const b=o.current.children[0];b.scrollTo({top:x*54,behavior:"smooth"});const $=()=>{Math.abs(b.scrollTop-x*54)<1&&(y(t[x].value),b.removeEventListener("scroll",$))};b.addEventListener("scroll",$)}}return}let e=Math.round(f/54),n=e*54;const a=54*(t.length-1);n<0?(n=0,e=0):n>a&&(n=a,e=t.length-1),p.current=e;const c=d=>{if(Math.abs(d-n)<1)S(n),o.current&&(o.current.children[0].scrollTop=n);else{const u=d+(n-d)/5;S(u),o.current&&(o.current.children[0].scrollTop=u),requestAnimationFrame(()=>c(u))}};requestAnimationFrame(()=>c(f)),t[e]&&y(t[e].value)};return l.useLayoutEffect(()=>{const e=t.findIndex(n=>n.value===r)*54;S(e),o.current&&(o.current.children[0].scrollTop=e)},[r,t,54]),h.jsx(ee,{ref:o,...g,css:g==null?void 0:g.inlineCSS,focusWithin:W&&F,children:h.jsx(Z,{role:"group",ref:q,css:C,...j,onMouseDown:A,onMouseMove:U,onMouseUp:v,onMouseLeave:v,onTouchStart:K,onTouchMove:V,onTouchEnd:v,onTouchCancel:v,children:t.map((i,e)=>{const n=t.findIndex(d=>d.value===r),a=n===0?0:Math.round(f/54),c=e===a;return h.jsxs(l.Fragment,{children:[e===0&&h.jsx(m,{className:"chain-picker-item","data-index":e-1,selected:!1,distance:(n+1)*-1}),h.jsx(m,{className:"chain-picker-item","data-index":e,"data-selected":c,selected:c,distance:e-n,role:"spinbutton",tabIndex:c?0:-1,"aria-hidden":c?"false":"true","aria-valuenow":i.value,"aria-valuetext":i.ariaValueText??i.label,"aria-valuemin":t[0].value,"aria-valuemax":t[t.length-1].value,...R,onKeyDown:z,children:k?k(i,c):i.label}),e===t.length-1&&h.jsx(m,{className:"chain-picker-item","data-index":e+1,selected:!1,distance:t.length-n})]},`${Y}_${i.label}`)})})})});exports.SCROLL_POSITION_THRESHOLD=_;exports.default=te;
|
|
@@ -5,13 +5,15 @@ export declare const SCROLL_POSITION_THRESHOLD = 3;
|
|
|
5
5
|
export interface ChainPickerItem {
|
|
6
6
|
label: string;
|
|
7
7
|
value: number;
|
|
8
|
+
ariaValueText?: string;
|
|
8
9
|
}
|
|
9
|
-
export interface ChainPickerProps extends GeneralComponentProps<Omit<HTMLAttributes<
|
|
10
|
+
export interface ChainPickerProps extends GeneralComponentProps<Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>> {
|
|
10
11
|
column: ChainPickerItem[];
|
|
11
12
|
value?: number;
|
|
12
13
|
onChange: (selectedValue: number) => void;
|
|
13
14
|
renderLabel?: (item: ChainPickerItem, isSelected: boolean) => ReactNode;
|
|
14
15
|
wrapperProps?: GeneralComponentProps<HTMLAttributes<HTMLDivElement>>;
|
|
16
|
+
thumbProps?: GeneralComponentProps<HTMLAttributes<HTMLDivElement>>;
|
|
15
17
|
}
|
|
16
|
-
declare const ChainPicker: import('react').ForwardRefExoticComponent<ChainPickerProps & import('react').RefAttributes<
|
|
18
|
+
declare const ChainPicker: import('react').ForwardRefExoticComponent<ChainPickerProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
17
19
|
export default ChainPicker;
|