@dotss/ui 0.0.10 → 0.0.12
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 +25 -22
- 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 +34 -22
- 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,12 +1,14 @@
|
|
|
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 f=require("@emotion/react/jsx-runtime"),l=require("react"),j=require("@emotion/styled"),w=e=>e&&e.__esModule?e:{default:e},d=w(j),_=d.default.div`
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
gap: ${({theme:{spacing:e}})=>e.content(2)}px;
|
|
6
6
|
cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
|
|
7
7
|
flex-direction: ${({placement:e})=>e==="left"?"row-reverse":"row"};
|
|
8
|
-
`,v=
|
|
8
|
+
`,v=d.default.div`
|
|
9
9
|
display: inline-flex;
|
|
10
|
-
`,
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
`,T=d.default.label`
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
|
|
13
|
+
${({theme:{palette:{grey:e},typography:{h0R:n,b2R:o}},size:u,disabled:c})=>{let i={fontSize:o.size,fontWeight:o.weight,lineHeight:o.lineHeight,letterSpacing:o.letterSpacing};return u==="2xLarge"&&(i={fontSize:n.size,fontWeight:n.weight,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing}),c&&(i.color=e[30],i.cursor="not-allowed"),i}}
|
|
14
|
+
`,F=l.forwardRef(function({control:n,text:o,placement:u,size:c,onClick:i,disabled:a,inlineCSS:h,controlWrapperProps:p,textProps:x,...s},y){const C=l.useRef(null),m=l.useId(),g=(s==null?void 0:s.id)||m,S=t=>r=>{r.stopPropagation(),typeof t=="function"&&t(r)};return f.jsxs(_,{ref:y,placement:u,disabled:a,...s,css:h,children:[f.jsx(v,{ref:C,...p,children:l.Children.map(n,t=>{var r;return l.isValidElement(t)?l.cloneElement(t,{size:c,disabled:a,onClick:S((r=t.props)==null?void 0:r.onClick),id:g,...t.props}):null})}),f.jsx(T,{size:c,disabled:a,htmlFor:g,...x,children:o})]})});exports.default=F;
|
|
@@ -9,6 +9,8 @@ export interface FormControlTextProps extends GeneralComponentProps<HTMLAttribut
|
|
|
9
9
|
placement?: 'left' | 'right';
|
|
10
10
|
size?: Extract<Size, 'medium' | '2xLarge'>;
|
|
11
11
|
disabled?: boolean;
|
|
12
|
+
controlWrapperProps?: GeneralComponentProps<HTMLAttributes<HTMLDivElement>>;
|
|
13
|
+
textProps?: GeneralComponentProps<HTMLAttributes<HTMLLabelElement>>;
|
|
12
14
|
}
|
|
13
15
|
declare const FormControlText: import('react').ForwardRefExoticComponent<FormControlTextProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
16
|
export default FormControlText;
|
|
@@ -1,68 +1,78 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { jsxs as w, jsx as g } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as S, useRef as j, useId as F, Children as H, isValidElement as T, cloneElement as $ } from "react";
|
|
3
|
+
import a from "@emotion/styled";
|
|
4
|
+
const k = a.div`
|
|
5
5
|
display: inline-flex;
|
|
6
6
|
align-items: center;
|
|
7
7
|
justify-content: center;
|
|
8
|
-
gap: ${({ theme: { spacing:
|
|
9
|
-
cursor: ${({ disabled:
|
|
10
|
-
flex-direction: ${({ placement:
|
|
11
|
-
`,
|
|
8
|
+
gap: ${({ theme: { spacing: t } }) => t.content(2)}px;
|
|
9
|
+
cursor: ${({ disabled: t }) => t ? "not-allowed" : "pointer"};
|
|
10
|
+
flex-direction: ${({ placement: t }) => t === "left" ? "row-reverse" : "row"};
|
|
11
|
+
`, v = a.div`
|
|
12
12
|
display: inline-flex;
|
|
13
|
-
`,
|
|
13
|
+
`, z = a.label`
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
|
|
14
16
|
${({
|
|
15
17
|
theme: {
|
|
16
|
-
palette: { grey:
|
|
17
|
-
typography: { h0R: o, b2R:
|
|
18
|
+
palette: { grey: t },
|
|
19
|
+
typography: { h0R: o, b2R: n }
|
|
18
20
|
},
|
|
19
|
-
size:
|
|
21
|
+
size: f,
|
|
20
22
|
disabled: l
|
|
21
23
|
}) => {
|
|
22
|
-
let
|
|
23
|
-
fontSize:
|
|
24
|
-
fontWeight:
|
|
25
|
-
lineHeight:
|
|
26
|
-
letterSpacing:
|
|
24
|
+
let i = {
|
|
25
|
+
fontSize: n.size,
|
|
26
|
+
fontWeight: n.weight,
|
|
27
|
+
lineHeight: n.lineHeight,
|
|
28
|
+
letterSpacing: n.letterSpacing
|
|
27
29
|
};
|
|
28
|
-
return
|
|
30
|
+
return f === "2xLarge" && (i = {
|
|
29
31
|
fontSize: o.size,
|
|
30
32
|
fontWeight: o.weight,
|
|
31
33
|
lineHeight: o.lineHeight,
|
|
32
34
|
letterSpacing: o.letterSpacing
|
|
33
|
-
}), l && (
|
|
35
|
+
}), l && (i.color = t[30], i.cursor = "not-allowed"), i;
|
|
34
36
|
}}
|
|
35
|
-
`,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
`, L = S(function({
|
|
38
|
+
control: o,
|
|
39
|
+
text: n,
|
|
40
|
+
placement: f,
|
|
41
|
+
size: l,
|
|
42
|
+
onClick: i,
|
|
43
|
+
disabled: s,
|
|
44
|
+
inlineCSS: u,
|
|
45
|
+
controlWrapperProps: p,
|
|
46
|
+
textProps: h,
|
|
47
|
+
...c
|
|
48
|
+
}, m) {
|
|
49
|
+
const x = j(null), C = F(), d = (c == null ? void 0 : c.id) || C, y = (e) => (r) => {
|
|
50
|
+
r.stopPropagation(), typeof e == "function" && e(r);
|
|
41
51
|
};
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
|
|
52
|
+
return /* @__PURE__ */ w(
|
|
53
|
+
k,
|
|
44
54
|
{
|
|
45
|
-
ref:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
...d,
|
|
55
|
+
ref: m,
|
|
56
|
+
placement: f,
|
|
57
|
+
disabled: s,
|
|
58
|
+
...c,
|
|
50
59
|
css: u,
|
|
51
60
|
children: [
|
|
52
|
-
/* @__PURE__ */ g(
|
|
53
|
-
var
|
|
54
|
-
return
|
|
61
|
+
/* @__PURE__ */ g(v, { ref: x, ...p, children: H.map(o, (e) => {
|
|
62
|
+
var r;
|
|
63
|
+
return T(e) ? $(e, {
|
|
55
64
|
size: l,
|
|
56
|
-
disabled:
|
|
57
|
-
onClick:
|
|
58
|
-
|
|
65
|
+
disabled: s,
|
|
66
|
+
onClick: y((r = e.props) == null ? void 0 : r.onClick),
|
|
67
|
+
id: d,
|
|
68
|
+
...e.props
|
|
59
69
|
}) : null;
|
|
60
70
|
}) }),
|
|
61
|
-
/* @__PURE__ */ g(
|
|
71
|
+
/* @__PURE__ */ g(z, { size: l, disabled: s, htmlFor: d, ...h, children: n })
|
|
62
72
|
]
|
|
63
73
|
}
|
|
64
74
|
);
|
|
65
75
|
});
|
|
66
76
|
export {
|
|
67
|
-
|
|
77
|
+
L as default
|
|
68
78
|
};
|
package/Icon/Icon.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-BmqvB_n6.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)`
|
|
2
2
|
${({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
3
|
|
|
4
4
|
color: ${({theme:o,color:s="grey.100"})=>h.default(s,{theme:o})};
|
package/Icon/Icon.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as w } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { forwardRef as y, Children as f, isValidElement as i, cloneElement as s } from "react";
|
|
3
|
-
import { S as $ } from "../resources/tictoccroc/icons/index.ts-
|
|
3
|
+
import { S as $ } from "../resources/tictoccroc/icons/index.ts-CzTh-XsD.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)`
|
|
@@ -1,21 +1,21 @@
|
|
|
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 l=require("@emotion/react/jsx-runtime"),v=require("react"),m=require("../Icon/Icon.cjs"),C=require("../hooks/useCheckHoverPossible/useCheckHoverPossible.cjs"),p=require("../utils/getIconLabel/getIconLabel.cjs"),w=require("@emotion/styled"),x=require("../utils/getContrastingTextColor/getContrastingTextColor.cjs"),j=r=>r&&r.__esModule?r:{default:r},u=j(w),q=u.default.button`
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
border-radius: 100px;
|
|
6
6
|
|
|
7
|
-
${({theme:{spacing:r},size:
|
|
7
|
+
${({theme:{spacing:r},size:t})=>{let i={width:40,height:40,padding:r.content(1)};switch(t){case"2xLarge":i={width:80,height:80,padding:0};break;case"xLarge":i={width:56,height:56,padding:r.content(.5)};break;case"large":i={width:48,height:48,padding:r.content(1)};break;case"small":i={width:32,height:32,padding:r.content(1)};break;case"xSmall":i={width:24,height:24,padding:r.content(.5)};break}return i}};
|
|
8
8
|
|
|
9
|
-
${({theme:{palette:{yellow:r,grey:
|
|
9
|
+
${({theme:{palette:{yellow:r,grey:t}},variant:i,color:a,isHoverPossible:e})=>{let d={'&:not([aria-disabled="true"]):active > div':{backgroundColor:t[10]},...e?{'&:not([aria-disabled="true"]):hover > div':{backgroundColor:t[10]}}:{}};switch(i){case"standard":a==="tertiary"&&(d={'&:not([aria-disabled="true"]):active > div':{backgroundColor:t[80]},...e?{'&:not([aria-disabled="true"]):hover > div':{backgroundColor:t[80]}}:{}});break;case"filled":a==="primary"&&(d={'&:not([aria-disabled="true"]):active > div':{backgroundColor:r[80]},...e?{'&:not([aria-disabled="true"]):hover > div':{backgroundColor:r[80]}}:{}}),a==="secondary"&&(d={'&:not([aria-disabled="true"]):active > div':{backgroundColor:t[100]},...e?{'&:not([aria-disabled="true"]):hover > div':{backgroundColor:t[100]}}:{}});break;case"outlined":a==="primary"&&(d={'&:not([aria-disabled="true"]):active > div':{backgroundColor:t[10]},...e?{'&:not([aria-disabled="true"]):hover > div':{backgroundColor:t[10]}}:{}}),a==="tertiary"&&(d={'&:not([aria-disabled="true"]):active > div':{backgroundColor:t[100]},...e?{'&:not([aria-disabled="true"]):hover > div':{backgroundColor:t[100]}}:{}});break}return d}};
|
|
10
10
|
|
|
11
11
|
&[aria-disabled='true'] {
|
|
12
12
|
cursor: not-allowed;
|
|
13
13
|
|
|
14
14
|
& > div {
|
|
15
|
-
${({theme:{palette:{brand:r,grey:
|
|
15
|
+
${({theme:{palette:{brand:r,grey:t}},variant:i,color:a})=>{let e={backgroundColor:"transparent","& svg":{color:t[30]}};switch(i){case"standard":a==="tertiary"&&(e={backgroundColor:"transparent","& svg":{color:t[80]}});break;case"filled":a==="primary"&&(e={backgroundColor:r.primary.disable,"& svg":{color:t[30]}}),a==="secondary"&&(e={backgroundColor:t[10],"& svg":{color:t[30]}});break;case"outlined":a==="secondary"&&(e={backgroundColor:t[10],borderColor:t[30],"& svg":{color:t[30]}}),a==="tertiary"&&(e={backgroundColor:t[80],borderColor:t[70],"& svg":{color:t[70]}});break}return e}};
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
`,
|
|
18
|
+
`,W=u.default.div`
|
|
19
19
|
display: flex;
|
|
20
20
|
align-items: center;
|
|
21
21
|
justify-content: center;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
border: 1px solid transparent;
|
|
25
25
|
border-radius: 100px;
|
|
26
26
|
|
|
27
|
-
${({theme:{palette:{brand:r,grey:
|
|
27
|
+
${({theme:{palette:{brand:r,grey:t}},variant:i,color:a})=>{let e={backgroundColor:"transparent"};switch(i){case"standard":a==="tertiary"&&(e={backgroundColor:"transparent","& svg":{color:t.white}});break;case"filled":a==="primary"&&(e={backgroundColor:r.primary.main,color:x.default(r.primary.main,[t.white,t[100]]),"& svg":{color:"inherit"}}),a==="secondary"&&(e={backgroundColor:r.secondary,color:t.white,"& svg":{color:"inherit"}});break;case"outlined":a==="primary"&&(e={backgroundColor:t.white,borderColor:t[50]}),a==="tertiary"&&(e={backgroundColor:"transparent",borderColor:t[50],"& svg":{color:t[50]}});break}return e}};
|
|
28
28
|
|
|
29
|
-
${({size:r})=>{let
|
|
30
|
-
`,
|
|
29
|
+
${({size:r})=>{let t={minWidth:32,minHeight:32,"& svg":{width:24,height:24}};switch(r){case"2xLarge":t={minWidth:80,minHeight:80,borderWidth:2,"& svg":{width:48,height:48}};break;case"xLarge":t={minWidth:52,minHeight:52,"& svg":{width:36,height:36}};break;case"large":t={minWidth:40,minHeight:40,"& svg":{width:32,height:32}};break;case"small":t={minWidth:24,minHeight:24,"& svg":{width:16,height:16}};break;case"xSmall":t={minWidth:20,minHeight:20,"& svg":{width:16,height:16}};break}return t}};
|
|
30
|
+
`,_=v.forwardRef(function({name:t,variant:i="standard",size:a="medium",color:e="primary",inlineCSS:d,disabled:o=!1,onClick:n,onKeyDown:s,...h},b){const{isHoverPossible:g}=C.default(),k=c=>{o||n==null||n(c)},f=c=>{o||s==null||s(c)};return l.jsx(q,{ref:b,variant:i,size:a,color:e,"aria-disabled":o,"aria-label":p.default(t),isHoverPossible:g,onClick:k,onKeyDown:f,...h,css:d,children:l.jsx(W,{variant:i,size:a,color:e,children:l.jsx(m.default,{name:t,focusable:!1})})})});exports.default=_;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const
|
|
1
|
+
import { jsx as l } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as f } from "react";
|
|
3
|
+
import v from "../Icon/Icon.es.js";
|
|
4
|
+
import p from "../hooks/useCheckHoverPossible/useCheckHoverPossible.es.js";
|
|
5
|
+
import C from "../utils/getIconLabel/getIconLabel.es.js";
|
|
6
|
+
import h from "@emotion/styled";
|
|
7
|
+
import w from "../utils/getContrastingTextColor/getContrastingTextColor.es.js";
|
|
8
|
+
const x = h.button`
|
|
9
9
|
display: inline-flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
justify-content: center;
|
|
@@ -157,7 +157,7 @@ const v = c.button`
|
|
|
157
157
|
}};
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
`,
|
|
160
|
+
`, j = h.div`
|
|
161
161
|
display: flex;
|
|
162
162
|
align-items: center;
|
|
163
163
|
justify-content: center;
|
|
@@ -188,7 +188,7 @@ const v = c.button`
|
|
|
188
188
|
case "filled":
|
|
189
189
|
a === "primary" && (t = {
|
|
190
190
|
backgroundColor: e.primary.main,
|
|
191
|
-
color:
|
|
191
|
+
color: w(e.primary.main, [r.white, r[100]]),
|
|
192
192
|
"& svg": {
|
|
193
193
|
color: "inherit"
|
|
194
194
|
}
|
|
@@ -280,33 +280,40 @@ const v = c.button`
|
|
|
280
280
|
}
|
|
281
281
|
return r;
|
|
282
282
|
}};
|
|
283
|
-
`,
|
|
283
|
+
`, S = f(function({
|
|
284
284
|
name: r,
|
|
285
285
|
variant: i = "standard",
|
|
286
286
|
size: a = "medium",
|
|
287
287
|
color: t = "primary",
|
|
288
288
|
inlineCSS: o,
|
|
289
|
-
disabled:
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
289
|
+
disabled: d = !1,
|
|
290
|
+
onClick: n,
|
|
291
|
+
onKeyDown: c,
|
|
292
|
+
...b
|
|
293
|
+
}, u) {
|
|
294
|
+
const { isHoverPossible: m } = p(), g = (s) => {
|
|
295
|
+
d || n == null || n(s);
|
|
296
|
+
}, k = (s) => {
|
|
297
|
+
d || c == null || c(s);
|
|
298
|
+
};
|
|
299
|
+
return /* @__PURE__ */ l(
|
|
300
|
+
x,
|
|
295
301
|
{
|
|
296
|
-
ref:
|
|
302
|
+
ref: u,
|
|
297
303
|
variant: i,
|
|
298
304
|
size: a,
|
|
299
305
|
color: t,
|
|
300
|
-
"aria-disabled":
|
|
301
|
-
"aria-label":
|
|
302
|
-
isHoverPossible:
|
|
303
|
-
|
|
304
|
-
|
|
306
|
+
"aria-disabled": d,
|
|
307
|
+
"aria-label": C(r),
|
|
308
|
+
isHoverPossible: m,
|
|
309
|
+
onClick: g,
|
|
310
|
+
onKeyDown: k,
|
|
311
|
+
...b,
|
|
305
312
|
css: o,
|
|
306
|
-
children: /* @__PURE__ */
|
|
313
|
+
children: /* @__PURE__ */ l(j, { variant: i, size: a, color: t, children: /* @__PURE__ */ l(v, { name: r, focusable: !1 }) })
|
|
307
314
|
}
|
|
308
315
|
);
|
|
309
316
|
});
|
|
310
317
|
export {
|
|
311
|
-
|
|
318
|
+
S as default
|
|
312
319
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
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 n=require("@emotion/react/jsx-runtime"),f=require("react"),g=require("@emotion/react"),m=require("@emotion/styled"),p=e=>e&&e.__esModule?e:{default:e},o=p(m),b=g.keyframes`
|
|
2
2
|
to {
|
|
3
3
|
transform: translateX(100%);
|
|
4
4
|
}
|
|
5
|
-
`,
|
|
5
|
+
`,h=o.default.div`
|
|
6
6
|
position: relative;
|
|
7
7
|
height: ${({size:e})=>e==="large"?42:4}px;
|
|
8
8
|
border-radius: 100px;
|
|
9
9
|
background-color: ${({theme:{palette:{grey:e}}})=>e[10]};
|
|
10
10
|
overflow: hidden;
|
|
11
|
-
`,
|
|
11
|
+
`,y=o.default.div`
|
|
12
12
|
position: absolute;
|
|
13
13
|
top: 0;
|
|
14
14
|
left: 0;
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
transition: transform ${({transitionDuration:e})=>e}ms linear;
|
|
22
22
|
background-color: ${({theme:{palette:{brand:e}}})=>e.primary.main};
|
|
23
23
|
|
|
24
|
-
${({loop:e})=>e?{animation:`${
|
|
25
|
-
`,
|
|
24
|
+
${({loop:e})=>e?{animation:`${b} 1s infinite`}:{}};
|
|
25
|
+
`,x=o.default.div`
|
|
26
26
|
position: absolute;
|
|
27
27
|
top: 0;
|
|
28
28
|
left: 0;
|
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
width: 100%;
|
|
33
33
|
height: 100%;
|
|
34
34
|
white-space: nowrap;
|
|
35
|
-
`,j=f.forwardRef(function({children:
|
|
35
|
+
`,j=f.forwardRef(function({children:s,size:l,value:r=0,transitionDuration:d=500,loop:a,inlineCSS:c,...i},u){let t=r-100;return t=r>100?0:t,t=a?-80:t,n.jsxs(h,{role:"progressbar","aria-valuenow":a?void 0:r,"aria-label":i["aria-label"]?i["aria-label"]:"로딩 중",ref:u,size:l,...i,css:c,children:[n.jsx(y,{transitionDuration:d,loop:a,style:{transform:`translate3d(${t}%, 0, 0)`}}),l==="large"&&s&&n.jsx(x,{children:s})]})});exports.default=j;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as m, jsx as
|
|
1
|
+
import { jsxs as m, jsx as l } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { forwardRef as p } from "react";
|
|
3
3
|
import { keyframes as g } from "@emotion/react";
|
|
4
|
-
import
|
|
4
|
+
import a from "@emotion/styled";
|
|
5
5
|
const h = g`
|
|
6
6
|
to {
|
|
7
7
|
transform: translateX(100%);
|
|
8
8
|
}
|
|
9
|
-
`,
|
|
9
|
+
`, b = a.div`
|
|
10
10
|
position: relative;
|
|
11
11
|
height: ${({ size: t }) => t === "large" ? 42 : 4}px;
|
|
12
12
|
border-radius: 100px;
|
|
@@ -16,7 +16,7 @@ const h = g`
|
|
|
16
16
|
}
|
|
17
17
|
}) => t[10]};
|
|
18
18
|
overflow: hidden;
|
|
19
|
-
`,
|
|
19
|
+
`, u = a.div`
|
|
20
20
|
position: absolute;
|
|
21
21
|
top: 0;
|
|
22
22
|
left: 0;
|
|
@@ -36,7 +36,7 @@ const h = g`
|
|
|
36
36
|
${({ loop: t }) => t ? {
|
|
37
37
|
animation: `${h} 1s infinite`
|
|
38
38
|
} : {}};
|
|
39
|
-
`,
|
|
39
|
+
`, y = a.div`
|
|
40
40
|
position: absolute;
|
|
41
41
|
top: 0;
|
|
42
42
|
left: 0;
|
|
@@ -46,24 +46,36 @@ const h = g`
|
|
|
46
46
|
width: 100%;
|
|
47
47
|
height: 100%;
|
|
48
48
|
white-space: nowrap;
|
|
49
|
-
`,
|
|
50
|
-
function({ children:
|
|
51
|
-
let e =
|
|
52
|
-
return e =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
49
|
+
`, j = p(
|
|
50
|
+
function({ children: n, size: s, value: r = 0, transitionDuration: d = 500, loop: i, inlineCSS: c, ...o }, f) {
|
|
51
|
+
let e = r - 100;
|
|
52
|
+
return e = r > 100 ? 0 : e, e = i ? -80 : e, /* @__PURE__ */ m(
|
|
53
|
+
b,
|
|
54
|
+
{
|
|
55
|
+
role: "progressbar",
|
|
56
|
+
"aria-valuenow": i ? void 0 : r,
|
|
57
|
+
"aria-label": o["aria-label"] ? o["aria-label"] : "로딩 중",
|
|
58
|
+
ref: f,
|
|
59
|
+
size: s,
|
|
60
|
+
...o,
|
|
61
|
+
css: c,
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ l(
|
|
64
|
+
u,
|
|
65
|
+
{
|
|
66
|
+
transitionDuration: d,
|
|
67
|
+
loop: i,
|
|
68
|
+
style: {
|
|
69
|
+
transform: `translate3d(${e}%, 0, 0)`
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
s === "large" && n && /* @__PURE__ */ l(y, { children: n })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
65
77
|
}
|
|
66
78
|
);
|
|
67
79
|
export {
|
|
68
|
-
|
|
80
|
+
j as default
|
|
69
81
|
};
|
package/Menu/Menu.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 y=require("@emotion/react/jsx-runtime"),o=require("react"),ot=require("react-dom"),z=require("../utils/getSibling/getSibling.cjs"),st=require("@emotion/styled"),it=e=>e&&e.__esModule?e:{default:e},$=it(st),rt=$.default.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -6,30 +6,30 @@
|
|
|
6
6
|
height: 100%;
|
|
7
7
|
z-index: 100003;
|
|
8
8
|
|
|
9
|
-
${({disableClickOutside:
|
|
9
|
+
${({disableClickOutside:e})=>e?null:{pointerEvents:"none","& *":{pointerEvents:"auto"}}}}
|
|
10
10
|
|
|
11
|
-
`,
|
|
11
|
+
`,ut=$.default.div`
|
|
12
12
|
position: fixed;
|
|
13
|
-
max-width: calc(100% - ${({theme:{spacing:
|
|
13
|
+
max-width: calc(100% - ${({theme:{spacing:e}})=>e.layout(4)}px);
|
|
14
14
|
border-radius: 10px;
|
|
15
15
|
overflow: hidden;
|
|
16
|
-
background-color: ${({theme:{palette:{grey:
|
|
17
|
-
box-shadow: ${({theme:{elevation:
|
|
16
|
+
background-color: ${({theme:{palette:{grey:e}}})=>e.white};
|
|
17
|
+
box-shadow: ${({theme:{elevation:e}})=>e[4]};
|
|
18
18
|
transition:
|
|
19
|
-
transform ${({transitionDuration:
|
|
20
|
-
opacity ${({transitionDuration:
|
|
21
|
-
transform: scale(${({open:
|
|
22
|
-
opacity: ${({open:
|
|
19
|
+
transform ${({transitionDuration:e})=>e}ms,
|
|
20
|
+
opacity ${({transitionDuration:e=0})=>e/2}ms;
|
|
21
|
+
transform: scale(${({open:e})=>e?1:.97});
|
|
22
|
+
opacity: ${({open:e})=>e?1:0};
|
|
23
23
|
z-index: 100003;
|
|
24
|
-
`,
|
|
24
|
+
`,nt=$.default.ul`
|
|
25
25
|
display: flex;
|
|
26
26
|
flex-direction: column;
|
|
27
|
-
max-height: ${({maxHeight:
|
|
27
|
+
max-height: ${({maxHeight:e})=>e}px;
|
|
28
28
|
overflow-y: auto;
|
|
29
29
|
|
|
30
|
-
${({theme:{spacing:
|
|
31
|
-
`,
|
|
30
|
+
${({theme:{spacing:e},disablePadding:l})=>l?null:{padding:`${e.content(1)}px 0`}}}
|
|
31
|
+
`,ct=$.default.div`
|
|
32
32
|
width: 100%;
|
|
33
33
|
height: 1px;
|
|
34
|
-
background-color: ${({theme:{palette:{grey:
|
|
35
|
-
`,
|
|
34
|
+
background-color: ${({theme:{palette:{grey:e}}})=>e[20]};
|
|
35
|
+
`,k=24,dt=o.forwardRef(function({children:l,anchorRef:d,open:w,onClose:f,spacing:v=4,transitionDuration:T=200,onChange:h,value:H,showDivider:F,placement:D="bottom-center",disablePadding:N,disableClickOutside:R=!0,width:M,fitToAnchorWidth:I=!0,maxHeight:A=476,style:B,inlineCSS:C,menuProps:G,...K},U){const[m,O]=o.useState(0),[_,j]=o.useState(0),[g,V]=o.useState(0),[q,W]=o.useState(!1),[J,Q]=o.useState(!1),[X,L]=o.useState(!0),[Y,p]=o.useState(null),b=o.useRef(),x=o.useRef(),E=o.useRef(null),Z=(t,s)=>u=>{u.stopPropagation(),typeof f=="function"&&f(),typeof h=="function"&&h(t,u),typeof s=="function"&&s(u)},tt=t=>s=>{var r,c,n,a;s.key==="Tab"&&typeof f=="function"&&(f(),p(0)),(s.key==="Enter"||s.key===" ")&&typeof f=="function"&&typeof h=="function"&&(f(),h(t,s));const u=document.activeElement;if(u){if(s.code==="ArrowDown"){const i=z.default(u,"next",{skipDisabled:!0});i&&i.dataset.index?(p(Number(i.dataset.index)),i.focus()):(p(0),(c=(r=E.current)==null?void 0:r.querySelector('[role="menuitem"]'))==null||c.focus())}if(s.code==="ArrowUp"){const i=z.default(u,"prev",{skipDisabled:!0});i&&i.dataset.index?(p(Number(i.dataset.index)),i.focus()):(p(o.Children.count(l)-1),(a=(n=E.current)==null?void 0:n.querySelector('[role="menuitem"]:last-child'))==null||a.focus())}}};return o.useEffect(()=>{w&&(x.current&&clearTimeout(x.current),document.body.style.overflow="hidden",L(!1),b.current=setTimeout(()=>{W(!0)},100))},[w]),o.useEffect(()=>{w||(b.current&&clearTimeout(b.current),W(!1),document.body.removeAttribute("style"),x.current=setTimeout(()=>{L(!0),p(0)},T))},[w,T]),o.useEffect(()=>{const t=()=>{var P;const{offsetWidth:s=0,offsetHeight:u=0}=(d==null?void 0:d.current)||{},r=((P=d==null?void 0:d.current)==null?void 0:P.getBoundingClientRect())||{top:0,left:0,bottom:0},{offsetWidth:c=0,offsetHeight:n=0}=E.current||{},[a,i]=D.split("-");V(M||s);const S=(r.top||0)-n-v-k<k,et=(r.bottom||0)+n+v+k>window.innerHeight;switch(a){case"top":O(S?k:r.top-n-v);break;default:O(et?"auto":r.top+u+v);break}switch(i){case"left":j(r.left);break;case"right":j(r.left-Math.abs(s-c));break;default:j(r.left+s/2-c/2);break}};return t(),window.addEventListener("scroll",t),window.addEventListener("resize",t),()=>{window.removeEventListener("scroll",t),window.removeEventListener("resize",t)}},[d,v,D,q,l,M]),o.useEffect(()=>{Q(q&&!!m&&!!_&&!!g)},[q,m,_,g]),o.useEffect(()=>()=>{b.current&&clearTimeout(b.current),x.current&&clearTimeout(x.current)},[]),X?null:ot.createPortal(y.jsx(rt,{onClick:f,disableClickOutside:R,children:y.jsx(ut,{ref:U,open:J,transitionDuration:T,...K,css:C,style:{...B,top:m,left:_,bottom:m==="auto"?24:void 0,width:I?g:void 0},children:y.jsx(nt,{role:"menu",ref:E,disablePadding:N,maxHeight:A,...G,children:o.Children.map(l,(t,s)=>{var r,c,n,a,i,S;if(!o.isValidElement(t))return null;const u=Y===s;return y.jsxs(y.Fragment,{children:[o.cloneElement(t,{...t.props,"data-index":s,selected:!!((r=t==null?void 0:t.props)!=null&&r.value)&&((c=t==null?void 0:t.props)==null?void 0:c.value)===H,onClick:Z((n=t==null?void 0:t.props)==null?void 0:n.value,(a=t==null?void 0:t.props)==null?void 0:a.onClick),onKeyDown:tt((i=t==null?void 0:t.props)==null?void 0:i.value),tabIndex:u?0:-1,style:{...(S=t==null?void 0:t.props)==null?void 0:S.style,[M?"width":"minWidth"]:I?void 0:g,maxWidth:I?void 0:"100%"}}),F&&o.Children.count(l)!==s+1&&y.jsx(ct,{})]})})})})}),document.body)});exports.default=dt;
|
package/Menu/Menu.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLAttributes,
|
|
1
|
+
import { HTMLAttributes, ReactElement, ReactNode, RefObject, SyntheticEvent } from 'react';
|
|
2
2
|
import { GeneralComponentProps } from '../typings/component';
|
|
3
3
|
import { default as MenuBlock } from './MenuBlock';
|
|
4
4
|
|
|
@@ -8,7 +8,7 @@ export interface MenuProps extends GeneralComponentProps<Omit<HTMLAttributes<HTM
|
|
|
8
8
|
onClose?: () => void;
|
|
9
9
|
spacing?: number;
|
|
10
10
|
transitionDuration?: number;
|
|
11
|
-
onChange?: (newValue?: string | number, e?:
|
|
11
|
+
onChange?: (newValue?: string | number, e?: SyntheticEvent) => void;
|
|
12
12
|
value?: string | number;
|
|
13
13
|
showDivider?: boolean;
|
|
14
14
|
placement?: 'bottom-left' | 'bottom-right' | 'bottom-center' | 'top-left' | 'top-right' | 'top-center';
|
|
@@ -18,6 +18,7 @@ export interface MenuProps extends GeneralComponentProps<Omit<HTMLAttributes<HTM
|
|
|
18
18
|
width?: number;
|
|
19
19
|
fitToAnchorWidth?: boolean;
|
|
20
20
|
maxHeight?: number;
|
|
21
|
+
menuProps?: HTMLAttributes<HTMLUListElement>;
|
|
21
22
|
}
|
|
22
23
|
declare const Menu: import('react').ForwardRefExoticComponent<MenuProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
23
24
|
export default Menu;
|