@drivenets/design-system 0.15.0 → 0.17.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 (206) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/index.cjs +1092 -381
  3. package/dist/index.d.cts +886 -1204
  4. package/dist/index.d.cts.map +1 -1
  5. package/dist/index.d.ts +886 -1204
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1076 -377
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.min.css +1 -1
  10. package/package.json +36 -34
  11. package/src/components/ds-alert-banner/ds-alert-banner.tsx +16 -6
  12. package/src/components/ds-autocomplete/ds-autocomplete.figma.ts +36 -0
  13. package/src/components/ds-autocomplete/ds-autocomplete.tsx +2 -0
  14. package/src/components/ds-avatar/ds-avatar.figma.ts +30 -0
  15. package/src/components/ds-avatar/ds-avatar.tsx +6 -1
  16. package/src/components/ds-avatar/ds-avatar.types.ts +5 -2
  17. package/src/components/ds-avatar-group/ds-avatar-group.figma.ts +27 -0
  18. package/src/components/ds-avatar-group/ds-avatar-group.tsx +6 -1
  19. package/src/components/ds-avatar-group/ds-avatar-group.types.ts +3 -1
  20. package/src/components/ds-breadcrumb/ds-breadcrumb.figma.ts +19 -0
  21. package/src/components/ds-breadcrumb/ds-breadcrumb.tsx +2 -0
  22. package/src/components/ds-button/ds-button.tsx +2 -0
  23. package/src/components/ds-button-v3/ds-button-v3.figma.ts +3 -3
  24. package/src/components/ds-button-v3/ds-button-v3.tsx +6 -0
  25. package/src/components/ds-button-v3/index.ts +2 -0
  26. package/src/components/ds-card/ds-card.tsx +7 -3
  27. package/src/components/ds-card/figma/ds-card-content.figma.ts +2 -2
  28. package/src/components/ds-card/figma/ds-card-footer.figma.ts +2 -2
  29. package/src/components/ds-card/figma/ds-card-header.figma.ts +2 -2
  30. package/src/components/ds-card/figma/ds-card.figma.ts +2 -2
  31. package/src/components/ds-catalog-layout/ds-catalog-layout.figma.ts +51 -0
  32. package/src/components/ds-catalog-layout/ds-catalog-layout.tsx +15 -6
  33. package/src/components/ds-checkbox/ds-checkbox-level-2.figma.ts +40 -0
  34. package/src/components/ds-checkbox/ds-checkbox.figma.ts +45 -0
  35. package/src/components/ds-checkbox/ds-checkbox.module.scss +1 -1
  36. package/src/components/ds-checkbox/ds-checkbox.tsx +9 -1
  37. package/src/components/ds-checkbox-group/ds-checkbox-group.figma.ts +15 -0
  38. package/src/components/ds-checkbox-group/ds-checkbox-group.tsx +2 -0
  39. package/src/components/ds-chip/ds-chip.tsx +2 -0
  40. package/src/components/ds-chip-group/ds-chip-group.tsx +2 -0
  41. package/src/components/ds-comment-bubble/components/ds-comment-thread/ds-comment-thread.tsx +1 -0
  42. package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.tsx +1 -0
  43. package/src/components/ds-comment-bubble/ds-comment-bubble.tsx +1 -0
  44. package/src/components/ds-comment-card/ds-comment-card.tsx +1 -0
  45. package/src/components/ds-comment-indicator/ds-comment-indicator.tsx +1 -0
  46. package/src/components/ds-comments-drawer/components/comments-filter-modal/index.ts +0 -1
  47. package/src/components/ds-comments-drawer/ds-comments-drawer.tsx +1 -0
  48. package/src/components/ds-confirmation/ds-confirmation.tsx +13 -10
  49. package/src/components/ds-date-input/ds-date-input.tsx +2 -0
  50. package/src/components/ds-date-picker/ds-date-picker.figma.ts +2 -2
  51. package/src/components/ds-date-picker/ds-date-picker.tsx +9 -0
  52. package/src/components/ds-date-picker/ds-date-picker.types.ts +1 -1
  53. package/src/components/ds-date-range-picker/ds-date-range-picker.tsx +2 -0
  54. package/src/components/ds-dialog/ds-dialog.tsx +9 -0
  55. package/src/components/ds-dialog/ds-dialog.types.ts +1 -1
  56. package/src/components/ds-divider/ds-divider.figma.ts +19 -0
  57. package/src/components/ds-divider/ds-divider.tsx +2 -0
  58. package/src/components/ds-drawer/ds-drawer.tsx +19 -8
  59. package/src/components/ds-drawer/figma/ds-drawer-content.figma.ts +15 -0
  60. package/src/components/ds-drawer/figma/ds-drawer-footer.figma.ts +19 -0
  61. package/src/components/ds-drawer/figma/ds-drawer-header.figma.ts +16 -0
  62. package/src/components/ds-drawer/figma/ds-drawer.figma.ts +36 -0
  63. package/src/components/ds-dropdown-menu/ds-dropdown-menu.module.scss +12 -3
  64. package/src/components/ds-dropdown-menu/ds-dropdown-menu.tsx +24 -6
  65. package/src/components/ds-dropdown-menu/ds-dropdown-menu.types.ts +10 -1
  66. package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-footer.figma.ts +11 -0
  67. package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-group.figma.ts +23 -0
  68. package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-item.figma.ts +29 -0
  69. package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-separator.figma.ts +11 -0
  70. package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu.figma.ts +24 -0
  71. package/src/components/ds-expandable-text-input/ds-expandable-text-input.figma.ts +24 -0
  72. package/src/components/ds-expandable-text-input/ds-expandable-text-input.tsx +1 -0
  73. package/src/components/ds-file-upload/components/file-upload-item/index.ts +0 -1
  74. package/src/components/ds-file-upload/ds-file-upload.figma.ts +29 -0
  75. package/src/components/ds-file-upload/ds-file-upload.tsx +2 -0
  76. package/src/components/ds-filter-status-icon/ds-filter-status-icon.figma.ts +22 -0
  77. package/src/components/ds-filter-status-icon/ds-filter-status-icon.tsx +1 -0
  78. package/src/components/ds-form-control/ds-form-control.figma.ts +2 -2
  79. package/src/components/ds-form-control/ds-form-control.tsx +16 -11
  80. package/src/components/ds-grid/index.ts +3 -0
  81. package/src/components/ds-icon/ds-icon.tsx +2 -0
  82. package/src/components/ds-icon/figma/ds-icon-material.figma.batch.ts +1 -1
  83. package/src/components/ds-icon/figma/ds-icon-special.figma.batch.ts +1 -1
  84. package/src/components/ds-key-value-pair/ds-key-value-pair.figma.ts +24 -0
  85. package/src/components/ds-key-value-pair/ds-key-value-pair.tsx +2 -0
  86. package/src/components/ds-loader/ds-loader.figma.ts +11 -0
  87. package/src/components/ds-loader/ds-loader.tsx +2 -0
  88. package/src/components/ds-modal/ds-modal.tsx +17 -7
  89. package/src/components/ds-modal/figma/ds-modal-content.figma.ts +2 -2
  90. package/src/components/ds-modal/figma/ds-modal-footer.figma.ts +2 -2
  91. package/src/components/ds-modal/figma/ds-modal-header.figma.ts +2 -2
  92. package/src/components/ds-modal/figma/ds-modal.figma.ts +2 -2
  93. package/src/components/ds-number-input/ds-number-input.tsx +3 -0
  94. package/src/components/ds-panel/ds-panel.figma.ts +16 -0
  95. package/src/components/ds-panel/index.ts +2 -0
  96. package/src/components/ds-password-input/ds-password-input.tsx +2 -0
  97. package/src/components/ds-popover/ds-popover.tsx +9 -0
  98. package/src/components/ds-popover/figma/ds-popover-content-item.figma.ts +18 -0
  99. package/src/components/ds-popover/figma/ds-popover-content.figma.ts +15 -0
  100. package/src/components/ds-popover/figma/ds-popover-footer.figma.ts +19 -0
  101. package/src/components/ds-popover/figma/ds-popover-header.figma.ts +16 -0
  102. package/src/components/ds-popover/figma/ds-popover.figma.ts +34 -0
  103. package/src/components/ds-progress-arc/ds-progress-arc.figma.ts +23 -0
  104. package/src/components/ds-progress-arc/ds-progress-arc.tsx +2 -0
  105. package/src/components/ds-progress-donut/ds-progress-donut.figma.ts +45 -0
  106. package/src/components/ds-progress-donut/ds-progress-donut.tsx +2 -0
  107. package/src/components/ds-progress-linear/ds-progress-linear.figma.ts +26 -0
  108. package/src/components/ds-progress-linear/ds-progress-linear.tsx +2 -0
  109. package/src/components/ds-progress-task-bar/ds-progress-task-bar.figma.ts +2 -2
  110. package/src/components/ds-progress-task-bar/ds-progress-task-bar.tsx +2 -0
  111. package/src/components/ds-radio-group/ds-radio-group.tsx +3 -0
  112. package/src/components/ds-radio-group/figma/ds-radio-group-item.figma.ts +24 -0
  113. package/src/components/ds-radio-group/figma/ds-radio-group.figma.ts +14 -0
  114. package/src/components/ds-segment-group/ds-segment-group.tsx +3 -0
  115. package/src/components/ds-segment-group/figma/ds-segment-group-item.figma.ts +25 -0
  116. package/src/components/ds-segment-group/figma/ds-segment-group.figma.ts +23 -0
  117. package/src/components/ds-select/ds-select.figma.ts +2 -2
  118. package/src/components/ds-select/ds-select.tsx +2 -0
  119. package/src/components/ds-site-node/ds-site-node.figma.ts +27 -0
  120. package/src/components/ds-site-node/ds-site-node.module.scss +59 -0
  121. package/src/components/ds-site-node/ds-site-node.tsx +73 -0
  122. package/src/components/ds-site-node/ds-site-node.types.ts +36 -0
  123. package/src/components/ds-site-node/hooks/use-is-overflowing.ts +31 -0
  124. package/src/components/ds-site-node/index.ts +3 -0
  125. package/src/components/ds-skeleton/ds-skeleton-circle.tsx +2 -0
  126. package/src/components/ds-skeleton/ds-skeleton-rect.tsx +2 -0
  127. package/src/components/ds-skeleton/ds-skeleton-text.tsx +2 -0
  128. package/src/components/ds-skeleton/ds-skeleton.ts +7 -1
  129. package/src/components/ds-smart-tabs/ds-smart-tabs.tsx +7 -2
  130. package/src/components/ds-spinner/ds-spinner.figma.ts +19 -0
  131. package/src/components/ds-spinner/ds-spinner.tsx +2 -0
  132. package/src/components/ds-split-button/ds-split-button.figma.ts +2 -2
  133. package/src/components/ds-split-button/ds-split-button.tsx +6 -0
  134. package/src/components/ds-status-badge/ds-status-badge.tsx +2 -0
  135. package/src/components/ds-status-badge-v2/ds-status-badge-v2.figma.ts +2 -2
  136. package/src/components/ds-status-badge-v2/index.ts +2 -0
  137. package/src/components/ds-stepper/components/ds-step-content.tsx +2 -0
  138. package/src/components/ds-stepper/components/ds-step-next-button.tsx +2 -0
  139. package/src/components/ds-stepper/components/ds-step.tsx +2 -0
  140. package/src/components/ds-stepper/ds-stepper.figma.ts +38 -0
  141. package/src/components/ds-stepper/ds-stepper.tsx +1 -0
  142. package/src/components/ds-system-status/ds-system-status.tsx +2 -0
  143. package/src/components/ds-table/components/ds-table-group-header-cell/index.ts +0 -1
  144. package/src/components/ds-table/components/ds-table-header/ds-table-header.module.scss +2 -2
  145. package/src/components/ds-table/components/ds-table-header/ds-table-header.tsx +2 -4
  146. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-checkbox.tsx +1 -0
  147. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-date.tsx +1 -0
  148. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-number.tsx +1 -0
  149. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-select.tsx +1 -0
  150. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-text.tsx +1 -0
  151. package/src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.tsx +1 -0
  152. package/src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.tsx +1 -0
  153. package/src/components/ds-table/ds-table.module.scss +15 -0
  154. package/src/components/ds-table/ds-table.tsx +39 -34
  155. package/src/components/ds-table/ds-table.types.ts +6 -0
  156. package/src/components/ds-table/figma/ds-table-expandable.figma.ts +2 -2
  157. package/src/components/ds-table/figma/ds-table.figma.ts +2 -2
  158. package/src/components/ds-table/index.ts +3 -0
  159. package/src/components/ds-tabs/components/ds-tabs-content/ds-tabs-content.tsx +2 -0
  160. package/src/components/ds-tabs/components/ds-tabs-list/ds-tabs-list.tsx +2 -0
  161. package/src/components/ds-tabs/components/ds-tabs-tab/ds-tabs-tab.tsx +2 -0
  162. package/src/components/ds-tabs/ds-tabs.tsx +2 -0
  163. package/src/components/ds-tabs/figma/ds-tabs-tab-vertical.figma.ts +2 -2
  164. package/src/components/ds-tabs/figma/ds-tabs-tab.figma.ts +2 -2
  165. package/src/components/ds-tabs/figma/ds-tabs-vertical.figma.ts +2 -2
  166. package/src/components/ds-tabs/figma/ds-tabs.figma.ts +2 -2
  167. package/src/components/ds-tag/ds-tag.tsx +2 -0
  168. package/src/components/ds-tag-filter/ds-tag-filter.tsx +2 -0
  169. package/src/components/ds-text-input/ds-input-field-v02.figma.ts +87 -0
  170. package/src/components/ds-text-input/ds-text-input.figma.ts +2 -2
  171. package/src/components/ds-text-input/ds-text-input.tsx +2 -0
  172. package/src/components/ds-textarea/ds-textarea.tsx +2 -0
  173. package/src/components/ds-time-picker/ds-time-picker.figma.ts +2 -2
  174. package/src/components/ds-time-picker/ds-time-picker.tsx +2 -0
  175. package/src/components/ds-toast/ds-toast-context.tsx +1 -0
  176. package/src/components/ds-toast/ds-toast.figma.ts +34 -0
  177. package/src/components/ds-toast/ds-toast.tsx +3 -0
  178. package/src/components/ds-toggle/ds-toggle.figma.ts +39 -0
  179. package/src/components/ds-toggle/ds-toggle.tsx +2 -0
  180. package/src/components/ds-tooltip/ds-tooltip.figma.ts +16 -0
  181. package/src/components/ds-tooltip/ds-tooltip.module.scss +8 -1
  182. package/src/components/ds-tooltip/ds-tooltip.tsx +35 -15
  183. package/src/components/ds-tooltip/ds-tooltip.types.ts +40 -0
  184. package/src/components/ds-tree/ds-tree.module.scss +2 -2
  185. package/src/components/ds-tree/ds-tree.tsx +22 -0
  186. package/src/components/ds-tree/ds-tree.types.ts +16 -0
  187. package/src/components/ds-typography/ds-typography.config.ts +1 -1
  188. package/src/components/ds-typography/ds-typography.figma.ts +63 -0
  189. package/src/components/ds-typography/ds-typography.module.scss +16 -0
  190. package/src/components/ds-typography/ds-typography.tsx +64 -7
  191. package/src/components/ds-typography/ds-typography.types.ts +13 -0
  192. package/src/components/ds-typography/hooks/use-truncation.ts +151 -0
  193. package/src/components/ds-user-card/ds-user-card.figma.ts +16 -0
  194. package/src/components/ds-user-card/ds-user-card.module.scss +25 -0
  195. package/src/components/ds-user-card/ds-user-card.tsx +31 -0
  196. package/src/components/ds-user-card/ds-user-card.types.ts +26 -0
  197. package/src/components/ds-user-card/index.ts +2 -0
  198. package/src/components/ds-vertical-tabs/ds-vertical-tabs.tsx +17 -4
  199. package/src/components/ds-workspace-layout/ds-workspace-layout.tsx +19 -8
  200. package/src/index.ts +2 -0
  201. package/src/styles/_root.scss +468 -363
  202. package/src/styles/shared/_dropdown.scss +2 -2
  203. package/src/styles/styles.scss +0 -3
  204. package/src/styles/_colors.scss +0 -65
  205. package/src/styles/_root_new.scss +0 -451
  206. package/src/styles/_spacing.scss +0 -47
