@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
|
@@ -21,153 +21,92 @@ const iconSizes = {
|
|
|
21
21
|
const BASE_INPUT_WIDTH = 34;
|
|
22
22
|
const StyledSelectButton = /*#__PURE__*/_styled(Button, {
|
|
23
23
|
target: "exvap484"
|
|
24
|
-
})("margin:0 ",
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} = _ref;
|
|
28
|
-
return theme.space['1'];
|
|
29
|
-
}, ";width:32px;height:32px;");
|
|
24
|
+
})("margin:0 ", ({
|
|
25
|
+
theme
|
|
26
|
+
}) => theme.space['1'], ";width:32px;height:32px;");
|
|
30
27
|
const StyledCenterBox = /*#__PURE__*/_styled('div', {
|
|
31
28
|
shouldForwardProp: prop => !['size'].includes(prop),
|
|
32
29
|
target: "exvap483"
|
|
33
|
-
})("display:flex;flex:1;flex-direction:row;height:",
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}, ";align-items:center;outline:none;justify-content:center;border-radius:", _ref3 => {
|
|
39
|
-
let {
|
|
40
|
-
theme
|
|
41
|
-
} = _ref3;
|
|
42
|
-
return theme.radii.default;
|
|
43
|
-
}, ";border:1px solid transparent;max-width:100%;");
|
|
30
|
+
})("display:flex;flex:1;flex-direction:row;height:", ({
|
|
31
|
+
size
|
|
32
|
+
}) => size === 'small' ? '24px' : '32px', ";align-items:center;outline:none;justify-content:center;border-radius:", ({
|
|
33
|
+
theme
|
|
34
|
+
}) => theme.radii.default, ";border:1px solid transparent;max-width:100%;");
|
|
44
35
|
const StyledInput = /*#__PURE__*/_styled("input", {
|
|
45
36
|
target: "exvap482"
|
|
46
|
-
})("color:",
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}, ";
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
} = _ref6;
|
|
60
|
-
return theme.space['0.5'];
|
|
61
|
-
}, ";max-width:100%;font-weight:", _ref7 => {
|
|
62
|
-
let {
|
|
63
|
-
theme
|
|
64
|
-
} = _ref7;
|
|
65
|
-
return theme.typography.bodyStrong.weight;
|
|
66
|
-
}, ";text-align:center;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}::placeholder{color:", _ref8 => {
|
|
67
|
-
let {
|
|
68
|
-
theme
|
|
69
|
-
} = _ref8;
|
|
70
|
-
return theme.colors.neutral.textWeak;
|
|
71
|
-
}, ";}-moz-appearance:textfield;&[disabled]{color:", _ref9 => {
|
|
72
|
-
let {
|
|
73
|
-
theme
|
|
74
|
-
} = _ref9;
|
|
75
|
-
return theme.colors.neutral.textDisabled;
|
|
76
|
-
}, ";cursor:not-allowed;}");
|
|
37
|
+
})("color:", ({
|
|
38
|
+
theme
|
|
39
|
+
}) => theme.colors.neutral.text, ";background-color:transparent;font-size:", ({
|
|
40
|
+
theme
|
|
41
|
+
}) => theme.typography.bodyStrong.fontSize, ";border:none;outline:none;position:relative;margin-right:", ({
|
|
42
|
+
theme
|
|
43
|
+
}) => theme.space['0.5'], ";max-width:100%;font-weight:", ({
|
|
44
|
+
theme
|
|
45
|
+
}) => theme.typography.bodyStrong.weight, ";text-align:center;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}::placeholder{color:", ({
|
|
46
|
+
theme
|
|
47
|
+
}) => theme.colors.neutral.textWeak, ";}-moz-appearance:textfield;&[disabled]{color:", ({
|
|
48
|
+
theme
|
|
49
|
+
}) => theme.colors.neutral.textDisabled, ";cursor:not-allowed;}");
|
|
77
50
|
const StyledText = /*#__PURE__*/_styled('span', {
|
|
78
51
|
shouldForwardProp: prop => !['disabled'].includes(prop),
|
|
79
52
|
target: "exvap481"
|
|
80
|
-
})("color:",
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}, ";user-select:none;margin-right:", _ref11 => {
|
|
87
|
-
let {
|
|
88
|
-
theme
|
|
89
|
-
} = _ref11;
|
|
90
|
-
return theme.space['1'];
|
|
91
|
-
}, ";");
|
|
53
|
+
})("color:", ({
|
|
54
|
+
theme,
|
|
55
|
+
disabled
|
|
56
|
+
}) => disabled ? theme.colors.neutral.textDisabled : theme.colors.neutral.text, ";user-select:none;margin-right:", ({
|
|
57
|
+
theme
|
|
58
|
+
}) => theme.space['1'], ";");
|
|
92
59
|
const StyledContainer = /*#__PURE__*/_styled('div', {
|
|
93
60
|
shouldForwardProp: prop => !['size'].includes(prop),
|
|
94
61
|
target: "exvap480"
|
|
95
|
-
})("background-color:",
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}, "
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return theme.radii.default;
|
|
115
|
-
}, ";&[data-error='true']{border:1px solid ", _ref16 => {
|
|
116
|
-
let {
|
|
117
|
-
theme
|
|
118
|
-
} = _ref16;
|
|
119
|
-
return theme.colors.danger.border;
|
|
120
|
-
}, ";}&[aria-disabled='true']{background:", _ref17 => {
|
|
121
|
-
let {
|
|
122
|
-
theme
|
|
123
|
-
} = _ref17;
|
|
124
|
-
return theme.colors.neutral.backgroundDisabled;
|
|
125
|
-
}, ";cursor:not-allowed;}&:not([aria-disabled='true']){", StyledCenterBox, ":hover,", StyledCenterBox, ":focus{border:1px solid ", _ref18 => {
|
|
126
|
-
let {
|
|
127
|
-
theme
|
|
128
|
-
} = _ref18;
|
|
129
|
-
return theme.colors.primary.borderHover;
|
|
130
|
-
}, ";}", StyledCenterBox, ":focus-within{box-shadow:", _ref19 => {
|
|
131
|
-
let {
|
|
132
|
-
theme
|
|
133
|
-
} = _ref19;
|
|
134
|
-
return theme.shadows.focusPrimary;
|
|
135
|
-
}, ";border:1px solid ", _ref20 => {
|
|
136
|
-
let {
|
|
137
|
-
theme
|
|
138
|
-
} = _ref20;
|
|
139
|
-
return theme.colors.primary.borderHover;
|
|
140
|
-
}, ";}}");
|
|
62
|
+
})("background-color:", ({
|
|
63
|
+
theme
|
|
64
|
+
}) => theme.colors.neutral.background, ";display:flex;flex-direction:row;align-items:center;align-self:stretch;font-weight:500;height:", ({
|
|
65
|
+
size
|
|
66
|
+
}) => containerSizes[size], "px;border:1px solid ", ({
|
|
67
|
+
theme
|
|
68
|
+
}) => theme.colors.neutral.border, ";border-radius:", ({
|
|
69
|
+
theme
|
|
70
|
+
}) => theme.radii.default, ";&[data-error='true']{border:1px solid ", ({
|
|
71
|
+
theme
|
|
72
|
+
}) => theme.colors.danger.border, ";}&[aria-disabled='true']{background:", ({
|
|
73
|
+
theme
|
|
74
|
+
}) => theme.colors.neutral.backgroundDisabled, ";cursor:not-allowed;}&:not([aria-disabled='true']){", StyledCenterBox, ":hover,", StyledCenterBox, ":focus{border:1px solid ", ({
|
|
75
|
+
theme
|
|
76
|
+
}) => theme.colors.primary.borderHover, ";}", StyledCenterBox, ":focus-within{box-shadow:", ({
|
|
77
|
+
theme
|
|
78
|
+
}) => theme.shadows.focusPrimary, ";border:1px solid ", ({
|
|
79
|
+
theme
|
|
80
|
+
}) => theme.colors.primary.borderHover, ";}}");
|
|
141
81
|
/**
|
|
142
82
|
* NumberInput component is used to increment / decrement a number value by clicking on + / - buttons or
|
|
143
83
|
* by typing into input.
|
|
144
84
|
*/
|
|
145
|
-
const NumberInput =
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
} = _ref21;
|
|
85
|
+
const NumberInput = ({
|
|
86
|
+
disabled = false,
|
|
87
|
+
maxValue,
|
|
88
|
+
minValue = 0,
|
|
89
|
+
name = 'numberinput',
|
|
90
|
+
onChange,
|
|
91
|
+
onFocus,
|
|
92
|
+
onBlur,
|
|
93
|
+
onMaxCrossed,
|
|
94
|
+
onMinCrossed,
|
|
95
|
+
size = 'large',
|
|
96
|
+
step = 1,
|
|
97
|
+
text,
|
|
98
|
+
defaultValue,
|
|
99
|
+
value,
|
|
100
|
+
disabledTooltip,
|
|
101
|
+
className,
|
|
102
|
+
label,
|
|
103
|
+
id,
|
|
104
|
+
placeholder,
|
|
105
|
+
error,
|
|
106
|
+
'aria-label': ariaLabel,
|
|
107
|
+
'aria-describedby': ariaDescribedBy,
|
|
108
|
+
'data-testid': dataTestId
|
|
109
|
+
}) => {
|
|
171
110
|
const inputRef = useRef();
|
|
172
111
|
const uniqueId = useId();
|
|
173
112
|
|
|
@@ -182,14 +121,11 @@ const NumberInput = _ref21 => {
|
|
|
182
121
|
return defaultValue;
|
|
183
122
|
});
|
|
184
123
|
const currentValue = value !== undefined && value !== null ? value : inputValue;
|
|
185
|
-
const setValue =
|
|
124
|
+
const setValue = (newValue,
|
|
186
125
|
/**
|
|
187
126
|
* If true, will check if newValue is between minValue and maxValue and set it to minValue or maxValue if it's not.
|
|
188
127
|
*/
|
|
189
|
-
hasMinMaxVerification) {
|
|
190
|
-
if (hasMinMaxVerification === void 0) {
|
|
191
|
-
hasMinMaxVerification = true;
|
|
192
|
-
}
|
|
128
|
+
hasMinMaxVerification = true) => {
|
|
193
129
|
let nextValue = newValue;
|
|
194
130
|
if (value === undefined && hasMinMaxVerification) {
|
|
195
131
|
if (newValue !== undefined && newValue < minValue) {
|
|
@@ -5,10 +5,7 @@
|
|
|
5
5
|
* @param range The number of pages wanted
|
|
6
6
|
* @returns List of page numbers around currentPage
|
|
7
7
|
*/
|
|
8
|
-
const getPageNumbers =
|
|
9
|
-
if (range === void 0) {
|
|
10
|
-
range = 5;
|
|
11
|
-
}
|
|
8
|
+
const getPageNumbers = (currentPage, pageCount, range = 5) => {
|
|
12
9
|
const gap = Math.floor(range / 2);
|
|
13
10
|
let end = currentPage + gap;
|
|
14
11
|
let remaining = 0;
|
|
@@ -7,25 +7,16 @@ import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
|
7
7
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
8
8
|
const PageNumbersContainer = /*#__PURE__*/_styled("div", {
|
|
9
9
|
target: "e5s692s2"
|
|
10
|
-
})("display:flex;gap:",
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}, ";margin:0 ", _ref2 => {
|
|
16
|
-
let {
|
|
17
|
-
theme
|
|
18
|
-
} = _ref2;
|
|
19
|
-
return theme.space['2'];
|
|
20
|
-
}, ";");
|
|
10
|
+
})("display:flex;gap:", ({
|
|
11
|
+
theme
|
|
12
|
+
}) => theme.space['2'], ";margin:0 ", ({
|
|
13
|
+
theme
|
|
14
|
+
}) => theme.space['2'], ";");
|
|
21
15
|
const PageSwitchContainer = /*#__PURE__*/_styled("div", {
|
|
22
16
|
target: "e5s692s1"
|
|
23
|
-
})("display:flex;gap:",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} = _ref3;
|
|
27
|
-
return theme.space['1'];
|
|
28
|
-
}, ";");
|
|
17
|
+
})("display:flex;gap:", ({
|
|
18
|
+
theme
|
|
19
|
+
}) => theme.space['1'], ";");
|
|
29
20
|
const StyledContainer = /*#__PURE__*/_styled("div", {
|
|
30
21
|
target: "e5s692s0"
|
|
31
22
|
})(process.env.NODE_ENV === "production" ? {
|
|
@@ -40,16 +31,15 @@ const StyledContainer = /*#__PURE__*/_styled("div", {
|
|
|
40
31
|
* Pagination is a component to navigate between pages, it is composed of 2 buttons to go to the previous and next page,
|
|
41
32
|
* and a list of buttons to go to a specific page.
|
|
42
33
|
*/
|
|
43
|
-
const Pagination =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
} = _ref4;
|
|
34
|
+
const Pagination = ({
|
|
35
|
+
disabled = false,
|
|
36
|
+
page,
|
|
37
|
+
pageCount,
|
|
38
|
+
onChange,
|
|
39
|
+
pageTabCount = 5,
|
|
40
|
+
className,
|
|
41
|
+
'data-testid': dataTestId
|
|
42
|
+
}) => {
|
|
53
43
|
const goToFirstPage = useCallback(() => {
|
|
54
44
|
onChange(1);
|
|
55
45
|
}, [onChange]);
|
|
@@ -6,42 +6,36 @@ import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
|
6
6
|
|
|
7
7
|
const PasswordCheckContainer = /*#__PURE__*/_styled("div", {
|
|
8
8
|
target: "eunxap90"
|
|
9
|
-
})("display:grid;grid-template-columns:repeat(2, 1fr);gap:",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} = _ref;
|
|
13
|
-
return theme.space['1'];
|
|
14
|
-
}, ";");
|
|
9
|
+
})("display:grid;grid-template-columns:repeat(2, 1fr);gap:", ({
|
|
10
|
+
theme
|
|
11
|
+
}) => theme.space['1'], ";");
|
|
15
12
|
|
|
16
13
|
/**
|
|
17
14
|
* PasswordCheck is a component that display a list of password rules with a check or a cross depending on the validity
|
|
18
15
|
* of the rule.
|
|
19
16
|
*/
|
|
20
|
-
const PasswordCheck =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}, rule.name))
|
|
44
|
-
});
|
|
45
|
-
};
|
|
17
|
+
const PasswordCheck = ({
|
|
18
|
+
rules,
|
|
19
|
+
className,
|
|
20
|
+
'data-testid': dataTestId
|
|
21
|
+
}) => jsx(PasswordCheckContainer, {
|
|
22
|
+
className: className,
|
|
23
|
+
"data-testid": dataTestId,
|
|
24
|
+
children: rules.map(rule => jsxs(Stack, {
|
|
25
|
+
direction: "row",
|
|
26
|
+
gap: 1,
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
children: [jsx(Icon, {
|
|
29
|
+
name: rule.valid ? 'checkbox-circle-outline' : 'close-circle-outline',
|
|
30
|
+
color: rule.valid ? 'success' : 'neutral',
|
|
31
|
+
prominence: "weak",
|
|
32
|
+
size: 20
|
|
33
|
+
}), jsx(Text, {
|
|
34
|
+
as: "p",
|
|
35
|
+
variant: "bodySmall",
|
|
36
|
+
children: rule.text
|
|
37
|
+
})]
|
|
38
|
+
}, rule.name))
|
|
39
|
+
});
|
|
46
40
|
|
|
47
41
|
export { PasswordCheck };
|
|
@@ -17,43 +17,25 @@ const StyledTitle = /*#__PURE__*/_styled(Text, {
|
|
|
17
17
|
});
|
|
18
18
|
const StyledStrength = /*#__PURE__*/_styled(Text, {
|
|
19
19
|
target: "e1uv9umu2"
|
|
20
|
-
})("float:right;vertical-align:top;color:",
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref;
|
|
24
|
-
return strength.color;
|
|
25
|
-
}, ";");
|
|
20
|
+
})("float:right;vertical-align:top;color:", ({
|
|
21
|
+
strength
|
|
22
|
+
}) => strength.color, ";");
|
|
26
23
|
const StyledWrapper = /*#__PURE__*/_styled("div", {
|
|
27
24
|
target: "e1uv9umu1"
|
|
28
|
-
})("background-color:",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return theme.radii.default;
|
|
38
|
-
}, ";height:8px;margin-top:", _ref4 => {
|
|
39
|
-
let {
|
|
40
|
-
theme
|
|
41
|
-
} = _ref4;
|
|
42
|
-
return theme.space['1'];
|
|
43
|
-
}, ";margin-bottom:", _ref5 => {
|
|
44
|
-
let {
|
|
45
|
-
theme
|
|
46
|
-
} = _ref5;
|
|
47
|
-
return theme.space['2'];
|
|
48
|
-
}, ";");
|
|
25
|
+
})("background-color:", ({
|
|
26
|
+
theme
|
|
27
|
+
}) => theme.colors.neutral.backgroundDisabled, ";border-radius:", ({
|
|
28
|
+
theme
|
|
29
|
+
}) => theme.radii.default, ";height:8px;margin-top:", ({
|
|
30
|
+
theme
|
|
31
|
+
}) => theme.space['1'], ";margin-bottom:", ({
|
|
32
|
+
theme
|
|
33
|
+
}) => theme.space['2'], ";");
|
|
49
34
|
const StyledMeter = /*#__PURE__*/_styled("div", {
|
|
50
35
|
target: "e1uv9umu0"
|
|
51
|
-
})("border-radius:",
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
} = _ref6;
|
|
55
|
-
return theme.radii.default;
|
|
56
|
-
}, ";height:100%;transition:all 0.5s;");
|
|
36
|
+
})("border-radius:", ({
|
|
37
|
+
theme
|
|
38
|
+
}) => theme.radii.default, ";height:100%;transition:all 0.5s;");
|
|
57
39
|
const DEFAULT_ESTIMATE = () => ({
|
|
58
40
|
score: 0
|
|
59
41
|
});
|
|
@@ -63,17 +45,16 @@ const DEFAULT_FORBIDDEN_WORDS = [];
|
|
|
63
45
|
* PasswordStrengthMeter is a component that displays a password strength meter.
|
|
64
46
|
* @deprecated use Meter component instead
|
|
65
47
|
*/
|
|
66
|
-
const PasswordStrengthMeter =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
} = _ref7;
|
|
48
|
+
const PasswordStrengthMeter = ({
|
|
49
|
+
password = '',
|
|
50
|
+
onChange,
|
|
51
|
+
strength,
|
|
52
|
+
title,
|
|
53
|
+
estimate = DEFAULT_ESTIMATE,
|
|
54
|
+
forbiddenInputs = DEFAULT_FORBIDDEN_WORDS,
|
|
55
|
+
className,
|
|
56
|
+
'data-testid': dataTestId
|
|
57
|
+
}) => {
|
|
77
58
|
const [score, setScore] = useState(0);
|
|
78
59
|
const theme = useTheme();
|
|
79
60
|
const [backgroundColor, setBackgroundColor] = useState(strength[0]?.color || theme.colors.success.backgroundStrong);
|