@ultraviolet/ui 1.27.3 → 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 +57 -4
- 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 +166 -345
- package/dist/src/components/CheckboxGroup/index.js +25 -27
- package/dist/src/components/CopyButton/index.js +12 -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 +19 -22
- package/dist/src/components/Popup/index.js +56 -99
- package/dist/src/components/ProgressBar/index.js +31 -49
- package/dist/src/components/Radio/index.js +75 -118
- 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 +81 -112
- 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 +12 -15
- 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 -21
- 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 +5 -5
|
@@ -14,80 +14,38 @@ function noop() {}
|
|
|
14
14
|
const StyledPopup = /*#__PURE__*/_styled('div', {
|
|
15
15
|
shouldForwardProp: prop => !['maxWidth', 'positions', 'reverseAnimation', 'maxHeight', 'animationDuration', 'isDialog'].includes(prop),
|
|
16
16
|
target: "e4h1g861"
|
|
17
|
-
})("background:",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
maxHeight
|
|
50
|
-
} = _ref7;
|
|
51
|
-
return maxHeight ? 'auto' : undefined;
|
|
52
|
-
}, ";overflow-wrap:break-word;font-size:0.8rem;inset:0 auto auto 0;top:0;left:0;z-index:1;transform:", _ref8 => {
|
|
53
|
-
let {
|
|
54
|
-
positions
|
|
55
|
-
} = _ref8;
|
|
56
|
-
return positions.popupPosition;
|
|
57
|
-
}, ";animation:", _ref9 => {
|
|
58
|
-
let {
|
|
59
|
-
positions,
|
|
60
|
-
reverseAnimation,
|
|
61
|
-
maxHeight,
|
|
62
|
-
animationDuration
|
|
63
|
-
} = _ref9;
|
|
64
|
-
return maxHeight || animationDuration === 0 || animationDuration === undefined ? undefined : /*#__PURE__*/css(animationDuration, "ms ", !reverseAnimation ? animation(positions) : exitAnimation(positions), " forwards;");
|
|
65
|
-
}, ";&[data-has-arrow='true']{&::after{content:' ';position:absolute;top:", _ref10 => {
|
|
66
|
-
let {
|
|
67
|
-
positions
|
|
68
|
-
} = _ref10;
|
|
69
|
-
return positions.arrowTop;
|
|
70
|
-
}, "px;left:", _ref11 => {
|
|
71
|
-
let {
|
|
72
|
-
positions
|
|
73
|
-
} = _ref11;
|
|
74
|
-
return positions.arrowLeft;
|
|
75
|
-
}, "px;transform:", _ref12 => {
|
|
76
|
-
let {
|
|
77
|
-
positions
|
|
78
|
-
} = _ref12;
|
|
79
|
-
return positions.arrowTransform;
|
|
80
|
-
}, " rotate(", _ref13 => {
|
|
81
|
-
let {
|
|
82
|
-
positions
|
|
83
|
-
} = _ref13;
|
|
84
|
-
return positions.rotate;
|
|
85
|
-
}, "deg);margin-left:-", ARROW_WIDTH, "px;border-width:", ARROW_WIDTH, "px;border-style:solid;border-color:", _ref14 => {
|
|
86
|
-
let {
|
|
87
|
-
theme
|
|
88
|
-
} = _ref14;
|
|
89
|
-
return theme.colors.neutral.backgroundStronger;
|
|
90
|
-
}, " transparent transparent transparent;pointer-events:none;}}");
|
|
17
|
+
})("background:", ({
|
|
18
|
+
theme
|
|
19
|
+
}) => theme.colors.neutral.backgroundStronger, ";color:", ({
|
|
20
|
+
theme
|
|
21
|
+
}) => theme.colors.neutral.textStronger, ";border-radius:", ({
|
|
22
|
+
theme
|
|
23
|
+
}) => theme.radii.default, ";padding:", ({
|
|
24
|
+
theme
|
|
25
|
+
}) => `${theme.space['0.5']} ${theme.space['1']}`, ";text-align:center;position:absolute;max-width:", ({
|
|
26
|
+
maxWidth
|
|
27
|
+
}) => typeof maxWidth === 'number' ? `${maxWidth}px` : maxWidth, ";max-height:", ({
|
|
28
|
+
maxHeight
|
|
29
|
+
}) => typeof maxHeight === 'number' ? `${maxHeight}px` : maxHeight, ";overflow:", ({
|
|
30
|
+
maxHeight
|
|
31
|
+
}) => maxHeight ? 'auto' : undefined, ";overflow-wrap:break-word;font-size:0.8rem;inset:0 auto auto 0;top:0;left:0;z-index:1;transform:", ({
|
|
32
|
+
positions
|
|
33
|
+
}) => positions.popupPosition, ";animation:", ({
|
|
34
|
+
positions,
|
|
35
|
+
reverseAnimation,
|
|
36
|
+
maxHeight,
|
|
37
|
+
animationDuration
|
|
38
|
+
}) => maxHeight || animationDuration === 0 || animationDuration === undefined ? undefined : /*#__PURE__*/css(animationDuration, "ms ", !reverseAnimation ? animation(positions) : exitAnimation(positions), " forwards;"), ";&[data-has-arrow='true']{&::after{content:' ';position:absolute;top:", ({
|
|
39
|
+
positions
|
|
40
|
+
}) => positions.arrowTop, "px;left:", ({
|
|
41
|
+
positions
|
|
42
|
+
}) => positions.arrowLeft, "px;transform:", ({
|
|
43
|
+
positions
|
|
44
|
+
}) => positions.arrowTransform, " rotate(", ({
|
|
45
|
+
positions
|
|
46
|
+
}) => positions.rotate, "deg);margin-left:-", ARROW_WIDTH, "px;border-width:", ARROW_WIDTH, "px;border-style:solid;border-color:", ({
|
|
47
|
+
theme
|
|
48
|
+
}) => theme.colors.neutral.backgroundStronger, " transparent transparent transparent;pointer-events:none;}}");
|
|
91
49
|
const StyledChildrenContainer = /*#__PURE__*/_styled("div", {
|
|
92
50
|
target: "e4h1g860"
|
|
93
51
|
})(process.env.NODE_ENV === "production" ? {
|
|
@@ -101,30 +59,29 @@ const StyledChildrenContainer = /*#__PURE__*/_styled("div", {
|
|
|
101
59
|
/**
|
|
102
60
|
* @experimental This component is experimental and may be subject to breaking changes in the future.
|
|
103
61
|
*/
|
|
104
|
-
const Popup = /*#__PURE__*/forwardRef((
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
} = _ref15;
|
|
62
|
+
const Popup = /*#__PURE__*/forwardRef(({
|
|
63
|
+
children,
|
|
64
|
+
text = '',
|
|
65
|
+
placement = 'auto',
|
|
66
|
+
id,
|
|
67
|
+
className,
|
|
68
|
+
containerFullWidth,
|
|
69
|
+
maxWidth = 232,
|
|
70
|
+
maxHeight,
|
|
71
|
+
visible,
|
|
72
|
+
innerRef,
|
|
73
|
+
role = 'popup',
|
|
74
|
+
'data-testid': dataTestId,
|
|
75
|
+
hasArrow = true,
|
|
76
|
+
onClose,
|
|
77
|
+
tabIndex = 0,
|
|
78
|
+
onKeyDown,
|
|
79
|
+
'aria-haspopup': ariaHasPopup,
|
|
80
|
+
hideOnClickOutside = false,
|
|
81
|
+
needDebounce = true,
|
|
82
|
+
disableAnimation = false,
|
|
83
|
+
portalTarget
|
|
84
|
+
}, ref) => {
|
|
128
85
|
const childrenRef = useRef(null);
|
|
129
86
|
useImperativeHandle(innerRef, () => childrenRef.current);
|
|
130
87
|
const innerPopupRef = useRef(null);
|
|
@@ -244,8 +201,8 @@ const Popup = /*#__PURE__*/forwardRef((_ref15, ref) => {
|
|
|
244
201
|
// We want to detect scroll and resize in order to recompute positions of popup
|
|
245
202
|
// Adding true as third parameter to event listener will detect nested scrolls.
|
|
246
203
|
window.addEventListener('scroll', onWindowChangeDetected, true);
|
|
247
|
-
window.addEventListener('resize', onWindowChangeDetected, true);
|
|
248
204
|
}
|
|
205
|
+
window.addEventListener('resize', onWindowChangeDetected, true);
|
|
249
206
|
}
|
|
250
207
|
return () => {
|
|
251
208
|
window.removeEventListener('scroll', onWindowChangeDetected, true);
|
|
@@ -13,63 +13,45 @@ const shineAnimation = keyframes`
|
|
|
13
13
|
`;
|
|
14
14
|
const StyledProgressContainer = /*#__PURE__*/_styled("div", {
|
|
15
15
|
target: "e1b95x8r2"
|
|
16
|
-
})("overflow:hidden;position:relative;height:4px;margin-left:0;margin-right:0;border-radius:",
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, ";background-color:", _ref2 => {
|
|
22
|
-
let {
|
|
23
|
-
theme
|
|
24
|
-
} = _ref2;
|
|
25
|
-
return theme.colors.neutral.backgroundStrong;
|
|
26
|
-
}, ";");
|
|
16
|
+
})("overflow:hidden;position:relative;height:4px;margin-left:0;margin-right:0;border-radius:", ({
|
|
17
|
+
theme
|
|
18
|
+
}) => theme.radii.default, ";background-color:", ({
|
|
19
|
+
theme
|
|
20
|
+
}) => theme.colors.neutral.backgroundStrong, ";");
|
|
27
21
|
const StyledProgress = /*#__PURE__*/_styled("div", {
|
|
28
22
|
target: "e1b95x8r1"
|
|
29
23
|
})("position:absolute;top:0;left:0;bottom:0;width:25%;opacity:0.8;background:linear-gradient(\n 90deg,\n rgba(255, 255, 255, 0),\n rgba(255, 255, 255, 0.3),\n rgba(255, 255, 255, 0.4),\n rgba(255, 255, 255, 0.3),\n rgba(255, 255, 255, 0)\n );animation:", shineAnimation, " 1s linear infinite;");
|
|
30
24
|
const StyledFilled = /*#__PURE__*/_styled('div', {
|
|
31
25
|
shouldForwardProp: prop => !['sentiment', 'value'].includes(prop),
|
|
32
26
|
target: "e1b95x8r0"
|
|
33
|
-
})("border-radius:",
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}, ";
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
sentiment
|
|
42
|
-
} = _ref4;
|
|
43
|
-
return theme.colors[sentiment].backgroundStrong ?? 'inherit';
|
|
44
|
-
}, ";transition:0.3s width;width:", _ref5 => {
|
|
45
|
-
let {
|
|
46
|
-
value
|
|
47
|
-
} = _ref5;
|
|
48
|
-
return Math.max(0, Math.min(100, value));
|
|
49
|
-
}, "%;");
|
|
27
|
+
})("border-radius:", ({
|
|
28
|
+
theme
|
|
29
|
+
}) => theme.radii.default, ";position:absolute;top:0;left:0;bottom:0;background-color:", ({
|
|
30
|
+
theme,
|
|
31
|
+
sentiment
|
|
32
|
+
}) => theme.colors[sentiment].backgroundStrong ?? 'inherit', ";transition:0.3s width;width:", ({
|
|
33
|
+
value
|
|
34
|
+
}) => Math.max(0, Math.min(100, value)), "%;");
|
|
50
35
|
/**
|
|
51
36
|
* Progress bar component to display progress of a task. Can be used to display progress of a form or a loading state.
|
|
52
37
|
*/
|
|
53
|
-
const ProgressBar =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
})
|
|
72
|
-
});
|
|
73
|
-
};
|
|
38
|
+
const ProgressBar = ({
|
|
39
|
+
progress = false,
|
|
40
|
+
value = 0,
|
|
41
|
+
sentiment = 'primary',
|
|
42
|
+
className,
|
|
43
|
+
'data-testid': dataTestId
|
|
44
|
+
}) => jsx(StyledProgressContainer, {
|
|
45
|
+
role: "progressbar",
|
|
46
|
+
"aria-valuenow": value,
|
|
47
|
+
"aria-valuemin": 0,
|
|
48
|
+
"aria-valuemax": 100,
|
|
49
|
+
className: className,
|
|
50
|
+
"data-testid": dataTestId,
|
|
51
|
+
children: progress ? jsx(StyledProgress, {}) : jsx(StyledFilled, {
|
|
52
|
+
sentiment: sentiment,
|
|
53
|
+
value: value
|
|
54
|
+
})
|
|
55
|
+
});
|
|
74
56
|
|
|
75
57
|
export { ProgressBar };
|
|
@@ -5,12 +5,13 @@ import { Text } from '../Text/index.js';
|
|
|
5
5
|
import { Tooltip } from '../Tooltip/index.js';
|
|
6
6
|
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
7
7
|
|
|
8
|
+
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
9
|
const SIZE = 24;
|
|
9
10
|
const InnerCircleRing = /*#__PURE__*/_styled("circle", {
|
|
10
|
-
target: "
|
|
11
|
+
target: "ehkrmld6"
|
|
11
12
|
})();
|
|
12
13
|
const RadioMark = /*#__PURE__*/_styled("circle", {
|
|
13
|
-
target: "
|
|
14
|
+
target: "ehkrmld5"
|
|
14
15
|
})();
|
|
15
16
|
const RadioMarkedIcon = () => jsxs("g", {
|
|
16
17
|
children: [jsx("circle", {
|
|
@@ -29,135 +30,91 @@ const RadioMarkedIcon = () => jsxs("g", {
|
|
|
29
30
|
})]
|
|
30
31
|
});
|
|
31
32
|
const Ring = /*#__PURE__*/_styled("svg", {
|
|
32
|
-
target: "
|
|
33
|
-
})("height:", SIZE, "px;width:", SIZE, "px;min-width:", SIZE, "px;min-height:", SIZE, "px;border-radius:",
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
theme
|
|
41
|
-
} = _ref2;
|
|
42
|
-
return theme.colors.neutral.border;
|
|
43
|
-
}, ";", InnerCircleRing, "{fill:", _ref3 => {
|
|
44
|
-
let {
|
|
45
|
-
theme
|
|
46
|
-
} = _ref3;
|
|
47
|
-
return theme.colors.neutral.background;
|
|
48
|
-
}, ";}");
|
|
33
|
+
target: "ehkrmld4"
|
|
34
|
+
})("height:", SIZE, "px;width:", SIZE, "px;min-width:", SIZE, "px;min-height:", SIZE, "px;border-radius:", ({
|
|
35
|
+
theme
|
|
36
|
+
}) => theme.radii.circle, ";fill:", ({
|
|
37
|
+
theme
|
|
38
|
+
}) => theme.colors.neutral.border, ";", InnerCircleRing, "{fill:", ({
|
|
39
|
+
theme
|
|
40
|
+
}) => theme.colors.neutral.background, ";}");
|
|
49
41
|
const RadioInput = /*#__PURE__*/_styled("input", {
|
|
50
|
-
target: "
|
|
51
|
-
})("cursor:pointer;position:absolute;height:", SIZE, "px;width:", SIZE, "px;opacity:0;white-space:nowrap;border-width:0;&+", Ring, "{", RadioMark, "{transform-origin:center;transition:200ms transform ease-in-out;transform:scale(0);}}&:checked+svg{", RadioMark, "{transform:scale(1);}}&:checked[aria-disabled='false'][aria-invalid='false']+", Ring, "{fill:",
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}, ";
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} = _ref6;
|
|
65
|
-
return theme.colors.primary.backgroundStrong;
|
|
66
|
-
}, ";", InnerCircleRing, "{fill:", _ref7 => {
|
|
67
|
-
let {
|
|
68
|
-
theme
|
|
69
|
-
} = _ref7;
|
|
70
|
-
return theme.colors.primary.background;
|
|
71
|
-
}, ";}}&[aria-disabled='false']:focus-visible+", Ring, "{outline:-webkit-focus-ring-color auto 1px;}&[aria-invalid='true']:focus+", Ring, "{background-color:#f91b6c40;fill:", _ref8 => {
|
|
72
|
-
let {
|
|
73
|
-
theme
|
|
74
|
-
} = _ref8;
|
|
75
|
-
return theme.colors.danger.backgroundStrong;
|
|
76
|
-
}, ";", InnerCircleRing, "{fill:", _ref9 => {
|
|
77
|
-
let {
|
|
78
|
-
theme
|
|
79
|
-
} = _ref9;
|
|
80
|
-
return theme.colors.danger.background;
|
|
81
|
-
}, ";}}");
|
|
42
|
+
target: "ehkrmld3"
|
|
43
|
+
})("cursor:pointer;position:absolute;height:", SIZE, "px;width:", SIZE, "px;opacity:0;white-space:nowrap;border-width:0;&+", Ring, "{", RadioMark, "{transform-origin:center;transition:200ms transform ease-in-out;transform:scale(0);}}&:checked+svg{", RadioMark, "{transform:scale(1);}}&:checked[aria-disabled='false'][aria-invalid='false']+", Ring, "{fill:", ({
|
|
44
|
+
theme
|
|
45
|
+
}) => theme.colors.primary.backgroundStrong, ";}&[aria-invalid='true']:not([aria-disabled='true'])+", Ring, "{fill:", ({
|
|
46
|
+
theme
|
|
47
|
+
}) => theme.colors.danger.backgroundStrong, ";}&[aria-disabled='false']:active+", Ring, "{background-color:#5e127e40;fill:", ({
|
|
48
|
+
theme
|
|
49
|
+
}) => theme.colors.primary.backgroundStrong, ";", InnerCircleRing, "{fill:", ({
|
|
50
|
+
theme
|
|
51
|
+
}) => theme.colors.primary.background, ";}}&[aria-disabled='false']:focus-visible+", Ring, "{outline:-webkit-focus-ring-color auto 1px;}&[aria-invalid='true']:focus+", Ring, "{background-color:#f91b6c40;fill:", ({
|
|
52
|
+
theme
|
|
53
|
+
}) => theme.colors.danger.backgroundStrong, ";", InnerCircleRing, "{fill:", ({
|
|
54
|
+
theme
|
|
55
|
+
}) => theme.colors.danger.background, ";}}");
|
|
82
56
|
const RadioContainer = /*#__PURE__*/_styled("div", {
|
|
57
|
+
target: "ehkrmld2"
|
|
58
|
+
})("position:relative;display:flex;flex:1;align-items:flex-start;gap:", ({
|
|
59
|
+
theme
|
|
60
|
+
}) => theme.space['1'], ";&[aria-disabled='false'],&[aria-disabled='false']>label{cursor:pointer;}&[aria-disabled='true'][data-checked='false']{color:", ({
|
|
61
|
+
theme
|
|
62
|
+
}) => theme.colors.neutral.textDisabled, ";}:hover[aria-disabled='false']{", RadioInput, "+", Ring, "{fill:", ({
|
|
63
|
+
theme
|
|
64
|
+
}) => theme.colors.primary.border, ";", InnerCircleRing, "{fill:", ({
|
|
65
|
+
theme
|
|
66
|
+
}) => theme.colors.primary.backgroundHover, ";}}", RadioInput, "[aria-invalid='true']+", Ring, "{fill:", ({
|
|
67
|
+
theme
|
|
68
|
+
}) => theme.colors.danger.border, ";", InnerCircleRing, "{fill:", ({
|
|
69
|
+
theme
|
|
70
|
+
}) => theme.colors.danger.backgroundHover, ";}}}&[aria-disabled='true']{cursor:not-allowed;&>label,", RadioInput, "{cursor:not-allowed;}", Ring, "{fill:", ({
|
|
71
|
+
theme
|
|
72
|
+
}) => theme.colors.neutral.borderDisabled, ";cursor:not-allowed;", InnerCircleRing, "{fill:", ({
|
|
73
|
+
theme
|
|
74
|
+
}) => theme.colors.neutral.backgroundDisabled, ";}}}");
|
|
75
|
+
const StyledLabel = /*#__PURE__*/_styled("label", {
|
|
83
76
|
target: "ehkrmld1"
|
|
84
|
-
})("
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
} = _ref11;
|
|
93
|
-
return theme.colors.neutral.textDisabled;
|
|
94
|
-
}, ";}:hover[aria-disabled='false']{", RadioInput, "+", Ring, "{fill:", _ref12 => {
|
|
95
|
-
let {
|
|
96
|
-
theme
|
|
97
|
-
} = _ref12;
|
|
98
|
-
return theme.colors.primary.border;
|
|
99
|
-
}, ";", InnerCircleRing, "{fill:", _ref13 => {
|
|
100
|
-
let {
|
|
101
|
-
theme
|
|
102
|
-
} = _ref13;
|
|
103
|
-
return theme.colors.primary.backgroundHover;
|
|
104
|
-
}, ";}}", RadioInput, "[aria-invalid='true']+", Ring, "{fill:", _ref14 => {
|
|
105
|
-
let {
|
|
106
|
-
theme
|
|
107
|
-
} = _ref14;
|
|
108
|
-
return theme.colors.danger.border;
|
|
109
|
-
}, ";", InnerCircleRing, "{fill:", _ref15 => {
|
|
110
|
-
let {
|
|
111
|
-
theme
|
|
112
|
-
} = _ref15;
|
|
113
|
-
return theme.colors.danger.backgroundHover;
|
|
114
|
-
}, ";}}}&[aria-disabled='true']{cursor:not-allowed;&>label,", RadioInput, "{cursor:not-allowed;}", Ring, "{fill:", _ref16 => {
|
|
115
|
-
let {
|
|
116
|
-
theme
|
|
117
|
-
} = _ref16;
|
|
118
|
-
return theme.colors.neutral.borderDisabled;
|
|
119
|
-
}, ";cursor:not-allowed;", InnerCircleRing, "{fill:", _ref17 => {
|
|
120
|
-
let {
|
|
121
|
-
theme
|
|
122
|
-
} = _ref17;
|
|
123
|
-
return theme.colors.neutral.backgroundDisabled;
|
|
124
|
-
}, ";}}}");
|
|
77
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
78
|
+
name: "82a6rk",
|
|
79
|
+
styles: "flex:1"
|
|
80
|
+
} : {
|
|
81
|
+
name: "82a6rk",
|
|
82
|
+
styles: "flex:1",
|
|
83
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
84
|
+
});
|
|
125
85
|
const MargedText = /*#__PURE__*/_styled(Text, {
|
|
126
86
|
target: "ehkrmld0"
|
|
127
|
-
})("margin-left:",
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
} = _ref18;
|
|
131
|
-
return theme.space['4'];
|
|
132
|
-
}, ";");
|
|
87
|
+
})("margin-left:", ({
|
|
88
|
+
theme
|
|
89
|
+
}) => theme.space['4'], ";");
|
|
133
90
|
/**
|
|
134
91
|
* Radio component is used to select a single option from a list of options. It is a type of input component.
|
|
135
92
|
*/
|
|
136
|
-
const Radio = /*#__PURE__*/forwardRef((
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
} = _ref19;
|
|
93
|
+
const Radio = /*#__PURE__*/forwardRef(({
|
|
94
|
+
checked = false,
|
|
95
|
+
onChange,
|
|
96
|
+
onFocus,
|
|
97
|
+
onBlur,
|
|
98
|
+
disabled = false,
|
|
99
|
+
error,
|
|
100
|
+
name,
|
|
101
|
+
value,
|
|
102
|
+
label,
|
|
103
|
+
helper,
|
|
104
|
+
className,
|
|
105
|
+
autoFocus,
|
|
106
|
+
onKeyDown,
|
|
107
|
+
tooltip,
|
|
108
|
+
'aria-label': ariaLabel,
|
|
109
|
+
'data-testid': dataTestId
|
|
110
|
+
}, ref) => {
|
|
155
111
|
const id = useId();
|
|
156
112
|
const computedName = name ?? id;
|
|
157
113
|
return jsx(Tooltip, {
|
|
158
114
|
text: tooltip,
|
|
159
115
|
children: jsxs(Stack, {
|
|
160
116
|
gap: 0.5,
|
|
117
|
+
width: "100%",
|
|
161
118
|
children: [jsxs(RadioContainer, {
|
|
162
119
|
"aria-disabled": disabled,
|
|
163
120
|
className: className,
|
|
@@ -183,7 +140,7 @@ const Radio = /*#__PURE__*/forwardRef((_ref19, ref) => {
|
|
|
183
140
|
}), jsx(Ring, {
|
|
184
141
|
viewBox: "0 0 24 24",
|
|
185
142
|
children: jsx(RadioMarkedIcon, {})
|
|
186
|
-
}), label ? jsx(
|
|
143
|
+
}), label ? jsx(StyledLabel, {
|
|
187
144
|
htmlFor: `${computedName}-${value}`,
|
|
188
145
|
children: label
|
|
189
146
|
}) : null]
|
|
@@ -8,21 +8,20 @@ import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
|
8
8
|
|
|
9
9
|
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)."; }
|
|
10
10
|
const RadioGroupContext = /*#__PURE__*/createContext(undefined);
|
|
11
|
-
const RadioGroupRadio =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} = _ref;
|
|
11
|
+
const RadioGroupRadio = ({
|
|
12
|
+
onFocus,
|
|
13
|
+
onBlur,
|
|
14
|
+
disabled,
|
|
15
|
+
error,
|
|
16
|
+
name,
|
|
17
|
+
value,
|
|
18
|
+
label,
|
|
19
|
+
helper,
|
|
20
|
+
className,
|
|
21
|
+
autoFocus,
|
|
22
|
+
onKeyDown,
|
|
23
|
+
'data-testid': dataTestId
|
|
24
|
+
}) => {
|
|
26
25
|
const context = useContext(RadioGroupContext);
|
|
27
26
|
if (!context) {
|
|
28
27
|
throw new Error('RadioGroup.Radio can only be used inside a RadioGroup');
|
|
@@ -73,19 +72,18 @@ const StyledRequiredIcon = /*#__PURE__*/_styled(Icon, {
|
|
|
73
72
|
/**
|
|
74
73
|
* RadioGroup is a component that allows users to select one option from a list of options using radio.
|
|
75
74
|
*/
|
|
76
|
-
const RadioGroup =
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
} = _ref2;
|
|
75
|
+
const RadioGroup = ({
|
|
76
|
+
legend,
|
|
77
|
+
value,
|
|
78
|
+
className,
|
|
79
|
+
helper,
|
|
80
|
+
error,
|
|
81
|
+
direction = 'column',
|
|
82
|
+
children,
|
|
83
|
+
onChange,
|
|
84
|
+
name,
|
|
85
|
+
required = false
|
|
86
|
+
}) => {
|
|
89
87
|
const contextValue = useMemo(() => ({
|
|
90
88
|
groupName: name,
|
|
91
89
|
groupValue: value,
|
|
@@ -4,44 +4,38 @@ import { jsx } from '@emotion/react/jsx-runtime';
|
|
|
4
4
|
const StyledRow = /*#__PURE__*/_styled('div', {
|
|
5
5
|
shouldForwardProp: prop => !['templateColumns', 'gap', 'alignItems', 'justifyContent'].includes(prop),
|
|
6
6
|
target: "e3f5lzv0"
|
|
7
|
-
})("display:grid;",
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} = _ref;
|
|
15
|
-
return `
|
|
7
|
+
})("display:grid;", ({
|
|
8
|
+
theme,
|
|
9
|
+
gap,
|
|
10
|
+
alignItems = 'normal',
|
|
11
|
+
templateColumns,
|
|
12
|
+
justifyContent = 'normal'
|
|
13
|
+
}) => `
|
|
16
14
|
grid-template-columns: ${templateColumns};
|
|
17
15
|
${gap ? `gap: ${theme.space[gap]};` : ''}
|
|
18
16
|
align-items: ${alignItems};
|
|
19
17
|
justify-content: ${justifyContent};
|
|
20
|
-
|
|
21
|
-
}, ";");
|
|
18
|
+
`, ";");
|
|
22
19
|
/**
|
|
23
20
|
* Row component is a wrapper for grid layout.
|
|
24
21
|
* @experimental This component is experimental and may be subject to breaking changes in the future.
|
|
25
22
|
*/
|
|
26
|
-
const Row =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
children: children
|
|
44
|
-
});
|
|
45
|
-
};
|
|
23
|
+
const Row = ({
|
|
24
|
+
className,
|
|
25
|
+
'data-testid': dataTestId,
|
|
26
|
+
children,
|
|
27
|
+
templateColumns,
|
|
28
|
+
alignItems,
|
|
29
|
+
justifyContent,
|
|
30
|
+
gap
|
|
31
|
+
}) => jsx(StyledRow, {
|
|
32
|
+
className: className,
|
|
33
|
+
"data-testid": dataTestId,
|
|
34
|
+
gap: gap,
|
|
35
|
+
templateColumns: templateColumns,
|
|
36
|
+
alignItems: alignItems,
|
|
37
|
+
justifyContent: justifyContent,
|
|
38
|
+
children: children
|
|
39
|
+
});
|
|
46
40
|
|
|
47
41
|
export { Row, StyledRow };
|