@@ -104,4 +104,6 @@ const DsProgressLinear = ({
104
104
  );
105
105
  };
106
106
 
107
+ DsProgressLinear.displayName = 'DsProgressLinear';
108
+
107
109
  export default DsProgressLinear;
@@ -23,7 +23,7 @@ const attrs = [
23
23
 
24
24
  export default {
25
25
  example: zero ? figma.code`<DsProgressTaskBar total={999} />` : figma.code`<DsProgressTaskBar ${attrs} />`,
26
- imports: ["import { DsProgressTaskBar } from '@drivenets/design-system'"],
26
+ imports: ["import { DsProgressTaskBar } from '@drivenets/design-system';"],
27
27
  id: 'ds-progress-task-bar',
28
28
  metadata: { nestable: false },
29
- };
29
+ } satisfies figma.Template;
@@ -119,4 +119,6 @@ const DsProgressTaskBar = ({
119
119
  );
120
120
  };
121
121
 
122
+ DsProgressTaskBar.displayName = 'DsProgressTaskBar';
123
+
122
124
  export default DsProgressTaskBar;
@@ -122,3 +122,6 @@ export const DsRadioGroup = {
122
122
  Root,
123
123
  Item,
124
124
  };
125
+ DsRadioGroup.Root.displayName = 'DsRadioGroup.Root';
126
+ DsRadioGroup.Item.displayName = 'DsRadioGroup.Item';
127
+ DsRadioGroupLegacy.displayName = 'DsRadioGroupLegacy';
@@ -0,0 +1,24 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=32934-446
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-radio-group
3
+ // component=DsRadioGroup.Item
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
+ disabled: 'disabled',
13
+ });
14
+
15
+ const attrs = ['value="option"', 'label="Option"', state === 'disabled' ? 'disabled' : '']
16
+ .filter(Boolean)
17
+ .join(' ');
18
+
19
+ export default {
20
+ example: figma.code`<DsRadioGroup.Item ${attrs} />`,
21
+ imports: ["import { DsRadioGroup } from '@drivenets/design-system';"],
22
+ id: 'ds-radio-group-item',
23
+ metadata: { nestable: true },
24
+ } satisfies figma.Template;
@@ -0,0 +1,14 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=34864-124515
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-radio-group
3
+ // component=DsRadioGroup.Root
4
+ import figma from 'figma';
5
+
6
+ export default {
7
+ example: figma.code`<DsRadioGroup.Root>
8
+ <DsRadioGroup.Item value="option-1" label="Option 1" />
9
+ <DsRadioGroup.Item value="option-2" label="Option 2" />
10
+ </DsRadioGroup.Root>`,
11
+ imports: ["import { DsRadioGroup } from '@drivenets/design-system';"],
12
+ id: 'ds-radio-group',
13
+ metadata: { nestable: false },
14
+ } satisfies figma.Template;
@@ -74,3 +74,6 @@ export const DsSegmentGroup = {
74
74
  Item,
75
75
  ItemText,
76
76
  };
