@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.
Files changed (172) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/index.cjs +868 -200
  3. package/dist/index.d.cts +810 -1181
  4. package/dist/index.d.cts.map +1 -1
  5. package/dist/index.d.ts +810 -1181
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +852 -196
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.min.css +1 -1
  10. package/package.json +15 -13
  11. package/src/components/ds-alert-banner/ds-alert-banner.tsx +11 -2
  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 +1 -1
  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-catalog-layout/ds-catalog-layout.tsx +8 -0
  28. package/src/components/ds-checkbox/ds-checkbox-level-2.figma.ts +40 -0
  29. package/src/components/ds-checkbox/ds-checkbox.figma.ts +45 -0
  30. package/src/components/ds-checkbox/ds-checkbox.module.scss +1 -1
  31. package/src/components/ds-checkbox/ds-checkbox.tsx +9 -1
  32. package/src/components/ds-checkbox-group/ds-checkbox-group.figma.ts +15 -0
  33. package/src/components/ds-checkbox-group/ds-checkbox-group.tsx +2 -0
  34. package/src/components/ds-chip/ds-chip.tsx +2 -0
  35. package/src/components/ds-chip-group/ds-chip-group.tsx +2 -0
  36. package/src/components/ds-comment-bubble/components/ds-comment-thread/ds-comment-thread.tsx +1 -0
  37. package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.tsx +1 -0
  38. package/src/components/ds-comment-bubble/ds-comment-bubble.tsx +1 -0
  39. package/src/components/ds-comment-card/ds-comment-card.tsx +1 -0
  40. package/src/components/ds-comment-indicator/ds-comment-indicator.tsx +1 -0
  41. package/src/components/ds-comments-drawer/ds-comments-drawer.tsx +1 -0
  42. package/src/components/ds-confirmation/ds-confirmation.tsx +1 -0
  43. package/src/components/ds-date-input/ds-date-input.tsx +2 -0
  44. package/src/components/ds-date-picker/ds-date-picker.tsx +9 -0
  45. package/src/components/ds-date-picker/ds-date-picker.types.ts +1 -1
  46. package/src/components/ds-date-range-picker/ds-date-range-picker.tsx +2 -0
  47. package/src/components/ds-dialog/ds-dialog.tsx +9 -0
  48. package/src/components/ds-dialog/ds-dialog.types.ts +1 -1
  49. package/src/components/ds-divider/ds-divider.figma.ts +19 -0
  50. package/src/components/ds-divider/ds-divider.tsx +2 -0
  51. package/src/components/ds-drawer/ds-drawer.tsx +10 -0
  52. package/src/components/ds-drawer/figma/ds-drawer-content.figma.ts +15 -0
  53. package/src/components/ds-drawer/figma/ds-drawer-footer.figma.ts +19 -0
  54. package/src/components/ds-drawer/figma/ds-drawer-header.figma.ts +16 -0
  55. package/src/components/ds-drawer/figma/ds-drawer.figma.ts +36 -0
  56. package/src/components/ds-dropdown-menu/ds-dropdown-menu.module.scss +12 -3
  57. package/src/components/ds-dropdown-menu/ds-dropdown-menu.tsx +24 -6
  58. package/src/components/ds-dropdown-menu/ds-dropdown-menu.types.ts +10 -1
  59. package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-footer.figma.ts +11 -0
  60. package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-group.figma.ts +23 -0
  61. package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-item.figma.ts +29 -0
  62. package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-separator.figma.ts +11 -0
  63. package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu.figma.ts +24 -0
  64. package/src/components/ds-expandable-text-input/ds-expandable-text-input.figma.ts +24 -0
  65. package/src/components/ds-expandable-text-input/ds-expandable-text-input.tsx +1 -0
  66. package/src/components/ds-file-upload/ds-file-upload.figma.ts +29 -0
  67. package/src/components/ds-file-upload/ds-file-upload.tsx +2 -0
  68. package/src/components/ds-filter-status-icon/ds-filter-status-icon.figma.ts +22 -0
  69. package/src/components/ds-filter-status-icon/ds-filter-status-icon.tsx +1 -0
  70. package/src/components/ds-form-control/ds-form-control.tsx +3 -0
  71. package/src/components/ds-grid/index.ts +3 -0
  72. package/src/components/ds-icon/ds-icon.tsx +2 -0
  73. package/src/components/ds-key-value-pair/ds-key-value-pair.figma.ts +24 -0
  74. package/src/components/ds-key-value-pair/ds-key-value-pair.tsx +2 -0
  75. package/src/components/ds-loader/ds-loader.figma.ts +11 -0
  76. package/src/components/ds-loader/ds-loader.tsx +2 -0
  77. package/src/components/ds-modal/ds-modal.tsx +9 -0
  78. package/src/components/ds-number-input/ds-number-input.tsx +2 -0
  79. package/src/components/ds-panel/ds-panel.figma.ts +16 -0
  80. package/src/components/ds-panel/index.ts +2 -0
  81. package/src/components/ds-password-input/ds-password-input.tsx +2 -0
  82. package/src/components/ds-popover/ds-popover.tsx +9 -0
  83. package/src/components/ds-popover/figma/ds-popover-content-item.figma.ts +18 -0
  84. package/src/components/ds-popover/figma/ds-popover-content.figma.ts +15 -0
  85. package/src/components/ds-popover/figma/ds-popover-footer.figma.ts +19 -0
  86. package/src/components/ds-popover/figma/ds-popover-header.figma.ts +16 -0
  87. package/src/components/ds-popover/figma/ds-popover.figma.ts +34 -0
  88. package/src/components/ds-progress-arc/ds-progress-arc.figma.ts +23 -0
  89. package/src/components/ds-progress-arc/ds-progress-arc.tsx +2 -0
  90. package/src/components/ds-progress-donut/ds-progress-donut.figma.ts +45 -0
  91. package/src/components/ds-progress-donut/ds-progress-donut.tsx +2 -0
  92. package/src/components/ds-progress-linear/ds-progress-linear.figma.ts +26 -0
  93. package/src/components/ds-progress-linear/ds-progress-linear.tsx +2 -0
  94. package/src/components/ds-progress-task-bar/ds-progress-task-bar.tsx +2 -0
  95. package/src/components/ds-radio-group/ds-radio-group.tsx +3 -0
  96. package/src/components/ds-radio-group/figma/ds-radio-group-item.figma.ts +24 -0
  97. package/src/components/ds-radio-group/figma/ds-radio-group.figma.ts +14 -0
  98. package/src/components/ds-segment-group/ds-segment-group.tsx +3 -0
  99. package/src/components/ds-segment-group/figma/ds-segment-group-item.figma.ts +25 -0
  100. package/src/components/ds-segment-group/figma/ds-segment-group.figma.ts +23 -0
  101. package/src/components/ds-select/ds-select.tsx +2 -0
  102. package/src/components/ds-site-node/ds-site-node.figma.ts +27 -0
  103. package/src/components/ds-site-node/ds-site-node.module.scss +59 -0
  104. package/src/components/ds-site-node/ds-site-node.tsx +73 -0
  105. package/src/components/ds-site-node/ds-site-node.types.ts +36 -0
  106. package/src/components/ds-site-node/hooks/use-is-overflowing.ts +31 -0
  107. package/src/components/ds-site-node/index.ts +3 -0
  108. package/src/components/ds-skeleton/ds-skeleton-circle.tsx +2 -0
  109. package/src/components/ds-skeleton/ds-skeleton-rect.tsx +2 -0
  110. package/src/components/ds-skeleton/ds-skeleton-text.tsx +2 -0
  111. package/src/components/ds-skeleton/ds-skeleton.ts +7 -1
  112. package/src/components/ds-smart-tabs/ds-smart-tabs.tsx +4 -0
  113. package/src/components/ds-spinner/ds-spinner.figma.ts +19 -0
  114. package/src/components/ds-spinner/ds-spinner.tsx +2 -0
  115. package/src/components/ds-split-button/ds-split-button.tsx +6 -0
  116. package/src/components/ds-status-badge/ds-status-badge.tsx +2 -0
  117. package/src/components/ds-status-badge-v2/index.ts +2 -0
  118. package/src/components/ds-stepper/components/ds-step-content.tsx +2 -0
  119. package/src/components/ds-stepper/components/ds-step-next-button.tsx +2 -0
  120. package/src/components/ds-stepper/components/ds-step.tsx +2 -0
  121. package/src/components/ds-stepper/ds-stepper.figma.ts +38 -0
  122. package/src/components/ds-stepper/ds-stepper.tsx +1 -0
  123. package/src/components/ds-system-status/ds-system-status.tsx +2 -0
  124. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-checkbox.tsx +1 -0
  125. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-date.tsx +1 -0
  126. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-number.tsx +1 -0
  127. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-select.tsx +1 -0
  128. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-text.tsx +1 -0
  129. package/src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.tsx +1 -0
  130. package/src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.tsx +1 -0
  131. package/src/components/ds-table/ds-table.tsx +2 -0
  132. package/src/components/ds-table/index.ts +3 -0
  133. package/src/components/ds-tabs/components/ds-tabs-content/ds-tabs-content.tsx +2 -0
  134. package/src/components/ds-tabs/components/ds-tabs-list/ds-tabs-list.tsx +2 -0
  135. package/src/components/ds-tabs/components/ds-tabs-tab/ds-tabs-tab.tsx +2 -0
  136. package/src/components/ds-tabs/ds-tabs.tsx +2 -0
  137. package/src/components/ds-tag/ds-tag.tsx +2 -0
  138. package/src/components/ds-tag-filter/ds-tag-filter.tsx +2 -0
  139. package/src/components/ds-text-input/ds-input-field-v02.figma.ts +87 -0
  140. package/src/components/ds-text-input/ds-text-input.tsx +2 -0
  141. package/src/components/ds-textarea/ds-textarea.tsx +2 -0
  142. package/src/components/ds-time-picker/ds-time-picker.tsx +2 -0
  143. package/src/components/ds-toast/ds-toast-context.tsx +1 -0
  144. package/src/components/ds-toast/ds-toast.figma.ts +34 -0
  145. package/src/components/ds-toast/ds-toast.tsx +3 -0
  146. package/src/components/ds-toggle/ds-toggle.figma.ts +39 -0
  147. package/src/components/ds-toggle/ds-toggle.tsx +2 -0
  148. package/src/components/ds-tooltip/ds-tooltip.figma.ts +16 -0
  149. package/src/components/ds-tooltip/ds-tooltip.module.scss +8 -1
  150. package/src/components/ds-tooltip/ds-tooltip.tsx +35 -15
  151. package/src/components/ds-tooltip/ds-tooltip.types.ts +40 -0
  152. package/src/components/ds-tree/ds-tree.tsx +16 -0
  153. package/src/components/ds-typography/ds-typography.config.ts +1 -1
  154. package/src/components/ds-typography/ds-typography.figma.ts +63 -0
  155. package/src/components/ds-typography/ds-typography.module.scss +16 -0
  156. package/src/components/ds-typography/ds-typography.tsx +64 -7
  157. package/src/components/ds-typography/ds-typography.types.ts +13 -0
  158. package/src/components/ds-typography/hooks/use-truncation.ts +151 -0
  159. package/src/components/ds-user-card/ds-user-card.figma.ts +16 -0
  160. package/src/components/ds-user-card/ds-user-card.module.scss +25 -0
  161. package/src/components/ds-user-card/ds-user-card.tsx +31 -0
  162. package/src/components/ds-user-card/ds-user-card.types.ts +26 -0
  163. package/src/components/ds-user-card/index.ts +2 -0
  164. package/src/components/ds-vertical-tabs/ds-vertical-tabs.tsx +6 -0
  165. package/src/components/ds-workspace-layout/ds-workspace-layout.tsx +10 -0
  166. package/src/index.ts +2 -0
  167. package/src/styles/_root.scss +468 -363
  168. package/src/styles/shared/_dropdown.scss +2 -2
  169. package/src/styles/styles.scss +0 -3
  170. package/src/styles/_colors.scss +0 -65
  171. package/src/styles/_root_new.scss +0 -451
  172. package/src/styles/_spacing.scss +0 -47
