@ultraviolet/ui 1.28.0 → 1.29.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/README.md +14 -7
- package/dist/index.d.ts +51 -2
- package/dist/src/components/ActionBar/index.js +22 -37
- package/dist/src/components/Alert/index.js +27 -41
- package/dist/src/components/Avatar/index.js +48 -69
- package/dist/src/components/Badge/index.js +29 -49
- package/dist/src/components/Banner/index.js +42 -62
- package/dist/src/components/BarChart/Tooltip.js +35 -50
- package/dist/src/components/BarChart/index.js +13 -14
- package/dist/src/components/BarStack/index.js +100 -191
- package/dist/src/components/Breadcrumbs/index.js +29 -39
- package/dist/src/components/Bullet/index.js +42 -55
- package/dist/src/components/Button/index.js +73 -99
- package/dist/src/components/Card/index.js +39 -57
- package/dist/src/components/Carousel/index.js +32 -60
- package/dist/src/components/Checkbox/index.js +153 -341
- package/dist/src/components/CheckboxGroup/index.js +25 -27
- package/dist/src/components/CopyButton/index.js +11 -12
- package/dist/src/components/DateInput/index.js +141 -268
- package/dist/src/components/EmptyState/index.js +68 -83
- package/dist/src/components/Expandable/index.js +13 -20
- package/dist/src/components/GlobalAlert/GlobalAlertLink.js +12 -13
- package/dist/src/components/GlobalAlert/index.js +19 -32
- package/dist/src/components/LineChart/CustomLegend.js +80 -89
- package/dist/src/components/LineChart/Tooltip.js +32 -47
- package/dist/src/components/LineChart/helpers.js +15 -50
- package/dist/src/components/LineChart/index.js +23 -33
- package/dist/src/components/Link/index.js +46 -65
- package/dist/src/components/List/Body.js +9 -15
- package/dist/src/components/List/Cell.js +6 -7
- package/dist/src/components/List/HeaderCell.js +28 -56
- package/dist/src/components/List/HeaderRow.js +9 -16
- package/dist/src/components/List/ListContext.js +5 -6
- package/dist/src/components/List/Row.js +44 -90
- package/dist/src/components/List/SelectBar.js +9 -13
- package/dist/src/components/List/SkeletonRows.js +5 -6
- package/dist/src/components/List/index.js +15 -25
- package/dist/src/components/Loader/index.js +18 -25
- package/dist/src/components/Menu/Item.js +39 -49
- package/dist/src/components/Menu/index.js +31 -56
- package/dist/src/components/MenuV2/Item.js +39 -49
- package/dist/src/components/MenuV2/index.js +28 -47
- package/dist/src/components/Meter/index.js +25 -47
- package/dist/src/components/Modal/Dialog.js +33 -58
- package/dist/src/components/Modal/Disclosure.js +8 -9
- package/dist/src/components/Modal/index.js +26 -33
- package/dist/src/components/Notice/index.js +21 -27
- package/dist/src/components/NumberInput/index.js +73 -137
- package/dist/src/components/Pagination/getPageNumbers.js +1 -4
- package/dist/src/components/Pagination/index.js +17 -27
- package/dist/src/components/PasswordCheck/index.js +26 -32
- package/dist/src/components/PasswordStrengthMeter/index.js +25 -44
- package/dist/src/components/PieChart/Legends.js +71 -107
- package/dist/src/components/PieChart/Tooltip.js +33 -36
- package/dist/src/components/PieChart/index.js +13 -17
- package/dist/src/components/Popover/index.js +58 -75
- package/dist/src/components/Popup/helpers.js +13 -15
- package/dist/src/components/Popup/index.js +55 -98
- package/dist/src/components/ProgressBar/index.js +31 -49
- package/dist/src/components/Radio/index.js +58 -113
- package/dist/src/components/RadioGroup/index.js +26 -28
- package/dist/src/components/Row/index.js +25 -31
- package/dist/src/components/SelectInput/index.js +357 -410
- package/dist/src/components/SelectableCard/index.js +73 -115
- package/dist/src/components/Separator/index.js +52 -73
- package/dist/src/components/Skeleton/Block.js +23 -41
- package/dist/src/components/Skeleton/Blocks.js +23 -41
- package/dist/src/components/Skeleton/BoxWithIcon.js +21 -36
- package/dist/src/components/Skeleton/Donut.js +3 -6
- package/dist/src/components/Skeleton/IconSkeleton.js +13 -31
- package/dist/src/components/Skeleton/Line.js +5 -11
- package/dist/src/components/Skeleton/List.js +22 -31
- package/dist/src/components/Skeleton/Slider.js +25 -46
- package/dist/src/components/Skeleton/Square.js +3 -6
- package/dist/src/components/Skeleton/index.js +17 -33
- package/dist/src/components/Snippet/index.js +82 -137
- package/dist/src/components/Stack/index.js +11 -14
- package/dist/src/components/Status/index.js +48 -78
- package/dist/src/components/StepList/index.js +45 -63
- package/dist/src/components/Stepper/index.js +74 -129
- package/dist/src/components/SwitchButton/FocusOverlay.js +13 -23
- package/dist/src/components/SwitchButton/index.js +36 -62
- package/dist/src/components/Table/Body.js +5 -8
- package/dist/src/components/Table/Cell.js +14 -20
- package/dist/src/components/Table/Header.js +8 -14
- package/dist/src/components/Table/HeaderCell.js +40 -56
- package/dist/src/components/Table/HeaderRow.js +4 -5
- package/dist/src/components/Table/Row.js +10 -14
- package/dist/src/components/Table/SelectBar.js +9 -13
- package/dist/src/components/Table/SkeletonRows.js +5 -6
- package/dist/src/components/Table/TableContext.js +6 -7
- package/dist/src/components/Table/index.js +44 -50
- package/dist/src/components/Tabs/Tab.js +57 -118
- package/dist/src/components/Tabs/TabMenu.js +32 -38
- package/dist/src/components/Tabs/TabMenuItem.js +9 -13
- package/dist/src/components/Tabs/index.js +24 -43
- package/dist/src/components/Tag/index.js +57 -74
- package/dist/src/components/TagInput/index.js +63 -94
- package/dist/src/components/TagList/index.js +22 -35
- package/dist/src/components/Text/index.js +29 -31
- package/dist/src/components/TextArea/index.js +240 -0
- package/dist/src/components/TextInput/index.js +166 -260
- package/dist/src/components/TimeInput/index.js +10 -13
- package/dist/src/components/Toaster/index.js +51 -67
- package/dist/src/components/Toggle/index.js +62 -129
- package/dist/src/components/ToggleGroup/index.js +21 -23
- package/dist/src/components/Tooltip/index.js +28 -31
- package/dist/src/components/VerificationCode/index.js +55 -90
- package/dist/src/index.js +1 -0
- package/dist/src/utils/ids.js +1 -6
- package/package.json +3 -3
|
@@ -22,97 +22,43 @@ const SIZES = {
|
|
|
22
22
|
};
|
|
23
23
|
const StyledToggle = /*#__PURE__*/_styled("div", {
|
|
24
24
|
target: "e1wstm612"
|
|
25
|
-
})("box-sizing:content-box;outline:none;overflow:hidden;display:flex;align-items:center;border:none;border-radius:",
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}, ";
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}, "
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}, "
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
size
|
|
63
|
-
} = _ref8;
|
|
64
|
-
return SIZES[size].ball;
|
|
65
|
-
}, "px;border-radius:", _ref9 => {
|
|
66
|
-
let {
|
|
67
|
-
theme
|
|
68
|
-
} = _ref9;
|
|
69
|
-
return theme.radii.circle;
|
|
70
|
-
}, ";background-color:", _ref10 => {
|
|
71
|
-
let {
|
|
72
|
-
theme
|
|
73
|
-
} = _ref10;
|
|
74
|
-
return theme.colors.neutral.background;
|
|
75
|
-
}, ";transition:all 300ms;}&:focus-within,&:focus{box-shadow:", _ref11 => {
|
|
76
|
-
let {
|
|
77
|
-
theme
|
|
78
|
-
} = _ref11;
|
|
79
|
-
return theme.shadows.focusNeutral;
|
|
80
|
-
}, ";}&[data-disabled='false']:active:after{width:", _ref12 => {
|
|
81
|
-
let {
|
|
82
|
-
size
|
|
83
|
-
} = _ref12;
|
|
84
|
-
return SIZES[size].ball * 1.3775;
|
|
85
|
-
}, "px;}&[data-checked='true']{color:", _ref13 => {
|
|
86
|
-
let {
|
|
87
|
-
theme
|
|
88
|
-
} = _ref13;
|
|
89
|
-
return theme.colors.neutral.textStrong;
|
|
90
|
-
}, ";background-color:", _ref14 => {
|
|
91
|
-
let {
|
|
92
|
-
theme
|
|
93
|
-
} = _ref14;
|
|
94
|
-
return theme.colors.primary.backgroundStrong;
|
|
95
|
-
}, ";&:hover{background-color:", _ref15 => {
|
|
96
|
-
let {
|
|
97
|
-
theme
|
|
98
|
-
} = _ref15;
|
|
99
|
-
return theme.colors.primary.backgroundStrongHover;
|
|
100
|
-
}, ";}&:after{left:calc(100% - 5px);transform:translateX(-100%);}&:focus-within,&:focus{box-shadow:", _ref16 => {
|
|
101
|
-
let {
|
|
102
|
-
theme
|
|
103
|
-
} = _ref16;
|
|
104
|
-
return theme.shadows.focusPrimary;
|
|
105
|
-
}, ";}}&[data-disabled='true']{background:", _ref17 => {
|
|
106
|
-
let {
|
|
107
|
-
theme
|
|
108
|
-
} = _ref17;
|
|
109
|
-
return theme.colors.neutral.backgroundStrongDisabled;
|
|
110
|
-
}, ";&[data-checked='true']{background:", _ref18 => {
|
|
111
|
-
let {
|
|
112
|
-
theme
|
|
113
|
-
} = _ref18;
|
|
114
|
-
return theme.colors.primary.backgroundStrongDisabled;
|
|
115
|
-
}, ";}}");
|
|
25
|
+
})("box-sizing:content-box;outline:none;overflow:hidden;display:flex;align-items:center;border:none;border-radius:", ({
|
|
26
|
+
theme
|
|
27
|
+
}) => theme.radii.xlarge, ";position:relative;transition:all 300ms;background-color:", ({
|
|
28
|
+
theme
|
|
29
|
+
}) => theme.colors.neutral.backgroundStrong, ";width:", ({
|
|
30
|
+
size
|
|
31
|
+
}) => SIZES[size].width, "px;height:", ({
|
|
32
|
+
size
|
|
33
|
+
}) => SIZES[size].height, "px;&:hover{background-color:", ({
|
|
34
|
+
theme
|
|
35
|
+
}) => theme.colors.neutral.backgroundStrongHover, ";}&:after{content:'';position:absolute;top:", ({
|
|
36
|
+
size
|
|
37
|
+
}) => SIZES[size].height / 2 - SIZES[size].ball / 2, "px;left:5px;width:", ({
|
|
38
|
+
size
|
|
39
|
+
}) => SIZES[size].ball, "px;height:", ({
|
|
40
|
+
size
|
|
41
|
+
}) => SIZES[size].ball, "px;border-radius:", ({
|
|
42
|
+
theme
|
|
43
|
+
}) => theme.radii.circle, ";background-color:", ({
|
|
44
|
+
theme
|
|
45
|
+
}) => theme.colors.neutral.background, ";transition:all 300ms;}&:focus-within,&:focus{box-shadow:", ({
|
|
46
|
+
theme
|
|
47
|
+
}) => theme.shadows.focusNeutral, ";}&[data-disabled='false']:active:after{width:", ({
|
|
48
|
+
size
|
|
49
|
+
}) => SIZES[size].ball * 1.3775, "px;}&[data-checked='true']{color:", ({
|
|
50
|
+
theme
|
|
51
|
+
}) => theme.colors.neutral.textStrong, ";background-color:", ({
|
|
52
|
+
theme
|
|
53
|
+
}) => theme.colors.primary.backgroundStrong, ";&:hover{background-color:", ({
|
|
54
|
+
theme
|
|
55
|
+
}) => theme.colors.primary.backgroundStrongHover, ";}&:after{left:calc(100% - 5px);transform:translateX(-100%);}&:focus-within,&:focus{box-shadow:", ({
|
|
56
|
+
theme
|
|
57
|
+
}) => theme.shadows.focusPrimary, ";}}&[data-disabled='true']{background:", ({
|
|
58
|
+
theme
|
|
59
|
+
}) => theme.colors.neutral.backgroundStrongDisabled, ";&[data-checked='true']{background:", ({
|
|
60
|
+
theme
|
|
61
|
+
}) => theme.colors.primary.backgroundStrongDisabled, ";}}");
|
|
116
62
|
const StyledCheckbox = /*#__PURE__*/_styled("input", {
|
|
117
63
|
target: "e1wstm611"
|
|
118
64
|
})(process.env.NODE_ENV === "production" ? {
|
|
@@ -125,27 +71,15 @@ const StyledCheckbox = /*#__PURE__*/_styled("input", {
|
|
|
125
71
|
});
|
|
126
72
|
const StyledLabel = /*#__PURE__*/_styled("label", {
|
|
127
73
|
target: "e1wstm610"
|
|
128
|
-
})("display:flex;gap:",
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
return labelPosition === 'left' ? 'row' : 'row-reverse';
|
|
138
|
-
}, ";&:active ", StyledToggle, "[data-disabled='false']:after{width:", _ref21 => {
|
|
139
|
-
let {
|
|
140
|
-
size
|
|
141
|
-
} = _ref21;
|
|
142
|
-
return SIZES[size].ball * 1.3775;
|
|
143
|
-
}, "px;}&[aria-disabled='true']{cursor:not-allowed;color:", _ref22 => {
|
|
144
|
-
let {
|
|
145
|
-
theme
|
|
146
|
-
} = _ref22;
|
|
147
|
-
return theme.colors.neutral.textDisabled;
|
|
148
|
-
}, ";}");
|
|
74
|
+
})("display:flex;gap:", ({
|
|
75
|
+
theme
|
|
76
|
+
}) => theme.space['1'], ";align-items:start;width:fit-content;cursor:pointer;flex-direction:", ({
|
|
77
|
+
labelPosition
|
|
78
|
+
}) => labelPosition === 'left' ? 'row' : 'row-reverse', ";&:active ", StyledToggle, "[data-disabled='false']:after{width:", ({
|
|
79
|
+
size
|
|
80
|
+
}) => SIZES[size].ball * 1.3775, "px;}&[aria-disabled='true']{cursor:not-allowed;color:", ({
|
|
81
|
+
theme
|
|
82
|
+
}) => theme.colors.neutral.textDisabled, ";}");
|
|
149
83
|
const RequiredIcon = () => jsx("sup", {
|
|
150
84
|
children: jsx(Icon, {
|
|
151
85
|
name: "asterisk",
|
|
@@ -156,23 +90,22 @@ const RequiredIcon = () => jsx("sup", {
|
|
|
156
90
|
/**
|
|
157
91
|
* Toggle component is used to toggle between two states (on/off, true/false, etc.).
|
|
158
92
|
*/
|
|
159
|
-
const Toggle = /*#__PURE__*/forwardRef((
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
} = _ref23;
|
|
93
|
+
const Toggle = /*#__PURE__*/forwardRef(({
|
|
94
|
+
checked = false,
|
|
95
|
+
disabled = false,
|
|
96
|
+
id,
|
|
97
|
+
name,
|
|
98
|
+
onChange,
|
|
99
|
+
size = 'large',
|
|
100
|
+
tooltip,
|
|
101
|
+
labelPosition = 'right',
|
|
102
|
+
label,
|
|
103
|
+
helper,
|
|
104
|
+
required,
|
|
105
|
+
className,
|
|
106
|
+
'data-testid': dataTestId,
|
|
107
|
+
value
|
|
108
|
+
}, ref) => {
|
|
176
109
|
const [state, setState] = useState(checked);
|
|
177
110
|
const uniqueId = useId();
|
|
178
111
|
const onLocalChange = useCallback(event => {
|
|
@@ -11,16 +11,15 @@ const ToggleGroupContext = /*#__PURE__*/createContext(undefined);
|
|
|
11
11
|
/**
|
|
12
12
|
* ToggleGroup is a component that allows you to group a set of Toggle components together under the same legend.
|
|
13
13
|
*/
|
|
14
|
-
const ToggleGroupToggle =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref;
|
|
14
|
+
const ToggleGroupToggle = ({
|
|
15
|
+
disabled,
|
|
16
|
+
name,
|
|
17
|
+
value,
|
|
18
|
+
label,
|
|
19
|
+
helper,
|
|
20
|
+
className,
|
|
21
|
+
'data-testid': dataTestId
|
|
22
|
+
}) => {
|
|
24
23
|
const context = useContext(ToggleGroupContext);
|
|
25
24
|
if (!context) {
|
|
26
25
|
throw new Error('ToggleGroup.Toggle can only be used inside a ToggleGroup');
|
|
@@ -64,19 +63,18 @@ const StyledRequiredIcon = /*#__PURE__*/_styled(Icon, {
|
|
|
64
63
|
styles: "vertical-align:super",
|
|
65
64
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
66
65
|
});
|
|
67
|
-
const ToggleGroup =
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
} = _ref2;
|
|
66
|
+
const ToggleGroup = ({
|
|
67
|
+
legend,
|
|
68
|
+
value,
|
|
69
|
+
className,
|
|
70
|
+
helper,
|
|
71
|
+
error,
|
|
72
|
+
direction = 'column',
|
|
73
|
+
children,
|
|
74
|
+
onChange,
|
|
75
|
+
name,
|
|
76
|
+
required = false
|
|
77
|
+
}) => {
|
|
80
78
|
const contextValue = useMemo(() => ({
|
|
81
79
|
groupName: name,
|
|
82
80
|
groupValues: value ?? [],
|
|
@@ -19,36 +19,33 @@ const StyledPopup = /*#__PURE__*/_styled(Popup, {
|
|
|
19
19
|
* Tooltip component is used to display additional information on hover or focus.
|
|
20
20
|
* It is used to explain the purpose of the element it is attached to.
|
|
21
21
|
*/
|
|
22
|
-
const Tooltip = /*#__PURE__*/forwardRef((
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
children: children
|
|
51
|
-
});
|
|
52
|
-
});
|
|
22
|
+
const Tooltip = /*#__PURE__*/forwardRef(({
|
|
23
|
+
children,
|
|
24
|
+
text = '',
|
|
25
|
+
placement = 'auto',
|
|
26
|
+
id,
|
|
27
|
+
className,
|
|
28
|
+
containerFullWidth,
|
|
29
|
+
maxWidth = 232,
|
|
30
|
+
visible,
|
|
31
|
+
innerRef,
|
|
32
|
+
role = 'tooltip',
|
|
33
|
+
'data-testid': dataTestId,
|
|
34
|
+
portalTarget
|
|
35
|
+
}, tooltipRef) => jsx(StyledPopup, {
|
|
36
|
+
id: id,
|
|
37
|
+
ref: tooltipRef,
|
|
38
|
+
role: role,
|
|
39
|
+
"data-testid": dataTestId,
|
|
40
|
+
className: className,
|
|
41
|
+
containerFullWidth: containerFullWidth,
|
|
42
|
+
maxWidth: maxWidth,
|
|
43
|
+
visible: visible,
|
|
44
|
+
placement: placement,
|
|
45
|
+
text: text,
|
|
46
|
+
innerRef: innerRef,
|
|
47
|
+
portalTarget: portalTarget,
|
|
48
|
+
children: children
|
|
49
|
+
}));
|
|
53
50
|
|
|
54
51
|
export { Tooltip };
|
|
@@ -17,28 +17,18 @@ const SIZE_WIDTH = {
|
|
|
17
17
|
const StyledInput = /*#__PURE__*/_styled('input', {
|
|
18
18
|
shouldForwardProp: prop => !['inputSize'].includes(prop),
|
|
19
19
|
target: "e1a2bx9q0"
|
|
20
|
-
})("background:",
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
let {
|
|
33
|
-
'aria-invalid': error,
|
|
34
|
-
theme
|
|
35
|
-
} = _ref3;
|
|
36
|
-
return error ? theme.colors.danger.text : theme.colors.neutral.text;
|
|
37
|
-
}, ";", _ref4 => {
|
|
38
|
-
let {
|
|
39
|
-
inputSize,
|
|
40
|
-
theme
|
|
41
|
-
} = _ref4;
|
|
20
|
+
})("background:", ({
|
|
21
|
+
theme
|
|
22
|
+
}) => theme.colors.neutral.background, ";border:solid 1px ", ({
|
|
23
|
+
'aria-invalid': error,
|
|
24
|
+
theme
|
|
25
|
+
}) => error ? theme.colors.danger.border : theme.colors.neutral.border, ";color:", ({
|
|
26
|
+
'aria-invalid': error,
|
|
27
|
+
theme
|
|
28
|
+
}) => error ? theme.colors.danger.text : theme.colors.neutral.text, ";", ({
|
|
29
|
+
inputSize,
|
|
30
|
+
theme
|
|
31
|
+
}) => {
|
|
42
32
|
if (inputSize === 'small') {
|
|
43
33
|
return `
|
|
44
34
|
font-size: ${theme.typography.caption.fontSize};
|
|
@@ -49,54 +39,31 @@ const StyledInput = /*#__PURE__*/_styled('input', {
|
|
|
49
39
|
font-size: ${theme.typography.body.fontSize};
|
|
50
40
|
font-weight: ${theme.typography.body.weight};
|
|
51
41
|
`;
|
|
52
|
-
}, " text-align:center;border-radius:",
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return error ? theme.colors.danger.borderHover : theme.colors.primary.borderHover;
|
|
78
|
-
}, ";}&:focus{box-shadow:", _ref10 => {
|
|
79
|
-
let {
|
|
80
|
-
'aria-invalid': error,
|
|
81
|
-
theme: {
|
|
82
|
-
shadows
|
|
83
|
-
}
|
|
84
|
-
} = _ref10;
|
|
85
|
-
return error ? shadows.focusDanger : shadows.focusPrimary;
|
|
86
|
-
}, ";}&:last-child{margin-right:0;}&::placeholder{color:", _ref11 => {
|
|
87
|
-
let {
|
|
88
|
-
disabled,
|
|
89
|
-
theme
|
|
90
|
-
} = _ref11;
|
|
91
|
-
return disabled ? theme.colors.neutral.textWeakDisabled : theme.colors.neutral.textWeak;
|
|
92
|
-
}, ";}", _ref12 => {
|
|
93
|
-
let {
|
|
94
|
-
disabled,
|
|
95
|
-
theme: {
|
|
96
|
-
colors
|
|
97
|
-
}
|
|
98
|
-
} = _ref12;
|
|
99
|
-
return disabled && `cursor: default;
|
|
42
|
+
}, " text-align:center;border-radius:", ({
|
|
43
|
+
theme
|
|
44
|
+
}) => theme.radii.default, ";margin-right:", ({
|
|
45
|
+
theme
|
|
46
|
+
}) => theme.space['1'], ";width:", ({
|
|
47
|
+
inputSize
|
|
48
|
+
}) => SIZE_WIDTH[inputSize], "px;height:", ({
|
|
49
|
+
inputSize
|
|
50
|
+
}) => SIZE_HEIGHT[inputSize], "px;outline-style:none;transition:border-color 0.2s ease,box-shadow 0.2s ease;&:hover,&:focus{border-color:", ({
|
|
51
|
+
'aria-invalid': error,
|
|
52
|
+
theme
|
|
53
|
+
}) => error ? theme.colors.danger.borderHover : theme.colors.primary.borderHover, ";}&:focus{box-shadow:", ({
|
|
54
|
+
'aria-invalid': error,
|
|
55
|
+
theme: {
|
|
56
|
+
shadows
|
|
57
|
+
}
|
|
58
|
+
}) => error ? shadows.focusDanger : shadows.focusPrimary, ";}&:last-child{margin-right:0;}&::placeholder{color:", ({
|
|
59
|
+
disabled,
|
|
60
|
+
theme
|
|
61
|
+
}) => disabled ? theme.colors.neutral.textWeakDisabled : theme.colors.neutral.textWeak, ";}", ({
|
|
62
|
+
disabled,
|
|
63
|
+
theme: {
|
|
64
|
+
colors
|
|
65
|
+
}
|
|
66
|
+
}) => disabled && `cursor: default;
|
|
100
67
|
background-color: ${colors.neutral.backgroundDisabled};
|
|
101
68
|
border-color: ${colors.neutral.borderDisabled};
|
|
102
69
|
color: ${colors.neutral.textDisabled};
|
|
@@ -104,31 +71,29 @@ const StyledInput = /*#__PURE__*/_styled('input', {
|
|
|
104
71
|
&:hover {
|
|
105
72
|
border: ${colors.neutral.borderDisabled}
|
|
106
73
|
}
|
|
107
|
-
|
|
108
|
-
}, ";");
|
|
74
|
+
`, ";");
|
|
109
75
|
const DEFAULT_ON_FUNCTION = () => {};
|
|
110
76
|
|
|
111
77
|
/**
|
|
112
78
|
* Verification code allows you to enter a code in multiple fields (4 by default).
|
|
113
79
|
*/
|
|
114
|
-
const VerificationCode =
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
} = _ref13;
|
|
80
|
+
const VerificationCode = ({
|
|
81
|
+
disabled = false,
|
|
82
|
+
className,
|
|
83
|
+
error = false,
|
|
84
|
+
fields = 4,
|
|
85
|
+
initialValue = '',
|
|
86
|
+
inputId,
|
|
87
|
+
inputStyle = '',
|
|
88
|
+
size = 'large',
|
|
89
|
+
onChange = DEFAULT_ON_FUNCTION,
|
|
90
|
+
onComplete = DEFAULT_ON_FUNCTION,
|
|
91
|
+
placeholder = '',
|
|
92
|
+
required = false,
|
|
93
|
+
type = 'number',
|
|
94
|
+
'data-testid': dataTestId,
|
|
95
|
+
'aria-label': ariaLabel = 'Verification code'
|
|
96
|
+
}) => {
|
|
132
97
|
const uniqueId = useId();
|
|
133
98
|
const valuesArray = Object.assign(new Array(fields).fill(''), initialValue.substring(0, fields).split(''));
|
|
134
99
|
const [values, setValues] = useState(valuesArray);
|
package/dist/src/index.js
CHANGED
|
@@ -57,6 +57,7 @@ export { Tag } from './components/Tag/index.js';
|
|
|
57
57
|
export { TagInput } from './components/TagInput/index.js';
|
|
58
58
|
export { TagList } from './components/TagList/index.js';
|
|
59
59
|
export { Text } from './components/Text/index.js';
|
|
60
|
+
export { TextArea } from './components/TextArea/index.js';
|
|
60
61
|
export { TextInput } from './components/TextInput/index.js';
|
|
61
62
|
export { TimeInput } from './components/TimeInput/index.js';
|
|
62
63
|
export { ToastContainer, toast } from './components/Toaster/index.js';
|
package/dist/src/utils/ids.js
CHANGED
|
@@ -2,11 +2,6 @@ const chr4 = () => Math.random().toString(16).slice(-4);
|
|
|
2
2
|
const uuid = () => Array.from({
|
|
3
3
|
length: 8
|
|
4
4
|
}, chr4).join('');
|
|
5
|
-
const getUUID =
|
|
6
|
-
if (prefix === void 0) {
|
|
7
|
-
prefix = '';
|
|
8
|
-
}
|
|
9
|
-
return `${prefix ? `${prefix}-` : ''}${uuid()}`;
|
|
10
|
-
};
|
|
5
|
+
const getUUID = (prefix = '') => `${prefix ? `${prefix}-` : ''}${uuid()}`;
|
|
11
6
|
|
|
12
7
|
export { getUUID };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultraviolet/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.0",
|
|
4
4
|
"description": "Ultraviolet UI",
|
|
5
5
|
"homepage": "https://github.com/scaleway/ultraviolet#readme",
|
|
6
6
|
"repository": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"react-dom": "18.2.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@babel/core": "7.23.
|
|
42
|
+
"@babel/core": "7.23.6",
|
|
43
43
|
"@emotion/babel-plugin": "11.11.0",
|
|
44
44
|
"@emotion/react": "11.11.1",
|
|
45
45
|
"@emotion/styled": "11.11.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"react-use-clipboard": "1.0.9",
|
|
68
68
|
"reakit": "1.3.11",
|
|
69
69
|
"@ultraviolet/themes": "1.5.0",
|
|
70
|
-
"@ultraviolet/icons": "2.7.
|
|
70
|
+
"@ultraviolet/icons": "2.7.1"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"build": "rollup -c ../../rollup.config.mjs"
|