@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
@@ -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';
@@ -18,9 +18,24 @@ $bulk-actions-reserved-space: 80px;
18
18
  border-style: solid;
19
19
  border-color: var(--color-dap-gray-400);
20
20
  background: var(--background);
21
+ display: flex;
22
+ flex-direction: column;
23
+ max-height: 100%;
24
+ overflow: hidden;
25
+ }
26
+
27
+ .controls {
28
+ background: var(--background);
29
+ border-bottom: 1px solid var(--border);
30
+ padding: var(--xs) var(--standard);
31
+ display: flex;
32
+ align-items: center;
33
+ flex-shrink: 0;
21
34
  }
22
35
 
23
36
  .dataTableContainer {
37
+ flex: 1;
38
+ min-height: 0;
24
39
  max-height: 100%;
25
40
  overflow-x: auto;
26
41
  overflow-y: hidden;
@@ -52,6 +52,7 @@ const DsTable = <TData extends { id: string }, TValue>({
52
52
  ref,
53
53
  columns: columnsProp,
54
54
  data: tableData,
55
+ controls,
55
56
  virtualized = false,
56
57
  virtualizedOptions,
57
58
  className,
@@ -336,41 +337,43 @@ const DsTable = <TData extends { id: string }, TValue>({
336
337
  return (
337
338
  <DsTableContext.Provider value={contextValue}>
338
339
  <div
339
- ref={tableContainerRef}
340
- className={classnames(
341
- styles.container,
342
- !virtualized && styles.dataTableContainer,
343
- virtualized && styles.virtualizedContainer,
344
- isBulkActionsVisible && styles.bulkActionsVisible,
345
- className,
346
- )}
340
+ className={classnames(styles.container, isBulkActionsVisible && styles.bulkActionsVisible, className)}
347
341
  >
348
- <DragWrapper>
349
- <Table className={classnames(fullWidth && styles.fullWidth, !bordered && styles.tableNoBorder)}>
350
- <DsTableHeader table={table} />
351
- {virtualized ? (
352
- <DsTableBodyVirtualized
353
- table={table}
354
- emptyState={emptyState}
355
- estimateSize={virtualizedOptions?.estimateSize || ROW_SIZE_HEIGHT_MAP[rowSize]}
356
- overscan={virtualizedOptions?.overscan}
357
- onScroll={onScroll}
358
- rowSelection={rowSelection}
359
- infiniteScroll={infiniteScroll}
360
- />
361
- ) : (
362
- <TableBody>
363
- <SortableWrapper>
364
- {rows.length
365
- ? rows.map((row) => (
366
- <DsTableRow key={row.id} row={row} isSelected={!!rowSelection[row.id]} />
367
- ))
368
- : renderEmptyState()}
369
- </SortableWrapper>
370
- </TableBody>
371
- )}
372
- </Table>
373
- </DragWrapper>
342
+ {controls && <div className={styles.controls}>{controls}</div>}
343
+ <div
344
+ ref={tableContainerRef}
345
+ className={classnames(
346
+ !virtualized && styles.dataTableContainer,
347
+ virtualized && styles.virtualizedContainer,
348
+ )}
349
+ >
350
+ <DragWrapper>
351
+ <Table className={classnames(fullWidth && styles.fullWidth, !bordered && styles.tableNoBorder)}>
352
+ <DsTableHeader table={table} />
353
+ {virtualized ? (
354
+ <DsTableBodyVirtualized
355
+ table={table}
356
+ emptyState={emptyState}
357
+ estimateSize={virtualizedOptions?.estimateSize || ROW_SIZE_HEIGHT_MAP[rowSize]}
358
+ overscan={virtualizedOptions?.overscan}
359
+ onScroll={onScroll}
360
+ rowSelection={rowSelection}
361
+ infiniteScroll={infiniteScroll}
362
+ />
363
+ ) : (
364
+ <TableBody>
365
+ <SortableWrapper>
366
+ {rows.length
367
+ ? rows.map((row) => (
368
+ <DsTableRow key={row.id} row={row} isSelected={!!rowSelection[row.id]} />
369
+ ))
370
+ : renderEmptyState()}
371
+ </SortableWrapper>
372
+ </TableBody>
373
+ )}
374
+ </Table>
375
+ </DragWrapper>
376
+ </div>
374
377
  {selectable && actions.length > 0 && (
375
378
  <DsTableBulkActions
376
379
  numSelectedRows={selectedRows.length}
@@ -386,4 +389,6 @@ const DsTable = <TData extends { id: string }, TValue>({
386
389
  );
387
390
  };
388
391
 
392
+ DsTable.displayName = 'DsTable';
393
+
389
394
  export default DsTable;
@@ -228,6 +228,12 @@ export interface DsDataTableProps<TData, TValue> {
228
228
  */
229
229
  data: TData[];
230
230
 
231
+ /**
232
+ * Optional content rendered in a pinned controls bar above the table header
233
+ * (e.g. filters, action buttons). Layout is owned by the consumer.
234
+ */
235
+ controls?: React.ReactNode;
236
+
231
237
  /**
232
238
  * Whether the table is virtualized
233
239
  * @default false
@@ -11,7 +11,7 @@ import figma from 'figma';
11
11
 
12
12
  export default {
13
13
  example: figma.code`<DsTable columns={columns} data={data} expandable renderExpandedRow={(row) => null} />`,
14
- imports: ["import { DsTable } from '@drivenets/design-system'"],
14
+ imports: ["import { DsTable } from '@drivenets/design-system';"],
15
15
  id: 'ds-table-expandable',
16
16
  metadata: { nestable: false },
17
- };
17
+ } satisfies figma.Template;
@@ -10,7 +10,7 @@ import figma from 'figma';
10
10
 
11
11
  export default {
12
12
  example: figma.code`<DsTable columns={columns} data={data} />`,
13
- imports: ["import { DsTable } from '@drivenets/design-system'"],
13
+ imports: ["import { DsTable } from '@drivenets/design-system';"],
14
14
  id: 'ds-table',
15
15
  metadata: { nestable: false },
16
- };
16
+ } satisfies figma.Template;
@@ -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,
@@ -72,7 +72,7 @@ const attrs = [`value="${value}"`, `label="${label}"`, icon ? `icon="${icon}"` :
72
72
 
73
73
  export default {
74
74
  example: figma.code`<DsTabs.Tab ${attrs} />`,
75
- imports: ["import { DsTabs } from '@drivenets/design-system'"],
75
+ imports: ["import { DsTabs } from '@drivenets/design-system';"],
76
76
  id: 'ds-tabs-tab-vertical',
77
77
  metadata: { nestable: true },
78
- };
78
+ } satisfies figma.Template;
@@ -83,7 +83,7 @@ const attrs = [
83
83
 
84
84
  export default {
85
85
  example: figma.code`<DsTabs.Tab ${attrs} />`,
86
- imports: ["import { DsTabs } from '@drivenets/design-system'"],
86
+ imports: ["import { DsTabs } from '@drivenets/design-system';"],
87
87
  id: 'ds-tabs-tab',
88
88
  metadata: { nestable: true },
89
- };
89
+ } satisfies figma.Template;
@@ -25,7 +25,7 @@ export default {
25
25
  <DsTabs.List>${tabs}</DsTabs.List>
26
26
  {/* Add a <DsTabs.Content value="..."> panel for each tab */}
27
27
  </DsTabs.Root>`,
28
- imports: ["import { DsTabs } from '@drivenets/design-system'"],
28
+ imports: ["import { DsTabs } from '@drivenets/design-system';"],
29
29
  id: 'ds-tabs-vertical',
30
30
  metadata: { nestable: false },
31
- };
31
+ } satisfies figma.Template;
@@ -23,7 +23,7 @@ export default {
23
23
  <DsTabs.List>${tabs}</DsTabs.List>
24
24
  {/* Add a <DsTabs.Content value="..."> panel for each tab */}
25
25
  </DsTabs.Root>`,
26
- imports: ["import { DsTabs } from '@drivenets/design-system'"],
26
+ imports: ["import { DsTabs } from '@drivenets/design-system';"],
27
27
  id: 'ds-tabs',
28
28
  metadata: { nestable: false },
29
- };
29
+ } satisfies figma.Template;
@@ -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
+ } satisfies figma.Template;
@@ -54,7 +54,7 @@ export default {
54
54
  : type === 'password'
55
55
  ? figma.code`<DsPasswordInput ${sizeAttr} ${disabled ? 'disabled' : ''} />`
56
56
  : figma.code`<DsTextInput ${sizeAttr} ${disabled ? 'disabled' : ''} ${readOnly ? 'readOnly' : ''} />`,
57
- imports: [`import { ${componentName} } from '@drivenets/design-system'`],
57
+ imports: [`import { ${componentName} } from '@drivenets/design-system';`],
58
58
  id: 'ds-text-input',
59
59
  metadata: { nestable: true, props: { fcMember, fcProps } },
60
- };
60
+ } satisfies figma.Template;
@@ -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;
@@ -12,7 +12,7 @@ export default {
12
12
  example: figma.code`const [value, setValue] = useState<Date | null>(null);
13
13
 
14
14
  <DsTimePicker value={value} onChange={setValue} placeholder="hh:mm AM/PM" />`,
15
- imports: ["import { useState } from 'react'", "import { DsTimePicker } from '@drivenets/design-system'"],
15
+ imports: ["import { DsTimePicker } from '@drivenets/design-system';", "import { useState } from 'react';"],
16
16
  id: 'ds-time-picker',
17
17
  metadata: { nestable: true, props: { fcMember: 'TimePicker', fcProps: '' } },
18
- };
18
+ } satisfies figma.Template;
@@ -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
+ } satisfies figma.Template;
@@ -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
+ } satisfies figma.Template;
@@ -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
+ } satisfies figma.Template;
@@ -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;