@drivenets/design-system 0.12.1 → 0.14.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.
Files changed (122) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/index.cjs +1989 -735
  3. package/dist/index.d.cts +1378 -998
  4. package/dist/index.d.cts.map +1 -1
  5. package/dist/index.d.ts +1378 -998
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1978 -735
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.min.css +1 -1
  10. package/package.json +43 -41
  11. package/src/components/ds-button-v3/ds-button-v3.figma.ts +99 -0
  12. package/src/components/ds-button-v3/ds-button-v3.module.scss +22 -22
  13. package/src/components/ds-card/figma/ds-card-content.figma.ts +15 -0
  14. package/src/components/ds-card/figma/ds-card-footer.figma.ts +15 -0
  15. package/src/components/ds-card/figma/ds-card-header.figma.ts +15 -0
  16. package/src/components/ds-card/figma/ds-card.figma.ts +72 -0
  17. package/src/components/ds-date-input/ds-date-input.utils.ts +2 -2
  18. package/src/components/ds-date-picker/ds-date-picker.figma.ts +19 -0
  19. package/src/components/ds-drawer/ds-drawer.tsx +2 -0
  20. package/src/components/ds-form-control/ds-form-control.figma.ts +76 -0
  21. package/src/components/ds-form-control/ds-form-control.tsx +14 -11
  22. package/src/components/ds-form-control/ds-form-control.types.ts +4 -0
  23. package/src/components/ds-grid/ds-grid.tsx +1 -2
  24. package/src/components/ds-icon/figma/ds-icon-material.figma.batch.ts +10 -0
  25. package/src/components/ds-icon/figma/ds-icon-special.figma.batch.ts +18 -0
  26. package/src/components/ds-icon/figma/ds-icon.figma.batch.json +2873 -0
  27. package/src/components/ds-modal/ds-modal.tsx +3 -0
  28. package/src/components/ds-modal/figma/ds-modal-content.figma.ts +18 -0
  29. package/src/components/ds-modal/figma/ds-modal-footer.figma.ts +19 -0
  30. package/src/components/ds-modal/figma/ds-modal-header.figma.ts +21 -0
  31. package/src/components/ds-modal/figma/ds-modal.figma.ts +36 -0
  32. package/src/components/ds-popover/ds-popover.module.scss +58 -16
  33. package/src/components/ds-popover/ds-popover.tsx +148 -24
  34. package/src/components/ds-popover/ds-popover.types.ts +95 -12
  35. package/src/components/ds-popover/index.ts +1 -1
  36. package/src/components/ds-select/ds-select.figma.ts +53 -0
  37. package/src/components/ds-split-button/ds-split-button.figma.ts +95 -0
  38. package/src/components/ds-status-badge-v2/ds-status-badge-v2.figma.ts +41 -0
  39. package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.module.scss +21 -2
  40. package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.tsx +22 -14
  41. package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.types.ts +1 -6
  42. package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.module.scss +2 -2
  43. package/src/components/ds-table/components/ds-table-cell/ds-table-cell.module.scss +2 -0
  44. package/src/components/ds-table/components/ds-table-cell/ds-table-cell.tsx +42 -11
  45. package/src/components/ds-table/components/ds-table-group-header-cell/ds-table-group-header-cell.module.scss +31 -0
  46. package/src/components/ds-table/components/ds-table-group-header-cell/ds-table-group-header-cell.tsx +48 -0
  47. package/src/components/ds-table/components/ds-table-group-header-cell/ds-table-group-header-cell.types.ts +12 -0
  48. package/src/components/ds-table/components/ds-table-group-header-cell/index.ts +2 -0
  49. package/src/components/ds-table/components/ds-table-header/ds-table-header.module.scss +28 -4
  50. package/src/components/ds-table/components/ds-table-header/ds-table-header.tsx +65 -28
  51. package/src/components/ds-table/components/ds-table-row/ds-table-row.module.scss +26 -0
  52. package/src/components/ds-table/components/ds-table-row/ds-table-row.tsx +3 -0
  53. package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.module.scss +23 -0
  54. package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.tsx +4 -1
  55. package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.types.ts +1 -1
  56. package/src/components/ds-table/components/edit/cell-editors/cell-editors.module.scss +3 -0
  57. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-checkbox.tsx +27 -0
  58. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-date.tsx +50 -0
  59. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-number.tsx +51 -0
  60. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-select.tsx +36 -0
  61. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-text.tsx +50 -0
  62. package/src/components/ds-table/components/edit/cell-editors/index.ts +14 -0
  63. package/src/components/ds-table/components/edit/cell-editors/table-edit-form-control.tsx +31 -0
  64. package/src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.module.scss +28 -0
  65. package/src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.tsx +39 -0
  66. package/src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.types.ts +7 -0
  67. package/src/components/ds-table/components/edit/ds-table-editable-cell/index.ts +2 -0
  68. package/src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.module.scss +48 -0
  69. package/src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.tsx +76 -0
  70. package/src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.types.ts +5 -0
  71. package/src/components/ds-table/components/edit/ds-table-editing-cell/index.ts +2 -0
  72. package/src/components/ds-table/context/ds-table-context.ts +83 -1
  73. package/src/components/ds-table/ds-table-column.types.ts +12 -0
  74. package/src/components/ds-table/ds-table.module.scss +100 -10
  75. package/src/components/ds-table/ds-table.tsx +38 -21
  76. package/src/components/ds-table/ds-table.types.ts +107 -0
  77. package/src/components/ds-table/figma/ds-table-expandable.figma.ts +17 -0
  78. package/src/components/ds-table/figma/ds-table.figma.ts +16 -0
  79. package/src/components/ds-table/filters/adapters/create-checkbox-filter-adapter.tsx +24 -40
  80. package/src/components/ds-table/filters/adapters/create-dual-range-filter-adapter.tsx +10 -31
  81. package/src/components/ds-table/filters/adapters/create-filter-adapter.ts +6 -98
  82. package/src/components/ds-table/filters/components/checkbox-filter/checkbox-filter.module.scss +36 -0
  83. package/src/components/ds-table/filters/components/checkbox-filter/checkbox-filter.tsx +92 -13
  84. package/src/components/ds-table/filters/components/checkbox-filter/index.ts +1 -1
  85. package/src/components/ds-table/filters/components/column-filter-popover/column-filter-popover.module.scss +42 -0
  86. package/src/components/ds-table/filters/components/column-filter-popover/column-filter-popover.tsx +89 -0
  87. package/src/components/ds-table/filters/components/column-filter-popover/column-filter-popover.types.ts +25 -0
  88. package/src/components/ds-table/filters/components/column-filter-popover/index.ts +5 -0
  89. package/src/components/ds-table/filters/hooks/use-table-filters.ts +113 -78
  90. package/src/components/ds-table/filters/index.ts +2 -44
  91. package/src/components/ds-table/filters/types/column-meta.augmentation.ts +19 -0
  92. package/src/components/ds-table/filters/types/filter-adapter.types.ts +48 -81
  93. package/src/components/ds-table/grouping/hooks/use-column-groups.ts +73 -0
  94. package/src/components/ds-table/grouping/index.ts +5 -0
  95. package/src/components/ds-table/grouping/types/column-group-meta.augmentation.ts +26 -0
  96. package/src/components/ds-table/grouping/types/column-group.types.ts +35 -0
  97. package/src/components/ds-table/grouping/utils/column-group.ts +119 -0
  98. package/src/components/ds-table/hooks/use-cell-editor.ts +81 -0
  99. package/src/components/ds-table/index.ts +32 -0
  100. package/src/components/ds-table/styles/_variables.scss +1 -0
  101. package/src/components/ds-table/utils/column-size.ts +9 -8
  102. package/src/components/ds-tag/ds-tag.module.scss +22 -1
  103. package/src/components/ds-tag/ds-tag.tsx +18 -5
  104. package/src/components/ds-tag/ds-tag.types.ts +22 -8
  105. package/src/components/ds-tag/ds-tag.unit.test.ts +32 -0
  106. package/src/components/ds-tag-filter/ds-tag-filter.tsx +14 -22
  107. package/src/components/ds-text-input/ds-text-input.figma.ts +60 -0
  108. package/src/components/ds-time-picker/ds-time-picker.figma.ts +18 -0
  109. package/src/components/ds-workspace-layout/ds-workspace-layout.context.ts +19 -0
  110. package/src/components/ds-workspace-layout/ds-workspace-layout.module.scss +166 -0
  111. package/src/components/ds-workspace-layout/ds-workspace-layout.tsx +135 -0
  112. package/src/components/ds-workspace-layout/ds-workspace-layout.types.ts +52 -0
  113. package/src/components/ds-workspace-layout/index.ts +11 -0
  114. package/src/index.ts +1 -1
  115. package/src/styles/_root_new.scss +2 -0
  116. package/src/styles/_scrollbars.scss +36 -22
  117. package/src/utils/restore-document-body-modal-styles.ts +44 -0
  118. package/src/utils/use-ark-dialog-body-lock-cleanup.ts +36 -0
  119. package/src/components/ds-workspace/ds-workspace.module.scss +0 -55
  120. package/src/components/ds-workspace/ds-workspace.tsx +0 -37
  121. package/src/components/ds-workspace/ds-workspace.types.ts +0 -17
  122. package/src/components/ds-workspace/index.ts +0 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drivenets/design-system",