77
+ DsSegmentGroup.Root.displayName = 'DsSegmentGroup.Root';
78
+ DsSegmentGroup.Item.displayName = 'DsSegmentGroup.Item';
79
+ DsSegmentGroup.ItemText.displayName = 'DsSegmentGroup.ItemText';
@@ -0,0 +1,25 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=15094-6249
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-segment-group
3
+ // component=DsSegmentGroup.Item
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
+ Pressed: 'pressed',
12
+ Focus: 'focus',
13
+ Disabled: 'disabled',
14
+ });
15
+
16
+ const attrs = ['value="option"', 'label="Option"', state === 'disabled' ? 'disabled' : '']
17
+ .filter(Boolean)
18
+ .join(' ');
19
+
20
+ export default {
21
+ example: figma.code`<DsSegmentGroup.Item ${attrs} />`,
22
+ imports: ["import { DsSegmentGroup } from '@drivenets/design-system';"],
23
+ id: 'ds-segment-group-item',
24
+ metadata: { nestable: true },
25
+ } satisfies figma.Template;
@@ -0,0 +1,23 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=15094-8569
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-segment-group
3
+ // component=DsSegmentGroup.Root
4
+ import figma from 'figma';
5
+
6
+ const instance = figma.selectedInstance;
7
+
8
+ const size = instance.getEnum('Size', {
9
+ medium: 'medium',
10
+ small: 'small',
11
+ });
12
+
13
+ const sizeAttr = size === 'small' ? ' size="small"' : '';
14
+
15
+ export default {
16
+ example: figma.code`<DsSegmentGroup.Root${sizeAttr}>
17
+ <DsSegmentGroup.Item value="option-1" label="Option 1" />
18
+ <DsSegmentGroup.Item value="option-2" label="Option 2" />
19
+ </DsSegmentGroup.Root>`,
20
+ imports: ["import { DsSegmentGroup } from '@drivenets/design-system';"],
21
+ id: 'ds-segment-group',
22
+ metadata: { nestable: false },
23
+ } satisfies figma.Template;
@@ -47,7 +47,7 @@ const attrs = [
47
47
 
48
48
  export default {
49
49
  example: figma.code`<DsSelect ${attrs} />`,
50
- imports: ["import { DsSelect } from '@drivenets/design-system'"],
50
+ imports: ["import { DsSelect } from '@drivenets/design-system';"],
51
51
  id: 'ds-select',
52
52
  metadata: { nestable: true, props: { fcMember: 'Select', fcProps: attrs } },
53
- };
53
+ } satisfies figma.Template;
@@ -271,4 +271,6 @@ function getItemCheckedState({
271
271
  return someSelected ? 'indeterminate' : false;
272
272
  }
273
273
 
274
+ DsSelect.displayName = 'DsSelect';
275
+
274
276
  export default DsSelect;
@@ -0,0 +1,27 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=39525-181
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-site-node
3
+ // component=DsSiteNode
4
+ import figma from 'figma';
5
+
6
+ const instance = figma.selectedInstance;
7
+
8
+ const state = instance.getEnum('State', {
9
+ Default: 'default',
10
+ Selected: 'selected',
11
+ Muted: 'muted',
12
+ Overflow: 'overflow',
13
+ });
14
+
15
+ const tier = instance.getString('Tier');
16
+ const siteCode = instance.getString('Site code');
17
+ const overflowLabel = instance.getString('Overflow label');
18
+
19
+ export default {
20
+ example:
21
+ state === 'overflow'
22
+ ? figma.code`<DsSiteNode state="${state}" overflowLabel="${overflowLabel}" />`
23
+ : figma.code`<DsSiteNode state="${state}" tier="${tier}" siteCode="${siteCode}" />`,
24
+ imports: ["import { DsSiteNode } from '@drivenets/design-system';"],
25
+ id: 'ds-site-node',
26
+ metadata: { nestable: true },
27
+ } satisfies figma.Template;
@@ -0,0 +1,59 @@
1
+ $node-width: 140px;
2
+ $node-radius: 8px;
3
+ $overflow-height: 70px;
4
+
5
+ .node {
6
+ display: flex;
7
+ flex-direction: column;
8
+ align-items: center;
9
+ justify-content: center;
10
+ box-sizing: border-box;
11
+ width: $node-width;
12
+ padding: var(--sm);
13
+ gap: var(--2xs);
14
+ overflow: clip;
15
+ border: 1px solid var(--border-secondary);
16
+ border-radius: $node-radius;
17
+ background: var(--background);
18
+ font-family: var(--font-family-base);
19
+ cursor: pointer;
20
+ appearance: none;
21
+
22
+ &:focus-visible {
23
+ outline: 2px solid var(--outline-moderate);
24
+ outline-offset: 2px;
25
+ }
26
+ }
27
+
28
+ .selected {
29
+ border-color: var(--outline-moderate);
30
+ background: var(--background-info);
31
+ box-shadow: inset 0 0 0 1px var(--outline-moderate);
32
+ }
33
+
34
+ .overflow {
35
+ min-height: $overflow-height;
36
+ gap: 0;
37
+ border: 1px dashed var(--border-disabled);
38
+ background: var(--background-secondary-selected-weak);
39
+ }
40
+
41
+ .pill {
42
+ padding: var(--4xs) var(--xs);
43
+ overflow: clip;
44
+ border-radius: 9999px;
45
+ background: var(--background-primary);
46
+ }
47
+
48
+ .pillMuted {
49
+ background: var(--background-tertiary-selected-weak);
50
+ }
51
+
52
+ .siteCode {
53
+ display: block;
54
+ align-self: stretch;
55
+ overflow: hidden;
56
+ text-align: center;
57
+ text-overflow: ellipsis;
58
+ white-space: nowrap;
59
+ }
@@ -0,0 +1,73 @@
1
+ import classNames from 'classnames';
2
+ import type { DsSiteNodeProps } from './ds-site-node.types';
3
+ import { useIsOverflowing } from './hooks/use-is-overflowing';
4
+ import { DsStack } from '../ds-stack';
5
+ import { DsTooltip } from '../ds-tooltip';
6
+ import { DsTypography } from '../ds-typography';
7
+ import styles from './ds-site-node.module.scss';
8
+
9
+ const DsSiteNode = ({
10
+ ref,
11
+ state = 'default',
12
+ tier,
13
+ siteCode,
14
+ overflowLabel,
15
+ className,
16
+ style,
17
+ 'aria-label': ariaLabel,
18
+ onClick,
19
+ }: DsSiteNodeProps) => {
20
+ const isOverflow = state === 'overflow';
21
+ const isSelected = state === 'selected';
22
+ const isMuted = state === 'muted';
23
+
24
+ const { ref: siteCodeRef, isOverflowing } = useIsOverflowing<HTMLSpanElement>(siteCode);
25
+
26
+ return (
27
+ <button
28
+ ref={ref}
29
+ type="button"
30
+ className={classNames(
31
+ styles.node,
32
+ {
33
+ [styles.selected]: isSelected,
34
+ [styles.overflow]: isOverflow,
35
+ },
36
+ className,
37
+ )}
38
+ style={style}
39
+ aria-label={ariaLabel}
40
+ aria-current={isSelected ? true : undefined}
41
+ onClick={onClick}
42
+ >
43
+ {isOverflow ? (
44
+ <DsTypography variant="body-sm-reg" color="secondary">
45
+ {overflowLabel}
46
+ </DsTypography>
47
+ ) : (
48
+ <>
49
+ <DsStack
50
+ direction="row"
51
+ alignItems="center"
52
+ justifyContent="center"
53
+ className={classNames(styles.pill, { [styles.pillMuted]: isMuted })}
54
+ >
55
+ <DsTypography variant="body-xs-md" color={isMuted ? 'on-disabled' : 'on-action'}>
56
+ {tier}
57
+ </DsTypography>
58
+ </DsStack>
59
+
60
+ <span ref={siteCodeRef} className={styles.siteCode}>
61
+ <DsTooltip content={isOverflowing ? siteCode : undefined}>
62
+ <DsTypography variant="body-sm-bold" color={isSelected ? 'main' : 'secondary'}>
63
+ {siteCode}
64
+ </DsTypography>
65
+ </DsTooltip>
66
+ </span>
67
+ </>
68
+ )}
69
+ </button>
70
+ );
71
+ };
72
+
73
+ export default DsSiteNode;
@@ -0,0 +1,36 @@
1
+ import type { CSSProperties, MouseEvent, Ref } from 'react';
2
+
3
+ export const siteNodeStates = ['default', 'selected', 'muted', 'overflow'] as const;
4
+ export type SiteNodeState = (typeof siteNodeStates)[number];
5
+
6
+ export interface DsSiteNodeProps {
7
+ ref?: Ref<HTMLButtonElement>;
8
+ /**
9
+ * Scope/selection state within the site hierarchy path.
10
+ * `overflow` renders a collapsed summary node (no tier/site code).
11
+ */
12
+ state?: SiteNodeState;
13
+ /**
14
+ * Short tier label shown in the pill, e.g. `"T1"`. Ignored when `state="overflow"`.
15
+ */
16
+ tier?: string;
17
+ /**
18
+ * Site identifier. Truncates with an ellipsis and reveals the full value in a
19
+ * tooltip when it overflows. Ignored when `state="overflow"`.
20
+ */
21
+ siteCode?: string;
22
+ /**
23
+ * Summary label for the collapsed branch, e.g. `"+2 more"`. Only used when
24
+ * `state="overflow"`.
25
+ */
26
+ overflowLabel?: string;
27
+ className?: string;
28
+ style?: CSSProperties;
29
+ /**
30
+ * Overrides the accessible name. By default the node is named by its visible
31
+ * content (tier + site code, or the overflow label); set this to give the
32
+ * overflow node a more descriptive name, e.g. `"Show 2 more sites"`.
33
+ */
34
+ 'aria-label'?: string;
35
+ onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
36
+ }
@@ -0,0 +1,31 @@
1
+ import { useLayoutEffect, useRef, useState } from 'react';
2
+
3
+ export const useIsOverflowing = <T extends HTMLElement = HTMLElement>(text: string | undefined) => {
4
+ const ref = useRef<T>(null);
5
+ const [isOverflowing, setIsOverflowing] = useState(false);
6
+
7
+ useLayoutEffect(() => {
8
+ const element = ref.current;
9
+ if (!element) {
10
+ return;
11
+ }
12
+
13
+ const measure = () => setIsOverflowing(element.scrollWidth > element.clientWidth);
14
+ measure();
15
+
16
+ const observer = new ResizeObserver(measure);
17
+ observer.observe(element);
18
+
19
+ const frame = requestAnimationFrame(measure);
20
+ document.fonts.ready.then(measure).catch(() => undefined);
21
+ document.fonts.addEventListener('loadingdone', measure);
22
+
23
+ return () => {
24
+ cancelAnimationFrame(frame);
25
+ observer.disconnect();
26
+ document.fonts.removeEventListener('loadingdone', measure);
27
+ };
28
+ }, [text]);
29
+
30
+ return { ref, isOverflowing };
31
+ };
@@ -0,0 +1,3 @@
1
+ export { default as DsSiteNode } from './ds-site-node';
2
+ export { siteNodeStates } from './ds-site-node.types';
3
+ export type { DsSiteNodeProps, SiteNodeState } from './ds-site-node.types';
@@ -26,4 +26,6 @@ const DsSkeletonCircle = ({ size = 'regular', color = 'gray', className, style }
26
26
  );
27
27
  };
