@ultraviolet/ui 3.0.0-beta.27 → 3.0.0-beta.28
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/ActionBar/index.js +19 -7
- package/dist/components/Alert/index.d.ts +2 -1
- package/dist/components/Alert/index.js +98 -20
- package/dist/components/Alert/styles.css.d.ts +10 -1
- package/dist/components/Alert/styles.css.js +7 -5
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/Avatar/index.js +46 -36
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Badge/index.js +19 -8
- package/dist/components/Banner/index.d.ts +1 -1
- package/dist/components/Banner/index.js +87 -28
- package/dist/components/BarChart/Tooltip.d.ts +1 -1
- package/dist/components/BarChart/Tooltip.js +23 -10
- package/dist/components/BarChart/index.d.ts +1 -1
- package/dist/components/BarChart/index.js +51 -31
- package/dist/components/BarStack/index.d.ts +1 -1
- package/dist/components/BarStack/index.js +64 -19
- package/dist/components/Breadcrumbs/components/Item.d.ts +1 -1
- package/dist/components/Breadcrumbs/components/Item.js +48 -12
- package/dist/components/Breadcrumbs/index.js +11 -2
- package/dist/components/Bullet/index.d.ts +1 -1
- package/dist/components/Bullet/index.js +10 -7
- package/dist/components/Button/index.js +122 -72
- package/dist/components/Card/index.js +80 -20
- package/dist/components/Carousel/index.d.ts +3 -3
- package/dist/components/Carousel/index.js +72 -26
- package/dist/components/Checkbox/index.js +139 -43
- package/dist/components/CheckboxGroup/index.d.ts +3 -3
- package/dist/components/CheckboxGroup/index.js +77 -24
- package/dist/components/Chip/ChipIcon.d.ts +1 -1
- package/dist/components/Chip/ChipIcon.js +46 -12
- package/dist/components/Chip/index.d.ts +3 -3
- package/dist/components/Chip/index.js +36 -11
- package/dist/components/CopyButton/index.d.ts +1 -1
- package/dist/components/CopyButton/index.js +23 -8
- package/dist/components/DateInput/components/CalendarContent.d.ts +1 -1
- package/dist/components/DateInput/components/CalendarContent.js +61 -26
- package/dist/components/DateInput/components/CalendarDaily.d.ts +1 -1
- package/dist/components/DateInput/components/CalendarDaily.js +105 -62
- package/dist/components/DateInput/components/CalendarMonthly.d.ts +1 -1
- package/dist/components/DateInput/components/CalendarMonthly.js +62 -39
- package/dist/components/DateInput/components/Popup.d.ts +1 -1
- package/dist/components/DateInput/components/Popup.js +27 -4
- package/dist/components/DateInput/helpers.js +9 -2
- package/dist/components/DateInput/helpersLocale.js +3 -9
- package/dist/components/DateInput/index.d.ts +1 -1
- package/dist/components/DateInput/index.js +193 -62
- package/dist/components/Dialog/Context.js +3 -1
- package/dist/components/Dialog/components/Button.d.ts +1 -1
- package/dist/components/Dialog/components/Button.js +12 -2
- package/dist/components/Dialog/components/Buttons.d.ts +1 -1
- package/dist/components/Dialog/components/Buttons.js +1 -1
- package/dist/components/Dialog/components/CancelButton.d.ts +1 -1
- package/dist/components/Dialog/components/CancelButton.js +12 -2
- package/dist/components/Dialog/components/Stack.d.ts +1 -1
- package/dist/components/Dialog/components/Stack.js +2 -5
- package/dist/components/Dialog/components/Text.d.ts +1 -1
- package/dist/components/Dialog/components/Text.js +2 -5
- package/dist/components/Dialog/index.d.ts +7 -7
- package/dist/components/Dialog/index.js +43 -12
- package/dist/components/Drawer/index.d.ts +4 -4
- package/dist/components/Drawer/index.js +53 -15
- package/dist/components/EmptyState/index.d.ts +1 -1
- package/dist/components/EmptyState/index.js +63 -21
- package/dist/components/Expandable/index.d.ts +2 -2
- package/dist/components/Expandable/index.js +52 -15
- package/dist/components/ExpandableCard/components/Title.d.ts +1 -1
- package/dist/components/ExpandableCard/components/Title.js +12 -2
- package/dist/components/ExpandableCard/index.d.ts +1 -1
- package/dist/components/ExpandableCard/index.js +197 -96
- package/dist/components/GlobalAlert/GlobalAlertLink.d.ts +1 -1
- package/dist/components/GlobalAlert/GlobalAlertLink.js +21 -5
- package/dist/components/GlobalAlert/index.d.ts +2 -2
- package/dist/components/GlobalAlert/index.js +51 -11
- package/dist/components/InfiniteScroll/index.d.ts +1 -1
- package/dist/components/InfiniteScroll/index.js +40 -33
- package/dist/components/Key/index.d.ts +1 -1
- package/dist/components/Key/index.js +29 -8
- package/dist/components/Label/index.d.ts +1 -1
- package/dist/components/Label/index.js +67 -6
- package/dist/components/LineChart/CustomLegend.d.ts +1 -1
- package/dist/components/LineChart/CustomLegend.js +69 -45
- package/dist/components/LineChart/Tooltip.d.ts +1 -1
- package/dist/components/LineChart/Tooltip.js +31 -9
- package/dist/components/LineChart/helpers.js +13 -12
- package/dist/components/LineChart/index.d.ts +1 -1
- package/dist/components/LineChart/index.js +56 -40
- package/dist/components/Link/index.js +74 -57
- package/dist/components/List/Cell.js +24 -22
- package/dist/components/List/ColumnProvider.d.ts +1 -1
- package/dist/components/List/ColumnProvider.js +12 -6
- package/dist/components/List/HeaderCell.d.ts +1 -1
- package/dist/components/List/HeaderCell.js +36 -19
- package/dist/components/List/HeaderRow.d.ts +1 -1
- package/dist/components/List/HeaderRow.js +14 -12
- package/dist/components/List/ListContext.d.ts +1 -1
- package/dist/components/List/ListContext.js +128 -78
- package/dist/components/List/Row.js +166 -90
- package/dist/components/List/SelectBar.d.ts +1 -1
- package/dist/components/List/SelectBar.js +20 -10
- package/dist/components/List/SkeletonRows.d.ts +1 -1
- package/dist/components/List/SkeletonRows.js +26 -16
- package/dist/components/List/index.d.ts +1 -1
- package/dist/components/List/index.js +60 -22
- package/dist/components/Loader/index.d.ts +1 -1
- package/dist/components/Loader/index.js +47 -23
- package/dist/components/Menu/MenuContent.d.ts +1 -1
- package/dist/components/Menu/MenuContent.js +216 -162
- package/dist/components/Menu/MenuProvider.d.ts +1 -1
- package/dist/components/Menu/MenuProvider.js +26 -13
- package/dist/components/Menu/components/Group.d.ts +1 -1
- package/dist/components/Menu/components/Group.js +11 -2
- package/dist/components/Menu/components/Item.js +144 -82
- package/dist/components/Menu/helpers.js +3 -1
- package/dist/components/Menu/index.d.ts +2 -2
- package/dist/components/Menu/index.js +5 -11
- package/dist/components/Menu/types.d.ts +2 -2
- package/dist/components/Meter/index.d.ts +1 -1
- package/dist/components/Meter/index.js +43 -12
- package/dist/components/Modal/ModalContent.d.ts +1 -1
- package/dist/components/Modal/ModalContent.js +41 -11
- package/dist/components/Modal/ModalProvider.d.ts +1 -1
- package/dist/components/Modal/ModalProvider.js +14 -11
- package/dist/components/Modal/components/Dialog.js +91 -47
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/index.js +60 -3
- package/dist/components/Notice/index.d.ts +1 -1
- package/dist/components/Notice/index.js +24 -5
- package/dist/components/Notification/Notification.js +12 -2
- package/dist/components/Notification/NotificationContainer.d.ts +1 -1
- package/dist/components/Notification/NotificationContainer.js +18 -2
- package/dist/components/NumberInput/index.d.ts +1 -1
- package/dist/components/NumberInput/index.js +239 -130
- package/dist/components/Pagination/PaginationButtons.d.ts +1 -1
- package/dist/components/Pagination/PaginationButtons.js +75 -10
- package/dist/components/Pagination/PerPage.d.ts +1 -1
- package/dist/components/Pagination/PerPage.js +32 -17
- package/dist/components/Pagination/getPageNumbers.js +12 -13
- package/dist/components/Pagination/index.d.ts +1 -1
- package/dist/components/Pagination/index.js +26 -3
- package/dist/components/PasswordCheck/index.d.ts +1 -1
- package/dist/components/PasswordCheck/index.js +27 -5
- package/dist/components/PieChart/Legends.d.ts +1 -1
- package/dist/components/PieChart/Legends.js +52 -20
- package/dist/components/PieChart/Tooltip.d.ts +1 -1
- package/dist/components/PieChart/Tooltip.js +2 -4
- package/dist/components/PieChart/index.d.ts +1 -1
- package/dist/components/PieChart/index.js +80 -40
- package/dist/components/Popover/index.js +104 -46
- package/dist/components/Popup/helpers.d.ts +5 -1
- package/dist/components/Popup/helpers.js +49 -35
- package/dist/components/Popup/index.js +344 -254
- package/dist/components/Popup/styles.css.js +0 -1
- package/dist/components/Popup/variables.css.js +1 -0
- package/dist/components/ProgressBar/index.d.ts +1 -1
- package/dist/components/ProgressBar/index.js +74 -20
- package/dist/components/ProgressBar/styles.css.js +1 -0
- package/dist/components/ProgressBar/variables.css.js +0 -1
- package/dist/components/Radio/index.js +83 -51
- package/dist/components/RadioGroup/index.d.ts +2 -2
- package/dist/components/RadioGroup/index.js +74 -20
- package/dist/components/Row/index.d.ts +1 -1
- package/dist/components/Row/index.js +38 -27
- package/dist/components/SearchInput/KeyGroup.d.ts +1 -1
- package/dist/components/SearchInput/KeyGroup.js +2 -6
- package/dist/components/SearchInput/index.js +232 -164
- package/dist/components/SelectInput/SelectInputProvider.d.ts +1 -1
- package/dist/components/SelectInput/SelectInputProvider.js +91 -55
- package/dist/components/SelectInput/components/Dropdown.d.ts +1 -1
- package/dist/components/SelectInput/components/Dropdown.js +408 -95
- package/dist/components/SelectInput/components/DropdownOption.d.ts +1 -1
- package/dist/components/SelectInput/components/DropdownOption.js +176 -27
- package/dist/components/SelectInput/components/SearchBarDropdown.d.ts +1 -1
- package/dist/components/SelectInput/components/SearchBarDropdown.js +40 -14
- package/dist/components/SelectInput/components/SelectBar.d.ts +1 -1
- package/dist/components/SelectInput/components/SelectBar.js +252 -97
- package/dist/components/SelectInput/index.d.ts +1 -1
- package/dist/components/SelectInput/index.js +102 -10
- package/dist/components/SelectableCard/index.js +200 -114
- package/dist/components/SelectableCardGroup/index.d.ts +2 -2
- package/dist/components/SelectableCardGroup/index.js +67 -25
- package/dist/components/SelectableCardOptionGroup/Provider.js +3 -1
- package/dist/components/SelectableCardOptionGroup/components/Image.d.ts +1 -1
- package/dist/components/SelectableCardOptionGroup/components/Image.js +12 -8
- package/dist/components/SelectableCardOptionGroup/components/Option.d.ts +1 -1
- package/dist/components/SelectableCardOptionGroup/components/Option.js +96 -19
- package/dist/components/SelectableCardOptionGroup/index.d.ts +2 -2
- package/dist/components/SelectableCardOptionGroup/index.js +53 -17
- package/dist/components/Separator/index.d.ts +1 -1
- package/dist/components/Separator/index.js +43 -26
- package/dist/components/Skeleton/Block.d.ts +1 -1
- package/dist/components/Skeleton/Block.js +2 -6
- package/dist/components/Skeleton/Blocks.d.ts +1 -1
- package/dist/components/Skeleton/Blocks.js +14 -9
- package/dist/components/Skeleton/BoxWithIcon.d.ts +1 -1
- package/dist/components/Skeleton/BoxWithIcon.js +14 -9
- package/dist/components/Skeleton/Donut.d.ts +1 -1
- package/dist/components/Skeleton/Donut.js +10 -2
- package/dist/components/Skeleton/IconSkeleton.d.ts +1 -1
- package/dist/components/Skeleton/IconSkeleton.js +1 -1
- package/dist/components/Skeleton/Line.d.ts +1 -1
- package/dist/components/Skeleton/Line.js +10 -4
- package/dist/components/Skeleton/List.d.ts +1 -1
- package/dist/components/Skeleton/List.js +3 -9
- package/dist/components/Skeleton/Slider.d.ts +1 -1
- package/dist/components/Skeleton/Slider.js +11 -8
- package/dist/components/Skeleton/Square.d.ts +1 -1
- package/dist/components/Skeleton/Square.js +1 -1
- package/dist/components/Skeleton/index.d.ts +9 -9
- package/dist/components/Skeleton/index.js +16 -5
- package/dist/components/Slider/components/DoubleSlider.d.ts +1 -1
- package/dist/components/Slider/components/DoubleSlider.js +191 -88
- package/dist/components/Slider/components/Options.d.ts +1 -1
- package/dist/components/Slider/components/Options.js +44 -28
- package/dist/components/Slider/components/SingleSlider.d.ts +1 -1
- package/dist/components/Slider/components/SingleSlider.js +133 -53
- package/dist/components/Slider/index.d.ts +1 -1
- package/dist/components/Slider/index.js +82 -12
- package/dist/components/Snippet/index.d.ts +1 -1
- package/dist/components/Snippet/index.js +103 -19
- package/dist/components/Stack/index.d.ts +1 -1
- package/dist/components/Stack/index.js +20 -24
- package/dist/components/Status/index.d.ts +1 -1
- package/dist/components/Status/index.js +13 -11
- package/dist/components/StepList/index.d.ts +2 -2
- package/dist/components/StepList/index.js +31 -10
- package/dist/components/Stepper/Step.d.ts +1 -1
- package/dist/components/Stepper/Step.js +65 -30
- package/dist/components/Stepper/StepperProvider.d.ts +1 -1
- package/dist/components/Stepper/StepperProvider.js +13 -10
- package/dist/components/Stepper/index.d.ts +2 -2
- package/dist/components/Stepper/index.js +46 -26
- package/dist/components/SwitchButton/FocusOverlay.d.ts +1 -1
- package/dist/components/SwitchButton/FocusOverlay.js +11 -5
- package/dist/components/SwitchButton/Option.d.ts +1 -1
- package/dist/components/SwitchButton/Option.js +20 -2
- package/dist/components/SwitchButton/index.d.ts +2 -2
- package/dist/components/SwitchButton/index.js +95 -48
- package/dist/components/Table/Body.d.ts +1 -1
- package/dist/components/Table/Body.js +2 -4
- package/dist/components/Table/Cell.d.ts +1 -1
- package/dist/components/Table/Cell.js +20 -17
- package/dist/components/Table/Header.d.ts +1 -1
- package/dist/components/Table/Header.js +2 -4
- package/dist/components/Table/HeaderCell.d.ts +1 -1
- package/dist/components/Table/HeaderCell.js +46 -22
- package/dist/components/Table/HeaderRow.d.ts +1 -1
- package/dist/components/Table/HeaderRow.js +21 -12
- package/dist/components/Table/Row.d.ts +1 -1
- package/dist/components/Table/Row.js +70 -14
- package/dist/components/Table/SelectBar.d.ts +1 -1
- package/dist/components/Table/SelectBar.js +20 -10
- package/dist/components/Table/SkeletonRows.d.ts +1 -1
- package/dist/components/Table/SkeletonRows.js +17 -16
- package/dist/components/Table/TableContext.d.ts +1 -1
- package/dist/components/Table/TableContext.js +22 -13
- package/dist/components/Table/index.d.ts +6 -6
- package/dist/components/Table/index.js +64 -23
- package/dist/components/Tabs/Tab.js +79 -41
- package/dist/components/Tabs/TabMenu.js +39 -23
- package/dist/components/Tabs/TabMenuItem.d.ts +1 -1
- package/dist/components/Tabs/TabMenuItem.js +20 -11
- package/dist/components/Tabs/TabsContext.js +3 -1
- package/dist/components/Tabs/index.d.ts +3 -3
- package/dist/components/Tabs/index.js +34 -14
- package/dist/components/Tag/index.d.ts +1 -1
- package/dist/components/Tag/index.js +45 -12
- package/dist/components/TagInput/index.d.ts +1 -1
- package/dist/components/TagInput/index.js +131 -52
- package/dist/components/TagInput/styles.css.d.ts +3 -0
- package/dist/components/TagList/index.d.ts +1 -1
- package/dist/components/TagList/index.js +132 -59
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/Text/index.js +21 -17
- package/dist/components/Text/style.css.js +0 -1
- package/dist/components/Text/variables.css.js +1 -0
- package/dist/components/TextArea/index.js +178 -103
- package/dist/components/TextInput/index.d.ts +1 -1
- package/dist/components/TextInput/index.js +286 -106
- package/dist/components/TimeInput/constants.js +1 -5
- package/dist/components/TimeInput/index.d.ts +1 -1
- package/dist/components/TimeInput/index.js +207 -118
- package/dist/components/Toaster/Toaster.js +1 -1
- package/dist/components/Toaster/ToasterContainer.d.ts +1 -1
- package/dist/components/Toaster/ToasterContainer.js +21 -2
- package/dist/components/Toaster/components/Button.d.ts +1 -1
- package/dist/components/Toaster/components/CloseButton.d.ts +1 -1
- package/dist/components/Toaster/components/CloseButton.js +12 -2
- package/dist/components/Toaster/components/Content.d.ts +1 -1
- package/dist/components/Toaster/components/Content.js +2 -4
- package/dist/components/Toaster/components/Link.d.ts +1 -1
- package/dist/components/Toaster/index.d.ts +2 -2
- package/dist/components/Toggle/index.js +101 -40
- package/dist/components/ToggleGroup/index.d.ts +3 -3
- package/dist/components/ToggleGroup/index.js +61 -22
- package/dist/components/Tooltip/index.js +42 -19
- package/dist/components/TreeMapChart/Tooltip.d.ts +1 -1
- package/dist/components/TreeMapChart/Tooltip.js +1 -1
- package/dist/components/TreeMapChart/index.d.ts +1 -1
- package/dist/components/TreeMapChart/index.js +33 -27
- package/dist/components/UnitInput/index.d.ts +1 -1
- package/dist/components/UnitInput/index.js +110 -29
- package/dist/components/VerificationCode/index.d.ts +1 -1
- package/dist/components/VerificationCode/index.js +80 -21
- package/dist/helpers/legend.js +4 -4
- package/dist/helpers/treeMap.d.ts +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -4
- package/dist/theme/ThemeProvider.d.ts +1 -1
- package/dist/theme/ThemeProvider.js +4 -2
- package/dist/theme/index.js +1 -8
- package/dist/ui.css +1 -1
- package/dist/utils/ids.js +1 -3
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/responsive/index.d.ts +0 -1
- package/dist/utils/responsive/style.css.d.ts +3 -0
- package/package.json +2 -7
- package/dist/utils/responsive/Breakpoint.d.ts +0 -9
- package/dist/utils/responsive/Breakpoint.js +0 -14
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs } from "
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Modal } from "../Modal/index.js";
|
|
4
4
|
import { Separator } from "../Separator/index.js";
|
|
5
5
|
import { Stack } from "../Stack/index.js";
|
|
6
6
|
import { Text } from "../Text/index.js";
|
|
7
7
|
import { drawer, drawerContentWrapper, drawerChildrenWrapper, drawerFooter, drawerContent, drawerHeader } from "./styles.css.js";
|
|
8
|
-
const DrawerContent = ({
|
|
9
|
-
children
|
|
10
|
-
}) => /* @__PURE__ */ jsx("div", { className: drawerContent, children });
|
|
8
|
+
const DrawerContent = ({ children }) => /* @__PURE__ */ jsx("div", { className: drawerContent, children });
|
|
11
9
|
const BaseDrawer = ({
|
|
12
10
|
size = "medium",
|
|
13
11
|
onClose,
|
|
@@ -29,22 +27,62 @@ const BaseDrawer = ({
|
|
|
29
27
|
}) => {
|
|
30
28
|
const computeHeader = (modalProps) => {
|
|
31
29
|
if (typeof header === "string") {
|
|
32
|
-
return /* @__PURE__ */ jsx(
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
Text,
|
|
32
|
+
{
|
|
33
|
+
as: "h2",
|
|
34
|
+
className: drawerHeader,
|
|
35
|
+
prominence: "default",
|
|
36
|
+
sentiment: "neutral",
|
|
37
|
+
variant: "headingSmallStrong",
|
|
38
|
+
children: header
|
|
39
|
+
}
|
|
40
|
+
);
|
|
33
41
|
}
|
|
34
42
|
if (typeof header === "function") {
|
|
35
|
-
return /* @__PURE__ */ jsx(
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
Text,
|
|
45
|
+
{
|
|
46
|
+
as: "h2",
|
|
47
|
+
className: drawerHeader,
|
|
48
|
+
prominence: "default",
|
|
49
|
+
sentiment: "neutral",
|
|
50
|
+
variant: "headingSmallStrong",
|
|
51
|
+
children: header(modalProps)
|
|
52
|
+
}
|
|
53
|
+
);
|
|
36
54
|
}
|
|
37
55
|
return header;
|
|
38
56
|
};
|
|
39
|
-
return /* @__PURE__ */ jsx(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
57
|
+
return /* @__PURE__ */ jsx(
|
|
58
|
+
Modal,
|
|
59
|
+
{
|
|
60
|
+
ariaLabel,
|
|
61
|
+
backdropClassName: "backdrop-drawer",
|
|
62
|
+
className: `${className ? `${className} ` : ""}${drawer[size]}`,
|
|
63
|
+
"data-size": size,
|
|
64
|
+
"data-testid": dataTestId,
|
|
65
|
+
disclosure,
|
|
66
|
+
hideOnClickOutside,
|
|
67
|
+
hideOnEsc,
|
|
68
|
+
id,
|
|
69
|
+
isClosable,
|
|
70
|
+
onClose,
|
|
71
|
+
open,
|
|
72
|
+
placement: "top-right",
|
|
73
|
+
size,
|
|
74
|
+
style,
|
|
75
|
+
children: (modalProps) => {
|
|
76
|
+
const content = typeof children === "function" ? children(modalProps) : children;
|
|
77
|
+
return /* @__PURE__ */ jsxs(Stack, { className: drawerContentWrapper, gap: 2, children: [
|
|
78
|
+
computeHeader(modalProps),
|
|
79
|
+
separator ? /* @__PURE__ */ jsx(Separator, {}) : null,
|
|
80
|
+
/* @__PURE__ */ jsx("div", { className: drawerChildrenWrapper, children: noPadding ? content : /* @__PURE__ */ jsx(DrawerContent, { children: content }) }),
|
|
81
|
+
/* @__PURE__ */ jsx(Stack, { className: drawerFooter, children: typeof footer === "function" ? footer(modalProps) : footer })
|
|
82
|
+
] });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
);
|
|
48
86
|
};
|
|
49
87
|
const Drawer = Object.assign(BaseDrawer, {
|
|
50
88
|
Content: DrawerContent
|
|
@@ -30,5 +30,5 @@ type EmptyStateProps = {
|
|
|
30
30
|
/**
|
|
31
31
|
* EmptyState component is used to display a message when there is no data to show.
|
|
32
32
|
*/
|
|
33
|
-
export declare const EmptyState: ({ image, title, size, description, primaryButton, secondaryButton, learnMore, className, bordered, children, "data-testid": dataTestId, style, }: EmptyStateProps) => import("
|
|
33
|
+
export declare const EmptyState: ({ image, title, size, description, primaryButton, secondaryButton, learnMore, className, bordered, children, "data-testid": dataTestId, style, }: EmptyStateProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
34
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs } from "
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Link } from "../Link/index.js";
|
|
4
4
|
import { Stack } from "../Stack/index.js";
|
|
5
5
|
import { Text } from "../Text/index.js";
|
|
@@ -17,26 +17,68 @@ const EmptyState = ({
|
|
|
17
17
|
children,
|
|
18
18
|
"data-testid": dataTestId,
|
|
19
19
|
style
|
|
20
|
-
}) => /* @__PURE__ */ jsx(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/* @__PURE__ */ jsxs(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
20
|
+
}) => /* @__PURE__ */ jsx(
|
|
21
|
+
Stack,
|
|
22
|
+
{
|
|
23
|
+
className: `${className ? `${className} ` : ""}${emptyStateContainer({ bordered, size })}`,
|
|
24
|
+
"data-testid": dataTestId,
|
|
25
|
+
style,
|
|
26
|
+
children: /* @__PURE__ */ jsxs(
|
|
27
|
+
Stack,
|
|
28
|
+
{
|
|
29
|
+
alignItems: "center",
|
|
30
|
+
className: paddedStack,
|
|
31
|
+
gap: size === "small" ? 2 : 3,
|
|
32
|
+
justifyContent: "center",
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsxs(Stack, { alignItems: "center", gap: 2, justifyContent: "center", children: [
|
|
35
|
+
image && typeof image === "string" ? /* @__PURE__ */ jsx("img", { alt: "", className: emptyStateImage[size], src: image }) : image,
|
|
36
|
+
/* @__PURE__ */ jsxs(Stack, { alignItems: "center", gap: 0.5, children: [
|
|
37
|
+
title ? /* @__PURE__ */ jsx(
|
|
38
|
+
Text,
|
|
39
|
+
{
|
|
40
|
+
as: "h2",
|
|
41
|
+
placement: "center",
|
|
42
|
+
prominence: "strong",
|
|
43
|
+
sentiment: "neutral",
|
|
44
|
+
variant: size === "small" ? "bodyStrong" : "headingSmall",
|
|
45
|
+
children: title
|
|
46
|
+
}
|
|
47
|
+
) : null,
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
Text,
|
|
50
|
+
{
|
|
51
|
+
as: "p",
|
|
52
|
+
placement: "center",
|
|
53
|
+
sentiment: "neutral",
|
|
54
|
+
variant: size === "small" ? "bodySmall" : "body",
|
|
55
|
+
children: description
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] })
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ jsxs(Stack, { alignItems: "center", gap: 2, justifyContent: "center", children: [
|
|
61
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", gap: 2, children: [
|
|
62
|
+
secondaryButton,
|
|
63
|
+
primaryButton
|
|
64
|
+
] }),
|
|
65
|
+
learnMore?.text ? /* @__PURE__ */ jsx(
|
|
66
|
+
Link,
|
|
67
|
+
{
|
|
68
|
+
href: learnMore.link,
|
|
69
|
+
iconPosition: "right",
|
|
70
|
+
size: size === "small" ? "small" : void 0,
|
|
71
|
+
target: learnMore.target,
|
|
72
|
+
children: learnMore.text
|
|
73
|
+
}
|
|
74
|
+
) : null
|
|
75
|
+
] }),
|
|
76
|
+
children
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
);
|
|
40
82
|
export {
|
|
41
83
|
EmptyState
|
|
42
84
|
};
|
|
@@ -20,11 +20,11 @@ type ExpandableProps = {
|
|
|
20
20
|
animationDuration?: number;
|
|
21
21
|
style?: CSSProperties;
|
|
22
22
|
};
|
|
23
|
-
export declare const AnimatedExpandable: ({ children, opened, minHeight, className, "data-testid": dataTestId, style, animationDuration, }: ExpandableProps) => import("
|
|
23
|
+
export declare const AnimatedExpandable: ({ children, opened, minHeight, className, "data-testid": dataTestId, style, animationDuration, }: ExpandableProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
/**
|
|
25
25
|
* The Expandable component is a dynamic React component that allows for the expansion of its children content
|
|
26
26
|
* based on its height. The component comes with a sleek and smooth animation, providing a visually pleasing
|
|
27
27
|
* user experience.
|
|
28
28
|
*/
|
|
29
|
-
export declare const Expandable: ({ children, opened, minHeight, className, "data-testid": dataTestId, animationDuration, style, }: ExpandableProps) => import("
|
|
29
|
+
export declare const Expandable: ({ children, opened, minHeight, className, "data-testid": dataTestId, animationDuration, style, }: ExpandableProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
30
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
4
4
|
import { useState, useRef, useEffect } from "react";
|
|
5
5
|
import { expandable, animationDurationVar } from "./styles.css.js";
|
|
@@ -11,11 +11,15 @@ const NoAnimationExpandable = ({
|
|
|
11
11
|
className,
|
|
12
12
|
"data-testid": dataTestId,
|
|
13
13
|
style
|
|
14
|
-
}) => /* @__PURE__ */ jsx(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
}) => /* @__PURE__ */ jsx(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className,
|
|
18
|
+
"data-testid": dataTestId,
|
|
19
|
+
style: { display: !opened ? "none" : void 0, minHeight, ...style },
|
|
20
|
+
children
|
|
21
|
+
}
|
|
22
|
+
);
|
|
19
23
|
const AnimatedExpandable = ({
|
|
20
24
|
children,
|
|
21
25
|
opened,
|
|
@@ -26,7 +30,9 @@ const AnimatedExpandable = ({
|
|
|
26
30
|
animationDuration = ANIMATION_DURATION
|
|
27
31
|
}) => {
|
|
28
32
|
const [height, setHeight] = useState(null);
|
|
29
|
-
const transitionTimer = useRef(
|
|
33
|
+
const transitionTimer = useRef(
|
|
34
|
+
null
|
|
35
|
+
);
|
|
30
36
|
const ref = useRef(null);
|
|
31
37
|
const shouldBeAnimated = animationDuration > 0;
|
|
32
38
|
const isFirstRender = useRef(true);
|
|
@@ -81,12 +87,22 @@ const AnimatedExpandable = ({
|
|
|
81
87
|
}
|
|
82
88
|
};
|
|
83
89
|
}, [animationDuration, height, minHeight, opened, shouldBeAnimated]);
|
|
84
|
-
return /* @__PURE__ */ jsx(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
return /* @__PURE__ */ jsx(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
className: `${className ? `${className} ` : ""}${expandable}`,
|
|
94
|
+
"data-is-animated": shouldBeAnimated && !isFirstRender.current,
|
|
95
|
+
"data-testid": dataTestId,
|
|
96
|
+
ref,
|
|
97
|
+
style: {
|
|
98
|
+
...assignInlineVars({
|
|
99
|
+
[animationDurationVar]: `${animationDuration}ms`
|
|
100
|
+
}),
|
|
101
|
+
...style
|
|
102
|
+
},
|
|
103
|
+
children
|
|
104
|
+
}
|
|
105
|
+
);
|
|
90
106
|
};
|
|
91
107
|
const Expandable = ({
|
|
92
108
|
children,
|
|
@@ -98,9 +114,30 @@ const Expandable = ({
|
|
|
98
114
|
style
|
|
99
115
|
}) => {
|
|
100
116
|
if (animationDuration > 0) {
|
|
101
|
-
return /* @__PURE__ */ jsx(
|
|
117
|
+
return /* @__PURE__ */ jsx(
|
|
118
|
+
AnimatedExpandable,
|
|
119
|
+
{
|
|
120
|
+
animationDuration,
|
|
121
|
+
className,
|
|
122
|
+
"data-testid": dataTestId,
|
|
123
|
+
minHeight,
|
|
124
|
+
opened,
|
|
125
|
+
style,
|
|
126
|
+
children
|
|
127
|
+
}
|
|
128
|
+
);
|
|
102
129
|
}
|
|
103
|
-
return /* @__PURE__ */ jsx(
|
|
130
|
+
return /* @__PURE__ */ jsx(
|
|
131
|
+
NoAnimationExpandable,
|
|
132
|
+
{
|
|
133
|
+
className,
|
|
134
|
+
"data-testid": dataTestId,
|
|
135
|
+
minHeight,
|
|
136
|
+
opened,
|
|
137
|
+
style,
|
|
138
|
+
children
|
|
139
|
+
}
|
|
140
|
+
);
|
|
104
141
|
};
|
|
105
142
|
export {
|
|
106
143
|
AnimatedExpandable,
|
|
@@ -4,4 +4,4 @@ export type ExpandableCardTitleProps = {
|
|
|
4
4
|
size?: 'medium' | 'large';
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
} & Partial<Pick<ComponentProps<typeof Text>, 'as' | 'style'>> & Pick<ComponentProps<typeof Text>, 'children'>;
|
|
7
|
-
export declare const ExpandableCardTitle: ({ as, size, children, disabled, style, }: ExpandableCardTitleProps) => import("
|
|
7
|
+
export declare const ExpandableCardTitle: ({ as, size, children, disabled, style, }: ExpandableCardTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Text } from "../../Text/index.js";
|
|
4
4
|
const ExpandableCardTitle = ({
|
|
5
5
|
as,
|
|
@@ -7,7 +7,17 @@ const ExpandableCardTitle = ({
|
|
|
7
7
|
children,
|
|
8
8
|
disabled,
|
|
9
9
|
style
|
|
10
|
-
}) => /* @__PURE__ */ jsx(
|
|
10
|
+
}) => /* @__PURE__ */ jsx(
|
|
11
|
+
Text,
|
|
12
|
+
{
|
|
13
|
+
as: as ?? "h2",
|
|
14
|
+
disabled,
|
|
15
|
+
sentiment: "neutral",
|
|
16
|
+
style,
|
|
17
|
+
variant: size === "medium" ? "bodyStrong" : "headingSmallStrong",
|
|
18
|
+
children
|
|
19
|
+
}
|
|
20
|
+
);
|
|
11
21
|
export {
|
|
12
22
|
ExpandableCardTitle
|
|
13
23
|
};
|
|
@@ -41,6 +41,6 @@ export declare const ExpandableCard: import("react").ForwardRefExoticComponent<(
|
|
|
41
41
|
expanded: boolean;
|
|
42
42
|
onToggleExpand: () => void;
|
|
43
43
|
}))) & import("react").RefAttributes<HTMLDetailsElement>> & {
|
|
44
|
-
Title: ({ as, size, children, disabled, style, }: import("./components/Title").ExpandableCardTitleProps) => import("
|
|
44
|
+
Title: ({ as, size, children, disabled, style, }: import("./components/Title").ExpandableCardTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
45
45
|
};
|
|
46
46
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs, jsx } from "
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { DragIcon, ArrowDownIcon } from "@ultraviolet/icons";
|
|
4
4
|
import { useTheme } from "@ultraviolet/themes";
|
|
5
5
|
import { forwardRef, useRef, useState, useCallback } from "react";
|
|
@@ -7,105 +7,206 @@ import { Stack } from "../Stack/index.js";
|
|
|
7
7
|
import { Tooltip } from "../Tooltip/index.js";
|
|
8
8
|
import { ExpandableCardTitle } from "./components/Title.js";
|
|
9
9
|
import { stackClass, dragIconContainer, detailsClass, summaryClass, arrowIcon, content, dropableArea } from "./styles.css.js";
|
|
10
|
-
const BaseExpandableCard = forwardRef(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
}, []);
|
|
55
|
-
const handleDrop = useCallback((event, isFirst) => {
|
|
56
|
-
event.preventDefault();
|
|
57
|
-
if (draggableRef.current) {
|
|
58
|
-
draggableRef.current.style.borderColor = "transparent";
|
|
59
|
-
}
|
|
60
|
-
if (event?.dataTransfer) {
|
|
61
|
-
const data = JSON.parse(event.dataTransfer.getData("text"));
|
|
62
|
-
onDrop?.(isFirst ? "" : value, data.value ?? "");
|
|
63
|
-
}
|
|
64
|
-
}, [onDrop, value]);
|
|
65
|
-
return /* @__PURE__ */ jsxs(Stack, { className: stackClass, "data-draggable": draggable, "data-name": name, "data-value": value, direction: "row", draggable, gap: 2, onDragEnd, onDragStart, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: containerRef, style, width: "100%", children: [
|
|
66
|
-
draggable ? /* @__PURE__ */ jsx(Stack, { className: dragIconContainer, "data-testid": `draggable-icon-${value}`, "data-visible": isHovered, justifyContent: "center", onKeyDown: (event) => {
|
|
67
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
10
|
+
const BaseExpandableCard = forwardRef(
|
|
11
|
+
({
|
|
12
|
+
header,
|
|
13
|
+
name,
|
|
14
|
+
size = "medium",
|
|
15
|
+
children,
|
|
16
|
+
disabled,
|
|
17
|
+
expanded,
|
|
18
|
+
onToggleExpand,
|
|
19
|
+
className,
|
|
20
|
+
draggable,
|
|
21
|
+
value,
|
|
22
|
+
draggableTooltip = "Click and drag to move",
|
|
23
|
+
onDrop,
|
|
24
|
+
index,
|
|
25
|
+
onKeyDown,
|
|
26
|
+
"data-testid": dataTestId,
|
|
27
|
+
open,
|
|
28
|
+
style
|
|
29
|
+
}, ref) => {
|
|
30
|
+
const headerRef = useRef(null);
|
|
31
|
+
const containerRef = useRef(null);
|
|
32
|
+
const draggableRef = useRef(null);
|
|
33
|
+
const draggableFirstRef = useRef(null);
|
|
34
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
35
|
+
const [clicking, setClicking] = useState(false);
|
|
36
|
+
const theme = useTheme();
|
|
37
|
+
const handleMouseEnter = () => {
|
|
38
|
+
setIsHovered(true);
|
|
39
|
+
};
|
|
40
|
+
const handleMouseLeave = () => {
|
|
41
|
+
setIsHovered(false);
|
|
42
|
+
};
|
|
43
|
+
const onDragStart = useCallback(
|
|
44
|
+
(event) => {
|
|
45
|
+
event.dataTransfer.setData("text/plain", JSON.stringify({ value }));
|
|
46
|
+
},
|
|
47
|
+
[value]
|
|
48
|
+
);
|
|
49
|
+
const onDragEnd = useCallback(() => setClicking(false), []);
|
|
50
|
+
const onDrag = useCallback(
|
|
51
|
+
(event, borderColor, isFirst) => {
|
|
52
|
+
const refElement = isFirst ? draggableFirstRef : draggableRef;
|
|
68
53
|
event.preventDefault();
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
setIsHovered(false);
|
|
72
|
-
} else if (containerRef.current) {
|
|
73
|
-
setClicking(true);
|
|
74
|
-
setIsHovered(true);
|
|
54
|
+
if (refElement.current) {
|
|
55
|
+
refElement.current.style.borderColor = borderColor;
|
|
75
56
|
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
visible: clicking ? false : void 0,
|
|
85
|
-
children: /* @__PURE__ */ jsx(DragIcon, { disabled, prominence: clicking ? "strong" : "weak", sentiment: "neutral", size: "small" })
|
|
86
|
-
}
|
|
87
|
-
) }) : null,
|
|
88
|
-
/* @__PURE__ */ jsxs("details", { className: `${className ? `${className} ` : ""}${detailsClass}`, "data-clicking": clicking, "data-testid": dataTestId, name, open: open ?? expanded, ref, tabIndex: disabled ? -1 : void 0, children: [
|
|
89
|
-
/* @__PURE__ */ jsxs("summary", { className: summaryClass, "data-disabled": !!disabled, "data-testid": dataTestId ? `${dataTestId}-summary` : void 0, onClick: (event) => {
|
|
90
|
-
if (disabled || onToggleExpand) {
|
|
91
|
-
onToggleExpand?.();
|
|
92
|
-
event.preventDefault();
|
|
57
|
+
},
|
|
58
|
+
[]
|
|
59
|
+
);
|
|
60
|
+
const handleDrop = useCallback(
|
|
61
|
+
(event, isFirst) => {
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
if (draggableRef.current) {
|
|
64
|
+
draggableRef.current.style.borderColor = "transparent";
|
|
93
65
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
66
|
+
if (event?.dataTransfer) {
|
|
67
|
+
const data = JSON.parse(
|
|
68
|
+
event.dataTransfer.getData("text")
|
|
69
|
+
);
|
|
70
|
+
onDrop?.(isFirst ? "" : value, data.value ?? "");
|
|
98
71
|
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
72
|
+
},
|
|
73
|
+
[onDrop, value]
|
|
74
|
+
);
|
|
75
|
+
return /* @__PURE__ */ jsxs(
|
|
76
|
+
Stack,
|
|
77
|
+
{
|
|
78
|
+
className: stackClass,
|
|
79
|
+
"data-draggable": draggable,
|
|
80
|
+
"data-name": name,
|
|
81
|
+
"data-value": value,
|
|
82
|
+
direction: "row",
|
|
83
|
+
draggable,
|
|
84
|
+
gap: 2,
|
|
85
|
+
onDragEnd,
|
|
86
|
+
onDragStart,
|
|
87
|
+
onMouseEnter: handleMouseEnter,
|
|
88
|
+
onMouseLeave: handleMouseLeave,
|
|
89
|
+
ref: containerRef,
|
|
90
|
+
style,
|
|
91
|
+
width: "100%",
|
|
92
|
+
children: [
|
|
93
|
+
draggable ? /* @__PURE__ */ jsx(
|
|
94
|
+
Stack,
|
|
95
|
+
{
|
|
96
|
+
className: dragIconContainer,
|
|
97
|
+
"data-testid": `draggable-icon-${value}`,
|
|
98
|
+
"data-visible": isHovered,
|
|
99
|
+
justifyContent: "center",
|
|
100
|
+
onKeyDown: (event) => {
|
|
101
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
if (clicking && containerRef.current) {
|
|
104
|
+
setClicking(false);
|
|
105
|
+
setIsHovered(false);
|
|
106
|
+
} else if (containerRef.current) {
|
|
107
|
+
setClicking(true);
|
|
108
|
+
setIsHovered(true);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (clicking) {
|
|
112
|
+
onKeyDown?.(event);
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
onMouseDown: () => setClicking(true),
|
|
116
|
+
onMouseUp: () => setClicking(false),
|
|
117
|
+
children: /* @__PURE__ */ jsx(
|
|
118
|
+
Tooltip,
|
|
119
|
+
{
|
|
120
|
+
text: draggableTooltip,
|
|
121
|
+
visible: clicking ? false : void 0,
|
|
122
|
+
children: /* @__PURE__ */ jsx(
|
|
123
|
+
DragIcon,
|
|
124
|
+
{
|
|
125
|
+
disabled,
|
|
126
|
+
prominence: clicking ? "strong" : "weak",
|
|
127
|
+
sentiment: "neutral",
|
|
128
|
+
size: "small"
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
) : null,
|
|
135
|
+
/* @__PURE__ */ jsxs(
|
|
136
|
+
"details",
|
|
137
|
+
{
|
|
138
|
+
className: `${className ? `${className} ` : ""}${detailsClass}`,
|
|
139
|
+
"data-clicking": clicking,
|
|
140
|
+
"data-testid": dataTestId,
|
|
141
|
+
name,
|
|
142
|
+
open: open ?? expanded,
|
|
143
|
+
ref,
|
|
144
|
+
tabIndex: disabled ? -1 : void 0,
|
|
145
|
+
children: [
|
|
146
|
+
/* @__PURE__ */ jsxs(
|
|
147
|
+
"summary",
|
|
148
|
+
{
|
|
149
|
+
className: summaryClass,
|
|
150
|
+
"data-disabled": !!disabled,
|
|
151
|
+
"data-testid": dataTestId ? `${dataTestId}-summary` : void 0,
|
|
152
|
+
onClick: (event) => {
|
|
153
|
+
if (disabled || onToggleExpand) {
|
|
154
|
+
onToggleExpand?.();
|
|
155
|
+
event.preventDefault();
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
onKeyDown: onToggleExpand ? (event) => {
|
|
159
|
+
if (event.key === " " && event.target === headerRef.current) {
|
|
160
|
+
onToggleExpand();
|
|
161
|
+
event.preventDefault();
|
|
162
|
+
}
|
|
163
|
+
} : void 0,
|
|
164
|
+
ref: headerRef,
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ jsx(
|
|
167
|
+
ArrowDownIcon,
|
|
168
|
+
{
|
|
169
|
+
className: arrowIcon,
|
|
170
|
+
disabled,
|
|
171
|
+
sentiment: "neutral"
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
typeof header === "string" ? /* @__PURE__ */ jsx(ExpandableCardTitle, { disabled, size, children: header }) : header
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
/* @__PURE__ */ jsx("div", { className: content, children })
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
clicking ? "closed" : "open"
|
|
182
|
+
),
|
|
183
|
+
draggable && index === 0 ? /* @__PURE__ */ jsx(
|
|
184
|
+
"div",
|
|
185
|
+
{
|
|
186
|
+
className: dropableArea,
|
|
187
|
+
"data-first": true,
|
|
188
|
+
onDragLeave: (event) => onDrag(event, "transparent", true),
|
|
189
|
+
onDragOver: (event) => onDrag(event, theme.colors.primary.border, true),
|
|
190
|
+
onDrop: (event) => handleDrop(event, true),
|
|
191
|
+
ref: draggableFirstRef
|
|
192
|
+
}
|
|
193
|
+
) : null,
|
|
194
|
+
draggable ? /* @__PURE__ */ jsx(
|
|
195
|
+
"div",
|
|
196
|
+
{
|
|
197
|
+
className: dropableArea,
|
|
198
|
+
"data-testid": `${value}-dropable-area`,
|
|
199
|
+
onDragLeave: (event) => onDrag(event, "transparent"),
|
|
200
|
+
onDragOver: (event) => onDrag(event, theme.colors.primary.border),
|
|
201
|
+
onDrop: handleDrop,
|
|
202
|
+
ref: draggableRef
|
|
203
|
+
}
|
|
204
|
+
) : null
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
);
|
|
109
210
|
const ExpandableCard = Object.assign(BaseExpandableCard, {
|
|
110
211
|
Title: ExpandableCardTitle
|
|
111
212
|
});
|