@@ -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
+ };
@@ -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;
@@ -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;
@@ -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
+ };
@@ -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;
@@ -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';
@@ -49,3 +49,4 @@ export const DsTableEditCellNumber = <TData extends RowData>({
49
49
  </TableEditFormControl>
50
50
  );
51
51
  };
52
+ DsTableEditCellNumber.displayName = 'DsTableEditCellNumber';
@@ -34,3 +34,4 @@ export const DsTableEditCellSelect = <TData extends RowData>({
34
34
  </TableEditFormControl>
35
35
  );
36
36
  };
37
+ DsTableEditCellSelect.displayName = 'DsTableEditCellSelect';
@@ -48,3 +48,4 @@ export const DsTableEditCellText = <TData extends RowData>({
48
48
  </TableEditFormControl>
49
49
  );
50
50
  };
51
+ DsTableEditCellText.displayName = 'DsTableEditCellText';
@@ -56,3 +56,4 @@ export const DsTableEditableCell = <TData, TValue>({
56
56
  </div>
57
57
  );
58
58
  };
59
+ DsTableEditableCell.displayName = 'DsTableEditableCell';
@@ -74,3 +74,4 @@ export const DsTableEditingCell = <TData, TValue>({ cell }: DsTableEditingCellPr
74
74
  </div>
75
75
  );
