@dmsi/wedgekit-react 0.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/README.md +35 -0
- package/dist/chunk-27KIIUAR.js +59 -0
- package/dist/chunk-2G2E2JMA.js +123 -0
- package/dist/chunk-4C66DLIJ.js +51 -0
- package/dist/chunk-4RD5ZF2V.js +55 -0
- package/dist/chunk-4RJKB7LC.js +14 -0
- package/dist/chunk-4T7F5BZZ.js +26 -0
- package/dist/chunk-5GOBP2JS.js +53 -0
- package/dist/chunk-6ZY524ID.js +42 -0
- package/dist/chunk-AWQSSKCK.js +32 -0
- package/dist/chunk-BNHSAFMP.js +93 -0
- package/dist/chunk-BWRHL2AG.js +439 -0
- package/dist/chunk-DKKYR6DS.js +132 -0
- package/dist/chunk-E5ALT5W7.js +182 -0
- package/dist/chunk-FY7PTP6E.js +322 -0
- package/dist/chunk-GTCSRHPF.js +119 -0
- package/dist/chunk-I2UVVKQI.js +12 -0
- package/dist/chunk-IGQVA7SC.js +41 -0
- package/dist/chunk-K3IKUSZW.js +59 -0
- package/dist/chunk-KENSVWOY.js +151 -0
- package/dist/chunk-KX3O6GJ6.js +138 -0
- package/dist/chunk-L4UM372R.js +253 -0
- package/dist/chunk-ORMEWXMH.js +37 -0
- package/dist/chunk-Q3FKEKIN.js +23 -0
- package/dist/chunk-SEKKGFM6.js +28 -0
- package/dist/chunk-SY3HT54E.js +91 -0
- package/dist/chunk-TAW5ZZ4Z.js +346 -0
- package/dist/chunk-TRUPPHBQ.js +109 -0
- package/dist/chunk-TU55CHXU.js +30 -0
- package/dist/chunk-TWZZB4WO.js +114 -0
- package/dist/chunk-TYI74BSP.js +62 -0
- package/dist/chunk-U42SKNR6.js +104 -0
- package/dist/chunk-UU3FA6LV.js +72 -0
- package/dist/chunk-WVUIIBRR.js +51 -0
- package/dist/chunk-XUIPGYP5.js +39 -0
- package/dist/chunk-Z4UCFUF7.js +299 -0
- package/dist/components/Breadcrumbs.cjs +376 -0
- package/dist/components/Breadcrumbs.js +90 -0
- package/dist/components/Button.cjs +319 -0
- package/dist/components/Button.js +8 -0
- package/dist/components/CalendarRange.cjs +520 -0
- package/dist/components/CalendarRange.js +13 -0
- package/dist/components/Caption.cjs +283 -0
- package/dist/components/Caption.js +80 -0
- package/dist/components/Checkbox.cjs +378 -0
- package/dist/components/Checkbox.js +11 -0
- package/dist/components/ContentTab.cjs +382 -0
- package/dist/components/ContentTab.js +10 -0
- package/dist/components/ContentTabs.cjs +472 -0
- package/dist/components/ContentTabs.js +98 -0
- package/dist/components/DMSiLogo.cjs +79 -0
- package/dist/components/DMSiLogo.js +56 -0
- package/dist/components/DataGrid.cjs +3113 -0
- package/dist/components/DataGrid.js +758 -0
- package/dist/components/DataGridCell.cjs +1907 -0
- package/dist/components/DataGridCell.js +24 -0
- package/dist/components/DataTable.cjs +791 -0
- package/dist/components/DataTable.js +720 -0
- package/dist/components/DateInput.cjs +1130 -0
- package/dist/components/DateInput.js +170 -0
- package/dist/components/DateRangeInput.cjs +1131 -0
- package/dist/components/DateRangeInput.js +171 -0
- package/dist/components/DebugJson.cjs +50 -0
- package/dist/components/DebugJson.js +27 -0
- package/dist/components/Display.cjs +234 -0
- package/dist/components/Display.js +12 -0
- package/dist/components/EditingContext.cjs +73 -0
- package/dist/components/EditingContext.js +35 -0
- package/dist/components/FilterGroup.cjs +1431 -0
- package/dist/components/FilterGroup.js +231 -0
- package/dist/components/FullViewportBox.cjs +35 -0
- package/dist/components/FullViewportBox.js +12 -0
- package/dist/components/Grid.cjs +69 -0
- package/dist/components/Grid.js +36 -0
- package/dist/components/GridContainer.cjs +125 -0
- package/dist/components/GridContainer.js +92 -0
- package/dist/components/Heading.cjs +238 -0
- package/dist/components/Heading.js +14 -0
- package/dist/components/HorizontalDivider.cjs +33 -0
- package/dist/components/HorizontalDivider.js +10 -0
- package/dist/components/Icon.cjs +98 -0
- package/dist/components/Icon.js +7 -0
- package/dist/components/Input.cjs +672 -0
- package/dist/components/Input.js +21 -0
- package/dist/components/InputGroup.cjs +270 -0
- package/dist/components/InputGroup.js +60 -0
- package/dist/components/Label.cjs +223 -0
- package/dist/components/Label.js +8 -0
- package/dist/components/Link.cjs +262 -0
- package/dist/components/Link.js +8 -0
- package/dist/components/List.cjs +37 -0
- package/dist/components/List.js +14 -0
- package/dist/components/LiveChatComponent.cjs +63 -0
- package/dist/components/LiveChatComponent.js +40 -0
- package/dist/components/LogoAgilityTopBar.cjs +115 -0
- package/dist/components/LogoAgilityTopBar.js +92 -0
- package/dist/components/LogoDMSiTopBar.cjs +79 -0
- package/dist/components/LogoDMSiTopBar.js +7 -0
- package/dist/components/LogoMillworkTopBar.cjs +221 -0
- package/dist/components/LogoMillworkTopBar.js +198 -0
- package/dist/components/MainBar.cjs +211 -0
- package/dist/components/MainBar.js +65 -0
- package/dist/components/Menu.cjs +437 -0
- package/dist/components/Menu.js +11 -0
- package/dist/components/MenuOption.cjs +483 -0
- package/dist/components/MenuOption.js +13 -0
- package/dist/components/MobileDataGrid.cjs +658 -0
- package/dist/components/MobileDataGrid.js +125 -0
- package/dist/components/Modal.cjs +783 -0
- package/dist/components/Modal.js +245 -0
- package/dist/components/ModalButtons.cjs +385 -0
- package/dist/components/ModalButtons.js +10 -0
- package/dist/components/ModalContent.cjs +57 -0
- package/dist/components/ModalContent.js +7 -0
- package/dist/components/ModalHeader.cjs +426 -0
- package/dist/components/ModalHeader.js +11 -0
- package/dist/components/ModalScrim.cjs +64 -0
- package/dist/components/ModalScrim.js +7 -0
- package/dist/components/NavigationTab.cjs +431 -0
- package/dist/components/NavigationTab.js +10 -0
- package/dist/components/NavigationTabs.cjs +477 -0
- package/dist/components/NavigationTabs.js +56 -0
- package/dist/components/Notification.cjs +640 -0
- package/dist/components/Notification.js +117 -0
- package/dist/components/OptionPill.cjs +478 -0
- package/dist/components/OptionPill.js +11 -0
- package/dist/components/Paragraph.cjs +231 -0
- package/dist/components/Paragraph.js +8 -0
- package/dist/components/Password.cjs +700 -0
- package/dist/components/Password.js +53 -0
- package/dist/components/ProjectBar.cjs +242 -0
- package/dist/components/ProjectBar.js +63 -0
- package/dist/components/Radio.cjs +349 -0
- package/dist/components/Radio.js +131 -0
- package/dist/components/Search.cjs +767 -0
- package/dist/components/Search.js +12 -0
- package/dist/components/Select.cjs +758 -0
- package/dist/components/Select.js +12 -0
- package/dist/components/SideMenu.cjs +54 -0
- package/dist/components/SideMenu.js +21 -0
- package/dist/components/SideMenuGroup.cjs +422 -0
- package/dist/components/SideMenuGroup.js +83 -0
- package/dist/components/SideMenuItem.cjs +388 -0
- package/dist/components/SideMenuItem.js +70 -0
- package/dist/components/Stack.cjs +138 -0
- package/dist/components/Stack.js +7 -0
- package/dist/components/StatusPill.cjs +265 -0
- package/dist/components/StatusPill.js +52 -0
- package/dist/components/Stepper.cjs +885 -0
- package/dist/components/Stepper.js +105 -0
- package/dist/components/Subheader.cjs +226 -0
- package/dist/components/Subheader.js +8 -0
- package/dist/components/Surface.cjs +98 -0
- package/dist/components/Surface.js +40 -0
- package/dist/components/Swatch.cjs +1728 -0
- package/dist/components/Swatch.js +1319 -0
- package/dist/components/Textarea.cjs +269 -0
- package/dist/components/Textarea.js +96 -0
- package/dist/components/Theme.cjs +36 -0
- package/dist/components/Theme.js +7 -0
- package/dist/components/Time.cjs +1118 -0
- package/dist/components/Time.js +353 -0
- package/dist/components/Toast.cjs +644 -0
- package/dist/components/Toast.js +218 -0
- package/dist/components/Tooltip.cjs +273 -0
- package/dist/components/Tooltip.js +9 -0
- package/dist/components/TopBar.cjs +352 -0
- package/dist/components/TopBar.js +132 -0
- package/dist/components/useInfiniteScroll.cjs +57 -0
- package/dist/components/useInfiniteScroll.js +8 -0
- package/dist/components/useMatchesMedia.cjs +53 -0
- package/dist/components/useMatchesMedia.js +9 -0
- package/dist/components/useMenuSystem.cjs +358 -0
- package/dist/components/useMenuSystem.js +11 -0
- package/dist/components/useMounted.cjs +39 -0
- package/dist/components/useMounted.js +8 -0
- package/dist/fonts.css +21 -0
- package/dist/icons-light[FILL]-PPZXOLWS.woff2 +0 -0
- package/dist/icons-normal[FILL]-PPZXOLWS.woff2 +0 -0
- package/dist/index.css +4401 -0
- package/dist/open-sans-55T6A4JE.woff2 +0 -0
- package/dist/types.cjs +18 -0
- package/dist/types.js +0 -0
- package/package.json +66 -0
- package/src/brand.css +125 -0
- package/src/classNames.ts +144 -0
- package/src/components/Breadcrumbs.tsx +116 -0
- package/src/components/Button.tsx +210 -0
- package/src/components/CalendarRange.tsx +429 -0
- package/src/components/Caption.tsx +101 -0
- package/src/components/Checkbox.tsx +196 -0
- package/src/components/ContentTab.tsx +66 -0
- package/src/components/ContentTabs.tsx +103 -0
- package/src/components/DMSiLogo.tsx +32 -0
- package/src/components/DataGrid.tsx +948 -0
- package/src/components/DataGridCell.tsx +384 -0
- package/src/components/DataTable.tsx +835 -0
- package/src/components/DateInput.tsx +188 -0
- package/src/components/DateRangeInput.tsx +179 -0
- package/src/components/DebugJson.tsx +24 -0
- package/src/components/Display.tsx +60 -0
- package/src/components/EditingContext.tsx +40 -0
- package/src/components/FilterGroup.tsx +234 -0
- package/src/components/FullViewportBox.tsx +11 -0
- package/src/components/Grid.tsx +75 -0
- package/src/components/GridContainer.tsx +124 -0
- package/src/components/Heading.tsx +66 -0
- package/src/components/HorizontalDivider.tsx +3 -0
- package/src/components/Icon.tsx +36 -0
- package/src/components/Input.tsx +511 -0
- package/src/components/InputGroup.tsx +51 -0
- package/src/components/Label.tsx +40 -0
- package/src/components/Link.tsx +106 -0
- package/src/components/List.tsx +10 -0
- package/src/components/LiveChatComponent.tsx +56 -0
- package/src/components/LogoAgilityTopBar.tsx +53 -0
- package/src/components/LogoDMSiTopBar.tsx +32 -0
- package/src/components/LogoMillworkTopBar.tsx +118 -0
- package/src/components/MainBar.tsx +83 -0
- package/src/components/Menu.tsx +286 -0
- package/src/components/MenuOption.tsx +275 -0
- package/src/components/MobileDataGrid.tsx +135 -0
- package/src/components/Modal.tsx +271 -0
- package/src/components/ModalButtons.tsx +44 -0
- package/src/components/ModalContent.tsx +23 -0
- package/src/components/ModalHeader.tsx +41 -0
- package/src/components/ModalScrim.tsx +35 -0
- package/src/components/NavigationTab.tsx +89 -0
- package/src/components/NavigationTabs.tsx +63 -0
- package/src/components/Notification.tsx +120 -0
- package/src/components/OptionPill.tsx +114 -0
- package/src/components/Paragraph.tsx +49 -0
- package/src/components/Password.tsx +46 -0
- package/src/components/ProjectBar.tsx +76 -0
- package/src/components/Radio.tsx +140 -0
- package/src/components/Search.tsx +129 -0
- package/src/components/Select.tsx +104 -0
- package/src/components/SideMenu.tsx +21 -0
- package/src/components/SideMenuGroup.tsx +81 -0
- package/src/components/SideMenuItem.tsx +90 -0
- package/src/components/Stack.tsx +179 -0
- package/src/components/StatusPill.tsx +51 -0
- package/src/components/Stepper.tsx +91 -0
- package/src/components/Subheader.tsx +44 -0
- package/src/components/Surface.tsx +34 -0
- package/src/components/Swatch.tsx +1066 -0
- package/src/components/Textarea.tsx +101 -0
- package/src/components/Theme.tsx +13 -0
- package/src/components/Time.tsx +438 -0
- package/src/components/Toast.tsx +244 -0
- package/src/components/Tooltip.tsx +137 -0
- package/src/components/TopBar.tsx +124 -0
- package/src/components/useInfiniteScroll.tsx +40 -0
- package/src/components/useMatchesMedia.tsx +28 -0
- package/src/components/useMenuSystem.tsx +367 -0
- package/src/components/useMounted.tsx +14 -0
- package/src/darkmode.css +140 -0
- package/src/fonts.css +23 -0
- package/src/index.css +509 -0
- package/src/index.tsx +2 -0
- package/src/types.ts +149 -0
- package/src/utils/formatting.tsx +81 -0
- package/src/utils.ts +23 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import {
|
|
2
|
+
baseTransition,
|
|
3
|
+
componentPaddingY,
|
|
4
|
+
typography
|
|
5
|
+
} from "./chunk-KX3O6GJ6.js";
|
|
6
|
+
import {
|
|
7
|
+
__objRest,
|
|
8
|
+
__spreadProps,
|
|
9
|
+
__spreadValues
|
|
10
|
+
} from "./chunk-ORMEWXMH.js";
|
|
11
|
+
|
|
12
|
+
// src/components/Link.tsx
|
|
13
|
+
import clsx from "clsx";
|
|
14
|
+
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
var Link = (_a) => {
|
|
16
|
+
var _b = _a, {
|
|
17
|
+
as = "a",
|
|
18
|
+
className,
|
|
19
|
+
variant = "primary",
|
|
20
|
+
typographyStyle = "paragraph",
|
|
21
|
+
disabled = false,
|
|
22
|
+
color,
|
|
23
|
+
paddedY,
|
|
24
|
+
align,
|
|
25
|
+
underline = false
|
|
26
|
+
} = _b, props = __objRest(_b, [
|
|
27
|
+
"as",
|
|
28
|
+
"className",
|
|
29
|
+
"variant",
|
|
30
|
+
"typographyStyle",
|
|
31
|
+
"disabled",
|
|
32
|
+
"color",
|
|
33
|
+
"paddedY",
|
|
34
|
+
"align",
|
|
35
|
+
"underline"
|
|
36
|
+
]);
|
|
37
|
+
const Component = as;
|
|
38
|
+
const primaryStateStyles = variant === "primary" && !disabled && clsx(
|
|
39
|
+
"text-text-link-normal hover:text-text-link-hover active:text-text-link-active"
|
|
40
|
+
);
|
|
41
|
+
const secondaryStateStyles = variant === "secondary" && !disabled && clsx(
|
|
42
|
+
"text-text-primary-normal hover:text-text-link-hover active:text-text-link-active"
|
|
43
|
+
);
|
|
44
|
+
const criticalStateStyles = variant === "critical" && !disabled && clsx(
|
|
45
|
+
"text-text-action-critical-normal hover:text-text-action-critical-hover active:text-text-action-critical-active"
|
|
46
|
+
);
|
|
47
|
+
const criticalStateDisabledStyles = disabled && variant === "critical" && clsx("text-text-action-critical-disabled");
|
|
48
|
+
const disabledStateStyles = disabled && ["primary", "secondary"].includes(variant) && clsx("text-text-link-disabled");
|
|
49
|
+
const disabledStyles = disabled && clsx("pointer-events-none cursor-default");
|
|
50
|
+
const underlineStyles = underline ? "decoration-current" : "decoration-transparent";
|
|
51
|
+
const paddingY = paddedY && componentPaddingY;
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
Component,
|
|
54
|
+
__spreadProps(__spreadValues({
|
|
55
|
+
className: clsx(
|
|
56
|
+
"inline",
|
|
57
|
+
disabled ? "cursor-default" : "cursor-pointer",
|
|
58
|
+
"underline decoration-[10%] underline-offset-[32%]",
|
|
59
|
+
!disabled && "hover:decoration-current",
|
|
60
|
+
!disabled && "active:decoration-transparent",
|
|
61
|
+
"flex flex-col items-center justify-center",
|
|
62
|
+
baseTransition,
|
|
63
|
+
primaryStateStyles,
|
|
64
|
+
secondaryStateStyles,
|
|
65
|
+
criticalStateStyles,
|
|
66
|
+
criticalStateDisabledStyles,
|
|
67
|
+
disabledStateStyles,
|
|
68
|
+
disabledStyles,
|
|
69
|
+
underlineStyles,
|
|
70
|
+
typographyStyle === "caption" && typography.caption,
|
|
71
|
+
typographyStyle === "paragraph" && typography.paragraph,
|
|
72
|
+
align === "left" && "text-left",
|
|
73
|
+
align === "center" && "text-center",
|
|
74
|
+
align === "right" && "text-right",
|
|
75
|
+
paddingY,
|
|
76
|
+
className
|
|
77
|
+
)
|
|
78
|
+
}, props), {
|
|
79
|
+
style: __spreadProps(__spreadValues({}, props.style), {
|
|
80
|
+
color: color ? `var(--color-${color})` : void 0
|
|
81
|
+
}),
|
|
82
|
+
"aria-disabled": disabled,
|
|
83
|
+
tabIndex: disabled ? -1 : void 0
|
|
84
|
+
})
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
Link.displayName = "Link";
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
Link
|
|
91
|
+
};
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Menu
|
|
3
|
+
} from "./chunk-L4UM372R.js";
|
|
4
|
+
import {
|
|
5
|
+
useSubMenuSystem
|
|
6
|
+
} from "./chunk-Z4UCFUF7.js";
|
|
7
|
+
import {
|
|
8
|
+
MenuOption
|
|
9
|
+
} from "./chunk-E5ALT5W7.js";
|
|
10
|
+
import {
|
|
11
|
+
Search
|
|
12
|
+
} from "./chunk-GTCSRHPF.js";
|
|
13
|
+
import {
|
|
14
|
+
CSS
|
|
15
|
+
} from "./chunk-WVUIIBRR.js";
|
|
16
|
+
import {
|
|
17
|
+
Icon
|
|
18
|
+
} from "./chunk-IGQVA7SC.js";
|
|
19
|
+
import {
|
|
20
|
+
paddingUsingComponentGap
|
|
21
|
+
} from "./chunk-KX3O6GJ6.js";
|
|
22
|
+
import {
|
|
23
|
+
__objRest,
|
|
24
|
+
__spreadProps,
|
|
25
|
+
__spreadValues
|
|
26
|
+
} from "./chunk-ORMEWXMH.js";
|
|
27
|
+
|
|
28
|
+
// src/components/DataGridCell.tsx
|
|
29
|
+
import { useSortable } from "@dnd-kit/sortable";
|
|
30
|
+
import clsx from "clsx";
|
|
31
|
+
import {
|
|
32
|
+
memo,
|
|
33
|
+
useEffect,
|
|
34
|
+
useRef,
|
|
35
|
+
useState
|
|
36
|
+
} from "react";
|
|
37
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
38
|
+
var DataGridCell = memo(
|
|
39
|
+
(_a) => {
|
|
40
|
+
var _b = _a, {
|
|
41
|
+
type = "default",
|
|
42
|
+
component = "static",
|
|
43
|
+
children,
|
|
44
|
+
className,
|
|
45
|
+
locked = false,
|
|
46
|
+
noPadding = false,
|
|
47
|
+
paddedLeft = false,
|
|
48
|
+
style,
|
|
49
|
+
onClick,
|
|
50
|
+
onRightClick,
|
|
51
|
+
error,
|
|
52
|
+
warning,
|
|
53
|
+
center,
|
|
54
|
+
width
|
|
55
|
+
} = _b, props = __objRest(_b, [
|
|
56
|
+
"type",
|
|
57
|
+
"component",
|
|
58
|
+
"children",
|
|
59
|
+
"className",
|
|
60
|
+
"locked",
|
|
61
|
+
"noPadding",
|
|
62
|
+
"paddedLeft",
|
|
63
|
+
"style",
|
|
64
|
+
"onClick",
|
|
65
|
+
"onRightClick",
|
|
66
|
+
"error",
|
|
67
|
+
"warning",
|
|
68
|
+
"center",
|
|
69
|
+
"width"
|
|
70
|
+
]);
|
|
71
|
+
const Element = type === "header" ? "th" : "td";
|
|
72
|
+
const timerRef = useRef(null);
|
|
73
|
+
const [isGrabbing, setIsGrabbing] = useState(false);
|
|
74
|
+
const [isPointerPressed, setIsPointerPressed] = useState(false);
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
return () => {
|
|
77
|
+
if (timerRef.current) {
|
|
78
|
+
clearTimeout(timerRef.current);
|
|
79
|
+
timerRef.current = null;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
}, []);
|
|
83
|
+
const handlePointerDown = (_event) => {
|
|
84
|
+
setIsPointerPressed(true);
|
|
85
|
+
timerRef.current = window.setTimeout(() => {
|
|
86
|
+
setIsGrabbing(true);
|
|
87
|
+
}, 500);
|
|
88
|
+
};
|
|
89
|
+
const handlePointerUp = (event) => {
|
|
90
|
+
if (timerRef.current) {
|
|
91
|
+
clearTimeout(timerRef.current);
|
|
92
|
+
timerRef.current = null;
|
|
93
|
+
}
|
|
94
|
+
const rightClick = event.nativeEvent instanceof MouseEvent && event.nativeEvent.button === 2;
|
|
95
|
+
if (!isGrabbing && onClick && !rightClick && isPointerPressed) {
|
|
96
|
+
onClick(event);
|
|
97
|
+
}
|
|
98
|
+
if (rightClick && onRightClick) {
|
|
99
|
+
onRightClick();
|
|
100
|
+
}
|
|
101
|
+
setIsGrabbing(false);
|
|
102
|
+
setIsPointerPressed(false);
|
|
103
|
+
};
|
|
104
|
+
const handlePointerLeave = () => {
|
|
105
|
+
if (timerRef.current) {
|
|
106
|
+
clearTimeout(timerRef.current);
|
|
107
|
+
timerRef.current = null;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
const headerBgStyles = type === "header" && !locked && !["button"].includes(component) && "bg-brand-400 border-brand-200";
|
|
111
|
+
const lockedHeaderBgStyles = locked && !["button"].includes(component) && "bg-neutral-400 border-neutral-300";
|
|
112
|
+
const headerTypeStyles = type === "header" && component !== "button" && component !== "icon" && clsx("border-r");
|
|
113
|
+
const buttonComponentStyles = component === "button" && clsx("border-r border-b border-border-primary-normal");
|
|
114
|
+
const iconComponentStyles = component === "icon" && clsx("border-l");
|
|
115
|
+
const cellClasses = clsx(
|
|
116
|
+
headerTypeStyles,
|
|
117
|
+
buttonComponentStyles,
|
|
118
|
+
headerBgStyles,
|
|
119
|
+
lockedHeaderBgStyles,
|
|
120
|
+
iconComponentStyles,
|
|
121
|
+
className,
|
|
122
|
+
"flex flex-1 items-center gap-1 whitespace-nowrap min-w-full max-h-10 relative text-text-primary-normal",
|
|
123
|
+
"focus-within:!z-10",
|
|
124
|
+
component === "input" && "border",
|
|
125
|
+
component === "input" && !error && !warning && "border-border-primary-normal",
|
|
126
|
+
component === "input" && error && "border-border-primary-error",
|
|
127
|
+
component === "input" && warning && "border-background-warning-normal",
|
|
128
|
+
!["button", "icon"].includes(component) && !noPadding && "p-2",
|
|
129
|
+
paddedLeft && "pl-2",
|
|
130
|
+
component === "icon" && "border-l",
|
|
131
|
+
isGrabbing && "!cursor-grabbing",
|
|
132
|
+
component === "checkbox" || center && "justify-center"
|
|
133
|
+
);
|
|
134
|
+
return /* @__PURE__ */ jsx(
|
|
135
|
+
Element,
|
|
136
|
+
__spreadProps(__spreadValues({
|
|
137
|
+
className: clsx("flex", !width && "flex-1"),
|
|
138
|
+
style: { width }
|
|
139
|
+
}, props), {
|
|
140
|
+
children: /* @__PURE__ */ jsx(
|
|
141
|
+
"div",
|
|
142
|
+
{
|
|
143
|
+
className: cellClasses,
|
|
144
|
+
style: __spreadValues({}, style),
|
|
145
|
+
onMouseDown: handlePointerDown,
|
|
146
|
+
onMouseUp: handlePointerUp,
|
|
147
|
+
onMouseLeave: handlePointerLeave,
|
|
148
|
+
onTouchStart: handlePointerDown,
|
|
149
|
+
onTouchEnd: handlePointerUp,
|
|
150
|
+
onTouchCancel: handlePointerLeave,
|
|
151
|
+
onContextMenu: (e) => e.preventDefault(),
|
|
152
|
+
children
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
})
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
DataGridCell.displayName = "DataGridCell";
|
|
160
|
+
function DraggableCellHeader(_a) {
|
|
161
|
+
var _b = _a, {
|
|
162
|
+
header,
|
|
163
|
+
children,
|
|
164
|
+
locked = false
|
|
165
|
+
} = _b, props = __objRest(_b, [
|
|
166
|
+
"header",
|
|
167
|
+
"children",
|
|
168
|
+
"locked"
|
|
169
|
+
]);
|
|
170
|
+
var _a2;
|
|
171
|
+
const { attributes, isDragging, listeners, setNodeRef, transform, node } = useSortable({
|
|
172
|
+
id: header.column.id
|
|
173
|
+
});
|
|
174
|
+
const [showMenu, setShowMenu] = useState(false);
|
|
175
|
+
const [filter, setFilter] = useState(
|
|
176
|
+
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
177
|
+
);
|
|
178
|
+
const {
|
|
179
|
+
menuRootRef,
|
|
180
|
+
isMenuActive,
|
|
181
|
+
registerSubMenu,
|
|
182
|
+
listeners: subMenuListeners,
|
|
183
|
+
mobileHide
|
|
184
|
+
} = useSubMenuSystem(node);
|
|
185
|
+
useEffect(() => {
|
|
186
|
+
const handler = setTimeout(() => {
|
|
187
|
+
header.column.setFilterValue(filter);
|
|
188
|
+
}, 500);
|
|
189
|
+
return () => {
|
|
190
|
+
clearTimeout(handler);
|
|
191
|
+
};
|
|
192
|
+
}, [filter]);
|
|
193
|
+
const style = {
|
|
194
|
+
opacity: isDragging ? 0.8 : 1,
|
|
195
|
+
position: "relative",
|
|
196
|
+
transform: CSS.Translate.toString(transform),
|
|
197
|
+
transition: "width transform 0.2s ease-in-out",
|
|
198
|
+
whiteSpace: "nowrap",
|
|
199
|
+
width: header.column.getSize(),
|
|
200
|
+
zIndex: isDragging ? 1 : 0,
|
|
201
|
+
"--color-text-primary-normal": "var(--color-neutral-000)"
|
|
202
|
+
};
|
|
203
|
+
return /* @__PURE__ */ jsxs(
|
|
204
|
+
DataGridCell,
|
|
205
|
+
__spreadProps(__spreadValues(__spreadValues(__spreadProps(__spreadValues({
|
|
206
|
+
locked,
|
|
207
|
+
type: "header",
|
|
208
|
+
component: "header",
|
|
209
|
+
ref: setNodeRef,
|
|
210
|
+
colSpan: header.colSpan,
|
|
211
|
+
style
|
|
212
|
+
}, props), {
|
|
213
|
+
onClick: header.column.getToggleSortingHandler(),
|
|
214
|
+
onRightClick: () => setShowMenu(!showMenu)
|
|
215
|
+
}), locked ? {} : attributes), locked ? {} : listeners), {
|
|
216
|
+
children: [
|
|
217
|
+
children,
|
|
218
|
+
header.column.getCanFilter() && /* @__PURE__ */ jsx(
|
|
219
|
+
Menu,
|
|
220
|
+
{
|
|
221
|
+
ref: menuRootRef,
|
|
222
|
+
positionTo: node,
|
|
223
|
+
show: showMenu,
|
|
224
|
+
setShow: setShowMenu,
|
|
225
|
+
mobileHide,
|
|
226
|
+
children: /* @__PURE__ */ jsx(
|
|
227
|
+
MenuOption,
|
|
228
|
+
__spreadProps(__spreadValues({}, subMenuListeners), {
|
|
229
|
+
subMenu: (_b2) => {
|
|
230
|
+
var _c = _b2, { menuId, subMenuLevel } = _c, props2 = __objRest(_c, ["menuId", "subMenuLevel"]);
|
|
231
|
+
return /* @__PURE__ */ jsxs(
|
|
232
|
+
Menu,
|
|
233
|
+
__spreadProps(__spreadValues({}, props2), {
|
|
234
|
+
show: isMenuActive(menuId, subMenuLevel),
|
|
235
|
+
ref: (el) => {
|
|
236
|
+
registerSubMenu(menuId, el);
|
|
237
|
+
},
|
|
238
|
+
children: [
|
|
239
|
+
/* @__PURE__ */ jsx("div", { className: clsx(paddingUsingComponentGap), children: /* @__PURE__ */ jsx(
|
|
240
|
+
Search,
|
|
241
|
+
{
|
|
242
|
+
onChange: (event) => {
|
|
243
|
+
setFilter(event.target.value);
|
|
244
|
+
},
|
|
245
|
+
onKeyDown: (event) => {
|
|
246
|
+
if ([" ", "Space"].includes(event.key)) {
|
|
247
|
+
event.stopPropagation();
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
value: filter != null ? filter : ""
|
|
251
|
+
}
|
|
252
|
+
) }),
|
|
253
|
+
/* @__PURE__ */ jsx(
|
|
254
|
+
MenuOption,
|
|
255
|
+
{
|
|
256
|
+
onClick: handleFilterFnChange,
|
|
257
|
+
before: menuOptionIcon("includesString"),
|
|
258
|
+
children: "Contains"
|
|
259
|
+
}
|
|
260
|
+
),
|
|
261
|
+
/* @__PURE__ */ jsx(
|
|
262
|
+
MenuOption,
|
|
263
|
+
{
|
|
264
|
+
onClick: handleFilterFnChange,
|
|
265
|
+
before: menuOptionIcon("startsWith"),
|
|
266
|
+
children: "Starts with"
|
|
267
|
+
}
|
|
268
|
+
),
|
|
269
|
+
/* @__PURE__ */ jsx(
|
|
270
|
+
MenuOption,
|
|
271
|
+
{
|
|
272
|
+
onClick: handleFilterFnChange,
|
|
273
|
+
before: menuOptionIcon("endsWith"),
|
|
274
|
+
children: "Ends with"
|
|
275
|
+
}
|
|
276
|
+
)
|
|
277
|
+
]
|
|
278
|
+
})
|
|
279
|
+
);
|
|
280
|
+
},
|
|
281
|
+
children: "Filter"
|
|
282
|
+
})
|
|
283
|
+
)
|
|
284
|
+
}
|
|
285
|
+
)
|
|
286
|
+
]
|
|
287
|
+
})
|
|
288
|
+
);
|
|
289
|
+
function menuOptionIcon(value) {
|
|
290
|
+
return /* @__PURE__ */ jsx(
|
|
291
|
+
Icon,
|
|
292
|
+
{
|
|
293
|
+
name: "check",
|
|
294
|
+
className: clsx(
|
|
295
|
+
header.column.columnDef.filterFn !== value && "text-transparent"
|
|
296
|
+
)
|
|
297
|
+
}
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
function handleFilterFnChange(_id, value) {
|
|
301
|
+
var _a3;
|
|
302
|
+
let filterFn = "includesString";
|
|
303
|
+
const currentFilterFn = header.column.columnDef.filterFn;
|
|
304
|
+
if ((value == null ? void 0 : value.toLowerCase()) === "starts with") {
|
|
305
|
+
filterFn = currentFilterFn === "startsWith" ? "auto" : "startsWith";
|
|
306
|
+
}
|
|
307
|
+
if ((value == null ? void 0 : value.toLowerCase()) === "ends with") {
|
|
308
|
+
filterFn = currentFilterFn === "endsWith" ? "auto" : "endsWith";
|
|
309
|
+
}
|
|
310
|
+
if ((value == null ? void 0 : value.toLowerCase()) === "contains") {
|
|
311
|
+
filterFn = currentFilterFn === "includesString" ? "auto" : "includesString";
|
|
312
|
+
}
|
|
313
|
+
header.column.columnDef.filterFn = filterFn;
|
|
314
|
+
header.column.setFilterValue((_a3 = header.column.getFilterValue()) != null ? _a3 : "");
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
DraggableCellHeader.displayName = "DraggableCellHeader";
|
|
318
|
+
function DragAlongCell(_a) {
|
|
319
|
+
var _b = _a, {
|
|
320
|
+
cell,
|
|
321
|
+
children
|
|
322
|
+
} = _b, props = __objRest(_b, [
|
|
323
|
+
"cell",
|
|
324
|
+
"children"
|
|
325
|
+
]);
|
|
326
|
+
const { isDragging, setNodeRef, transform } = useSortable({
|
|
327
|
+
id: cell.column.id
|
|
328
|
+
});
|
|
329
|
+
const style = {
|
|
330
|
+
opacity: isDragging ? 0.8 : 1,
|
|
331
|
+
position: "relative",
|
|
332
|
+
transform: CSS.Translate.toString(transform),
|
|
333
|
+
transition: "width transform 0.2s ease-in-out",
|
|
334
|
+
zIndex: isDragging ? 1 : 0,
|
|
335
|
+
width: cell.column.getSize(),
|
|
336
|
+
minWidth: "min-content"
|
|
337
|
+
};
|
|
338
|
+
return /* @__PURE__ */ jsx(DataGridCell, __spreadProps(__spreadValues({ style, ref: setNodeRef }, props), { children }));
|
|
339
|
+
}
|
|
340
|
+
DragAlongCell.displayName = "DragAlongCell";
|
|
341
|
+
|
|
342
|
+
export {
|
|
343
|
+
DataGridCell,
|
|
344
|
+
DraggableCellHeader,
|
|
345
|
+
DragAlongCell
|
|
346
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import {
|
|
2
|
+
InputBase
|
|
3
|
+
} from "./chunk-BWRHL2AG.js";
|
|
4
|
+
import {
|
|
5
|
+
Icon
|
|
6
|
+
} from "./chunk-IGQVA7SC.js";
|
|
7
|
+
import {
|
|
8
|
+
__objRest,
|
|
9
|
+
__spreadProps,
|
|
10
|
+
__spreadValues
|
|
11
|
+
} from "./chunk-ORMEWXMH.js";
|
|
12
|
+
|
|
13
|
+
// src/components/Select.tsx
|
|
14
|
+
import { useEffect, useRef, useState } from "react";
|
|
15
|
+
import clsx from "clsx";
|
|
16
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
var Select = (_a) => {
|
|
18
|
+
var _b = _a, {
|
|
19
|
+
label,
|
|
20
|
+
error,
|
|
21
|
+
children,
|
|
22
|
+
readOnly,
|
|
23
|
+
renderMenu,
|
|
24
|
+
onClick,
|
|
25
|
+
className,
|
|
26
|
+
wrapperClassName,
|
|
27
|
+
removeRoundness,
|
|
28
|
+
displayValue,
|
|
29
|
+
value
|
|
30
|
+
} = _b, props = __objRest(_b, [
|
|
31
|
+
"label",
|
|
32
|
+
"error",
|
|
33
|
+
"children",
|
|
34
|
+
"readOnly",
|
|
35
|
+
"renderMenu",
|
|
36
|
+
"onClick",
|
|
37
|
+
"className",
|
|
38
|
+
"wrapperClassName",
|
|
39
|
+
"removeRoundness",
|
|
40
|
+
"displayValue",
|
|
41
|
+
"value"
|
|
42
|
+
]);
|
|
43
|
+
const inputRef = useRef(null);
|
|
44
|
+
const inputContainerRef = useRef(null);
|
|
45
|
+
const preventFocusOnInitialRender = useRef(true);
|
|
46
|
+
const [show, setShow] = useState(false);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
var _a2;
|
|
49
|
+
if (preventFocusOnInitialRender.current) {
|
|
50
|
+
preventFocusOnInitialRender.current = false;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
54
|
+
}, [value]);
|
|
55
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
InputBase,
|
|
58
|
+
__spreadProps(__spreadValues({
|
|
59
|
+
inputContainerRef,
|
|
60
|
+
ref: inputRef,
|
|
61
|
+
label,
|
|
62
|
+
after: !readOnly && /* @__PURE__ */ jsx(
|
|
63
|
+
"span",
|
|
64
|
+
{
|
|
65
|
+
className: clsx(
|
|
66
|
+
props.disabled ? "text-icon-action-primary-disabled" : "text-icon-action-primary-normal",
|
|
67
|
+
"contents"
|
|
68
|
+
),
|
|
69
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "keyboard_arrow_down" })
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
maxLength: 0,
|
|
73
|
+
className: clsx("!caret-transparent !cursor-default", className),
|
|
74
|
+
wrapperClassName,
|
|
75
|
+
onKeyDown: (e) => {
|
|
76
|
+
const openKeys = ["Enter", "Space", " "];
|
|
77
|
+
if (openKeys.includes(e.key)) {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
e.target.click();
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
onClick: (e) => {
|
|
83
|
+
if (props.disabled || readOnly) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
setShow(!show);
|
|
87
|
+
onClick == null ? void 0 : onClick(e);
|
|
88
|
+
},
|
|
89
|
+
error,
|
|
90
|
+
readOnly,
|
|
91
|
+
removeRoundness,
|
|
92
|
+
focus: show
|
|
93
|
+
}, props), {
|
|
94
|
+
value: displayValue != null ? displayValue : value
|
|
95
|
+
})
|
|
96
|
+
),
|
|
97
|
+
renderMenu ? renderMenu({
|
|
98
|
+
positionTo: inputContainerRef,
|
|
99
|
+
show,
|
|
100
|
+
setShow,
|
|
101
|
+
topOffset: props.caption ? -16 : null
|
|
102
|
+
}) : children
|
|
103
|
+
] });
|
|
104
|
+
};
|
|
105
|
+
Select.displayName = "Select";
|
|
106
|
+
|
|
107
|
+
export {
|
|
108
|
+
Select
|
|
109
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/components/ModalScrim.tsx
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var ModalScrim = ({
|
|
5
|
+
show = false,
|
|
6
|
+
size = "small",
|
|
7
|
+
children,
|
|
8
|
+
onClick,
|
|
9
|
+
ref
|
|
10
|
+
}) => {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
className: clsx(
|
|
15
|
+
"overflow-y-auto h-screen transition-[visibility,opacity,background] ease-in-out duration-100 grid place-content-center desktop:p-4 group bg-neutral-600/50 fixed opacity-0",
|
|
16
|
+
!show && " pointer-events-none",
|
|
17
|
+
size === "small" && "p-4",
|
|
18
|
+
"inset-0 z-50"
|
|
19
|
+
),
|
|
20
|
+
onMouseDown: onClick,
|
|
21
|
+
ref,
|
|
22
|
+
children
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
ModalScrim.displayName = "ModalScrim";
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
ModalScrim
|
|
30
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Label
|
|
3
|
+
} from "./chunk-4C66DLIJ.js";
|
|
4
|
+
import {
|
|
5
|
+
Button
|
|
6
|
+
} from "./chunk-KENSVWOY.js";
|
|
7
|
+
import {
|
|
8
|
+
Icon
|
|
9
|
+
} from "./chunk-IGQVA7SC.js";
|
|
10
|
+
import {
|
|
11
|
+
baseTransition,
|
|
12
|
+
componentGap,
|
|
13
|
+
componentPadding,
|
|
14
|
+
componentPaddingMinusBorder,
|
|
15
|
+
componentPaddingYUsingComponentGap
|
|
16
|
+
} from "./chunk-KX3O6GJ6.js";
|
|
17
|
+
import {
|
|
18
|
+
__objRest,
|
|
19
|
+
__spreadProps,
|
|
20
|
+
__spreadValues
|
|
21
|
+
} from "./chunk-ORMEWXMH.js";
|
|
22
|
+
|
|
23
|
+
// src/components/OptionPill.tsx
|
|
24
|
+
import clsx from "clsx";
|
|
25
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
26
|
+
var OptionPill = (_a) => {
|
|
27
|
+
var _b = _a, {
|
|
28
|
+
selected = false,
|
|
29
|
+
onClick,
|
|
30
|
+
onRemove,
|
|
31
|
+
removable = false,
|
|
32
|
+
disabled = false,
|
|
33
|
+
children,
|
|
34
|
+
className
|
|
35
|
+
} = _b, props = __objRest(_b, [
|
|
36
|
+
"selected",
|
|
37
|
+
"onClick",
|
|
38
|
+
"onRemove",
|
|
39
|
+
"removable",
|
|
40
|
+
"disabled",
|
|
41
|
+
"children",
|
|
42
|
+
"className"
|
|
43
|
+
]);
|
|
44
|
+
const additionalAttributes = {
|
|
45
|
+
"data-disabled": disabled || null,
|
|
46
|
+
"data-selected": selected || null
|
|
47
|
+
};
|
|
48
|
+
const classNames = clsx(
|
|
49
|
+
{
|
|
50
|
+
"hover:border-border-action-hover active:border-border-action-active": !disabled,
|
|
51
|
+
"data-disabled:cursor-default data-disabled:border-border-primary-normal": disabled,
|
|
52
|
+
"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": selected,
|
|
53
|
+
"data-selected:data-disabled:bg-background-action-secondary-disabled data-selected:data-disabled:border-border-action-disabled data-selected:data-disabled:outline-transparent": disabled && selected
|
|
54
|
+
},
|
|
55
|
+
!removable && componentPadding,
|
|
56
|
+
removable && "pl-mobile-component-padding desktop:pl-desktop-component-padding compact:pl-desktop-compact-component-padding"
|
|
57
|
+
);
|
|
58
|
+
const textColor = clsx(
|
|
59
|
+
!disabled && "text-text-primary-normal",
|
|
60
|
+
disabled && !selected && "text-text-primary-disabled",
|
|
61
|
+
disabled && selected && "text-text-on-action-primary-disabled"
|
|
62
|
+
);
|
|
63
|
+
return /* @__PURE__ */ jsxs(
|
|
64
|
+
"div",
|
|
65
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
66
|
+
onClick: handleOnClick
|
|
67
|
+
}, props), additionalAttributes), {
|
|
68
|
+
className: clsx(
|
|
69
|
+
"flex items-center justify-between cursor-pointer w-max",
|
|
70
|
+
"border border-border-primary-normal rounded-base",
|
|
71
|
+
"outline-2 outline-transparent -outline-offset-2",
|
|
72
|
+
componentGap,
|
|
73
|
+
baseTransition,
|
|
74
|
+
classNames,
|
|
75
|
+
className,
|
|
76
|
+
textColor
|
|
77
|
+
),
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ jsx(Label, { padded: true, className: componentPaddingYUsingComponentGap, children }),
|
|
80
|
+
removable && /* @__PURE__ */ jsx(
|
|
81
|
+
Button,
|
|
82
|
+
{
|
|
83
|
+
onClick: handleOnRemove,
|
|
84
|
+
disabled,
|
|
85
|
+
className: clsx(
|
|
86
|
+
"mx-0 h-full w-10 !border-0",
|
|
87
|
+
componentPaddingMinusBorder
|
|
88
|
+
),
|
|
89
|
+
iconOnly: true,
|
|
90
|
+
variant: "tertiary",
|
|
91
|
+
leftIcon: /* @__PURE__ */ jsx(Icon, { name: "close" })
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
]
|
|
95
|
+
})
|
|
96
|
+
);
|
|
97
|
+
function handleOnClick() {
|
|
98
|
+
if (disabled) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
onClick == null ? void 0 : onClick();
|
|
102
|
+
}
|
|
103
|
+
function handleOnRemove() {
|
|
104
|
+
if (!removable || !onRemove) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
onRemove();
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
OptionPill.displayName = "OptionPill";
|
|
111
|
+
|
|
112
|
+
export {
|
|
113
|
+
OptionPill
|
|
114
|
+
};
|