@dmsi/wedgekit-react 0.0.550 → 0.0.552
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/{chunk-U3QGZAVS.js → chunk-JADOJNBI.js} +4 -4
- package/dist/{chunk-N2KPADIL.js → chunk-WNGFRQ4Y.js} +7 -7
- package/dist/{chunk-ZVY3TLXL.js → chunk-ZIPJMN2E.js} +4 -4
- package/dist/components/Alert.js +2 -2
- package/dist/components/CalendarRange.js +10 -10
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +10 -10
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +10 -10
- package/dist/components/DataGrid/PinnedColumns.js +10 -10
- package/dist/components/DataGrid/TableBody/LoadingCell.js +10 -10
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +10 -10
- package/dist/components/DataGrid/TableBody/index.js +10 -10
- package/dist/components/DataGrid/index.js +10 -10
- package/dist/components/DataGrid/utils.js +10 -10
- package/dist/components/DateInput.js +10 -10
- package/dist/components/DateRangeInput.js +10 -10
- package/dist/components/FilterGroup.js +5 -5
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +10 -10
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +10 -10
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +5 -5
- package/dist/components/MobileDataGrid/index.js +10 -10
- package/dist/components/Modal.js +4 -4
- package/dist/components/ModalButtons.js +2 -2
- package/dist/components/ModalHeader.js +2 -2
- package/dist/components/NavigationTab.js +2 -2
- package/dist/components/NavigationTabs.js +2 -2
- package/dist/components/NestedMenu.js +3 -3
- package/dist/components/Notification.js +3 -3
- package/dist/components/OptionPill.js +2 -2
- package/dist/components/PDFViewer/DownloadIcon.js +2 -2
- package/dist/components/PDFViewer/PDFNavigation.js +2 -2
- package/dist/components/PDFViewer/index.js +6 -6
- package/dist/components/ProductImagePreview/index.js +1 -1
- package/dist/components/Stepper.js +3 -3
- package/dist/components/Toast.js +3 -3
- package/dist/components/Upload.js +3 -3
- package/dist/components/index.js +16 -16
- package/package.json +8 -9
- package/src/brand.css +0 -125
- package/src/classNames.ts +0 -174
- package/src/components/AccessChangerTabItem.tsx +0 -71
- package/src/components/Accordion.tsx +0 -108
- package/src/components/Alert.tsx +0 -81
- package/src/components/Breadcrumbs.tsx +0 -142
- package/src/components/Button.tsx +0 -216
- package/src/components/CalendarRange.tsx +0 -628
- package/src/components/Caption.tsx +0 -144
- package/src/components/Card.tsx +0 -88
- package/src/components/Checkbox.tsx +0 -206
- package/src/components/CompactImagesPreview.tsx +0 -135
- package/src/components/ContentTab.tsx +0 -84
- package/src/components/ContentTabs.tsx +0 -136
- package/src/components/DMSiLogo.tsx +0 -33
- package/src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx +0 -35
- package/src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx +0 -74
- package/src/components/DataGrid/PinnedColumns.tsx +0 -183
- package/src/components/DataGrid/TableBody/LoadingCell.tsx +0 -44
- package/src/components/DataGrid/TableBody/TableBodyRow.tsx +0 -157
- package/src/components/DataGrid/TableBody/index.tsx +0 -185
- package/src/components/DataGrid/index.tsx +0 -756
- package/src/components/DataGrid/types.ts +0 -98
- package/src/components/DataGrid/utils.tsx +0 -15
- package/src/components/DataGridCell.tsx +0 -526
- package/src/components/DataTable.tsx +0 -881
- package/src/components/DateInput.tsx +0 -306
- package/src/components/DateRangeInput.tsx +0 -758
- package/src/components/DebugJson.tsx +0 -28
- package/src/components/Display.tsx +0 -66
- package/src/components/EditingContext.tsx +0 -43
- package/src/components/EmptyCartIcon.tsx +0 -18
- package/src/components/FilterGroup.tsx +0 -264
- package/src/components/FullViewportBox.tsx +0 -19
- package/src/components/Grid.tsx +0 -97
- package/src/components/Heading.tsx +0 -72
- package/src/components/HorizontalDivider.tsx +0 -22
- package/src/components/Icon.tsx +0 -39
- package/src/components/ImagePlaceholder.tsx +0 -22
- package/src/components/Input.tsx +0 -609
- package/src/components/InputGroup.tsx +0 -59
- package/src/components/Label.tsx +0 -46
- package/src/components/Link.tsx +0 -117
- package/src/components/List.tsx +0 -18
- package/src/components/ListGroup.tsx +0 -82
- package/src/components/LiveChatComponent.tsx +0 -56
- package/src/components/LoadingScrim.tsx +0 -33
- package/src/components/LogoAgilityTopBar.tsx +0 -54
- package/src/components/LogoDMSiTopBar.tsx +0 -33
- package/src/components/LogoMillworkTopBar.tsx +0 -119
- package/src/components/MainBar.tsx +0 -91
- package/src/components/MaxViewportBox.tsx +0 -19
- package/src/components/Menu.tsx +0 -316
- package/src/components/MenuOption.tsx +0 -330
- package/src/components/MobileDataGrid/ColumnList.tsx +0 -66
- package/src/components/MobileDataGrid/ColumnSelector/index.tsx +0 -97
- package/src/components/MobileDataGrid/GridContextProvider/GridContext.tsx +0 -25
- package/src/components/MobileDataGrid/GridContextProvider/index.tsx +0 -132
- package/src/components/MobileDataGrid/GridContextProvider/useGridContext.ts +0 -10
- package/src/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.tsx +0 -27
- package/src/components/MobileDataGrid/MobileDataGridCard/index.tsx +0 -138
- package/src/components/MobileDataGrid/MobileDataGridHeader.tsx +0 -81
- package/src/components/MobileDataGrid/RowDetailModalProvider/ModalContent.tsx +0 -42
- package/src/components/MobileDataGrid/RowDetailModalProvider/index.tsx +0 -68
- package/src/components/MobileDataGrid/dataGridReducer.ts +0 -55
- package/src/components/MobileDataGrid/index.tsx +0 -92
- package/src/components/MobileDataGrid/types.ts +0 -4
- package/src/components/Modal.tsx +0 -312
- package/src/components/ModalButtons.tsx +0 -62
- package/src/components/ModalContent.tsx +0 -31
- package/src/components/ModalHeader.tsx +0 -78
- package/src/components/ModalScrim.tsx +0 -42
- package/src/components/NavigationTab.tsx +0 -95
- package/src/components/NavigationTabs.tsx +0 -70
- package/src/components/NestedMenu.tsx +0 -131
- package/src/components/Notification.tsx +0 -128
- package/src/components/OptionPill.tsx +0 -139
- package/src/components/OrderCheckIcon.tsx +0 -19
- package/src/components/PDFViewer/DownloadIcon.tsx +0 -25
- package/src/components/PDFViewer/PDFElement.tsx +0 -90
- package/src/components/PDFViewer/PDFNavigation.tsx +0 -68
- package/src/components/PDFViewer/PDFPage.tsx +0 -34
- package/src/components/PDFViewer/index.tsx +0 -128
- package/src/components/Pagination.tsx +0 -182
- package/src/components/Paragraph.tsx +0 -55
- package/src/components/Password.tsx +0 -62
- package/src/components/ProductImagePreview/CarouselPagination.tsx +0 -54
- package/src/components/ProductImagePreview/MobileImageCarousel.tsx +0 -226
- package/src/components/ProductImagePreview/ProductPrimaryImage.tsx +0 -219
- package/src/components/ProductImagePreview/Thumbnail.tsx +0 -55
- package/src/components/ProductImagePreview/ZoomWindow.tsx +0 -136
- package/src/components/ProductImagePreview/index.tsx +0 -182
- package/src/components/ProductImagePreview/useProductImagePreview.ts +0 -211
- package/src/components/ProjectBar.tsx +0 -82
- package/src/components/Radio.tsx +0 -146
- package/src/components/Search.tsx +0 -152
- package/src/components/SearchResultImage/index.tsx +0 -39
- package/src/components/Select.tsx +0 -114
- package/src/components/SideMenu.tsx +0 -30
- package/src/components/SideMenuGroup.tsx +0 -95
- package/src/components/SideMenuItem.tsx +0 -109
- package/src/components/SimpleTable.tsx +0 -77
- package/src/components/SkeletonParagraph.tsx +0 -31
- package/src/components/Spinner.tsx +0 -32
- package/src/components/Stack.tsx +0 -347
- package/src/components/StatusPill.tsx +0 -59
- package/src/components/Stepper.tsx +0 -128
- package/src/components/Subheader.tsx +0 -50
- package/src/components/Surface.tsx +0 -37
- package/src/components/Swatch.tsx +0 -1341
- package/src/components/Textarea.tsx +0 -102
- package/src/components/Theme.tsx +0 -27
- package/src/components/Time.tsx +0 -460
- package/src/components/Toast.tsx +0 -268
- package/src/components/Tooltip.tsx +0 -159
- package/src/components/TopBar.tsx +0 -139
- package/src/components/Upload.tsx +0 -107
- package/src/components/WorldpayIframe.tsx +0 -7
- package/src/components/index.ts +0 -34
- package/src/components/useMenuSystem.tsx +0 -456
- package/src/components/useMounted.tsx +0 -14
- package/src/darkmode.css +0 -278
- package/src/fonts.css +0 -23
- package/src/hooks/index.ts +0 -4
- package/src/hooks/useInfiniteScroll.tsx +0 -40
- package/src/hooks/useKeydown.ts +0 -42
- package/src/hooks/useMatchesMedia.ts +0 -18
- package/src/hooks/useTableLayout.ts +0 -106
- package/src/index.css +0 -800
- package/src/index.tsx +0 -5
- package/src/types.ts +0 -150
- package/src/utils/date.ts +0 -236
- package/src/utils/formatting.tsx +0 -81
- package/src/utils/index.ts +0 -4
- package/src/utils/mergeObjectArrays.ts +0 -18
- package/src/utils.ts +0 -24
- package/dist/{chunk-7FQ7PGUF.js → chunk-7COWXCPA.js} +3 -3
- package/dist/{chunk-NKCFYM7A.js → chunk-7SFFUICM.js} +3 -3
- package/dist/{chunk-25RZP3VR.js → chunk-AKJUBFJK.js} +3 -3
- package/dist/{chunk-TAPYQBQU.js → chunk-CMMQTIVM.js} +3 -3
- package/dist/{chunk-GYEXSNFP.js → chunk-FWCVZWE6.js} +3 -3
- package/dist/{chunk-MV6W7OMC.js → chunk-QMMPHXVE.js} +3 -3
- package/dist/{chunk-GG5OZTI5.js → chunk-XRE52QTN.js} +3 -3
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import clsx from "clsx";
|
|
2
|
-
import { Button } from "./Button";
|
|
3
|
-
import { Icon } from "./Icon";
|
|
4
|
-
import { CSSProperties } from "react";
|
|
5
|
-
|
|
6
|
-
export type NavigationTabProps = {
|
|
7
|
-
id?: string;
|
|
8
|
-
testid?: string;
|
|
9
|
-
label?: string;
|
|
10
|
-
onClick?: () => void;
|
|
11
|
-
selected?: boolean;
|
|
12
|
-
className?: string;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
colorPrimitives?: "dmsi" | "agility";
|
|
15
|
-
href?: string;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const NavigationTab = ({
|
|
19
|
-
id,
|
|
20
|
-
testid,
|
|
21
|
-
label,
|
|
22
|
-
onClick,
|
|
23
|
-
selected = false,
|
|
24
|
-
className,
|
|
25
|
-
disabled = false,
|
|
26
|
-
href,
|
|
27
|
-
...props
|
|
28
|
-
}: NavigationTabProps) => {
|
|
29
|
-
const textClassName = clsx(
|
|
30
|
-
// "!text-text-on-action-primary-hover", // use this once semantic tokens are available
|
|
31
|
-
"!text-brand-text-on-action-primary-hover",
|
|
32
|
-
// "hover:!text-text-on-action-primary-hover", // use this once semantic tokens are available
|
|
33
|
-
"hover:!text-brand-text-on-action-primary-hover",
|
|
34
|
-
// "active:!text-text-on-action-primary-active", // use this once semantic tokens are available
|
|
35
|
-
"active:!text-brand-text-on-action-primary-active",
|
|
36
|
-
"disabled:!text-brand-text-on-action-primary-disabled",
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
const disabledClassName = clsx(
|
|
40
|
-
"disabled:!bg-background-on-action-primary-disabled disabled:pointer-events-none",
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
const paddingClassName = clsx(
|
|
44
|
-
"p-mobile-component-padding desktop:p-desktop-component-padding compact:p-desktop-compact-component-padding",
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
const unselectedClassName = clsx(
|
|
48
|
-
"!bg-brand-200",
|
|
49
|
-
"hover:!bg-background-on-action-primary-normal",
|
|
50
|
-
// "hover:!bg-background-action-primary-normal", // use this once semantic tokens are available
|
|
51
|
-
"active:!bg-background-on-action-primary-active",
|
|
52
|
-
// "active:!bg-background-action-primary-active", // use this once semantic tokens are available
|
|
53
|
-
"shadow-nav-tab",
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
const selectedClassName = clsx(
|
|
57
|
-
"!bg-neutral-000",
|
|
58
|
-
"hover:!bg-background-on-action-primary-normal",
|
|
59
|
-
"active:!bg-background-on-action-primary-active",
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
const tokenOverrides: CSSProperties = {
|
|
63
|
-
"--color-text-on-action-primary-hover": "var(--color-brand-500)",
|
|
64
|
-
"--color-text-on-action-primary-active": "var(--color-brand-300)",
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<Button
|
|
69
|
-
id={id}
|
|
70
|
-
testid={testid}
|
|
71
|
-
variant="tertiary-critical"
|
|
72
|
-
colorClassName={textClassName}
|
|
73
|
-
className={clsx(
|
|
74
|
-
"!border-0 !rounded-b-none h-10 min-w-20 relative",
|
|
75
|
-
paddingClassName,
|
|
76
|
-
disabledClassName,
|
|
77
|
-
!selected && unselectedClassName,
|
|
78
|
-
selected && selectedClassName,
|
|
79
|
-
className,
|
|
80
|
-
)}
|
|
81
|
-
style={tokenOverrides}
|
|
82
|
-
classNameLabel="px-1"
|
|
83
|
-
rightIcon={<Icon name="close" size={16} />}
|
|
84
|
-
onClick={onClick}
|
|
85
|
-
disabled={disabled}
|
|
86
|
-
{...props}
|
|
87
|
-
as={href ? "a" : undefined}
|
|
88
|
-
href={href}
|
|
89
|
-
>
|
|
90
|
-
{label}
|
|
91
|
-
</Button>
|
|
92
|
-
);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
NavigationTab.displayName = "NavigationTab";
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
import { ReactNode, useState } from "react";
|
|
4
|
-
import { NavigationTab } from "./NavigationTab";
|
|
5
|
-
import { componentGap } from "../classNames";
|
|
6
|
-
|
|
7
|
-
type Tab = {
|
|
8
|
-
id?: string;
|
|
9
|
-
testid?: string;
|
|
10
|
-
label: string;
|
|
11
|
-
href?: string;
|
|
12
|
-
content?: ReactNode;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export type NavigationTabsProps = {
|
|
16
|
-
id?: string;
|
|
17
|
-
testid?: string;
|
|
18
|
-
tabs: Tab[];
|
|
19
|
-
onTabChange?: (tabId: string) => void;
|
|
20
|
-
colorPrimitives?: "dmsi" | "agility";
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const NavigationTabs = ({
|
|
24
|
-
id,
|
|
25
|
-
testid,
|
|
26
|
-
tabs,
|
|
27
|
-
onTabChange,
|
|
28
|
-
colorPrimitives = "dmsi",
|
|
29
|
-
}: NavigationTabsProps) => {
|
|
30
|
-
const [selectedTab, setSelectedTab] = useState<string>(tabs[0]?.id ?? "");
|
|
31
|
-
|
|
32
|
-
const handleTabClick = (id: string) => {
|
|
33
|
-
setSelectedTab(id);
|
|
34
|
-
onTabChange?.(id);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const selectedContent = tabs.find((tab) => tab.id === selectedTab)?.content;
|
|
38
|
-
const selectedTabHasHref = tabs.find((tab) => tab.id === selectedTab)?.href;
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<div id={id} data-testid={testid}>
|
|
42
|
-
<div>
|
|
43
|
-
<div
|
|
44
|
-
className={clsx(
|
|
45
|
-
"flex items-center relative overflow-x-auto overflow-y-hidden",
|
|
46
|
-
componentGap,
|
|
47
|
-
)}
|
|
48
|
-
>
|
|
49
|
-
{tabs.map((tab) => (
|
|
50
|
-
<NavigationTab
|
|
51
|
-
key={tab.id}
|
|
52
|
-
id={id ? `${id}-tab-${tab.id}` : undefined}
|
|
53
|
-
testid={testid ? `${testid}-tab-${tab.id}` : undefined}
|
|
54
|
-
label={tab.label}
|
|
55
|
-
selected={selectedTab === tab.id}
|
|
56
|
-
onClick={() => handleTabClick(tab.id!)}
|
|
57
|
-
colorPrimitives={colorPrimitives}
|
|
58
|
-
href={tab.href}
|
|
59
|
-
/>
|
|
60
|
-
))}
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
{selectedContent && !selectedTabHasHref && (
|
|
64
|
-
<div className="mt-2">{selectedContent}</div>
|
|
65
|
-
)}
|
|
66
|
-
</div>
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
NavigationTabs.displayName = "NavigationTabs";
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { Icon } from "./Icon";
|
|
5
|
-
import { MenuOption } from "./MenuOption";
|
|
6
|
-
import { useKeydown } from "../hooks";
|
|
7
|
-
import { Label } from "./Label";
|
|
8
|
-
import { Button } from "./Button";
|
|
9
|
-
|
|
10
|
-
export type NestedMenuEntry = {
|
|
11
|
-
id: string; // Unique identifier for the nested menu entry
|
|
12
|
-
label: string;
|
|
13
|
-
title?: string;
|
|
14
|
-
icon?: string;
|
|
15
|
-
subEntries?: NestedMenuEntry[];
|
|
16
|
-
url?: string;
|
|
17
|
-
onClick?: () => void; // Optional click handler
|
|
18
|
-
previousMenu?: NestedMenuEntry | null; // Reference to the previous menu entry
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export type NestedMenuProps = {
|
|
22
|
-
currentMenu: NestedMenuEntry; // Current menu entry, if any
|
|
23
|
-
onMenuClick: (
|
|
24
|
-
entry: NestedMenuEntry | null,
|
|
25
|
-
action?: "url" | "onClick" | "subEntry",
|
|
26
|
-
) => void; // Callback when a menu item is clicked. tailing
|
|
27
|
-
testid?: string;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export function NestedMenu(props: NestedMenuProps) {
|
|
31
|
-
const { onMenuClick, currentMenu, testid } = props;
|
|
32
|
-
const [selectedIndex, setSelectedIndex] = useState<number>(0);
|
|
33
|
-
|
|
34
|
-
useKeydown(
|
|
35
|
-
{
|
|
36
|
-
Escape: () => {
|
|
37
|
-
setSelectedIndex(0);
|
|
38
|
-
handleMenuClick(null, true);
|
|
39
|
-
},
|
|
40
|
-
ArrowUp: () => {
|
|
41
|
-
setSelectedIndex((prev) => (prev === 0 ? -1 : Math.max(prev - 1, 0)));
|
|
42
|
-
},
|
|
43
|
-
ArrowDown: () => {
|
|
44
|
-
setSelectedIndex((prev) => {
|
|
45
|
-
const entriesLength = currentMenu.subEntries?.length || 0;
|
|
46
|
-
if (prev === entriesLength - 1) return 0;
|
|
47
|
-
return Math.min(prev + 1, (currentMenu.subEntries || []).length - 1);
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
// "Space" is replaced with " " to handle spacebar.
|
|
51
|
-
"Enter/Space": () => {
|
|
52
|
-
const item = (currentMenu.subEntries || [])[selectedIndex];
|
|
53
|
-
handleMenuClick(
|
|
54
|
-
item || currentMenu.previousMenu,
|
|
55
|
-
!item && currentMenu.previousMenu !== null,
|
|
56
|
-
);
|
|
57
|
-
if (!item && !currentMenu.previousMenu?.previousMenu)
|
|
58
|
-
setSelectedIndex(0);
|
|
59
|
-
},
|
|
60
|
-
Backspace: () => {
|
|
61
|
-
handleMenuClick(currentMenu.previousMenu ?? null, true);
|
|
62
|
-
if (!currentMenu.previousMenu?.previousMenu) setSelectedIndex(0);
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
true,
|
|
66
|
-
); // Static active state as it unmounts if !currentMenu
|
|
67
|
-
|
|
68
|
-
function handleMenuClick(item: NestedMenuEntry | null, isPrevious = false) {
|
|
69
|
-
onMenuClick(
|
|
70
|
-
item && { ...item, ...(!isPrevious && { previousMenu: currentMenu }) },
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<div className="flex flex-col w-full">
|
|
76
|
-
<MenuOption
|
|
77
|
-
testid={testid ? `${testid}-back` : undefined}
|
|
78
|
-
variant="normal"
|
|
79
|
-
before={
|
|
80
|
-
<Icon
|
|
81
|
-
name="chevron_left"
|
|
82
|
-
className="icon text-text-action-normal"
|
|
83
|
-
size={24}
|
|
84
|
-
/>
|
|
85
|
-
}
|
|
86
|
-
onClick={() => handleMenuClick(currentMenu.previousMenu ?? null, true)}
|
|
87
|
-
selected={selectedIndex === -1}
|
|
88
|
-
>
|
|
89
|
-
<Label color="text-action-normal">
|
|
90
|
-
{currentMenu.previousMenu
|
|
91
|
-
? currentMenu.previousMenu.label
|
|
92
|
-
: "Main Menu"}
|
|
93
|
-
</Label>
|
|
94
|
-
</MenuOption>
|
|
95
|
-
<MenuOption
|
|
96
|
-
variant="action"
|
|
97
|
-
testid={testid ? `${testid}-title` : undefined}
|
|
98
|
-
>
|
|
99
|
-
{currentMenu.title ?? currentMenu.label}
|
|
100
|
-
</MenuOption>
|
|
101
|
-
{(currentMenu.subEntries || []).map((item, idx) => (
|
|
102
|
-
<MenuOption
|
|
103
|
-
testid={testid ? `${testid}-${item.label}` : undefined}
|
|
104
|
-
key={item.id}
|
|
105
|
-
variant="normal"
|
|
106
|
-
onClick={() => handleMenuClick(item)}
|
|
107
|
-
after={
|
|
108
|
-
item.subEntries?.length && (
|
|
109
|
-
<Button
|
|
110
|
-
iconOnly
|
|
111
|
-
variant="tertiary"
|
|
112
|
-
onClick={(e: React.MouseEvent) => {
|
|
113
|
-
e.preventDefault();
|
|
114
|
-
e.stopPropagation();
|
|
115
|
-
onMenuClick(item, "subEntry");
|
|
116
|
-
}}
|
|
117
|
-
className="!p-0 w-full justify-end"
|
|
118
|
-
leftIcon={
|
|
119
|
-
<Icon name="chevron_right" className="icon" size={24} />
|
|
120
|
-
}
|
|
121
|
-
/>
|
|
122
|
-
)
|
|
123
|
-
}
|
|
124
|
-
selected={selectedIndex === idx}
|
|
125
|
-
>
|
|
126
|
-
{item.label}
|
|
127
|
-
</MenuOption>
|
|
128
|
-
))}
|
|
129
|
-
</div>
|
|
130
|
-
);
|
|
131
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import clsx from "clsx";
|
|
4
|
-
|
|
5
|
-
import { ComponentProps, ReactNode, useState } from "react";
|
|
6
|
-
|
|
7
|
-
import { Button } from "./Button";
|
|
8
|
-
import { Paragraph } from "./Paragraph";
|
|
9
|
-
import { Heading3 } from "./Heading";
|
|
10
|
-
import { Icon } from "./Icon";
|
|
11
|
-
import { Stack } from "./Stack";
|
|
12
|
-
|
|
13
|
-
export interface NotificationProps {
|
|
14
|
-
id?: string;
|
|
15
|
-
testid?: string;
|
|
16
|
-
variant?: "success" | "warning" | "error" | "info";
|
|
17
|
-
title?: string;
|
|
18
|
-
message?: string;
|
|
19
|
-
enableMessage?: boolean;
|
|
20
|
-
description?: string;
|
|
21
|
-
enableDescription?: boolean;
|
|
22
|
-
disclaimer?: string;
|
|
23
|
-
enableDisclaimer?: boolean;
|
|
24
|
-
card?: boolean;
|
|
25
|
-
icon?: ReactNode;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const variants = {
|
|
29
|
-
success: {
|
|
30
|
-
className: "border-success-400",
|
|
31
|
-
icon: (
|
|
32
|
-
<span className="text-icon-success-normal contents">
|
|
33
|
-
<Icon name="check_circle" size={24} />
|
|
34
|
-
</span>
|
|
35
|
-
),
|
|
36
|
-
},
|
|
37
|
-
warning: {
|
|
38
|
-
className: "border-warning-400",
|
|
39
|
-
icon: (
|
|
40
|
-
<span className="text-icon-warning-normal contents">
|
|
41
|
-
<Icon name="warning" size={24} />
|
|
42
|
-
</span>
|
|
43
|
-
),
|
|
44
|
-
},
|
|
45
|
-
error: {
|
|
46
|
-
className: "border-critical-400",
|
|
47
|
-
icon: (
|
|
48
|
-
<span className="text-icon-critical-normal contents">
|
|
49
|
-
<Icon name="error" size={24} />
|
|
50
|
-
</span>
|
|
51
|
-
),
|
|
52
|
-
},
|
|
53
|
-
info: {
|
|
54
|
-
className: "border-action-400",
|
|
55
|
-
icon: (
|
|
56
|
-
<span className="text-icon-on-action-secondary-normal contents">
|
|
57
|
-
<Icon name="info" size={24} />
|
|
58
|
-
</span>
|
|
59
|
-
),
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const Notification = ({
|
|
64
|
-
id,
|
|
65
|
-
testid,
|
|
66
|
-
variant = "success",
|
|
67
|
-
title,
|
|
68
|
-
message,
|
|
69
|
-
enableMessage = true,
|
|
70
|
-
description,
|
|
71
|
-
enableDescription = false,
|
|
72
|
-
disclaimer,
|
|
73
|
-
enableDisclaimer = false,
|
|
74
|
-
card = false,
|
|
75
|
-
...props
|
|
76
|
-
}: NotificationProps & ComponentProps<"div">) => {
|
|
77
|
-
const [visible, setVisible] = useState(true);
|
|
78
|
-
|
|
79
|
-
const { className, icon: iconElement } =
|
|
80
|
-
variants[variant] ?? variants.success;
|
|
81
|
-
|
|
82
|
-
if (!visible) return null;
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<div
|
|
86
|
-
id={id}
|
|
87
|
-
data-testid={testid}
|
|
88
|
-
className={clsx(
|
|
89
|
-
"flex gap-mobile-layout-gap desktop:gap-desktop-layout-gap compact:gap-desktop-compact-layout-gap justify-between items-center border-2 rounded-sm w-full p-mobile-layout-padding desktop:p-desktop-layout-padding compact:p-desktop-compact-layout-padding bg-white max-w-240",
|
|
90
|
-
className,
|
|
91
|
-
card && "shadow-4",
|
|
92
|
-
)}
|
|
93
|
-
{...props}
|
|
94
|
-
>
|
|
95
|
-
<Stack
|
|
96
|
-
horizontal
|
|
97
|
-
horizontalMobile
|
|
98
|
-
items="start"
|
|
99
|
-
justify="start"
|
|
100
|
-
sizing="layout"
|
|
101
|
-
>
|
|
102
|
-
{iconElement}
|
|
103
|
-
|
|
104
|
-
<Stack elevation={0} items="start" justify="start" sizing="component">
|
|
105
|
-
{title && <Heading3 as="h3">{title}</Heading3>}
|
|
106
|
-
{message && enableMessage && <Paragraph as="p">{message}</Paragraph>}
|
|
107
|
-
{description && enableDescription && (
|
|
108
|
-
<Paragraph as="p">{description}</Paragraph>
|
|
109
|
-
)}
|
|
110
|
-
{disclaimer && enableDisclaimer && (
|
|
111
|
-
<Paragraph as="p">{disclaimer}</Paragraph>
|
|
112
|
-
)}
|
|
113
|
-
</Stack>
|
|
114
|
-
</Stack>
|
|
115
|
-
|
|
116
|
-
<Button
|
|
117
|
-
id={id ? `${id}-close-button` : undefined}
|
|
118
|
-
testid={testid ? `${testid}-close-button` : undefined}
|
|
119
|
-
iconOnly
|
|
120
|
-
variant="tertiary"
|
|
121
|
-
onClick={() => setVisible(false)}
|
|
122
|
-
leftIcon={<Icon name="close" size={24} />}
|
|
123
|
-
/>
|
|
124
|
-
</div>
|
|
125
|
-
);
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
Notification.displayName = "Notification";
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import clsx from "clsx";
|
|
2
|
-
import { ComponentProps } from "react";
|
|
3
|
-
import {
|
|
4
|
-
baseTransition,
|
|
5
|
-
componentGap,
|
|
6
|
-
componentPadding,
|
|
7
|
-
componentPaddingMinusBorder,
|
|
8
|
-
componentPaddingYUsingComponentGap,
|
|
9
|
-
} from "../classNames";
|
|
10
|
-
import { Button } from "./Button";
|
|
11
|
-
import { Label } from "./Label";
|
|
12
|
-
import { Icon } from "./Icon";
|
|
13
|
-
|
|
14
|
-
type OptionPillProps = {
|
|
15
|
-
id?: string;
|
|
16
|
-
testid?: string;
|
|
17
|
-
selected?: boolean;
|
|
18
|
-
onClick?: () => void;
|
|
19
|
-
onRemove?: () => void;
|
|
20
|
-
removable?: boolean;
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
active?: boolean;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const OptionPill = ({
|
|
26
|
-
id,
|
|
27
|
-
testid,
|
|
28
|
-
selected = false,
|
|
29
|
-
onClick,
|
|
30
|
-
onRemove,
|
|
31
|
-
removable = false,
|
|
32
|
-
active = false,
|
|
33
|
-
disabled = false,
|
|
34
|
-
children,
|
|
35
|
-
className,
|
|
36
|
-
...props
|
|
37
|
-
}: ComponentProps<"div"> & OptionPillProps) => {
|
|
38
|
-
const additionalAttributes = {
|
|
39
|
-
"data-disabled": disabled || null,
|
|
40
|
-
"data-selected": selected || null,
|
|
41
|
-
"data-active": active || null,
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const classNames = clsx(
|
|
45
|
-
{
|
|
46
|
-
// Base interactive (only when not disabled)
|
|
47
|
-
"hover:border-border-action-hover active:border-border-action-active":
|
|
48
|
-
!disabled,
|
|
49
|
-
|
|
50
|
-
// Disabled base
|
|
51
|
-
"data-disabled:cursor-default data-disabled:border-border-primary-normal":
|
|
52
|
-
disabled,
|
|
53
|
-
|
|
54
|
-
// Active (Figma: filled blue background, white text)
|
|
55
|
-
"data-active:bg-background-action-primary-normal data-active:text-white data-active:border-transparent":
|
|
56
|
-
active && !selected,
|
|
57
|
-
|
|
58
|
-
// Selected (filled style) overrides background & border, but keeps outline interaction chain.
|
|
59
|
-
"data-selected:border-transparent data-selected:bg-background-action-secondary-hover data-selected:outline-border-action-normal data-selected:hover:outline-border-action-hover data-selected:active:outline-border-action-active":
|
|
60
|
-
selected,
|
|
61
|
-
|
|
62
|
-
// Disabled + Selected combination
|
|
63
|
-
"data-selected:data-disabled:bg-background-action-secondary-disabled data-selected:data-disabled:border-border-action-disabled data-selected:data-disabled:outline-transparent":
|
|
64
|
-
disabled && selected,
|
|
65
|
-
},
|
|
66
|
-
!removable && componentPadding,
|
|
67
|
-
removable &&
|
|
68
|
-
"pl-mobile-component-padding desktop:pl-desktop-component-padding compact:pl-desktop-compact-component-padding",
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
const textColor = clsx(
|
|
72
|
-
!disabled && "text-text-primary-normal",
|
|
73
|
-
disabled && !selected && "text-text-primary-disabled",
|
|
74
|
-
disabled && selected && "text-text-on-action-primary-disabled",
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
return (
|
|
78
|
-
<div
|
|
79
|
-
id={id}
|
|
80
|
-
data-testid={testid}
|
|
81
|
-
onClick={handleOnClick}
|
|
82
|
-
{...props}
|
|
83
|
-
{...additionalAttributes}
|
|
84
|
-
className={clsx(
|
|
85
|
-
"flex items-center justify-between cursor-pointer w-max",
|
|
86
|
-
"border border-border-primary-normal rounded-base",
|
|
87
|
-
"outline-2 outline-transparent -outline-offset-2",
|
|
88
|
-
componentGap,
|
|
89
|
-
baseTransition,
|
|
90
|
-
classNames,
|
|
91
|
-
className,
|
|
92
|
-
textColor,
|
|
93
|
-
)}
|
|
94
|
-
>
|
|
95
|
-
<Label
|
|
96
|
-
id={id ? `${id}-label` : undefined}
|
|
97
|
-
testid={testid ? `${testid}-label` : undefined}
|
|
98
|
-
padded
|
|
99
|
-
className={componentPaddingYUsingComponentGap}
|
|
100
|
-
>
|
|
101
|
-
{children}
|
|
102
|
-
</Label>
|
|
103
|
-
|
|
104
|
-
{removable && (
|
|
105
|
-
<Button
|
|
106
|
-
id={id ? `${id}-remove-button` : undefined}
|
|
107
|
-
testid={testid ? `${testid}-remove-button` : undefined}
|
|
108
|
-
onClick={handleOnRemove}
|
|
109
|
-
disabled={disabled}
|
|
110
|
-
className={clsx(
|
|
111
|
-
"mx-0 h-full w-10 !border-0",
|
|
112
|
-
componentPaddingMinusBorder,
|
|
113
|
-
)}
|
|
114
|
-
iconOnly
|
|
115
|
-
variant="tertiary"
|
|
116
|
-
leftIcon={<Icon name="close" size={16} />}
|
|
117
|
-
/>
|
|
118
|
-
)}
|
|
119
|
-
</div>
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
function handleOnClick() {
|
|
123
|
-
if (disabled) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
onClick?.();
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function handleOnRemove() {
|
|
131
|
-
if (!removable || !onRemove) {
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
onRemove();
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
OptionPill.displayName = "OptionPill";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SVGProps } from "react";
|
|
2
|
-
|
|
3
|
-
export function OrderCheckIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
-
return (
|
|
5
|
-
<svg
|
|
6
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
-
viewBox="0 0 37 36"
|
|
8
|
-
fill="none"
|
|
9
|
-
width={37}
|
|
10
|
-
height={36}
|
|
11
|
-
{...props}
|
|
12
|
-
>
|
|
13
|
-
<path
|
|
14
|
-
d="M18.457 3.00024C19.6493 3.01827 20.8644 3.13827 22.0283 3.41724C22.8321 3.61234 23.3287 4.42237 23.1337 5.22778C22.9402 6.03178 22.1252 6.5272 21.3242 6.33521C20.3928 6.11026 19.4046 6.01526 18.4658 6.00024C15.2603 6.00924 12.2492 7.26586 9.99018 9.53833C7.72976 11.8108 6.49103 14.829 6.49995 18.0344C6.50895 21.2399 7.7656 24.2495 10.038 26.51C12.303 28.7615 15.3065 30.0002 18.4999 30.0002H18.5341C21.7396 29.9912 24.7507 28.7346 27.0097 26.4622C29.2701 24.1882 30.5089 21.1714 30.4999 17.9661C30.4984 17.1382 31.1673 16.4629 31.9951 16.4612H31.9999C32.8263 16.4612 33.4982 17.13 33.4999 17.9563C33.5119 21.9627 31.9625 25.7354 29.1367 28.5764C26.3123 31.4173 22.5503 32.9881 18.5439 33.0002H18.4999C14.5086 33.0002 10.7542 31.4523 7.92378 28.637C5.08288 25.8126 3.51206 22.0505 3.49995 18.0442C3.48795 14.0363 5.03742 10.265 7.86323 7.42407C10.6877 4.58307 14.4505 3.01224 18.457 3.00024ZM27.872 9.51196C28.418 8.89248 29.3642 8.82637 29.9882 9.37231C30.6107 9.91681 30.6739 10.8645 30.1279 11.4885L19.6279 23.4885C19.3549 23.8004 18.9652 23.9852 18.5498 24.0002H18.4999C18.1025 24.0002 17.7214 23.8428 17.4394 23.5608L12.9394 19.0608C12.3529 18.4743 12.353 17.5262 12.9394 16.9397C13.5259 16.3532 14.474 16.3532 15.0605 16.9397L18.4267 20.3059L27.872 9.51196Z"
|
|
15
|
-
fill="#1D1E1E"
|
|
16
|
-
/>
|
|
17
|
-
</svg>
|
|
18
|
-
);
|
|
19
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Button } from "../Button";
|
|
2
|
-
import { Icon } from "../Icon";
|
|
3
|
-
import { Tooltip } from "../Tooltip";
|
|
4
|
-
|
|
5
|
-
export function DownloadIcon({
|
|
6
|
-
onClick,
|
|
7
|
-
isDownloading,
|
|
8
|
-
testid,
|
|
9
|
-
}: {
|
|
10
|
-
onClick: () => void;
|
|
11
|
-
isDownloading?: boolean;
|
|
12
|
-
testid?: string;
|
|
13
|
-
}) {
|
|
14
|
-
return (
|
|
15
|
-
<Tooltip message="Download" position="bottom">
|
|
16
|
-
<Button
|
|
17
|
-
testid={testid}
|
|
18
|
-
iconOnly
|
|
19
|
-
variant="tertiary"
|
|
20
|
-
leftIcon={<Icon name={isDownloading ? "cached" : "download"} />}
|
|
21
|
-
onClick={onClick}
|
|
22
|
-
/>
|
|
23
|
-
</Tooltip>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { usePdf } from "@mikecousins/react-pdf";
|
|
2
|
-
import { useRef } from "react";
|
|
3
|
-
import { Spinner } from "../Spinner";
|
|
4
|
-
import { Stack } from "../Stack";
|
|
5
|
-
import { PdfPage } from "./PDFPage";
|
|
6
|
-
import clsx from "clsx";
|
|
7
|
-
|
|
8
|
-
export function PDFElement({
|
|
9
|
-
b64,
|
|
10
|
-
testid,
|
|
11
|
-
isMobile,
|
|
12
|
-
error,
|
|
13
|
-
}: {
|
|
14
|
-
b64: string;
|
|
15
|
-
testid?: string;
|
|
16
|
-
isMobile?: boolean;
|
|
17
|
-
error?: React.ReactNode;
|
|
18
|
-
}) {
|
|
19
|
-
const canvasRef = useRef<HTMLCanvasElement>(null);
|
|
20
|
-
|
|
21
|
-
const { pdfDocument } = usePdf({
|
|
22
|
-
file: `data:application/pdf;base64,${b64}`,
|
|
23
|
-
workerSrc: "/scripts/pdf.worker.min.mjs",
|
|
24
|
-
scale: isMobile ? 1 : 1.3,
|
|
25
|
-
canvasRef,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const pagesArr = new Array(pdfDocument?.numPages ?? 1).fill(null);
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<div
|
|
32
|
-
className="flex flex-col space-y-4"
|
|
33
|
-
style={
|
|
34
|
-
!isMobile
|
|
35
|
-
? {
|
|
36
|
-
minHeight: 871,
|
|
37
|
-
minWidth: 654,
|
|
38
|
-
}
|
|
39
|
-
: undefined
|
|
40
|
-
}
|
|
41
|
-
>
|
|
42
|
-
{!!pdfDocument && !!b64 && !error ? (
|
|
43
|
-
<Stack sizing="layout-group">
|
|
44
|
-
{pagesArr.length > 1 ? (
|
|
45
|
-
pagesArr.map((_, i) => (
|
|
46
|
-
<div
|
|
47
|
-
key={`${testid}-pdf-page-${i + 1}`}
|
|
48
|
-
className={clsx(
|
|
49
|
-
"flex justify-center border-border-primary-normal",
|
|
50
|
-
isMobile ? "border-0" : "border",
|
|
51
|
-
)}
|
|
52
|
-
>
|
|
53
|
-
<PdfPage
|
|
54
|
-
testid={testid ? `${testid}-pdf_page_${i + 1}` : undefined}
|
|
55
|
-
file={`data:application/pdf;base64,${b64}`}
|
|
56
|
-
pageNumber={i + 1}
|
|
57
|
-
/>
|
|
58
|
-
</div>
|
|
59
|
-
))
|
|
60
|
-
) : (
|
|
61
|
-
<div
|
|
62
|
-
className={clsx(
|
|
63
|
-
"flex justify-center border-border-primary-normal",
|
|
64
|
-
isMobile ? "border-0" : "border",
|
|
65
|
-
)}
|
|
66
|
-
>
|
|
67
|
-
<canvas
|
|
68
|
-
data-testid={testid ? `${testid}-pdf-content` : undefined}
|
|
69
|
-
ref={canvasRef}
|
|
70
|
-
style={{ width: "100%", height: "auto" }}
|
|
71
|
-
/>
|
|
72
|
-
</div>
|
|
73
|
-
)}
|
|
74
|
-
</Stack>
|
|
75
|
-
) : (
|
|
76
|
-
<Stack
|
|
77
|
-
justify="center"
|
|
78
|
-
items="center"
|
|
79
|
-
height="full"
|
|
80
|
-
flexGrow={1}
|
|
81
|
-
data-testid={
|
|
82
|
-
testid ? `${testid}-pdf-${error ? "error" : "loading"}` : undefined
|
|
83
|
-
}
|
|
84
|
-
>
|
|
85
|
-
{error ? error : <Spinner size="large" />}
|
|
86
|
-
</Stack>
|
|
87
|
-
)}
|
|
88
|
-
</div>
|
|
89
|
-
);
|
|
90
|
-
}
|