@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.
- package/CHANGELOG.md +31 -0
- package/dist/index.cjs +1893 -824
- package/dist/index.d.cts +363 -247
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +363 -247
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1896 -829
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +1 -1
- package/package.json +25 -25
- package/src/components/ds-alert-banner/ds-alert-banner-global.figma.ts +49 -0
- package/src/components/ds-alert-banner/ds-alert-banner.figma.ts +51 -0
- package/src/components/ds-alert-banner/ds-alert-banner.tsx +7 -6
- package/src/components/ds-autocomplete/ds-autocomplete.figma.ts +2 -2
- package/src/components/ds-autocomplete/ds-autocomplete.module.scss +15 -4
- package/src/components/ds-autocomplete/ds-autocomplete.tsx +10 -3
- package/src/components/ds-autocomplete/ds-autocomplete.types.ts +8 -0
- package/src/components/ds-avatar/ds-avatar.figma.ts +2 -2
- package/src/components/ds-avatar-group/ds-avatar-group.figma.ts +2 -2
- package/src/components/ds-breadcrumb/ds-breadcrumb.figma.ts +2 -2
- package/src/components/ds-button-v3/ds-button-v3.figma.ts +7 -5
- package/src/components/ds-button-v3/ds-button-v3.module.scss +84 -17
- package/src/components/ds-button-v3/ds-button-v3.tsx +2 -0
- package/src/components/ds-button-v3/ds-button-v3.types.ts +11 -2
- package/src/components/ds-button-v3/ds-button-v4.figma.ts +121 -0
- package/src/components/ds-card/figma/ds-card-content.figma.ts +2 -2
- package/src/components/ds-card/figma/ds-card-footer.figma.ts +2 -2
- package/src/components/ds-card/figma/ds-card-header.figma.ts +2 -2
- package/src/components/ds-card/figma/ds-card.figma.ts +2 -2
- package/src/components/ds-catalog-layout/ds-catalog-layout.figma.ts +51 -0
- package/src/components/ds-catalog-layout/ds-catalog-layout.tsx +9 -8
- package/src/components/ds-checkbox/ds-checkbox-level-2.figma.ts +2 -2
- package/src/components/ds-checkbox/ds-checkbox.figma.ts +2 -2
- package/src/components/ds-checkbox-group/ds-checkbox-group.figma.ts +2 -2
- package/src/components/ds-comment-bubble/ds-comment-bubble.figma.ts +52 -0
- package/src/components/ds-comment-card/ds-comment-card.figma.ts +36 -0
- package/src/components/ds-comment-indicator/ds-comment-indicator.figma.ts +32 -0
- package/src/components/ds-comments-drawer/components/comments-filter-modal/index.ts +0 -1
- package/src/components/ds-comments-drawer/ds-comments-drawer.figma.ts +19 -0
- package/src/components/ds-confirmation/ds-confirmation.tsx +13 -11
- package/src/components/ds-date-picker/ds-date-picker.figma.ts +2 -2
- package/src/components/ds-divider/ds-divider.figma.ts +2 -2
- package/src/components/ds-drawer/ds-drawer.tsx +11 -10
- package/src/components/ds-drawer/figma/ds-drawer-content.figma.ts +2 -2
- package/src/components/ds-drawer/figma/ds-drawer-footer.figma.ts +2 -2
- package/src/components/ds-drawer/figma/ds-drawer-header.figma.ts +2 -2
- package/src/components/ds-drawer/figma/ds-drawer.figma.ts +2 -2
- package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-footer.figma.ts +2 -2
- package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-group.figma.ts +2 -2
- package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-item.figma.ts +2 -2
- package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-separator.figma.ts +2 -2
- package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu.figma.ts +2 -2
- package/src/components/ds-expandable-text-input/ds-expandable-text-input.figma.ts +2 -2
- package/src/components/ds-file-upload/components/file-upload-item/index.ts +0 -1
- package/src/components/ds-file-upload/ds-file-upload.figma.ts +2 -2
- package/src/components/ds-filter-status-icon/ds-filter-status-icon.figma.ts +2 -2
- package/src/components/ds-form-control/ds-form-control.figma.ts +2 -2
- package/src/components/ds-form-control/ds-form-control.tsx +15 -13
- package/src/components/ds-icon/figma/ds-icon-material.figma.batch.ts +1 -1
- package/src/components/ds-icon/figma/ds-icon-special.figma.batch.ts +1 -1
- package/src/components/ds-key-value-pair/ds-key-value-pair.figma.ts +2 -2
- package/src/components/ds-loader/ds-loader.figma.ts +2 -2
- package/src/components/ds-modal/ds-modal.tsx +10 -9
- package/src/components/ds-modal/figma/ds-modal-content.figma.ts +2 -2
- package/src/components/ds-modal/figma/ds-modal-footer.figma.ts +2 -2
- package/src/components/ds-modal/figma/ds-modal-header.figma.ts +2 -2
- package/src/components/ds-modal/figma/ds-modal.figma.ts +2 -2
- package/src/components/ds-number-input/ds-number-input.tsx +1 -0
- package/src/components/ds-panel/ds-panel.figma.ts +2 -2
- package/src/components/ds-popover/figma/ds-popover-content-item.figma.ts +2 -2
- package/src/components/ds-popover/figma/ds-popover-content.figma.ts +2 -2
- package/src/components/ds-popover/figma/ds-popover-footer.figma.ts +2 -2
- package/src/components/ds-popover/figma/ds-popover-header.figma.ts +2 -2
- package/src/components/ds-popover/figma/ds-popover.figma.ts +2 -2
- package/src/components/ds-progress-arc/ds-progress-arc.figma.ts +2 -2
- package/src/components/ds-progress-donut/ds-progress-donut.figma.ts +2 -2
- package/src/components/ds-progress-linear/ds-progress-linear.figma.ts +2 -2
- package/src/components/ds-progress-task-bar/ds-progress-task-bar.figma.ts +2 -2
- package/src/components/ds-radio-group/figma/ds-radio-group-item.figma.ts +2 -2
- package/src/components/ds-radio-group/figma/ds-radio-group.figma.ts +2 -2
- package/src/components/ds-segment-group/figma/ds-segment-group-item.figma.ts +2 -2
- package/src/components/ds-segment-group/figma/ds-segment-group.figma.ts +2 -2
- package/src/components/ds-select/ds-select.figma.ts +4 -3
- package/src/components/ds-select/ds-select.tsx +6 -1
- package/src/components/ds-select/ds-select.types.ts +2 -1
- package/src/components/ds-site-node/ds-site-node.figma.ts +2 -2
- package/src/components/ds-slider/ds-slider.figma.ts +29 -0
- package/src/components/ds-slider/ds-slider.module.scss +104 -0
- package/src/components/ds-slider/ds-slider.tsx +118 -0
- package/src/components/ds-slider/ds-slider.types.ts +102 -0
- package/src/components/ds-slider/ds-slider.utils.ts +14 -0
- package/src/components/ds-slider/index.ts +11 -0
- package/src/components/ds-smart-tabs/ds-smart-tabs.tsx +5 -4
- package/src/components/ds-smart-tabs/figma/ds-smart-tabs-tab.figma.ts +83 -0
- package/src/components/ds-smart-tabs/figma/ds-smart-tabs.figma.ts +23 -0
- package/src/components/ds-spinner/ds-spinner.figma.ts +2 -2
- package/src/components/ds-split-button/ds-split-button.figma.ts +2 -2
- package/src/components/ds-status-badge-v2/ds-status-badge-v2.figma.ts +2 -2
- package/src/components/ds-stepper/ds-stepper.figma.ts +2 -2
- package/src/components/ds-table/components/ds-table-group-header-cell/ds-table-group-header-cell.module.scss +5 -1
- package/src/components/ds-table/components/ds-table-group-header-cell/ds-table-group-header-cell.tsx +15 -3
- package/src/components/ds-table/components/ds-table-group-header-cell/index.ts +0 -1
- package/src/components/ds-table/components/ds-table-header/ds-table-header.module.scss +17 -3
- package/src/components/ds-table/components/ds-table-header/ds-table-header.tsx +30 -9
- package/src/components/ds-table/components/ds-table-resize-handle/ds-table-resize-handle.module.scss +23 -0
- package/src/components/ds-table/components/ds-table-resize-handle/ds-table-resize-handle.tsx +218 -0
- package/src/components/ds-table/components/ds-table-resize-handle/ds-table-resize-handle.types.ts +14 -0
- package/src/components/ds-table/components/ds-table-resize-handle/index.ts +1 -0
- package/src/components/ds-table/components/ds-table-resize-overlay/ds-table-resize-overlay.module.scss +18 -0
- package/src/components/ds-table/components/ds-table-resize-overlay/ds-table-resize-overlay.tsx +16 -0
- package/src/components/ds-table/components/ds-table-resize-overlay/ds-table-resize-overlay.types.ts +13 -0
- package/src/components/ds-table/components/ds-table-resize-overlay/index.ts +1 -0
- package/src/components/ds-table/components/ds-table-row/ds-table-row.module.scss +1 -1
- package/src/components/ds-table/components/ds-table-row/ds-table-row.tsx +9 -2
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.module.scss +2 -1
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.tsx +9 -2
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-checkbox.tsx +2 -2
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-date.tsx +2 -1
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-number.tsx +2 -1
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-select.tsx +2 -1
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-text.tsx +2 -1
- package/src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.tsx +12 -3
- package/src/components/ds-table/context/ds-table-context.tsx +208 -0
- package/src/components/ds-table/ds-table-defaults.ts +42 -0
- package/src/components/ds-table/ds-table.module.scss +19 -1
- package/src/components/ds-table/ds-table.tsx +163 -235
- package/src/components/ds-table/ds-table.types.ts +59 -47
- package/src/components/ds-table/figma/ds-table-expandable.figma.ts +2 -2
- package/src/components/ds-table/figma/ds-table.figma.ts +2 -2
- package/src/components/ds-table/grouping/utils/column-group.ts +7 -5
- package/src/components/ds-table/hooks/use-cell-editor.ts +5 -1
- package/src/components/ds-table/hooks/use-column-resize.ts +385 -0
- package/src/components/ds-table/hooks/use-editing-state.ts +190 -0
- package/src/components/ds-table/index.ts +1 -0
- package/src/components/ds-table/styles/_variables.scss +2 -1
- package/src/components/ds-table/utils/column-size-meta.augmentation.ts +16 -0
- package/src/components/ds-table/utils/column-size.ts +213 -10
- package/src/components/ds-table/utils/column-size.unit.test.ts +213 -0
- package/src/components/ds-table/utils/constants.ts +28 -0
- package/src/components/ds-table/utils/frozen-body.ts +33 -0
- package/src/components/ds-table/utils/frozen-body.unit.test.ts +44 -0
- package/src/components/ds-table/utils/table-api.ts +42 -0
- package/src/components/ds-table/utils/table-api.unit.test.ts +82 -0
- package/src/components/ds-table/utils/table-columns.tsx +119 -0
- package/src/components/ds-table/utils/table-columns.unit.test.ts +199 -0
- package/src/components/ds-tabs/figma/ds-tabs-tab-vertical.figma.ts +2 -2
- package/src/components/ds-tabs/figma/ds-tabs-tab.figma.ts +2 -2
- package/src/components/ds-tabs/figma/ds-tabs-vertical.figma.ts +2 -2
- package/src/components/ds-tabs/figma/ds-tabs.figma.ts +2 -2
- package/src/components/ds-tag/ds-tag.figma.ts +51 -0
- package/src/components/ds-tag-filter/ds-tag-filter.figma.ts +16 -0
- package/src/components/ds-text-input/ds-input-field-v02.figma.ts +31 -6
- package/src/components/ds-text-input/ds-text-input.figma.ts +5 -4
- package/src/components/ds-text-input/ds-text-input.tsx +1 -0
- package/src/components/ds-text-input/ds-text-input.types.ts +1 -1
- package/src/components/ds-time-picker/ds-time-picker.figma.ts +2 -2
- package/src/components/ds-toast/ds-toast.figma.ts +3 -3
- package/src/components/ds-toggle/ds-toggle.figma.ts +2 -2
- package/src/components/ds-tooltip/ds-tooltip.figma.ts +2 -2
- package/src/components/ds-tree/ds-tree.figma.ts +54 -0
- package/src/components/ds-tree/ds-tree.module.scss +2 -2
- package/src/components/ds-tree/ds-tree.tsx +6 -0
- package/src/components/ds-tree/ds-tree.types.ts +16 -0
- package/src/components/ds-typography/ds-typography.figma.ts +2 -2
- package/src/components/ds-user-card/ds-user-card.figma.ts +2 -2
- package/src/components/ds-vertical-tabs/ds-vertical-tabs.tsx +13 -6
- package/src/components/ds-workspace-layout/ds-workspace-layout.figma.ts +99 -0
- package/src/components/ds-workspace-layout/ds-workspace-layout.module.scss +1 -8
- package/src/components/ds-workspace-layout/ds-workspace-layout.tsx +11 -10
- package/src/index.ts +1 -0
- package/src/styles/_gradients.scss +19 -0
- package/src/styles/_root.scss +39 -15
- package/src/styles/_typography.scss +1 -0
- package/src/styles/shared/_input.scss +10 -0
- package/src/styles/styles.scss +1 -0
- package/src/components/ds-table/context/ds-table-context.ts +0 -112
|
@@ -16,7 +16,7 @@ const activeProp = active ? '' : ' active={false}';
|
|
|
16
16
|
|
|
17
17
|
export default {
|
|
18
18
|
example: figma.code`<DsFilterStatusIcon status="${status}"${activeProp} />`,
|
|
19
|
-
imports: ["import { DsFilterStatusIcon } from '@drivenets/design-system'"],
|
|
19
|
+
imports: ["import { DsFilterStatusIcon } from '@drivenets/design-system';"],
|
|
20
20
|
id: 'ds-filter-status-icon',
|
|
21
21
|
metadata: { nestable: true },
|
|
22
|
-
};
|
|
22
|
+
} satisfies figma.Template;
|
|
@@ -70,7 +70,7 @@ const formControlAttrs = [labelAttr, requiredAttr, hideLabelAttr, statusAttr, me
|
|
|
70
70
|
|
|
71
71
|
export default {
|
|
72
72
|
example: figma.code`<DsFormControl ${formControlAttrs}>${description}${child}</DsFormControl>`,
|
|
73
|
-
imports: ["import { DsFormControl } from '@drivenets/design-system'"],
|
|
73
|
+
imports: ["import { DsFormControl } from '@drivenets/design-system';"],
|
|
74
74
|
id: 'ds-form-control',
|
|
75
75
|
metadata: { nestable: false },
|
|
76
|
-
};
|
|
76
|
+
} satisfies figma.Template;
|
|
@@ -41,7 +41,7 @@ const DsFormControlDescription: React.FC<DsFormControlDescriptionProps> = ({ chi
|
|
|
41
41
|
return <div className={classNames(styles.description, className)}>{children}</div>;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
const
|
|
44
|
+
const DsFormControlRoot = ({
|
|
45
45
|
id,
|
|
46
46
|
status,
|
|
47
47
|
label,
|
|
@@ -96,18 +96,20 @@ const DsFormControl = ({
|
|
|
96
96
|
);
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
DsFormControl.NumberInput = controlify(DsNumberInput);
|
|
101
|
-
DsFormControl.PasswordInput = controlify(DsPasswordInput);
|
|
102
|
-
/** @deprecated DsDateInput is deprecated. Use DsDatePicker or DsDateRangePicker instead. */
|
|
103
|
-
DsFormControl.DateInput = controlify(DsDateInput);
|
|
104
|
-
DsFormControl.DatePicker = controlify(DsDatePicker);
|
|
105
|
-
DsFormControl.TimePicker = controlify(DsTimePicker);
|
|
106
|
-
DsFormControl.Textarea = controlify(DsTextarea);
|
|
107
|
-
DsFormControl.Select = controlify(DsSelect);
|
|
108
|
-
DsFormControl.Description = DsFormControlDescription;
|
|
99
|
+
DsFormControlDescription.displayName = 'DsFormControl.Description';
|
|
109
100
|
|
|
110
|
-
DsFormControl
|
|
111
|
-
|
|
101
|
+
const DsFormControl = Object.assign(DsFormControlRoot, {
|
|
102
|
+
displayName: 'DsFormControl',
|
|
103
|
+
TextInput: controlify(DsTextInput),
|
|
104
|
+
NumberInput: controlify(DsNumberInput),
|
|
105
|
+
PasswordInput: controlify(DsPasswordInput),
|
|
106
|
+
/** @deprecated DsDateInput is deprecated. Use DsDatePicker or DsDateRangePicker instead. */
|
|
107
|
+
DateInput: controlify(DsDateInput),
|
|
108
|
+
DatePicker: controlify(DsDatePicker),
|
|
109
|
+
TimePicker: controlify(DsTimePicker),
|
|
110
|
+
Textarea: controlify(DsTextarea),
|
|
111
|
+
Select: controlify(DsSelect),
|
|
112
|
+
Description: DsFormControlDescription,
|
|
113
|
+
});
|
|
112
114
|
|
|
113
115
|
export default DsFormControl;
|
|
@@ -4,7 +4,7 @@ const batch = figma.batch as { icon: string; filled: boolean; id: string };
|
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
example: figma.code`<DsIcon icon="${batch.icon}"${batch.filled ? ' filled' : ''} />`,
|
|
7
|
-
imports: ["import { DsIcon } from '@drivenets/design-system'"],
|
|
7
|
+
imports: ["import { DsIcon } from '@drivenets/design-system';"],
|
|
8
8
|
id: batch.id,
|
|
9
9
|
metadata: { nestable: true, props: { icon: batch.icon } },
|
|
10
10
|
};
|
|
@@ -12,7 +12,7 @@ export default {
|
|
|
12
12
|
example: icon
|
|
13
13
|
? figma.code`<DsIcon icon="${icon}" />`
|
|
14
14
|
: figma.code`{/* This icon is not available in @drivenets/design-system */}`,
|
|
15
|
-
imports: ["import { DsIcon } from '@drivenets/design-system'"],
|
|
15
|
+
imports: ["import { DsIcon } from '@drivenets/design-system';"],
|
|
16
16
|
id: batch.id,
|
|
17
17
|
metadata: { nestable: true, props: { icon } },
|
|
18
18
|
};
|
|
@@ -18,7 +18,7 @@ const orientation =
|
|
|
18
18
|
|
|
19
19
|
export default {
|
|
20
20
|
example: figma.code`<DsKeyValuePair keyLabel="Label" value="Value" orientation="${orientation}" />`,
|
|
21
|
-
imports: ["import { DsKeyValuePair } from '@drivenets/design-system'"],
|
|
21
|
+
imports: ["import { DsKeyValuePair } from '@drivenets/design-system';"],
|
|
22
22
|
id: 'ds-key-value-pair',
|
|
23
23
|
metadata: { nestable: true },
|
|
24
|
-
};
|
|
24
|
+
} satisfies figma.Template;
|
|
@@ -5,7 +5,7 @@ import figma from 'figma';
|
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
example: figma.code`<DsLoader />`,
|
|
8
|
-
imports: ["import { DsLoader } from '@drivenets/design-system'"],
|
|
8
|
+
imports: ["import { DsLoader } from '@drivenets/design-system';"],
|
|
9
9
|
id: 'ds-loader',
|
|
10
10
|
metadata: { nestable: true },
|
|
11
|
-
};
|
|
11
|
+
} satisfies figma.Template;
|
|
@@ -13,7 +13,7 @@ import { DsTypography } from '../ds-typography';
|
|
|
13
13
|
* Supports custom header, footer, and body content with grid-based sizing.
|
|
14
14
|
* Use columns prop to control modal width (1-12 grid columns).
|
|
15
15
|
*/
|
|
16
|
-
const
|
|
16
|
+
const DsModalRoot = ({
|
|
17
17
|
open,
|
|
18
18
|
columns = 6,
|
|
19
19
|
dividers = false,
|
|
@@ -145,13 +145,14 @@ Body.displayName = 'DsModal.Body';
|
|
|
145
145
|
Footer.displayName = 'DsModal.Footer';
|
|
146
146
|
Actions.displayName = 'DsModal.Actions';
|
|
147
147
|
|
|
148
|
-
DsModal
|
|
149
|
-
DsModal
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
148
|
+
const DsModal = Object.assign(DsModalRoot, {
|
|
149
|
+
displayName: 'DsModal',
|
|
150
|
+
Header,
|
|
151
|
+
Title,
|
|
152
|
+
CloseTrigger,
|
|
153
|
+
Body,
|
|
154
|
+
Footer,
|
|
155
|
+
Actions,
|
|
156
|
+
});
|
|
156
157
|
|
|
157
158
|
export default DsModal;
|
|
@@ -12,7 +12,7 @@ const content = instance.getSlot('Modal content slot');
|
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
14
|
example: figma.code`<DsModal.Body>${content}</DsModal.Body>`,
|
|
15
|
-
imports: ["import { DsModal } from '@drivenets/design-system'"],
|
|
15
|
+
imports: ["import { DsModal } from '@drivenets/design-system';"],
|
|
16
16
|
id: 'ds-modal-content',
|
|
17
17
|
metadata: { nestable: true },
|
|
18
|
-
};
|
|
18
|
+
} satisfies figma.Template;
|
|
@@ -13,7 +13,7 @@ const rightButtons = instance.getSlot('right side buttons');
|
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
15
|
example: figma.code`<DsModal.Footer><DsModal.Actions>${rightButtons}</DsModal.Actions></DsModal.Footer>`,
|
|
16
|
-
imports: ["import { DsModal } from '@drivenets/design-system'"],
|
|
16
|
+
imports: ["import { DsModal } from '@drivenets/design-system';"],
|
|
17
17
|
id: 'ds-modal-footer',
|
|
18
18
|
metadata: { nestable: true },
|
|
19
|
-
};
|
|
19
|
+
} satisfies figma.Template;
|
|
@@ -15,7 +15,7 @@ const title = titleNode.type === 'TEXT' ? titleNode.textContent : 'Modal title';
|
|
|
15
15
|
|
|
16
16
|
export default {
|
|
17
17
|
example: figma.code`<DsModal.Header><DsModal.Title>${title}</DsModal.Title><DsModal.CloseTrigger /></DsModal.Header>`,
|
|
18
|
-
imports: ["import { DsModal } from '@drivenets/design-system'"],
|
|
18
|
+
imports: ["import { DsModal } from '@drivenets/design-system';"],
|
|
19
19
|
id: 'ds-modal-header',
|
|
20
20
|
metadata: { nestable: true },
|
|
21
|
-
};
|
|
21
|
+
} satisfies figma.Template;
|
|
@@ -30,7 +30,7 @@ if (footer.type === 'INSTANCE') {
|
|
|
30
30
|
|
|
31
31
|
export default {
|
|
32
32
|
example: figma.code`<DsModal open columns={6} onOpenChange={() => {}}>${headerCode}${contentCode}${footerCode}</DsModal>`,
|
|
33
|
-
imports: ["import { DsModal } from '@drivenets/design-system'"],
|
|
33
|
+
imports: ["import { DsModal } from '@drivenets/design-system';"],
|
|
34
34
|
id: 'ds-modal',
|
|
35
35
|
metadata: { nestable: false },
|
|
36
|
-
};
|
|
36
|
+
} satisfies figma.Template;
|
|
@@ -10,7 +10,7 @@ const openAttr = open ? 'open' : 'open={false}';
|
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
12
|
example: figma.code`<DsPanel ${openAttr}>{/* panel content */}</DsPanel>`,
|
|
13
|
-
imports: ["import { DsPanel } from '@drivenets/design-system'"],
|
|
13
|
+
imports: ["import { DsPanel } from '@drivenets/design-system';"],
|
|
14
14
|
id: 'ds-panel',
|
|
15
15
|
metadata: { nestable: false },
|
|
16
|
-
};
|
|
16
|
+
} satisfies figma.Template;
|
|
@@ -12,7 +12,7 @@ const body = instance.getSlot('Slot');
|
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
14
|
example: figma.code`<DsPopover.ContentItem${headlineAttr}>${body}</DsPopover.ContentItem>`,
|
|
15
|
-
imports: ["import { DsPopover } from '@drivenets/design-system'"],
|
|
15
|
+
imports: ["import { DsPopover } from '@drivenets/design-system';"],
|
|
16
16
|
id: 'ds-popover-content-item',
|
|
17
17
|
metadata: { nestable: true },
|
|
18
|
-
};
|
|
18
|
+
} satisfies figma.Template;
|
|
@@ -9,7 +9,7 @@ const items = instance.getSlot('Slot');
|
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
11
|
example: figma.code`<DsPopover.Content>${items}</DsPopover.Content>`,
|
|
12
|
-
imports: ["import { DsPopover } from '@drivenets/design-system'"],
|
|
12
|
+
imports: ["import { DsPopover } from '@drivenets/design-system';"],
|
|
13
13
|
id: 'ds-popover-content',
|
|
14
14
|
metadata: { nestable: true },
|
|
15
|
-
};
|
|
15
|
+
} satisfies figma.Template;
|
|
@@ -13,7 +13,7 @@ if (button.type === 'INSTANCE') {
|
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
15
|
example: figma.code`<DsPopover.Footer>${buttonCode}</DsPopover.Footer>`,
|
|
16
|
-
imports: ["import { DsPopover } from '@drivenets/design-system'"],
|
|
16
|
+
imports: ["import { DsPopover } from '@drivenets/design-system';"],
|
|
17
17
|
id: 'ds-popover-footer',
|
|
18
18
|
metadata: { nestable: true },
|
|
19
|
-
};
|
|
19
|
+
} satisfies figma.Template;
|
|
@@ -10,7 +10,7 @@ const title = titleNode.type === 'TEXT' ? titleNode.textContent : 'Popover title
|
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
12
|
example: figma.code`<DsPopover.Header>${title}</DsPopover.Header>`,
|
|
13
|
-
imports: ["import { DsPopover } from '@drivenets/design-system'"],
|
|
13
|
+
imports: ["import { DsPopover } from '@drivenets/design-system';"],
|
|
14
14
|
id: 'ds-popover-header',
|
|
15
15
|
metadata: { nestable: true },
|
|
16
|
-
};
|
|
16
|
+
} satisfies figma.Template;
|
|
@@ -28,7 +28,7 @@ export default {
|
|
|
28
28
|
<DsPopover.Trigger>{/* trigger element */}</DsPopover.Trigger>
|
|
29
29
|
<DsPopover.Panel>${headerCode}${contentCode}${footerCode}</DsPopover.Panel>
|
|
30
30
|
</DsPopover.Root>`,
|
|
31
|
-
imports: ["import { DsPopover } from '@drivenets/design-system'"],
|
|
31
|
+
imports: ["import { DsPopover } from '@drivenets/design-system';"],
|
|
32
32
|
id: 'ds-popover',
|
|
33
33
|
metadata: { nestable: false },
|
|
34
|
-
};
|
|
34
|
+
} satisfies figma.Template;
|
|
@@ -17,7 +17,7 @@ const variant = instance.getEnum('State', {
|
|
|
17
17
|
|
|
18
18
|
export default {
|
|
19
19
|
example: figma.code`<DsProgressArc variant="${variant}" size="${size}" value={0} />`,
|
|
20
|
-
imports: ["import { DsProgressArc } from '@drivenets/design-system'"],
|
|
20
|
+
imports: ["import { DsProgressArc } from '@drivenets/design-system';"],
|
|
21
21
|
id: 'ds-progress-arc',
|
|
22
22
|
metadata: { nestable: false },
|
|
23
|
-
};
|
|
23
|
+
} satisfies figma.Template;
|
|
@@ -39,7 +39,7 @@ const valueProp = typeof value === 'number' ? ` value={${String(value)}}` : '';
|
|
|
39
39
|
|
|
40
40
|
export default {
|
|
41
41
|
example: figma.code`<DsProgressDonut variant="${variant}" size="${size}"${valueProp} />`,
|
|
42
|
-
imports: ["import { DsProgressDonut } from '@drivenets/design-system'"],
|
|
42
|
+
imports: ["import { DsProgressDonut } from '@drivenets/design-system';"],
|
|
43
43
|
id: 'ds-progress-donut',
|
|
44
44
|
metadata: { nestable: false },
|
|
45
|
-
};
|
|
45
|
+
} satisfies figma.Template;
|
|
@@ -20,7 +20,7 @@ const variant = instance.getEnum('Type', {
|
|
|
20
20
|
|
|
21
21
|
export default {
|
|
22
22
|
example: figma.code`<DsProgressLinear variant="${variant}" size="${size}" value={0} />`,
|
|
23
|
-
imports: ["import { DsProgressLinear } from '@drivenets/design-system'"],
|
|
23
|
+
imports: ["import { DsProgressLinear } from '@drivenets/design-system';"],
|
|
24
24
|
id: 'ds-progress-linear',
|
|
25
25
|
metadata: { nestable: false },
|
|
26
|
-
};
|
|
26
|
+
} satisfies figma.Template;
|
|
@@ -23,7 +23,7 @@ const attrs = [
|
|
|
23
23
|
|
|
24
24
|
export default {
|
|
25
25
|
example: zero ? figma.code`<DsProgressTaskBar total={999} />` : figma.code`<DsProgressTaskBar ${attrs} />`,
|
|
26
|
-
imports: ["import { DsProgressTaskBar } from '@drivenets/design-system'"],
|
|
26
|
+
imports: ["import { DsProgressTaskBar } from '@drivenets/design-system';"],
|
|
27
27
|
id: 'ds-progress-task-bar',
|
|
28
28
|
metadata: { nestable: false },
|
|
29
|
-
};
|
|
29
|
+
} satisfies figma.Template;
|
|
@@ -18,7 +18,7 @@ const attrs = ['value="option"', 'label="Option"', state === 'disabled' ? 'disab
|
|
|
18
18
|
|
|
19
19
|
export default {
|
|
20
20
|
example: figma.code`<DsRadioGroup.Item ${attrs} />`,
|
|
21
|
-
imports: ["import { DsRadioGroup } from '@drivenets/design-system'"],
|
|
21
|
+
imports: ["import { DsRadioGroup } from '@drivenets/design-system';"],
|
|
22
22
|
id: 'ds-radio-group-item',
|
|
23
23
|
metadata: { nestable: true },
|
|
24
|
-
};
|
|
24
|
+
} satisfies figma.Template;
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
<DsRadioGroup.Item value="option-1" label="Option 1" />
|
|
9
9
|
<DsRadioGroup.Item value="option-2" label="Option 2" />
|
|
10
10
|
</DsRadioGroup.Root>`,
|
|
11
|
-
imports: ["import { DsRadioGroup } from '@drivenets/design-system'"],
|
|
11
|
+
imports: ["import { DsRadioGroup } from '@drivenets/design-system';"],
|
|
12
12
|
id: 'ds-radio-group',
|
|
13
13
|
metadata: { nestable: false },
|
|
14
|
-
};
|
|
14
|
+
} satisfies figma.Template;
|
|
@@ -19,7 +19,7 @@ const attrs = ['value="option"', 'label="Option"', state === 'disabled' ? 'disab
|
|
|
19
19
|
|
|
20
20
|
export default {
|
|
21
21
|
example: figma.code`<DsSegmentGroup.Item ${attrs} />`,
|
|
22
|
-
imports: ["import { DsSegmentGroup } from '@drivenets/design-system'"],
|
|
22
|
+
imports: ["import { DsSegmentGroup } from '@drivenets/design-system';"],
|
|
23
23
|
id: 'ds-segment-group-item',
|
|
24
24
|
metadata: { nestable: true },
|
|
25
|
-
};
|
|
25
|
+
} satisfies figma.Template;
|
|
@@ -17,7 +17,7 @@ export default {
|
|
|
17
17
|
<DsSegmentGroup.Item value="option-1" label="Option 1" />
|
|
18
18
|
<DsSegmentGroup.Item value="option-2" label="Option 2" />
|
|
19
19
|
</DsSegmentGroup.Root>`,
|
|
20
|
-
imports: ["import { DsSegmentGroup } from '@drivenets/design-system'"],
|
|
20
|
+
imports: ["import { DsSegmentGroup } from '@drivenets/design-system';"],
|
|
21
21
|
id: 'ds-segment-group',
|
|
22
22
|
metadata: { nestable: false },
|
|
23
|
-
};
|
|
23
|
+
} satisfies figma.Template;
|
|
@@ -8,6 +8,7 @@ const instance = figma.selectedInstance;
|
|
|
8
8
|
const size = instance.getEnum('Size', {
|
|
9
9
|
Default: 'default',
|
|
10
10
|
Small: 'small',
|
|
11
|
+
Large: 'large',
|
|
11
12
|
});
|
|
12
13
|
|
|
13
14
|
const state = instance.getEnum('State', {
|
|
@@ -22,7 +23,7 @@ const state = instance.getEnum('State', {
|
|
|
22
23
|
|
|
23
24
|
const disabled = state === 'disable';
|
|
24
25
|
|
|
25
|
-
const sizeAttr = size === 'small' ?
|
|
26
|
+
const sizeAttr = size === 'small' || size === 'large' ? `size="${size}"` : '';
|
|
26
27
|
|
|
27
28
|
// Multi-select is driven by the nested dropdown menu's `Type` (Checkbox = multi). The menu
|
|
28
29
|
// lives inside the select tree even when collapsed, so the designer's intent is read in any
|
|
@@ -47,7 +48,7 @@ const attrs = [
|
|
|
47
48
|
|
|
48
49
|
export default {
|
|
49
50
|
example: figma.code`<DsSelect ${attrs} />`,
|
|
50
|
-
imports: ["import { DsSelect } from '@drivenets/design-system'"],
|
|
51
|
+
imports: ["import { DsSelect } from '@drivenets/design-system';"],
|
|
51
52
|
id: 'ds-select',
|
|
52
53
|
metadata: { nestable: true, props: { fcMember: 'Select', fcProps: attrs } },
|
|
53
|
-
};
|
|
54
|
+
} satisfies figma.Template;
|
|
@@ -135,7 +135,12 @@ const DsSelect = ({
|
|
|
135
135
|
lazyMount
|
|
136
136
|
>
|
|
137
137
|
<Select.Control
|
|
138
|
-
className={classNames(
|
|
138
|
+
className={classNames(
|
|
139
|
+
styles.control,
|
|
140
|
+
size === 'small' && styles.small,
|
|
141
|
+
size === 'large' && styles.large,
|
|
142
|
+
className,
|
|
143
|
+
)}
|
|
139
144
|
style={style}
|
|
140
145
|
onBlur={onBlur}
|
|
141
146
|
onKeyDown={(e) => {
|
|
@@ -2,7 +2,8 @@ import type React from 'react';
|
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import type { IconName } from '../ds-icon';
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export const selectSizes = ['small', 'default', 'large'] as const;
|
|
6
|
+
export type SelectSize = (typeof selectSizes)[number];
|
|
6
7
|
|
|
7
8
|
export interface DsSelectOption {
|
|
8
9
|
/**
|
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
state === 'overflow'
|
|
22
22
|
? figma.code`<DsSiteNode state="${state}" overflowLabel="${overflowLabel}" />`
|
|
23
23
|
: figma.code`<DsSiteNode state="${state}" tier="${tier}" siteCode="${siteCode}" />`,
|
|
24
|
-
imports: ["import { DsSiteNode } from '@drivenets/design-system'"],
|
|
24
|
+
imports: ["import { DsSiteNode } from '@drivenets/design-system';"],
|
|
25
25
|
id: 'ds-site-node',
|
|
26
26
|
metadata: { nestable: true },
|
|
27
|
-
};
|
|
27
|
+
} satisfies figma.Template;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=29879-165
|
|
2
|
+
// source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-slider
|
|
3
|
+
// component=DsSlider
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
|
|
6
|
+
const instance = figma.selectedInstance;
|
|
7
|
+
|
|
8
|
+
const type = instance.getEnum('type', {
|
|
9
|
+
value: 'value',
|
|
10
|
+
range: 'range',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const isRange = type === 'range';
|
|
14
|
+
|
|
15
|
+
const attrs = [
|
|
16
|
+
'label="Input label"',
|
|
17
|
+
isRange ? 'type="range"' : '',
|
|
18
|
+
isRange ? 'defaultValue={[36, 60]}' : 'defaultValue={36}',
|
|
19
|
+
isRange ? "thumbLabels={['Minimum', 'Maximum']}" : '',
|
|
20
|
+
]
|
|
21
|
+
.filter(Boolean)
|
|
22
|
+
.join(' ');
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
example: figma.code`<DsSlider ${attrs} />`,
|
|
26
|
+
imports: ["import { DsSlider } from '@drivenets/design-system';"],
|
|
27
|
+
id: 'ds-slider',
|
|
28
|
+
metadata: { nestable: false },
|
|
29
|
+
} satisfies figma.Template;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
--ds-slider-thumb-size: var(--md);
|
|
3
|
+
--ds-slider-thumb-size-active: var(--lg);
|
|
4
|
+
--ds-slider-thumb-border: 2px;
|
|
5
|
+
--ds-slider-thumb-border-active: 4px;
|
|
6
|
+
--ds-slider-track-height: 4px;
|
|
7
|
+
--ds-slider-focus-ring: 3px;
|
|
8
|
+
--ds-slider-radius: 9999px;
|
|
9
|
+
--ds-slider-transition: 0.2s;
|
|
10
|
+
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
gap: var(--sm);
|
|
14
|
+
width: 100%;
|
|
15
|
+
|
|
16
|
+
&.small {
|
|
17
|
+
--ds-slider-thumb-size: var(--standard);
|
|
18
|
+
--ds-slider-thumb-size-active: var(--md);
|
|
19
|
+
--ds-slider-track-height: 2px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.large {
|
|
23
|
+
--ds-slider-thumb-size: var(--lg);
|
|
24
|
+
--ds-slider-thumb-size-active: 28px;
|
|
25
|
+
--ds-slider-thumb-border: 3px;
|
|
26
|
+
--ds-slider-thumb-border-active: 5px;
|
|
27
|
+
--ds-slider-track-height: 8px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&[data-disabled] {
|
|
31
|
+
cursor: not-allowed;
|
|
32
|
+
|
|
33
|
+
.range {
|
|
34
|
+
background: var(--background-disable);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.thumb {
|
|
38
|
+
cursor: not-allowed;
|
|
39
|
+
border-color: var(--background-disable);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.header {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: space-between;
|
|
48
|
+
gap: var(--xs);
|
|
49
|
+
padding-bottom: var(--4xs);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.valueText {
|
|
53
|
+
margin-left: auto;
|
|
54
|
+
text-align: right;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.control {
|
|
58
|
+
position: relative;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
min-height: var(--ds-slider-thumb-size-active);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.track {
|
|
65
|
+
flex: 1;
|
|
66
|
+
height: var(--ds-slider-track-height);
|
|
67
|
+
background: var(--background-secondary-hover);
|
|
68
|
+
border-radius: var(--ds-slider-radius);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.range {
|
|
72
|
+
height: 100%;
|
|
73
|
+
background: var(--background-primary);
|
|
74
|
+
border-radius: var(--ds-slider-radius);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.thumb {
|
|
78
|
+
box-sizing: border-box;
|
|
79
|
+
width: var(--ds-slider-thumb-size);
|
|
80
|
+
height: var(--ds-slider-thumb-size);
|
|
81
|
+
background: var(--background);
|
|
82
|
+
border: var(--ds-slider-thumb-border) solid var(--background-primary);
|
|
83
|
+
border-radius: var(--ds-slider-radius);
|
|
84
|
+
outline: none;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
transition:
|
|
87
|
+
width var(--ds-slider-transition),
|
|
88
|
+
height var(--ds-slider-transition),
|
|
89
|
+
border-width var(--ds-slider-transition),
|
|
90
|
+
border-color var(--ds-slider-transition),
|
|
91
|
+
box-shadow var(--ds-slider-transition);
|
|
92
|
+
|
|
93
|
+
&:not([data-disabled]):hover,
|
|
94
|
+
&:focus-visible {
|
|
95
|
+
width: var(--ds-slider-thumb-size-active);
|
|
96
|
+
height: var(--ds-slider-thumb-size-active);
|
|
97
|
+
border-width: var(--ds-slider-thumb-border-active);
|
|
98
|
+
border-color: var(--background-primary-hover);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&:focus-visible {
|
|
102
|
+
box-shadow: 0 0 0 var(--ds-slider-focus-ring) var(--background-secondary-hover);
|
|
103
|
+
}
|
|
104
|
+
}
|