@drivenets/design-system 0.9.1 → 0.11.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.
- package/CHANGELOG.md +33 -0
- package/dist/index.cjs +1182 -716
- package/dist/index.d.cts +1806 -636
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1809 -639
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1189 -726
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +1 -1
- package/package.json +11 -13
- package/src/components/ds-alert-banner/ds-alert-banner.module.scss +25 -25
- package/src/components/ds-autocomplete/ds-autocomplete.module.scss +29 -29
- package/src/components/ds-avatar/_mixins.scss +7 -7
- package/src/components/ds-avatar/ds-avatar.module.scss +2 -2
- package/src/components/ds-avatar-group/ds-avatar-group.module.scss +6 -6
- package/src/components/ds-breadcrumb/ds-breadcrumb.module.scss +14 -14
- package/src/components/ds-breadcrumb/ds-breadcrumb.types.ts +40 -6
- package/src/components/ds-button/ds-button.types.ts +13 -2
- package/src/components/ds-button/versions/ds-button-legacy/ds-button-legacy.module.scss +17 -17
- package/src/components/ds-button/versions/ds-button-new/ds-button-new.module.scss +135 -135
- package/src/components/ds-button-v3/ds-button-v3.module.scss +113 -114
- package/src/components/ds-button-v3/ds-button-v3.types.ts +7 -0
- package/src/components/ds-card/ds-card.module.scss +12 -12
- package/src/components/ds-card/ds-card.types.ts +3 -1
- package/src/components/ds-checkbox/ds-checkbox.module.scss +106 -123
- package/src/components/ds-checkbox/ds-checkbox.tsx +24 -35
- package/src/components/ds-checkbox/ds-checkbox.types.ts +12 -11
- package/src/components/ds-checkbox-group/ds-checkbox-group.module.scss +13 -0
- package/src/components/ds-checkbox-group/ds-checkbox-group.tsx +20 -0
- package/src/components/ds-checkbox-group/ds-checkbox-group.types.ts +8 -0
- package/src/components/ds-checkbox-group/hooks/index.ts +6 -0
- package/src/components/ds-checkbox-group/hooks/use-checkbox-select-all.ts +65 -0
- package/src/components/ds-checkbox-group/index.ts +3 -0
- package/src/components/ds-chip/ds-chip.module.scss +17 -17
- package/src/components/ds-chip-group/ds-chip-group.module.scss +12 -12
- package/src/components/ds-comment-bubble/components/ds-comment-thread/ds-comment-thread.module.scss +3 -3
- package/src/components/ds-comment-bubble/components/ds-comment-thread/ds-comment-thread.types.ts +26 -0
- package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.module.scss +18 -18
- package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.types.ts +38 -0
- package/src/components/ds-comment-bubble/ds-comment-bubble.module.scss +43 -43
- package/src/components/ds-comment-bubble/ds-comment-bubble.types.ts +78 -0
- package/src/components/ds-comment-card/ds-comment-card.module.scss +34 -34
- package/src/components/ds-comment-card/ds-comment-card.types.ts +114 -0
- package/src/components/ds-comment-indicator/ds-comment-indicator.module.scss +9 -9
- package/src/components/ds-comment-indicator/ds-comment-indicator.types.ts +26 -0
- package/src/components/ds-comments-drawer/comments-filters.types.ts +33 -0
- package/src/components/ds-comments-drawer/components/comments-filter-modal/comments-filter-modal.module.scss +10 -10
- package/src/components/ds-comments-drawer/components/comments-filter-modal/comments-filter-modal.types.ts +37 -1
- package/src/components/ds-comments-drawer/ds-comments-drawer.module.scss +11 -11
- package/src/components/ds-comments-drawer/ds-comments-drawer.types.ts +64 -0
- package/src/components/ds-date-input/ds-date-input.module.scss +42 -42
- package/src/components/ds-date-input/ds-date-input.types.ts +23 -0
- package/src/components/ds-date-picker/components/calendar-table.module.scss +17 -17
- package/src/components/ds-date-picker/components/calendar-view-control/calendar-view-control.module.scss +8 -8
- package/src/components/ds-date-picker/components/day-view/day-view.module.scss +1 -1
- package/src/components/ds-date-picker/ds-date-picker.module.scss +1 -1
- package/src/components/ds-date-picker/ds-date-picker.tsx +3 -0
- package/src/components/ds-date-picker/ds-date-picker.types.ts +20 -0
- package/src/components/ds-date-range-picker/ds-date-range-picker.module.scss +1 -1
- package/src/components/ds-date-range-picker/ds-date-range-picker.types.ts +28 -0
- package/src/components/ds-dialog/ds-dialog.module.scss +3 -3
- package/src/components/ds-dialog/ds-dialog.types.ts +10 -1
- package/src/components/ds-divider/ds-divider.module.scss +1 -1
- package/src/components/ds-drawer/ds-drawer.module.scss +12 -12
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.module.scss +22 -14
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.tsx +2 -0
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.types.ts +33 -0
- package/src/components/ds-expandable-text-input/ds-expandable-text-input.module.scss +1 -1
- package/src/components/ds-file-upload/components/file-upload/file-upload.module.scss +22 -22
- package/src/components/ds-file-upload/components/file-upload/file-upload.types.ts +1 -0
- package/src/components/ds-file-upload/components/file-upload-item/file-upload-item.module.scss +23 -23
- package/src/components/ds-file-upload/ds-file-upload-api.types.ts +55 -0
- package/src/components/ds-filter-status-icon/ds-filter-status-icon.module.scss +5 -5
- package/src/components/ds-form-control/ds-form-control.module.scss +13 -13
- package/src/components/ds-form-control/ds-form-control.types.ts +3 -0
- package/src/components/ds-grid/ds-grid.tsx +29 -12
- package/src/components/ds-grid/ds-grid.types.ts +16 -13
- package/src/components/ds-grid/index.ts +10 -2
- package/src/components/ds-icon/custom-icons/index.ts +2 -0
- package/src/components/ds-icon/custom-icons/special-leading-icon.tsx +11 -0
- package/src/components/ds-icon/ds-icon.module.scss +8 -0
- package/src/components/ds-icon/ds-icon.tsx +10 -4
- package/src/components/ds-icon/ds-icon.types.ts +30 -0
- package/src/components/ds-key-value-pair/ds-key-value-pair.module.scss +7 -7
- package/src/components/ds-key-value-pair/ds-key-value-pair.types.ts +12 -2
- package/src/components/ds-modal/ds-modal.module.scss +9 -9
- package/src/components/ds-modal/ds-modal.types.ts +16 -0
- package/src/components/ds-panel/ds-panel.module.scss +16 -16
- package/src/components/ds-panel/ds-panel.types.ts +39 -0
- package/src/components/ds-popover/ds-popover.module.scss +2 -2
- package/src/components/ds-progress-arc/ds-progress-arc.module.scss +7 -7
- package/src/components/ds-progress-donut/ds-progress-donut.module.scss +7 -7
- package/src/components/ds-progress-linear/ds-progress-linear.module.scss +15 -15
- package/src/components/ds-radio-group/ds-radio-group.module.scss +58 -56
- package/src/components/ds-radio-group/ds-radio-group.tsx +35 -28
- package/src/components/ds-radio-group/ds-radio-group.types.ts +38 -7
- package/src/components/ds-segment-group/ds-segment-group.module.scss +18 -18
- package/src/components/ds-segment-group/ds-segment-group.types.ts +17 -0
- package/src/components/ds-select/ds-select.module.scss +8 -8
- package/src/components/ds-select/ds-select.types.ts +32 -0
- package/src/components/ds-skeleton/ds-skeleton.module.scss +1 -1
- package/src/components/ds-smart-tabs/ds-smart-tabs.module.scss +12 -12
- package/src/components/ds-smart-tabs/ds-smart-tabs.tsx +9 -9
- package/src/components/ds-spinner/ds-spinner.module.scss +1 -1
- package/src/components/ds-split-button/ds-split-button.module.scss +7 -7
- package/src/components/ds-split-button/ds-split-button.types.ts +28 -0
- package/src/components/ds-stack/ds-stack.types.ts +23 -0
- package/src/components/ds-status-badge/ds-status-badge.module.scss +21 -25
- package/src/components/ds-stepper/ds-stepper.module.scss +55 -55
- package/src/components/ds-stepper/ds-stepper.types.ts +34 -1
- package/src/components/ds-system-status/ds-system-status.module.scss +22 -22
- package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.types.ts +27 -0
- package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.module.scss +9 -9
- package/src/components/ds-table/components/ds-table-cell/ds-table-cell.module.scss +4 -4
- package/src/components/ds-table/components/ds-table-header/ds-table-header.module.scss +5 -10
- package/src/components/ds-table/components/ds-table-header/ds-table-header.tsx +6 -9
- package/src/components/ds-table/components/ds-table-row/ds-table-row.module.scss +13 -22
- package/src/components/ds-table/components/ds-table-row/ds-table-row.tsx +11 -18
- package/src/components/ds-table/components/ds-table-row-expandable-cell/ds-table-row-expandable-cell.module.scss +0 -7
- package/src/components/ds-table/components/ds-table-row-expandable-cell/ds-table-row-expandable-cell.tsx +19 -28
- package/src/components/ds-table/components/ds-table-row-expandable-cell/ds-table-row-expandable-cell.types.ts +7 -1
- package/src/components/ds-table/components/ds-table-row-selectable-cell/ds-table-row-selectable-cell.tsx +3 -8
- package/src/components/ds-table/components/ds-table-row-selectable-cell/ds-table-row-selectable-cell.types.ts +11 -0
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.module.scss +15 -11
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.tsx +9 -4
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.types.ts +27 -0
- package/src/components/ds-table/ds-table.module.scss +9 -2
- package/src/components/ds-table/ds-table.tsx +26 -4
- package/src/components/ds-table/filters/components/range-filter/range-filter.module.scss +1 -1
- package/src/components/ds-table/filters/types/filter-adapter.types.ts +6 -0
- package/src/components/ds-table/styles/_mixins.scss +1 -1
- package/src/components/ds-table/styles/_variables.scss +5 -6
- package/src/components/ds-table/utils/constants.ts +10 -0
- package/src/components/ds-tabs/components/ds-tabs-content/ds-tabs-content.module.scss +1 -1
- package/src/components/ds-tabs/components/ds-tabs-list/ds-tabs-indicator.module.scss +1 -1
- package/src/components/ds-tabs/components/ds-tabs-list/ds-tabs-list.module.scss +3 -3
- package/src/components/ds-tabs/components/ds-tabs-tab/ds-tabs-tab.module.scss +55 -55
- package/src/components/ds-tabs/ds-tabs.module.scss +1 -1
- package/src/components/ds-tag/ds-tag.module.scss +22 -22
- package/src/components/ds-tag/ds-tag.types.ts +6 -0
- package/src/components/ds-tag-filter/ds-tag-filter.module.scss +10 -10
- package/src/components/ds-tag-filter/ds-tag-filter.types.ts +16 -0
- package/src/components/ds-text-input/ds-text-input.module.scss +1 -1
- package/src/components/ds-text-input/ds-text-input.types.ts +3 -0
- package/src/components/ds-time-picker/components/time-item/time-item.module.scss +8 -8
- package/src/components/ds-time-picker/components/time-item/time-item.types.ts +19 -0
- package/src/components/ds-time-picker/components/time-scroller/time-scroller.module.scss +3 -3
- package/src/components/ds-time-picker/components/time-scroller/time-scroller.types.ts +29 -0
- package/src/components/ds-time-picker/ds-time-picker.module.scss +7 -0
- package/src/components/ds-time-picker/ds-time-picker.tsx +8 -1
- package/src/components/ds-time-picker/ds-time-picker.types.ts +80 -0
- package/src/components/ds-toast/ds-toast.module.scss +11 -11
- package/src/components/ds-toggle/ds-toggle.module.scss +18 -18
- package/src/components/ds-tooltip/ds-tooltip.module.scss +5 -5
- package/src/components/ds-tooltip/ds-tooltip.types.ts +6 -0
- package/src/components/ds-tree/ds-tree.module.scss +27 -27
- package/src/components/ds-tree/ds-tree.types.ts +84 -2
- package/src/components/ds-typography/ds-typography.config.ts +46 -27
- package/src/components/ds-typography/ds-typography.tsx +22 -7
- package/src/components/ds-typography/ds-typography.types.ts +15 -4
- package/src/components/ds-vertical-tabs/ds-vertical-tabs.module.scss +13 -13
- package/src/components/ds-workspace/ds-workspace.module.scss +55 -0
- package/src/components/ds-workspace/ds-workspace.tsx +37 -0
- package/src/components/ds-workspace/ds-workspace.types.ts +17 -0
- package/src/components/ds-workspace/index.ts +8 -0
- package/src/index.ts +2 -0
- package/src/styles/_grid.scss +2 -2
- package/src/styles/_root.scss +0 -18
- package/src/styles/_root_new.scss +449 -0
- package/src/styles/_scrollbars.scss +5 -5
- package/src/styles/_typography.scss +18 -14
- package/src/styles/mixins/_list.scss +8 -8
- package/src/styles/shared/_dropdown.scss +9 -9
- package/src/styles/shared/_input.scss +47 -49
- package/src/styles/styles.scss +1 -0
- package/src/styles/_root_updated.scss +0 -593
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
export interface
|
|
4
|
-
/**
|
|
5
|
-
* The content to be rendered inside the grid
|
|
6
|
-
*/
|
|
3
|
+
export interface DsGridBaseProps {
|
|
7
4
|
children: ReactNode;
|
|
8
5
|
|
|
9
6
|
/**
|
|
@@ -17,15 +14,24 @@ export interface DsGridProps {
|
|
|
17
14
|
columns?: 2 | 4 | 6 | 8 | 10 | 12;
|
|
18
15
|
|
|
19
16
|
/**
|
|
20
|
-
*
|
|
17
|
+
* Gap between grid cells.
|
|
18
|
+
* A number is treated as px. A string is used as-is (e.g. `"1rem"`, `"var(--grid-gutter)"`).
|
|
19
|
+
* CSS default (when omitted): `16px` — set by `$gutter` in `_grid-variables.scss`.
|
|
21
20
|
*/
|
|
22
|
-
|
|
23
|
-
}
|
|
21
|
+
gutter?: number | string;
|
|
24
22
|
|
|
25
|
-
export interface DsGridItemProps {
|
|
26
23
|
/**
|
|
27
|
-
*
|
|
24
|
+
* Padding around the grid container.
|
|
25
|
+
* A number is treated as px (uniform). A string is used as-is (e.g. `"16px 20px"`, `"var(--grid-margin)"`).
|
|
26
|
+
* CSS default (when omitted): `16px 20px` — set by `$margin-y $margin-x` in `_grid-variables.scss`.
|
|
28
27
|
*/
|
|
28
|
+
margin?: number | string;
|
|
29
|
+
|
|
30
|
+
className?: string;
|
|
31
|
+
style?: CSSProperties;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface DsGridItemBaseProps {
|
|
29
35
|
children: ReactNode;
|
|
30
36
|
|
|
31
37
|
/**
|
|
@@ -48,8 +54,5 @@ export interface DsGridItemProps {
|
|
|
48
54
|
*/
|
|
49
55
|
rowStart?: number;
|
|
50
56
|
|
|
51
|
-
/**
|
|
52
|
-
* Custom class names to apply to the grid item
|
|
53
|
-
*/
|
|
54
57
|
className?: string;
|
|
55
58
|
}
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
|
|
3
|
+
import { withResponsiveProps } from '../../utils/responsive';
|
|
4
|
+
import { DsGridBase, DsGridItemBase } from './ds-grid';
|
|
5
|
+
|
|
6
|
+
export const DsGrid = withResponsiveProps(DsGridBase, ['gutter', 'margin']);
|
|
7
|
+
export const DsGridItem = withResponsiveProps(DsGridItemBase, ['colSpan', 'rowSpan']);
|
|
8
|
+
|
|
9
|
+
export type DsGridProps = ComponentProps<typeof DsGrid>;
|
|
10
|
+
export type DsGridItemProps = ComponentProps<typeof DsGridItem>;
|
|
@@ -50,6 +50,7 @@ import { SpecialMapView } from './special-map-view';
|
|
|
50
50
|
|
|
51
51
|
// Misc icons
|
|
52
52
|
import { SpecialHome } from './special-home';
|
|
53
|
+
import { SpecialLeadingIcon } from './special-leading-icon';
|
|
53
54
|
import { SpecialLego } from './special-lego';
|
|
54
55
|
import { SpecialScheme } from './special-scheme';
|
|
55
56
|
import { SpecialBook } from './special-book';
|
|
@@ -120,6 +121,7 @@ export const customIcons = {
|
|
|
120
121
|
|
|
121
122
|
// Misc
|
|
122
123
|
'special-home': SpecialHome,
|
|
124
|
+
'special-leading-icon': SpecialLeadingIcon,
|
|
123
125
|
'special-lego': SpecialLego,
|
|
124
126
|
'special-scheme': SpecialScheme,
|
|
125
127
|
'special-book': SpecialBook,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FC, SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Leading / input-adjacent building icon from design (AR-58177). */
|
|
4
|
+
export const SpecialLeadingIcon: FC<SVGProps<SVGSVGElement>> = (props) => (
|
|
5
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 13" fill="none" {...props}>
|
|
6
|
+
<path
|
|
7
|
+
d="M7.2 4.81737H7.8C7.95913 4.81737 8.11174 4.75164 8.22426 4.63464C8.33679 4.51765 8.4 4.35896 8.4 4.1935C8.4 4.02804 8.33679 3.86936 8.22426 3.75237C8.11174 3.63537 7.95913 3.56964 7.8 3.56964H7.2C7.04087 3.56964 6.88826 3.63537 6.77574 3.75237C6.66321 3.86936 6.6 4.02804 6.6 4.1935C6.6 4.35896 6.66321 4.51765 6.77574 4.63464C6.88826 4.75164 7.04087 4.81737 7.2 4.81737ZM7.2 7.31283H7.8C7.95913 7.31283 8.11174 7.24711 8.22426 7.13011C8.33679 7.01311 8.4 6.85443 8.4 6.68897C8.4 6.52351 8.33679 6.36483 8.22426 6.24783C8.11174 6.13083 7.95913 6.0651 7.8 6.0651H7.2C7.04087 6.0651 6.88826 6.13083 6.77574 6.24783C6.66321 6.36483 6.6 6.52351 6.6 6.68897C6.6 6.85443 6.66321 7.01311 6.77574 7.13011C6.88826 7.24711 7.04087 7.31283 7.2 7.31283ZM4.2 4.81737H4.8C4.95913 4.81737 5.11174 4.75164 5.22426 4.63464C5.33679 4.51765 5.4 4.35896 5.4 4.1935C5.4 4.02804 5.33679 3.86936 5.22426 3.75237C5.11174 3.63537 4.95913 3.56964 4.8 3.56964H4.2C4.04087 3.56964 3.88826 3.63537 3.77574 3.75237C3.66321 3.86936 3.6 4.02804 3.6 4.1935C3.6 4.35896 3.66321 4.51765 3.77574 4.63464C3.88826 4.75164 4.04087 4.81737 4.2 4.81737ZM4.2 7.31283H4.8C4.95913 7.31283 5.11174 7.24711 5.22426 7.13011C5.33679 7.01311 5.4 6.85443 5.4 6.68897C5.4 6.52351 5.33679 6.36483 5.22426 6.24783C5.11174 6.13083 4.95913 6.0651 4.8 6.0651H4.2C4.04087 6.0651 3.88826 6.13083 3.77574 6.24783C3.66321 6.36483 3.6 6.52351 3.6 6.68897C3.6 6.85443 3.66321 7.01311 3.77574 7.13011C3.88826 7.24711 4.04087 7.31283 4.2 7.31283ZM11.4 11.264H10.8V1.13558C10.8 0.97012 10.7368 0.811436 10.6243 0.694439C10.5117 0.577441 10.3591 0.511713 10.2 0.511713H1.8C1.64087 0.511713 1.48826 0.577441 1.37574 0.694439C1.26321 0.811436 1.2 0.97012 1.2 1.13558V11.264H0.6C0.44087 11.264 0.288258 11.3297 0.175736 11.4467C0.0632141 11.5637 0 11.7224 0 11.8879C0 12.0533 0.0632141 12.212 0.175736 12.329C0.288258 12.446 0.44087 12.5117 0.6 12.5117H11.4C11.5591 12.5117 11.7117 12.446 11.8243 12.329C11.9368 12.212 12 12.0533 12 11.8879C12 11.7224 11.9368 11.5637 11.8243 11.4467C11.7117 11.3297 11.5591 11.264 11.4 11.264ZM6.6 12.5117H5.4V9.91228H6.6V12.5117ZM9.6 11.264H7.8V9.28841C7.8 9.12295 7.73679 8.96426 7.62426 8.84727C7.51174 8.73027 7.35913 8.66454 7.2 8.66454H4.8C4.64087 8.66454 4.48826 8.73027 4.37574 8.84727C4.26321 8.96426 4.2 9.12295 4.2 9.28841V11.264H2.4V1.75945H9.6V11.264Z"
|
|
8
|
+
fill="currentColor"
|
|
9
|
+
/>
|
|
10
|
+
</svg>
|
|
11
|
+
);
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import styles from './ds-icon.module.scss';
|
|
3
|
-
import type
|
|
3
|
+
import { iconColors, type DsIconProps } from './ds-icon.types';
|
|
4
4
|
import { customIcons, isCustomIcon } from './custom-icons';
|
|
5
5
|
|
|
6
|
+
const iconColorSet = new Set<string>(iconColors);
|
|
7
|
+
|
|
8
|
+
const resolveColor = (color: string): string => (iconColorSet.has(color) ? `var(--icon-${color})` : color);
|
|
9
|
+
|
|
6
10
|
/**
|
|
7
11
|
* Design system Icon component that renders Google Material Icons, custom SVG icons, or inline SVGs
|
|
8
12
|
*/
|
|
@@ -11,29 +15,31 @@ const DsIcon = ({
|
|
|
11
15
|
size = 'medium',
|
|
12
16
|
variant = 'outlined',
|
|
13
17
|
filled,
|
|
18
|
+
color,
|
|
14
19
|
className = '',
|
|
15
20
|
style = {},
|
|
16
21
|
...rest
|
|
17
22
|
}: DsIconProps) => {
|
|
18
23
|
const iconClass = classNames(styles.icon, styles[size], { [styles.filled]: filled }, className);
|
|
24
|
+
const mergedStyle = color ? { color: resolveColor(color), ...style } : style;
|
|
19
25
|
|
|
20
26
|
// 1. SVG component passed directly
|
|
21
27
|
if (typeof icon === 'function') {
|
|
22
28
|
const SvgComponent = icon;
|
|
23
|
-
return <SvgComponent className={iconClass} style={
|
|
29
|
+
return <SvgComponent className={iconClass} style={mergedStyle} {...rest} />;
|
|
24
30
|
}
|
|
25
31
|
|
|
26
32
|
// 2. Custom registered icon from custom-icons registry
|
|
27
33
|
if (isCustomIcon(icon)) {
|
|
28
34
|
const SvgComponent = customIcons[icon];
|
|
29
|
-
return <SvgComponent className={iconClass} style={
|
|
35
|
+
return <SvgComponent className={iconClass} style={mergedStyle} {...rest} />;
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
// 3. Material Icon (font-based)
|
|
33
39
|
const variantClass = `material-symbols-${variant}`;
|
|
34
40
|
|
|
35
41
|
return (
|
|
36
|
-
<span className={classNames(iconClass, variantClass)} style={
|
|
42
|
+
<span className={classNames(iconClass, variantClass)} style={mergedStyle} {...rest}>
|
|
37
43
|
{icon}
|
|
38
44
|
</span>
|
|
39
45
|
);
|
|
@@ -7,6 +7,29 @@ export type IconSize = (typeof iconSizes)[number];
|
|
|
7
7
|
export const iconVariants = ['outlined', 'rounded'] as const;
|
|
8
8
|
export type IconVariant = (typeof iconVariants)[number];
|
|
9
9
|
|
|
10
|
+
export const iconColors = [
|
|
11
|
+
'action',
|
|
12
|
+
'action-hover',
|
|
13
|
+
'action-secondary',
|
|
14
|
+
'disabled',
|
|
15
|
+
'error',
|
|
16
|
+
'execution',
|
|
17
|
+
'information-main',
|
|
18
|
+
'information-secondary',
|
|
19
|
+
'inverse',
|
|
20
|
+
'main',
|
|
21
|
+
'on-button',
|
|
22
|
+
'on-dark-disabled',
|
|
23
|
+
'pause',
|
|
24
|
+
'pending',
|
|
25
|
+
'secondary',
|
|
26
|
+
'success',
|
|
27
|
+
'success-light',
|
|
28
|
+
'warning',
|
|
29
|
+
'warning-light',
|
|
30
|
+
] as const;
|
|
31
|
+
export type IconColor = (typeof iconColors)[number];
|
|
32
|
+
|
|
10
33
|
export type MaterialIconName = {
|
|
11
34
|
[K in keyof typeof materialIcons]: K extends `${IconPrefix}::${infer Name}` ? Name : never;
|
|
12
35
|
}[keyof typeof materialIcons];
|
|
@@ -39,6 +62,13 @@ export interface DsIconProps {
|
|
|
39
62
|
*/
|
|
40
63
|
filled?: boolean;
|
|
41
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Icon color. Semantic names map to `--icon-*` tokens (e.g. `'error'` →
|
|
67
|
+
* `var(--icon-error)`); raw CSS values (hex, rgb, hsl, CSS variables)
|
|
68
|
+
* pass through unchanged. Omit to inherit from parent.
|
|
69
|
+
*/
|
|
70
|
+
color?: IconColor | (string & {});
|
|
71
|
+
|
|
42
72
|
/**
|
|
43
73
|
* Additional CSS class names
|
|
44
74
|
*/
|
|
@@ -10,21 +10,21 @@
|
|
|
10
10
|
.root[data-orientation='horizontal'] {
|
|
11
11
|
display: grid;
|
|
12
12
|
grid-template-columns: auto 1fr;
|
|
13
|
-
column-gap: var(--
|
|
13
|
+
column-gap: var(--xs);
|
|
14
14
|
align-items: start;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.label {
|
|
18
|
-
padding-bottom: var(--
|
|
19
|
-
padding-left: var(--
|
|
20
|
-
color: var(--
|
|
18
|
+
padding-bottom: var(--4xs);
|
|
19
|
+
padding-left: var(--sm);
|
|
20
|
+
color: var(--font-main);
|
|
21
21
|
white-space: nowrap;
|
|
22
22
|
flex-shrink: 0;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.root[data-orientation='horizontal'] .label {
|
|
26
26
|
padding-bottom: 0;
|
|
27
|
-
padding-top: var(--
|
|
27
|
+
padding-top: var(--3xs);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.valueContainer {
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
width: 100%;
|
|
44
44
|
min-width: 0;
|
|
45
45
|
min-height: 28px;
|
|
46
|
-
padding: var(--
|
|
47
|
-
color: var(--
|
|
46
|
+
padding: var(--3xs) var(--sm);
|
|
47
|
+
color: var(--font-secondary);
|
|
48
48
|
text-overflow: ellipsis;
|
|
49
49
|
white-space: nowrap;
|
|
50
50
|
overflow: hidden;
|
|
@@ -4,15 +4,25 @@ export const dsKeyValuePairOrientations = ['vertical', 'horizontal'] as const;
|
|
|
4
4
|
export type DsKeyValuePairOrientation = (typeof dsKeyValuePairOrientations)[number];
|
|
5
5
|
|
|
6
6
|
export interface DsKeyValuePairProps {
|
|
7
|
+
/** Label rendered for the key side of the pair (left or top depending on `orientation`). */
|
|
7
8
|
keyLabel: ReactNode;
|
|
8
9
|
|
|
9
10
|
/** Shown when the editor is not active (read-only or not hovered). */
|
|
10
11
|
value?: ReactNode;
|
|
11
12
|
|
|
12
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* When `true`, the pair is rendered as a static display and the editor is never
|
|
15
|
+
* revealed (even on hover/focus).
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
13
18
|
readOnly?: boolean;
|
|
14
19
|
|
|
15
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Layout orientation:
|
|
22
|
+
* - `vertical`: key stacked above value
|
|
23
|
+
* - `horizontal`: key and value side-by-side
|
|
24
|
+
* @default 'vertical'
|
|
25
|
+
*/
|
|
16
26
|
orientation?: DsKeyValuePairOrientation;
|
|
17
27
|
|
|
18
28
|
/** Editor content revealed on hover/focus when not read-only. */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
$pad-x: var(--
|
|
2
|
-
$pad-y: var(--
|
|
1
|
+
$pad-x: var(--lg);
|
|
2
|
+
$pad-y: var(--standard);
|
|
3
3
|
$max-width: 90vw;
|
|
4
4
|
$border-size: 1px;
|
|
5
|
-
$border: $border-size solid var(--
|
|
5
|
+
$border: $border-size solid var(--border-secondary);
|
|
6
6
|
|
|
7
7
|
.overlay {
|
|
8
8
|
position: fixed;
|
|
9
9
|
inset: 0;
|
|
10
|
-
background: var(--
|
|
10
|
+
background: var(--background-brand);
|
|
11
11
|
opacity: 0.4;
|
|
12
12
|
z-index: 1199;
|
|
13
13
|
|
|
@@ -43,7 +43,7 @@ $border: $border-size solid var(--color-border-secondary);
|
|
|
43
43
|
.modal {
|
|
44
44
|
position: fixed;
|
|
45
45
|
inset: 50% auto auto 50%;
|
|
46
|
-
background: var(--
|
|
46
|
+
background: var(--background);
|
|
47
47
|
border-radius: 4px;
|
|
48
48
|
box-shadow: 0 5px 15px 0 rgba(0, 0, 0, 0.15);
|
|
49
49
|
z-index: 1200;
|
|
@@ -98,7 +98,7 @@ $border: $border-size solid var(--color-border-secondary);
|
|
|
98
98
|
.header {
|
|
99
99
|
display: flex;
|
|
100
100
|
align-items: center;
|
|
101
|
-
gap: var(--
|
|
101
|
+
gap: var(--xs);
|
|
102
102
|
position: relative;
|
|
103
103
|
background: inherit;
|
|
104
104
|
flex-shrink: 0;
|
|
@@ -110,7 +110,7 @@ $border: $border-size solid var(--color-border-secondary);
|
|
|
110
110
|
left: $pad-x;
|
|
111
111
|
right: $pad-x;
|
|
112
112
|
height: $border-size;
|
|
113
|
-
background: var(--
|
|
113
|
+
background: var(--border-secondary);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -121,7 +121,7 @@ $border: $border-size solid var(--color-border-secondary);
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
.title {
|
|
124
|
-
color: var(--
|
|
124
|
+
color: var(--font-main);
|
|
125
125
|
margin: 0;
|
|
126
126
|
flex: 1;
|
|
127
127
|
}
|
|
@@ -135,7 +135,7 @@ $border: $border-size solid var(--color-border-secondary);
|
|
|
135
135
|
|
|
136
136
|
.actions {
|
|
137
137
|
display: flex;
|
|
138
|
-
gap: var(--
|
|
138
|
+
gap: var(--xs);
|
|
139
139
|
justify-content: flex-end;
|
|
140
140
|
margin-left: auto;
|
|
141
141
|
}
|
|
@@ -13,6 +13,22 @@ export interface DsModalProps extends Pick<
|
|
|
13
13
|
DialogProps,
|
|
14
14
|
'modal' | 'closeOnEscape' | 'closeOnInteractOutside'
|
|
15
15
|
> {
|
|
16
|
+
/**
|
|
17
|
+
* Whether the modal traps focus and blocks interaction with the page behind the
|
|
18
|
+
* backdrop. When `false`, users can continue interacting with the underlying page.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
modal?: DialogProps['modal'];
|
|
22
|
+
/**
|
|
23
|
+
* Whether pressing the Escape key closes the modal.
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
closeOnEscape?: DialogProps['closeOnEscape'];
|
|
27
|
+
/**
|
|
28
|
+
* Whether clicking or focusing outside the modal closes it.
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
closeOnInteractOutside?: DialogProps['closeOnInteractOutside'];
|
|
16
32
|
/**
|
|
17
33
|
* Whether the modal is open
|
|
18
34
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.root {
|
|
2
2
|
position: relative;
|
|
3
|
-
background: var(--
|
|
4
|
-
padding: var(--
|
|
3
|
+
background: var(--color-dap-gray-050);
|
|
4
|
+
padding: var(--lg);
|
|
5
5
|
width: 20vw;
|
|
6
6
|
min-width: 240px;
|
|
7
7
|
max-width: 480px;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
&[data-state='open']:hover,
|
|
12
12
|
&[data-state='open']:has(:focus-visible) {
|
|
13
|
-
border-color: var(--
|
|
13
|
+
border-color: var(--border);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
&[data-state='closed'] {
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
|
|
20
20
|
&.variantFloating {
|
|
21
21
|
position: absolute;
|
|
22
|
-
inset-inline-start: var(--
|
|
23
|
-
top: var(--
|
|
22
|
+
inset-inline-start: var(--sm);
|
|
23
|
+
top: var(--sm);
|
|
24
24
|
border: none;
|
|
25
|
-
border-radius: var(--
|
|
25
|
+
border-radius: var(--xs);
|
|
26
26
|
filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.22));
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
height: var(--size);
|
|
47
47
|
width: var(--size);
|
|
48
48
|
padding: 1px;
|
|
49
|
-
border: 1px solid var(--
|
|
49
|
+
border: 1px solid var(--border-secondary);
|
|
50
50
|
border-radius: 100%;
|
|
51
|
-
background: var(--
|
|
52
|
-
color: var(--
|
|
53
|
-
top: var(--
|
|
51
|
+
background: var(--color-dap-gray-050);
|
|
52
|
+
color: var(--icon-action-secondary);
|
|
53
|
+
top: var(--lg);
|
|
54
54
|
inset-inline-start: 100%;
|
|
55
55
|
margin-inline-start: calc(var(--size) / -2);
|
|
56
56
|
|
|
@@ -66,13 +66,13 @@
|
|
|
66
66
|
|
|
67
67
|
&:hover,
|
|
68
68
|
&:focus-visible {
|
|
69
|
-
color: var(--
|
|
70
|
-
border-color: var(--
|
|
69
|
+
color: var(--icon-action);
|
|
70
|
+
border-color: var(--border-action-primary);
|
|
71
71
|
outline: none;
|
|
72
|
-
background: var(--
|
|
72
|
+
background: var(--background-action-tertiary-hover);
|
|
73
73
|
|
|
74
74
|
.root:has(&) {
|
|
75
|
-
border-color: var(--
|
|
75
|
+
border-color: var(--border-action-primary);
|
|
76
76
|
|
|
77
77
|
// Add an inset single-sided border on hover without affecting the layout.
|
|
78
78
|
&.variantDocked[data-state='open']::before {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
width: 1px;
|
|
84
84
|
top: 0;
|
|
85
85
|
inset-inline-end: 0;
|
|
86
|
-
background: var(--
|
|
86
|
+
background: var(--border-action-primary);
|
|
87
87
|
pointer-events: none;
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
&::after {
|
|
94
94
|
content: '';
|
|
95
95
|
position: absolute;
|
|
96
|
-
inset: calc(-1 * var(--
|
|
96
|
+
inset: calc(-1 * var(--3xs));
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
.root.variantFloating & {
|
|
@@ -5,21 +5,60 @@ import type { ResponsiveValue } from '../../utils/responsive';
|
|
|
5
5
|
export type DsPanelVariant = 'docked' | 'floating';
|
|
6
6
|
|
|
7
7
|
export type DsPanelBaseProps = Omit<Collapsible.CollapsibleProps, 'onOpenChange'> & {
|
|
8
|
+
/**
|
|
9
|
+
* Visual treatment of the panel:
|
|
10
|
+
* - `docked`: sits flush within the surrounding layout (default)
|
|
11
|
+
* - `floating`: elevated card with shadow, detached from the layout
|
|
12
|
+
* @default docked
|
|
13
|
+
*/
|
|
8
14
|
variant?: DsPanelVariant;
|
|
15
|
+
/**
|
|
16
|
+
* Width of the panel in pixels when expanded.
|
|
17
|
+
*/
|
|
9
18
|
width?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the panel edge can be dragged to resize its width.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
10
23
|
draggable?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Disable the default inner padding so the panel content can bleed to the edges.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
11
28
|
disablePadding?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Props forwarded to nested sub-components.
|
|
31
|
+
*/
|
|
12
32
|
slotProps?: {
|
|
33
|
+
/**
|
|
34
|
+
* Props forwarded to the collapse/expand button shown on the panel edge.
|
|
35
|
+
*/
|
|
13
36
|
collapseButton?: DsPanelCollapseButtonProps;
|
|
14
37
|
};
|
|
38
|
+
/**
|
|
39
|
+
* Called when the panel's open (expanded) state changes. Receives the next
|
|
40
|
+
* boolean state.
|
|
41
|
+
*/
|
|
15
42
|
onOpenChange?: (open: boolean) => void;
|
|
16
43
|
};
|
|
17
44
|
|
|
18
45
|
export type DsPanelProps = Omit<DsPanelBaseProps, 'width'> & {
|
|
46
|
+
/**
|
|
47
|
+
* Width of the panel when expanded. Accepts a single number (px) or a
|
|
48
|
+
* `ResponsiveValue` to vary width by breakpoint.
|
|
49
|
+
*/
|
|
19
50
|
width?: ResponsiveValue<number>;
|
|
20
51
|
};
|
|
21
52
|
|
|
22
53
|
export type DsPanelCollapseButtonProps = {
|
|
54
|
+
/**
|
|
55
|
+
* Called when the collapse button is clicked.
|
|
56
|
+
*/
|
|
23
57
|
onClick?: () => void;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the panel is currently collapsed. Drives the button's chevron
|
|
60
|
+
* orientation and aria-label.
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
24
63
|
collapsed?: boolean;
|
|
25
64
|
};
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
gap: 12px;
|
|
12
12
|
box-shadow: 0 1.25px 4px 0 rgba(0, 0, 0, 0.25);
|
|
13
13
|
border-radius: 2px;
|
|
14
|
-
background: var(--
|
|
14
|
+
background: var(--color-dap-gray-050);
|
|
15
15
|
padding: 12px;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.arrow {
|
|
19
|
-
fill: var(--
|
|
19
|
+
fill: var(--color-dap-gray-050);
|
|
20
20
|
filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.1));
|
|
21
21
|
width: 18px;
|
|
22
22
|
height: 10px;
|
|
@@ -14,7 +14,7 @@ $transition-duration: 0.2s;
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.track {
|
|
17
|
-
stroke: var(--
|
|
17
|
+
stroke: var(--background-tertiary);
|
|
18
18
|
transition: stroke $transition-duration;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -23,15 +23,15 @@ $transition-duration: 0.2s;
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.default {
|
|
26
|
-
stroke: var(--
|
|
26
|
+
stroke: var(--background-primary);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.success {
|
|
30
|
-
stroke: var(--
|
|
30
|
+
stroke: var(--background-success-strong);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.error {
|
|
34
|
-
stroke: var(--
|
|
34
|
+
stroke: var(--background-error);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.center {
|
|
@@ -39,15 +39,15 @@ $transition-duration: 0.2s;
|
|
|
39
39
|
display: flex;
|
|
40
40
|
align-items: center;
|
|
41
41
|
justify-content: center;
|
|
42
|
-
color: var(--
|
|
42
|
+
color: var(--font-main);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.iconSuccess {
|
|
46
|
-
color: var(--
|
|
46
|
+
color: var(--icon-success);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.iconError {
|
|
50
|
-
color: var(--
|
|
50
|
+
color: var(--icon-error);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.iconMediumSize.iconMediumSize {
|
|
@@ -20,7 +20,7 @@ $transition-duration: 0.2s;
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.track {
|
|
23
|
-
stroke: var(--
|
|
23
|
+
stroke: var(--background-tertiary);
|
|
24
24
|
transition: stroke $transition-duration;
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -30,16 +30,16 @@ $transition-duration: 0.2s;
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.default .range {
|
|
33
|
-
stroke: var(--
|
|
33
|
+
stroke: var(--background-primary);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.success .track,
|
|
37
37
|
.success .range {
|
|
38
|
-
stroke: var(--
|
|
38
|
+
stroke: var(--background-success-strong);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.error .range {
|
|
42
|
-
stroke: var(--
|
|
42
|
+
stroke: var(--background-error);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.center {
|
|
@@ -47,15 +47,15 @@ $transition-duration: 0.2s;
|
|
|
47
47
|
display: flex;
|
|
48
48
|
align-items: center;
|
|
49
49
|
justify-content: center;
|
|
50
|
-
color: var(--
|
|
50
|
+
color: var(--font-main);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.iconSuccess {
|
|
54
|
-
color: var(--
|
|
54
|
+
color: var(--icon-success);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.iconError {
|
|
58
|
-
color: var(--
|
|
58
|
+
color: var(--icon-error);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
$icon-medium-size: 44px;
|