@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
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# DMSi Global Design System
|
|
2
|
+
|
|
3
|
+
This package provides a set of react components that implement the DMSi Global Design System.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
`npm install @dmsi/wedgekit-react`
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
To use a component import it from the design system
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
|
|
15
|
+
import { Button } from '@dmsi/wedgekit-react/components/Button`;
|
|
16
|
+
|
|
17
|
+
const MyComponent = () => <Button variant="primary">Action</Button>;
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The CSS for styles and fonts will be required for the components to display correctly an needs to be included in the application.
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import "@dmsi/wedgekit-react/styles.css";
|
|
25
|
+
import "@dmsi/wedgekit-react/fonts.css";
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<link rel="stylesheet" href="/node_modules/@dmsi/wedgekit-react/styles.css" />
|
|
30
|
+
<link rel="stylesheet" href="/node_modules/@dmsi/wedgekit-react/fonts.css" />
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Documentation
|
|
34
|
+
|
|
35
|
+
The components and their options can be seen in the Global Design System storybook. TBD (currently at [https://dev-dmsi-storybook.soda.dev](https://dev-dmsi-storybook.soda.dev)).
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
typography
|
|
3
|
+
} from "./chunk-KX3O6GJ6.js";
|
|
4
|
+
import {
|
|
5
|
+
__objRest,
|
|
6
|
+
__spreadProps,
|
|
7
|
+
__spreadValues
|
|
8
|
+
} from "./chunk-ORMEWXMH.js";
|
|
9
|
+
|
|
10
|
+
// src/components/Display.tsx
|
|
11
|
+
import clsx from "clsx";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
var Display = (_a) => {
|
|
14
|
+
var _b = _a, {
|
|
15
|
+
className,
|
|
16
|
+
children,
|
|
17
|
+
as,
|
|
18
|
+
color,
|
|
19
|
+
align,
|
|
20
|
+
variant = "display1"
|
|
21
|
+
} = _b, props = __objRest(_b, [
|
|
22
|
+
"className",
|
|
23
|
+
"children",
|
|
24
|
+
"as",
|
|
25
|
+
"color",
|
|
26
|
+
"align",
|
|
27
|
+
"variant"
|
|
28
|
+
]);
|
|
29
|
+
const defaultElement = variant === "display1" ? "h1" : "h2";
|
|
30
|
+
const Element = as != null ? as : defaultElement;
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
Element,
|
|
33
|
+
__spreadProps(__spreadValues({
|
|
34
|
+
className: clsx(
|
|
35
|
+
typography[variant],
|
|
36
|
+
className,
|
|
37
|
+
align === "left" && "text-left",
|
|
38
|
+
align === "center" && "text-center",
|
|
39
|
+
align === "right" && "text-right"
|
|
40
|
+
),
|
|
41
|
+
style: __spreadProps(__spreadValues({}, props.style), {
|
|
42
|
+
color: color ? `var(--color-${color})` : void 0
|
|
43
|
+
})
|
|
44
|
+
}, props), {
|
|
45
|
+
children
|
|
46
|
+
})
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
Display.displayName = "Display";
|
|
50
|
+
var Display1 = (props) => /* @__PURE__ */ jsx(Display, __spreadProps(__spreadValues({}, props), { variant: "display1" }));
|
|
51
|
+
var Display2 = (props) => /* @__PURE__ */ jsx(Display, __spreadProps(__spreadValues({}, props), { variant: "display2" }));
|
|
52
|
+
Display1.displayName = "Display1";
|
|
53
|
+
Display2.displayName = "Display2";
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
Display,
|
|
57
|
+
Display1,
|
|
58
|
+
Display2
|
|
59
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import {
|
|
2
|
+
typography
|
|
3
|
+
} from "./chunk-KX3O6GJ6.js";
|
|
4
|
+
|
|
5
|
+
// src/components/Tooltip.tsx
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { useEffect, useRef, useState } from "react";
|
|
8
|
+
import { createPortal } from "react-dom";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var Tooltip = ({
|
|
11
|
+
message,
|
|
12
|
+
position = "top",
|
|
13
|
+
children,
|
|
14
|
+
showOnTruncation = false,
|
|
15
|
+
offset = 8
|
|
16
|
+
}) => {
|
|
17
|
+
const ref = useRef(null);
|
|
18
|
+
const tooltipRef = useRef(null);
|
|
19
|
+
const [isTruncated, setIsTruncated] = useState(false);
|
|
20
|
+
const [tooltipPosition, setTooltipPosition] = useState({ top: 0, left: 0 });
|
|
21
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
22
|
+
const [removeOpacity, setRemoveOpacity] = useState(false);
|
|
23
|
+
const updatePosition = () => {
|
|
24
|
+
if (!ref.current || !tooltipRef.current) return;
|
|
25
|
+
const rect = ref.current.getBoundingClientRect();
|
|
26
|
+
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
27
|
+
let top = 0;
|
|
28
|
+
let left = 0;
|
|
29
|
+
switch (position) {
|
|
30
|
+
case "top":
|
|
31
|
+
top = rect.top - tooltipRect.height - offset;
|
|
32
|
+
left = rect.left + rect.width / 2 - tooltipRect.width / 2;
|
|
33
|
+
break;
|
|
34
|
+
case "bottom":
|
|
35
|
+
top = rect.bottom + offset;
|
|
36
|
+
left = rect.left + rect.width / 2 - tooltipRect.width / 2;
|
|
37
|
+
break;
|
|
38
|
+
case "left":
|
|
39
|
+
top = rect.top + rect.height / 2 - tooltipRect.height / 2;
|
|
40
|
+
left = rect.left - tooltipRect.width - offset;
|
|
41
|
+
break;
|
|
42
|
+
case "right":
|
|
43
|
+
top = rect.top + rect.height / 2 - tooltipRect.height / 2;
|
|
44
|
+
left = rect.right + offset;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
setTooltipPosition({ top, left });
|
|
48
|
+
requestAnimationFrame(() => {
|
|
49
|
+
setRemoveOpacity(true);
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const handleMouseEnter = () => {
|
|
53
|
+
if (!showOnTruncation || checkForTextTruncation()) {
|
|
54
|
+
setIsVisible(true);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const handleMouseLeave = () => {
|
|
58
|
+
setIsVisible(false);
|
|
59
|
+
setRemoveOpacity(false);
|
|
60
|
+
};
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (isVisible && tooltipRef.current) {
|
|
63
|
+
requestAnimationFrame(() => {
|
|
64
|
+
updatePosition();
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}, [isVisible]);
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (isVisible) {
|
|
70
|
+
window.addEventListener("resize", updatePosition);
|
|
71
|
+
return () => window.removeEventListener("resize", updatePosition);
|
|
72
|
+
}
|
|
73
|
+
}, [isVisible]);
|
|
74
|
+
return /* @__PURE__ */ jsxs(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
ref,
|
|
78
|
+
className: "relative inline-grid grid-cols-[auto_1fr] items-center",
|
|
79
|
+
onMouseEnter: handleMouseEnter,
|
|
80
|
+
onMouseLeave: handleMouseLeave,
|
|
81
|
+
children: [
|
|
82
|
+
children,
|
|
83
|
+
isVisible && typeof document !== "undefined" && createPortal(
|
|
84
|
+
/* @__PURE__ */ jsx(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
ref: tooltipRef,
|
|
88
|
+
style: {
|
|
89
|
+
position: "fixed",
|
|
90
|
+
top: `${tooltipPosition.top}px`,
|
|
91
|
+
left: `${tooltipPosition.left}px`,
|
|
92
|
+
zIndex: 9999
|
|
93
|
+
},
|
|
94
|
+
className: clsx(
|
|
95
|
+
typography.caption,
|
|
96
|
+
"p-2 bg-neutral-500 text-neutral-100 rounded whitespace-nowrap shadow-2 pointer-events-none transition-opacity duration-100 ease-in-out",
|
|
97
|
+
!removeOpacity && "opacity-0"
|
|
98
|
+
),
|
|
99
|
+
children: message
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
document.body
|
|
103
|
+
)
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
function checkForTextTruncation() {
|
|
108
|
+
if (showOnTruncation && ref.current) {
|
|
109
|
+
const paragraph = ref.current.querySelector("p");
|
|
110
|
+
if (paragraph) {
|
|
111
|
+
const isTruncated2 = paragraph.scrollWidth > paragraph.clientWidth;
|
|
112
|
+
setIsTruncated(isTruncated2);
|
|
113
|
+
return isTruncated2;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
Tooltip.displayName = "Tooltip";
|
|
120
|
+
|
|
121
|
+
export {
|
|
122
|
+
Tooltip
|
|
123
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
componentPaddingXUsingComponentGap,
|
|
3
|
+
typography
|
|
4
|
+
} from "./chunk-KX3O6GJ6.js";
|
|
5
|
+
import {
|
|
6
|
+
__objRest,
|
|
7
|
+
__spreadProps,
|
|
8
|
+
__spreadValues
|
|
9
|
+
} from "./chunk-ORMEWXMH.js";
|
|
10
|
+
|
|
11
|
+
// src/components/Label.tsx
|
|
12
|
+
import clsx from "clsx";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
var Label = (_a) => {
|
|
15
|
+
var _b = _a, {
|
|
16
|
+
as = "span",
|
|
17
|
+
padded,
|
|
18
|
+
className,
|
|
19
|
+
color,
|
|
20
|
+
align
|
|
21
|
+
} = _b, props = __objRest(_b, [
|
|
22
|
+
"as",
|
|
23
|
+
"padded",
|
|
24
|
+
"className",
|
|
25
|
+
"color",
|
|
26
|
+
"align"
|
|
27
|
+
]);
|
|
28
|
+
const Element = as;
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
30
|
+
Element,
|
|
31
|
+
__spreadProps(__spreadValues({
|
|
32
|
+
className: clsx(
|
|
33
|
+
typography.label,
|
|
34
|
+
align === "left" && "text-left",
|
|
35
|
+
align === "center" && "text-center",
|
|
36
|
+
align === "right" && "text-right",
|
|
37
|
+
className,
|
|
38
|
+
padded && componentPaddingXUsingComponentGap
|
|
39
|
+
)
|
|
40
|
+
}, props), {
|
|
41
|
+
style: __spreadProps(__spreadValues({}, props.style), {
|
|
42
|
+
color: color ? `var(--color-${color})` : void 0
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
Label.displayName = "Label";
|
|
48
|
+
|
|
49
|
+
export {
|
|
50
|
+
Label
|
|
51
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// src/components/LogoDMSiTopBar.tsx
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
function LogoDMSiTopBar() {
|
|
4
|
+
return /* @__PURE__ */ jsxs(
|
|
5
|
+
"svg",
|
|
6
|
+
{
|
|
7
|
+
width: "106",
|
|
8
|
+
height: "24",
|
|
9
|
+
viewBox: "0 0 106 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ jsx(
|
|
14
|
+
"path",
|
|
15
|
+
{
|
|
16
|
+
d: "M9.32182 5.86849H21.4356C23.2074 5.86849 24.3938 5.79786 25.426 7.25511C26.3235 8.60827 26.5931 9.79786 26.3851 11.4335C26.1771 13.0692 25.7342 14.2291 24.6672 15.6529C24.1742 16.3295 23.5541 16.8648 22.803 17.2551C21.7823 17.7533 21.1275 17.6826 20.0952 17.6826H7.87355V17.638L7.18024 23.2588H19.945C23.4501 23.2588 26.8242 22.5228 29.6553 19.9949C32.2745 17.6826 33.819 14.8127 34.2235 11.612C34.6664 8.125 33.8152 5.72351 31.4695 3.30344C29.0621 0.775554 26.0539 0.362915 22.4024 0.362915H10.0074L9.32182 5.92797V5.86849Z",
|
|
17
|
+
fill: "#55585A"
|
|
18
|
+
}
|
|
19
|
+
),
|
|
20
|
+
/* @__PURE__ */ jsx(
|
|
21
|
+
"path",
|
|
22
|
+
{
|
|
23
|
+
d: "M44.8888 0.960416L44.5229 3.92324L44.6115 3.64071C46.1021 1.46599 48.4517 0.618408 51.0516 0.618408C53.7787 0.618408 55.5312 1.62213 56.5828 3.91952C58.4008 1.53662 60.7273 0.618408 63.6277 0.618408C65.4881 0.618408 67.1289 1.16116 68.2613 2.45856C69.6595 4.04592 69.3937 6.13514 69.1087 8.39164L67.1828 23.2355H59.7451L61.5207 9.28012C61.6979 7.90094 61.6787 6.35447 59.6873 6.35447C57.2607 6.35447 56.7831 8.52919 56.5635 10.2392L54.9111 23.2318H47.3771L49.1527 9.2764C49.3222 7.93811 49.1643 6.22436 47.3 6.22436C45.2663 6.22436 44.6153 7.68904 44.4112 9.2764L42.6355 23.2318H34.5199L37.3817 0.960416H44.8888Z",
|
|
24
|
+
fill: "#55585A"
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ jsx(
|
|
28
|
+
"path",
|
|
29
|
+
{
|
|
30
|
+
d: "M96.5979 0.336548L95.8699 6.39231H102.649L95.4501 9.54101L93.6821 23.2734H102.429L105.349 0.336548H96.5979Z",
|
|
31
|
+
fill: "#55585A"
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
"path",
|
|
36
|
+
{
|
|
37
|
+
d: "M90.2045 10.4126C88.529 9.34573 85.7827 9.04833 83.7837 8.79182C83.0903 8.70632 82.3084 8.49814 81.5804 8.29368C81.3031 8.23792 81.045 8.16729 80.8062 8.07807C80.7176 8.05204 80.6175 8.02231 80.5328 8C80.3363 7.95539 80.1206 7.81041 79.928 7.61338C79.5275 7.30855 79.2886 6.94424 79.2886 6.54647C79.2886 6.35688 79.358 6.17844 79.4581 6.00372C79.4697 5.98513 79.4774 5.97026 79.4889 5.95167C79.9666 5.20446 81.2993 4.66543 82.8862 4.66543C84.8005 4.66543 86.3566 5.44981 86.4645 6.43866H93.9138C92.9316 2.34572 88.2517 0 84.0071 0C81.488 0 78.2949 0.342007 75.9184 1.66171C73.6343 2.94052 71.9973 4.66914 71.6814 7.14126C70.9419 12.9405 76.369 14.026 81.0181 14.6654C81.2762 14.6952 81.7807 14.8141 82.3315 15.0037C83.7721 15.2974 84.7928 16.026 84.7928 16.8848C84.7928 17.8773 83.4254 18.6989 81.6267 18.8699C81.4187 18.9145 81.2338 18.9368 81.0913 18.9368C79.9434 18.9368 79.1615 18.8625 78.5876 18.487C77.8635 18.197 77.3358 17.777 77.1471 17.29H69.3395C70.3795 22.3234 75.0132 24 79.7085 24C84.789 24 91.8492 22.2491 92.6157 16.2342C92.8546 14.3494 92.1844 11.7286 90.2123 10.4089L90.2045 10.4126Z",
|
|
38
|
+
fill: "#55585A"
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
"path",
|
|
43
|
+
{
|
|
44
|
+
d: "M1.03227 9.54944H16.0773L0 16.9175L1.03227 9.54944Z",
|
|
45
|
+
fill: "#DF4405"
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
LogoDMSiTopBar
|
|
55
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/components/useMounted.tsx
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
var useMounted = () => {
|
|
4
|
+
const [isMounted, setIsMounted] = useState(false);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
setIsMounted(true);
|
|
7
|
+
return () => setIsMounted(false);
|
|
8
|
+
}, []);
|
|
9
|
+
return isMounted;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
useMounted
|
|
14
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/utils.ts
|
|
2
|
+
function findDocumentRoot(element) {
|
|
3
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
4
|
+
throw new Error(
|
|
5
|
+
"findDocumentRoot can only be used in a browser environment."
|
|
6
|
+
);
|
|
7
|
+
}
|
|
8
|
+
if (!element || !(element instanceof Node)) {
|
|
9
|
+
return window.document.body;
|
|
10
|
+
}
|
|
11
|
+
var currentElement = element;
|
|
12
|
+
while (currentElement && currentElement.parentNode) {
|
|
13
|
+
if (currentElement.parentNode === document) {
|
|
14
|
+
return document.body;
|
|
15
|
+
} else if (currentElement.parentNode instanceof DocumentFragment) {
|
|
16
|
+
return currentElement.parentNode;
|
|
17
|
+
} else {
|
|
18
|
+
currentElement = currentElement.parentNode;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return window.document.body;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
findDocumentRoot
|
|
26
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
typography
|
|
3
|
+
} from "./chunk-KX3O6GJ6.js";
|
|
4
|
+
import {
|
|
5
|
+
__objRest,
|
|
6
|
+
__spreadProps,
|
|
7
|
+
__spreadValues
|
|
8
|
+
} from "./chunk-ORMEWXMH.js";
|
|
9
|
+
|
|
10
|
+
// src/components/Subheader.tsx
|
|
11
|
+
import clsx from "clsx";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
var Subheader = (_a) => {
|
|
14
|
+
var _b = _a, {
|
|
15
|
+
className,
|
|
16
|
+
children,
|
|
17
|
+
as = "span",
|
|
18
|
+
align,
|
|
19
|
+
color,
|
|
20
|
+
tall
|
|
21
|
+
} = _b, props = __objRest(_b, [
|
|
22
|
+
"className",
|
|
23
|
+
"children",
|
|
24
|
+
"as",
|
|
25
|
+
"align",
|
|
26
|
+
"color",
|
|
27
|
+
"tall"
|
|
28
|
+
]);
|
|
29
|
+
const Element = as;
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
Element,
|
|
32
|
+
__spreadProps(__spreadValues({
|
|
33
|
+
className: clsx(
|
|
34
|
+
typography.subheader,
|
|
35
|
+
className,
|
|
36
|
+
align === "left" && "text-left",
|
|
37
|
+
align === "center" && "text-center",
|
|
38
|
+
align === "right" && "text-right",
|
|
39
|
+
tall && "!leading-6"
|
|
40
|
+
),
|
|
41
|
+
style: __spreadProps(__spreadValues({}, props.style), {
|
|
42
|
+
color: color ? `var(--color-${color})` : void 0
|
|
43
|
+
})
|
|
44
|
+
}, props), {
|
|
45
|
+
children
|
|
46
|
+
})
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
Subheader.displayName = "Subheader";
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
Subheader
|
|
53
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button
|
|
3
|
+
} from "./chunk-KENSVWOY.js";
|
|
4
|
+
import {
|
|
5
|
+
Icon
|
|
6
|
+
} from "./chunk-IGQVA7SC.js";
|
|
7
|
+
|
|
8
|
+
// src/components/ModalButtons.tsx
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var ModalButtons = ({
|
|
11
|
+
onClose,
|
|
12
|
+
onContinue,
|
|
13
|
+
customActions
|
|
14
|
+
}) => {
|
|
15
|
+
return /* @__PURE__ */ jsx("div", { className: "border-t border-neutral-300 p-4 flex justify-end space-x-2", children: customActions != null ? customActions : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16
|
+
/* @__PURE__ */ jsx(
|
|
17
|
+
Button,
|
|
18
|
+
{
|
|
19
|
+
variant: "secondary",
|
|
20
|
+
leftIcon: /* @__PURE__ */ jsx(Icon, { name: "close", size: 24 }),
|
|
21
|
+
onClick: onClose,
|
|
22
|
+
className: "max-sm:w-full",
|
|
23
|
+
children: "Close"
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
Button,
|
|
28
|
+
{
|
|
29
|
+
variant: "primary",
|
|
30
|
+
leftIcon: /* @__PURE__ */ jsx(Icon, { name: "check", size: 24 }),
|
|
31
|
+
className: "max-sm:w-full",
|
|
32
|
+
onClick: onContinue,
|
|
33
|
+
children: "Continue"
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
] }) });
|
|
37
|
+
};
|
|
38
|
+
ModalButtons.displayName = "ModalButtons";
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
ModalButtons
|
|
42
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/components/useInfiniteScroll.tsx
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
function useInfiniteScroll({
|
|
4
|
+
containerRef,
|
|
5
|
+
onLoadMore,
|
|
6
|
+
isLoading,
|
|
7
|
+
offset = 50,
|
|
8
|
+
enabled = true
|
|
9
|
+
// ✅ Add this
|
|
10
|
+
}) {
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (!enabled) return;
|
|
13
|
+
const handleScroll = () => {
|
|
14
|
+
const el2 = containerRef.current;
|
|
15
|
+
if (!el2 || isLoading) return;
|
|
16
|
+
const { scrollTop, scrollHeight, clientHeight } = el2;
|
|
17
|
+
const isNearBottom = scrollTop + clientHeight >= scrollHeight - offset;
|
|
18
|
+
if (isNearBottom) {
|
|
19
|
+
onLoadMore();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const el = containerRef.current;
|
|
23
|
+
if (el) el.addEventListener("scroll", handleScroll);
|
|
24
|
+
return () => {
|
|
25
|
+
if (el) el.removeEventListener("scroll", handleScroll);
|
|
26
|
+
};
|
|
27
|
+
}, [containerRef, onLoadMore, isLoading, offset, enabled]);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
useInfiniteScroll
|
|
32
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button
|
|
3
|
+
} from "./chunk-KENSVWOY.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/NavigationTab.tsx
|
|
14
|
+
import clsx from "clsx";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
var NavigationTab = (_a) => {
|
|
17
|
+
var _b = _a, {
|
|
18
|
+
label,
|
|
19
|
+
onClick,
|
|
20
|
+
selected = false,
|
|
21
|
+
className,
|
|
22
|
+
disabled = false,
|
|
23
|
+
href
|
|
24
|
+
} = _b, props = __objRest(_b, [
|
|
25
|
+
"label",
|
|
26
|
+
"onClick",
|
|
27
|
+
"selected",
|
|
28
|
+
"className",
|
|
29
|
+
"disabled",
|
|
30
|
+
"href"
|
|
31
|
+
]);
|
|
32
|
+
const textClassName = clsx(
|
|
33
|
+
// "!text-text-on-action-primary-hover", // use this once semantic tokens are available
|
|
34
|
+
"!text-brand-text-on-action-primary-hover",
|
|
35
|
+
// "hover:!text-text-on-action-primary-hover", // use this once semantic tokens are available
|
|
36
|
+
"hover:!text-brand-text-on-action-primary-hover",
|
|
37
|
+
// "active:!text-text-on-action-primary-active", // use this once semantic tokens are available
|
|
38
|
+
"active:!text-brand-text-on-action-primary-active",
|
|
39
|
+
"disabled:!text-brand-text-on-action-primary-disabled"
|
|
40
|
+
);
|
|
41
|
+
const disabledClassName = clsx(
|
|
42
|
+
"disabled:!bg-background-on-action-primary-disabled disabled:pointer-events-none"
|
|
43
|
+
);
|
|
44
|
+
const paddingClassName = clsx(
|
|
45
|
+
"p-mobile-component-padding desktop:p-desktop-component-padding compact:p-desktop-compact-component-padding"
|
|
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
|
+
const selectedClassName = clsx(
|
|
56
|
+
"!bg-neutral-000",
|
|
57
|
+
"hover:!bg-background-on-action-primary-normal",
|
|
58
|
+
"active:!bg-background-on-action-primary-active"
|
|
59
|
+
);
|
|
60
|
+
const tokenOverrides = {
|
|
61
|
+
"--color-text-on-action-primary-hover": "var(--color-brand-500)",
|
|
62
|
+
"--color-text-on-action-primary-active": "var(--color-brand-300)"
|
|
63
|
+
};
|
|
64
|
+
return /* @__PURE__ */ jsx(
|
|
65
|
+
Button,
|
|
66
|
+
__spreadProps(__spreadValues({
|
|
67
|
+
variant: "tertiary-critical",
|
|
68
|
+
colorClassName: textClassName,
|
|
69
|
+
className: clsx(
|
|
70
|
+
"!border-0 !rounded-b-none h-10 min-w-20 relative",
|
|
71
|
+
paddingClassName,
|
|
72
|
+
disabledClassName,
|
|
73
|
+
!selected && unselectedClassName,
|
|
74
|
+
selected && selectedClassName,
|
|
75
|
+
className
|
|
76
|
+
),
|
|
77
|
+
style: tokenOverrides,
|
|
78
|
+
classNameLabel: "px-1",
|
|
79
|
+
rightIcon: /* @__PURE__ */ jsx(Icon, { name: "close", size: 16 }),
|
|
80
|
+
onClick,
|
|
81
|
+
disabled
|
|
82
|
+
}, props), {
|
|
83
|
+
as: href ? "a" : void 0,
|
|
84
|
+
href,
|
|
85
|
+
children: label
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
NavigationTab.displayName = "NavigationTab";
|
|
90
|
+
|
|
91
|
+
export {
|
|
92
|
+
NavigationTab
|
|
93
|
+
};
|