@drivenets/design-system 0.0.1

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 (242) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/LICENSE +201 -0
  3. package/dist/index.cjs +5394 -0
  4. package/dist/index.css +1 -0
  5. package/dist/index.d.cts +9157 -0
  6. package/dist/index.d.cts.map +1 -0
  7. package/dist/index.d.ts +9157 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +5335 -0
  10. package/dist/index.js.map +1 -0
  11. package/package.json +104 -0
  12. package/src/components/ds-alert-banner/ds-alert-banner.module.scss +116 -0
  13. package/src/components/ds-alert-banner/ds-alert-banner.tsx +115 -0
  14. package/src/components/ds-alert-banner/ds-alert-banner.types.tsx +47 -0
  15. package/src/components/ds-alert-banner/index.tsx +2 -0
  16. package/src/components/ds-breadcrumb/ds-breadcrumb.module.scss +99 -0
  17. package/src/components/ds-breadcrumb/ds-breadcrumb.tsx +94 -0
  18. package/src/components/ds-breadcrumb/ds-breadcrumb.types.tsx +32 -0
  19. package/src/components/ds-breadcrumb/index.tsx +2 -0
  20. package/src/components/ds-button/ds-button.tsx +12 -0
  21. package/src/components/ds-button/ds-button.types.ts +6 -0
  22. package/src/components/ds-button/index.ts +2 -0
  23. package/src/components/ds-button/versions/ds-button-legacy/ds-button-legacy.module.scss +257 -0
  24. package/src/components/ds-button/versions/ds-button-legacy/ds-button-legacy.tsx +34 -0
  25. package/src/components/ds-button/versions/ds-button-legacy/ds-button-legacy.types.ts +41 -0
  26. package/src/components/ds-button/versions/ds-button-legacy/index.ts +2 -0
  27. package/src/components/ds-button/versions/ds-button-new/ds-button-new.module.scss +580 -0
  28. package/src/components/ds-button/versions/ds-button-new/ds-button-new.tsx +49 -0
  29. package/src/components/ds-button/versions/ds-button-new/ds-button-new.types.ts +41 -0
  30. package/src/components/ds-button/versions/ds-button-new/index.ts +2 -0
  31. package/src/components/ds-checkbox/ds-checkbox.module.scss +130 -0
  32. package/src/components/ds-checkbox/ds-checkbox.tsx +55 -0
  33. package/src/components/ds-checkbox/ds-checkbox.types.tsx +27 -0
  34. package/src/components/ds-checkbox/index.tsx +2 -0
  35. package/src/components/ds-chip/ds-chip.module.scss +71 -0
  36. package/src/components/ds-chip/ds-chip.tsx +73 -0
  37. package/src/components/ds-chip/ds-chip.types.tsx +46 -0
  38. package/src/components/ds-chip/index.tsx +2 -0
  39. package/src/components/ds-chip-group/ds-chip-group.module.scss +59 -0
  40. package/src/components/ds-chip-group/ds-chip-group.tsx +122 -0
  41. package/src/components/ds-chip-group/ds-chip-group.types.ts +52 -0
  42. package/src/components/ds-chip-group/hooks/use-chip-row-calculation.ts +76 -0
  43. package/src/components/ds-chip-group/index.ts +2 -0
  44. package/src/components/ds-confirmation/ds-confirmation.module.scss +58 -0
  45. package/src/components/ds-confirmation/ds-confirmation.tsx +121 -0
  46. package/src/components/ds-confirmation/ds-confirmation.types.tsx +28 -0
  47. package/src/components/ds-confirmation/index.ts +2 -0
  48. package/src/components/ds-dialog/ds-dialog.module.scss +50 -0
  49. package/src/components/ds-dialog/ds-dialog.tsx +70 -0
  50. package/src/components/ds-dialog/ds-dialog.types.tsx +48 -0
  51. package/src/components/ds-dialog/index.tsx +2 -0
  52. package/src/components/ds-drawer/ds-drawer.module.scss +212 -0
  53. package/src/components/ds-drawer/ds-drawer.tsx +160 -0
  54. package/src/components/ds-drawer/ds-drawer.types.tsx +54 -0
  55. package/src/components/ds-drawer/index.ts +2 -0
  56. package/src/components/ds-dropdown-menu/ds-dropdown-menu.module.scss +123 -0
  57. package/src/components/ds-dropdown-menu/ds-dropdown-menu.tsx +396 -0
  58. package/src/components/ds-dropdown-menu/ds-dropdown-menu.types.tsx +262 -0
  59. package/src/components/ds-dropdown-menu/index.tsx +2 -0
  60. package/src/components/ds-expandable-text-input/ds-expandable-text-input.module.scss +70 -0
  61. package/src/components/ds-expandable-text-input/ds-expandable-text-input.tsx +106 -0
  62. package/src/components/ds-expandable-text-input/ds-expandable-text-input.types.tsx +19 -0
  63. package/src/components/ds-expandable-text-input/index.ts +2 -0
  64. package/src/components/ds-file-upload/components/file-upload/file-upload.module.scss +90 -0
  65. package/src/components/ds-file-upload/components/file-upload/file-upload.tsx +106 -0
  66. package/src/components/ds-file-upload/components/file-upload/file-upload.types.tsx +94 -0
  67. package/src/components/ds-file-upload/components/file-upload/index.ts +2 -0
  68. package/src/components/ds-file-upload/components/file-upload-item/file-upload-item.module.scss +125 -0
  69. package/src/components/ds-file-upload/components/file-upload-item/file-upload-item.tsx +143 -0
  70. package/src/components/ds-file-upload/components/file-upload-item/file-upload-item.types.tsx +26 -0
  71. package/src/components/ds-file-upload/components/file-upload-item/index.ts +2 -0
  72. package/src/components/ds-file-upload/ds-file-upload-api.types.ts +38 -0
  73. package/src/components/ds-file-upload/ds-file-upload.tsx +46 -0
  74. package/src/components/ds-file-upload/ds-file-upload.types.tsx +54 -0
  75. package/src/components/ds-file-upload/errors/file-upload-errors.ts +27 -0
  76. package/src/components/ds-file-upload/hooks/index.ts +2 -0
  77. package/src/components/ds-file-upload/hooks/use-file-upload.ts +350 -0
  78. package/src/components/ds-file-upload/index.ts +7 -0
  79. package/src/components/ds-file-upload/types/accept-types.ts +106 -0
  80. package/src/components/ds-file-upload/utils/accept-utils.ts +25 -0
  81. package/src/components/ds-file-upload/utils/constants.ts +21 -0
  82. package/src/components/ds-file-upload/utils/file-factory.ts +18 -0
  83. package/src/components/ds-file-upload/utils/format-file-size.ts +15 -0
  84. package/src/components/ds-file-upload/utils/generate-helper-text.ts +39 -0
  85. package/src/components/ds-file-upload/utils/get-error-message.ts +17 -0
  86. package/src/components/ds-file-upload/utils/is-file-equal.ts +8 -0
  87. package/src/components/ds-form-control/ds-form-control.module.scss +135 -0
  88. package/src/components/ds-form-control/ds-form-control.tsx +94 -0
  89. package/src/components/ds-form-control/ds-form-control.types.tsx +58 -0
  90. package/src/components/ds-form-control/index.tsx +2 -0
  91. package/src/components/ds-grid/ds-grid.module.scss +0 -0
  92. package/src/components/ds-grid/ds-grid.tsx +43 -0
  93. package/src/components/ds-grid/ds-grid.types.ts +55 -0
  94. package/src/components/ds-grid/index.ts +2 -0
  95. package/src/components/ds-icon/ds-icon.module.scss +25 -0
  96. package/src/components/ds-icon/ds-icon.tsx +33 -0
  97. package/src/components/ds-icon/ds-icon.types.ts +53 -0
  98. package/src/components/ds-icon/index.ts +2 -0
  99. package/src/components/ds-icon/material-icons.ts +6203 -0
  100. package/src/components/ds-modal/ds-modal.module.scss +100 -0
  101. package/src/components/ds-modal/ds-modal.tsx +136 -0
  102. package/src/components/ds-modal/ds-modal.types.tsx +44 -0
  103. package/src/components/ds-modal/index.tsx +2 -0
  104. package/src/components/ds-number-input/ds-number-input.module.scss +15 -0
  105. package/src/components/ds-number-input/ds-number-input.tsx +74 -0
  106. package/src/components/ds-number-input/ds-number-input.types.tsx +76 -0
  107. package/src/components/ds-number-input/index.tsx +2 -0
  108. package/src/components/ds-panel/ds-panel.module.scss +95 -0
  109. package/src/components/ds-panel/ds-panel.tsx +46 -0
  110. package/src/components/ds-panel/ds-panel.types.ts +17 -0
  111. package/src/components/ds-panel/index.tsx +2 -0
  112. package/src/components/ds-password-input/ds-password-input.module.scss +10 -0
  113. package/src/components/ds-password-input/ds-password-input.tsx +67 -0
  114. package/src/components/ds-password-input/ds-password-input.types.tsx +62 -0
  115. package/src/components/ds-password-input/index.tsx +2 -0
  116. package/src/components/ds-popover/ds-popover.module.scss +23 -0
  117. package/src/components/ds-popover/ds-popover.tsx +33 -0
  118. package/src/components/ds-popover/ds-popover.types.tsx +24 -0
  119. package/src/components/ds-popover/index.tsx +2 -0
  120. package/src/components/ds-radio-group/ds-radio-group.module.scss +138 -0
  121. package/src/components/ds-radio-group/ds-radio-group.tsx +115 -0
  122. package/src/components/ds-radio-group/ds-radio-group.types.tsx +93 -0
  123. package/src/components/ds-radio-group/index.tsx +2 -0
  124. package/src/components/ds-select/ds-select.module.scss +66 -0
  125. package/src/components/ds-select/ds-select.tsx +239 -0
  126. package/src/components/ds-select/ds-select.types.tsx +80 -0
  127. package/src/components/ds-select/index.tsx +2 -0
  128. package/src/components/ds-select/select-items-chips.tsx +56 -0
  129. package/src/components/ds-smart-tabs/ds-smart-tabs.module.scss +69 -0
  130. package/src/components/ds-smart-tabs/ds-smart-tabs.tsx +113 -0
  131. package/src/components/ds-smart-tabs/ds-smart-tabs.types.tsx +74 -0
  132. package/src/components/ds-smart-tabs/index.tsx +2 -0
  133. package/src/components/ds-spinner/ds-spinner.module.scss +39 -0
  134. package/src/components/ds-spinner/ds-spinner.tsx +51 -0
  135. package/src/components/ds-spinner/ds-spinner.types.tsx +20 -0
  136. package/src/components/ds-spinner/index.tsx +2 -0
  137. package/src/components/ds-status-badge/ds-status-badge.module.scss +79 -0
  138. package/src/components/ds-status-badge/ds-status-badge.tsx +42 -0
  139. package/src/components/ds-status-badge/ds-status-badge.types.tsx +46 -0
  140. package/src/components/ds-status-badge/index.tsx +2 -0
  141. package/src/components/ds-stepper/components/ds-step-content.tsx +32 -0
  142. package/src/components/ds-stepper/components/ds-step-description.tsx +6 -0
  143. package/src/components/ds-stepper/components/ds-step-label.tsx +6 -0
  144. package/src/components/ds-stepper/components/ds-step-next-button.tsx +13 -0
  145. package/src/components/ds-stepper/components/ds-step.tsx +59 -0
  146. package/src/components/ds-stepper/ds-stepper.module.scss +134 -0
  147. package/src/components/ds-stepper/ds-stepper.tsx +34 -0
  148. package/src/components/ds-stepper/ds-stepper.types.ts +12 -0
  149. package/src/components/ds-stepper/hooks/use-stepper.ts +20 -0
  150. package/src/components/ds-stepper/hooks/use-steps.ts +18 -0
  151. package/src/components/ds-stepper/index.tsx +6 -0
  152. package/src/components/ds-system-status/ds-system-status.module.scss +87 -0
  153. package/src/components/ds-system-status/ds-system-status.tsx +33 -0
  154. package/src/components/ds-system-status/ds-system-status.types.tsx +37 -0
  155. package/src/components/ds-system-status/index.tsx +10 -0
  156. package/src/components/ds-table/components/core-table/core-table.module.scss +32 -0
  157. package/src/components/ds-table/components/core-table/core-table.tsx +83 -0
  158. package/src/components/ds-table/components/core-table/index.ts +1 -0
  159. package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.module.scss +115 -0
  160. package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.tsx +70 -0
  161. package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.types.ts +41 -0
  162. package/src/components/ds-table/components/ds-table-bulk-actions/index.ts +2 -0
  163. package/src/components/ds-table/components/ds-table-cell/ds-table-cell.module.scss +53 -0
  164. package/src/components/ds-table/components/ds-table-cell/ds-table-cell.tsx +95 -0
  165. package/src/components/ds-table/components/ds-table-cell/ds-table-cell.types.ts +67 -0
  166. package/src/components/ds-table/components/ds-table-cell/index.ts +2 -0
  167. package/src/components/ds-table/components/ds-table-header/ds-table-header.module.scss +81 -0
  168. package/src/components/ds-table/components/ds-table-header/ds-table-header.tsx +99 -0
  169. package/src/components/ds-table/components/ds-table-header/ds-table-header.types.ts +11 -0
  170. package/src/components/ds-table/components/ds-table-header/index.ts +2 -0
  171. package/src/components/ds-table/components/ds-table-row/ds-table-row.module.scss +137 -0
  172. package/src/components/ds-table/components/ds-table-row/ds-table-row.tsx +205 -0
  173. package/src/components/ds-table/components/ds-table-row/ds-table-row.types.ts +22 -0
  174. package/src/components/ds-table/components/ds-table-row/index.ts +2 -0
  175. package/src/components/ds-table/context/ds-table-context.tsx +39 -0
  176. package/src/components/ds-table/ds-table.module.scss +60 -0
  177. package/src/components/ds-table/ds-table.tsx +312 -0
  178. package/src/components/ds-table/ds-table.types.ts +377 -0
  179. package/src/components/ds-table/filters/adapters/create-checkbox-filter-adapter.tsx +116 -0
  180. package/src/components/ds-table/filters/adapters/create-dual-range-filter-adapter.tsx +171 -0
  181. package/src/components/ds-table/filters/adapters/create-filter-adapter.ts +131 -0
  182. package/src/components/ds-table/filters/adapters/index.ts +12 -0
  183. package/src/components/ds-table/filters/components/checkbox-filter/checkbox-filter.tsx +43 -0
  184. package/src/components/ds-table/filters/components/checkbox-filter/index.ts +2 -0
  185. package/src/components/ds-table/filters/components/range-filter/index.ts +2 -0
  186. package/src/components/ds-table/filters/components/range-filter/range-filter.module.scss +25 -0
  187. package/src/components/ds-table/filters/components/range-filter/range-filter.tsx +79 -0
  188. package/src/components/ds-table/filters/hooks/index.ts +1 -0
  189. package/src/components/ds-table/filters/hooks/use-table-filters.ts +234 -0
  190. package/src/components/ds-table/filters/index.ts +50 -0
  191. package/src/components/ds-table/filters/types/filter-adapter.types.ts +111 -0
  192. package/src/components/ds-table/hooks/use-drag-and-drop.tsx +107 -0
  193. package/src/components/ds-table/index.ts +4 -0
  194. package/src/components/ds-table/styles/_variables.scss +17 -0
  195. package/src/components/ds-table/styles/shared/ds-table-shared.module.scss +16 -0
  196. package/src/components/ds-table/utils/column-styling.ts +30 -0
  197. package/src/components/ds-table/utils/create-columns-grid-template.ts +23 -0
  198. package/src/components/ds-table/utils/merge-refs.ts +15 -0
  199. package/src/components/ds-table/utils/story-data-generator.ts +91 -0
  200. package/src/components/ds-text-input/ds-text-input.module.scss +27 -0
  201. package/src/components/ds-text-input/ds-text-input.tsx +75 -0
  202. package/src/components/ds-text-input/ds-text-input.types.tsx +110 -0
  203. package/src/components/ds-text-input/index.ts +2 -0
  204. package/src/components/ds-textarea/ds-textarea.module.scss +5 -0
  205. package/src/components/ds-textarea/ds-textarea.tsx +49 -0
  206. package/src/components/ds-textarea/ds-textarea.types.tsx +67 -0
  207. package/src/components/ds-textarea/index.tsx +2 -0
  208. package/src/components/ds-toast/ds-toast-context.tsx +79 -0
  209. package/src/components/ds-toast/ds-toast.module.scss +134 -0
  210. package/src/components/ds-toast/ds-toast.tsx +54 -0
  211. package/src/components/ds-toast/ds-toast.types.tsx +53 -0
  212. package/src/components/ds-toast/index.ts +3 -0
  213. package/src/components/ds-tooltip/ds-tooltip.module.scss +19 -0
  214. package/src/components/ds-tooltip/ds-tooltip.tsx +33 -0
  215. package/src/components/ds-tooltip/ds-tooltip.types.tsx +12 -0
  216. package/src/components/ds-tooltip/index.tsx +2 -0
  217. package/src/components/ds-typography/ds-typography.config.ts +32 -0
  218. package/src/components/ds-typography/ds-typography.module.scss +93 -0
  219. package/src/components/ds-typography/ds-typography.tsx +27 -0
  220. package/src/components/ds-typography/ds-typography.types.tsx +27 -0
  221. package/src/components/ds-typography/index.tsx +2 -0
  222. package/src/components/ds-vertical-tabs/ds-vertical-tabs.module.scss +60 -0
  223. package/src/components/ds-vertical-tabs/ds-vertical-tabs.tsx +80 -0
  224. package/src/components/ds-vertical-tabs/ds-vertical-tabs.types.ts +69 -0
  225. package/src/components/ds-vertical-tabs/index.ts +7 -0
  226. package/src/index.ts +34 -0
  227. package/src/styles/_colors.scss +65 -0
  228. package/src/styles/_grid.scss +111 -0
  229. package/src/styles/_mixin.scss +1 -0
  230. package/src/styles/_reset.scss +38 -0
  231. package/src/styles/_root.scss +390 -0
  232. package/src/styles/_scrollbars.scss +41 -0
  233. package/src/styles/_spacing.scss +47 -0
  234. package/src/styles/_typography.scss +301 -0
  235. package/src/styles/_utilities.scss +33 -0
  236. package/src/styles/_variables.scss +44 -0
  237. package/src/styles/mixins/_bounding-box.scss +53 -0
  238. package/src/styles/mixins/_list.scss +74 -0
  239. package/src/styles/shared/_dropdown.scss +89 -0
  240. package/src/styles/shared/_input.scss +365 -0
  241. package/src/styles/shared/_modal.scss +123 -0
  242. package/src/styles/styles.scss +12 -0