76
76
  };
77
+ DsTableEditingCell.displayName = 'DsTableEditingCell';
@@ -386,4 +386,6 @@ const DsTable = <TData extends { id: string }, TValue>({
386
386
  );
387
387
  };
388
388
 
389
+ DsTable.displayName = 'DsTable';
390
+
389
391
  export default DsTable;
@@ -10,6 +10,9 @@ export type { DsTableEditDisabledResult } from './ds-table-column.types';
10
10
  export { default as DsTable } from './ds-table';
11
11
  export * from './ds-table.types';
12
12
 
13
+ export { createColumnHelper } from '@tanstack/react-table';
14
+ export type { ColumnDef } from '@tanstack/react-table';
15
+
13
16
  export { useCellEditor } from './hooks/use-cell-editor';
14
17
  export type {
15
18
  UseCellEditorOptions,
@@ -10,3 +10,5 @@ export const DsTabsContent = ({ value, className, style, children }: DsTabsConte
10
10
  </Tabs.Content>
11
11
  );
12
12
  };
13
+
14
+ DsTabsContent.displayName = 'DsTabs.Content';
@@ -12,3 +12,5 @@ export const DsTabsList = ({ className, style, children }: DsTabsListProps) => {
12
12
  </Tabs.List>
13
13
  );