3
- "version": "0.12.1",
3
+ "version": "0.14.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.cts",
@@ -36,21 +36,20 @@
36
36
  "directory": "/packages/design-system"
37
37
  },
38
38
  "dependencies": {
39
- "@ark-ui/react": "^5.36.1",
39
+ "@ark-ui/react": "^5.37.2",
40
40
  "@dnd-kit/core": "^6.3.1",
41
41
  "@dnd-kit/modifiers": "^9.0.0",
42
42
  "@dnd-kit/sortable": "^10.0.0",
43
43
  "@dnd-kit/utilities": "^3.2.2",
44
- "@radix-ui/react-collapsible": "^1.1.12",
45
- "@radix-ui/react-dialog": "^1.1.15",
46
- "@radix-ui/react-dropdown-menu": "^2.1.16",
47
- "@radix-ui/react-popover": "^1.1.15",
48
- "@radix-ui/react-tooltip": "^1.2.8",
49
- "@radix-ui/react-visually-hidden": "^1.2.4",
44
+ "@radix-ui/react-collapsible": "^1.1.13",
45
+ "@radix-ui/react-dialog": "^1.1.16",
46
+ "@radix-ui/react-dropdown-menu": "^2.1.17",
47
+ "@radix-ui/react-tooltip": "^1.2.9",
48
+ "@radix-ui/react-visually-hidden": "^1.2.5",
50
49
  "@tanstack/react-table": "^8.21.3",
51
- "@tanstack/react-virtual": "^3.13.24",
52
- "@zag-js/react": "^1.40.0",
53
- "@zag-js/steps": "^1.40.0",
50
+ "@tanstack/react-virtual": "^3.14.2",
51
+ "@zag-js/react": "^1.41.2",
52
+ "@zag-js/steps": "^1.41.2",
54
53
  "classnames": "^2.5.1",
55
54
  "csstype": "^3.2.3"
56
55
  },
