@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,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs, jsx } from "
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { Stack } from "../Stack/index.js";
|
|
5
5
|
import { Text } from "../Text/index.js";
|
|
@@ -35,13 +35,7 @@ const Slider = ({
|
|
|
35
35
|
style,
|
|
36
36
|
"aria-label": ariaLabel
|
|
37
37
|
}) => {
|
|
38
|
-
const correctedBounds = options ? {
|
|
39
|
-
max: Array.isArray(options) ? options.length - 1 : max,
|
|
40
|
-
min: 0
|
|
41
|
-
} : {
|
|
42
|
-
max,
|
|
43
|
-
min
|
|
44
|
-
};
|
|
38
|
+
const correctedBounds = options ? { max: Array.isArray(options) ? options.length - 1 : max, min: 0 } : { max, min };
|
|
45
39
|
const gap = useMemo(() => {
|
|
46
40
|
if (options) {
|
|
47
41
|
return 3;
|
|
@@ -51,10 +45,86 @@ const Slider = ({
|
|
|
51
45
|
}
|
|
52
46
|
return 1;
|
|
53
47
|
}, [options, input, double, helper]);
|
|
54
|
-
return /* @__PURE__ */ jsxs(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
48
|
+
return /* @__PURE__ */ jsxs(
|
|
49
|
+
Stack,
|
|
50
|
+
{
|
|
51
|
+
"aria-label": ariaLabel,
|
|
52
|
+
className: double && !!options ? sliderContainer : "",
|
|
53
|
+
"data-double": double,
|
|
54
|
+
"data-options": !!options,
|
|
55
|
+
gap,
|
|
56
|
+
style,
|
|
57
|
+
children: [
|
|
58
|
+
double ? /* @__PURE__ */ jsx(
|
|
59
|
+
DoubleSlider,
|
|
60
|
+
{
|
|
61
|
+
"aria-label": ariaLabel,
|
|
62
|
+
className,
|
|
63
|
+
"data-testid": dataTestId,
|
|
64
|
+
direction,
|
|
65
|
+
disabled,
|
|
66
|
+
error,
|
|
67
|
+
id,
|
|
68
|
+
input,
|
|
69
|
+
label,
|
|
70
|
+
max: correctedBounds.max,
|
|
71
|
+
min: correctedBounds.min,
|
|
72
|
+
name,
|
|
73
|
+
onBlur,
|
|
74
|
+
onChange,
|
|
75
|
+
onFocus,
|
|
76
|
+
options,
|
|
77
|
+
prefix,
|
|
78
|
+
required,
|
|
79
|
+
step,
|
|
80
|
+
suffix,
|
|
81
|
+
tooltip,
|
|
82
|
+
tooltipPosition,
|
|
83
|
+
unit,
|
|
84
|
+
value
|
|
85
|
+
}
|
|
86
|
+
) : /* @__PURE__ */ jsx(
|
|
87
|
+
SingleSlider,
|
|
88
|
+
{
|
|
89
|
+
"aria-label": ariaLabel,
|
|
90
|
+
className,
|
|
91
|
+
"data-testid": dataTestId,
|
|
92
|
+
direction,
|
|
93
|
+
disabled,
|
|
94
|
+
error,
|
|
95
|
+
id,
|
|
96
|
+
input,
|
|
97
|
+
label,
|
|
98
|
+
max: correctedBounds.max,
|
|
99
|
+
min: correctedBounds.min,
|
|
100
|
+
name,
|
|
101
|
+
onBlur,
|
|
102
|
+
onChange,
|
|
103
|
+
onFocus,
|
|
104
|
+
options,
|
|
105
|
+
prefix,
|
|
106
|
+
required,
|
|
107
|
+
step,
|
|
108
|
+
suffix,
|
|
109
|
+
tooltip,
|
|
110
|
+
tooltipPosition,
|
|
111
|
+
unit,
|
|
112
|
+
value
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
error || helper ? /* @__PURE__ */ jsx(
|
|
116
|
+
Text,
|
|
117
|
+
{
|
|
118
|
+
as: "p",
|
|
119
|
+
prominence: "weak",
|
|
120
|
+
sentiment: error ? "danger" : "neutral",
|
|
121
|
+
variant: "caption",
|
|
122
|
+
children: typeof error === "string" ? error : helper
|
|
123
|
+
}
|
|
124
|
+
) : null
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
);
|
|
58
128
|
};
|
|
59
129
|
export {
|
|
60
130
|
Slider
|
|
@@ -23,5 +23,5 @@ type SnippetProps = {
|
|
|
23
23
|
* Snippet component is used to display code snippets with the ability to copy the code.
|
|
24
24
|
* It also has the ability to show/hide the code snippet if it has more than 4 lines.
|
|
25
25
|
*/
|
|
26
|
-
export declare const Snippet: ({ children, copyText, copiedText, showText, hideText, prefix, className, "data-testid": dataTestId, initiallyExpanded, rows, noExpandable, onCopy, style, }: SnippetProps) => import("
|
|
26
|
+
export declare const Snippet: ({ children, copyText, copiedText, showText, hideText, prefix, className, "data-testid": dataTestId, initiallyExpanded, rows, noExpandable, onCopy, style, }: SnippetProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
27
|
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 { ArrowDownIcon } from "@ultraviolet/icons";
|
|
4
4
|
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
5
5
|
import { useReducer, Children } from "react";
|
|
@@ -19,14 +19,29 @@ const CodeContent = ({
|
|
|
19
19
|
lines,
|
|
20
20
|
noExpandable,
|
|
21
21
|
rows
|
|
22
|
-
}) => /* @__PURE__ */ jsx(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
})
|
|
22
|
+
}) => /* @__PURE__ */ jsx(
|
|
23
|
+
Text,
|
|
24
|
+
{
|
|
25
|
+
as: "pre",
|
|
26
|
+
className: pretext({
|
|
27
|
+
noExpandable,
|
|
28
|
+
showMore: hasShowMoreButton && !showMore
|
|
29
|
+
}),
|
|
30
|
+
style: assignInlineVars({
|
|
31
|
+
[rowsVar]: rows.toString()
|
|
32
|
+
}),
|
|
33
|
+
variant: "code",
|
|
34
|
+
whiteSpace: !multiline ? "nowrap" : void 0,
|
|
35
|
+
children: multiline ? Children.map(lines, (child) => /* @__PURE__ */ jsx(
|
|
36
|
+
"span",
|
|
37
|
+
{
|
|
38
|
+
className: `${line({ multiline: true })} ${prefix$1 ? prefix[prefix$1] : ""}`,
|
|
39
|
+
children: child
|
|
40
|
+
},
|
|
41
|
+
child
|
|
42
|
+
)) : /* @__PURE__ */ jsx("span", { className: `${line()} ${prefix$1 ? prefix[prefix$1] : ""}`, children })
|
|
43
|
+
}
|
|
44
|
+
);
|
|
30
45
|
const Snippet = ({
|
|
31
46
|
children,
|
|
32
47
|
copyText,
|
|
@@ -43,21 +58,90 @@ const Snippet = ({
|
|
|
43
58
|
style
|
|
44
59
|
}) => {
|
|
45
60
|
const theme = useTheme();
|
|
46
|
-
const [showMore, setShowMore] = useReducer(
|
|
61
|
+
const [showMore, setShowMore] = useReducer(
|
|
62
|
+
(value) => !value,
|
|
63
|
+
initiallyExpanded ?? false
|
|
64
|
+
);
|
|
47
65
|
const lines = children.split(LINES_BREAK_REGEX);
|
|
48
66
|
const numberOfLines = lines.length;
|
|
49
67
|
const multiline = numberOfLines > 1;
|
|
50
68
|
const hasShowMoreButton = numberOfLines > rows && multiline && !noExpandable;
|
|
51
69
|
const minHeight = rows * Number.parseFloat(theme.typography.code.lineHeight) * 16 + Number.parseFloat(theme.space[4]) * 16;
|
|
52
|
-
return /* @__PURE__ */ jsx(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
60
|
-
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
className: `${className ? `${className} ` : ""}${snippetContainer[multiline ? "multiline" : "oneLine"]}`,
|
|
74
|
+
"data-testid": dataTestId,
|
|
75
|
+
style,
|
|
76
|
+
children: /* @__PURE__ */ jsxs(Stack, { className: stackStyle, children: [
|
|
77
|
+
hasShowMoreButton ? /* @__PURE__ */ jsx(Expandable, { minHeight, opened: showMore, children: /* @__PURE__ */ jsx(
|
|
78
|
+
CodeContent,
|
|
79
|
+
{
|
|
80
|
+
lines,
|
|
81
|
+
multiline,
|
|
82
|
+
noExpandable,
|
|
83
|
+
prefix: prefix2,
|
|
84
|
+
rows,
|
|
85
|
+
children
|
|
86
|
+
}
|
|
87
|
+
) }) : /* @__PURE__ */ jsx(
|
|
88
|
+
CodeContent,
|
|
89
|
+
{
|
|
90
|
+
lines,
|
|
91
|
+
multiline,
|
|
92
|
+
noExpandable,
|
|
93
|
+
prefix: prefix2,
|
|
94
|
+
rows,
|
|
95
|
+
children
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ jsx(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
className: buttonContainer[multiline && numberOfLines > 1 ? "multiline" : "oneLine"],
|
|
102
|
+
children: /* @__PURE__ */ jsx(
|
|
103
|
+
CopyButton,
|
|
104
|
+
{
|
|
105
|
+
copiedText,
|
|
106
|
+
copyText,
|
|
107
|
+
onCopy,
|
|
108
|
+
sentiment: "neutral",
|
|
109
|
+
value: children
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
hasShowMoreButton ? /* @__PURE__ */ jsx("div", { className: showMoreContainer[showMore ? "true" : "false"], children: /* @__PURE__ */ jsx(
|
|
115
|
+
"button",
|
|
116
|
+
{
|
|
117
|
+
"aria-expanded": showMore,
|
|
118
|
+
className: showMoreButton,
|
|
119
|
+
onClick: setShowMore,
|
|
120
|
+
type: "button",
|
|
121
|
+
children: /* @__PURE__ */ jsxs(
|
|
122
|
+
Text,
|
|
123
|
+
{
|
|
124
|
+
as: "span",
|
|
125
|
+
className: centeredText,
|
|
126
|
+
sentiment: "neutral",
|
|
127
|
+
variant: "bodySmallStrong",
|
|
128
|
+
children: [
|
|
129
|
+
showMore ? hideText : showText,
|
|
130
|
+
" ",
|
|
131
|
+
/* @__PURE__ */ jsx(
|
|
132
|
+
ArrowDownIcon,
|
|
133
|
+
{
|
|
134
|
+
className: animatedArrowIcon[showMore ? "true" : "false"]
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
) }) : null
|
|
142
|
+
] })
|
|
143
|
+
}
|
|
144
|
+
);
|
|
61
145
|
};
|
|
62
146
|
export {
|
|
63
147
|
Snippet
|
|
@@ -20,5 +20,5 @@ type OwnStackProps = {
|
|
|
20
20
|
id?: string;
|
|
21
21
|
};
|
|
22
22
|
export type StackProps<T extends ElementType = 'div'> = PolymorphicComponentProps<T, OwnStackProps>;
|
|
23
|
-
export declare const Stack: <T extends ElementType = "div">({ gap, direction, alignItems, justifyContent, wrap, className, children, id, "data-testid": dataTestId, width, maxWidth, minWidth, flex, as, ref, style, ...props }: StackProps<T>) => import("
|
|
23
|
+
export declare const Stack: <T extends ElementType = "div">({ gap, direction, alignItems, justifyContent, wrap, className, children, id, "data-testid": dataTestId, width, maxWidth, minWidth, flex, as, ref, style, ...props }: StackProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
export {};
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { consoleLightTheme } from "@ultraviolet/themes";
|
|
4
4
|
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
5
5
|
import { useMemo } from "react";
|
|
6
6
|
import { sprinkles, stack } from "./styles.css.js";
|
|
7
7
|
import { flexVar, minWidthVar, maxWidthVar, widthVar } from "./variables.css.js";
|
|
8
|
-
const mapRepsonsiveGap = (object) => object ? Object.keys(object).reduce(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const mapRepsonsiveGap = (object) => object ? Object.keys(object).reduce(
|
|
9
|
+
(acc, key) => ({
|
|
10
|
+
...acc,
|
|
11
|
+
[key]: consoleLightTheme.space[object[key]]
|
|
12
|
+
}),
|
|
13
|
+
{}
|
|
14
|
+
) : {};
|
|
12
15
|
const Stack = ({
|
|
13
16
|
gap,
|
|
14
17
|
direction = "column",
|
|
@@ -33,30 +36,23 @@ const Stack = ({
|
|
|
33
36
|
return wrap ? "wrap" : "nowrap";
|
|
34
37
|
}
|
|
35
38
|
if (typeof wrap === "object") {
|
|
36
|
-
return Object.keys(wrap).reduce(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
return Object.keys(wrap).reduce(
|
|
40
|
+
(acc, key) => ({
|
|
41
|
+
...acc,
|
|
42
|
+
[key]: wrap[key] ? "wrap" : "nowrap"
|
|
43
|
+
}),
|
|
44
|
+
{}
|
|
45
|
+
);
|
|
40
46
|
}
|
|
41
47
|
return wrap;
|
|
42
48
|
}, [wrap]);
|
|
43
49
|
const Component = as || "div";
|
|
44
50
|
const sprinkleClassName = sprinkles({
|
|
45
|
-
alignItems: typeof alignItems === "object" ? alignItems : {
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
flexWrap: typeof wrapValue === "object" ? wrapValue : {
|
|
52
|
-
xxsmall: wrapValue
|
|
53
|
-
},
|
|
54
|
-
gap: typeof gap === "object" ? mapRepsonsiveGap(gap) : {
|
|
55
|
-
xxsmall: gap ? consoleLightTheme.space[gap] : void 0
|
|
56
|
-
},
|
|
57
|
-
justifyContent: typeof justifyContent === "object" ? justifyContent : {
|
|
58
|
-
xxsmall: justifyContent
|
|
59
|
-
}
|
|
51
|
+
alignItems: typeof alignItems === "object" ? alignItems : { xxsmall: alignItems },
|
|
52
|
+
flexDirection: typeof direction === "object" ? direction : { xxsmall: direction },
|
|
53
|
+
flexWrap: typeof wrapValue === "object" ? wrapValue : { xxsmall: wrapValue },
|
|
54
|
+
gap: typeof gap === "object" ? mapRepsonsiveGap(gap) : { xxsmall: gap ? consoleLightTheme.space[gap] : void 0 },
|
|
55
|
+
justifyContent: typeof justifyContent === "object" ? justifyContent : { xxsmall: justifyContent }
|
|
60
56
|
});
|
|
61
57
|
const combinedClassName = [className, stack, sprinkleClassName].filter(Boolean).join(" ");
|
|
62
58
|
return /* @__PURE__ */ jsx(
|
|
@@ -16,5 +16,5 @@ type StatusProps = {
|
|
|
16
16
|
/**
|
|
17
17
|
* Status component used to display a colored circle with a tooltip for additional information.
|
|
18
18
|
*/
|
|
19
|
-
export declare const Status: ({ animated, className, tooltip, sentiment, "data-testid": dataTestId, notification, style, }: StatusProps) => import("
|
|
19
|
+
export declare const Status: ({ animated, className, tooltip, sentiment, "data-testid": dataTestId, notification, style, }: StatusProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
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 { Tooltip } from "../Tooltip/index.js";
|
|
4
4
|
import { status, animatedCircleStatus, circleStatus } from "./styles.css.js";
|
|
5
5
|
const Status = ({
|
|
@@ -10,16 +10,18 @@ const Status = ({
|
|
|
10
10
|
"data-testid": dataTestId,
|
|
11
11
|
notification,
|
|
12
12
|
style
|
|
13
|
-
}) => /* @__PURE__ */ jsx(Tooltip, { text: tooltip, children: /* @__PURE__ */ jsxs(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
]
|
|
13
|
+
}) => /* @__PURE__ */ jsx(Tooltip, { text: tooltip, children: /* @__PURE__ */ jsxs(
|
|
14
|
+
"span",
|
|
15
|
+
{
|
|
16
|
+
className: `${className ? `${className} ` : ""}${status({ notification })}`,
|
|
17
|
+
"data-testid": dataTestId,
|
|
18
|
+
style,
|
|
19
|
+
children: [
|
|
20
|
+
animated ? /* @__PURE__ */ jsx("span", { className: animatedCircleStatus({ sentiment }) }) : null,
|
|
21
|
+
/* @__PURE__ */ jsx("span", { className: circleStatus({ sentiment }) })
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
) });
|
|
23
25
|
export {
|
|
24
26
|
Status
|
|
25
27
|
};
|
|
@@ -23,7 +23,7 @@ type StepListProps = {
|
|
|
23
23
|
* @experimental This component is experimental and may be subject to breaking changes in the future.
|
|
24
24
|
*/
|
|
25
25
|
export declare const StepList: {
|
|
26
|
-
({ children, className, style, "data-testid": dataTestId, }: StepListProps): import("
|
|
27
|
-
Item: ({ bulletContent, sentiment, prominence, children, onClick, onKeyDown, size, disabled, className, }: ItemProps) => import("
|
|
26
|
+
({ children, className, style, "data-testid": dataTestId, }: StepListProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
Item: ({ bulletContent, sentiment, prominence, children, onClick, onKeyDown, size, disabled, className, }: ItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
28
|
};
|
|
29
29
|
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 { Bullet } from "../Bullet/index.js";
|
|
4
4
|
import { steps, step, stepDiv } from "./styles.css.js";
|
|
5
5
|
const Item = ({
|
|
@@ -12,20 +12,41 @@ const Item = ({
|
|
|
12
12
|
size = "medium",
|
|
13
13
|
disabled = false,
|
|
14
14
|
className
|
|
15
|
-
}) => /* @__PURE__ */ jsxs(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
}) => /* @__PURE__ */ jsxs(
|
|
16
|
+
"li",
|
|
17
|
+
{
|
|
18
|
+
className: `${className ? `${className} ` : ""}${step({ disabled })}`,
|
|
19
|
+
onClick,
|
|
20
|
+
onKeyDown,
|
|
21
|
+
children: [
|
|
22
|
+
bulletContent ? /* @__PURE__ */ jsx(
|
|
23
|
+
Bullet,
|
|
24
|
+
{
|
|
25
|
+
disabled,
|
|
26
|
+
prominence,
|
|
27
|
+
sentiment,
|
|
28
|
+
size,
|
|
29
|
+
children: bulletContent
|
|
30
|
+
}
|
|
31
|
+
) : null,
|
|
32
|
+
/* @__PURE__ */ jsx("div", { className: stepDiv({ size }), children })
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
);
|
|
23
36
|
const StepList = ({
|
|
24
37
|
children,
|
|
25
38
|
className,
|
|
26
39
|
style,
|
|
27
40
|
"data-testid": dataTestId
|
|
28
|
-
}) => /* @__PURE__ */ jsx(
|
|
41
|
+
}) => /* @__PURE__ */ jsx(
|
|
42
|
+
"ul",
|
|
43
|
+
{
|
|
44
|
+
className: `${className ? `${className} ` : ""}${steps}`,
|
|
45
|
+
"data-testid": dataTestId,
|
|
46
|
+
style,
|
|
47
|
+
children
|
|
48
|
+
}
|
|
49
|
+
);
|
|
29
50
|
StepList.Item = Item;
|
|
30
51
|
export {
|
|
31
52
|
StepList
|
|
@@ -22,5 +22,5 @@ type StepProps = {
|
|
|
22
22
|
'data-testid'?: string;
|
|
23
23
|
style?: CSSProperties;
|
|
24
24
|
};
|
|
25
|
-
export declare const Step: ({ index, onClick, disabled, title, children, className, style, "data-testid": dataTestId, }: StepProps) => import("
|
|
25
|
+
export declare const Step: ({ index, onClick, disabled, title, children, className, style, "data-testid": dataTestId, }: StepProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
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 { CheckIcon } from "@ultraviolet/icons";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import { Bullet } from "../Bullet/index.js";
|
|
@@ -36,36 +36,71 @@ const Step = ({
|
|
|
36
36
|
}
|
|
37
37
|
return isActive ? "bodySmallStrong" : "bodySmall";
|
|
38
38
|
}, [size, isActive]);
|
|
39
|
-
return /* @__PURE__ */ jsxs(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
return /* @__PURE__ */ jsxs(
|
|
40
|
+
Stack,
|
|
41
|
+
{
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
className: `${className ? `${className} ` : "step "}${stepContainer} ${separatorBottom ? stepperContainerRecipe({ animated, disabled, done: isDone, labelPosition, separator, size }) : ""} ${isActive && separator && animated ? animationStepperContainer[size] : ""} ${interactiveDone && !disabled ? stepperInteractive[isActive ? "active" : "inactive"] : ""}`,
|
|
44
|
+
"data-testid": dataTestId ?? `stepper-step-${index}`,
|
|
45
|
+
direction: labelPosition === "right" ? "row" : "column",
|
|
46
|
+
gap: labelPosition === "right" ? 1 : 0,
|
|
47
|
+
justifyContent: "flex-start",
|
|
48
|
+
onClick: () => {
|
|
49
|
+
if (interactive && !disabled) {
|
|
50
|
+
if (index < step) {
|
|
51
|
+
setStep(index);
|
|
52
|
+
}
|
|
53
|
+
onClick?.(index);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
style,
|
|
57
|
+
children: [
|
|
58
|
+
isDone && !disabled ? /* @__PURE__ */ jsx(
|
|
59
|
+
Bullet,
|
|
60
|
+
{
|
|
61
|
+
className: stepBullet({
|
|
62
|
+
disabled,
|
|
63
|
+
isActive,
|
|
64
|
+
size
|
|
65
|
+
}),
|
|
66
|
+
prominence: "strong",
|
|
67
|
+
sentiment: "primary",
|
|
68
|
+
size,
|
|
69
|
+
children: /* @__PURE__ */ jsx(CheckIcon, {})
|
|
70
|
+
}
|
|
71
|
+
) : /* @__PURE__ */ jsx(
|
|
72
|
+
Bullet,
|
|
73
|
+
{
|
|
74
|
+
className: stepBullet({
|
|
75
|
+
disabled,
|
|
76
|
+
isActive,
|
|
77
|
+
size
|
|
78
|
+
}),
|
|
79
|
+
prominence: "strong",
|
|
80
|
+
sentiment: isDone || isActive ? "primary" : "neutral",
|
|
81
|
+
size,
|
|
82
|
+
children: (index + 1).toString()
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
title ? /* @__PURE__ */ jsx(
|
|
86
|
+
Text,
|
|
87
|
+
{
|
|
88
|
+
as: "span",
|
|
89
|
+
className: stepText({
|
|
90
|
+
addMarginTop: separator && labelPosition !== "right",
|
|
91
|
+
disabled
|
|
92
|
+
}),
|
|
93
|
+
prominence: isDone || isActive ? "default" : "weak",
|
|
94
|
+
sentiment: isActive ? "primary" : "neutral",
|
|
95
|
+
variant: textVariant,
|
|
96
|
+
whiteSpace: "normal",
|
|
97
|
+
children: title
|
|
98
|
+
}
|
|
99
|
+
) : null,
|
|
100
|
+
children ?? null
|
|
101
|
+
]
|
|
52
102
|
}
|
|
53
|
-
|
|
54
|
-
isDone && !disabled ? /* @__PURE__ */ jsx(Bullet, { className: stepBullet({
|
|
55
|
-
disabled,
|
|
56
|
-
isActive,
|
|
57
|
-
size
|
|
58
|
-
}), prominence: "strong", sentiment: "primary", size, children: /* @__PURE__ */ jsx(CheckIcon, {}) }) : /* @__PURE__ */ jsx(Bullet, { className: stepBullet({
|
|
59
|
-
disabled,
|
|
60
|
-
isActive,
|
|
61
|
-
size
|
|
62
|
-
}), prominence: "strong", sentiment: isDone || isActive ? "primary" : "neutral", size, children: (index + 1).toString() }),
|
|
63
|
-
title ? /* @__PURE__ */ jsx(Text, { as: "span", className: stepText({
|
|
64
|
-
addMarginTop: separator && labelPosition !== "right",
|
|
65
|
-
disabled
|
|
66
|
-
}), prominence: isDone || isActive ? "default" : "weak", sentiment: isActive ? "primary" : "neutral", variant: textVariant, whiteSpace: "normal", children: title }) : null,
|
|
67
|
-
children ?? null
|
|
68
|
-
] });
|
|
103
|
+
);
|
|
69
104
|
};
|
|
70
105
|
export {
|
|
71
106
|
Step
|
|
@@ -21,5 +21,5 @@ export declare const useStepper: () => ContextType;
|
|
|
21
21
|
/**
|
|
22
22
|
* Stepper component to show the progress of a process in a linear way.
|
|
23
23
|
*/
|
|
24
|
-
export declare const StepperProvider: ({ children, interactive, selected, animated, labelPosition, size, separator, }: StepperProviderProps) => import("
|
|
24
|
+
export declare const StepperProvider: ({ children, interactive, selected, animated, labelPosition, size, separator, }: StepperProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo, useState, useEffect, createContext, useContext } from "react";
|
|
4
4
|
const StepperContext = createContext({
|
|
5
5
|
animated: false,
|
|
@@ -23,15 +23,18 @@ const StepperProvider = ({
|
|
|
23
23
|
}) => {
|
|
24
24
|
const currentSelected = useMemo(() => selected, [selected]);
|
|
25
25
|
const [step, setStep] = useState(currentSelected);
|
|
26
|
-
const value = useMemo(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
const value = useMemo(
|
|
27
|
+
() => ({
|
|
28
|
+
animated,
|
|
29
|
+
interactive,
|
|
30
|
+
labelPosition,
|
|
31
|
+
separator,
|
|
32
|
+
setStep,
|
|
33
|
+
size,
|
|
34
|
+
step
|
|
35
|
+
}),
|
|
36
|
+
[step, interactive, size, animated, labelPosition, separator]
|
|
37
|
+
);
|
|
35
38
|
useEffect(() => setStep(selected), [selected]);
|
|
36
39
|
return /* @__PURE__ */ jsx(StepperContext.Provider, { value, children });
|
|
37
40
|
};
|
|
@@ -18,7 +18,7 @@ type StepperProps = {
|
|
|
18
18
|
style?: CSSProperties;
|
|
19
19
|
};
|
|
20
20
|
export declare const Stepper: {
|
|
21
|
-
({ children, interactive, selected, animated, className, labelPosition, size, "data-testid": dataTestId, separator, style, }: StepperProps): import("
|
|
21
|
+
({ children, interactive, selected, animated, className, labelPosition, size, "data-testid": dataTestId, separator, style, }: StepperProps): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
Step: ({ index, onClick, disabled, title, children, className, style, "data-testid": dataTestId, }: {
|
|
23
23
|
onClick?: (index: number) => void;
|
|
24
24
|
index?: number;
|
|
@@ -28,6 +28,6 @@ export declare const Stepper: {
|
|
|
28
28
|
className?: string;
|
|
29
29
|
'data-testid'?: string;
|
|
30
30
|
style?: CSSProperties;
|
|
31
|
-
}) => import("
|
|
31
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
};
|
|
33
33
|
export {};
|