14
14
  };
15
+
16
+ DsTabsList.displayName = 'DsTabs.List';
@@ -127,3 +127,5 @@ export const DsTabsTab = ({
127
127
  </>
128
128
  );
129
129
  };
130
+
131
+ DsTabsTab.displayName = 'DsTabs.Tab';
@@ -38,6 +38,8 @@ const DsTabsRoot = ({
38
38
  );
39
39
  };
40
40
 
41
+ DsTabsRoot.displayName = 'DsTabs.Root';
42
+
41
43
  export const DsTabs = {
42
44
  Root: DsTabsRoot,
43
45
  List: DsTabsList,
@@ -134,4 +134,6 @@ const DsTag = ({
134
134
  );
135
135
  };
136
136
 
137
+ DsTag.displayName = 'DsTag';
138
+
137
139
  export default DsTag;
@@ -133,4 +133,6 @@ const DsTagFilter = ({
133
133
  );
134
134
  };
135
135
 
136
+ DsTagFilter.displayName = 'DsTagFilter';
137
+
136
138
  export default DsTagFilter;
@@ -0,0 +1,87 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=39475-58722
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-text-input
3
+ // component=DsTextInput
4
+ import figma from 'figma';
5
+
6
+ interface FieldInfo {
7
+ component: string;
8
+ fcMember?: string;
9
+ size?: boolean;
10
+ readOnly?: boolean;
11
+ invalid?: boolean;
12
+ data?: string;
13
+ }
14
+
15
+ const textInfo: FieldInfo = { component: 'DsTextInput', fcMember: 'TextInput', size: true, readOnly: true };
16
+
17
+ const registry: Record<string, FieldInfo> = {
18
+ text: textInfo,
19
+ textArea: { component: 'DsTextarea', fcMember: 'Textarea' },
20
+ number: { component: 'DsNumberInput', fcMember: 'NumberInput', size: true, readOnly: true },
21
+ password: { component: 'DsPasswordInput', fcMember: 'PasswordInput', size: true, readOnly: true },
22
+ select: { component: 'DsSelect', fcMember: 'Select', invalid: true, data: 'options={[]} value=""' },
23
+ date: { component: 'DsDateInput', fcMember: 'DateInput' },
24
+ time: { component: 'DsTimePicker', fcMember: 'TimePicker' },
25
+ autocompleteSearch: {
26
+ component: 'DsAutocomplete',
27
+ invalid: true,
28
+ data: 'options={[]} showTrigger={false}',
29
+ },
30
+ autocompleteCombobox: { component: 'DsAutocomplete', invalid: true, data: 'options={[]}' },
31
+ };
32
+
33
+ const instance = figma.selectedInstance;
34
+
35
+ const size = instance.getEnum('size', {
36
+ small: 'small',
37
+ medium: 'medium',
38
+ large: 'large',
39
+ });
40
+
41
+ const state = instance.getEnum('state', {
42
+ default: 'default',
43
+ hover: 'hover',
44
+ focus: 'focus',
45
+ disabled: 'disabled',
46
+ 'read-only': 'readOnly',
47
+ error: 'error',
48
+ });
49
+
50
+ const part = instance.findInstance('DAP-part_InputType_v01', { traverseInstances: true });
51
+ const inputType =
52
+ (part.type === 'INSTANCE'
53
+ ? part.getEnum('inputType', {
54
+ text: 'text',
55
+ 'text-area': 'textArea',
56
+ select: 'select',
57
+ password: 'password',
58
+ number: 'number',
59
+ date: 'date',
60
+ time: 'time',
61
+ 'autocomplete-search': 'autocompleteSearch',
62
+ 'autocomplete-combobox': 'autocompleteCombobox',
63
+ })
64
+ : 'text') ?? 'text';
65
+
66
+ const info = registry[inputType] ?? textInfo;
67
+
68
+ const disabled = state === 'disabled';
69
+ const readOnly = state === 'readOnly';
70
+ const error = state === 'error';
71
+
72
+ const attrs = [
73
+ info.size && size === 'small' ? 'size="small"' : '',
74
+ info.data ?? '',
75
+ disabled ? 'disabled' : '',
76
+ info.readOnly && readOnly ? 'readOnly' : '',
77
+ info.invalid && error ? 'invalid' : '',
78
+ ]
79
+ .filter(Boolean)
80
+ .join(' ');
81
+
82
+ export default {
83
+ example: figma.code`<${info.component} ${attrs} />`,
84
+ imports: [`import { ${info.component} } from '@drivenets/design-system'`],
85
+ id: 'ds-input-field-v02',
86
+ metadata: { nestable: true, props: { fcMember: info.fcMember, fcProps: attrs } },
87
+ };
@@ -76,4 +76,6 @@ const DsTextInput: FC<DsTextInputProps> = ({
76
76
  );
77
77
  };
78
78
 
79
+ DsTextInput.displayName = 'DsTextInput';
80
+
79
81
  export default DsTextInput;
@@ -46,4 +46,6 @@ const DsTextarea: React.FC<DsTextareaProps> = ({
46
46
  );
47
47
  };
48
48
 
49
+ DsTextarea.displayName = 'DsTextarea';
50
+
49
51
  export default DsTextarea;
@@ -182,4 +182,6 @@ const DsTimePicker = (props: DsTimePickerProps) => {
182
182
  );
183
183
  };
