@ultraviolet/ui 3.0.0-beta.27 → 3.0.0-beta.29
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/README.md +47 -18
- 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/Avatar/styles.css.js +0 -1
- package/dist/components/Avatar/variables.css.js +1 -0
- 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 +29 -6
- 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.d.ts +2 -1
- package/dist/components/Popup/index.js +373 -255
- 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/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/Row/styles.css.d.ts +11 -0
- package/dist/components/Row/styles.css.js +2 -2
- 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 +442 -101
- 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/Stack/styles.css.js +2 -2
- 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/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.d.ts +1 -1
- 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 +5 -10
- 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 { jsx } from "
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as Icon from "@ultraviolet/icons";
|
|
4
4
|
import { useContext } from "react";
|
|
5
5
|
import { ChipContext } from "./ChipContext.js";
|
|
@@ -13,21 +13,55 @@ const ChipIcon = ({
|
|
|
13
13
|
if (!context) {
|
|
14
14
|
throw new Error("Chip.Icon can only be used inside a Chip component");
|
|
15
15
|
}
|
|
16
|
-
const {
|
|
17
|
-
disabled,
|
|
18
|
-
isActive,
|
|
19
|
-
iconRef
|
|
20
|
-
} = context;
|
|
16
|
+
const { disabled, isActive, iconRef } = context;
|
|
21
17
|
const IconUsed = Icon[`${name.charAt(0).toUpperCase() + name.slice(1)}Icon`];
|
|
22
18
|
if (onClick) {
|
|
23
|
-
return /* @__PURE__ */ jsx(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
"button",
|
|
21
|
+
{
|
|
22
|
+
className: buttonContainer,
|
|
23
|
+
"data-active": isActive,
|
|
24
|
+
"data-disabled": disabled,
|
|
25
|
+
"data-has-onclick": !!onClick && !disabled,
|
|
26
|
+
"data-testid": dataTestId,
|
|
27
|
+
onClick: (event) => {
|
|
28
|
+
if (!disabled && onClick) {
|
|
29
|
+
event.stopPropagation();
|
|
30
|
+
onClick();
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
ref: iconRef,
|
|
34
|
+
children: /* @__PURE__ */ jsx(
|
|
35
|
+
IconUsed,
|
|
36
|
+
{
|
|
37
|
+
disabled,
|
|
38
|
+
prominence: isActive ? "stronger" : "default",
|
|
39
|
+
sentiment: "neutral",
|
|
40
|
+
size: "small"
|
|
41
|
+
}
|
|
42
|
+
)
|
|
27
43
|
}
|
|
28
|
-
|
|
44
|
+
);
|
|
29
45
|
}
|
|
30
|
-
return /* @__PURE__ */ jsx(
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
className: buttonContainer,
|
|
50
|
+
"data-active": isActive,
|
|
51
|
+
"data-disabled": disabled,
|
|
52
|
+
"data-testid": dataTestId,
|
|
53
|
+
ref: iconRef,
|
|
54
|
+
children: /* @__PURE__ */ jsx(
|
|
55
|
+
IconUsed,
|
|
56
|
+
{
|
|
57
|
+
disabled,
|
|
58
|
+
prominence: isActive ? "stronger" : "default",
|
|
59
|
+
sentiment: "neutral",
|
|
60
|
+
size: "small"
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
);
|
|
31
65
|
};
|
|
32
66
|
export {
|
|
33
67
|
ChipIcon
|
|
@@ -13,11 +13,11 @@ type ChipType = {
|
|
|
13
13
|
* Chip component is used to display a clickable status or a label in a small container
|
|
14
14
|
*/
|
|
15
15
|
export declare const Chip: {
|
|
16
|
-
({ children, size, disabled, active, className, "data-testid": dataTestId, onClick, style, }: ChipType): import("
|
|
16
|
+
({ children, size, disabled, active, className, "data-testid": dataTestId, onClick, style, }: ChipType): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
Icon: ({ name, onClick, "data-testid": dataTestId, }: {
|
|
18
|
-
name: "search" | "anchor" | "bold" | "filter" | "sort" | "italic" | "underline" | "drag" | "address" | "audio" | "video" | "image" | "stop" | "view" | "id" | "pen" | "download" | "cancel" | "close" | "play" | "send" | "email" | "arrowLeft" | "upload" | "addressOutline" | "addressPlay" | "adjustmentsHorizontal" | "adjustmentsHorizontalOutline" | "alertCircle" | "alertCircleOutline" | "arrowDown" | "arrowLeftBottom" | "arrowLeftDouble" | "arrowRightBottom" | "arrowRightDouble" | "arrowRight" | "arrowUp" | "attach" | "autoFix" | "autoFixOutline" | "bookOpenOutline" | "bookOpenOutlineOutline" | "boxEssentials" | "boxEssentialsOutline" | "bullhorn" | "bullhornOutline" | "burger" | "calculator" | "calculatorOutline" | "calendarRange" | "calendarRangeOutline" | "chat" | "chatOutline" | "checkCircle" | "checkCircleOutline" | "check" | "clickhouse" | "lock" | "clock" | "lockOutline" | "clockOutline" | "closeCircleOutline" | "console" | "consoleOutline" | "copyContent" | "credential" | "credentialOutline" | "creditCard" | "creditCardOutline" | "database" | "databaseOutline" | "delete" | "deleteOutline" | "detach" | "doc" | "docOutline" | "dotsHorizontal" | "dotsVertical" | "earth" | "earthOutline" | "east" | "eastShort" | "emailOutline" | "emailRemove" | "emailRemoveOutline" | "equal" | "escape" | "expand" | "expandMore" | "eye" | "eyeOff" | "eyeOffOutline" | "eyeOutline" | "filterOutline" | "folder" | "folderOutline" | "github" | "helpCircle" | "helpCircleOutline" | "idOutline" | "imageOutline" | "information" | "informationOutline" | "instagram" | "leaf" | "leafOutline" | "leftRightArrow" | "lightBulb" | "lightBulbOutline" | "linkedin" | "listBullet" | "listNumber" | "logout" | "members" | "membersOutline" | "minus" | "moon" | "moonOutline" | "mosaic" | "mosaicOutline" | "music" | "musicOutline" | "north" | "northShort" | "notification" | "notificationOutline" | "openInNew" | "organization" | "paperclip" | "partnerSpace" | "pen2" | "pen2Outline" | "pencil" | "pencilOutline" | "penOutline" | "phone" | "phoneOutline" | "pin" | "pinOutline" | "playOutline" | "plus" | "privacy" | "privacyOutline" | "profile" | "profileOutline" | "progressCheck" | "rayEndArrow" | "rayStartArrow" | "rayStartEnd" | "rayTopArrow" | "reboot" | "restore" | "revoke" | "rocket" | "rocketOutline" | "rss" | "sendOutline" | "settings" | "settingsOutline" | "sidebar" | "sidebarOutline" | "slack" | "south" | "southShort" | "sparkles" | "sparklesOutline" | "star" | "starOutline" | "stopOutline" | "sun" | "sunOutline" | "support" | "supportOutline" | "switchOrga" | "thumbsDown" | "thumbsDownOutline" | "thumbsUp" | "thumbsUpOutline" | "twitter" | "unlock" | "unlockOutline" | "unpin" | "unpinOutline" | "videoOutline" | "weatherNight" | "weatherNightOutline" | "west" | "westShort" | "youtube";
|
|
18
|
+
name: "search" | "anchor" | "bold" | "filter" | "sort" | "italic" | "underline" | "drag" | "address" | "audio" | "video" | "image" | "stop" | "view" | "id" | "pen" | "download" | "cancel" | "close" | "play" | "send" | "email" | "arrowLeft" | "upload" | "addressOutline" | "addressPlay" | "adjustmentsHorizontal" | "adjustmentsHorizontalOutline" | "alertCircle" | "alertCircleOutline" | "arrowDown" | "arrowLeftBottom" | "arrowLeftDouble" | "arrowRightBottom" | "arrowRightDouble" | "arrowRight" | "arrowUp" | "attach" | "autoFix" | "autoFixOutline" | "bookOpenOutline" | "bookOpenOutlineOutline" | "boxEssentials" | "boxEssentialsOutline" | "bullhorn" | "bullhornOutline" | "burger" | "calculator" | "calculatorOutline" | "calendarRange" | "calendarRangeOutline" | "chat" | "chatOutline" | "checkCircle" | "checkCircleOutline" | "check" | "clickhouse" | "lock" | "clock" | "lockOutline" | "clockOutline" | "closeCircle" | "closeCircleOutline" | "console" | "consoleOutline" | "copyContent" | "credential" | "credentialOutline" | "creditCard" | "creditCardOutline" | "database" | "databaseOutline" | "delete" | "deleteOutline" | "detach" | "doc" | "docOutline" | "dotsHorizontal" | "dotsVertical" | "earth" | "earthOutline" | "east" | "eastShort" | "emailOutline" | "emailRemove" | "emailRemoveOutline" | "equal" | "escape" | "expand" | "expandMore" | "eye" | "eyeOff" | "eyeOffOutline" | "eyeOutline" | "filterOutline" | "folder" | "folderOutline" | "github" | "helpCircle" | "helpCircleOutline" | "idOutline" | "imageOutline" | "information" | "informationOutline" | "instagram" | "leaf" | "leafOutline" | "leftRightArrow" | "lightBulb" | "lightBulbOutline" | "linkedin" | "listBullet" | "listNumber" | "logout" | "members" | "membersOutline" | "minus" | "moon" | "moonOutline" | "mosaic" | "mosaicOutline" | "music" | "musicOutline" | "north" | "northShort" | "notification" | "notificationOutline" | "openInNew" | "organization" | "paperclip" | "partnerSpace" | "pen2" | "pen2Outline" | "pencil" | "pencilOutline" | "penOutline" | "phone" | "phoneOutline" | "pin" | "pinOutline" | "playOutline" | "plus" | "privacy" | "privacyOutline" | "profile" | "profileOutline" | "progressCheck" | "rayEndArrow" | "rayStartArrow" | "rayStartEnd" | "rayTopArrow" | "reboot" | "restore" | "revoke" | "rocket" | "rocketOutline" | "rss" | "sendOutline" | "settings" | "settingsOutline" | "sidebar" | "sidebarOutline" | "slack" | "south" | "southShort" | "sparkles" | "sparklesOutline" | "star" | "starOutline" | "stopOutline" | "sun" | "sunOutline" | "support" | "supportOutline" | "switchOrga" | "thumbsDown" | "thumbsDownOutline" | "thumbsUp" | "thumbsUpOutline" | "twitter" | "unlock" | "unlockOutline" | "unpin" | "unpinOutline" | "videoOutline" | "weatherNight" | "weatherNightOutline" | "west" | "westShort" | "youtube";
|
|
19
19
|
onClick?: () => void;
|
|
20
20
|
'data-testid'?: string;
|
|
21
|
-
}) => import("
|
|
21
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
};
|
|
23
23
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useRef, useMemo, useEffect } from "react";
|
|
4
4
|
import { Stack } from "../Stack/index.js";
|
|
5
5
|
import { Text } from "../Text/index.js";
|
|
@@ -29,11 +29,10 @@ const Chip = ({
|
|
|
29
29
|
}
|
|
30
30
|
return "default";
|
|
31
31
|
}, [isActive, disabled]);
|
|
32
|
-
const value = useMemo(
|
|
33
|
-
disabled,
|
|
34
|
-
iconRef
|
|
35
|
-
|
|
36
|
-
}), [isActive, disabled, iconRef]);
|
|
32
|
+
const value = useMemo(
|
|
33
|
+
() => ({ disabled, iconRef, isActive }),
|
|
34
|
+
[isActive, disabled, iconRef]
|
|
35
|
+
);
|
|
37
36
|
useEffect(() => {
|
|
38
37
|
setIsActive(active);
|
|
39
38
|
}, [active]);
|
|
@@ -47,12 +46,38 @@ const Chip = ({
|
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
}, [children, iconRef]);
|
|
50
|
-
return /* @__PURE__ */ jsx(ChipContext.Provider, { value, children: /* @__PURE__ */ jsx(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
return /* @__PURE__ */ jsx(ChipContext.Provider, { value, children: /* @__PURE__ */ jsx(
|
|
50
|
+
Text,
|
|
51
|
+
{
|
|
52
|
+
as: "div",
|
|
53
|
+
style,
|
|
54
|
+
variant: size === "large" ? "bodySmall" : "caption",
|
|
55
|
+
children: /* @__PURE__ */ jsx(
|
|
56
|
+
Stack,
|
|
57
|
+
{
|
|
58
|
+
alignItems: "center",
|
|
59
|
+
className: `${className ? `${className} ` : ""}${container}`,
|
|
60
|
+
"data-active": isActive,
|
|
61
|
+
"data-disabled": disabled,
|
|
62
|
+
"data-prominence": prominence,
|
|
63
|
+
"data-size": size,
|
|
64
|
+
"data-testid": dataTestId,
|
|
65
|
+
"data-trailing-icon": hasTrailingIcon,
|
|
66
|
+
direction: "row",
|
|
67
|
+
gap: 1,
|
|
68
|
+
justifyContent: "center",
|
|
69
|
+
onClick: () => {
|
|
70
|
+
if (!disabled) {
|
|
71
|
+
setIsActive(!isActive);
|
|
72
|
+
onClick?.(!isActive);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
ref: chipRef,
|
|
76
|
+
children
|
|
77
|
+
}
|
|
78
|
+
)
|
|
54
79
|
}
|
|
55
|
-
|
|
80
|
+
) });
|
|
56
81
|
};
|
|
57
82
|
Chip.Icon = ChipIcon;
|
|
58
83
|
export {
|
|
@@ -15,5 +15,5 @@ type CopyButtonProps = {
|
|
|
15
15
|
/**
|
|
16
16
|
* CopyButton is a button that copies a given value to the clipboard.
|
|
17
17
|
*/
|
|
18
|
-
export declare const CopyButton: ({ size, value, copyText, copiedText, sentiment, bordered, className, children, "data-testid": dataTestId, onCopy, style, }: CopyButtonProps) => import("
|
|
18
|
+
export declare const CopyButton: ({ size, value, copyText, copiedText, sentiment, bordered, className, children, "data-testid": dataTestId, onCopy, style, }: CopyButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
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, CopyContentIcon } from "@ultraviolet/icons";
|
|
4
4
|
import useClipboard from "react-use-clipboard";
|
|
5
5
|
import { Button } from "../Button/index.js";
|
|
@@ -20,13 +20,28 @@ const CopyButton = ({
|
|
|
20
20
|
const [isCopied, setCopied] = useClipboard(value, {
|
|
21
21
|
successDuration: COPY_DURATION
|
|
22
22
|
});
|
|
23
|
-
return /* @__PURE__ */ jsxs(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
return /* @__PURE__ */ jsxs(
|
|
24
|
+
Button,
|
|
25
|
+
{
|
|
26
|
+
"aria-label": "Copy",
|
|
27
|
+
className,
|
|
28
|
+
"data-testid": dataTestId,
|
|
29
|
+
onClick: () => {
|
|
30
|
+
setCopied();
|
|
31
|
+
onCopy?.();
|
|
32
|
+
},
|
|
33
|
+
sentiment,
|
|
34
|
+
size,
|
|
35
|
+
style,
|
|
36
|
+
tooltip: isCopied ? copiedText : copyText,
|
|
37
|
+
type: "button",
|
|
38
|
+
variant: !bordered ? "ghost" : "outlined",
|
|
39
|
+
children: [
|
|
40
|
+
isCopied ? /* @__PURE__ */ jsx(CheckIcon, {}) : /* @__PURE__ */ jsx(CopyContentIcon, {}),
|
|
41
|
+
children
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
);
|
|
30
45
|
};
|
|
31
46
|
export {
|
|
32
47
|
CopyButton
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CalendarContent: () => import("
|
|
1
|
+
export declare const CalendarContent: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs, jsx } from "
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { ArrowLeftIcon, ArrowRightIcon } from "@ultraviolet/icons";
|
|
4
4
|
import { useContext } from "react";
|
|
5
5
|
import { Button } from "../../Button/index.js";
|
|
@@ -25,33 +25,68 @@ const CalendarContent = () => {
|
|
|
25
25
|
} = useContext(DateInputContext);
|
|
26
26
|
return /* @__PURE__ */ jsxs(Stack, { gap: 2, children: [
|
|
27
27
|
/* @__PURE__ */ jsxs(Stack, { direction: "row", justifyContent: "space-between", width: "100%", children: [
|
|
28
|
-
/* @__PURE__ */ jsx(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
/* @__PURE__ */ jsx(
|
|
29
|
+
Button,
|
|
30
|
+
{
|
|
31
|
+
"data-testid": "previous-month",
|
|
32
|
+
disabled: !!(minDate && minDate > new Date(yearToShow, monthToShow - 1, 0)) || disabled,
|
|
33
|
+
onClick: () => {
|
|
34
|
+
if ((!minDate || minDate <= new Date(yearToShow, monthToShow - 1, 0)) && !readOnly) {
|
|
35
|
+
if (!showMonthYearPicker) {
|
|
36
|
+
const [prevMonth, year] = getPreviousMonth(
|
|
37
|
+
monthToShow,
|
|
38
|
+
yearToShow
|
|
39
|
+
);
|
|
40
|
+
setMonthToShow(prevMonth);
|
|
41
|
+
setYearToShow(year);
|
|
42
|
+
} else {
|
|
43
|
+
setYearToShow(yearToShow - 1);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
sentiment: "neutral",
|
|
48
|
+
size: "xsmall",
|
|
49
|
+
variant: "ghost",
|
|
50
|
+
children: /* @__PURE__ */ jsx(ArrowLeftIcon, {})
|
|
37
51
|
}
|
|
38
|
-
|
|
39
|
-
/* @__PURE__ */ jsxs(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsxs(
|
|
54
|
+
Text,
|
|
55
|
+
{
|
|
56
|
+
as: "span",
|
|
57
|
+
className: capitalizedText,
|
|
58
|
+
disabled,
|
|
59
|
+
sentiment: "neutral",
|
|
60
|
+
variant: "bodyStrong",
|
|
61
|
+
children: [
|
|
62
|
+
!showMonthYearPicker ? MONTHS_ARR[monthToShow - 1] : null,
|
|
63
|
+
" ",
|
|
64
|
+
yearToShow
|
|
65
|
+
]
|
|
53
66
|
}
|
|
54
|
-
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
Button,
|
|
70
|
+
{
|
|
71
|
+
"data-testid": "next-month",
|
|
72
|
+
disabled: !!(maxDate && maxDate < new Date(yearToShow, monthToShow, 1)) || disabled,
|
|
73
|
+
onClick: () => {
|
|
74
|
+
if ((!maxDate || maxDate >= new Date(yearToShow, monthToShow, 1)) && !readOnly) {
|
|
75
|
+
if (!showMonthYearPicker) {
|
|
76
|
+
const [monthNext, year] = getNextMonth(monthToShow, yearToShow);
|
|
77
|
+
setMonthToShow(monthNext);
|
|
78
|
+
setYearToShow(year);
|
|
79
|
+
} else {
|
|
80
|
+
setYearToShow(yearToShow + 1);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
sentiment: "neutral",
|
|
85
|
+
size: "xsmall",
|
|
86
|
+
variant: "ghost",
|
|
87
|
+
children: /* @__PURE__ */ jsx(ArrowRightIcon, {})
|
|
88
|
+
}
|
|
89
|
+
)
|
|
55
90
|
] }),
|
|
56
91
|
showMonthYearPicker ? /* @__PURE__ */ jsx(Monthly, {}) : /* @__PURE__ */ jsx(Daily, {})
|
|
57
92
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const Daily: () => import("
|
|
1
|
+
export declare const Daily: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs, jsx } from "
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useContext, useState } from "react";
|
|
4
4
|
import { Button } from "../../Button/index.js";
|
|
5
5
|
import { Row } from "../../Row/index.js";
|
|
@@ -32,36 +32,57 @@ const Daily = () => {
|
|
|
32
32
|
hoveredDate,
|
|
33
33
|
setHoveredDate
|
|
34
34
|
} = useContext(DateInputContext);
|
|
35
|
-
const [rangeState, setRangeState] = useState(
|
|
35
|
+
const [rangeState, setRangeState] = useState(
|
|
36
|
+
range?.start && !range?.end ? "end" : "start"
|
|
37
|
+
);
|
|
36
38
|
const monthDays = new Date(yearToShow, monthToShow, 0).getDate();
|
|
37
39
|
const daysFromPreviousMonth = getMonthFirstDay(monthToShow, yearToShow);
|
|
38
40
|
const daysFromNextMonth = CALENDAR_WEEKS * 7 - (daysFromPreviousMonth + monthDays);
|
|
39
|
-
const [previousMonth, prevMonthYear] = getPreviousMonth(
|
|
41
|
+
const [previousMonth, prevMonthYear] = getPreviousMonth(
|
|
42
|
+
monthToShow,
|
|
43
|
+
yearToShow
|
|
44
|
+
);
|
|
40
45
|
const [nextMonth, nextMonthYear] = getNextMonth(monthToShow, yearToShow);
|
|
41
46
|
const previousMonthDays = new Date(prevMonthYear, previousMonth, 0).getDate();
|
|
42
|
-
const prevMonthDates = Array.from(
|
|
43
|
-
length: daysFromPreviousMonth
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, (_, index) => ({
|
|
47
|
+
const prevMonthDates = Array.from(
|
|
48
|
+
{ length: daysFromPreviousMonth },
|
|
49
|
+
(_, index) => ({
|
|
50
|
+
day: index + 1 + (previousMonthDays - daysFromPreviousMonth),
|
|
51
|
+
month: -1
|
|
52
|
+
})
|
|
53
|
+
);
|
|
54
|
+
const currentMonthDates = Array.from({ length: monthDays }, (_, index) => ({
|
|
51
55
|
day: index + 1,
|
|
52
56
|
month: 0
|
|
53
57
|
}));
|
|
54
|
-
const nextMonthDates = Array.from(
|
|
55
|
-
length: daysFromNextMonth
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
const nextMonthDates = Array.from(
|
|
59
|
+
{ length: daysFromNextMonth },
|
|
60
|
+
(_, index) => ({ day: index + 1, month: 1 })
|
|
61
|
+
);
|
|
62
|
+
const allDaysToShow = [
|
|
63
|
+
...prevMonthDates,
|
|
64
|
+
...currentMonthDates,
|
|
65
|
+
...nextMonthDates
|
|
66
|
+
];
|
|
61
67
|
return /* @__PURE__ */ jsxs(Row, { gap: 1, templateColumns: "repeat(7, 1fr)", children: [
|
|
62
|
-
Object.entries(DAYS).map((day) => /* @__PURE__ */ jsx(
|
|
68
|
+
Object.entries(DAYS).map((day) => /* @__PURE__ */ jsx(
|
|
69
|
+
Text,
|
|
70
|
+
{
|
|
71
|
+
as: "p",
|
|
72
|
+
className: capitalizedTextDay,
|
|
73
|
+
disabled,
|
|
74
|
+
sentiment: "neutral",
|
|
75
|
+
variant: "bodyStrong",
|
|
76
|
+
children: day[1]
|
|
77
|
+
},
|
|
78
|
+
day[0]
|
|
79
|
+
)),
|
|
63
80
|
allDaysToShow.map((data) => {
|
|
64
|
-
const constructedDate = new Date(
|
|
81
|
+
const constructedDate = new Date(
|
|
82
|
+
yearToShow,
|
|
83
|
+
monthToShow - 1 + data.month,
|
|
84
|
+
data.day
|
|
85
|
+
);
|
|
65
86
|
const isExcluded = excludeDates ? excludeDates.map((date) => isSameDay(constructedDate, date)).includes(true) : false;
|
|
66
87
|
const isOutsideRange = !!(minDate && constructedDate < minDate) || !!(maxDate && constructedDate > maxDate);
|
|
67
88
|
const isSelected = value && isSameDay(constructedDate, new Date(value)) || range?.end && isSameDay(constructedDate, range.end) || range?.start && isSameDay(constructedDate, range.start);
|
|
@@ -83,39 +104,45 @@ const Daily = () => {
|
|
|
83
104
|
const onClickRange = (event, newDate) => {
|
|
84
105
|
if (selectsRange) {
|
|
85
106
|
if (rangeState === "end" && isAfterStartDate) {
|
|
86
|
-
setRange?.({
|
|
87
|
-
end: newDate,
|
|
88
|
-
start: range.start
|
|
89
|
-
});
|
|
107
|
+
setRange?.({ end: newDate, start: range.start });
|
|
90
108
|
onChange?.([range.start, newDate], event);
|
|
91
|
-
setInputValue(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
109
|
+
setInputValue(
|
|
110
|
+
formatValue(
|
|
111
|
+
null,
|
|
112
|
+
{ end: newDate, start: range.start },
|
|
113
|
+
false,
|
|
114
|
+
true,
|
|
115
|
+
format
|
|
116
|
+
)
|
|
117
|
+
);
|
|
95
118
|
setRangeState("start");
|
|
96
119
|
setVisible(false);
|
|
97
120
|
} else if (rangeState === "end" && !isAfterStartDate && range?.start) {
|
|
98
|
-
setRange?.({
|
|
99
|
-
end: range.start,
|
|
100
|
-
start: newDate
|
|
101
|
-
});
|
|
121
|
+
setRange?.({ end: range.start, start: newDate });
|
|
102
122
|
onChange?.([newDate, range.start], event);
|
|
103
|
-
setInputValue(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
123
|
+
setInputValue(
|
|
124
|
+
formatValue(
|
|
125
|
+
null,
|
|
126
|
+
{ end: range.start, start: newDate },
|
|
127
|
+
false,
|
|
128
|
+
true,
|
|
129
|
+
format
|
|
130
|
+
)
|
|
131
|
+
);
|
|
107
132
|
setRangeState("start");
|
|
108
133
|
setVisible(false);
|
|
109
134
|
} else {
|
|
110
|
-
setRange?.({
|
|
111
|
-
end: null,
|
|
112
|
-
start: newDate
|
|
113
|
-
});
|
|
135
|
+
setRange?.({ end: null, start: newDate });
|
|
114
136
|
onChange?.([newDate, null], event);
|
|
115
|
-
setInputValue(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
137
|
+
setInputValue(
|
|
138
|
+
formatValue(
|
|
139
|
+
null,
|
|
140
|
+
{ end: null, start: newDate },
|
|
141
|
+
false,
|
|
142
|
+
true,
|
|
143
|
+
format
|
|
144
|
+
)
|
|
145
|
+
);
|
|
119
146
|
setRangeState("end");
|
|
120
147
|
}
|
|
121
148
|
}
|
|
@@ -144,23 +171,39 @@ const Daily = () => {
|
|
|
144
171
|
}
|
|
145
172
|
return "neutral";
|
|
146
173
|
};
|
|
147
|
-
return /* @__PURE__ */ jsx(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
174
|
+
return /* @__PURE__ */ jsx(
|
|
175
|
+
Button,
|
|
176
|
+
{
|
|
177
|
+
"aria-label": dayState(),
|
|
178
|
+
className: dayMonth,
|
|
179
|
+
"data-testid": createTestId(),
|
|
180
|
+
disabled: disabled || isExcluded || isOutsideRange,
|
|
181
|
+
onClick: (event) => {
|
|
182
|
+
if (!isExcluded && !isOutsideRange && !readOnly) {
|
|
183
|
+
const newDate = getNewDate();
|
|
184
|
+
if (selectsRange) {
|
|
185
|
+
onClickRange(event, newDate);
|
|
186
|
+
} else {
|
|
187
|
+
setValue(newDate);
|
|
188
|
+
onChange?.(newDate, event);
|
|
189
|
+
setInputValue(
|
|
190
|
+
formatValue(newDate, null, false, false, format)
|
|
191
|
+
);
|
|
192
|
+
setVisible(false);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
onMouseEnter: () => {
|
|
197
|
+
if (selectsRange && range?.start) {
|
|
198
|
+
setHoveredDate(constructedDate);
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
sentiment: isSelected || isInHoveredRange ? "primary" : "neutral",
|
|
202
|
+
variant: isSelected || isInHoveredRange ? "filled" : "ghost",
|
|
203
|
+
children: data.day
|
|
204
|
+
},
|
|
205
|
+
`${data.month}-${data.day}`
|
|
206
|
+
);
|
|
164
207
|
})
|
|
165
208
|
] });
|
|
166
209
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const Monthly: () => import("
|
|
1
|
+
export declare const Monthly: () => import("react/jsx-runtime").JSX.Element;
|