@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
|
Binary file
|
package/dist/types.cjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/types.ts
|
|
17
|
+
var types_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(types_exports);
|
package/dist/types.js
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dmsi/wedgekit-react",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.0.2",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsup",
|
|
8
|
+
"dev": "tsup --watch",
|
|
9
|
+
"lint": "eslint . --max-warnings 0",
|
|
10
|
+
"fmt": "prettier --write src/**/*.{ts,tsx,css,json}"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"src"
|
|
15
|
+
],
|
|
16
|
+
"exports": {
|
|
17
|
+
"./components/*": {
|
|
18
|
+
"types": "./src/components/*.tsx",
|
|
19
|
+
"import": "./dist/components/*.js",
|
|
20
|
+
"require": "./dist/components/*.cjs"
|
|
21
|
+
},
|
|
22
|
+
"./types": {
|
|
23
|
+
"types": "./src/types.ts",
|
|
24
|
+
"import": "./dist/types.js",
|
|
25
|
+
"require": "./dist/types.cjs"
|
|
26
|
+
},
|
|
27
|
+
"./styles.css": "./dist/index.css",
|
|
28
|
+
"./fonts.css": "./dist/fonts.css",
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@dmsi/wedgekit-react": "*",
|
|
33
|
+
"@dnd-kit/core": "^6.3.1",
|
|
34
|
+
"@dnd-kit/modifiers": "^9.0.0",
|
|
35
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
36
|
+
"@headlessui/react": "^2.2.4",
|
|
37
|
+
"@js-temporal/polyfill": "^0.5.1",
|
|
38
|
+
"@tanstack/react-table": "^8.21.3",
|
|
39
|
+
"@tanstack/react-virtual": "^3.13.12",
|
|
40
|
+
"clsx": "^2.1.1",
|
|
41
|
+
"react-use": "^17.6.0"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"react": "^19.1.0",
|
|
45
|
+
"react-dom": "^19.1.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@tailwindcss/postcss": "^4.1.11",
|
|
49
|
+
"@types/react": "^19.1.8",
|
|
50
|
+
"@types/react-dom": "^19.1.6",
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^8.35.1",
|
|
52
|
+
"eslint": "^9.30.1",
|
|
53
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
54
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
55
|
+
"prettier": "^3.6.2",
|
|
56
|
+
"react": "^19.1.0",
|
|
57
|
+
"react-dom": "^19.1.0",
|
|
58
|
+
"tailwindcss": "^4.1.11",
|
|
59
|
+
"tsup": "^8.5.0",
|
|
60
|
+
"typescript": "5.8.3"
|
|
61
|
+
},
|
|
62
|
+
"optionalDependencies": {
|
|
63
|
+
"@rollup/rollup-linux-x64-gnu": "4.42.0",
|
|
64
|
+
"lightningcss-linux-x64-gnu": "1.30.1"
|
|
65
|
+
}
|
|
66
|
+
}
|
package/src/brand.css
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
[data-theme="brand"] {
|
|
2
|
+
--color-text-primary-normal: var(--color-neutral-000);
|
|
3
|
+
|
|
4
|
+
--color-text-primary-disabled: var(--color-neutral-400);
|
|
5
|
+
--color-text-primary-error: var(--color-critical-200);
|
|
6
|
+
|
|
7
|
+
--color-text-secondary-normal: var(--color-neutral-200);
|
|
8
|
+
--color-text-secondary-disabled: var(--color-neutral-400);
|
|
9
|
+
--color-text-secondary-error: var(--color-critical-200);
|
|
10
|
+
|
|
11
|
+
--color-text-success-normal: var(--color-success-200);
|
|
12
|
+
--color-text-success-disabled: var(--color-neutral-300);
|
|
13
|
+
--color-text-success-error: var(--color-critical-200);
|
|
14
|
+
|
|
15
|
+
--color-text-warning-normal: var(--color-warning-200);
|
|
16
|
+
--color-text-warning-disabled: var(--color-neutral-300);
|
|
17
|
+
--color-text-warning-error: var(--color-critical-200);
|
|
18
|
+
|
|
19
|
+
--color-text-link-normal: var(--color-link-000);
|
|
20
|
+
--color-text-link-hover: var(--color-brand-200);
|
|
21
|
+
--color-text-link-active: var(--color-brand-200);
|
|
22
|
+
--color-text-link-disabled: var(--color-neutral-400);
|
|
23
|
+
|
|
24
|
+
--color-border-primary-normal: var(--color-brand-200);
|
|
25
|
+
--color-border-primary-focus: var(--color-neutral-000);
|
|
26
|
+
--color-border-primary-error: var(--color-critical-300);
|
|
27
|
+
|
|
28
|
+
--color-icon-primary-normal: var(--color-brand-200);
|
|
29
|
+
--color-icon-primary-disabled: var(--color-neutral-400);
|
|
30
|
+
|
|
31
|
+
--color-icon-success-normal: var(--color-success-400);
|
|
32
|
+
--color-icon-success-disabled: var(--color-neutral-400);
|
|
33
|
+
|
|
34
|
+
--color-icon-warning-normal: var(--color-warning-400);
|
|
35
|
+
--color-icon-warning-disabled: var(--color-neutral-400);
|
|
36
|
+
|
|
37
|
+
--color-icon-critical-normal: var(--color-critical-400);
|
|
38
|
+
--color-icon-critical-disabled: var(--color-neutral-400);
|
|
39
|
+
|
|
40
|
+
--color-background-primary-normal: var(--color-brand-400);
|
|
41
|
+
--color-background-grouped-primary-normal: var(--color-brand-400);
|
|
42
|
+
--color-background-secondary-normal: var(--color-brand-500);
|
|
43
|
+
--color-background-grouped-secondary-normal: var(--color-brand-500);
|
|
44
|
+
--color-background-success-normal: var(--color-success-400);
|
|
45
|
+
--color-background-warning-normal: var(--color-warning-400);
|
|
46
|
+
--color-background-critical-normal: var(--color-critical-400);
|
|
47
|
+
|
|
48
|
+
--color-text-action-primary-normal: var(--color-action-000);
|
|
49
|
+
--color-text-action-primary-hover: var(--color-brand-200);
|
|
50
|
+
--color-text-action-primary-active: var(--color-brand-200);
|
|
51
|
+
--color-text-action-primary-disabled: var(--color-neutral-400);
|
|
52
|
+
|
|
53
|
+
--color-text-on-action-primary-normal: var(--color-brand-400);
|
|
54
|
+
--color-text-on-action-primary-hover: var(--color-brand-200);
|
|
55
|
+
--color-text-on-action-primary-active: var(--color-brand-200);
|
|
56
|
+
--color-text-on-action-primary-disabled: var(--color-neutral-400);
|
|
57
|
+
|
|
58
|
+
--color-text-action-critical-normal: var(--color-critical-200);
|
|
59
|
+
--color-text-action-critical-hover: var(--color-critical-300);
|
|
60
|
+
--color-text-action-critical-active: var(--color-critical-200);
|
|
61
|
+
--color-text-action-critical-disabled: var(--color-neutral-400);
|
|
62
|
+
|
|
63
|
+
--color-border-action-normal: var(--color-neutral-000);
|
|
64
|
+
--color-border-action-hover: var(--color-brand-200);
|
|
65
|
+
--color-border-action-active: var(--color-brand-200);
|
|
66
|
+
--color-border-action-disabled: var(--color-neutral-200);
|
|
67
|
+
|
|
68
|
+
--color-text-critical-normal: var(--color-critical-200);
|
|
69
|
+
--color-text-critical-disabled: var(--color-neutral-300);
|
|
70
|
+
--color-text-critical-error: var(--color-critical-200);
|
|
71
|
+
|
|
72
|
+
--color-border-action-critical-normal: var(--color-critical-200);
|
|
73
|
+
--color-border-action-critical-hover: var(--color-critical-300);
|
|
74
|
+
--color-border-action-critical-active: var(--color-critical-200);
|
|
75
|
+
--color-border-action-critical-disabled: var(--color-neutral-200);
|
|
76
|
+
|
|
77
|
+
--color-icon-action-primary-normal: var(--color-neutral-000);
|
|
78
|
+
--color-icon-action-primary-hover: var(--color-brand-200);
|
|
79
|
+
--color-icon-action-primary-active: var(--color-brand-100);
|
|
80
|
+
--color-icon-action-primary-disabled: var(--color-neutral-300);
|
|
81
|
+
|
|
82
|
+
--color-icon-action-secondary-normal: var(--color-neutral-000);
|
|
83
|
+
--color-icon-action-secondary-hover: var(--color-brand-200);
|
|
84
|
+
--color-icon-action-secondary-active: var(--color-brand-200);
|
|
85
|
+
--color-icon-action-secondary-disabled: var(--color-neutral-400);
|
|
86
|
+
|
|
87
|
+
--color-icon-on-action-primary-normal: var(--color-brand-400);
|
|
88
|
+
--color-icon-on-action-primary-hover: var(--color-brand-500);
|
|
89
|
+
--color-icon-on-action-primary-active: var(--color-brand-300);
|
|
90
|
+
--color-icon-on-action-primary-disabled: var(--color-neutral-400);
|
|
91
|
+
|
|
92
|
+
--color-icon-action-critical-normal: var(--color-critical-200);
|
|
93
|
+
--color-icon-action-critical-hover: var(--color-critical-300);
|
|
94
|
+
--color-icon-action-critical-active: var(--color-critical-200);
|
|
95
|
+
--color-icon-action-critical-disabled: var(--color-neutral-400);
|
|
96
|
+
|
|
97
|
+
--color-icon-brand-primary-normal: var(--color-neutral-000);
|
|
98
|
+
--color-icon-brand-primary-hover: var(--color-brand-200);
|
|
99
|
+
--color-icon-brand-primary-active: var(--color-neutral-000);
|
|
100
|
+
--color-icon-brand-primary-disabled: var(--color-neutral-300);
|
|
101
|
+
|
|
102
|
+
--color-background-action-primary-normal: var(--color-action-000);
|
|
103
|
+
--color-background-action-primary-hover: var(--color-brand-200);
|
|
104
|
+
--color-background-action-primary-active: var(--color-neutral-000);
|
|
105
|
+
--color-background-action-primary-disabled: var(--color-neutral-200);
|
|
106
|
+
|
|
107
|
+
--color-background-action-secondary-normal: var(--color-brand-400);
|
|
108
|
+
--color-background-action-secondary-hover: var(--color-brand-500);
|
|
109
|
+
--color-background-action-secondary-active: var(--color-brand-400);
|
|
110
|
+
--color-background-action-secondary-disabled: var(--color-neutral-200);
|
|
111
|
+
|
|
112
|
+
--color-background-brand-normal: var(--color-brand-400);
|
|
113
|
+
|
|
114
|
+
--color-background-action-critical-primary-normal: var(--color-critical-400);
|
|
115
|
+
--color-background-action-critical-primary-hover: var(--color-critical-500);
|
|
116
|
+
--color-background-action-critical-primary-active: var(--color-critical-300);
|
|
117
|
+
--color-background-action-critical-primary-disabled: var(--color-neutral-200);
|
|
118
|
+
|
|
119
|
+
--color-background-action-critical-secondary-normal: var(--color-brand-400);
|
|
120
|
+
--color-background-action-critical-secondary-hover: var(--color-brand-500);
|
|
121
|
+
--color-background-action-critical-secondary-active: var(--color-brand-400);
|
|
122
|
+
--color-background-action-critical-secondary-disabled: var(
|
|
123
|
+
--color-neutral-200
|
|
124
|
+
);
|
|
125
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
|
|
3
|
+
export const typography = {
|
|
4
|
+
display1: clsx(
|
|
5
|
+
"font-sans font-semibold",
|
|
6
|
+
"text-display-1-mobile desktop:text-display-1-desktop compact:text-display-1-desktop-compact",
|
|
7
|
+
"leading-display-1-mobile desktop:leading-display-1-desktop",
|
|
8
|
+
),
|
|
9
|
+
|
|
10
|
+
display2: clsx(
|
|
11
|
+
"font-sans font-bold",
|
|
12
|
+
"text-display-2-mobile desktop:text-display-2-desktop compact:text-display-2-desktop-compact",
|
|
13
|
+
"leading-display-2-mobile desktop:leading-display-2-desktop",
|
|
14
|
+
),
|
|
15
|
+
|
|
16
|
+
heading1: clsx(
|
|
17
|
+
"font-sans font-semibold",
|
|
18
|
+
"text-heading-1-mobile desktop:text-heading-1-desktop compact:text-heading-1-desktop-compact",
|
|
19
|
+
"leading-heading-1-mobile desktop:leading-heading-1-desktop",
|
|
20
|
+
),
|
|
21
|
+
|
|
22
|
+
heading2: clsx(
|
|
23
|
+
"font-sans font-normal",
|
|
24
|
+
"text-heading-2-mobile desktop:text-heading-2-desktop compact:text-heading-2-desktop-compact",
|
|
25
|
+
"leading-heading-2-mobile desktop:leading-heading-2-desktop",
|
|
26
|
+
),
|
|
27
|
+
|
|
28
|
+
heading3: clsx(
|
|
29
|
+
"font-sans font-semibold",
|
|
30
|
+
"text-heading-3-mobile desktop:text-heading-3-desktop compact:text-heading-3-desktop-compact",
|
|
31
|
+
"leading-heading-3-mobile desktop:leading-heading-3-desktop",
|
|
32
|
+
),
|
|
33
|
+
|
|
34
|
+
subheader: clsx(
|
|
35
|
+
"font-sans font-semibold",
|
|
36
|
+
"text-subheader-mobile desktop:text-subheader-desktop compact:text-subheader-desktop-compact",
|
|
37
|
+
"leading-subheader-mobile desktop:leading-subheader-desktop",
|
|
38
|
+
),
|
|
39
|
+
|
|
40
|
+
link: clsx(
|
|
41
|
+
"font-sans font-normal",
|
|
42
|
+
"text-link-mobile desktop:text-link-desktop compact:text-link-desktop-compact",
|
|
43
|
+
"leading-link-mobile desktop:leading-link-desktop",
|
|
44
|
+
),
|
|
45
|
+
buttonLabel: clsx(
|
|
46
|
+
"font-sans font-semibold",
|
|
47
|
+
"text-label-mobile desktop:text-label-desktop compact:text-label-desktop-compact",
|
|
48
|
+
"leading-label-mobile desktop:leading-label-desktop",
|
|
49
|
+
),
|
|
50
|
+
|
|
51
|
+
label: clsx(
|
|
52
|
+
"font-sans font-semibold",
|
|
53
|
+
"text-label-mobile desktop:text-label-desktop compact:text-label-desktop-compact",
|
|
54
|
+
"leading-label-mobile desktop:leading-label-desktop",
|
|
55
|
+
),
|
|
56
|
+
|
|
57
|
+
paragraph: clsx(
|
|
58
|
+
"font-sans font-normal",
|
|
59
|
+
"text-paragraph-mobile desktop:text-paragraph-desktop compact:text-paragraph-desktop-compact",
|
|
60
|
+
"leading-paragraph-mobile desktop:leading-paragraph-desktop",
|
|
61
|
+
),
|
|
62
|
+
|
|
63
|
+
caption: clsx(
|
|
64
|
+
"font-sans font-normal",
|
|
65
|
+
"text-caption-mobile desktop:text-caption-desktop compact:text-caption-desktop-compact",
|
|
66
|
+
"leading-caption-mobile desktop:leading-caption-desktop",
|
|
67
|
+
),
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const baseTransition = clsx(
|
|
71
|
+
"transition-colors duration-100 ease-in-out",
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
export const componentGap = clsx(
|
|
75
|
+
"gap-mobile-component-gap desktop:gap-desktop-component-gap compact:gap-desktop-compact-component-gap",
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
export const paddingUsingComponentGap = clsx(
|
|
79
|
+
"p-mobile-component-gap desktop:p-desktop-component-gap compact:p-desktop-compact-component-gap",
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
export const paddingYUsingLayoutGroupGap = clsx(
|
|
83
|
+
"py-mobile-layout-group-gap desktop:py-desktop-layout-group-gap compact:py-desktop-compact-layout-group-gap",
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
export const componentPadding = clsx(
|
|
87
|
+
"p-mobile-component-padding desktop:p-desktop-component-padding compact:p-desktop-compact-component-padding",
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
export const componentPaddingBottom = clsx(
|
|
91
|
+
"pb-mobile-component-padding desktop:pb-desktop-component-padding compact:pb-desktop-compact-component-padding",
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
export const componentPaddingY = clsx(
|
|
95
|
+
"py-mobile-component-padding desktop:py-desktop-component-padding compact:py-desktop-compact-component-padding",
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
export const componentPaddingXUsingComponentGap = clsx(
|
|
99
|
+
"px-mobile-component-gap desktop:px-desktop-component-gap compact:px-desktop-compact-component-gap",
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
export const componentPaddingYUsingComponentGap = clsx(
|
|
103
|
+
"py-mobile-component-gap desktop:py-desktop-component-gap compact:py-desktop-compact-component-gap",
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
export const componentPaddingMinusBorder = clsx(
|
|
107
|
+
"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)]",
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
export const componentPaddingMinus2pxBorder = clsx(
|
|
111
|
+
"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)]",
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
export const layoutPaddingBottom = clsx(
|
|
115
|
+
"pb-mobile-layout-padding desktop:pb-desktop-layout-padding compact:pb-desktop-compact-layout-padding",
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
export const layoutPaddingY = clsx(
|
|
119
|
+
"py-mobile-layout-padding desktop:py-desktop-layout-padding compact:py-desktop-compact-layout-padding",
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
export const containerPaddingX = clsx(
|
|
123
|
+
"px-mobile-container-padding desktop:px-desktop-container-padding compact:px-desktop-compact-container-padding",
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
export const containerPaddingY = clsx(
|
|
127
|
+
"py-mobile-container-padding desktop:py-desktop-container-padding compact:py-desktop-compact-container-padding",
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
export const layoutGroupGapPaddingY = clsx(
|
|
131
|
+
"py-mobile-layout-group-gap desktop:py-desktop-layout-group-gap compact:py-desktop-compact-layout-group-gap",
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
export const layoutGroupGap = clsx(
|
|
135
|
+
"gap-mobile-layout-group-gap desktop:gap-desktop-layout-group-gap compact:gap-desktop-compact-layout-group-gap",
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
export const layoutGap = clsx(
|
|
139
|
+
"gap-mobile-layout-gap desktop:gap-desktop-layout-gap compact:gap-desktop-compact-layout-gap",
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
export const gapUsingContainerPadding = clsx(
|
|
143
|
+
"gap-mobile-container-padding desktop:gap-desktop-container-padding compact:gap-desktop-compact-container-padding",
|
|
144
|
+
);
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React, { useLayoutEffect, useState } from "react";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { Link } from "./Link";
|
|
6
|
+
|
|
7
|
+
import { Icon } from "./Icon";
|
|
8
|
+
|
|
9
|
+
type BreadcrumbsProps = {
|
|
10
|
+
asCardStyle?: boolean;
|
|
11
|
+
path?: string; // Optional override for SSR / testing
|
|
12
|
+
crumbs: BreadcrumbProps[];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type BreadcrumbProps = {
|
|
16
|
+
href: string;
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
onClick?: () => void; // Optional click handler
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const Breadcrumb = ({ href, children, onClick }: BreadcrumbProps) => {
|
|
22
|
+
const linkPadding = clsx(
|
|
23
|
+
"py-[calc(var(--spacing-mobile-component-padding)_+_3px)] !text-text-link-normal whitespace-nowrap",
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<li key={href} className="flex items-center">
|
|
28
|
+
<Link className={linkPadding} href={href} onClick={onClick}>
|
|
29
|
+
{children}
|
|
30
|
+
</Link>
|
|
31
|
+
</li>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const Chevron = () => (
|
|
36
|
+
<li className="flex items-center">
|
|
37
|
+
<Icon name="chevron_right" size={16} />
|
|
38
|
+
</li>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export const Breadcrumbs = ({
|
|
42
|
+
asCardStyle,
|
|
43
|
+
|
|
44
|
+
crumbs,
|
|
45
|
+
}: BreadcrumbsProps) => {
|
|
46
|
+
const scrollableElement = React.useRef<HTMLElement | null>(null);
|
|
47
|
+
|
|
48
|
+
const [isOverflow, setIsOverflow] = useState(false);
|
|
49
|
+
|
|
50
|
+
useLayoutEffect(() => {
|
|
51
|
+
console.log(scrollableElement.current);
|
|
52
|
+
scrollableElement.current?.scrollTo({
|
|
53
|
+
left: scrollableElement.current?.scrollWidth ?? 0,
|
|
54
|
+
behavior: "instant",
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
updateOverflow();
|
|
58
|
+
// Scroll to the start of the breadcrumbs when the component mounts
|
|
59
|
+
}, [scrollableElement, crumbs]);
|
|
60
|
+
|
|
61
|
+
const updateOverflow = () => {
|
|
62
|
+
if (!scrollableElement.current) return;
|
|
63
|
+
|
|
64
|
+
// Check if the scrollable element has overflow
|
|
65
|
+
setIsOverflow(
|
|
66
|
+
scrollableElement.current.scrollWidth !==
|
|
67
|
+
scrollableElement.current.clientWidth &&
|
|
68
|
+
scrollableElement.current.scrollLeft > 0,
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<nav
|
|
74
|
+
className={clsx(
|
|
75
|
+
"relative select-none flex items-center max-w-full w-full",
|
|
76
|
+
{
|
|
77
|
+
"bg-white rounded-base shadow-4 px-desktop-layout-padding":
|
|
78
|
+
asCardStyle,
|
|
79
|
+
"px-desktop-container-padding": !asCardStyle,
|
|
80
|
+
},
|
|
81
|
+
)}
|
|
82
|
+
aria-label="Breadcrumb"
|
|
83
|
+
>
|
|
84
|
+
<div
|
|
85
|
+
className={clsx(
|
|
86
|
+
isOverflow ? "opacity-100" : "opacity-0",
|
|
87
|
+
"absolute left-6 top-0 h-full w-12 bg-gradient-to-r from-white to-transparent pointer-events-none z-10 transition",
|
|
88
|
+
)}
|
|
89
|
+
/>
|
|
90
|
+
|
|
91
|
+
<ol
|
|
92
|
+
className="flex items-center overflow-x-scroll"
|
|
93
|
+
style={{ scrollbarWidth: "none" }}
|
|
94
|
+
onScroll={updateOverflow}
|
|
95
|
+
ref={(el) => {
|
|
96
|
+
scrollableElement.current = el;
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
{crumbs.map((crumb, index) => {
|
|
100
|
+
const { href, children, onClick } = crumb;
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<React.Fragment key={index}>
|
|
104
|
+
{index > 0 && <Chevron />}
|
|
105
|
+
<Breadcrumb href={href} onClick={onClick}>
|
|
106
|
+
{children}
|
|
107
|
+
</Breadcrumb>
|
|
108
|
+
</React.Fragment>
|
|
109
|
+
);
|
|
110
|
+
})}
|
|
111
|
+
</ol>
|
|
112
|
+
</nav>
|
|
113
|
+
);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
Breadcrumbs.displayName = "Breadcrumbs";
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import { ReactNode, ButtonHTMLAttributes } from "react";
|
|
3
|
+
import {
|
|
4
|
+
baseTransition,
|
|
5
|
+
componentGap,
|
|
6
|
+
componentPaddingMinus2pxBorder,
|
|
7
|
+
componentPaddingXUsingComponentGap,
|
|
8
|
+
paddingUsingComponentGap,
|
|
9
|
+
typography,
|
|
10
|
+
} from "../classNames";
|
|
11
|
+
import { AsProps } from "../types";
|
|
12
|
+
type Tags = "a" | "button" | React.ElementType;
|
|
13
|
+
|
|
14
|
+
type BaseButtonProps = Omit<
|
|
15
|
+
ButtonHTMLAttributes<HTMLButtonElement>,
|
|
16
|
+
"children"
|
|
17
|
+
> & {
|
|
18
|
+
as?: Tags;
|
|
19
|
+
variant?:
|
|
20
|
+
| "primary"
|
|
21
|
+
| "secondary"
|
|
22
|
+
| "tertiary"
|
|
23
|
+
| "primary-critical"
|
|
24
|
+
| "secondary-critical"
|
|
25
|
+
| "tertiary-critical"
|
|
26
|
+
| "navigation";
|
|
27
|
+
iconOnly?: boolean;
|
|
28
|
+
block?: boolean;
|
|
29
|
+
className?: string;
|
|
30
|
+
classNameLabel?: string;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
colorClassName?: string;
|
|
33
|
+
href?: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// At least one of leftIcon, rightIcon, or children must be provided
|
|
37
|
+
type RequireAtLeastOneContent =
|
|
38
|
+
| { leftIcon: ReactNode; rightIcon?: ReactNode; children?: ReactNode }
|
|
39
|
+
| { rightIcon: ReactNode; leftIcon?: ReactNode; children?: ReactNode }
|
|
40
|
+
| { children: ReactNode; leftIcon?: ReactNode; rightIcon?: ReactNode };
|
|
41
|
+
|
|
42
|
+
export type ButtonProps = BaseButtonProps & RequireAtLeastOneContent;
|
|
43
|
+
|
|
44
|
+
export const Button = ({
|
|
45
|
+
variant = "primary",
|
|
46
|
+
as = "button",
|
|
47
|
+
block,
|
|
48
|
+
leftIcon,
|
|
49
|
+
rightIcon,
|
|
50
|
+
className,
|
|
51
|
+
classNameLabel,
|
|
52
|
+
disabled = false,
|
|
53
|
+
children,
|
|
54
|
+
iconOnly = false,
|
|
55
|
+
colorClassName,
|
|
56
|
+
href,
|
|
57
|
+
...props
|
|
58
|
+
}: AsProps<Tags> & ButtonProps) => {
|
|
59
|
+
|
|
60
|
+
const primaryVariantStyles =
|
|
61
|
+
variant === "primary" &&
|
|
62
|
+
clsx(
|
|
63
|
+
colorClassName?.trim()
|
|
64
|
+
? colorClassName
|
|
65
|
+
: "text-text-on-action-primary-normal",
|
|
66
|
+
"bg-background-action-primary-normal border-background-action-primary-normal",
|
|
67
|
+
"hover:bg-background-action-primary-hover hover:border-background-action-primary-hover",
|
|
68
|
+
"focus:bg-background-action-primary-hover focus:border-background-action-primary-hover focus:outline-0",
|
|
69
|
+
"active:bg-background-action-primary-active active:border-background-action-primary-active",
|
|
70
|
+
"disabled:bg-background-action-primary-disabled disabled:border-background-action-primary-disabled disabled:text-text-on-action-primary-disabled",
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
const secondaryVariantStyles =
|
|
74
|
+
variant === "secondary" &&
|
|
75
|
+
clsx(
|
|
76
|
+
colorClassName?.trim()
|
|
77
|
+
? colorClassName
|
|
78
|
+
: "text-text-action-primary-normal",
|
|
79
|
+
"bg-background-action-secondary-normal border-border-action-normal",
|
|
80
|
+
"hover:bg-background-action-secondary-hover hover:border-border-action-hover hover:text-text-action-primary-hover",
|
|
81
|
+
"focus:bg-background-action-secondary-hover focus:border-border-action-hover focus:text-text-action-primary-hover focus:outline-0",
|
|
82
|
+
"active:bg-background-action-secondary-active active:border-border-action-active active:text-text-action-primary-active",
|
|
83
|
+
"disabled:bg-background-action-primary-disabled disabled:border-border-action-disabled disabled:text-text-action-primary-disabled",
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const tertiaryVariantStyles =
|
|
87
|
+
variant === "tertiary" &&
|
|
88
|
+
clsx(
|
|
89
|
+
"bg-transparent border-transparent",
|
|
90
|
+
iconOnly
|
|
91
|
+
? colorClassName?.trim()
|
|
92
|
+
? colorClassName
|
|
93
|
+
: "text-icon-action-primary-normal"
|
|
94
|
+
: colorClassName?.trim()
|
|
95
|
+
? colorClassName
|
|
96
|
+
: "text-text-action-primary-normal",
|
|
97
|
+
"bg-transparent border-transparent",
|
|
98
|
+
"hover:bg-background-action-secondary-hover hover:border-background-action-secondary-hover hover:text-text-action-primary-hover",
|
|
99
|
+
"focus:bg-background-action-secondary-hover focus:border-background-action-secondary-hover focus:text-text-action-primary-hover focus:outline-0",
|
|
100
|
+
"active:bg-background-action-secondary-active active:border-transparent active:text-text-action-primary-active",
|
|
101
|
+
"disabled:bg-transparent disabled:border-transparent disabled:text-text-action-primary-disabled",
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
const primaryCriticalVariantStyles =
|
|
105
|
+
variant === "primary-critical" &&
|
|
106
|
+
clsx(
|
|
107
|
+
colorClassName?.trim()
|
|
108
|
+
? colorClassName
|
|
109
|
+
: "text-text-on-action-primary-normal",
|
|
110
|
+
"bg-background-action-critical-primary-normal border-background-action-critical-primary-normal",
|
|
111
|
+
"hover:bg-background-action-critical-primary-hover hover:border-background-action-critical-primary-hover",
|
|
112
|
+
"focus:bg-background-action-critical-primary-hover focus:border-background-action-critical-primary-hover focus:outline-0",
|
|
113
|
+
"active:bg-background-action-critical-primary-active active:border-background-action-critical-primary-active",
|
|
114
|
+
"disabled:bg-background-action-critical-primary-disabled disabled:border-background-action-critical-primary-disabled disabled:text-text-on-action-primary-disabled",
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
const secondaryCriticalVariantStyles =
|
|
118
|
+
variant === "secondary-critical" &&
|
|
119
|
+
clsx(
|
|
120
|
+
colorClassName?.trim()
|
|
121
|
+
? colorClassName
|
|
122
|
+
: "text-text-action-critical-normal",
|
|
123
|
+
"bg-background-action-critical-secondary-normal border-border-action-critical-normal",
|
|
124
|
+
"hover:bg-background-action-critical-secondary-hover hover:border-border-action-critical-hover hover:text-text-action-critical-hover",
|
|
125
|
+
"focus:bg-background-action-critical-secondary-hover focus:border-border-action-critical-hover focus:text-text-action-critical-hover focus:outline-0",
|
|
126
|
+
"active:bg-background-action-critical-secondary-active active:border-border-action-critical-active active:text-text-action-critical-active",
|
|
127
|
+
"disabled:bg-background-action-critical-disabled disabled:border-border-action-critical-disabled disabled:text-text-action-critical-disabled",
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
const tertiaryCriticalVariantStyles =
|
|
131
|
+
variant === "tertiary-critical" &&
|
|
132
|
+
clsx(
|
|
133
|
+
colorClassName?.trim()
|
|
134
|
+
? colorClassName
|
|
135
|
+
: "text-text-action-critical-normal",
|
|
136
|
+
"bg-transparent border-transparent text-text-action-critical-normal",
|
|
137
|
+
"hover:bg-background-action-critical-secondary-hover hover:border-background-action-critical-secondary-hover hover:text-text-action-critical-hover",
|
|
138
|
+
"focus:bg-background-action-critical-secondary-hover focus:border-background-action-critical-secondary-hover focus:text-text-action-critical-hover focus:outline-0",
|
|
139
|
+
"active:bg-background-action-critical-secondary-active active:border-background-action-critical-secondary-active active:text-text-action-critical-active",
|
|
140
|
+
"disabled:bg-transparent disabled:border-transparent disabled:text-text-action-critical-disabled",
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
const navigationVarianStyles =
|
|
144
|
+
variant === "navigation" &&
|
|
145
|
+
clsx(
|
|
146
|
+
colorClassName?.trim()
|
|
147
|
+
? colorClassName
|
|
148
|
+
: "text-text-on-action-primary-normal",
|
|
149
|
+
"bg-transparent",
|
|
150
|
+
"hover:bg-background-on-action-secondary-hover hover:text-brand-text-action-primary-hover",
|
|
151
|
+
// "hover:bg-background-action-secondary-hover hover:text-text-action-primary-hover", // Will use this once colors are finalized
|
|
152
|
+
"focus:bg-background-on-action-secondary-hover focus:text-brand-text-action-primary-hover focus:outline-0",
|
|
153
|
+
// "focus:bg-background-action-secondary-hover focus:text-text-action-primary-hover", // Will use this once colors are finalized
|
|
154
|
+
"active:bg-background-on-action-secondary-active active:text-brand-text-action-primary-active",
|
|
155
|
+
// "active:bg-background-action-secondary-active active:text-text-action-primary-active", // Will use this once colors are finalized
|
|
156
|
+
"disabled:bg-transparent disabled:text-text-on-action-primary-disabled",
|
|
157
|
+
"flex-col",
|
|
158
|
+
paddingUsingComponentGap,
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
const notNavigationVariantStyles =
|
|
162
|
+
variant !== "navigation" &&
|
|
163
|
+
clsx("border-2 flex-row", componentPaddingMinus2pxBorder, componentGap);
|
|
164
|
+
|
|
165
|
+
const buttonClasses = clsx(
|
|
166
|
+
disabled ? "cursor-default" : "cursor-pointer",
|
|
167
|
+
block ? "w-full" : "w-fit",
|
|
168
|
+
baseTransition,
|
|
169
|
+
"rounded-sm whitespace-nowrap inline-flex items-center justify-center group/btn",
|
|
170
|
+
primaryVariantStyles,
|
|
171
|
+
secondaryVariantStyles,
|
|
172
|
+
tertiaryVariantStyles,
|
|
173
|
+
primaryCriticalVariantStyles,
|
|
174
|
+
secondaryCriticalVariantStyles,
|
|
175
|
+
tertiaryCriticalVariantStyles,
|
|
176
|
+
|
|
177
|
+
navigationVarianStyles,
|
|
178
|
+
notNavigationVariantStyles,
|
|
179
|
+
className,
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
const labelClasses = clsx(
|
|
183
|
+
"min-h-6 flex items-center justify-center",
|
|
184
|
+
classNameLabel,
|
|
185
|
+
componentPaddingXUsingComponentGap,
|
|
186
|
+
typography.buttonLabel,
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
const Element = href ? "a" : as;
|
|
190
|
+
|
|
191
|
+
return (
|
|
192
|
+
<Element
|
|
193
|
+
type={Element === "button" ? "button" : undefined}
|
|
194
|
+
className={buttonClasses}
|
|
195
|
+
{...props}
|
|
196
|
+
disabled={disabled}
|
|
197
|
+
href={href}
|
|
198
|
+
>
|
|
199
|
+
{leftIcon && leftIcon}
|
|
200
|
+
|
|
201
|
+
{!iconOnly && children && (
|
|
202
|
+
<span className={labelClasses}>{children}</span>
|
|
203
|
+
)}
|
|
204
|
+
|
|
205
|
+
{rightIcon && rightIcon}
|
|
206
|
+
</Element>
|
|
207
|
+
);
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
Button.displayName = "Button";
|