184
184
 
185
+ DsTimePicker.displayName = 'DsTimePicker';
186
+
185
187
  export default DsTimePicker;
@@ -77,3 +77,4 @@ export const useToaster = (): DsToastContextType => {
77
77
  }
78
78
  return context;
79
79
  };
80
+ DsToastProvider.displayName = 'DsToastProvider';
@@ -0,0 +1,34 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=15100-3016
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-toast
3
+ // component=DsToast
4
+ import figma from 'figma';
5
+
6
+ const instance = figma.selectedInstance;
7
+
8
+ const variant = instance.getEnum('Type', {
9
+ info: 'info',
10
+ success: 'success',
11
+ warning: 'warning',
12
+ error: 'error',
13
+ });
14
+
15
+ const extended = instance.getEnum('Extended', { True: true, False: false });
16
+ const cta = instance.getEnum('CTA', { True: true, False: false });
17
+
18
+ const titleLine = extended ? `\n\ttitle: 'Title',` : '';
19
+ const actionsLine = cta ? `\n\tactions: <DsButtonV3 variant="secondary">Action</DsButtonV3>,` : '';
20
+
21
+ export default {
22
+ example: figma.code`const { createToast } = useToaster();
23
+
24
+ createToast({
25
+ variant: '${variant}',${titleLine}
26
+ description: 'Description',${actionsLine}
27
+ });`,
28
+ imports: [
29
+ "import { useToaster } from '@drivenets/design-system'",
30
+ "import { DsButtonV3 } from '@drivenets/design-system'",
31
+ ],
32
+ id: 'ds-toast',
33
+ metadata: { nestable: false },
34
+ };
@@ -51,4 +51,7 @@ const DsToastGroup: React.FC<{ toaster: CreateToasterReturn }> = ({ toaster }) =
51
51
  return <Toaster toaster={toaster}>{(toast: DsToastProps) => <DsToast {...toast} />}</Toaster>;