@@ -0,0 +1,33 @@
1
+ import { type FC, isValidElement } from 'react';
2
+ import * as Tooltip from '@radix-ui/react-tooltip';
3
+ import classNames from 'classnames';
4
+ import styles from './ds-tooltip.module.scss';
5
+ import type { DsTooltipProps } from './ds-tooltip.types';
6
+ import { DsTypography } from '../ds-typography';
7
+
8
+ const DsTooltip: FC<DsTooltipProps> = ({ content, children }) => {
9
+ if (content === undefined) {
10
+ return children;
11
+ }
12
+ return (
13
+ <Tooltip.Provider delayDuration={200}>
14
+ <Tooltip.Root>
15
+ <Tooltip.Trigger asChild>{children}</Tooltip.Trigger>
16
+ <Tooltip.Portal>
17
+ <Tooltip.Content className={classNames(styles.tooltip)} side="top" align="center" sideOffset={4}>
18
+ {isValidElement(content) ? (
19
+ content
20
+ ) : (
21
+ <DsTypography variant="body-xs-reg" className={styles.content}>
22
+ {content}
23
+ </DsTypography>
24
+ )}
25
+ <Tooltip.Arrow className={styles.arrow} />
26
+ </Tooltip.Content>
27
+ </Tooltip.Portal>
28
+ </Tooltip.Root>
29
+ </Tooltip.Provider>
30
+ );
31
+ };
32
+
33
+ export default DsTooltip;
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ export interface DsTooltipProps {
4
+ /**
5
+ * Tooltip content
6
+ */
7
+ content?: string | ReactNode;
8
+ /**
9
+ * The content to be rendered inside the tooltip
10
+ */
11
+ children: ReactNode;
12
+ }
@@ -0,0 +1,2 @@
1
+ export { default as DsTooltip } from './ds-tooltip';
2
+ export * from './ds-tooltip.types';
@@ -0,0 +1,32 @@
1
+ export const semanticElementMap = {
2
+ // Body variants
3
+ 'body-md-reg': 'p',
4
+ 'body-md-md': 'p',
5
+ 'body-md-semi-bold': 'p',
6
+ 'body-md-bold': 'p',
7
+ 'body-md-link': 'a',
8
+
9
+ 'body-sm-reg': 'span',
10
+ 'body-sm-md': 'span',
11
+ 'body-sm-semi-bold': 'span',
12
+ 'body-sm-bold': 'span',
13
+ 'body-sm-link': 'a',
14
+
15
+ 'body-xs-reg': 'span',
16
+ 'body-xs-md': 'span',
17
+ 'body-xs-semi-bold': 'span',
18
+ 'body-xs-bold': 'span',
19
+ 'body-xs-link': 'a',
20
+
21
+ // Code variants
22
+ 'code-sm-reg': 'code',
23
+ 'code-sm-semi-bold': 'code',
24
+ 'code-xs-reg': 'code',
25
+ 'code-xs-semi-bold': 'code',
26
+
27
+ // Heading variants
28
+ heading1: 'h1',
29
+ heading2: 'h2',
30
+ heading3: 'h3',
31
+ heading4: 'h4',
32
+ } as const;
@@ -0,0 +1,93 @@
1
+ @use '../../styles/typography';
2
+
3
+ .heading1 {
4
+ @include typography.heading1;
5
+ }
6
+
7
+ .heading2 {
8
+ @include typography.heading2;
9
+ }
10
+
11
+ .heading3 {
12
+ @include typography.heading3;
13
+ }
14
+
15
+ .heading4 {
16
+ @include typography.heading4;
17
+ }
18
+
19
+ .body-md-reg {
20
+ @include typography.body-md-reg;
21
+ }
22
+
23
+ .body-md-md {
24
+ @include typography.body-md-md;
25
+ }
26
+
27
+ .body-md-semi-bold {
28
+ @include typography.body-md-semi-bold;
29
+ }
30
+
31
+ .body-md-bold {
32
+ @include typography.body-md-bold;
33
+ }
34
+
35
+ .body-md-link {
36
+ @include typography.body-md-link;
37
+ }
38
+
39
+ .body-sm-reg {
40
+ @include typography.body-sm-reg;
41
+ }
42
+
43
+ .body-sm-md {
44
+ @include typography.body-sm-md;
45
+ }
46
+
47
+ .body-sm-semi-bold {
48
+ @include typography.body-sm-semi-bold;
49
+ }
50
+
51
+ .body-sm-bold {
52
+ @include typography.body-sm-bold;
53
+ }
54
+
55
+ .body-sm-link {
56
+ @include typography.body-sm-link;
57
+ }
58
+
59
+ .body-xs-reg {
60
+ @include typography.body-xs-reg;
61
+ }
62
+
63
+ .body-xs-md {
64
+ @include typography.body-xs-md;
65
+ }
66
+
67
+ .body-xs-semi-bold {
68
+ @include typography.body-xs-semi-bold;
69
+ }
70
+
71
+ .body-xs-bold {
72
+ @include typography.body-xs-bold;
73
+ }
74
+
75
+ .body-xs-link {
76
+ @include typography.body-xs-link;
77
+ }
78
+
79
+ .code-sm-reg {
80
+ @include typography.code-sm-reg;
81
+ }
82
+
83
+ .code-sm-semi-bold {
84
+ @include typography.code-sm-semi-bold;
85
+ }
86
+
87
+ .code-xs-reg {
88
+ @include typography.code-xs-reg;
89
+ }
90
+
91
+ .code-xs-semi-bold {
92
+ @include typography.code-xs-semi-bold;
93
+ }
@@ -0,0 +1,27 @@
1
+ import type React from 'react';
2
+ import { Slot } from '@radix-ui/react-slot';
3
+ import classNames from 'classnames';
4
+ import type { DsTypographyProps } from './ds-typography.types';
5
+ import { semanticElementMap } from './ds-typography.config';
6
+ import styles from './ds-typography.module.scss';
7
+
8
+ /*
9
+ * Design system Typography component that provides consistent text styling
10
+ */
11
+ const DsTypography: React.FC<DsTypographyProps & { ref?: React.Ref<HTMLElement> }> = ({
12
+ ref,
13
+ variant,
14
+ asChild = false,
15
+ className,
16
+ children,
17
+ ...props
18
+ }) => {
19
+ const Component: React.ElementType = asChild ? Slot : semanticElementMap[variant];
20
+ return (
21
+ <Component ref={ref} className={classNames(styles[variant], className)} {...props}>
22
+ {children}
23
+ </Component>
24
+ );
25
+ };
26
+
27
+ export default DsTypography;
@@ -0,0 +1,27 @@
1
+ import type React from 'react';
2
+ import type { semanticElementMap } from './ds-typography.config';
3
+
4
+ export type SemanticVariant = keyof typeof semanticElementMap;
5
+
6
+ export interface DsTypographyProps {
7
+ /**
8
+ * The semantic variant of the component
9
+ */
10
+ variant: SemanticVariant;
11
+ /**
12
+ * Additional CSS class names
13
+ */
14
+ className?: string;
15
+ /**
16
+ * Additional styles to apply to the typography component
17
+ */
18
+ style?: React.CSSProperties;
19
+ /**
20
+ * When true, renders as Slot component for composition without extra DOM nodes
21
+ */
22
+ asChild?: boolean;
23
+ /**
24
+ * The content of the component
25
+ */
26
+ children: React.ReactNode;
27
+ }
@@ -0,0 +1,2 @@
1
+ export { default as DsTypography } from './ds-typography';
2
+ export * from './ds-typography.types';
@@ -0,0 +1,60 @@
1
+ @use '../../styles/typography';
2
+
3
+ .tabList {
4
+ display: flex;
5
+ flex-direction: column;
6
+ width: 100%;
7
+ overflow-y: auto;
8
+
9
+ scrollbar-width: none;
10
+ -ms-overflow-style: none;
11
+
12
+ &::-webkit-scrollbar {
13
+ width: 0;
14
+ display: none;
15
+ }
16
+ }
17
+
18
+ .tabItem {
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: space-between;
22
+ padding: 0 var(--spacing-lg);
23
+ min-height: var(--spacing-3xl);
24
+ height: var(--spacing-3xl);
25
+ flex-shrink: 0;
26
+ border: none;
27
+ border-bottom: 1px solid var(--color-border);
28
+ background: var(--color-background-secondary);
29
+ cursor: pointer;
30
+ text-align: left;
31
+ color: var(--color-font-secondary);
32
+ transition:
33
+ background-color 0.2s,
34
+ color 0.2s;
35
+ gap: var(--spacing-xs);
36
+
37
+ &:hover:not(:disabled):not(.selected):not([data-disabled]) {
38
+ background: var(--color-background-action-tertiary);
39
+ color: var(--color-font-main);
40
+ }
41
+
42
+ &.selected,
43
+ &[data-state='active'] {
44
+ background: var(--color-background-action-secondary-hover);
45
+ color: var(--color-font-main);
46
+ }
47
+
48
+ &:disabled,
49
+ &[data-disabled] {
50
+ cursor: not-allowed;
51
+ color: var(--color-font-secondary);
52
+ opacity: 0.5;
53
+ }
54
+
55
+ &:focus-visible {
56
+ outline: 2px solid var(--color-background-selected);
57
+ outline-offset: -2px;
58
+ z-index: 1;
59
+ }
60
+ }
@@ -0,0 +1,80 @@
1
+ import classNames from 'classnames';
2
+ import { Tabs } from '@ark-ui/react/tabs';
3
+ import type {
4
+ DsVerticalTabsContentProps,
5
+ DsVerticalTabsListProps,
6
+ DsVerticalTabsRootProps,
7
+ DsVerticalTabsTabProps,
8
+ } from './ds-vertical-tabs.types';
9
+ import styles from './ds-vertical-tabs.module.scss';
10
+
11
+ /**
12
+ * Design system vertical tabs component - compound component for flexible vertical navigation
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * <DsVerticalTabs value={selected} onValueChange={handleChange}>
17
+ * <DsVerticalTabs.List>
18
+ * <DsVerticalTabs.Tab value="status">
19
+ * <span>Status</span>
20
+ * <span className={styles.badge}>5</span>
21
+ * </DsVerticalTabs.Tab>
22
+ * <DsVerticalTabs.Tab value="date">Date</DsVerticalTabs.Tab>
23
+ * </DsVerticalTabs.List>
24
+ * <DsVerticalTabs.Content value="status">Status filters...</DsVerticalTabs.Content>
25
+ * <DsVerticalTabs.Content value="date">Date filters...</DsVerticalTabs.Content>
26
+ * </DsVerticalTabs>
27
+ * ```
28
+ */
29
+ const DsVerticalTabs = ({ value, onValueChange, className, style, children }: DsVerticalTabsRootProps) => {
30
+ const handleValueChange = (details: { value: string | null }) => {
31
+ onValueChange?.(details.value);
32
+ };
33
+
34
+ return (
35
+ <Tabs.Root
36
+ orientation="vertical"
37
+ value={value}
38
+ onValueChange={handleValueChange}
39
+ className={className}
40
+ style={style}
41
+ >
42
+ {children}
43
+ </Tabs.Root>
44
+ );
45
+ };
46
+
47
+ /**
48
+ * Container for tab triggers
49
+ */
50
+ const DsVerticalTabsList = ({ className, children }: DsVerticalTabsListProps) => {
51
+ return <Tabs.List className={classNames(styles.tabList, className)}>{children}</Tabs.List>;
52
+ };
53
+
54
+ /**
55
+ * Individual tab trigger - fully customizable content
56
+ */
57
+ const DsVerticalTabsTab = ({ value, disabled, className, children }: DsVerticalTabsTabProps) => {
58
+ return (
59
+ <Tabs.Trigger value={value} disabled={disabled} className={classNames(styles.tabItem, className)}>
60
+ {children}
61
+ </Tabs.Trigger>
62
+ );
63
+ };
64
+
65
+ /**
66
+ * Tab content panel - displays when corresponding tab is active
67
+ */
68
+ const DsVerticalTabsContent = ({ value, className, children }: DsVerticalTabsContentProps) => {
69
+ return (
70
+ <Tabs.Content value={value} className={className}>
71
+ {children}
72
+ </Tabs.Content>
73
+ );
74
+ };
75
+
76
+ DsVerticalTabs.List = DsVerticalTabsList;
77
+ DsVerticalTabs.Tab = DsVerticalTabsTab;
78
+ DsVerticalTabs.Content = DsVerticalTabsContent;
79
+
80
+ export default DsVerticalTabs;
@@ -0,0 +1,69 @@
1
+ import type { CSSProperties, ReactNode } from 'react';
2
+
3
+ export interface DsVerticalTabsRootProps {
4
+ /**
5
+ * Currently selected tab value
6
+ */
7
+ value?: string;
8
+ /**
9
+ * Callback when selected tab changes
10
+ */
11
+ onValueChange?: (value: string | null) => void;
12
+ /**
13
+ * Additional CSS class names
14
+ */
15
+ className?: string;
16
+ /**
17
+ * Optional inline styles
18
+ */
19
+ style?: CSSProperties;
20
+ /**
21
+ * Child components (DsVerticalTabs.List, etc.)
22
+ */
23
+ children: ReactNode;
24
+ }
25
+
26
+ export interface DsVerticalTabsListProps {
27
+ /**
28
+ * Additional CSS class names
29
+ */
30
+ className?: string;
31
+ /**
32
+ * Tab trigger components
33
+ */
34
+ children: ReactNode;
35
+ }
36
+
37
+ export interface DsVerticalTabsTabProps {
38
+ /**
39
+ * Value that identifies this tab
40
+ */
41
+ value: string;
42
+ /**
43
+ * Whether the tab is disabled
44
+ */
45
+ disabled?: boolean;
46
+ /**
47
+ * Additional CSS class names
48
+ */
49
+ className?: string;
50
+ /**
51
+ * Tab content (label, icons, badges, etc.)
52
+ */
53
+ children: ReactNode;
54
+ }
55
+
56
+ export interface DsVerticalTabsContentProps {
57
+ /**
58
+ * Value that identifies which tab this content belongs to
59
+ */
60
+ value: string;
61
+ /**
62
+ * Additional CSS class names
63
+ */
64
+ className?: string;
65
+ /**
66
+ * Content to display when tab is active
67
+ */
68
+ children: ReactNode;
69
+ }
@@ -0,0 +1,7 @@
1
+ export { default as DsVerticalTabs } from './ds-vertical-tabs';
2
+ export type {
3
+ DsVerticalTabsRootProps,
4
+ DsVerticalTabsListProps,
5
+ DsVerticalTabsTabProps,
6
+ DsVerticalTabsContentProps,
7
+ } from './ds-vertical-tabs.types';
package/src/index.ts ADDED
@@ -0,0 +1,34 @@
1
+ export * from './components/ds-alert-banner';
2
+ export * from './components/ds-breadcrumb';
3
+ export * from './components/ds-button';
4
+ export * from './components/ds-checkbox';
5
+ export * from './components/ds-chip';
6
+ export * from './components/ds-chip-group';
7
+ export * from './components/ds-confirmation';
8
+ export * from './components/ds-dialog';
9
+ export * from './components/ds-drawer';
10
+ export * from './components/ds-dropdown-menu';
11
+ export * from './components/ds-expandable-text-input';
12
+ export * from './components/ds-file-upload';
13
+ export * from './components/ds-form-control';
14
+ export * from './components/ds-grid';
15
+ export * from './components/ds-icon';
16
+ export * from './components/ds-modal';
17
+ export * from './components/ds-number-input';
18
+ export * from './components/ds-panel';
19
+ export * from './components/ds-password-input';
20
+ export * from './components/ds-popover';
21
+ export * from './components/ds-radio-group';
22
+ export * from './components/ds-select';
23
+ export * from './components/ds-smart-tabs';
24
+ export * from './components/ds-spinner';
25
+ export * from './components/ds-status-badge';
26
+ export * from './components/ds-stepper';
27
+ export * from './components/ds-system-status';
28
+ export * from './components/ds-table';
29
+ export * from './components/ds-text-input';
30
+ export * from './components/ds-textarea';
31
+ export * from './components/ds-toast';
32
+ export * from './components/ds-tooltip';
33
+ export * from './components/ds-typography';
34
+ export * from './components/ds-vertical-tabs';
@@ -0,0 +1,65 @@
1
+ // all colors are defined in https://www.figma.com/design/5BjP3KnzlfAxTbdx1srK48/%F0%9F%A6%BE-DAP-Design-System?node-id=4804-92173&p=f&m=dev
2
+ $colors: (
3
+ // Primary
4
+ deep-blue: #001a47,
5
+ white: #ffffff,
6
+ black: #000000,
7
+ // Gradient (Specials)
8
+ gradient-violet-background: linear-gradient(90deg, #001b48 -0.12%, #312e81 99.86%),
9
+ gradient-violet-transparent: linear-gradient(180deg, rgba(30, 89, 215, 0.4) 0%, rgba(0, 27, 72, 0.16) 100%),
10
+ gradient-blue-light: linear-gradient(116deg, #e9eefc 22.81%, #d6e2ff 99.14%),
11
+ // Neutral
12
+ neutral-1: #2c3a4b,
13
+ neutral-2: #4c5f76,
14
+ neutral-3: #6c7b8e,
15
+ neutral-4: #8b98a6,
16
+ neutral-5: #a0aab7,
17
+ neutral-6: #b3bfd1,
18
+ neutral-7: #c2cedf,
19
+ neutral-8: #dee6f1,
20
+ neutral-9: #eaecef,
21
+ neutral-10: #f3f5fa,
22
+ neutral-bg: #dae2f4,
23
+ // Action
24
+ action-cta1: #0064fa,
25
+ action-cta2: #579aff,
26
+ action-cta3: #6b7b8e,
27
+ action-active-light: #c7d8ff,
28
+ action-hover-light: #e0eaff,
29
+ action-disabled: #b0b4bf,
30
+ // System Status
31
+ system-status-ok: #067a00,
32
+ system-status-info: #005dcf,
33
+ system-status-error: #d70a00,
34
+ system-status-alert: #d04d07,
35
+ system-status-in-progress: #1513da,
36
+ system-status-pending: #8836d6,
37
+ // Utility
38
+ utility-ok: #d6f5cf,
39
+ utility-info: #c4dcff,
40
+ utility-error: #ffd8d6,
41
+ utility-alert: #ffeac0,
42
+ utility-in-progress: #d9d9ff,
43
+ utility-pending: #ede2ff,
44
+ utility-disabled: #e3e3e3,
45
+ // Map / Scheme
46
+ map-and-scheme-line-layer-0: #5452f6,
47
+ map-and-scheme-line-layer-01: #cc4c5f,
48
+ map-and-scheme-line-layer-02: #00894d,
49
+ map-and-scheme-line-layer-1-optical: #3b8edb,
50
+ map-and-scheme-line-layer-2-ethernet: #00b8d9,
51
+ map-and-scheme-line-layer-3-routing: #9a55e0,
52
+ map-and-scheme-service-overlay: #c30ede,
53
+ map-and-scheme-pops-core-zones: #a92a00,
54
+ map-and-scheme-line-optional-1: #da7b2d
55
+ );
56
+
57
+ @mixin applyRootColors($colors) {
58
+ :root {
59
+ @each $name, $color in $colors {
60
+ #{'--' + $name}: #{$color};
61
+ }
62
+ }
63
+ }
64
+
65
+ @include applyRootColors($colors);
@@ -0,0 +1,111 @@
1
+ @use 'sass:map';
2
+ @use 'sass:math';
3
+
4
+ // max columns
5
+ $columns: 12;
6
+ // max rows
7
+ $rows: 8;
8
+
9
+ $gutter: 16px;
10
+ $margin-y: 16px;
11
+ $margin-x: 20px;
12
+
13
+ $grid-hd: (
14
+ gutter: $gutter,
15
+ margin: $margin-y $margin-x,
16
+ );
17
+
18
+ :root {
19
+ --grid-gutter: #{$gutter};
20
+ --grid-margin: #{$margin-x};
21
+ --grid-columns: #{$columns};
22
+
23
+ // Computed width of a single grid column: (viewport_width - margins - gutters) / number_of_columns
24
+ --grid-column-size: calc(
25
+ ((100vw - 2 * var(--grid-margin)) - ((var(--grid-columns) - 1) * var(--grid-gutter))) /
26
+ var(--grid-columns)
27
+ );
28
+
29
+ // Generate custom properties for each column span (1 through 12)
30
+ // Each --col-span-N represents the total width for spanning N columns
31
+ @for $i from 1 through $columns {
32
+ // Margins are added to all column spans to ensure proper alignment
33
+ // The last column span (full width) receives 2 margins (left + right), others receive 1 margin (typically left)
34
+ $margins: if($i == $columns, 2, 1);
35
+
36
+ // Calculate total width for spanning i columns:
37
+ // - i columns × column width
38
+ // - (i-1) gutters between columns
39
+ // - appropriate margins (1 or 2 depending on if it's full width)
40
+ --col-span-#{$i}: calc(
41
+ #{$i} * var(--grid-column-size) + #{($i - 1)} * var(--grid-gutter) + var(--grid-margin) * #{$margins}
42
+ );
43
+ }
44
+ }
45
+
46
+ @mixin grid-setup($grid-setup) {
47
+ gap: map.get($grid-setup, 'gutter');
48
+ padding: map.get($grid-setup, 'margin');
49
+ width: 100%;
50
+ height: 100%;
51
+ box-sizing: border-box;
52
+ }
53
+
54
+ @mixin generate-grid-classes($grid-setup) {
55
+ @for $i from 1 through $columns {
56
+ .ds-grid-col-span-#{$i} {
57
+ --col-span: #{$i};
58
+ }
59
+ @if $i < $columns {
60
+ .ds-grid-col-start-#{$i} {
61
+ --col-start: #{$i};
62
+ }
63
+ }
64
+ }
65
+ @for $i from 1 through $rows {
66
+ .ds-grid-row-span-#{$i} {
67
+ --row-span: #{$i};
68
+ }
69
+ @if $i < $rows {
70
+ .ds-grid-row-start-#{$i} {
71
+ --row-start: #{$i};
72
+ }
73
+ }
74
+ }
75
+ @for $i from 3 through $columns {
76
+ &.ds-grid-cols-#{$i} {
77
+ grid-template-columns: repeat($i, 1fr);
78
+ }
79
+ }
80
+ @for $i from 1 through math.floor(calc($rows / 2)) {
81
+ $row-count: 2 * $i;
82
+ &.ds-grid-rows-#{$row-count} {
83
+ grid-template-rows: repeat($row-count, 1fr);
84
+ }
85
+ }
86
+ .ds-grid-col-span-full {
87
+ --col-span: #{$columns};
88
+ }
89
+ .ds-grid-row-span-full {
90
+ --row-span: #{$rows};
91
+ }
92
+ }
93
+
94
+ .ds-grid {
95
+ display: grid;
96
+ grid-template-columns: repeat($columns, 1fr);
97
+ grid-template-rows: 1fr;
98
+ @include grid-setup($grid-hd);
99
+ @include generate-grid-classes($grid-hd);
100
+
101
+ /*
102
+ @media screen and (min-width: $qhd) {
103
+ @include grid-setup($grid-qhd);
104
+ }
105
+ */
106
+ }
107
+
108
+ .ds-grid > [class^='ds-grid'] {
109
+ grid-column: var(--col-start, auto) / span var(--col-span, 1);
110
+ grid-row: var(--row-start, auto) / span var(--row-span, 1);
111
+ }
@@ -0,0 +1 @@
1
+ @import './mixins/list';