@strapi/design-system 2.0.0-beta.6 → 2.0.0-rc.10
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/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +2 -2
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/Divider/Divider.d.ts.map +1 -1
- package/dist/components/EmptyStateLayout/EmptyStateLayout.d.ts +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/MultiSelect.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/Tabs/Tabs.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 +1129 -1002
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1129 -1002
- 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.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import * as DismissibleLayerPrimitive from "@radix-ui/react-dismissable-layer";
|
|
|
9
9
|
import { useCallbackRef, Combobox as Combobox$1, Select, composeEventHandlers, usePrev } from "@strapi/ui-primitives";
|
|
10
10
|
import { composeEventHandlers as composeEventHandlers2, useCallbackRef as useCallbackRef2, useCollator, useFilter } from "@strapi/ui-primitives";
|
|
11
11
|
import * as RadixAccordion from "@radix-ui/react-accordion";
|
|
12
|
-
import { CaretDown, Cross, CheckCircle, WarningCircle, Information, Loader as Loader$1, ExternalLink, ChevronRight, ChevronLeft, Calendar, Clock, Search } from "@strapi/icons";
|
|
12
|
+
import { CaretDown, Cross, CheckCircle, WarningCircle, Information, Loader as Loader$1, ExternalLink, ChevronRight, Minus, ChevronLeft, Calendar, Clock, Search } from "@strapi/icons";
|
|
13
13
|
import * as Avatar$1 from "@radix-ui/react-avatar";
|
|
14
14
|
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
|
|
15
15
|
import * as Checkbox from "@radix-ui/react-checkbox";
|
|
@@ -48,32 +48,6 @@ const createContext = (rootComponentName, defaultContext) => {
|
|
|
48
48
|
Provider2.displayName = `${rootComponentName}Provider`;
|
|
49
49
|
return [Provider2, useContext];
|
|
50
50
|
};
|
|
51
|
-
const handleResponsiveValues = (property, value, theme) => {
|
|
52
|
-
if (!value) {
|
|
53
|
-
return void 0;
|
|
54
|
-
}
|
|
55
|
-
if (typeof value === "object") {
|
|
56
|
-
const transformedArray = Array.isArray(value) ? value : [value?.desktop, value?.tablet, value?.mobile];
|
|
57
|
-
const spaces = transformedArray.reduce((acc, curr, index) => {
|
|
58
|
-
if (curr) {
|
|
59
|
-
switch (index) {
|
|
60
|
-
case 0:
|
|
61
|
-
return `${acc}${property}: ${theme.spaces[curr]};`;
|
|
62
|
-
case 1:
|
|
63
|
-
return `${acc}${theme.mediaQueries.tablet}{${property}: ${theme.spaces[curr]};}`;
|
|
64
|
-
case 2:
|
|
65
|
-
return `${acc}${theme.mediaQueries.mobile}{${property}: ${theme.spaces[curr]};}`;
|
|
66
|
-
default:
|
|
67
|
-
return acc;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return acc;
|
|
71
|
-
}, "");
|
|
72
|
-
return spaces;
|
|
73
|
-
}
|
|
74
|
-
const realValue = theme.spaces[value] ?? value;
|
|
75
|
-
return `${property}: ${realValue};`;
|
|
76
|
-
};
|
|
77
51
|
function isKeyOf(o, s) {
|
|
78
52
|
if (typeof o === "string") {
|
|
79
53
|
return false;
|
|
@@ -84,11 +58,166 @@ function isObject(item) {
|
|
|
84
58
|
return item && typeof item === "object" && !Array.isArray(item);
|
|
85
59
|
}
|
|
86
60
|
function extractStyleFromTheme(themeSection, key, defaultValue) {
|
|
87
|
-
if (key && isKeyOf(themeSection, key)) {
|
|
61
|
+
if (themeSection && key && isKeyOf(themeSection, key)) {
|
|
88
62
|
return themeSection[key];
|
|
89
63
|
}
|
|
90
64
|
return defaultValue;
|
|
91
65
|
}
|
|
66
|
+
const mappedCSSProps = {
|
|
67
|
+
padding: ["padding-block-start", "padding-inline-end", "padding-block-end", "padding-inline-start"],
|
|
68
|
+
paddingTop: "padding-block-start",
|
|
69
|
+
paddingRight: "padding-inline-end",
|
|
70
|
+
paddingBottom: "padding-block-end",
|
|
71
|
+
paddingLeft: "padding-inline-start",
|
|
72
|
+
margin: ["margin-block-start", "margin-inline-end", "margin-block-end", "margin-inline-start"],
|
|
73
|
+
marginLeft: "margin-inline-start",
|
|
74
|
+
marginRight: "margin-inline-end",
|
|
75
|
+
marginTop: "margin-block-start",
|
|
76
|
+
marginBottom: "margin-block-end",
|
|
77
|
+
borderRadius: "border-radius",
|
|
78
|
+
borderStyle: "border-style",
|
|
79
|
+
borderWidth: "border-width",
|
|
80
|
+
borderColor: "border-color",
|
|
81
|
+
fontSize: "font-size",
|
|
82
|
+
fontWeight: "font-weight",
|
|
83
|
+
lineHeight: "line-height",
|
|
84
|
+
zIndex: "z-index",
|
|
85
|
+
boxShadow: "box-shadow",
|
|
86
|
+
pointerEvents: "pointer-events",
|
|
87
|
+
textAlign: "text-align",
|
|
88
|
+
textTransform: "text-transform",
|
|
89
|
+
textDecoration: "text-decoration",
|
|
90
|
+
flexGrow: "flex-grow",
|
|
91
|
+
flexShrink: "flex-shrink",
|
|
92
|
+
flexBasis: "flex-basis",
|
|
93
|
+
minWidth: "min-width",
|
|
94
|
+
maxWidth: "max-width",
|
|
95
|
+
minHeight: "min-height",
|
|
96
|
+
maxHeight: "max-height",
|
|
97
|
+
flexDirection: "flex-direction",
|
|
98
|
+
flexWrap: "flex-wrap",
|
|
99
|
+
justifyContent: "justify-content",
|
|
100
|
+
alignItems: "align-items"
|
|
101
|
+
};
|
|
102
|
+
const fillCssValues = (value) => {
|
|
103
|
+
const [top, right, bottom, left] = value;
|
|
104
|
+
const rightValue = right ?? top;
|
|
105
|
+
const bottomValue = bottom ?? top;
|
|
106
|
+
const leftValue = left ?? rightValue;
|
|
107
|
+
return [top, rightValue, bottomValue, leftValue];
|
|
108
|
+
};
|
|
109
|
+
function getThemeSection(key, theme) {
|
|
110
|
+
switch (key) {
|
|
111
|
+
case "gap":
|
|
112
|
+
case "padding":
|
|
113
|
+
case "margin":
|
|
114
|
+
case "paddingTop":
|
|
115
|
+
case "paddingLeft":
|
|
116
|
+
case "paddingRight":
|
|
117
|
+
case "paddingBottom":
|
|
118
|
+
case "marginTop":
|
|
119
|
+
case "marginLeft":
|
|
120
|
+
case "marginRight":
|
|
121
|
+
case "marginBottom":
|
|
122
|
+
case "left":
|
|
123
|
+
case "right":
|
|
124
|
+
case "top":
|
|
125
|
+
case "bottom":
|
|
126
|
+
case "width":
|
|
127
|
+
case "maxWidth":
|
|
128
|
+
case "minWidth":
|
|
129
|
+
case "height":
|
|
130
|
+
case "maxHeight":
|
|
131
|
+
case "minHeight":
|
|
132
|
+
case "borderRadius":
|
|
133
|
+
case "borderWidth":
|
|
134
|
+
return theme.spaces;
|
|
135
|
+
case "color":
|
|
136
|
+
case "background":
|
|
137
|
+
case "borderColor":
|
|
138
|
+
return theme.colors;
|
|
139
|
+
case "fontSize":
|
|
140
|
+
return theme.fontSizes;
|
|
141
|
+
case "fontWeight":
|
|
142
|
+
return theme.fontWeights;
|
|
143
|
+
case "lineHeight":
|
|
144
|
+
return theme.lineHeights;
|
|
145
|
+
case "zIndex":
|
|
146
|
+
return theme.zIndices;
|
|
147
|
+
case "boxShadow":
|
|
148
|
+
return theme.shadows;
|
|
149
|
+
default:
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const handleResponsiveValues = (values, theme) => {
|
|
154
|
+
const stylesByBreakpoint = Object.entries(values).reduce(
|
|
155
|
+
(acc, curr) => {
|
|
156
|
+
const [key, value] = curr;
|
|
157
|
+
const themeSection = getThemeSection(key, theme);
|
|
158
|
+
const cssProperty = Object.prototype.hasOwnProperty.call(mappedCSSProps, key) ? mappedCSSProps[key] : key;
|
|
159
|
+
if (cssProperty && (value || value === 0)) {
|
|
160
|
+
if (typeof value === "object" && !Array.isArray(value)) {
|
|
161
|
+
Object.entries(value).forEach(([breakpointName, breakpointValue]) => {
|
|
162
|
+
acc[breakpointName] = {
|
|
163
|
+
...acc[breakpointName],
|
|
164
|
+
...convertCssPropertiesToCssValues(cssProperty, breakpointValue, themeSection)
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
} else {
|
|
168
|
+
acc.initial = {
|
|
169
|
+
...acc.initial,
|
|
170
|
+
...convertCssPropertiesToCssValues(cssProperty, value, themeSection)
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return acc;
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
initial: {},
|
|
178
|
+
small: {},
|
|
179
|
+
medium: {},
|
|
180
|
+
large: {}
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
return Object.entries(stylesByBreakpoint).reduce((acc, [key, value]) => {
|
|
184
|
+
if (value && Object.keys(value).length > 0) {
|
|
185
|
+
const breakpointStyles = Object.entries(value).reduce((arr, [property, value2]) => {
|
|
186
|
+
arr.push(`${property}: ${value2};`);
|
|
187
|
+
return arr;
|
|
188
|
+
}, []).join("\n");
|
|
189
|
+
if (key === "initial") {
|
|
190
|
+
acc.push(breakpointStyles);
|
|
191
|
+
} else {
|
|
192
|
+
acc.push(`${theme.breakpoints[key]}{ ${breakpointStyles} }`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return acc;
|
|
196
|
+
}, []).join("\n");
|
|
197
|
+
};
|
|
198
|
+
const convertCssPropertiesToCssValues = (property, value, themeSection) => {
|
|
199
|
+
if (Array.isArray(property) && Array.isArray(value)) {
|
|
200
|
+
const shorthandValues = fillCssValues(value);
|
|
201
|
+
return property.reduce((acc, prop, index) => {
|
|
202
|
+
acc[prop] = extractStyleFromTheme(themeSection, shorthandValues[index], shorthandValues[index]);
|
|
203
|
+
return acc;
|
|
204
|
+
}, {});
|
|
205
|
+
} else if (Array.isArray(property) && !Array.isArray(value)) {
|
|
206
|
+
return property.reduce((acc, prop) => {
|
|
207
|
+
acc[prop] = extractStyleFromTheme(themeSection, value, value);
|
|
208
|
+
return acc;
|
|
209
|
+
}, {});
|
|
210
|
+
} else if (!Array.isArray(property) && !Array.isArray(value)) {
|
|
211
|
+
return {
|
|
212
|
+
[property]: extractStyleFromTheme(themeSection, value, value)
|
|
213
|
+
};
|
|
214
|
+
} else {
|
|
215
|
+
console.warn(
|
|
216
|
+
"You've passed an array of values to a property that does not support it. Please check the property and value you're passing."
|
|
217
|
+
);
|
|
218
|
+
return {};
|
|
219
|
+
}
|
|
220
|
+
};
|
|
92
221
|
const forwardRef = React.forwardRef;
|
|
93
222
|
const Box = forwardRef((props, ref) => {
|
|
94
223
|
const {
|
|
@@ -100,8 +229,6 @@ const Box = forwardRef((props, ref) => {
|
|
|
100
229
|
fontSize,
|
|
101
230
|
grow,
|
|
102
231
|
hasRadius,
|
|
103
|
-
hiddenS,
|
|
104
|
-
hiddenXS,
|
|
105
232
|
padding,
|
|
106
233
|
paddingBottom,
|
|
107
234
|
paddingLeft,
|
|
@@ -115,6 +242,7 @@ const Box = forwardRef((props, ref) => {
|
|
|
115
242
|
shadow,
|
|
116
243
|
shrink,
|
|
117
244
|
lineHeight,
|
|
245
|
+
fontWeight,
|
|
118
246
|
width,
|
|
119
247
|
minWidth,
|
|
120
248
|
maxWidth,
|
|
@@ -152,8 +280,6 @@ const Box = forwardRef((props, ref) => {
|
|
|
152
280
|
$fontSize: fontSize,
|
|
153
281
|
$grow: grow,
|
|
154
282
|
$hasRadius: hasRadius,
|
|
155
|
-
$hiddenS: hiddenS,
|
|
156
|
-
$hiddenXS: hiddenXS,
|
|
157
283
|
$padding: padding,
|
|
158
284
|
$paddingBottom: paddingBottom,
|
|
159
285
|
$paddingLeft: paddingLeft,
|
|
@@ -167,6 +293,7 @@ const Box = forwardRef((props, ref) => {
|
|
|
167
293
|
$shadow: shadow,
|
|
168
294
|
$shrink: shrink,
|
|
169
295
|
$lineHeight: lineHeight,
|
|
296
|
+
$fontWeight: fontWeight,
|
|
170
297
|
$width: width,
|
|
171
298
|
$minWidth: minWidth,
|
|
172
299
|
$maxWidth: maxWidth,
|
|
@@ -195,110 +322,83 @@ const Box = forwardRef((props, ref) => {
|
|
|
195
322
|
return /* @__PURE__ */ jsx(StyledBox, { as: AsComponent, ref, ...mappedProps, ...rest });
|
|
196
323
|
});
|
|
197
324
|
const StyledBox = styled.div`
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
325
|
+
${({ theme, ...props }) => {
|
|
326
|
+
return handleResponsiveValues(
|
|
327
|
+
{
|
|
328
|
+
padding: props.$padding,
|
|
329
|
+
paddingTop: props.$paddingTop,
|
|
330
|
+
paddingBottom: props.$paddingBottom,
|
|
331
|
+
paddingLeft: props.$paddingLeft,
|
|
332
|
+
paddingRight: props.$paddingRight,
|
|
333
|
+
margin: props.$margin,
|
|
334
|
+
marginTop: props.$marginTop,
|
|
335
|
+
marginBottom: props.$marginBottom,
|
|
336
|
+
marginLeft: props.$marginLeft,
|
|
337
|
+
marginRight: props.$marginRight,
|
|
338
|
+
top: props.$top,
|
|
339
|
+
left: props.$left,
|
|
340
|
+
bottom: props.$bottom,
|
|
341
|
+
right: props.$right,
|
|
342
|
+
width: props.$width,
|
|
343
|
+
minWidth: props.$minWidth,
|
|
344
|
+
maxWidth: props.$maxWidth,
|
|
345
|
+
height: props.$height,
|
|
346
|
+
minHeight: props.$minHeight,
|
|
347
|
+
maxHeight: props.$maxHeight,
|
|
348
|
+
color: props.$color,
|
|
349
|
+
background: props.$background,
|
|
350
|
+
fontSize: props.$fontSize,
|
|
351
|
+
fontWeight: props.$fontWeight,
|
|
352
|
+
lineHeight: props.$lineHeight,
|
|
353
|
+
borderRadius: props.$hasRadius ? theme.borderRadius : props.$borderRadius,
|
|
354
|
+
borderStyle: props.$borderColor && !props.$borderStyle ? "solid" : props.$borderStyle,
|
|
355
|
+
borderWidth: props.$borderColor && !props.$borderWidth ? "1px" : props.$borderWidth,
|
|
356
|
+
borderColor: props.$borderColor,
|
|
357
|
+
zIndex: props.$zIndex,
|
|
358
|
+
boxShadow: props.$shadow,
|
|
359
|
+
display: props.$display,
|
|
360
|
+
pointerEvents: props.$pointerEvents,
|
|
361
|
+
cursor: props.$cursor,
|
|
362
|
+
textAlign: props.$textAlign,
|
|
363
|
+
textTransform: props.$textTransform,
|
|
364
|
+
transition: props.$transition,
|
|
365
|
+
transform: props.$transform,
|
|
366
|
+
animation: props.$animation,
|
|
367
|
+
position: props.$position,
|
|
368
|
+
overflow: props.$overflow,
|
|
369
|
+
flex: props.$flex,
|
|
370
|
+
flexShrink: props.$shrink,
|
|
371
|
+
flexGrow: props.$grow,
|
|
372
|
+
flexBasis: props.$basis
|
|
373
|
+
},
|
|
374
|
+
theme
|
|
375
|
+
);
|
|
235
376
|
}};
|
|
236
|
-
|
|
237
|
-
// Shadows
|
|
238
|
-
box-shadow: ${({ theme, $shadow }) => extractStyleFromTheme(theme.shadows, $shadow, void 0)};
|
|
239
|
-
|
|
240
|
-
// Handlers
|
|
241
|
-
pointer-events: ${({ $pointerEvents }) => $pointerEvents};
|
|
242
|
-
|
|
243
|
-
// Display
|
|
244
|
-
display: ${({ $display }) => $display};
|
|
245
|
-
|
|
246
|
-
// Position
|
|
247
|
-
position: ${({ $position }) => $position};
|
|
248
|
-
left: ${({ $left, theme }) => extractStyleFromTheme(theme.spaces, $left, $left)};
|
|
249
|
-
right: ${({ $right, theme }) => extractStyleFromTheme(theme.spaces, $right, $right)};
|
|
250
|
-
top: ${({ $top, theme }) => extractStyleFromTheme(theme.spaces, $top, $top)};
|
|
251
|
-
bottom: ${({ $bottom, theme }) => extractStyleFromTheme(theme.spaces, $bottom, $bottom)};
|
|
252
|
-
z-index: ${({ $zIndex, theme }) => extractStyleFromTheme(theme.zIndices, $zIndex, $zIndex)};
|
|
253
|
-
overflow: ${({ $overflow }) => $overflow};
|
|
254
|
-
|
|
255
|
-
// Size
|
|
256
|
-
width: ${({ $width, theme }) => extractStyleFromTheme(theme.spaces, $width, $width)};
|
|
257
|
-
max-width: ${({ $maxWidth, theme }) => extractStyleFromTheme(theme.spaces, $maxWidth, $maxWidth)};
|
|
258
|
-
min-width: ${({ $minWidth, theme }) => extractStyleFromTheme(theme.spaces, $minWidth, $minWidth)};
|
|
259
|
-
height: ${({ $height, theme }) => extractStyleFromTheme(theme.spaces, $height, $height)};
|
|
260
|
-
max-height: ${({ $maxHeight, theme }) => extractStyleFromTheme(theme.spaces, $maxHeight, $maxHeight)};
|
|
261
|
-
min-height: ${({ $minHeight, theme }) => extractStyleFromTheme(theme.spaces, $minHeight, $minHeight)};
|
|
262
|
-
|
|
263
|
-
// Animation
|
|
264
|
-
transition: ${({ $transition }) => $transition};
|
|
265
|
-
transform: ${({ $transform }) => $transform};
|
|
266
|
-
animation: ${({ $animation }) => $animation};
|
|
267
|
-
|
|
268
|
-
//Flexbox children props
|
|
269
|
-
flex-shrink: ${({ $shrink }) => $shrink};
|
|
270
|
-
flex-grow: ${({ $grow }) => $grow};
|
|
271
|
-
flex-basis: ${({ $basis }) => $basis};
|
|
272
|
-
flex: ${({ $flex }) => $flex};
|
|
273
|
-
|
|
274
|
-
// Text
|
|
275
|
-
text-align: ${({ $textAlign }) => $textAlign};
|
|
276
|
-
text-transform: ${({ $textTransform }) => $textTransform};
|
|
277
|
-
line-height: ${({ theme, $lineHeight }) => extractStyleFromTheme(theme.lineHeights, $lineHeight, $lineHeight)};
|
|
278
|
-
|
|
279
|
-
// Cursor
|
|
280
|
-
cursor: ${({ $cursor }) => $cursor};
|
|
281
377
|
`;
|
|
282
378
|
const Flex = forwardRef((props, ref) => {
|
|
283
|
-
const { className, alignItems, direction,
|
|
379
|
+
const { className, alignItems, direction, inline, gap, justifyContent, wrap, ...rest } = props;
|
|
284
380
|
const mappedProps = {
|
|
285
381
|
$alignItems: alignItems,
|
|
286
382
|
$direction: direction,
|
|
287
383
|
$gap: gap,
|
|
288
|
-
$inline: inline,
|
|
289
384
|
$justifyContent: justifyContent,
|
|
290
|
-
$wrap: wrap
|
|
385
|
+
$wrap: wrap,
|
|
386
|
+
$inline: inline
|
|
291
387
|
};
|
|
292
388
|
return /* @__PURE__ */ jsx(StyledFlex, { className, ref, ...mappedProps, ...rest });
|
|
293
389
|
});
|
|
294
390
|
const StyledFlex = styled(Box)`
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
391
|
+
${({ theme, $display = "flex", $alignItems = "center", $direction = "row", ...props }) => handleResponsiveValues(
|
|
392
|
+
{
|
|
393
|
+
gap: props.$gap,
|
|
394
|
+
alignItems: $alignItems,
|
|
395
|
+
justifyContent: props.$justifyContent,
|
|
396
|
+
flexWrap: props.$wrap,
|
|
397
|
+
flexDirection: $direction,
|
|
398
|
+
display: props.$inline ? "inline-flex" : $display
|
|
399
|
+
},
|
|
400
|
+
theme
|
|
401
|
+
)};
|
|
302
402
|
`;
|
|
303
403
|
const ALPHA = "alpha";
|
|
304
404
|
const BETA = "beta";
|
|
@@ -373,26 +473,24 @@ const Typography = forwardRef(
|
|
|
373
473
|
(props, ref) => {
|
|
374
474
|
const {
|
|
375
475
|
ellipsis: ellipsis2,
|
|
376
|
-
fontSize,
|
|
377
|
-
fontWeight,
|
|
378
|
-
lineHeight,
|
|
379
|
-
textAlign,
|
|
380
476
|
textColor = "currentcolor",
|
|
381
477
|
textDecoration,
|
|
382
478
|
textTransform,
|
|
383
479
|
variant: variant2,
|
|
480
|
+
lineHeight,
|
|
481
|
+
fontWeight,
|
|
482
|
+
fontSize,
|
|
384
483
|
...rest
|
|
385
484
|
} = props;
|
|
386
485
|
const mappedProps = {
|
|
387
486
|
$ellipsis: ellipsis2,
|
|
388
|
-
$fontSize: fontSize,
|
|
389
|
-
$fontWeight: fontWeight,
|
|
390
|
-
$lineHeight: lineHeight,
|
|
391
|
-
$textAlign: textAlign,
|
|
392
487
|
$textColor: textColor,
|
|
393
488
|
$textDecoration: textDecoration,
|
|
394
489
|
$textTransform: textTransform,
|
|
395
|
-
$variant: variant2
|
|
490
|
+
$variant: variant2,
|
|
491
|
+
$lineHeight: lineHeight,
|
|
492
|
+
$fontWeight: fontWeight,
|
|
493
|
+
$fontSize: fontSize
|
|
396
494
|
};
|
|
397
495
|
return /* @__PURE__ */ jsx(StyledTypography, { ref, tag: "span", ...mappedProps, ...rest });
|
|
398
496
|
}
|
|
@@ -401,15 +499,19 @@ const StyledTypography = styled(Box)`
|
|
|
401
499
|
${variant}
|
|
402
500
|
${({ $ellipsis }) => $ellipsis ? ellipsis : ""}
|
|
403
501
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
502
|
+
${({ theme, ...props }) => {
|
|
503
|
+
return handleResponsiveValues(
|
|
504
|
+
{
|
|
505
|
+
color: props.$textColor,
|
|
506
|
+
textDecoration: props.$textDecoration,
|
|
507
|
+
textTransform: props.$textTransform,
|
|
508
|
+
lineHeight: props.$lineHeight,
|
|
509
|
+
fontWeight: props.$fontWeight,
|
|
510
|
+
fontSize: props.$fontSize
|
|
511
|
+
},
|
|
512
|
+
theme
|
|
513
|
+
);
|
|
514
|
+
}}
|
|
413
515
|
`;
|
|
414
516
|
const [AccordionProvider, useAccordion] = createContext("Accordion");
|
|
415
517
|
const Root$8 = React.forwardRef(({ children, size = "S", ...props }, forwardedRef) => {
|
|
@@ -437,25 +539,38 @@ const AccordionItem = styled(RadixAccordion.Item)`
|
|
|
437
539
|
overflow: hidden;
|
|
438
540
|
|
|
439
541
|
&:first-child {
|
|
440
|
-
border-top-left-radius:
|
|
441
|
-
border-top-right-radius:
|
|
542
|
+
border-top-left-radius: 0.3rem;
|
|
543
|
+
border-top-right-radius: 0.3rem;
|
|
442
544
|
}
|
|
443
545
|
|
|
444
546
|
&:last-child {
|
|
445
|
-
border-bottom-left-radius:
|
|
446
|
-
border-bottom-right-radius:
|
|
547
|
+
border-bottom-left-radius: 0.3rem;
|
|
548
|
+
border-bottom-right-radius: 0.3rem;
|
|
447
549
|
}
|
|
448
550
|
|
|
449
551
|
& + & {
|
|
450
552
|
border-top: ${(props) => props.$size === "S" ? `solid 1px ${props.theme.colors.neutral200}` : "unset"};
|
|
451
553
|
}
|
|
452
554
|
|
|
555
|
+
&[data-state='open'] {
|
|
556
|
+
box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
&:hover {
|
|
560
|
+
box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
|
|
561
|
+
}
|
|
562
|
+
|
|
453
563
|
/* This applies our desired focus effect correctly. */
|
|
454
564
|
&:focus-within {
|
|
455
565
|
position: relative;
|
|
456
566
|
z-index: 1;
|
|
457
567
|
box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
|
|
458
568
|
}
|
|
569
|
+
|
|
570
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
571
|
+
transition: box-shadow ${(props) => props.theme.motion.timings["120"]}
|
|
572
|
+
${(props) => props.theme.motion.easings.easeOutQuad};
|
|
573
|
+
}
|
|
459
574
|
`;
|
|
460
575
|
const Trigger$7 = React.forwardRef(
|
|
461
576
|
({ caretPosition = "left", description, icon: Icon, children, ...restProps }, forwardedRef) => {
|
|
@@ -471,10 +586,11 @@ const Trigger$7 = React.forwardRef(
|
|
|
471
586
|
fontWeight: size === "S" ? "bold" : void 0,
|
|
472
587
|
ellipsis: true,
|
|
473
588
|
variant: size === "M" ? "delta" : void 0,
|
|
589
|
+
textAlign: "left",
|
|
474
590
|
children
|
|
475
591
|
}
|
|
476
592
|
),
|
|
477
|
-
description && size === "M" ? /* @__PURE__ */ jsx(Typography, { children: description }) : null
|
|
593
|
+
description && size === "M" ? /* @__PURE__ */ jsx(Typography, { textAlign: "left", children: description }) : null
|
|
478
594
|
] })
|
|
479
595
|
] }),
|
|
480
596
|
caretPosition === "right" ? /* @__PURE__ */ jsx(TriggerIcon, { $size: size, children: /* @__PURE__ */ jsx(CaretDown, { width: size === "S" ? "1.2rem" : "1.6rem", height: size === "S" ? "1.2rem" : "1.6rem" }) }) : null
|
|
@@ -1138,51 +1254,32 @@ const Base = styled(Flex)`
|
|
|
1138
1254
|
`;
|
|
1139
1255
|
}};
|
|
1140
1256
|
`;
|
|
1141
|
-
const
|
|
1142
|
-
({ disabled,
|
|
1143
|
-
return /* @__PURE__ */ jsx(
|
|
1144
|
-
BaseButtonWrapper,
|
|
1145
|
-
{
|
|
1146
|
-
ref,
|
|
1147
|
-
"aria-disabled": disabled,
|
|
1148
|
-
disabled,
|
|
1149
|
-
tag: "button",
|
|
1150
|
-
type: "button",
|
|
1151
|
-
padding: 2,
|
|
1152
|
-
hasRadius: true,
|
|
1153
|
-
background: "neutral0",
|
|
1154
|
-
borderColor: "neutral200",
|
|
1155
|
-
cursor: "pointer",
|
|
1156
|
-
...props,
|
|
1157
|
-
children
|
|
1158
|
-
}
|
|
1159
|
-
);
|
|
1160
|
-
}
|
|
1161
|
-
);
|
|
1162
|
-
const BaseButtonWrapper = styled(Flex)`
|
|
1163
|
-
&[aria-disabled='true'] {
|
|
1164
|
-
pointer-events: none;
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
${focus}
|
|
1168
|
-
`;
|
|
1169
|
-
const BaseLink = forwardRef(
|
|
1170
|
-
({ href, rel = "noreferrer noopener", target = "_self", disabled = false, isExternal = false, ...props }, ref) => {
|
|
1257
|
+
const BaseLinkImpl = forwardRef(
|
|
1258
|
+
({ href, disabled = false, isExternal = false, ...props }, ref) => {
|
|
1171
1259
|
return /* @__PURE__ */ jsx(
|
|
1172
|
-
|
|
1260
|
+
BaseLink,
|
|
1173
1261
|
{
|
|
1174
1262
|
tag: "a",
|
|
1175
1263
|
ref,
|
|
1176
|
-
target: isExternal ? "_blank" :
|
|
1177
|
-
rel: isExternal ?
|
|
1178
|
-
href
|
|
1264
|
+
target: isExternal ? "_blank" : void 0,
|
|
1265
|
+
rel: isExternal ? "noreferrer noopener" : void 0,
|
|
1266
|
+
href,
|
|
1267
|
+
tabIndex: disabled ? -1 : void 0,
|
|
1179
1268
|
"aria-disabled": disabled,
|
|
1180
|
-
|
|
1269
|
+
pointerEvents: disabled ? "none" : void 0,
|
|
1270
|
+
cursor: disabled ? void 0 : "pointer",
|
|
1181
1271
|
...props
|
|
1182
1272
|
}
|
|
1183
1273
|
);
|
|
1184
1274
|
}
|
|
1185
1275
|
);
|
|
1276
|
+
const BaseLink = styled(Box)`
|
|
1277
|
+
text-decoration: none;
|
|
1278
|
+
|
|
1279
|
+
&:visited {
|
|
1280
|
+
color: inherit;
|
|
1281
|
+
}
|
|
1282
|
+
`;
|
|
1186
1283
|
const Divider$1 = () => {
|
|
1187
1284
|
return /* @__PURE__ */ jsx(Box, { "aria-hidden": true, paddingLeft: 1, paddingRight: 1, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", children: "/" }) });
|
|
1188
1285
|
};
|
|
@@ -1196,30 +1293,34 @@ const AlignedList = styled(Flex)`
|
|
|
1196
1293
|
margin-left: ${({ theme }) => `calc(-1*${theme.spaces[2]})`};
|
|
1197
1294
|
}
|
|
1198
1295
|
`;
|
|
1199
|
-
const Breadcrumbs = (
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
};
|
|
1209
|
-
Breadcrumbs.displayName = "Breadcrumbs";
|
|
1210
|
-
const Crumb = ({ children, isCurrent = false, ...props }) => /* @__PURE__ */ jsx(Box, { paddingLeft: 2, paddingRight: 2, paddingTop: 1, paddingBottom: 1, children: /* @__PURE__ */ jsx(
|
|
1211
|
-
Typography,
|
|
1212
|
-
{
|
|
1213
|
-
variant: "pi",
|
|
1214
|
-
textColor: "neutral800",
|
|
1215
|
-
fontWeight: isCurrent ? "bold" : "regular",
|
|
1216
|
-
"aria-current": isCurrent,
|
|
1217
|
-
...props,
|
|
1218
|
-
children
|
|
1296
|
+
const Breadcrumbs = React.forwardRef(
|
|
1297
|
+
({ label, children, ...props }, forwardedRef) => {
|
|
1298
|
+
const childrenArray = React.Children.toArray(children);
|
|
1299
|
+
return /* @__PURE__ */ jsx(Box, { "aria-label": label, tag: "nav", ...props, ref: forwardedRef, children: /* @__PURE__ */ jsx(AlignedList, { tag: "ol", children: React.Children.map(childrenArray, (child, index) => {
|
|
1300
|
+
const shouldDisplayDivider = childrenArray.length > 1 && index + 1 < childrenArray.length;
|
|
1301
|
+
return /* @__PURE__ */ jsxs(Flex, { inline: true, tag: "li", children: [
|
|
1302
|
+
child,
|
|
1303
|
+
shouldDisplayDivider && /* @__PURE__ */ jsx(Divider$1, {})
|
|
1304
|
+
] });
|
|
1305
|
+
}) }) });
|
|
1219
1306
|
}
|
|
1220
|
-
)
|
|
1307
|
+
);
|
|
1308
|
+
Breadcrumbs.displayName = "Breadcrumbs";
|
|
1309
|
+
const Crumb = React.forwardRef(
|
|
1310
|
+
({ children, isCurrent = false, ...props }, forwardedRef) => /* @__PURE__ */ jsx(Box, { paddingLeft: 2, paddingRight: 2, paddingTop: 1, paddingBottom: 1, ref: forwardedRef, children: /* @__PURE__ */ jsx(
|
|
1311
|
+
Typography,
|
|
1312
|
+
{
|
|
1313
|
+
variant: "pi",
|
|
1314
|
+
textColor: "neutral800",
|
|
1315
|
+
fontWeight: isCurrent ? "bold" : "regular",
|
|
1316
|
+
"aria-current": isCurrent,
|
|
1317
|
+
...props,
|
|
1318
|
+
children
|
|
1319
|
+
}
|
|
1320
|
+
) })
|
|
1321
|
+
);
|
|
1221
1322
|
Crumb.displayName = "Crumb";
|
|
1222
|
-
const StyledLink = styled(
|
|
1323
|
+
const StyledLink = styled(BaseLinkImpl)`
|
|
1223
1324
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
1224
1325
|
color: ${({ theme }) => theme.colors.neutral600};
|
|
1225
1326
|
font-size: ${({ theme }) => theme.fontSizes[1]};
|
|
@@ -1233,9 +1334,22 @@ const StyledLink = styled(BaseLink)`
|
|
|
1233
1334
|
color: ${({ theme }) => theme.colors.neutral700};
|
|
1234
1335
|
}
|
|
1235
1336
|
`;
|
|
1236
|
-
const CrumbLink = ({ children, ...props }) => /* @__PURE__ */ jsx(StyledLink, { ...props, children });
|
|
1337
|
+
const CrumbLink = React.forwardRef(({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsx(StyledLink, { ref: forwardedRef, ...props, children }));
|
|
1237
1338
|
CrumbLink.displayName = "CrumbLink";
|
|
1238
1339
|
const stripReactIdOfColon = (str) => str.replaceAll(":", "");
|
|
1340
|
+
function setRef(ref, value) {
|
|
1341
|
+
if (typeof ref === "function") {
|
|
1342
|
+
ref(value);
|
|
1343
|
+
} else if (ref !== null && ref !== void 0) {
|
|
1344
|
+
ref.current = value;
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
function composeRefs(...refs) {
|
|
1348
|
+
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
1349
|
+
}
|
|
1350
|
+
function useComposedRefs(...refs) {
|
|
1351
|
+
return React.useCallback(composeRefs(...refs), refs);
|
|
1352
|
+
}
|
|
1239
1353
|
const isSSR = () => typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
|
|
1240
1354
|
const useIsomorphicLayoutEffect = isSSR() ? useEffect : useLayoutEffect;
|
|
1241
1355
|
const useReactId = React["useId".toString()] || (() => void 0);
|
|
@@ -1285,7 +1399,7 @@ const DANGER = "danger";
|
|
|
1285
1399
|
const SUCCESS = "success";
|
|
1286
1400
|
const GHOST = "ghost";
|
|
1287
1401
|
const LIGHT_VARIANTS = [SUCCESS_LIGHT, DANGER_LIGHT];
|
|
1288
|
-
const VARIANTS
|
|
1402
|
+
const VARIANTS = [DEFAULT, TERTIARY, SECONDARY, DANGER, SUCCESS, GHOST, ...LIGHT_VARIANTS];
|
|
1289
1403
|
const BUTTON_SIZES = ["S", "M", "L"];
|
|
1290
1404
|
const getVariantColorName = (variant2) => {
|
|
1291
1405
|
if (variant2 === SUCCESS_LIGHT || variant2 === DANGER_LIGHT) {
|
|
@@ -1294,7 +1408,7 @@ const getVariantColorName = (variant2) => {
|
|
|
1294
1408
|
if (variant2 === TERTIARY) {
|
|
1295
1409
|
return "neutral";
|
|
1296
1410
|
}
|
|
1297
|
-
if (variant2 === DEFAULT || variant2 === SECONDARY || VARIANTS
|
|
1411
|
+
if (variant2 === DEFAULT || variant2 === SECONDARY || VARIANTS.every((vari) => vari !== variant2)) {
|
|
1298
1412
|
return "primary";
|
|
1299
1413
|
}
|
|
1300
1414
|
return `${variant2}`;
|
|
@@ -1304,6 +1418,7 @@ const getDisabledStyle = ({ theme }) => {
|
|
|
1304
1418
|
border: 1px solid ${theme.colors.neutral200};
|
|
1305
1419
|
background: ${theme.colors.neutral150};
|
|
1306
1420
|
color: ${theme.colors.neutral600};
|
|
1421
|
+
cursor: default;
|
|
1307
1422
|
`;
|
|
1308
1423
|
};
|
|
1309
1424
|
const getHoverStyle = ({ theme, $variant }) => {
|
|
@@ -1341,7 +1456,7 @@ const getActiveStyle = ({ theme, $variant }) => {
|
|
|
1341
1456
|
color: ${theme.colors[`${getVariantColorName($variant)}600`]};
|
|
1342
1457
|
`;
|
|
1343
1458
|
}
|
|
1344
|
-
if ($variant === TERTIARY) {
|
|
1459
|
+
if ($variant === TERTIARY || $variant === GHOST) {
|
|
1345
1460
|
return css`
|
|
1346
1461
|
background-color: ${theme.colors.neutral150};
|
|
1347
1462
|
`;
|
|
@@ -1390,6 +1505,8 @@ const getVariantStyle = ({ theme, $variant }) => {
|
|
|
1390
1505
|
}
|
|
1391
1506
|
default: {
|
|
1392
1507
|
return css`
|
|
1508
|
+
border: 1px solid ${theme.colors.buttonPrimary600};
|
|
1509
|
+
background: ${theme.colors.buttonPrimary600};
|
|
1393
1510
|
color: ${theme.colors.buttonNeutral0};
|
|
1394
1511
|
`;
|
|
1395
1512
|
}
|
|
@@ -1422,21 +1539,22 @@ const Button = forwardRef(
|
|
|
1422
1539
|
disabled: isDisabled,
|
|
1423
1540
|
$size: size,
|
|
1424
1541
|
$variant: variant2,
|
|
1542
|
+
tag: "button",
|
|
1425
1543
|
onClick: handleClick,
|
|
1426
|
-
|
|
1427
|
-
background: "buttonPrimary600",
|
|
1428
|
-
borderColor: "buttonPrimary600",
|
|
1544
|
+
hasRadius: true,
|
|
1429
1545
|
gap: 2,
|
|
1430
|
-
inline:
|
|
1431
|
-
|
|
1546
|
+
inline: true,
|
|
1547
|
+
alignItems: "center",
|
|
1548
|
+
justifyContent: "center",
|
|
1549
|
+
width: fullWidth ? "100%" : void 0,
|
|
1432
1550
|
paddingLeft: 4,
|
|
1433
1551
|
paddingRight: 4,
|
|
1434
|
-
|
|
1552
|
+
cursor: "pointer",
|
|
1435
1553
|
...props,
|
|
1436
1554
|
children: [
|
|
1437
|
-
(startIcon || loading) && /* @__PURE__ */ jsx(
|
|
1555
|
+
(startIcon || loading) && /* @__PURE__ */ jsx(Flex, { tag: "span", "aria-hidden": true, children: loading ? /* @__PURE__ */ jsx(LoaderAnimated, {}) : startIcon }),
|
|
1438
1556
|
/* @__PURE__ */ jsx(Typography, { variant: size === "S" ? "pi" : void 0, fontWeight: "bold", children }),
|
|
1439
|
-
endIcon && /* @__PURE__ */ jsx(Flex, { "aria-hidden": true, children: endIcon })
|
|
1557
|
+
endIcon && /* @__PURE__ */ jsx(Flex, { tag: "span", "aria-hidden": true, children: endIcon })
|
|
1440
1558
|
]
|
|
1441
1559
|
}
|
|
1442
1560
|
);
|
|
@@ -1454,20 +1572,10 @@ const LoaderAnimated = styled(Loader$1)`
|
|
|
1454
1572
|
animation: ${rotation$2} 2s infinite linear;
|
|
1455
1573
|
will-change: transform;
|
|
1456
1574
|
`;
|
|
1457
|
-
const ButtonWrapper = styled(
|
|
1575
|
+
const ButtonWrapper = styled(Flex)`
|
|
1458
1576
|
height: ${({ theme, $size }) => theme.sizes.button[$size]};
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
height: 1.2rem;
|
|
1462
|
-
}
|
|
1463
|
-
|
|
1464
|
-
&[aria-disabled='true'] {
|
|
1465
|
-
${getDisabledStyle}
|
|
1466
|
-
|
|
1467
|
-
&:active {
|
|
1468
|
-
${getDisabledStyle}
|
|
1469
|
-
}
|
|
1470
|
-
}
|
|
1577
|
+
text-decoration: none;
|
|
1578
|
+
${getVariantStyle}
|
|
1471
1579
|
|
|
1472
1580
|
&:hover {
|
|
1473
1581
|
${getHoverStyle}
|
|
@@ -1477,7 +1585,9 @@ const ButtonWrapper = styled(BaseButton)`
|
|
|
1477
1585
|
${getActiveStyle}
|
|
1478
1586
|
}
|
|
1479
1587
|
|
|
1480
|
-
|
|
1588
|
+
&[aria-disabled='true'] {
|
|
1589
|
+
${getDisabledStyle}
|
|
1590
|
+
}
|
|
1481
1591
|
|
|
1482
1592
|
@media (prefers-reduced-motion: no-preference) {
|
|
1483
1593
|
transition:
|
|
@@ -1486,76 +1596,220 @@ const ButtonWrapper = styled(BaseButton)`
|
|
|
1486
1596
|
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
1487
1597
|
}
|
|
1488
1598
|
`;
|
|
1489
|
-
const
|
|
1490
|
-
({
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1599
|
+
const TooltipImpl = React.forwardRef(
|
|
1600
|
+
({
|
|
1601
|
+
children,
|
|
1602
|
+
description,
|
|
1603
|
+
label,
|
|
1604
|
+
defaultOpen,
|
|
1605
|
+
open,
|
|
1606
|
+
onOpenChange,
|
|
1607
|
+
delayDuration = 500,
|
|
1608
|
+
disableHoverableContent,
|
|
1609
|
+
...restProps
|
|
1610
|
+
}, forwardedRef) => {
|
|
1611
|
+
return /* @__PURE__ */ jsxs(
|
|
1612
|
+
Tooltip.Root,
|
|
1613
|
+
{
|
|
1614
|
+
defaultOpen,
|
|
1615
|
+
open,
|
|
1616
|
+
onOpenChange,
|
|
1617
|
+
delayDuration,
|
|
1618
|
+
disableHoverableContent,
|
|
1619
|
+
children: [
|
|
1620
|
+
/* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children }),
|
|
1621
|
+
/* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(TooltipContent, { ref: forwardedRef, sideOffset: 8, ...restProps, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: label || description }) }) })
|
|
1622
|
+
]
|
|
1623
|
+
}
|
|
1624
|
+
);
|
|
1497
1625
|
}
|
|
1498
1626
|
);
|
|
1499
|
-
const
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
path {
|
|
1510
|
-
fill: ${({ disabled, theme }) => disabled ? theme.colors.neutral600 : theme.colors.primary600};
|
|
1511
|
-
}
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
&:hover {
|
|
1515
|
-
color: ${({ theme }) => theme.colors.primary500};
|
|
1516
|
-
}
|
|
1627
|
+
const TooltipContent = styled(Tooltip.Content)`
|
|
1628
|
+
background-color: ${(props) => props.theme.colors.neutral900};
|
|
1629
|
+
color: ${(props) => props.theme.colors.neutral0};
|
|
1630
|
+
padding-inline: ${(props) => props.theme.spaces[2]};
|
|
1631
|
+
padding-block: ${(props) => props.theme.spaces[2]};
|
|
1632
|
+
border-radius: ${(props) => props.theme.borderRadius};
|
|
1633
|
+
z-index: ${(props) => props.theme.zIndices.tooltip};
|
|
1634
|
+
will-change: opacity;
|
|
1635
|
+
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
1517
1636
|
|
|
1518
|
-
|
|
1519
|
-
|
|
1637
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1638
|
+
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
1639
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
1520
1640
|
}
|
|
1521
|
-
|
|
1522
|
-
${focus};
|
|
1523
1641
|
`;
|
|
1524
|
-
const
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1642
|
+
const IconButton = forwardRef(
|
|
1643
|
+
({
|
|
1644
|
+
label,
|
|
1645
|
+
background,
|
|
1646
|
+
children,
|
|
1647
|
+
disabled = false,
|
|
1648
|
+
onClick,
|
|
1649
|
+
size = "S",
|
|
1650
|
+
variant: variant2 = "tertiary",
|
|
1651
|
+
withTooltip = true,
|
|
1652
|
+
...restProps
|
|
1653
|
+
}, ref) => {
|
|
1654
|
+
const handleClick = (e) => {
|
|
1655
|
+
if (!disabled && onClick) {
|
|
1656
|
+
onClick(e);
|
|
1657
|
+
}
|
|
1658
|
+
};
|
|
1659
|
+
const component = /* @__PURE__ */ jsx(
|
|
1660
|
+
IconButtonWrapper,
|
|
1529
1661
|
{
|
|
1662
|
+
"aria-disabled": disabled,
|
|
1663
|
+
background: disabled ? "neutral150" : background,
|
|
1664
|
+
tag: "button",
|
|
1665
|
+
display: "inline-flex",
|
|
1666
|
+
justifyContent: "center",
|
|
1667
|
+
hasRadius: true,
|
|
1668
|
+
cursor: "pointer",
|
|
1669
|
+
...restProps,
|
|
1530
1670
|
ref,
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
paddingBottom: size === "S" ? 1 : 2,
|
|
1536
|
-
paddingLeft: size === "S" ? 3 : 4,
|
|
1537
|
-
paddingRight: size === "S" ? 3 : 4,
|
|
1538
|
-
...props
|
|
1671
|
+
$size: size,
|
|
1672
|
+
onClick: handleClick,
|
|
1673
|
+
$variant: variant2,
|
|
1674
|
+
children: /* @__PURE__ */ jsx(AccessibleIcon, { label, children })
|
|
1539
1675
|
}
|
|
1540
|
-
)
|
|
1676
|
+
);
|
|
1677
|
+
return withTooltip ? /* @__PURE__ */ jsx(TooltipImpl, { label, children: component }) : component;
|
|
1678
|
+
}
|
|
1679
|
+
);
|
|
1680
|
+
const IconButtonWrapper = styled(Flex)`
|
|
1681
|
+
text-decoration: none;
|
|
1682
|
+
|
|
1683
|
+
${(props) => {
|
|
1684
|
+
switch (props.$size) {
|
|
1685
|
+
case "S": {
|
|
1686
|
+
return css`
|
|
1687
|
+
padding-block: 0.7rem;
|
|
1688
|
+
padding-inline: 0.7rem;
|
|
1689
|
+
`;
|
|
1690
|
+
}
|
|
1691
|
+
case "M": {
|
|
1692
|
+
return css`
|
|
1693
|
+
padding-block: 0.9rem;
|
|
1694
|
+
padding-inline: 0.9rem;
|
|
1695
|
+
`;
|
|
1696
|
+
}
|
|
1697
|
+
case "L": {
|
|
1698
|
+
return css`
|
|
1699
|
+
padding-block: 1.1rem;
|
|
1700
|
+
padding-inline: 1.1rem;
|
|
1701
|
+
`;
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
}}
|
|
1705
|
+
${getVariantStyle}
|
|
1706
|
+
${(props) => props.$variant === "tertiary" ? css`
|
|
1707
|
+
color: ${props.theme.colors.neutral500};
|
|
1708
|
+
` : ""}
|
|
1709
|
+
|
|
1710
|
+
&:hover {
|
|
1711
|
+
${getHoverStyle}
|
|
1712
|
+
${(props) => props.$variant === "tertiary" ? css`
|
|
1713
|
+
color: ${props.theme.colors.neutral600};
|
|
1714
|
+
` : ""}
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
&:active {
|
|
1718
|
+
${getActiveStyle}
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
&[aria-disabled='true'] {
|
|
1722
|
+
${getDisabledStyle}
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1726
|
+
transition:
|
|
1727
|
+
${(props) => props.theme.transitions.backgroundColor},
|
|
1728
|
+
${(props) => props.theme.transitions.color},
|
|
1729
|
+
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
1730
|
+
}
|
|
1731
|
+
`;
|
|
1732
|
+
const IconButtonGroup = styled(Flex)`
|
|
1733
|
+
& ${IconButtonWrapper}:first-child {
|
|
1734
|
+
border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
& ${IconButtonWrapper}:last-child {
|
|
1738
|
+
border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
& ${IconButtonWrapper} {
|
|
1742
|
+
border-radius: 0;
|
|
1743
|
+
|
|
1744
|
+
& + ${IconButtonWrapper} {
|
|
1745
|
+
border-left: none;
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
`;
|
|
1749
|
+
const Link = forwardRef(
|
|
1750
|
+
({ children, href, disabled = false, startIcon, endIcon, isExternal = false, ...props }, ref) => {
|
|
1751
|
+
return /* @__PURE__ */ jsxs(LinkWrapper$1, { ref, href, disabled, isExternal, ...props, children: [
|
|
1752
|
+
startIcon,
|
|
1753
|
+
/* @__PURE__ */ jsx(Typography, { textColor: disabled ? "neutral600" : "primary600", children }),
|
|
1754
|
+
endIcon,
|
|
1755
|
+
href && !endIcon && isExternal && /* @__PURE__ */ jsx(ExternalLink, {})
|
|
1756
|
+
] });
|
|
1757
|
+
}
|
|
1758
|
+
);
|
|
1759
|
+
const LinkWrapper$1 = styled(BaseLinkImpl)`
|
|
1760
|
+
display: inline-flex;
|
|
1761
|
+
align-items: center;
|
|
1762
|
+
text-decoration: none;
|
|
1763
|
+
gap: ${({ theme }) => theme.spaces[2]};
|
|
1764
|
+
pointer-events: ${({ disabled }) => disabled ? "none" : void 0};
|
|
1765
|
+
|
|
1766
|
+
svg {
|
|
1767
|
+
font-size: 1rem;
|
|
1768
|
+
|
|
1769
|
+
path {
|
|
1770
|
+
fill: ${({ disabled, theme }) => disabled ? theme.colors.neutral600 : theme.colors.primary600};
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
&:hover {
|
|
1775
|
+
& > span {
|
|
1776
|
+
color: ${({ theme }) => theme.colors.primary500};
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
&:active {
|
|
1781
|
+
color: ${({ theme }) => theme.colors.primary700};
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
${focus};
|
|
1785
|
+
`;
|
|
1786
|
+
const MenuRoot = DropdownMenu.Root;
|
|
1787
|
+
const MenuTrigger = React.forwardRef(
|
|
1788
|
+
({ label, endIcon = /* @__PURE__ */ jsx(CaretDown, { width: "1.2rem", height: "1.2rem", "aria-hidden": true }), tag = Button, icon, ...rest }, ref) => {
|
|
1789
|
+
const props = {
|
|
1790
|
+
...rest,
|
|
1791
|
+
ref,
|
|
1792
|
+
type: "button"
|
|
1793
|
+
};
|
|
1794
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild: true, children: tag === IconButton ? /* @__PURE__ */ jsx(IconButton, { label, variant: "tertiary", ...props, children: icon }) : /* @__PURE__ */ jsx(Button, { endIcon, variant: "ghost", ...props }) });
|
|
1541
1795
|
}
|
|
1542
1796
|
);
|
|
1543
1797
|
const MenuContent = React.forwardRef(
|
|
1544
1798
|
({ children, intersectionId, popoverPlacement = "bottom-start", ...props }, ref) => {
|
|
1545
1799
|
const [side, align] = popoverPlacement.split("-");
|
|
1546
|
-
return /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx(
|
|
1800
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx(DropdownMenuContent, { align, side, loop: true, asChild: true, children: /* @__PURE__ */ jsxs(
|
|
1547
1801
|
Viewport$2,
|
|
1548
1802
|
{
|
|
1549
1803
|
ref,
|
|
1550
1804
|
direction: "column",
|
|
1551
|
-
borderStyle: "solid",
|
|
1552
|
-
borderWidth: "1px",
|
|
1553
1805
|
borderColor: "neutral150",
|
|
1554
1806
|
hasRadius: true,
|
|
1555
1807
|
background: "neutral0",
|
|
1556
1808
|
shadow: "filterShadow",
|
|
1557
1809
|
maxHeight: "15rem",
|
|
1558
1810
|
padding: 1,
|
|
1811
|
+
marginTop: 1,
|
|
1812
|
+
marginBottom: 1,
|
|
1559
1813
|
alignItems: "flex-start",
|
|
1560
1814
|
position: "relative",
|
|
1561
1815
|
overflow: "auto",
|
|
@@ -1577,6 +1831,23 @@ const Viewport$2 = styled(Flex)`
|
|
|
1577
1831
|
display: none;
|
|
1578
1832
|
}
|
|
1579
1833
|
`;
|
|
1834
|
+
const DropdownMenuContent = styled(DropdownMenu.Content)`
|
|
1835
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1836
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
1837
|
+
|
|
1838
|
+
&[data-state='open'] {
|
|
1839
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
1840
|
+
|
|
1841
|
+
&[data-side='top'] {
|
|
1842
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
&[data-side='bottom'] {
|
|
1846
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
`;
|
|
1580
1851
|
const MenuItem$1 = ({ onSelect, disabled = false, isLink, ...props }) => {
|
|
1581
1852
|
return /* @__PURE__ */ jsx(DropdownMenu.Item, { asChild: true, onSelect, disabled, children: isLink || props.isExternal ? /* @__PURE__ */ jsx(OptionLink, { color: "neutral800", ...props, isExternal: props.isExternal ?? false, children: /* @__PURE__ */ jsx(Typography, { children: props.children }) }) : /* @__PURE__ */ jsx(OptionButton, { cursor: "pointer", color: "neutral800", background: "transparent", borderStyle: "none", ...props, children: /* @__PURE__ */ jsx(Typography, { children: props.children }) }) });
|
|
1582
1853
|
};
|
|
@@ -1586,7 +1857,7 @@ const getOptionStyle = ({ theme }) => css`
|
|
|
1586
1857
|
border-radius: ${theme.borderRadius};
|
|
1587
1858
|
padding: ${theme.spaces[2]} ${theme.spaces[4]};
|
|
1588
1859
|
|
|
1589
|
-
&[aria-disabled] {
|
|
1860
|
+
&[aria-disabled='true'] {
|
|
1590
1861
|
cursor: not-allowed;
|
|
1591
1862
|
color: ${theme.colors.neutral500};
|
|
1592
1863
|
}
|
|
@@ -1691,37 +1962,41 @@ const Menu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
1691
1962
|
SubTrigger,
|
|
1692
1963
|
Trigger: Trigger$6
|
|
1693
1964
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1694
|
-
const SimpleMenu = (
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
}
|
|
1965
|
+
const SimpleMenu = React.forwardRef(
|
|
1966
|
+
({ children, onOpen, onClose, popoverPlacement, onReachEnd, ...props }, forwardedRef) => {
|
|
1967
|
+
const triggerRef = React.useRef(null);
|
|
1968
|
+
const composedRef = useComposedRefs(forwardedRef, triggerRef);
|
|
1969
|
+
const contentRef = React.useRef(null);
|
|
1970
|
+
const [internalIsOpen, setInternalIsOpen] = React.useState(false);
|
|
1971
|
+
const handleReachEnd = (entry) => {
|
|
1972
|
+
if (onReachEnd) {
|
|
1973
|
+
onReachEnd(entry);
|
|
1974
|
+
}
|
|
1975
|
+
};
|
|
1976
|
+
const handleOpenChange = (isOpen) => {
|
|
1977
|
+
if (isOpen && typeof onOpen === "function") {
|
|
1978
|
+
onOpen();
|
|
1979
|
+
} else if (!isOpen && typeof onClose === "function") {
|
|
1980
|
+
onClose();
|
|
1981
|
+
}
|
|
1982
|
+
setInternalIsOpen(isOpen);
|
|
1983
|
+
};
|
|
1984
|
+
const generatedId = useId();
|
|
1985
|
+
const intersectionId = `intersection-${stripReactIdOfColon(generatedId)}`;
|
|
1986
|
+
useIntersection(contentRef, handleReachEnd, {
|
|
1987
|
+
selectorToWatch: `#${intersectionId}`,
|
|
1988
|
+
/**
|
|
1989
|
+
* We need to know when the select is open because only then will viewportRef
|
|
1990
|
+
* not be null. Because it uses a portal that (sensibly) is not mounted 24/7.
|
|
1991
|
+
*/
|
|
1992
|
+
skipWhen: !internalIsOpen
|
|
1993
|
+
});
|
|
1994
|
+
return /* @__PURE__ */ jsxs(Root$7, { onOpenChange: handleOpenChange, children: [
|
|
1995
|
+
/* @__PURE__ */ jsx(Trigger$6, { ref: composedRef, ...props, children: props.label }),
|
|
1996
|
+
/* @__PURE__ */ jsx(Content$6, { ref: contentRef, intersectionId, popoverPlacement, children })
|
|
1997
|
+
] });
|
|
1998
|
+
}
|
|
1999
|
+
);
|
|
1725
2000
|
const MenuItem = Item$3;
|
|
1726
2001
|
const StyledButton = styled(SimpleMenu)`
|
|
1727
2002
|
padding: ${({ theme }) => `${theme.spaces[1]} ${theme.spaces[2]}`};
|
|
@@ -1732,16 +2007,19 @@ const StyledButton = styled(SimpleMenu)`
|
|
|
1732
2007
|
background-color: ${({ theme }) => theme.colors.neutral200};
|
|
1733
2008
|
}
|
|
1734
2009
|
`;
|
|
1735
|
-
const CrumbSimpleMenu = (
|
|
2010
|
+
const CrumbSimpleMenu = React.forwardRef(
|
|
2011
|
+
({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsx(StyledButton, { ref: forwardedRef, endIcon: null, size: "S", ...props, children })
|
|
2012
|
+
);
|
|
1736
2013
|
CrumbSimpleMenu.displayName = "CrumbSimpleMenu";
|
|
1737
2014
|
const CardContext = React.createContext({ id: "" });
|
|
1738
2015
|
const useCard = () => React.useContext(CardContext);
|
|
1739
|
-
const Card = ({ id, ...props }) => {
|
|
2016
|
+
const Card = React.forwardRef(({ id, ...props }, forwardedRef) => {
|
|
1740
2017
|
const generatedId = useId(id);
|
|
1741
2018
|
const context = React.useMemo(() => ({ id: generatedId }), [generatedId]);
|
|
1742
2019
|
return /* @__PURE__ */ jsx(CardContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
|
|
1743
2020
|
Box,
|
|
1744
2021
|
{
|
|
2022
|
+
ref: forwardedRef,
|
|
1745
2023
|
id,
|
|
1746
2024
|
tabIndex: 0,
|
|
1747
2025
|
hasRadius: true,
|
|
@@ -1755,10 +2033,10 @@ const Card = ({ id, ...props }) => {
|
|
|
1755
2033
|
...props
|
|
1756
2034
|
}
|
|
1757
2035
|
) });
|
|
1758
|
-
};
|
|
1759
|
-
const CardActionImpl = ({ position, ...restProps }) => {
|
|
1760
|
-
return /* @__PURE__ */ jsx(CardAction, { $position: position, ...restProps, direction: "row", gap: 2 });
|
|
1761
|
-
};
|
|
2036
|
+
});
|
|
2037
|
+
const CardActionImpl = React.forwardRef(({ position, ...restProps }, forwardedRef) => {
|
|
2038
|
+
return /* @__PURE__ */ jsx(CardAction, { ref: forwardedRef, $position: position, ...restProps, direction: "row", gap: 2 });
|
|
2039
|
+
});
|
|
1762
2040
|
const CardAction = styled(Flex)`
|
|
1763
2041
|
position: absolute;
|
|
1764
2042
|
top: ${({ theme }) => theme.spaces[3]};
|
|
@@ -1809,30 +2087,17 @@ const CardBadge = (props) => /* @__PURE__ */ jsx(CardBadgeWrapper, { children: /
|
|
|
1809
2087
|
const CardBody = (props) => {
|
|
1810
2088
|
return /* @__PURE__ */ jsx(Box, { paddingLeft: 3, paddingRight: 3, paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsx(Flex, { ...props, alignItems: "flex-start" }) });
|
|
1811
2089
|
};
|
|
1812
|
-
function setRef(ref, value) {
|
|
1813
|
-
if (typeof ref === "function") {
|
|
1814
|
-
ref(value);
|
|
1815
|
-
} else if (ref !== null && ref !== void 0) {
|
|
1816
|
-
ref.current = value;
|
|
1817
|
-
}
|
|
1818
|
-
}
|
|
1819
|
-
function composeRefs(...refs) {
|
|
1820
|
-
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
1821
|
-
}
|
|
1822
|
-
function useComposedRefs(...refs) {
|
|
1823
|
-
return React.useCallback(composeRefs(...refs), refs);
|
|
1824
|
-
}
|
|
1825
2090
|
const CheckIcon = ({ fill, ...props }) => {
|
|
1826
2091
|
const { colors } = useTheme();
|
|
1827
2092
|
return /* @__PURE__ */ jsx(
|
|
1828
2093
|
Box,
|
|
1829
2094
|
{
|
|
1830
2095
|
tag: "svg",
|
|
1831
|
-
viewBox: "0 0
|
|
2096
|
+
viewBox: "0 0 32 32",
|
|
1832
2097
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1833
2098
|
fill: fill ? colors[fill] : void 0,
|
|
1834
2099
|
...props,
|
|
1835
|
-
children: /* @__PURE__ */ jsx("path", { d: "
|
|
2100
|
+
children: /* @__PURE__ */ jsx("path", { d: "M29.0613 10.0613L13.0613 26.0613C12.9219 26.2011 12.7563 26.3121 12.574 26.3878C12.3917 26.4635 12.1962 26.5024 11.9988 26.5024C11.8013 26.5024 11.6059 26.4635 11.4235 26.3878C11.2412 26.3121 11.0756 26.2011 10.9363 26.0613L3.93626 19.0613C3.79673 18.9217 3.68605 18.7561 3.61053 18.5738C3.53502 18.3915 3.49615 18.1961 3.49615 17.9988C3.49615 17.8014 3.53502 17.606 3.61053 17.4237C3.68605 17.2414 3.79673 17.0758 3.93626 16.9363C4.07579 16.7967 4.24143 16.686 4.42374 16.6105C4.60604 16.535 4.80143 16.4962 4.99876 16.4962C5.19608 16.4962 5.39147 16.535 5.57378 16.6105C5.75608 16.686 5.92173 16.7967 6.06126 16.9363L12 22.875L26.9388 7.93876C27.2205 7.65697 27.6027 7.49866 28.0013 7.49866C28.3998 7.49866 28.782 7.65697 29.0638 7.93876C29.3455 8.22055 29.5039 8.60274 29.5039 9.00126C29.5039 9.39977 29.3455 9.78197 29.0638 10.0638L29.0613 10.0613Z" })
|
|
1836
2101
|
}
|
|
1837
2102
|
);
|
|
1838
2103
|
};
|
|
@@ -1845,9 +2110,9 @@ const CheckboxEl = React.forwardRef(
|
|
|
1845
2110
|
onChange: onCheckedChange
|
|
1846
2111
|
});
|
|
1847
2112
|
const composedRefs = useComposedRefs(checkboxRef, forwardedRef);
|
|
1848
|
-
return /* @__PURE__ */ jsx(CheckboxRoot, { ref: composedRefs, checked, onCheckedChange: setChecked, ...props, children: /* @__PURE__ */ jsxs(Checkbox.Indicator, { children: [
|
|
1849
|
-
checked === true ? /* @__PURE__ */ jsx(CheckIcon, { width: "
|
|
1850
|
-
checked === "indeterminate" ? /* @__PURE__ */ jsx(
|
|
2113
|
+
return /* @__PURE__ */ jsx(CheckboxRoot, { ref: composedRefs, checked, onCheckedChange: setChecked, ...props, children: /* @__PURE__ */ jsxs(Checkbox.Indicator, { style: { display: "inline-flex" }, children: [
|
|
2114
|
+
checked === true ? /* @__PURE__ */ jsx(CheckIcon, { width: "1.6rem", fill: "neutral0" }) : null,
|
|
2115
|
+
checked === "indeterminate" ? /* @__PURE__ */ jsx(Minus, { fill: "neutral0" }) : null
|
|
1851
2116
|
] }) });
|
|
1852
2117
|
}
|
|
1853
2118
|
);
|
|
@@ -1865,12 +2130,6 @@ const CheckboxRoot = styled(Checkbox.Root)`
|
|
|
1865
2130
|
// this ensures the checkbox is always a square even in flex-containers.
|
|
1866
2131
|
flex: 0 0 2rem;
|
|
1867
2132
|
|
|
1868
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
1869
|
-
transition:
|
|
1870
|
-
border-color ${(props) => props.theme.motion.timings["120"]} ${(props) => props.theme.motion.easings.easeOutQuad},
|
|
1871
|
-
${(props) => props.theme.transitions.backgroundColor};
|
|
1872
|
-
}
|
|
1873
|
-
|
|
1874
2133
|
&[data-state='checked'],
|
|
1875
2134
|
&[data-state='indeterminate'] {
|
|
1876
2135
|
border: 1px solid ${(props) => props.theme.colors.primary600};
|
|
@@ -1904,10 +2163,10 @@ const CheckboxImpl = React.forwardRef(({ children, ...restProps }, forwardedRef)
|
|
|
1904
2163
|
/* @__PURE__ */ jsx(Typography, { tag: "label", textColor: "neutral800", htmlFor: labelId, children })
|
|
1905
2164
|
] });
|
|
1906
2165
|
});
|
|
1907
|
-
const CardCheckbox = (props) => {
|
|
2166
|
+
const CardCheckbox = React.forwardRef((props, forwardedRef) => {
|
|
1908
2167
|
const { id } = useCard();
|
|
1909
|
-
return /* @__PURE__ */ jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsx(CheckboxImpl, { "aria-labelledby": `${id}-title`, ...props }) });
|
|
1910
|
-
};
|
|
2168
|
+
return /* @__PURE__ */ jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsx(CheckboxImpl, { "aria-labelledby": `${id}-title`, ...props, ref: forwardedRef }) });
|
|
2169
|
+
});
|
|
1911
2170
|
const BreakBox = styled(Box)`
|
|
1912
2171
|
word-break: break-all;
|
|
1913
2172
|
`;
|
|
@@ -1959,49 +2218,6 @@ const KeyboardKeys = {
|
|
|
1959
2218
|
BACKSPACE: "Backspace",
|
|
1960
2219
|
CLEAR: "Clear"
|
|
1961
2220
|
};
|
|
1962
|
-
const TooltipImpl = React.forwardRef(
|
|
1963
|
-
({
|
|
1964
|
-
children,
|
|
1965
|
-
description,
|
|
1966
|
-
label,
|
|
1967
|
-
defaultOpen,
|
|
1968
|
-
open,
|
|
1969
|
-
onOpenChange,
|
|
1970
|
-
delayDuration = 500,
|
|
1971
|
-
disableHoverableContent,
|
|
1972
|
-
...restProps
|
|
1973
|
-
}, forwardedRef) => {
|
|
1974
|
-
return /* @__PURE__ */ jsxs(
|
|
1975
|
-
Tooltip.Root,
|
|
1976
|
-
{
|
|
1977
|
-
defaultOpen,
|
|
1978
|
-
open,
|
|
1979
|
-
onOpenChange,
|
|
1980
|
-
delayDuration,
|
|
1981
|
-
disableHoverableContent,
|
|
1982
|
-
children: [
|
|
1983
|
-
/* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children }),
|
|
1984
|
-
/* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(TooltipContent, { ref: forwardedRef, sideOffset: 8, ...restProps, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: label || description }) }) })
|
|
1985
|
-
]
|
|
1986
|
-
}
|
|
1987
|
-
);
|
|
1988
|
-
}
|
|
1989
|
-
);
|
|
1990
|
-
const TooltipContent = styled(Tooltip.Content)`
|
|
1991
|
-
background-color: ${(props) => props.theme.colors.neutral900};
|
|
1992
|
-
color: ${(props) => props.theme.colors.neutral0};
|
|
1993
|
-
padding-inline: ${(props) => props.theme.spaces[2]};
|
|
1994
|
-
padding-block: ${(props) => props.theme.spaces[2]};
|
|
1995
|
-
border-radius: ${(props) => props.theme.borderRadius};
|
|
1996
|
-
z-index: ${(props) => props.theme.zIndices.tooltip};
|
|
1997
|
-
will-change: opacity;
|
|
1998
|
-
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
1999
|
-
|
|
2000
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
2001
|
-
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
2002
|
-
${(props) => props.theme.motion.easings.authenticMotion};
|
|
2003
|
-
}
|
|
2004
|
-
`;
|
|
2005
2221
|
const CarouselGrid = styled(Box)`
|
|
2006
2222
|
grid-template-columns: auto 1fr auto;
|
|
2007
2223
|
grid-template-areas: 'startAction slides endAction';
|
|
@@ -2096,9 +2312,11 @@ const commonTheme = {
|
|
|
2096
2312
|
},
|
|
2097
2313
|
spaces: ["0px", "4px", "8px", "12px", "16px", "20px", "24px", "32px", "40px", "48px", "56px", "64px"],
|
|
2098
2314
|
borderRadius: "4px",
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2315
|
+
breakpoints: {
|
|
2316
|
+
initial: "@media(min-width: 0px)",
|
|
2317
|
+
small: "@media(min-width: 520px)",
|
|
2318
|
+
medium: "@media(min-width: 768px)",
|
|
2319
|
+
large: "@media(min-width: 1080px)"
|
|
2102
2320
|
},
|
|
2103
2321
|
fontSizes: [`1.1rem`, `1.2rem`, `1.4rem`, "1.6rem", `1.8rem`, `3.2rem`],
|
|
2104
2322
|
lineHeights: [1.14, 1.22, 1.25, 1.33, 1.43, 1.45, 1.5],
|
|
@@ -2939,7 +3157,7 @@ lodash.exports;
|
|
|
2939
3157
|
}
|
|
2940
3158
|
var runInContext = function runInContext2(context) {
|
|
2941
3159
|
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
|
|
2942
|
-
var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function,
|
|
3160
|
+
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;
|
|
2943
3161
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
|
2944
3162
|
var coreJsData = context["__core-js_shared__"];
|
|
2945
3163
|
var funcToString = funcProto.toString;
|
|
@@ -2965,7 +3183,7 @@ lodash.exports;
|
|
|
2965
3183
|
}
|
|
2966
3184
|
}();
|
|
2967
3185
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
|
|
2968
|
-
var nativeCeil =
|
|
3186
|
+
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;
|
|
2969
3187
|
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");
|
|
2970
3188
|
var metaMap = WeakMap && new WeakMap();
|
|
2971
3189
|
var realNames = {};
|
|
@@ -4711,7 +4929,7 @@ lodash.exports;
|
|
|
4711
4929
|
return setWrapToString(result2, func, bitmask);
|
|
4712
4930
|
}
|
|
4713
4931
|
function createRound(methodName) {
|
|
4714
|
-
var func =
|
|
4932
|
+
var func = Math2[methodName];
|
|
4715
4933
|
return function(number, precision) {
|
|
4716
4934
|
number = toNumber(number);
|
|
4717
4935
|
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
|
|
@@ -7802,10 +8020,9 @@ const Label = React.forwardRef(({ children, action, ...props }, ref) => {
|
|
|
7802
8020
|
return null;
|
|
7803
8021
|
}
|
|
7804
8022
|
return /* @__PURE__ */ jsxs(
|
|
7805
|
-
|
|
8023
|
+
TypographyLabel,
|
|
7806
8024
|
{
|
|
7807
8025
|
ref: composedRefs,
|
|
7808
|
-
display: "flex",
|
|
7809
8026
|
variant: "pi",
|
|
7810
8027
|
textColor: "neutral800",
|
|
7811
8028
|
fontWeight: "bold",
|
|
@@ -7813,6 +8030,7 @@ const Label = React.forwardRef(({ children, action, ...props }, ref) => {
|
|
|
7813
8030
|
id: `${id}-label`,
|
|
7814
8031
|
htmlFor: id,
|
|
7815
8032
|
tag: "label",
|
|
8033
|
+
ellipsis: true,
|
|
7816
8034
|
children: [
|
|
7817
8035
|
children,
|
|
7818
8036
|
required && /* @__PURE__ */ jsx(Typography, { "aria-hidden": true, lineHeight: "1em", textColor: "danger600", children: "*" }),
|
|
@@ -7821,6 +8039,9 @@ const Label = React.forwardRef(({ children, action, ...props }, ref) => {
|
|
|
7821
8039
|
}
|
|
7822
8040
|
);
|
|
7823
8041
|
});
|
|
8042
|
+
const TypographyLabel = styled(Typography)`
|
|
8043
|
+
display: flex;
|
|
8044
|
+
`;
|
|
7824
8045
|
const LabelAction = styled(Flex)`
|
|
7825
8046
|
line-height: 0;
|
|
7826
8047
|
color: ${({ theme }) => theme.colors.neutral500};
|
|
@@ -7845,11 +8066,24 @@ const Input$2 = React.forwardRef(
|
|
|
7845
8066
|
ariaDescription = `${id}-hint`;
|
|
7846
8067
|
}
|
|
7847
8068
|
const hasError = Boolean(error);
|
|
8069
|
+
const endActionRef = React.useRef(null);
|
|
8070
|
+
const inputElementRef = React.useRef(null);
|
|
8071
|
+
const inputRef = useComposedRefs(inputElementRef, ref);
|
|
7848
8072
|
const handleChange = (e) => {
|
|
7849
8073
|
if (!disabled && onChange) {
|
|
7850
8074
|
onChange(e);
|
|
7851
8075
|
}
|
|
7852
8076
|
};
|
|
8077
|
+
React.useLayoutEffect(() => {
|
|
8078
|
+
if (endActionRef.current && inputElementRef.current) {
|
|
8079
|
+
const endActionWidth = endActionRef.current.offsetWidth;
|
|
8080
|
+
const inputElement = inputElementRef.current;
|
|
8081
|
+
if (inputElement) {
|
|
8082
|
+
const inputPadding = endActionWidth + 8 + 16;
|
|
8083
|
+
inputElement.style.paddingRight = `${inputPadding}px`;
|
|
8084
|
+
}
|
|
8085
|
+
}
|
|
8086
|
+
}, [endAction]);
|
|
7853
8087
|
return /* @__PURE__ */ jsxs(
|
|
7854
8088
|
InputWrapper,
|
|
7855
8089
|
{
|
|
@@ -7857,6 +8091,9 @@ const Input$2 = React.forwardRef(
|
|
|
7857
8091
|
justifyContent: "space-between",
|
|
7858
8092
|
$hasError: hasError || hasErrorProp,
|
|
7859
8093
|
$disabled: disabled,
|
|
8094
|
+
$size: size,
|
|
8095
|
+
$hasLeftAction: Boolean(startAction),
|
|
8096
|
+
$hasRightAction: Boolean(endAction),
|
|
7860
8097
|
className,
|
|
7861
8098
|
children: [
|
|
7862
8099
|
startAction,
|
|
@@ -7865,9 +8102,7 @@ const Input$2 = React.forwardRef(
|
|
|
7865
8102
|
{
|
|
7866
8103
|
id,
|
|
7867
8104
|
name,
|
|
7868
|
-
ref,
|
|
7869
|
-
$hasLeftAction: Boolean(startAction),
|
|
7870
|
-
$hasRightAction: Boolean(endAction),
|
|
8105
|
+
ref: inputRef,
|
|
7871
8106
|
$size: size,
|
|
7872
8107
|
"aria-describedby": ariaDescription,
|
|
7873
8108
|
"aria-invalid": hasError || hasErrorProp,
|
|
@@ -7876,10 +8111,12 @@ const Input$2 = React.forwardRef(
|
|
|
7876
8111
|
"data-disabled": disabled ? "" : void 0,
|
|
7877
8112
|
onChange: handleChange,
|
|
7878
8113
|
"aria-required": required || requiredProp,
|
|
8114
|
+
$hasLeftAction: Boolean(startAction),
|
|
8115
|
+
$hasRightAction: Boolean(endAction),
|
|
7879
8116
|
...props
|
|
7880
8117
|
}
|
|
7881
8118
|
),
|
|
7882
|
-
endAction
|
|
8119
|
+
endAction && /* @__PURE__ */ jsx(EndAction, { ref: endActionRef, children: endAction })
|
|
7883
8120
|
]
|
|
7884
8121
|
}
|
|
7885
8122
|
);
|
|
@@ -7898,23 +8135,6 @@ const InputElement = styled.input`
|
|
|
7898
8135
|
width: 100%;
|
|
7899
8136
|
background: inherit;
|
|
7900
8137
|
|
|
7901
|
-
${(props) => {
|
|
7902
|
-
switch (props.$size) {
|
|
7903
|
-
case "S":
|
|
7904
|
-
return css`
|
|
7905
|
-
padding-inline-start: ${props.$hasLeftAction ? props.theme.spaces[3] : props.theme.spaces[4]};
|
|
7906
|
-
padding-inline-end: ${props.$hasRightAction ? props.theme.spaces[3] : props.theme.spaces[4]};
|
|
7907
|
-
padding-block: ${props.theme.spaces[1]};
|
|
7908
|
-
`;
|
|
7909
|
-
default:
|
|
7910
|
-
return css`
|
|
7911
|
-
padding-inline-start: ${props.$hasLeftAction ? props.theme.spaces[3] : props.theme.spaces[4]};
|
|
7912
|
-
padding-inline-end: ${props.$hasRightAction ? props.theme.spaces[3] : props.theme.spaces[4]};
|
|
7913
|
-
padding-block: ${props.theme.spaces[2]};
|
|
7914
|
-
`;
|
|
7915
|
-
}
|
|
7916
|
-
}};
|
|
7917
|
-
|
|
7918
8138
|
::placeholder {
|
|
7919
8139
|
color: ${({ theme }) => theme.colors.neutral500};
|
|
7920
8140
|
opacity: 1;
|
|
@@ -7929,17 +8149,42 @@ const InputElement = styled.input`
|
|
|
7929
8149
|
outline: none;
|
|
7930
8150
|
box-shadow: none;
|
|
7931
8151
|
}
|
|
8152
|
+
|
|
8153
|
+
${(props) => {
|
|
8154
|
+
switch (props.$size) {
|
|
8155
|
+
case "S":
|
|
8156
|
+
return css`
|
|
8157
|
+
padding-inline-start: ${props.$hasLeftAction ? 0 : props.theme.spaces[4]};
|
|
8158
|
+
padding-inline-end: ${props.$hasRightAction ? 0 : props.theme.spaces[4]};
|
|
8159
|
+
padding-block: ${props.theme.spaces[1]};
|
|
8160
|
+
`;
|
|
8161
|
+
default:
|
|
8162
|
+
return css`
|
|
8163
|
+
padding-inline-start: ${props.$hasLeftAction ? 0 : props.theme.spaces[4]};
|
|
8164
|
+
padding-inline-end: ${props.$hasRightAction ? 0 : props.theme.spaces[4]};
|
|
8165
|
+
padding-block: ${props.theme.spaces[2]};
|
|
8166
|
+
`;
|
|
8167
|
+
}
|
|
8168
|
+
}}
|
|
8169
|
+
`;
|
|
8170
|
+
const EndAction = styled(Flex)`
|
|
8171
|
+
position: absolute;
|
|
8172
|
+
right: ${({ theme }) => theme.spaces[4]};
|
|
8173
|
+
top: 50%;
|
|
8174
|
+
transform: translateY(-50%);
|
|
7932
8175
|
`;
|
|
7933
8176
|
const InputWrapper = styled(Flex)`
|
|
7934
8177
|
border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
|
7935
8178
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
7936
8179
|
background: ${({ theme }) => theme.colors.neutral0};
|
|
7937
|
-
${
|
|
8180
|
+
padding-inline-start: ${({ $hasLeftAction, theme }) => $hasLeftAction ? theme.spaces[4] : 0};
|
|
8181
|
+
position: relative;
|
|
7938
8182
|
|
|
8183
|
+
${inputFocusStyle()}
|
|
7939
8184
|
${({ theme, $disabled }) => $disabled ? css`
|
|
7940
8185
|
color: ${theme.colors.neutral600};
|
|
7941
8186
|
background: ${theme.colors.neutral150};
|
|
7942
|
-
` : void 0}
|
|
8187
|
+
` : void 0};
|
|
7943
8188
|
`;
|
|
7944
8189
|
const Hint = () => {
|
|
7945
8190
|
const { id, hint, error } = useField("Hint");
|
|
@@ -8220,7 +8465,7 @@ const Combobox = React.forwardRef(
|
|
|
8220
8465
|
children: [
|
|
8221
8466
|
/* @__PURE__ */ jsxs(Trigger$5, { $hasError: hasError, $size: size, className, children: [
|
|
8222
8467
|
/* @__PURE__ */ jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
|
|
8223
|
-
startIcon ? /* @__PURE__ */ jsx(
|
|
8468
|
+
startIcon ? /* @__PURE__ */ jsx(Flex, { flex: "0 0 1.6rem", tag: "span", "aria-hidden": true, children: startIcon }) : null,
|
|
8224
8469
|
/* @__PURE__ */ jsx(
|
|
8225
8470
|
TextInput$1,
|
|
8226
8471
|
{
|
|
@@ -8254,7 +8499,7 @@ const Combobox = React.forwardRef(
|
|
|
8254
8499
|
children: /* @__PURE__ */ jsx(Cross, {})
|
|
8255
8500
|
}
|
|
8256
8501
|
) : null,
|
|
8257
|
-
/* @__PURE__ */ jsx(DownIcon$1, { children: /* @__PURE__ */ jsx(CaretDown, {}) })
|
|
8502
|
+
/* @__PURE__ */ jsx(DownIcon$1, { children: /* @__PURE__ */ jsx(CaretDown, { fill: "neutral500" }) })
|
|
8258
8503
|
] })
|
|
8259
8504
|
] }),
|
|
8260
8505
|
/* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(Content$5, { sideOffset: 4, children: /* @__PURE__ */ jsxs(Viewport$1, { ref: viewportRef, children: [
|
|
@@ -8343,6 +8588,7 @@ const DownIcon$1 = styled(Combobox$1.Icon)`
|
|
|
8343
8588
|
background: transparent;
|
|
8344
8589
|
padding: 0;
|
|
8345
8590
|
color: ${({ theme }) => theme.colors.neutral600};
|
|
8591
|
+
display: flex;
|
|
8346
8592
|
|
|
8347
8593
|
&[aria-disabled='true'] {
|
|
8348
8594
|
cursor: inherit;
|
|
@@ -8366,11 +8612,11 @@ const Content$5 = styled(Combobox$1.Content)`
|
|
|
8366
8612
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8367
8613
|
|
|
8368
8614
|
&[data-side='top'] {
|
|
8369
|
-
animation-name: ${ANIMATIONS.
|
|
8615
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
8370
8616
|
}
|
|
8371
8617
|
|
|
8372
8618
|
&[data-side='bottom'] {
|
|
8373
|
-
animation-name: ${ANIMATIONS.
|
|
8619
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
8374
8620
|
}
|
|
8375
8621
|
}
|
|
8376
8622
|
}
|
|
@@ -8466,19 +8712,7 @@ const ContentImpl$1 = styled(AlertDialog.Content)`
|
|
|
8466
8712
|
}
|
|
8467
8713
|
`;
|
|
8468
8714
|
const Header$1 = React.forwardRef(({ children, ...restProps }, forwardedRef) => {
|
|
8469
|
-
return /* @__PURE__ */ jsx(AlertDialog.Title, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
8470
|
-
Title$1,
|
|
8471
|
-
{
|
|
8472
|
-
tag: "h2",
|
|
8473
|
-
ref: forwardedRef,
|
|
8474
|
-
padding: 6,
|
|
8475
|
-
justifyContent: "center",
|
|
8476
|
-
variant: "h2",
|
|
8477
|
-
fontWeight: "bold",
|
|
8478
|
-
...restProps,
|
|
8479
|
-
children
|
|
8480
|
-
}
|
|
8481
|
-
) });
|
|
8715
|
+
return /* @__PURE__ */ jsx(AlertDialog.Title, { asChild: true, children: /* @__PURE__ */ jsx(Title$1, { tag: "h2", variant: "beta", ref: forwardedRef, padding: 6, fontWeight: "bold", ...restProps, children }) });
|
|
8482
8716
|
});
|
|
8483
8717
|
const Title$1 = styled(Typography)`
|
|
8484
8718
|
display: flex;
|
|
@@ -8652,8 +8886,7 @@ ${css`
|
|
|
8652
8886
|
img,
|
|
8653
8887
|
picture,
|
|
8654
8888
|
video,
|
|
8655
|
-
canvas
|
|
8656
|
-
svg {
|
|
8889
|
+
canvas {
|
|
8657
8890
|
display: block;
|
|
8658
8891
|
max-width: 100%;
|
|
8659
8892
|
}
|
|
@@ -8798,7 +9031,7 @@ const SelectTrigger = React.forwardRef(
|
|
|
8798
9031
|
...restProps,
|
|
8799
9032
|
children: [
|
|
8800
9033
|
/* @__PURE__ */ jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
|
|
8801
|
-
startIcon && /* @__PURE__ */ jsx(
|
|
9034
|
+
startIcon && /* @__PURE__ */ jsx(Flex, { tag: "span", "aria-hidden": true, children: startIcon }),
|
|
8802
9035
|
children
|
|
8803
9036
|
] }),
|
|
8804
9037
|
/* @__PURE__ */ jsxs(Flex, { tag: "span", gap: 3, children: [
|
|
@@ -8827,6 +9060,7 @@ const SelectTrigger = React.forwardRef(
|
|
|
8827
9060
|
);
|
|
8828
9061
|
const IconBox$2 = styled(Box)`
|
|
8829
9062
|
border: none;
|
|
9063
|
+
display: flex;
|
|
8830
9064
|
|
|
8831
9065
|
svg {
|
|
8832
9066
|
height: 1.1rem;
|
|
@@ -8834,7 +9068,7 @@ const IconBox$2 = styled(Box)`
|
|
|
8834
9068
|
}
|
|
8835
9069
|
|
|
8836
9070
|
svg path {
|
|
8837
|
-
fill: ${({ theme }) => theme.colors.
|
|
9071
|
+
fill: ${({ theme }) => theme.colors.neutral500};
|
|
8838
9072
|
}
|
|
8839
9073
|
`;
|
|
8840
9074
|
const StyledTrigger = styled(Flex)`
|
|
@@ -8857,7 +9091,7 @@ const StyledTrigger = styled(Flex)`
|
|
|
8857
9091
|
}}
|
|
8858
9092
|
|
|
8859
9093
|
&[aria-disabled='true'] {
|
|
8860
|
-
color: ${(props) => props.theme.colors.
|
|
9094
|
+
color: ${(props) => props.theme.colors.neutral500};
|
|
8861
9095
|
}
|
|
8862
9096
|
|
|
8863
9097
|
/* Required to ensure the below inputFocusStyles are adhered too */
|
|
@@ -8868,8 +9102,9 @@ const StyledTrigger = styled(Flex)`
|
|
|
8868
9102
|
${({ theme, $hasError }) => inputFocusStyle()({ theme, $hasError })};
|
|
8869
9103
|
`;
|
|
8870
9104
|
const DownIcon = styled(Select.Icon)`
|
|
9105
|
+
display: flex;
|
|
8871
9106
|
& > svg {
|
|
8872
|
-
fill: ${({ theme }) => theme.colors.
|
|
9107
|
+
fill: ${({ theme }) => theme.colors.neutral500};
|
|
8873
9108
|
}
|
|
8874
9109
|
`;
|
|
8875
9110
|
const SelectValue = React.forwardRef(({ children, placeholder, ...restProps }, ref) => /* @__PURE__ */ jsx(ValueType, { ref, ellipsis: true, ...restProps, children: /* @__PURE__ */ jsx(StyledValue, { placeholder, children }) }));
|
|
@@ -8889,8 +9124,7 @@ const SelectContent = styled(Select.Content)`
|
|
|
8889
9124
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
8890
9125
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
8891
9126
|
min-width: var(--radix-select-trigger-width);
|
|
8892
|
-
|
|
8893
|
-
max-height: 15rem;
|
|
9127
|
+
max-height: 15.6rem;
|
|
8894
9128
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
8895
9129
|
|
|
8896
9130
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -8901,11 +9135,11 @@ const SelectContent = styled(Select.Content)`
|
|
|
8901
9135
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8902
9136
|
|
|
8903
9137
|
&[data-side='top'] {
|
|
8904
|
-
animation-name: ${ANIMATIONS.
|
|
9138
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
8905
9139
|
}
|
|
8906
9140
|
|
|
8907
9141
|
&[data-side='bottom'] {
|
|
8908
|
-
animation-name: ${ANIMATIONS.
|
|
9142
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
8909
9143
|
}
|
|
8910
9144
|
}
|
|
8911
9145
|
}
|
|
@@ -9067,7 +9301,7 @@ const SingleSelectOption = React.forwardRef(
|
|
|
9067
9301
|
({ value, startIcon, children, ...restProps }, ref) => {
|
|
9068
9302
|
return /* @__PURE__ */ jsxs(Item$2, { ref, value: value.toString(), ...restProps, children: [
|
|
9069
9303
|
startIcon && /* @__PURE__ */ jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
|
|
9070
|
-
/* @__PURE__ */ jsx(Typography, { children: /* @__PURE__ */ jsx(ItemText, { children }) })
|
|
9304
|
+
/* @__PURE__ */ jsx(Typography, { lineHeight: "20px", children: /* @__PURE__ */ jsx(ItemText, { children }) })
|
|
9071
9305
|
] });
|
|
9072
9306
|
}
|
|
9073
9307
|
);
|
|
@@ -9563,7 +9797,7 @@ const DatePickerContentImpl = React.forwardRef(
|
|
|
9563
9797
|
(props, forwardedRef) => {
|
|
9564
9798
|
const { label = "Choose date", ...restProps } = props;
|
|
9565
9799
|
const { onOpenChange, ...context } = useDatePickerContext(CONTENT_IMPL_NAME);
|
|
9566
|
-
const { x, y, refs, strategy } = useFloating({
|
|
9800
|
+
const { x, y, refs, strategy, placement } = useFloating({
|
|
9567
9801
|
strategy: "fixed",
|
|
9568
9802
|
placement: "bottom-start",
|
|
9569
9803
|
middleware: [
|
|
@@ -9610,6 +9844,7 @@ const DatePickerContentImpl = React.forwardRef(
|
|
|
9610
9844
|
{
|
|
9611
9845
|
ref: composedRefs,
|
|
9612
9846
|
"data-state": context.open ? "open" : "closed",
|
|
9847
|
+
"data-side": placement.includes("top") ? "top" : "bottom",
|
|
9613
9848
|
onContextMenu: (event) => event.preventDefault(),
|
|
9614
9849
|
id: context.contentId,
|
|
9615
9850
|
role: "dialog",
|
|
@@ -9634,6 +9869,22 @@ const ContentElement = styled(Box)`
|
|
|
9634
9869
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
|
9635
9870
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
9636
9871
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
9872
|
+
|
|
9873
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
9874
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
9875
|
+
|
|
9876
|
+
&[data-state='open'] {
|
|
9877
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
9878
|
+
|
|
9879
|
+
&[data-side='top'] {
|
|
9880
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
9881
|
+
}
|
|
9882
|
+
|
|
9883
|
+
&[data-side='bottom'] {
|
|
9884
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
9885
|
+
}
|
|
9886
|
+
}
|
|
9887
|
+
}
|
|
9637
9888
|
`;
|
|
9638
9889
|
const DATE_PICKER_CALENDAR_NAME = "DatePickerCalendar";
|
|
9639
9890
|
const DatePickerCalendar = React.forwardRef(
|
|
@@ -10063,238 +10314,27 @@ const EmptyStateIconWrapper = styled(Box)`
|
|
|
10063
10314
|
height: 8.8rem;
|
|
10064
10315
|
}
|
|
10065
10316
|
`;
|
|
10066
|
-
const EmptyStateLayout = (
|
|
10067
|
-
icon,
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
hasRadius = true,
|
|
10071
|
-
shadow = "tableShadow"
|
|
10072
|
-
}) => {
|
|
10073
|
-
return /* @__PURE__ */ jsxs(
|
|
10074
|
-
Flex,
|
|
10075
|
-
{
|
|
10076
|
-
alignItems: "center",
|
|
10077
|
-
direction: "column",
|
|
10078
|
-
padding: 11,
|
|
10079
|
-
background: "neutral0",
|
|
10080
|
-
hasRadius,
|
|
10081
|
-
shadow,
|
|
10082
|
-
children: [
|
|
10083
|
-
icon ? /* @__PURE__ */ jsx(EmptyStateIconWrapper, { paddingBottom: 6, "aria-hidden": true, children: icon }) : null,
|
|
10084
|
-
/* @__PURE__ */ jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsx(Typography, { variant: "delta", tag: "p", textAlign: "center", textColor: "neutral600", children: content }) }),
|
|
10085
|
-
action
|
|
10086
|
-
]
|
|
10087
|
-
}
|
|
10088
|
-
);
|
|
10089
|
-
};
|
|
10090
|
-
const getFocusableNodes = (node, includeNegativeTabIndex) => {
|
|
10091
|
-
const nodes = [
|
|
10092
|
-
...node.querySelectorAll(
|
|
10093
|
-
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
10094
|
-
)
|
|
10095
|
-
];
|
|
10096
|
-
const focusables = nodes.filter((node2) => {
|
|
10097
|
-
if (node2.hasAttribute("disabled"))
|
|
10098
|
-
return false;
|
|
10099
|
-
if (includeNegativeTabIndex)
|
|
10100
|
-
return true;
|
|
10101
|
-
return node2.getAttribute("tabindex") !== "-1";
|
|
10102
|
-
});
|
|
10103
|
-
return focusables;
|
|
10104
|
-
};
|
|
10105
|
-
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
10106
|
-
return nodes.filter((node) => {
|
|
10107
|
-
if (node.tagName === "INPUT") {
|
|
10108
|
-
return node.type !== "checkbox" && node.type !== "radio";
|
|
10109
|
-
}
|
|
10110
|
-
return false;
|
|
10111
|
-
});
|
|
10112
|
-
};
|
|
10113
|
-
const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
|
|
10114
|
-
const trappedRef = React.useRef(null);
|
|
10115
|
-
React.useEffect(() => {
|
|
10116
|
-
let currentFocus = null;
|
|
10117
|
-
if (restoreFocus) {
|
|
10118
|
-
currentFocus = document.activeElement;
|
|
10119
|
-
}
|
|
10120
|
-
return () => {
|
|
10121
|
-
if (currentFocus) {
|
|
10122
|
-
currentFocus.focus();
|
|
10123
|
-
}
|
|
10124
|
-
};
|
|
10125
|
-
}, [restoreFocus]);
|
|
10126
|
-
React.useEffect(() => {
|
|
10127
|
-
if (!trappedRef.current || skipAutoFocus)
|
|
10128
|
-
return;
|
|
10129
|
-
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
10130
|
-
if (focusableChildren.length > 0) {
|
|
10131
|
-
const firstElement = focusableChildren[0];
|
|
10132
|
-
firstElement.focus();
|
|
10133
|
-
} else {
|
|
10134
|
-
console.warn(
|
|
10135
|
-
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
10136
|
-
);
|
|
10137
|
-
}
|
|
10138
|
-
}, [skipAutoFocus]);
|
|
10139
|
-
const handleKeyDown = (e) => {
|
|
10140
|
-
if (e.key === KeyboardKeys.ESCAPE && onEscape) {
|
|
10141
|
-
onEscape();
|
|
10142
|
-
return;
|
|
10143
|
-
}
|
|
10144
|
-
if (e.key !== KeyboardKeys.TAB)
|
|
10145
|
-
return;
|
|
10146
|
-
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
10147
|
-
if (focusableChildren.length > 0) {
|
|
10148
|
-
const firstElement = focusableChildren[0];
|
|
10149
|
-
const lastElement = focusableChildren[focusableChildren.length - 1];
|
|
10150
|
-
if (e.shiftKey) {
|
|
10151
|
-
if (firstElement === document.activeElement) {
|
|
10152
|
-
e.preventDefault();
|
|
10153
|
-
lastElement.focus();
|
|
10154
|
-
}
|
|
10155
|
-
} else if (lastElement === document.activeElement) {
|
|
10156
|
-
e.preventDefault();
|
|
10157
|
-
firstElement.focus();
|
|
10158
|
-
}
|
|
10159
|
-
}
|
|
10160
|
-
};
|
|
10161
|
-
return /* @__PURE__ */ jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
|
|
10162
|
-
};
|
|
10163
|
-
const Root$3 = forwardRef((props, forwardedRef) => {
|
|
10164
|
-
const { gap = 0, gridCols = 12, ...rest } = props;
|
|
10165
|
-
return /* @__PURE__ */ jsx(Wrapper$1, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
|
|
10166
|
-
});
|
|
10167
|
-
const Wrapper$1 = styled(Box)`
|
|
10168
|
-
display: grid;
|
|
10169
|
-
grid-template-columns: repeat(${({ $gridCols }) => $gridCols}, 1fr);
|
|
10170
|
-
${({ theme, $gap }) => handleResponsiveValues("gap", $gap, theme)}
|
|
10171
|
-
`;
|
|
10172
|
-
const ItemImpl = forwardRef(
|
|
10173
|
-
({ col, s, xs, ...props }, forwardedRef) => /* @__PURE__ */ jsx(Item$1, { ref: forwardedRef, $col: col, $s: s, $xs: xs, ...props })
|
|
10174
|
-
);
|
|
10175
|
-
const Item$1 = styled(Box)`
|
|
10176
|
-
grid-column: span ${({ $col }) => $col ?? 1};
|
|
10177
|
-
max-width: 100%;
|
|
10178
|
-
|
|
10179
|
-
${({ theme }) => theme.mediaQueries.tablet} {
|
|
10180
|
-
grid-column: span ${({ $s }) => $s};
|
|
10181
|
-
}
|
|
10182
|
-
|
|
10183
|
-
${({ theme }) => theme.mediaQueries.mobile} {
|
|
10184
|
-
grid-column: span ${({ $xs }) => $xs};
|
|
10185
|
-
}
|
|
10186
|
-
`;
|
|
10187
|
-
const Grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10188
|
-
__proto__: null,
|
|
10189
|
-
Item: ItemImpl,
|
|
10190
|
-
Root: Root$3
|
|
10191
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
10192
|
-
const VARIANT_DEFAULT = "tertiary";
|
|
10193
|
-
const VARIANT_SECONDARY = "secondary";
|
|
10194
|
-
const SIZES = ["S", "M", "L"];
|
|
10195
|
-
const VARIANTS = [VARIANT_DEFAULT, VARIANT_SECONDARY];
|
|
10196
|
-
const IconButton = forwardRef(
|
|
10197
|
-
({
|
|
10198
|
-
label,
|
|
10199
|
-
background,
|
|
10200
|
-
children,
|
|
10201
|
-
disabled = false,
|
|
10202
|
-
onClick,
|
|
10203
|
-
size = SIZES[0],
|
|
10204
|
-
variant: variant2 = VARIANTS[0],
|
|
10205
|
-
withTooltip = true,
|
|
10206
|
-
...restProps
|
|
10207
|
-
}, ref) => {
|
|
10208
|
-
const handleClick = (e) => {
|
|
10209
|
-
if (!disabled && onClick) {
|
|
10210
|
-
onClick(e);
|
|
10211
|
-
}
|
|
10212
|
-
};
|
|
10213
|
-
const component = /* @__PURE__ */ jsx(
|
|
10214
|
-
IconButtonWrapper,
|
|
10317
|
+
const EmptyStateLayout = React.forwardRef(
|
|
10318
|
+
({ icon, content, action, hasRadius = true, shadow = "tableShadow" }, forwardedRef) => {
|
|
10319
|
+
return /* @__PURE__ */ jsxs(
|
|
10320
|
+
Flex,
|
|
10215
10321
|
{
|
|
10216
|
-
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
|
|
10223
|
-
|
|
10224
|
-
|
|
10322
|
+
ref: forwardedRef,
|
|
10323
|
+
alignItems: "center",
|
|
10324
|
+
direction: "column",
|
|
10325
|
+
padding: 11,
|
|
10326
|
+
background: "neutral0",
|
|
10327
|
+
hasRadius,
|
|
10328
|
+
shadow,
|
|
10329
|
+
children: [
|
|
10330
|
+
icon ? /* @__PURE__ */ jsx(EmptyStateIconWrapper, { paddingBottom: 6, "aria-hidden": true, children: icon }) : null,
|
|
10331
|
+
/* @__PURE__ */ jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsx(Typography, { variant: "delta", tag: "p", textAlign: "center", textColor: "neutral600", children: content }) }),
|
|
10332
|
+
action
|
|
10333
|
+
]
|
|
10225
10334
|
}
|
|
10226
10335
|
);
|
|
10227
|
-
return withTooltip ? /* @__PURE__ */ jsx(TooltipImpl, { label, children: component }) : component;
|
|
10228
10336
|
}
|
|
10229
10337
|
);
|
|
10230
|
-
const IconButtonWrapper = styled(BaseButton)`
|
|
10231
|
-
background-color: ${({ theme, $variant }) => {
|
|
10232
|
-
if ($variant === VARIANT_SECONDARY) {
|
|
10233
|
-
return theme.colors.primary100;
|
|
10234
|
-
}
|
|
10235
|
-
return void 0;
|
|
10236
|
-
}};
|
|
10237
|
-
border-color: ${({ theme, $variant }) => {
|
|
10238
|
-
if ($variant === VARIANT_SECONDARY) {
|
|
10239
|
-
return theme.colors.primary200;
|
|
10240
|
-
}
|
|
10241
|
-
return theme.colors.neutral200;
|
|
10242
|
-
}};
|
|
10243
|
-
height: ${({ theme, $size }) => theme.sizes.button[$size]};
|
|
10244
|
-
width: ${({ theme, $size }) => theme.sizes.button[$size]};
|
|
10245
|
-
color: ${({ theme, $variant }) => {
|
|
10246
|
-
if ($variant === VARIANT_SECONDARY) {
|
|
10247
|
-
return theme.colors.primary500;
|
|
10248
|
-
}
|
|
10249
|
-
return theme.colors.neutral500;
|
|
10250
|
-
}};
|
|
10251
|
-
|
|
10252
|
-
&:hover,
|
|
10253
|
-
&:focus {
|
|
10254
|
-
color: ${({ theme, $variant }) => {
|
|
10255
|
-
if ($variant === VARIANT_SECONDARY) {
|
|
10256
|
-
return theme.colors.primary600;
|
|
10257
|
-
}
|
|
10258
|
-
return theme.colors.neutral600;
|
|
10259
|
-
}};
|
|
10260
|
-
}
|
|
10261
|
-
|
|
10262
|
-
&[aria-disabled='true'] {
|
|
10263
|
-
color: ${({ theme }) => theme.colors.neutral600};
|
|
10264
|
-
}
|
|
10265
|
-
`;
|
|
10266
|
-
const IconButtonGroup = styled(Flex)`
|
|
10267
|
-
& ${IconButtonWrapper}:first-child {
|
|
10268
|
-
border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
|
|
10269
|
-
}
|
|
10270
|
-
|
|
10271
|
-
& ${IconButtonWrapper}:last-child {
|
|
10272
|
-
border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
|
|
10273
|
-
}
|
|
10274
|
-
|
|
10275
|
-
& ${IconButtonWrapper} {
|
|
10276
|
-
border-radius: 0;
|
|
10277
|
-
color: ${({ theme }) => theme.colors.neutral700};
|
|
10278
|
-
|
|
10279
|
-
& + ${IconButtonWrapper} {
|
|
10280
|
-
border-left: none;
|
|
10281
|
-
}
|
|
10282
|
-
|
|
10283
|
-
&:hover {
|
|
10284
|
-
background-color: ${({ theme }) => theme.colors.neutral100};
|
|
10285
|
-
color: ${({ theme }) => theme.colors.neutral800};
|
|
10286
|
-
}
|
|
10287
|
-
|
|
10288
|
-
&:active {
|
|
10289
|
-
background-color: ${({ theme }) => theme.colors.neutral150};
|
|
10290
|
-
color: ${({ theme }) => theme.colors.neutral900};
|
|
10291
|
-
}
|
|
10292
|
-
|
|
10293
|
-
&[aria-disabled='true'] {
|
|
10294
|
-
color: ${({ theme }) => theme.colors.neutral600};
|
|
10295
|
-
}
|
|
10296
|
-
}
|
|
10297
|
-
`;
|
|
10298
10338
|
const addMarks = StateEffect.define();
|
|
10299
10339
|
const filterMarks = StateEffect.define();
|
|
10300
10340
|
const lineHighlightMark = Decoration.mark({
|
|
@@ -10472,72 +10512,29 @@ const JSONInputContainer = styled(Flex)`
|
|
|
10472
10512
|
}
|
|
10473
10513
|
`;
|
|
10474
10514
|
const LinkButton = forwardRef(
|
|
10475
|
-
({
|
|
10476
|
-
|
|
10477
|
-
|
|
10478
|
-
return /* @__PURE__ */ jsxs(
|
|
10479
|
-
LinkWrapper$1,
|
|
10515
|
+
({ disabled, ...restProps }, ref) => {
|
|
10516
|
+
return /* @__PURE__ */ jsx(
|
|
10517
|
+
Button,
|
|
10480
10518
|
{
|
|
10481
10519
|
ref,
|
|
10482
|
-
|
|
10483
|
-
|
|
10484
|
-
|
|
10485
|
-
|
|
10486
|
-
hasRadius: true,
|
|
10487
|
-
display: "inline-flex",
|
|
10488
|
-
paddingBottom: paddingX,
|
|
10489
|
-
paddingLeft: paddingY,
|
|
10490
|
-
paddingRight: paddingY,
|
|
10491
|
-
paddingTop: paddingX,
|
|
10492
|
-
pointerEvents: disabled ? "none" : void 0,
|
|
10493
|
-
...props,
|
|
10494
|
-
children: [
|
|
10495
|
-
startIcon && /* @__PURE__ */ jsx(Flex, { "aria-hidden": true, children: startIcon }),
|
|
10496
|
-
/* @__PURE__ */ jsx(Typography, { variant: size === "S" ? "pi" : void 0, fontWeight: "bold", children }),
|
|
10497
|
-
endIcon && /* @__PURE__ */ jsx(Flex, { "aria-hidden": true, children: endIcon })
|
|
10498
|
-
]
|
|
10520
|
+
tag: BaseLinkImpl,
|
|
10521
|
+
tabIndex: disabled ? -1 : void 0,
|
|
10522
|
+
disabled,
|
|
10523
|
+
...restProps
|
|
10499
10524
|
}
|
|
10500
10525
|
);
|
|
10501
10526
|
}
|
|
10502
10527
|
);
|
|
10503
|
-
const
|
|
10504
|
-
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
-
&[aria-disabled='true'] {
|
|
10509
|
-
pointer-events: none;
|
|
10528
|
+
const MainWrapper = styled(Box)`
|
|
10529
|
+
// To prevent global outline on focus visible to force an outline when Main is focused
|
|
10530
|
+
&:focus-visible {
|
|
10531
|
+
outline: none;
|
|
10510
10532
|
}
|
|
10511
|
-
|
|
10512
|
-
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
&:active {
|
|
10517
|
-
${getDisabledStyle}
|
|
10518
|
-
}
|
|
10519
|
-
}
|
|
10520
|
-
|
|
10521
|
-
&:hover {
|
|
10522
|
-
${getHoverStyle}
|
|
10523
|
-
}
|
|
10524
|
-
|
|
10525
|
-
&:active {
|
|
10526
|
-
${getActiveStyle}
|
|
10527
|
-
}
|
|
10528
|
-
|
|
10529
|
-
${getVariantStyle}
|
|
10530
|
-
`;
|
|
10531
|
-
const MainWrapper = styled(Box)`
|
|
10532
|
-
// To prevent global outline on focus visible to force an outline when Main is focused
|
|
10533
|
-
&:focus-visible {
|
|
10534
|
-
outline: none;
|
|
10535
|
-
}
|
|
10536
|
-
`;
|
|
10537
|
-
const Main = ({ labelledBy = "main-content-title", ...props }) => {
|
|
10538
|
-
return /* @__PURE__ */ jsx(MainWrapper, { "aria-labelledby": labelledBy, tag: "main", id: "main-content", tabIndex: -1, ...props });
|
|
10539
|
-
};
|
|
10540
|
-
const AnchorBox = styled(Box)`
|
|
10533
|
+
`;
|
|
10534
|
+
const Main = ({ labelledBy = "main-content-title", ...props }) => {
|
|
10535
|
+
return /* @__PURE__ */ jsx(MainWrapper, { "aria-labelledby": labelledBy, tag: "main", id: "main-content", tabIndex: -1, ...props });
|
|
10536
|
+
};
|
|
10537
|
+
const AnchorBox = styled(Box)`
|
|
10541
10538
|
text-decoration: none;
|
|
10542
10539
|
|
|
10543
10540
|
&:focus {
|
|
@@ -10563,6 +10560,7 @@ const SkipToContent = ({ children }) => {
|
|
|
10563
10560
|
}
|
|
10564
10561
|
);
|
|
10565
10562
|
};
|
|
10563
|
+
const setOpacity = (hex, alpha) => `${hex}${Math.floor(alpha * 255).toString(16).padStart(2, "0")}`;
|
|
10566
10564
|
const ScrollAreaImpl$1 = React.forwardRef(
|
|
10567
10565
|
({ children, viewportRef, ...restProps }, forwardedRef) => {
|
|
10568
10566
|
return /* @__PURE__ */ jsxs(ScrollAreaRoot, { ref: forwardedRef, ...restProps, children: [
|
|
@@ -10617,22 +10615,18 @@ const Thumb = styled(ScrollArea.Thumb)`
|
|
|
10617
10615
|
min-height: 44px;
|
|
10618
10616
|
}
|
|
10619
10617
|
`;
|
|
10620
|
-
const Root$
|
|
10618
|
+
const Root$3 = Dialog$1.Root;
|
|
10621
10619
|
const Trigger$2 = React.forwardRef((props, forwardedRef) => {
|
|
10622
10620
|
return /* @__PURE__ */ jsx(Dialog$1.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
10623
10621
|
});
|
|
10624
10622
|
const Content$2 = React.forwardRef((props, forwardedRef) => {
|
|
10625
|
-
return /* @__PURE__ */
|
|
10626
|
-
/* @__PURE__ */ jsx(Overlay, {}),
|
|
10627
|
-
/* @__PURE__ */ jsx(ContentImpl, { ref: forwardedRef, ...props })
|
|
10628
|
-
] });
|
|
10623
|
+
return /* @__PURE__ */ jsx(Dialog$1.Portal, { children: /* @__PURE__ */ jsx(Overlay, { children: /* @__PURE__ */ jsx(ContentImpl, { ref: forwardedRef, ...props }) }) });
|
|
10629
10624
|
});
|
|
10630
10625
|
const Overlay = styled(Dialog$1.Overlay)`
|
|
10631
|
-
background
|
|
10626
|
+
background: ${(props) => setOpacity(props.theme.colors.neutral800, 0.2)};
|
|
10632
10627
|
position: fixed;
|
|
10633
10628
|
inset: 0;
|
|
10634
10629
|
z-index: ${(props) => props.theme.zIndices.overlay};
|
|
10635
|
-
opacity: 0.2;
|
|
10636
10630
|
|
|
10637
10631
|
@media (prefers-reduced-motion: no-preference) {
|
|
10638
10632
|
animation: ${ANIMATIONS.overlayFadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
@@ -10641,8 +10635,8 @@ const Overlay = styled(Dialog$1.Overlay)`
|
|
|
10641
10635
|
`;
|
|
10642
10636
|
const ContentImpl = styled(Dialog$1.Content)`
|
|
10643
10637
|
max-width: 83rem;
|
|
10644
|
-
max-height:
|
|
10645
|
-
height:
|
|
10638
|
+
max-height: 90vh;
|
|
10639
|
+
height: auto;
|
|
10646
10640
|
width: 60%;
|
|
10647
10641
|
overflow: hidden;
|
|
10648
10642
|
margin: 0 auto;
|
|
@@ -10744,7 +10738,7 @@ const Modal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
10744
10738
|
Content: Content$2,
|
|
10745
10739
|
Footer,
|
|
10746
10740
|
Header,
|
|
10747
|
-
Root: Root$
|
|
10741
|
+
Root: Root$3,
|
|
10748
10742
|
Title,
|
|
10749
10743
|
Trigger: Trigger$2
|
|
10750
10744
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -10931,7 +10925,7 @@ const NextLink = forwardRef(
|
|
|
10931
10925
|
] });
|
|
10932
10926
|
}
|
|
10933
10927
|
);
|
|
10934
|
-
const LinkWrapper = styled(
|
|
10928
|
+
const LinkWrapper = styled(BaseLinkImpl)`
|
|
10935
10929
|
padding: ${({ theme }) => theme.spaces[3]};
|
|
10936
10930
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
10937
10931
|
box-shadow: ${({ $active, theme }) => $active ? theme.shadows.filterShadow : void 0};
|
|
@@ -10980,7 +10974,7 @@ const Dots = ({ children, ...props }) => /* @__PURE__ */ jsxs(Box, { ...props, c
|
|
|
10980
10974
|
/* @__PURE__ */ jsx(VisuallyHidden, { children }),
|
|
10981
10975
|
/* @__PURE__ */ jsx(Typography, { "aria-hidden": true, lineHeight: "revert", textColor: "neutral800", variant: "pi", children: "…" })
|
|
10982
10976
|
] });
|
|
10983
|
-
const Root$
|
|
10977
|
+
const Root$2 = Popover$1.Root;
|
|
10984
10978
|
const Trigger$1 = React.forwardRef((props, forwardedRef) => {
|
|
10985
10979
|
return /* @__PURE__ */ jsx(Popover$1.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
10986
10980
|
});
|
|
@@ -10992,6 +10986,7 @@ const PopoverContent = styled(Popover$1.Content)`
|
|
|
10992
10986
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
10993
10987
|
background-color: ${(props) => props.theme.colors.neutral0};
|
|
10994
10988
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
10989
|
+
border-radius: ${({ theme }) => theme.borderRadius};
|
|
10995
10990
|
|
|
10996
10991
|
@media (prefers-reduced-motion: no-preference) {
|
|
10997
10992
|
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
@@ -11000,11 +10995,11 @@ const PopoverContent = styled(Popover$1.Content)`
|
|
|
11000
10995
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
11001
10996
|
|
|
11002
10997
|
&[data-side='top'] {
|
|
11003
|
-
animation-name: ${ANIMATIONS.
|
|
10998
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
11004
10999
|
}
|
|
11005
11000
|
|
|
11006
11001
|
&[data-side='bottom'] {
|
|
11007
|
-
animation-name: ${ANIMATIONS.
|
|
11002
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
11008
11003
|
}
|
|
11009
11004
|
}
|
|
11010
11005
|
|
|
@@ -11012,35 +11007,38 @@ const PopoverContent = styled(Popover$1.Content)`
|
|
|
11012
11007
|
animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
11013
11008
|
|
|
11014
11009
|
&[data-side='top'] {
|
|
11015
|
-
animation-name: ${ANIMATIONS.
|
|
11010
|
+
animation-name: ${ANIMATIONS.slideUpOut};
|
|
11016
11011
|
}
|
|
11017
11012
|
|
|
11018
11013
|
&[data-side='bottom'] {
|
|
11019
|
-
animation-name: ${ANIMATIONS.
|
|
11014
|
+
animation-name: ${ANIMATIONS.slideDownOut};
|
|
11020
11015
|
}
|
|
11021
11016
|
}
|
|
11022
11017
|
}
|
|
11023
11018
|
`;
|
|
11024
|
-
const ScrollAreaImpl = (
|
|
11025
|
-
|
|
11026
|
-
|
|
11027
|
-
|
|
11028
|
-
|
|
11029
|
-
|
|
11030
|
-
|
|
11031
|
-
|
|
11032
|
-
|
|
11033
|
-
|
|
11034
|
-
|
|
11035
|
-
|
|
11036
|
-
}
|
|
11019
|
+
const ScrollAreaImpl = React.forwardRef(
|
|
11020
|
+
({ children, intersectionId, onReachEnd, ...props }, forwardedRef) => {
|
|
11021
|
+
const popoverRef = React.useRef(null);
|
|
11022
|
+
const composedRef = useComposedRefs(popoverRef, forwardedRef);
|
|
11023
|
+
const generatedIntersectionId = useId();
|
|
11024
|
+
useIntersection(popoverRef, onReachEnd ?? (() => {
|
|
11025
|
+
}), {
|
|
11026
|
+
selectorToWatch: `#${stripReactIdOfColon(generatedIntersectionId)}`,
|
|
11027
|
+
skipWhen: !intersectionId || !onReachEnd
|
|
11028
|
+
});
|
|
11029
|
+
return /* @__PURE__ */ jsxs(PopoverScrollArea, { ref: composedRef, ...props, children: [
|
|
11030
|
+
children,
|
|
11031
|
+
intersectionId && onReachEnd && /* @__PURE__ */ jsx(Box, { id: stripReactIdOfColon(generatedIntersectionId), width: "100%", height: "1px" })
|
|
11032
|
+
] });
|
|
11033
|
+
}
|
|
11034
|
+
);
|
|
11037
11035
|
const PopoverScrollArea = styled(ScrollAreaImpl$1)`
|
|
11038
11036
|
height: 20rem;
|
|
11039
11037
|
`;
|
|
11040
11038
|
const Popover = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11041
11039
|
__proto__: null,
|
|
11042
11040
|
Content: Content$1,
|
|
11043
|
-
Root: Root$
|
|
11041
|
+
Root: Root$2,
|
|
11044
11042
|
ScrollArea: ScrollAreaImpl,
|
|
11045
11043
|
Trigger: Trigger$1
|
|
11046
11044
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -11080,7 +11078,7 @@ const RadioGroupRoot = styled(RadioGroup.Root)`
|
|
|
11080
11078
|
flex-direction: column;
|
|
11081
11079
|
gap: ${(props) => props.theme.spaces[3]};
|
|
11082
11080
|
`;
|
|
11083
|
-
const Item = React.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
|
|
11081
|
+
const Item$1 = React.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
|
|
11084
11082
|
const id = useId(idProp);
|
|
11085
11083
|
return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
11086
11084
|
/* @__PURE__ */ jsx(RadioGroupItem, { id, ref: forwardedRef, ...restProps, children: /* @__PURE__ */ jsx(RadioGroupIndicator, {}) }),
|
|
@@ -11149,7 +11147,7 @@ const RadioGroupIndicator = styled(RadioGroup.Indicator)`
|
|
|
11149
11147
|
const Radio = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11150
11148
|
__proto__: null,
|
|
11151
11149
|
Group,
|
|
11152
|
-
Item
|
|
11150
|
+
Item: Item$1
|
|
11153
11151
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
11154
11152
|
const focusFocusable = (node) => {
|
|
11155
11153
|
const nextNode = node.querySelector('[tabindex="0"]');
|
|
@@ -11165,172 +11163,194 @@ const RawTableContext = React.createContext({
|
|
|
11165
11163
|
}
|
|
11166
11164
|
});
|
|
11167
11165
|
const useTable = () => React.useContext(RawTableContext);
|
|
11168
|
-
const RawTable = (
|
|
11169
|
-
colCount,
|
|
11170
|
-
|
|
11171
|
-
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
|
|
11175
|
-
}) => {
|
|
11176
|
-
|
|
11177
|
-
|
|
11178
|
-
|
|
11179
|
-
|
|
11180
|
-
|
|
11181
|
-
|
|
11182
|
-
setRowIndex(rowIndex2);
|
|
11183
|
-
}, []);
|
|
11184
|
-
React.useEffect(() => {
|
|
11185
|
-
if (mountedRef.current) {
|
|
11186
|
-
focusFocusable(tableRef.current);
|
|
11187
|
-
}
|
|
11188
|
-
if (!mountedRef.current) {
|
|
11189
|
-
mountedRef.current = true;
|
|
11190
|
-
}
|
|
11191
|
-
}, [colIndex, rowIndex]);
|
|
11192
|
-
const handleKeyDown = (e) => {
|
|
11193
|
-
switch (e.key) {
|
|
11194
|
-
case KeyboardKeys.RIGHT: {
|
|
11195
|
-
e.preventDefault();
|
|
11196
|
-
setColIndex((prevColIndex) => prevColIndex < colCount - 1 ? prevColIndex + 1 : prevColIndex);
|
|
11197
|
-
break;
|
|
11198
|
-
}
|
|
11199
|
-
case KeyboardKeys.LEFT: {
|
|
11200
|
-
e.preventDefault();
|
|
11201
|
-
setColIndex((prevColIndex) => prevColIndex > 0 ? prevColIndex - 1 : prevColIndex);
|
|
11202
|
-
break;
|
|
11203
|
-
}
|
|
11204
|
-
case KeyboardKeys.UP: {
|
|
11205
|
-
e.preventDefault();
|
|
11206
|
-
setRowIndex((prevRowIndex) => prevRowIndex > 0 ? prevRowIndex - 1 : prevRowIndex);
|
|
11207
|
-
break;
|
|
11166
|
+
const RawTable = React.forwardRef(
|
|
11167
|
+
({ colCount, rowCount, jumpStep = 3, initialCol = 0, initialRow = 0, ...props }, forwardedRef) => {
|
|
11168
|
+
const tableRef = React.useRef(null);
|
|
11169
|
+
const mountedRef = React.useRef(false);
|
|
11170
|
+
const composedRef = useComposedRefs(tableRef, forwardedRef);
|
|
11171
|
+
const [rowIndex, setRowIndex] = React.useState(initialRow);
|
|
11172
|
+
const [colIndex, setColIndex] = React.useState(initialCol);
|
|
11173
|
+
const setTableValues = React.useCallback(({ colIndex: colIndex2, rowIndex: rowIndex2 }) => {
|
|
11174
|
+
setColIndex(colIndex2);
|
|
11175
|
+
setRowIndex(rowIndex2);
|
|
11176
|
+
}, []);
|
|
11177
|
+
React.useEffect(() => {
|
|
11178
|
+
if (mountedRef.current) {
|
|
11179
|
+
focusFocusable(tableRef.current);
|
|
11208
11180
|
}
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
setRowIndex((prevRowIndex) => prevRowIndex < rowCount - 1 ? prevRowIndex + 1 : prevRowIndex);
|
|
11212
|
-
break;
|
|
11181
|
+
if (!mountedRef.current) {
|
|
11182
|
+
mountedRef.current = true;
|
|
11213
11183
|
}
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
|
|
11184
|
+
}, [colIndex, rowIndex]);
|
|
11185
|
+
const handleKeyDown = (e) => {
|
|
11186
|
+
switch (e.key) {
|
|
11187
|
+
case KeyboardKeys.RIGHT: {
|
|
11188
|
+
e.preventDefault();
|
|
11189
|
+
setColIndex((prevColIndex) => prevColIndex < colCount - 1 ? prevColIndex + 1 : prevColIndex);
|
|
11190
|
+
break;
|
|
11218
11191
|
}
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
|
|
11225
|
-
|
|
11192
|
+
case KeyboardKeys.LEFT: {
|
|
11193
|
+
e.preventDefault();
|
|
11194
|
+
setColIndex((prevColIndex) => prevColIndex > 0 ? prevColIndex - 1 : prevColIndex);
|
|
11195
|
+
break;
|
|
11196
|
+
}
|
|
11197
|
+
case KeyboardKeys.UP: {
|
|
11198
|
+
e.preventDefault();
|
|
11199
|
+
setRowIndex((prevRowIndex) => prevRowIndex > 0 ? prevRowIndex - 1 : prevRowIndex);
|
|
11200
|
+
break;
|
|
11201
|
+
}
|
|
11202
|
+
case KeyboardKeys.DOWN: {
|
|
11203
|
+
e.preventDefault();
|
|
11204
|
+
setRowIndex((prevRowIndex) => prevRowIndex < rowCount - 1 ? prevRowIndex + 1 : prevRowIndex);
|
|
11205
|
+
break;
|
|
11206
|
+
}
|
|
11207
|
+
case KeyboardKeys.HOME: {
|
|
11208
|
+
e.preventDefault();
|
|
11209
|
+
if (e.ctrlKey) {
|
|
11210
|
+
setRowIndex(0);
|
|
11211
|
+
}
|
|
11212
|
+
setColIndex(0);
|
|
11213
|
+
break;
|
|
11214
|
+
}
|
|
11215
|
+
case KeyboardKeys.END: {
|
|
11216
|
+
e.preventDefault();
|
|
11217
|
+
if (e.ctrlKey) {
|
|
11218
|
+
setRowIndex(rowCount - 1);
|
|
11219
|
+
}
|
|
11220
|
+
setColIndex(colCount - 1);
|
|
11221
|
+
break;
|
|
11222
|
+
}
|
|
11223
|
+
case KeyboardKeys.PAGE_DOWN: {
|
|
11224
|
+
e.preventDefault();
|
|
11225
|
+
setRowIndex((prevRowIndex) => prevRowIndex + jumpStep < rowCount ? prevRowIndex + jumpStep : rowCount - 1);
|
|
11226
|
+
break;
|
|
11227
|
+
}
|
|
11228
|
+
case KeyboardKeys.PAGE_UP: {
|
|
11229
|
+
e.preventDefault();
|
|
11230
|
+
setRowIndex((prevRowIndex) => prevRowIndex - jumpStep > 0 ? prevRowIndex - jumpStep : 0);
|
|
11231
|
+
break;
|
|
11226
11232
|
}
|
|
11227
|
-
setColIndex(colCount - 1);
|
|
11228
|
-
break;
|
|
11229
|
-
}
|
|
11230
|
-
case KeyboardKeys.PAGE_DOWN: {
|
|
11231
|
-
e.preventDefault();
|
|
11232
|
-
setRowIndex((prevRowIndex) => prevRowIndex + jumpStep < rowCount ? prevRowIndex + jumpStep : rowCount - 1);
|
|
11233
|
-
break;
|
|
11234
11233
|
}
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
|
|
11234
|
+
};
|
|
11235
|
+
const context = React.useMemo(() => ({ rowIndex, colIndex, setTableValues }), [colIndex, rowIndex, setTableValues]);
|
|
11236
|
+
return /* @__PURE__ */ jsx(RawTableContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
|
|
11237
|
+
"table",
|
|
11238
|
+
{
|
|
11239
|
+
role: "grid",
|
|
11240
|
+
ref: composedRef,
|
|
11241
|
+
"aria-rowcount": rowCount,
|
|
11242
|
+
"aria-colcount": colCount,
|
|
11243
|
+
onKeyDown: handleKeyDown,
|
|
11244
|
+
...props
|
|
11239
11245
|
}
|
|
11240
|
-
}
|
|
11241
|
-
}
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11246
|
+
) });
|
|
11247
|
+
}
|
|
11248
|
+
);
|
|
11249
|
+
const getFocusableNodes = (node, includeNegativeTabIndex) => {
|
|
11250
|
+
const nodes = [
|
|
11251
|
+
...node.querySelectorAll(
|
|
11252
|
+
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
11253
|
+
)
|
|
11254
|
+
];
|
|
11255
|
+
const focusables = nodes.filter((node2) => {
|
|
11256
|
+
if (node2.hasAttribute("disabled"))
|
|
11257
|
+
return false;
|
|
11258
|
+
if (includeNegativeTabIndex)
|
|
11259
|
+
return true;
|
|
11260
|
+
return node2.getAttribute("tabindex") !== "-1";
|
|
11261
|
+
});
|
|
11262
|
+
return focusables;
|
|
11254
11263
|
};
|
|
11255
|
-
const
|
|
11256
|
-
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
const handleKeyDown = (e) => {
|
|
11260
|
-
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11261
|
-
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length === 0) {
|
|
11262
|
-
return;
|
|
11264
|
+
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
11265
|
+
return nodes.filter((node) => {
|
|
11266
|
+
if (node.tagName === "INPUT") {
|
|
11267
|
+
return node.type !== "checkbox" && node.type !== "radio";
|
|
11263
11268
|
}
|
|
11264
|
-
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
|
|
11271
|
-
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11277
|
-
nextNode.focus();
|
|
11278
|
-
}
|
|
11269
|
+
return false;
|
|
11270
|
+
});
|
|
11271
|
+
};
|
|
11272
|
+
const RawTd = React.forwardRef(
|
|
11273
|
+
({ coords = { col: 0, row: 0 }, tag = "td", ...props }, forwardedRef) => {
|
|
11274
|
+
const tdRef = React.useRef(null);
|
|
11275
|
+
const composedRef = useComposedRefs(forwardedRef, tdRef);
|
|
11276
|
+
const { rowIndex, colIndex, setTableValues } = useTable();
|
|
11277
|
+
const [isActive, setIsActive] = React.useState(false);
|
|
11278
|
+
const handleKeyDown = (e) => {
|
|
11279
|
+
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11280
|
+
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length === 0) {
|
|
11281
|
+
return;
|
|
11279
11282
|
}
|
|
11280
|
-
|
|
11281
|
-
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
|
|
11286
|
-
|
|
11283
|
+
if (focusableNodes.length > 1 && !focusableNodes.find((node) => node.tagName !== "BUTTON")) {
|
|
11284
|
+
e.preventDefault();
|
|
11285
|
+
const focussedButtonIndex = focusableNodes.findIndex((node) => node === document.activeElement);
|
|
11286
|
+
if (e.key === KeyboardKeys.RIGHT) {
|
|
11287
|
+
const nextNode = focusableNodes[focussedButtonIndex + 1];
|
|
11288
|
+
if (nextNode) {
|
|
11289
|
+
e.stopPropagation();
|
|
11290
|
+
nextNode.focus();
|
|
11291
|
+
}
|
|
11292
|
+
} else if (e.key === KeyboardKeys.LEFT) {
|
|
11293
|
+
const nextNode = focusableNodes[focussedButtonIndex - 1];
|
|
11294
|
+
if (nextNode) {
|
|
11295
|
+
e.stopPropagation();
|
|
11296
|
+
nextNode.focus();
|
|
11297
|
+
}
|
|
11298
|
+
}
|
|
11287
11299
|
return;
|
|
11288
11300
|
}
|
|
11289
|
-
|
|
11290
|
-
|
|
11291
|
-
|
|
11292
|
-
e.
|
|
11293
|
-
|
|
11294
|
-
|
|
11295
|
-
const isFocused = rowIndex === coords.row - 1 && colIndex === coords.col - 1;
|
|
11296
|
-
useIsomorphicLayoutEffect(() => {
|
|
11297
|
-
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11298
|
-
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || focusableNodes.length > 1 && Boolean(focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
|
|
11299
|
-
tdRef.current.setAttribute("tabIndex", !isActive && isFocused ? "0" : "-1");
|
|
11300
|
-
focusableNodes.forEach((node, index) => {
|
|
11301
|
-
node.setAttribute("tabIndex", isActive ? "0" : "-1");
|
|
11302
|
-
if (isActive && index === 0) {
|
|
11303
|
-
node.focus();
|
|
11301
|
+
const isEnterKey = e.key === KeyboardKeys.ENTER;
|
|
11302
|
+
if (isEnterKey && !isActive) {
|
|
11303
|
+
setIsActive(true);
|
|
11304
|
+
} else if ((e.key === KeyboardKeys.ESCAPE || isEnterKey) && isActive) {
|
|
11305
|
+
if (isEnterKey && document.activeElement?.tagName === "A") {
|
|
11306
|
+
return;
|
|
11304
11307
|
}
|
|
11305
|
-
|
|
11306
|
-
|
|
11308
|
+
setIsActive(false);
|
|
11309
|
+
tdRef.current.focus();
|
|
11310
|
+
} else if (isActive) {
|
|
11311
|
+
e.stopPropagation();
|
|
11312
|
+
}
|
|
11313
|
+
};
|
|
11314
|
+
const isFocused = rowIndex === coords.row - 1 && colIndex === coords.col - 1;
|
|
11315
|
+
useIsomorphicLayoutEffect(() => {
|
|
11316
|
+
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11317
|
+
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || focusableNodes.length > 1 && Boolean(focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
|
|
11318
|
+
tdRef.current.setAttribute("tabIndex", !isActive && isFocused ? "0" : "-1");
|
|
11319
|
+
focusableNodes.forEach((node, index) => {
|
|
11320
|
+
node.setAttribute("tabIndex", isActive ? "0" : "-1");
|
|
11321
|
+
if (isActive && index === 0) {
|
|
11322
|
+
node.focus();
|
|
11323
|
+
}
|
|
11324
|
+
});
|
|
11325
|
+
} else {
|
|
11326
|
+
focusableNodes.forEach((node) => {
|
|
11327
|
+
node.setAttribute("tabIndex", isFocused ? "0" : "-1");
|
|
11328
|
+
});
|
|
11329
|
+
}
|
|
11330
|
+
}, [isActive, isFocused]);
|
|
11331
|
+
const handleFocusableNodeFocus = React.useCallback(() => {
|
|
11332
|
+
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11333
|
+
if (focusableNodes.length >= 1 && (getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || !focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
|
|
11334
|
+
setIsActive(true);
|
|
11335
|
+
}
|
|
11336
|
+
setTableValues({ rowIndex: coords.row - 1, colIndex: coords.col - 1 });
|
|
11337
|
+
}, [coords, setTableValues]);
|
|
11338
|
+
useIsomorphicLayoutEffect(() => {
|
|
11339
|
+
const cell = tdRef.current;
|
|
11340
|
+
const focusableNodes = getFocusableNodes(cell, true);
|
|
11307
11341
|
focusableNodes.forEach((node) => {
|
|
11308
|
-
node.
|
|
11342
|
+
node.addEventListener("focus", handleFocusableNodeFocus);
|
|
11309
11343
|
});
|
|
11310
|
-
|
|
11311
|
-
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
|
|
11315
|
-
|
|
11316
|
-
}
|
|
11317
|
-
|
|
11318
|
-
}
|
|
11319
|
-
|
|
11320
|
-
const cell = tdRef.current;
|
|
11321
|
-
const focusableNodes = getFocusableNodes(cell, true);
|
|
11322
|
-
focusableNodes.forEach((node) => {
|
|
11323
|
-
node.addEventListener("focus", handleFocusableNodeFocus);
|
|
11324
|
-
});
|
|
11325
|
-
return () => {
|
|
11326
|
-
const focusableNodes2 = getFocusableNodes(cell, true);
|
|
11327
|
-
focusableNodes2.forEach((node) => {
|
|
11328
|
-
node.removeEventListener("focus", handleFocusableNodeFocus);
|
|
11329
|
-
});
|
|
11330
|
-
};
|
|
11331
|
-
}, [handleFocusableNodeFocus]);
|
|
11332
|
-
return /* @__PURE__ */ jsx(Box, { role: "gridcell", tag, ref: tdRef, onKeyDown: handleKeyDown, ...props });
|
|
11333
|
-
};
|
|
11344
|
+
return () => {
|
|
11345
|
+
const focusableNodes2 = getFocusableNodes(cell, true);
|
|
11346
|
+
focusableNodes2.forEach((node) => {
|
|
11347
|
+
node.removeEventListener("focus", handleFocusableNodeFocus);
|
|
11348
|
+
});
|
|
11349
|
+
};
|
|
11350
|
+
}, [handleFocusableNodeFocus]);
|
|
11351
|
+
return /* @__PURE__ */ jsx(Box, { role: "gridcell", tag, ref: composedRef, onKeyDown: handleKeyDown, ...props });
|
|
11352
|
+
}
|
|
11353
|
+
);
|
|
11334
11354
|
const RawTh = (props) => /* @__PURE__ */ jsx(RawTd, { ...props, tag: "th" });
|
|
11335
11355
|
const RawThead = ({ children, ...props }) => {
|
|
11336
11356
|
const childrenClone = React.Children.toArray(children).map((child) => {
|
|
@@ -11381,14 +11401,18 @@ const SearchbarWrapper = styled.div`
|
|
|
11381
11401
|
&:focus-within {
|
|
11382
11402
|
${SearchIcon} {
|
|
11383
11403
|
fill: ${({ theme }) => theme.colors.primary600};
|
|
11384
|
-
path {
|
|
11385
|
-
}
|
|
11386
11404
|
}
|
|
11387
11405
|
}
|
|
11388
11406
|
`;
|
|
11389
11407
|
const SearchbarInput = styled(Input$2)`
|
|
11390
11408
|
border: 1px solid transparent;
|
|
11391
11409
|
|
|
11410
|
+
&:hover {
|
|
11411
|
+
button {
|
|
11412
|
+
cursor: pointer;
|
|
11413
|
+
}
|
|
11414
|
+
}
|
|
11415
|
+
|
|
11392
11416
|
${inputFocusStyle()}
|
|
11393
11417
|
`;
|
|
11394
11418
|
const Searchbar = React.forwardRef(
|
|
@@ -11408,7 +11432,17 @@ const Searchbar = React.forwardRef(
|
|
|
11408
11432
|
ref: actualRef,
|
|
11409
11433
|
value,
|
|
11410
11434
|
startAction: /* @__PURE__ */ jsx(SearchIcon, { "aria-hidden": true }),
|
|
11411
|
-
endAction: isCompleting ? /* @__PURE__ */ jsx(
|
|
11435
|
+
endAction: isCompleting ? /* @__PURE__ */ jsx(
|
|
11436
|
+
Action$1,
|
|
11437
|
+
{
|
|
11438
|
+
label: clearLabel,
|
|
11439
|
+
onClick: handleClear,
|
|
11440
|
+
onMouseDown: (e) => {
|
|
11441
|
+
e.preventDefault();
|
|
11442
|
+
},
|
|
11443
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
11444
|
+
}
|
|
11445
|
+
) : void 0,
|
|
11412
11446
|
...props
|
|
11413
11447
|
}
|
|
11414
11448
|
)
|
|
@@ -11416,47 +11450,60 @@ const Searchbar = React.forwardRef(
|
|
|
11416
11450
|
}
|
|
11417
11451
|
);
|
|
11418
11452
|
const SearchForm = (props) => /* @__PURE__ */ jsx("form", { ...props, role: "search" });
|
|
11419
|
-
const
|
|
11453
|
+
const ButtonBox$1 = styled(Box)`
|
|
11454
|
+
display: inline-flex;
|
|
11455
|
+
border: none;
|
|
11456
|
+
|
|
11457
|
+
& > svg {
|
|
11458
|
+
height: 1.2rem;
|
|
11459
|
+
width: 1.2rem;
|
|
11460
|
+
}
|
|
11461
|
+
|
|
11462
|
+
& > svg path {
|
|
11463
|
+
fill: ${({ theme, ...p }) => p["aria-disabled"] ? theme.colors.neutral600 : theme.colors.primary600};
|
|
11464
|
+
}
|
|
11465
|
+
|
|
11466
|
+
&:hover {
|
|
11467
|
+
cursor: ${({ $iconAction }) => $iconAction ? "pointer" : "initial"};
|
|
11468
|
+
}
|
|
11469
|
+
`;
|
|
11470
|
+
const Tag = ({ children, icon, label, disabled = false, onClick, ...props }) => {
|
|
11420
11471
|
const handleClick = (e) => {
|
|
11421
11472
|
if (disabled || !onClick)
|
|
11422
11473
|
return;
|
|
11423
11474
|
onClick(e);
|
|
11424
11475
|
};
|
|
11425
11476
|
return /* @__PURE__ */ jsxs(
|
|
11426
|
-
|
|
11477
|
+
Flex,
|
|
11427
11478
|
{
|
|
11428
|
-
|
|
11479
|
+
inline: true,
|
|
11429
11480
|
background: disabled ? "neutral200" : "primary100",
|
|
11430
11481
|
color: disabled ? "neutral700" : "primary600",
|
|
11431
11482
|
paddingLeft: 3,
|
|
11432
|
-
paddingRight:
|
|
11433
|
-
onClick: handleClick,
|
|
11434
|
-
"aria-disabled": disabled,
|
|
11435
|
-
disabled,
|
|
11436
|
-
borderWidth: "1px",
|
|
11437
|
-
borderStyle: "solid",
|
|
11483
|
+
paddingRight: 1,
|
|
11438
11484
|
borderColor: disabled ? "neutral300" : "primary200",
|
|
11439
11485
|
hasRadius: true,
|
|
11440
11486
|
height: "3.2rem",
|
|
11441
|
-
gap: 2,
|
|
11442
11487
|
...props,
|
|
11443
11488
|
children: [
|
|
11444
11489
|
/* @__PURE__ */ jsx(TagText, { $disabled: disabled, variant: "pi", fontWeight: "bold", children }),
|
|
11445
|
-
|
|
11490
|
+
/* @__PURE__ */ jsx(
|
|
11491
|
+
ButtonBox$1,
|
|
11492
|
+
{
|
|
11493
|
+
tag: "button",
|
|
11494
|
+
disabled,
|
|
11495
|
+
"aria-disabled": disabled,
|
|
11496
|
+
"aria-label": label,
|
|
11497
|
+
padding: 2,
|
|
11498
|
+
onClick: handleClick,
|
|
11499
|
+
$iconAction: !!onClick,
|
|
11500
|
+
children: icon
|
|
11501
|
+
}
|
|
11502
|
+
)
|
|
11446
11503
|
]
|
|
11447
11504
|
}
|
|
11448
11505
|
);
|
|
11449
11506
|
};
|
|
11450
|
-
const TagWrapper = styled(Flex)`
|
|
11451
|
-
& > svg {
|
|
11452
|
-
height: 0.8rem;
|
|
11453
|
-
width: 0.8rem;
|
|
11454
|
-
}
|
|
11455
|
-
|
|
11456
|
-
& > svg path {
|
|
11457
|
-
fill: ${({ theme, ...p }) => p["aria-disabled"] ? theme.colors.neutral600 : theme.colors.primary600};
|
|
11458
|
-
}
|
|
11459
|
-
`;
|
|
11460
11507
|
const TagText = styled(Typography)`
|
|
11461
11508
|
color: inherit;
|
|
11462
11509
|
border-right: 1px solid ${({ theme, $disabled }) => $disabled ? theme.colors.neutral300 : theme.colors.primary200};
|
|
@@ -11522,7 +11569,17 @@ const MultiSelect = React.forwardRef(
|
|
|
11522
11569
|
const value = typeof passedValue !== "undefined" && passedValue !== null ? passedValue : internalValue;
|
|
11523
11570
|
const renderTags = (arg) => {
|
|
11524
11571
|
if (arg && typeof arg === "object" && arg.value) {
|
|
11525
|
-
return /* @__PURE__ */ jsx(
|
|
11572
|
+
return /* @__PURE__ */ jsx(
|
|
11573
|
+
Tag,
|
|
11574
|
+
{
|
|
11575
|
+
tabIndex: -1,
|
|
11576
|
+
disabled,
|
|
11577
|
+
icon: /* @__PURE__ */ jsx(Cross, { width: `${14 / 16}rem`, height: `${14 / 16}rem` }),
|
|
11578
|
+
onClick: handleTagClick(arg.value),
|
|
11579
|
+
children: arg.textValue
|
|
11580
|
+
},
|
|
11581
|
+
arg.value
|
|
11582
|
+
);
|
|
11526
11583
|
}
|
|
11527
11584
|
return null;
|
|
11528
11585
|
};
|
|
@@ -11671,7 +11728,8 @@ const SubNavHeader = ({
|
|
|
11671
11728
|
},
|
|
11672
11729
|
onSubmit = () => {
|
|
11673
11730
|
},
|
|
11674
|
-
id
|
|
11731
|
+
id,
|
|
11732
|
+
placeholder
|
|
11675
11733
|
}) => {
|
|
11676
11734
|
const [isSearchOpen, setSearchOpen] = React.useState(false);
|
|
11677
11735
|
const previousSearchOpenValue = usePrev(isSearchOpen);
|
|
@@ -11711,7 +11769,7 @@ const SubNavHeader = ({
|
|
|
11711
11769
|
name: "searchbar",
|
|
11712
11770
|
value,
|
|
11713
11771
|
onChange,
|
|
11714
|
-
placeholder
|
|
11772
|
+
placeholder,
|
|
11715
11773
|
onKeyDown: handleKeyDown,
|
|
11716
11774
|
ref: searchRef,
|
|
11717
11775
|
onBlur: handleBlur,
|
|
@@ -11725,7 +11783,7 @@ const SubNavHeader = ({
|
|
|
11725
11783
|
] });
|
|
11726
11784
|
}
|
|
11727
11785
|
return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingLeft: 6, paddingTop: 6, paddingBottom: 2, paddingRight: 4, children: [
|
|
11728
|
-
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", children: [
|
|
11786
|
+
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", width: "100%", gap: 2, children: [
|
|
11729
11787
|
/* @__PURE__ */ jsx(Typography, { variant: "beta", tag, children: label }),
|
|
11730
11788
|
searchable && /* @__PURE__ */ jsx(IconButton, { ref: searchButtonRef, onClick: toggleSearch, label: searchLabel, children: /* @__PURE__ */ jsx(Search, {}) })
|
|
11731
11789
|
] }),
|
|
@@ -11760,7 +11818,7 @@ const CustomBullet = styled.span`
|
|
|
11760
11818
|
background-color: ${({ theme, $active }) => $active ? theme.colors.primary600 : theme.colors.neutral600};
|
|
11761
11819
|
border-radius: 50%;
|
|
11762
11820
|
`;
|
|
11763
|
-
const SubNavLinkWrapper = styled(
|
|
11821
|
+
const SubNavLinkWrapper = styled(BaseLinkImpl)`
|
|
11764
11822
|
display: flex;
|
|
11765
11823
|
align-items: center;
|
|
11766
11824
|
justify-content: space-between;
|
|
@@ -12000,7 +12058,7 @@ const LabelTypography = styled(Typography)`
|
|
|
12000
12058
|
}
|
|
12001
12059
|
`;
|
|
12002
12060
|
const [TabsProvider, useTabs] = createContext("Tabs");
|
|
12003
|
-
const Root = React.forwardRef(
|
|
12061
|
+
const Root$1 = React.forwardRef(
|
|
12004
12062
|
({ disabled = false, variant: variant2 = "regular", hasError, ...props }, forwardedRef) => {
|
|
12005
12063
|
return /* @__PURE__ */ jsx(TabsProvider, { disabled, hasError, variant: variant2, children: /* @__PURE__ */ jsx(TabsRoot, { ref: forwardedRef, ...props }) });
|
|
12006
12064
|
}
|
|
@@ -12039,10 +12097,6 @@ const TabBar = styled.span`
|
|
|
12039
12097
|
left: 0;
|
|
12040
12098
|
opacity: 0;
|
|
12041
12099
|
height: 0.2rem;
|
|
12042
|
-
|
|
12043
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
12044
|
-
transition: ${(props) => `opacity 200ms ${props.theme.motion.easings.authenticMotion}`};
|
|
12045
|
-
}
|
|
12046
12100
|
`;
|
|
12047
12101
|
const TriggerTypography = styled(Typography)``;
|
|
12048
12102
|
const TabsTrigger = styled(Tabs$1.Trigger)`
|
|
@@ -12096,10 +12150,6 @@ const TabsTrigger = styled(Tabs$1.Trigger)`
|
|
|
12096
12150
|
}
|
|
12097
12151
|
}}
|
|
12098
12152
|
|
|
12099
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
12100
|
-
transition: ${(props) => `${props.theme.transitions.color}, ${props.theme.transitions.backgroundColor}, box-shadow ${props.theme.motion.timings["120"]} ${props.theme.motion.easings.easeOutQuad}`};
|
|
12101
|
-
}
|
|
12102
|
-
|
|
12103
12153
|
&[data-disabled] {
|
|
12104
12154
|
cursor: not-allowed;
|
|
12105
12155
|
color: ${(props) => props.theme.colors.neutral400};
|
|
@@ -12126,7 +12176,7 @@ const Tabs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
12126
12176
|
__proto__: null,
|
|
12127
12177
|
Content,
|
|
12128
12178
|
List,
|
|
12129
|
-
Root,
|
|
12179
|
+
Root: Root$1,
|
|
12130
12180
|
Trigger
|
|
12131
12181
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
12132
12182
|
const TableContainer = styled(Box)`
|
|
@@ -12166,7 +12216,7 @@ const TableBox = styled(Box)`
|
|
|
12166
12216
|
const ScrollContainer = styled(Box)`
|
|
12167
12217
|
overflow-x: auto;
|
|
12168
12218
|
`;
|
|
12169
|
-
const Table = ({ footer, ...props }) => {
|
|
12219
|
+
const Table = React.forwardRef(({ footer, ...props }, forwardedRef) => {
|
|
12170
12220
|
const tableRef = React.useRef(null);
|
|
12171
12221
|
const [overflowing, setOverflowing] = React.useState();
|
|
12172
12222
|
const handleScroll = (e) => {
|
|
@@ -12189,10 +12239,10 @@ const Table = ({ footer, ...props }) => {
|
|
|
12189
12239
|
}
|
|
12190
12240
|
}, []);
|
|
12191
12241
|
return /* @__PURE__ */ jsxs(TableContainer, { shadow: "tableShadow", hasRadius: true, background: "neutral0", children: [
|
|
12192
|
-
/* @__PURE__ */ jsx(TableBox, { $overflowing: overflowing, position: "relative", children: /* @__PURE__ */ jsx(ScrollContainer, { ref: tableRef, onScroll: handleScroll, paddingLeft: 6, paddingRight: 6, children: /* @__PURE__ */ jsx(TableWrapper, { ...props }) }) }),
|
|
12242
|
+
/* @__PURE__ */ jsx(TableBox, { $overflowing: overflowing, position: "relative", children: /* @__PURE__ */ jsx(ScrollContainer, { ref: tableRef, onScroll: handleScroll, paddingLeft: 6, paddingRight: 6, children: /* @__PURE__ */ jsx(TableWrapper, { ref: forwardedRef, ...props }) }) }),
|
|
12193
12243
|
footer
|
|
12194
12244
|
] });
|
|
12195
|
-
};
|
|
12245
|
+
});
|
|
12196
12246
|
const TbodyWrapper = styled(RawTbody)`
|
|
12197
12247
|
& tr:last-of-type {
|
|
12198
12248
|
border-bottom: none;
|
|
@@ -12233,7 +12283,6 @@ const Tr = (props) => {
|
|
|
12233
12283
|
const CellWrapper = styled(RawTd)`
|
|
12234
12284
|
vertical-align: middle;
|
|
12235
12285
|
text-align: left;
|
|
12236
|
-
color: ${({ theme }) => theme.colors.neutral600};
|
|
12237
12286
|
outline-offset: -4px;
|
|
12238
12287
|
|
|
12239
12288
|
/**
|
|
@@ -12243,15 +12292,15 @@ const CellWrapper = styled(RawTd)`
|
|
|
12243
12292
|
vertical-align: sub;
|
|
12244
12293
|
}
|
|
12245
12294
|
`;
|
|
12246
|
-
const Th = ({ children, action, ...props }) => {
|
|
12247
|
-
return /* @__PURE__ */ jsx(CellWrapper, { as: RawTh, ...props, children: /* @__PURE__ */ jsxs(Flex, { children: [
|
|
12295
|
+
const Th = React.forwardRef(({ children, action, ...props }, forwardedRef) => {
|
|
12296
|
+
return /* @__PURE__ */ jsx(CellWrapper, { color: "neutral600", as: RawTh, ref: forwardedRef, ...props, children: /* @__PURE__ */ jsxs(Flex, { children: [
|
|
12248
12297
|
children,
|
|
12249
12298
|
action
|
|
12250
12299
|
] }) });
|
|
12251
|
-
};
|
|
12252
|
-
const Td = ({ children, ...props }) => {
|
|
12253
|
-
return /* @__PURE__ */ jsx(CellWrapper, { ...props, children });
|
|
12254
|
-
};
|
|
12300
|
+
});
|
|
12301
|
+
const Td = React.forwardRef(({ children, ...props }, forwardedRef) => {
|
|
12302
|
+
return /* @__PURE__ */ jsx(CellWrapper, { color: "neutral800", ref: forwardedRef, ...props, children });
|
|
12303
|
+
});
|
|
12255
12304
|
const IconBox = styled(Box)`
|
|
12256
12305
|
height: 2.4rem;
|
|
12257
12306
|
width: 2.4rem;
|
|
@@ -12284,6 +12333,28 @@ const TFooter = ({ children, icon, ...props }) => {
|
|
|
12284
12333
|
] }) })
|
|
12285
12334
|
] });
|
|
12286
12335
|
};
|
|
12336
|
+
const TextButton = forwardRef(
|
|
12337
|
+
({ children, startIcon, endIcon, disabled = false, loading = false, ...props }, ref) => {
|
|
12338
|
+
const isDisabled = disabled || loading;
|
|
12339
|
+
return /* @__PURE__ */ jsxs(
|
|
12340
|
+
TextButtonWrapper,
|
|
12341
|
+
{
|
|
12342
|
+
ref,
|
|
12343
|
+
disabled: isDisabled,
|
|
12344
|
+
"aria-disabled": isDisabled,
|
|
12345
|
+
tag: "button",
|
|
12346
|
+
type: "button",
|
|
12347
|
+
gap: 2,
|
|
12348
|
+
...props,
|
|
12349
|
+
children: [
|
|
12350
|
+
loading ? /* @__PURE__ */ jsx(LoadingWrapper, { "aria-hidden": true, children: /* @__PURE__ */ jsx(Loader$1, {}) }) : startIcon,
|
|
12351
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", children }),
|
|
12352
|
+
endIcon
|
|
12353
|
+
]
|
|
12354
|
+
}
|
|
12355
|
+
);
|
|
12356
|
+
}
|
|
12357
|
+
);
|
|
12287
12358
|
const rotation = keyframes`
|
|
12288
12359
|
from {
|
|
12289
12360
|
transform: rotate(0deg);
|
|
@@ -12292,51 +12363,24 @@ const rotation = keyframes`
|
|
|
12292
12363
|
transform: rotate(359deg);
|
|
12293
12364
|
}
|
|
12294
12365
|
`;
|
|
12295
|
-
const LoadingWrapper = styled.
|
|
12366
|
+
const LoadingWrapper = styled.span`
|
|
12367
|
+
display: flex;
|
|
12296
12368
|
animation: ${rotation} 2s infinite linear;
|
|
12297
12369
|
will-change: transform;
|
|
12298
12370
|
`;
|
|
12299
12371
|
const TextButtonWrapper = styled(Flex)`
|
|
12300
12372
|
border: none;
|
|
12373
|
+
background-color: transparent;
|
|
12374
|
+
color: ${(props) => props.theme.colors.primary600};
|
|
12375
|
+
cursor: pointer;
|
|
12301
12376
|
|
|
12302
12377
|
&[aria-disabled='true'] {
|
|
12303
12378
|
pointer-events: none;
|
|
12304
|
-
|
|
12305
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
12306
|
-
}
|
|
12307
|
-
}
|
|
12308
|
-
|
|
12309
|
-
svg path {
|
|
12310
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
|
12379
|
+
color: ${(props) => props.theme.colors.neutral600};
|
|
12311
12380
|
}
|
|
12312
12381
|
|
|
12313
12382
|
${focus}
|
|
12314
12383
|
`;
|
|
12315
|
-
const TextButton = React.forwardRef(
|
|
12316
|
-
({ children, startIcon, endIcon, onClick, disabled = false, loading = false, ...props }, ref) => {
|
|
12317
|
-
const handleClick = onClick && !disabled ? onClick : void 0;
|
|
12318
|
-
const isDisabled = disabled || loading;
|
|
12319
|
-
return /* @__PURE__ */ jsxs(
|
|
12320
|
-
TextButtonWrapper,
|
|
12321
|
-
{
|
|
12322
|
-
ref,
|
|
12323
|
-
"aria-disabled": isDisabled,
|
|
12324
|
-
onClick: handleClick,
|
|
12325
|
-
tag: "button",
|
|
12326
|
-
type: "button",
|
|
12327
|
-
background: "transparent",
|
|
12328
|
-
gap: 2,
|
|
12329
|
-
...props,
|
|
12330
|
-
children: [
|
|
12331
|
-
loading ? /* @__PURE__ */ jsx(LoadingWrapper, { "aria-hidden": true, children: /* @__PURE__ */ jsx(Loader$1, {}) }) : startIcon,
|
|
12332
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: isDisabled ? "neutral600" : "primary600", children }),
|
|
12333
|
-
endIcon
|
|
12334
|
-
]
|
|
12335
|
-
}
|
|
12336
|
-
);
|
|
12337
|
-
}
|
|
12338
|
-
);
|
|
12339
|
-
TextButton.displayName = "TextButton";
|
|
12340
12384
|
const TextInput = React.forwardRef((props, ref) => {
|
|
12341
12385
|
return /* @__PURE__ */ jsx(Input$2, { ref, ...props });
|
|
12342
12386
|
});
|
|
@@ -12354,7 +12398,7 @@ const Textarea = React.forwardRef(
|
|
|
12354
12398
|
} else if (field.hint) {
|
|
12355
12399
|
ariaDescription = `${id}-hint`;
|
|
12356
12400
|
}
|
|
12357
|
-
return /* @__PURE__ */ jsx(Wrapper, { borderColor: hasError ? "danger600" : "neutral200", $hasError: hasError, hasRadius: true, children: /* @__PURE__ */ jsx(
|
|
12401
|
+
return /* @__PURE__ */ jsx(Wrapper$1, { borderColor: hasError ? "danger600" : "neutral200", $hasError: hasError, hasRadius: true, children: /* @__PURE__ */ jsx(
|
|
12358
12402
|
TextareaElement,
|
|
12359
12403
|
{
|
|
12360
12404
|
"aria-invalid": hasError,
|
|
@@ -12365,11 +12409,11 @@ const Textarea = React.forwardRef(
|
|
|
12365
12409
|
disabled,
|
|
12366
12410
|
fontSize: 2,
|
|
12367
12411
|
hasRadius: true,
|
|
12368
|
-
height: "10.5rem",
|
|
12369
12412
|
ref,
|
|
12370
12413
|
lineHeight: 4,
|
|
12371
12414
|
padding: 4,
|
|
12372
12415
|
width: "100%",
|
|
12416
|
+
height: "100%",
|
|
12373
12417
|
id,
|
|
12374
12418
|
name,
|
|
12375
12419
|
"aria-describedby": ariaDescription,
|
|
@@ -12378,7 +12422,8 @@ const Textarea = React.forwardRef(
|
|
|
12378
12422
|
) });
|
|
12379
12423
|
}
|
|
12380
12424
|
);
|
|
12381
|
-
const Wrapper = styled(Box)`
|
|
12425
|
+
const Wrapper$1 = styled(Box)`
|
|
12426
|
+
height: 10.5rem;
|
|
12382
12427
|
${inputFocusStyle()}
|
|
12383
12428
|
`;
|
|
12384
12429
|
const TextareaElement = styled(Box)`
|
|
@@ -12523,6 +12568,39 @@ const Input = styled.input`
|
|
|
12523
12568
|
z-index: 0;
|
|
12524
12569
|
width: 100%;
|
|
12525
12570
|
`;
|
|
12571
|
+
const Root = forwardRef((props, forwardedRef) => {
|
|
12572
|
+
const { gap = 0, gridCols = 12, ...rest } = props;
|
|
12573
|
+
return /* @__PURE__ */ jsx(Wrapper, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
|
|
12574
|
+
});
|
|
12575
|
+
const Wrapper = styled(Box)`
|
|
12576
|
+
display: grid;
|
|
12577
|
+
grid-template-columns: repeat(${({ $gridCols }) => $gridCols}, 1fr);
|
|
12578
|
+
${({ theme, $gap }) => handleResponsiveValues({ gap: $gap }, theme)}
|
|
12579
|
+
`;
|
|
12580
|
+
const ItemImpl = forwardRef(
|
|
12581
|
+
({ col, s, xs, m, ...props }, forwardedRef) => /* @__PURE__ */ jsx(Item, { ref: forwardedRef, $col: col, $s: s, $xs: xs, $m: m, ...props })
|
|
12582
|
+
);
|
|
12583
|
+
const Item = styled(Flex)`
|
|
12584
|
+
grid-column: span ${({ $xs }) => $xs ?? 12};
|
|
12585
|
+
max-width: 100%;
|
|
12586
|
+
|
|
12587
|
+
${({ theme }) => theme.breakpoints.small} {
|
|
12588
|
+
grid-column: span ${({ $s, $xs }) => $s ?? $xs ?? 12};
|
|
12589
|
+
}
|
|
12590
|
+
|
|
12591
|
+
${({ theme }) => theme.breakpoints.medium} {
|
|
12592
|
+
grid-column: span ${({ $m, $s, $xs }) => $m ?? $s ?? $xs ?? 12};
|
|
12593
|
+
}
|
|
12594
|
+
|
|
12595
|
+
${({ theme }) => theme.breakpoints.large} {
|
|
12596
|
+
grid-column: span ${({ $col, $m, $s, $xs }) => $col ?? $m ?? $s ?? $xs ?? 12};
|
|
12597
|
+
}
|
|
12598
|
+
`;
|
|
12599
|
+
const Grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12600
|
+
__proto__: null,
|
|
12601
|
+
Item: ItemImpl,
|
|
12602
|
+
Root
|
|
12603
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
12526
12604
|
const defaultState = {
|
|
12527
12605
|
x: 0,
|
|
12528
12606
|
y: 0,
|
|
@@ -12555,6 +12633,56 @@ function useMeasure() {
|
|
|
12555
12633
|
}, [element, observer]);
|
|
12556
12634
|
return [ref, rect];
|
|
12557
12635
|
}
|
|
12636
|
+
const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
|
|
12637
|
+
const trappedRef = React.useRef(null);
|
|
12638
|
+
React.useEffect(() => {
|
|
12639
|
+
let currentFocus = null;
|
|
12640
|
+
if (restoreFocus) {
|
|
12641
|
+
currentFocus = document.activeElement;
|
|
12642
|
+
}
|
|
12643
|
+
return () => {
|
|
12644
|
+
if (currentFocus) {
|
|
12645
|
+
currentFocus.focus();
|
|
12646
|
+
}
|
|
12647
|
+
};
|
|
12648
|
+
}, [restoreFocus]);
|
|
12649
|
+
React.useEffect(() => {
|
|
12650
|
+
if (!trappedRef.current || skipAutoFocus)
|
|
12651
|
+
return;
|
|
12652
|
+
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
12653
|
+
if (focusableChildren.length > 0) {
|
|
12654
|
+
const firstElement = focusableChildren[0];
|
|
12655
|
+
firstElement.focus();
|
|
12656
|
+
} else {
|
|
12657
|
+
console.warn(
|
|
12658
|
+
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
12659
|
+
);
|
|
12660
|
+
}
|
|
12661
|
+
}, [skipAutoFocus]);
|
|
12662
|
+
const handleKeyDown = (e) => {
|
|
12663
|
+
if (e.key === KeyboardKeys.ESCAPE && onEscape) {
|
|
12664
|
+
onEscape();
|
|
12665
|
+
return;
|
|
12666
|
+
}
|
|
12667
|
+
if (e.key !== KeyboardKeys.TAB)
|
|
12668
|
+
return;
|
|
12669
|
+
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
12670
|
+
if (focusableChildren.length > 0) {
|
|
12671
|
+
const firstElement = focusableChildren[0];
|
|
12672
|
+
const lastElement = focusableChildren[focusableChildren.length - 1];
|
|
12673
|
+
if (e.shiftKey) {
|
|
12674
|
+
if (firstElement === document.activeElement) {
|
|
12675
|
+
e.preventDefault();
|
|
12676
|
+
lastElement.focus();
|
|
12677
|
+
}
|
|
12678
|
+
} else if (lastElement === document.activeElement) {
|
|
12679
|
+
e.preventDefault();
|
|
12680
|
+
firstElement.focus();
|
|
12681
|
+
}
|
|
12682
|
+
}
|
|
12683
|
+
};
|
|
12684
|
+
return /* @__PURE__ */ jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
|
|
12685
|
+
};
|
|
12558
12686
|
const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
|
|
12559
12687
|
const isValidFocusedElement = () => {
|
|
12560
12688
|
const focused = document.activeElement;
|
|
@@ -12626,8 +12754,7 @@ export {
|
|
|
12626
12754
|
Alert,
|
|
12627
12755
|
Avatar,
|
|
12628
12756
|
Badge,
|
|
12629
|
-
|
|
12630
|
-
BaseLink,
|
|
12757
|
+
BaseLinkImpl as BaseLink,
|
|
12631
12758
|
Box,
|
|
12632
12759
|
Breadcrumbs,
|
|
12633
12760
|
Button,
|