@@ -62,50 +61,51 @@
62
61
  },
63
62
  "devDependencies": {
64
63
  "@arethetypeswrong/cli": "^0.18.2",
65
- "@eslint/compat": "^2.0.3",
64
+ "@eslint/compat": "^2.1.0",
66
65
  "@faker-js/faker": "^10.3.0",
67
- "@hookform/resolvers": "^5.2.2",
68
- "@rolldown/plugin-babel": "^0.2.2",
69
- "@storybook/addon-a11y": "^10.2.19",
70
- "@storybook/addon-docs": "^10.2.19",
66
+ "@figma/code-connect": "^1.4.8",
67
+ "@hookform/resolvers": "^5.4.0",
68
+ "@rolldown/plugin-babel": "^0.2.3",
69
+ "@storybook/addon-a11y": "^10.4.1",
70
+ "@storybook/addon-docs": "^10.4.1",
71
71
  "@storybook/addon-mcp": "^0.6.0",
72
- "@storybook/addon-vitest": "^10.2.19",
73
- "@storybook/react-vite": "^10.2.19",
74
- "@tanstack/react-query": "^5.90.21",
75
- "@tanstack/react-router": "^1.166.2",
76
- "@tsdown/css": "^0.21.6",
72
+ "@storybook/addon-vitest": "^10.4.1",
73
+ "@storybook/react-vite": "^10.4.1",
74
+ "@tanstack/react-query": "^5.100.14",
75
+ "@tanstack/react-router": "^1.170.8",
76
+ "@tsdown/css": "^0.22.0",
77
77
  "@types/eslint-plugin-jsx-a11y": "^6.10.1",
78
- "@types/react": "^19.2.14",
78
+ "@types/react": "^19.2.15",
79
79
  "@types/react-dom": "^19.2.3",
80
- "@typescript/native-preview": "7.0.0-dev.20260426.1",
81
- "@vitejs/plugin-react": "^6.0.1",
82
- "@vitest/browser-playwright": "^4.1.0",
83
- "@vitest/coverage-v8": "^4.1.5",
80
+ "@typescript/native-preview": "7.0.0-dev.20260521.1",
81
+ "@vitejs/plugin-react": "^6.0.2",
82
+ "@vitest/browser-playwright": "^4.1.7",
83
+ "@vitest/coverage-v8": "^4.1.7",
84
84
  "babel-plugin-react-compiler": "^1.0.0",
85
85
  "eslint": "^10.0.1",
86
86
  "eslint-plugin-jsx-a11y": "^6.10.2",
87
87
  "eslint-plugin-react": "^7.37.5",
88
- "eslint-plugin-react-hooks": "^7.0.1",
89
- "eslint-plugin-storybook": "^10.2.19",
88
+ "eslint-plugin-react-hooks": "^7.1.1",
89
+ "eslint-plugin-storybook": "^10.4.1",
90
90
  "mockdate": "^3.0.5",
91
- "playwright": "^1.58.2",
92
- "publint": "^0.3.18",
93
- "react": "^19.2.4",
94
- "react-dom": "^19.2.4",
95
- "react-hook-form": "^7.71.2",
91
+ "playwright": "^1.60.0",
92
+ "publint": "^0.3.21",
93
+ "react": "^19.2.6",
94
+ "react-dom": "^19.2.6",
95
+ "react-hook-form": "^7.76.1",
96
96
  "remark-gfm": "^4.0.1",
97
- "sass-embedded": "^1.97.3",
98
- "storybook": "^10.2.19",
99
- "tsdown": "^0.21.10",
97
+ "sass-embedded": "^1.100.0",
98
+ "storybook": "^10.4.1",
99
+ "tsdown": "^0.22.0",
100
100
  "typed-scss-modules": "^8.1.1",
101
101
  "typescript": "^6.0.3",
102
102
  "typescript-plugin-css-modules": "^5.2.0",
103
- "vite": "8.0.5",
104
- "vitest": "^4.1.5",
103
+ "vite": "8.0.14",
104
+ "vitest": "^4.1.7",
105
105
  "vitest-browser-react": "^2.1.0",
106
- "zod": "^4.3.6",
107
- "@drivenets/vite-plugin-design-system": "0.0.8",
108
- "@drivenets/eslint-plugin-internal": "0.0.0"
106
+ "zod": "^4.4.3",
107
+ "@drivenets/eslint-plugin-internal": "0.0.0",
108
+ "@drivenets/vite-plugin-design-system": "0.0.9"
109
109
  },
