@drivenets/design-system 0.0.1
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/CHANGELOG.md +9 -0
- package/LICENSE +201 -0
- package/dist/index.cjs +5394 -0
- package/dist/index.css +1 -0
- package/dist/index.d.cts +9157 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +9157 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5335 -0
- package/dist/index.js.map +1 -0
- package/package.json +104 -0
- package/src/components/ds-alert-banner/ds-alert-banner.module.scss +116 -0
- package/src/components/ds-alert-banner/ds-alert-banner.tsx +115 -0
- package/src/components/ds-alert-banner/ds-alert-banner.types.tsx +47 -0
- package/src/components/ds-alert-banner/index.tsx +2 -0
- package/src/components/ds-breadcrumb/ds-breadcrumb.module.scss +99 -0
- package/src/components/ds-breadcrumb/ds-breadcrumb.tsx +94 -0
- package/src/components/ds-breadcrumb/ds-breadcrumb.types.tsx +32 -0
- package/src/components/ds-breadcrumb/index.tsx +2 -0
- package/src/components/ds-button/ds-button.tsx +12 -0
- package/src/components/ds-button/ds-button.types.ts +6 -0
- package/src/components/ds-button/index.ts +2 -0
- package/src/components/ds-button/versions/ds-button-legacy/ds-button-legacy.module.scss +257 -0
- package/src/components/ds-button/versions/ds-button-legacy/ds-button-legacy.tsx +34 -0
- package/src/components/ds-button/versions/ds-button-legacy/ds-button-legacy.types.ts +41 -0
- package/src/components/ds-button/versions/ds-button-legacy/index.ts +2 -0
- package/src/components/ds-button/versions/ds-button-new/ds-button-new.module.scss +580 -0
- package/src/components/ds-button/versions/ds-button-new/ds-button-new.tsx +49 -0
- package/src/components/ds-button/versions/ds-button-new/ds-button-new.types.ts +41 -0
- package/src/components/ds-button/versions/ds-button-new/index.ts +2 -0
- package/src/components/ds-checkbox/ds-checkbox.module.scss +130 -0
- package/src/components/ds-checkbox/ds-checkbox.tsx +55 -0
- package/src/components/ds-checkbox/ds-checkbox.types.tsx +27 -0
- package/src/components/ds-checkbox/index.tsx +2 -0
- package/src/components/ds-chip/ds-chip.module.scss +71 -0
- package/src/components/ds-chip/ds-chip.tsx +73 -0
- package/src/components/ds-chip/ds-chip.types.tsx +46 -0
- package/src/components/ds-chip/index.tsx +2 -0
- package/src/components/ds-chip-group/ds-chip-group.module.scss +59 -0
- package/src/components/ds-chip-group/ds-chip-group.tsx +122 -0
- package/src/components/ds-chip-group/ds-chip-group.types.ts +52 -0
- package/src/components/ds-chip-group/hooks/use-chip-row-calculation.ts +76 -0
- package/src/components/ds-chip-group/index.ts +2 -0
- package/src/components/ds-confirmation/ds-confirmation.module.scss +58 -0
- package/src/components/ds-confirmation/ds-confirmation.tsx +121 -0
- package/src/components/ds-confirmation/ds-confirmation.types.tsx +28 -0
- package/src/components/ds-confirmation/index.ts +2 -0
- package/src/components/ds-dialog/ds-dialog.module.scss +50 -0
- package/src/components/ds-dialog/ds-dialog.tsx +70 -0
- package/src/components/ds-dialog/ds-dialog.types.tsx +48 -0
- package/src/components/ds-dialog/index.tsx +2 -0
- package/src/components/ds-drawer/ds-drawer.module.scss +212 -0
- package/src/components/ds-drawer/ds-drawer.tsx +160 -0
- package/src/components/ds-drawer/ds-drawer.types.tsx +54 -0
- package/src/components/ds-drawer/index.ts +2 -0
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.module.scss +123 -0
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.tsx +396 -0
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.types.tsx +262 -0
- package/src/components/ds-dropdown-menu/index.tsx +2 -0
- package/src/components/ds-expandable-text-input/ds-expandable-text-input.module.scss +70 -0
- package/src/components/ds-expandable-text-input/ds-expandable-text-input.tsx +106 -0
- package/src/components/ds-expandable-text-input/ds-expandable-text-input.types.tsx +19 -0
- package/src/components/ds-expandable-text-input/index.ts +2 -0
- package/src/components/ds-file-upload/components/file-upload/file-upload.module.scss +90 -0
- package/src/components/ds-file-upload/components/file-upload/file-upload.tsx +106 -0
- package/src/components/ds-file-upload/components/file-upload/file-upload.types.tsx +94 -0
- package/src/components/ds-file-upload/components/file-upload/index.ts +2 -0
- package/src/components/ds-file-upload/components/file-upload-item/file-upload-item.module.scss +125 -0
- package/src/components/ds-file-upload/components/file-upload-item/file-upload-item.tsx +143 -0
- package/src/components/ds-file-upload/components/file-upload-item/file-upload-item.types.tsx +26 -0
- package/src/components/ds-file-upload/components/file-upload-item/index.ts +2 -0
- package/src/components/ds-file-upload/ds-file-upload-api.types.ts +38 -0
- package/src/components/ds-file-upload/ds-file-upload.tsx +46 -0
- package/src/components/ds-file-upload/ds-file-upload.types.tsx +54 -0
- package/src/components/ds-file-upload/errors/file-upload-errors.ts +27 -0
- package/src/components/ds-file-upload/hooks/index.ts +2 -0
- package/src/components/ds-file-upload/hooks/use-file-upload.ts +350 -0
- package/src/components/ds-file-upload/index.ts +7 -0
- package/src/components/ds-file-upload/types/accept-types.ts +106 -0
- package/src/components/ds-file-upload/utils/accept-utils.ts +25 -0
- package/src/components/ds-file-upload/utils/constants.ts +21 -0
- package/src/components/ds-file-upload/utils/file-factory.ts +18 -0
- package/src/components/ds-file-upload/utils/format-file-size.ts +15 -0
- package/src/components/ds-file-upload/utils/generate-helper-text.ts +39 -0
- package/src/components/ds-file-upload/utils/get-error-message.ts +17 -0
- package/src/components/ds-file-upload/utils/is-file-equal.ts +8 -0
- package/src/components/ds-form-control/ds-form-control.module.scss +135 -0
- package/src/components/ds-form-control/ds-form-control.tsx +94 -0
- package/src/components/ds-form-control/ds-form-control.types.tsx +58 -0
- package/src/components/ds-form-control/index.tsx +2 -0
- package/src/components/ds-grid/ds-grid.module.scss +0 -0
- package/src/components/ds-grid/ds-grid.tsx +43 -0
- package/src/components/ds-grid/ds-grid.types.ts +55 -0
- package/src/components/ds-grid/index.ts +2 -0
- package/src/components/ds-icon/ds-icon.module.scss +25 -0
- package/src/components/ds-icon/ds-icon.tsx +33 -0
- package/src/components/ds-icon/ds-icon.types.ts +53 -0
- package/src/components/ds-icon/index.ts +2 -0
- package/src/components/ds-icon/material-icons.ts +6203 -0
- package/src/components/ds-modal/ds-modal.module.scss +100 -0
- package/src/components/ds-modal/ds-modal.tsx +136 -0
- package/src/components/ds-modal/ds-modal.types.tsx +44 -0
- package/src/components/ds-modal/index.tsx +2 -0
- package/src/components/ds-number-input/ds-number-input.module.scss +15 -0
- package/src/components/ds-number-input/ds-number-input.tsx +74 -0
- package/src/components/ds-number-input/ds-number-input.types.tsx +76 -0
- package/src/components/ds-number-input/index.tsx +2 -0
- package/src/components/ds-panel/ds-panel.module.scss +95 -0
- package/src/components/ds-panel/ds-panel.tsx +46 -0
- package/src/components/ds-panel/ds-panel.types.ts +17 -0
- package/src/components/ds-panel/index.tsx +2 -0
- package/src/components/ds-password-input/ds-password-input.module.scss +10 -0
- package/src/components/ds-password-input/ds-password-input.tsx +67 -0
- package/src/components/ds-password-input/ds-password-input.types.tsx +62 -0
- package/src/components/ds-password-input/index.tsx +2 -0
- package/src/components/ds-popover/ds-popover.module.scss +23 -0
- package/src/components/ds-popover/ds-popover.tsx +33 -0
- package/src/components/ds-popover/ds-popover.types.tsx +24 -0
- package/src/components/ds-popover/index.tsx +2 -0
- package/src/components/ds-radio-group/ds-radio-group.module.scss +138 -0
- package/src/components/ds-radio-group/ds-radio-group.tsx +115 -0
- package/src/components/ds-radio-group/ds-radio-group.types.tsx +93 -0
- package/src/components/ds-radio-group/index.tsx +2 -0
- package/src/components/ds-select/ds-select.module.scss +66 -0
- package/src/components/ds-select/ds-select.tsx +239 -0
- package/src/components/ds-select/ds-select.types.tsx +80 -0
- package/src/components/ds-select/index.tsx +2 -0
- package/src/components/ds-select/select-items-chips.tsx +56 -0
- package/src/components/ds-smart-tabs/ds-smart-tabs.module.scss +69 -0
- package/src/components/ds-smart-tabs/ds-smart-tabs.tsx +113 -0
- package/src/components/ds-smart-tabs/ds-smart-tabs.types.tsx +74 -0
- package/src/components/ds-smart-tabs/index.tsx +2 -0
- package/src/components/ds-spinner/ds-spinner.module.scss +39 -0
- package/src/components/ds-spinner/ds-spinner.tsx +51 -0
- package/src/components/ds-spinner/ds-spinner.types.tsx +20 -0
- package/src/components/ds-spinner/index.tsx +2 -0
- package/src/components/ds-status-badge/ds-status-badge.module.scss +79 -0
- package/src/components/ds-status-badge/ds-status-badge.tsx +42 -0
- package/src/components/ds-status-badge/ds-status-badge.types.tsx +46 -0
- package/src/components/ds-status-badge/index.tsx +2 -0
- package/src/components/ds-stepper/components/ds-step-content.tsx +32 -0
- package/src/components/ds-stepper/components/ds-step-description.tsx +6 -0
- package/src/components/ds-stepper/components/ds-step-label.tsx +6 -0
- package/src/components/ds-stepper/components/ds-step-next-button.tsx +13 -0
- package/src/components/ds-stepper/components/ds-step.tsx +59 -0
- package/src/components/ds-stepper/ds-stepper.module.scss +134 -0
- package/src/components/ds-stepper/ds-stepper.tsx +34 -0
- package/src/components/ds-stepper/ds-stepper.types.ts +12 -0
- package/src/components/ds-stepper/hooks/use-stepper.ts +20 -0
- package/src/components/ds-stepper/hooks/use-steps.ts +18 -0
- package/src/components/ds-stepper/index.tsx +6 -0
- package/src/components/ds-system-status/ds-system-status.module.scss +87 -0
- package/src/components/ds-system-status/ds-system-status.tsx +33 -0
- package/src/components/ds-system-status/ds-system-status.types.tsx +37 -0
- package/src/components/ds-system-status/index.tsx +10 -0
- package/src/components/ds-table/components/core-table/core-table.module.scss +32 -0
- package/src/components/ds-table/components/core-table/core-table.tsx +83 -0
- package/src/components/ds-table/components/core-table/index.ts +1 -0
- package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.module.scss +115 -0
- package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.tsx +70 -0
- package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.types.ts +41 -0
- package/src/components/ds-table/components/ds-table-bulk-actions/index.ts +2 -0
- package/src/components/ds-table/components/ds-table-cell/ds-table-cell.module.scss +53 -0
- package/src/components/ds-table/components/ds-table-cell/ds-table-cell.tsx +95 -0
- package/src/components/ds-table/components/ds-table-cell/ds-table-cell.types.ts +67 -0
- package/src/components/ds-table/components/ds-table-cell/index.ts +2 -0
- package/src/components/ds-table/components/ds-table-header/ds-table-header.module.scss +81 -0
- package/src/components/ds-table/components/ds-table-header/ds-table-header.tsx +99 -0
- package/src/components/ds-table/components/ds-table-header/ds-table-header.types.ts +11 -0
- package/src/components/ds-table/components/ds-table-header/index.ts +2 -0
- package/src/components/ds-table/components/ds-table-row/ds-table-row.module.scss +137 -0
- package/src/components/ds-table/components/ds-table-row/ds-table-row.tsx +205 -0
- package/src/components/ds-table/components/ds-table-row/ds-table-row.types.ts +22 -0
- package/src/components/ds-table/components/ds-table-row/index.ts +2 -0
- package/src/components/ds-table/context/ds-table-context.tsx +39 -0
- package/src/components/ds-table/ds-table.module.scss +60 -0
- package/src/components/ds-table/ds-table.tsx +312 -0
- package/src/components/ds-table/ds-table.types.ts +377 -0
- package/src/components/ds-table/filters/adapters/create-checkbox-filter-adapter.tsx +116 -0
- package/src/components/ds-table/filters/adapters/create-dual-range-filter-adapter.tsx +171 -0
- package/src/components/ds-table/filters/adapters/create-filter-adapter.ts +131 -0
- package/src/components/ds-table/filters/adapters/index.ts +12 -0
- package/src/components/ds-table/filters/components/checkbox-filter/checkbox-filter.tsx +43 -0
- package/src/components/ds-table/filters/components/checkbox-filter/index.ts +2 -0
- package/src/components/ds-table/filters/components/range-filter/index.ts +2 -0
- package/src/components/ds-table/filters/components/range-filter/range-filter.module.scss +25 -0
- package/src/components/ds-table/filters/components/range-filter/range-filter.tsx +79 -0
- package/src/components/ds-table/filters/hooks/index.ts +1 -0
- package/src/components/ds-table/filters/hooks/use-table-filters.ts +234 -0
- package/src/components/ds-table/filters/index.ts +50 -0
- package/src/components/ds-table/filters/types/filter-adapter.types.ts +111 -0
- package/src/components/ds-table/hooks/use-drag-and-drop.tsx +107 -0
- package/src/components/ds-table/index.ts +4 -0
- package/src/components/ds-table/styles/_variables.scss +17 -0
- package/src/components/ds-table/styles/shared/ds-table-shared.module.scss +16 -0
- package/src/components/ds-table/utils/column-styling.ts +30 -0
- package/src/components/ds-table/utils/create-columns-grid-template.ts +23 -0
- package/src/components/ds-table/utils/merge-refs.ts +15 -0
- package/src/components/ds-table/utils/story-data-generator.ts +91 -0
- package/src/components/ds-text-input/ds-text-input.module.scss +27 -0
- package/src/components/ds-text-input/ds-text-input.tsx +75 -0
- package/src/components/ds-text-input/ds-text-input.types.tsx +110 -0
- package/src/components/ds-text-input/index.ts +2 -0
- package/src/components/ds-textarea/ds-textarea.module.scss +5 -0
- package/src/components/ds-textarea/ds-textarea.tsx +49 -0
- package/src/components/ds-textarea/ds-textarea.types.tsx +67 -0
- package/src/components/ds-textarea/index.tsx +2 -0
- package/src/components/ds-toast/ds-toast-context.tsx +79 -0
- package/src/components/ds-toast/ds-toast.module.scss +134 -0
- package/src/components/ds-toast/ds-toast.tsx +54 -0
- package/src/components/ds-toast/ds-toast.types.tsx +53 -0
- package/src/components/ds-toast/index.ts +3 -0
- package/src/components/ds-tooltip/ds-tooltip.module.scss +19 -0
- package/src/components/ds-tooltip/ds-tooltip.tsx +33 -0
- package/src/components/ds-tooltip/ds-tooltip.types.tsx +12 -0
- package/src/components/ds-tooltip/index.tsx +2 -0
- package/src/components/ds-typography/ds-typography.config.ts +32 -0
- package/src/components/ds-typography/ds-typography.module.scss +93 -0
- package/src/components/ds-typography/ds-typography.tsx +27 -0
- package/src/components/ds-typography/ds-typography.types.tsx +27 -0
- package/src/components/ds-typography/index.tsx +2 -0
- package/src/components/ds-vertical-tabs/ds-vertical-tabs.module.scss +60 -0
- package/src/components/ds-vertical-tabs/ds-vertical-tabs.tsx +80 -0
- package/src/components/ds-vertical-tabs/ds-vertical-tabs.types.ts +69 -0
- package/src/components/ds-vertical-tabs/index.ts +7 -0
- package/src/index.ts +34 -0
- package/src/styles/_colors.scss +65 -0
- package/src/styles/_grid.scss +111 -0
- package/src/styles/_mixin.scss +1 -0
- package/src/styles/_reset.scss +38 -0
- package/src/styles/_root.scss +390 -0
- package/src/styles/_scrollbars.scss +41 -0
- package/src/styles/_spacing.scss +47 -0
- package/src/styles/_typography.scss +301 -0
- package/src/styles/_utilities.scss +33 -0
- package/src/styles/_variables.scss +44 -0
- package/src/styles/mixins/_bounding-box.scss +53 -0
- package/src/styles/mixins/_list.scss +74 -0
- package/src/styles/shared/_dropdown.scss +89 -0
- package/src/styles/shared/_input.scss +365 -0
- package/src/styles/shared/_modal.scss +123 -0
- package/src/styles/styles.scss +12 -0
package/package.json
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@drivenets/design-system",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"types": "./dist/index.d.cts",
|
|
7
|
+
"main": "./dist/index.cjs",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/index.d.cts",
|
|
17
|
+
"default": "./dist/index.cjs"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"./src/styles/*": "./src/styles/*"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"README.md",
|
|
24
|
+
"CHANGELOG.md",
|
|
25
|
+
"LICENSE",
|
|
26
|
+
"./dist",
|
|
27
|
+
"./src",
|
|
28
|
+
"!**/__tests__",
|
|
29
|
+
"!./src/**/*.d.ts",
|
|
30
|
+
"!**/stories",
|
|
31
|
+
"!**/*.stories.*"
|
|
32
|
+
],
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@ark-ui/react": "^5.18.0",
|
|
35
|
+
"@dnd-kit/core": "^6.3.1",
|
|
36
|
+
"@dnd-kit/modifiers": "^9.0.0",
|
|
37
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
38
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
39
|
+
"@radix-ui/react-checkbox": "^1.1.5",
|
|
40
|
+
"@radix-ui/react-collapsible": "^1.1.11",
|
|
41
|
+
"@radix-ui/react-dialog": "^1.1.13",
|
|
42
|
+
"@radix-ui/react-dropdown-menu": "^2.1.14",
|
|
43
|
+
"@radix-ui/react-popover": "^1.1.11",
|
|
44
|
+
"@radix-ui/react-radio-group": "^1.2.4",
|
|
45
|
+
"@radix-ui/react-slot": "^1.2.3",
|
|
46
|
+
"@radix-ui/react-tooltip": "^1.2.4",
|
|
47
|
+
"@radix-ui/react-visually-hidden": "^1.2.2",
|
|
48
|
+
"@tanstack/react-table": "^8.21.3",
|
|
49
|
+
"@tanstack/react-virtual": "^3.13.6",
|
|
50
|
+
"@zag-js/react": "^1.17.4",
|
|
51
|
+
"@zag-js/steps": "^1.17.4",
|
|
52
|
+
"classnames": "^2.5.1"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"react": "^19"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@arethetypeswrong/cli": "^0.18.2",
|
|
59
|
+
"@chromatic-com/storybook": "^4.1.3",
|
|
60
|
+
"@faker-js/faker": "^9.7.0",
|
|
61
|
+
"@hookform/resolvers": "^5.0.1",
|
|
62
|
+
"@storybook/addon-a11y": "^10.1.9",
|
|
63
|
+
"@storybook/addon-docs": "^10.1.9",
|
|
64
|
+
"@storybook/addon-vitest": "^10.1.9",
|
|
65
|
+
"@storybook/builder-vite": "^10.1.9",
|
|
66
|
+
"@storybook/react-vite": "^10.1.9",
|
|
67
|
+
"@tanstack/react-query": "^5.90.12",
|
|
68
|
+
"@tanstack/react-router": "^1.141.2",
|
|
69
|
+
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
70
|
+
"@types/react": "^19.2.7",
|
|
71
|
+
"@vitest/browser": "^4.0.16",
|
|
72
|
+
"@vitest/browser-playwright": "^4.0.15",
|
|
73
|
+
"eslint": "^9.39.2",
|
|
74
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
75
|
+
"eslint-plugin-react": "^7.37.5",
|
|
76
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
77
|
+
"eslint-plugin-storybook": "^10.1.9",
|
|
78
|
+
"playwright": "^1.57.0",
|
|
79
|
+
"postcss": "^8.5.6",
|
|
80
|
+
"postcss-modules": "^6.0.1",
|
|
81
|
+
"publint": "^0.3.16",
|
|
82
|
+
"react": "^19.2.3",
|
|
83
|
+
"react-hook-form": "^7.55.0",
|
|
84
|
+
"rollup-plugin-sass": "^1.15.3",
|
|
85
|
+
"sass-embedded": "^1.97.0",
|
|
86
|
+
"storybook": "^10.1.9",
|
|
87
|
+
"tsdown": "^0.18.0",
|
|
88
|
+
"typescript": "^5.9.3",
|
|
89
|
+
"typescript-plugin-css-modules": "^5.2.0",
|
|
90
|
+
"vite": "^7.3.0",
|
|
91
|
+
"vitest": "^4.0.16",
|
|
92
|
+
"zod": "^3.24.2",
|
|
93
|
+
"@drivenets/vite-plugin-design-system": "0.0.1"
|
|
94
|
+
},
|
|
95
|
+
"scripts": {
|
|
96
|
+
"lint": "eslint --max-warnings=0 .",
|
|
97
|
+
"typecheck": "tsc",
|
|
98
|
+
"storybook": "storybook dev -p 6006",
|
|
99
|
+
"test": "vitest",
|
|
100
|
+
"build": "tsdown",
|
|
101
|
+
"build:storybook": "storybook build",
|
|
102
|
+
"build:lint": "publint && attw --pack"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
@use '../../styles/typography';
|
|
2
|
+
|
|
3
|
+
.alertBanner {
|
|
4
|
+
&.inline {
|
|
5
|
+
display: grid;
|
|
6
|
+
grid-template-columns: auto 1fr auto;
|
|
7
|
+
grid-template-rows: auto auto auto;
|
|
8
|
+
grid-template-areas:
|
|
9
|
+
'icon title close'
|
|
10
|
+
'icon description close'
|
|
11
|
+
'icon actions close';
|
|
12
|
+
align-items: start;
|
|
13
|
+
padding: var(--spacing-standard);
|
|
14
|
+
border-radius: 4px;
|
|
15
|
+
border: 1px solid;
|
|
16
|
+
column-gap: var(--spacing-xs);
|
|
17
|
+
row-gap: var(--spacing-4xs);
|
|
18
|
+
|
|
19
|
+
&:not(:has(.title)) {
|
|
20
|
+
align-items: center;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.global {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
padding: var(--spacing-sm) var(--spacing-standard);
|
|
28
|
+
gap: var(--spacing-2xs);
|
|
29
|
+
border-bottom: 2px solid;
|
|
30
|
+
|
|
31
|
+
.title {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.description {
|
|
36
|
+
@include typography.ellipsis;
|
|
37
|
+
flex: 1;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&.hidden {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.icon {
|
|
46
|
+
grid-area: icon;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.title {
|
|
50
|
+
grid-area: title;
|
|
51
|
+
color: var(--color-font-main);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.description {
|
|
55
|
+
grid-area: description;
|
|
56
|
+
color: var(--color-font-secondary);
|
|
57
|
+
margin-top: var(--spacing-4xs);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.actions {
|
|
61
|
+
grid-area: actions;
|
|
62
|
+
display: inline-flex;
|
|
63
|
+
gap: var(--spacing-xs);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.closeButton {
|
|
67
|
+
grid-area: close;
|
|
68
|
+
display: flex;
|
|
69
|
+
color: var(--color-background-action);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&.infoNeutral {
|
|
73
|
+
background-color: var(--color-background-secondary);
|
|
74
|
+
border-color: var(--color-border);
|
|
75
|
+
|
|
76
|
+
.icon {
|
|
77
|
+
color: var(--color-icon-secondary);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&.infoBlue {
|
|
82
|
+
background-color: var(--color-background-info);
|
|
83
|
+
border-color: var(--color-border-action-primary);
|
|
84
|
+
|
|
85
|
+
.icon {
|
|
86
|
+
color: var(--color-icon-primary);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.warning {
|
|
91
|
+
background-color: var(--color-background-warning);
|
|
92
|
+
border-color: var(--color-background-warning-strong);
|
|
93
|
+
|
|
94
|
+
.icon {
|
|
95
|
+
color: var(--color-icon-warning);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&.error {
|
|
100
|
+
background-color: var(--color-background-danger-weak);
|
|
101
|
+
border-color: var(--color-border-danger-strong);
|
|
102
|
+
|
|
103
|
+
.icon {
|
|
104
|
+
color: var(--color-icon-danger);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&.success {
|
|
109
|
+
background-color: var(--color-background-success);
|
|
110
|
+
border-color: var(--color-border-success);
|
|
111
|
+
|
|
112
|
+
.icon {
|
|
113
|
+
color: var(--color-icon-success);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import styles from './ds-alert-banner.module.scss';
|
|
4
|
+
import type { DsAlertBannerProps } from './ds-alert-banner.types';
|
|
5
|
+
import { DsIcon } from '../ds-icon';
|
|
6
|
+
import { DsTypography } from '../ds-typography';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Design system AlertBanner component
|
|
10
|
+
* Controlled component that displays alert messages with different variants
|
|
11
|
+
*/
|
|
12
|
+
const DsAlertBanner = ({
|
|
13
|
+
open,
|
|
14
|
+
onOpenChange,
|
|
15
|
+
inline = false,
|
|
16
|
+
variant = 'info-blue',
|
|
17
|
+
icon,
|
|
18
|
+
closable = false,
|
|
19
|
+
className,
|
|
20
|
+
style = {},
|
|
21
|
+
children,
|
|
22
|
+
}: DsAlertBannerProps) => {
|
|
23
|
+
const variantClass = {
|
|
24
|
+
'info-neutral': styles.infoNeutral,
|
|
25
|
+
'info-blue': styles.infoBlue,
|
|
26
|
+
warning: styles.warning,
|
|
27
|
+
error: styles.error,
|
|
28
|
+
success: styles.success,
|
|
29
|
+
}[variant];
|
|
30
|
+
|
|
31
|
+
const alertBannerClass = classNames(
|
|
32
|
+
styles.alertBanner,
|
|
33
|
+
inline && styles.inline,
|
|
34
|
+
!inline && styles.global,
|
|
35
|
+
variantClass,
|
|
36
|
+
{
|
|
37
|
+
[styles.hidden]: !open,
|
|
38
|
+
},
|
|
39
|
+
className,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const handleClose = () => {
|
|
43
|
+
onOpenChange(false);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
if (!open) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div className={alertBannerClass} style={style}>
|
|
52
|
+
{icon && <DsIcon className={styles.icon} icon={icon} size="small" filled />}
|
|
53
|
+
{children}
|
|
54
|
+
{closable && (
|
|
55
|
+
<button
|
|
56
|
+
type="button"
|
|
57
|
+
className={styles.closeButton}
|
|
58
|
+
onClick={handleClose}
|
|
59
|
+
aria-label="Close alert"
|
|
60
|
+
data-close
|
|
61
|
+
>
|
|
62
|
+
<DsIcon icon="close" size="small" />
|
|
63
|
+
</button>
|
|
64
|
+
)}
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const Title = ({
|
|
70
|
+
style,
|
|
71
|
+
className,
|
|
72
|
+
children,
|
|
73
|
+
}: {
|
|
74
|
+
style?: CSSProperties;
|
|
75
|
+
className?: string;
|
|
76
|
+
children: ReactNode;
|
|
77
|
+
}) => (
|
|
78
|
+
<DsTypography style={style} className={classNames(styles.title, className)} variant="body-md-md">
|
|
79
|
+
{children}
|
|
80
|
+
</DsTypography>
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
const Body = ({
|
|
84
|
+
style,
|
|
85
|
+
className,
|
|
86
|
+
children,
|
|
87
|
+
}: {
|
|
88
|
+
style?: CSSProperties;
|
|
89
|
+
className?: string;
|
|
90
|
+
children: ReactNode;
|
|
91
|
+
}) => (
|
|
92
|
+
<DsTypography style={style} className={classNames(styles.description, className)} variant="body-sm-reg">
|
|
93
|
+
{children}
|
|
94
|
+
</DsTypography>
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
const Actions = ({
|
|
98
|
+
style,
|
|
99
|
+
className,
|
|
100
|
+
children,
|
|
101
|
+
}: {
|
|
102
|
+
style?: CSSProperties;
|
|
103
|
+
className?: string;
|
|
104
|
+
children: ReactNode;
|
|
105
|
+
}) => (
|
|
106
|
+
<div style={style} className={classNames(styles.actions, className)}>
|
|
107
|
+
{children}
|
|
108
|
+
</div>
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
DsAlertBanner.Title = Title;
|
|
112
|
+
DsAlertBanner.Body = Body;
|
|
113
|
+
DsAlertBanner.Actions = Actions;
|
|
114
|
+
|
|
115
|
+
export default DsAlertBanner;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import type { IconType } from '../ds-icon';
|
|
4
|
+
|
|
5
|
+
export const alertBannerVariants = ['info-neutral', 'info-blue', 'warning', 'error', 'success'] as const;
|
|
6
|
+
export type AlertBannerVariant = (typeof alertBannerVariants)[number];
|
|
7
|
+
|
|
8
|
+
export interface DsAlertBannerProps {
|
|
9
|
+
/**
|
|
10
|
+
* Controls whether the alert banner is visible
|
|
11
|
+
*/
|
|
12
|
+
open: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Callback fired when the alert banner should be closed
|
|
15
|
+
*/
|
|
16
|
+
onOpenChange: (open: boolean) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the alert banner should be inline (normal document flow) instead of global (designed for top of the page)
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
inline?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The variant of the alert banner
|
|
24
|
+
* @default 'info-blue'
|
|
25
|
+
*/
|
|
26
|
+
variant?: AlertBannerVariant;
|
|
27
|
+
/**
|
|
28
|
+
* Optional icon to display using DsIcon
|
|
29
|
+
*/
|
|
30
|
+
icon?: IconType;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the alert banner can be closed with an X button
|
|
33
|
+
*/
|
|
34
|
+
closable?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Additional CSS class names
|
|
37
|
+
*/
|
|
38
|
+
className?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Additional styles to apply to the component
|
|
41
|
+
*/
|
|
42
|
+
style?: React.CSSProperties;
|
|
43
|
+
/**
|
|
44
|
+
* Optional children to be rendered inside the component (typically action buttons)
|
|
45
|
+
*/
|
|
46
|
+
children?: ReactNode;
|
|
47
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
@use '../../styles/typography';
|
|
2
|
+
|
|
3
|
+
@mixin breadcrumb-item {
|
|
4
|
+
@include typography.body-sm-reg;
|
|
5
|
+
color: var(--color-background-action);
|
|
6
|
+
text-decoration: none;
|
|
7
|
+
outline: none;
|
|
8
|
+
padding: var(--exo-spacing-2x-small) var(--spacing-sm);
|
|
9
|
+
gap: var(--exo-spacing-2x-small);
|
|
10
|
+
border-radius: var(--exo-spacing-2x-small);
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
|
|
14
|
+
&:hover {
|
|
15
|
+
color: var(--color-background-selected);
|
|
16
|
+
background: var(--color-background-action-tertiary);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&:active {
|
|
20
|
+
color: var(--color-background-selected-hover);
|
|
21
|
+
background: var(--color-background-action-secondary-hover);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:focus {
|
|
25
|
+
outline: 2px solid var(--color-background-selected);
|
|
26
|
+
outline-offset: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:disabled {
|
|
30
|
+
color: var(--color-background-disable);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.breadcrumb {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.list {
|
|
40
|
+
display: flex;
|
|
41
|
+
list-style: none;
|
|
42
|
+
padding: 0;
|
|
43
|
+
margin: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.breadcrumbItem {
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
|
|
50
|
+
&:not(:last-child)::after {
|
|
51
|
+
content: '/';
|
|
52
|
+
@include typography.body-sm-reg;
|
|
53
|
+
display: flex;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
align-items: center;
|
|
56
|
+
color: var(--color-font-disabled);
|
|
57
|
+
width: var(--icon-width-small);
|
|
58
|
+
height: var(--icon-width-small);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:last-child {
|
|
62
|
+
.link,
|
|
63
|
+
.trigger {
|
|
64
|
+
@include typography.body-sm-md;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.link {
|
|
70
|
+
@include breadcrumb-item;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.active {
|
|
74
|
+
@include typography.body-sm-md;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.trigger {
|
|
78
|
+
@include breadcrumb-item;
|
|
79
|
+
background: none;
|
|
80
|
+
border: none;
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.icon {
|
|
85
|
+
margin-right: var(--exo-spacing-2x-small);
|
|
86
|
+
display: flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.dropdownIcon {
|
|
91
|
+
margin-left: var(--exo-spacing-2x-small);
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.itemLabel {
|
|
97
|
+
@include typography.ellipsis;
|
|
98
|
+
color: var(--color-font-main);
|
|
99
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Link, useLocation } from '@tanstack/react-router';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import styles from './ds-breadcrumb.module.scss';
|
|
6
|
+
import type { DsBreadcrumbProps } from './ds-breadcrumb.types';
|
|
7
|
+
import { DsIcon } from '../ds-icon';
|
|
8
|
+
import { DsDropdownMenu } from '../ds-dropdown-menu';
|
|
9
|
+
import { DsTextInput } from '../ds-text-input/index';
|
|
10
|
+
import { DsTypography } from '../ds-typography';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Design system Breadcrumb component
|
|
14
|
+
*/
|
|
15
|
+
const DsBreadcrumb: React.FC<DsBreadcrumbProps> = ({ items, onSelect, className }) => {
|
|
16
|
+
const location = useLocation();
|
|
17
|
+
const [search, setSearch] = useState('');
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<nav className={classNames(styles.breadcrumb, className)} aria-label="Breadcrumb">
|
|
21
|
+
<ol className={styles.list}>
|
|
22
|
+
{items.map((item, index) => {
|
|
23
|
+
const selectedOption =
|
|
24
|
+
item.type === 'dropdown'
|
|
25
|
+
? item.options.find((option) => option.href === location.pathname)
|
|
26
|
+
: null;
|
|
27
|
+
|
|
28
|
+
const filteredOptions =
|
|
29
|
+
item.type === 'dropdown'
|
|
30
|
+
? item.options.filter((opt) => opt.label.toLowerCase().includes(search.toLowerCase()))
|
|
31
|
+
: [];
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<li key={index} className={styles.breadcrumbItem}>
|
|
35
|
+
{item.type === 'link' ? (
|
|
36
|
+
<Link
|
|
37
|
+
to={item.href}
|
|
38
|
+
className={classNames(styles.link)}
|
|
39
|
+
aria-current={index === items.length - 1 ? 'page' : undefined}
|
|
40
|
+
onClick={() => onSelect?.(item.href)}
|
|
41
|
+
>
|
|
42
|
+
{item.icon && <DsIcon icon={item.icon} className={styles.icon} size="small" />}
|
|
43
|
+
{item.label}
|
|
44
|
+
</Link>
|
|
45
|
+
) : (
|
|
46
|
+
<DsDropdownMenu.Root onSelect={onSelect}>
|
|
47
|
+
<DsDropdownMenu.Trigger
|
|
48
|
+
className={styles.trigger}
|
|
49
|
+
aria-current={index === items.length - 1 ? 'page' : undefined}
|
|
50
|
+
>
|
|
51
|
+
{item.icon && <DsIcon icon={item.icon} className={styles.icon} size="small" />}
|
|
52
|
+
{selectedOption?.label || item.label}
|
|
53
|
+
<DsIcon icon="arrow_drop_down" className={styles.dropdownIcon} />
|
|
54
|
+
</DsDropdownMenu.Trigger>
|
|
55
|
+
<DsDropdownMenu.Content>
|
|
56
|
+
<DsDropdownMenu.Header>
|
|
57
|
+
<DsTextInput
|
|
58
|
+
placeholder="Search"
|
|
59
|
+
value={search}
|
|
60
|
+
onValueChange={setSearch}
|
|
61
|
+
onKeyDown={(e) => e.stopPropagation()}
|
|
62
|
+
slots={{
|
|
63
|
+
startAdornment: <DsIcon icon="search" size="tiny" />,
|
|
64
|
+
}}
|
|
65
|
+
/>
|
|
66
|
+
</DsDropdownMenu.Header>
|
|
67
|
+
{filteredOptions.map((opt) => {
|
|
68
|
+
const selected = selectedOption?.href === opt.href;
|
|
69
|
+
return (
|
|
70
|
+
<DsTypography
|
|
71
|
+
key={opt.href}
|
|
72
|
+
className={styles.itemLabel}
|
|
73
|
+
variant="body-sm-reg"
|
|
74
|
+
asChild
|
|
75
|
+
>
|
|
76
|
+
<DsDropdownMenu.Item value={opt.href} selected={selected}>
|
|
77
|
+
{opt.label}
|
|
78
|
+
{selected && <DsDropdownMenu.ItemIndicator />}
|
|
79
|
+
</DsDropdownMenu.Item>
|
|
80
|
+
</DsTypography>
|
|
81
|
+
);
|
|
82
|
+
})}
|
|
83
|
+
</DsDropdownMenu.Content>
|
|
84
|
+
</DsDropdownMenu.Root>
|
|
85
|
+
)}
|
|
86
|
+
</li>
|
|
87
|
+
);
|
|
88
|
+
})}
|
|
89
|
+
</ol>
|
|
90
|
+
</nav>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export default DsBreadcrumb;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { IconType } from '../ds-icon';
|
|
2
|
+
|
|
3
|
+
export type DsBreadcrumbItem =
|
|
4
|
+
| {
|
|
5
|
+
type: 'link';
|
|
6
|
+
label: string;
|
|
7
|
+
href: string;
|
|
8
|
+
icon?: IconType;
|
|
9
|
+
}
|
|
10
|
+
| {
|
|
11
|
+
type: 'dropdown';
|
|
12
|
+
label: string;
|
|
13
|
+
options: { label: string; href: string }[];
|
|
14
|
+
icon?: IconType;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export interface DsBreadcrumbProps {
|
|
18
|
+
/**
|
|
19
|
+
* The items to be displayed in the breadcrumb
|
|
20
|
+
*/
|
|
21
|
+
items: DsBreadcrumbItem[];
|
|
22
|
+
/**
|
|
23
|
+
* The event handler to be called when an option is selected
|
|
24
|
+
*
|
|
25
|
+
* @param href
|
|
26
|
+
*/
|
|
27
|
+
onSelect?: (href: string) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Additional CSS class name to be applied to the breadcrumb
|
|
30
|
+
*/
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DsButtonLegacy } from './versions/ds-button-legacy';
|
|
2
|
+
import { DsButtonNew } from './versions/ds-button-new';
|
|
3
|
+
import type { DsButtonUnifiedProps } from './ds-button.types';
|
|
4
|
+
|
|
5
|
+
const DsButton = (props: DsButtonUnifiedProps) => {
|
|
6
|
+
if (props.design === 'v1.2') {
|
|
7
|
+
return <DsButtonNew {...props} />;
|
|
8
|
+
}
|
|
9
|
+
return <DsButtonLegacy {...props} />;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default DsButton;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DsButtonProps as DsButtonLegacyProps } from './versions/ds-button-legacy/ds-button-legacy.types';
|
|
2
|
+
import type { DsButtonProps as DsButtonNewProps } from './versions/ds-button-new/ds-button-new.types';
|
|
3
|
+
|
|
4
|
+
export type DsButtonUnifiedProps =
|
|
5
|
+
| (DsButtonLegacyProps & { design?: undefined | 'legacy' })
|
|
6
|
+
| (DsButtonNewProps & { design: 'v1.2' });
|