@drivenets/design-system 0.16.0 → 0.18.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 (176) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/index.cjs +1893 -824
  3. package/dist/index.d.cts +363 -247
  4. package/dist/index.d.cts.map +1 -1
  5. package/dist/index.d.ts +363 -247
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1896 -829
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.min.css +1 -1
  10. package/package.json +25 -25
  11. package/src/components/ds-alert-banner/ds-alert-banner-global.figma.ts +49 -0
  12. package/src/components/ds-alert-banner/ds-alert-banner.figma.ts +51 -0
  13. package/src/components/ds-alert-banner/ds-alert-banner.tsx +7 -6
  14. package/src/components/ds-autocomplete/ds-autocomplete.figma.ts +2 -2
  15. package/src/components/ds-autocomplete/ds-autocomplete.module.scss +15 -4
  16. package/src/components/ds-autocomplete/ds-autocomplete.tsx +10 -3
  17. package/src/components/ds-autocomplete/ds-autocomplete.types.ts +8 -0
  18. package/src/components/ds-avatar/ds-avatar.figma.ts +2 -2
  19. package/src/components/ds-avatar-group/ds-avatar-group.figma.ts +2 -2
  20. package/src/components/ds-breadcrumb/ds-breadcrumb.figma.ts +2 -2
  21. package/src/components/ds-button-v3/ds-button-v3.figma.ts +7 -5
  22. package/src/components/ds-button-v3/ds-button-v3.module.scss +84 -17
  23. package/src/components/ds-button-v3/ds-button-v3.tsx +2 -0
  24. package/src/components/ds-button-v3/ds-button-v3.types.ts +11 -2
  25. package/src/components/ds-button-v3/ds-button-v4.figma.ts +121 -0
  26. package/src/components/ds-card/figma/ds-card-content.figma.ts +2 -2
  27. package/src/components/ds-card/figma/ds-card-footer.figma.ts +2 -2
  28. package/src/components/ds-card/figma/ds-card-header.figma.ts +2 -2
  29. package/src/components/ds-card/figma/ds-card.figma.ts +2 -2
  30. package/src/components/ds-catalog-layout/ds-catalog-layout.figma.ts +51 -0
  31. package/src/components/ds-catalog-layout/ds-catalog-layout.tsx +9 -8
  32. package/src/components/ds-checkbox/ds-checkbox-level-2.figma.ts +2 -2
  33. package/src/components/ds-checkbox/ds-checkbox.figma.ts +2 -2
  34. package/src/components/ds-checkbox-group/ds-checkbox-group.figma.ts +2 -2
  35. package/src/components/ds-comment-bubble/ds-comment-bubble.figma.ts +52 -0
  36. package/src/components/ds-comment-card/ds-comment-card.figma.ts +36 -0
  37. package/src/components/ds-comment-indicator/ds-comment-indicator.figma.ts +32 -0
  38. package/src/components/ds-comments-drawer/components/comments-filter-modal/index.ts +0 -1
  39. package/src/components/ds-comments-drawer/ds-comments-drawer.figma.ts +19 -0
  40. package/src/components/ds-confirmation/ds-confirmation.tsx +13 -11
  41. package/src/components/ds-date-picker/ds-date-picker.figma.ts +2 -2
  42. package/src/components/ds-divider/ds-divider.figma.ts +2 -2
  43. package/src/components/ds-drawer/ds-drawer.tsx +11 -10
  44. package/src/components/ds-drawer/figma/ds-drawer-content.figma.ts +2 -2
  45. package/src/components/ds-drawer/figma/ds-drawer-footer.figma.ts +2 -2
  46. package/src/components/ds-drawer/figma/ds-drawer-header.figma.ts +2 -2
  47. package/src/components/ds-drawer/figma/ds-drawer.figma.ts +2 -2
  48. package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-footer.figma.ts +2 -2
  49. package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-group.figma.ts +2 -2
  50. package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-item.figma.ts +2 -2
  51. package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-separator.figma.ts +2 -2
  52. package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu.figma.ts +2 -2
  53. package/src/components/ds-expandable-text-input/ds-expandable-text-input.figma.ts +2 -2
  54. package/src/components/ds-file-upload/components/file-upload-item/index.ts +0 -1
  55. package/src/components/ds-file-upload/ds-file-upload.figma.ts +2 -2
  56. package/src/components/ds-filter-status-icon/ds-filter-status-icon.figma.ts +2 -2
  57. package/src/components/ds-form-control/ds-form-control.figma.ts +2 -2
  58. package/src/components/ds-form-control/ds-form-control.tsx +15 -13
  59. package/src/components/ds-icon/figma/ds-icon-material.figma.batch.ts +1 -1
  60. package/src/components/ds-icon/figma/ds-icon-special.figma.batch.ts +1 -1
  61. package/src/components/ds-key-value-pair/ds-key-value-pair.figma.ts +2 -2
  62. package/src/components/ds-loader/ds-loader.figma.ts +2 -2
  63. package/src/components/ds-modal/ds-modal.tsx +10 -9
  64. package/src/components/ds-modal/figma/ds-modal-content.figma.ts +2 -2
  65. package/src/components/ds-modal/figma/ds-modal-footer.figma.ts +2 -2
  66. package/src/components/ds-modal/figma/ds-modal-header.figma.ts +2 -2
  67. package/src/components/ds-modal/figma/ds-modal.figma.ts +2 -2
  68. package/src/components/ds-number-input/ds-number-input.tsx +1 -0
  69. package/src/components/ds-panel/ds-panel.figma.ts +2 -2
  70. package/src/components/ds-popover/figma/ds-popover-content-item.figma.ts +2 -2
  71. package/src/components/ds-popover/figma/ds-popover-content.figma.ts +2 -2
  72. package/src/components/ds-popover/figma/ds-popover-footer.figma.ts +2 -2
  73. package/src/components/ds-popover/figma/ds-popover-header.figma.ts +2 -2
  74. package/src/components/ds-popover/figma/ds-popover.figma.ts +2 -2
  75. package/src/components/ds-progress-arc/ds-progress-arc.figma.ts +2 -2
  76. package/src/components/ds-progress-donut/ds-progress-donut.figma.ts +2 -2
  77. package/src/components/ds-progress-linear/ds-progress-linear.figma.ts +2 -2
  78. package/src/components/ds-progress-task-bar/ds-progress-task-bar.figma.ts +2 -2
  79. package/src/components/ds-radio-group/figma/ds-radio-group-item.figma.ts +2 -2
  80. package/src/components/ds-radio-group/figma/ds-radio-group.figma.ts +2 -2
  81. package/src/components/ds-segment-group/figma/ds-segment-group-item.figma.ts +2 -2
  82. package/src/components/ds-segment-group/figma/ds-segment-group.figma.ts +2 -2
  83. package/src/components/ds-select/ds-select.figma.ts +4 -3
  84. package/src/components/ds-select/ds-select.tsx +6 -1
  85. package/src/components/ds-select/ds-select.types.ts +2 -1
  86. package/src/components/ds-site-node/ds-site-node.figma.ts +2 -2
  87. package/src/components/ds-slider/ds-slider.figma.ts +29 -0
  88. package/src/components/ds-slider/ds-slider.module.scss +104 -0
  89. package/src/components/ds-slider/ds-slider.tsx +118 -0
  90. package/src/components/ds-slider/ds-slider.types.ts +102 -0
  91. package/src/components/ds-slider/ds-slider.utils.ts +14 -0
  92. package/src/components/ds-slider/index.ts +11 -0
  93. package/src/components/ds-smart-tabs/ds-smart-tabs.tsx +5 -4
  94. package/src/components/ds-smart-tabs/figma/ds-smart-tabs-tab.figma.ts +83 -0
  95. package/src/components/ds-smart-tabs/figma/ds-smart-tabs.figma.ts +23 -0
  96. package/src/components/ds-spinner/ds-spinner.figma.ts +2 -2
  97. package/src/components/ds-split-button/ds-split-button.figma.ts +2 -2
  98. package/src/components/ds-status-badge-v2/ds-status-badge-v2.figma.ts +2 -2
  99. package/src/components/ds-stepper/ds-stepper.figma.ts +2 -2
  100. package/src/components/ds-table/components/ds-table-group-header-cell/ds-table-group-header-cell.module.scss +5 -1
  101. package/src/components/ds-table/components/ds-table-group-header-cell/ds-table-group-header-cell.tsx +15 -3
  102. package/src/components/ds-table/components/ds-table-group-header-cell/index.ts +0 -1
  103. package/src/components/ds-table/components/ds-table-header/ds-table-header.module.scss +17 -3
  104. package/src/components/ds-table/components/ds-table-header/ds-table-header.tsx +30 -9
  105. package/src/components/ds-table/components/ds-table-resize-handle/ds-table-resize-handle.module.scss +23 -0
  106. package/src/components/ds-table/components/ds-table-resize-handle/ds-table-resize-handle.tsx +218 -0
  107. package/src/components/ds-table/components/ds-table-resize-handle/ds-table-resize-handle.types.ts +14 -0
  108. package/src/components/ds-table/components/ds-table-resize-handle/index.ts +1 -0
  109. package/src/components/ds-table/components/ds-table-resize-overlay/ds-table-resize-overlay.module.scss +18 -0
  110. package/src/components/ds-table/components/ds-table-resize-overlay/ds-table-resize-overlay.tsx +16 -0
  111. package/src/components/ds-table/components/ds-table-resize-overlay/ds-table-resize-overlay.types.ts +13 -0
  112. package/src/components/ds-table/components/ds-table-resize-overlay/index.ts +1 -0
  113. package/src/components/ds-table/components/ds-table-row/ds-table-row.module.scss +1 -1
  114. package/src/components/ds-table/components/ds-table-row/ds-table-row.tsx +9 -2
  115. package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.module.scss +2 -1
  116. package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.tsx +9 -2
  117. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-checkbox.tsx +2 -2
  118. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-date.tsx +2 -1
  119. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-number.tsx +2 -1
  120. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-select.tsx +2 -1
  121. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-text.tsx +2 -1
  122. package/src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.tsx +12 -3
  123. package/src/components/ds-table/context/ds-table-context.tsx +208 -0
  124. package/src/components/ds-table/ds-table-defaults.ts +42 -0
  125. package/src/components/ds-table/ds-table.module.scss +19 -1
  126. package/src/components/ds-table/ds-table.tsx +163 -235
  127. package/src/components/ds-table/ds-table.types.ts +59 -47
  128. package/src/components/ds-table/figma/ds-table-expandable.figma.ts +2 -2
  129. package/src/components/ds-table/figma/ds-table.figma.ts +2 -2
  130. package/src/components/ds-table/grouping/utils/column-group.ts +7 -5
  131. package/src/components/ds-table/hooks/use-cell-editor.ts +5 -1
  132. package/src/components/ds-table/hooks/use-column-resize.ts +385 -0
  133. package/src/components/ds-table/hooks/use-editing-state.ts +190 -0
  134. package/src/components/ds-table/index.ts +1 -0
  135. package/src/components/ds-table/styles/_variables.scss +2 -1
  136. package/src/components/ds-table/utils/column-size-meta.augmentation.ts +16 -0
  137. package/src/components/ds-table/utils/column-size.ts +213 -10
  138. package/src/components/ds-table/utils/column-size.unit.test.ts +213 -0
  139. package/src/components/ds-table/utils/constants.ts +28 -0
  140. package/src/components/ds-table/utils/frozen-body.ts +33 -0
  141. package/src/components/ds-table/utils/frozen-body.unit.test.ts +44 -0
  142. package/src/components/ds-table/utils/table-api.ts +42 -0
  143. package/src/components/ds-table/utils/table-api.unit.test.ts +82 -0
  144. package/src/components/ds-table/utils/table-columns.tsx +119 -0
  145. package/src/components/ds-table/utils/table-columns.unit.test.ts +199 -0
  146. package/src/components/ds-tabs/figma/ds-tabs-tab-vertical.figma.ts +2 -2
  147. package/src/components/ds-tabs/figma/ds-tabs-tab.figma.ts +2 -2
  148. package/src/components/ds-tabs/figma/ds-tabs-vertical.figma.ts +2 -2
  149. package/src/components/ds-tabs/figma/ds-tabs.figma.ts +2 -2
  150. package/src/components/ds-tag/ds-tag.figma.ts +51 -0
  151. package/src/components/ds-tag-filter/ds-tag-filter.figma.ts +16 -0
  152. package/src/components/ds-text-input/ds-input-field-v02.figma.ts +31 -6
  153. package/src/components/ds-text-input/ds-text-input.figma.ts +5 -4
  154. package/src/components/ds-text-input/ds-text-input.tsx +1 -0
  155. package/src/components/ds-text-input/ds-text-input.types.ts +1 -1
  156. package/src/components/ds-time-picker/ds-time-picker.figma.ts +2 -2
  157. package/src/components/ds-toast/ds-toast.figma.ts +3 -3
  158. package/src/components/ds-toggle/ds-toggle.figma.ts +2 -2
  159. package/src/components/ds-tooltip/ds-tooltip.figma.ts +2 -2
  160. package/src/components/ds-tree/ds-tree.figma.ts +54 -0
  161. package/src/components/ds-tree/ds-tree.module.scss +2 -2
  162. package/src/components/ds-tree/ds-tree.tsx +6 -0
  163. package/src/components/ds-tree/ds-tree.types.ts +16 -0
  164. package/src/components/ds-typography/ds-typography.figma.ts +2 -2
  165. package/src/components/ds-user-card/ds-user-card.figma.ts +2 -2
  166. package/src/components/ds-vertical-tabs/ds-vertical-tabs.tsx +13 -6
  167. package/src/components/ds-workspace-layout/ds-workspace-layout.figma.ts +99 -0
  168. package/src/components/ds-workspace-layout/ds-workspace-layout.module.scss +1 -8
  169. package/src/components/ds-workspace-layout/ds-workspace-layout.tsx +11 -10
  170. package/src/index.ts +1 -0
  171. package/src/styles/_gradients.scss +19 -0
  172. package/src/styles/_root.scss +39 -15
  173. package/src/styles/_typography.scss +1 -0
  174. package/src/styles/shared/_input.scss +10 -0
  175. package/src/styles/styles.scss +1 -0
  176. package/src/components/ds-table/context/ds-table-context.ts +0 -112