52
52
  };
53
53
 
54
+ DsToast.displayName = 'DsToast';
55
+ DsToastGroup.displayName = 'DsToastGroup';
56
+
54
57
  export { DsToast, DsToastGroup };
@@ -0,0 +1,39 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=15035-29699
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-toggle
3
+ // component=DsToggle
4
+ import figma from 'figma';
5
+
6
+ const instance = figma.selectedInstance;
7
+
8
+ const on = instance.getEnum('On', {
9
+ Yes: 'yes',
10
+ No: 'no',
11
+ });
12
+
13
+ const size = instance.getEnum('Size', {
14
+ Default: 'default',
15
+ Small: 'small',
16
+ });
17
+
18
+ const state = instance.getEnum('State', {
19
+ Default: 'default',
20
+ Hover: 'hover',
21
+ Focus: 'focus',
22
+ Disabled: 'disabled',
23
+ });
24
+
25
+ const attrs = [
26
+ 'label="Label"',
27
+ size === 'small' ? 'size="small"' : '',
28
+ on === 'yes' ? 'checked' : '',
29
+ state === 'disabled' ? 'disabled' : '',
30
+ ]
31
+ .filter(Boolean)
32
+ .join(' ');
33
+
34
+ export default {
35
+ example: figma.code`<DsToggle ${attrs} />`,
36
+ imports: ["import { DsToggle } from '@drivenets/design-system'"],
37
+ id: 'ds-toggle',
38
+ metadata: { nestable: true },
39
+ };
@@ -75,4 +75,6 @@ const DsToggle = ({
75
75
  );
76
76
  };
77
77
 
78
+ DsToggle.displayName = 'DsToggle';
79
+
78
80
  export default DsToggle;
