@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,885 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defProps = Object.defineProperties;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
10
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
13
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
14
|
+
var __spreadValues = (a, b) => {
|
|
15
|
+
for (var prop in b || (b = {}))
|
|
16
|
+
if (__hasOwnProp.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
if (__getOwnPropSymbols)
|
|
19
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
20
|
+
if (__propIsEnum.call(b, prop))
|
|
21
|
+
__defNormalProp(a, prop, b[prop]);
|
|
22
|
+
}
|
|
23
|
+
return a;
|
|
24
|
+
};
|
|
25
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
26
|
+
var __objRest = (source, exclude) => {
|
|
27
|
+
var target = {};
|
|
28
|
+
for (var prop in source)
|
|
29
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
30
|
+
target[prop] = source[prop];
|
|
31
|
+
if (source != null && __getOwnPropSymbols)
|
|
32
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
33
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
34
|
+
target[prop] = source[prop];
|
|
35
|
+
}
|
|
36
|
+
return target;
|
|
37
|
+
};
|
|
38
|
+
var __export = (target, all) => {
|
|
39
|
+
for (var name in all)
|
|
40
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
41
|
+
};
|
|
42
|
+
var __copyProps = (to, from, except, desc) => {
|
|
43
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
44
|
+
for (let key of __getOwnPropNames(from))
|
|
45
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
46
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
47
|
+
}
|
|
48
|
+
return to;
|
|
49
|
+
};
|
|
50
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
51
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
52
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
53
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
54
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
55
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
56
|
+
mod
|
|
57
|
+
));
|
|
58
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
59
|
+
|
|
60
|
+
// src/components/Stepper.tsx
|
|
61
|
+
var Stepper_exports = {};
|
|
62
|
+
__export(Stepper_exports, {
|
|
63
|
+
Stepper: () => Stepper
|
|
64
|
+
});
|
|
65
|
+
module.exports = __toCommonJS(Stepper_exports);
|
|
66
|
+
|
|
67
|
+
// src/components/Button.tsx
|
|
68
|
+
var import_clsx2 = __toESM(require("clsx"), 1);
|
|
69
|
+
|
|
70
|
+
// src/classNames.ts
|
|
71
|
+
var import_clsx = __toESM(require("clsx"), 1);
|
|
72
|
+
var typography = {
|
|
73
|
+
display1: (0, import_clsx.default)(
|
|
74
|
+
"font-sans font-semibold",
|
|
75
|
+
"text-display-1-mobile desktop:text-display-1-desktop compact:text-display-1-desktop-compact",
|
|
76
|
+
"leading-display-1-mobile desktop:leading-display-1-desktop"
|
|
77
|
+
),
|
|
78
|
+
display2: (0, import_clsx.default)(
|
|
79
|
+
"font-sans font-bold",
|
|
80
|
+
"text-display-2-mobile desktop:text-display-2-desktop compact:text-display-2-desktop-compact",
|
|
81
|
+
"leading-display-2-mobile desktop:leading-display-2-desktop"
|
|
82
|
+
),
|
|
83
|
+
heading1: (0, import_clsx.default)(
|
|
84
|
+
"font-sans font-semibold",
|
|
85
|
+
"text-heading-1-mobile desktop:text-heading-1-desktop compact:text-heading-1-desktop-compact",
|
|
86
|
+
"leading-heading-1-mobile desktop:leading-heading-1-desktop"
|
|
87
|
+
),
|
|
88
|
+
heading2: (0, import_clsx.default)(
|
|
89
|
+
"font-sans font-normal",
|
|
90
|
+
"text-heading-2-mobile desktop:text-heading-2-desktop compact:text-heading-2-desktop-compact",
|
|
91
|
+
"leading-heading-2-mobile desktop:leading-heading-2-desktop"
|
|
92
|
+
),
|
|
93
|
+
heading3: (0, import_clsx.default)(
|
|
94
|
+
"font-sans font-semibold",
|
|
95
|
+
"text-heading-3-mobile desktop:text-heading-3-desktop compact:text-heading-3-desktop-compact",
|
|
96
|
+
"leading-heading-3-mobile desktop:leading-heading-3-desktop"
|
|
97
|
+
),
|
|
98
|
+
subheader: (0, import_clsx.default)(
|
|
99
|
+
"font-sans font-semibold",
|
|
100
|
+
"text-subheader-mobile desktop:text-subheader-desktop compact:text-subheader-desktop-compact",
|
|
101
|
+
"leading-subheader-mobile desktop:leading-subheader-desktop"
|
|
102
|
+
),
|
|
103
|
+
link: (0, import_clsx.default)(
|
|
104
|
+
"font-sans font-normal",
|
|
105
|
+
"text-link-mobile desktop:text-link-desktop compact:text-link-desktop-compact",
|
|
106
|
+
"leading-link-mobile desktop:leading-link-desktop"
|
|
107
|
+
),
|
|
108
|
+
buttonLabel: (0, import_clsx.default)(
|
|
109
|
+
"font-sans font-semibold",
|
|
110
|
+
"text-label-mobile desktop:text-label-desktop compact:text-label-desktop-compact",
|
|
111
|
+
"leading-label-mobile desktop:leading-label-desktop"
|
|
112
|
+
),
|
|
113
|
+
label: (0, import_clsx.default)(
|
|
114
|
+
"font-sans font-semibold",
|
|
115
|
+
"text-label-mobile desktop:text-label-desktop compact:text-label-desktop-compact",
|
|
116
|
+
"leading-label-mobile desktop:leading-label-desktop"
|
|
117
|
+
),
|
|
118
|
+
paragraph: (0, import_clsx.default)(
|
|
119
|
+
"font-sans font-normal",
|
|
120
|
+
"text-paragraph-mobile desktop:text-paragraph-desktop compact:text-paragraph-desktop-compact",
|
|
121
|
+
"leading-paragraph-mobile desktop:leading-paragraph-desktop"
|
|
122
|
+
),
|
|
123
|
+
caption: (0, import_clsx.default)(
|
|
124
|
+
"font-sans font-normal",
|
|
125
|
+
"text-caption-mobile desktop:text-caption-desktop compact:text-caption-desktop-compact",
|
|
126
|
+
"leading-caption-mobile desktop:leading-caption-desktop"
|
|
127
|
+
)
|
|
128
|
+
};
|
|
129
|
+
var baseTransition = (0, import_clsx.default)(
|
|
130
|
+
"transition-colors duration-100 ease-in-out"
|
|
131
|
+
);
|
|
132
|
+
var componentGap = (0, import_clsx.default)(
|
|
133
|
+
"gap-mobile-component-gap desktop:gap-desktop-component-gap compact:gap-desktop-compact-component-gap"
|
|
134
|
+
);
|
|
135
|
+
var paddingUsingComponentGap = (0, import_clsx.default)(
|
|
136
|
+
"p-mobile-component-gap desktop:p-desktop-component-gap compact:p-desktop-compact-component-gap"
|
|
137
|
+
);
|
|
138
|
+
var paddingYUsingLayoutGroupGap = (0, import_clsx.default)(
|
|
139
|
+
"py-mobile-layout-group-gap desktop:py-desktop-layout-group-gap compact:py-desktop-compact-layout-group-gap"
|
|
140
|
+
);
|
|
141
|
+
var componentPadding = (0, import_clsx.default)(
|
|
142
|
+
"p-mobile-component-padding desktop:p-desktop-component-padding compact:p-desktop-compact-component-padding"
|
|
143
|
+
);
|
|
144
|
+
var componentPaddingBottom = (0, import_clsx.default)(
|
|
145
|
+
"pb-mobile-component-padding desktop:pb-desktop-component-padding compact:pb-desktop-compact-component-padding"
|
|
146
|
+
);
|
|
147
|
+
var componentPaddingY = (0, import_clsx.default)(
|
|
148
|
+
"py-mobile-component-padding desktop:py-desktop-component-padding compact:py-desktop-compact-component-padding"
|
|
149
|
+
);
|
|
150
|
+
var componentPaddingXUsingComponentGap = (0, import_clsx.default)(
|
|
151
|
+
"px-mobile-component-gap desktop:px-desktop-component-gap compact:px-desktop-compact-component-gap"
|
|
152
|
+
);
|
|
153
|
+
var componentPaddingYUsingComponentGap = (0, import_clsx.default)(
|
|
154
|
+
"py-mobile-component-gap desktop:py-desktop-component-gap compact:py-desktop-compact-component-gap"
|
|
155
|
+
);
|
|
156
|
+
var componentPaddingMinusBorder = (0, import_clsx.default)(
|
|
157
|
+
"p-[calc(var(--spacing-mobile-component-padding)_-_1px)] desktop:p-[calc(var(--spacing-desktop-component-padding)_-_1px)] compact:p-[calc(var(--spacing-desktop-compact-component-padding)_-_1px)]"
|
|
158
|
+
);
|
|
159
|
+
var componentPaddingMinus2pxBorder = (0, import_clsx.default)(
|
|
160
|
+
"p-[calc(var(--spacing-mobile-component-padding)_-_2px)] desktop:p-[calc(var(--spacing-desktop-component-padding)_-_2px)] compact:p-[calc(var(--spacing-desktop-compact-component-padding)_-_2px)]"
|
|
161
|
+
);
|
|
162
|
+
var layoutPaddingBottom = (0, import_clsx.default)(
|
|
163
|
+
"pb-mobile-layout-padding desktop:pb-desktop-layout-padding compact:pb-desktop-compact-layout-padding"
|
|
164
|
+
);
|
|
165
|
+
var layoutPaddingY = (0, import_clsx.default)(
|
|
166
|
+
"py-mobile-layout-padding desktop:py-desktop-layout-padding compact:py-desktop-compact-layout-padding"
|
|
167
|
+
);
|
|
168
|
+
var containerPaddingX = (0, import_clsx.default)(
|
|
169
|
+
"px-mobile-container-padding desktop:px-desktop-container-padding compact:px-desktop-compact-container-padding"
|
|
170
|
+
);
|
|
171
|
+
var containerPaddingY = (0, import_clsx.default)(
|
|
172
|
+
"py-mobile-container-padding desktop:py-desktop-container-padding compact:py-desktop-compact-container-padding"
|
|
173
|
+
);
|
|
174
|
+
var layoutGroupGapPaddingY = (0, import_clsx.default)(
|
|
175
|
+
"py-mobile-layout-group-gap desktop:py-desktop-layout-group-gap compact:py-desktop-compact-layout-group-gap"
|
|
176
|
+
);
|
|
177
|
+
var layoutGroupGap = (0, import_clsx.default)(
|
|
178
|
+
"gap-mobile-layout-group-gap desktop:gap-desktop-layout-group-gap compact:gap-desktop-compact-layout-group-gap"
|
|
179
|
+
);
|
|
180
|
+
var layoutGap = (0, import_clsx.default)(
|
|
181
|
+
"gap-mobile-layout-gap desktop:gap-desktop-layout-gap compact:gap-desktop-compact-layout-gap"
|
|
182
|
+
);
|
|
183
|
+
var gapUsingContainerPadding = (0, import_clsx.default)(
|
|
184
|
+
"gap-mobile-container-padding desktop:gap-desktop-container-padding compact:gap-desktop-compact-container-padding"
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
// src/components/Button.tsx
|
|
188
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
189
|
+
var Button = (_a) => {
|
|
190
|
+
var _b = _a, {
|
|
191
|
+
variant = "primary",
|
|
192
|
+
as = "button",
|
|
193
|
+
block,
|
|
194
|
+
leftIcon,
|
|
195
|
+
rightIcon,
|
|
196
|
+
className,
|
|
197
|
+
classNameLabel,
|
|
198
|
+
disabled = false,
|
|
199
|
+
children,
|
|
200
|
+
iconOnly = false,
|
|
201
|
+
colorClassName,
|
|
202
|
+
href
|
|
203
|
+
} = _b, props = __objRest(_b, [
|
|
204
|
+
"variant",
|
|
205
|
+
"as",
|
|
206
|
+
"block",
|
|
207
|
+
"leftIcon",
|
|
208
|
+
"rightIcon",
|
|
209
|
+
"className",
|
|
210
|
+
"classNameLabel",
|
|
211
|
+
"disabled",
|
|
212
|
+
"children",
|
|
213
|
+
"iconOnly",
|
|
214
|
+
"colorClassName",
|
|
215
|
+
"href"
|
|
216
|
+
]);
|
|
217
|
+
const primaryVariantStyles = variant === "primary" && (0, import_clsx2.default)(
|
|
218
|
+
(colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-on-action-primary-normal",
|
|
219
|
+
"bg-background-action-primary-normal border-background-action-primary-normal",
|
|
220
|
+
"hover:bg-background-action-primary-hover hover:border-background-action-primary-hover",
|
|
221
|
+
"focus:bg-background-action-primary-hover focus:border-background-action-primary-hover focus:outline-0",
|
|
222
|
+
"active:bg-background-action-primary-active active:border-background-action-primary-active",
|
|
223
|
+
"disabled:bg-background-action-primary-disabled disabled:border-background-action-primary-disabled disabled:text-text-on-action-primary-disabled"
|
|
224
|
+
);
|
|
225
|
+
const secondaryVariantStyles = variant === "secondary" && (0, import_clsx2.default)(
|
|
226
|
+
(colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-primary-normal",
|
|
227
|
+
"bg-background-action-secondary-normal border-border-action-normal",
|
|
228
|
+
"hover:bg-background-action-secondary-hover hover:border-border-action-hover hover:text-text-action-primary-hover",
|
|
229
|
+
"focus:bg-background-action-secondary-hover focus:border-border-action-hover focus:text-text-action-primary-hover focus:outline-0",
|
|
230
|
+
"active:bg-background-action-secondary-active active:border-border-action-active active:text-text-action-primary-active",
|
|
231
|
+
"disabled:bg-background-action-primary-disabled disabled:border-border-action-disabled disabled:text-text-action-primary-disabled"
|
|
232
|
+
);
|
|
233
|
+
const tertiaryVariantStyles = variant === "tertiary" && (0, import_clsx2.default)(
|
|
234
|
+
"bg-transparent border-transparent",
|
|
235
|
+
iconOnly ? (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-icon-action-primary-normal" : (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-primary-normal",
|
|
236
|
+
"bg-transparent border-transparent",
|
|
237
|
+
"hover:bg-background-action-secondary-hover hover:border-background-action-secondary-hover hover:text-text-action-primary-hover",
|
|
238
|
+
"focus:bg-background-action-secondary-hover focus:border-background-action-secondary-hover focus:text-text-action-primary-hover focus:outline-0",
|
|
239
|
+
"active:bg-background-action-secondary-active active:border-transparent active:text-text-action-primary-active",
|
|
240
|
+
"disabled:bg-transparent disabled:border-transparent disabled:text-text-action-primary-disabled"
|
|
241
|
+
);
|
|
242
|
+
const primaryCriticalVariantStyles = variant === "primary-critical" && (0, import_clsx2.default)(
|
|
243
|
+
(colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-on-action-primary-normal",
|
|
244
|
+
"bg-background-action-critical-primary-normal border-background-action-critical-primary-normal",
|
|
245
|
+
"hover:bg-background-action-critical-primary-hover hover:border-background-action-critical-primary-hover",
|
|
246
|
+
"focus:bg-background-action-critical-primary-hover focus:border-background-action-critical-primary-hover focus:outline-0",
|
|
247
|
+
"active:bg-background-action-critical-primary-active active:border-background-action-critical-primary-active",
|
|
248
|
+
"disabled:bg-background-action-critical-primary-disabled disabled:border-background-action-critical-primary-disabled disabled:text-text-on-action-primary-disabled"
|
|
249
|
+
);
|
|
250
|
+
const secondaryCriticalVariantStyles = variant === "secondary-critical" && (0, import_clsx2.default)(
|
|
251
|
+
(colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-critical-normal",
|
|
252
|
+
"bg-background-action-critical-secondary-normal border-border-action-critical-normal",
|
|
253
|
+
"hover:bg-background-action-critical-secondary-hover hover:border-border-action-critical-hover hover:text-text-action-critical-hover",
|
|
254
|
+
"focus:bg-background-action-critical-secondary-hover focus:border-border-action-critical-hover focus:text-text-action-critical-hover focus:outline-0",
|
|
255
|
+
"active:bg-background-action-critical-secondary-active active:border-border-action-critical-active active:text-text-action-critical-active",
|
|
256
|
+
"disabled:bg-background-action-critical-disabled disabled:border-border-action-critical-disabled disabled:text-text-action-critical-disabled"
|
|
257
|
+
);
|
|
258
|
+
const tertiaryCriticalVariantStyles = variant === "tertiary-critical" && (0, import_clsx2.default)(
|
|
259
|
+
(colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-critical-normal",
|
|
260
|
+
"bg-transparent border-transparent text-text-action-critical-normal",
|
|
261
|
+
"hover:bg-background-action-critical-secondary-hover hover:border-background-action-critical-secondary-hover hover:text-text-action-critical-hover",
|
|
262
|
+
"focus:bg-background-action-critical-secondary-hover focus:border-background-action-critical-secondary-hover focus:text-text-action-critical-hover focus:outline-0",
|
|
263
|
+
"active:bg-background-action-critical-secondary-active active:border-background-action-critical-secondary-active active:text-text-action-critical-active",
|
|
264
|
+
"disabled:bg-transparent disabled:border-transparent disabled:text-text-action-critical-disabled"
|
|
265
|
+
);
|
|
266
|
+
const navigationVarianStyles = variant === "navigation" && (0, import_clsx2.default)(
|
|
267
|
+
(colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-on-action-primary-normal",
|
|
268
|
+
"bg-transparent",
|
|
269
|
+
"hover:bg-background-on-action-secondary-hover hover:text-brand-text-action-primary-hover",
|
|
270
|
+
// "hover:bg-background-action-secondary-hover hover:text-text-action-primary-hover", // Will use this once colors are finalized
|
|
271
|
+
"focus:bg-background-on-action-secondary-hover focus:text-brand-text-action-primary-hover focus:outline-0",
|
|
272
|
+
// "focus:bg-background-action-secondary-hover focus:text-text-action-primary-hover", // Will use this once colors are finalized
|
|
273
|
+
"active:bg-background-on-action-secondary-active active:text-brand-text-action-primary-active",
|
|
274
|
+
// "active:bg-background-action-secondary-active active:text-text-action-primary-active", // Will use this once colors are finalized
|
|
275
|
+
"disabled:bg-transparent disabled:text-text-on-action-primary-disabled",
|
|
276
|
+
"flex-col",
|
|
277
|
+
paddingUsingComponentGap
|
|
278
|
+
);
|
|
279
|
+
const notNavigationVariantStyles = variant !== "navigation" && (0, import_clsx2.default)("border-2 flex-row", componentPaddingMinus2pxBorder, componentGap);
|
|
280
|
+
const buttonClasses = (0, import_clsx2.default)(
|
|
281
|
+
disabled ? "cursor-default" : "cursor-pointer",
|
|
282
|
+
block ? "w-full" : "w-fit",
|
|
283
|
+
baseTransition,
|
|
284
|
+
"rounded-sm whitespace-nowrap inline-flex items-center justify-center group/btn",
|
|
285
|
+
primaryVariantStyles,
|
|
286
|
+
secondaryVariantStyles,
|
|
287
|
+
tertiaryVariantStyles,
|
|
288
|
+
primaryCriticalVariantStyles,
|
|
289
|
+
secondaryCriticalVariantStyles,
|
|
290
|
+
tertiaryCriticalVariantStyles,
|
|
291
|
+
navigationVarianStyles,
|
|
292
|
+
notNavigationVariantStyles,
|
|
293
|
+
className
|
|
294
|
+
);
|
|
295
|
+
const labelClasses = (0, import_clsx2.default)(
|
|
296
|
+
"min-h-6 flex items-center justify-center",
|
|
297
|
+
classNameLabel,
|
|
298
|
+
componentPaddingXUsingComponentGap,
|
|
299
|
+
typography.buttonLabel
|
|
300
|
+
);
|
|
301
|
+
const Element = href ? "a" : as;
|
|
302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
303
|
+
Element,
|
|
304
|
+
__spreadProps(__spreadValues({
|
|
305
|
+
type: Element === "button" ? "button" : void 0,
|
|
306
|
+
className: buttonClasses
|
|
307
|
+
}, props), {
|
|
308
|
+
disabled,
|
|
309
|
+
href,
|
|
310
|
+
children: [
|
|
311
|
+
leftIcon && leftIcon,
|
|
312
|
+
!iconOnly && children && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: labelClasses, children }),
|
|
313
|
+
rightIcon && rightIcon
|
|
314
|
+
]
|
|
315
|
+
})
|
|
316
|
+
);
|
|
317
|
+
};
|
|
318
|
+
Button.displayName = "Button";
|
|
319
|
+
|
|
320
|
+
// src/components/Input.tsx
|
|
321
|
+
var import_react = require("react");
|
|
322
|
+
var import_clsx5 = __toESM(require("clsx"), 1);
|
|
323
|
+
|
|
324
|
+
// src/components/Label.tsx
|
|
325
|
+
var import_clsx3 = __toESM(require("clsx"), 1);
|
|
326
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
327
|
+
var Label = (_a) => {
|
|
328
|
+
var _b = _a, {
|
|
329
|
+
as = "span",
|
|
330
|
+
padded,
|
|
331
|
+
className,
|
|
332
|
+
color,
|
|
333
|
+
align
|
|
334
|
+
} = _b, props = __objRest(_b, [
|
|
335
|
+
"as",
|
|
336
|
+
"padded",
|
|
337
|
+
"className",
|
|
338
|
+
"color",
|
|
339
|
+
"align"
|
|
340
|
+
]);
|
|
341
|
+
const Element = as;
|
|
342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
343
|
+
Element,
|
|
344
|
+
__spreadProps(__spreadValues({
|
|
345
|
+
className: (0, import_clsx3.default)(
|
|
346
|
+
typography.label,
|
|
347
|
+
align === "left" && "text-left",
|
|
348
|
+
align === "center" && "text-center",
|
|
349
|
+
align === "right" && "text-right",
|
|
350
|
+
className,
|
|
351
|
+
padded && componentPaddingXUsingComponentGap
|
|
352
|
+
)
|
|
353
|
+
}, props), {
|
|
354
|
+
style: __spreadProps(__spreadValues({}, props.style), {
|
|
355
|
+
color: color ? `var(--color-${color})` : void 0
|
|
356
|
+
})
|
|
357
|
+
})
|
|
358
|
+
);
|
|
359
|
+
};
|
|
360
|
+
Label.displayName = "Label";
|
|
361
|
+
|
|
362
|
+
// src/components/Icon.tsx
|
|
363
|
+
var import_clsx4 = __toESM(require("clsx"), 1);
|
|
364
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
365
|
+
function Icon(_a) {
|
|
366
|
+
var _b = _a, {
|
|
367
|
+
name,
|
|
368
|
+
size = 24,
|
|
369
|
+
variant = "outline"
|
|
370
|
+
} = _b, props = __objRest(_b, [
|
|
371
|
+
"name",
|
|
372
|
+
"size",
|
|
373
|
+
"variant"
|
|
374
|
+
]);
|
|
375
|
+
const variantStyle = variant === "filled" ? '"FILL" 1' : '"FILL" 0';
|
|
376
|
+
const weightStyle = size === 16 ? '"wght" 400' : '"wght" 300';
|
|
377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
378
|
+
"span",
|
|
379
|
+
__spreadProps(__spreadValues({}, props), {
|
|
380
|
+
className: (0, import_clsx4.default)(
|
|
381
|
+
"icon",
|
|
382
|
+
`icon-${size}`,
|
|
383
|
+
// size === 16 ? "font-normal" : "font-light", // size 16 font weight is not working as normal from before
|
|
384
|
+
props.className
|
|
385
|
+
),
|
|
386
|
+
style: __spreadValues({
|
|
387
|
+
fontVariationSettings: variantStyle + `, ${weightStyle}`
|
|
388
|
+
}, props.style),
|
|
389
|
+
children: name
|
|
390
|
+
})
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// src/utils/formatting.tsx
|
|
395
|
+
function getDecimalPlaceholder(decimals) {
|
|
396
|
+
if (!decimals || decimals <= 0) {
|
|
397
|
+
return {};
|
|
398
|
+
}
|
|
399
|
+
return {
|
|
400
|
+
placeholder: `0.${"0".repeat(decimals)}`
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
function formatDecimalValue(value, decimals) {
|
|
404
|
+
if (!value || value === "") {
|
|
405
|
+
return "";
|
|
406
|
+
}
|
|
407
|
+
const numValue = typeof value === "string" ? parseFloat(value) : value;
|
|
408
|
+
if (isNaN(numValue)) {
|
|
409
|
+
return "";
|
|
410
|
+
}
|
|
411
|
+
if (!decimals || decimals <= 0) {
|
|
412
|
+
return String(Math.round(numValue));
|
|
413
|
+
}
|
|
414
|
+
return numValue.toFixed(decimals);
|
|
415
|
+
}
|
|
416
|
+
function formatCurrencyDisplay(value) {
|
|
417
|
+
if (!value || value === "") {
|
|
418
|
+
return "";
|
|
419
|
+
}
|
|
420
|
+
const parts = value.split(".");
|
|
421
|
+
const integerPart = parts[0];
|
|
422
|
+
const decimalPart = parts[1];
|
|
423
|
+
const formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
424
|
+
return decimalPart !== void 0 ? `${formattedInteger}.${decimalPart}` : formattedInteger;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// src/components/Input.tsx
|
|
428
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
429
|
+
var InputBase = (_a) => {
|
|
430
|
+
var _b = _a, {
|
|
431
|
+
before,
|
|
432
|
+
after,
|
|
433
|
+
type,
|
|
434
|
+
label,
|
|
435
|
+
error,
|
|
436
|
+
className,
|
|
437
|
+
align = "left",
|
|
438
|
+
caption,
|
|
439
|
+
required,
|
|
440
|
+
selectOnFocus,
|
|
441
|
+
removeRoundness,
|
|
442
|
+
inputContainerRef,
|
|
443
|
+
removeBorder,
|
|
444
|
+
wrapperClassName,
|
|
445
|
+
focus
|
|
446
|
+
} = _b, props = __objRest(_b, [
|
|
447
|
+
"before",
|
|
448
|
+
"after",
|
|
449
|
+
"type",
|
|
450
|
+
"label",
|
|
451
|
+
"error",
|
|
452
|
+
"className",
|
|
453
|
+
"align",
|
|
454
|
+
"caption",
|
|
455
|
+
"required",
|
|
456
|
+
"selectOnFocus",
|
|
457
|
+
"removeRoundness",
|
|
458
|
+
"inputContainerRef",
|
|
459
|
+
"removeBorder",
|
|
460
|
+
"wrapperClassName",
|
|
461
|
+
"focus"
|
|
462
|
+
]);
|
|
463
|
+
const attributes = {
|
|
464
|
+
"data-error": error && !focus || null,
|
|
465
|
+
"data-focus": focus || null
|
|
466
|
+
};
|
|
467
|
+
const inputRef = (0, import_react.useRef)(null);
|
|
468
|
+
(0, import_react.useEffect)(() => {
|
|
469
|
+
var _a2;
|
|
470
|
+
const input = inputRef.current;
|
|
471
|
+
const focusHandler = () => {
|
|
472
|
+
input == null ? void 0 : input.select();
|
|
473
|
+
};
|
|
474
|
+
if (selectOnFocus) {
|
|
475
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.addEventListener("focus", focusHandler);
|
|
476
|
+
return () => {
|
|
477
|
+
input == null ? void 0 : input.removeEventListener("focus", focusHandler);
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
}, [selectOnFocus]);
|
|
481
|
+
const inputBaseClass = (0, import_clsx5.default)(
|
|
482
|
+
"w-full",
|
|
483
|
+
"flex flex-row items-center",
|
|
484
|
+
"bg-background-action-secondary-normal caret-icon-on-action-secondary-normal",
|
|
485
|
+
componentGap,
|
|
486
|
+
baseTransition,
|
|
487
|
+
"outline-transparent outline-2 -outline-offset-2",
|
|
488
|
+
componentPaddingMinusBorder,
|
|
489
|
+
!removeRoundness && "rounded-base",
|
|
490
|
+
!removeBorder && "border border-border-primary-normal",
|
|
491
|
+
"relative"
|
|
492
|
+
);
|
|
493
|
+
const inputFocusClass = (0, import_clsx5.default)(
|
|
494
|
+
"has-[[data-focus]]:border-transparent has-[[data-focus]]:outline-border-primary-focus focus-within:border-transparent focus-within:outline-border-primary-focus"
|
|
495
|
+
);
|
|
496
|
+
const inputDisabledClass = (0, import_clsx5.default)(
|
|
497
|
+
"has-disabled:bg-background-action-secondary-disabled"
|
|
498
|
+
);
|
|
499
|
+
const inputReadOnlyClass = (0, import_clsx5.default)(
|
|
500
|
+
"has-[input:not(:disabled):read-only]:outline-none has-[input:not(:disabled):read-only]:bg-transparent has-[input:not(:disabled):read-only]:border-transparent has-[input:not(:disabled):read-only]:pl-0"
|
|
501
|
+
);
|
|
502
|
+
const inputInvalidClass = (0, import_clsx5.default)(
|
|
503
|
+
"has-[[data-error]]:border-transparent has-[[data-error]]:not-focus-within:outline-border-primary-error has-[[data-error]]:not-focus-within:outline-1"
|
|
504
|
+
);
|
|
505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
506
|
+
"label",
|
|
507
|
+
{
|
|
508
|
+
ref: inputContainerRef,
|
|
509
|
+
className: (0, import_clsx5.default)(
|
|
510
|
+
"w-full flex flex-col",
|
|
511
|
+
"block",
|
|
512
|
+
"text-text-primary-normal has-disabled:text-text-primary-disabled",
|
|
513
|
+
componentGap
|
|
514
|
+
),
|
|
515
|
+
style: __spreadValues({}, props.style),
|
|
516
|
+
children: [
|
|
517
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: (0, import_clsx5.default)("flex items-center", componentGap), children: [
|
|
518
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
519
|
+
Label,
|
|
520
|
+
{
|
|
521
|
+
className: (0, import_clsx5.default)(
|
|
522
|
+
props.disabled || props.readOnly ? "cursor-default" : "cursor-pointer"
|
|
523
|
+
),
|
|
524
|
+
children: label
|
|
525
|
+
}
|
|
526
|
+
),
|
|
527
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
528
|
+
"span",
|
|
529
|
+
{
|
|
530
|
+
className: (0, import_clsx5.default)(typography.label, "text-text-critical-normal"),
|
|
531
|
+
children: "*"
|
|
532
|
+
}
|
|
533
|
+
)
|
|
534
|
+
] }),
|
|
535
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
536
|
+
"div",
|
|
537
|
+
{
|
|
538
|
+
className: (0, import_clsx5.default)(
|
|
539
|
+
inputBaseClass,
|
|
540
|
+
!props.disabled && inputInvalidClass,
|
|
541
|
+
inputFocusClass,
|
|
542
|
+
inputDisabledClass,
|
|
543
|
+
inputReadOnlyClass,
|
|
544
|
+
wrapperClassName
|
|
545
|
+
),
|
|
546
|
+
children: [
|
|
547
|
+
before,
|
|
548
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
549
|
+
"input",
|
|
550
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
551
|
+
ref: (el) => {
|
|
552
|
+
inputRef.current = el;
|
|
553
|
+
},
|
|
554
|
+
type,
|
|
555
|
+
required
|
|
556
|
+
}, props), attributes), {
|
|
557
|
+
id: props.id,
|
|
558
|
+
className: (0, import_clsx5.default)(
|
|
559
|
+
"flex-1 outline-none w-full max-w-full min-h-6 min-w-0",
|
|
560
|
+
"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
|
|
561
|
+
"placeholder:text-text-secondary-normal disabled:text-text-secondary-disabled",
|
|
562
|
+
align === "right" && "text-right",
|
|
563
|
+
align === "center" && "text-center",
|
|
564
|
+
componentPaddingXUsingComponentGap,
|
|
565
|
+
typography.paragraph,
|
|
566
|
+
className,
|
|
567
|
+
props.readOnly && !props.disabled && "!px-0"
|
|
568
|
+
)
|
|
569
|
+
})
|
|
570
|
+
),
|
|
571
|
+
after
|
|
572
|
+
]
|
|
573
|
+
}
|
|
574
|
+
),
|
|
575
|
+
caption
|
|
576
|
+
]
|
|
577
|
+
}
|
|
578
|
+
);
|
|
579
|
+
};
|
|
580
|
+
var Input = (_a) => {
|
|
581
|
+
var _b = _a, {
|
|
582
|
+
variant = "default",
|
|
583
|
+
decimals,
|
|
584
|
+
uom,
|
|
585
|
+
removeSearchIcon,
|
|
586
|
+
value: propValue,
|
|
587
|
+
onChange,
|
|
588
|
+
onBlur,
|
|
589
|
+
onClear
|
|
590
|
+
} = _b, props = __objRest(_b, [
|
|
591
|
+
"variant",
|
|
592
|
+
"decimals",
|
|
593
|
+
"uom",
|
|
594
|
+
"removeSearchIcon",
|
|
595
|
+
"value",
|
|
596
|
+
"onChange",
|
|
597
|
+
"onBlur",
|
|
598
|
+
"onClear"
|
|
599
|
+
]);
|
|
600
|
+
const [internalValue, setInternalValue] = (0, import_react.useState)("");
|
|
601
|
+
const [displayValue, setDisplayValue] = (0, import_react.useState)("");
|
|
602
|
+
(0, import_react.useEffect)(() => {
|
|
603
|
+
var _a2;
|
|
604
|
+
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
605
|
+
if (variant === "currency") {
|
|
606
|
+
if (propValue === void 0 || propValue === "" || typeof propValue === "number" && isNaN(propValue)) {
|
|
607
|
+
setInternalValue("");
|
|
608
|
+
setDisplayValue("");
|
|
609
|
+
} else {
|
|
610
|
+
const numValue = typeof propValue === "string" ? parseFloat(propValue) : propValue;
|
|
611
|
+
if (!isNaN(numValue)) {
|
|
612
|
+
const formatted = numValue.toFixed(decimals != null ? decimals : 2);
|
|
613
|
+
setInternalValue(formatted);
|
|
614
|
+
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
} else {
|
|
618
|
+
setInternalValue(stringValue);
|
|
619
|
+
setDisplayValue(stringValue);
|
|
620
|
+
}
|
|
621
|
+
}, [propValue, decimals, variant]);
|
|
622
|
+
const getInputProps = () => {
|
|
623
|
+
var _a2;
|
|
624
|
+
const baseProps = __spreadProps(__spreadValues(__spreadValues({}, props), getDecimalPlaceholder(decimals)), {
|
|
625
|
+
value: propValue
|
|
626
|
+
});
|
|
627
|
+
switch (variant) {
|
|
628
|
+
case "search":
|
|
629
|
+
return __spreadProps(__spreadValues({}, baseProps), {
|
|
630
|
+
placeholder: (_a2 = props.placeholder) != null ? _a2 : "Search",
|
|
631
|
+
className: "!mr-6",
|
|
632
|
+
value: displayValue
|
|
633
|
+
});
|
|
634
|
+
case "finder":
|
|
635
|
+
return baseProps;
|
|
636
|
+
case "currency":
|
|
637
|
+
return __spreadProps(__spreadValues({}, baseProps), {
|
|
638
|
+
align: "right",
|
|
639
|
+
type: "text",
|
|
640
|
+
value: displayValue
|
|
641
|
+
});
|
|
642
|
+
case "percentage":
|
|
643
|
+
case "uom":
|
|
644
|
+
return __spreadProps(__spreadValues({}, baseProps), {
|
|
645
|
+
type: "number",
|
|
646
|
+
align: "right"
|
|
647
|
+
});
|
|
648
|
+
default:
|
|
649
|
+
return baseProps;
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
const getBeforeElement = () => {
|
|
653
|
+
if (props.before) return props.before;
|
|
654
|
+
switch (variant) {
|
|
655
|
+
case "search":
|
|
656
|
+
return !removeSearchIcon ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "search" }) }) : null;
|
|
657
|
+
case "currency":
|
|
658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "attach_money" }) });
|
|
659
|
+
default:
|
|
660
|
+
return null;
|
|
661
|
+
}
|
|
662
|
+
};
|
|
663
|
+
const getAfterElement = () => {
|
|
664
|
+
if (props.after) return props.after;
|
|
665
|
+
switch (variant) {
|
|
666
|
+
case "search": {
|
|
667
|
+
const hasValue = displayValue.length > 0;
|
|
668
|
+
return hasValue && !props.readOnly ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
669
|
+
Icon,
|
|
670
|
+
{
|
|
671
|
+
name: "close",
|
|
672
|
+
onClick: handleSearchReset,
|
|
673
|
+
className: "cursor-pointer absolute right-2 bottom-2/4 translate-y-2/4"
|
|
674
|
+
}
|
|
675
|
+
) : null;
|
|
676
|
+
}
|
|
677
|
+
case "finder":
|
|
678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "search" });
|
|
679
|
+
case "uom":
|
|
680
|
+
return uom ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-text-secondary-normal uppercase", children: uom.slice(0, 4) }) : null;
|
|
681
|
+
case "percentage":
|
|
682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "percent" }) });
|
|
683
|
+
default:
|
|
684
|
+
return null;
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
const handleSearchReset = () => {
|
|
688
|
+
setInternalValue("");
|
|
689
|
+
setDisplayValue("");
|
|
690
|
+
if (onChange) {
|
|
691
|
+
const syntheticEvent = {
|
|
692
|
+
target: { value: "" }
|
|
693
|
+
};
|
|
694
|
+
if (typeof onChange === "function") {
|
|
695
|
+
onChange(syntheticEvent);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
onClear == null ? void 0 : onClear();
|
|
699
|
+
};
|
|
700
|
+
const handleChange = (e) => {
|
|
701
|
+
const rawValue = e.target.value;
|
|
702
|
+
if (variant === "search") {
|
|
703
|
+
setInternalValue(rawValue);
|
|
704
|
+
setDisplayValue(rawValue);
|
|
705
|
+
if (typeof onChange === "function") {
|
|
706
|
+
onChange(e);
|
|
707
|
+
}
|
|
708
|
+
return;
|
|
709
|
+
}
|
|
710
|
+
if (variant === "currency") {
|
|
711
|
+
const raw = rawValue.replace(/,/g, "");
|
|
712
|
+
if (raw === "") {
|
|
713
|
+
setInternalValue("");
|
|
714
|
+
setDisplayValue("");
|
|
715
|
+
if (onChange) {
|
|
716
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
717
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: "" })
|
|
718
|
+
});
|
|
719
|
+
onChange(syntheticEvent);
|
|
720
|
+
}
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
const regex = /^\d*\.?\d*$/;
|
|
724
|
+
if (!regex.test(raw)) return;
|
|
725
|
+
const parts = raw.split(".");
|
|
726
|
+
const currentDecimals = decimals != null ? decimals : 2;
|
|
727
|
+
if (parts.length === 2 && parts[1].length > currentDecimals) return;
|
|
728
|
+
setInternalValue(raw);
|
|
729
|
+
setDisplayValue(formatCurrencyDisplay(raw));
|
|
730
|
+
const asNumber = Number(raw);
|
|
731
|
+
if (!isNaN(asNumber) && onChange) {
|
|
732
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
733
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
734
|
+
});
|
|
735
|
+
onChange(syntheticEvent);
|
|
736
|
+
}
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
739
|
+
setInternalValue(rawValue);
|
|
740
|
+
setDisplayValue(rawValue);
|
|
741
|
+
if (typeof onChange === "function") {
|
|
742
|
+
onChange(e);
|
|
743
|
+
}
|
|
744
|
+
};
|
|
745
|
+
const handleBlur = (e) => {
|
|
746
|
+
if (variant === "currency") {
|
|
747
|
+
const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
|
|
748
|
+
setInternalValue(formatted);
|
|
749
|
+
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
750
|
+
const asNumber = Number(formatted);
|
|
751
|
+
if (!isNaN(asNumber) && onChange) {
|
|
752
|
+
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
753
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
754
|
+
});
|
|
755
|
+
onChange(syntheticEvent);
|
|
756
|
+
}
|
|
757
|
+
} else if (variant === "uom" || variant === "percentage") {
|
|
758
|
+
const formattedValue = formatDecimalValue(e.target.value, decimals);
|
|
759
|
+
e.target.value = formattedValue;
|
|
760
|
+
}
|
|
761
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
762
|
+
};
|
|
763
|
+
const inputProps = getInputProps();
|
|
764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
765
|
+
InputBase,
|
|
766
|
+
__spreadProps(__spreadValues({}, inputProps), {
|
|
767
|
+
before: getBeforeElement(),
|
|
768
|
+
after: getAfterElement(),
|
|
769
|
+
onChange: handleChange,
|
|
770
|
+
onBlur: handleBlur
|
|
771
|
+
})
|
|
772
|
+
);
|
|
773
|
+
};
|
|
774
|
+
Input.displayName = "Input";
|
|
775
|
+
var Finder = (props) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Input, __spreadProps(__spreadValues({}, props), { variant: "finder" }));
|
|
776
|
+
var UOM = (props) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Input, __spreadProps(__spreadValues({}, props), { variant: "uom" }));
|
|
777
|
+
var Currency = (props) => {
|
|
778
|
+
var _a;
|
|
779
|
+
const handleCurrencyChange = (e) => {
|
|
780
|
+
var _a2;
|
|
781
|
+
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, e);
|
|
782
|
+
};
|
|
783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
784
|
+
Input,
|
|
785
|
+
__spreadProps(__spreadValues({}, props), {
|
|
786
|
+
variant: "currency",
|
|
787
|
+
decimals: (_a = props.decimals) != null ? _a : 2,
|
|
788
|
+
onChange: handleCurrencyChange
|
|
789
|
+
})
|
|
790
|
+
);
|
|
791
|
+
};
|
|
792
|
+
var Percentage = (props) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Input, __spreadProps(__spreadValues({}, props), { variant: "percentage" }));
|
|
793
|
+
Finder.displayName = "Finder";
|
|
794
|
+
UOM.displayName = "UOM";
|
|
795
|
+
Currency.displayName = "Currency";
|
|
796
|
+
Percentage.displayName = "Percentage";
|
|
797
|
+
|
|
798
|
+
// src/components/Stepper.tsx
|
|
799
|
+
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
800
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
801
|
+
var Stepper = (_a) => {
|
|
802
|
+
var _b = _a, {
|
|
803
|
+
error,
|
|
804
|
+
disabled,
|
|
805
|
+
value,
|
|
806
|
+
setValue,
|
|
807
|
+
onDecrease,
|
|
808
|
+
onIncrease
|
|
809
|
+
} = _b, props = __objRest(_b, [
|
|
810
|
+
"error",
|
|
811
|
+
"disabled",
|
|
812
|
+
"value",
|
|
813
|
+
"setValue",
|
|
814
|
+
"onDecrease",
|
|
815
|
+
"onIncrease"
|
|
816
|
+
]);
|
|
817
|
+
function handleIncrease() {
|
|
818
|
+
setValue((prevVal) => prevVal + 1);
|
|
819
|
+
onIncrease == null ? void 0 : onIncrease();
|
|
820
|
+
}
|
|
821
|
+
function handleDecrease() {
|
|
822
|
+
setValue((prevVal) => prevVal - 1);
|
|
823
|
+
onDecrease == null ? void 0 : onDecrease();
|
|
824
|
+
}
|
|
825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-desktop-component-gap", children: [
|
|
826
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
827
|
+
Button,
|
|
828
|
+
{
|
|
829
|
+
iconOnly: true,
|
|
830
|
+
variant: "tertiary",
|
|
831
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
832
|
+
"span",
|
|
833
|
+
{
|
|
834
|
+
className: (0, import_clsx6.default)(
|
|
835
|
+
!disabled || value > 0 && "text-icon-action-primary-normal",
|
|
836
|
+
disabled || value === 0 && "text-icon-action-primary-disabled",
|
|
837
|
+
"contents"
|
|
838
|
+
),
|
|
839
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "remove" })
|
|
840
|
+
}
|
|
841
|
+
),
|
|
842
|
+
onClick: handleDecrease,
|
|
843
|
+
disabled: disabled || value === 0
|
|
844
|
+
}
|
|
845
|
+
),
|
|
846
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
847
|
+
InputBase,
|
|
848
|
+
__spreadProps(__spreadValues({}, props), {
|
|
849
|
+
id: props.id,
|
|
850
|
+
type: "number",
|
|
851
|
+
align: "center",
|
|
852
|
+
value,
|
|
853
|
+
onChange: (e) => setValue(+e.target.value),
|
|
854
|
+
error,
|
|
855
|
+
disabled,
|
|
856
|
+
className: "!w-6 !h-4.5 !px-0 disabled:!text-text-on-action-primary-disabled disabled:!bg-background-action-secondary-disabled disabled:!border-border-primary-normal"
|
|
857
|
+
})
|
|
858
|
+
) }),
|
|
859
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
860
|
+
Button,
|
|
861
|
+
{
|
|
862
|
+
iconOnly: true,
|
|
863
|
+
variant: "tertiary",
|
|
864
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
865
|
+
"span",
|
|
866
|
+
{
|
|
867
|
+
className: (0, import_clsx6.default)(
|
|
868
|
+
!disabled && "text-icon-action-primary-normal",
|
|
869
|
+
disabled && "text-icon-action-primary-disabled",
|
|
870
|
+
"contents"
|
|
871
|
+
),
|
|
872
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "add" })
|
|
873
|
+
}
|
|
874
|
+
),
|
|
875
|
+
onClick: handleIncrease,
|
|
876
|
+
disabled
|
|
877
|
+
}
|
|
878
|
+
)
|
|
879
|
+
] });
|
|
880
|
+
};
|
|
881
|
+
Stepper.displayName = "Stepper";
|
|
882
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
883
|
+
0 && (module.exports = {
|
|
884
|
+
Stepper
|
|
885
|
+
});
|