@strapi/design-system 2.0.0-beta.5 → 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 +4 -0
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +6 -2
- 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 +6 -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 +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 +8 -11
- 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 +2 -2
- package/dist/components/Select/MultiSelect.d.ts.map +1 -1
- package/dist/components/Select/SelectParts.d.ts +8 -2
- package/dist/components/Select/SelectParts.d.ts.map +1 -1
- package/dist/components/Select/SingleSelect.d.ts +2 -2
- package/dist/components/Select/SingleSelect.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/Switch/Switch.d.ts +4 -6
- package/dist/components/Switch/Switch.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 +1292 -1081
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1307 -1098
- 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 +9 -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";
|
|
@@ -26,7 +26,9 @@ import * as Dialog$1 from "@radix-ui/react-dialog";
|
|
|
26
26
|
import * as ScrollArea from "@radix-ui/react-scroll-area";
|
|
27
27
|
import { NumberParser, NumberFormatter } from "@internationalized/number";
|
|
28
28
|
import * as Popover$1 from "@radix-ui/react-popover";
|
|
29
|
+
import * as Progress from "@radix-ui/react-progress";
|
|
29
30
|
import * as RadioGroup from "@radix-ui/react-radio-group";
|
|
31
|
+
import * as Switch from "@radix-ui/react-switch";
|
|
30
32
|
import * as Tabs$1 from "@radix-ui/react-tabs";
|
|
31
33
|
const createContext = (rootComponentName, defaultContext) => {
|
|
32
34
|
const Context = React.createContext(defaultContext);
|
|
@@ -46,32 +48,6 @@ const createContext = (rootComponentName, defaultContext) => {
|
|
|
46
48
|
Provider2.displayName = `${rootComponentName}Provider`;
|
|
47
49
|
return [Provider2, useContext];
|
|
48
50
|
};
|
|
49
|
-
const handleResponsiveValues = (property, value, theme) => {
|
|
50
|
-
if (!value) {
|
|
51
|
-
return void 0;
|
|
52
|
-
}
|
|
53
|
-
if (typeof value === "object") {
|
|
54
|
-
const transformedArray = Array.isArray(value) ? value : [value?.desktop, value?.tablet, value?.mobile];
|
|
55
|
-
const spaces = transformedArray.reduce((acc, curr, index) => {
|
|
56
|
-
if (curr) {
|
|
57
|
-
switch (index) {
|
|
58
|
-
case 0:
|
|
59
|
-
return `${acc}${property}: ${theme.spaces[curr]};`;
|
|
60
|
-
case 1:
|
|
61
|
-
return `${acc}${theme.mediaQueries.tablet}{${property}: ${theme.spaces[curr]};}`;
|
|
62
|
-
case 2:
|
|
63
|
-
return `${acc}${theme.mediaQueries.mobile}{${property}: ${theme.spaces[curr]};}`;
|
|
64
|
-
default:
|
|
65
|
-
return acc;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return acc;
|
|
69
|
-
}, "");
|
|
70
|
-
return spaces;
|
|
71
|
-
}
|
|
72
|
-
const realValue = theme.spaces[value] ?? value;
|
|
73
|
-
return `${property}: ${realValue};`;
|
|
74
|
-
};
|
|
75
51
|
function isKeyOf(o, s) {
|
|
76
52
|
if (typeof o === "string") {
|
|
77
53
|
return false;
|
|
@@ -82,11 +58,166 @@ function isObject(item) {
|
|
|
82
58
|
return item && typeof item === "object" && !Array.isArray(item);
|
|
83
59
|
}
|
|
84
60
|
function extractStyleFromTheme(themeSection, key, defaultValue) {
|
|
85
|
-
if (key && isKeyOf(themeSection, key)) {
|
|
61
|
+
if (themeSection && key && isKeyOf(themeSection, key)) {
|
|
86
62
|
return themeSection[key];
|
|
87
63
|
}
|
|
88
64
|
return defaultValue;
|
|
89
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
|
+
};
|
|
90
221
|
const forwardRef = React.forwardRef;
|
|
91
222
|
const Box = forwardRef((props, ref) => {
|
|
92
223
|
const {
|
|
@@ -98,8 +229,6 @@ const Box = forwardRef((props, ref) => {
|
|
|
98
229
|
fontSize,
|
|
99
230
|
grow,
|
|
100
231
|
hasRadius,
|
|
101
|
-
hiddenS,
|
|
102
|
-
hiddenXS,
|
|
103
232
|
padding,
|
|
104
233
|
paddingBottom,
|
|
105
234
|
paddingLeft,
|
|
@@ -113,6 +242,7 @@ const Box = forwardRef((props, ref) => {
|
|
|
113
242
|
shadow,
|
|
114
243
|
shrink,
|
|
115
244
|
lineHeight,
|
|
245
|
+
fontWeight,
|
|
116
246
|
width,
|
|
117
247
|
minWidth,
|
|
118
248
|
maxWidth,
|
|
@@ -150,8 +280,6 @@ const Box = forwardRef((props, ref) => {
|
|
|
150
280
|
$fontSize: fontSize,
|
|
151
281
|
$grow: grow,
|
|
152
282
|
$hasRadius: hasRadius,
|
|
153
|
-
$hiddenS: hiddenS,
|
|
154
|
-
$hiddenXS: hiddenXS,
|
|
155
283
|
$padding: padding,
|
|
156
284
|
$paddingBottom: paddingBottom,
|
|
157
285
|
$paddingLeft: paddingLeft,
|
|
@@ -165,6 +293,7 @@ const Box = forwardRef((props, ref) => {
|
|
|
165
293
|
$shadow: shadow,
|
|
166
294
|
$shrink: shrink,
|
|
167
295
|
$lineHeight: lineHeight,
|
|
296
|
+
$fontWeight: fontWeight,
|
|
168
297
|
$width: width,
|
|
169
298
|
$minWidth: minWidth,
|
|
170
299
|
$maxWidth: maxWidth,
|
|
@@ -193,110 +322,83 @@ const Box = forwardRef((props, ref) => {
|
|
|
193
322
|
return /* @__PURE__ */ jsx(StyledBox, { as: AsComponent, ref, ...mappedProps, ...rest });
|
|
194
323
|
});
|
|
195
324
|
const StyledBox = styled.div`
|
|
196
|
-
|
|
197
|
-
|
|
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
|
-
|
|
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
|
+
);
|
|
233
376
|
}};
|
|
234
|
-
|
|
235
|
-
// Shadows
|
|
236
|
-
box-shadow: ${({ theme, $shadow }) => extractStyleFromTheme(theme.shadows, $shadow, void 0)};
|
|
237
|
-
|
|
238
|
-
// Handlers
|
|
239
|
-
pointer-events: ${({ $pointerEvents }) => $pointerEvents};
|
|
240
|
-
|
|
241
|
-
// Display
|
|
242
|
-
display: ${({ $display }) => $display};
|
|
243
|
-
|
|
244
|
-
// Position
|
|
245
|
-
position: ${({ $position }) => $position};
|
|
246
|
-
left: ${({ $left, theme }) => extractStyleFromTheme(theme.spaces, $left, $left)};
|
|
247
|
-
right: ${({ $right, theme }) => extractStyleFromTheme(theme.spaces, $right, $right)};
|
|
248
|
-
top: ${({ $top, theme }) => extractStyleFromTheme(theme.spaces, $top, $top)};
|
|
249
|
-
bottom: ${({ $bottom, theme }) => extractStyleFromTheme(theme.spaces, $bottom, $bottom)};
|
|
250
|
-
z-index: ${({ $zIndex, theme }) => extractStyleFromTheme(theme.zIndices, $zIndex, $zIndex)};
|
|
251
|
-
overflow: ${({ $overflow }) => $overflow};
|
|
252
|
-
|
|
253
|
-
// Size
|
|
254
|
-
width: ${({ $width, theme }) => extractStyleFromTheme(theme.spaces, $width, $width)};
|
|
255
|
-
max-width: ${({ $maxWidth, theme }) => extractStyleFromTheme(theme.spaces, $maxWidth, $maxWidth)};
|
|
256
|
-
min-width: ${({ $minWidth, theme }) => extractStyleFromTheme(theme.spaces, $minWidth, $minWidth)};
|
|
257
|
-
height: ${({ $height, theme }) => extractStyleFromTheme(theme.spaces, $height, $height)};
|
|
258
|
-
max-height: ${({ $maxHeight, theme }) => extractStyleFromTheme(theme.spaces, $maxHeight, $maxHeight)};
|
|
259
|
-
min-height: ${({ $minHeight, theme }) => extractStyleFromTheme(theme.spaces, $minHeight, $minHeight)};
|
|
260
|
-
|
|
261
|
-
// Animation
|
|
262
|
-
transition: ${({ $transition }) => $transition};
|
|
263
|
-
transform: ${({ $transform }) => $transform};
|
|
264
|
-
animation: ${({ $animation }) => $animation};
|
|
265
|
-
|
|
266
|
-
//Flexbox children props
|
|
267
|
-
flex-shrink: ${({ $shrink }) => $shrink};
|
|
268
|
-
flex-grow: ${({ $grow }) => $grow};
|
|
269
|
-
flex-basis: ${({ $basis }) => $basis};
|
|
270
|
-
flex: ${({ $flex }) => $flex};
|
|
271
|
-
|
|
272
|
-
// Text
|
|
273
|
-
text-align: ${({ $textAlign }) => $textAlign};
|
|
274
|
-
text-transform: ${({ $textTransform }) => $textTransform};
|
|
275
|
-
line-height: ${({ theme, $lineHeight }) => extractStyleFromTheme(theme.lineHeights, $lineHeight, $lineHeight)};
|
|
276
|
-
|
|
277
|
-
// Cursor
|
|
278
|
-
cursor: ${({ $cursor }) => $cursor};
|
|
279
377
|
`;
|
|
280
378
|
const Flex = forwardRef((props, ref) => {
|
|
281
|
-
const { className, alignItems, direction,
|
|
379
|
+
const { className, alignItems, direction, inline, gap, justifyContent, wrap, ...rest } = props;
|
|
282
380
|
const mappedProps = {
|
|
283
381
|
$alignItems: alignItems,
|
|
284
382
|
$direction: direction,
|
|
285
383
|
$gap: gap,
|
|
286
|
-
$inline: inline,
|
|
287
384
|
$justifyContent: justifyContent,
|
|
288
|
-
$wrap: wrap
|
|
385
|
+
$wrap: wrap,
|
|
386
|
+
$inline: inline
|
|
289
387
|
};
|
|
290
388
|
return /* @__PURE__ */ jsx(StyledFlex, { className, ref, ...mappedProps, ...rest });
|
|
291
389
|
});
|
|
292
390
|
const StyledFlex = styled(Box)`
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
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
|
+
)};
|
|
300
402
|
`;
|
|
301
403
|
const ALPHA = "alpha";
|
|
302
404
|
const BETA = "beta";
|
|
@@ -371,26 +473,24 @@ const Typography = forwardRef(
|
|
|
371
473
|
(props, ref) => {
|
|
372
474
|
const {
|
|
373
475
|
ellipsis: ellipsis2,
|
|
374
|
-
fontSize,
|
|
375
|
-
fontWeight,
|
|
376
|
-
lineHeight,
|
|
377
|
-
textAlign,
|
|
378
476
|
textColor = "currentcolor",
|
|
379
477
|
textDecoration,
|
|
380
478
|
textTransform,
|
|
381
479
|
variant: variant2,
|
|
480
|
+
lineHeight,
|
|
481
|
+
fontWeight,
|
|
482
|
+
fontSize,
|
|
382
483
|
...rest
|
|
383
484
|
} = props;
|
|
384
485
|
const mappedProps = {
|
|
385
486
|
$ellipsis: ellipsis2,
|
|
386
|
-
$fontSize: fontSize,
|
|
387
|
-
$fontWeight: fontWeight,
|
|
388
|
-
$lineHeight: lineHeight,
|
|
389
|
-
$textAlign: textAlign,
|
|
390
487
|
$textColor: textColor,
|
|
391
488
|
$textDecoration: textDecoration,
|
|
392
489
|
$textTransform: textTransform,
|
|
393
|
-
$variant: variant2
|
|
490
|
+
$variant: variant2,
|
|
491
|
+
$lineHeight: lineHeight,
|
|
492
|
+
$fontWeight: fontWeight,
|
|
493
|
+
$fontSize: fontSize
|
|
394
494
|
};
|
|
395
495
|
return /* @__PURE__ */ jsx(StyledTypography, { ref, tag: "span", ...mappedProps, ...rest });
|
|
396
496
|
}
|
|
@@ -399,15 +499,19 @@ const StyledTypography = styled(Box)`
|
|
|
399
499
|
${variant}
|
|
400
500
|
${({ $ellipsis }) => $ellipsis ? ellipsis : ""}
|
|
401
501
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
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
|
+
}}
|
|
411
515
|
`;
|
|
412
516
|
const [AccordionProvider, useAccordion] = createContext("Accordion");
|
|
413
517
|
const Root$8 = React.forwardRef(({ children, size = "S", ...props }, forwardedRef) => {
|
|
@@ -435,25 +539,38 @@ const AccordionItem = styled(RadixAccordion.Item)`
|
|
|
435
539
|
overflow: hidden;
|
|
436
540
|
|
|
437
541
|
&:first-child {
|
|
438
|
-
border-top-left-radius:
|
|
439
|
-
border-top-right-radius:
|
|
542
|
+
border-top-left-radius: 0.3rem;
|
|
543
|
+
border-top-right-radius: 0.3rem;
|
|
440
544
|
}
|
|
441
545
|
|
|
442
546
|
&:last-child {
|
|
443
|
-
border-bottom-left-radius:
|
|
444
|
-
border-bottom-right-radius:
|
|
547
|
+
border-bottom-left-radius: 0.3rem;
|
|
548
|
+
border-bottom-right-radius: 0.3rem;
|
|
445
549
|
}
|
|
446
550
|
|
|
447
551
|
& + & {
|
|
448
552
|
border-top: ${(props) => props.$size === "S" ? `solid 1px ${props.theme.colors.neutral200}` : "unset"};
|
|
449
553
|
}
|
|
450
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
|
+
|
|
451
563
|
/* This applies our desired focus effect correctly. */
|
|
452
564
|
&:focus-within {
|
|
453
565
|
position: relative;
|
|
454
566
|
z-index: 1;
|
|
455
567
|
box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
|
|
456
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
|
+
}
|
|
457
574
|
`;
|
|
458
575
|
const Trigger$7 = React.forwardRef(
|
|
459
576
|
({ caretPosition = "left", description, icon: Icon, children, ...restProps }, forwardedRef) => {
|
|
@@ -469,10 +586,11 @@ const Trigger$7 = React.forwardRef(
|
|
|
469
586
|
fontWeight: size === "S" ? "bold" : void 0,
|
|
470
587
|
ellipsis: true,
|
|
471
588
|
variant: size === "M" ? "delta" : void 0,
|
|
589
|
+
textAlign: "left",
|
|
472
590
|
children
|
|
473
591
|
}
|
|
474
592
|
),
|
|
475
|
-
description && size === "M" ? /* @__PURE__ */ jsx(Typography, { children: description }) : null
|
|
593
|
+
description && size === "M" ? /* @__PURE__ */ jsx(Typography, { textAlign: "left", children: description }) : null
|
|
476
594
|
] })
|
|
477
595
|
] }),
|
|
478
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
|
|
@@ -1136,51 +1254,32 @@ const Base = styled(Flex)`
|
|
|
1136
1254
|
`;
|
|
1137
1255
|
}};
|
|
1138
1256
|
`;
|
|
1139
|
-
const
|
|
1140
|
-
({ disabled,
|
|
1141
|
-
return /* @__PURE__ */ jsx(
|
|
1142
|
-
BaseButtonWrapper,
|
|
1143
|
-
{
|
|
1144
|
-
ref,
|
|
1145
|
-
"aria-disabled": disabled,
|
|
1146
|
-
disabled,
|
|
1147
|
-
tag: "button",
|
|
1148
|
-
type: "button",
|
|
1149
|
-
padding: 2,
|
|
1150
|
-
hasRadius: true,
|
|
1151
|
-
background: "neutral0",
|
|
1152
|
-
borderColor: "neutral200",
|
|
1153
|
-
cursor: "pointer",
|
|
1154
|
-
...props,
|
|
1155
|
-
children
|
|
1156
|
-
}
|
|
1157
|
-
);
|
|
1158
|
-
}
|
|
1159
|
-
);
|
|
1160
|
-
const BaseButtonWrapper = styled(Flex)`
|
|
1161
|
-
&[aria-disabled='true'] {
|
|
1162
|
-
pointer-events: none;
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
${focus}
|
|
1166
|
-
`;
|
|
1167
|
-
const BaseLink = forwardRef(
|
|
1168
|
-
({ href, rel = "noreferrer noopener", target = "_self", disabled = false, isExternal = false, ...props }, ref) => {
|
|
1257
|
+
const BaseLinkImpl = forwardRef(
|
|
1258
|
+
({ href, disabled = false, isExternal = false, ...props }, ref) => {
|
|
1169
1259
|
return /* @__PURE__ */ jsx(
|
|
1170
|
-
|
|
1260
|
+
BaseLink,
|
|
1171
1261
|
{
|
|
1172
1262
|
tag: "a",
|
|
1173
1263
|
ref,
|
|
1174
|
-
target: isExternal ? "_blank" :
|
|
1175
|
-
rel: isExternal ?
|
|
1176
|
-
href
|
|
1264
|
+
target: isExternal ? "_blank" : void 0,
|
|
1265
|
+
rel: isExternal ? "noreferrer noopener" : void 0,
|
|
1266
|
+
href,
|
|
1267
|
+
tabIndex: disabled ? -1 : void 0,
|
|
1177
1268
|
"aria-disabled": disabled,
|
|
1178
|
-
|
|
1269
|
+
pointerEvents: disabled ? "none" : void 0,
|
|
1270
|
+
cursor: disabled ? void 0 : "pointer",
|
|
1179
1271
|
...props
|
|
1180
1272
|
}
|
|
1181
1273
|
);
|
|
1182
1274
|
}
|
|
1183
1275
|
);
|
|
1276
|
+
const BaseLink = styled(Box)`
|
|
1277
|
+
text-decoration: none;
|
|
1278
|
+
|
|
1279
|
+
&:visited {
|
|
1280
|
+
color: inherit;
|
|
1281
|
+
}
|
|
1282
|
+
`;
|
|
1184
1283
|
const Divider$1 = () => {
|
|
1185
1284
|
return /* @__PURE__ */ jsx(Box, { "aria-hidden": true, paddingLeft: 1, paddingRight: 1, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", children: "/" }) });
|
|
1186
1285
|
};
|
|
@@ -1194,30 +1293,34 @@ const AlignedList = styled(Flex)`
|
|
|
1194
1293
|
margin-left: ${({ theme }) => `calc(-1*${theme.spaces[2]})`};
|
|
1195
1294
|
}
|
|
1196
1295
|
`;
|
|
1197
|
-
const Breadcrumbs = (
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
};
|
|
1207
|
-
Breadcrumbs.displayName = "Breadcrumbs";
|
|
1208
|
-
const Crumb = ({ children, isCurrent = false, ...props }) => /* @__PURE__ */ jsx(Box, { paddingLeft: 2, paddingRight: 2, paddingTop: 1, paddingBottom: 1, children: /* @__PURE__ */ jsx(
|
|
1209
|
-
Typography,
|
|
1210
|
-
{
|
|
1211
|
-
variant: "pi",
|
|
1212
|
-
textColor: "neutral800",
|
|
1213
|
-
fontWeight: isCurrent ? "bold" : "regular",
|
|
1214
|
-
"aria-current": isCurrent,
|
|
1215
|
-
...props,
|
|
1216
|
-
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
|
+
}) }) });
|
|
1217
1306
|
}
|
|
1218
|
-
)
|
|
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
|
+
);
|
|
1219
1322
|
Crumb.displayName = "Crumb";
|
|
1220
|
-
const StyledLink = styled(
|
|
1323
|
+
const StyledLink = styled(BaseLinkImpl)`
|
|
1221
1324
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
1222
1325
|
color: ${({ theme }) => theme.colors.neutral600};
|
|
1223
1326
|
font-size: ${({ theme }) => theme.fontSizes[1]};
|
|
@@ -1231,9 +1334,22 @@ const StyledLink = styled(BaseLink)`
|
|
|
1231
1334
|
color: ${({ theme }) => theme.colors.neutral700};
|
|
1232
1335
|
}
|
|
1233
1336
|
`;
|
|
1234
|
-
const CrumbLink = ({ children, ...props }) => /* @__PURE__ */ jsx(StyledLink, { ...props, children });
|
|
1337
|
+
const CrumbLink = React.forwardRef(({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsx(StyledLink, { ref: forwardedRef, ...props, children }));
|
|
1235
1338
|
CrumbLink.displayName = "CrumbLink";
|
|
1236
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
|
+
}
|
|
1237
1353
|
const isSSR = () => typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
|
|
1238
1354
|
const useIsomorphicLayoutEffect = isSSR() ? useEffect : useLayoutEffect;
|
|
1239
1355
|
const useReactId = React["useId".toString()] || (() => void 0);
|
|
@@ -1283,7 +1399,7 @@ const DANGER = "danger";
|
|
|
1283
1399
|
const SUCCESS = "success";
|
|
1284
1400
|
const GHOST = "ghost";
|
|
1285
1401
|
const LIGHT_VARIANTS = [SUCCESS_LIGHT, DANGER_LIGHT];
|
|
1286
|
-
const VARIANTS
|
|
1402
|
+
const VARIANTS = [DEFAULT, TERTIARY, SECONDARY, DANGER, SUCCESS, GHOST, ...LIGHT_VARIANTS];
|
|
1287
1403
|
const BUTTON_SIZES = ["S", "M", "L"];
|
|
1288
1404
|
const getVariantColorName = (variant2) => {
|
|
1289
1405
|
if (variant2 === SUCCESS_LIGHT || variant2 === DANGER_LIGHT) {
|
|
@@ -1292,7 +1408,7 @@ const getVariantColorName = (variant2) => {
|
|
|
1292
1408
|
if (variant2 === TERTIARY) {
|
|
1293
1409
|
return "neutral";
|
|
1294
1410
|
}
|
|
1295
|
-
if (variant2 === DEFAULT || variant2 === SECONDARY || VARIANTS
|
|
1411
|
+
if (variant2 === DEFAULT || variant2 === SECONDARY || VARIANTS.every((vari) => vari !== variant2)) {
|
|
1296
1412
|
return "primary";
|
|
1297
1413
|
}
|
|
1298
1414
|
return `${variant2}`;
|
|
@@ -1302,6 +1418,7 @@ const getDisabledStyle = ({ theme }) => {
|
|
|
1302
1418
|
border: 1px solid ${theme.colors.neutral200};
|
|
1303
1419
|
background: ${theme.colors.neutral150};
|
|
1304
1420
|
color: ${theme.colors.neutral600};
|
|
1421
|
+
cursor: default;
|
|
1305
1422
|
`;
|
|
1306
1423
|
};
|
|
1307
1424
|
const getHoverStyle = ({ theme, $variant }) => {
|
|
@@ -1339,7 +1456,7 @@ const getActiveStyle = ({ theme, $variant }) => {
|
|
|
1339
1456
|
color: ${theme.colors[`${getVariantColorName($variant)}600`]};
|
|
1340
1457
|
`;
|
|
1341
1458
|
}
|
|
1342
|
-
if ($variant === TERTIARY) {
|
|
1459
|
+
if ($variant === TERTIARY || $variant === GHOST) {
|
|
1343
1460
|
return css`
|
|
1344
1461
|
background-color: ${theme.colors.neutral150};
|
|
1345
1462
|
`;
|
|
@@ -1388,6 +1505,8 @@ const getVariantStyle = ({ theme, $variant }) => {
|
|
|
1388
1505
|
}
|
|
1389
1506
|
default: {
|
|
1390
1507
|
return css`
|
|
1508
|
+
border: 1px solid ${theme.colors.buttonPrimary600};
|
|
1509
|
+
background: ${theme.colors.buttonPrimary600};
|
|
1391
1510
|
color: ${theme.colors.buttonNeutral0};
|
|
1392
1511
|
`;
|
|
1393
1512
|
}
|
|
@@ -1420,21 +1539,22 @@ const Button = forwardRef(
|
|
|
1420
1539
|
disabled: isDisabled,
|
|
1421
1540
|
$size: size,
|
|
1422
1541
|
$variant: variant2,
|
|
1542
|
+
tag: "button",
|
|
1423
1543
|
onClick: handleClick,
|
|
1424
|
-
|
|
1425
|
-
background: "buttonPrimary600",
|
|
1426
|
-
borderColor: "buttonPrimary600",
|
|
1544
|
+
hasRadius: true,
|
|
1427
1545
|
gap: 2,
|
|
1428
|
-
inline:
|
|
1429
|
-
|
|
1546
|
+
inline: true,
|
|
1547
|
+
alignItems: "center",
|
|
1548
|
+
justifyContent: "center",
|
|
1549
|
+
width: fullWidth ? "100%" : void 0,
|
|
1430
1550
|
paddingLeft: 4,
|
|
1431
1551
|
paddingRight: 4,
|
|
1432
|
-
|
|
1552
|
+
cursor: "pointer",
|
|
1433
1553
|
...props,
|
|
1434
1554
|
children: [
|
|
1435
|
-
(startIcon || loading) && /* @__PURE__ */ jsx(
|
|
1555
|
+
(startIcon || loading) && /* @__PURE__ */ jsx(Flex, { tag: "span", "aria-hidden": true, children: loading ? /* @__PURE__ */ jsx(LoaderAnimated, {}) : startIcon }),
|
|
1436
1556
|
/* @__PURE__ */ jsx(Typography, { variant: size === "S" ? "pi" : void 0, fontWeight: "bold", children }),
|
|
1437
|
-
endIcon && /* @__PURE__ */ jsx(Flex, { "aria-hidden": true, children: endIcon })
|
|
1557
|
+
endIcon && /* @__PURE__ */ jsx(Flex, { tag: "span", "aria-hidden": true, children: endIcon })
|
|
1438
1558
|
]
|
|
1439
1559
|
}
|
|
1440
1560
|
);
|
|
@@ -1452,20 +1572,10 @@ const LoaderAnimated = styled(Loader$1)`
|
|
|
1452
1572
|
animation: ${rotation$2} 2s infinite linear;
|
|
1453
1573
|
will-change: transform;
|
|
1454
1574
|
`;
|
|
1455
|
-
const ButtonWrapper = styled(
|
|
1575
|
+
const ButtonWrapper = styled(Flex)`
|
|
1456
1576
|
height: ${({ theme, $size }) => theme.sizes.button[$size]};
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
height: 1.2rem;
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
&[aria-disabled='true'] {
|
|
1463
|
-
${getDisabledStyle}
|
|
1464
|
-
|
|
1465
|
-
&:active {
|
|
1466
|
-
${getDisabledStyle}
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1577
|
+
text-decoration: none;
|
|
1578
|
+
${getVariantStyle}
|
|
1469
1579
|
|
|
1470
1580
|
&:hover {
|
|
1471
1581
|
${getHoverStyle}
|
|
@@ -1475,7 +1585,9 @@ const ButtonWrapper = styled(BaseButton)`
|
|
|
1475
1585
|
${getActiveStyle}
|
|
1476
1586
|
}
|
|
1477
1587
|
|
|
1478
|
-
|
|
1588
|
+
&[aria-disabled='true'] {
|
|
1589
|
+
${getDisabledStyle}
|
|
1590
|
+
}
|
|
1479
1591
|
|
|
1480
1592
|
@media (prefers-reduced-motion: no-preference) {
|
|
1481
1593
|
transition:
|
|
@@ -1484,76 +1596,220 @@ const ButtonWrapper = styled(BaseButton)`
|
|
|
1484
1596
|
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
1485
1597
|
}
|
|
1486
1598
|
`;
|
|
1487
|
-
const
|
|
1488
|
-
({
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
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
|
+
);
|
|
1495
1625
|
}
|
|
1496
1626
|
);
|
|
1497
|
-
const
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
path {
|
|
1508
|
-
fill: ${({ disabled, theme }) => disabled ? theme.colors.neutral600 : theme.colors.primary600};
|
|
1509
|
-
}
|
|
1510
|
-
}
|
|
1511
|
-
|
|
1512
|
-
&:hover {
|
|
1513
|
-
color: ${({ theme }) => theme.colors.primary500};
|
|
1514
|
-
}
|
|
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);
|
|
1515
1636
|
|
|
1516
|
-
|
|
1517
|
-
|
|
1637
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1638
|
+
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
1639
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
1518
1640
|
}
|
|
1519
|
-
|
|
1520
|
-
${focus};
|
|
1521
1641
|
`;
|
|
1522
|
-
const
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
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,
|
|
1527
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,
|
|
1528
1670
|
ref,
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
paddingBottom: size === "S" ? 1 : 2,
|
|
1534
|
-
paddingLeft: size === "S" ? 3 : 4,
|
|
1535
|
-
paddingRight: size === "S" ? 3 : 4,
|
|
1536
|
-
...props
|
|
1671
|
+
$size: size,
|
|
1672
|
+
onClick: handleClick,
|
|
1673
|
+
$variant: variant2,
|
|
1674
|
+
children: /* @__PURE__ */ jsx(AccessibleIcon, { label, children })
|
|
1537
1675
|
}
|
|
1538
|
-
)
|
|
1539
|
-
|
|
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 }) });
|
|
1795
|
+
}
|
|
1540
1796
|
);
|
|
1541
1797
|
const MenuContent = React.forwardRef(
|
|
1542
1798
|
({ children, intersectionId, popoverPlacement = "bottom-start", ...props }, ref) => {
|
|
1543
1799
|
const [side, align] = popoverPlacement.split("-");
|
|
1544
|
-
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(
|
|
1545
1801
|
Viewport$2,
|
|
1546
1802
|
{
|
|
1547
1803
|
ref,
|
|
1548
1804
|
direction: "column",
|
|
1549
|
-
borderStyle: "solid",
|
|
1550
|
-
borderWidth: "1px",
|
|
1551
1805
|
borderColor: "neutral150",
|
|
1552
1806
|
hasRadius: true,
|
|
1553
1807
|
background: "neutral0",
|
|
1554
1808
|
shadow: "filterShadow",
|
|
1555
1809
|
maxHeight: "15rem",
|
|
1556
1810
|
padding: 1,
|
|
1811
|
+
marginTop: 1,
|
|
1812
|
+
marginBottom: 1,
|
|
1557
1813
|
alignItems: "flex-start",
|
|
1558
1814
|
position: "relative",
|
|
1559
1815
|
overflow: "auto",
|
|
@@ -1575,6 +1831,23 @@ const Viewport$2 = styled(Flex)`
|
|
|
1575
1831
|
display: none;
|
|
1576
1832
|
}
|
|
1577
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
|
+
`;
|
|
1578
1851
|
const MenuItem$1 = ({ onSelect, disabled = false, isLink, ...props }) => {
|
|
1579
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 }) }) });
|
|
1580
1853
|
};
|
|
@@ -1584,7 +1857,7 @@ const getOptionStyle = ({ theme }) => css`
|
|
|
1584
1857
|
border-radius: ${theme.borderRadius};
|
|
1585
1858
|
padding: ${theme.spaces[2]} ${theme.spaces[4]};
|
|
1586
1859
|
|
|
1587
|
-
&[aria-disabled] {
|
|
1860
|
+
&[aria-disabled='true'] {
|
|
1588
1861
|
cursor: not-allowed;
|
|
1589
1862
|
color: ${theme.colors.neutral500};
|
|
1590
1863
|
}
|
|
@@ -1689,37 +1962,41 @@ const Menu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
1689
1962
|
SubTrigger,
|
|
1690
1963
|
Trigger: Trigger$6
|
|
1691
1964
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1692
|
-
const SimpleMenu = (
|
|
1693
|
-
|
|
1694
|
-
|
|
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
|
-
}
|
|
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
|
+
);
|
|
1723
2000
|
const MenuItem = Item$3;
|
|
1724
2001
|
const StyledButton = styled(SimpleMenu)`
|
|
1725
2002
|
padding: ${({ theme }) => `${theme.spaces[1]} ${theme.spaces[2]}`};
|
|
@@ -1730,16 +2007,19 @@ const StyledButton = styled(SimpleMenu)`
|
|
|
1730
2007
|
background-color: ${({ theme }) => theme.colors.neutral200};
|
|
1731
2008
|
}
|
|
1732
2009
|
`;
|
|
1733
|
-
const CrumbSimpleMenu = (
|
|
2010
|
+
const CrumbSimpleMenu = React.forwardRef(
|
|
2011
|
+
({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsx(StyledButton, { ref: forwardedRef, endIcon: null, size: "S", ...props, children })
|
|
2012
|
+
);
|
|
1734
2013
|
CrumbSimpleMenu.displayName = "CrumbSimpleMenu";
|
|
1735
2014
|
const CardContext = React.createContext({ id: "" });
|
|
1736
2015
|
const useCard = () => React.useContext(CardContext);
|
|
1737
|
-
const Card = ({ id, ...props }) => {
|
|
2016
|
+
const Card = React.forwardRef(({ id, ...props }, forwardedRef) => {
|
|
1738
2017
|
const generatedId = useId(id);
|
|
1739
2018
|
const context = React.useMemo(() => ({ id: generatedId }), [generatedId]);
|
|
1740
2019
|
return /* @__PURE__ */ jsx(CardContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
|
|
1741
2020
|
Box,
|
|
1742
2021
|
{
|
|
2022
|
+
ref: forwardedRef,
|
|
1743
2023
|
id,
|
|
1744
2024
|
tabIndex: 0,
|
|
1745
2025
|
hasRadius: true,
|
|
@@ -1753,10 +2033,10 @@ const Card = ({ id, ...props }) => {
|
|
|
1753
2033
|
...props
|
|
1754
2034
|
}
|
|
1755
2035
|
) });
|
|
1756
|
-
};
|
|
1757
|
-
const CardActionImpl = ({ position, ...restProps }) => {
|
|
1758
|
-
return /* @__PURE__ */ jsx(CardAction, { $position: position, ...restProps, direction: "row", gap: 2 });
|
|
1759
|
-
};
|
|
2036
|
+
});
|
|
2037
|
+
const CardActionImpl = React.forwardRef(({ position, ...restProps }, forwardedRef) => {
|
|
2038
|
+
return /* @__PURE__ */ jsx(CardAction, { ref: forwardedRef, $position: position, ...restProps, direction: "row", gap: 2 });
|
|
2039
|
+
});
|
|
1760
2040
|
const CardAction = styled(Flex)`
|
|
1761
2041
|
position: absolute;
|
|
1762
2042
|
top: ${({ theme }) => theme.spaces[3]};
|
|
@@ -1807,30 +2087,17 @@ const CardBadge = (props) => /* @__PURE__ */ jsx(CardBadgeWrapper, { children: /
|
|
|
1807
2087
|
const CardBody = (props) => {
|
|
1808
2088
|
return /* @__PURE__ */ jsx(Box, { paddingLeft: 3, paddingRight: 3, paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsx(Flex, { ...props, alignItems: "flex-start" }) });
|
|
1809
2089
|
};
|
|
1810
|
-
function setRef(ref, value) {
|
|
1811
|
-
if (typeof ref === "function") {
|
|
1812
|
-
ref(value);
|
|
1813
|
-
} else if (ref !== null && ref !== void 0) {
|
|
1814
|
-
ref.current = value;
|
|
1815
|
-
}
|
|
1816
|
-
}
|
|
1817
|
-
function composeRefs(...refs) {
|
|
1818
|
-
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
1819
|
-
}
|
|
1820
|
-
function useComposedRefs(...refs) {
|
|
1821
|
-
return React.useCallback(composeRefs(...refs), refs);
|
|
1822
|
-
}
|
|
1823
2090
|
const CheckIcon = ({ fill, ...props }) => {
|
|
1824
2091
|
const { colors } = useTheme();
|
|
1825
2092
|
return /* @__PURE__ */ jsx(
|
|
1826
2093
|
Box,
|
|
1827
2094
|
{
|
|
1828
2095
|
tag: "svg",
|
|
1829
|
-
viewBox: "0 0
|
|
2096
|
+
viewBox: "0 0 32 32",
|
|
1830
2097
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1831
2098
|
fill: fill ? colors[fill] : void 0,
|
|
1832
2099
|
...props,
|
|
1833
|
-
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" })
|
|
1834
2101
|
}
|
|
1835
2102
|
);
|
|
1836
2103
|
};
|
|
@@ -1843,9 +2110,9 @@ const CheckboxEl = React.forwardRef(
|
|
|
1843
2110
|
onChange: onCheckedChange
|
|
1844
2111
|
});
|
|
1845
2112
|
const composedRefs = useComposedRefs(checkboxRef, forwardedRef);
|
|
1846
|
-
return /* @__PURE__ */ jsx(CheckboxRoot, { ref: composedRefs, checked, onCheckedChange: setChecked, ...props, children: /* @__PURE__ */ jsxs(Checkbox.Indicator, { children: [
|
|
1847
|
-
checked === true ? /* @__PURE__ */ jsx(CheckIcon, { width: "
|
|
1848
|
-
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
|
|
1849
2116
|
] }) });
|
|
1850
2117
|
}
|
|
1851
2118
|
);
|
|
@@ -1863,12 +2130,6 @@ const CheckboxRoot = styled(Checkbox.Root)`
|
|
|
1863
2130
|
// this ensures the checkbox is always a square even in flex-containers.
|
|
1864
2131
|
flex: 0 0 2rem;
|
|
1865
2132
|
|
|
1866
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
1867
|
-
transition:
|
|
1868
|
-
border-color ${(props) => props.theme.motion.timings["120"]} ${(props) => props.theme.motion.easings.easeOutQuad},
|
|
1869
|
-
${(props) => props.theme.transitions.backgroundColor};
|
|
1870
|
-
}
|
|
1871
|
-
|
|
1872
2133
|
&[data-state='checked'],
|
|
1873
2134
|
&[data-state='indeterminate'] {
|
|
1874
2135
|
border: 1px solid ${(props) => props.theme.colors.primary600};
|
|
@@ -1902,10 +2163,10 @@ const CheckboxImpl = React.forwardRef(({ children, ...restProps }, forwardedRef)
|
|
|
1902
2163
|
/* @__PURE__ */ jsx(Typography, { tag: "label", textColor: "neutral800", htmlFor: labelId, children })
|
|
1903
2164
|
] });
|
|
1904
2165
|
});
|
|
1905
|
-
const CardCheckbox = (props) => {
|
|
2166
|
+
const CardCheckbox = React.forwardRef((props, forwardedRef) => {
|
|
1906
2167
|
const { id } = useCard();
|
|
1907
|
-
return /* @__PURE__ */ jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsx(CheckboxImpl, { "aria-labelledby": `${id}-title`, ...props }) });
|
|
1908
|
-
};
|
|
2168
|
+
return /* @__PURE__ */ jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsx(CheckboxImpl, { "aria-labelledby": `${id}-title`, ...props, ref: forwardedRef }) });
|
|
2169
|
+
});
|
|
1909
2170
|
const BreakBox = styled(Box)`
|
|
1910
2171
|
word-break: break-all;
|
|
1911
2172
|
`;
|
|
@@ -1957,49 +2218,6 @@ const KeyboardKeys = {
|
|
|
1957
2218
|
BACKSPACE: "Backspace",
|
|
1958
2219
|
CLEAR: "Clear"
|
|
1959
2220
|
};
|
|
1960
|
-
const TooltipImpl = React.forwardRef(
|
|
1961
|
-
({
|
|
1962
|
-
children,
|
|
1963
|
-
description,
|
|
1964
|
-
label,
|
|
1965
|
-
defaultOpen,
|
|
1966
|
-
open,
|
|
1967
|
-
onOpenChange,
|
|
1968
|
-
delayDuration = 500,
|
|
1969
|
-
disableHoverableContent,
|
|
1970
|
-
...restProps
|
|
1971
|
-
}, forwardedRef) => {
|
|
1972
|
-
return /* @__PURE__ */ jsxs(
|
|
1973
|
-
Tooltip.Root,
|
|
1974
|
-
{
|
|
1975
|
-
defaultOpen,
|
|
1976
|
-
open,
|
|
1977
|
-
onOpenChange,
|
|
1978
|
-
delayDuration,
|
|
1979
|
-
disableHoverableContent,
|
|
1980
|
-
children: [
|
|
1981
|
-
/* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children }),
|
|
1982
|
-
/* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(TooltipContent, { ref: forwardedRef, sideOffset: 8, ...restProps, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: label || description }) }) })
|
|
1983
|
-
]
|
|
1984
|
-
}
|
|
1985
|
-
);
|
|
1986
|
-
}
|
|
1987
|
-
);
|
|
1988
|
-
const TooltipContent = styled(Tooltip.Content)`
|
|
1989
|
-
background-color: ${(props) => props.theme.colors.neutral900};
|
|
1990
|
-
color: ${(props) => props.theme.colors.neutral0};
|
|
1991
|
-
padding-inline: ${(props) => props.theme.spaces[2]};
|
|
1992
|
-
padding-block: ${(props) => props.theme.spaces[2]};
|
|
1993
|
-
border-radius: ${(props) => props.theme.borderRadius};
|
|
1994
|
-
z-index: ${(props) => props.theme.zIndices.tooltip};
|
|
1995
|
-
will-change: opacity;
|
|
1996
|
-
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
1997
|
-
|
|
1998
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
1999
|
-
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
2000
|
-
${(props) => props.theme.motion.easings.authenticMotion};
|
|
2001
|
-
}
|
|
2002
|
-
`;
|
|
2003
2221
|
const CarouselGrid = styled(Box)`
|
|
2004
2222
|
grid-template-columns: auto 1fr auto;
|
|
2005
2223
|
grid-template-areas: 'startAction slides endAction';
|
|
@@ -2094,9 +2312,11 @@ const commonTheme = {
|
|
|
2094
2312
|
},
|
|
2095
2313
|
spaces: ["0px", "4px", "8px", "12px", "16px", "20px", "24px", "32px", "40px", "48px", "56px", "64px"],
|
|
2096
2314
|
borderRadius: "4px",
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
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)"
|
|
2100
2320
|
},
|
|
2101
2321
|
fontSizes: [`1.1rem`, `1.2rem`, `1.4rem`, "1.6rem", `1.8rem`, `3.2rem`],
|
|
2102
2322
|
lineHeights: [1.14, 1.22, 1.25, 1.33, 1.43, 1.45, 1.5],
|
|
@@ -2937,7 +3157,7 @@ lodash.exports;
|
|
|
2937
3157
|
}
|
|
2938
3158
|
var runInContext = function runInContext2(context) {
|
|
2939
3159
|
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
|
|
2940
|
-
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;
|
|
2941
3161
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
|
2942
3162
|
var coreJsData = context["__core-js_shared__"];
|
|
2943
3163
|
var funcToString = funcProto.toString;
|
|
@@ -2963,7 +3183,7 @@ lodash.exports;
|
|
|
2963
3183
|
}
|
|
2964
3184
|
}();
|
|
2965
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;
|
|
2966
|
-
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;
|
|
2967
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");
|
|
2968
3188
|
var metaMap = WeakMap && new WeakMap();
|
|
2969
3189
|
var realNames = {};
|
|
@@ -4709,7 +4929,7 @@ lodash.exports;
|
|
|
4709
4929
|
return setWrapToString(result2, func, bitmask);
|
|
4710
4930
|
}
|
|
4711
4931
|
function createRound(methodName) {
|
|
4712
|
-
var func =
|
|
4932
|
+
var func = Math2[methodName];
|
|
4713
4933
|
return function(number, precision) {
|
|
4714
4934
|
number = toNumber(number);
|
|
4715
4935
|
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
|
|
@@ -7800,10 +8020,9 @@ const Label = React.forwardRef(({ children, action, ...props }, ref) => {
|
|
|
7800
8020
|
return null;
|
|
7801
8021
|
}
|
|
7802
8022
|
return /* @__PURE__ */ jsxs(
|
|
7803
|
-
|
|
8023
|
+
TypographyLabel,
|
|
7804
8024
|
{
|
|
7805
8025
|
ref: composedRefs,
|
|
7806
|
-
display: "flex",
|
|
7807
8026
|
variant: "pi",
|
|
7808
8027
|
textColor: "neutral800",
|
|
7809
8028
|
fontWeight: "bold",
|
|
@@ -7811,6 +8030,7 @@ const Label = React.forwardRef(({ children, action, ...props }, ref) => {
|
|
|
7811
8030
|
id: `${id}-label`,
|
|
7812
8031
|
htmlFor: id,
|
|
7813
8032
|
tag: "label",
|
|
8033
|
+
ellipsis: true,
|
|
7814
8034
|
children: [
|
|
7815
8035
|
children,
|
|
7816
8036
|
required && /* @__PURE__ */ jsx(Typography, { "aria-hidden": true, lineHeight: "1em", textColor: "danger600", children: "*" }),
|
|
@@ -7819,6 +8039,9 @@ const Label = React.forwardRef(({ children, action, ...props }, ref) => {
|
|
|
7819
8039
|
}
|
|
7820
8040
|
);
|
|
7821
8041
|
});
|
|
8042
|
+
const TypographyLabel = styled(Typography)`
|
|
8043
|
+
display: flex;
|
|
8044
|
+
`;
|
|
7822
8045
|
const LabelAction = styled(Flex)`
|
|
7823
8046
|
line-height: 0;
|
|
7824
8047
|
color: ${({ theme }) => theme.colors.neutral500};
|
|
@@ -7832,6 +8055,7 @@ const Input$2 = React.forwardRef(
|
|
|
7832
8055
|
hasError: hasErrorProp,
|
|
7833
8056
|
required: requiredProp,
|
|
7834
8057
|
className,
|
|
8058
|
+
size = "M",
|
|
7835
8059
|
...props
|
|
7836
8060
|
}, ref) => {
|
|
7837
8061
|
const { id, error, hint, name, required } = useField("Input");
|
|
@@ -7842,22 +8066,34 @@ const Input$2 = React.forwardRef(
|
|
|
7842
8066
|
ariaDescription = `${id}-hint`;
|
|
7843
8067
|
}
|
|
7844
8068
|
const hasError = Boolean(error);
|
|
8069
|
+
const endActionRef = React.useRef(null);
|
|
8070
|
+
const inputElementRef = React.useRef(null);
|
|
8071
|
+
const inputRef = useComposedRefs(inputElementRef, ref);
|
|
7845
8072
|
const handleChange = (e) => {
|
|
7846
8073
|
if (!disabled && onChange) {
|
|
7847
8074
|
onChange(e);
|
|
7848
8075
|
}
|
|
7849
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]);
|
|
7850
8087
|
return /* @__PURE__ */ jsxs(
|
|
7851
8088
|
InputWrapper,
|
|
7852
8089
|
{
|
|
7853
|
-
paddingLeft: 3,
|
|
7854
|
-
paddingRight: 3,
|
|
7855
|
-
paddingTop: 2,
|
|
7856
|
-
paddingBottom: 2,
|
|
7857
8090
|
gap: 2,
|
|
7858
8091
|
justifyContent: "space-between",
|
|
7859
8092
|
$hasError: hasError || hasErrorProp,
|
|
7860
8093
|
$disabled: disabled,
|
|
8094
|
+
$size: size,
|
|
8095
|
+
$hasLeftAction: Boolean(startAction),
|
|
8096
|
+
$hasRightAction: Boolean(endAction),
|
|
7861
8097
|
className,
|
|
7862
8098
|
children: [
|
|
7863
8099
|
startAction,
|
|
@@ -7866,20 +8102,21 @@ const Input$2 = React.forwardRef(
|
|
|
7866
8102
|
{
|
|
7867
8103
|
id,
|
|
7868
8104
|
name,
|
|
7869
|
-
ref,
|
|
8105
|
+
ref: inputRef,
|
|
8106
|
+
$size: size,
|
|
7870
8107
|
"aria-describedby": ariaDescription,
|
|
7871
8108
|
"aria-invalid": hasError || hasErrorProp,
|
|
7872
8109
|
"aria-disabled": disabled,
|
|
7873
8110
|
disabled,
|
|
7874
8111
|
"data-disabled": disabled ? "" : void 0,
|
|
7875
|
-
$hasLeftAction: Boolean(startAction),
|
|
7876
|
-
$hasRightAction: Boolean(endAction),
|
|
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
|
);
|
|
@@ -7912,17 +8149,42 @@ const InputElement = styled.input`
|
|
|
7912
8149
|
outline: none;
|
|
7913
8150
|
box-shadow: none;
|
|
7914
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%);
|
|
7915
8175
|
`;
|
|
7916
8176
|
const InputWrapper = styled(Flex)`
|
|
7917
8177
|
border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
|
7918
8178
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
7919
8179
|
background: ${({ theme }) => theme.colors.neutral0};
|
|
7920
|
-
${
|
|
8180
|
+
padding-inline-start: ${({ $hasLeftAction, theme }) => $hasLeftAction ? theme.spaces[4] : 0};
|
|
8181
|
+
position: relative;
|
|
7921
8182
|
|
|
8183
|
+
${inputFocusStyle()}
|
|
7922
8184
|
${({ theme, $disabled }) => $disabled ? css`
|
|
7923
8185
|
color: ${theme.colors.neutral600};
|
|
7924
8186
|
background: ${theme.colors.neutral150};
|
|
7925
|
-
` : void 0}
|
|
8187
|
+
` : void 0};
|
|
7926
8188
|
`;
|
|
7927
8189
|
const Hint = () => {
|
|
7928
8190
|
const { id, hint, error } = useField("Hint");
|
|
@@ -8101,6 +8363,7 @@ const Combobox = React.forwardRef(
|
|
|
8101
8363
|
onLoadMore,
|
|
8102
8364
|
placeholder = "Select or enter a value",
|
|
8103
8365
|
required: requiredProp = false,
|
|
8366
|
+
size = "M",
|
|
8104
8367
|
startIcon,
|
|
8105
8368
|
textValue,
|
|
8106
8369
|
value,
|
|
@@ -8200,9 +8463,9 @@ const Combobox = React.forwardRef(
|
|
|
8200
8463
|
onFilterValueChange: handleFilterValueChange,
|
|
8201
8464
|
isPrintableCharacter: isPrintableCharacter2,
|
|
8202
8465
|
children: [
|
|
8203
|
-
/* @__PURE__ */ jsxs(Trigger$5, { $hasError: hasError, className, children: [
|
|
8466
|
+
/* @__PURE__ */ jsxs(Trigger$5, { $hasError: hasError, $size: size, className, children: [
|
|
8204
8467
|
/* @__PURE__ */ jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
|
|
8205
|
-
startIcon ? /* @__PURE__ */ jsx(
|
|
8468
|
+
startIcon ? /* @__PURE__ */ jsx(Flex, { flex: "0 0 1.6rem", tag: "span", "aria-hidden": true, children: startIcon }) : null,
|
|
8206
8469
|
/* @__PURE__ */ jsx(
|
|
8207
8470
|
TextInput$1,
|
|
8208
8471
|
{
|
|
@@ -8236,7 +8499,7 @@ const Combobox = React.forwardRef(
|
|
|
8236
8499
|
children: /* @__PURE__ */ jsx(Cross, {})
|
|
8237
8500
|
}
|
|
8238
8501
|
) : null,
|
|
8239
|
-
/* @__PURE__ */ jsx(DownIcon$1, { children: /* @__PURE__ */ jsx(CaretDown, {}) })
|
|
8502
|
+
/* @__PURE__ */ jsx(DownIcon$1, { children: /* @__PURE__ */ jsx(CaretDown, { fill: "neutral500" }) })
|
|
8240
8503
|
] })
|
|
8241
8504
|
] }),
|
|
8242
8505
|
/* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(Content$5, { sideOffset: 4, children: /* @__PURE__ */ jsxs(Viewport$1, { ref: viewportRef, children: [
|
|
@@ -8265,10 +8528,6 @@ const IconBox$3 = styled(Box)`
|
|
|
8265
8528
|
const Trigger$5 = styled(Combobox$1.Trigger)`
|
|
8266
8529
|
position: relative;
|
|
8267
8530
|
border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
|
8268
|
-
padding-right: ${({ theme }) => theme.spaces[3]};
|
|
8269
|
-
padding-left: ${({ theme }) => theme.spaces[3]};
|
|
8270
|
-
padding-top: ${({ theme }) => theme.spaces[2]};
|
|
8271
|
-
padding-bottom: ${({ theme }) => theme.spaces[2]};
|
|
8272
8531
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
8273
8532
|
background: ${({ theme }) => theme.colors.neutral0};
|
|
8274
8533
|
overflow: hidden;
|
|
@@ -8277,6 +8536,23 @@ const Trigger$5 = styled(Combobox$1.Trigger)`
|
|
|
8277
8536
|
justify-content: space-between;
|
|
8278
8537
|
gap: ${({ theme }) => theme.spaces[4]};
|
|
8279
8538
|
|
|
8539
|
+
${(props) => {
|
|
8540
|
+
switch (props.$size) {
|
|
8541
|
+
case "S":
|
|
8542
|
+
return css`
|
|
8543
|
+
padding-inline-start: ${({ theme }) => theme.spaces[4]};
|
|
8544
|
+
padding-inline-end: ${({ theme }) => theme.spaces[3]};
|
|
8545
|
+
padding-block: ${({ theme }) => theme.spaces[1]};
|
|
8546
|
+
`;
|
|
8547
|
+
default:
|
|
8548
|
+
return css`
|
|
8549
|
+
padding-inline-start: ${({ theme }) => theme.spaces[4]};
|
|
8550
|
+
padding-inline-end: ${({ theme }) => theme.spaces[3]};
|
|
8551
|
+
padding-block: ${({ theme }) => theme.spaces[2]};
|
|
8552
|
+
`;
|
|
8553
|
+
}
|
|
8554
|
+
}}
|
|
8555
|
+
|
|
8280
8556
|
&[data-disabled] {
|
|
8281
8557
|
color: ${({ theme }) => theme.colors.neutral600};
|
|
8282
8558
|
background: ${({ theme }) => theme.colors.neutral150};
|
|
@@ -8312,6 +8588,7 @@ const DownIcon$1 = styled(Combobox$1.Icon)`
|
|
|
8312
8588
|
background: transparent;
|
|
8313
8589
|
padding: 0;
|
|
8314
8590
|
color: ${({ theme }) => theme.colors.neutral600};
|
|
8591
|
+
display: flex;
|
|
8315
8592
|
|
|
8316
8593
|
&[aria-disabled='true'] {
|
|
8317
8594
|
cursor: inherit;
|
|
@@ -8335,11 +8612,11 @@ const Content$5 = styled(Combobox$1.Content)`
|
|
|
8335
8612
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8336
8613
|
|
|
8337
8614
|
&[data-side='top'] {
|
|
8338
|
-
animation-name: ${ANIMATIONS.
|
|
8615
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
8339
8616
|
}
|
|
8340
8617
|
|
|
8341
8618
|
&[data-side='bottom'] {
|
|
8342
|
-
animation-name: ${ANIMATIONS.
|
|
8619
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
8343
8620
|
}
|
|
8344
8621
|
}
|
|
8345
8622
|
}
|
|
@@ -8435,19 +8712,7 @@ const ContentImpl$1 = styled(AlertDialog.Content)`
|
|
|
8435
8712
|
}
|
|
8436
8713
|
`;
|
|
8437
8714
|
const Header$1 = React.forwardRef(({ children, ...restProps }, forwardedRef) => {
|
|
8438
|
-
return /* @__PURE__ */ jsx(AlertDialog.Title, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
8439
|
-
Title$1,
|
|
8440
|
-
{
|
|
8441
|
-
tag: "h2",
|
|
8442
|
-
ref: forwardedRef,
|
|
8443
|
-
padding: 6,
|
|
8444
|
-
justifyContent: "center",
|
|
8445
|
-
variant: "h2",
|
|
8446
|
-
fontWeight: "bold",
|
|
8447
|
-
...restProps,
|
|
8448
|
-
children
|
|
8449
|
-
}
|
|
8450
|
-
) });
|
|
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 }) });
|
|
8451
8716
|
});
|
|
8452
8717
|
const Title$1 = styled(Typography)`
|
|
8453
8718
|
display: flex;
|
|
@@ -8621,8 +8886,7 @@ ${css`
|
|
|
8621
8886
|
img,
|
|
8622
8887
|
picture,
|
|
8623
8888
|
video,
|
|
8624
|
-
canvas
|
|
8625
|
-
svg {
|
|
8889
|
+
canvas {
|
|
8626
8890
|
display: block;
|
|
8627
8891
|
max-width: 100%;
|
|
8628
8892
|
}
|
|
@@ -8737,7 +9001,7 @@ const Portal$1 = React.forwardRef(
|
|
|
8737
9001
|
);
|
|
8738
9002
|
Portal$1.displayName = "Portal";
|
|
8739
9003
|
const SelectTrigger = React.forwardRef(
|
|
8740
|
-
({ onClear, clearLabel = "Clear", startIcon, disabled, hasError, children, id, ...restProps }, ref) => {
|
|
9004
|
+
({ onClear, clearLabel = "Clear", startIcon, disabled, hasError, children, id, size = "M", withTags, ...restProps }, ref) => {
|
|
8741
9005
|
const triggerRef = React.useRef(null);
|
|
8742
9006
|
const handleClearClick = (e) => {
|
|
8743
9007
|
if (onClear && !disabled) {
|
|
@@ -8759,17 +9023,15 @@ const SelectTrigger = React.forwardRef(
|
|
|
8759
9023
|
overflow: "hidden",
|
|
8760
9024
|
hasRadius: true,
|
|
8761
9025
|
background: disabled ? "neutral150" : "neutral0",
|
|
8762
|
-
paddingLeft: 3,
|
|
8763
|
-
paddingRight: 3,
|
|
8764
|
-
paddingTop: 2,
|
|
8765
|
-
paddingBottom: 2,
|
|
8766
9026
|
gap: 4,
|
|
8767
9027
|
cursor: "default",
|
|
8768
9028
|
"aria-labelledby": labelNode ? `${id}-label` : void 0,
|
|
9029
|
+
$size: size,
|
|
9030
|
+
$withTags: withTags,
|
|
8769
9031
|
...restProps,
|
|
8770
9032
|
children: [
|
|
8771
9033
|
/* @__PURE__ */ jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
|
|
8772
|
-
startIcon && /* @__PURE__ */ jsx(
|
|
9034
|
+
startIcon && /* @__PURE__ */ jsx(Flex, { tag: "span", "aria-hidden": true, children: startIcon }),
|
|
8773
9035
|
children
|
|
8774
9036
|
] }),
|
|
8775
9037
|
/* @__PURE__ */ jsxs(Flex, { tag: "span", gap: 3, children: [
|
|
@@ -8798,6 +9060,7 @@ const SelectTrigger = React.forwardRef(
|
|
|
8798
9060
|
);
|
|
8799
9061
|
const IconBox$2 = styled(Box)`
|
|
8800
9062
|
border: none;
|
|
9063
|
+
display: flex;
|
|
8801
9064
|
|
|
8802
9065
|
svg {
|
|
8803
9066
|
height: 1.1rem;
|
|
@@ -8805,14 +9068,30 @@ const IconBox$2 = styled(Box)`
|
|
|
8805
9068
|
}
|
|
8806
9069
|
|
|
8807
9070
|
svg path {
|
|
8808
|
-
fill: ${({ theme }) => theme.colors.
|
|
9071
|
+
fill: ${({ theme }) => theme.colors.neutral500};
|
|
8809
9072
|
}
|
|
8810
9073
|
`;
|
|
8811
9074
|
const StyledTrigger = styled(Flex)`
|
|
8812
9075
|
border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
|
9076
|
+
${(props) => {
|
|
9077
|
+
switch (props.$size) {
|
|
9078
|
+
case "S":
|
|
9079
|
+
return css`
|
|
9080
|
+
padding-block: ${props.theme.spaces[1]};
|
|
9081
|
+
padding-inline-start: ${props.$withTags ? props.theme.spaces[1] : props.theme.spaces[4]};
|
|
9082
|
+
padding-inline-end: ${props.theme.spaces[3]};
|
|
9083
|
+
`;
|
|
9084
|
+
default:
|
|
9085
|
+
return css`
|
|
9086
|
+
padding-block: ${props.$withTags ? "0.3rem" : props.theme.spaces[2]};
|
|
9087
|
+
padding-inline-start: ${props.$withTags ? props.theme.spaces[1] : props.theme.spaces[4]};
|
|
9088
|
+
padding-inline-end: ${props.theme.spaces[3]};
|
|
9089
|
+
`;
|
|
9090
|
+
}
|
|
9091
|
+
}}
|
|
8813
9092
|
|
|
8814
9093
|
&[aria-disabled='true'] {
|
|
8815
|
-
color: ${(props) => props.theme.colors.
|
|
9094
|
+
color: ${(props) => props.theme.colors.neutral500};
|
|
8816
9095
|
}
|
|
8817
9096
|
|
|
8818
9097
|
/* Required to ensure the below inputFocusStyles are adhered too */
|
|
@@ -8823,8 +9102,9 @@ const StyledTrigger = styled(Flex)`
|
|
|
8823
9102
|
${({ theme, $hasError }) => inputFocusStyle()({ theme, $hasError })};
|
|
8824
9103
|
`;
|
|
8825
9104
|
const DownIcon = styled(Select.Icon)`
|
|
9105
|
+
display: flex;
|
|
8826
9106
|
& > svg {
|
|
8827
|
-
fill: ${({ theme }) => theme.colors.
|
|
9107
|
+
fill: ${({ theme }) => theme.colors.neutral500};
|
|
8828
9108
|
}
|
|
8829
9109
|
`;
|
|
8830
9110
|
const SelectValue = React.forwardRef(({ children, placeholder, ...restProps }, ref) => /* @__PURE__ */ jsx(ValueType, { ref, ellipsis: true, ...restProps, children: /* @__PURE__ */ jsx(StyledValue, { placeholder, children }) }));
|
|
@@ -8844,8 +9124,7 @@ const SelectContent = styled(Select.Content)`
|
|
|
8844
9124
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
8845
9125
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
8846
9126
|
min-width: var(--radix-select-trigger-width);
|
|
8847
|
-
|
|
8848
|
-
max-height: 15rem;
|
|
9127
|
+
max-height: 15.6rem;
|
|
8849
9128
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
8850
9129
|
|
|
8851
9130
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -8856,11 +9135,11 @@ const SelectContent = styled(Select.Content)`
|
|
|
8856
9135
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8857
9136
|
|
|
8858
9137
|
&[data-side='top'] {
|
|
8859
|
-
animation-name: ${ANIMATIONS.
|
|
9138
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
8860
9139
|
}
|
|
8861
9140
|
|
|
8862
9141
|
&[data-side='bottom'] {
|
|
8863
|
-
animation-name: ${ANIMATIONS.
|
|
9142
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
8864
9143
|
}
|
|
8865
9144
|
}
|
|
8866
9145
|
}
|
|
@@ -8929,6 +9208,7 @@ const SingleSelect = React.forwardRef(
|
|
|
8929
9208
|
onReachEnd,
|
|
8930
9209
|
placeholder,
|
|
8931
9210
|
required: requiredProp,
|
|
9211
|
+
size,
|
|
8932
9212
|
startIcon,
|
|
8933
9213
|
value: passedValue,
|
|
8934
9214
|
...restProps
|
|
@@ -9004,6 +9284,7 @@ const SingleSelect = React.forwardRef(
|
|
|
9004
9284
|
onClear: value && onClear ? handleOnClear : void 0,
|
|
9005
9285
|
"aria-label": restProps["aria-label"],
|
|
9006
9286
|
"aria-describedby": ariaDescription ?? restProps["aria-describedby"],
|
|
9287
|
+
size,
|
|
9007
9288
|
children: /* @__PURE__ */ jsx(Value, { placeholder, textColor: value ? "neutral800" : "neutral600", children: value && customizeContent ? customizeContent(value) : void 0 })
|
|
9008
9289
|
}
|
|
9009
9290
|
),
|
|
@@ -9020,7 +9301,7 @@ const SingleSelectOption = React.forwardRef(
|
|
|
9020
9301
|
({ value, startIcon, children, ...restProps }, ref) => {
|
|
9021
9302
|
return /* @__PURE__ */ jsxs(Item$2, { ref, value: value.toString(), ...restProps, children: [
|
|
9022
9303
|
startIcon && /* @__PURE__ */ jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
|
|
9023
|
-
/* @__PURE__ */ jsx(Typography, { children: /* @__PURE__ */ jsx(ItemText, { children }) })
|
|
9304
|
+
/* @__PURE__ */ jsx(Typography, { lineHeight: "20px", children: /* @__PURE__ */ jsx(ItemText, { children }) })
|
|
9024
9305
|
] });
|
|
9025
9306
|
}
|
|
9026
9307
|
);
|
|
@@ -9052,6 +9333,7 @@ const DatePicker$1 = React.forwardRef(
|
|
|
9052
9333
|
required: requiredProp = false,
|
|
9053
9334
|
onClear,
|
|
9054
9335
|
clearLabel = "Clear",
|
|
9336
|
+
size = "M",
|
|
9055
9337
|
...restProps
|
|
9056
9338
|
}, ref) => {
|
|
9057
9339
|
const timeZone = getLocalTimeZone();
|
|
@@ -9162,7 +9444,7 @@ const DatePicker$1 = React.forwardRef(
|
|
|
9162
9444
|
trigger,
|
|
9163
9445
|
value,
|
|
9164
9446
|
children: [
|
|
9165
|
-
/* @__PURE__ */ jsxs(DatePickerTrigger, { className, hasError, children: [
|
|
9447
|
+
/* @__PURE__ */ jsxs(DatePickerTrigger, { className, hasError, size, children: [
|
|
9166
9448
|
/* @__PURE__ */ jsx(Calendar, { fill: "neutral500", "aria-hidden": true }),
|
|
9167
9449
|
/* @__PURE__ */ jsx(DatePickerTextInput, { ref, "aria-describedby": ariaDescription, id, name, ...restProps }),
|
|
9168
9450
|
textValue && onClear ? /* @__PURE__ */ jsx(
|
|
@@ -9208,7 +9490,7 @@ const makeInitialCalendarDate = ({ currentValue, minDate: minDate$1, maxDate: ma
|
|
|
9208
9490
|
};
|
|
9209
9491
|
const DATE_PICKER_TRIGGER_NAME = "DatePickerTrigger";
|
|
9210
9492
|
const DatePickerTrigger = React.forwardRef(
|
|
9211
|
-
({ hasError, ...restProps }, forwardedRef) => {
|
|
9493
|
+
({ hasError, size, ...restProps }, forwardedRef) => {
|
|
9212
9494
|
const context = useDatePickerContext(DATE_PICKER_TRIGGER_NAME);
|
|
9213
9495
|
const composedRefs = useComposedRefs(forwardedRef, (node) => context.onTriggerChange(node));
|
|
9214
9496
|
const handleOpenChange = () => {
|
|
@@ -9233,9 +9515,8 @@ const DatePickerTrigger = React.forwardRef(
|
|
|
9233
9515
|
{
|
|
9234
9516
|
ref: composedRefs,
|
|
9235
9517
|
$hasError: hasError,
|
|
9518
|
+
$size: size,
|
|
9236
9519
|
...restProps,
|
|
9237
|
-
paddingLeft: 3,
|
|
9238
|
-
paddingRight: 3,
|
|
9239
9520
|
hasRadius: true,
|
|
9240
9521
|
gap: 3,
|
|
9241
9522
|
overflow: "hidden",
|
|
@@ -9265,7 +9546,20 @@ const DatePickerTrigger = React.forwardRef(
|
|
|
9265
9546
|
);
|
|
9266
9547
|
const TriggerElement = styled(Flex)`
|
|
9267
9548
|
border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
|
9268
|
-
|
|
9549
|
+
${(props) => {
|
|
9550
|
+
switch (props.$size) {
|
|
9551
|
+
case "S":
|
|
9552
|
+
return css`
|
|
9553
|
+
padding-block: ${props.theme.spaces[1]};
|
|
9554
|
+
padding-inline: ${props.theme.spaces[3]};
|
|
9555
|
+
`;
|
|
9556
|
+
default:
|
|
9557
|
+
return css`
|
|
9558
|
+
padding-block: ${props.theme.spaces[2]};
|
|
9559
|
+
padding-inline: ${props.theme.spaces[3]};
|
|
9560
|
+
`;
|
|
9561
|
+
}
|
|
9562
|
+
}}
|
|
9269
9563
|
|
|
9270
9564
|
& > svg {
|
|
9271
9565
|
flex: 1 0 auto;
|
|
@@ -9503,7 +9797,7 @@ const DatePickerContentImpl = React.forwardRef(
|
|
|
9503
9797
|
(props, forwardedRef) => {
|
|
9504
9798
|
const { label = "Choose date", ...restProps } = props;
|
|
9505
9799
|
const { onOpenChange, ...context } = useDatePickerContext(CONTENT_IMPL_NAME);
|
|
9506
|
-
const { x, y, refs, strategy } = useFloating({
|
|
9800
|
+
const { x, y, refs, strategy, placement } = useFloating({
|
|
9507
9801
|
strategy: "fixed",
|
|
9508
9802
|
placement: "bottom-start",
|
|
9509
9803
|
middleware: [
|
|
@@ -9550,6 +9844,7 @@ const DatePickerContentImpl = React.forwardRef(
|
|
|
9550
9844
|
{
|
|
9551
9845
|
ref: composedRefs,
|
|
9552
9846
|
"data-state": context.open ? "open" : "closed",
|
|
9847
|
+
"data-side": placement.includes("top") ? "top" : "bottom",
|
|
9553
9848
|
onContextMenu: (event) => event.preventDefault(),
|
|
9554
9849
|
id: context.contentId,
|
|
9555
9850
|
role: "dialog",
|
|
@@ -9574,6 +9869,22 @@ const ContentElement = styled(Box)`
|
|
|
9574
9869
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
|
9575
9870
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
9576
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
|
+
}
|
|
9577
9888
|
`;
|
|
9578
9889
|
const DATE_PICKER_CALENDAR_NAME = "DatePickerCalendar";
|
|
9579
9890
|
const DatePickerCalendar = React.forwardRef(
|
|
@@ -9882,6 +10193,7 @@ const DateTimePicker = React.forwardRef(
|
|
|
9882
10193
|
step,
|
|
9883
10194
|
value,
|
|
9884
10195
|
initialDate,
|
|
10196
|
+
size,
|
|
9885
10197
|
...props
|
|
9886
10198
|
}, forwardedRef) => {
|
|
9887
10199
|
const DatePickerElement2 = React.useRef(null);
|
|
@@ -9941,6 +10253,7 @@ const DateTimePicker = React.forwardRef(
|
|
|
9941
10253
|
DatePicker,
|
|
9942
10254
|
{
|
|
9943
10255
|
...props,
|
|
10256
|
+
size,
|
|
9944
10257
|
value: dateValue?.toDate("UTC"),
|
|
9945
10258
|
onChange: handleDateChange,
|
|
9946
10259
|
required,
|
|
@@ -9954,6 +10267,7 @@ const DateTimePicker = React.forwardRef(
|
|
|
9954
10267
|
/* @__PURE__ */ jsx(Root$6, { children: /* @__PURE__ */ jsx(
|
|
9955
10268
|
TimePicker,
|
|
9956
10269
|
{
|
|
10270
|
+
size,
|
|
9957
10271
|
hasError,
|
|
9958
10272
|
value: timeValue,
|
|
9959
10273
|
onChange: handleTimeChange,
|
|
@@ -10000,238 +10314,27 @@ const EmptyStateIconWrapper = styled(Box)`
|
|
|
10000
10314
|
height: 8.8rem;
|
|
10001
10315
|
}
|
|
10002
10316
|
`;
|
|
10003
|
-
const EmptyStateLayout = (
|
|
10004
|
-
icon,
|
|
10005
|
-
|
|
10006
|
-
|
|
10007
|
-
hasRadius = true,
|
|
10008
|
-
shadow = "tableShadow"
|
|
10009
|
-
}) => {
|
|
10010
|
-
return /* @__PURE__ */ jsxs(
|
|
10011
|
-
Flex,
|
|
10012
|
-
{
|
|
10013
|
-
alignItems: "center",
|
|
10014
|
-
direction: "column",
|
|
10015
|
-
padding: 11,
|
|
10016
|
-
background: "neutral0",
|
|
10017
|
-
hasRadius,
|
|
10018
|
-
shadow,
|
|
10019
|
-
children: [
|
|
10020
|
-
icon ? /* @__PURE__ */ jsx(EmptyStateIconWrapper, { paddingBottom: 6, "aria-hidden": true, children: icon }) : null,
|
|
10021
|
-
/* @__PURE__ */ jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsx(Typography, { variant: "delta", tag: "p", textAlign: "center", textColor: "neutral600", children: content }) }),
|
|
10022
|
-
action
|
|
10023
|
-
]
|
|
10024
|
-
}
|
|
10025
|
-
);
|
|
10026
|
-
};
|
|
10027
|
-
const getFocusableNodes = (node, includeNegativeTabIndex) => {
|
|
10028
|
-
const nodes = [
|
|
10029
|
-
...node.querySelectorAll(
|
|
10030
|
-
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
10031
|
-
)
|
|
10032
|
-
];
|
|
10033
|
-
const focusables = nodes.filter((node2) => {
|
|
10034
|
-
if (node2.hasAttribute("disabled"))
|
|
10035
|
-
return false;
|
|
10036
|
-
if (includeNegativeTabIndex)
|
|
10037
|
-
return true;
|
|
10038
|
-
return node2.getAttribute("tabindex") !== "-1";
|
|
10039
|
-
});
|
|
10040
|
-
return focusables;
|
|
10041
|
-
};
|
|
10042
|
-
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
10043
|
-
return nodes.filter((node) => {
|
|
10044
|
-
if (node.tagName === "INPUT") {
|
|
10045
|
-
return node.type !== "checkbox" && node.type !== "radio";
|
|
10046
|
-
}
|
|
10047
|
-
return false;
|
|
10048
|
-
});
|
|
10049
|
-
};
|
|
10050
|
-
const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
|
|
10051
|
-
const trappedRef = React.useRef(null);
|
|
10052
|
-
React.useEffect(() => {
|
|
10053
|
-
let currentFocus = null;
|
|
10054
|
-
if (restoreFocus) {
|
|
10055
|
-
currentFocus = document.activeElement;
|
|
10056
|
-
}
|
|
10057
|
-
return () => {
|
|
10058
|
-
if (currentFocus) {
|
|
10059
|
-
currentFocus.focus();
|
|
10060
|
-
}
|
|
10061
|
-
};
|
|
10062
|
-
}, [restoreFocus]);
|
|
10063
|
-
React.useEffect(() => {
|
|
10064
|
-
if (!trappedRef.current || skipAutoFocus)
|
|
10065
|
-
return;
|
|
10066
|
-
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
10067
|
-
if (focusableChildren.length > 0) {
|
|
10068
|
-
const firstElement = focusableChildren[0];
|
|
10069
|
-
firstElement.focus();
|
|
10070
|
-
} else {
|
|
10071
|
-
console.warn(
|
|
10072
|
-
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
10073
|
-
);
|
|
10074
|
-
}
|
|
10075
|
-
}, [skipAutoFocus]);
|
|
10076
|
-
const handleKeyDown = (e) => {
|
|
10077
|
-
if (e.key === KeyboardKeys.ESCAPE && onEscape) {
|
|
10078
|
-
onEscape();
|
|
10079
|
-
return;
|
|
10080
|
-
}
|
|
10081
|
-
if (e.key !== KeyboardKeys.TAB)
|
|
10082
|
-
return;
|
|
10083
|
-
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
10084
|
-
if (focusableChildren.length > 0) {
|
|
10085
|
-
const firstElement = focusableChildren[0];
|
|
10086
|
-
const lastElement = focusableChildren[focusableChildren.length - 1];
|
|
10087
|
-
if (e.shiftKey) {
|
|
10088
|
-
if (firstElement === document.activeElement) {
|
|
10089
|
-
e.preventDefault();
|
|
10090
|
-
lastElement.focus();
|
|
10091
|
-
}
|
|
10092
|
-
} else if (lastElement === document.activeElement) {
|
|
10093
|
-
e.preventDefault();
|
|
10094
|
-
firstElement.focus();
|
|
10095
|
-
}
|
|
10096
|
-
}
|
|
10097
|
-
};
|
|
10098
|
-
return /* @__PURE__ */ jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
|
|
10099
|
-
};
|
|
10100
|
-
const Root$3 = forwardRef((props, forwardedRef) => {
|
|
10101
|
-
const { gap = 0, gridCols = 12, ...rest } = props;
|
|
10102
|
-
return /* @__PURE__ */ jsx(Wrapper$1, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
|
|
10103
|
-
});
|
|
10104
|
-
const Wrapper$1 = styled(Box)`
|
|
10105
|
-
display: grid;
|
|
10106
|
-
grid-template-columns: repeat(${({ $gridCols }) => $gridCols}, 1fr);
|
|
10107
|
-
${({ theme, $gap }) => handleResponsiveValues("gap", $gap, theme)}
|
|
10108
|
-
`;
|
|
10109
|
-
const ItemImpl = forwardRef(
|
|
10110
|
-
({ col, s, xs, ...props }, forwardedRef) => /* @__PURE__ */ jsx(Item$1, { ref: forwardedRef, $col: col, $s: s, $xs: xs, ...props })
|
|
10111
|
-
);
|
|
10112
|
-
const Item$1 = styled(Box)`
|
|
10113
|
-
grid-column: span ${({ $col }) => $col ?? 1};
|
|
10114
|
-
max-width: 100%;
|
|
10115
|
-
|
|
10116
|
-
${({ theme }) => theme.mediaQueries.tablet} {
|
|
10117
|
-
grid-column: span ${({ $s }) => $s};
|
|
10118
|
-
}
|
|
10119
|
-
|
|
10120
|
-
${({ theme }) => theme.mediaQueries.mobile} {
|
|
10121
|
-
grid-column: span ${({ $xs }) => $xs};
|
|
10122
|
-
}
|
|
10123
|
-
`;
|
|
10124
|
-
const Grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10125
|
-
__proto__: null,
|
|
10126
|
-
Item: ItemImpl,
|
|
10127
|
-
Root: Root$3
|
|
10128
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
10129
|
-
const VARIANT_DEFAULT = "tertiary";
|
|
10130
|
-
const VARIANT_SECONDARY = "secondary";
|
|
10131
|
-
const SIZES = ["S", "M", "L"];
|
|
10132
|
-
const VARIANTS = [VARIANT_DEFAULT, VARIANT_SECONDARY];
|
|
10133
|
-
const IconButton = forwardRef(
|
|
10134
|
-
({
|
|
10135
|
-
label,
|
|
10136
|
-
background,
|
|
10137
|
-
children,
|
|
10138
|
-
disabled = false,
|
|
10139
|
-
onClick,
|
|
10140
|
-
size = SIZES[0],
|
|
10141
|
-
variant: variant2 = VARIANTS[0],
|
|
10142
|
-
withTooltip = true,
|
|
10143
|
-
...restProps
|
|
10144
|
-
}, ref) => {
|
|
10145
|
-
const handleClick = (e) => {
|
|
10146
|
-
if (!disabled && onClick) {
|
|
10147
|
-
onClick(e);
|
|
10148
|
-
}
|
|
10149
|
-
};
|
|
10150
|
-
const component = /* @__PURE__ */ jsx(
|
|
10151
|
-
IconButtonWrapper,
|
|
10317
|
+
const EmptyStateLayout = React.forwardRef(
|
|
10318
|
+
({ icon, content, action, hasRadius = true, shadow = "tableShadow" }, forwardedRef) => {
|
|
10319
|
+
return /* @__PURE__ */ jsxs(
|
|
10320
|
+
Flex,
|
|
10152
10321
|
{
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
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
|
+
]
|
|
10162
10334
|
}
|
|
10163
10335
|
);
|
|
10164
|
-
return withTooltip ? /* @__PURE__ */ jsx(TooltipImpl, { label, children: component }) : component;
|
|
10165
10336
|
}
|
|
10166
10337
|
);
|
|
10167
|
-
const IconButtonWrapper = styled(BaseButton)`
|
|
10168
|
-
background-color: ${({ theme, $variant }) => {
|
|
10169
|
-
if ($variant === VARIANT_SECONDARY) {
|
|
10170
|
-
return theme.colors.primary100;
|
|
10171
|
-
}
|
|
10172
|
-
return void 0;
|
|
10173
|
-
}};
|
|
10174
|
-
border-color: ${({ theme, $variant }) => {
|
|
10175
|
-
if ($variant === VARIANT_SECONDARY) {
|
|
10176
|
-
return theme.colors.primary200;
|
|
10177
|
-
}
|
|
10178
|
-
return theme.colors.neutral200;
|
|
10179
|
-
}};
|
|
10180
|
-
height: ${({ theme, $size }) => theme.sizes.button[$size]};
|
|
10181
|
-
width: ${({ theme, $size }) => theme.sizes.button[$size]};
|
|
10182
|
-
color: ${({ theme, $variant }) => {
|
|
10183
|
-
if ($variant === VARIANT_SECONDARY) {
|
|
10184
|
-
return theme.colors.primary500;
|
|
10185
|
-
}
|
|
10186
|
-
return theme.colors.neutral500;
|
|
10187
|
-
}};
|
|
10188
|
-
|
|
10189
|
-
&:hover,
|
|
10190
|
-
&:focus {
|
|
10191
|
-
color: ${({ theme, $variant }) => {
|
|
10192
|
-
if ($variant === VARIANT_SECONDARY) {
|
|
10193
|
-
return theme.colors.primary600;
|
|
10194
|
-
}
|
|
10195
|
-
return theme.colors.neutral600;
|
|
10196
|
-
}};
|
|
10197
|
-
}
|
|
10198
|
-
|
|
10199
|
-
&[aria-disabled='true'] {
|
|
10200
|
-
color: ${({ theme }) => theme.colors.neutral600};
|
|
10201
|
-
}
|
|
10202
|
-
`;
|
|
10203
|
-
const IconButtonGroup = styled(Flex)`
|
|
10204
|
-
& ${IconButtonWrapper}:first-child {
|
|
10205
|
-
border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
|
|
10206
|
-
}
|
|
10207
|
-
|
|
10208
|
-
& ${IconButtonWrapper}:last-child {
|
|
10209
|
-
border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
|
|
10210
|
-
}
|
|
10211
|
-
|
|
10212
|
-
& ${IconButtonWrapper} {
|
|
10213
|
-
border-radius: 0;
|
|
10214
|
-
color: ${({ theme }) => theme.colors.neutral700};
|
|
10215
|
-
|
|
10216
|
-
& + ${IconButtonWrapper} {
|
|
10217
|
-
border-left: none;
|
|
10218
|
-
}
|
|
10219
|
-
|
|
10220
|
-
&:hover {
|
|
10221
|
-
background-color: ${({ theme }) => theme.colors.neutral100};
|
|
10222
|
-
color: ${({ theme }) => theme.colors.neutral800};
|
|
10223
|
-
}
|
|
10224
|
-
|
|
10225
|
-
&:active {
|
|
10226
|
-
background-color: ${({ theme }) => theme.colors.neutral150};
|
|
10227
|
-
color: ${({ theme }) => theme.colors.neutral900};
|
|
10228
|
-
}
|
|
10229
|
-
|
|
10230
|
-
&[aria-disabled='true'] {
|
|
10231
|
-
color: ${({ theme }) => theme.colors.neutral600};
|
|
10232
|
-
}
|
|
10233
|
-
}
|
|
10234
|
-
`;
|
|
10235
10338
|
const addMarks = StateEffect.define();
|
|
10236
10339
|
const filterMarks = StateEffect.define();
|
|
10237
10340
|
const lineHighlightMark = Decoration.mark({
|
|
@@ -10409,72 +10512,29 @@ const JSONInputContainer = styled(Flex)`
|
|
|
10409
10512
|
}
|
|
10410
10513
|
`;
|
|
10411
10514
|
const LinkButton = forwardRef(
|
|
10412
|
-
({
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
return /* @__PURE__ */ jsxs(
|
|
10416
|
-
LinkWrapper$1,
|
|
10515
|
+
({ disabled, ...restProps }, ref) => {
|
|
10516
|
+
return /* @__PURE__ */ jsx(
|
|
10517
|
+
Button,
|
|
10417
10518
|
{
|
|
10418
10519
|
ref,
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
hasRadius: true,
|
|
10424
|
-
display: "inline-flex",
|
|
10425
|
-
paddingBottom: paddingX,
|
|
10426
|
-
paddingLeft: paddingY,
|
|
10427
|
-
paddingRight: paddingY,
|
|
10428
|
-
paddingTop: paddingX,
|
|
10429
|
-
pointerEvents: disabled ? "none" : void 0,
|
|
10430
|
-
...props,
|
|
10431
|
-
children: [
|
|
10432
|
-
startIcon && /* @__PURE__ */ jsx(Flex, { "aria-hidden": true, children: startIcon }),
|
|
10433
|
-
/* @__PURE__ */ jsx(Typography, { variant: size === "S" ? "pi" : void 0, fontWeight: "bold", textColor: "buttonNeutral0", children }),
|
|
10434
|
-
endIcon && /* @__PURE__ */ jsx(Flex, { "aria-hidden": true, children: endIcon })
|
|
10435
|
-
]
|
|
10520
|
+
tag: BaseLinkImpl,
|
|
10521
|
+
tabIndex: disabled ? -1 : void 0,
|
|
10522
|
+
disabled,
|
|
10523
|
+
...restProps
|
|
10436
10524
|
}
|
|
10437
10525
|
);
|
|
10438
10526
|
}
|
|
10439
10527
|
);
|
|
10440
|
-
const
|
|
10441
|
-
|
|
10442
|
-
|
|
10443
|
-
|
|
10444
|
-
|
|
10445
|
-
&[aria-disabled='true'] {
|
|
10446
|
-
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;
|
|
10447
10532
|
}
|
|
10448
|
-
|
|
10449
|
-
|
|
10450
|
-
|
|
10451
|
-
|
|
10452
|
-
|
|
10453
|
-
&:active {
|
|
10454
|
-
${getDisabledStyle}
|
|
10455
|
-
}
|
|
10456
|
-
}
|
|
10457
|
-
|
|
10458
|
-
&:hover {
|
|
10459
|
-
${getHoverStyle}
|
|
10460
|
-
}
|
|
10461
|
-
|
|
10462
|
-
&:active {
|
|
10463
|
-
${getActiveStyle}
|
|
10464
|
-
}
|
|
10465
|
-
|
|
10466
|
-
${getVariantStyle}
|
|
10467
|
-
`;
|
|
10468
|
-
const MainWrapper = styled(Box)`
|
|
10469
|
-
// To prevent global outline on focus visible to force an outline when Main is focused
|
|
10470
|
-
&:focus-visible {
|
|
10471
|
-
outline: none;
|
|
10472
|
-
}
|
|
10473
|
-
`;
|
|
10474
|
-
const Main = ({ labelledBy = "main-content-title", ...props }) => {
|
|
10475
|
-
return /* @__PURE__ */ jsx(MainWrapper, { "aria-labelledby": labelledBy, tag: "main", id: "main-content", tabIndex: -1, ...props });
|
|
10476
|
-
};
|
|
10477
|
-
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)`
|
|
10478
10538
|
text-decoration: none;
|
|
10479
10539
|
|
|
10480
10540
|
&:focus {
|
|
@@ -10500,6 +10560,7 @@ const SkipToContent = ({ children }) => {
|
|
|
10500
10560
|
}
|
|
10501
10561
|
);
|
|
10502
10562
|
};
|
|
10563
|
+
const setOpacity = (hex, alpha) => `${hex}${Math.floor(alpha * 255).toString(16).padStart(2, "0")}`;
|
|
10503
10564
|
const ScrollAreaImpl$1 = React.forwardRef(
|
|
10504
10565
|
({ children, viewportRef, ...restProps }, forwardedRef) => {
|
|
10505
10566
|
return /* @__PURE__ */ jsxs(ScrollAreaRoot, { ref: forwardedRef, ...restProps, children: [
|
|
@@ -10517,7 +10578,7 @@ const ScrollAreaRoot = styled(ScrollArea.Root)`
|
|
|
10517
10578
|
`;
|
|
10518
10579
|
const ScrollAreaViewport = styled(ScrollArea.Viewport)`
|
|
10519
10580
|
min-width: 100%;
|
|
10520
|
-
padding-inline
|
|
10581
|
+
padding-inline: 4px;
|
|
10521
10582
|
`;
|
|
10522
10583
|
const Scrollbar = styled(ScrollArea.Scrollbar)`
|
|
10523
10584
|
display: flex;
|
|
@@ -10554,22 +10615,18 @@ const Thumb = styled(ScrollArea.Thumb)`
|
|
|
10554
10615
|
min-height: 44px;
|
|
10555
10616
|
}
|
|
10556
10617
|
`;
|
|
10557
|
-
const Root$
|
|
10618
|
+
const Root$3 = Dialog$1.Root;
|
|
10558
10619
|
const Trigger$2 = React.forwardRef((props, forwardedRef) => {
|
|
10559
10620
|
return /* @__PURE__ */ jsx(Dialog$1.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
10560
10621
|
});
|
|
10561
10622
|
const Content$2 = React.forwardRef((props, forwardedRef) => {
|
|
10562
|
-
return /* @__PURE__ */
|
|
10563
|
-
/* @__PURE__ */ jsx(Overlay, {}),
|
|
10564
|
-
/* @__PURE__ */ jsx(ContentImpl, { ref: forwardedRef, ...props })
|
|
10565
|
-
] });
|
|
10623
|
+
return /* @__PURE__ */ jsx(Dialog$1.Portal, { children: /* @__PURE__ */ jsx(Overlay, { children: /* @__PURE__ */ jsx(ContentImpl, { ref: forwardedRef, ...props }) }) });
|
|
10566
10624
|
});
|
|
10567
10625
|
const Overlay = styled(Dialog$1.Overlay)`
|
|
10568
|
-
background
|
|
10626
|
+
background: ${(props) => setOpacity(props.theme.colors.neutral800, 0.2)};
|
|
10569
10627
|
position: fixed;
|
|
10570
10628
|
inset: 0;
|
|
10571
10629
|
z-index: ${(props) => props.theme.zIndices.overlay};
|
|
10572
|
-
opacity: 0.2;
|
|
10573
10630
|
|
|
10574
10631
|
@media (prefers-reduced-motion: no-preference) {
|
|
10575
10632
|
animation: ${ANIMATIONS.overlayFadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
@@ -10578,8 +10635,8 @@ const Overlay = styled(Dialog$1.Overlay)`
|
|
|
10578
10635
|
`;
|
|
10579
10636
|
const ContentImpl = styled(Dialog$1.Content)`
|
|
10580
10637
|
max-width: 83rem;
|
|
10581
|
-
max-height:
|
|
10582
|
-
height:
|
|
10638
|
+
max-height: 90vh;
|
|
10639
|
+
height: auto;
|
|
10583
10640
|
width: 60%;
|
|
10584
10641
|
overflow: hidden;
|
|
10585
10642
|
margin: 0 auto;
|
|
@@ -10681,7 +10738,7 @@ const Modal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
10681
10738
|
Content: Content$2,
|
|
10682
10739
|
Footer,
|
|
10683
10740
|
Header,
|
|
10684
|
-
Root: Root$
|
|
10741
|
+
Root: Root$3,
|
|
10685
10742
|
Title,
|
|
10686
10743
|
Trigger: Trigger$2
|
|
10687
10744
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -10764,7 +10821,7 @@ const NumberInput = React.forwardRef(
|
|
|
10764
10821
|
onKeyDown: handleKeyDown,
|
|
10765
10822
|
onBlur: handleBlur,
|
|
10766
10823
|
value: inputValue,
|
|
10767
|
-
endAction: /* @__PURE__ */ jsxs(
|
|
10824
|
+
endAction: /* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
|
|
10768
10825
|
/* @__PURE__ */ jsx(
|
|
10769
10826
|
ArrowButton,
|
|
10770
10827
|
{
|
|
@@ -10798,13 +10855,14 @@ const NumberInput = React.forwardRef(
|
|
|
10798
10855
|
);
|
|
10799
10856
|
const ArrowButton = styled.button`
|
|
10800
10857
|
display: flex;
|
|
10801
|
-
|
|
10802
|
-
align-items:
|
|
10858
|
+
justify-content: center;
|
|
10859
|
+
align-items: center;
|
|
10803
10860
|
transform: translateY(${({ $reverse }) => $reverse ? `-2px` : `2px`});
|
|
10804
10861
|
cursor: ${({ disabled }) => disabled ? "not-allowed" : void 0};
|
|
10862
|
+
height: 1.1rem;
|
|
10863
|
+
|
|
10805
10864
|
svg {
|
|
10806
|
-
|
|
10807
|
-
height: 0.4rem;
|
|
10865
|
+
width: 1.2rem;
|
|
10808
10866
|
transform: ${({ $reverse }) => $reverse ? "rotateX(180deg)" : void 0};
|
|
10809
10867
|
}
|
|
10810
10868
|
`;
|
|
@@ -10867,7 +10925,7 @@ const NextLink = forwardRef(
|
|
|
10867
10925
|
] });
|
|
10868
10926
|
}
|
|
10869
10927
|
);
|
|
10870
|
-
const LinkWrapper = styled(
|
|
10928
|
+
const LinkWrapper = styled(BaseLinkImpl)`
|
|
10871
10929
|
padding: ${({ theme }) => theme.spaces[3]};
|
|
10872
10930
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
10873
10931
|
box-shadow: ${({ $active, theme }) => $active ? theme.shadows.filterShadow : void 0};
|
|
@@ -10916,7 +10974,7 @@ const Dots = ({ children, ...props }) => /* @__PURE__ */ jsxs(Box, { ...props, c
|
|
|
10916
10974
|
/* @__PURE__ */ jsx(VisuallyHidden, { children }),
|
|
10917
10975
|
/* @__PURE__ */ jsx(Typography, { "aria-hidden": true, lineHeight: "revert", textColor: "neutral800", variant: "pi", children: "…" })
|
|
10918
10976
|
] });
|
|
10919
|
-
const Root$
|
|
10977
|
+
const Root$2 = Popover$1.Root;
|
|
10920
10978
|
const Trigger$1 = React.forwardRef((props, forwardedRef) => {
|
|
10921
10979
|
return /* @__PURE__ */ jsx(Popover$1.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
10922
10980
|
});
|
|
@@ -10928,6 +10986,7 @@ const PopoverContent = styled(Popover$1.Content)`
|
|
|
10928
10986
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
10929
10987
|
background-color: ${(props) => props.theme.colors.neutral0};
|
|
10930
10988
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
10989
|
+
border-radius: ${({ theme }) => theme.borderRadius};
|
|
10931
10990
|
|
|
10932
10991
|
@media (prefers-reduced-motion: no-preference) {
|
|
10933
10992
|
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
@@ -10936,11 +10995,11 @@ const PopoverContent = styled(Popover$1.Content)`
|
|
|
10936
10995
|
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
10937
10996
|
|
|
10938
10997
|
&[data-side='top'] {
|
|
10939
|
-
animation-name: ${ANIMATIONS.
|
|
10998
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
10940
10999
|
}
|
|
10941
11000
|
|
|
10942
11001
|
&[data-side='bottom'] {
|
|
10943
|
-
animation-name: ${ANIMATIONS.
|
|
11002
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
10944
11003
|
}
|
|
10945
11004
|
}
|
|
10946
11005
|
|
|
@@ -10948,68 +11007,69 @@ const PopoverContent = styled(Popover$1.Content)`
|
|
|
10948
11007
|
animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
10949
11008
|
|
|
10950
11009
|
&[data-side='top'] {
|
|
10951
|
-
animation-name: ${ANIMATIONS.
|
|
11010
|
+
animation-name: ${ANIMATIONS.slideUpOut};
|
|
10952
11011
|
}
|
|
10953
11012
|
|
|
10954
11013
|
&[data-side='bottom'] {
|
|
10955
|
-
animation-name: ${ANIMATIONS.
|
|
11014
|
+
animation-name: ${ANIMATIONS.slideDownOut};
|
|
10956
11015
|
}
|
|
10957
11016
|
}
|
|
10958
11017
|
}
|
|
10959
11018
|
`;
|
|
10960
|
-
const ScrollAreaImpl = (
|
|
10961
|
-
|
|
10962
|
-
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
|
|
10970
|
-
|
|
10971
|
-
|
|
10972
|
-
}
|
|
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
|
+
);
|
|
10973
11035
|
const PopoverScrollArea = styled(ScrollAreaImpl$1)`
|
|
10974
11036
|
height: 20rem;
|
|
10975
11037
|
`;
|
|
10976
11038
|
const Popover = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10977
11039
|
__proto__: null,
|
|
10978
11040
|
Content: Content$1,
|
|
10979
|
-
Root: Root$
|
|
11041
|
+
Root: Root$2,
|
|
10980
11042
|
ScrollArea: ScrollAreaImpl,
|
|
10981
11043
|
Trigger: Trigger$1
|
|
10982
11044
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
10983
|
-
const
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
10987
|
-
|
|
10988
|
-
|
|
10989
|
-
|
|
10990
|
-
|
|
10991
|
-
|
|
11045
|
+
const ProgressBar = React.forwardRef(
|
|
11046
|
+
({ size = "M", value, ...restProps }, forwardedRef) => {
|
|
11047
|
+
return /* @__PURE__ */ jsx(ProgressRoot, { ref: forwardedRef, $size: size, ...restProps, children: /* @__PURE__ */ jsx(ProgressIndicator, { style: { transform: `translate3D(-${100 - (value ?? 0)}%, 0, 0)` } }) });
|
|
11048
|
+
}
|
|
11049
|
+
);
|
|
11050
|
+
const ProgressRoot = styled(Progress.Root)`
|
|
11051
|
+
position: relative;
|
|
11052
|
+
overflow: hidden;
|
|
11053
|
+
width: ${(props) => props.$size === "S" ? "7.8rem" : "10.2rem"};
|
|
11054
|
+
height: ${(props) => props.$size === "S" ? "0.4rem" : "0.8rem"};
|
|
11055
|
+
background-color: ${(props) => props.theme.colors.neutral600};
|
|
11056
|
+
border-radius: ${(props) => props.theme.borderRadius};
|
|
11057
|
+
|
|
11058
|
+
/* Fix overflow clipping in Safari */
|
|
11059
|
+
/* https://gist.github.com/domske/b66047671c780a238b51c51ffde8d3a0 */
|
|
11060
|
+
transform: translateZ(0);
|
|
11061
|
+
`;
|
|
11062
|
+
const ProgressIndicator = styled(Progress.Indicator)`
|
|
11063
|
+
background-color: ${({ theme }) => theme.colors.neutral0};
|
|
11064
|
+
border-radius: ${({ theme }) => theme.borderRadius};
|
|
11065
|
+
width: 100%;
|
|
11066
|
+
height: 100%;
|
|
11067
|
+
|
|
11068
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
11069
|
+
transition: transform ${(props) => props.theme.motion.timings["320"]}
|
|
11070
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
10992
11071
|
}
|
|
10993
11072
|
`;
|
|
10994
|
-
const ProgressBar = ({ min = 0, max = 100, value = 0, children, size = "M", ...props }) => {
|
|
10995
|
-
return /* @__PURE__ */ jsx(
|
|
10996
|
-
ProgressbarBase,
|
|
10997
|
-
{
|
|
10998
|
-
background: "neutral600",
|
|
10999
|
-
hasRadius: true,
|
|
11000
|
-
"aria-label": children,
|
|
11001
|
-
"aria-valuemax": max,
|
|
11002
|
-
"aria-valuemin": min,
|
|
11003
|
-
"aria-valuenow": value,
|
|
11004
|
-
height: size === "S" ? 1 : 2,
|
|
11005
|
-
position: "relative",
|
|
11006
|
-
role: "progressbar",
|
|
11007
|
-
$value: value,
|
|
11008
|
-
width: size === "S" ? "78px" : "102px",
|
|
11009
|
-
...props
|
|
11010
|
-
}
|
|
11011
|
-
);
|
|
11012
|
-
};
|
|
11013
11073
|
const Group = React.forwardRef((props, forwardedRef) => {
|
|
11014
11074
|
return /* @__PURE__ */ jsx(RadioGroupRoot, { ref: forwardedRef, ...props });
|
|
11015
11075
|
});
|
|
@@ -11018,7 +11078,7 @@ const RadioGroupRoot = styled(RadioGroup.Root)`
|
|
|
11018
11078
|
flex-direction: column;
|
|
11019
11079
|
gap: ${(props) => props.theme.spaces[3]};
|
|
11020
11080
|
`;
|
|
11021
|
-
const Item = React.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
|
|
11081
|
+
const Item$1 = React.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
|
|
11022
11082
|
const id = useId(idProp);
|
|
11023
11083
|
return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
11024
11084
|
/* @__PURE__ */ jsx(RadioGroupItem, { id, ref: forwardedRef, ...restProps, children: /* @__PURE__ */ jsx(RadioGroupIndicator, {}) }),
|
|
@@ -11087,7 +11147,7 @@ const RadioGroupIndicator = styled(RadioGroup.Indicator)`
|
|
|
11087
11147
|
const Radio = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11088
11148
|
__proto__: null,
|
|
11089
11149
|
Group,
|
|
11090
|
-
Item
|
|
11150
|
+
Item: Item$1
|
|
11091
11151
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
11092
11152
|
const focusFocusable = (node) => {
|
|
11093
11153
|
const nextNode = node.querySelector('[tabindex="0"]');
|
|
@@ -11103,172 +11163,194 @@ const RawTableContext = React.createContext({
|
|
|
11103
11163
|
}
|
|
11104
11164
|
});
|
|
11105
11165
|
const useTable = () => React.useContext(RawTableContext);
|
|
11106
|
-
const RawTable = (
|
|
11107
|
-
colCount,
|
|
11108
|
-
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
}) => {
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
setRowIndex(rowIndex2);
|
|
11121
|
-
}, []);
|
|
11122
|
-
React.useEffect(() => {
|
|
11123
|
-
if (mountedRef.current) {
|
|
11124
|
-
focusFocusable(tableRef.current);
|
|
11125
|
-
}
|
|
11126
|
-
if (!mountedRef.current) {
|
|
11127
|
-
mountedRef.current = true;
|
|
11128
|
-
}
|
|
11129
|
-
}, [colIndex, rowIndex]);
|
|
11130
|
-
const handleKeyDown = (e) => {
|
|
11131
|
-
switch (e.key) {
|
|
11132
|
-
case KeyboardKeys.RIGHT: {
|
|
11133
|
-
e.preventDefault();
|
|
11134
|
-
setColIndex((prevColIndex) => prevColIndex < colCount - 1 ? prevColIndex + 1 : prevColIndex);
|
|
11135
|
-
break;
|
|
11136
|
-
}
|
|
11137
|
-
case KeyboardKeys.LEFT: {
|
|
11138
|
-
e.preventDefault();
|
|
11139
|
-
setColIndex((prevColIndex) => prevColIndex > 0 ? prevColIndex - 1 : prevColIndex);
|
|
11140
|
-
break;
|
|
11141
|
-
}
|
|
11142
|
-
case KeyboardKeys.UP: {
|
|
11143
|
-
e.preventDefault();
|
|
11144
|
-
setRowIndex((prevRowIndex) => prevRowIndex > 0 ? prevRowIndex - 1 : prevRowIndex);
|
|
11145
|
-
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);
|
|
11146
11180
|
}
|
|
11147
|
-
|
|
11148
|
-
|
|
11149
|
-
setRowIndex((prevRowIndex) => prevRowIndex < rowCount - 1 ? prevRowIndex + 1 : prevRowIndex);
|
|
11150
|
-
break;
|
|
11181
|
+
if (!mountedRef.current) {
|
|
11182
|
+
mountedRef.current = true;
|
|
11151
11183
|
}
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
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;
|
|
11156
11191
|
}
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
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;
|
|
11164
11232
|
}
|
|
11165
|
-
setColIndex(colCount - 1);
|
|
11166
|
-
break;
|
|
11167
|
-
}
|
|
11168
|
-
case KeyboardKeys.PAGE_DOWN: {
|
|
11169
|
-
e.preventDefault();
|
|
11170
|
-
setRowIndex((prevRowIndex) => prevRowIndex + jumpStep < rowCount ? prevRowIndex + jumpStep : rowCount - 1);
|
|
11171
|
-
break;
|
|
11172
11233
|
}
|
|
11173
|
-
|
|
11174
|
-
|
|
11175
|
-
|
|
11176
|
-
|
|
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
|
|
11177
11245
|
}
|
|
11178
|
-
}
|
|
11179
|
-
}
|
|
11180
|
-
|
|
11181
|
-
|
|
11182
|
-
|
|
11183
|
-
|
|
11184
|
-
|
|
11185
|
-
|
|
11186
|
-
|
|
11187
|
-
|
|
11188
|
-
|
|
11189
|
-
|
|
11190
|
-
|
|
11191
|
-
|
|
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;
|
|
11192
11263
|
};
|
|
11193
|
-
const
|
|
11194
|
-
|
|
11195
|
-
|
|
11196
|
-
|
|
11197
|
-
const handleKeyDown = (e) => {
|
|
11198
|
-
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11199
|
-
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length === 0) {
|
|
11200
|
-
return;
|
|
11264
|
+
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
11265
|
+
return nodes.filter((node) => {
|
|
11266
|
+
if (node.tagName === "INPUT") {
|
|
11267
|
+
return node.type !== "checkbox" && node.type !== "radio";
|
|
11201
11268
|
}
|
|
11202
|
-
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
nextNode.focus();
|
|
11216
|
-
}
|
|
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;
|
|
11217
11282
|
}
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
|
|
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
|
+
}
|
|
11225
11299
|
return;
|
|
11226
11300
|
}
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
e.
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
const isFocused = rowIndex === coords.row - 1 && colIndex === coords.col - 1;
|
|
11234
|
-
useIsomorphicLayoutEffect(() => {
|
|
11235
|
-
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11236
|
-
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || focusableNodes.length > 1 && Boolean(focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
|
|
11237
|
-
tdRef.current.setAttribute("tabIndex", !isActive && isFocused ? "0" : "-1");
|
|
11238
|
-
focusableNodes.forEach((node, index) => {
|
|
11239
|
-
node.setAttribute("tabIndex", isActive ? "0" : "-1");
|
|
11240
|
-
if (isActive && index === 0) {
|
|
11241
|
-
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;
|
|
11242
11307
|
}
|
|
11243
|
-
|
|
11244
|
-
|
|
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);
|
|
11245
11341
|
focusableNodes.forEach((node) => {
|
|
11246
|
-
node.
|
|
11247
|
-
});
|
|
11248
|
-
}
|
|
11249
|
-
}, [isActive, isFocused]);
|
|
11250
|
-
const handleFocusableNodeFocus = React.useCallback(() => {
|
|
11251
|
-
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11252
|
-
if (focusableNodes.length >= 1 && (getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || !focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
|
|
11253
|
-
setIsActive(true);
|
|
11254
|
-
}
|
|
11255
|
-
setTableValues({ rowIndex: coords.row - 1, colIndex: coords.col - 1 });
|
|
11256
|
-
}, [coords, setTableValues]);
|
|
11257
|
-
useIsomorphicLayoutEffect(() => {
|
|
11258
|
-
const cell = tdRef.current;
|
|
11259
|
-
const focusableNodes = getFocusableNodes(cell, true);
|
|
11260
|
-
focusableNodes.forEach((node) => {
|
|
11261
|
-
node.addEventListener("focus", handleFocusableNodeFocus);
|
|
11262
|
-
});
|
|
11263
|
-
return () => {
|
|
11264
|
-
const focusableNodes2 = getFocusableNodes(cell, true);
|
|
11265
|
-
focusableNodes2.forEach((node) => {
|
|
11266
|
-
node.removeEventListener("focus", handleFocusableNodeFocus);
|
|
11342
|
+
node.addEventListener("focus", handleFocusableNodeFocus);
|
|
11267
11343
|
});
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
|
|
11271
|
-
|
|
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
|
+
);
|
|
11272
11354
|
const RawTh = (props) => /* @__PURE__ */ jsx(RawTd, { ...props, tag: "th" });
|
|
11273
11355
|
const RawThead = ({ children, ...props }) => {
|
|
11274
11356
|
const childrenClone = React.Children.toArray(children).map((child) => {
|
|
@@ -11319,14 +11401,18 @@ const SearchbarWrapper = styled.div`
|
|
|
11319
11401
|
&:focus-within {
|
|
11320
11402
|
${SearchIcon} {
|
|
11321
11403
|
fill: ${({ theme }) => theme.colors.primary600};
|
|
11322
|
-
path {
|
|
11323
|
-
}
|
|
11324
11404
|
}
|
|
11325
11405
|
}
|
|
11326
11406
|
`;
|
|
11327
11407
|
const SearchbarInput = styled(Input$2)`
|
|
11328
11408
|
border: 1px solid transparent;
|
|
11329
11409
|
|
|
11410
|
+
&:hover {
|
|
11411
|
+
button {
|
|
11412
|
+
cursor: pointer;
|
|
11413
|
+
}
|
|
11414
|
+
}
|
|
11415
|
+
|
|
11330
11416
|
${inputFocusStyle()}
|
|
11331
11417
|
`;
|
|
11332
11418
|
const Searchbar = React.forwardRef(
|
|
@@ -11346,7 +11432,17 @@ const Searchbar = React.forwardRef(
|
|
|
11346
11432
|
ref: actualRef,
|
|
11347
11433
|
value,
|
|
11348
11434
|
startAction: /* @__PURE__ */ jsx(SearchIcon, { "aria-hidden": true }),
|
|
11349
|
-
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,
|
|
11350
11446
|
...props
|
|
11351
11447
|
}
|
|
11352
11448
|
)
|
|
@@ -11354,47 +11450,60 @@ const Searchbar = React.forwardRef(
|
|
|
11354
11450
|
}
|
|
11355
11451
|
);
|
|
11356
11452
|
const SearchForm = (props) => /* @__PURE__ */ jsx("form", { ...props, role: "search" });
|
|
11357
|
-
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 }) => {
|
|
11358
11471
|
const handleClick = (e) => {
|
|
11359
11472
|
if (disabled || !onClick)
|
|
11360
11473
|
return;
|
|
11361
11474
|
onClick(e);
|
|
11362
11475
|
};
|
|
11363
11476
|
return /* @__PURE__ */ jsxs(
|
|
11364
|
-
|
|
11477
|
+
Flex,
|
|
11365
11478
|
{
|
|
11366
|
-
|
|
11479
|
+
inline: true,
|
|
11367
11480
|
background: disabled ? "neutral200" : "primary100",
|
|
11368
11481
|
color: disabled ? "neutral700" : "primary600",
|
|
11369
11482
|
paddingLeft: 3,
|
|
11370
|
-
paddingRight:
|
|
11371
|
-
onClick: handleClick,
|
|
11372
|
-
"aria-disabled": disabled,
|
|
11373
|
-
disabled,
|
|
11374
|
-
borderWidth: "1px",
|
|
11375
|
-
borderStyle: "solid",
|
|
11483
|
+
paddingRight: 1,
|
|
11376
11484
|
borderColor: disabled ? "neutral300" : "primary200",
|
|
11377
11485
|
hasRadius: true,
|
|
11378
11486
|
height: "3.2rem",
|
|
11379
|
-
gap: 2,
|
|
11380
11487
|
...props,
|
|
11381
11488
|
children: [
|
|
11382
11489
|
/* @__PURE__ */ jsx(TagText, { $disabled: disabled, variant: "pi", fontWeight: "bold", children }),
|
|
11383
|
-
|
|
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
|
+
)
|
|
11384
11503
|
]
|
|
11385
11504
|
}
|
|
11386
11505
|
);
|
|
11387
11506
|
};
|
|
11388
|
-
const TagWrapper = styled(Flex)`
|
|
11389
|
-
& > svg {
|
|
11390
|
-
height: 0.8rem;
|
|
11391
|
-
width: 0.8rem;
|
|
11392
|
-
}
|
|
11393
|
-
|
|
11394
|
-
& > svg path {
|
|
11395
|
-
fill: ${({ theme, ...p }) => p["aria-disabled"] ? theme.colors.neutral600 : theme.colors.primary600};
|
|
11396
|
-
}
|
|
11397
|
-
`;
|
|
11398
11507
|
const TagText = styled(Typography)`
|
|
11399
11508
|
color: inherit;
|
|
11400
11509
|
border-right: 1px solid ${({ theme, $disabled }) => $disabled ? theme.colors.neutral300 : theme.colors.primary200};
|
|
@@ -11415,6 +11524,7 @@ const MultiSelect = React.forwardRef(
|
|
|
11415
11524
|
onReachEnd,
|
|
11416
11525
|
placeholder,
|
|
11417
11526
|
required: requiredProp,
|
|
11527
|
+
size,
|
|
11418
11528
|
startIcon,
|
|
11419
11529
|
value: passedValue,
|
|
11420
11530
|
withTags,
|
|
@@ -11459,7 +11569,17 @@ const MultiSelect = React.forwardRef(
|
|
|
11459
11569
|
const value = typeof passedValue !== "undefined" && passedValue !== null ? passedValue : internalValue;
|
|
11460
11570
|
const renderTags = (arg) => {
|
|
11461
11571
|
if (arg && typeof arg === "object" && arg.value) {
|
|
11462
|
-
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
|
+
);
|
|
11463
11583
|
}
|
|
11464
11584
|
return null;
|
|
11465
11585
|
};
|
|
@@ -11498,7 +11618,8 @@ const MultiSelect = React.forwardRef(
|
|
|
11498
11618
|
disabled,
|
|
11499
11619
|
clearLabel,
|
|
11500
11620
|
onClear: value?.length ? onClear : void 0,
|
|
11501
|
-
|
|
11621
|
+
withTags: Boolean(withTags && (value?.length ?? 0 > 0)),
|
|
11622
|
+
size,
|
|
11502
11623
|
children: /* @__PURE__ */ jsx(Value, { placeholder, textColor: value?.length ? "neutral800" : "neutral600", children: value?.length ? withTags ? renderTags : customizeContent ? customizeContent(value) : void 0 : void 0 })
|
|
11503
11624
|
}
|
|
11504
11625
|
),
|
|
@@ -11607,7 +11728,8 @@ const SubNavHeader = ({
|
|
|
11607
11728
|
},
|
|
11608
11729
|
onSubmit = () => {
|
|
11609
11730
|
},
|
|
11610
|
-
id
|
|
11731
|
+
id,
|
|
11732
|
+
placeholder
|
|
11611
11733
|
}) => {
|
|
11612
11734
|
const [isSearchOpen, setSearchOpen] = React.useState(false);
|
|
11613
11735
|
const previousSearchOpenValue = usePrev(isSearchOpen);
|
|
@@ -11647,7 +11769,7 @@ const SubNavHeader = ({
|
|
|
11647
11769
|
name: "searchbar",
|
|
11648
11770
|
value,
|
|
11649
11771
|
onChange,
|
|
11650
|
-
placeholder
|
|
11772
|
+
placeholder,
|
|
11651
11773
|
onKeyDown: handleKeyDown,
|
|
11652
11774
|
ref: searchRef,
|
|
11653
11775
|
onBlur: handleBlur,
|
|
@@ -11661,7 +11783,7 @@ const SubNavHeader = ({
|
|
|
11661
11783
|
] });
|
|
11662
11784
|
}
|
|
11663
11785
|
return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingLeft: 6, paddingTop: 6, paddingBottom: 2, paddingRight: 4, children: [
|
|
11664
|
-
/* @__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: [
|
|
11665
11787
|
/* @__PURE__ */ jsx(Typography, { variant: "beta", tag, children: label }),
|
|
11666
11788
|
searchable && /* @__PURE__ */ jsx(IconButton, { ref: searchButtonRef, onClick: toggleSearch, label: searchLabel, children: /* @__PURE__ */ jsx(Search, {}) })
|
|
11667
11789
|
] }),
|
|
@@ -11690,7 +11812,13 @@ const SubNavLink = forwardRef(
|
|
|
11690
11812
|
);
|
|
11691
11813
|
}
|
|
11692
11814
|
);
|
|
11693
|
-
const
|
|
11815
|
+
const CustomBullet = styled.span`
|
|
11816
|
+
width: 0.4rem;
|
|
11817
|
+
height: 0.4rem;
|
|
11818
|
+
background-color: ${({ theme, $active }) => $active ? theme.colors.primary600 : theme.colors.neutral600};
|
|
11819
|
+
border-radius: 50%;
|
|
11820
|
+
`;
|
|
11821
|
+
const SubNavLinkWrapper = styled(BaseLinkImpl)`
|
|
11694
11822
|
display: flex;
|
|
11695
11823
|
align-items: center;
|
|
11696
11824
|
justify-content: space-between;
|
|
@@ -11709,18 +11837,16 @@ const SubNavLinkWrapper = styled(BaseLink)`
|
|
|
11709
11837
|
font-weight: 500;
|
|
11710
11838
|
`;
|
|
11711
11839
|
}}
|
|
11840
|
+
|
|
11841
|
+
${CustomBullet} {
|
|
11842
|
+
background-color: ${({ theme }) => theme.colors.primary600};
|
|
11843
|
+
}
|
|
11712
11844
|
}
|
|
11713
11845
|
|
|
11714
11846
|
&:focus-visible {
|
|
11715
11847
|
outline-offset: -2px;
|
|
11716
11848
|
}
|
|
11717
11849
|
`;
|
|
11718
|
-
const CustomBullet = styled.span`
|
|
11719
|
-
width: 0.4rem;
|
|
11720
|
-
height: 0.4rem;
|
|
11721
|
-
background-color: ${({ theme, $active }) => $active ? theme.colors.primary600 : theme.colors.neutral600};
|
|
11722
|
-
border-radius: 50%;
|
|
11723
|
-
`;
|
|
11724
11850
|
const IconWrapper = styled.div`
|
|
11725
11851
|
svg {
|
|
11726
11852
|
height: 1.6rem;
|
|
@@ -11851,74 +11977,88 @@ const SubNavSections = ({ children, spacing = 2, horizontal = false, ...props })
|
|
|
11851
11977
|
}
|
|
11852
11978
|
) });
|
|
11853
11979
|
};
|
|
11854
|
-
const
|
|
11855
|
-
({
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
|
|
11869
|
-
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11980
|
+
const SwitchImpl = React.forwardRef(
|
|
11981
|
+
({
|
|
11982
|
+
visibleLabels,
|
|
11983
|
+
onLabel = "On",
|
|
11984
|
+
offLabel = "Off",
|
|
11985
|
+
onCheckedChange: onCheckedChangeProp,
|
|
11986
|
+
checked: checkedProp,
|
|
11987
|
+
defaultChecked,
|
|
11988
|
+
disabled,
|
|
11989
|
+
...restProps
|
|
11990
|
+
}, forwardedRef) => {
|
|
11991
|
+
const [internalChecked, setInternalChecked] = useControllableState$1({
|
|
11992
|
+
prop: checkedProp,
|
|
11993
|
+
defaultProp: defaultChecked
|
|
11994
|
+
});
|
|
11995
|
+
const handleCheckChange = (checked) => {
|
|
11996
|
+
setInternalChecked(checked);
|
|
11997
|
+
};
|
|
11998
|
+
return /* @__PURE__ */ jsxs(Flex, { gap: 3, children: [
|
|
11999
|
+
/* @__PURE__ */ jsx(
|
|
12000
|
+
SwitchRoot,
|
|
12001
|
+
{
|
|
12002
|
+
ref: forwardedRef,
|
|
12003
|
+
onCheckedChange: composeEventHandlers(onCheckedChangeProp, handleCheckChange),
|
|
12004
|
+
checked: internalChecked,
|
|
12005
|
+
disabled,
|
|
12006
|
+
...restProps,
|
|
12007
|
+
children: /* @__PURE__ */ jsx(SwitchThumb, {})
|
|
12008
|
+
}
|
|
12009
|
+
),
|
|
12010
|
+
visibleLabels ? /* @__PURE__ */ jsx(LabelTypography, { "aria-hidden": true, "data-disabled": disabled, "data-state": internalChecked ? "checked" : "unchecked", children: internalChecked ? onLabel : offLabel }) : null
|
|
12011
|
+
] });
|
|
11875
12012
|
}
|
|
11876
12013
|
);
|
|
11877
|
-
const
|
|
11878
|
-
background: ${({ theme }) => theme.colors.danger500};
|
|
11879
|
-
border: none;
|
|
11880
|
-
border-radius: 16px;
|
|
11881
|
-
position: relative;
|
|
11882
|
-
height: 2.4rem;
|
|
12014
|
+
const SwitchRoot = styled(Switch.Root)`
|
|
11883
12015
|
width: 4rem;
|
|
12016
|
+
height: 2.4rem;
|
|
12017
|
+
border-radius: 1.2rem;
|
|
12018
|
+
background-color: ${({ theme }) => theme.colors.danger500};
|
|
11884
12019
|
|
|
11885
|
-
&
|
|
11886
|
-
|
|
12020
|
+
&[data-state='checked'] {
|
|
12021
|
+
background-color: ${({ theme }) => theme.colors.success500};
|
|
11887
12022
|
}
|
|
11888
12023
|
|
|
11889
|
-
|
|
11890
|
-
|
|
11891
|
-
background: ${({ theme }) => theme.colors.neutral0};
|
|
11892
|
-
width: 1rem;
|
|
11893
|
-
height: 1rem;
|
|
11894
|
-
border-radius: 50%;
|
|
11895
|
-
position: absolute;
|
|
11896
|
-
transition: all 0.5s;
|
|
11897
|
-
left: ${({ theme }) => theme.spaces[1]};
|
|
11898
|
-
top: ${({ theme }) => theme.spaces[1]};
|
|
12024
|
+
&[data-disabled] {
|
|
12025
|
+
background-color: ${({ theme }) => theme.colors.neutral300};
|
|
11899
12026
|
}
|
|
11900
12027
|
|
|
11901
|
-
@media (prefers-reduced-motion:
|
|
11902
|
-
|
|
11903
|
-
transition: none;
|
|
11904
|
-
}
|
|
12028
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
12029
|
+
transition: ${(props) => props.theme.transitions.backgroundColor};
|
|
11905
12030
|
}
|
|
11906
12031
|
`;
|
|
11907
|
-
const
|
|
11908
|
-
|
|
11909
|
-
|
|
11910
|
-
|
|
12032
|
+
const SwitchThumb = styled(Switch.Thumb)`
|
|
12033
|
+
display: block;
|
|
12034
|
+
height: 1.6rem;
|
|
12035
|
+
width: 1.6rem;
|
|
12036
|
+
border-radius: 50%;
|
|
12037
|
+
background-color: ${({ theme }) => theme.colors.neutral0};
|
|
12038
|
+
transform: translateX(4px);
|
|
11911
12039
|
|
|
11912
|
-
&[
|
|
11913
|
-
|
|
12040
|
+
&[data-state='checked'] {
|
|
12041
|
+
transform: translateX(20px);
|
|
11914
12042
|
}
|
|
11915
12043
|
|
|
11916
|
-
|
|
11917
|
-
|
|
12044
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
12045
|
+
transition: transform ${(props) => props.theme.motion.timings["120"]}
|
|
12046
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
12047
|
+
}
|
|
12048
|
+
`;
|
|
12049
|
+
const LabelTypography = styled(Typography)`
|
|
12050
|
+
color: ${(props) => props.theme.colors.danger600};
|
|
12051
|
+
|
|
12052
|
+
&[data-state='checked'] {
|
|
12053
|
+
color: ${(props) => props.theme.colors.success600};
|
|
12054
|
+
}
|
|
12055
|
+
|
|
12056
|
+
&[data-disabled='true'] {
|
|
12057
|
+
color: ${({ theme }) => theme.colors.neutral500};
|
|
11918
12058
|
}
|
|
11919
12059
|
`;
|
|
11920
12060
|
const [TabsProvider, useTabs] = createContext("Tabs");
|
|
11921
|
-
const Root = React.forwardRef(
|
|
12061
|
+
const Root$1 = React.forwardRef(
|
|
11922
12062
|
({ disabled = false, variant: variant2 = "regular", hasError, ...props }, forwardedRef) => {
|
|
11923
12063
|
return /* @__PURE__ */ jsx(TabsProvider, { disabled, hasError, variant: variant2, children: /* @__PURE__ */ jsx(TabsRoot, { ref: forwardedRef, ...props }) });
|
|
11924
12064
|
}
|
|
@@ -11957,10 +12097,6 @@ const TabBar = styled.span`
|
|
|
11957
12097
|
left: 0;
|
|
11958
12098
|
opacity: 0;
|
|
11959
12099
|
height: 0.2rem;
|
|
11960
|
-
|
|
11961
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
11962
|
-
transition: ${(props) => `opacity 200ms ${props.theme.motion.easings.authenticMotion}`};
|
|
11963
|
-
}
|
|
11964
12100
|
`;
|
|
11965
12101
|
const TriggerTypography = styled(Typography)``;
|
|
11966
12102
|
const TabsTrigger = styled(Tabs$1.Trigger)`
|
|
@@ -12014,10 +12150,6 @@ const TabsTrigger = styled(Tabs$1.Trigger)`
|
|
|
12014
12150
|
}
|
|
12015
12151
|
}}
|
|
12016
12152
|
|
|
12017
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
12018
|
-
transition: ${(props) => `${props.theme.transitions.color}, ${props.theme.transitions.backgroundColor}, box-shadow ${props.theme.motion.timings["120"]} ${props.theme.motion.easings.easeOutQuad}`};
|
|
12019
|
-
}
|
|
12020
|
-
|
|
12021
12153
|
&[data-disabled] {
|
|
12022
12154
|
cursor: not-allowed;
|
|
12023
12155
|
color: ${(props) => props.theme.colors.neutral400};
|
|
@@ -12044,7 +12176,7 @@ const Tabs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
12044
12176
|
__proto__: null,
|
|
12045
12177
|
Content,
|
|
12046
12178
|
List,
|
|
12047
|
-
Root,
|
|
12179
|
+
Root: Root$1,
|
|
12048
12180
|
Trigger
|
|
12049
12181
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
12050
12182
|
const TableContainer = styled(Box)`
|
|
@@ -12084,7 +12216,7 @@ const TableBox = styled(Box)`
|
|
|
12084
12216
|
const ScrollContainer = styled(Box)`
|
|
12085
12217
|
overflow-x: auto;
|
|
12086
12218
|
`;
|
|
12087
|
-
const Table = ({ footer, ...props }) => {
|
|
12219
|
+
const Table = React.forwardRef(({ footer, ...props }, forwardedRef) => {
|
|
12088
12220
|
const tableRef = React.useRef(null);
|
|
12089
12221
|
const [overflowing, setOverflowing] = React.useState();
|
|
12090
12222
|
const handleScroll = (e) => {
|
|
@@ -12107,10 +12239,10 @@ const Table = ({ footer, ...props }) => {
|
|
|
12107
12239
|
}
|
|
12108
12240
|
}, []);
|
|
12109
12241
|
return /* @__PURE__ */ jsxs(TableContainer, { shadow: "tableShadow", hasRadius: true, background: "neutral0", children: [
|
|
12110
|
-
/* @__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 }) }) }),
|
|
12111
12243
|
footer
|
|
12112
12244
|
] });
|
|
12113
|
-
};
|
|
12245
|
+
});
|
|
12114
12246
|
const TbodyWrapper = styled(RawTbody)`
|
|
12115
12247
|
& tr:last-of-type {
|
|
12116
12248
|
border-bottom: none;
|
|
@@ -12151,7 +12283,6 @@ const Tr = (props) => {
|
|
|
12151
12283
|
const CellWrapper = styled(RawTd)`
|
|
12152
12284
|
vertical-align: middle;
|
|
12153
12285
|
text-align: left;
|
|
12154
|
-
color: ${({ theme }) => theme.colors.neutral600};
|
|
12155
12286
|
outline-offset: -4px;
|
|
12156
12287
|
|
|
12157
12288
|
/**
|
|
@@ -12161,15 +12292,15 @@ const CellWrapper = styled(RawTd)`
|
|
|
12161
12292
|
vertical-align: sub;
|
|
12162
12293
|
}
|
|
12163
12294
|
`;
|
|
12164
|
-
const Th = ({ children, action, ...props }) => {
|
|
12165
|
-
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: [
|
|
12166
12297
|
children,
|
|
12167
12298
|
action
|
|
12168
12299
|
] }) });
|
|
12169
|
-
};
|
|
12170
|
-
const Td = ({ children, ...props }) => {
|
|
12171
|
-
return /* @__PURE__ */ jsx(CellWrapper, { ...props, children });
|
|
12172
|
-
};
|
|
12300
|
+
});
|
|
12301
|
+
const Td = React.forwardRef(({ children, ...props }, forwardedRef) => {
|
|
12302
|
+
return /* @__PURE__ */ jsx(CellWrapper, { color: "neutral800", ref: forwardedRef, ...props, children });
|
|
12303
|
+
});
|
|
12173
12304
|
const IconBox = styled(Box)`
|
|
12174
12305
|
height: 2.4rem;
|
|
12175
12306
|
width: 2.4rem;
|
|
@@ -12202,6 +12333,28 @@ const TFooter = ({ children, icon, ...props }) => {
|
|
|
12202
12333
|
] }) })
|
|
12203
12334
|
] });
|
|
12204
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
|
+
);
|
|
12205
12358
|
const rotation = keyframes`
|
|
12206
12359
|
from {
|
|
12207
12360
|
transform: rotate(0deg);
|
|
@@ -12210,51 +12363,24 @@ const rotation = keyframes`
|
|
|
12210
12363
|
transform: rotate(359deg);
|
|
12211
12364
|
}
|
|
12212
12365
|
`;
|
|
12213
|
-
const LoadingWrapper = styled.
|
|
12366
|
+
const LoadingWrapper = styled.span`
|
|
12367
|
+
display: flex;
|
|
12214
12368
|
animation: ${rotation} 2s infinite linear;
|
|
12215
12369
|
will-change: transform;
|
|
12216
12370
|
`;
|
|
12217
12371
|
const TextButtonWrapper = styled(Flex)`
|
|
12218
12372
|
border: none;
|
|
12373
|
+
background-color: transparent;
|
|
12374
|
+
color: ${(props) => props.theme.colors.primary600};
|
|
12375
|
+
cursor: pointer;
|
|
12219
12376
|
|
|
12220
12377
|
&[aria-disabled='true'] {
|
|
12221
12378
|
pointer-events: none;
|
|
12222
|
-
|
|
12223
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
12224
|
-
}
|
|
12225
|
-
}
|
|
12226
|
-
|
|
12227
|
-
svg path {
|
|
12228
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
|
12379
|
+
color: ${(props) => props.theme.colors.neutral600};
|
|
12229
12380
|
}
|
|
12230
12381
|
|
|
12231
12382
|
${focus}
|
|
12232
12383
|
`;
|
|
12233
|
-
const TextButton = React.forwardRef(
|
|
12234
|
-
({ children, startIcon, endIcon, onClick, disabled = false, loading = false, ...props }, ref) => {
|
|
12235
|
-
const handleClick = onClick && !disabled ? onClick : void 0;
|
|
12236
|
-
const isDisabled = disabled || loading;
|
|
12237
|
-
return /* @__PURE__ */ jsxs(
|
|
12238
|
-
TextButtonWrapper,
|
|
12239
|
-
{
|
|
12240
|
-
ref,
|
|
12241
|
-
"aria-disabled": isDisabled,
|
|
12242
|
-
onClick: handleClick,
|
|
12243
|
-
tag: "button",
|
|
12244
|
-
type: "button",
|
|
12245
|
-
background: "transparent",
|
|
12246
|
-
gap: 2,
|
|
12247
|
-
...props,
|
|
12248
|
-
children: [
|
|
12249
|
-
loading ? /* @__PURE__ */ jsx(LoadingWrapper, { "aria-hidden": true, children: /* @__PURE__ */ jsx(Loader$1, {}) }) : startIcon,
|
|
12250
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: isDisabled ? "neutral600" : "primary600", children }),
|
|
12251
|
-
endIcon
|
|
12252
|
-
]
|
|
12253
|
-
}
|
|
12254
|
-
);
|
|
12255
|
-
}
|
|
12256
|
-
);
|
|
12257
|
-
TextButton.displayName = "TextButton";
|
|
12258
12384
|
const TextInput = React.forwardRef((props, ref) => {
|
|
12259
12385
|
return /* @__PURE__ */ jsx(Input$2, { ref, ...props });
|
|
12260
12386
|
});
|
|
@@ -12272,7 +12398,7 @@ const Textarea = React.forwardRef(
|
|
|
12272
12398
|
} else if (field.hint) {
|
|
12273
12399
|
ariaDescription = `${id}-hint`;
|
|
12274
12400
|
}
|
|
12275
|
-
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(
|
|
12276
12402
|
TextareaElement,
|
|
12277
12403
|
{
|
|
12278
12404
|
"aria-invalid": hasError,
|
|
@@ -12283,11 +12409,11 @@ const Textarea = React.forwardRef(
|
|
|
12283
12409
|
disabled,
|
|
12284
12410
|
fontSize: 2,
|
|
12285
12411
|
hasRadius: true,
|
|
12286
|
-
height: "10.5rem",
|
|
12287
12412
|
ref,
|
|
12288
12413
|
lineHeight: 4,
|
|
12289
12414
|
padding: 4,
|
|
12290
12415
|
width: "100%",
|
|
12416
|
+
height: "100%",
|
|
12291
12417
|
id,
|
|
12292
12418
|
name,
|
|
12293
12419
|
"aria-describedby": ariaDescription,
|
|
@@ -12296,7 +12422,8 @@ const Textarea = React.forwardRef(
|
|
|
12296
12422
|
) });
|
|
12297
12423
|
}
|
|
12298
12424
|
);
|
|
12299
|
-
const Wrapper = styled(Box)`
|
|
12425
|
+
const Wrapper$1 = styled(Box)`
|
|
12426
|
+
height: 10.5rem;
|
|
12300
12427
|
${inputFocusStyle()}
|
|
12301
12428
|
`;
|
|
12302
12429
|
const TextareaElement = styled(Box)`
|
|
@@ -12441,6 +12568,39 @@ const Input = styled.input`
|
|
|
12441
12568
|
z-index: 0;
|
|
12442
12569
|
width: 100%;
|
|
12443
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" }));
|
|
12444
12604
|
const defaultState = {
|
|
12445
12605
|
x: 0,
|
|
12446
12606
|
y: 0,
|
|
@@ -12473,6 +12633,56 @@ function useMeasure() {
|
|
|
12473
12633
|
}, [element, observer]);
|
|
12474
12634
|
return [ref, rect];
|
|
12475
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
|
+
};
|
|
12476
12686
|
const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
|
|
12477
12687
|
const isValidFocusedElement = () => {
|
|
12478
12688
|
const focused = document.activeElement;
|
|
@@ -12544,8 +12754,7 @@ export {
|
|
|
12544
12754
|
Alert,
|
|
12545
12755
|
Avatar,
|
|
12546
12756
|
Badge,
|
|
12547
|
-
|
|
12548
|
-
BaseLink,
|
|
12757
|
+
BaseLinkImpl as BaseLink,
|
|
12549
12758
|
Box,
|
|
12550
12759
|
Breadcrumbs,
|
|
12551
12760
|
Button,
|
|
@@ -12628,7 +12837,7 @@ export {
|
|
|
12628
12837
|
SubNavLinkSection,
|
|
12629
12838
|
SubNavSection,
|
|
12630
12839
|
SubNavSections,
|
|
12631
|
-
Switch,
|
|
12840
|
+
SwitchImpl as Switch,
|
|
12632
12841
|
TFooter,
|
|
12633
12842
|
Table,
|
|
12634
12843
|
Tabs,
|