@drivenets/design-system 0.14.0 → 0.16.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 +32 -0
- package/README.md +1 -1
- package/dist/index.cjs +1239 -262
- package/dist/index.d.cts +904 -1169
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +904 -1169
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1221 -258
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +1 -1
- package/package.json +15 -12
- package/src/components/ds-alert-banner/ds-alert-banner.tsx +11 -2
- package/src/components/ds-autocomplete/ds-autocomplete.figma.ts +36 -0
- package/src/components/ds-autocomplete/ds-autocomplete.tsx +2 -0
- package/src/components/ds-avatar/ds-avatar.figma.ts +30 -0
- package/src/components/ds-avatar/ds-avatar.tsx +6 -1
- package/src/components/ds-avatar/ds-avatar.types.ts +5 -2
- package/src/components/ds-avatar-group/ds-avatar-group.figma.ts +27 -0
- package/src/components/ds-avatar-group/ds-avatar-group.tsx +6 -1
- package/src/components/ds-avatar-group/ds-avatar-group.types.ts +3 -1
- package/src/components/ds-breadcrumb/ds-breadcrumb.figma.ts +19 -0
- package/src/components/ds-breadcrumb/ds-breadcrumb.tsx +2 -0
- package/src/components/ds-button/ds-button.tsx +2 -0
- package/src/components/ds-button-v3/ds-button-v3.figma.ts +1 -1
- package/src/components/ds-button-v3/ds-button-v3.tsx +6 -0
- package/src/components/ds-button-v3/index.ts +2 -0
- package/src/components/ds-card/ds-card.tsx +7 -3
- package/src/components/ds-catalog-layout/ds-catalog-layout.tsx +8 -0
- package/src/components/ds-checkbox/ds-checkbox-level-2.figma.ts +40 -0
- package/src/components/ds-checkbox/ds-checkbox.figma.ts +45 -0
- package/src/components/ds-checkbox/ds-checkbox.module.scss +1 -1
- package/src/components/ds-checkbox/ds-checkbox.tsx +9 -1
- package/src/components/ds-checkbox-group/ds-checkbox-group.figma.ts +15 -0
- package/src/components/ds-checkbox-group/ds-checkbox-group.tsx +2 -0
- package/src/components/ds-chip/ds-chip.tsx +2 -0
- package/src/components/ds-chip-group/ds-chip-group.tsx +2 -0
- package/src/components/ds-comment-bubble/components/ds-comment-thread/ds-comment-thread.tsx +1 -0
- package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.tsx +1 -0
- package/src/components/ds-comment-bubble/ds-comment-bubble.tsx +1 -0
- package/src/components/ds-comment-card/ds-comment-card.tsx +1 -0
- package/src/components/ds-comment-indicator/ds-comment-indicator.tsx +1 -0
- package/src/components/ds-comments-drawer/ds-comments-drawer.tsx +1 -0
- package/src/components/ds-confirmation/ds-confirmation.tsx +1 -0
- package/src/components/ds-date-input/ds-date-input.tsx +2 -0
- package/src/components/ds-date-picker/ds-date-picker.tsx +9 -0
- package/src/components/ds-date-picker/ds-date-picker.types.ts +1 -1
- package/src/components/ds-date-range-picker/ds-date-range-picker.tsx +2 -0
- package/src/components/ds-dialog/ds-dialog.tsx +9 -0
- package/src/components/ds-dialog/ds-dialog.types.ts +1 -1
- package/src/components/ds-divider/ds-divider.figma.ts +19 -0
- package/src/components/ds-divider/ds-divider.tsx +2 -0
- package/src/components/ds-drawer/ds-drawer.module.scss +14 -0
- package/src/components/ds-drawer/ds-drawer.tsx +30 -1
- package/src/components/ds-drawer/ds-drawer.types.ts +7 -0
- package/src/components/ds-drawer/figma/ds-drawer-content.figma.ts +15 -0
- package/src/components/ds-drawer/figma/ds-drawer-footer.figma.ts +19 -0
- package/src/components/ds-drawer/figma/ds-drawer-header.figma.ts +16 -0
- package/src/components/ds-drawer/figma/ds-drawer.figma.ts +36 -0
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.module.scss +12 -3
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.tsx +24 -6
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.types.ts +10 -1
- package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-footer.figma.ts +11 -0
- package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-group.figma.ts +23 -0
- package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-item.figma.ts +29 -0
- package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu-separator.figma.ts +11 -0
- package/src/components/ds-dropdown-menu/figma/ds-dropdown-menu.figma.ts +24 -0
- package/src/components/ds-expandable-text-input/ds-expandable-text-input.figma.ts +24 -0
- package/src/components/ds-expandable-text-input/ds-expandable-text-input.tsx +1 -0
- package/src/components/ds-file-upload/ds-file-upload.figma.ts +29 -0
- package/src/components/ds-file-upload/ds-file-upload.tsx +2 -0
- package/src/components/ds-file-upload/hooks/use-file-upload.ts +7 -0
- package/src/components/ds-filter-status-icon/ds-filter-status-icon.figma.ts +22 -0
- package/src/components/ds-filter-status-icon/ds-filter-status-icon.tsx +1 -0
- package/src/components/ds-form-control/ds-form-control.tsx +3 -0
- package/src/components/ds-grid/index.ts +3 -0
- package/src/components/ds-icon/ds-icon.tsx +2 -0
- package/src/components/ds-key-value-pair/ds-key-value-pair.figma.ts +24 -0
- package/src/components/ds-key-value-pair/ds-key-value-pair.tsx +2 -0
- package/src/components/ds-loader/ds-loader.figma.ts +11 -0
- package/src/components/ds-loader/ds-loader.tsx +2 -0
- package/src/components/ds-modal/ds-modal.tsx +9 -0
- package/src/components/ds-number-input/ds-number-input.tsx +2 -0
- package/src/components/ds-panel/ds-panel.figma.ts +16 -0
- package/src/components/ds-panel/index.ts +2 -0
- package/src/components/ds-password-input/ds-password-input.tsx +2 -0
- package/src/components/ds-popover/ds-popover.tsx +9 -0
- package/src/components/ds-popover/figma/ds-popover-content-item.figma.ts +18 -0
- package/src/components/ds-popover/figma/ds-popover-content.figma.ts +15 -0
- package/src/components/ds-popover/figma/ds-popover-footer.figma.ts +19 -0
- package/src/components/ds-popover/figma/ds-popover-header.figma.ts +16 -0
- package/src/components/ds-popover/figma/ds-popover.figma.ts +34 -0
- package/src/components/ds-progress-arc/ds-progress-arc.figma.ts +23 -0
- package/src/components/ds-progress-arc/ds-progress-arc.tsx +2 -0
- package/src/components/ds-progress-donut/ds-progress-donut.figma.ts +45 -0
- package/src/components/ds-progress-donut/ds-progress-donut.tsx +2 -0
- package/src/components/ds-progress-linear/ds-progress-linear.figma.ts +26 -0
- package/src/components/ds-progress-linear/ds-progress-linear.tsx +2 -0
- package/src/components/ds-progress-task-bar/ds-progress-task-bar.figma.ts +29 -0
- package/src/components/ds-progress-task-bar/ds-progress-task-bar.module.scss +39 -0
- package/src/components/ds-progress-task-bar/ds-progress-task-bar.tsx +124 -0
- package/src/components/ds-progress-task-bar/ds-progress-task-bar.types.ts +65 -0
- package/src/components/ds-progress-task-bar/index.ts +2 -0
- package/src/components/ds-progress-task-bar/utils.ts +51 -0
- package/src/components/ds-radio-group/ds-radio-group.tsx +3 -0
- package/src/components/ds-radio-group/figma/ds-radio-group-item.figma.ts +24 -0
- package/src/components/ds-radio-group/figma/ds-radio-group.figma.ts +14 -0
- package/src/components/ds-segment-group/ds-segment-group.tsx +3 -0
- package/src/components/ds-segment-group/figma/ds-segment-group-item.figma.ts +25 -0
- package/src/components/ds-segment-group/figma/ds-segment-group.figma.ts +23 -0
- package/src/components/ds-select/ds-select.tsx +2 -0
- package/src/components/ds-site-node/ds-site-node.figma.ts +27 -0
- package/src/components/ds-site-node/ds-site-node.module.scss +59 -0
- package/src/components/ds-site-node/ds-site-node.tsx +73 -0
- package/src/components/ds-site-node/ds-site-node.types.ts +36 -0
- package/src/components/ds-site-node/hooks/use-is-overflowing.ts +31 -0
- package/src/components/ds-site-node/index.ts +3 -0
- package/src/components/ds-skeleton/ds-skeleton-circle.tsx +2 -0
- package/src/components/ds-skeleton/ds-skeleton-rect.tsx +2 -0
- package/src/components/ds-skeleton/ds-skeleton-text.tsx +2 -0
- package/src/components/ds-skeleton/ds-skeleton.ts +7 -1
- package/src/components/ds-smart-tabs/ds-smart-tabs.tsx +4 -0
- package/src/components/ds-spinner/ds-spinner.figma.ts +19 -0
- package/src/components/ds-spinner/ds-spinner.tsx +2 -0
- package/src/components/ds-split-button/ds-split-button.tsx +6 -0
- package/src/components/ds-status-badge/ds-status-badge.tsx +2 -0
- package/src/components/ds-status-badge-v2/index.ts +2 -0
- package/src/components/ds-stepper/components/ds-step-content.tsx +2 -0
- package/src/components/ds-stepper/components/ds-step-next-button.tsx +2 -0
- package/src/components/ds-stepper/components/ds-step.tsx +2 -0
- package/src/components/ds-stepper/ds-stepper.figma.ts +38 -0
- package/src/components/ds-stepper/ds-stepper.tsx +1 -0
- package/src/components/ds-system-status/ds-system-status.tsx +2 -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 +2 -0
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.module.scss +1 -1
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.tsx +2 -0
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-checkbox.tsx +1 -0
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-date.tsx +1 -0
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-number.tsx +1 -0
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-select.tsx +1 -0
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-text.tsx +1 -0
- package/src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.module.scss +14 -2
- package/src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.tsx +20 -0
- package/src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.tsx +1 -0
- package/src/components/ds-table/ds-table-column.types.ts +24 -0
- package/src/components/ds-table/ds-table.tsx +30 -4
- package/src/components/ds-table/ds-table.types.ts +7 -0
- package/src/components/ds-table/index.ts +4 -0
- package/src/components/ds-table/utils/constants.ts +5 -0
- package/src/components/ds-tabs/components/ds-tabs-content/ds-tabs-content.tsx +2 -0
- package/src/components/ds-tabs/components/ds-tabs-list/ds-tabs-list.tsx +2 -0
- package/src/components/ds-tabs/components/ds-tabs-tab/ds-tabs-tab.tsx +2 -0
- package/src/components/ds-tabs/ds-tabs.tsx +2 -0
- package/src/components/ds-tabs/figma/ds-tabs-tab-vertical.figma.ts +78 -0
- package/src/components/ds-tabs/figma/ds-tabs-tab.figma.ts +89 -0
- package/src/components/ds-tabs/figma/ds-tabs-vertical.figma.ts +31 -0
- package/src/components/ds-tabs/figma/ds-tabs.figma.ts +29 -0
- package/src/components/ds-tag/ds-tag.tsx +2 -0
- package/src/components/ds-tag-filter/ds-tag-filter.tsx +2 -0
- package/src/components/ds-text-input/ds-input-field-v02.figma.ts +87 -0
- package/src/components/ds-text-input/ds-text-input.tsx +2 -0
- package/src/components/ds-textarea/ds-textarea.tsx +2 -0
- package/src/components/ds-time-picker/ds-time-picker.tsx +2 -0
- package/src/components/ds-toast/ds-toast-context.tsx +1 -0
- package/src/components/ds-toast/ds-toast.figma.ts +34 -0
- package/src/components/ds-toast/ds-toast.tsx +3 -0
- package/src/components/ds-toggle/ds-toggle.figma.ts +39 -0
- package/src/components/ds-toggle/ds-toggle.tsx +2 -0
- package/src/components/ds-tooltip/ds-tooltip.figma.ts +16 -0
- package/src/components/ds-tooltip/ds-tooltip.module.scss +8 -1
- package/src/components/ds-tooltip/ds-tooltip.tsx +35 -15
- package/src/components/ds-tooltip/ds-tooltip.types.ts +40 -0
- package/src/components/ds-tree/ds-tree.tsx +16 -0
- package/src/components/ds-typography/ds-typography.config.ts +1 -1
- package/src/components/ds-typography/ds-typography.figma.ts +63 -0
- package/src/components/ds-typography/ds-typography.module.scss +16 -0
- package/src/components/ds-typography/ds-typography.tsx +64 -7
- package/src/components/ds-typography/ds-typography.types.ts +13 -0
- package/src/components/ds-typography/hooks/use-truncation.ts +151 -0
- package/src/components/ds-user-card/ds-user-card.figma.ts +16 -0
- package/src/components/ds-user-card/ds-user-card.module.scss +25 -0
- package/src/components/ds-user-card/ds-user-card.tsx +31 -0
- package/src/components/ds-user-card/ds-user-card.types.ts +26 -0
- package/src/components/ds-user-card/index.ts +2 -0
- package/src/components/ds-vertical-tabs/ds-vertical-tabs.tsx +6 -0
- package/src/components/ds-workspace-layout/ds-workspace-layout.tsx +10 -0
- package/src/index.ts +3 -0
- package/src/styles/_root.scss +468 -363
- package/src/styles/shared/_dropdown.scss +2 -2
- package/src/styles/styles.scss +0 -3
- package/src/styles/_colors.scss +0 -65
- package/src/styles/_root_new.scss +0 -451
- package/src/styles/_spacing.scss +0 -47
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=32934-446
|
|
2
|
+
// source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-radio-group
|
|
3
|
+
// component=DsRadioGroup.Item
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
|
|
6
|
+
const instance = figma.selectedInstance;
|
|
7
|
+
|
|
8
|
+
const state = instance.getEnum('state', {
|
|
9
|
+
default: 'default',
|
|
10
|
+
hover: 'hover',
|
|
11
|
+
focus: 'focus',
|
|
12
|
+
disabled: 'disabled',
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const attrs = ['value="option"', 'label="Option"', state === 'disabled' ? 'disabled' : '']
|
|
16
|
+
.filter(Boolean)
|
|
17
|
+
.join(' ');
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
example: figma.code`<DsRadioGroup.Item ${attrs} />`,
|
|
21
|
+
imports: ["import { DsRadioGroup } from '@drivenets/design-system'"],
|
|
22
|
+
id: 'ds-radio-group-item',
|
|
23
|
+
metadata: { nestable: true },
|
|
24
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=34864-124515
|
|
2
|
+
// source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-radio-group
|
|
3
|
+
// component=DsRadioGroup.Root
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
example: figma.code`<DsRadioGroup.Root>
|
|
8
|
+
<DsRadioGroup.Item value="option-1" label="Option 1" />
|
|
9
|
+
<DsRadioGroup.Item value="option-2" label="Option 2" />
|
|
10
|
+
</DsRadioGroup.Root>`,
|
|
11
|
+
imports: ["import { DsRadioGroup } from '@drivenets/design-system'"],
|
|
12
|
+
id: 'ds-radio-group',
|
|
13
|
+
metadata: { nestable: false },
|
|
14
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=15094-6249
|
|
2
|
+
// source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-segment-group
|
|
3
|
+
// component=DsSegmentGroup.Item
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
|
|
6
|
+
const instance = figma.selectedInstance;
|
|
7
|
+
|
|
8
|
+
const state = instance.getEnum('State', {
|
|
9
|
+
Default: 'default',
|
|
10
|
+
Hover: 'hover',
|
|
11
|
+
Pressed: 'pressed',
|
|
12
|
+
Focus: 'focus',
|
|
13
|
+
Disabled: 'disabled',
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const attrs = ['value="option"', 'label="Option"', state === 'disabled' ? 'disabled' : '']
|
|
17
|
+
.filter(Boolean)
|
|
18
|
+
.join(' ');
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
example: figma.code`<DsSegmentGroup.Item ${attrs} />`,
|
|
22
|
+
imports: ["import { DsSegmentGroup } from '@drivenets/design-system'"],
|
|
23
|
+
id: 'ds-segment-group-item',
|
|
24
|
+
metadata: { nestable: true },
|
|
25
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=15094-8569
|
|
2
|
+
// source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-segment-group
|
|
3
|
+
// component=DsSegmentGroup.Root
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
|
|
6
|
+
const instance = figma.selectedInstance;
|
|
7
|
+
|
|
8
|
+
const size = instance.getEnum('Size', {
|
|
9
|
+
medium: 'medium',
|
|
10
|
+
small: 'small',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const sizeAttr = size === 'small' ? ' size="small"' : '';
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
example: figma.code`<DsSegmentGroup.Root${sizeAttr}>
|
|
17
|
+
<DsSegmentGroup.Item value="option-1" label="Option 1" />
|
|
18
|
+
<DsSegmentGroup.Item value="option-2" label="Option 2" />
|
|
19
|
+
</DsSegmentGroup.Root>`,
|
|
20
|
+
imports: ["import { DsSegmentGroup } from '@drivenets/design-system'"],
|
|
21
|
+
id: 'ds-segment-group',
|
|
22
|
+
metadata: { nestable: false },
|
|
23
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=39525-181
|
|
2
|
+
// source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-site-node
|
|
3
|
+
// component=DsSiteNode
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
|
|
6
|
+
const instance = figma.selectedInstance;
|
|
7
|
+
|
|
8
|
+
const state = instance.getEnum('State', {
|
|
9
|
+
Default: 'default',
|
|
10
|
+
Selected: 'selected',
|
|
11
|
+
Muted: 'muted',
|
|
12
|
+
Overflow: 'overflow',
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const tier = instance.getString('Tier');
|
|
16
|
+
const siteCode = instance.getString('Site code');
|
|
17
|
+
const overflowLabel = instance.getString('Overflow label');
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
example:
|
|
21
|
+
state === 'overflow'
|
|
22
|
+
? figma.code`<DsSiteNode state="${state}" overflowLabel="${overflowLabel}" />`
|
|
23
|
+
: figma.code`<DsSiteNode state="${state}" tier="${tier}" siteCode="${siteCode}" />`,
|
|
24
|
+
imports: ["import { DsSiteNode } from '@drivenets/design-system'"],
|
|
25
|
+
id: 'ds-site-node',
|
|
26
|
+
metadata: { nestable: true },
|
|
27
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
$node-width: 140px;
|
|
2
|
+
$node-radius: 8px;
|
|
3
|
+
$overflow-height: 70px;
|
|
4
|
+
|
|
5
|
+
.node {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
width: $node-width;
|
|
12
|
+
padding: var(--sm);
|
|
13
|
+
gap: var(--2xs);
|
|
14
|
+
overflow: clip;
|
|
15
|
+
border: 1px solid var(--border-secondary);
|
|
16
|
+
border-radius: $node-radius;
|
|
17
|
+
background: var(--background);
|
|
18
|
+
font-family: var(--font-family-base);
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
appearance: none;
|
|
21
|
+
|
|
22
|
+
&:focus-visible {
|
|
23
|
+
outline: 2px solid var(--outline-moderate);
|
|
24
|
+
outline-offset: 2px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.selected {
|
|
29
|
+
border-color: var(--outline-moderate);
|
|
30
|
+
background: var(--background-info);
|
|
31
|
+
box-shadow: inset 0 0 0 1px var(--outline-moderate);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.overflow {
|
|
35
|
+
min-height: $overflow-height;
|
|
36
|
+
gap: 0;
|
|
37
|
+
border: 1px dashed var(--border-disabled);
|
|
38
|
+
background: var(--background-secondary-selected-weak);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.pill {
|
|
42
|
+
padding: var(--4xs) var(--xs);
|
|
43
|
+
overflow: clip;
|
|
44
|
+
border-radius: 9999px;
|
|
45
|
+
background: var(--background-primary);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.pillMuted {
|
|
49
|
+
background: var(--background-tertiary-selected-weak);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.siteCode {
|
|
53
|
+
display: block;
|
|
54
|
+
align-self: stretch;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
text-align: center;
|
|
57
|
+
text-overflow: ellipsis;
|
|
58
|
+
white-space: nowrap;
|
|
59
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import type { DsSiteNodeProps } from './ds-site-node.types';
|
|
3
|
+
import { useIsOverflowing } from './hooks/use-is-overflowing';
|
|
4
|
+
import { DsStack } from '../ds-stack';
|
|
5
|
+
import { DsTooltip } from '../ds-tooltip';
|
|
6
|
+
import { DsTypography } from '../ds-typography';
|
|
7
|
+
import styles from './ds-site-node.module.scss';
|
|
8
|
+
|
|
9
|
+
const DsSiteNode = ({
|
|
10
|
+
ref,
|
|
11
|
+
state = 'default',
|
|
12
|
+
tier,
|
|
13
|
+
siteCode,
|
|
14
|
+
overflowLabel,
|
|
15
|
+
className,
|
|
16
|
+
style,
|
|
17
|
+
'aria-label': ariaLabel,
|
|
18
|
+
onClick,
|
|
19
|
+
}: DsSiteNodeProps) => {
|
|
20
|
+
const isOverflow = state === 'overflow';
|
|
21
|
+
const isSelected = state === 'selected';
|
|
22
|
+
const isMuted = state === 'muted';
|
|
23
|
+
|
|
24
|
+
const { ref: siteCodeRef, isOverflowing } = useIsOverflowing<HTMLSpanElement>(siteCode);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<button
|
|
28
|
+
ref={ref}
|
|
29
|
+
type="button"
|
|
30
|
+
className={classNames(
|
|
31
|
+
styles.node,
|
|
32
|
+
{
|
|
33
|
+
[styles.selected]: isSelected,
|
|
34
|
+
[styles.overflow]: isOverflow,
|
|
35
|
+
},
|
|
36
|
+
className,
|
|
37
|
+
)}
|
|
38
|
+
style={style}
|
|
39
|
+
aria-label={ariaLabel}
|
|
40
|
+
aria-current={isSelected ? true : undefined}
|
|
41
|
+
onClick={onClick}
|
|
42
|
+
>
|
|
43
|
+
{isOverflow ? (
|
|
44
|
+
<DsTypography variant="body-sm-reg" color="secondary">
|
|
45
|
+
{overflowLabel}
|
|
46
|
+
</DsTypography>
|
|
47
|
+
) : (
|
|
48
|
+
<>
|
|
49
|
+
<DsStack
|
|
50
|
+
direction="row"
|
|
51
|
+
alignItems="center"
|
|
52
|
+
justifyContent="center"
|
|
53
|
+
className={classNames(styles.pill, { [styles.pillMuted]: isMuted })}
|
|
54
|
+
>
|
|
55
|
+
<DsTypography variant="body-xs-md" color={isMuted ? 'on-disabled' : 'on-action'}>
|
|
56
|
+
{tier}
|
|
57
|
+
</DsTypography>
|
|
58
|
+
</DsStack>
|
|
59
|
+
|
|
60
|
+
<span ref={siteCodeRef} className={styles.siteCode}>
|
|
61
|
+
<DsTooltip content={isOverflowing ? siteCode : undefined}>
|
|
62
|
+
<DsTypography variant="body-sm-bold" color={isSelected ? 'main' : 'secondary'}>
|
|
63
|
+
{siteCode}
|
|
64
|
+
</DsTypography>
|
|
65
|
+
</DsTooltip>
|
|
66
|
+
</span>
|
|
67
|
+
</>
|
|
68
|
+
)}
|
|
69
|
+
</button>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export default DsSiteNode;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { CSSProperties, MouseEvent, Ref } from 'react';
|
|
2
|
+
|
|
3
|
+
export const siteNodeStates = ['default', 'selected', 'muted', 'overflow'] as const;
|
|
4
|
+
export type SiteNodeState = (typeof siteNodeStates)[number];
|
|
5
|
+
|
|
6
|
+
export interface DsSiteNodeProps {
|
|
7
|
+
ref?: Ref<HTMLButtonElement>;
|
|
8
|
+
/**
|
|
9
|
+
* Scope/selection state within the site hierarchy path.
|
|
10
|
+
* `overflow` renders a collapsed summary node (no tier/site code).
|
|
11
|
+
*/
|
|
12
|
+
state?: SiteNodeState;
|
|
13
|
+
/**
|
|
14
|
+
* Short tier label shown in the pill, e.g. `"T1"`. Ignored when `state="overflow"`.
|
|
15
|
+
*/
|
|
16
|
+
tier?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Site identifier. Truncates with an ellipsis and reveals the full value in a
|
|
19
|
+
* tooltip when it overflows. Ignored when `state="overflow"`.
|
|
20
|
+
*/
|
|
21
|
+
siteCode?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Summary label for the collapsed branch, e.g. `"+2 more"`. Only used when
|
|
24
|
+
* `state="overflow"`.
|
|
25
|
+
*/
|
|
26
|
+
overflowLabel?: string;
|
|
27
|
+
className?: string;
|
|
28
|
+
style?: CSSProperties;
|
|
29
|
+
/**
|
|
30
|
+
* Overrides the accessible name. By default the node is named by its visible
|
|
31
|
+
* content (tier + site code, or the overflow label); set this to give the
|
|
32
|
+
* overflow node a more descriptive name, e.g. `"Show 2 more sites"`.
|
|
33
|
+
*/
|
|
34
|
+
'aria-label'?: string;
|
|
35
|
+
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useLayoutEffect, useRef, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
export const useIsOverflowing = <T extends HTMLElement = HTMLElement>(text: string | undefined) => {
|
|
4
|
+
const ref = useRef<T>(null);
|
|
5
|
+
const [isOverflowing, setIsOverflowing] = useState(false);
|
|
6
|
+
|
|
7
|
+
useLayoutEffect(() => {
|
|
8
|
+
const element = ref.current;
|
|
9
|
+
if (!element) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const measure = () => setIsOverflowing(element.scrollWidth > element.clientWidth);
|
|
14
|
+
measure();
|
|
15
|
+
|
|
16
|
+
const observer = new ResizeObserver(measure);
|
|
17
|
+
observer.observe(element);
|
|
18
|
+
|
|
19
|
+
const frame = requestAnimationFrame(measure);
|
|
20
|
+
document.fonts.ready.then(measure).catch(() => undefined);
|
|
21
|
+
document.fonts.addEventListener('loadingdone', measure);
|
|
22
|
+
|
|
23
|
+
return () => {
|
|
24
|
+
cancelAnimationFrame(frame);
|
|
25
|
+
observer.disconnect();
|
|
26
|
+
document.fonts.removeEventListener('loadingdone', measure);
|
|
27
|
+
};
|
|
28
|
+
}, [text]);
|
|
29
|
+
|
|
30
|
+
return { ref, isOverflowing };
|
|
31
|
+
};
|
|
@@ -2,8 +2,14 @@ import DsSkeletonText from './ds-skeleton-text';
|
|
|
2
2
|
import DsSkeletonCircle from './ds-skeleton-circle';
|
|
3
3
|
import DsSkeletonRect from './ds-skeleton-rect';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const DsSkeleton = {
|
|
6
6
|
Text: DsSkeletonText,
|
|
7
7
|
Circle: DsSkeletonCircle,
|
|
8
8
|
Rect: DsSkeletonRect,
|
|
9
9
|
};
|
|
10
|
+
|
|
11
|
+
DsSkeleton.Text.displayName = 'DsSkeleton.Text';
|
|
12
|
+
DsSkeleton.Circle.displayName = 'DsSkeleton.Circle';
|
|
13
|
+
DsSkeleton.Rect.displayName = 'DsSkeleton.Rect';
|
|
14
|
+
|
|
15
|
+
export default DsSkeleton;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=15119-13518
|
|
2
|
+
// source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-spinner
|
|
3
|
+
// component=DsSpinner
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
|
|
6
|
+
const instance = figma.selectedInstance;
|
|
7
|
+
|
|
8
|
+
const size = instance.getEnum('Size', {
|
|
9
|
+
SM: 'small',
|
|
10
|
+
Default: 'medium',
|
|
11
|
+
LG: 'large',
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
example: figma.code`<DsSpinner size="${size}" />`,
|
|
16
|
+
imports: ["import { DsSpinner } from '@drivenets/design-system'"],
|
|
17
|
+
id: 'ds-spinner',
|
|
18
|
+
metadata: { nestable: true },
|
|
19
|
+
};
|
|
@@ -4,6 +4,12 @@ import styles from './ds-split-button.module.scss';
|
|
|
4
4
|
import type { DsSplitButtonProps, SplitButtonSize } from './ds-split-button.types';
|
|
5
5
|
import { DsButtonV3 } from '../ds-button-v3';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Secondary action button paired with a dropdown select for choosing a related option.
|
|
9
|
+
* Both slots share a size and disabled state controlled by the split button.
|
|
10
|
+
*
|
|
11
|
+
* @summary split action button with a primary action and an option select
|
|
12
|
+
*/
|
|
7
13
|
const DsSplitButton = ({
|
|
8
14
|
ref,
|
|
9
15
|
className,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=29164-187694
|
|
2
|
+
// source=https://github.com/drivenets/design-system/tree/main/packages/design-system/src/components/ds-stepper
|
|
3
|
+
// component=DsStepper
|
|
4
|
+
//
|
|
5
|
+
// `direction` maps to `orientation`. Figma's `type` (detailed|compact) is not a code prop:
|
|
6
|
+
// detailed steps carry a `description` on each `DsStepContent`, compact steps omit it. The
|
|
7
|
+
// steps are composed in code (`DsStep` > `DsStepContent` > `DsNextStepButton`), not derivable
|
|
8
|
+
// from Figma's step atoms, and `count` is data — so a representative two-step composition is
|
|
9
|
+
// emitted for the developer to extend (one `DsStep` per step). The panel-docked wrappers
|
|
10
|
+
// (`DAP_stepper-panel-*_v01`) are a `DsPanel` composition and are intentionally not connected;
|
|
11
|
+
// the stepper still resolves when nested inside them.
|
|
12
|
+
import figma from 'figma';
|
|
13
|
+
|
|
14
|
+
const instance = figma.selectedInstance;
|
|
15
|
+
|
|
16
|
+
const orientation =
|
|
17
|
+
instance.getEnum('direction', {
|
|
18
|
+
vertical: 'vertical',
|
|
19
|
+
horizontal: 'horizontal',
|
|
20
|
+
}) ?? 'vertical';
|
|
21
|
+
|
|
22
|
+
const detailed = instance.getEnum('type', { detailed: true, compact: false }) ?? true;
|
|
23
|
+
const description = detailed ? ' description="Step description"' : '';
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
example: figma.code`<DsStepper count={2} orientation="${orientation}">
|
|
27
|
+
<DsStep index={0}>
|
|
28
|
+
<DsStepContent index={0} label="Step title"${description} actions={<DsNextStepButton>Next</DsNextStepButton>} />
|
|
29
|
+
</DsStep>
|
|
30
|
+
<DsStep index={1}>
|
|
31
|
+
<DsStepContent index={1} label="Step title"${description} actions={<DsNextStepButton>Finish</DsNextStepButton>} />
|
|
32
|
+
</DsStep>
|
|
33
|
+
{/* Add a <DsStep> per step */}
|
|
34
|
+
</DsStepper>`,
|
|
35
|
+
imports: ["import { DsStepper, DsStep, DsStepContent, DsNextStepButton } from '@drivenets/design-system'"],
|
|
36
|
+
id: 'ds-stepper',
|
|
37
|
+
metadata: { nestable: true },
|
|
38
|
+
};
|
|
@@ -51,6 +51,7 @@ const DsTableRow = <TData,>({ ref, row, isSelected }: DsTableRowProps<TData>) =>
|
|
|
51
51
|
primaryRowActions,
|
|
52
52
|
secondaryRowActions,
|
|
53
53
|
activeRowId,
|
|
54
|
+
loading,
|
|
54
55
|
} = useDsTableContext<TData, unknown>();
|
|
55
56
|
const isExpanded = row.getIsExpanded();
|
|
56
57
|
const isActive = activeRowId === row.id;
|
|
@@ -90,6 +91,7 @@ const DsTableRow = <TData,>({ ref, row, isSelected }: DsTableRowProps<TData>) =>
|
|
|
90
91
|
onRowClick && styles.clickableRow,
|
|
91
92
|
!bordered && styles.rowNoBorder,
|
|
92
93
|
isExpanded && styles.expanded,
|
|
94
|
+
loading && styles.loadingRow,
|
|
93
95
|
)}
|
|
94
96
|
style={rowStyle}
|
|
95
97
|
onClick={() => onRowClick?.(row.original)}
|
package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.tsx
CHANGED
|
@@ -26,6 +26,7 @@ export const DsTableRowVirtualized = <TData,>({
|
|
|
26
26
|
renderExpandedRow,
|
|
27
27
|
onRowClick,
|
|
28
28
|
onRowDoubleClick,
|
|
29
|
+
loading,
|
|
29
30
|
} = useDsTableContext<TData, unknown>();
|
|
30
31
|
const isExpanded = row.getIsExpanded();
|
|
31
32
|
const isActive = activeRowId === row.id;
|
|
@@ -58,6 +59,7 @@ export const DsTableRowVirtualized = <TData,>({
|
|
|
58
59
|
onRowClick && styles.clickableRow,
|
|
59
60
|
!bordered && styles.rowNoBorder,
|
|
60
61
|
isExpanded && styles.expanded,
|
|
62
|
+
loading && styles.loadingRow,
|
|
61
63
|
)}
|
|
62
64
|
onClick={isExpandedRowContent ? undefined : () => onRowClick?.(row.original)}
|
|
63
65
|
onDoubleClick={isExpandedRowContent ? undefined : () => onRowDoubleClick?.(row.original)}
|
|
@@ -11,18 +11,30 @@
|
|
|
11
11
|
outline: none;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.editButton
|
|
14
|
+
.editButton,
|
|
15
|
+
.lockIcon {
|
|
15
16
|
flex-shrink: 0;
|
|
16
17
|
opacity: 0;
|
|
17
18
|
pointer-events: none;
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
.lockIcon {
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
}
|
|
26
|
+
|
|
20
27
|
&:hover,
|
|
21
28
|
&:focus-within,
|
|
22
29
|
&[data-active] {
|
|
23
|
-
.editButton
|
|
30
|
+
.editButton,
|
|
31
|
+
.lockIcon {
|
|
24
32
|
opacity: 1;
|
|
25
33
|
pointer-events: auto;
|
|
26
34
|
}
|
|
27
35
|
}
|
|
36
|
+
|
|
37
|
+
&[data-locked] {
|
|
38
|
+
cursor: default;
|
|
39
|
+
}
|
|
28
40
|
}
|