@strapi/design-system 2.0.0-rc.7 → 2.0.0-rc.9
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/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Alert/Alert.d.ts +1 -1
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Badge/Badge.d.ts +4 -4
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/BaseLink/BaseLink.d.ts +1 -1
- package/dist/components/BaseLink/BaseLink.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Crumb.d.ts +1 -1
- package/dist/components/Breadcrumbs/Crumb.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/CrumbSimpleMenu.d.ts +33 -3
- package/dist/components/Breadcrumbs/CrumbSimpleMenu.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/CardAction.d.ts +1 -1
- package/dist/components/Card/CardAction.d.ts.map +1 -1
- package/dist/components/Card/CardBody.d.ts +1 -1
- package/dist/components/Card/CardBody.d.ts.map +1 -1
- package/dist/components/Card/CardContent.d.ts +1 -1
- package/dist/components/Card/CardContent.d.ts.map +1 -1
- package/dist/components/Card/CardHeader.d.ts +1 -1
- package/dist/components/Card/CardHeader.d.ts.map +1 -1
- package/dist/components/Card/CardTimer.d.ts +1 -1
- package/dist/components/Card/CardTimer.d.ts.map +1 -1
- package/dist/components/Card/CardTitle.d.ts +1 -1
- package/dist/components/Card/CardTitle.d.ts.map +1 -1
- package/dist/components/CarouselInput/Carousel.d.ts +1 -1
- package/dist/components/CarouselInput/Carousel.d.ts.map +1 -1
- package/dist/components/CarouselInput/CarouselActions.d.ts +1 -1
- package/dist/components/CarouselInput/CarouselActions.d.ts.map +1 -1
- package/dist/components/CarouselInput/CarouselImage.d.ts +1 -1
- package/dist/components/CarouselInput/CarouselImage.d.ts.map +1 -1
- package/dist/components/CarouselInput/CarouselInput.d.ts.map +1 -1
- package/dist/components/CarouselInput/CarouselSlide.d.ts +1 -1
- package/dist/components/CarouselInput/CarouselSlide.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +2 -2
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/Divider/Divider.d.ts.map +1 -1
- package/dist/components/EmptyStateLayout/EmptyStateLayout.d.ts +1 -1
- package/dist/components/EmptyStateLayout/EmptyStateLayout.d.ts.map +1 -1
- package/dist/components/Field/Field.d.ts +2 -2
- package/dist/components/Field/Field.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +1 -1
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/JSONInput/JSONInput.d.ts +1 -1
- package/dist/components/JSONInput/JSONInput.d.ts.map +1 -1
- package/dist/components/Link/Link.d.ts.map +1 -1
- package/dist/components/Main/Main.d.ts +1 -1
- package/dist/components/Main/Main.d.ts.map +1 -1
- package/dist/components/Modal/Modal.d.ts +2 -2
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/components/Pagination/components.d.ts +1 -1
- package/dist/components/Pagination/components.d.ts.map +1 -1
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/RawTable/RawCell.d.ts +1 -1
- package/dist/components/RawTable/RawCell.d.ts.map +1 -1
- package/dist/components/RawTable/RawTr.d.ts +1 -1
- package/dist/components/RawTable/RawTr.d.ts.map +1 -1
- package/dist/components/Select/SelectParts.d.ts +2 -2
- package/dist/components/Select/SelectParts.d.ts.map +1 -1
- package/dist/components/SimpleMenu/Menu.d.ts +19 -7
- package/dist/components/SimpleMenu/Menu.d.ts.map +1 -1
- package/dist/components/SimpleMenu/SimpleMenu.d.ts +31 -4
- package/dist/components/SimpleMenu/SimpleMenu.d.ts.map +1 -1
- package/dist/components/Status/Status.d.ts +1 -1
- package/dist/components/Status/Status.d.ts.map +1 -1
- package/dist/components/SubNav/SubNav.d.ts +1 -1
- package/dist/components/SubNav/SubNav.d.ts.map +1 -1
- package/dist/components/SubNav/SubNavHeader.d.ts +3 -3
- package/dist/components/SubNav/SubNavHeader.d.ts.map +1 -1
- package/dist/components/SubNav/SubNavLink.d.ts.map +1 -1
- package/dist/components/SubNav/SubNavSections.d.ts +1 -1
- package/dist/components/SubNav/SubNavSections.d.ts.map +1 -1
- package/dist/components/Table/TFooter.d.ts +1 -1
- package/dist/components/Table/TFooter.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/components/Tag/Tag.d.ts.map +1 -1
- package/dist/components/TextButton/TextButton.d.ts +1 -1
- package/dist/components/TextButton/TextButton.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +1 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/index.d.ts +0 -5
- package/dist/components/index.d.ts.map +1 -1
- package/dist/helpers/handleResponsiveValues.d.ts +30 -15
- package/dist/helpers/handleResponsiveValues.d.ts.map +1 -1
- package/dist/helpers/theme.d.ts +1 -1
- package/dist/helpers/theme.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +655 -512
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +655 -512
- package/dist/index.mjs.map +1 -1
- package/dist/primitives/Box/Box.d.ts +84 -0
- package/dist/primitives/Box/Box.d.ts.map +1 -0
- package/dist/primitives/Box/index.d.ts.map +1 -0
- package/dist/{components → primitives}/Flex/Flex.d.ts +7 -8
- package/dist/primitives/Flex/Flex.d.ts.map +1 -0
- package/dist/primitives/Flex/index.d.ts.map +1 -0
- package/dist/{components → primitives}/Grid/Grid.d.ts +4 -3
- package/dist/primitives/Grid/Grid.d.ts.map +1 -0
- package/dist/primitives/Grid/index.d.ts.map +1 -0
- package/dist/{components → primitives}/Typography/Typography.d.ts +5 -9
- package/dist/primitives/Typography/Typography.d.ts.map +1 -0
- package/dist/primitives/Typography/index.d.ts.map +1 -0
- package/dist/primitives/index.d.ts +5 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/themes/common-theme.d.ts +8 -4
- package/dist/themes/common-theme.d.ts.map +1 -1
- package/dist/utilities/KeyboardNavigable/KeyboardNavigable.d.ts +1 -1
- package/dist/utilities/KeyboardNavigable/KeyboardNavigable.d.ts.map +1 -1
- package/dist/utilities/Portal/Portal.d.ts +1 -1
- package/package.json +3 -3
- package/dist/components/Box/Box.d.ts +0 -102
- package/dist/components/Box/Box.d.ts.map +0 -1
- package/dist/components/Box/index.d.ts.map +0 -1
- package/dist/components/Flex/Flex.d.ts.map +0 -1
- package/dist/components/Flex/index.d.ts.map +0 -1
- package/dist/components/Grid/Grid.d.ts.map +0 -1
- package/dist/components/Grid/index.d.ts.map +0 -1
- package/dist/components/Typography/Typography.d.ts.map +0 -1
- package/dist/components/Typography/index.d.ts.map +0 -1
- /package/dist/{components → primitives}/Box/index.d.ts +0 -0
- /package/dist/{components → primitives}/Flex/index.d.ts +0 -0
- /package/dist/{components → primitives}/Grid/index.d.ts +0 -0
- /package/dist/{components → primitives}/Typography/index.d.ts +0 -0
package/dist/index.mjs
CHANGED
|
@@ -48,32 +48,6 @@ const createContext = (rootComponentName, defaultContext) => {
|
|
|
48
48
|
Provider2.displayName = `${rootComponentName}Provider`;
|
|
49
49
|
return [Provider2, useContext];
|
|
50
50
|
};
|
|
51
|
-
const handleResponsiveValues = (property, value, theme) => {
|
|
52
|
-
if (!value) {
|
|
53
|
-
return void 0;
|
|
54
|
-
}
|
|
55
|
-
if (typeof value === "object") {
|
|
56
|
-
const transformedArray = Array.isArray(value) ? value : [value?.desktop, value?.tablet, value?.mobile];
|
|
57
|
-
const spaces = transformedArray.reduce((acc, curr, index) => {
|
|
58
|
-
if (curr) {
|
|
59
|
-
switch (index) {
|
|
60
|
-
case 0:
|
|
61
|
-
return `${acc}${property}: ${theme.spaces[curr]};`;
|
|
62
|
-
case 1:
|
|
63
|
-
return `${acc}${theme.mediaQueries.tablet}{${property}: ${theme.spaces[curr]};}`;
|
|
64
|
-
case 2:
|
|
65
|
-
return `${acc}${theme.mediaQueries.mobile}{${property}: ${theme.spaces[curr]};}`;
|
|
66
|
-
default:
|
|
67
|
-
return acc;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return acc;
|
|
71
|
-
}, "");
|
|
72
|
-
return spaces;
|
|
73
|
-
}
|
|
74
|
-
const realValue = theme.spaces[value] ?? value;
|
|
75
|
-
return `${property}: ${realValue};`;
|
|
76
|
-
};
|
|
77
51
|
function isKeyOf(o, s) {
|
|
78
52
|
if (typeof o === "string") {
|
|
79
53
|
return false;
|
|
@@ -84,11 +58,166 @@ function isObject(item) {
|
|
|
84
58
|
return item && typeof item === "object" && !Array.isArray(item);
|
|
85
59
|
}
|
|
86
60
|
function extractStyleFromTheme(themeSection, key, defaultValue) {
|
|
87
|
-
if (key && isKeyOf(themeSection, key)) {
|
|
61
|
+
if (themeSection && key && isKeyOf(themeSection, key)) {
|
|
88
62
|
return themeSection[key];
|
|
89
63
|
}
|
|
90
64
|
return defaultValue;
|
|
91
65
|
}
|
|
66
|
+
const mappedCSSProps = {
|
|
67
|
+
padding: ["padding-block-start", "padding-inline-end", "padding-block-end", "padding-inline-start"],
|
|
68
|
+
paddingTop: "padding-block-start",
|
|
69
|
+
paddingRight: "padding-inline-end",
|
|
70
|
+
paddingBottom: "padding-block-end",
|
|
71
|
+
paddingLeft: "padding-inline-start",
|
|
72
|
+
margin: ["margin-block-start", "margin-inline-end", "margin-block-end", "margin-inline-start"],
|
|
73
|
+
marginLeft: "margin-inline-start",
|
|
74
|
+
marginRight: "margin-inline-end",
|
|
75
|
+
marginTop: "margin-block-start",
|
|
76
|
+
marginBottom: "margin-block-end",
|
|
77
|
+
borderRadius: "border-radius",
|
|
78
|
+
borderStyle: "border-style",
|
|
79
|
+
borderWidth: "border-width",
|
|
80
|
+
borderColor: "border-color",
|
|
81
|
+
fontSize: "font-size",
|
|
82
|
+
fontWeight: "font-weight",
|
|
83
|
+
lineHeight: "line-height",
|
|
84
|
+
zIndex: "z-index",
|
|
85
|
+
boxShadow: "box-shadow",
|
|
86
|
+
pointerEvents: "pointer-events",
|
|
87
|
+
textAlign: "text-align",
|
|
88
|
+
textTransform: "text-transform",
|
|
89
|
+
textDecoration: "text-decoration",
|
|
90
|
+
flexGrow: "flex-grow",
|
|
91
|
+
flexShrink: "flex-shrink",
|
|
92
|
+
flexBasis: "flex-basis",
|
|
93
|
+
minWidth: "min-width",
|
|
94
|
+
maxWidth: "max-width",
|
|
95
|
+
minHeight: "min-height",
|
|
96
|
+
maxHeight: "max-height",
|
|
97
|
+
flexDirection: "flex-direction",
|
|
98
|
+
flexWrap: "flex-wrap",
|
|
99
|
+
justifyContent: "justify-content",
|
|
100
|
+
alignItems: "align-items"
|
|
101
|
+
};
|
|
102
|
+
const fillCssValues = (value) => {
|
|
103
|
+
const [top, right, bottom, left] = value;
|
|
104
|
+
const rightValue = right ?? top;
|
|
105
|
+
const bottomValue = bottom ?? top;
|
|
106
|
+
const leftValue = left ?? rightValue;
|
|
107
|
+
return [top, rightValue, bottomValue, leftValue];
|
|
108
|
+
};
|
|
109
|
+
function getThemeSection(key, theme) {
|
|
110
|
+
switch (key) {
|
|
111
|
+
case "gap":
|
|
112
|
+
case "padding":
|
|
113
|
+
case "margin":
|
|
114
|
+
case "paddingTop":
|
|
115
|
+
case "paddingLeft":
|
|
116
|
+
case "paddingRight":
|
|
117
|
+
case "paddingBottom":
|
|
118
|
+
case "marginTop":
|
|
119
|
+
case "marginLeft":
|
|
120
|
+
case "marginRight":
|
|
121
|
+
case "marginBottom":
|
|
122
|
+
case "left":
|
|
123
|
+
case "right":
|
|
124
|
+
case "top":
|
|
125
|
+
case "bottom":
|
|
126
|
+
case "width":
|
|
127
|
+
case "maxWidth":
|
|
128
|
+
case "minWidth":
|
|
129
|
+
case "height":
|
|
130
|
+
case "maxHeight":
|
|
131
|
+
case "minHeight":
|
|
132
|
+
case "borderRadius":
|
|
133
|
+
case "borderWidth":
|
|
134
|
+
return theme.spaces;
|
|
135
|
+
case "color":
|
|
136
|
+
case "background":
|
|
137
|
+
case "borderColor":
|
|
138
|
+
return theme.colors;
|
|
139
|
+
case "fontSize":
|
|
140
|
+
return theme.fontSizes;
|
|
141
|
+
case "fontWeight":
|
|
142
|
+
return theme.fontWeights;
|
|
143
|
+
case "lineHeight":
|
|
144
|
+
return theme.lineHeights;
|
|
145
|
+
case "zIndex":
|
|
146
|
+
return theme.zIndices;
|
|
147
|
+
case "boxShadow":
|
|
148
|
+
return theme.shadows;
|
|
149
|
+
default:
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const handleResponsiveValues = (values, theme) => {
|
|
154
|
+
const stylesByBreakpoint = Object.entries(values).reduce(
|
|
155
|
+
(acc, curr) => {
|
|
156
|
+
const [key, value] = curr;
|
|
157
|
+
const themeSection = getThemeSection(key, theme);
|
|
158
|
+
const cssProperty = Object.prototype.hasOwnProperty.call(mappedCSSProps, key) ? mappedCSSProps[key] : key;
|
|
159
|
+
if (cssProperty && (value || value === 0)) {
|
|
160
|
+
if (typeof value === "object" && !Array.isArray(value)) {
|
|
161
|
+
Object.entries(value).forEach(([breakpointName, breakpointValue]) => {
|
|
162
|
+
acc[breakpointName] = {
|
|
163
|
+
...acc[breakpointName],
|
|
164
|
+
...convertCssPropertiesToCssValues(cssProperty, breakpointValue, themeSection)
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
} else {
|
|
168
|
+
acc.initial = {
|
|
169
|
+
...acc.initial,
|
|
170
|
+
...convertCssPropertiesToCssValues(cssProperty, value, themeSection)
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return acc;
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
initial: {},
|
|
178
|
+
small: {},
|
|
179
|
+
medium: {},
|
|
180
|
+
large: {}
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
return Object.entries(stylesByBreakpoint).reduce((acc, [key, value]) => {
|
|
184
|
+
if (value && Object.keys(value).length > 0) {
|
|
185
|
+
const breakpointStyles = Object.entries(value).reduce((arr, [property, value2]) => {
|
|
186
|
+
arr.push(`${property}: ${value2};`);
|
|
187
|
+
return arr;
|
|
188
|
+
}, []).join("\n");
|
|
189
|
+
if (key === "initial") {
|
|
190
|
+
acc.push(breakpointStyles);
|
|
191
|
+
} else {
|
|
192
|
+
acc.push(`${theme.breakpoints[key]}{ ${breakpointStyles} }`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return acc;
|
|
196
|
+
}, []).join("\n");
|
|
197
|
+
};
|
|
198
|
+
const convertCssPropertiesToCssValues = (property, value, themeSection) => {
|
|
199
|
+
if (Array.isArray(property) && Array.isArray(value)) {
|
|
200
|
+
const shorthandValues = fillCssValues(value);
|
|
201
|
+
return property.reduce((acc, prop, index) => {
|
|
202
|
+
acc[prop] = extractStyleFromTheme(themeSection, shorthandValues[index], shorthandValues[index]);
|
|
203
|
+
return acc;
|
|
204
|
+
}, {});
|
|
205
|
+
} else if (Array.isArray(property) && !Array.isArray(value)) {
|
|
206
|
+
return property.reduce((acc, prop) => {
|
|
207
|
+
acc[prop] = extractStyleFromTheme(themeSection, value, value);
|
|
208
|
+
return acc;
|
|
209
|
+
}, {});
|
|
210
|
+
} else if (!Array.isArray(property) && !Array.isArray(value)) {
|
|
211
|
+
return {
|
|
212
|
+
[property]: extractStyleFromTheme(themeSection, value, value)
|
|
213
|
+
};
|
|
214
|
+
} else {
|
|
215
|
+
console.warn(
|
|
216
|
+
"You've passed an array of values to a property that does not support it. Please check the property and value you're passing."
|
|
217
|
+
);
|
|
218
|
+
return {};
|
|
219
|
+
}
|
|
220
|
+
};
|
|
92
221
|
const forwardRef = React.forwardRef;
|
|
93
222
|
const Box = forwardRef((props, ref) => {
|
|
94
223
|
const {
|
|
@@ -100,8 +229,6 @@ const Box = forwardRef((props, ref) => {
|
|
|
100
229
|
fontSize,
|
|
101
230
|
grow,
|
|
102
231
|
hasRadius,
|
|
103
|
-
hiddenS,
|
|
104
|
-
hiddenXS,
|
|
105
232
|
padding,
|
|
106
233
|
paddingBottom,
|
|
107
234
|
paddingLeft,
|
|
@@ -115,6 +242,7 @@ const Box = forwardRef((props, ref) => {
|
|
|
115
242
|
shadow,
|
|
116
243
|
shrink,
|
|
117
244
|
lineHeight,
|
|
245
|
+
fontWeight,
|
|
118
246
|
width,
|
|
119
247
|
minWidth,
|
|
120
248
|
maxWidth,
|
|
@@ -152,8 +280,6 @@ const Box = forwardRef((props, ref) => {
|
|
|
152
280
|
$fontSize: fontSize,
|
|
153
281
|
$grow: grow,
|
|
154
282
|
$hasRadius: hasRadius,
|
|
155
|
-
$hiddenS: hiddenS,
|
|
156
|
-
$hiddenXS: hiddenXS,
|
|
157
283
|
$padding: padding,
|
|
158
284
|
$paddingBottom: paddingBottom,
|
|
159
285
|
$paddingLeft: paddingLeft,
|
|
@@ -167,6 +293,7 @@ const Box = forwardRef((props, ref) => {
|
|
|
167
293
|
$shadow: shadow,
|
|
168
294
|
$shrink: shrink,
|
|
169
295
|
$lineHeight: lineHeight,
|
|
296
|
+
$fontWeight: fontWeight,
|
|
170
297
|
$width: width,
|
|
171
298
|
$minWidth: minWidth,
|
|
172
299
|
$maxWidth: maxWidth,
|
|
@@ -195,110 +322,83 @@ const Box = forwardRef((props, ref) => {
|
|
|
195
322
|
return /* @__PURE__ */ jsx(StyledBox, { as: AsComponent, ref, ...mappedProps, ...rest });
|
|
196
323
|
});
|
|
197
324
|
const StyledBox = styled.div`
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
325
|
+
${({ theme, ...props }) => {
|
|
326
|
+
return handleResponsiveValues(
|
|
327
|
+
{
|
|
328
|
+
padding: props.$padding,
|
|
329
|
+
paddingTop: props.$paddingTop,
|
|
330
|
+
paddingBottom: props.$paddingBottom,
|
|
331
|
+
paddingLeft: props.$paddingLeft,
|
|
332
|
+
paddingRight: props.$paddingRight,
|
|
333
|
+
margin: props.$margin,
|
|
334
|
+
marginTop: props.$marginTop,
|
|
335
|
+
marginBottom: props.$marginBottom,
|
|
336
|
+
marginLeft: props.$marginLeft,
|
|
337
|
+
marginRight: props.$marginRight,
|
|
338
|
+
top: props.$top,
|
|
339
|
+
left: props.$left,
|
|
340
|
+
bottom: props.$bottom,
|
|
341
|
+
right: props.$right,
|
|
342
|
+
width: props.$width,
|
|
343
|
+
minWidth: props.$minWidth,
|
|
344
|
+
maxWidth: props.$maxWidth,
|
|
345
|
+
height: props.$height,
|
|
346
|
+
minHeight: props.$minHeight,
|
|
347
|
+
maxHeight: props.$maxHeight,
|
|
348
|
+
color: props.$color,
|
|
349
|
+
background: props.$background,
|
|
350
|
+
fontSize: props.$fontSize,
|
|
351
|
+
fontWeight: props.$fontWeight,
|
|
352
|
+
lineHeight: props.$lineHeight,
|
|
353
|
+
borderRadius: props.$hasRadius ? theme.borderRadius : props.$borderRadius,
|
|
354
|
+
borderStyle: props.$borderColor && !props.$borderStyle ? "solid" : props.$borderStyle,
|
|
355
|
+
borderWidth: props.$borderColor && !props.$borderWidth ? "1px" : props.$borderWidth,
|
|
356
|
+
borderColor: props.$borderColor,
|
|
357
|
+
zIndex: props.$zIndex,
|
|
358
|
+
boxShadow: props.$shadow,
|
|
359
|
+
display: props.$display,
|
|
360
|
+
pointerEvents: props.$pointerEvents,
|
|
361
|
+
cursor: props.$cursor,
|
|
362
|
+
textAlign: props.$textAlign,
|
|
363
|
+
textTransform: props.$textTransform,
|
|
364
|
+
transition: props.$transition,
|
|
365
|
+
transform: props.$transform,
|
|
366
|
+
animation: props.$animation,
|
|
367
|
+
position: props.$position,
|
|
368
|
+
overflow: props.$overflow,
|
|
369
|
+
flex: props.$flex,
|
|
370
|
+
flexShrink: props.$shrink,
|
|
371
|
+
flexGrow: props.$grow,
|
|
372
|
+
flexBasis: props.$basis
|
|
373
|
+
},
|
|
374
|
+
theme
|
|
375
|
+
);
|
|
235
376
|
}};
|
|
236
|
-
|
|
237
|
-
// Shadows
|
|
238
|
-
box-shadow: ${({ theme, $shadow }) => extractStyleFromTheme(theme.shadows, $shadow, void 0)};
|
|
239
|
-
|
|
240
|
-
// Handlers
|
|
241
|
-
pointer-events: ${({ $pointerEvents }) => $pointerEvents};
|
|
242
|
-
|
|
243
|
-
// Display
|
|
244
|
-
display: ${({ $display }) => $display};
|
|
245
|
-
|
|
246
|
-
// Position
|
|
247
|
-
position: ${({ $position }) => $position};
|
|
248
|
-
left: ${({ $left, theme }) => extractStyleFromTheme(theme.spaces, $left, $left)};
|
|
249
|
-
right: ${({ $right, theme }) => extractStyleFromTheme(theme.spaces, $right, $right)};
|
|
250
|
-
top: ${({ $top, theme }) => extractStyleFromTheme(theme.spaces, $top, $top)};
|
|
251
|
-
bottom: ${({ $bottom, theme }) => extractStyleFromTheme(theme.spaces, $bottom, $bottom)};
|
|
252
|
-
z-index: ${({ $zIndex, theme }) => extractStyleFromTheme(theme.zIndices, $zIndex, $zIndex)};
|
|
253
|
-
overflow: ${({ $overflow }) => $overflow};
|
|
254
|
-
|
|
255
|
-
// Size
|
|
256
|
-
width: ${({ $width, theme }) => extractStyleFromTheme(theme.spaces, $width, $width)};
|
|
257
|
-
max-width: ${({ $maxWidth, theme }) => extractStyleFromTheme(theme.spaces, $maxWidth, $maxWidth)};
|
|
258
|
-
min-width: ${({ $minWidth, theme }) => extractStyleFromTheme(theme.spaces, $minWidth, $minWidth)};
|
|
259
|
-
height: ${({ $height, theme }) => extractStyleFromTheme(theme.spaces, $height, $height)};
|
|
260
|
-
max-height: ${({ $maxHeight, theme }) => extractStyleFromTheme(theme.spaces, $maxHeight, $maxHeight)};
|
|
261
|
-
min-height: ${({ $minHeight, theme }) => extractStyleFromTheme(theme.spaces, $minHeight, $minHeight)};
|
|
262
|
-
|
|
263
|
-
// Animation
|
|
264
|
-
transition: ${({ $transition }) => $transition};
|
|
265
|
-
transform: ${({ $transform }) => $transform};
|
|
266
|
-
animation: ${({ $animation }) => $animation};
|
|
267
|
-
|
|
268
|
-
//Flexbox children props
|
|
269
|
-
flex-shrink: ${({ $shrink }) => $shrink};
|
|
270
|
-
flex-grow: ${({ $grow }) => $grow};
|
|
271
|
-
flex-basis: ${({ $basis }) => $basis};
|
|
272
|
-
flex: ${({ $flex }) => $flex};
|
|
273
|
-
|
|
274
|
-
// Text
|
|
275
|
-
text-align: ${({ $textAlign }) => $textAlign};
|
|
276
|
-
text-transform: ${({ $textTransform }) => $textTransform};
|
|
277
|
-
line-height: ${({ theme, $lineHeight }) => extractStyleFromTheme(theme.lineHeights, $lineHeight, $lineHeight)};
|
|
278
|
-
|
|
279
|
-
// Cursor
|
|
280
|
-
cursor: ${({ $cursor }) => $cursor};
|
|
281
377
|
`;
|
|
282
378
|
const Flex = forwardRef((props, ref) => {
|
|
283
|
-
const { className, alignItems, direction,
|
|
379
|
+
const { className, alignItems, direction, inline, gap, justifyContent, wrap, ...rest } = props;
|
|
284
380
|
const mappedProps = {
|
|
285
381
|
$alignItems: alignItems,
|
|
286
382
|
$direction: direction,
|
|
287
383
|
$gap: gap,
|
|
288
|
-
$inline: inline,
|
|
289
384
|
$justifyContent: justifyContent,
|
|
290
|
-
$wrap: wrap
|
|
385
|
+
$wrap: wrap,
|
|
386
|
+
$inline: inline
|
|
291
387
|
};
|
|
292
388
|
return /* @__PURE__ */ jsx(StyledFlex, { className, ref, ...mappedProps, ...rest });
|
|
293
389
|
});
|
|
294
390
|
const StyledFlex = styled(Box)`
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
391
|
+
${({ theme, $display = "flex", $alignItems = "center", $direction = "row", ...props }) => handleResponsiveValues(
|
|
392
|
+
{
|
|
393
|
+
gap: props.$gap,
|
|
394
|
+
alignItems: $alignItems,
|
|
395
|
+
justifyContent: props.$justifyContent,
|
|
396
|
+
flexWrap: props.$wrap,
|
|
397
|
+
flexDirection: $direction,
|
|
398
|
+
display: props.$inline ? "inline-flex" : $display
|
|
399
|
+
},
|
|
400
|
+
theme
|
|
401
|
+
)};
|
|
302
402
|
`;
|
|
303
403
|
const ALPHA = "alpha";
|
|
304
404
|
const BETA = "beta";
|
|
@@ -373,26 +473,24 @@ const Typography = forwardRef(
|
|
|
373
473
|
(props, ref) => {
|
|
374
474
|
const {
|
|
375
475
|
ellipsis: ellipsis2,
|
|
376
|
-
fontSize,
|
|
377
|
-
fontWeight,
|
|
378
|
-
lineHeight,
|
|
379
|
-
textAlign,
|
|
380
476
|
textColor = "currentcolor",
|
|
381
477
|
textDecoration,
|
|
382
478
|
textTransform,
|
|
383
479
|
variant: variant2,
|
|
480
|
+
lineHeight,
|
|
481
|
+
fontWeight,
|
|
482
|
+
fontSize,
|
|
384
483
|
...rest
|
|
385
484
|
} = props;
|
|
386
485
|
const mappedProps = {
|
|
387
486
|
$ellipsis: ellipsis2,
|
|
388
|
-
$fontSize: fontSize,
|
|
389
|
-
$fontWeight: fontWeight,
|
|
390
|
-
$lineHeight: lineHeight,
|
|
391
|
-
$textAlign: textAlign,
|
|
392
487
|
$textColor: textColor,
|
|
393
488
|
$textDecoration: textDecoration,
|
|
394
489
|
$textTransform: textTransform,
|
|
395
|
-
$variant: variant2
|
|
490
|
+
$variant: variant2,
|
|
491
|
+
$lineHeight: lineHeight,
|
|
492
|
+
$fontWeight: fontWeight,
|
|
493
|
+
$fontSize: fontSize
|
|
396
494
|
};
|
|
397
495
|
return /* @__PURE__ */ jsx(StyledTypography, { ref, tag: "span", ...mappedProps, ...rest });
|
|
398
496
|
}
|
|
@@ -401,15 +499,19 @@ const StyledTypography = styled(Box)`
|
|
|
401
499
|
${variant}
|
|
402
500
|
${({ $ellipsis }) => $ellipsis ? ellipsis : ""}
|
|
403
501
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
502
|
+
${({ theme, ...props }) => {
|
|
503
|
+
return handleResponsiveValues(
|
|
504
|
+
{
|
|
505
|
+
color: props.$textColor,
|
|
506
|
+
textDecoration: props.$textDecoration,
|
|
507
|
+
textTransform: props.$textTransform,
|
|
508
|
+
lineHeight: props.$lineHeight,
|
|
509
|
+
fontWeight: props.$fontWeight,
|
|
510
|
+
fontSize: props.$fontSize
|
|
511
|
+
},
|
|
512
|
+
theme
|
|
513
|
+
);
|
|
514
|
+
}}
|
|
413
515
|
`;
|
|
414
516
|
const [AccordionProvider, useAccordion] = createContext("Accordion");
|
|
415
517
|
const Root$8 = React.forwardRef(({ children, size = "S", ...props }, forwardedRef) => {
|
|
@@ -1354,7 +1456,7 @@ const getActiveStyle = ({ theme, $variant }) => {
|
|
|
1354
1456
|
color: ${theme.colors[`${getVariantColorName($variant)}600`]};
|
|
1355
1457
|
`;
|
|
1356
1458
|
}
|
|
1357
|
-
if ($variant === TERTIARY) {
|
|
1459
|
+
if ($variant === TERTIARY || $variant === GHOST) {
|
|
1358
1460
|
return css`
|
|
1359
1461
|
background-color: ${theme.colors.neutral150};
|
|
1360
1462
|
`;
|
|
@@ -1494,6 +1596,156 @@ const ButtonWrapper = styled(Flex)`
|
|
|
1494
1596
|
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
1495
1597
|
}
|
|
1496
1598
|
`;
|
|
1599
|
+
const TooltipImpl = React.forwardRef(
|
|
1600
|
+
({
|
|
1601
|
+
children,
|
|
1602
|
+
description,
|
|
1603
|
+
label,
|
|
1604
|
+
defaultOpen,
|
|
1605
|
+
open,
|
|
1606
|
+
onOpenChange,
|
|
1607
|
+
delayDuration = 500,
|
|
1608
|
+
disableHoverableContent,
|
|
1609
|
+
...restProps
|
|
1610
|
+
}, forwardedRef) => {
|
|
1611
|
+
return /* @__PURE__ */ jsxs(
|
|
1612
|
+
Tooltip.Root,
|
|
1613
|
+
{
|
|
1614
|
+
defaultOpen,
|
|
1615
|
+
open,
|
|
1616
|
+
onOpenChange,
|
|
1617
|
+
delayDuration,
|
|
1618
|
+
disableHoverableContent,
|
|
1619
|
+
children: [
|
|
1620
|
+
/* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children }),
|
|
1621
|
+
/* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(TooltipContent, { ref: forwardedRef, sideOffset: 8, ...restProps, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: label || description }) }) })
|
|
1622
|
+
]
|
|
1623
|
+
}
|
|
1624
|
+
);
|
|
1625
|
+
}
|
|
1626
|
+
);
|
|
1627
|
+
const TooltipContent = styled(Tooltip.Content)`
|
|
1628
|
+
background-color: ${(props) => props.theme.colors.neutral900};
|
|
1629
|
+
color: ${(props) => props.theme.colors.neutral0};
|
|
1630
|
+
padding-inline: ${(props) => props.theme.spaces[2]};
|
|
1631
|
+
padding-block: ${(props) => props.theme.spaces[2]};
|
|
1632
|
+
border-radius: ${(props) => props.theme.borderRadius};
|
|
1633
|
+
z-index: ${(props) => props.theme.zIndices.tooltip};
|
|
1634
|
+
will-change: opacity;
|
|
1635
|
+
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
1636
|
+
|
|
1637
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1638
|
+
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
1639
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
1640
|
+
}
|
|
1641
|
+
`;
|
|
1642
|
+
const IconButton = forwardRef(
|
|
1643
|
+
({
|
|
1644
|
+
label,
|
|
1645
|
+
background,
|
|
1646
|
+
children,
|
|
1647
|
+
disabled = false,
|
|
1648
|
+
onClick,
|
|
1649
|
+
size = "S",
|
|
1650
|
+
variant: variant2 = "tertiary",
|
|
1651
|
+
withTooltip = true,
|
|
1652
|
+
...restProps
|
|
1653
|
+
}, ref) => {
|
|
1654
|
+
const handleClick = (e) => {
|
|
1655
|
+
if (!disabled && onClick) {
|
|
1656
|
+
onClick(e);
|
|
1657
|
+
}
|
|
1658
|
+
};
|
|
1659
|
+
const component = /* @__PURE__ */ jsx(
|
|
1660
|
+
IconButtonWrapper,
|
|
1661
|
+
{
|
|
1662
|
+
"aria-disabled": disabled,
|
|
1663
|
+
background: disabled ? "neutral150" : background,
|
|
1664
|
+
tag: "button",
|
|
1665
|
+
display: "inline-flex",
|
|
1666
|
+
justifyContent: "center",
|
|
1667
|
+
hasRadius: true,
|
|
1668
|
+
cursor: "pointer",
|
|
1669
|
+
...restProps,
|
|
1670
|
+
ref,
|
|
1671
|
+
$size: size,
|
|
1672
|
+
onClick: handleClick,
|
|
1673
|
+
$variant: variant2,
|
|
1674
|
+
children: /* @__PURE__ */ jsx(AccessibleIcon, { label, children })
|
|
1675
|
+
}
|
|
1676
|
+
);
|
|
1677
|
+
return withTooltip ? /* @__PURE__ */ jsx(TooltipImpl, { label, children: component }) : component;
|
|
1678
|
+
}
|
|
1679
|
+
);
|
|
1680
|
+
const IconButtonWrapper = styled(Flex)`
|
|
1681
|
+
text-decoration: none;
|
|
1682
|
+
|
|
1683
|
+
${(props) => {
|
|
1684
|
+
switch (props.$size) {
|
|
1685
|
+
case "S": {
|
|
1686
|
+
return css`
|
|
1687
|
+
padding-block: 0.7rem;
|
|
1688
|
+
padding-inline: 0.7rem;
|
|
1689
|
+
`;
|
|
1690
|
+
}
|
|
1691
|
+
case "M": {
|
|
1692
|
+
return css`
|
|
1693
|
+
padding-block: 0.9rem;
|
|
1694
|
+
padding-inline: 0.9rem;
|
|
1695
|
+
`;
|
|
1696
|
+
}
|
|
1697
|
+
case "L": {
|
|
1698
|
+
return css`
|
|
1699
|
+
padding-block: 1.1rem;
|
|
1700
|
+
padding-inline: 1.1rem;
|
|
1701
|
+
`;
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
}}
|
|
1705
|
+
${getVariantStyle}
|
|
1706
|
+
${(props) => props.$variant === "tertiary" ? css`
|
|
1707
|
+
color: ${props.theme.colors.neutral500};
|
|
1708
|
+
` : ""}
|
|
1709
|
+
|
|
1710
|
+
&:hover {
|
|
1711
|
+
${getHoverStyle}
|
|
1712
|
+
${(props) => props.$variant === "tertiary" ? css`
|
|
1713
|
+
color: ${props.theme.colors.neutral600};
|
|
1714
|
+
` : ""}
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
&:active {
|
|
1718
|
+
${getActiveStyle}
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
&[aria-disabled='true'] {
|
|
1722
|
+
${getDisabledStyle}
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1726
|
+
transition:
|
|
1727
|
+
${(props) => props.theme.transitions.backgroundColor},
|
|
1728
|
+
${(props) => props.theme.transitions.color},
|
|
1729
|
+
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
1730
|
+
}
|
|
1731
|
+
`;
|
|
1732
|
+
const IconButtonGroup = styled(Flex)`
|
|
1733
|
+
& ${IconButtonWrapper}:first-child {
|
|
1734
|
+
border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
& ${IconButtonWrapper}:last-child {
|
|
1738
|
+
border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
& ${IconButtonWrapper} {
|
|
1742
|
+
border-radius: 0;
|
|
1743
|
+
|
|
1744
|
+
& + ${IconButtonWrapper} {
|
|
1745
|
+
border-left: none;
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
`;
|
|
1497
1749
|
const Link = forwardRef(
|
|
1498
1750
|
({ children, href, disabled = false, startIcon, endIcon, isExternal = false, ...props }, ref) => {
|
|
1499
1751
|
return /* @__PURE__ */ jsxs(LinkWrapper$1, { ref, href, disabled, isExternal, ...props, children: [
|
|
@@ -1520,7 +1772,7 @@ const LinkWrapper$1 = styled(BaseLinkImpl)`
|
|
|
1520
1772
|
}
|
|
1521
1773
|
|
|
1522
1774
|
&:hover {
|
|
1523
|
-
span {
|
|
1775
|
+
& > span {
|
|
1524
1776
|
color: ${({ theme }) => theme.colors.primary500};
|
|
1525
1777
|
}
|
|
1526
1778
|
}
|
|
@@ -1533,39 +1785,31 @@ const LinkWrapper$1 = styled(BaseLinkImpl)`
|
|
|
1533
1785
|
`;
|
|
1534
1786
|
const MenuRoot = DropdownMenu.Root;
|
|
1535
1787
|
const MenuTrigger = React.forwardRef(
|
|
1536
|
-
({
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
endIcon,
|
|
1544
|
-
paddingTop: size === "S" ? 1 : 2,
|
|
1545
|
-
paddingBottom: size === "S" ? 1 : 2,
|
|
1546
|
-
paddingLeft: size === "S" ? 3 : 4,
|
|
1547
|
-
paddingRight: size === "S" ? 3 : 4,
|
|
1548
|
-
...props
|
|
1549
|
-
}
|
|
1550
|
-
) });
|
|
1788
|
+
({ label, endIcon = /* @__PURE__ */ jsx(CaretDown, { width: "1.2rem", height: "1.2rem", "aria-hidden": true }), tag = Button, icon, ...rest }, ref) => {
|
|
1789
|
+
const props = {
|
|
1790
|
+
...rest,
|
|
1791
|
+
ref,
|
|
1792
|
+
type: "button"
|
|
1793
|
+
};
|
|
1794
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild: true, children: tag === IconButton ? /* @__PURE__ */ jsx(IconButton, { label, variant: "tertiary", ...props, children: icon }) : /* @__PURE__ */ jsx(Button, { endIcon, variant: "ghost", ...props }) });
|
|
1551
1795
|
}
|
|
1552
1796
|
);
|
|
1553
1797
|
const MenuContent = React.forwardRef(
|
|
1554
1798
|
({ children, intersectionId, popoverPlacement = "bottom-start", ...props }, ref) => {
|
|
1555
1799
|
const [side, align] = popoverPlacement.split("-");
|
|
1556
|
-
return /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx(
|
|
1800
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx(DropdownMenuContent, { align, side, loop: true, asChild: true, children: /* @__PURE__ */ jsxs(
|
|
1557
1801
|
Viewport$2,
|
|
1558
1802
|
{
|
|
1559
1803
|
ref,
|
|
1560
1804
|
direction: "column",
|
|
1561
|
-
borderStyle: "solid",
|
|
1562
|
-
borderWidth: "1px",
|
|
1563
1805
|
borderColor: "neutral150",
|
|
1564
1806
|
hasRadius: true,
|
|
1565
1807
|
background: "neutral0",
|
|
1566
1808
|
shadow: "filterShadow",
|
|
1567
1809
|
maxHeight: "15rem",
|
|
1568
1810
|
padding: 1,
|
|
1811
|
+
marginTop: 1,
|
|
1812
|
+
marginBottom: 1,
|
|
1569
1813
|
alignItems: "flex-start",
|
|
1570
1814
|
position: "relative",
|
|
1571
1815
|
overflow: "auto",
|
|
@@ -1587,6 +1831,23 @@ const Viewport$2 = styled(Flex)`
|
|
|
1587
1831
|
display: none;
|
|
1588
1832
|
}
|
|
1589
1833
|
`;
|
|
1834
|
+
const DropdownMenuContent = styled(DropdownMenu.Content)`
|
|
1835
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1836
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
1837
|
+
|
|
1838
|
+
&[data-state='open'] {
|
|
1839
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
1840
|
+
|
|
1841
|
+
&[data-side='top'] {
|
|
1842
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
&[data-side='bottom'] {
|
|
1846
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
`;
|
|
1590
1851
|
const MenuItem$1 = ({ onSelect, disabled = false, isLink, ...props }) => {
|
|
1591
1852
|
return /* @__PURE__ */ jsx(DropdownMenu.Item, { asChild: true, onSelect, disabled, children: isLink || props.isExternal ? /* @__PURE__ */ jsx(OptionLink, { color: "neutral800", ...props, isExternal: props.isExternal ?? false, children: /* @__PURE__ */ jsx(Typography, { children: props.children }) }) : /* @__PURE__ */ jsx(OptionButton, { cursor: "pointer", color: "neutral800", background: "transparent", borderStyle: "none", ...props, children: /* @__PURE__ */ jsx(Typography, { children: props.children }) }) });
|
|
1592
1853
|
};
|
|
@@ -1596,7 +1857,7 @@ const getOptionStyle = ({ theme }) => css`
|
|
|
1596
1857
|
border-radius: ${theme.borderRadius};
|
|
1597
1858
|
padding: ${theme.spaces[2]} ${theme.spaces[4]};
|
|
1598
1859
|
|
|
1599
|
-
&[aria-disabled] {
|
|
1860
|
+
&[aria-disabled='true'] {
|
|
1600
1861
|
cursor: not-allowed;
|
|
1601
1862
|
color: ${theme.colors.neutral500};
|
|
1602
1863
|
}
|
|
@@ -1869,12 +2130,6 @@ const CheckboxRoot = styled(Checkbox.Root)`
|
|
|
1869
2130
|
// this ensures the checkbox is always a square even in flex-containers.
|
|
1870
2131
|
flex: 0 0 2rem;
|
|
1871
2132
|
|
|
1872
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
1873
|
-
transition:
|
|
1874
|
-
border-color ${(props) => props.theme.motion.timings["120"]} ${(props) => props.theme.motion.easings.easeOutQuad},
|
|
1875
|
-
${(props) => props.theme.transitions.backgroundColor};
|
|
1876
|
-
}
|
|
1877
|
-
|
|
1878
2133
|
&[data-state='checked'],
|
|
1879
2134
|
&[data-state='indeterminate'] {
|
|
1880
2135
|
border: 1px solid ${(props) => props.theme.colors.primary600};
|
|
@@ -1963,49 +2218,6 @@ const KeyboardKeys = {
|
|
|
1963
2218
|
BACKSPACE: "Backspace",
|
|
1964
2219
|
CLEAR: "Clear"
|
|
1965
2220
|
};
|
|
1966
|
-
const TooltipImpl = React.forwardRef(
|
|
1967
|
-
({
|
|
1968
|
-
children,
|
|
1969
|
-
description,
|
|
1970
|
-
label,
|
|
1971
|
-
defaultOpen,
|
|
1972
|
-
open,
|
|
1973
|
-
onOpenChange,
|
|
1974
|
-
delayDuration = 500,
|
|
1975
|
-
disableHoverableContent,
|
|
1976
|
-
...restProps
|
|
1977
|
-
}, forwardedRef) => {
|
|
1978
|
-
return /* @__PURE__ */ jsxs(
|
|
1979
|
-
Tooltip.Root,
|
|
1980
|
-
{
|
|
1981
|
-
defaultOpen,
|
|
1982
|
-
open,
|
|
1983
|
-
onOpenChange,
|
|
1984
|
-
delayDuration,
|
|
1985
|
-
disableHoverableContent,
|
|
1986
|
-
children: [
|
|
1987
|
-
/* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children }),
|
|
1988
|
-
/* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(TooltipContent, { ref: forwardedRef, sideOffset: 8, ...restProps, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: label || description }) }) })
|
|
1989
|
-
]
|
|
1990
|
-
}
|
|
1991
|
-
);
|
|
1992
|
-
}
|
|
1993
|
-
);
|
|
1994
|
-
const TooltipContent = styled(Tooltip.Content)`
|
|
1995
|
-
background-color: ${(props) => props.theme.colors.neutral900};
|
|
1996
|
-
color: ${(props) => props.theme.colors.neutral0};
|
|
1997
|
-
padding-inline: ${(props) => props.theme.spaces[2]};
|
|
1998
|
-
padding-block: ${(props) => props.theme.spaces[2]};
|
|
1999
|
-
border-radius: ${(props) => props.theme.borderRadius};
|
|
2000
|
-
z-index: ${(props) => props.theme.zIndices.tooltip};
|
|
2001
|
-
will-change: opacity;
|
|
2002
|
-
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
2003
|
-
|
|
2004
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
2005
|
-
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
2006
|
-
${(props) => props.theme.motion.easings.authenticMotion};
|
|
2007
|
-
}
|
|
2008
|
-
`;
|
|
2009
2221
|
const CarouselGrid = styled(Box)`
|
|
2010
2222
|
grid-template-columns: auto 1fr auto;
|
|
2011
2223
|
grid-template-areas: 'startAction slides endAction';
|
|
@@ -2100,9 +2312,11 @@ const commonTheme = {
|
|
|
2100
2312
|
},
|
|
2101
2313
|
spaces: ["0px", "4px", "8px", "12px", "16px", "20px", "24px", "32px", "40px", "48px", "56px", "64px"],
|
|
2102
2314
|
borderRadius: "4px",
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2315
|
+
breakpoints: {
|
|
2316
|
+
initial: "@media(min-width: 0px)",
|
|
2317
|
+
small: "@media(min-width: 520px)",
|
|
2318
|
+
medium: "@media(min-width: 768px)",
|
|
2319
|
+
large: "@media(min-width: 1280px)"
|
|
2106
2320
|
},
|
|
2107
2321
|
fontSizes: [`1.1rem`, `1.2rem`, `1.4rem`, "1.6rem", `1.8rem`, `3.2rem`],
|
|
2108
2322
|
lineHeights: [1.14, 1.22, 1.25, 1.33, 1.43, 1.45, 1.5],
|
|
@@ -7806,10 +8020,9 @@ const Label = React.forwardRef(({ children, action, ...props }, ref) => {
|
|
|
7806
8020
|
return null;
|
|
7807
8021
|
}
|
|
7808
8022
|
return /* @__PURE__ */ jsxs(
|
|
7809
|
-
|
|
8023
|
+
TypographyLabel,
|
|
7810
8024
|
{
|
|
7811
8025
|
ref: composedRefs,
|
|
7812
|
-
display: "flex",
|
|
7813
8026
|
variant: "pi",
|
|
7814
8027
|
textColor: "neutral800",
|
|
7815
8028
|
fontWeight: "bold",
|
|
@@ -7817,6 +8030,7 @@ const Label = React.forwardRef(({ children, action, ...props }, ref) => {
|
|
|
7817
8030
|
id: `${id}-label`,
|
|
7818
8031
|
htmlFor: id,
|
|
7819
8032
|
tag: "label",
|
|
8033
|
+
ellipsis: true,
|
|
7820
8034
|
children: [
|
|
7821
8035
|
children,
|
|
7822
8036
|
required && /* @__PURE__ */ jsx(Typography, { "aria-hidden": true, lineHeight: "1em", textColor: "danger600", children: "*" }),
|
|
@@ -7825,6 +8039,9 @@ const Label = React.forwardRef(({ children, action, ...props }, ref) => {
|
|
|
7825
8039
|
}
|
|
7826
8040
|
);
|
|
7827
8041
|
});
|
|
8042
|
+
const TypographyLabel = styled(Typography)`
|
|
8043
|
+
display: flex;
|
|
8044
|
+
`;
|
|
7828
8045
|
const LabelAction = styled(Flex)`
|
|
7829
8046
|
line-height: 0;
|
|
7830
8047
|
color: ${({ theme }) => theme.colors.neutral500};
|
|
@@ -7849,11 +8066,24 @@ const Input$2 = React.forwardRef(
|
|
|
7849
8066
|
ariaDescription = `${id}-hint`;
|
|
7850
8067
|
}
|
|
7851
8068
|
const hasError = Boolean(error);
|
|
8069
|
+
const endActionRef = React.useRef(null);
|
|
8070
|
+
const inputElementRef = React.useRef(null);
|
|
8071
|
+
const inputRef = useComposedRefs(inputElementRef, ref);
|
|
7852
8072
|
const handleChange = (e) => {
|
|
7853
8073
|
if (!disabled && onChange) {
|
|
7854
8074
|
onChange(e);
|
|
7855
8075
|
}
|
|
7856
8076
|
};
|
|
8077
|
+
React.useLayoutEffect(() => {
|
|
8078
|
+
if (endActionRef.current && inputElementRef.current) {
|
|
8079
|
+
const endActionWidth = endActionRef.current.offsetWidth;
|
|
8080
|
+
const inputElement = inputElementRef.current;
|
|
8081
|
+
if (inputElement) {
|
|
8082
|
+
const inputPadding = endActionWidth + 8 + 16;
|
|
8083
|
+
inputElement.style.paddingRight = `${inputPadding}px`;
|
|
8084
|
+
}
|
|
8085
|
+
}
|
|
8086
|
+
}, [endAction]);
|
|
7857
8087
|
return /* @__PURE__ */ jsxs(
|
|
7858
8088
|
InputWrapper,
|
|
7859
8089
|
{
|
|
@@ -7872,7 +8102,7 @@ const Input$2 = React.forwardRef(
|
|
|
7872
8102
|
{
|
|
7873
8103
|
id,
|
|
7874
8104
|
name,
|
|
7875
|
-
ref,
|
|
8105
|
+
ref: inputRef,
|
|
7876
8106
|
$size: size,
|
|
7877
8107
|
"aria-describedby": ariaDescription,
|
|
7878
8108
|
"aria-invalid": hasError || hasErrorProp,
|
|
@@ -7881,10 +8111,12 @@ const Input$2 = React.forwardRef(
|
|
|
7881
8111
|
"data-disabled": disabled ? "" : void 0,
|
|
7882
8112
|
onChange: handleChange,
|
|
7883
8113
|
"aria-required": required || requiredProp,
|
|
8114
|
+
$hasLeftAction: Boolean(startAction),
|
|
8115
|
+
$hasRightAction: Boolean(endAction),
|
|
7884
8116
|
...props
|
|
7885
8117
|
}
|
|
7886
8118
|
),
|
|
7887
|
-
endAction
|
|
8119
|
+
endAction && /* @__PURE__ */ jsx(EndAction, { ref: endActionRef, children: endAction })
|
|
7888
8120
|
]
|
|
7889
8121
|
}
|
|
7890
8122
|
);
|
|
@@ -7903,19 +8135,6 @@ const InputElement = styled.input`
|
|
|
7903
8135
|
width: 100%;
|
|
7904
8136
|
background: inherit;
|
|
7905
8137
|
|
|
7906
|
-
${(props) => {
|
|
7907
|
-
switch (props.$size) {
|
|
7908
|
-
case "S":
|
|
7909
|
-
return css`
|
|
7910
|
-
padding-block: ${props.theme.spaces[1]};
|
|
7911
|
-
`;
|
|
7912
|
-
default:
|
|
7913
|
-
return css`
|
|
7914
|
-
padding-block: ${props.theme.spaces[2]};
|
|
7915
|
-
`;
|
|
7916
|
-
}
|
|
7917
|
-
}};
|
|
7918
|
-
|
|
7919
8138
|
::placeholder {
|
|
7920
8139
|
color: ${({ theme }) => theme.colors.neutral500};
|
|
7921
8140
|
opacity: 1;
|
|
@@ -7930,32 +8149,42 @@ const InputElement = styled.input`
|
|
|
7930
8149
|
outline: none;
|
|
7931
8150
|
box-shadow: none;
|
|
7932
8151
|
}
|
|
7933
|
-
`;
|
|
7934
|
-
const InputWrapper = styled(Flex)`
|
|
7935
|
-
border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
|
7936
|
-
border-radius: ${({ theme }) => theme.borderRadius};
|
|
7937
|
-
background: ${({ theme }) => theme.colors.neutral0};
|
|
7938
|
-
${inputFocusStyle()}
|
|
7939
8152
|
|
|
7940
8153
|
${(props) => {
|
|
7941
8154
|
switch (props.$size) {
|
|
7942
8155
|
case "S":
|
|
7943
8156
|
return css`
|
|
7944
|
-
padding-inline-start: ${props.$hasLeftAction ?
|
|
7945
|
-
padding-inline-end: ${props.$hasRightAction ?
|
|
8157
|
+
padding-inline-start: ${props.$hasLeftAction ? 0 : props.theme.spaces[4]};
|
|
8158
|
+
padding-inline-end: ${props.$hasRightAction ? 0 : props.theme.spaces[4]};
|
|
8159
|
+
padding-block: ${props.theme.spaces[1]};
|
|
7946
8160
|
`;
|
|
7947
8161
|
default:
|
|
7948
8162
|
return css`
|
|
7949
|
-
padding-inline-start: ${props.$hasLeftAction ?
|
|
7950
|
-
padding-inline-end: ${props.$hasRightAction ?
|
|
8163
|
+
padding-inline-start: ${props.$hasLeftAction ? 0 : props.theme.spaces[4]};
|
|
8164
|
+
padding-inline-end: ${props.$hasRightAction ? 0 : props.theme.spaces[4]};
|
|
8165
|
+
padding-block: ${props.theme.spaces[2]};
|
|
7951
8166
|
`;
|
|
7952
8167
|
}
|
|
7953
8168
|
}}
|
|
8169
|
+
`;
|
|
8170
|
+
const EndAction = styled(Flex)`
|
|
8171
|
+
position: absolute;
|
|
8172
|
+
right: ${({ theme }) => theme.spaces[4]};
|
|
8173
|
+
top: 50%;
|
|
8174
|
+
transform: translateY(-50%);
|
|
8175
|
+
`;
|
|
8176
|
+
const InputWrapper = styled(Flex)`
|
|
8177
|
+
border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
|
8178
|
+
border-radius: ${({ theme }) => theme.borderRadius};
|
|
8179
|
+
background: ${({ theme }) => theme.colors.neutral0};
|
|
8180
|
+
padding-inline-start: ${({ $hasLeftAction, theme }) => $hasLeftAction ? theme.spaces[4] : 0};
|
|
8181
|
+
position: relative;
|
|
7954
8182
|
|
|
8183
|
+
${inputFocusStyle()}
|
|
7955
8184
|
${({ theme, $disabled }) => $disabled ? css`
|
|
7956
8185
|
color: ${theme.colors.neutral600};
|
|
7957
8186
|
background: ${theme.colors.neutral150};
|
|
7958
|
-
` : void 0}
|
|
8187
|
+
` : void 0};
|
|
7959
8188
|
`;
|
|
7960
8189
|
const Hint = () => {
|
|
7961
8190
|
const { id, hint, error } = useField("Hint");
|
|
@@ -8236,7 +8465,7 @@ const Combobox = React.forwardRef(
|
|
|
8236
8465
|
children: [
|
|
8237
8466
|
/* @__PURE__ */ jsxs(Trigger$5, { $hasError: hasError, $size: size, className, children: [
|
|
8238
8467
|
/* @__PURE__ */ jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
|
|
8239
|
-
startIcon ? /* @__PURE__ */ jsx(
|
|
8468
|
+
startIcon ? /* @__PURE__ */ jsx(Flex, { flex: "0 0 1.6rem", tag: "span", "aria-hidden": true, children: startIcon }) : null,
|
|
8240
8469
|
/* @__PURE__ */ jsx(
|
|
8241
8470
|
TextInput$1,
|
|
8242
8471
|
{
|
|
@@ -8270,7 +8499,7 @@ const Combobox = React.forwardRef(
|
|
|
8270
8499
|
children: /* @__PURE__ */ jsx(Cross, {})
|
|
8271
8500
|
}
|
|
8272
8501
|
) : null,
|
|
8273
|
-
/* @__PURE__ */ jsx(DownIcon$1, { children: /* @__PURE__ */ jsx(CaretDown, {}) })
|
|
8502
|
+
/* @__PURE__ */ jsx(DownIcon$1, { children: /* @__PURE__ */ jsx(CaretDown, { fill: "neutral500" }) })
|
|
8274
8503
|
] })
|
|
8275
8504
|
] }),
|
|
8276
8505
|
/* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(Content$5, { sideOffset: 4, children: /* @__PURE__ */ jsxs(Viewport$1, { ref: viewportRef, children: [
|
|
@@ -8359,6 +8588,7 @@ const DownIcon$1 = styled(Combobox$1.Icon)`
|
|
|
8359
8588
|
background: transparent;
|
|
8360
8589
|
padding: 0;
|
|
8361
8590
|
color: ${({ theme }) => theme.colors.neutral600};
|
|
8591
|
+
display: flex;
|
|
8362
8592
|
|
|
8363
8593
|
&[aria-disabled='true'] {
|
|
8364
8594
|
cursor: inherit;
|
|
@@ -8382,11 +8612,11 @@ const Content$5 = styled(Combobox$1.Content)`
|
|
|
8382
8612
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8383
8613
|
|
|
8384
8614
|
&[data-side='top'] {
|
|
8385
|
-
animation-name: ${ANIMATIONS.
|
|
8615
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
8386
8616
|
}
|
|
8387
8617
|
|
|
8388
8618
|
&[data-side='bottom'] {
|
|
8389
|
-
animation-name: ${ANIMATIONS.
|
|
8619
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
8390
8620
|
}
|
|
8391
8621
|
}
|
|
8392
8622
|
}
|
|
@@ -8830,6 +9060,7 @@ const SelectTrigger = React.forwardRef(
|
|
|
8830
9060
|
);
|
|
8831
9061
|
const IconBox$2 = styled(Box)`
|
|
8832
9062
|
border: none;
|
|
9063
|
+
display: flex;
|
|
8833
9064
|
|
|
8834
9065
|
svg {
|
|
8835
9066
|
height: 1.1rem;
|
|
@@ -8837,7 +9068,7 @@ const IconBox$2 = styled(Box)`
|
|
|
8837
9068
|
}
|
|
8838
9069
|
|
|
8839
9070
|
svg path {
|
|
8840
|
-
fill: ${({ theme }) => theme.colors.
|
|
9071
|
+
fill: ${({ theme }) => theme.colors.neutral500};
|
|
8841
9072
|
}
|
|
8842
9073
|
`;
|
|
8843
9074
|
const StyledTrigger = styled(Flex)`
|
|
@@ -8860,7 +9091,7 @@ const StyledTrigger = styled(Flex)`
|
|
|
8860
9091
|
}}
|
|
8861
9092
|
|
|
8862
9093
|
&[aria-disabled='true'] {
|
|
8863
|
-
color: ${(props) => props.theme.colors.
|
|
9094
|
+
color: ${(props) => props.theme.colors.neutral500};
|
|
8864
9095
|
}
|
|
8865
9096
|
|
|
8866
9097
|
/* Required to ensure the below inputFocusStyles are adhered too */
|
|
@@ -8871,8 +9102,9 @@ const StyledTrigger = styled(Flex)`
|
|
|
8871
9102
|
${({ theme, $hasError }) => inputFocusStyle()({ theme, $hasError })};
|
|
8872
9103
|
`;
|
|
8873
9104
|
const DownIcon = styled(Select.Icon)`
|
|
9105
|
+
display: flex;
|
|
8874
9106
|
& > svg {
|
|
8875
|
-
fill: ${({ theme }) => theme.colors.
|
|
9107
|
+
fill: ${({ theme }) => theme.colors.neutral500};
|
|
8876
9108
|
}
|
|
8877
9109
|
`;
|
|
8878
9110
|
const SelectValue = React.forwardRef(({ children, placeholder, ...restProps }, ref) => /* @__PURE__ */ jsx(ValueType, { ref, ellipsis: true, ...restProps, children: /* @__PURE__ */ jsx(StyledValue, { placeholder, children }) }));
|
|
@@ -8903,11 +9135,11 @@ const SelectContent = styled(Select.Content)`
|
|
|
8903
9135
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8904
9136
|
|
|
8905
9137
|
&[data-side='top'] {
|
|
8906
|
-
animation-name: ${ANIMATIONS.
|
|
9138
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
8907
9139
|
}
|
|
8908
9140
|
|
|
8909
9141
|
&[data-side='bottom'] {
|
|
8910
|
-
animation-name: ${ANIMATIONS.
|
|
9142
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
8911
9143
|
}
|
|
8912
9144
|
}
|
|
8913
9145
|
}
|
|
@@ -9565,7 +9797,7 @@ const DatePickerContentImpl = React.forwardRef(
|
|
|
9565
9797
|
(props, forwardedRef) => {
|
|
9566
9798
|
const { label = "Choose date", ...restProps } = props;
|
|
9567
9799
|
const { onOpenChange, ...context } = useDatePickerContext(CONTENT_IMPL_NAME);
|
|
9568
|
-
const { x, y, refs, strategy } = useFloating({
|
|
9800
|
+
const { x, y, refs, strategy, placement } = useFloating({
|
|
9569
9801
|
strategy: "fixed",
|
|
9570
9802
|
placement: "bottom-start",
|
|
9571
9803
|
middleware: [
|
|
@@ -9612,6 +9844,7 @@ const DatePickerContentImpl = React.forwardRef(
|
|
|
9612
9844
|
{
|
|
9613
9845
|
ref: composedRefs,
|
|
9614
9846
|
"data-state": context.open ? "open" : "closed",
|
|
9847
|
+
"data-side": placement.includes("top") ? "top" : "bottom",
|
|
9615
9848
|
onContextMenu: (event) => event.preventDefault(),
|
|
9616
9849
|
id: context.contentId,
|
|
9617
9850
|
role: "dialog",
|
|
@@ -9636,6 +9869,22 @@ const ContentElement = styled(Box)`
|
|
|
9636
9869
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
|
9637
9870
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
9638
9871
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
9872
|
+
|
|
9873
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
9874
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
9875
|
+
|
|
9876
|
+
&[data-state='open'] {
|
|
9877
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
9878
|
+
|
|
9879
|
+
&[data-side='top'] {
|
|
9880
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
9881
|
+
}
|
|
9882
|
+
|
|
9883
|
+
&[data-side='bottom'] {
|
|
9884
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
9885
|
+
}
|
|
9886
|
+
}
|
|
9887
|
+
}
|
|
9639
9888
|
`;
|
|
9640
9889
|
const DATE_PICKER_CALENDAR_NAME = "DatePickerCalendar";
|
|
9641
9890
|
const DatePickerCalendar = React.forwardRef(
|
|
@@ -10048,250 +10297,44 @@ const Divider = React.forwardRef((props, forwardedRef) => {
|
|
|
10048
10297
|
ref: forwardedRef,
|
|
10049
10298
|
background: "neutral150",
|
|
10050
10299
|
...props,
|
|
10051
|
-
"data-orientation": "horizontal",
|
|
10052
|
-
role: "separator",
|
|
10053
|
-
tag: "div"
|
|
10054
|
-
}
|
|
10055
|
-
);
|
|
10056
|
-
});
|
|
10057
|
-
const DividerImpl = styled(Box)`
|
|
10058
|
-
height: 1px;
|
|
10059
|
-
border: none;
|
|
10060
|
-
/* If contained in a Flex parent we want to prevent the Divider to shink */
|
|
10061
|
-
flex-shrink: 0;
|
|
10062
|
-
`;
|
|
10063
|
-
const EmptyStateIconWrapper = styled(Box)`
|
|
10064
|
-
svg {
|
|
10065
|
-
height: 8.8rem;
|
|
10066
|
-
}
|
|
10067
|
-
`;
|
|
10068
|
-
const EmptyStateLayout = React.forwardRef(
|
|
10069
|
-
({ icon, content, action, hasRadius = true, shadow = "tableShadow" }, forwardedRef) => {
|
|
10070
|
-
return /* @__PURE__ */ jsxs(
|
|
10071
|
-
Flex,
|
|
10072
|
-
{
|
|
10073
|
-
ref: forwardedRef,
|
|
10074
|
-
alignItems: "center",
|
|
10075
|
-
direction: "column",
|
|
10076
|
-
padding: 11,
|
|
10077
|
-
background: "neutral0",
|
|
10078
|
-
hasRadius,
|
|
10079
|
-
shadow,
|
|
10080
|
-
children: [
|
|
10081
|
-
icon ? /* @__PURE__ */ jsx(EmptyStateIconWrapper, { paddingBottom: 6, "aria-hidden": true, children: icon }) : null,
|
|
10082
|
-
/* @__PURE__ */ jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsx(Typography, { variant: "delta", tag: "p", textAlign: "center", textColor: "neutral600", children: content }) }),
|
|
10083
|
-
action
|
|
10084
|
-
]
|
|
10085
|
-
}
|
|
10086
|
-
);
|
|
10087
|
-
}
|
|
10088
|
-
);
|
|
10089
|
-
const getFocusableNodes = (node, includeNegativeTabIndex) => {
|
|
10090
|
-
const nodes = [
|
|
10091
|
-
...node.querySelectorAll(
|
|
10092
|
-
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
10093
|
-
)
|
|
10094
|
-
];
|
|
10095
|
-
const focusables = nodes.filter((node2) => {
|
|
10096
|
-
if (node2.hasAttribute("disabled"))
|
|
10097
|
-
return false;
|
|
10098
|
-
if (includeNegativeTabIndex)
|
|
10099
|
-
return true;
|
|
10100
|
-
return node2.getAttribute("tabindex") !== "-1";
|
|
10101
|
-
});
|
|
10102
|
-
return focusables;
|
|
10103
|
-
};
|
|
10104
|
-
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
10105
|
-
return nodes.filter((node) => {
|
|
10106
|
-
if (node.tagName === "INPUT") {
|
|
10107
|
-
return node.type !== "checkbox" && node.type !== "radio";
|
|
10108
|
-
}
|
|
10109
|
-
return false;
|
|
10110
|
-
});
|
|
10111
|
-
};
|
|
10112
|
-
const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
|
|
10113
|
-
const trappedRef = React.useRef(null);
|
|
10114
|
-
React.useEffect(() => {
|
|
10115
|
-
let currentFocus = null;
|
|
10116
|
-
if (restoreFocus) {
|
|
10117
|
-
currentFocus = document.activeElement;
|
|
10118
|
-
}
|
|
10119
|
-
return () => {
|
|
10120
|
-
if (currentFocus) {
|
|
10121
|
-
currentFocus.focus();
|
|
10122
|
-
}
|
|
10123
|
-
};
|
|
10124
|
-
}, [restoreFocus]);
|
|
10125
|
-
React.useEffect(() => {
|
|
10126
|
-
if (!trappedRef.current || skipAutoFocus)
|
|
10127
|
-
return;
|
|
10128
|
-
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
10129
|
-
if (focusableChildren.length > 0) {
|
|
10130
|
-
const firstElement = focusableChildren[0];
|
|
10131
|
-
firstElement.focus();
|
|
10132
|
-
} else {
|
|
10133
|
-
console.warn(
|
|
10134
|
-
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
10135
|
-
);
|
|
10136
|
-
}
|
|
10137
|
-
}, [skipAutoFocus]);
|
|
10138
|
-
const handleKeyDown = (e) => {
|
|
10139
|
-
if (e.key === KeyboardKeys.ESCAPE && onEscape) {
|
|
10140
|
-
onEscape();
|
|
10141
|
-
return;
|
|
10142
|
-
}
|
|
10143
|
-
if (e.key !== KeyboardKeys.TAB)
|
|
10144
|
-
return;
|
|
10145
|
-
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
10146
|
-
if (focusableChildren.length > 0) {
|
|
10147
|
-
const firstElement = focusableChildren[0];
|
|
10148
|
-
const lastElement = focusableChildren[focusableChildren.length - 1];
|
|
10149
|
-
if (e.shiftKey) {
|
|
10150
|
-
if (firstElement === document.activeElement) {
|
|
10151
|
-
e.preventDefault();
|
|
10152
|
-
lastElement.focus();
|
|
10153
|
-
}
|
|
10154
|
-
} else if (lastElement === document.activeElement) {
|
|
10155
|
-
e.preventDefault();
|
|
10156
|
-
firstElement.focus();
|
|
10157
|
-
}
|
|
10300
|
+
"data-orientation": "horizontal",
|
|
10301
|
+
role: "separator",
|
|
10302
|
+
tag: "div"
|
|
10158
10303
|
}
|
|
10159
|
-
|
|
10160
|
-
return /* @__PURE__ */ jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
|
|
10161
|
-
};
|
|
10162
|
-
const Root$3 = forwardRef((props, forwardedRef) => {
|
|
10163
|
-
const { gap = 0, gridCols = 12, ...rest } = props;
|
|
10164
|
-
return /* @__PURE__ */ jsx(Wrapper$1, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
|
|
10304
|
+
);
|
|
10165
10305
|
});
|
|
10166
|
-
const
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10306
|
+
const DividerImpl = styled(Box)`
|
|
10307
|
+
height: 1px;
|
|
10308
|
+
border: none;
|
|
10309
|
+
/* If contained in a Flex parent we want to prevent the Divider to shink */
|
|
10310
|
+
flex-shrink: 0;
|
|
10170
10311
|
`;
|
|
10171
|
-
const
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
const Item$1 = styled(Flex)`
|
|
10175
|
-
grid-column: span ${({ $col }) => $col ?? 1};
|
|
10176
|
-
max-width: 100%;
|
|
10177
|
-
|
|
10178
|
-
${({ theme }) => theme.mediaQueries.tablet} {
|
|
10179
|
-
grid-column: span ${({ $s }) => $s};
|
|
10180
|
-
}
|
|
10181
|
-
|
|
10182
|
-
${({ theme }) => theme.mediaQueries.mobile} {
|
|
10183
|
-
grid-column: span ${({ $xs }) => $xs};
|
|
10312
|
+
const EmptyStateIconWrapper = styled(Box)`
|
|
10313
|
+
svg {
|
|
10314
|
+
height: 8.8rem;
|
|
10184
10315
|
}
|
|
10185
10316
|
`;
|
|
10186
|
-
const
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
10191
|
-
const IconButton = forwardRef(
|
|
10192
|
-
({
|
|
10193
|
-
label,
|
|
10194
|
-
background,
|
|
10195
|
-
children,
|
|
10196
|
-
disabled = false,
|
|
10197
|
-
onClick,
|
|
10198
|
-
size = "M",
|
|
10199
|
-
variant: variant2 = "tertiary",
|
|
10200
|
-
withTooltip = true,
|
|
10201
|
-
...restProps
|
|
10202
|
-
}, ref) => {
|
|
10203
|
-
const handleClick = (e) => {
|
|
10204
|
-
if (!disabled && onClick) {
|
|
10205
|
-
onClick(e);
|
|
10206
|
-
}
|
|
10207
|
-
};
|
|
10208
|
-
const component = /* @__PURE__ */ jsx(
|
|
10209
|
-
IconButtonWrapper,
|
|
10317
|
+
const EmptyStateLayout = React.forwardRef(
|
|
10318
|
+
({ icon, content, action, hasRadius = true, shadow = "tableShadow" }, forwardedRef) => {
|
|
10319
|
+
return /* @__PURE__ */ jsxs(
|
|
10320
|
+
Flex,
|
|
10210
10321
|
{
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
|
|
10215
|
-
|
|
10216
|
-
hasRadius
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
|
|
10223
|
-
children: /* @__PURE__ */ jsx(AccessibleIcon, { label, children })
|
|
10322
|
+
ref: forwardedRef,
|
|
10323
|
+
alignItems: "center",
|
|
10324
|
+
direction: "column",
|
|
10325
|
+
padding: 11,
|
|
10326
|
+
background: "neutral0",
|
|
10327
|
+
hasRadius,
|
|
10328
|
+
shadow,
|
|
10329
|
+
children: [
|
|
10330
|
+
icon ? /* @__PURE__ */ jsx(EmptyStateIconWrapper, { paddingBottom: 6, "aria-hidden": true, children: icon }) : null,
|
|
10331
|
+
/* @__PURE__ */ jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsx(Typography, { variant: "delta", tag: "p", textAlign: "center", textColor: "neutral600", children: content }) }),
|
|
10332
|
+
action
|
|
10333
|
+
]
|
|
10224
10334
|
}
|
|
10225
10335
|
);
|
|
10226
|
-
return withTooltip ? /* @__PURE__ */ jsx(TooltipImpl, { label, children: component }) : component;
|
|
10227
10336
|
}
|
|
10228
10337
|
);
|
|
10229
|
-
const IconButtonWrapper = styled(Flex)`
|
|
10230
|
-
text-decoration: none;
|
|
10231
|
-
|
|
10232
|
-
${(props) => {
|
|
10233
|
-
switch (props.$size) {
|
|
10234
|
-
case "S": {
|
|
10235
|
-
return css`
|
|
10236
|
-
padding-block: 0.6rem;
|
|
10237
|
-
padding-inline: 0.6rem;
|
|
10238
|
-
`;
|
|
10239
|
-
}
|
|
10240
|
-
case "M": {
|
|
10241
|
-
return css`
|
|
10242
|
-
padding-block: 0.9rem;
|
|
10243
|
-
padding-inline: 0.9rem;
|
|
10244
|
-
`;
|
|
10245
|
-
}
|
|
10246
|
-
case "L": {
|
|
10247
|
-
return css`
|
|
10248
|
-
padding-block: 1.1rem;
|
|
10249
|
-
padding-inline: 1.1rem;
|
|
10250
|
-
`;
|
|
10251
|
-
}
|
|
10252
|
-
}
|
|
10253
|
-
}}
|
|
10254
|
-
${getVariantStyle}
|
|
10255
|
-
${(props) => props.$variant === "tertiary" ? css`
|
|
10256
|
-
color: ${props.theme.colors.neutral600};
|
|
10257
|
-
` : ""}
|
|
10258
|
-
|
|
10259
|
-
&:hover {
|
|
10260
|
-
${getHoverStyle}
|
|
10261
|
-
}
|
|
10262
|
-
|
|
10263
|
-
&:active {
|
|
10264
|
-
${getActiveStyle}
|
|
10265
|
-
}
|
|
10266
|
-
|
|
10267
|
-
&[aria-disabled='true'] {
|
|
10268
|
-
${getDisabledStyle}
|
|
10269
|
-
}
|
|
10270
|
-
|
|
10271
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
10272
|
-
transition:
|
|
10273
|
-
${(props) => props.theme.transitions.backgroundColor},
|
|
10274
|
-
${(props) => props.theme.transitions.color},
|
|
10275
|
-
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
10276
|
-
}
|
|
10277
|
-
`;
|
|
10278
|
-
const IconButtonGroup = styled(Flex)`
|
|
10279
|
-
& ${IconButtonWrapper}:first-child {
|
|
10280
|
-
border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
|
|
10281
|
-
}
|
|
10282
|
-
|
|
10283
|
-
& ${IconButtonWrapper}:last-child {
|
|
10284
|
-
border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
|
|
10285
|
-
}
|
|
10286
|
-
|
|
10287
|
-
& ${IconButtonWrapper} {
|
|
10288
|
-
border-radius: 0;
|
|
10289
|
-
|
|
10290
|
-
& + ${IconButtonWrapper} {
|
|
10291
|
-
border-left: none;
|
|
10292
|
-
}
|
|
10293
|
-
}
|
|
10294
|
-
`;
|
|
10295
10338
|
const addMarks = StateEffect.define();
|
|
10296
10339
|
const filterMarks = StateEffect.define();
|
|
10297
10340
|
const lineHighlightMark = Decoration.mark({
|
|
@@ -10572,7 +10615,7 @@ const Thumb = styled(ScrollArea.Thumb)`
|
|
|
10572
10615
|
min-height: 44px;
|
|
10573
10616
|
}
|
|
10574
10617
|
`;
|
|
10575
|
-
const Root$
|
|
10618
|
+
const Root$3 = Dialog$1.Root;
|
|
10576
10619
|
const Trigger$2 = React.forwardRef((props, forwardedRef) => {
|
|
10577
10620
|
return /* @__PURE__ */ jsx(Dialog$1.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
10578
10621
|
});
|
|
@@ -10592,8 +10635,8 @@ const Overlay = styled(Dialog$1.Overlay)`
|
|
|
10592
10635
|
`;
|
|
10593
10636
|
const ContentImpl = styled(Dialog$1.Content)`
|
|
10594
10637
|
max-width: 83rem;
|
|
10595
|
-
max-height:
|
|
10596
|
-
height:
|
|
10638
|
+
max-height: 90vh;
|
|
10639
|
+
height: auto;
|
|
10597
10640
|
width: 60%;
|
|
10598
10641
|
overflow: hidden;
|
|
10599
10642
|
margin: 0 auto;
|
|
@@ -10695,7 +10738,7 @@ const Modal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
10695
10738
|
Content: Content$2,
|
|
10696
10739
|
Footer,
|
|
10697
10740
|
Header,
|
|
10698
|
-
Root: Root$
|
|
10741
|
+
Root: Root$3,
|
|
10699
10742
|
Title,
|
|
10700
10743
|
Trigger: Trigger$2
|
|
10701
10744
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -10931,7 +10974,7 @@ const Dots = ({ children, ...props }) => /* @__PURE__ */ jsxs(Box, { ...props, c
|
|
|
10931
10974
|
/* @__PURE__ */ jsx(VisuallyHidden, { children }),
|
|
10932
10975
|
/* @__PURE__ */ jsx(Typography, { "aria-hidden": true, lineHeight: "revert", textColor: "neutral800", variant: "pi", children: "…" })
|
|
10933
10976
|
] });
|
|
10934
|
-
const Root$
|
|
10977
|
+
const Root$2 = Popover$1.Root;
|
|
10935
10978
|
const Trigger$1 = React.forwardRef((props, forwardedRef) => {
|
|
10936
10979
|
return /* @__PURE__ */ jsx(Popover$1.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
10937
10980
|
});
|
|
@@ -10943,6 +10986,7 @@ const PopoverContent = styled(Popover$1.Content)`
|
|
|
10943
10986
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
10944
10987
|
background-color: ${(props) => props.theme.colors.neutral0};
|
|
10945
10988
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
10989
|
+
border-radius: ${({ theme }) => theme.borderRadius};
|
|
10946
10990
|
|
|
10947
10991
|
@media (prefers-reduced-motion: no-preference) {
|
|
10948
10992
|
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
@@ -10951,11 +10995,11 @@ const PopoverContent = styled(Popover$1.Content)`
|
|
|
10951
10995
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
10952
10996
|
|
|
10953
10997
|
&[data-side='top'] {
|
|
10954
|
-
animation-name: ${ANIMATIONS.
|
|
10998
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
10955
10999
|
}
|
|
10956
11000
|
|
|
10957
11001
|
&[data-side='bottom'] {
|
|
10958
|
-
animation-name: ${ANIMATIONS.
|
|
11002
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
10959
11003
|
}
|
|
10960
11004
|
}
|
|
10961
11005
|
|
|
@@ -10963,11 +11007,11 @@ const PopoverContent = styled(Popover$1.Content)`
|
|
|
10963
11007
|
animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
10964
11008
|
|
|
10965
11009
|
&[data-side='top'] {
|
|
10966
|
-
animation-name: ${ANIMATIONS.
|
|
11010
|
+
animation-name: ${ANIMATIONS.slideUpOut};
|
|
10967
11011
|
}
|
|
10968
11012
|
|
|
10969
11013
|
&[data-side='bottom'] {
|
|
10970
|
-
animation-name: ${ANIMATIONS.
|
|
11014
|
+
animation-name: ${ANIMATIONS.slideDownOut};
|
|
10971
11015
|
}
|
|
10972
11016
|
}
|
|
10973
11017
|
}
|
|
@@ -10994,7 +11038,7 @@ const PopoverScrollArea = styled(ScrollAreaImpl$1)`
|
|
|
10994
11038
|
const Popover = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10995
11039
|
__proto__: null,
|
|
10996
11040
|
Content: Content$1,
|
|
10997
|
-
Root: Root$
|
|
11041
|
+
Root: Root$2,
|
|
10998
11042
|
ScrollArea: ScrollAreaImpl,
|
|
10999
11043
|
Trigger: Trigger$1
|
|
11000
11044
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -11034,7 +11078,7 @@ const RadioGroupRoot = styled(RadioGroup.Root)`
|
|
|
11034
11078
|
flex-direction: column;
|
|
11035
11079
|
gap: ${(props) => props.theme.spaces[3]};
|
|
11036
11080
|
`;
|
|
11037
|
-
const Item = React.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
|
|
11081
|
+
const Item$1 = React.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
|
|
11038
11082
|
const id = useId(idProp);
|
|
11039
11083
|
return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
11040
11084
|
/* @__PURE__ */ jsx(RadioGroupItem, { id, ref: forwardedRef, ...restProps, children: /* @__PURE__ */ jsx(RadioGroupIndicator, {}) }),
|
|
@@ -11103,7 +11147,7 @@ const RadioGroupIndicator = styled(RadioGroup.Indicator)`
|
|
|
11103
11147
|
const Radio = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11104
11148
|
__proto__: null,
|
|
11105
11149
|
Group,
|
|
11106
|
-
Item
|
|
11150
|
+
Item: Item$1
|
|
11107
11151
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
11108
11152
|
const focusFocusable = (node) => {
|
|
11109
11153
|
const nextNode = node.querySelector('[tabindex="0"]');
|
|
@@ -11202,6 +11246,29 @@ const RawTable = React.forwardRef(
|
|
|
11202
11246
|
) });
|
|
11203
11247
|
}
|
|
11204
11248
|
);
|
|
11249
|
+
const getFocusableNodes = (node, includeNegativeTabIndex) => {
|
|
11250
|
+
const nodes = [
|
|
11251
|
+
...node.querySelectorAll(
|
|
11252
|
+
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
11253
|
+
)
|
|
11254
|
+
];
|
|
11255
|
+
const focusables = nodes.filter((node2) => {
|
|
11256
|
+
if (node2.hasAttribute("disabled"))
|
|
11257
|
+
return false;
|
|
11258
|
+
if (includeNegativeTabIndex)
|
|
11259
|
+
return true;
|
|
11260
|
+
return node2.getAttribute("tabindex") !== "-1";
|
|
11261
|
+
});
|
|
11262
|
+
return focusables;
|
|
11263
|
+
};
|
|
11264
|
+
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
11265
|
+
return nodes.filter((node) => {
|
|
11266
|
+
if (node.tagName === "INPUT") {
|
|
11267
|
+
return node.type !== "checkbox" && node.type !== "radio";
|
|
11268
|
+
}
|
|
11269
|
+
return false;
|
|
11270
|
+
});
|
|
11271
|
+
};
|
|
11205
11272
|
const RawTd = React.forwardRef(
|
|
11206
11273
|
({ coords = { col: 0, row: 0 }, tag = "td", ...props }, forwardedRef) => {
|
|
11207
11274
|
const tdRef = React.useRef(null);
|
|
@@ -11651,7 +11718,8 @@ const SubNavHeader = ({
|
|
|
11651
11718
|
},
|
|
11652
11719
|
onSubmit = () => {
|
|
11653
11720
|
},
|
|
11654
|
-
id
|
|
11721
|
+
id,
|
|
11722
|
+
placeholder
|
|
11655
11723
|
}) => {
|
|
11656
11724
|
const [isSearchOpen, setSearchOpen] = React.useState(false);
|
|
11657
11725
|
const previousSearchOpenValue = usePrev(isSearchOpen);
|
|
@@ -11691,7 +11759,7 @@ const SubNavHeader = ({
|
|
|
11691
11759
|
name: "searchbar",
|
|
11692
11760
|
value,
|
|
11693
11761
|
onChange,
|
|
11694
|
-
placeholder
|
|
11762
|
+
placeholder,
|
|
11695
11763
|
onKeyDown: handleKeyDown,
|
|
11696
11764
|
ref: searchRef,
|
|
11697
11765
|
onBlur: handleBlur,
|
|
@@ -11980,7 +12048,7 @@ const LabelTypography = styled(Typography)`
|
|
|
11980
12048
|
}
|
|
11981
12049
|
`;
|
|
11982
12050
|
const [TabsProvider, useTabs] = createContext("Tabs");
|
|
11983
|
-
const Root = React.forwardRef(
|
|
12051
|
+
const Root$1 = React.forwardRef(
|
|
11984
12052
|
({ disabled = false, variant: variant2 = "regular", hasError, ...props }, forwardedRef) => {
|
|
11985
12053
|
return /* @__PURE__ */ jsx(TabsProvider, { disabled, hasError, variant: variant2, children: /* @__PURE__ */ jsx(TabsRoot, { ref: forwardedRef, ...props }) });
|
|
11986
12054
|
}
|
|
@@ -12019,10 +12087,6 @@ const TabBar = styled.span`
|
|
|
12019
12087
|
left: 0;
|
|
12020
12088
|
opacity: 0;
|
|
12021
12089
|
height: 0.2rem;
|
|
12022
|
-
|
|
12023
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
12024
|
-
transition: ${(props) => `opacity 200ms ${props.theme.motion.easings.authenticMotion}`};
|
|
12025
|
-
}
|
|
12026
12090
|
`;
|
|
12027
12091
|
const TriggerTypography = styled(Typography)``;
|
|
12028
12092
|
const TabsTrigger = styled(Tabs$1.Trigger)`
|
|
@@ -12076,10 +12140,6 @@ const TabsTrigger = styled(Tabs$1.Trigger)`
|
|
|
12076
12140
|
}
|
|
12077
12141
|
}}
|
|
12078
12142
|
|
|
12079
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
12080
|
-
transition: ${(props) => `${props.theme.transitions.color}, ${props.theme.transitions.backgroundColor}, box-shadow ${props.theme.motion.timings["120"]} ${props.theme.motion.easings.easeOutQuad}`};
|
|
12081
|
-
}
|
|
12082
|
-
|
|
12083
12143
|
&[data-disabled] {
|
|
12084
12144
|
cursor: not-allowed;
|
|
12085
12145
|
color: ${(props) => props.theme.colors.neutral400};
|
|
@@ -12106,7 +12166,7 @@ const Tabs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
12106
12166
|
__proto__: null,
|
|
12107
12167
|
Content,
|
|
12108
12168
|
List,
|
|
12109
|
-
Root,
|
|
12169
|
+
Root: Root$1,
|
|
12110
12170
|
Trigger
|
|
12111
12171
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
12112
12172
|
const TableContainer = styled(Box)`
|
|
@@ -12328,7 +12388,7 @@ const Textarea = React.forwardRef(
|
|
|
12328
12388
|
} else if (field.hint) {
|
|
12329
12389
|
ariaDescription = `${id}-hint`;
|
|
12330
12390
|
}
|
|
12331
|
-
return /* @__PURE__ */ jsx(Wrapper, { borderColor: hasError ? "danger600" : "neutral200", $hasError: hasError, hasRadius: true, children: /* @__PURE__ */ jsx(
|
|
12391
|
+
return /* @__PURE__ */ jsx(Wrapper$1, { borderColor: hasError ? "danger600" : "neutral200", $hasError: hasError, hasRadius: true, children: /* @__PURE__ */ jsx(
|
|
12332
12392
|
TextareaElement,
|
|
12333
12393
|
{
|
|
12334
12394
|
"aria-invalid": hasError,
|
|
@@ -12352,7 +12412,7 @@ const Textarea = React.forwardRef(
|
|
|
12352
12412
|
) });
|
|
12353
12413
|
}
|
|
12354
12414
|
);
|
|
12355
|
-
const Wrapper = styled(Box)`
|
|
12415
|
+
const Wrapper$1 = styled(Box)`
|
|
12356
12416
|
${inputFocusStyle()}
|
|
12357
12417
|
`;
|
|
12358
12418
|
const TextareaElement = styled(Box)`
|
|
@@ -12497,6 +12557,39 @@ const Input = styled.input`
|
|
|
12497
12557
|
z-index: 0;
|
|
12498
12558
|
width: 100%;
|
|
12499
12559
|
`;
|
|
12560
|
+
const Root = forwardRef((props, forwardedRef) => {
|
|
12561
|
+
const { gap = 0, gridCols = 12, ...rest } = props;
|
|
12562
|
+
return /* @__PURE__ */ jsx(Wrapper, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
|
|
12563
|
+
});
|
|
12564
|
+
const Wrapper = styled(Box)`
|
|
12565
|
+
display: grid;
|
|
12566
|
+
grid-template-columns: repeat(${({ $gridCols }) => $gridCols}, 1fr);
|
|
12567
|
+
${({ theme, $gap }) => handleResponsiveValues({ gap: $gap }, theme)}
|
|
12568
|
+
`;
|
|
12569
|
+
const ItemImpl = forwardRef(
|
|
12570
|
+
({ col, s, xs, ...props }, forwardedRef) => /* @__PURE__ */ jsx(Item, { ref: forwardedRef, $col: col, $s: s, $xs: xs, ...props })
|
|
12571
|
+
);
|
|
12572
|
+
const Item = styled(Flex)`
|
|
12573
|
+
grid-column: span ${({ $xs }) => $xs ?? 12};
|
|
12574
|
+
max-width: 100%;
|
|
12575
|
+
|
|
12576
|
+
${({ theme }) => theme.breakpoints.small} {
|
|
12577
|
+
grid-column: span ${({ $s, $xs }) => $s ?? $xs ?? 12};
|
|
12578
|
+
}
|
|
12579
|
+
|
|
12580
|
+
${({ theme }) => theme.breakpoints.medium} {
|
|
12581
|
+
grid-column: span ${({ $m, $s, $xs }) => $m ?? $s ?? $xs ?? 12};
|
|
12582
|
+
}
|
|
12583
|
+
|
|
12584
|
+
${({ theme }) => theme.breakpoints.large} {
|
|
12585
|
+
grid-column: span ${({ $col, $m, $s, $xs }) => $col ?? $m ?? $s ?? $xs ?? 12};
|
|
12586
|
+
}
|
|
12587
|
+
`;
|
|
12588
|
+
const Grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12589
|
+
__proto__: null,
|
|
12590
|
+
Item: ItemImpl,
|
|
12591
|
+
Root
|
|
12592
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
12500
12593
|
const defaultState = {
|
|
12501
12594
|
x: 0,
|
|
12502
12595
|
y: 0,
|
|
@@ -12529,6 +12622,56 @@ function useMeasure() {
|
|
|
12529
12622
|
}, [element, observer]);
|
|
12530
12623
|
return [ref, rect];
|
|
12531
12624
|
}
|
|
12625
|
+
const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
|
|
12626
|
+
const trappedRef = React.useRef(null);
|
|
12627
|
+
React.useEffect(() => {
|
|
12628
|
+
let currentFocus = null;
|
|
12629
|
+
if (restoreFocus) {
|
|
12630
|
+
currentFocus = document.activeElement;
|
|
12631
|
+
}
|
|
12632
|
+
return () => {
|
|
12633
|
+
if (currentFocus) {
|
|
12634
|
+
currentFocus.focus();
|
|
12635
|
+
}
|
|
12636
|
+
};
|
|
12637
|
+
}, [restoreFocus]);
|
|
12638
|
+
React.useEffect(() => {
|
|
12639
|
+
if (!trappedRef.current || skipAutoFocus)
|
|
12640
|
+
return;
|
|
12641
|
+
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
12642
|
+
if (focusableChildren.length > 0) {
|
|
12643
|
+
const firstElement = focusableChildren[0];
|
|
12644
|
+
firstElement.focus();
|
|
12645
|
+
} else {
|
|
12646
|
+
console.warn(
|
|
12647
|
+
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
12648
|
+
);
|
|
12649
|
+
}
|
|
12650
|
+
}, [skipAutoFocus]);
|
|
12651
|
+
const handleKeyDown = (e) => {
|
|
12652
|
+
if (e.key === KeyboardKeys.ESCAPE && onEscape) {
|
|
12653
|
+
onEscape();
|
|
12654
|
+
return;
|
|
12655
|
+
}
|
|
12656
|
+
if (e.key !== KeyboardKeys.TAB)
|
|
12657
|
+
return;
|
|
12658
|
+
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
12659
|
+
if (focusableChildren.length > 0) {
|
|
12660
|
+
const firstElement = focusableChildren[0];
|
|
12661
|
+
const lastElement = focusableChildren[focusableChildren.length - 1];
|
|
12662
|
+
if (e.shiftKey) {
|
|
12663
|
+
if (firstElement === document.activeElement) {
|
|
12664
|
+
e.preventDefault();
|
|
12665
|
+
lastElement.focus();
|
|
12666
|
+
}
|
|
12667
|
+
} else if (lastElement === document.activeElement) {
|
|
12668
|
+
e.preventDefault();
|
|
12669
|
+
firstElement.focus();
|
|
12670
|
+
}
|
|
12671
|
+
}
|
|
12672
|
+
};
|
|
12673
|
+
return /* @__PURE__ */ jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
|
|
12674
|
+
};
|
|
12532
12675
|
const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
|
|
12533
12676
|
const isValidFocusedElement = () => {
|
|
12534
12677
|
const focused = document.activeElement;
|