28
28
 
29
+ DsSkeletonCircle.displayName = 'DsSkeletonCircle';
30
+
29
31
  export default DsSkeletonCircle;
@@ -33,4 +33,6 @@ const DsSkeletonRect = ({
33
33
  );
34
34
  };
35
35
 
36
+ DsSkeletonRect.displayName = 'DsSkeletonRect';
37
+
36
38
  export default DsSkeletonRect;
@@ -46,4 +46,6 @@ const DsSkeletonText = ({
46
46
  );
47
47
  };
48
48
 
49
+ DsSkeletonText.displayName = 'DsSkeletonText';
50
+
49
51
  export default DsSkeletonText;
@@ -2,8 +2,14 @@ import DsSkeletonText from './ds-skeleton-text';
2
2
  import DsSkeletonCircle from './ds-skeleton-circle';
3
3
  import DsSkeletonRect from './ds-skeleton-rect';
4
4
 
5
- export default {
5
+ const DsSkeleton = {
6
6
  Text: DsSkeletonText,
7
7
  Circle: DsSkeletonCircle,
8
8
  Rect: DsSkeletonRect,
9
9
  };
10
+
11
+ DsSkeleton.Text.displayName = 'DsSkeleton.Text';
12
+ DsSkeleton.Circle.displayName = 'DsSkeleton.Circle';
13
+ DsSkeleton.Rect.displayName = 'DsSkeleton.Rect';
14
+
15
+ export default DsSkeleton;
@@ -86,7 +86,7 @@ const DsSmartTab: React.FC<DsSmartTabProps> = ({
86
86
  /**
87
87
  * Design system SmartTabs component
88
88
  */
89
- const DsSmartTabs = ({
89
+ const DsSmartTabsRoot = ({
90
90
  activeTab,
91
91
  onTabClick,
92
92
  className,
@@ -108,6 +108,11 @@ const DsSmartTabs = ({
108
108
  );
109
109
  };
110
110
 
111
- DsSmartTabs.Tab = DsSmartTab;
111
+ DsSmartTab.displayName = 'DsSmartTabs.Tab';
112
+
113
+ const DsSmartTabs = Object.assign(DsSmartTabsRoot, {
114
+ displayName: 'DsSmartTabs',
115
+ Tab: DsSmartTab,
116
+ });
112
117
 
113
118
  export default DsSmartTabs;
@@ -0,0 +1,19 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=15119-13518
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-spinner
3
+ // component=DsSpinner
4
+ import figma from 'figma';
5
+
6
+ const instance = figma.selectedInstance;
7
+
8
+ const size = instance.getEnum('Size', {
9
+ SM: 'small',
10
+ Default: 'medium',
11
+ LG: 'large',
12
+ });
13
+
14
+ export default {
15
+ example: figma.code`<DsSpinner size="${size}" />`,
16
+ imports: ["import { DsSpinner } from '@drivenets/design-system';"],
17
+ id: 'ds-spinner',
18
+ metadata: { nestable: true },
19
+ } satisfies figma.Template;
@@ -48,4 +48,6 @@ const DsSpinner: React.FC<DsSpinnerProps> = ({ size = 'medium', className, style
48
48
  );
49
49
  };
50
50
 
51
+ DsSpinner.displayName = 'DsSpinner';
52
+
51
53
  export default DsSpinner;
@@ -89,7 +89,7 @@ const buttonProps = [
89
89
 
90
90
  export default {
91
91
  example: figma.code`<DsSplitButton size="${size}"${disabled ? ' disabled' : ''} slotProps={{ button: { ${buttonProps} }, select: { options: [], value: '' } }} />`,
92
- imports: ["import { DsSplitButton } from '@drivenets/design-system'"],
92
+ imports: ["import { DsSplitButton } from '@drivenets/design-system';"],
93
93
  id: 'ds-split-button',
94
94
  metadata: { nestable: false },
95
- };
95
+ } satisfies figma.Template;
@@ -4,6 +4,12 @@ import styles from './ds-split-button.module.scss';
4
4
  import type { DsSplitButtonProps, SplitButtonSize } from './ds-split-button.types';
5
5
  import { DsButtonV3 } from '../ds-button-v3';
6
6
 
7
+ /**
8
+ * Secondary action button paired with a dropdown select for choosing a related option.
9
+ * Both slots share a size and disabled state controlled by the split button.
10
+ *
11
+ * @summary split action button with a primary action and an option select
12
+ */
7
13
  const DsSplitButton = ({
8
14
  ref,
9
15
  className,
@@ -39,4 +39,6 @@ const DsStatusBadge: React.FC<DsStatusBadgeProps> = ({
39
39
  );
40
40
  };
41
41
 
42
+ DsStatusBadge.displayName = 'DsStatusBadge';
43
+
42
44
  export default DsStatusBadge;
@@ -35,7 +35,7 @@ export default {
35
35
  : structure === 'text-only'
36
36
  ? figma.code`<DsStatusBadgeV2 phase="${phase}" label="${label}" variant="${variant}" size="${size}" icon={null} />`
37
37
  : figma.code`<DsStatusBadgeV2 phase="${phase}" label="${label}" variant="${variant}" size="${size}" />`,
38
- imports: ["import { DsStatusBadgeV2 } from '@drivenets/design-system'"],
38
+ imports: ["import { DsStatusBadgeV2 } from '@drivenets/design-system';"],
39
39
  id: 'ds-status-badge-v2',
40
40
  metadata: { nestable: true },
41
- };
41
+ } satisfies figma.Template;
@@ -11,3 +11,5 @@ export type {
11
11
  DsStatusBadgeV2Props,
12
12
  } from './ds-status-badge-v2.types';
13
13
  export { statusBadgeV2Phases, statusBadgeV2Variants, statusBadgeV2Sizes } from './ds-status-badge-v2.types';
14
+
15
+ DsStatusBadgeV2.displayName = 'DsStatusBadgeV2';
@@ -48,3 +48,5 @@ export function DsStepContent({ index, label, description, actions }: DsStepCont
48
48
  </div>
49
49
  );
50
50
  }
51
+
52
+ DsStepContent.displayName = 'DsStepContent';
@@ -20,3 +20,5 @@ export function DsNextStepButton({ children, size = 'small', ...rest }: DsNextSt
20
20
  </DsButton>
21
21
  );
22
22
  }
23
+
24
+ DsNextStepButton.displayName = 'DsNextStepButton';
@@ -116,3 +116,5 @@ export function DsStep({
116
116
  </Wrapper>
117
117
  );
118
118
  }
119
+
120
+ DsStep.displayName = 'DsStep';
@@ -0,0 +1,38 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=29164-187694
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-stepper
3
+ // component=DsStepper
4
+ //
5
+ // `direction` maps to `orientation`. Figma's `type` (detailed|compact) is not a code prop:
6
+ // detailed steps carry a `description` on each `DsStepContent`, compact steps omit it. The
7
+ // steps are composed in code (`DsStep` > `DsStepContent` > `DsNextStepButton`), not derivable
8
+ // from Figma's step atoms, and `count` is data — so a representative two-step composition is
9
+ // emitted for the developer to extend (one `DsStep` per step). The panel-docked wrappers
10
+ // (`DAP_stepper-panel-*_v01`) are a `DsPanel` composition and are intentionally not connected;
11
+ // the stepper still resolves when nested inside them.
12
+ import figma from 'figma';
13
+
14
+ const instance = figma.selectedInstance;
15
+
16
+ const orientation =
17
+ instance.getEnum('direction', {
18
+ vertical: 'vertical',
19
+ horizontal: 'horizontal',
20
+ }) ?? 'vertical';
21
+
22
+ const detailed = instance.getEnum('type', { detailed: true, compact: false }) ?? true;
23
+ const description = detailed ? ' description="Step description"' : '';
24
+
25
+ export default {
26
+ example: figma.code`<DsStepper count={2} orientation="${orientation}">
27
+ <DsStep index={0}>
28
+ <DsStepContent index={0} label="Step title"${description} actions={<DsNextStepButton>Next</DsNextStepButton>} />
29
+ </DsStep>
30
+ <DsStep index={1}>
31
+ <DsStepContent index={1} label="Step title"${description} actions={<DsNextStepButton>Finish</DsNextStepButton>} />
32
+ </DsStep>
33
+ {/* Add a <DsStep> per step */}
34
+ </DsStepper>`,
35
+ imports: ["import { DsStepper, DsStep, DsStepContent, DsNextStepButton } from '@drivenets/design-system';"],
36
+ id: 'ds-stepper',
37
+ metadata: { nestable: true },
38
+ } satisfies figma.Template;
@@ -58,3 +58,4 @@ export function DsStepper({
58
58
  </StepperContext.Provider>
59
59
  );
60
60
  }
61
+ DsStepper.displayName = 'DsStepper';
@@ -30,4 +30,6 @@ const DsSystemStatus: React.FC<DsSystemStatusProps> = ({ status, label, classNam
30
30
  );
31
31
  };
32
32
 
33
+ DsSystemStatus.displayName = 'DsSystemStatus';
34
+
33
35
  export default DsSystemStatus;
@@ -1,2 +1 @@
1
1
  export { DsTableGroupHeaderCell } from './ds-table-group-header-cell';
2
- export type { DsTableGroupHeaderCellProps } from './ds-table-group-header-cell.types';
@@ -1,8 +1,8 @@
1
1
  @use '../../../../styles/typography';
2
2
  @use '../../styles/variables' as vars;
3
3
 
4
- .stickyHeader {
5
- background-color: var(--background);
4
+ .header {
5
+ background-color: var(--background-secondary);
6
6
  }
7
7
 
8
8
  .virtualizedHeader {
@@ -15,12 +15,10 @@ import { DsTableGroupHeaderCell } from '../ds-table-group-header-cell';
15
15
  import { isFirstLeafColumnOfGroup } from '../../grouping';
16
16
 
17
17
  const DsTableHeader = <TData,>({ table }: DsTableHeaderProps<TData>) => {
18
- const { stickyHeader, bordered, virtualized } = useDsTableContext<TData, unknown>();
18
+ const { bordered, virtualized } = useDsTableContext<TData, unknown>();
19
19
 
20
20
  return (
21
- <TableHeader
22
- className={classnames(stickyHeader && styles.stickyHeader, virtualized && styles.virtualizedHeader)}
23
- >
21
+ <TableHeader className={classnames(styles.header, virtualized && styles.virtualizedHeader)}>
24
22
  {table.getHeaderGroups().map((headerGroup) => (
25
23
  <TableRow
26
24
  key={headerGroup.id}
@@ -25,3 +25,4 @@ export const DsTableEditCellCheckbox = <TData extends RowData>({
25
25
  />
26
26
  );
27
27
  };
28
+ DsTableEditCellCheckbox.displayName = 'DsTableEditCellCheckbox';
@@ -48,3 +48,4 @@ export const DsTableEditCellDate = <TData extends RowData>({
48
48
  </TableEditFormControl>
49
49
  );
50
50
  };
51
+ DsTableEditCellDate.displayName = 'DsTableEditCellDate';