110
110
  "scripts": {
111
111
  "start": "storybook dev -p 6006",
@@ -116,6 +116,8 @@
116
116
  "lint:build": "publint && attw --pack",
117
117
  "typecheck": "pnpm generate-scss-dts && tsgo; EXIT_CODE=$?; rm -rf .scss-dts; exit $EXIT_CODE",
118
118
  "generate-scss-dts": "typed-scss-modules ./src -o ./.scss-dts --nameFormat all --exportType default > /dev/null 2>&1",
119
+ "figma:lint": "figma connect parse --exit-on-unreadable-files",
120
+ "figma:publish": "figma connect publish --exit-on-unreadable-files",
119
121
  "test": "vitest --project=\"!requires-build\"",
120
122
  "test:coverage": "pnpm test --coverage",
121
123
  "test:unit": "vitest --project=unit",
@@ -0,0 +1,99 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=31065-2352
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-button-v3
3
+ // component=DsButtonV3
4
+ import figma from 'figma';
5
+
6
+ const instance = figma.selectedInstance;
7
+
8
+ const variant = instance.getEnum('Variant', {
9
+ primary: 'primary',
10
+ secondary: 'secondary',
11
+ tertiary: 'tertiary',
12
+ });
13
+ const size = instance.getEnum('Size', {
14
+ tiny: 'tiny',
15
+ small: 'small',
16
+ medium: 'medium',
17
+ large: 'large',
18
+ });
19
+ const colorVariant = instance.getEnum('Color', { default: 'default', error: 'error' });
20
+ const isLight = instance.getEnum('light', { true: true, false: false });
21
+ const color = isLight ? 'light' : colorVariant;
22
+ const disabled = instance.getEnum('State', {
23
+ default: false,
24
+ hover: false,
25
+ focus: false,
26
+ active: false,
27
+ disabled: true,
28
+ });
29
+ const iconOnly = instance.getEnum('Icon', { 'icon-only': true, text: false });
30
+
31
+ const structure = instance.findInstance('.button-structure', { traverseInstances: true });
32
+ const showIcon = structure.type === 'INSTANCE' ? structure.getBoolean('Show icon') : false;
33
+
34
+ // `DsButtonV3.icon` is an icon-name string. Swapped icons keep the placeholder layer
35
+ // name (e.g. `DAP_GM_O_check_circle`), so resolve via Code Connect ID or metadata.
36
+ const toIconName = (name: string): string =>
37
+ name
38
+ .replace(/^DAP_DAP_/, 'DAP_')
39
+ .replace(/^DAP_GM_[OS]_/, '')
40
+ .replace(/^DAP_outline_icon\//, '')
41
+ .replace(/^DAP_/, '')
42
+ .replace(/^\/+/, '')
43
+ .replace(/[\s/]+/g, '_')
44
+ .toLowerCase();
45
+
46
+ const iconNameFromCodeConnectId = (id: string | null): string | undefined => {
47
+ if (!id) {
48
+ return undefined;
49
+ }
50
+ if (id.startsWith('ds-icon-o-')) {
51
+ return id.slice('ds-icon-o-'.length);
52
+ }
53
+ if (id.startsWith('ds-icon-s-')) {
54
+ return id.slice('ds-icon-s-'.length);
55
+ }
56
+ return undefined;
57
+ };
58
+
59
+ const resolveIcon = (iconInstance: figma.InstanceHandle): string | undefined => {
60
+ const fromCcId = iconNameFromCodeConnectId(iconInstance.codeConnectId());
61
+ if (fromCcId) {
62
+ return fromCcId;
63
+ }
64
+
65
+ const iconFromMetadata = iconInstance.executeTemplate().metadata?.props?.icon;
66
+ if (typeof iconFromMetadata === 'string') {
67
+ return iconFromMetadata;
68
+ }
69
+
70
+ return toIconName(iconInstance.name);
71
+ };
72
+
73
+ const leadingIcon = structure.type === 'INSTANCE' ? structure.getInstanceSwap('Leading icon') : undefined;
74
+ const iconFromSwap = leadingIcon?.type === 'INSTANCE' ? resolveIcon(leadingIcon) : undefined;
75
+ const iconFromChild =
76
+ structure.type === 'INSTANCE'
77
+ ? structure
78
+ .findConnectedInstances((node) => node.codeConnectId()?.startsWith('ds-icon-') ?? false, {
79
+ traverseInstances: true,
80
+ })
81
+ .find((node): node is figma.InstanceHandle => node.type === 'INSTANCE')
82
+ : undefined;
83
+ const icon = iconFromSwap ?? (iconFromChild ? resolveIcon(iconFromChild) : undefined);
84
+
85
+ const labelNode = instance.findText('Button', { traverseInstances: true });
86
+ const label = labelNode.type === 'TEXT' ? labelNode.textContent : 'Button';
87
+
88
+ const iconProp = icon ? figma.code` icon="${icon}"` : '';
89
+
90
+ export default {
91
+ example: iconOnly
92
+ ? figma.code`<DsButtonV3 variant="${variant}" color="${color}" size="${size}" ${disabled ? 'disabled' : ''}${iconProp} aria-label="${label}" />`
93
+ : showIcon && icon
94
+ ? figma.code`<DsButtonV3 variant="${variant}" color="${color}" size="${size}" ${disabled ? 'disabled' : ''} icon="${icon}">${label}</DsButtonV3>`
95
+ : figma.code`<DsButtonV3 variant="${variant}" color="${color}" size="${size}" ${disabled ? 'disabled' : ''}>${label}</DsButtonV3>`,
96
+ imports: ["import { DsButtonV3 } from '@drivenets/design-system'"],
97
+ id: 'ds-button-v3',
98
+ metadata: { nestable: true },
99
+ };
@@ -293,66 +293,66 @@ $focus-ring-width: 2px;
293
293
  }
294
294
 
295
295
  .root[data-color='light'][data-variant='primary'] {
296
- background-color: var(--background-ondark-primary);
296
+ background-color: var(--background-light-primary);
297
297
  color: var(--font-on-action);
298
298
  border-color: transparent;
299
299
 
300
300
  &:hover:not(:disabled):not(:active):not([data-selected='true']) {
301
- background-color: var(--background-ondark-primary-hover);
301
+ background-color: var(--background-light-primary-hover);
302
302
  }
303
303
 
304
304
  &:active:not(:disabled) {
305
- background-color: var(--background-ondark-primary-selected);
305
+ background-color: var(--background-light-primary-selected);
306
306
  }
307
307
 
308
308
  &:focus-visible {
309
- @include focus-ring(var(--outline-outline-inverse));
309
+ @include focus-ring(var(--outline-inverse));
310
310
 
311
- background-color: var(--background-ondark-primary-hover);
311
+ background-color: var(--background-light-primary-hover);
312
312
  border-color: var(--border-action-secondary);
313
313
  }
314
314
 
315
315
  &[data-selected='true'] {
316
- background-color: var(--background-ondark-primary-selected);
316
+ background-color: var(--background-light-primary-selected);
317
317
  }
318
318
 
319
319
  &:disabled:not([data-loading]) {
320
- background-color: var(--background-ondark-disabled);
321
- color: var(--font-disabled);
320
+ background-color: var(--background-light-disabled);
321
+ color: var(--font-light-disabled);
322
322
  }
323
323
  }
324
324
 
325
325
  .root[data-color='light'][data-variant='secondary'] {
326
326
  background-color: transparent;
327
327
  color: var(--font-on-action);
328
- border-color: var(--border-ondark-secondary);
328
+ border-color: var(--border-light-secondary);
329
329
 
330
330
  &:hover:not(:disabled):not(:active):not([data-selected='true']) {
331
- background-color: var(--background-ondark-secondary-hover);
331
+ background-color: var(--light-buttons-secondary-background);
332
332
  color: var(--font-on-action);
333
333
  }
334
334
 
335
335
  &:active:not(:disabled) {
336
- background-color: var(--background-ondark-secondary-selected);
336
+ background-color: var(--background-light-secondary-selected);
337
337
  color: var(--font-on-action);
338
338
  }
339
339
 
340
340
  &:focus-visible {
341
- @include focus-ring(var(--outline-outline-inverse));
341
+ @include focus-ring(var(--outline-inverse));
342
342
 
343
- background-color: var(--background-ondark-secondary-hover);
343
+ background-color: var(--light-buttons-secondary-background);
344
344
  border-color: var(--border-action-secondary);
345
345
  color: var(--font-on-action);
346
346
  }
347
347
 
348
348
  &[data-selected='true'] {
349
- background-color: var(--background-ondark-secondary-selected);
349
+ background-color: var(--background-light-secondary-selected);
350
350
  }
351
351
 
352
352
  &:disabled:not([data-loading]) {
353
353
  background-color: transparent;
354
- color: var(--font-ondark-disabled);
355
- border-color: var(--background-ondark-disabled);
354
+ color: var(--font-light-disabled);
355
+ border-color: var(--border-light-disabled);
356
356
  }
357
357
  }
358
358
 
@@ -362,29 +362,29 @@ $focus-ring-width: 2px;
362
362
  border-color: transparent;
363
363
 
364
364
  &:hover:not(:disabled):not(:active):not([data-selected='true']) {
365
- background-color: var(--background-ondark-secondary-hover);
365
+ background-color: var(--light-buttons-secondary-background);
366
366
  color: var(--font-on-action);
367
367
  }
368
368
 
369
369
  &:active:not(:disabled) {
370
- background-color: var(--background-ondark-secondary-selected);
370
+ background-color: var(--background-light-secondary-selected);
371
371
  color: var(--font-on-action);
372
372
  }
373
373
 
374
374
  &:focus-visible {
375
- @include focus-ring(var(--outline-outline-inverse));
375
+ @include focus-ring(var(--outline-inverse));
376
376
 
377
- background-color: var(--background-ondark-secondary-hover);
377
+ background-color: var(--light-buttons-secondary-background);
378
378
  border-color: var(--border-action-secondary);
379
379
  color: var(--font-on-action);
380
380
  }
381
381
 
382
382
  &[data-selected='true'] {
383
- background-color: var(--background-ondark-secondary-selected);
383
+ background-color: var(--background-light-secondary-selected);
384
384
  }
385
385
 
386
386
  &:disabled:not([data-loading]) {
387
387
  background-color: transparent;
388
- color: var(--font-ondark-disabled);
388
+ color: var(--font-light-disabled);
389
389
  }
390
390
  }
