@drivenets/design-system 0.15.0 → 0.16.0
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 +19 -0
- package/dist/index.cjs +868 -200
- package/dist/index.d.cts +810 -1181
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +810 -1181
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +852 -196
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +1 -1
- package/package.json +15 -13
- package/src/components/ds-alert-banner/ds-alert-banner.tsx +11 -2
- package/src/components/ds-autocomplete/ds-autocomplete.figma.ts +36 -0
- package/src/components/ds-autocomplete/ds-autocomplete.tsx +2 -0
- package/src/components/ds-avatar/ds-avatar.figma.ts +30 -0
- package/src/components/ds-avatar/ds-avatar.tsx +6 -1
- package/src/components/ds-avatar/ds-avatar.types.ts +5 -2
- package/src/components/ds-avatar-group/ds-avatar-group.figma.ts +27 -0
- package/src/components/ds-avatar-group/ds-avatar-group.tsx +6 -1
- package/src/components/ds-avatar-group/ds-avatar-group.types.ts +3 -1
- package/src/components/ds-breadcrumb/ds-breadcrumb.figma.ts +19 -0
- package/src/components/ds-breadcrumb/ds-breadcrumb.tsx +2 -0
- package/src/components/ds-button/ds-button.tsx +2 -0
- package/src/components/ds-button-v3/ds-button-v3.figma.ts +1 -1
- package/src/components/ds-button-v3/ds-button-v3.tsx +6 -0
- package/src/components/ds-button-v3/index.ts +2 -0
- package/src/components/ds-card/ds-card.tsx +7 -3
- package/src/components/ds-catalog-layout/ds-catalog-layout.tsx +8 -0
- package/src/components/ds-checkbox/ds-checkbox-level-2.figma.ts +40 -0
- package/src/components/ds-checkbox/ds-checkbox.figma.ts +45 -0
- package/src/components/ds-checkbox/ds-checkbox.module.scss +1 -1
- package/src/components/ds-checkbox/ds-checkbox.tsx +9 -1
- package/src/components/ds-checkbox-group/ds-checkbox-group.figma.ts +15 -0
- package/src/components/ds-checkbox-group/ds-checkbox-group.tsx +2 -0
- package/src/components/ds-chip/ds-chip.tsx +2 -0
- package/src/components/ds-chip-group/ds-chip-group.tsx +2 -0
- package/src/components/ds-comment-bubble/components/ds-comment-thread/ds-comment-thread.tsx +1 -0
- package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.tsx +1 -0
- package/src/components/ds-comment-bubble/ds-comment-bubble.tsx +1 -0
- package/src/components/ds-comment-card/ds-comment-card.tsx +1 -0
- package/src/components/ds-comment-indicator/ds-comment-indicator.tsx +1 -0
- package/src/components/ds-comments-drawer/ds-comments-drawer.tsx +1 -0
- package/src/components/ds-confirmation/ds-confirmation.tsx +1 -0
- package/src/components/ds-date-input/ds-date-input.tsx +2 -0
- package/src/components/ds-date-picker/ds-date-picker.tsx +9 -0
- package/src/components/ds-date-picker/ds-date-picker.types.ts +1 -1
- package/src/components/ds-date-range-picker/ds-date-range-picker.tsx +2 -0
- package/src/components/ds-dialog/ds-dialog.tsx +9 -0
- package/src/components/ds-dialog/ds-dialog.types.ts +1 -1
- package/src/components/ds-divider/ds-divider.figma.ts +19 -0
- package/src/components/ds-divider/ds-divider.tsx +2 -0
- package/src/components/ds-drawer/ds-drawer.tsx +10 -0
- package/src/components/ds-drawer/figma/ds-drawer-content.figma.ts +15 -0
- package/src/components/ds-drawer/figma/ds-drawer-footer.figma.ts +19 -0
- package/src/components/ds-drawer/figma/ds-drawer-header.figma.ts +16 -0
- package/src/components/ds-drawer/figma/ds-drawer.figma.ts +36 -0
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.module.scss +12 -3
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.tsx +24 -6
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.types.ts +10 -1
- package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-footer.figma.ts +11 -0
- package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-group.figma.ts +23 -0
- package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-item.figma.ts +29 -0
- package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-separator.figma.ts +11 -0
- package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu.figma.ts +24 -0
- package/src/components/ds-expandable-text-input/ds-expandable-text-input.figma.ts +24 -0
- package/src/components/ds-expandable-text-input/ds-expandable-text-input.tsx +1 -0
- package/src/components/ds-file-upload/ds-file-upload.figma.ts +29 -0
- package/src/components/ds-file-upload/ds-file-upload.tsx +2 -0
- package/src/components/ds-filter-status-icon/ds-filter-status-icon.figma.ts +22 -0
- package/src/components/ds-filter-status-icon/ds-filter-status-icon.tsx +1 -0
- package/src/components/ds-form-control/ds-form-control.tsx +3 -0
- package/src/components/ds-grid/index.ts +3 -0
- package/src/components/ds-icon/ds-icon.tsx +2 -0
- package/src/components/ds-key-value-pair/ds-key-value-pair.figma.ts +24 -0
- package/src/components/ds-key-value-pair/ds-key-value-pair.tsx +2 -0
- package/src/components/ds-loader/ds-loader.figma.ts +11 -0
- package/src/components/ds-loader/ds-loader.tsx +2 -0
- package/src/components/ds-modal/ds-modal.tsx +9 -0
- package/src/components/ds-number-input/ds-number-input.tsx +2 -0
- package/src/components/ds-panel/ds-panel.figma.ts +16 -0
- package/src/components/ds-panel/index.ts +2 -0
- package/src/components/ds-password-input/ds-password-input.tsx +2 -0
- package/src/components/ds-popover/ds-popover.tsx +9 -0
- package/src/components/ds-popover/figma/ds-popover-content-item.figma.ts +18 -0
- package/src/components/ds-popover/figma/ds-popover-content.figma.ts +15 -0
- package/src/components/ds-popover/figma/ds-popover-footer.figma.ts +19 -0
- package/src/components/ds-popover/figma/ds-popover-header.figma.ts +16 -0
- package/src/components/ds-popover/figma/ds-popover.figma.ts +34 -0
- package/src/components/ds-progress-arc/ds-progress-arc.figma.ts +23 -0
- package/src/components/ds-progress-arc/ds-progress-arc.tsx +2 -0
- package/src/components/ds-progress-donut/ds-progress-donut.figma.ts +45 -0
- package/src/components/ds-progress-donut/ds-progress-donut.tsx +2 -0
- package/src/components/ds-progress-linear/ds-progress-linear.figma.ts +26 -0
- package/src/components/ds-progress-linear/ds-progress-linear.tsx +2 -0
- package/src/components/ds-progress-task-bar/ds-progress-task-bar.tsx +2 -0
- package/src/components/ds-radio-group/ds-radio-group.tsx +3 -0
- package/src/components/ds-radio-group/figma/ds-radio-group-item.figma.ts +24 -0
- package/src/components/ds-radio-group/figma/ds-radio-group.figma.ts +14 -0
- package/src/components/ds-segment-group/ds-segment-group.tsx +3 -0
- package/src/components/ds-segment-group/figma/ds-segment-group-item.figma.ts +25 -0
- package/src/components/ds-segment-group/figma/ds-segment-group.figma.ts +23 -0
- package/src/components/ds-select/ds-select.tsx +2 -0
- package/src/components/ds-site-node/ds-site-node.figma.ts +27 -0
- package/src/components/ds-site-node/ds-site-node.module.scss +59 -0
- package/src/components/ds-site-node/ds-site-node.tsx +73 -0
- package/src/components/ds-site-node/ds-site-node.types.ts +36 -0
- package/src/components/ds-site-node/hooks/use-is-overflowing.ts +31 -0
- package/src/components/ds-site-node/index.ts +3 -0
- package/src/components/ds-skeleton/ds-skeleton-circle.tsx +2 -0
- package/src/components/ds-skeleton/ds-skeleton-rect.tsx +2 -0
- package/src/components/ds-skeleton/ds-skeleton-text.tsx +2 -0
- package/src/components/ds-skeleton/ds-skeleton.ts +7 -1
- package/src/components/ds-smart-tabs/ds-smart-tabs.tsx +4 -0
- package/src/components/ds-spinner/ds-spinner.figma.ts +19 -0
- package/src/components/ds-spinner/ds-spinner.tsx +2 -0
- package/src/components/ds-split-button/ds-split-button.tsx +6 -0
- package/src/components/ds-status-badge/ds-status-badge.tsx +2 -0
- package/src/components/ds-status-badge-v2/index.ts +2 -0
- package/src/components/ds-stepper/components/ds-step-content.tsx +2 -0
- package/src/components/ds-stepper/components/ds-step-next-button.tsx +2 -0
- package/src/components/ds-stepper/components/ds-step.tsx +2 -0
- package/src/components/ds-stepper/ds-stepper.figma.ts +38 -0
- package/src/components/ds-stepper/ds-stepper.tsx +1 -0
- package/src/components/ds-system-status/ds-system-status.tsx +2 -0
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-checkbox.tsx +1 -0
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-date.tsx +1 -0
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-number.tsx +1 -0
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-select.tsx +1 -0
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-text.tsx +1 -0
- package/src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.tsx +1 -0
- package/src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.tsx +1 -0
- package/src/components/ds-table/ds-table.tsx +2 -0
- package/src/components/ds-table/index.ts +3 -0
- package/src/components/ds-tabs/components/ds-tabs-content/ds-tabs-content.tsx +2 -0
- package/src/components/ds-tabs/components/ds-tabs-list/ds-tabs-list.tsx +2 -0
- package/src/components/ds-tabs/components/ds-tabs-tab/ds-tabs-tab.tsx +2 -0
- package/src/components/ds-tabs/ds-tabs.tsx +2 -0
- package/src/components/ds-tag/ds-tag.tsx +2 -0
- package/src/components/ds-tag-filter/ds-tag-filter.tsx +2 -0
- package/src/components/ds-text-input/ds-input-field-v02.figma.ts +87 -0
- package/src/components/ds-text-input/ds-text-input.tsx +2 -0
- package/src/components/ds-textarea/ds-textarea.tsx +2 -0
- package/src/components/ds-time-picker/ds-time-picker.tsx +2 -0
- package/src/components/ds-toast/ds-toast-context.tsx +1 -0
- package/src/components/ds-toast/ds-toast.figma.ts +34 -0
- package/src/components/ds-toast/ds-toast.tsx +3 -0
- package/src/components/ds-toggle/ds-toggle.figma.ts +39 -0
- package/src/components/ds-toggle/ds-toggle.tsx +2 -0
- package/src/components/ds-tooltip/ds-tooltip.figma.ts +16 -0
- package/src/components/ds-tooltip/ds-tooltip.module.scss +8 -1
- package/src/components/ds-tooltip/ds-tooltip.tsx +35 -15
- package/src/components/ds-tooltip/ds-tooltip.types.ts +40 -0
- package/src/components/ds-tree/ds-tree.tsx +16 -0
- package/src/components/ds-typography/ds-typography.config.ts +1 -1
- package/src/components/ds-typography/ds-typography.figma.ts +63 -0
- package/src/components/ds-typography/ds-typography.module.scss +16 -0
- package/src/components/ds-typography/ds-typography.tsx +64 -7
- package/src/components/ds-typography/ds-typography.types.ts +13 -0
- package/src/components/ds-typography/hooks/use-truncation.ts +151 -0
- package/src/components/ds-user-card/ds-user-card.figma.ts +16 -0
- package/src/components/ds-user-card/ds-user-card.module.scss +25 -0
- package/src/components/ds-user-card/ds-user-card.tsx +31 -0
- package/src/components/ds-user-card/ds-user-card.types.ts +26 -0
- package/src/components/ds-user-card/index.ts +2 -0
- package/src/components/ds-vertical-tabs/ds-vertical-tabs.tsx +6 -0
- package/src/components/ds-workspace-layout/ds-workspace-layout.tsx +10 -0
- package/src/index.ts +2 -0
- package/src/styles/_root.scss +468 -363
- package/src/styles/shared/_dropdown.scss +2 -2
- package/src/styles/styles.scss +0 -3
- package/src/styles/_colors.scss +0 -65
- package/src/styles/_root_new.scss +0 -451
- package/src/styles/_spacing.scss +0 -47
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drivenets/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.cts",
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
"@radix-ui/react-collapsible": "^1.1.13",
|
|
45
45
|
"@radix-ui/react-dialog": "^1.1.16",
|
|
46
46
|
"@radix-ui/react-dropdown-menu": "^2.1.17",
|
|
47
|
-
"@radix-ui/react-tooltip": "^1.2.9",
|
|
48
47
|
"@radix-ui/react-visually-hidden": "^1.2.5",
|
|
49
48
|
"@tanstack/react-table": "^8.21.3",
|
|
50
49
|
"@tanstack/react-virtual": "^3.14.2",
|
|
@@ -74,14 +73,15 @@
|
|
|
74
73
|
"@storybook/react-vite": "^10.4.1",
|
|
75
74
|
"@tanstack/react-query": "^5.100.14",
|
|
76
75
|
"@tanstack/react-router": "^1.170.8",
|
|
77
|
-
"@tsdown/css": "^0.22.
|
|
76
|
+
"@tsdown/css": "^0.22.12",
|
|
78
77
|
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
79
78
|
"@types/react": "^19.2.15",
|
|
80
79
|
"@types/react-dom": "^19.2.3",
|
|
81
|
-
"@
|
|
80
|
+
"@types/serve-handler": "^6.1.4",
|
|
81
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
82
82
|
"@vitejs/plugin-react": "^6.0.2",
|
|
83
|
-
"@vitest/browser-playwright": "^4.1.
|
|
84
|
-
"@vitest/coverage-v8": "^4.1.
|
|
83
|
+
"@vitest/browser-playwright": "^4.1.10",
|
|
84
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
85
85
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
86
86
|
"eslint": "^10.0.1",
|
|
87
87
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
@@ -96,17 +96,18 @@
|
|
|
96
96
|
"react-hook-form": "^7.76.1",
|
|
97
97
|
"remark-gfm": "^4.0.1",
|
|
98
98
|
"sass-embedded": "^1.100.0",
|
|
99
|
+
"serve-handler": "^6.1.7",
|
|
99
100
|
"storybook": "^10.4.1",
|
|
100
|
-
"tsdown": "^0.22.
|
|
101
|
+
"tsdown": "^0.22.12",
|
|
101
102
|
"typed-scss-modules": "^8.1.1",
|
|
102
|
-
"typescript": "
|
|
103
|
+
"typescript": "npm:@typescript/typescript6",
|
|
103
104
|
"typescript-plugin-css-modules": "^5.2.0",
|
|
104
105
|
"vite": "8.0.14",
|
|
105
|
-
"vitest": "^4.1.
|
|
106
|
+
"vitest": "^4.1.10",
|
|
106
107
|
"vitest-browser-react": "^2.1.0",
|
|
107
108
|
"zod": "^4.4.3",
|
|
108
|
-
"@drivenets/
|
|
109
|
-
"@drivenets/
|
|
109
|
+
"@drivenets/eslint-plugin-internal": "0.0.0",
|
|
110
|
+
"@drivenets/vite-plugin-design-system": "0.0.10"
|
|
110
111
|
},
|
|
111
112
|
"scripts": {
|
|
112
113
|
"start": "storybook dev -p 6006",
|
|
@@ -115,15 +116,16 @@
|
|
|
115
116
|
"//": "ESLINT_ARGS is used to pass arguments to eslint. We're using it so we don't need to duplicate the lint script.",
|
|
116
117
|
"lint:fix": "ESLINT_ARGS=--fix pnpm lint",
|
|
117
118
|
"lint:build": "publint && attw --pack",
|
|
118
|
-
"typecheck": "pnpm generate-scss-dts &&
|
|
119
|
+
"typecheck": "pnpm generate-scss-dts && tsc; EXIT_CODE=$?; rm -rf .scss-dts; exit $EXIT_CODE",
|
|
119
120
|
"generate-scss-dts": "typed-scss-modules ./src -o ./.scss-dts --nameFormat all --exportType default > /dev/null 2>&1",
|
|
120
121
|
"figma:lint": "figma connect parse --exit-on-unreadable-files",
|
|
121
122
|
"figma:publish": "figma connect publish --exit-on-unreadable-files",
|
|
122
|
-
"test": "vitest --project
|
|
123
|
+
"test": "vitest --project=unit --project=browser --project=storybook",
|
|
123
124
|
"test:coverage": "pnpm test --coverage",
|
|
124
125
|
"test:unit": "vitest --project=unit",
|
|
125
126
|
"test:browser": "vitest --project=browser",
|
|
126
127
|
"test:requires-build": "vitest --project=requires-build",
|
|
128
|
+
"test:storybook-docs": "vitest --project=storybook-docs",
|
|
127
129
|
"build": "tsdown",
|
|
128
130
|
"build:watch": "pnpm build --watch",
|
|
129
131
|
"build:storybook": "storybook build"
|
|
@@ -6,8 +6,11 @@ import { DsIcon } from '../ds-icon';
|
|
|
6
6
|
import { DsTypography } from '../ds-typography';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* @summary Controlled banner for surfacing contextual status messages.
|
|
10
|
+
*
|
|
11
|
+
* Renders as an inline bordered card or a full-width global bar, with five
|
|
12
|
+
* severity variants, an optional icon, and an optional close button. Compose the
|
|
13
|
+
* content with `DsAlertBanner.Title`, `DsAlertBanner.Body`, and `DsAlertBanner.Actions`.
|
|
11
14
|
*/
|
|
12
15
|
const DsAlertBanner = ({
|
|
13
16
|
open,
|
|
@@ -108,8 +111,14 @@ const Actions = ({
|
|
|
108
111
|
</div>
|
|
109
112
|
);
|
|
110
113
|
|
|
114
|
+
Title.displayName = 'DsAlertBanner.Title';
|
|
115
|
+
Body.displayName = 'DsAlertBanner.Body';
|
|
116
|
+
Actions.displayName = 'DsAlertBanner.Actions';
|
|
117
|
+
|
|
111
118
|
DsAlertBanner.Title = Title;
|
|
112
119
|
DsAlertBanner.Body = Body;
|
|
113
120
|
DsAlertBanner.Actions = Actions;
|
|
114
121
|
|
|
122
|
+
DsAlertBanner.displayName = 'DsAlertBanner';
|
|
123
|
+
|
|
115
124
|
export default DsAlertBanner;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=14824-7324
|
|
2
|
+
// source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-autocomplete
|
|
3
|
+
// component=DsAutocomplete
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
|
|
6
|
+
const instance = figma.selectedInstance;
|
|
7
|
+
|
|
8
|
+
const state = instance.getEnum('State', {
|
|
9
|
+
Default: 'default',
|
|
10
|
+
Hover: 'hover',
|
|
11
|
+
Focus: 'focus',
|
|
12
|
+
Disable: 'disable',
|
|
13
|
+
Error: 'error',
|
|
14
|
+
'read only': 'readOnly',
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const comboBox = instance.getEnum('Combo box', {
|
|
18
|
+
ON: 'on',
|
|
19
|
+
OFF: 'off',
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const attrs = [
|
|
23
|
+
'options={[]}',
|
|
24
|
+
comboBox === 'off' ? 'showTrigger={false}' : '',
|
|
25
|
+
state === 'disable' ? 'disabled' : '',
|
|
26
|
+
state === 'error' ? 'invalid' : '',
|
|
27
|
+
]
|
|
28
|
+
.filter(Boolean)
|
|
29
|
+
.join(' ');
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
example: figma.code`<DsAutocomplete ${attrs} />`,
|
|
33
|
+
imports: ["import { DsAutocomplete } from '@drivenets/design-system'"],
|
|
34
|
+
id: 'ds-autocomplete',
|
|
35
|
+
metadata: { nestable: true },
|
|
36
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=14860-11893
|
|
2
|
+
// source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-avatar
|
|
3
|
+
// component=DsAvatar
|
|
4
|
+
//
|
|
5
|
+
// `Size` and `Type` map to the code props. Figma's boolean `Placeholder` variant has no
|
|
6
|
+
// code equivalent — initials-vs-photo is automatic (required `name` drives initials, an
|
|
7
|
+
// optional `src` drives the photo) — so it is ignored. `name` is content, not derivable
|
|
8
|
+
// from Figma, so it is emitted as a placeholder (see `ds-user-card.figma.ts`).
|
|
9
|
+
import figma from 'figma';
|
|
10
|
+
|
|
11
|
+
const instance = figma.selectedInstance;
|
|
12
|
+
|
|
13
|
+
const size =
|
|
14
|
+
instance.getEnum('Size', {
|
|
15
|
+
'XSM - 18': 'xsm',
|
|
16
|
+
'SM - 24': 'sm',
|
|
17
|
+
'Regular - 32': 'regular',
|
|
18
|
+
'MD - 48': 'md',
|
|
19
|
+
'LG - 80': 'lg',
|
|
20
|
+
'XL - 144': 'xl',
|
|
21
|
+
}) ?? 'regular';
|
|
22
|
+
|
|
23
|
+
const type = instance.getEnum('Type', { Circle: 'circle', Rounded: 'rounded' }) ?? 'circle';
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
example: figma.code`<DsAvatar name="Full Name" size="${size}" type="${type}" />`,
|
|
27
|
+
imports: ["import { DsAvatar } from '@drivenets/design-system'"],
|
|
28
|
+
id: 'ds-avatar',
|
|
29
|
+
metadata: { nestable: true },
|
|
30
|
+
};
|
|
@@ -6,7 +6,11 @@ import type { DsAvatarProps } from './ds-avatar.types';
|
|
|
6
6
|
import { DsTooltip } from '../ds-tooltip';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* @summary Displays a user's profile picture, falling back to initials.
|
|
10
|
+
*
|
|
11
|
+
* Renders a circular or rounded avatar from an image `src`. When the image is
|
|
12
|
+
* missing or fails to load, the trimmed initials derived from `name` are shown
|
|
13
|
+
* instead, and `name` is surfaced in a tooltip on hover.
|
|
10
14
|
*/
|
|
11
15
|
export const DsAvatar: FC<DsAvatarProps> = ({
|
|
12
16
|
src,
|
|
@@ -40,3 +44,4 @@ export const DsAvatar: FC<DsAvatarProps> = ({
|
|
|
40
44
|
</DsTooltip>
|
|
41
45
|
);
|
|
42
46
|
};
|
|
47
|
+
DsAvatar.displayName = 'DsAvatar';
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export const dsAvatarSizes = ['xsm', 'sm', 'regular', 'md', 'lg', 'xl'] as const;
|
|
4
|
+
export const dsAvatarTypes = ['circle', 'rounded'] as const;
|
|
5
|
+
|
|
6
|
+
export type DsAvatarSize = (typeof dsAvatarSizes)[number];
|
|
7
|
+
export type DsAvatarType = (typeof dsAvatarTypes)[number];
|
|
5
8
|
|
|
6
9
|
export interface DsAvatarProps {
|
|
7
10
|
/**
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=14870-20161
|
|
2
|
+
// source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-avatar-group
|
|
3
|
+
// component=DsAvatarGroup
|
|
4
|
+
//
|
|
5
|
+
// `Size` maps to the code prop (note the key is `XS - 18`, unlike `ds-avatar`'s `XSM - 18`).
|
|
6
|
+
// `avatars` is a required data array, not derivable from Figma, so it is emitted as an empty
|
|
7
|
+
// placeholder for the developer to fill in (see `ds-select.figma.ts`). The Figma set only
|
|
8
|
+
// models `type=circle` (code also supports `rounded`) and does not expose `max`, so neither
|
|
9
|
+
// is mapped.
|
|
10
|
+
import figma from 'figma';
|
|
11
|
+
|
|
12
|
+
const instance = figma.selectedInstance;
|
|
13
|
+
|
|
14
|
+
const size =
|
|
15
|
+
instance.getEnum('Size', {
|
|
16
|
+
'XS - 18': 'xsm',
|
|
17
|
+
'SM - 24': 'sm',
|
|
18
|
+
'Regular - 32': 'regular',
|
|
19
|
+
'MD - 48': 'md',
|
|
20
|
+
}) ?? 'regular';
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
example: figma.code`<DsAvatarGroup avatars={[]} size="${size}" />`,
|
|
24
|
+
imports: ["import { DsAvatarGroup } from '@drivenets/design-system'"],
|
|
25
|
+
id: 'ds-avatar-group',
|
|
26
|
+
metadata: { nestable: true },
|
|
27
|
+
};
|
|
@@ -7,7 +7,11 @@ import { DsTooltip } from '../ds-tooltip';
|
|
|
7
7
|
import { DsTypography } from '../ds-typography';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* @summary Overlapping avatars with overflow collapse and tooltip.
|
|
11
|
+
*
|
|
12
|
+
* Renders a row of {@link DsAvatar} members that share `size` and `type`. When
|
|
13
|
+
* `avatars.length` exceeds `max`, the remainder collapse behind a `+N`
|
|
14
|
+
* indicator; hovering it lists the hidden names in a tooltip.
|
|
11
15
|
*/
|
|
12
16
|
export const DsAvatarGroup: FC<DsAvatarGroupProps> = ({
|
|
13
17
|
avatars,
|
|
@@ -49,3 +53,4 @@ export const DsAvatarGroup: FC<DsAvatarGroupProps> = ({
|
|
|
49
53
|
</div>
|
|
50
54
|
);
|
|
51
55
|
};
|
|
56
|
+
DsAvatarGroup.displayName = 'DsAvatarGroup';
|
|
@@ -2,7 +2,9 @@ import type { DsAvatarProps, DsAvatarSize, DsAvatarType } from '../ds-avatar';
|
|
|
2
2
|
|
|
3
3
|
export interface DsAvatarGroupProps {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Avatar items to display. Each item accepts `DsAvatar` props except `size`
|
|
6
|
+
* and `type`, which are set on the group. `name` is required; `src` and `alt`
|
|
7
|
+
* are optional — without `src`, initials are shown per `DsAvatar`.
|
|
6
8
|
*/
|
|
7
9
|
avatars: Omit<DsAvatarProps, 'size' | 'type'>[];
|
|
8
10
|
/**
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=15015-2480
|
|
2
|
+
// source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-breadcrumb
|
|
3
|
+
// component=DsBreadcrumb
|
|
4
|
+
//
|
|
5
|
+
// `DAP_Breadcrumbs-nav_v01` maps to `DsBreadcrumb`. Its `steps`/`icons`/`back` variants do
|
|
6
|
+
// not map to props: the trail is built from a single `items` array (Figma's fixed
|
|
7
|
+
// `steps=1..7` variants only exist because a component can't repeat an array), the per-item
|
|
8
|
+
// icon lives in each `items` entry, and there is no back-navigation feature in code. `items`
|
|
9
|
+
// is required data, so it is emitted as an empty placeholder (see `ds-select.figma.ts`). The
|
|
10
|
+
// single-crumb atom `DAP_Breadcrumbs-item_v01` has no public export and is intentionally not
|
|
11
|
+
// connected.
|
|
12
|
+
import figma from 'figma';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
example: figma.code`<DsBreadcrumb items={[]} />`,
|
|
16
|
+
imports: ["import { DsBreadcrumb } from '@drivenets/design-system'"],
|
|
17
|
+
id: 'ds-breadcrumb',
|
|
18
|
+
metadata: { nestable: true },
|
|
19
|
+
};
|
|
@@ -11,6 +11,12 @@ const iconSizeMap: Record<ButtonV3Size, IconSize> = Object.freeze({
|
|
|
11
11
|
tiny: 'tiny',
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Button for user-triggered actions that do not navigate to another route.
|
|
16
|
+
* Supports color palettes, emphasis variants, sizes, icon-only layout, loading and selected states.
|
|
17
|
+
*
|
|
18
|
+
* @summary action button with color/variant/size, icon-only, loading and selected states
|
|
19
|
+
*/
|
|
14
20
|
const DsButtonV3 = ({
|
|
15
21
|
ref,
|
|
16
22
|
className,
|
|
@@ -51,9 +51,8 @@ const Root = ({
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
* Card header
|
|
55
|
-
*
|
|
56
|
-
* or provide custom children for full flexibility.
|
|
54
|
+
* Card header — title row and optional trailing content.
|
|
55
|
+
* Provide custom children for full layout flexibility.
|
|
57
56
|
*/
|
|
58
57
|
const Header = ({ className, children, ref, ...rest }: DsCardHeaderProps) => (
|
|
59
58
|
<div ref={ref} className={classNames(styles.header, className)} {...rest}>
|
|
@@ -79,6 +78,11 @@ const Footer = ({ className, children, ref, ...rest }: DsCardFooterProps) => (
|
|
|
79
78
|
</div>
|
|
80
79
|
);
|
|
81
80
|
|
|
81
|
+
Root.displayName = 'DsCard.Root';
|
|
82
|
+
Header.displayName = 'DsCard.Header';
|
|
83
|
+
Body.displayName = 'DsCard.Body';
|
|
84
|
+
Footer.displayName = 'DsCard.Footer';
|
|
85
|
+
|
|
82
86
|
export const DsCard = {
|
|
83
87
|
Root,
|
|
84
88
|
Header,
|
|
@@ -121,10 +121,18 @@ const ContentHeader = ({
|
|
|
121
121
|
</div>
|
|
122
122
|
);
|
|
123
123
|
|
|
124
|
+
Header.displayName = 'DsCatalogLayout.Header';
|
|
125
|
+
Body.displayName = 'DsCatalogLayout.Body';
|
|
126
|
+
SideMenu.displayName = 'DsCatalogLayout.SideMenu';
|
|
127
|
+
Content.displayName = 'DsCatalogLayout.Content';
|
|
128
|
+
ContentHeader.displayName = 'DsCatalogLayout.ContentHeader';
|
|
129
|
+
|
|
124
130
|
DsCatalogLayout.Header = Header;
|
|
125
131
|
DsCatalogLayout.Body = Body;
|
|
126
132
|
DsCatalogLayout.SideMenu = SideMenu;
|
|
127
133
|
DsCatalogLayout.Content = Content;
|
|
128
134
|
DsCatalogLayout.ContentHeader = ContentHeader;
|
|
129
135
|
|
|
136
|
+
DsCatalogLayout.displayName = 'DsCatalogLayout';
|
|
137
|
+
|
|
130
138
|
export default DsCatalogLayout;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=34856-101385
|
|
2
|
+
// source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-checkbox
|
|
3
|
+
// component=DsCheckbox
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
|
|
6
|
+
const instance = figma.selectedInstance;
|
|
7
|
+
|
|
8
|
+
const inner = instance.findInstance('DAP_checkbox_v03', { traverseInstances: true });
|
|
9
|
+
|
|
10
|
+
const color =
|
|
11
|
+
inner.type === 'INSTANCE' ? inner.getEnum('color', { Default: 'default', warning: 'warning' }) : 'default';
|
|
12
|
+
|
|
13
|
+
const checked =
|
|
14
|
+
inner.type === 'INSTANCE'
|
|
15
|
+
? inner.getEnum('checked', { unchecked: 'unchecked', checked: 'checked', partial: 'partial' })
|
|
16
|
+
: 'unchecked';
|
|
17
|
+
|
|
18
|
+
const state =
|
|
19
|
+
inner.type === 'INSTANCE'
|
|
20
|
+
? inner.getEnum('state', { default: 'default', hover: 'hover', focus: 'focus', disabled: 'disabled' })
|
|
21
|
+
: 'default';
|
|
22
|
+
|
|
23
|
+
const checkedAttr =
|
|
24
|
+
checked === 'partial' ? 'defaultChecked="indeterminate"' : checked === 'checked' ? 'defaultChecked' : '';
|
|
25
|
+
|
|
26
|
+
const attrs = [
|
|
27
|
+
'label="Label"',
|
|
28
|
+
color === 'warning' ? 'variant="warning"' : '',
|
|
29
|
+
checkedAttr,
|
|
30
|
+
state === 'disabled' ? 'disabled' : '',
|
|
31
|
+
]
|
|
32
|
+
.filter(Boolean)
|
|
33
|
+
.join(' ');
|
|
34
|
+
|
|
35
|
+
export default {
|
|
36
|
+
example: figma.code`<DsCheckbox ${attrs} />`,
|
|
37
|
+
imports: ["import { DsCheckbox } from '@drivenets/design-system'"],
|
|
38
|
+
id: 'ds-checkbox-level-2',
|
|
39
|
+
metadata: { nestable: true },
|
|
40
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=33315-40861
|
|
2
|
+
// source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-checkbox
|
|
3
|
+
// component=DsCheckbox
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
|
|
6
|
+
const instance = figma.selectedInstance;
|
|
7
|
+
|
|
8
|
+
const color = instance.getEnum('color', {
|
|
9
|
+
Default: 'default',
|
|
10
|
+
warning: 'warning',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const checked = instance.getEnum('checked', {
|
|
14
|
+
unchecked: 'unchecked',
|
|
15
|
+
checked: 'checked',
|
|
16
|
+
partial: 'partial',
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const state = instance.getEnum('state', {
|
|
20
|
+
default: 'default',
|
|
21
|
+
hover: 'hover',
|
|
22
|
+
focus: 'focus',
|
|
23
|
+
disabled: 'disabled',
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// `partial` is Ark's indeterminate state; both checked values seed the
|
|
27
|
+
// uncontrolled `defaultChecked` so the snippet renders without a handler.
|
|
28
|
+
const checkedAttr =
|
|
29
|
+
checked === 'partial' ? 'defaultChecked="indeterminate"' : checked === 'checked' ? 'defaultChecked' : '';
|
|
30
|
+
|
|
31
|
+
const attrs = [
|
|
32
|
+
'label="Label"',
|
|
33
|
+
color === 'warning' ? 'variant="warning"' : '',
|
|
34
|
+
checkedAttr,
|
|
35
|
+
state === 'disabled' ? 'disabled' : '',
|
|
36
|
+
]
|
|
37
|
+
.filter(Boolean)
|
|
38
|
+
.join(' ');
|
|
39
|
+
|
|
40
|
+
export default {
|
|
41
|
+
example: figma.code`<DsCheckbox ${attrs} />`,
|
|
42
|
+
imports: ["import { DsCheckbox } from '@drivenets/design-system'"],
|
|
43
|
+
id: 'ds-checkbox',
|
|
44
|
+
metadata: { nestable: true },
|
|
45
|
+
};
|
|
@@ -5,7 +5,13 @@ import type { DsCheckboxProps } from './ds-checkbox.types';
|
|
|
5
5
|
import { DsIcon } from '../ds-icon';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* @summary Checkbox for single and grouped selection
|
|
9
|
+
*
|
|
10
|
+
* Checkbox for boolean and multi-select inputs. Use standalone for a single
|
|
11
|
+
* toggle, or compose inside `DsCheckboxGroup` for multi-select lists. Import
|
|
12
|
+
* `useCheckboxSelectAll` from `ds-checkbox-group` for parent "select all"
|
|
13
|
+
* checkboxes. `checked` accepts `true`, `false`, or `"indeterminate"`.
|
|
14
|
+
*
|
|
9
15
|
*/
|
|
10
16
|
const DsCheckbox = ({
|
|
11
17
|
variant = 'default',
|
|
@@ -42,4 +48,6 @@ const DsCheckbox = ({
|
|
|
42
48
|
);
|
|
43
49
|
};
|
|
44
50
|
|
|
51
|
+
DsCheckbox.displayName = 'DsCheckbox';
|
|
52
|
+
|
|
45
53
|
export default DsCheckbox;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=34859-101457
|
|
2
|
+
// source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-checkbox-group
|
|
3
|
+
// component=DsCheckboxGroup
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
|
|
6
|
+
const instance = figma.selectedInstance;
|
|
7
|
+
|
|
8
|
+
const checkboxes = instance.getSlot('checkboxes slot');
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
example: figma.code`<DsCheckboxGroup>${checkboxes}</DsCheckboxGroup>`,
|
|
12
|
+
imports: ["import { DsCheckboxGroup, DsCheckbox } from '@drivenets/design-system'"],
|
|
13
|
+
id: 'ds-checkbox-group',
|
|
14
|
+
metadata: { nestable: false },
|
|
15
|
+
};
|
|
@@ -20,6 +20,13 @@ import { DayView } from './components/day-view';
|
|
|
20
20
|
import { MonthView } from './components/month-view';
|
|
21
21
|
import { YearView } from './components/year-view';
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @summary Date and optional time input with calendar popover and manual typing.
|
|
25
|
+
*
|
|
26
|
+
* Supports controlled (`value` + `onChange`) and uncontrolled (`defaultValue`) modes.
|
|
27
|
+
* Pass `withTime` to include a nested time picker. A clear button appears when a
|
|
28
|
+
* value is set unless `hideClearButton` is set.
|
|
29
|
+
*/
|
|
23
30
|
const DsDatePicker = ({
|
|
24
31
|
placeholder,
|
|
25
32
|
className,
|
|
@@ -211,4 +218,6 @@ const DsDatePicker = ({
|
|
|
211
218
|
);
|
|
212
219
|
};
|
|
213
220
|
|
|
221
|
+
DsDatePicker.displayName = 'DsDatePicker';
|
|
222
|
+
|
|
214
223
|
export default DsDatePicker;
|