@@ -27,7 +27,7 @@ $transition-duration: 0.2s;
27
27
  background: var(--background-action-hover-weak);
28
28
  }
29
29
 
30
- &[data-focus] {
30
+ &:focus-visible {
31
31
  position: relative;
32
32
  outline: none;
33
33
  background: var(--background-action-hover-weak);
@@ -56,7 +56,7 @@ $transition-duration: 0.2s;
56
56
  }
57
57
 
58
58
  &:hover .itemAction,
59
- &[data-focus-visible] .itemAction {
59
+ &:focus-within .itemAction {
60
60
  opacity: 1;
61
61
  }
62
62
  }
@@ -38,6 +38,9 @@ const DsTreeRoot = <T extends DsTreeNode = DsTreeNode>({
38
38
  checkedValue,
39
39
  defaultCheckedValue,
40
40
  onCheckedChange,
41
+ focusedValue,
42
+ defaultFocusedValue,
43
+ onFocusChange,
41
44
  typeahead = true,
42
45
  lazyMount = true,
43
46
  unmountOnExit,
@@ -56,6 +59,9 @@ const DsTreeRoot = <T extends DsTreeNode = DsTreeNode>({
56
59
  checkedValue={checkedValue}
57
60
  defaultCheckedValue={defaultCheckedValue}
58
61
  onCheckedChange={onCheckedChange}
62
+ focusedValue={focusedValue}
63
+ defaultFocusedValue={defaultFocusedValue}
64
+ onFocusChange={onFocusChange}
59
65
  typeahead={typeahead}
60
66
  lazyMount={lazyMount}
61
67
  unmountOnExit={unmountOnExit}
@@ -115,6 +115,22 @@ export interface DsTreeRootProps<T extends DsTreeNode = DsTreeNode> extends DsTr
115
115
  */
116
116
  onCheckedChange?: ArkTreeView.RootProps<T>['onCheckedChange'];
117
117
 
118
+ /**
119
+ * Id of the node with keyboard focus (controlled). Use with `onFocusChange`.
120
+ * When `null`, Ark treats the first node as focused for roving-tabindex purposes.
121
+ */
122
+ focusedValue?: string | null;
123
+ /**
124
+ * Id of the node focused initially when uncontrolled. When `null` (the Ark
125
+ * default), the first node receives focus for roving-tabindex purposes.
126
+ */
127
+ defaultFocusedValue?: string | null;
128
+ /**
129
+ * Called when the focused node changes. Receives the Ark focus-change details
130
+ * including the new `focusedValue` (or `null` when nothing is focused).
131
+ */
132
+ onFocusChange?: ArkTreeView.RootProps<T>['onFocusChange'];
133
+
118
134
  /**
119
135
  * Whether to enable typeahead navigation — typing characters focuses matching nodes.
120
136
  */
@@ -57,7 +57,7 @@ const colorProp = color === 'main' ? '' : figma.code` color="${color}"`;
57
57
 
58
58
  export default {
59
59
  example: figma.code`<DsTypography variant="${variant}"${colorProp}>${text}</DsTypography>`,
60
- imports: ["import { DsTypography } from '@drivenets/design-system'"],
60
+ imports: ["import { DsTypography } from '@drivenets/design-system';"],
61
61
  id: 'ds-typography',
62
62
  metadata: { nestable: true },
63
- };
63
+ } satisfies figma.Template;
@@ -10,7 +10,7 @@ import figma from 'figma';
10
10
 
11
11
  export default {
12
12
  example: figma.code`<DsUserCard name="Full Name" subtitle="subtitle" />`,
13
- imports: ["import { DsUserCard } from '@drivenets/design-system'"],
13
+ imports: ["import { DsUserCard } from '@drivenets/design-system';"],
14
14
  id: 'ds-user-card',
15
15
  metadata: { nestable: true },
16
- };
16
+ } satisfies figma.Template;
@@ -26,7 +26,13 @@ import styles from './ds-vertical-tabs.module.scss';
26
26
  * </DsVerticalTabs>
27
27
  * ```
28
28
  */
29
- const DsVerticalTabs = ({ value, onValueChange, className, style, children }: DsVerticalTabsRootProps) => {
29
+ const DsVerticalTabsRoot = ({
30
+ value,
31
+ onValueChange,
32
+ className,
33
+ style,
34
+ children,
35
+ }: DsVerticalTabsRootProps) => {
30
36
  const handleValueChange = (details: { value: string | null }) => {
31
37
  onValueChange?.(details.value);
32
38
  };
@@ -77,10 +83,11 @@ DsVerticalTabsList.displayName = 'DsVerticalTabs.List';
77
83
  DsVerticalTabsTab.displayName = 'DsVerticalTabs.Tab';
78
84
  DsVerticalTabsContent.displayName = 'DsVerticalTabs.Content';
79
85
 
80
- DsVerticalTabs.List = DsVerticalTabsList;
81
- DsVerticalTabs.Tab = DsVerticalTabsTab;
82
- DsVerticalTabs.Content = DsVerticalTabsContent;
83
-
84
- DsVerticalTabs.displayName = 'DsVerticalTabs';
86
+ const DsVerticalTabs = Object.assign(DsVerticalTabsRoot, {
87
+ displayName: 'DsVerticalTabs',
88
+ List: DsVerticalTabsList,
89
+ Tab: DsVerticalTabsTab,
90
+ Content: DsVerticalTabsContent,
91
+ });
85
92
 
86
93
  export default DsVerticalTabs;
@@ -0,0 +1,99 @@
1
+ // url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=32960-46399
2
+ // source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-workspace-layout
3
+ // component=DsWorkspaceLayout.Header
4
+ //
5
+ // Maps Part_workspace-header_v02 / DAP_workspace-header_v02. Figma `Type` selects the
6
+ // example Header composition; Figma `Status` is ignored (badge always shown).
7
+ // Layout divs are structural only — consumers supply their own header chrome CSS.
8
+ import figma from 'figma';
9
+
10
+ const instance = figma.selectedInstance;
11
+
12
+ const type =
13
+ instance.getEnum('Type', {
14
+ draft: 'draft',
15
+ pending: 'pending',
16
+ running: 'running',
17
+ }) ?? 'draft';
18
+
19
+ const draftHeader = figma.code`<DsWorkspaceLayout.Header>
20
+ {/* left / center / right — style with consumer CSS (flex row) */}
21
+ <div>
22
+ <DsButtonV3 variant="secondary" color="light" size="small" icon="close">
23
+ Close
24
+ </DsButtonV3>
25
+ </div>
26
+ <div>
27
+ <DsTypography variant="body-sm-reg">Untitled Project -23-May-2024 04:47 PM</DsTypography>
28
+ <DsIcon icon="info" size="tiny" />
29
+ <DsStatusBadgeV2 phase="temporary" label="Draft" size="small" />
30
+ </div>
31
+ <div>
32
+ <DsButtonV3 variant="secondary" color="light" size="small">
33
+ Discard
34
+ </DsButtonV3>
35
+ <DsButtonV3 variant="primary" color="light" size="small">
36
+ Save project
37
+ </DsButtonV3>
38
+ <DsButtonV3 variant="tertiary" color="light" size="small" icon="more_vert" aria-label="More actions" />
39
+ </div>
40
+ </DsWorkspaceLayout.Header>`;
41
+
42
+ const pendingHeader = figma.code`<DsWorkspaceLayout.Header>
43
+ {/* left / center / right — style with consumer CSS (flex row) */}
44
+ <div>
45
+ <DsButtonV3 variant="secondary" color="light" size="small" icon="close">
46
+ Close
47
+ </DsButtonV3>
48
+ </div>
49
+ <div>
50
+ <DsTypography variant="body-sm-reg">Untitled Project -23-May-2024 04:47 PM</DsTypography>
51
+ <DsIcon icon="info" size="tiny" />
52
+ <DsStatusBadgeV2 phase="pending" label="Pending" size="small" />
53
+ </div>
54
+ <div>
55
+ <DsButtonV3 variant="secondary" color="light" size="small">
56
+ Discard
57
+ </DsButtonV3>
58
+ <DsButtonV3 variant="primary" color="light" size="small">
59
+ Save project
60
+ </DsButtonV3>
61
+ <DsButtonV3 variant="tertiary" color="light" size="small" icon="more_vert" aria-label="More actions" />
62
+ </div>
63
+ </DsWorkspaceLayout.Header>`;
64
+
65
+ const runningHeader = figma.code`<DsWorkspaceLayout.Header>
66
+ {/* left / center / right — style with consumer CSS (flex row) */}
67
+ <div>
68
+ <DsButtonV3 variant="secondary" color="light" size="small" icon="close">
69
+ Close
70
+ </DsButtonV3>
71
+ <DsButtonV3 variant="secondary" color="light" size="small" icon="keyboard_double_arrow_left">
72
+ Previous
73
+ </DsButtonV3>
74
+ <DsButtonV3 variant="secondary" color="light" size="small">
75
+ Next
76
+ </DsButtonV3>
77
+ </div>
78
+ <div>
79
+ <DsTypography variant="body-sm-reg">Untitled Project -23-May-2024 04:47 PM</DsTypography>
80
+ <DsIcon icon="info" size="tiny" />
81
+ <DsStatusBadgeV2 phase="execution" label="Running" size="small" />
82
+ </div>
83
+ <div>
84
+ <DsIcon icon="history_2" size="small" />
85
+ <DsTypography variant="body-sm-reg">Last update: 2d ago</DsTypography>
86
+ <DsButtonV3 variant="tertiary" color="light" size="small" icon="more_vert" aria-label="More actions" />
87
+ </div>
88
+ </DsWorkspaceLayout.Header>`;
89
+
90
+ const example = type === 'pending' ? pendingHeader : type === 'running' ? runningHeader : draftHeader;
91
+
92
+ export default {
93
+ example,
94
+ imports: [
95
+ "import { DsWorkspaceLayout, DsButtonV3, DsTypography, DsIcon, DsStatusBadgeV2 } from '@drivenets/design-system';",
96
+ ],
97
+ id: 'ds-workspace-layout-header',
98
+ metadata: { nestable: true },
99
+ } satisfies figma.Template;
@@ -1,12 +1,5 @@
1
1
  .root {
2
2
  --ds-workspace-layout-header-height: 54px;
3
- --ds-workspace-layout-header-gradient: radial-gradient(
4
- ellipse at left bottom,
5
- rgba(1, 75, 253, 1) 0%,
6
- rgba(10, 60, 194, 1) 78%,
7
- rgba(16, 51, 160, 1) 89%,
8
- rgba(21, 42, 126, 1) 100%
9
- );
10
3
  --ds-workspace-layout-side-menu-collapsed-width: 60px;
11
4
  --ds-workspace-layout-side-menu-expanded-width: 256px;
12
5
  --ds-workspace-layout-side-menu-padding-top: 28px;
@@ -33,7 +26,7 @@
33
26
  flex-shrink: 0;
34
27
  height: var(--ds-workspace-layout-header-height);
35
28
  padding: 0 var(--sm) 0 var(--lg);
36
- background: var(--ds-workspace-layout-header-gradient);
29
+ background: var(--blue-grad-workspace-header);
37
30
  color: var(--font-on-action);
38
31
  overflow: clip;
39
32
  }
@@ -19,7 +19,7 @@ const DEFAULT_LOCALE = Object.freeze({
19
19
  unpinButtonLabel: 'Unpin side menu',
20
20
  });
21
21
 
22
- const DsWorkspaceLayout = ({ className, fillParent = false, ...rest }: DsWorkspaceLayoutProps) => {
22
+ const DsWorkspaceLayoutRoot = ({ className, fillParent = false, ...rest }: DsWorkspaceLayoutProps) => {
23
23
  const [hasLeftSidePanel, setHasLeftSidePanel] = useState(false);
24
24
 
25
25
  const registerLeftSidePanel = useCallback(() => setHasLeftSidePanel(true), []);
@@ -132,14 +132,15 @@ Body.displayName = 'DsWorkspaceLayout.Body';
132
132
  SideMenu.displayName = 'DsWorkspaceLayout.SideMenu';
133
133
  LeftPanel.displayName = 'DsWorkspaceLayout.LeftPanel';
134
134
 
135
- DsWorkspaceLayout.Header = Header;
136
- DsWorkspaceLayout.SubHeader = SubHeader;
137
- DsWorkspaceLayout.Content = Content;
138
- DsWorkspaceLayout.Footer = Footer;
139
- DsWorkspaceLayout.Body = Body;
140
- DsWorkspaceLayout.SideMenu = SideMenu;
141
- DsWorkspaceLayout.LeftPanel = LeftPanel;
142
-
143
- DsWorkspaceLayout.displayName = 'DsWorkspaceLayout';
135
+ const DsWorkspaceLayout = Object.assign(DsWorkspaceLayoutRoot, {
136
+ displayName: 'DsWorkspaceLayout',
137
+ Header,
138
+ SubHeader,
139
+ Content,
140
+ Footer,
141
+ Body,
142
+ SideMenu,
143
+ LeftPanel,
144
+ });
144
145
 
145
146
  export default DsWorkspaceLayout;
package/src/index.ts CHANGED
@@ -45,6 +45,7 @@ export * from './components/ds-segment-group';
45
45
  export * from './components/ds-select';
46
46
  export * from './components/ds-site-node';
47
47
  export * from './components/ds-skeleton';
48
+ export * from './components/ds-slider';
48
49
  export * from './components/ds-smart-tabs';
49
50
  export * from './components/ds-spinner';
50
51
  export * from './components/ds-split-button';
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Hand-authored shared Brand Refresh gradient styles. Source in Figma.
3
+ * App-/product-specific gradients stay in the consuming application — see Guidelines/Colors.
4
+ */
5
+ :root {
6
+ // https://www.figma.com/design/DDe8yyHzVoBDePbLfmJYce/DAP-Brand-Refresh-1.0?node-id=181-13762
7
+ --blue-radial-grad: radial-gradient(
8
+ 58.25% 72.07% at 94.38% 95.2%,
9
+ var(--blue-grad-2) 0%,
10
+ var(--blue-grad-1) 100%
11
+ );
12
+
13
+ // https://www.figma.com/design/DDe8yyHzVoBDePbLfmJYce/DAP-Brand-Refresh-1.0?node-id=4-10764
14
+ --blue-grad-workspace-header: radial-gradient(
15
+ 24.05% 380.93% at 24.05% 0%,
16
+ rgb(0 160 250 / 80%) 0%,
17
+ var(--blue-grad-1) 100%
18
+ );
19
+ }
@@ -18,18 +18,18 @@
18
18
  :root {
19
19
  /* Mode 1 */
20
20
  /* color */
21
- --color-dap-blue-050: #edf7ff;
22
- --color-dap-blue-075: #e1efff;
23
- --color-dap-blue-100: #d6eaff;
24
- --color-dap-blue-200: #b5ddff;
25
- --color-dap-blue-300: #83c8ff;
26
- --color-dap-blue-400: #48aaff;
27
- --color-dap-blue-500: #1e83ff;
28
- --color-dap-blue-600: #0661ff;
29
- --color-dap-blue-700: #004cff;
30
- --color-dap-blue-800: #083bc5;
31
- --color-dap-blue-900: #0d379b;
32
- --color-dap-blue-950: #0e235d;
21
+ --color-dap-blue-050: #e3f2ff;
22
+ --color-dap-blue-075: #d4ecff;
23
+ --color-dap-blue-100: #c4e4ff;
24
+ --color-dap-blue-200: #a7d3ff;
25
+ --color-dap-blue-300: #85c2ff;
26
+ --color-dap-blue-400: #5eacff;
27
+ --color-dap-blue-500: #3593ff;
28
+ --color-dap-blue-600: #1c79ff;
29
+ --color-dap-blue-700: #0066fa;
30
+ --color-dap-blue-800: #0057d4;
31
+ --color-dap-blue-900: #0047ad;
32
+ --color-dap-blue-950: #00337e;
33
33
  --color-dap-brand-050: #e5e8ed;
34
34
  --color-dap-brand-100: #bfc6d1;
35
35
  --color-dap-brand-200: #99a3b6;
@@ -259,14 +259,14 @@
259
259
  --background-info: var(--color-dap-blue-050);
260
260
  --background-info-strong: var(--color-dap-blue-800);
261
261
  --background-light: var(--color-dap-dark-blue-500);
262
+ --background-light-active: var(--color-dap-blue-400);
262
263
  --background-light-disabled: #415b9a;
264
+ --background-light-hover: var(--color-dap-blue-500);
263
265
  --background-light-primary: var(--color-dap-dark-blue-300);
264
266
  --background-light-primary-hover: var(--color-dap-dark-blue-200);
265
267
  --background-light-primary-selected: var(--color-dap-dark-blue-150);
266
268
  --background-light-secondary-selected: var(--color-dap-dark-blue-400);
267
269
  --background-light-subtle: var(--color-dap-blue-600);
268
- --background-light-subtle-active: var(--color-dap-blue-400);
269
- --background-light-subtle-hover: var(--color-dap-blue-500);
270
270
  --background-neutral: var(--color-dap-gray-600);
271
271
  --background-overlay: #001a4733;
272
272
  --background-page: var(--color-dap-gray-100);
@@ -293,6 +293,8 @@
293
293
  --background-transparent-hover: #ffffff26;
294
294
  --background-warning: var(--color-dap-orange-100);
295
295
  --background-warning-strong: var(--color-dap-orange-600);
296
+ --blue-grad-1: var(--color-dap-blue-700);
297
+ --blue-grad-2: #2ab2ff;
296
298
  --border: var(--color-dap-gray-300);
297
299
  --border-action-primary: var(--color-dap-blue-700);
298
300
  --border-action-primary-hover: var(--color-dap-blue-800);
@@ -316,6 +318,14 @@
316
318
  --border-success: var(--color-dap-green-600);
317
319
  --border-tertiary: var(--color-dap-gray-100);
318
320
  --border-warning-strong: var(--color-dap-orange-600);
321
+ --device-green: #39cea0;
322
+ --device-green-20: #39cea033;
323
+ --device-light-blue: #74b8f4;
324
+ --device-light-blue-20: #74b8f433;
325
+ --device-orange: #ea8078;
326
+ --device-orange-20: #ea807833;
327
+ --device-purple: #9747ff;
328
+ --device-purple-20: #9747ff33;
319
329
  --error: var(--color-dap-red-050);
320
330
  --font-action: var(--color-dap-blue-700);
321
331
  --font-action-hover: var(--color-dap-blue-800);
@@ -420,6 +430,20 @@
420
430
  --status-bg-success: var(--color-dap-green-075);
421
431
  --status-bg-warning: var(--color-dap-orange-200);
422
432
  --text-on-button: #000000;
433
+ --dap-icons-0: var(--color-dap-gray-050);
434
+ --dap-icons-100: var(--color-dap-blue-100);
435
+ --dap-icons-200: var(--color-dap-blue-200);
436
+ --dap-icons-300: var(--color-dap-blue-300);
437
+ --dap-icons-400: var(--color-dap-blue-400);
438
+ --dap-icons-50: var(--color-dap-blue-050);
439
+ --dap-icons-500: var(--color-dap-blue-500);
440
+ --dap-icons-600: var(--color-dap-blue-600);
441
+ --dap-icons-700: var(--color-dap-blue-700);
442
+ --dap-icons-75: var(--color-dap-blue-075);
443
+ --dap-icons-800: var(--color-dap-blue-800);
444
+ --dap-icons-900: var(--color-dap-blue-900);
445
+ --dap-icons-950: var(--color-dap-blue-950);
446
+ --dap-icons-grey: var(--color-dap-gray-600);
423
447
  }
424
448
  /* Spacing */
425
449
  :root {
@@ -473,5 +497,5 @@
473
497
  /* string */
474
498
  --font-family-base: Roboto;
475
499
  --font-family-code: Fira Mono;
476
- --font-family-heading: Roboto;
500
+ --font-family-heading: Poppins;
477
501
  }
@@ -164,6 +164,7 @@
164
164
 
165
165
  @mixin heading($font-weight: var(--heading-font-size-3xl), $line-height: var(--heading-line-height-3xl)) {
166
166
  @include font-base;
167
+ font-family: var(--font-family-heading);
167
168
  font-size: $font-weight;
168
169
  font-weight: var(--font-weight-semi-bold);
169
170
  line-height: $line-height;
@@ -3,6 +3,7 @@
3
3
  // Variables
4
4
  $input-text-height-small: 28px;
5
5
  $input-text-height-default: 36px;
6
+ $input-text-height-large: 40px;
6
7
  $textarea-height-default: 120px;
7
8
 
8
9
  // Mixins
@@ -171,6 +172,11 @@ $textarea-height-default: 120px;
171
172
  height: $input-text-height-default;
172
173
  }
173
174
 
175
+ &.large {
176
+ height: $input-text-height-large;
177
+ max-height: $input-text-height-large;
178
+ }
179
+
174
180
  &:has(input[type='number']) {
175
181
  .input {
176
182
  text-align: center;
@@ -240,6 +246,10 @@ $textarea-height-default: 120px;
240
246
  height: $input-text-height-small;
241
247
  }
242
248
 
249
+ &.large {
250
+ height: $input-text-height-large;
251
+ }
252
+
243
253
  .clearIcon {
244
254
  grid-column: 2;
245
255
  grid-row: 1;
@@ -5,6 +5,7 @@
5
5
  @use './utilities';
6
6
  @use './scrollbars';
7
7
  @use './root';
8
+ @use './gradients';
8
9
 
9
10
  @use './shared/dropdown';
10
11
  @use './shared/input';
@@ -1,112 +0,0 @@
1
- import { createContext, useCallback, useContext, useRef, useState } from 'react';
2
- import type { Cell } from '@tanstack/react-table';
3
- import type { DsDataTableProps, DsTableRowSize } from '../ds-table.types';
4
-
5
- export interface EditingState<TData, TValue> {
6
- cell: Cell<TData, TValue>;
7
- draftValue: TValue;
8
- error: string | null;
9
- }
10
-
11
- export interface DsTableContextType<TData, TValue> extends Partial<DsDataTableProps<TData, TValue>> {
12
- /**
13
- * Whether the table is virtualized
14
- * @default false
15
- */
16
- virtualized?: boolean;
17
- /**
18
- * Row size variant
19
- * @default 'medium'
20
- */
21
- rowSize: DsTableRowSize;
22
- /**
23
- * ID of the currently active row
24
- */
25
- activeRowId?: string | null;
26
- /**
27
- * Toggles the collapsed state of a column group by its id.
28
- */
29
- onToggleColumnGroup?: (groupId: string) => void;
30
- /** The cell currently in edit mode, if any. */
31
- editing: EditingState<TData, TValue> | null;
32
- beginEdit: (cell: Cell<TData, TValue>) => void;
33
- setDraft: (value: TValue) => void;
34
- commit: (overrideValue?: TValue) => void;
35
- cancel: () => void;
36
- }
37
-
38
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
39
- export const DsTableContext = createContext<DsTableContextType<any, any> | null>(null);
40
-
41
- export const useDsTableContext = <TData, TValue>(): DsTableContextType<TData, TValue> => {
42
- const context = useContext(DsTableContext);
43
- if (!context) {
44
- throw new Error('useDsTableContext must be used within DsTable');
45
- }
46
- return context as DsTableContextType<TData, TValue>;
47
- };
48
-
49
- /**
50
- * Hoisted editing state for single-cell-at-a-time inline editing.
51
- * Lives on {@link DsTableContext} so cell renderers and editors share one provider.
52
- */
53
- export const useEditingState = <TData, TValue>(
54
- onCellEdit?: (row: TData, columnId: string, value: TValue) => void,
55
- onCellValidate?: (row: TData, columnId: string, value: TValue) => string | null,
56
- ) => {
57
- const [editing, setEditing] = useState<EditingState<TData, TValue> | null>(null);
58
-
59
- const onCellEditRef = useRef(onCellEdit);
60
- onCellEditRef.current = onCellEdit;
61
-
62
- const onCellValidateRef = useRef(onCellValidate);
63
- onCellValidateRef.current = onCellValidate;
64
-
65
- const editingRef = useRef(editing);
66
- editingRef.current = editing;
67
-
68
- const beginEdit = useCallback((cell: Cell<TData, TValue>) => {
69
- const current = editingRef.current;
70
- if (current) {
71
- const isSameCell = current.cell.row.id === cell.row.id && current.cell.column.id === cell.column.id;
72
- if (isSameCell) {
73
- return;
74
- }
75
- }
76
- setEditing({
77
- cell,
78
- draftValue: cell.getValue(),
79
- error: null,
80
- });
81
- }, []);
82
-
83
- const setDraft = useCallback((value: TValue) => {
84
- const current = editingRef.current;
85
- if (!current) {
86
- return;
87
- }
88
- setEditing({ ...current, draftValue: value, error: null });
89
- }, []);
90
-
91
- const commit = useCallback((overrideValue?: TValue) => {
92
- const current = editingRef.current;
93
- if (!current) {
94
- return;
95
- }
96
- const valueToCommit = overrideValue !== undefined ? overrideValue : current.draftValue;
97
- const error =
98
- onCellValidateRef.current?.(current.cell.row.original, current.cell.column.id, valueToCommit) ?? null;
99
- if (error !== null) {
100
- setEditing({ ...current, draftValue: valueToCommit, error });
101
- return;
102
- }
103
- onCellEditRef.current?.(current.cell.row.original, current.cell.column.id, valueToCommit);
104
- setEditing(null);
105
- }, []);
106
-
107
- const cancel = useCallback(() => {
108
- setEditing(null);
109
- }, []);
110
-
111
- return { editing, beginEdit, setDraft, commit, cancel };
112
- };