@@ -0,0 +1,16 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=14845-9203
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-tooltip
3
+ // component=DsTooltip
4
+ import figma from 'figma';
5
+
6
+ const instance = figma.selectedInstance;
7
+
8
+ const labelNode = instance.findText('Tooltip', { traverseInstances: true });
9
+ const content = labelNode.type === 'TEXT' ? labelNode.textContent : 'Tooltip text';
10
+
11
+ export default {
12
+ example: figma.code`<DsTooltip content="${content}">{/* trigger element */}</DsTooltip>`,
13
+ imports: ["import { DsTooltip } from '@drivenets/design-system'"],
14
+ id: 'ds-tooltip',
15
+ metadata: { nestable: false },
16
+ };
@@ -1,4 +1,7 @@
1
+ @use '../../styles/typography';
2
+
1
3
  .tooltip {
4
+ --arrow-size: 7px;
2
5
  color: var(--font-on-action);
3
6
  background-color: var(--background-brand);
4
7
  padding: var(--xs) var(--sm);
@@ -8,6 +11,10 @@
8
11
  z-index: 9999;
9
12
  }
10
13
 
14
+ .text {
15
+ @include typography.body-xs-reg;
16
+ }
17
+
11
18
  .arrow {
12
- fill: var(--color-dap-gray-700);
19
+ --arrow-background: var(--color-dap-gray-700);
13
20
  }
@@ -1,33 +1,53 @@
1
1
  import { type FC, isValidElement } from 'react';
2
- import * as Tooltip from '@radix-ui/react-tooltip';
2
+ import { Tooltip } from '@ark-ui/react/tooltip';
3
+ import { Portal } from '@ark-ui/react/portal';
3
4
  import classNames from 'classnames';
4
5
  import styles from './ds-tooltip.module.scss';
5
6
  import type { DsTooltipProps } from './ds-tooltip.types';
6
- import { DsTypography } from '../ds-typography';
7
7
 
