@dmsi/wedgekit-react 2.0.0 → 2.0.2
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/classNames.js +150 -0
- package/dist/components/AccessCard.js +63 -0
- package/dist/components/AccessCardGroup.js +73 -0
- package/dist/components/AccessChangerTabItem.js +51 -0
- package/dist/components/Accordion.js +99 -0
- package/dist/components/Alert.js +78 -0
- package/dist/components/Breadcrumbs.js +111 -0
- package/dist/components/Button.js +137 -0
- package/dist/components/CalendarRange.d.ts.map +1 -1
- package/dist/components/CalendarRange.js +406 -0
- package/dist/components/Caption.js +99 -0
- package/dist/components/Card.js +50 -0
- package/dist/components/Checkbox.js +108 -0
- package/dist/components/CompactImagesPreview.d.ts.map +1 -1
- package/dist/components/CompactImagesPreview.js +121 -0
- package/dist/components/ContentTab.js +68 -0
- package/dist/components/ContentTabs.js +96 -0
- package/dist/components/DMSiLogo.js +54 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.d.ts.map +1 -1
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +28 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.d.ts.map +1 -1
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +80 -0
- package/dist/components/DataGrid/PinnedColumns.js +165 -0
- package/dist/components/DataGrid/SummaryRow/SummaryCell.js +51 -0
- package/dist/components/DataGrid/SummaryRow/aggregations.js +55 -0
- package/dist/components/DataGrid/SummaryRow/index.js +86 -0
- package/dist/components/DataGrid/TableBody/GroupRow.js +243 -0
- package/dist/components/DataGrid/TableBody/LoadingCell.js +33 -0
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +136 -0
- package/dist/components/DataGrid/TableBody/index.js +161 -0
- package/dist/components/DataGrid/index.js +696 -0
- package/dist/components/DataGrid/utils.js +20 -0
- package/dist/components/DataGridCell.js +412 -0
- package/dist/components/DataTable.js +700 -0
- package/dist/components/DateInput.d.ts.map +1 -1
- package/dist/components/DateInput.js +194 -0
- package/dist/components/DateRangeInput.d.ts.map +1 -1
- package/dist/components/DateRangeInput.js +369 -0
- package/dist/components/DebugJson.js +28 -0
- package/dist/components/Display.js +46 -0
- package/dist/components/EditingContext.js +34 -0
- package/dist/components/EmblaCarousel/ArrowButtons.js +83 -0
- package/dist/components/EmblaCarousel/SelectedSnapDisplay.js +12 -0
- package/dist/components/EmblaCarousel/index.d.ts.map +1 -1
- package/dist/components/EmblaCarousel/index.js +154 -0
- package/dist/components/EmblaCarousel/usePrevNextButtons.d.ts.map +1 -1
- package/dist/components/EmblaCarousel/usePrevNextButtons.js +22 -0
- package/dist/components/EmblaCarousel/useSelectedSnapDisplay.d.ts.map +1 -1
- package/dist/components/EmblaCarousel/useSelectedSnapDisplay.js +16 -0
- package/dist/components/EmptyCartIcon.js +25 -0
- package/dist/components/FilterGroup.js +198 -0
- package/dist/components/FullViewportBox.js +19 -0
- package/dist/components/Grid.js +54 -0
- package/dist/components/Heading.js +50 -0
- package/dist/components/HorizontalDivider.js +20 -0
- package/dist/components/Icon.js +73 -0
- package/dist/components/ImagePlaceholder.d.ts.map +1 -1
- package/dist/components/ImagePlaceholder.js +23 -0
- package/dist/components/Input.js +469 -0
- package/dist/components/InputGroup.js +45 -0
- package/dist/components/Label.js +37 -0
- package/dist/components/Link.js +69 -0
- package/dist/components/List.js +12 -0
- package/dist/components/ListGroup.d.ts.map +1 -1
- package/dist/components/ListGroup.js +55 -0
- package/dist/components/LiveChatComponent.js +25 -0
- package/dist/components/LoadingScrim.js +22 -0
- package/dist/components/LogoAgilityTopBar.js +90 -0
- package/dist/components/LogoDMSiTopBar.js +54 -0
- package/dist/components/LogoMillworkTopBar.js +196 -0
- package/dist/components/MainBar.js +58 -0
- package/dist/components/MaxViewportBox.js +19 -0
- package/dist/components/Menu.js +202 -0
- package/dist/components/MenuOption.js +161 -0
- package/dist/components/MobileDataGrid/ColumnList.js +85 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +101 -0
- package/dist/components/MobileDataGrid/GridContextProvider/GridContext.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/GridContextProvider/GridContext.js +6 -0
- package/dist/components/MobileDataGrid/GridContextProvider/index.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/GridContextProvider/index.js +81 -0
- package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.js +12 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +18 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +130 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +67 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +42 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +58 -0
- package/dist/components/MobileDataGrid/dataGridReducer.js +28 -0
- package/dist/components/MobileDataGrid/index.js +78 -0
- package/dist/components/MobileNavMenu.js +173 -0
- package/dist/components/Modal.js +201 -0
- package/dist/components/ModalButtons.js +57 -0
- package/dist/components/ModalContent.js +24 -0
- package/dist/components/ModalHeader.js +74 -0
- package/dist/components/ModalScrim.js +32 -0
- package/dist/components/NavigationTab.js +72 -0
- package/dist/components/NavigationTabs.js +45 -0
- package/dist/components/NestedMenu.js +119 -0
- package/dist/components/Notification.js +91 -0
- package/dist/components/OptionPill.js +103 -0
- package/dist/components/OrderCheckIcon.js +28 -0
- package/dist/components/PDFViewer/DownloadIcon.js +25 -0
- package/dist/components/PDFViewer/PDFElement.js +77 -0
- package/dist/components/PDFViewer/PDFNavigation.js +64 -0
- package/dist/components/PDFViewer/PDFPage.js +28 -0
- package/dist/components/PDFViewer/index.js +124 -0
- package/dist/components/Pagination.js +117 -0
- package/dist/components/Paragraph.js +43 -0
- package/dist/components/Password.js +47 -0
- package/dist/components/ProductImagePreview/CarouselPagination.js +48 -0
- package/dist/components/ProductImagePreview/MobileImageCarousel.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/MobileImageCarousel.js +147 -0
- package/dist/components/ProductImagePreview/ProductPrimaryImage.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/ProductPrimaryImage.js +139 -0
- package/dist/components/ProductImagePreview/Thumbnail.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/Thumbnail.js +47 -0
- package/dist/components/ProductImagePreview/ZoomWindow.js +74 -0
- package/dist/components/ProductImagePreview/index.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/index.js +190 -0
- package/dist/components/ProductImagePreview/useProductImagePreview.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/useProductImagePreview.js +86 -0
- package/dist/components/ProjectBar.js +54 -0
- package/dist/components/Radio.js +113 -0
- package/dist/components/Search.js +89 -0
- package/dist/components/SearchResultImage/index.d.ts.map +1 -1
- package/dist/components/SearchResultImage/index.js +27 -0
- package/dist/components/Select.js +122 -0
- package/dist/components/SideMenu.js +24 -0
- package/dist/components/SideMenuGroup.js +80 -0
- package/dist/components/SideMenuItem.js +79 -0
- package/dist/components/SimpleTable.js +60 -0
- package/dist/components/SkeletonParagraph.js +24 -0
- package/dist/components/Spinner.js +30 -0
- package/dist/components/Stack.js +174 -0
- package/dist/components/StatusPill.js +44 -0
- package/dist/components/Stepper.js +138 -0
- package/dist/components/Subheader.js +41 -0
- package/dist/components/Surface.js +30 -0
- package/dist/components/Swatch.js +1498 -0
- package/dist/components/Textarea.js +106 -0
- package/dist/components/Theme.js +25 -0
- package/dist/components/Time.d.ts.map +1 -1
- package/dist/components/Time.js +226 -0
- package/dist/components/Toast.js +170 -0
- package/dist/components/Tooltip.js +102 -0
- package/dist/components/TopBar.js +119 -0
- package/dist/components/Upload.js +107 -0
- package/dist/components/WorldpayIframe.js +19 -0
- package/dist/hooks/useEditCell.d.ts.map +1 -1
- package/dist/hooks/useEditCell.js +24 -0
- package/dist/hooks/useInfiniteScroll.js +25 -0
- package/dist/hooks/useKeydown.d.ts.map +1 -1
- package/dist/hooks/useKeydown.js +21 -0
- package/dist/hooks/useMatchesMedia.d.ts.map +1 -1
- package/dist/hooks/useMatchesMedia.js +16 -0
- package/dist/hooks/useMenuSystem.js +186 -0
- package/dist/hooks/useMounted.js +9 -0
- package/dist/hooks/useTableLayout/computeColumns.js +59 -0
- package/dist/hooks/useTableLayout/storage.js +64 -0
- package/dist/hooks/useTableLayout/useTableLayout.js +163 -0
- package/dist/index.js +249 -53839
- package/dist/lib/loadFonts.js +11 -0
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +56 -0
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +2299 -0
- package/dist/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +13 -0
- package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +367 -0
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +235 -0
- package/dist/node_modules/@headlessui/react/dist/components/description/description.js +45 -0
- package/dist/node_modules/@headlessui/react/dist/components/keyboard.js +4 -0
- package/dist/node_modules/@headlessui/react/dist/components/label/label.js +62 -0
- package/dist/node_modules/@headlessui/react/dist/components/switch/switch.js +56 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js +33 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-controllable.js +10 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-default-value.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-disposables.js +9 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js +9 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-latest-value.js +11 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js +12 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-slot.js +7 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js +16 -0
- package/dist/node_modules/@headlessui/react/dist/internal/disabled.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/internal/form-fields.js +35 -0
- package/dist/node_modules/@headlessui/react/dist/internal/hidden.js +13 -0
- package/dist/node_modules/@headlessui/react/dist/internal/id.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/utils/bugs.js +19 -0
- package/dist/node_modules/@headlessui/react/dist/utils/class-names.js +6 -0
- package/dist/node_modules/@headlessui/react/dist/utils/disposables.js +40 -0
- package/dist/node_modules/@headlessui/react/dist/utils/dom.js +34 -0
- package/dist/node_modules/@headlessui/react/dist/utils/env.js +34 -0
- package/dist/node_modules/@headlessui/react/dist/utils/form.js +32 -0
- package/dist/node_modules/@headlessui/react/dist/utils/match.js +11 -0
- package/dist/node_modules/@headlessui/react/dist/utils/micro-task.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/utils/owner.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/utils/render.js +126 -0
- package/dist/node_modules/@js-temporal/polyfill/dist/index.esm.js +3913 -0
- package/dist/node_modules/@mikecousins/react-pdf/dist/index.js +83 -0
- package/dist/node_modules/@react-aria/focus/dist/useFocusRing.js +38 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocus.js +31 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.js +99 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.js +59 -0
- package/dist/node_modules/@react-aria/interactions/dist/useHover.js +86 -0
- package/dist/node_modules/@react-aria/interactions/dist/utils.js +68 -0
- package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.js +32 -0
- package/dist/node_modules/@react-aria/utils/dist/domHelpers.js +15 -0
- package/dist/node_modules/@react-aria/utils/dist/focusWithoutScrolling.js +45 -0
- package/dist/node_modules/@react-aria/utils/dist/isVirtualEvent.js +7 -0
- package/dist/node_modules/@react-aria/utils/dist/openLink.js +28 -0
- package/dist/node_modules/@react-aria/utils/dist/platform.js +47 -0
- package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.js +34 -0
- package/dist/node_modules/@react-aria/utils/dist/useLayoutEffect.js +6 -0
- package/dist/node_modules/@react-stately/flags/dist/import.js +7 -0
- package/dist/node_modules/@tanstack/react-table/build/lib/index.js +94 -0
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +38 -0
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1954 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +575 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +52 -0
- package/dist/node_modules/clsx/dist/clsx.js +17 -0
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1204 -0
- package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js +126 -0
- package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +24 -0
- package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +35 -0
- package/dist/node_modules/jsbi/dist/jsbi.js +1040 -0
- package/dist/node_modules/react-use/esm/usePrevious.js +10 -0
- package/dist/static/no-results-image.png.js +4 -0
- package/dist/utils/date-patch-dashes.js +28 -0
- package/dist/utils/date.js +95 -0
- package/dist/utils/formatting.js +22 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +4 -0
- package/dist/utils/mergeObjectArrays.js +18 -0
- package/dist/utils.js +20 -0
- package/package.json +1 -1
- /package/dist/{pdf-l6QfMa5e.js → node_modules/pdfjs-dist/build/pdf.js} +0 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { jsxs as $, jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as t } from "../node_modules/clsx/dist/clsx.js";
|
|
3
|
+
import { paddingUsingComponentGap as z, componentPaddingMinus2pxBorder as E, componentGap as M, baseTransition as T, componentPaddingXUsingComponentGap as X, typography as A } from "../classNames.js";
|
|
4
|
+
import { Spinner as D } from "./Spinner.js";
|
|
5
|
+
function L({
|
|
6
|
+
variant: a = "primary",
|
|
7
|
+
as: c = "button",
|
|
8
|
+
block: v,
|
|
9
|
+
leftIcon: n,
|
|
10
|
+
rightIcon: d,
|
|
11
|
+
className: m,
|
|
12
|
+
classNameLabel: x,
|
|
13
|
+
disabled: b = !1,
|
|
14
|
+
children: s,
|
|
15
|
+
iconOnly: i = !1,
|
|
16
|
+
colorClassName: r,
|
|
17
|
+
href: l,
|
|
18
|
+
id: e,
|
|
19
|
+
testid: o,
|
|
20
|
+
isLoading: u,
|
|
21
|
+
fontNormal: h = !1,
|
|
22
|
+
...p
|
|
23
|
+
}) {
|
|
24
|
+
const k = a === "primary" && t(
|
|
25
|
+
r?.trim() ? r : "text-text-on-action-primary-normal",
|
|
26
|
+
"bg-background-action-primary-normal border-background-action-primary-normal",
|
|
27
|
+
"hover:bg-background-action-primary-hover hover:border-background-action-primary-hover",
|
|
28
|
+
"focus:bg-background-action-primary-hover focus:border-background-action-primary-hover focus:outline-0",
|
|
29
|
+
"active:bg-background-action-primary-active active:border-background-action-primary-active",
|
|
30
|
+
"disabled:bg-background-action-primary-disabled disabled:border-background-action-primary-disabled disabled:text-text-on-action-primary-disabled"
|
|
31
|
+
), f = a === "secondary" && t(
|
|
32
|
+
r?.trim() ? r : "text-text-action-primary-normal",
|
|
33
|
+
"bg-background-action-secondary-normal border-border-action-normal",
|
|
34
|
+
"hover:bg-background-action-secondary-hover hover:border-border-action-hover hover:text-text-action-primary-hover",
|
|
35
|
+
"focus:bg-background-action-secondary-hover focus:border-border-action-hover focus:text-text-action-primary-hover focus:outline-0",
|
|
36
|
+
"active:bg-background-action-secondary-active active:border-border-action-active active:text-text-action-primary-active",
|
|
37
|
+
"disabled:bg-background-action-primary-disabled disabled:border-border-action-disabled disabled:text-text-action-primary-disabled"
|
|
38
|
+
), S = a === "tertiary" && t(
|
|
39
|
+
"bg-transparent border-transparent",
|
|
40
|
+
i ? r?.trim() ? r : "text-icon-action-primary-normal" : r?.trim() ? r : "text-text-action-primary-normal",
|
|
41
|
+
"bg-transparent border-transparent",
|
|
42
|
+
"hover:bg-background-action-secondary-hover hover:border-background-action-secondary-hover hover:text-text-action-primary-hover",
|
|
43
|
+
"focus:bg-background-action-secondary-hover focus:border-background-action-secondary-hover focus:text-text-action-primary-hover focus:outline-0",
|
|
44
|
+
"active:bg-background-action-secondary-active active:border-transparent active:text-text-action-primary-active",
|
|
45
|
+
"disabled:bg-transparent disabled:border-transparent disabled:text-text-action-primary-disabled"
|
|
46
|
+
), V = a === "quarternary-outlined" && t(
|
|
47
|
+
"bg-transparent border-transparent",
|
|
48
|
+
i ? r?.trim() ? r : "text-icon-action-primary-normal" : r?.trim() ? r : "text-text-primary-normal",
|
|
49
|
+
"bg-transparent border-transparent",
|
|
50
|
+
"hover:bg-transparent hover:border-border-primary-normal hover:text-text-primary-normal",
|
|
51
|
+
"focus:bg-transparent focus:border-border-primary-normal focus:text-text-primary-normal focus:outline-0",
|
|
52
|
+
"active:bg-transparent active:border-transparent active:text-text-primary-active",
|
|
53
|
+
"disabled:bg-transparent disabled:border-transparent disabled:text-text-action-primary-disabled"
|
|
54
|
+
), w = a === "primary-critical" && t(
|
|
55
|
+
r?.trim() ? r : "text-text-on-action-primary-normal",
|
|
56
|
+
"bg-background-action-critical-primary-normal border-background-action-critical-primary-normal",
|
|
57
|
+
"hover:bg-background-action-critical-primary-hover hover:border-background-action-critical-primary-hover",
|
|
58
|
+
"focus:bg-background-action-critical-primary-hover focus:border-background-action-critical-primary-hover focus:outline-0",
|
|
59
|
+
"active:bg-background-action-critical-primary-active active:border-background-action-critical-primary-active",
|
|
60
|
+
"disabled:bg-background-action-critical-primary-disabled disabled:border-background-action-critical-primary-disabled disabled:text-text-on-action-primary-disabled"
|
|
61
|
+
), j = a === "secondary-critical" && t(
|
|
62
|
+
r?.trim() ? r : "text-text-action-critical-normal",
|
|
63
|
+
"bg-background-action-critical-secondary-normal border-border-action-critical-normal",
|
|
64
|
+
"hover:bg-background-action-critical-secondary-hover hover:border-border-action-critical-hover hover:text-text-action-critical-hover",
|
|
65
|
+
"focus:bg-background-action-critical-secondary-hover focus:border-border-action-critical-hover focus:text-text-action-critical-hover focus:outline-0",
|
|
66
|
+
"active:bg-background-action-critical-secondary-active active:border-border-action-critical-active active:text-text-action-critical-active",
|
|
67
|
+
"disabled:bg-background-action-critical-disabled disabled:border-border-action-critical-disabled disabled:text-text-action-critical-disabled"
|
|
68
|
+
), G = a === "tertiary-critical" && t(
|
|
69
|
+
r?.trim() ? r : "text-text-action-critical-normal",
|
|
70
|
+
"bg-transparent border-transparent text-text-action-critical-normal",
|
|
71
|
+
"hover:bg-background-action-critical-secondary-hover hover:border-background-action-critical-secondary-hover hover:text-text-action-critical-hover",
|
|
72
|
+
"focus:bg-background-action-critical-secondary-hover focus:border-background-action-critical-secondary-hover focus:text-text-action-critical-hover focus:outline-0",
|
|
73
|
+
"active:bg-background-action-critical-secondary-active active:border-background-action-critical-secondary-active active:text-text-action-critical-active",
|
|
74
|
+
"disabled:bg-transparent disabled:border-transparent disabled:text-text-action-critical-disabled"
|
|
75
|
+
), q = a === "navigation" && t(
|
|
76
|
+
r?.trim() ? r : "text-text-action-primary-normal",
|
|
77
|
+
"bg-transparent",
|
|
78
|
+
"hover:bg-background-action-secondary-hover hover:text-text-action-primary-hover",
|
|
79
|
+
"focus:bg-background-action-secondary-hover focus:text-text-action-primary-hover focus:outline-0",
|
|
80
|
+
"active:bg-background-action-secondary-active active:text-text-action-primary-active",
|
|
81
|
+
"disabled:bg-transparent disabled:text-text-action-primary-normal",
|
|
82
|
+
"flex-col",
|
|
83
|
+
z
|
|
84
|
+
), B = a !== "navigation" && t("border-2 flex-row", E, M), P = t(
|
|
85
|
+
b ? "cursor-default" : "cursor-pointer",
|
|
86
|
+
v ? "w-full" : "w-fit",
|
|
87
|
+
T,
|
|
88
|
+
"rounded-sm whitespace-nowrap inline-flex items-center justify-center group/btn",
|
|
89
|
+
k,
|
|
90
|
+
f,
|
|
91
|
+
S,
|
|
92
|
+
V,
|
|
93
|
+
w,
|
|
94
|
+
j,
|
|
95
|
+
G,
|
|
96
|
+
q,
|
|
97
|
+
B,
|
|
98
|
+
m
|
|
99
|
+
), U = t(
|
|
100
|
+
"min-h-6 flex items-center justify-center",
|
|
101
|
+
x,
|
|
102
|
+
h && "font-normal!",
|
|
103
|
+
X,
|
|
104
|
+
A.buttonLabel
|
|
105
|
+
), y = l && !c ? "a" : c;
|
|
106
|
+
return /* @__PURE__ */ $(
|
|
107
|
+
y,
|
|
108
|
+
{
|
|
109
|
+
id: e,
|
|
110
|
+
"data-testid": o,
|
|
111
|
+
type: y === "button" ? "button" : void 0,
|
|
112
|
+
className: P,
|
|
113
|
+
...p,
|
|
114
|
+
onClick: p.onClick,
|
|
115
|
+
disabled: b,
|
|
116
|
+
href: l,
|
|
117
|
+
"data-theme": a === "navigation" ? "brand" : void 0,
|
|
118
|
+
children: [
|
|
119
|
+
n && n,
|
|
120
|
+
u && /* @__PURE__ */ g(D, { size: "small" }),
|
|
121
|
+
!i && !u && s && /* @__PURE__ */ g(
|
|
122
|
+
"span",
|
|
123
|
+
{
|
|
124
|
+
id: e ? `${e}-label` : void 0,
|
|
125
|
+
"data-testid": o ? `${o}-label` : void 0,
|
|
126
|
+
className: U,
|
|
127
|
+
children: s
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
d && d
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
export {
|
|
136
|
+
L as Button
|
|
137
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarRange.d.ts","sourceRoot":"","sources":["../../src/components/CalendarRange.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CalendarRange.d.ts","sourceRoot":"","sources":["../../src/components/CalendarRange.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAKjD,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,KAAK,OAAO,CAAC;IACxD;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,GAAG,OAAO,CAG3D;AAmGD,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,EAAE,EACF,QAAQ,EACR,mBAAmB,EACnB,eAAe,EACf,IAAe,EACf,SAAiB,EACjB,YAAoB,EACpB,EAAE,EACF,MAAM,GACP,EAAE,kBAAkB,2CAmMpB;AAuRD,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as r, jsxs as U } from "react/jsx-runtime";
|
|
3
|
+
import { clsx as u } from "../node_modules/clsx/dist/clsx.js";
|
|
4
|
+
import { layoutGap as B, layoutPaddding as at, componentPadding as _, typography as Y } from "../classNames.js";
|
|
5
|
+
import { Icon as H } from "./Icon.js";
|
|
6
|
+
import ot, { useState as $, useEffect as J, useRef as K } from "react";
|
|
7
|
+
import { Temporal as f } from "../node_modules/@js-temporal/polyfill/dist/index.esm.js";
|
|
8
|
+
import { Menu as Q } from "./Menu.js";
|
|
9
|
+
import { MenuOption as R } from "./MenuOption.js";
|
|
10
|
+
import { Button as z } from "./Button.js";
|
|
11
|
+
function ht(h) {
|
|
12
|
+
return h.dayOfWeek === 6 || h.dayOfWeek === 7;
|
|
13
|
+
}
|
|
14
|
+
function it({
|
|
15
|
+
date: h,
|
|
16
|
+
isInMonth: y,
|
|
17
|
+
isToday: x,
|
|
18
|
+
isSelected: o,
|
|
19
|
+
inRange: n,
|
|
20
|
+
isDisabled: i,
|
|
21
|
+
isRangeStart: d,
|
|
22
|
+
isRangeEnd: p,
|
|
23
|
+
onClick: b,
|
|
24
|
+
onMouseEnter: c,
|
|
25
|
+
onMouseLeave: j,
|
|
26
|
+
cellPadding: k = "",
|
|
27
|
+
isRangeDisabled: l = !1,
|
|
28
|
+
id: v,
|
|
29
|
+
testid: N,
|
|
30
|
+
...g
|
|
31
|
+
}) {
|
|
32
|
+
return /* @__PURE__ */ r(
|
|
33
|
+
"span",
|
|
34
|
+
{
|
|
35
|
+
...g,
|
|
36
|
+
id: v,
|
|
37
|
+
"data-testid": N,
|
|
38
|
+
className: u(
|
|
39
|
+
"flex items-center justify-center aspect-square select-none transition-colors border duration-100 font-medium",
|
|
40
|
+
Y.caption,
|
|
41
|
+
k,
|
|
42
|
+
!x && !o && !n && !i && !d && !p && "border-transparent active:bg-background-primary-normal",
|
|
43
|
+
!y && "border-transparent",
|
|
44
|
+
// Today: subtle border ring
|
|
45
|
+
x && !o && !n && "rounded-full border-border-primary-normal hover:rounded-base hover:border-transparent active:rounded-full active:bg-transparent active:border-border-primary-normal",
|
|
46
|
+
// Selected: Figma blue, white text, strong shadow
|
|
47
|
+
o && "bg-background-action-primary-normal text-text-on-action-primary-normal border-border-action-normal z-10",
|
|
48
|
+
!o && !n && "rounded-base",
|
|
49
|
+
// When range is disabled OR when only 'from' is selected (no range yet), apply rounded corners
|
|
50
|
+
(l || !n && o) && "rounded-base",
|
|
51
|
+
n && o && "hover:border-border-action-hover hover:bg-background-action-primary-hover active:text-text-on-action-primary-active active:bg-background-action-primary-active",
|
|
52
|
+
// In range: Figma light blue background
|
|
53
|
+
n && !o && "bg-background-action-secondary-hover text-text-primary-normal border-border-action-normal border-x-0 active:bg-background-action-secondary-hover active:border-border-action-active active:text-text-action-primary-active hover:border-border-action-hover",
|
|
54
|
+
// Disabled: Figma gray, no pointer, no hover
|
|
55
|
+
i && !n ? "text-text-primary-disabled bg-transparent pointer-events-none opacity-40 border-transparent" : [
|
|
56
|
+
!o && "text-text-primary-normal",
|
|
57
|
+
!o && "hover:bg-background-action-secondary-hover",
|
|
58
|
+
"cursor-pointer",
|
|
59
|
+
// Figma hover: blue bg, blue text (or red text if selected)
|
|
60
|
+
!o && "hover:bg-action-100 hover:text-text-action-primary-hover",
|
|
61
|
+
// Figma active: darker blue bg, white text
|
|
62
|
+
!o && !n && "active:bg-transparent active:text-text-action-primary-active",
|
|
63
|
+
// Figma focus: ring
|
|
64
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-400"
|
|
65
|
+
],
|
|
66
|
+
d && "rounded-l",
|
|
67
|
+
p && "rounded-r"
|
|
68
|
+
),
|
|
69
|
+
tabIndex: i ? -1 : 0,
|
|
70
|
+
"aria-disabled": i,
|
|
71
|
+
onClick: () => !i && y && b(),
|
|
72
|
+
onMouseEnter: () => y && c(),
|
|
73
|
+
onMouseLeave: () => y && j(),
|
|
74
|
+
children: y ? h.day : ""
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function bt({
|
|
79
|
+
from: h,
|
|
80
|
+
to: y,
|
|
81
|
+
onChange: x,
|
|
82
|
+
onPendingFromChange: o,
|
|
83
|
+
isDateAvailable: n,
|
|
84
|
+
mode: i = "double",
|
|
85
|
+
cardStyle: d = !1,
|
|
86
|
+
disableRange: p = !1,
|
|
87
|
+
id: b,
|
|
88
|
+
testid: c
|
|
89
|
+
}) {
|
|
90
|
+
const j = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], k = (t) => {
|
|
91
|
+
if (t)
|
|
92
|
+
try {
|
|
93
|
+
return typeof t == "number" ? f.PlainDate.from(new Date(t).toISOString().slice(0, 10)) : typeof t == "string" ? f.PlainDate.from(t) : void 0;
|
|
94
|
+
} catch (e) {
|
|
95
|
+
return console.error("Invalid date format:", t, e), f.Now.plainDateISO();
|
|
96
|
+
}
|
|
97
|
+
}, l = k(h), v = k(y), N = f.Now.plainDateISO(), [g, W] = $(
|
|
98
|
+
l ?? N.with({ day: 1 })
|
|
99
|
+
), [E, S] = $("from"), [m, T] = $(void 0), [O, q] = $(void 0);
|
|
100
|
+
J(() => {
|
|
101
|
+
l ? W(l.with({ day: 1 })) : v && W(v.with({ day: 1 }));
|
|
102
|
+
}, [h, y]), J(() => {
|
|
103
|
+
l && v && (S("from"), T(void 0), q(void 0));
|
|
104
|
+
}, [h, y]);
|
|
105
|
+
function C(t) {
|
|
106
|
+
const e = g.add({ months: t }).with({ day: 1 }), w = e.daysInMonth, M = e.dayOfWeek % 7;
|
|
107
|
+
return {
|
|
108
|
+
name: e.toLocaleString("en-US", { month: "long" }),
|
|
109
|
+
year: e.year,
|
|
110
|
+
days: w,
|
|
111
|
+
firstDayOffset: M,
|
|
112
|
+
date: e
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function G(t) {
|
|
116
|
+
const e = g.with({ month: t }).with({ day: 1 }), w = e.daysInMonth, M = e.dayOfWeek % 7;
|
|
117
|
+
return {
|
|
118
|
+
name: e.toLocaleString("en-US", { month: "long" }),
|
|
119
|
+
year: e.year,
|
|
120
|
+
days: w,
|
|
121
|
+
firstDayOffset: M,
|
|
122
|
+
date: e
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function I(t) {
|
|
126
|
+
if (!(n && !n(t))) {
|
|
127
|
+
if (i === "single" && p) {
|
|
128
|
+
x && x(t.toString(), t.toString());
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (E === "from")
|
|
132
|
+
T(t), S("to"), q(void 0), o?.(t.toString());
|
|
133
|
+
else if (m) {
|
|
134
|
+
if (x) {
|
|
135
|
+
const [e, w] = f.PlainDate.compare(t, m) < 0 ? [t, m] : [m, t];
|
|
136
|
+
x(e.toString(), w.toString());
|
|
137
|
+
}
|
|
138
|
+
T(void 0), S("from"), q(void 0);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function L(t) {
|
|
143
|
+
if (i === "single" && p)
|
|
144
|
+
return !1;
|
|
145
|
+
if (m && E === "to" && O) {
|
|
146
|
+
const [e, w] = f.PlainDate.compare(O, m) < 0 ? [O, m] : [m, O];
|
|
147
|
+
return f.PlainDate.compare(t, e) >= 0 && f.PlainDate.compare(t, w) <= 0;
|
|
148
|
+
}
|
|
149
|
+
return !m && l && v ? f.PlainDate.compare(t, l) >= 0 && f.PlainDate.compare(t, v) <= 0 : !1;
|
|
150
|
+
}
|
|
151
|
+
return /* @__PURE__ */ r(
|
|
152
|
+
"div",
|
|
153
|
+
{
|
|
154
|
+
id: b,
|
|
155
|
+
"data-testid": c,
|
|
156
|
+
className: u(
|
|
157
|
+
"relative rounded-base w-fit",
|
|
158
|
+
d ? "bg-background-grouped-primary-normal" : "bg-background-transparent",
|
|
159
|
+
at,
|
|
160
|
+
B,
|
|
161
|
+
d && "shadow-4",
|
|
162
|
+
// baseTransition,
|
|
163
|
+
"overflow-hidden"
|
|
164
|
+
),
|
|
165
|
+
children: /* @__PURE__ */ r(
|
|
166
|
+
"div",
|
|
167
|
+
{
|
|
168
|
+
className: u(
|
|
169
|
+
"flex flex-row items-start justify-start bg-background-transparent overflow-clip",
|
|
170
|
+
B
|
|
171
|
+
),
|
|
172
|
+
children: (i === "double" ? [0, 1] : [0]).map((t, e) => /* @__PURE__ */ r(
|
|
173
|
+
ct,
|
|
174
|
+
{
|
|
175
|
+
getMonthData: C,
|
|
176
|
+
getMonthDataWith: G,
|
|
177
|
+
offset: t,
|
|
178
|
+
idx: e,
|
|
179
|
+
id: b,
|
|
180
|
+
testid: c,
|
|
181
|
+
baseMonth: g,
|
|
182
|
+
setBaseMonth: W,
|
|
183
|
+
mode: i,
|
|
184
|
+
pendingFrom: m,
|
|
185
|
+
weekDays: j,
|
|
186
|
+
fromDate: l,
|
|
187
|
+
toDate: v,
|
|
188
|
+
isDateAvailable: n,
|
|
189
|
+
disableRange: p,
|
|
190
|
+
hoveredDate: O,
|
|
191
|
+
isInRange: L,
|
|
192
|
+
today: N,
|
|
193
|
+
setHoveredDate: q,
|
|
194
|
+
handleDayClick: I
|
|
195
|
+
},
|
|
196
|
+
e
|
|
197
|
+
))
|
|
198
|
+
}
|
|
199
|
+
)
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
function ct({
|
|
204
|
+
getMonthData: h,
|
|
205
|
+
getMonthDataWith: y,
|
|
206
|
+
offset: x,
|
|
207
|
+
idx: o,
|
|
208
|
+
id: n,
|
|
209
|
+
testid: i,
|
|
210
|
+
baseMonth: d,
|
|
211
|
+
setBaseMonth: p,
|
|
212
|
+
mode: b,
|
|
213
|
+
pendingFrom: c,
|
|
214
|
+
weekDays: j,
|
|
215
|
+
fromDate: k,
|
|
216
|
+
toDate: l,
|
|
217
|
+
isDateAvailable: v,
|
|
218
|
+
disableRange: N,
|
|
219
|
+
hoveredDate: g,
|
|
220
|
+
isInRange: W,
|
|
221
|
+
today: E,
|
|
222
|
+
setHoveredDate: S,
|
|
223
|
+
handleDayClick: m
|
|
224
|
+
}) {
|
|
225
|
+
const T = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], O = Array.from({ length: 100 }).map(
|
|
226
|
+
(a, P) => d.year - 50 + P
|
|
227
|
+
), [q, C] = $(!1), [G, I] = $(!1), L = K(null), t = K(null), e = h(x), w = 42, M = e.firstDayOffset;
|
|
228
|
+
return /* @__PURE__ */ U(ot.Fragment, { children: [
|
|
229
|
+
/* @__PURE__ */ U(
|
|
230
|
+
"div",
|
|
231
|
+
{
|
|
232
|
+
className: u("flex flex-col"),
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ U(
|
|
235
|
+
"div",
|
|
236
|
+
{
|
|
237
|
+
className: u(
|
|
238
|
+
"flex flex-row items-center justify-between",
|
|
239
|
+
Y.label,
|
|
240
|
+
"text-text-action-primary-normal"
|
|
241
|
+
),
|
|
242
|
+
children: [
|
|
243
|
+
o === 0 ? /* @__PURE__ */ r(
|
|
244
|
+
z,
|
|
245
|
+
{
|
|
246
|
+
iconOnly: !0,
|
|
247
|
+
leftIcon: /* @__PURE__ */ r(H, { name: "chevron_left" }),
|
|
248
|
+
variant: "quarternary-outlined",
|
|
249
|
+
id: n ? `${n}-prev-month-button` : void 0,
|
|
250
|
+
"data-testid": i ? `${i}-prev-month-button` : void 0,
|
|
251
|
+
type: "button",
|
|
252
|
+
className: u(
|
|
253
|
+
"flex items-center justify-center text-icon-action-primary-normal hover:bg-background-action-secondary-hover! hover:border-transparent! hover:text-icon-action-secondary-hover! active:bg-background-action-secondary-active! active:text-icon-action-secondary-active!",
|
|
254
|
+
_
|
|
255
|
+
),
|
|
256
|
+
"aria-label": "Previous month",
|
|
257
|
+
onClick: () => p(d.subtract({ months: 1 }))
|
|
258
|
+
}
|
|
259
|
+
) : /* @__PURE__ */ r("span", { className: u(_, "mr-1") }),
|
|
260
|
+
/* @__PURE__ */ U("div", { children: [
|
|
261
|
+
/* @__PURE__ */ r(
|
|
262
|
+
z,
|
|
263
|
+
{
|
|
264
|
+
variant: "tertiary",
|
|
265
|
+
ref: (a) => {
|
|
266
|
+
L.current = a;
|
|
267
|
+
},
|
|
268
|
+
type: "button",
|
|
269
|
+
onClick: () => {
|
|
270
|
+
C(!0), I(!1);
|
|
271
|
+
},
|
|
272
|
+
className: "font-semibold text-text-action-primary-normal text-[14px] py-[2px] pr-0!",
|
|
273
|
+
children: e.name
|
|
274
|
+
}
|
|
275
|
+
),
|
|
276
|
+
/* @__PURE__ */ r(
|
|
277
|
+
Q,
|
|
278
|
+
{
|
|
279
|
+
show: q,
|
|
280
|
+
positionTo: L,
|
|
281
|
+
setShow: () => C(!1),
|
|
282
|
+
children: T.map((a) => [a, y(a + 1)]).map(([a, P]) => /* @__PURE__ */ r(
|
|
283
|
+
R,
|
|
284
|
+
{
|
|
285
|
+
selected: d.month === a + 1,
|
|
286
|
+
onClick: () => {
|
|
287
|
+
p(d.with({ month: a + 1 })), C(!1);
|
|
288
|
+
},
|
|
289
|
+
children: P.name
|
|
290
|
+
},
|
|
291
|
+
P.name
|
|
292
|
+
))
|
|
293
|
+
}
|
|
294
|
+
),
|
|
295
|
+
/* @__PURE__ */ r(
|
|
296
|
+
z,
|
|
297
|
+
{
|
|
298
|
+
variant: "tertiary",
|
|
299
|
+
ref: (a) => {
|
|
300
|
+
t.current = a;
|
|
301
|
+
},
|
|
302
|
+
type: "button",
|
|
303
|
+
onClick: () => {
|
|
304
|
+
I(!0), C(!1);
|
|
305
|
+
},
|
|
306
|
+
className: "font-semibold text-text-action-primary-normal text-[14px] py-[2px] truncate pl-0!",
|
|
307
|
+
children: e.year
|
|
308
|
+
}
|
|
309
|
+
),
|
|
310
|
+
/* @__PURE__ */ r(
|
|
311
|
+
Q,
|
|
312
|
+
{
|
|
313
|
+
show: G,
|
|
314
|
+
positionTo: t,
|
|
315
|
+
setShow: () => I(!1),
|
|
316
|
+
children: O.map((a) => /* @__PURE__ */ r(
|
|
317
|
+
R,
|
|
318
|
+
{
|
|
319
|
+
selected: d.year === a,
|
|
320
|
+
onClick: () => {
|
|
321
|
+
p(d.with({ year: a })), I(!1);
|
|
322
|
+
},
|
|
323
|
+
children: a
|
|
324
|
+
},
|
|
325
|
+
a
|
|
326
|
+
))
|
|
327
|
+
}
|
|
328
|
+
)
|
|
329
|
+
] }),
|
|
330
|
+
b !== "double" || o === 1 ? /* @__PURE__ */ r(
|
|
331
|
+
z,
|
|
332
|
+
{
|
|
333
|
+
iconOnly: !0,
|
|
334
|
+
rightIcon: /* @__PURE__ */ r(H, { name: "chevron_right" }),
|
|
335
|
+
variant: "quarternary-outlined",
|
|
336
|
+
id: n ? `${n}-next-month-button` : void 0,
|
|
337
|
+
"data-testid": i ? `${i}-next-month-button` : void 0,
|
|
338
|
+
type: "button",
|
|
339
|
+
className: u(
|
|
340
|
+
"flex items-center justify-center text-icon-action-primary-normal hover:bg-background-action-secondary-hover! hover:border-transparent! hover:text-icon-action-secondary-hover! active:bg-background-action-secondary-active! active:text-icon-action-secondary-active!",
|
|
341
|
+
_
|
|
342
|
+
),
|
|
343
|
+
"aria-label": "Next month",
|
|
344
|
+
onClick: () => p(d.add({ months: 1 }))
|
|
345
|
+
}
|
|
346
|
+
) : /* @__PURE__ */ r("span", { className: u(_, "ml-1") })
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
),
|
|
350
|
+
/* @__PURE__ */ r("div", { className: u("grid grid-cols-7"), children: j.map((a) => /* @__PURE__ */ r(
|
|
351
|
+
"span",
|
|
352
|
+
{
|
|
353
|
+
className: u(
|
|
354
|
+
Y.caption,
|
|
355
|
+
"text-text-secondary-normal text-center",
|
|
356
|
+
"w-10"
|
|
357
|
+
),
|
|
358
|
+
children: a
|
|
359
|
+
},
|
|
360
|
+
a
|
|
361
|
+
)) }),
|
|
362
|
+
/* @__PURE__ */ r("div", { className: u("grid grid-cols-7"), children: Array.from({ length: w }).map((a, P) => {
|
|
363
|
+
const A = P - M + 1, s = e.date.with({ day: 1 }).add({
|
|
364
|
+
days: P - M
|
|
365
|
+
}), D = A > 0 && A <= e.days, V = D && s.equals(E), X = D && (!c && k && s.equals(k) || !c && l && s.equals(l) || c && s.equals(c)), Z = D && W(s), F = !D || (v ? !v(s) : !1), tt = g && c && f.PlainDate.compare(g, c) < 0, et = g && c && f.PlainDate.compare(g, c) >= 0, rt = b === "single" && N ? !1 : !c && D && k && s.equals(k) || et && s.equals(c), nt = b === "single" && N ? !1 : !c && D && l && s.equals(l) || tt && s.equals(c);
|
|
366
|
+
return /* @__PURE__ */ r(
|
|
367
|
+
it,
|
|
368
|
+
{
|
|
369
|
+
id: n ? `${n}-date-${s.toString()}` : void 0,
|
|
370
|
+
testid: i ? `${i}-date-${s.toString()}` : void 0,
|
|
371
|
+
date: s,
|
|
372
|
+
isInMonth: !!D,
|
|
373
|
+
isToday: !!V,
|
|
374
|
+
isSelected: !!X,
|
|
375
|
+
inRange: !!Z,
|
|
376
|
+
isDisabled: !!F,
|
|
377
|
+
onClick: () => m(s),
|
|
378
|
+
onMouseEnter: () => S(s),
|
|
379
|
+
onMouseLeave: () => S(void 0),
|
|
380
|
+
isRangeStart: !!rt,
|
|
381
|
+
isRangeEnd: !!nt,
|
|
382
|
+
isRangeDisabled: b === "single" && N,
|
|
383
|
+
cellPadding: _
|
|
384
|
+
},
|
|
385
|
+
P
|
|
386
|
+
);
|
|
387
|
+
}) })
|
|
388
|
+
]
|
|
389
|
+
}
|
|
390
|
+
),
|
|
391
|
+
b === "double" && o === 0 && /* @__PURE__ */ r(
|
|
392
|
+
"div",
|
|
393
|
+
{
|
|
394
|
+
className: u(
|
|
395
|
+
"self-stretch bg-border-primary-normal rounded-base",
|
|
396
|
+
// 1px width, full height, matches Figma divider
|
|
397
|
+
"w-px"
|
|
398
|
+
)
|
|
399
|
+
}
|
|
400
|
+
)
|
|
401
|
+
] }, e.name + e.year);
|
|
402
|
+
}
|
|
403
|
+
export {
|
|
404
|
+
bt as CalendarRange,
|
|
405
|
+
ht as isWeekend
|
|
406
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as f } from "../node_modules/clsx/dist/clsx.js";
|
|
3
|
+
import { typography as d } from "../classNames.js";
|
|
4
|
+
import { Icon as m } from "./Icon.js";
|
|
5
|
+
function N({
|
|
6
|
+
className: r,
|
|
7
|
+
children: e,
|
|
8
|
+
as: c = "span",
|
|
9
|
+
style: n = "default",
|
|
10
|
+
color: t,
|
|
11
|
+
align: x,
|
|
12
|
+
id: a,
|
|
13
|
+
testid: i,
|
|
14
|
+
marginTopDesktop: s,
|
|
15
|
+
...l
|
|
16
|
+
}) {
|
|
17
|
+
return /* @__PURE__ */ p("div", { id: a, "data-testid": i, className: "flex gap-1", children: [
|
|
18
|
+
/* @__PURE__ */ o(
|
|
19
|
+
u,
|
|
20
|
+
{
|
|
21
|
+
id: a,
|
|
22
|
+
testid: i,
|
|
23
|
+
style: n,
|
|
24
|
+
size: 16,
|
|
25
|
+
className: "mt-[3px] desktop:mt-0"
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
/* @__PURE__ */ o(
|
|
29
|
+
c,
|
|
30
|
+
{
|
|
31
|
+
id: a ? `${a}-text` : void 0,
|
|
32
|
+
"data-testid": i ? `${i}-text` : void 0,
|
|
33
|
+
className: f(
|
|
34
|
+
d.caption.replace("text-text-primary-normal", ""),
|
|
35
|
+
(n === "default" || n === "info") && "text-text-secondary-normal",
|
|
36
|
+
n === "success" && "text-text-success-normal",
|
|
37
|
+
n === "warning" && "text-text-warning-normal",
|
|
38
|
+
n === "error" && "text-text-critical-normal",
|
|
39
|
+
x === "left" && "text-left",
|
|
40
|
+
x === "center" && "text-center",
|
|
41
|
+
x === "right" && "text-right",
|
|
42
|
+
r,
|
|
43
|
+
s && "desktop:mt-px"
|
|
44
|
+
),
|
|
45
|
+
...l,
|
|
46
|
+
style: {
|
|
47
|
+
color: t ? `var(--color-${t})` : void 0
|
|
48
|
+
},
|
|
49
|
+
children: e
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
const u = ({
|
|
55
|
+
style: r,
|
|
56
|
+
size: e,
|
|
57
|
+
className: c,
|
|
58
|
+
id: n,
|
|
59
|
+
testid: t
|
|
60
|
+
}) => r === "success" ? /* @__PURE__ */ o("span", { className: "text-icon-success-normal contents", children: /* @__PURE__ */ o(
|
|
61
|
+
m,
|
|
62
|
+
{
|
|
63
|
+
id: n ? `${n}-icon` : void 0,
|
|
64
|
+
testid: t ? `${t}-icon` : void 0,
|
|
65
|
+
className: c,
|
|
66
|
+
name: "check_circle",
|
|
67
|
+
size: e
|
|
68
|
+
}
|
|
69
|
+
) }) : r === "warning" ? /* @__PURE__ */ o("span", { className: "text-icon-warning-normal contents", children: /* @__PURE__ */ o(
|
|
70
|
+
m,
|
|
71
|
+
{
|
|
72
|
+
id: n ? `${n}-icon` : void 0,
|
|
73
|
+
testid: t ? `${t}-icon` : void 0,
|
|
74
|
+
className: c,
|
|
75
|
+
name: "warning",
|
|
76
|
+
size: e
|
|
77
|
+
}
|
|
78
|
+
) }) : r === "error" ? /* @__PURE__ */ o("span", { className: "text-icon-critical-normal contents", children: /* @__PURE__ */ o(
|
|
79
|
+
m,
|
|
80
|
+
{
|
|
81
|
+
id: n ? `${n}-icon` : void 0,
|
|
82
|
+
testid: t ? `${t}-icon` : void 0,
|
|
83
|
+
className: c,
|
|
84
|
+
name: "info",
|
|
85
|
+
size: e
|
|
86
|
+
}
|
|
87
|
+
) }) : r === "info" ? /* @__PURE__ */ o("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ o(
|
|
88
|
+
m,
|
|
89
|
+
{
|
|
90
|
+
id: n ? `${n}-icon` : void 0,
|
|
91
|
+
testid: t ? `${t}-icon` : void 0,
|
|
92
|
+
className: c,
|
|
93
|
+
name: "info",
|
|
94
|
+
size: e
|
|
95
|
+
}
|
|
96
|
+
) }) : null;
|
|
97
|
+
export {
|
|
98
|
+
N as Caption
|
|
99
|
+
};
|