@@ -0,0 +1,15 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=28122-12357
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-card
3
+ // component=DsCard.Body
4
+ //
5
+ // `card content` maps to `DsCard.Body`. The section exposes no named slot — its
6
+ // content is a freeform `DAP_Content placeholder_v01` marker — so the children are
7
+ // a static placeholder. Expose a Figma slot on the section to forward real content.
8
+ import figma from 'figma';
9
+
10
+ export default {
11
+ example: figma.code`<DsCard.Body>Card content</DsCard.Body>`,
12
+ imports: ["import { DsCard } from '@drivenets/design-system'"],
13
+ id: 'ds-card-content',
14
+ metadata: { nestable: true },
15
+ };
@@ -0,0 +1,15 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=28122-12361
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-card
3
+ // component=DsCard.Footer
4
+ //
5
+ // `card footer` maps to `DsCard.Footer`. The section exposes no named slot — its
6
+ // content is a freeform `DAP_Content placeholder_v01` marker — so the children are
7
+ // a static placeholder. Expose a Figma slot on the section to forward real content.
8
+ import figma from 'figma';
9
+
10
+ export default {
11
+ example: figma.code`<DsCard.Footer>Card footer</DsCard.Footer>`,
12
+ imports: ["import { DsCard } from '@drivenets/design-system'"],
13
+ id: 'ds-card-footer',
14
+ metadata: { nestable: true },
15
+ };
@@ -0,0 +1,15 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=28122-12353
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-card
3
+ // component=DsCard.Header
4
+ //
5
+ // `card header` maps to `DsCard.Header`. The section exposes no named slot — its
6
+ // content is a freeform `DAP_Content placeholder_v01` marker — so the children are
7
+ // a static placeholder. Expose a Figma slot on the section to forward real content.
8
+ import figma from 'figma';
9
+
10
+ export default {
11
+ example: figma.code`<DsCard.Header>Card title</DsCard.Header>`,
12
+ imports: ["import { DsCard } from '@drivenets/design-system'"],
13
+ id: 'ds-card-header',
14
+ metadata: { nestable: true },
15
+ };
@@ -0,0 +1,72 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=25703-1142
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-card
3
+ // component=DsCard
4
+ //
5
+ // `DAP_Card_v01` is the compound card. It maps to the composed `DsCard.Root` and
6
+ // resolves its `card header` / `card content` / `card footer` sections dynamically
7
+ // via their own Code Connect templates, so a section that is removed or restyled
8
+ // stays in sync. Sections are always present in the current design, but resolving
9
+ // them keeps a single source of truth for each slot.
10
+ import figma from 'figma';
11
+
12
+ const instance = figma.selectedInstance;
13
+
14
+ const size =
15
+ instance.getEnum('Size', {
16
+ Large: 'large',
17
+ Medium: 'medium',
18
+ Small: 'small',
19
+ }) ?? 'medium';
20
+
21
+ const state = instance.getEnum('State', {
22
+ default: 'default',
23
+ hover: 'default',
24
+ focus: 'default',
25
+ selected: 'selected',
26
+ 'selected blue': 'highlighted',
27
+ disabled: 'disabled',
28
+ });
29
+
30
+ const selected = state === 'selected' || state === 'highlighted';
31
+ const highlightSelected = state === 'highlighted';
32
+ const disabled = state === 'disabled';
33
+
34
+ // A card is only selectable when it carries a selection state. Disabled is an
35
+ // independent modifier, so it must not imply `selectable` on its own.
36
+ const selectable = selected;
37
+
38
+ const flags = [
39
+ selectable && 'selectable',
40
+ selected && 'selected',
41
+ highlightSelected && 'highlightSelected',
42
+ disabled && 'disabled',
43
+ ]
44
+ .filter(Boolean)
45
+ .join(' ');
46
+
47
+ const flagsAttr = flags ? ` ${flags}` : '';
48
+
49
+ const header = instance.findInstance('card header', { traverseInstances: true });
50
+ let headerCode: figma.ResultSection[] | undefined;
51
+ if (header.type === 'INSTANCE') {
52
+ headerCode = header.executeTemplate().example;
53
+ }
54
+
55
+ const content = instance.findInstance('card content', { traverseInstances: true });
56
+ let contentCode: figma.ResultSection[] | undefined;
57
+ if (content.type === 'INSTANCE') {
58
+ contentCode = content.executeTemplate().example;
59
+ }
60
+
61
+ const footer = instance.findInstance('card footer', { traverseInstances: true });
62
+ let footerCode: figma.ResultSection[] | undefined;
63
+ if (footer.type === 'INSTANCE') {
64
+ footerCode = footer.executeTemplate().example;
65
+ }
66
+
67
+ export default {
68
+ example: figma.code`<DsCard.Root size="${size}"${flagsAttr}>${headerCode}${contentCode}${footerCode}</DsCard.Root>`,
69
+ imports: ["import { DsCard } from '@drivenets/design-system'"],
70
+ id: 'ds-card',
71
+ metadata: { nestable: false },
72
+ };
@@ -23,7 +23,7 @@ interface ParsedDateRange {
23
23
  */
24
24
  export const isoStringToDateValue = (isoDate: string): DateValue | undefined => {
25
25
  try {
26
- return parseDate(isoDate) as unknown as DateValue;
26
+ return parseDate(isoDate);
27
27
  } catch {
28
28
  return undefined;
29
29
  }
@@ -109,7 +109,7 @@ const parseDateString = (dateStr: string): DateValue | null => {
109
109
  return null;
110
110
  }
111
111
 
112
- return new CalendarDate(yearNum, monthNum, dayNum) as unknown as DateValue;
112
+ return new CalendarDate(yearNum, monthNum, dayNum);
113
113
  };
114
114
 
115
115
  /**
@@ -0,0 +1,19 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=30063-134227
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-date-picker
3
+ // component=DsDatePicker
4
+ //
5
+ // `DAP_Date picker_v1.1` only exposes a `type` variant (day/month/year calendar view),
6
+ // which is internal UI state with no code-prop equivalent. The snippet is therefore an
7
+ // illustrative controlled-usage starter (props are not derived from Figma) showing the
8
+ // idiomatic `useState` + `value`/`onChange` pattern. `fcMember`/`fcProps` are surfaced so
9
+ // a parent `DsFormControl` template can render `<DsFormControl.DatePicker />`.
10
+ import figma from 'figma';
11
+
12
+ export default {
13
+ example: figma.code`const [value, setValue] = useState<Date | null>(null);
14
+
15
+ <DsDatePicker value={value} onChange={setValue} withTime placeholder="mm/dd/yyyy, hh:mm AM/PM" />`,
16
+ imports: ["import { useState } from 'react'", "import { DsDatePicker } from '@drivenets/design-system'"],
17
+ id: 'ds-date-picker',
18
+ metadata: { nestable: true, props: { fcMember: 'DatePicker', fcProps: '' } },
19
+ };
@@ -6,6 +6,7 @@ import type { DsDrawerProps } from './ds-drawer.types';
6
6
  import styles from './ds-drawer.module.scss';
7
7
  import { DsIcon } from '../ds-icon';
8
8
  import { DsTypography } from '../ds-typography';
9
+ import { useArkDialogBodyLockCleanup } from '../../utils/use-ark-dialog-body-lock-cleanup';
9
10
  import { useResponsiveValue } from '../../utils/responsive';
10
11
 
11
12
  const DsDrawer = ({
@@ -22,6 +23,7 @@ const DsDrawer = ({
22
23
  children,
23
24
  }: DsDrawerProps) => {
24
25
  const resolvedColumns = useResponsiveValue(columns);
26
+ useArkDialogBodyLockCleanup(open, backdrop);
25
27
 
26
28
  const handleOpenChange = (details: { open: boolean }) => {
27
29
  onOpenChange(details.open);
@@ -0,0 +1,76 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=13484-17388
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-form-control
3
+ // component=DsFormControl
4
+ //
5
+ // The Figma component `DAP_input/ input form unit/ vertical_v01` is the generic form-unit
6
+ // wrapper that owns the label, description and caption. Its `Swap Input to Select` slot
7
+ // holds the actual control (select, text/number/password input, ...), which is resolved
8
+ // dynamically. Inner templates that expose `metadata.props.fcMember` are linked as the
9
+ // idiomatic `DsFormControl.<member>` compound; anything else falls back to its bare snippet.
10
+ import figma from 'figma';
11
+
12
+ const instance = figma.selectedInstance;
13
+
14
+ const showLabel = instance.getBoolean('Show Label');
15
+ const showCaption = instance.getBoolean('Show Caption');
16
+ const showDescription = instance.getBoolean('Show Description');
17
+ const descriptionText = instance.getString('Description Text');
18
+
19
+ const labelInstance = instance.findInstance('input label', { traverseInstances: true });
20
+ const required = labelInstance.type === 'INSTANCE' ? labelInstance.getBoolean('Required') : false;
21
+
22
+ const labelText = instance.findText('Input label', { traverseInstances: true });
23
+ const label = labelText.type === 'TEXT' ? labelText.textContent : 'Label';
24
+
25
+ const captionInstance = instance.findInstance('inputs/ Input Caption', { traverseInstances: true });
26
+ const status =
27
+ captionInstance.type === 'INSTANCE'
28
+ ? (captionInstance.getEnum('Status', {
29
+ Default: 'info',
30
+ Success: 'success',
31
+ Error: 'error',
32
+ Warning: 'warning',
33
+ }) ?? 'info')
34
+ : 'info';
35
+
36
+ // The caption text isn't bound to a component property, so read the first text layer
37
+ // inside the caption instance and pass it through as the `message` value.
38
+ const captionText =
39
+ captionInstance.type === 'INSTANCE'
40
+ ? captionInstance.findLayers((node) => node.type === 'TEXT', { traverseInstances: true })[0]
41
+ : undefined;
42
+ const message = captionText?.type === 'TEXT' ? captionText.textContent : 'Caption';
43
+
44
+ // Resolve the swapped control and build the `DsFormControl.<member>` child from its
45
+ // surfaced metadata. Fall back to the bare snippet when no `fcMember` is exposed.
46
+ const inner = instance.getInstanceSwap('Swap Input to Select');
47
+
48
+ let child;
49
+ if (inner && inner.type === 'INSTANCE') {
50
+ const { example, metadata } = inner.executeTemplate();
51
+ const fcMember = metadata?.props?.fcMember;
52
+ const fcProps = metadata?.props?.fcProps ?? '';
53
+
54
+ child = fcMember ? figma.code`<DsFormControl.${fcMember} ${fcProps} />` : example;
55
+ }
56
+
57
+ const description = showDescription
58
+ ? figma.code`<DsFormControl.Description>${descriptionText}</DsFormControl.Description>`
59
+ : '';
60
+
61
+ const labelAttr = `label="${label}"`;
62
+ const requiredAttr = required ? 'required' : '';
63
+ const hideLabelAttr = showLabel ? '' : 'hideLabel';
64
+ const statusAttr = status !== 'info' ? `status="${status}"` : '';
65
+ const messageAttr = showCaption ? `message="${message}"` : '';
66
+
67
+ const formControlAttrs = [labelAttr, requiredAttr, hideLabelAttr, statusAttr, messageAttr]
68
+ .filter(Boolean)
69
+ .join(' ');
70
+
71
+ export default {
72
+ example: figma.code`<DsFormControl ${formControlAttrs}>${description}${child}</DsFormControl>`,
73
+ imports: ["import { DsFormControl } from '@drivenets/design-system'"],
74
+ id: 'ds-form-control',
75
+ metadata: { nestable: false },
76
+ };
@@ -45,6 +45,7 @@ const DsFormControl = ({
45
45
  id,
46
46
  status,
47
47
  label,
48
+ hideLabel = false,
48
49
  required = false,
49
50
  slots,
50
51
  message,
@@ -68,17 +69,19 @@ const DsFormControl = ({
68
69
  )}
69
70
  style={style}
70
71
  >
71
- <div className={styles.labelContainer}>
72
- <label
73
- htmlFor={controlId}
74
- className={classNames(styles.label, {
75
- [styles.required]: required,
76
- })}
77
- >
78
- {label}
79
- </label>
80
- {slots?.endAdornment && <div className={styles.endAdornment}>{slots.endAdornment}</div>}
81
- </div>
72
+ {!hideLabel && (
73
+ <div className={styles.labelContainer}>
74
+ <label
75
+ htmlFor={controlId}
76
+ className={classNames(styles.label, {
77
+ [styles.required]: required,
78
+ })}
79
+ >
80
+ {label}
81
+ </label>
82
+ {slots?.endAdornment && <div className={styles.endAdornment}>{slots.endAdornment}</div>}
83
+ </div>
84
+ )}
82
85
 
83
86
  {children}
84
87
 
@@ -17,6 +17,10 @@ export interface DsFormControlProps extends React.PropsWithChildren {
17
17
  * Label text
18
18
  */
19
19
  label: string;
20
+ /**
21
+ * When true, the label row is not rendered (e.g. inline table cell editors).
22
+ */
23
+ hideLabel?: boolean;
20
24
  /**
21
25
  * Marks the field as required
22
26
  */