@strapi/design-system 2.0.0-beta.6 → 2.0.0-rc.8
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 +3 -3
- package/dist/components/BaseLink/BaseLink.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -5
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Crumb.d.ts +3 -5
- package/dist/components/Breadcrumbs/Crumb.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/CrumbLink.d.ts +2 -4
- package/dist/components/Breadcrumbs/CrumbLink.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/CrumbSimpleMenu.d.ts +33 -6
- package/dist/components/Breadcrumbs/CrumbSimpleMenu.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +3 -2
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/utils.d.ts.map +1 -1
- package/dist/components/Card/Card.d.ts +3 -2
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/CardAction.d.ts +3 -2
- 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/CardCheckbox.d.ts +2 -1
- package/dist/components/Card/CardCheckbox.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/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 +3 -3
- 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 +7 -18
- 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/LinkButton/LinkButton.d.ts +4 -10
- package/dist/components/LinkButton/LinkButton.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 +1 -1
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +1 -2
- package/dist/components/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/components/RawTable/RawCell.d.ts +2 -2
- package/dist/components/RawTable/RawCell.d.ts.map +1 -1
- package/dist/components/RawTable/RawTable.d.ts +1 -1
- package/dist/components/RawTable/RawTable.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/Searchbar/Searchbar.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/Cell.d.ts +2 -2
- package/dist/components/Table/Cell.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/Table/Table.d.ts +1 -1
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/components/Tag/Tag.d.ts +6 -3
- package/dist/components/Tag/Tag.d.ts.map +1 -1
- package/dist/components/TextButton/TextButton.d.ts +9 -4
- 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 -6
- 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 +1044 -953
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1045 -954
- 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 +6 -4
- 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/styles/global.d.ts.map +1 -1
- 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 +7 -7
- package/dist/components/BaseButton/BaseButton.d.ts +0 -10
- package/dist/components/BaseButton/BaseButton.d.ts.map +0 -1
- package/dist/components/BaseButton/index.d.ts +0 -2
- package/dist/components/BaseButton/index.d.ts.map +0 -1
- 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.js
CHANGED
|
@@ -80,32 +80,6 @@ const createContext = (rootComponentName, defaultContext) => {
|
|
|
80
80
|
Provider2.displayName = `${rootComponentName}Provider`;
|
|
81
81
|
return [Provider2, useContext];
|
|
82
82
|
};
|
|
83
|
-
const handleResponsiveValues = (property, value, theme) => {
|
|
84
|
-
if (!value) {
|
|
85
|
-
return void 0;
|
|
86
|
-
}
|
|
87
|
-
if (typeof value === "object") {
|
|
88
|
-
const transformedArray = Array.isArray(value) ? value : [value?.desktop, value?.tablet, value?.mobile];
|
|
89
|
-
const spaces = transformedArray.reduce((acc, curr, index) => {
|
|
90
|
-
if (curr) {
|
|
91
|
-
switch (index) {
|
|
92
|
-
case 0:
|
|
93
|
-
return `${acc}${property}: ${theme.spaces[curr]};`;
|
|
94
|
-
case 1:
|
|
95
|
-
return `${acc}${theme.mediaQueries.tablet}{${property}: ${theme.spaces[curr]};}`;
|
|
96
|
-
case 2:
|
|
97
|
-
return `${acc}${theme.mediaQueries.mobile}{${property}: ${theme.spaces[curr]};}`;
|
|
98
|
-
default:
|
|
99
|
-
return acc;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return acc;
|
|
103
|
-
}, "");
|
|
104
|
-
return spaces;
|
|
105
|
-
}
|
|
106
|
-
const realValue = theme.spaces[value] ?? value;
|
|
107
|
-
return `${property}: ${realValue};`;
|
|
108
|
-
};
|
|
109
83
|
function isKeyOf(o, s) {
|
|
110
84
|
if (typeof o === "string") {
|
|
111
85
|
return false;
|
|
@@ -116,11 +90,166 @@ function isObject(item) {
|
|
|
116
90
|
return item && typeof item === "object" && !Array.isArray(item);
|
|
117
91
|
}
|
|
118
92
|
function extractStyleFromTheme(themeSection, key, defaultValue) {
|
|
119
|
-
if (key && isKeyOf(themeSection, key)) {
|
|
93
|
+
if (themeSection && key && isKeyOf(themeSection, key)) {
|
|
120
94
|
return themeSection[key];
|
|
121
95
|
}
|
|
122
96
|
return defaultValue;
|
|
123
97
|
}
|
|
98
|
+
const mappedCSSProps = {
|
|
99
|
+
padding: ["padding-block-start", "padding-inline-end", "padding-block-end", "padding-inline-start"],
|
|
100
|
+
paddingTop: "padding-block-start",
|
|
101
|
+
paddingRight: "padding-inline-end",
|
|
102
|
+
paddingBottom: "padding-block-end",
|
|
103
|
+
paddingLeft: "padding-inline-start",
|
|
104
|
+
margin: ["margin-block-start", "margin-inline-end", "margin-block-end", "margin-inline-start"],
|
|
105
|
+
marginLeft: "margin-inline-start",
|
|
106
|
+
marginRight: "margin-inline-end",
|
|
107
|
+
marginTop: "margin-block-start",
|
|
108
|
+
marginBottom: "margin-block-end",
|
|
109
|
+
borderRadius: "border-radius",
|
|
110
|
+
borderStyle: "border-style",
|
|
111
|
+
borderWidth: "border-width",
|
|
112
|
+
borderColor: "border-color",
|
|
113
|
+
fontSize: "font-size",
|
|
114
|
+
fontWeight: "font-weight",
|
|
115
|
+
lineHeight: "line-height",
|
|
116
|
+
zIndex: "z-index",
|
|
117
|
+
boxShadow: "box-shadow",
|
|
118
|
+
pointerEvents: "pointer-events",
|
|
119
|
+
textAlign: "text-align",
|
|
120
|
+
textTransform: "text-transform",
|
|
121
|
+
textDecoration: "text-decoration",
|
|
122
|
+
flexGrow: "flex-grow",
|
|
123
|
+
flexShrink: "flex-shrink",
|
|
124
|
+
flexBasis: "flex-basis",
|
|
125
|
+
minWidth: "min-width",
|
|
126
|
+
maxWidth: "max-width",
|
|
127
|
+
minHeight: "min-height",
|
|
128
|
+
maxHeight: "max-height",
|
|
129
|
+
flexDirection: "flex-direction",
|
|
130
|
+
flexWrap: "flex-wrap",
|
|
131
|
+
justifyContent: "justify-content",
|
|
132
|
+
alignItems: "align-items"
|
|
133
|
+
};
|
|
134
|
+
const fillCssValues = (value) => {
|
|
135
|
+
const [top, right, bottom, left] = value;
|
|
136
|
+
const rightValue = right ?? top;
|
|
137
|
+
const bottomValue = bottom ?? top;
|
|
138
|
+
const leftValue = left ?? rightValue;
|
|
139
|
+
return [top, rightValue, bottomValue, leftValue];
|
|
140
|
+
};
|
|
141
|
+
function getThemeSection(key, theme) {
|
|
142
|
+
switch (key) {
|
|
143
|
+
case "gap":
|
|
144
|
+
case "padding":
|
|
145
|
+
case "margin":
|
|
146
|
+
case "paddingTop":
|
|
147
|
+
case "paddingLeft":
|
|
148
|
+
case "paddingRight":
|
|
149
|
+
case "paddingBottom":
|
|
150
|
+
case "marginTop":
|
|
151
|
+
case "marginLeft":
|
|
152
|
+
case "marginRight":
|
|
153
|
+
case "marginBottom":
|
|
154
|
+
case "left":
|
|
155
|
+
case "right":
|
|
156
|
+
case "top":
|
|
157
|
+
case "bottom":
|
|
158
|
+
case "width":
|
|
159
|
+
case "maxWidth":
|
|
160
|
+
case "minWidth":
|
|
161
|
+
case "height":
|
|
162
|
+
case "maxHeight":
|
|
163
|
+
case "minHeight":
|
|
164
|
+
case "borderRadius":
|
|
165
|
+
case "borderWidth":
|
|
166
|
+
return theme.spaces;
|
|
167
|
+
case "color":
|
|
168
|
+
case "background":
|
|
169
|
+
case "borderColor":
|
|
170
|
+
return theme.colors;
|
|
171
|
+
case "fontSize":
|
|
172
|
+
return theme.fontSizes;
|
|
173
|
+
case "fontWeight":
|
|
174
|
+
return theme.fontWeights;
|
|
175
|
+
case "lineHeight":
|
|
176
|
+
return theme.lineHeights;
|
|
177
|
+
case "zIndex":
|
|
178
|
+
return theme.zIndices;
|
|
179
|
+
case "boxShadow":
|
|
180
|
+
return theme.shadows;
|
|
181
|
+
default:
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
const handleResponsiveValues = (values, theme) => {
|
|
186
|
+
const stylesByBreakpoint = Object.entries(values).reduce(
|
|
187
|
+
(acc, curr) => {
|
|
188
|
+
const [key, value] = curr;
|
|
189
|
+
const themeSection = getThemeSection(key, theme);
|
|
190
|
+
const cssProperty = Object.prototype.hasOwnProperty.call(mappedCSSProps, key) ? mappedCSSProps[key] : key;
|
|
191
|
+
if (cssProperty && (value || value === 0)) {
|
|
192
|
+
if (typeof value === "object" && !Array.isArray(value)) {
|
|
193
|
+
Object.entries(value).forEach(([breakpointName, breakpointValue]) => {
|
|
194
|
+
acc[breakpointName] = {
|
|
195
|
+
...acc[breakpointName],
|
|
196
|
+
...convertCssPropertiesToCssValues(cssProperty, breakpointValue, themeSection)
|
|
197
|
+
};
|
|
198
|
+
});
|
|
199
|
+
} else {
|
|
200
|
+
acc.initial = {
|
|
201
|
+
...acc.initial,
|
|
202
|
+
...convertCssPropertiesToCssValues(cssProperty, value, themeSection)
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return acc;
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
initial: {},
|
|
210
|
+
small: {},
|
|
211
|
+
medium: {},
|
|
212
|
+
large: {}
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
return Object.entries(stylesByBreakpoint).reduce((acc, [key, value]) => {
|
|
216
|
+
if (value && Object.keys(value).length > 0) {
|
|
217
|
+
const breakpointStyles = Object.entries(value).reduce((arr, [property, value2]) => {
|
|
218
|
+
arr.push(`${property}: ${value2};`);
|
|
219
|
+
return arr;
|
|
220
|
+
}, []).join("\n");
|
|
221
|
+
if (key === "initial") {
|
|
222
|
+
acc.push(breakpointStyles);
|
|
223
|
+
} else {
|
|
224
|
+
acc.push(`${theme.breakpoints[key]}{ ${breakpointStyles} }`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return acc;
|
|
228
|
+
}, []).join("\n");
|
|
229
|
+
};
|
|
230
|
+
const convertCssPropertiesToCssValues = (property, value, themeSection) => {
|
|
231
|
+
if (Array.isArray(property) && Array.isArray(value)) {
|
|
232
|
+
const shorthandValues = fillCssValues(value);
|
|
233
|
+
return property.reduce((acc, prop, index) => {
|
|
234
|
+
acc[prop] = extractStyleFromTheme(themeSection, shorthandValues[index], shorthandValues[index]);
|
|
235
|
+
return acc;
|
|
236
|
+
}, {});
|
|
237
|
+
} else if (Array.isArray(property) && !Array.isArray(value)) {
|
|
238
|
+
return property.reduce((acc, prop) => {
|
|
239
|
+
acc[prop] = extractStyleFromTheme(themeSection, value, value);
|
|
240
|
+
return acc;
|
|
241
|
+
}, {});
|
|
242
|
+
} else if (!Array.isArray(property) && !Array.isArray(value)) {
|
|
243
|
+
return {
|
|
244
|
+
[property]: extractStyleFromTheme(themeSection, value, value)
|
|
245
|
+
};
|
|
246
|
+
} else {
|
|
247
|
+
console.warn(
|
|
248
|
+
"You've passed an array of values to a property that does not support it. Please check the property and value you're passing."
|
|
249
|
+
);
|
|
250
|
+
return {};
|
|
251
|
+
}
|
|
252
|
+
};
|
|
124
253
|
const forwardRef = React__namespace.forwardRef;
|
|
125
254
|
const Box = forwardRef((props, ref) => {
|
|
126
255
|
const {
|
|
@@ -132,8 +261,6 @@ const Box = forwardRef((props, ref) => {
|
|
|
132
261
|
fontSize,
|
|
133
262
|
grow,
|
|
134
263
|
hasRadius,
|
|
135
|
-
hiddenS,
|
|
136
|
-
hiddenXS,
|
|
137
264
|
padding,
|
|
138
265
|
paddingBottom,
|
|
139
266
|
paddingLeft,
|
|
@@ -147,6 +274,7 @@ const Box = forwardRef((props, ref) => {
|
|
|
147
274
|
shadow,
|
|
148
275
|
shrink,
|
|
149
276
|
lineHeight,
|
|
277
|
+
fontWeight,
|
|
150
278
|
width,
|
|
151
279
|
minWidth,
|
|
152
280
|
maxWidth,
|
|
@@ -184,8 +312,6 @@ const Box = forwardRef((props, ref) => {
|
|
|
184
312
|
$fontSize: fontSize,
|
|
185
313
|
$grow: grow,
|
|
186
314
|
$hasRadius: hasRadius,
|
|
187
|
-
$hiddenS: hiddenS,
|
|
188
|
-
$hiddenXS: hiddenXS,
|
|
189
315
|
$padding: padding,
|
|
190
316
|
$paddingBottom: paddingBottom,
|
|
191
317
|
$paddingLeft: paddingLeft,
|
|
@@ -199,6 +325,7 @@ const Box = forwardRef((props, ref) => {
|
|
|
199
325
|
$shadow: shadow,
|
|
200
326
|
$shrink: shrink,
|
|
201
327
|
$lineHeight: lineHeight,
|
|
328
|
+
$fontWeight: fontWeight,
|
|
202
329
|
$width: width,
|
|
203
330
|
$minWidth: minWidth,
|
|
204
331
|
$maxWidth: maxWidth,
|
|
@@ -227,110 +354,83 @@ const Box = forwardRef((props, ref) => {
|
|
|
227
354
|
return /* @__PURE__ */ jsxRuntime.jsx(StyledBox, { as: AsComponent, ref, ...mappedProps, ...rest });
|
|
228
355
|
});
|
|
229
356
|
const StyledBox = styledComponents.styled.div`
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
357
|
+
${({ theme, ...props }) => {
|
|
358
|
+
return handleResponsiveValues(
|
|
359
|
+
{
|
|
360
|
+
padding: props.$padding,
|
|
361
|
+
paddingTop: props.$paddingTop,
|
|
362
|
+
paddingBottom: props.$paddingBottom,
|
|
363
|
+
paddingLeft: props.$paddingLeft,
|
|
364
|
+
paddingRight: props.$paddingRight,
|
|
365
|
+
margin: props.$margin,
|
|
366
|
+
marginTop: props.$marginTop,
|
|
367
|
+
marginBottom: props.$marginBottom,
|
|
368
|
+
marginLeft: props.$marginLeft,
|
|
369
|
+
marginRight: props.$marginRight,
|
|
370
|
+
top: props.$top,
|
|
371
|
+
left: props.$left,
|
|
372
|
+
bottom: props.$bottom,
|
|
373
|
+
right: props.$right,
|
|
374
|
+
width: props.$width,
|
|
375
|
+
minWidth: props.$minWidth,
|
|
376
|
+
maxWidth: props.$maxWidth,
|
|
377
|
+
height: props.$height,
|
|
378
|
+
minHeight: props.$minHeight,
|
|
379
|
+
maxHeight: props.$maxHeight,
|
|
380
|
+
color: props.$color,
|
|
381
|
+
background: props.$background,
|
|
382
|
+
fontSize: props.$fontSize,
|
|
383
|
+
fontWeight: props.$fontWeight,
|
|
384
|
+
lineHeight: props.$lineHeight,
|
|
385
|
+
borderRadius: props.$hasRadius ? theme.borderRadius : props.$borderRadius,
|
|
386
|
+
borderStyle: props.$borderColor && !props.$borderStyle ? "solid" : props.$borderStyle,
|
|
387
|
+
borderWidth: props.$borderColor && !props.$borderWidth ? "1px" : props.$borderWidth,
|
|
388
|
+
borderColor: props.$borderColor,
|
|
389
|
+
zIndex: props.$zIndex,
|
|
390
|
+
boxShadow: props.$shadow,
|
|
391
|
+
display: props.$display,
|
|
392
|
+
pointerEvents: props.$pointerEvents,
|
|
393
|
+
cursor: props.$cursor,
|
|
394
|
+
textAlign: props.$textAlign,
|
|
395
|
+
textTransform: props.$textTransform,
|
|
396
|
+
transition: props.$transition,
|
|
397
|
+
transform: props.$transform,
|
|
398
|
+
animation: props.$animation,
|
|
399
|
+
position: props.$position,
|
|
400
|
+
overflow: props.$overflow,
|
|
401
|
+
flex: props.$flex,
|
|
402
|
+
flexShrink: props.$shrink,
|
|
403
|
+
flexGrow: props.$grow,
|
|
404
|
+
flexBasis: props.$basis
|
|
405
|
+
},
|
|
406
|
+
theme
|
|
407
|
+
);
|
|
267
408
|
}};
|
|
268
|
-
|
|
269
|
-
// Shadows
|
|
270
|
-
box-shadow: ${({ theme, $shadow }) => extractStyleFromTheme(theme.shadows, $shadow, void 0)};
|
|
271
|
-
|
|
272
|
-
// Handlers
|
|
273
|
-
pointer-events: ${({ $pointerEvents }) => $pointerEvents};
|
|
274
|
-
|
|
275
|
-
// Display
|
|
276
|
-
display: ${({ $display }) => $display};
|
|
277
|
-
|
|
278
|
-
// Position
|
|
279
|
-
position: ${({ $position }) => $position};
|
|
280
|
-
left: ${({ $left, theme }) => extractStyleFromTheme(theme.spaces, $left, $left)};
|
|
281
|
-
right: ${({ $right, theme }) => extractStyleFromTheme(theme.spaces, $right, $right)};
|
|
282
|
-
top: ${({ $top, theme }) => extractStyleFromTheme(theme.spaces, $top, $top)};
|
|
283
|
-
bottom: ${({ $bottom, theme }) => extractStyleFromTheme(theme.spaces, $bottom, $bottom)};
|
|
284
|
-
z-index: ${({ $zIndex, theme }) => extractStyleFromTheme(theme.zIndices, $zIndex, $zIndex)};
|
|
285
|
-
overflow: ${({ $overflow }) => $overflow};
|
|
286
|
-
|
|
287
|
-
// Size
|
|
288
|
-
width: ${({ $width, theme }) => extractStyleFromTheme(theme.spaces, $width, $width)};
|
|
289
|
-
max-width: ${({ $maxWidth, theme }) => extractStyleFromTheme(theme.spaces, $maxWidth, $maxWidth)};
|
|
290
|
-
min-width: ${({ $minWidth, theme }) => extractStyleFromTheme(theme.spaces, $minWidth, $minWidth)};
|
|
291
|
-
height: ${({ $height, theme }) => extractStyleFromTheme(theme.spaces, $height, $height)};
|
|
292
|
-
max-height: ${({ $maxHeight, theme }) => extractStyleFromTheme(theme.spaces, $maxHeight, $maxHeight)};
|
|
293
|
-
min-height: ${({ $minHeight, theme }) => extractStyleFromTheme(theme.spaces, $minHeight, $minHeight)};
|
|
294
|
-
|
|
295
|
-
// Animation
|
|
296
|
-
transition: ${({ $transition }) => $transition};
|
|
297
|
-
transform: ${({ $transform }) => $transform};
|
|
298
|
-
animation: ${({ $animation }) => $animation};
|
|
299
|
-
|
|
300
|
-
//Flexbox children props
|
|
301
|
-
flex-shrink: ${({ $shrink }) => $shrink};
|
|
302
|
-
flex-grow: ${({ $grow }) => $grow};
|
|
303
|
-
flex-basis: ${({ $basis }) => $basis};
|
|
304
|
-
flex: ${({ $flex }) => $flex};
|
|
305
|
-
|
|
306
|
-
// Text
|
|
307
|
-
text-align: ${({ $textAlign }) => $textAlign};
|
|
308
|
-
text-transform: ${({ $textTransform }) => $textTransform};
|
|
309
|
-
line-height: ${({ theme, $lineHeight }) => extractStyleFromTheme(theme.lineHeights, $lineHeight, $lineHeight)};
|
|
310
|
-
|
|
311
|
-
// Cursor
|
|
312
|
-
cursor: ${({ $cursor }) => $cursor};
|
|
313
409
|
`;
|
|
314
410
|
const Flex = forwardRef((props, ref) => {
|
|
315
|
-
const { className, alignItems, direction,
|
|
411
|
+
const { className, alignItems, direction, inline, gap, justifyContent, wrap, ...rest } = props;
|
|
316
412
|
const mappedProps = {
|
|
317
413
|
$alignItems: alignItems,
|
|
318
414
|
$direction: direction,
|
|
319
415
|
$gap: gap,
|
|
320
|
-
$inline: inline,
|
|
321
416
|
$justifyContent: justifyContent,
|
|
322
|
-
$wrap: wrap
|
|
417
|
+
$wrap: wrap,
|
|
418
|
+
$inline: inline
|
|
323
419
|
};
|
|
324
420
|
return /* @__PURE__ */ jsxRuntime.jsx(StyledFlex, { className, ref, ...mappedProps, ...rest });
|
|
325
421
|
});
|
|
326
422
|
const StyledFlex = styledComponents.styled(Box)`
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
423
|
+
${({ theme, $display = "flex", $alignItems = "center", $direction = "row", ...props }) => handleResponsiveValues(
|
|
424
|
+
{
|
|
425
|
+
gap: props.$gap,
|
|
426
|
+
alignItems: $alignItems,
|
|
427
|
+
justifyContent: props.$justifyContent,
|
|
428
|
+
flexWrap: props.$wrap,
|
|
429
|
+
flexDirection: $direction,
|
|
430
|
+
display: props.$inline ? "inline-flex" : $display
|
|
431
|
+
},
|
|
432
|
+
theme
|
|
433
|
+
)};
|
|
334
434
|
`;
|
|
335
435
|
const ALPHA = "alpha";
|
|
336
436
|
const BETA = "beta";
|
|
@@ -405,26 +505,24 @@ const Typography = forwardRef(
|
|
|
405
505
|
(props, ref) => {
|
|
406
506
|
const {
|
|
407
507
|
ellipsis: ellipsis2,
|
|
408
|
-
fontSize,
|
|
409
|
-
fontWeight,
|
|
410
|
-
lineHeight,
|
|
411
|
-
textAlign,
|
|
412
508
|
textColor = "currentcolor",
|
|
413
509
|
textDecoration,
|
|
414
510
|
textTransform,
|
|
415
511
|
variant: variant2,
|
|
512
|
+
lineHeight,
|
|
513
|
+
fontWeight,
|
|
514
|
+
fontSize,
|
|
416
515
|
...rest
|
|
417
516
|
} = props;
|
|
418
517
|
const mappedProps = {
|
|
419
518
|
$ellipsis: ellipsis2,
|
|
420
|
-
$fontSize: fontSize,
|
|
421
|
-
$fontWeight: fontWeight,
|
|
422
|
-
$lineHeight: lineHeight,
|
|
423
|
-
$textAlign: textAlign,
|
|
424
519
|
$textColor: textColor,
|
|
425
520
|
$textDecoration: textDecoration,
|
|
426
521
|
$textTransform: textTransform,
|
|
427
|
-
$variant: variant2
|
|
522
|
+
$variant: variant2,
|
|
523
|
+
$lineHeight: lineHeight,
|
|
524
|
+
$fontWeight: fontWeight,
|
|
525
|
+
$fontSize: fontSize
|
|
428
526
|
};
|
|
429
527
|
return /* @__PURE__ */ jsxRuntime.jsx(StyledTypography, { ref, tag: "span", ...mappedProps, ...rest });
|
|
430
528
|
}
|
|
@@ -433,15 +531,19 @@ const StyledTypography = styledComponents.styled(Box)`
|
|
|
433
531
|
${variant}
|
|
434
532
|
${({ $ellipsis }) => $ellipsis ? ellipsis : ""}
|
|
435
533
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
534
|
+
${({ theme, ...props }) => {
|
|
535
|
+
return handleResponsiveValues(
|
|
536
|
+
{
|
|
537
|
+
color: props.$textColor,
|
|
538
|
+
textDecoration: props.$textDecoration,
|
|
539
|
+
textTransform: props.$textTransform,
|
|
540
|
+
lineHeight: props.$lineHeight,
|
|
541
|
+
fontWeight: props.$fontWeight,
|
|
542
|
+
fontSize: props.$fontSize
|
|
543
|
+
},
|
|
544
|
+
theme
|
|
545
|
+
);
|
|
546
|
+
}}
|
|
445
547
|
`;
|
|
446
548
|
const [AccordionProvider, useAccordion] = createContext("Accordion");
|
|
447
549
|
const Root$8 = React__namespace.forwardRef(({ children, size = "S", ...props }, forwardedRef) => {
|
|
@@ -469,25 +571,38 @@ const AccordionItem = styledComponents.styled(RadixAccordion__namespace.Item)`
|
|
|
469
571
|
overflow: hidden;
|
|
470
572
|
|
|
471
573
|
&:first-child {
|
|
472
|
-
border-top-left-radius:
|
|
473
|
-
border-top-right-radius:
|
|
574
|
+
border-top-left-radius: 0.3rem;
|
|
575
|
+
border-top-right-radius: 0.3rem;
|
|
474
576
|
}
|
|
475
577
|
|
|
476
578
|
&:last-child {
|
|
477
|
-
border-bottom-left-radius:
|
|
478
|
-
border-bottom-right-radius:
|
|
579
|
+
border-bottom-left-radius: 0.3rem;
|
|
580
|
+
border-bottom-right-radius: 0.3rem;
|
|
479
581
|
}
|
|
480
582
|
|
|
481
583
|
& + & {
|
|
482
584
|
border-top: ${(props) => props.$size === "S" ? `solid 1px ${props.theme.colors.neutral200}` : "unset"};
|
|
483
585
|
}
|
|
484
586
|
|
|
587
|
+
&[data-state='open'] {
|
|
588
|
+
box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
&:hover {
|
|
592
|
+
box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
|
|
593
|
+
}
|
|
594
|
+
|
|
485
595
|
/* This applies our desired focus effect correctly. */
|
|
486
596
|
&:focus-within {
|
|
487
597
|
position: relative;
|
|
488
598
|
z-index: 1;
|
|
489
599
|
box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
|
|
490
600
|
}
|
|
601
|
+
|
|
602
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
603
|
+
transition: box-shadow ${(props) => props.theme.motion.timings["120"]}
|
|
604
|
+
${(props) => props.theme.motion.easings.easeOutQuad};
|
|
605
|
+
}
|
|
491
606
|
`;
|
|
492
607
|
const Trigger$7 = React__namespace.forwardRef(
|
|
493
608
|
({ caretPosition = "left", description, icon: Icon, children, ...restProps }, forwardedRef) => {
|
|
@@ -503,10 +618,11 @@ const Trigger$7 = React__namespace.forwardRef(
|
|
|
503
618
|
fontWeight: size === "S" ? "bold" : void 0,
|
|
504
619
|
ellipsis: true,
|
|
505
620
|
variant: size === "M" ? "delta" : void 0,
|
|
621
|
+
textAlign: "left",
|
|
506
622
|
children
|
|
507
623
|
}
|
|
508
624
|
),
|
|
509
|
-
description && size === "M" ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { children: description }) : null
|
|
625
|
+
description && size === "M" ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { textAlign: "left", children: description }) : null
|
|
510
626
|
] })
|
|
511
627
|
] }),
|
|
512
628
|
caretPosition === "right" ? /* @__PURE__ */ jsxRuntime.jsx(TriggerIcon, { $size: size, children: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, { width: size === "S" ? "1.2rem" : "1.6rem", height: size === "S" ? "1.2rem" : "1.6rem" }) }) : null
|
|
@@ -1170,51 +1286,32 @@ const Base = styledComponents.styled(Flex)`
|
|
|
1170
1286
|
`;
|
|
1171
1287
|
}};
|
|
1172
1288
|
`;
|
|
1173
|
-
const
|
|
1174
|
-
({ disabled,
|
|
1175
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1176
|
-
BaseButtonWrapper,
|
|
1177
|
-
{
|
|
1178
|
-
ref,
|
|
1179
|
-
"aria-disabled": disabled,
|
|
1180
|
-
disabled,
|
|
1181
|
-
tag: "button",
|
|
1182
|
-
type: "button",
|
|
1183
|
-
padding: 2,
|
|
1184
|
-
hasRadius: true,
|
|
1185
|
-
background: "neutral0",
|
|
1186
|
-
borderColor: "neutral200",
|
|
1187
|
-
cursor: "pointer",
|
|
1188
|
-
...props,
|
|
1189
|
-
children
|
|
1190
|
-
}
|
|
1191
|
-
);
|
|
1192
|
-
}
|
|
1193
|
-
);
|
|
1194
|
-
const BaseButtonWrapper = styledComponents.styled(Flex)`
|
|
1195
|
-
&[aria-disabled='true'] {
|
|
1196
|
-
pointer-events: none;
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
${focus}
|
|
1200
|
-
`;
|
|
1201
|
-
const BaseLink = forwardRef(
|
|
1202
|
-
({ href, rel = "noreferrer noopener", target = "_self", disabled = false, isExternal = false, ...props }, ref) => {
|
|
1289
|
+
const BaseLinkImpl = forwardRef(
|
|
1290
|
+
({ href, disabled = false, isExternal = false, ...props }, ref) => {
|
|
1203
1291
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1204
|
-
|
|
1292
|
+
BaseLink,
|
|
1205
1293
|
{
|
|
1206
1294
|
tag: "a",
|
|
1207
1295
|
ref,
|
|
1208
|
-
target: isExternal ? "_blank" :
|
|
1209
|
-
rel: isExternal ?
|
|
1210
|
-
href
|
|
1296
|
+
target: isExternal ? "_blank" : void 0,
|
|
1297
|
+
rel: isExternal ? "noreferrer noopener" : void 0,
|
|
1298
|
+
href,
|
|
1299
|
+
tabIndex: disabled ? -1 : void 0,
|
|
1211
1300
|
"aria-disabled": disabled,
|
|
1212
|
-
|
|
1301
|
+
pointerEvents: disabled ? "none" : void 0,
|
|
1302
|
+
cursor: disabled ? void 0 : "pointer",
|
|
1213
1303
|
...props
|
|
1214
1304
|
}
|
|
1215
1305
|
);
|
|
1216
1306
|
}
|
|
1217
1307
|
);
|
|
1308
|
+
const BaseLink = styledComponents.styled(Box)`
|
|
1309
|
+
text-decoration: none;
|
|
1310
|
+
|
|
1311
|
+
&:visited {
|
|
1312
|
+
color: inherit;
|
|
1313
|
+
}
|
|
1314
|
+
`;
|
|
1218
1315
|
const Divider$1 = () => {
|
|
1219
1316
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": true, paddingLeft: 1, paddingRight: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", textColor: "neutral500", children: "/" }) });
|
|
1220
1317
|
};
|
|
@@ -1228,30 +1325,34 @@ const AlignedList = styledComponents.styled(Flex)`
|
|
|
1228
1325
|
margin-left: ${({ theme }) => `calc(-1*${theme.spaces[2]})`};
|
|
1229
1326
|
}
|
|
1230
1327
|
`;
|
|
1231
|
-
const Breadcrumbs = (
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
};
|
|
1241
|
-
Breadcrumbs.displayName = "Breadcrumbs";
|
|
1242
|
-
const Crumb = ({ children, isCurrent = false, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingLeft: 2, paddingRight: 2, paddingTop: 1, paddingBottom: 1, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1243
|
-
Typography,
|
|
1244
|
-
{
|
|
1245
|
-
variant: "pi",
|
|
1246
|
-
textColor: "neutral800",
|
|
1247
|
-
fontWeight: isCurrent ? "bold" : "regular",
|
|
1248
|
-
"aria-current": isCurrent,
|
|
1249
|
-
...props,
|
|
1250
|
-
children
|
|
1328
|
+
const Breadcrumbs = React__namespace.forwardRef(
|
|
1329
|
+
({ label, children, ...props }, forwardedRef) => {
|
|
1330
|
+
const childrenArray = React__namespace.Children.toArray(children);
|
|
1331
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-label": label, tag: "nav", ...props, ref: forwardedRef, children: /* @__PURE__ */ jsxRuntime.jsx(AlignedList, { tag: "ol", children: React__namespace.Children.map(childrenArray, (child, index) => {
|
|
1332
|
+
const shouldDisplayDivider = childrenArray.length > 1 && index + 1 < childrenArray.length;
|
|
1333
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { inline: true, tag: "li", children: [
|
|
1334
|
+
child,
|
|
1335
|
+
shouldDisplayDivider && /* @__PURE__ */ jsxRuntime.jsx(Divider$1, {})
|
|
1336
|
+
] });
|
|
1337
|
+
}) }) });
|
|
1251
1338
|
}
|
|
1252
|
-
)
|
|
1339
|
+
);
|
|
1340
|
+
Breadcrumbs.displayName = "Breadcrumbs";
|
|
1341
|
+
const Crumb = React__namespace.forwardRef(
|
|
1342
|
+
({ children, isCurrent = false, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingLeft: 2, paddingRight: 2, paddingTop: 1, paddingBottom: 1, ref: forwardedRef, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1343
|
+
Typography,
|
|
1344
|
+
{
|
|
1345
|
+
variant: "pi",
|
|
1346
|
+
textColor: "neutral800",
|
|
1347
|
+
fontWeight: isCurrent ? "bold" : "regular",
|
|
1348
|
+
"aria-current": isCurrent,
|
|
1349
|
+
...props,
|
|
1350
|
+
children
|
|
1351
|
+
}
|
|
1352
|
+
) })
|
|
1353
|
+
);
|
|
1253
1354
|
Crumb.displayName = "Crumb";
|
|
1254
|
-
const StyledLink = styledComponents.styled(
|
|
1355
|
+
const StyledLink = styledComponents.styled(BaseLinkImpl)`
|
|
1255
1356
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
1256
1357
|
color: ${({ theme }) => theme.colors.neutral600};
|
|
1257
1358
|
font-size: ${({ theme }) => theme.fontSizes[1]};
|
|
@@ -1265,9 +1366,22 @@ const StyledLink = styledComponents.styled(BaseLink)`
|
|
|
1265
1366
|
color: ${({ theme }) => theme.colors.neutral700};
|
|
1266
1367
|
}
|
|
1267
1368
|
`;
|
|
1268
|
-
const CrumbLink = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(StyledLink, { ...props, children });
|
|
1369
|
+
const CrumbLink = React__namespace.forwardRef(({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledLink, { ref: forwardedRef, ...props, children }));
|
|
1269
1370
|
CrumbLink.displayName = "CrumbLink";
|
|
1270
1371
|
const stripReactIdOfColon = (str) => str.replaceAll(":", "");
|
|
1372
|
+
function setRef(ref, value) {
|
|
1373
|
+
if (typeof ref === "function") {
|
|
1374
|
+
ref(value);
|
|
1375
|
+
} else if (ref !== null && ref !== void 0) {
|
|
1376
|
+
ref.current = value;
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
function composeRefs(...refs) {
|
|
1380
|
+
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
1381
|
+
}
|
|
1382
|
+
function useComposedRefs(...refs) {
|
|
1383
|
+
return React__namespace.useCallback(composeRefs(...refs), refs);
|
|
1384
|
+
}
|
|
1271
1385
|
const isSSR = () => typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
|
|
1272
1386
|
const useIsomorphicLayoutEffect = isSSR() ? React.useEffect : React.useLayoutEffect;
|
|
1273
1387
|
const useReactId = React__namespace["useId".toString()] || (() => void 0);
|
|
@@ -1317,7 +1431,7 @@ const DANGER = "danger";
|
|
|
1317
1431
|
const SUCCESS = "success";
|
|
1318
1432
|
const GHOST = "ghost";
|
|
1319
1433
|
const LIGHT_VARIANTS = [SUCCESS_LIGHT, DANGER_LIGHT];
|
|
1320
|
-
const VARIANTS
|
|
1434
|
+
const VARIANTS = [DEFAULT, TERTIARY, SECONDARY, DANGER, SUCCESS, GHOST, ...LIGHT_VARIANTS];
|
|
1321
1435
|
const BUTTON_SIZES = ["S", "M", "L"];
|
|
1322
1436
|
const getVariantColorName = (variant2) => {
|
|
1323
1437
|
if (variant2 === SUCCESS_LIGHT || variant2 === DANGER_LIGHT) {
|
|
@@ -1326,7 +1440,7 @@ const getVariantColorName = (variant2) => {
|
|
|
1326
1440
|
if (variant2 === TERTIARY) {
|
|
1327
1441
|
return "neutral";
|
|
1328
1442
|
}
|
|
1329
|
-
if (variant2 === DEFAULT || variant2 === SECONDARY || VARIANTS
|
|
1443
|
+
if (variant2 === DEFAULT || variant2 === SECONDARY || VARIANTS.every((vari) => vari !== variant2)) {
|
|
1330
1444
|
return "primary";
|
|
1331
1445
|
}
|
|
1332
1446
|
return `${variant2}`;
|
|
@@ -1336,6 +1450,7 @@ const getDisabledStyle = ({ theme }) => {
|
|
|
1336
1450
|
border: 1px solid ${theme.colors.neutral200};
|
|
1337
1451
|
background: ${theme.colors.neutral150};
|
|
1338
1452
|
color: ${theme.colors.neutral600};
|
|
1453
|
+
cursor: default;
|
|
1339
1454
|
`;
|
|
1340
1455
|
};
|
|
1341
1456
|
const getHoverStyle = ({ theme, $variant }) => {
|
|
@@ -1373,7 +1488,7 @@ const getActiveStyle = ({ theme, $variant }) => {
|
|
|
1373
1488
|
color: ${theme.colors[`${getVariantColorName($variant)}600`]};
|
|
1374
1489
|
`;
|
|
1375
1490
|
}
|
|
1376
|
-
if ($variant === TERTIARY) {
|
|
1491
|
+
if ($variant === TERTIARY || $variant === GHOST) {
|
|
1377
1492
|
return styledComponents.css`
|
|
1378
1493
|
background-color: ${theme.colors.neutral150};
|
|
1379
1494
|
`;
|
|
@@ -1422,6 +1537,8 @@ const getVariantStyle = ({ theme, $variant }) => {
|
|
|
1422
1537
|
}
|
|
1423
1538
|
default: {
|
|
1424
1539
|
return styledComponents.css`
|
|
1540
|
+
border: 1px solid ${theme.colors.buttonPrimary600};
|
|
1541
|
+
background: ${theme.colors.buttonPrimary600};
|
|
1425
1542
|
color: ${theme.colors.buttonNeutral0};
|
|
1426
1543
|
`;
|
|
1427
1544
|
}
|
|
@@ -1454,21 +1571,22 @@ const Button = forwardRef(
|
|
|
1454
1571
|
disabled: isDisabled,
|
|
1455
1572
|
$size: size,
|
|
1456
1573
|
$variant: variant2,
|
|
1574
|
+
tag: "button",
|
|
1457
1575
|
onClick: handleClick,
|
|
1458
|
-
|
|
1459
|
-
background: "buttonPrimary600",
|
|
1460
|
-
borderColor: "buttonPrimary600",
|
|
1576
|
+
hasRadius: true,
|
|
1461
1577
|
gap: 2,
|
|
1462
|
-
inline:
|
|
1463
|
-
|
|
1578
|
+
inline: true,
|
|
1579
|
+
alignItems: "center",
|
|
1580
|
+
justifyContent: "center",
|
|
1581
|
+
width: fullWidth ? "100%" : void 0,
|
|
1464
1582
|
paddingLeft: 4,
|
|
1465
1583
|
paddingRight: 4,
|
|
1466
|
-
|
|
1584
|
+
cursor: "pointer",
|
|
1467
1585
|
...props,
|
|
1468
1586
|
children: [
|
|
1469
|
-
(startIcon || loading) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1587
|
+
(startIcon || loading) && /* @__PURE__ */ jsxRuntime.jsx(Flex, { tag: "span", "aria-hidden": true, flex: "1 0 1.2rem", children: loading ? /* @__PURE__ */ jsxRuntime.jsx(LoaderAnimated, {}) : startIcon }),
|
|
1470
1588
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: size === "S" ? "pi" : void 0, fontWeight: "bold", children }),
|
|
1471
|
-
endIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { "aria-hidden": true, children: endIcon })
|
|
1589
|
+
endIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { tag: "span", "aria-hidden": true, flex: "1 0 1.2rem", children: endIcon })
|
|
1472
1590
|
]
|
|
1473
1591
|
}
|
|
1474
1592
|
);
|
|
@@ -1486,20 +1604,10 @@ const LoaderAnimated = styledComponents.styled(icons.Loader)`
|
|
|
1486
1604
|
animation: ${rotation$2} 2s infinite linear;
|
|
1487
1605
|
will-change: transform;
|
|
1488
1606
|
`;
|
|
1489
|
-
const ButtonWrapper = styledComponents.styled(
|
|
1607
|
+
const ButtonWrapper = styledComponents.styled(Flex)`
|
|
1490
1608
|
height: ${({ theme, $size }) => theme.sizes.button[$size]};
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
height: 1.2rem;
|
|
1494
|
-
}
|
|
1495
|
-
|
|
1496
|
-
&[aria-disabled='true'] {
|
|
1497
|
-
${getDisabledStyle}
|
|
1498
|
-
|
|
1499
|
-
&:active {
|
|
1500
|
-
${getDisabledStyle}
|
|
1501
|
-
}
|
|
1502
|
-
}
|
|
1609
|
+
text-decoration: none;
|
|
1610
|
+
${getVariantStyle}
|
|
1503
1611
|
|
|
1504
1612
|
&:hover {
|
|
1505
1613
|
${getHoverStyle}
|
|
@@ -1509,7 +1617,9 @@ const ButtonWrapper = styledComponents.styled(BaseButton)`
|
|
|
1509
1617
|
${getActiveStyle}
|
|
1510
1618
|
}
|
|
1511
1619
|
|
|
1512
|
-
|
|
1620
|
+
&[aria-disabled='true'] {
|
|
1621
|
+
${getDisabledStyle}
|
|
1622
|
+
}
|
|
1513
1623
|
|
|
1514
1624
|
@media (prefers-reduced-motion: no-preference) {
|
|
1515
1625
|
transition:
|
|
@@ -1518,58 +1628,204 @@ const ButtonWrapper = styledComponents.styled(BaseButton)`
|
|
|
1518
1628
|
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
1519
1629
|
}
|
|
1520
1630
|
`;
|
|
1521
|
-
const
|
|
1522
|
-
({
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1631
|
+
const TooltipImpl = React__namespace.forwardRef(
|
|
1632
|
+
({
|
|
1633
|
+
children,
|
|
1634
|
+
description,
|
|
1635
|
+
label,
|
|
1636
|
+
defaultOpen,
|
|
1637
|
+
open,
|
|
1638
|
+
onOpenChange,
|
|
1639
|
+
delayDuration = 500,
|
|
1640
|
+
disableHoverableContent,
|
|
1641
|
+
...restProps
|
|
1642
|
+
}, forwardedRef) => {
|
|
1643
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1644
|
+
Tooltip__namespace.Root,
|
|
1645
|
+
{
|
|
1646
|
+
defaultOpen,
|
|
1647
|
+
open,
|
|
1648
|
+
onOpenChange,
|
|
1649
|
+
delayDuration,
|
|
1650
|
+
disableHoverableContent,
|
|
1651
|
+
children: [
|
|
1652
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Trigger, { asChild: true, children }),
|
|
1653
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { ref: forwardedRef, sideOffset: 8, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", fontWeight: "bold", children: label || description }) }) })
|
|
1654
|
+
]
|
|
1655
|
+
}
|
|
1656
|
+
);
|
|
1529
1657
|
}
|
|
1530
1658
|
);
|
|
1531
|
-
const
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
path {
|
|
1542
|
-
fill: ${({ disabled, theme }) => disabled ? theme.colors.neutral600 : theme.colors.primary600};
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
|
-
|
|
1546
|
-
&:hover {
|
|
1547
|
-
color: ${({ theme }) => theme.colors.primary500};
|
|
1548
|
-
}
|
|
1659
|
+
const TooltipContent = styledComponents.styled(Tooltip__namespace.Content)`
|
|
1660
|
+
background-color: ${(props) => props.theme.colors.neutral900};
|
|
1661
|
+
color: ${(props) => props.theme.colors.neutral0};
|
|
1662
|
+
padding-inline: ${(props) => props.theme.spaces[2]};
|
|
1663
|
+
padding-block: ${(props) => props.theme.spaces[2]};
|
|
1664
|
+
border-radius: ${(props) => props.theme.borderRadius};
|
|
1665
|
+
z-index: ${(props) => props.theme.zIndices.tooltip};
|
|
1666
|
+
will-change: opacity;
|
|
1667
|
+
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
1549
1668
|
|
|
1550
|
-
|
|
1551
|
-
|
|
1669
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1670
|
+
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
1671
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
1552
1672
|
}
|
|
1553
|
-
|
|
1554
|
-
${focus};
|
|
1555
1673
|
`;
|
|
1556
|
-
const
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1674
|
+
const IconButton = forwardRef(
|
|
1675
|
+
({
|
|
1676
|
+
label,
|
|
1677
|
+
background,
|
|
1678
|
+
children,
|
|
1679
|
+
disabled = false,
|
|
1680
|
+
onClick,
|
|
1681
|
+
size = "S",
|
|
1682
|
+
variant: variant2 = "tertiary",
|
|
1683
|
+
withTooltip = true,
|
|
1684
|
+
...restProps
|
|
1685
|
+
}, ref) => {
|
|
1686
|
+
const handleClick = (e) => {
|
|
1687
|
+
if (!disabled && onClick) {
|
|
1688
|
+
onClick(e);
|
|
1689
|
+
}
|
|
1690
|
+
};
|
|
1691
|
+
const component = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1692
|
+
IconButtonWrapper,
|
|
1561
1693
|
{
|
|
1694
|
+
"aria-disabled": disabled,
|
|
1695
|
+
background: disabled ? "neutral150" : background,
|
|
1696
|
+
tag: "button",
|
|
1697
|
+
display: "inline-flex",
|
|
1698
|
+
justifyContent: "center",
|
|
1699
|
+
hasRadius: true,
|
|
1700
|
+
cursor: "pointer",
|
|
1701
|
+
...restProps,
|
|
1562
1702
|
ref,
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
paddingBottom: size === "S" ? 1 : 2,
|
|
1568
|
-
paddingLeft: size === "S" ? 3 : 4,
|
|
1569
|
-
paddingRight: size === "S" ? 3 : 4,
|
|
1570
|
-
...props
|
|
1703
|
+
$size: size,
|
|
1704
|
+
onClick: handleClick,
|
|
1705
|
+
$variant: variant2,
|
|
1706
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(AccessibleIcon, { label, children })
|
|
1571
1707
|
}
|
|
1572
|
-
)
|
|
1708
|
+
);
|
|
1709
|
+
return withTooltip ? /* @__PURE__ */ jsxRuntime.jsx(TooltipImpl, { label, children: component }) : component;
|
|
1710
|
+
}
|
|
1711
|
+
);
|
|
1712
|
+
const IconButtonWrapper = styledComponents.styled(Flex)`
|
|
1713
|
+
text-decoration: none;
|
|
1714
|
+
|
|
1715
|
+
${(props) => {
|
|
1716
|
+
switch (props.$size) {
|
|
1717
|
+
case "S": {
|
|
1718
|
+
return styledComponents.css`
|
|
1719
|
+
padding-block: 0.7rem;
|
|
1720
|
+
padding-inline: 0.7rem;
|
|
1721
|
+
`;
|
|
1722
|
+
}
|
|
1723
|
+
case "M": {
|
|
1724
|
+
return styledComponents.css`
|
|
1725
|
+
padding-block: 0.9rem;
|
|
1726
|
+
padding-inline: 0.9rem;
|
|
1727
|
+
`;
|
|
1728
|
+
}
|
|
1729
|
+
case "L": {
|
|
1730
|
+
return styledComponents.css`
|
|
1731
|
+
padding-block: 1.1rem;
|
|
1732
|
+
padding-inline: 1.1rem;
|
|
1733
|
+
`;
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
}}
|
|
1737
|
+
${getVariantStyle}
|
|
1738
|
+
${(props) => props.$variant === "tertiary" ? styledComponents.css`
|
|
1739
|
+
color: ${props.theme.colors.neutral600};
|
|
1740
|
+
` : ""}
|
|
1741
|
+
|
|
1742
|
+
&:hover {
|
|
1743
|
+
${getHoverStyle}
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
&:active {
|
|
1747
|
+
${getActiveStyle}
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
&[aria-disabled='true'] {
|
|
1751
|
+
${getDisabledStyle}
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1755
|
+
transition:
|
|
1756
|
+
${(props) => props.theme.transitions.backgroundColor},
|
|
1757
|
+
${(props) => props.theme.transitions.color},
|
|
1758
|
+
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
1759
|
+
}
|
|
1760
|
+
`;
|
|
1761
|
+
const IconButtonGroup = styledComponents.styled(Flex)`
|
|
1762
|
+
& ${IconButtonWrapper}:first-child {
|
|
1763
|
+
border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
& ${IconButtonWrapper}:last-child {
|
|
1767
|
+
border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
& ${IconButtonWrapper} {
|
|
1771
|
+
border-radius: 0;
|
|
1772
|
+
|
|
1773
|
+
& + ${IconButtonWrapper} {
|
|
1774
|
+
border-left: none;
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
`;
|
|
1778
|
+
const Link = forwardRef(
|
|
1779
|
+
({ children, href, disabled = false, startIcon, endIcon, isExternal = false, ...props }, ref) => {
|
|
1780
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(LinkWrapper$1, { ref, href, disabled, isExternal, ...props, children: [
|
|
1781
|
+
startIcon,
|
|
1782
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { textColor: disabled ? "neutral600" : "primary600", children }),
|
|
1783
|
+
endIcon,
|
|
1784
|
+
href && !endIcon && isExternal && /* @__PURE__ */ jsxRuntime.jsx(icons.ExternalLink, {})
|
|
1785
|
+
] });
|
|
1786
|
+
}
|
|
1787
|
+
);
|
|
1788
|
+
const LinkWrapper$1 = styledComponents.styled(BaseLinkImpl)`
|
|
1789
|
+
display: inline-flex;
|
|
1790
|
+
align-items: center;
|
|
1791
|
+
text-decoration: none;
|
|
1792
|
+
gap: ${({ theme }) => theme.spaces[2]};
|
|
1793
|
+
pointer-events: ${({ disabled }) => disabled ? "none" : void 0};
|
|
1794
|
+
|
|
1795
|
+
svg {
|
|
1796
|
+
font-size: 1rem;
|
|
1797
|
+
|
|
1798
|
+
path {
|
|
1799
|
+
fill: ${({ disabled, theme }) => disabled ? theme.colors.neutral600 : theme.colors.primary600};
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
&:hover {
|
|
1804
|
+
& > span {
|
|
1805
|
+
color: ${({ theme }) => theme.colors.primary500};
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
&:active {
|
|
1810
|
+
color: ${({ theme }) => theme.colors.primary700};
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
${focus};
|
|
1814
|
+
`;
|
|
1815
|
+
const MenuRoot = DropdownMenu__namespace.Root;
|
|
1816
|
+
const MenuTrigger = React__namespace.forwardRef(
|
|
1817
|
+
({ label, size, endIcon = /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, { width: "1.2rem", height: "1.2rem", "aria-hidden": true }), tag = Button, icon, ...rest }, ref) => {
|
|
1818
|
+
const props = {
|
|
1819
|
+
...rest,
|
|
1820
|
+
ref,
|
|
1821
|
+
type: "button",
|
|
1822
|
+
variant: "ghost",
|
|
1823
|
+
paddingTop: size === "S" ? 1 : 2,
|
|
1824
|
+
paddingBottom: size === "S" ? 1 : 2,
|
|
1825
|
+
paddingLeft: size === "S" ? 3 : 4,
|
|
1826
|
+
paddingRight: size === "S" ? 3 : 4
|
|
1827
|
+
};
|
|
1828
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Trigger, { asChild: true, children: tag === IconButton ? /* @__PURE__ */ jsxRuntime.jsx(IconButton, { label, ...props, children: icon }) : /* @__PURE__ */ jsxRuntime.jsx(Button, { endIcon, ...props }) });
|
|
1573
1829
|
}
|
|
1574
1830
|
);
|
|
1575
1831
|
const MenuContent = React__namespace.forwardRef(
|
|
@@ -1580,8 +1836,6 @@ const MenuContent = React__namespace.forwardRef(
|
|
|
1580
1836
|
{
|
|
1581
1837
|
ref,
|
|
1582
1838
|
direction: "column",
|
|
1583
|
-
borderStyle: "solid",
|
|
1584
|
-
borderWidth: "1px",
|
|
1585
1839
|
borderColor: "neutral150",
|
|
1586
1840
|
hasRadius: true,
|
|
1587
1841
|
background: "neutral0",
|
|
@@ -1618,7 +1872,7 @@ const getOptionStyle = ({ theme }) => styledComponents.css`
|
|
|
1618
1872
|
border-radius: ${theme.borderRadius};
|
|
1619
1873
|
padding: ${theme.spaces[2]} ${theme.spaces[4]};
|
|
1620
1874
|
|
|
1621
|
-
&[aria-disabled] {
|
|
1875
|
+
&[aria-disabled='true'] {
|
|
1622
1876
|
cursor: not-allowed;
|
|
1623
1877
|
color: ${theme.colors.neutral500};
|
|
1624
1878
|
}
|
|
@@ -1723,37 +1977,41 @@ const Menu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
1723
1977
|
SubTrigger,
|
|
1724
1978
|
Trigger: Trigger$6
|
|
1725
1979
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1726
|
-
const SimpleMenu = (
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
}
|
|
1980
|
+
const SimpleMenu = React__namespace.forwardRef(
|
|
1981
|
+
({ children, onOpen, onClose, popoverPlacement, onReachEnd, ...props }, forwardedRef) => {
|
|
1982
|
+
const triggerRef = React__namespace.useRef(null);
|
|
1983
|
+
const composedRef = useComposedRefs(forwardedRef, triggerRef);
|
|
1984
|
+
const contentRef = React__namespace.useRef(null);
|
|
1985
|
+
const [internalIsOpen, setInternalIsOpen] = React__namespace.useState(false);
|
|
1986
|
+
const handleReachEnd = (entry) => {
|
|
1987
|
+
if (onReachEnd) {
|
|
1988
|
+
onReachEnd(entry);
|
|
1989
|
+
}
|
|
1990
|
+
};
|
|
1991
|
+
const handleOpenChange = (isOpen) => {
|
|
1992
|
+
if (isOpen && typeof onOpen === "function") {
|
|
1993
|
+
onOpen();
|
|
1994
|
+
} else if (!isOpen && typeof onClose === "function") {
|
|
1995
|
+
onClose();
|
|
1996
|
+
}
|
|
1997
|
+
setInternalIsOpen(isOpen);
|
|
1998
|
+
};
|
|
1999
|
+
const generatedId = useId();
|
|
2000
|
+
const intersectionId = `intersection-${stripReactIdOfColon(generatedId)}`;
|
|
2001
|
+
useIntersection(contentRef, handleReachEnd, {
|
|
2002
|
+
selectorToWatch: `#${intersectionId}`,
|
|
2003
|
+
/**
|
|
2004
|
+
* We need to know when the select is open because only then will viewportRef
|
|
2005
|
+
* not be null. Because it uses a portal that (sensibly) is not mounted 24/7.
|
|
2006
|
+
*/
|
|
2007
|
+
skipWhen: !internalIsOpen
|
|
2008
|
+
});
|
|
2009
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Root$7, { onOpenChange: handleOpenChange, children: [
|
|
2010
|
+
/* @__PURE__ */ jsxRuntime.jsx(Trigger$6, { ref: composedRef, ...props, children: props.label }),
|
|
2011
|
+
/* @__PURE__ */ jsxRuntime.jsx(Content$6, { ref: contentRef, intersectionId, popoverPlacement, children })
|
|
2012
|
+
] });
|
|
2013
|
+
}
|
|
2014
|
+
);
|
|
1757
2015
|
const MenuItem = Item$3;
|
|
1758
2016
|
const StyledButton = styledComponents.styled(SimpleMenu)`
|
|
1759
2017
|
padding: ${({ theme }) => `${theme.spaces[1]} ${theme.spaces[2]}`};
|
|
@@ -1764,16 +2022,19 @@ const StyledButton = styledComponents.styled(SimpleMenu)`
|
|
|
1764
2022
|
background-color: ${({ theme }) => theme.colors.neutral200};
|
|
1765
2023
|
}
|
|
1766
2024
|
`;
|
|
1767
|
-
const CrumbSimpleMenu =
|
|
2025
|
+
const CrumbSimpleMenu = React__namespace.forwardRef(
|
|
2026
|
+
({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledButton, { ref: forwardedRef, endIcon: null, size: "S", ...props, children })
|
|
2027
|
+
);
|
|
1768
2028
|
CrumbSimpleMenu.displayName = "CrumbSimpleMenu";
|
|
1769
2029
|
const CardContext = React__namespace.createContext({ id: "" });
|
|
1770
2030
|
const useCard = () => React__namespace.useContext(CardContext);
|
|
1771
|
-
const Card = ({ id, ...props }) => {
|
|
2031
|
+
const Card = React__namespace.forwardRef(({ id, ...props }, forwardedRef) => {
|
|
1772
2032
|
const generatedId = useId(id);
|
|
1773
2033
|
const context = React__namespace.useMemo(() => ({ id: generatedId }), [generatedId]);
|
|
1774
2034
|
return /* @__PURE__ */ jsxRuntime.jsx(CardContext.Provider, { value: context, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1775
2035
|
Box,
|
|
1776
2036
|
{
|
|
2037
|
+
ref: forwardedRef,
|
|
1777
2038
|
id,
|
|
1778
2039
|
tabIndex: 0,
|
|
1779
2040
|
hasRadius: true,
|
|
@@ -1787,10 +2048,10 @@ const Card = ({ id, ...props }) => {
|
|
|
1787
2048
|
...props
|
|
1788
2049
|
}
|
|
1789
2050
|
) });
|
|
1790
|
-
};
|
|
1791
|
-
const CardActionImpl = ({ position, ...restProps }) => {
|
|
1792
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CardAction, { $position: position, ...restProps, direction: "row", gap: 2 });
|
|
1793
|
-
};
|
|
2051
|
+
});
|
|
2052
|
+
const CardActionImpl = React__namespace.forwardRef(({ position, ...restProps }, forwardedRef) => {
|
|
2053
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CardAction, { ref: forwardedRef, $position: position, ...restProps, direction: "row", gap: 2 });
|
|
2054
|
+
});
|
|
1794
2055
|
const CardAction = styledComponents.styled(Flex)`
|
|
1795
2056
|
position: absolute;
|
|
1796
2057
|
top: ${({ theme }) => theme.spaces[3]};
|
|
@@ -1841,19 +2102,6 @@ const CardBadge = (props) => /* @__PURE__ */ jsxRuntime.jsx(CardBadgeWrapper, {
|
|
|
1841
2102
|
const CardBody = (props) => {
|
|
1842
2103
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingLeft: 3, paddingRight: 3, paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { ...props, alignItems: "flex-start" }) });
|
|
1843
2104
|
};
|
|
1844
|
-
function setRef(ref, value) {
|
|
1845
|
-
if (typeof ref === "function") {
|
|
1846
|
-
ref(value);
|
|
1847
|
-
} else if (ref !== null && ref !== void 0) {
|
|
1848
|
-
ref.current = value;
|
|
1849
|
-
}
|
|
1850
|
-
}
|
|
1851
|
-
function composeRefs(...refs) {
|
|
1852
|
-
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
1853
|
-
}
|
|
1854
|
-
function useComposedRefs(...refs) {
|
|
1855
|
-
return React__namespace.useCallback(composeRefs(...refs), refs);
|
|
1856
|
-
}
|
|
1857
2105
|
const CheckIcon = ({ fill, ...props }) => {
|
|
1858
2106
|
const { colors } = styledComponents.useTheme();
|
|
1859
2107
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1936,10 +2184,10 @@ const CheckboxImpl = React__namespace.forwardRef(({ children, ...restProps }, fo
|
|
|
1936
2184
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { tag: "label", textColor: "neutral800", htmlFor: labelId, children })
|
|
1937
2185
|
] });
|
|
1938
2186
|
});
|
|
1939
|
-
const CardCheckbox = (props) => {
|
|
2187
|
+
const CardCheckbox = React__namespace.forwardRef((props, forwardedRef) => {
|
|
1940
2188
|
const { id } = useCard();
|
|
1941
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsxRuntime.jsx(CheckboxImpl, { "aria-labelledby": `${id}-title`, ...props }) });
|
|
1942
|
-
};
|
|
2189
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsxRuntime.jsx(CheckboxImpl, { "aria-labelledby": `${id}-title`, ...props, ref: forwardedRef }) });
|
|
2190
|
+
});
|
|
1943
2191
|
const BreakBox = styledComponents.styled(Box)`
|
|
1944
2192
|
word-break: break-all;
|
|
1945
2193
|
`;
|
|
@@ -1991,49 +2239,6 @@ const KeyboardKeys = {
|
|
|
1991
2239
|
BACKSPACE: "Backspace",
|
|
1992
2240
|
CLEAR: "Clear"
|
|
1993
2241
|
};
|
|
1994
|
-
const TooltipImpl = React__namespace.forwardRef(
|
|
1995
|
-
({
|
|
1996
|
-
children,
|
|
1997
|
-
description,
|
|
1998
|
-
label,
|
|
1999
|
-
defaultOpen,
|
|
2000
|
-
open,
|
|
2001
|
-
onOpenChange,
|
|
2002
|
-
delayDuration = 500,
|
|
2003
|
-
disableHoverableContent,
|
|
2004
|
-
...restProps
|
|
2005
|
-
}, forwardedRef) => {
|
|
2006
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2007
|
-
Tooltip__namespace.Root,
|
|
2008
|
-
{
|
|
2009
|
-
defaultOpen,
|
|
2010
|
-
open,
|
|
2011
|
-
onOpenChange,
|
|
2012
|
-
delayDuration,
|
|
2013
|
-
disableHoverableContent,
|
|
2014
|
-
children: [
|
|
2015
|
-
/* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Trigger, { asChild: true, children }),
|
|
2016
|
-
/* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { ref: forwardedRef, sideOffset: 8, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", fontWeight: "bold", children: label || description }) }) })
|
|
2017
|
-
]
|
|
2018
|
-
}
|
|
2019
|
-
);
|
|
2020
|
-
}
|
|
2021
|
-
);
|
|
2022
|
-
const TooltipContent = styledComponents.styled(Tooltip__namespace.Content)`
|
|
2023
|
-
background-color: ${(props) => props.theme.colors.neutral900};
|
|
2024
|
-
color: ${(props) => props.theme.colors.neutral0};
|
|
2025
|
-
padding-inline: ${(props) => props.theme.spaces[2]};
|
|
2026
|
-
padding-block: ${(props) => props.theme.spaces[2]};
|
|
2027
|
-
border-radius: ${(props) => props.theme.borderRadius};
|
|
2028
|
-
z-index: ${(props) => props.theme.zIndices.tooltip};
|
|
2029
|
-
will-change: opacity;
|
|
2030
|
-
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
2031
|
-
|
|
2032
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
2033
|
-
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
2034
|
-
${(props) => props.theme.motion.easings.authenticMotion};
|
|
2035
|
-
}
|
|
2036
|
-
`;
|
|
2037
2242
|
const CarouselGrid = styledComponents.styled(Box)`
|
|
2038
2243
|
grid-template-columns: auto 1fr auto;
|
|
2039
2244
|
grid-template-areas: 'startAction slides endAction';
|
|
@@ -2128,9 +2333,11 @@ const commonTheme = {
|
|
|
2128
2333
|
},
|
|
2129
2334
|
spaces: ["0px", "4px", "8px", "12px", "16px", "20px", "24px", "32px", "40px", "48px", "56px", "64px"],
|
|
2130
2335
|
borderRadius: "4px",
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2336
|
+
breakpoints: {
|
|
2337
|
+
initial: "@media(min-width: 0px)",
|
|
2338
|
+
small: "@media(min-width: 520px)",
|
|
2339
|
+
medium: "@media(min-width: 768px)",
|
|
2340
|
+
large: "@media(min-width: 1280px)"
|
|
2134
2341
|
},
|
|
2135
2342
|
fontSizes: [`1.1rem`, `1.2rem`, `1.4rem`, "1.6rem", `1.8rem`, `3.2rem`],
|
|
2136
2343
|
lineHeights: [1.14, 1.22, 1.25, 1.33, 1.43, 1.45, 1.5],
|
|
@@ -2971,7 +3178,7 @@ lodash.exports;
|
|
|
2971
3178
|
}
|
|
2972
3179
|
var runInContext = function runInContext2(context) {
|
|
2973
3180
|
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
|
|
2974
|
-
var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function,
|
|
3181
|
+
var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError = context.TypeError;
|
|
2975
3182
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
|
2976
3183
|
var coreJsData = context["__core-js_shared__"];
|
|
2977
3184
|
var funcToString = funcProto.toString;
|
|
@@ -2997,7 +3204,7 @@ lodash.exports;
|
|
|
2997
3204
|
}
|
|
2998
3205
|
}();
|
|
2999
3206
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
|
|
3000
|
-
var nativeCeil =
|
|
3207
|
+
var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
|
|
3001
3208
|
var DataView = getNative(context, "DataView"), Map = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set = getNative(context, "Set"), WeakMap = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
|
|
3002
3209
|
var metaMap = WeakMap && new WeakMap();
|
|
3003
3210
|
var realNames = {};
|
|
@@ -4743,7 +4950,7 @@ lodash.exports;
|
|
|
4743
4950
|
return setWrapToString(result2, func, bitmask);
|
|
4744
4951
|
}
|
|
4745
4952
|
function createRound(methodName) {
|
|
4746
|
-
var func =
|
|
4953
|
+
var func = Math2[methodName];
|
|
4747
4954
|
return function(number2, precision) {
|
|
4748
4955
|
number2 = toNumber(number2);
|
|
4749
4956
|
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
|
|
@@ -7845,6 +8052,7 @@ const Label = React__namespace.forwardRef(({ children, action, ...props }, ref)
|
|
|
7845
8052
|
id: `${id}-label`,
|
|
7846
8053
|
htmlFor: id,
|
|
7847
8054
|
tag: "label",
|
|
8055
|
+
ellipsis: true,
|
|
7848
8056
|
children: [
|
|
7849
8057
|
children,
|
|
7850
8058
|
required && /* @__PURE__ */ jsxRuntime.jsx(Typography, { "aria-hidden": true, lineHeight: "1em", textColor: "danger600", children: "*" }),
|
|
@@ -7877,11 +8085,24 @@ const Input$2 = React__namespace.forwardRef(
|
|
|
7877
8085
|
ariaDescription = `${id}-hint`;
|
|
7878
8086
|
}
|
|
7879
8087
|
const hasError = Boolean(error);
|
|
8088
|
+
const endActionRef = React__namespace.useRef(null);
|
|
8089
|
+
const inputElementRef = React__namespace.useRef(null);
|
|
8090
|
+
const inputRef = useComposedRefs(inputElementRef, ref);
|
|
7880
8091
|
const handleChange = (e) => {
|
|
7881
8092
|
if (!disabled && onChange) {
|
|
7882
8093
|
onChange(e);
|
|
7883
8094
|
}
|
|
7884
8095
|
};
|
|
8096
|
+
React__namespace.useLayoutEffect(() => {
|
|
8097
|
+
if (endActionRef.current && inputElementRef.current) {
|
|
8098
|
+
const endActionWidth = endActionRef.current.offsetWidth;
|
|
8099
|
+
const inputElement = inputElementRef.current;
|
|
8100
|
+
if (inputElement) {
|
|
8101
|
+
const inputPadding = endActionWidth + 8 + 16;
|
|
8102
|
+
inputElement.style.paddingRight = `${inputPadding}px`;
|
|
8103
|
+
}
|
|
8104
|
+
}
|
|
8105
|
+
}, [endAction]);
|
|
7885
8106
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7886
8107
|
InputWrapper,
|
|
7887
8108
|
{
|
|
@@ -7889,6 +8110,9 @@ const Input$2 = React__namespace.forwardRef(
|
|
|
7889
8110
|
justifyContent: "space-between",
|
|
7890
8111
|
$hasError: hasError || hasErrorProp,
|
|
7891
8112
|
$disabled: disabled,
|
|
8113
|
+
$size: size,
|
|
8114
|
+
$hasLeftAction: Boolean(startAction),
|
|
8115
|
+
$hasRightAction: Boolean(endAction),
|
|
7892
8116
|
className,
|
|
7893
8117
|
children: [
|
|
7894
8118
|
startAction,
|
|
@@ -7897,9 +8121,7 @@ const Input$2 = React__namespace.forwardRef(
|
|
|
7897
8121
|
{
|
|
7898
8122
|
id,
|
|
7899
8123
|
name,
|
|
7900
|
-
ref,
|
|
7901
|
-
$hasLeftAction: Boolean(startAction),
|
|
7902
|
-
$hasRightAction: Boolean(endAction),
|
|
8124
|
+
ref: inputRef,
|
|
7903
8125
|
$size: size,
|
|
7904
8126
|
"aria-describedby": ariaDescription,
|
|
7905
8127
|
"aria-invalid": hasError || hasErrorProp,
|
|
@@ -7908,10 +8130,12 @@ const Input$2 = React__namespace.forwardRef(
|
|
|
7908
8130
|
"data-disabled": disabled ? "" : void 0,
|
|
7909
8131
|
onChange: handleChange,
|
|
7910
8132
|
"aria-required": required || requiredProp,
|
|
8133
|
+
$hasLeftAction: Boolean(startAction),
|
|
8134
|
+
$hasRightAction: Boolean(endAction),
|
|
7911
8135
|
...props
|
|
7912
8136
|
}
|
|
7913
8137
|
),
|
|
7914
|
-
endAction
|
|
8138
|
+
endAction && /* @__PURE__ */ jsxRuntime.jsx(EndAction, { ref: endActionRef, children: endAction })
|
|
7915
8139
|
]
|
|
7916
8140
|
}
|
|
7917
8141
|
);
|
|
@@ -7930,23 +8154,6 @@ const InputElement = styledComponents.styled.input`
|
|
|
7930
8154
|
width: 100%;
|
|
7931
8155
|
background: inherit;
|
|
7932
8156
|
|
|
7933
|
-
${(props) => {
|
|
7934
|
-
switch (props.$size) {
|
|
7935
|
-
case "S":
|
|
7936
|
-
return styledComponents.css`
|
|
7937
|
-
padding-inline-start: ${props.$hasLeftAction ? props.theme.spaces[3] : props.theme.spaces[4]};
|
|
7938
|
-
padding-inline-end: ${props.$hasRightAction ? props.theme.spaces[3] : props.theme.spaces[4]};
|
|
7939
|
-
padding-block: ${props.theme.spaces[1]};
|
|
7940
|
-
`;
|
|
7941
|
-
default:
|
|
7942
|
-
return styledComponents.css`
|
|
7943
|
-
padding-inline-start: ${props.$hasLeftAction ? props.theme.spaces[3] : props.theme.spaces[4]};
|
|
7944
|
-
padding-inline-end: ${props.$hasRightAction ? props.theme.spaces[3] : props.theme.spaces[4]};
|
|
7945
|
-
padding-block: ${props.theme.spaces[2]};
|
|
7946
|
-
`;
|
|
7947
|
-
}
|
|
7948
|
-
}};
|
|
7949
|
-
|
|
7950
8157
|
::placeholder {
|
|
7951
8158
|
color: ${({ theme }) => theme.colors.neutral500};
|
|
7952
8159
|
opacity: 1;
|
|
@@ -7961,17 +8168,42 @@ const InputElement = styledComponents.styled.input`
|
|
|
7961
8168
|
outline: none;
|
|
7962
8169
|
box-shadow: none;
|
|
7963
8170
|
}
|
|
8171
|
+
|
|
8172
|
+
${(props) => {
|
|
8173
|
+
switch (props.$size) {
|
|
8174
|
+
case "S":
|
|
8175
|
+
return styledComponents.css`
|
|
8176
|
+
padding-inline-start: ${props.$hasLeftAction ? 0 : props.theme.spaces[4]};
|
|
8177
|
+
padding-inline-end: ${props.$hasRightAction ? 0 : props.theme.spaces[4]};
|
|
8178
|
+
padding-block: ${props.theme.spaces[1]};
|
|
8179
|
+
`;
|
|
8180
|
+
default:
|
|
8181
|
+
return styledComponents.css`
|
|
8182
|
+
padding-inline-start: ${props.$hasLeftAction ? 0 : props.theme.spaces[4]};
|
|
8183
|
+
padding-inline-end: ${props.$hasRightAction ? 0 : props.theme.spaces[4]};
|
|
8184
|
+
padding-block: ${props.theme.spaces[2]};
|
|
8185
|
+
`;
|
|
8186
|
+
}
|
|
8187
|
+
}}
|
|
8188
|
+
`;
|
|
8189
|
+
const EndAction = styledComponents.styled(Flex)`
|
|
8190
|
+
position: absolute;
|
|
8191
|
+
right: ${({ theme }) => theme.spaces[4]};
|
|
8192
|
+
top: 50%;
|
|
8193
|
+
transform: translateY(-50%);
|
|
7964
8194
|
`;
|
|
7965
8195
|
const InputWrapper = styledComponents.styled(Flex)`
|
|
7966
8196
|
border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
|
7967
8197
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
7968
8198
|
background: ${({ theme }) => theme.colors.neutral0};
|
|
7969
|
-
${
|
|
8199
|
+
padding-inline-start: ${({ $hasLeftAction, theme }) => $hasLeftAction ? theme.spaces[4] : 0};
|
|
8200
|
+
position: relative;
|
|
7970
8201
|
|
|
8202
|
+
${inputFocusStyle()}
|
|
7971
8203
|
${({ theme, $disabled }) => $disabled ? styledComponents.css`
|
|
7972
8204
|
color: ${theme.colors.neutral600};
|
|
7973
8205
|
background: ${theme.colors.neutral150};
|
|
7974
|
-
` : void 0}
|
|
8206
|
+
` : void 0};
|
|
7975
8207
|
`;
|
|
7976
8208
|
const Hint = () => {
|
|
7977
8209
|
const { id, hint, error } = useField("Hint");
|
|
@@ -8498,19 +8730,7 @@ const ContentImpl$1 = styledComponents.styled(AlertDialog__namespace.Content)`
|
|
|
8498
8730
|
}
|
|
8499
8731
|
`;
|
|
8500
8732
|
const Header$1 = React__namespace.forwardRef(({ children, ...restProps }, forwardedRef) => {
|
|
8501
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AlertDialog__namespace.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8502
|
-
Title$1,
|
|
8503
|
-
{
|
|
8504
|
-
tag: "h2",
|
|
8505
|
-
ref: forwardedRef,
|
|
8506
|
-
padding: 6,
|
|
8507
|
-
justifyContent: "center",
|
|
8508
|
-
variant: "h2",
|
|
8509
|
-
fontWeight: "bold",
|
|
8510
|
-
...restProps,
|
|
8511
|
-
children
|
|
8512
|
-
}
|
|
8513
|
-
) });
|
|
8733
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AlertDialog__namespace.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Title$1, { tag: "h2", variant: "beta", ref: forwardedRef, padding: 6, fontWeight: "bold", ...restProps, children }) });
|
|
8514
8734
|
});
|
|
8515
8735
|
const Title$1 = styledComponents.styled(Typography)`
|
|
8516
8736
|
display: flex;
|
|
@@ -8684,8 +8904,7 @@ ${styledComponents.css`
|
|
|
8684
8904
|
img,
|
|
8685
8905
|
picture,
|
|
8686
8906
|
video,
|
|
8687
|
-
canvas
|
|
8688
|
-
svg {
|
|
8907
|
+
canvas {
|
|
8689
8908
|
display: block;
|
|
8690
8909
|
max-width: 100%;
|
|
8691
8910
|
}
|
|
@@ -8921,8 +9140,7 @@ const SelectContent = styledComponents.styled(uiPrimitives.Select.Content)`
|
|
|
8921
9140
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
8922
9141
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
8923
9142
|
min-width: var(--radix-select-trigger-width);
|
|
8924
|
-
|
|
8925
|
-
max-height: 15rem;
|
|
9143
|
+
max-height: 15.6rem;
|
|
8926
9144
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
8927
9145
|
|
|
8928
9146
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -9099,7 +9317,7 @@ const SingleSelectOption = React__namespace.forwardRef(
|
|
|
9099
9317
|
({ value, startIcon, children, ...restProps }, ref) => {
|
|
9100
9318
|
return /* @__PURE__ */ jsxRuntime.jsxs(Item$2, { ref, value: value.toString(), ...restProps, children: [
|
|
9101
9319
|
startIcon && /* @__PURE__ */ jsxRuntime.jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
|
|
9102
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { children: /* @__PURE__ */ jsxRuntime.jsx(ItemText, { children }) })
|
|
9320
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { lineHeight: "20px", children: /* @__PURE__ */ jsxRuntime.jsx(ItemText, { children }) })
|
|
9103
9321
|
] });
|
|
9104
9322
|
}
|
|
9105
9323
|
);
|
|
@@ -10095,238 +10313,27 @@ const EmptyStateIconWrapper = styledComponents.styled(Box)`
|
|
|
10095
10313
|
height: 8.8rem;
|
|
10096
10314
|
}
|
|
10097
10315
|
`;
|
|
10098
|
-
const EmptyStateLayout = (
|
|
10099
|
-
icon,
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
hasRadius = true,
|
|
10103
|
-
shadow = "tableShadow"
|
|
10104
|
-
}) => {
|
|
10105
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10106
|
-
Flex,
|
|
10107
|
-
{
|
|
10108
|
-
alignItems: "center",
|
|
10109
|
-
direction: "column",
|
|
10110
|
-
padding: 11,
|
|
10111
|
-
background: "neutral0",
|
|
10112
|
-
hasRadius,
|
|
10113
|
-
shadow,
|
|
10114
|
-
children: [
|
|
10115
|
-
icon ? /* @__PURE__ */ jsxRuntime.jsx(EmptyStateIconWrapper, { paddingBottom: 6, "aria-hidden": true, children: icon }) : null,
|
|
10116
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "delta", tag: "p", textAlign: "center", textColor: "neutral600", children: content }) }),
|
|
10117
|
-
action
|
|
10118
|
-
]
|
|
10119
|
-
}
|
|
10120
|
-
);
|
|
10121
|
-
};
|
|
10122
|
-
const getFocusableNodes = (node, includeNegativeTabIndex) => {
|
|
10123
|
-
const nodes = [
|
|
10124
|
-
...node.querySelectorAll(
|
|
10125
|
-
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
10126
|
-
)
|
|
10127
|
-
];
|
|
10128
|
-
const focusables = nodes.filter((node2) => {
|
|
10129
|
-
if (node2.hasAttribute("disabled"))
|
|
10130
|
-
return false;
|
|
10131
|
-
if (includeNegativeTabIndex)
|
|
10132
|
-
return true;
|
|
10133
|
-
return node2.getAttribute("tabindex") !== "-1";
|
|
10134
|
-
});
|
|
10135
|
-
return focusables;
|
|
10136
|
-
};
|
|
10137
|
-
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
10138
|
-
return nodes.filter((node) => {
|
|
10139
|
-
if (node.tagName === "INPUT") {
|
|
10140
|
-
return node.type !== "checkbox" && node.type !== "radio";
|
|
10141
|
-
}
|
|
10142
|
-
return false;
|
|
10143
|
-
});
|
|
10144
|
-
};
|
|
10145
|
-
const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
|
|
10146
|
-
const trappedRef = React__namespace.useRef(null);
|
|
10147
|
-
React__namespace.useEffect(() => {
|
|
10148
|
-
let currentFocus = null;
|
|
10149
|
-
if (restoreFocus) {
|
|
10150
|
-
currentFocus = document.activeElement;
|
|
10151
|
-
}
|
|
10152
|
-
return () => {
|
|
10153
|
-
if (currentFocus) {
|
|
10154
|
-
currentFocus.focus();
|
|
10155
|
-
}
|
|
10156
|
-
};
|
|
10157
|
-
}, [restoreFocus]);
|
|
10158
|
-
React__namespace.useEffect(() => {
|
|
10159
|
-
if (!trappedRef.current || skipAutoFocus)
|
|
10160
|
-
return;
|
|
10161
|
-
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
10162
|
-
if (focusableChildren.length > 0) {
|
|
10163
|
-
const firstElement = focusableChildren[0];
|
|
10164
|
-
firstElement.focus();
|
|
10165
|
-
} else {
|
|
10166
|
-
console.warn(
|
|
10167
|
-
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
10168
|
-
);
|
|
10169
|
-
}
|
|
10170
|
-
}, [skipAutoFocus]);
|
|
10171
|
-
const handleKeyDown = (e) => {
|
|
10172
|
-
if (e.key === KeyboardKeys.ESCAPE && onEscape) {
|
|
10173
|
-
onEscape();
|
|
10174
|
-
return;
|
|
10175
|
-
}
|
|
10176
|
-
if (e.key !== KeyboardKeys.TAB)
|
|
10177
|
-
return;
|
|
10178
|
-
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
10179
|
-
if (focusableChildren.length > 0) {
|
|
10180
|
-
const firstElement = focusableChildren[0];
|
|
10181
|
-
const lastElement = focusableChildren[focusableChildren.length - 1];
|
|
10182
|
-
if (e.shiftKey) {
|
|
10183
|
-
if (firstElement === document.activeElement) {
|
|
10184
|
-
e.preventDefault();
|
|
10185
|
-
lastElement.focus();
|
|
10186
|
-
}
|
|
10187
|
-
} else if (lastElement === document.activeElement) {
|
|
10188
|
-
e.preventDefault();
|
|
10189
|
-
firstElement.focus();
|
|
10190
|
-
}
|
|
10191
|
-
}
|
|
10192
|
-
};
|
|
10193
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
|
|
10194
|
-
};
|
|
10195
|
-
const Root$3 = forwardRef((props, forwardedRef) => {
|
|
10196
|
-
const { gap = 0, gridCols = 12, ...rest } = props;
|
|
10197
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper$1, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
|
|
10198
|
-
});
|
|
10199
|
-
const Wrapper$1 = styledComponents.styled(Box)`
|
|
10200
|
-
display: grid;
|
|
10201
|
-
grid-template-columns: repeat(${({ $gridCols }) => $gridCols}, 1fr);
|
|
10202
|
-
${({ theme, $gap }) => handleResponsiveValues("gap", $gap, theme)}
|
|
10203
|
-
`;
|
|
10204
|
-
const ItemImpl = forwardRef(
|
|
10205
|
-
({ col, s, xs, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(Item$1, { ref: forwardedRef, $col: col, $s: s, $xs: xs, ...props })
|
|
10206
|
-
);
|
|
10207
|
-
const Item$1 = styledComponents.styled(Box)`
|
|
10208
|
-
grid-column: span ${({ $col }) => $col ?? 1};
|
|
10209
|
-
max-width: 100%;
|
|
10210
|
-
|
|
10211
|
-
${({ theme }) => theme.mediaQueries.tablet} {
|
|
10212
|
-
grid-column: span ${({ $s }) => $s};
|
|
10213
|
-
}
|
|
10214
|
-
|
|
10215
|
-
${({ theme }) => theme.mediaQueries.mobile} {
|
|
10216
|
-
grid-column: span ${({ $xs }) => $xs};
|
|
10217
|
-
}
|
|
10218
|
-
`;
|
|
10219
|
-
const Grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10220
|
-
__proto__: null,
|
|
10221
|
-
Item: ItemImpl,
|
|
10222
|
-
Root: Root$3
|
|
10223
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
10224
|
-
const VARIANT_DEFAULT = "tertiary";
|
|
10225
|
-
const VARIANT_SECONDARY = "secondary";
|
|
10226
|
-
const SIZES = ["S", "M", "L"];
|
|
10227
|
-
const VARIANTS = [VARIANT_DEFAULT, VARIANT_SECONDARY];
|
|
10228
|
-
const IconButton = forwardRef(
|
|
10229
|
-
({
|
|
10230
|
-
label,
|
|
10231
|
-
background,
|
|
10232
|
-
children,
|
|
10233
|
-
disabled = false,
|
|
10234
|
-
onClick,
|
|
10235
|
-
size = SIZES[0],
|
|
10236
|
-
variant: variant2 = VARIANTS[0],
|
|
10237
|
-
withTooltip = true,
|
|
10238
|
-
...restProps
|
|
10239
|
-
}, ref) => {
|
|
10240
|
-
const handleClick = (e) => {
|
|
10241
|
-
if (!disabled && onClick) {
|
|
10242
|
-
onClick(e);
|
|
10243
|
-
}
|
|
10244
|
-
};
|
|
10245
|
-
const component = /* @__PURE__ */ jsxRuntime.jsx(
|
|
10246
|
-
IconButtonWrapper,
|
|
10316
|
+
const EmptyStateLayout = React__namespace.forwardRef(
|
|
10317
|
+
({ icon, content, action, hasRadius = true, shadow = "tableShadow" }, forwardedRef) => {
|
|
10318
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10319
|
+
Flex,
|
|
10247
10320
|
{
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10321
|
+
ref: forwardedRef,
|
|
10322
|
+
alignItems: "center",
|
|
10323
|
+
direction: "column",
|
|
10324
|
+
padding: 11,
|
|
10325
|
+
background: "neutral0",
|
|
10326
|
+
hasRadius,
|
|
10327
|
+
shadow,
|
|
10328
|
+
children: [
|
|
10329
|
+
icon ? /* @__PURE__ */ jsxRuntime.jsx(EmptyStateIconWrapper, { paddingBottom: 6, "aria-hidden": true, children: icon }) : null,
|
|
10330
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "delta", tag: "p", textAlign: "center", textColor: "neutral600", children: content }) }),
|
|
10331
|
+
action
|
|
10332
|
+
]
|
|
10257
10333
|
}
|
|
10258
10334
|
);
|
|
10259
|
-
return withTooltip ? /* @__PURE__ */ jsxRuntime.jsx(TooltipImpl, { label, children: component }) : component;
|
|
10260
10335
|
}
|
|
10261
10336
|
);
|
|
10262
|
-
const IconButtonWrapper = styledComponents.styled(BaseButton)`
|
|
10263
|
-
background-color: ${({ theme, $variant }) => {
|
|
10264
|
-
if ($variant === VARIANT_SECONDARY) {
|
|
10265
|
-
return theme.colors.primary100;
|
|
10266
|
-
}
|
|
10267
|
-
return void 0;
|
|
10268
|
-
}};
|
|
10269
|
-
border-color: ${({ theme, $variant }) => {
|
|
10270
|
-
if ($variant === VARIANT_SECONDARY) {
|
|
10271
|
-
return theme.colors.primary200;
|
|
10272
|
-
}
|
|
10273
|
-
return theme.colors.neutral200;
|
|
10274
|
-
}};
|
|
10275
|
-
height: ${({ theme, $size }) => theme.sizes.button[$size]};
|
|
10276
|
-
width: ${({ theme, $size }) => theme.sizes.button[$size]};
|
|
10277
|
-
color: ${({ theme, $variant }) => {
|
|
10278
|
-
if ($variant === VARIANT_SECONDARY) {
|
|
10279
|
-
return theme.colors.primary500;
|
|
10280
|
-
}
|
|
10281
|
-
return theme.colors.neutral500;
|
|
10282
|
-
}};
|
|
10283
|
-
|
|
10284
|
-
&:hover,
|
|
10285
|
-
&:focus {
|
|
10286
|
-
color: ${({ theme, $variant }) => {
|
|
10287
|
-
if ($variant === VARIANT_SECONDARY) {
|
|
10288
|
-
return theme.colors.primary600;
|
|
10289
|
-
}
|
|
10290
|
-
return theme.colors.neutral600;
|
|
10291
|
-
}};
|
|
10292
|
-
}
|
|
10293
|
-
|
|
10294
|
-
&[aria-disabled='true'] {
|
|
10295
|
-
color: ${({ theme }) => theme.colors.neutral600};
|
|
10296
|
-
}
|
|
10297
|
-
`;
|
|
10298
|
-
const IconButtonGroup = styledComponents.styled(Flex)`
|
|
10299
|
-
& ${IconButtonWrapper}:first-child {
|
|
10300
|
-
border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
|
|
10301
|
-
}
|
|
10302
|
-
|
|
10303
|
-
& ${IconButtonWrapper}:last-child {
|
|
10304
|
-
border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
|
|
10305
|
-
}
|
|
10306
|
-
|
|
10307
|
-
& ${IconButtonWrapper} {
|
|
10308
|
-
border-radius: 0;
|
|
10309
|
-
color: ${({ theme }) => theme.colors.neutral700};
|
|
10310
|
-
|
|
10311
|
-
& + ${IconButtonWrapper} {
|
|
10312
|
-
border-left: none;
|
|
10313
|
-
}
|
|
10314
|
-
|
|
10315
|
-
&:hover {
|
|
10316
|
-
background-color: ${({ theme }) => theme.colors.neutral100};
|
|
10317
|
-
color: ${({ theme }) => theme.colors.neutral800};
|
|
10318
|
-
}
|
|
10319
|
-
|
|
10320
|
-
&:active {
|
|
10321
|
-
background-color: ${({ theme }) => theme.colors.neutral150};
|
|
10322
|
-
color: ${({ theme }) => theme.colors.neutral900};
|
|
10323
|
-
}
|
|
10324
|
-
|
|
10325
|
-
&[aria-disabled='true'] {
|
|
10326
|
-
color: ${({ theme }) => theme.colors.neutral600};
|
|
10327
|
-
}
|
|
10328
|
-
}
|
|
10329
|
-
`;
|
|
10330
10337
|
const addMarks = state.StateEffect.define();
|
|
10331
10338
|
const filterMarks = state.StateEffect.define();
|
|
10332
10339
|
const lineHighlightMark = view.Decoration.mark({
|
|
@@ -10504,62 +10511,19 @@ const JSONInputContainer = styledComponents.styled(Flex)`
|
|
|
10504
10511
|
}
|
|
10505
10512
|
`;
|
|
10506
10513
|
const LinkButton = forwardRef(
|
|
10507
|
-
({
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10511
|
-
LinkWrapper$1,
|
|
10514
|
+
({ disabled, ...restProps }, ref) => {
|
|
10515
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10516
|
+
Button,
|
|
10512
10517
|
{
|
|
10513
10518
|
ref,
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
hasRadius: true,
|
|
10519
|
-
display: "inline-flex",
|
|
10520
|
-
paddingBottom: paddingX,
|
|
10521
|
-
paddingLeft: paddingY,
|
|
10522
|
-
paddingRight: paddingY,
|
|
10523
|
-
paddingTop: paddingX,
|
|
10524
|
-
pointerEvents: disabled ? "none" : void 0,
|
|
10525
|
-
...props,
|
|
10526
|
-
children: [
|
|
10527
|
-
startIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { "aria-hidden": true, children: startIcon }),
|
|
10528
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: size === "S" ? "pi" : void 0, fontWeight: "bold", children }),
|
|
10529
|
-
endIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { "aria-hidden": true, children: endIcon })
|
|
10530
|
-
]
|
|
10519
|
+
tag: BaseLinkImpl,
|
|
10520
|
+
tabIndex: disabled ? -1 : void 0,
|
|
10521
|
+
disabled,
|
|
10522
|
+
...restProps
|
|
10531
10523
|
}
|
|
10532
10524
|
);
|
|
10533
10525
|
}
|
|
10534
10526
|
);
|
|
10535
|
-
const LinkWrapper$1 = styledComponents.styled(BaseLink)`
|
|
10536
|
-
gap: ${({ theme }) => theme.spaces[2]};
|
|
10537
|
-
|
|
10538
|
-
${focus}
|
|
10539
|
-
|
|
10540
|
-
&[aria-disabled='true'] {
|
|
10541
|
-
pointer-events: none;
|
|
10542
|
-
}
|
|
10543
|
-
|
|
10544
|
-
text-decoration: none;
|
|
10545
|
-
|
|
10546
|
-
&[aria-disabled='true'] {
|
|
10547
|
-
${getDisabledStyle}
|
|
10548
|
-
&:active {
|
|
10549
|
-
${getDisabledStyle}
|
|
10550
|
-
}
|
|
10551
|
-
}
|
|
10552
|
-
|
|
10553
|
-
&:hover {
|
|
10554
|
-
${getHoverStyle}
|
|
10555
|
-
}
|
|
10556
|
-
|
|
10557
|
-
&:active {
|
|
10558
|
-
${getActiveStyle}
|
|
10559
|
-
}
|
|
10560
|
-
|
|
10561
|
-
${getVariantStyle}
|
|
10562
|
-
`;
|
|
10563
10527
|
const MainWrapper = styledComponents.styled(Box)`
|
|
10564
10528
|
// To prevent global outline on focus visible to force an outline when Main is focused
|
|
10565
10529
|
&:focus-visible {
|
|
@@ -10595,6 +10559,7 @@ const SkipToContent = ({ children }) => {
|
|
|
10595
10559
|
}
|
|
10596
10560
|
);
|
|
10597
10561
|
};
|
|
10562
|
+
const setOpacity = (hex, alpha) => `${hex}${Math.floor(alpha * 255).toString(16).padStart(2, "0")}`;
|
|
10598
10563
|
const ScrollAreaImpl$1 = React__namespace.forwardRef(
|
|
10599
10564
|
({ children, viewportRef, ...restProps }, forwardedRef) => {
|
|
10600
10565
|
return /* @__PURE__ */ jsxRuntime.jsxs(ScrollAreaRoot, { ref: forwardedRef, ...restProps, children: [
|
|
@@ -10649,22 +10614,18 @@ const Thumb = styledComponents.styled(ScrollArea__namespace.Thumb)`
|
|
|
10649
10614
|
min-height: 44px;
|
|
10650
10615
|
}
|
|
10651
10616
|
`;
|
|
10652
|
-
const Root$
|
|
10617
|
+
const Root$3 = Dialog__namespace.Root;
|
|
10653
10618
|
const Trigger$2 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
10654
10619
|
return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
10655
10620
|
});
|
|
10656
10621
|
const Content$2 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
10657
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
10658
|
-
/* @__PURE__ */ jsxRuntime.jsx(Overlay, {}),
|
|
10659
|
-
/* @__PURE__ */ jsxRuntime.jsx(ContentImpl, { ref: forwardedRef, ...props })
|
|
10660
|
-
] });
|
|
10622
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(Overlay, { children: /* @__PURE__ */ jsxRuntime.jsx(ContentImpl, { ref: forwardedRef, ...props }) }) });
|
|
10661
10623
|
});
|
|
10662
10624
|
const Overlay = styledComponents.styled(Dialog__namespace.Overlay)`
|
|
10663
|
-
background
|
|
10625
|
+
background: ${(props) => setOpacity(props.theme.colors.neutral800, 0.2)};
|
|
10664
10626
|
position: fixed;
|
|
10665
10627
|
inset: 0;
|
|
10666
10628
|
z-index: ${(props) => props.theme.zIndices.overlay};
|
|
10667
|
-
opacity: 0.2;
|
|
10668
10629
|
|
|
10669
10630
|
@media (prefers-reduced-motion: no-preference) {
|
|
10670
10631
|
animation: ${ANIMATIONS.overlayFadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
@@ -10673,8 +10634,8 @@ const Overlay = styledComponents.styled(Dialog__namespace.Overlay)`
|
|
|
10673
10634
|
`;
|
|
10674
10635
|
const ContentImpl = styledComponents.styled(Dialog__namespace.Content)`
|
|
10675
10636
|
max-width: 83rem;
|
|
10676
|
-
max-height:
|
|
10677
|
-
height:
|
|
10637
|
+
max-height: 90vh;
|
|
10638
|
+
height: auto;
|
|
10678
10639
|
width: 60%;
|
|
10679
10640
|
overflow: hidden;
|
|
10680
10641
|
margin: 0 auto;
|
|
@@ -10776,7 +10737,7 @@ const Modal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
10776
10737
|
Content: Content$2,
|
|
10777
10738
|
Footer,
|
|
10778
10739
|
Header,
|
|
10779
|
-
Root: Root$
|
|
10740
|
+
Root: Root$3,
|
|
10780
10741
|
Title,
|
|
10781
10742
|
Trigger: Trigger$2
|
|
10782
10743
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -10963,7 +10924,7 @@ const NextLink = forwardRef(
|
|
|
10963
10924
|
] });
|
|
10964
10925
|
}
|
|
10965
10926
|
);
|
|
10966
|
-
const LinkWrapper = styledComponents.styled(
|
|
10927
|
+
const LinkWrapper = styledComponents.styled(BaseLinkImpl)`
|
|
10967
10928
|
padding: ${({ theme }) => theme.spaces[3]};
|
|
10968
10929
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
10969
10930
|
box-shadow: ${({ $active, theme }) => $active ? theme.shadows.filterShadow : void 0};
|
|
@@ -11012,7 +10973,7 @@ const Dots = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsxs(Box, {
|
|
|
11012
10973
|
/* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden, { children }),
|
|
11013
10974
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { "aria-hidden": true, lineHeight: "revert", textColor: "neutral800", variant: "pi", children: "…" })
|
|
11014
10975
|
] });
|
|
11015
|
-
const Root$
|
|
10976
|
+
const Root$2 = Popover__namespace.Root;
|
|
11016
10977
|
const Trigger$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
11017
10978
|
return /* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
11018
10979
|
});
|
|
@@ -11024,6 +10985,7 @@ const PopoverContent = styledComponents.styled(Popover__namespace.Content)`
|
|
|
11024
10985
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
11025
10986
|
background-color: ${(props) => props.theme.colors.neutral0};
|
|
11026
10987
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
10988
|
+
border-radius: ${({ theme }) => theme.borderRadius};
|
|
11027
10989
|
|
|
11028
10990
|
@media (prefers-reduced-motion: no-preference) {
|
|
11029
10991
|
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
@@ -11053,26 +11015,29 @@ const PopoverContent = styledComponents.styled(Popover__namespace.Content)`
|
|
|
11053
11015
|
}
|
|
11054
11016
|
}
|
|
11055
11017
|
`;
|
|
11056
|
-
const ScrollAreaImpl = (
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
}
|
|
11018
|
+
const ScrollAreaImpl = React__namespace.forwardRef(
|
|
11019
|
+
({ children, intersectionId, onReachEnd, ...props }, forwardedRef) => {
|
|
11020
|
+
const popoverRef = React__namespace.useRef(null);
|
|
11021
|
+
const composedRef = useComposedRefs(popoverRef, forwardedRef);
|
|
11022
|
+
const generatedIntersectionId = useId();
|
|
11023
|
+
useIntersection(popoverRef, onReachEnd ?? (() => {
|
|
11024
|
+
}), {
|
|
11025
|
+
selectorToWatch: `#${stripReactIdOfColon(generatedIntersectionId)}`,
|
|
11026
|
+
skipWhen: !intersectionId || !onReachEnd
|
|
11027
|
+
});
|
|
11028
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(PopoverScrollArea, { ref: composedRef, ...props, children: [
|
|
11029
|
+
children,
|
|
11030
|
+
intersectionId && onReachEnd && /* @__PURE__ */ jsxRuntime.jsx(Box, { id: stripReactIdOfColon(generatedIntersectionId), width: "100%", height: "1px" })
|
|
11031
|
+
] });
|
|
11032
|
+
}
|
|
11033
|
+
);
|
|
11069
11034
|
const PopoverScrollArea = styledComponents.styled(ScrollAreaImpl$1)`
|
|
11070
11035
|
height: 20rem;
|
|
11071
11036
|
`;
|
|
11072
11037
|
const Popover = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11073
11038
|
__proto__: null,
|
|
11074
11039
|
Content: Content$1,
|
|
11075
|
-
Root: Root$
|
|
11040
|
+
Root: Root$2,
|
|
11076
11041
|
ScrollArea: ScrollAreaImpl,
|
|
11077
11042
|
Trigger: Trigger$1
|
|
11078
11043
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -11112,7 +11077,7 @@ const RadioGroupRoot = styledComponents.styled(RadioGroup__namespace.Root)`
|
|
|
11112
11077
|
flex-direction: column;
|
|
11113
11078
|
gap: ${(props) => props.theme.spaces[3]};
|
|
11114
11079
|
`;
|
|
11115
|
-
const Item = React__namespace.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
|
|
11080
|
+
const Item$1 = React__namespace.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
|
|
11116
11081
|
const id = useId(idProp);
|
|
11117
11082
|
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: 2, children: [
|
|
11118
11083
|
/* @__PURE__ */ jsxRuntime.jsx(RadioGroupItem, { id, ref: forwardedRef, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupIndicator, {}) }),
|
|
@@ -11181,7 +11146,7 @@ const RadioGroupIndicator = styledComponents.styled(RadioGroup__namespace.Indica
|
|
|
11181
11146
|
const Radio = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11182
11147
|
__proto__: null,
|
|
11183
11148
|
Group,
|
|
11184
|
-
Item
|
|
11149
|
+
Item: Item$1
|
|
11185
11150
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
11186
11151
|
const focusFocusable = (node) => {
|
|
11187
11152
|
const nextNode = node.querySelector('[tabindex="0"]');
|
|
@@ -11197,172 +11162,194 @@ const RawTableContext = React__namespace.createContext({
|
|
|
11197
11162
|
}
|
|
11198
11163
|
});
|
|
11199
11164
|
const useTable = () => React__namespace.useContext(RawTableContext);
|
|
11200
|
-
const RawTable = (
|
|
11201
|
-
colCount,
|
|
11202
|
-
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
}) => {
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
setRowIndex(rowIndex2);
|
|
11215
|
-
}, []);
|
|
11216
|
-
React__namespace.useEffect(() => {
|
|
11217
|
-
if (mountedRef.current) {
|
|
11218
|
-
focusFocusable(tableRef.current);
|
|
11219
|
-
}
|
|
11220
|
-
if (!mountedRef.current) {
|
|
11221
|
-
mountedRef.current = true;
|
|
11222
|
-
}
|
|
11223
|
-
}, [colIndex, rowIndex]);
|
|
11224
|
-
const handleKeyDown = (e) => {
|
|
11225
|
-
switch (e.key) {
|
|
11226
|
-
case KeyboardKeys.RIGHT: {
|
|
11227
|
-
e.preventDefault();
|
|
11228
|
-
setColIndex((prevColIndex) => prevColIndex < colCount - 1 ? prevColIndex + 1 : prevColIndex);
|
|
11229
|
-
break;
|
|
11230
|
-
}
|
|
11231
|
-
case KeyboardKeys.LEFT: {
|
|
11232
|
-
e.preventDefault();
|
|
11233
|
-
setColIndex((prevColIndex) => prevColIndex > 0 ? prevColIndex - 1 : prevColIndex);
|
|
11234
|
-
break;
|
|
11165
|
+
const RawTable = React__namespace.forwardRef(
|
|
11166
|
+
({ colCount, rowCount, jumpStep = 3, initialCol = 0, initialRow = 0, ...props }, forwardedRef) => {
|
|
11167
|
+
const tableRef = React__namespace.useRef(null);
|
|
11168
|
+
const mountedRef = React__namespace.useRef(false);
|
|
11169
|
+
const composedRef = useComposedRefs(tableRef, forwardedRef);
|
|
11170
|
+
const [rowIndex, setRowIndex] = React__namespace.useState(initialRow);
|
|
11171
|
+
const [colIndex, setColIndex] = React__namespace.useState(initialCol);
|
|
11172
|
+
const setTableValues = React__namespace.useCallback(({ colIndex: colIndex2, rowIndex: rowIndex2 }) => {
|
|
11173
|
+
setColIndex(colIndex2);
|
|
11174
|
+
setRowIndex(rowIndex2);
|
|
11175
|
+
}, []);
|
|
11176
|
+
React__namespace.useEffect(() => {
|
|
11177
|
+
if (mountedRef.current) {
|
|
11178
|
+
focusFocusable(tableRef.current);
|
|
11235
11179
|
}
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
setRowIndex((prevRowIndex) => prevRowIndex > 0 ? prevRowIndex - 1 : prevRowIndex);
|
|
11239
|
-
break;
|
|
11180
|
+
if (!mountedRef.current) {
|
|
11181
|
+
mountedRef.current = true;
|
|
11240
11182
|
}
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
if (e.ctrlKey) {
|
|
11249
|
-
setRowIndex(0);
|
|
11183
|
+
}, [colIndex, rowIndex]);
|
|
11184
|
+
const handleKeyDown = (e) => {
|
|
11185
|
+
switch (e.key) {
|
|
11186
|
+
case KeyboardKeys.RIGHT: {
|
|
11187
|
+
e.preventDefault();
|
|
11188
|
+
setColIndex((prevColIndex) => prevColIndex < colCount - 1 ? prevColIndex + 1 : prevColIndex);
|
|
11189
|
+
break;
|
|
11250
11190
|
}
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
|
|
11191
|
+
case KeyboardKeys.LEFT: {
|
|
11192
|
+
e.preventDefault();
|
|
11193
|
+
setColIndex((prevColIndex) => prevColIndex > 0 ? prevColIndex - 1 : prevColIndex);
|
|
11194
|
+
break;
|
|
11195
|
+
}
|
|
11196
|
+
case KeyboardKeys.UP: {
|
|
11197
|
+
e.preventDefault();
|
|
11198
|
+
setRowIndex((prevRowIndex) => prevRowIndex > 0 ? prevRowIndex - 1 : prevRowIndex);
|
|
11199
|
+
break;
|
|
11200
|
+
}
|
|
11201
|
+
case KeyboardKeys.DOWN: {
|
|
11202
|
+
e.preventDefault();
|
|
11203
|
+
setRowIndex((prevRowIndex) => prevRowIndex < rowCount - 1 ? prevRowIndex + 1 : prevRowIndex);
|
|
11204
|
+
break;
|
|
11205
|
+
}
|
|
11206
|
+
case KeyboardKeys.HOME: {
|
|
11207
|
+
e.preventDefault();
|
|
11208
|
+
if (e.ctrlKey) {
|
|
11209
|
+
setRowIndex(0);
|
|
11210
|
+
}
|
|
11211
|
+
setColIndex(0);
|
|
11212
|
+
break;
|
|
11213
|
+
}
|
|
11214
|
+
case KeyboardKeys.END: {
|
|
11215
|
+
e.preventDefault();
|
|
11216
|
+
if (e.ctrlKey) {
|
|
11217
|
+
setRowIndex(rowCount - 1);
|
|
11218
|
+
}
|
|
11219
|
+
setColIndex(colCount - 1);
|
|
11220
|
+
break;
|
|
11221
|
+
}
|
|
11222
|
+
case KeyboardKeys.PAGE_DOWN: {
|
|
11223
|
+
e.preventDefault();
|
|
11224
|
+
setRowIndex((prevRowIndex) => prevRowIndex + jumpStep < rowCount ? prevRowIndex + jumpStep : rowCount - 1);
|
|
11225
|
+
break;
|
|
11226
|
+
}
|
|
11227
|
+
case KeyboardKeys.PAGE_UP: {
|
|
11228
|
+
e.preventDefault();
|
|
11229
|
+
setRowIndex((prevRowIndex) => prevRowIndex - jumpStep > 0 ? prevRowIndex - jumpStep : 0);
|
|
11230
|
+
break;
|
|
11258
11231
|
}
|
|
11259
|
-
setColIndex(colCount - 1);
|
|
11260
|
-
break;
|
|
11261
|
-
}
|
|
11262
|
-
case KeyboardKeys.PAGE_DOWN: {
|
|
11263
|
-
e.preventDefault();
|
|
11264
|
-
setRowIndex((prevRowIndex) => prevRowIndex + jumpStep < rowCount ? prevRowIndex + jumpStep : rowCount - 1);
|
|
11265
|
-
break;
|
|
11266
11232
|
}
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
|
|
11233
|
+
};
|
|
11234
|
+
const context = React__namespace.useMemo(() => ({ rowIndex, colIndex, setTableValues }), [colIndex, rowIndex, setTableValues]);
|
|
11235
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RawTableContext.Provider, { value: context, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11236
|
+
"table",
|
|
11237
|
+
{
|
|
11238
|
+
role: "grid",
|
|
11239
|
+
ref: composedRef,
|
|
11240
|
+
"aria-rowcount": rowCount,
|
|
11241
|
+
"aria-colcount": colCount,
|
|
11242
|
+
onKeyDown: handleKeyDown,
|
|
11243
|
+
...props
|
|
11271
11244
|
}
|
|
11272
|
-
}
|
|
11273
|
-
}
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
|
|
11279
|
-
|
|
11280
|
-
|
|
11281
|
-
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
|
|
11245
|
+
) });
|
|
11246
|
+
}
|
|
11247
|
+
);
|
|
11248
|
+
const getFocusableNodes = (node, includeNegativeTabIndex) => {
|
|
11249
|
+
const nodes = [
|
|
11250
|
+
...node.querySelectorAll(
|
|
11251
|
+
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
11252
|
+
)
|
|
11253
|
+
];
|
|
11254
|
+
const focusables = nodes.filter((node2) => {
|
|
11255
|
+
if (node2.hasAttribute("disabled"))
|
|
11256
|
+
return false;
|
|
11257
|
+
if (includeNegativeTabIndex)
|
|
11258
|
+
return true;
|
|
11259
|
+
return node2.getAttribute("tabindex") !== "-1";
|
|
11260
|
+
});
|
|
11261
|
+
return focusables;
|
|
11286
11262
|
};
|
|
11287
|
-
const
|
|
11288
|
-
|
|
11289
|
-
|
|
11290
|
-
|
|
11291
|
-
const handleKeyDown = (e) => {
|
|
11292
|
-
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11293
|
-
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length === 0) {
|
|
11294
|
-
return;
|
|
11263
|
+
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
11264
|
+
return nodes.filter((node) => {
|
|
11265
|
+
if (node.tagName === "INPUT") {
|
|
11266
|
+
return node.type !== "checkbox" && node.type !== "radio";
|
|
11295
11267
|
}
|
|
11296
|
-
|
|
11297
|
-
|
|
11298
|
-
|
|
11299
|
-
|
|
11300
|
-
|
|
11301
|
-
|
|
11302
|
-
|
|
11303
|
-
|
|
11304
|
-
|
|
11305
|
-
|
|
11306
|
-
|
|
11307
|
-
|
|
11308
|
-
|
|
11309
|
-
nextNode.focus();
|
|
11310
|
-
}
|
|
11268
|
+
return false;
|
|
11269
|
+
});
|
|
11270
|
+
};
|
|
11271
|
+
const RawTd = React__namespace.forwardRef(
|
|
11272
|
+
({ coords = { col: 0, row: 0 }, tag = "td", ...props }, forwardedRef) => {
|
|
11273
|
+
const tdRef = React__namespace.useRef(null);
|
|
11274
|
+
const composedRef = useComposedRefs(forwardedRef, tdRef);
|
|
11275
|
+
const { rowIndex, colIndex, setTableValues } = useTable();
|
|
11276
|
+
const [isActive, setIsActive] = React__namespace.useState(false);
|
|
11277
|
+
const handleKeyDown = (e) => {
|
|
11278
|
+
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11279
|
+
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length === 0) {
|
|
11280
|
+
return;
|
|
11311
11281
|
}
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
|
|
11315
|
-
|
|
11316
|
-
|
|
11317
|
-
|
|
11318
|
-
|
|
11282
|
+
if (focusableNodes.length > 1 && !focusableNodes.find((node) => node.tagName !== "BUTTON")) {
|
|
11283
|
+
e.preventDefault();
|
|
11284
|
+
const focussedButtonIndex = focusableNodes.findIndex((node) => node === document.activeElement);
|
|
11285
|
+
if (e.key === KeyboardKeys.RIGHT) {
|
|
11286
|
+
const nextNode = focusableNodes[focussedButtonIndex + 1];
|
|
11287
|
+
if (nextNode) {
|
|
11288
|
+
e.stopPropagation();
|
|
11289
|
+
nextNode.focus();
|
|
11290
|
+
}
|
|
11291
|
+
} else if (e.key === KeyboardKeys.LEFT) {
|
|
11292
|
+
const nextNode = focusableNodes[focussedButtonIndex - 1];
|
|
11293
|
+
if (nextNode) {
|
|
11294
|
+
e.stopPropagation();
|
|
11295
|
+
nextNode.focus();
|
|
11296
|
+
}
|
|
11297
|
+
}
|
|
11319
11298
|
return;
|
|
11320
11299
|
}
|
|
11321
|
-
|
|
11322
|
-
|
|
11323
|
-
|
|
11324
|
-
e.
|
|
11325
|
-
|
|
11326
|
-
|
|
11327
|
-
const isFocused = rowIndex === coords.row - 1 && colIndex === coords.col - 1;
|
|
11328
|
-
useIsomorphicLayoutEffect(() => {
|
|
11329
|
-
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11330
|
-
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || focusableNodes.length > 1 && Boolean(focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
|
|
11331
|
-
tdRef.current.setAttribute("tabIndex", !isActive && isFocused ? "0" : "-1");
|
|
11332
|
-
focusableNodes.forEach((node, index) => {
|
|
11333
|
-
node.setAttribute("tabIndex", isActive ? "0" : "-1");
|
|
11334
|
-
if (isActive && index === 0) {
|
|
11335
|
-
node.focus();
|
|
11300
|
+
const isEnterKey = e.key === KeyboardKeys.ENTER;
|
|
11301
|
+
if (isEnterKey && !isActive) {
|
|
11302
|
+
setIsActive(true);
|
|
11303
|
+
} else if ((e.key === KeyboardKeys.ESCAPE || isEnterKey) && isActive) {
|
|
11304
|
+
if (isEnterKey && document.activeElement?.tagName === "A") {
|
|
11305
|
+
return;
|
|
11336
11306
|
}
|
|
11337
|
-
|
|
11338
|
-
|
|
11307
|
+
setIsActive(false);
|
|
11308
|
+
tdRef.current.focus();
|
|
11309
|
+
} else if (isActive) {
|
|
11310
|
+
e.stopPropagation();
|
|
11311
|
+
}
|
|
11312
|
+
};
|
|
11313
|
+
const isFocused = rowIndex === coords.row - 1 && colIndex === coords.col - 1;
|
|
11314
|
+
useIsomorphicLayoutEffect(() => {
|
|
11315
|
+
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11316
|
+
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || focusableNodes.length > 1 && Boolean(focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
|
|
11317
|
+
tdRef.current.setAttribute("tabIndex", !isActive && isFocused ? "0" : "-1");
|
|
11318
|
+
focusableNodes.forEach((node, index) => {
|
|
11319
|
+
node.setAttribute("tabIndex", isActive ? "0" : "-1");
|
|
11320
|
+
if (isActive && index === 0) {
|
|
11321
|
+
node.focus();
|
|
11322
|
+
}
|
|
11323
|
+
});
|
|
11324
|
+
} else {
|
|
11325
|
+
focusableNodes.forEach((node) => {
|
|
11326
|
+
node.setAttribute("tabIndex", isFocused ? "0" : "-1");
|
|
11327
|
+
});
|
|
11328
|
+
}
|
|
11329
|
+
}, [isActive, isFocused]);
|
|
11330
|
+
const handleFocusableNodeFocus = React__namespace.useCallback(() => {
|
|
11331
|
+
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11332
|
+
if (focusableNodes.length >= 1 && (getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || !focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
|
|
11333
|
+
setIsActive(true);
|
|
11334
|
+
}
|
|
11335
|
+
setTableValues({ rowIndex: coords.row - 1, colIndex: coords.col - 1 });
|
|
11336
|
+
}, [coords, setTableValues]);
|
|
11337
|
+
useIsomorphicLayoutEffect(() => {
|
|
11338
|
+
const cell = tdRef.current;
|
|
11339
|
+
const focusableNodes = getFocusableNodes(cell, true);
|
|
11339
11340
|
focusableNodes.forEach((node) => {
|
|
11340
|
-
node.
|
|
11341
|
-
});
|
|
11342
|
-
}
|
|
11343
|
-
}, [isActive, isFocused]);
|
|
11344
|
-
const handleFocusableNodeFocus = React__namespace.useCallback(() => {
|
|
11345
|
-
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11346
|
-
if (focusableNodes.length >= 1 && (getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || !focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
|
|
11347
|
-
setIsActive(true);
|
|
11348
|
-
}
|
|
11349
|
-
setTableValues({ rowIndex: coords.row - 1, colIndex: coords.col - 1 });
|
|
11350
|
-
}, [coords, setTableValues]);
|
|
11351
|
-
useIsomorphicLayoutEffect(() => {
|
|
11352
|
-
const cell = tdRef.current;
|
|
11353
|
-
const focusableNodes = getFocusableNodes(cell, true);
|
|
11354
|
-
focusableNodes.forEach((node) => {
|
|
11355
|
-
node.addEventListener("focus", handleFocusableNodeFocus);
|
|
11356
|
-
});
|
|
11357
|
-
return () => {
|
|
11358
|
-
const focusableNodes2 = getFocusableNodes(cell, true);
|
|
11359
|
-
focusableNodes2.forEach((node) => {
|
|
11360
|
-
node.removeEventListener("focus", handleFocusableNodeFocus);
|
|
11341
|
+
node.addEventListener("focus", handleFocusableNodeFocus);
|
|
11361
11342
|
});
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
|
|
11365
|
-
|
|
11343
|
+
return () => {
|
|
11344
|
+
const focusableNodes2 = getFocusableNodes(cell, true);
|
|
11345
|
+
focusableNodes2.forEach((node) => {
|
|
11346
|
+
node.removeEventListener("focus", handleFocusableNodeFocus);
|
|
11347
|
+
});
|
|
11348
|
+
};
|
|
11349
|
+
}, [handleFocusableNodeFocus]);
|
|
11350
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "gridcell", tag, ref: composedRef, onKeyDown: handleKeyDown, ...props });
|
|
11351
|
+
}
|
|
11352
|
+
);
|
|
11366
11353
|
const RawTh = (props) => /* @__PURE__ */ jsxRuntime.jsx(RawTd, { ...props, tag: "th" });
|
|
11367
11354
|
const RawThead = ({ children, ...props }) => {
|
|
11368
11355
|
const childrenClone = React__namespace.Children.toArray(children).map((child) => {
|
|
@@ -11413,14 +11400,18 @@ const SearchbarWrapper = styledComponents.styled.div`
|
|
|
11413
11400
|
&:focus-within {
|
|
11414
11401
|
${SearchIcon} {
|
|
11415
11402
|
fill: ${({ theme }) => theme.colors.primary600};
|
|
11416
|
-
path {
|
|
11417
|
-
}
|
|
11418
11403
|
}
|
|
11419
11404
|
}
|
|
11420
11405
|
`;
|
|
11421
11406
|
const SearchbarInput = styledComponents.styled(Input$2)`
|
|
11422
11407
|
border: 1px solid transparent;
|
|
11423
11408
|
|
|
11409
|
+
&:hover {
|
|
11410
|
+
button {
|
|
11411
|
+
cursor: pointer;
|
|
11412
|
+
}
|
|
11413
|
+
}
|
|
11414
|
+
|
|
11424
11415
|
${inputFocusStyle()}
|
|
11425
11416
|
`;
|
|
11426
11417
|
const Searchbar = React__namespace.forwardRef(
|
|
@@ -11440,7 +11431,17 @@ const Searchbar = React__namespace.forwardRef(
|
|
|
11440
11431
|
ref: actualRef,
|
|
11441
11432
|
value,
|
|
11442
11433
|
startAction: /* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { "aria-hidden": true }),
|
|
11443
|
-
endAction: isCompleting ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11434
|
+
endAction: isCompleting ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11435
|
+
Action$1,
|
|
11436
|
+
{
|
|
11437
|
+
label: clearLabel,
|
|
11438
|
+
onClick: handleClear,
|
|
11439
|
+
onMouseDown: (e) => {
|
|
11440
|
+
e.preventDefault();
|
|
11441
|
+
},
|
|
11442
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {})
|
|
11443
|
+
}
|
|
11444
|
+
) : void 0,
|
|
11444
11445
|
...props
|
|
11445
11446
|
}
|
|
11446
11447
|
)
|
|
@@ -11448,47 +11449,60 @@ const Searchbar = React__namespace.forwardRef(
|
|
|
11448
11449
|
}
|
|
11449
11450
|
);
|
|
11450
11451
|
const SearchForm = (props) => /* @__PURE__ */ jsxRuntime.jsx("form", { ...props, role: "search" });
|
|
11451
|
-
const
|
|
11452
|
+
const ButtonBox$1 = styledComponents.styled(Box)`
|
|
11453
|
+
display: inline-flex;
|
|
11454
|
+
border: none;
|
|
11455
|
+
|
|
11456
|
+
& > svg {
|
|
11457
|
+
height: 0.8rem;
|
|
11458
|
+
width: 0.8rem;
|
|
11459
|
+
}
|
|
11460
|
+
|
|
11461
|
+
& > svg path {
|
|
11462
|
+
fill: ${({ theme, ...p }) => p["aria-disabled"] ? theme.colors.neutral600 : theme.colors.primary600};
|
|
11463
|
+
}
|
|
11464
|
+
|
|
11465
|
+
&:hover {
|
|
11466
|
+
cursor: ${({ $iconAction }) => $iconAction ? "pointer" : "initial"};
|
|
11467
|
+
}
|
|
11468
|
+
`;
|
|
11469
|
+
const Tag = ({ children, icon, label, disabled = false, onClick, ...props }) => {
|
|
11452
11470
|
const handleClick = (e) => {
|
|
11453
11471
|
if (disabled || !onClick)
|
|
11454
11472
|
return;
|
|
11455
11473
|
onClick(e);
|
|
11456
11474
|
};
|
|
11457
11475
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11458
|
-
|
|
11476
|
+
Flex,
|
|
11459
11477
|
{
|
|
11460
|
-
|
|
11478
|
+
inline: true,
|
|
11461
11479
|
background: disabled ? "neutral200" : "primary100",
|
|
11462
11480
|
color: disabled ? "neutral700" : "primary600",
|
|
11463
11481
|
paddingLeft: 3,
|
|
11464
|
-
paddingRight:
|
|
11465
|
-
onClick: handleClick,
|
|
11466
|
-
"aria-disabled": disabled,
|
|
11467
|
-
disabled,
|
|
11468
|
-
borderWidth: "1px",
|
|
11469
|
-
borderStyle: "solid",
|
|
11482
|
+
paddingRight: 1,
|
|
11470
11483
|
borderColor: disabled ? "neutral300" : "primary200",
|
|
11471
11484
|
hasRadius: true,
|
|
11472
11485
|
height: "3.2rem",
|
|
11473
|
-
gap: 2,
|
|
11474
11486
|
...props,
|
|
11475
11487
|
children: [
|
|
11476
11488
|
/* @__PURE__ */ jsxRuntime.jsx(TagText, { $disabled: disabled, variant: "pi", fontWeight: "bold", children }),
|
|
11477
|
-
|
|
11489
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11490
|
+
ButtonBox$1,
|
|
11491
|
+
{
|
|
11492
|
+
tag: "button",
|
|
11493
|
+
disabled,
|
|
11494
|
+
"aria-disabled": disabled,
|
|
11495
|
+
"aria-label": label,
|
|
11496
|
+
padding: 2,
|
|
11497
|
+
onClick: handleClick,
|
|
11498
|
+
$iconAction: !!onClick,
|
|
11499
|
+
children: icon
|
|
11500
|
+
}
|
|
11501
|
+
)
|
|
11478
11502
|
]
|
|
11479
11503
|
}
|
|
11480
11504
|
);
|
|
11481
11505
|
};
|
|
11482
|
-
const TagWrapper = styledComponents.styled(Flex)`
|
|
11483
|
-
& > svg {
|
|
11484
|
-
height: 0.8rem;
|
|
11485
|
-
width: 0.8rem;
|
|
11486
|
-
}
|
|
11487
|
-
|
|
11488
|
-
& > svg path {
|
|
11489
|
-
fill: ${({ theme, ...p }) => p["aria-disabled"] ? theme.colors.neutral600 : theme.colors.primary600};
|
|
11490
|
-
}
|
|
11491
|
-
`;
|
|
11492
11506
|
const TagText = styledComponents.styled(Typography)`
|
|
11493
11507
|
color: inherit;
|
|
11494
11508
|
border-right: 1px solid ${({ theme, $disabled }) => $disabled ? theme.colors.neutral300 : theme.colors.primary200};
|
|
@@ -11703,7 +11717,8 @@ const SubNavHeader = ({
|
|
|
11703
11717
|
},
|
|
11704
11718
|
onSubmit = () => {
|
|
11705
11719
|
},
|
|
11706
|
-
id
|
|
11720
|
+
id,
|
|
11721
|
+
placeholder
|
|
11707
11722
|
}) => {
|
|
11708
11723
|
const [isSearchOpen, setSearchOpen] = React__namespace.useState(false);
|
|
11709
11724
|
const previousSearchOpenValue = uiPrimitives.usePrev(isSearchOpen);
|
|
@@ -11743,7 +11758,7 @@ const SubNavHeader = ({
|
|
|
11743
11758
|
name: "searchbar",
|
|
11744
11759
|
value,
|
|
11745
11760
|
onChange,
|
|
11746
|
-
placeholder
|
|
11761
|
+
placeholder,
|
|
11747
11762
|
onKeyDown: handleKeyDown,
|
|
11748
11763
|
ref: searchRef,
|
|
11749
11764
|
onBlur: handleBlur,
|
|
@@ -11757,7 +11772,7 @@ const SubNavHeader = ({
|
|
|
11757
11772
|
] });
|
|
11758
11773
|
}
|
|
11759
11774
|
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingLeft: 6, paddingTop: 6, paddingBottom: 2, paddingRight: 4, children: [
|
|
11760
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", children: [
|
|
11775
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", width: "100%", gap: 2, children: [
|
|
11761
11776
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "beta", tag, children: label }),
|
|
11762
11777
|
searchable && /* @__PURE__ */ jsxRuntime.jsx(IconButton, { ref: searchButtonRef, onClick: toggleSearch, label: searchLabel, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Search, {}) })
|
|
11763
11778
|
] }),
|
|
@@ -11792,7 +11807,7 @@ const CustomBullet = styledComponents.styled.span`
|
|
|
11792
11807
|
background-color: ${({ theme, $active }) => $active ? theme.colors.primary600 : theme.colors.neutral600};
|
|
11793
11808
|
border-radius: 50%;
|
|
11794
11809
|
`;
|
|
11795
|
-
const SubNavLinkWrapper = styledComponents.styled(
|
|
11810
|
+
const SubNavLinkWrapper = styledComponents.styled(BaseLinkImpl)`
|
|
11796
11811
|
display: flex;
|
|
11797
11812
|
align-items: center;
|
|
11798
11813
|
justify-content: space-between;
|
|
@@ -12032,7 +12047,7 @@ const LabelTypography = styledComponents.styled(Typography)`
|
|
|
12032
12047
|
}
|
|
12033
12048
|
`;
|
|
12034
12049
|
const [TabsProvider, useTabs] = createContext("Tabs");
|
|
12035
|
-
const Root = React__namespace.forwardRef(
|
|
12050
|
+
const Root$1 = React__namespace.forwardRef(
|
|
12036
12051
|
({ disabled = false, variant: variant2 = "regular", hasError, ...props }, forwardedRef) => {
|
|
12037
12052
|
return /* @__PURE__ */ jsxRuntime.jsx(TabsProvider, { disabled, hasError, variant: variant2, children: /* @__PURE__ */ jsxRuntime.jsx(TabsRoot, { ref: forwardedRef, ...props }) });
|
|
12038
12053
|
}
|
|
@@ -12158,7 +12173,7 @@ const Tabs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
12158
12173
|
__proto__: null,
|
|
12159
12174
|
Content,
|
|
12160
12175
|
List,
|
|
12161
|
-
Root,
|
|
12176
|
+
Root: Root$1,
|
|
12162
12177
|
Trigger
|
|
12163
12178
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
12164
12179
|
const TableContainer = styledComponents.styled(Box)`
|
|
@@ -12198,7 +12213,7 @@ const TableBox = styledComponents.styled(Box)`
|
|
|
12198
12213
|
const ScrollContainer = styledComponents.styled(Box)`
|
|
12199
12214
|
overflow-x: auto;
|
|
12200
12215
|
`;
|
|
12201
|
-
const Table = ({ footer, ...props }) => {
|
|
12216
|
+
const Table = React__namespace.forwardRef(({ footer, ...props }, forwardedRef) => {
|
|
12202
12217
|
const tableRef = React__namespace.useRef(null);
|
|
12203
12218
|
const [overflowing, setOverflowing] = React__namespace.useState();
|
|
12204
12219
|
const handleScroll = (e) => {
|
|
@@ -12221,10 +12236,10 @@ const Table = ({ footer, ...props }) => {
|
|
|
12221
12236
|
}
|
|
12222
12237
|
}, []);
|
|
12223
12238
|
return /* @__PURE__ */ jsxRuntime.jsxs(TableContainer, { shadow: "tableShadow", hasRadius: true, background: "neutral0", children: [
|
|
12224
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableBox, { $overflowing: overflowing, position: "relative", children: /* @__PURE__ */ jsxRuntime.jsx(ScrollContainer, { ref: tableRef, onScroll: handleScroll, paddingLeft: 6, paddingRight: 6, children: /* @__PURE__ */ jsxRuntime.jsx(TableWrapper, { ...props }) }) }),
|
|
12239
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableBox, { $overflowing: overflowing, position: "relative", children: /* @__PURE__ */ jsxRuntime.jsx(ScrollContainer, { ref: tableRef, onScroll: handleScroll, paddingLeft: 6, paddingRight: 6, children: /* @__PURE__ */ jsxRuntime.jsx(TableWrapper, { ref: forwardedRef, ...props }) }) }),
|
|
12225
12240
|
footer
|
|
12226
12241
|
] });
|
|
12227
|
-
};
|
|
12242
|
+
});
|
|
12228
12243
|
const TbodyWrapper = styledComponents.styled(RawTbody)`
|
|
12229
12244
|
& tr:last-of-type {
|
|
12230
12245
|
border-bottom: none;
|
|
@@ -12265,7 +12280,6 @@ const Tr = (props) => {
|
|
|
12265
12280
|
const CellWrapper = styledComponents.styled(RawTd)`
|
|
12266
12281
|
vertical-align: middle;
|
|
12267
12282
|
text-align: left;
|
|
12268
|
-
color: ${({ theme }) => theme.colors.neutral600};
|
|
12269
12283
|
outline-offset: -4px;
|
|
12270
12284
|
|
|
12271
12285
|
/**
|
|
@@ -12275,15 +12289,15 @@ const CellWrapper = styledComponents.styled(RawTd)`
|
|
|
12275
12289
|
vertical-align: sub;
|
|
12276
12290
|
}
|
|
12277
12291
|
`;
|
|
12278
|
-
const Th = ({ children, action, ...props }) => {
|
|
12279
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CellWrapper, { as: RawTh, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { children: [
|
|
12292
|
+
const Th = React__namespace.forwardRef(({ children, action, ...props }, forwardedRef) => {
|
|
12293
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CellWrapper, { color: "neutral600", as: RawTh, ref: forwardedRef, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { children: [
|
|
12280
12294
|
children,
|
|
12281
12295
|
action
|
|
12282
12296
|
] }) });
|
|
12283
|
-
};
|
|
12284
|
-
const Td = ({ children, ...props }) => {
|
|
12285
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CellWrapper, { ...props, children });
|
|
12286
|
-
};
|
|
12297
|
+
});
|
|
12298
|
+
const Td = React__namespace.forwardRef(({ children, ...props }, forwardedRef) => {
|
|
12299
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CellWrapper, { color: "neutral800", ref: forwardedRef, ...props, children });
|
|
12300
|
+
});
|
|
12287
12301
|
const IconBox = styledComponents.styled(Box)`
|
|
12288
12302
|
height: 2.4rem;
|
|
12289
12303
|
width: 2.4rem;
|
|
@@ -12316,6 +12330,28 @@ const TFooter = ({ children, icon, ...props }) => {
|
|
|
12316
12330
|
] }) })
|
|
12317
12331
|
] });
|
|
12318
12332
|
};
|
|
12333
|
+
const TextButton = forwardRef(
|
|
12334
|
+
({ children, startIcon, endIcon, disabled = false, loading = false, ...props }, ref) => {
|
|
12335
|
+
const isDisabled = disabled || loading;
|
|
12336
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12337
|
+
TextButtonWrapper,
|
|
12338
|
+
{
|
|
12339
|
+
ref,
|
|
12340
|
+
disabled: isDisabled,
|
|
12341
|
+
"aria-disabled": isDisabled,
|
|
12342
|
+
tag: "button",
|
|
12343
|
+
type: "button",
|
|
12344
|
+
gap: 2,
|
|
12345
|
+
...props,
|
|
12346
|
+
children: [
|
|
12347
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingWrapper, { "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Loader, {}) }) : startIcon,
|
|
12348
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", children }),
|
|
12349
|
+
endIcon
|
|
12350
|
+
]
|
|
12351
|
+
}
|
|
12352
|
+
);
|
|
12353
|
+
}
|
|
12354
|
+
);
|
|
12319
12355
|
const rotation = styledComponents.keyframes`
|
|
12320
12356
|
from {
|
|
12321
12357
|
transform: rotate(0deg);
|
|
@@ -12324,51 +12360,24 @@ const rotation = styledComponents.keyframes`
|
|
|
12324
12360
|
transform: rotate(359deg);
|
|
12325
12361
|
}
|
|
12326
12362
|
`;
|
|
12327
|
-
const LoadingWrapper = styledComponents.styled.
|
|
12363
|
+
const LoadingWrapper = styledComponents.styled.span`
|
|
12364
|
+
display: flex;
|
|
12328
12365
|
animation: ${rotation} 2s infinite linear;
|
|
12329
12366
|
will-change: transform;
|
|
12330
12367
|
`;
|
|
12331
12368
|
const TextButtonWrapper = styledComponents.styled(Flex)`
|
|
12332
12369
|
border: none;
|
|
12370
|
+
background-color: transparent;
|
|
12371
|
+
color: ${(props) => props.theme.colors.primary600};
|
|
12372
|
+
cursor: pointer;
|
|
12333
12373
|
|
|
12334
12374
|
&[aria-disabled='true'] {
|
|
12335
12375
|
pointer-events: none;
|
|
12336
|
-
|
|
12337
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
12338
|
-
}
|
|
12339
|
-
}
|
|
12340
|
-
|
|
12341
|
-
svg path {
|
|
12342
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
|
12376
|
+
color: ${(props) => props.theme.colors.neutral600};
|
|
12343
12377
|
}
|
|
12344
12378
|
|
|
12345
12379
|
${focus}
|
|
12346
12380
|
`;
|
|
12347
|
-
const TextButton = React__namespace.forwardRef(
|
|
12348
|
-
({ children, startIcon, endIcon, onClick, disabled = false, loading = false, ...props }, ref) => {
|
|
12349
|
-
const handleClick = onClick && !disabled ? onClick : void 0;
|
|
12350
|
-
const isDisabled = disabled || loading;
|
|
12351
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12352
|
-
TextButtonWrapper,
|
|
12353
|
-
{
|
|
12354
|
-
ref,
|
|
12355
|
-
"aria-disabled": isDisabled,
|
|
12356
|
-
onClick: handleClick,
|
|
12357
|
-
tag: "button",
|
|
12358
|
-
type: "button",
|
|
12359
|
-
background: "transparent",
|
|
12360
|
-
gap: 2,
|
|
12361
|
-
...props,
|
|
12362
|
-
children: [
|
|
12363
|
-
loading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingWrapper, { "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Loader, {}) }) : startIcon,
|
|
12364
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", textColor: isDisabled ? "neutral600" : "primary600", children }),
|
|
12365
|
-
endIcon
|
|
12366
|
-
]
|
|
12367
|
-
}
|
|
12368
|
-
);
|
|
12369
|
-
}
|
|
12370
|
-
);
|
|
12371
|
-
TextButton.displayName = "TextButton";
|
|
12372
12381
|
const TextInput = React__namespace.forwardRef((props, ref) => {
|
|
12373
12382
|
return /* @__PURE__ */ jsxRuntime.jsx(Input$2, { ref, ...props });
|
|
12374
12383
|
});
|
|
@@ -12386,7 +12395,7 @@ const Textarea = React__namespace.forwardRef(
|
|
|
12386
12395
|
} else if (field.hint) {
|
|
12387
12396
|
ariaDescription = `${id}-hint`;
|
|
12388
12397
|
}
|
|
12389
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper, { borderColor: hasError ? "danger600" : "neutral200", $hasError: hasError, hasRadius: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12398
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper$1, { borderColor: hasError ? "danger600" : "neutral200", $hasError: hasError, hasRadius: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12390
12399
|
TextareaElement,
|
|
12391
12400
|
{
|
|
12392
12401
|
"aria-invalid": hasError,
|
|
@@ -12410,7 +12419,7 @@ const Textarea = React__namespace.forwardRef(
|
|
|
12410
12419
|
) });
|
|
12411
12420
|
}
|
|
12412
12421
|
);
|
|
12413
|
-
const Wrapper = styledComponents.styled(Box)`
|
|
12422
|
+
const Wrapper$1 = styledComponents.styled(Box)`
|
|
12414
12423
|
${inputFocusStyle()}
|
|
12415
12424
|
`;
|
|
12416
12425
|
const TextareaElement = styledComponents.styled(Box)`
|
|
@@ -12555,6 +12564,39 @@ const Input = styledComponents.styled.input`
|
|
|
12555
12564
|
z-index: 0;
|
|
12556
12565
|
width: 100%;
|
|
12557
12566
|
`;
|
|
12567
|
+
const Root = forwardRef((props, forwardedRef) => {
|
|
12568
|
+
const { gap = 0, gridCols = 12, ...rest } = props;
|
|
12569
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
|
|
12570
|
+
});
|
|
12571
|
+
const Wrapper = styledComponents.styled(Box)`
|
|
12572
|
+
display: grid;
|
|
12573
|
+
grid-template-columns: repeat(${({ $gridCols }) => $gridCols}, 1fr);
|
|
12574
|
+
${({ theme, $gap }) => handleResponsiveValues({ gap: $gap }, theme)}
|
|
12575
|
+
`;
|
|
12576
|
+
const ItemImpl = forwardRef(
|
|
12577
|
+
({ col, s, xs, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(Item, { ref: forwardedRef, $col: col, $s: s, $xs: xs, ...props })
|
|
12578
|
+
);
|
|
12579
|
+
const Item = styledComponents.styled(Flex)`
|
|
12580
|
+
grid-column: span ${({ $xs }) => $xs ?? 12};
|
|
12581
|
+
max-width: 100%;
|
|
12582
|
+
|
|
12583
|
+
${({ theme }) => theme.breakpoints.small} {
|
|
12584
|
+
grid-column: span ${({ $s, $xs }) => $s ?? $xs ?? 12};
|
|
12585
|
+
}
|
|
12586
|
+
|
|
12587
|
+
${({ theme }) => theme.breakpoints.medium} {
|
|
12588
|
+
grid-column: span ${({ $m, $s, $xs }) => $m ?? $s ?? $xs ?? 12};
|
|
12589
|
+
}
|
|
12590
|
+
|
|
12591
|
+
${({ theme }) => theme.breakpoints.large} {
|
|
12592
|
+
grid-column: span ${({ $col, $m, $s, $xs }) => $col ?? $m ?? $s ?? $xs ?? 12};
|
|
12593
|
+
}
|
|
12594
|
+
`;
|
|
12595
|
+
const Grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12596
|
+
__proto__: null,
|
|
12597
|
+
Item: ItemImpl,
|
|
12598
|
+
Root
|
|
12599
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
12558
12600
|
const defaultState = {
|
|
12559
12601
|
x: 0,
|
|
12560
12602
|
y: 0,
|
|
@@ -12587,6 +12629,56 @@ function useMeasure() {
|
|
|
12587
12629
|
}, [element, observer]);
|
|
12588
12630
|
return [ref, rect];
|
|
12589
12631
|
}
|
|
12632
|
+
const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
|
|
12633
|
+
const trappedRef = React__namespace.useRef(null);
|
|
12634
|
+
React__namespace.useEffect(() => {
|
|
12635
|
+
let currentFocus = null;
|
|
12636
|
+
if (restoreFocus) {
|
|
12637
|
+
currentFocus = document.activeElement;
|
|
12638
|
+
}
|
|
12639
|
+
return () => {
|
|
12640
|
+
if (currentFocus) {
|
|
12641
|
+
currentFocus.focus();
|
|
12642
|
+
}
|
|
12643
|
+
};
|
|
12644
|
+
}, [restoreFocus]);
|
|
12645
|
+
React__namespace.useEffect(() => {
|
|
12646
|
+
if (!trappedRef.current || skipAutoFocus)
|
|
12647
|
+
return;
|
|
12648
|
+
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
12649
|
+
if (focusableChildren.length > 0) {
|
|
12650
|
+
const firstElement = focusableChildren[0];
|
|
12651
|
+
firstElement.focus();
|
|
12652
|
+
} else {
|
|
12653
|
+
console.warn(
|
|
12654
|
+
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
12655
|
+
);
|
|
12656
|
+
}
|
|
12657
|
+
}, [skipAutoFocus]);
|
|
12658
|
+
const handleKeyDown = (e) => {
|
|
12659
|
+
if (e.key === KeyboardKeys.ESCAPE && onEscape) {
|
|
12660
|
+
onEscape();
|
|
12661
|
+
return;
|
|
12662
|
+
}
|
|
12663
|
+
if (e.key !== KeyboardKeys.TAB)
|
|
12664
|
+
return;
|
|
12665
|
+
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
12666
|
+
if (focusableChildren.length > 0) {
|
|
12667
|
+
const firstElement = focusableChildren[0];
|
|
12668
|
+
const lastElement = focusableChildren[focusableChildren.length - 1];
|
|
12669
|
+
if (e.shiftKey) {
|
|
12670
|
+
if (firstElement === document.activeElement) {
|
|
12671
|
+
e.preventDefault();
|
|
12672
|
+
lastElement.focus();
|
|
12673
|
+
}
|
|
12674
|
+
} else if (lastElement === document.activeElement) {
|
|
12675
|
+
e.preventDefault();
|
|
12676
|
+
firstElement.focus();
|
|
12677
|
+
}
|
|
12678
|
+
}
|
|
12679
|
+
};
|
|
12680
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
|
|
12681
|
+
};
|
|
12590
12682
|
const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
|
|
12591
12683
|
const isValidFocusedElement = () => {
|
|
12592
12684
|
const focused = document.activeElement;
|
|
@@ -12673,8 +12765,7 @@ exports.Accordion = Accordion;
|
|
|
12673
12765
|
exports.Alert = Alert;
|
|
12674
12766
|
exports.Avatar = Avatar;
|
|
12675
12767
|
exports.Badge = Badge;
|
|
12676
|
-
exports.
|
|
12677
|
-
exports.BaseLink = BaseLink;
|
|
12768
|
+
exports.BaseLink = BaseLinkImpl;
|
|
12678
12769
|
exports.Box = Box;
|
|
12679
12770
|
exports.Breadcrumbs = Breadcrumbs;
|
|
12680
12771
|
exports.Button = Button;
|