8
- const DsTooltip: FC<DsTooltipProps> = ({ content, children, slotProps }) => {
8
+ const OPEN_DELAY_MS = 200;
9
+ const CLOSE_DELAY_MS = 0;
10
+ const TOOLTIP_GUTTER_PX = 0;
11
+
12
+ const DsTooltip: FC<DsTooltipProps> = ({
13
+ content,
14
+ children,
15
+ placement = 'top',
16
+ disabled = false,
17
+ getAnchorRect,
18
+ slotProps,
19
+ }) => {
9
20
  if (content === undefined) {
10
21
  return children;
11
22
  }
23
+
12
24
  return (
13
- <Tooltip.Provider delayDuration={200}>
14
- <Tooltip.Root>
15
- <Tooltip.Trigger asChild>{children}</Tooltip.Trigger>
16
- <Tooltip.Portal>
25
+ <Tooltip.Root
26
+ openDelay={OPEN_DELAY_MS}
27
+ closeDelay={CLOSE_DELAY_MS}
28
+ disabled={disabled}
29
+ positioning={{ placement, gutter: TOOLTIP_GUTTER_PX, getAnchorRect: getAnchorRect ?? undefined }}
30
+ lazyMount
31
+ unmountOnExit
32
+ >
33
+ <Tooltip.Trigger asChild>{children}</Tooltip.Trigger>
34
+ <Portal>
35
+ <Tooltip.Positioner>
17
36
  <Tooltip.Content
18
37
  className={classNames(styles.tooltip, slotProps?.content?.className)}
19
38
  style={slotProps?.content?.style}
20
- side="top"
21
- align="center"
22
- sideOffset={4}
23
39
  >
24
- {isValidElement(content) ? content : <DsTypography variant="body-xs-reg">{content}</DsTypography>}
25
- <Tooltip.Arrow className={styles.arrow} />
40
+ {isValidElement(content) ? content : <span className={styles.text}>{content}</span>}
41
+ <Tooltip.Arrow className={styles.arrow}>
42
+ <Tooltip.ArrowTip />
43
+ </Tooltip.Arrow>
26
44
  </Tooltip.Content>
27
- </Tooltip.Portal>
28
- </Tooltip.Root>
29
- </Tooltip.Provider>
45
+ </Tooltip.Positioner>
46
+ </Portal>
47
+ </Tooltip.Root>
30
48
  );
31
49
  };
32
50
 
51
+ DsTooltip.displayName = 'DsTooltip';
52
+
33
53
  export default DsTooltip;
@@ -1,5 +1,32 @@
1
1
  import type { CSSProperties, ReactNode } from 'react';
2
2
 
3
+ export const tooltipPlacements = [
4
+ 'top',
5
+ 'top-start',
6
+ 'top-end',
7
+ 'bottom',
8
+ 'bottom-start',
9
+ 'bottom-end',
10
+ 'left',
11
+ 'left-start',
12
+ 'left-end',
13
+ 'right',
14
+ 'right-start',
15
+ 'right-end',
16
+ ] as const;
17
+
18
+ export type TooltipPlacement = (typeof tooltipPlacements)[number];
19
+
20
+ /**
21
+ * Viewport-relative rect (CSS pixels) the tooltip anchors to, instead of the trigger.
22
+ */
23
+ export interface TooltipAnchorRect {
24
+ x: number;
25
+ y: number;
26
+ width: number;
27
+ height: number;
28
+ }
29
+
3
30
  export interface DsTooltipProps {
4
31
  /**
5
32
  * Tooltip content
@@ -9,6 +36,19 @@ export interface DsTooltipProps {
9
36
  * The content to be rendered inside the tooltip
10
37
  */
11
38
  children: ReactNode;
39
+ /**
40
+ * Placement relative to the trigger; `-start` / `-end` align to that edge.
41
+ */
42
+ placement?: TooltipPlacement;
43
+ /**
44
+ * When true the trigger renders but the tooltip never opens.
45
+ */
46
+ disabled?: boolean;
47
+ /**
48
+ * Anchors the tooltip to a virtual rect instead of the trigger, re-evaluated on
49
+ * each reposition. Return `null` to fall back to the trigger.
50
+ */
51
+ getAnchorRect?: () => TooltipAnchorRect | null;
12
52
  /**
13
53
  * Props forwarded to nested sub-components.
14
54
  */
@@ -153,6 +153,22 @@ const DsTreeItemAction = ({ className, style, children, onClick }: DsTreeItemAct
153
153
  </button>
154
154
  );
155
155
 
156
+ DsTreeRoot.displayName = 'DsTree.Root';
157
+ DsTreeTree.displayName = 'DsTree.Tree';
158
+ Object.defineProperty(TreeView.NodeProvider, 'displayName', { value: 'DsTree.NodeProvider' });
159
+ Object.defineProperty(TreeView.NodeContext, 'displayName', { value: 'DsTree.NodeContext' });
160
+ DsTreeBranch.displayName = 'DsTree.Branch';
161
+ DsTreeBranchControl.displayName = 'DsTree.BranchControl';
162
+ DsTreeBranchIndicator.displayName = 'DsTree.BranchIndicator';
163
+ DsTreeBranchText.displayName = 'DsTree.BranchText';
164
+ DsTreeBranchContent.displayName = 'DsTree.BranchContent';
165
+ DsTreeBranchIndentGuide.displayName = 'DsTree.BranchIndentGuide';
166
+ DsTreeItem.displayName = 'DsTree.Item';
167
+ DsTreeItemText.displayName = 'DsTree.ItemText';
168
+ DsTreeItemIndicator.displayName = 'DsTree.ItemIndicator';
169
+ DsTreeItemAction.displayName = 'DsTree.ItemAction';
170
+ DsTreeNodeCheckbox.displayName = 'DsTree.NodeCheckbox';
171
+
156
172
  export const DsTree = {
157
173
  Root: DsTreeRoot,
158
174
  Tree: DsTreeTree,
@@ -30,7 +30,7 @@ export const typographyVariantConfig = {
30
30
  heading4: { element: 'h4', component: ark.h4 },
31
31
  } as const;
32
32
 
33
- /** Semantic text colors backed by `--font-*` tokens in `_root_new.scss`. */
33
+ /** Semantic text colors backed by `--font-*` tokens in `_root.scss`. */
34
34
  export const typographyColors = [
35
35
  'main',
36
36
  'secondary',