@drivenets/design-system 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/LICENSE +201 -0
- package/dist/index.cjs +5394 -0
- package/dist/index.css +1 -0
- package/dist/index.d.cts +9157 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +9157 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5335 -0
- package/dist/index.js.map +1 -0
- package/package.json +104 -0
- package/src/components/ds-alert-banner/ds-alert-banner.module.scss +116 -0
- package/src/components/ds-alert-banner/ds-alert-banner.tsx +115 -0
- package/src/components/ds-alert-banner/ds-alert-banner.types.tsx +47 -0
- package/src/components/ds-alert-banner/index.tsx +2 -0
- package/src/components/ds-breadcrumb/ds-breadcrumb.module.scss +99 -0
- package/src/components/ds-breadcrumb/ds-breadcrumb.tsx +94 -0
- package/src/components/ds-breadcrumb/ds-breadcrumb.types.tsx +32 -0
- package/src/components/ds-breadcrumb/index.tsx +2 -0
- package/src/components/ds-button/ds-button.tsx +12 -0
- package/src/components/ds-button/ds-button.types.ts +6 -0
- package/src/components/ds-button/index.ts +2 -0
- package/src/components/ds-button/versions/ds-button-legacy/ds-button-legacy.module.scss +257 -0
- package/src/components/ds-button/versions/ds-button-legacy/ds-button-legacy.tsx +34 -0
- package/src/components/ds-button/versions/ds-button-legacy/ds-button-legacy.types.ts +41 -0
- package/src/components/ds-button/versions/ds-button-legacy/index.ts +2 -0
- package/src/components/ds-button/versions/ds-button-new/ds-button-new.module.scss +580 -0
- package/src/components/ds-button/versions/ds-button-new/ds-button-new.tsx +49 -0
- package/src/components/ds-button/versions/ds-button-new/ds-button-new.types.ts +41 -0
- package/src/components/ds-button/versions/ds-button-new/index.ts +2 -0
- package/src/components/ds-checkbox/ds-checkbox.module.scss +130 -0
- package/src/components/ds-checkbox/ds-checkbox.tsx +55 -0
- package/src/components/ds-checkbox/ds-checkbox.types.tsx +27 -0
- package/src/components/ds-checkbox/index.tsx +2 -0
- package/src/components/ds-chip/ds-chip.module.scss +71 -0
- package/src/components/ds-chip/ds-chip.tsx +73 -0
- package/src/components/ds-chip/ds-chip.types.tsx +46 -0
- package/src/components/ds-chip/index.tsx +2 -0
- package/src/components/ds-chip-group/ds-chip-group.module.scss +59 -0
- package/src/components/ds-chip-group/ds-chip-group.tsx +122 -0
- package/src/components/ds-chip-group/ds-chip-group.types.ts +52 -0
- package/src/components/ds-chip-group/hooks/use-chip-row-calculation.ts +76 -0
- package/src/components/ds-chip-group/index.ts +2 -0
- package/src/components/ds-confirmation/ds-confirmation.module.scss +58 -0
- package/src/components/ds-confirmation/ds-confirmation.tsx +121 -0
- package/src/components/ds-confirmation/ds-confirmation.types.tsx +28 -0
- package/src/components/ds-confirmation/index.ts +2 -0
- package/src/components/ds-dialog/ds-dialog.module.scss +50 -0
- package/src/components/ds-dialog/ds-dialog.tsx +70 -0
- package/src/components/ds-dialog/ds-dialog.types.tsx +48 -0
- package/src/components/ds-dialog/index.tsx +2 -0
- package/src/components/ds-drawer/ds-drawer.module.scss +212 -0
- package/src/components/ds-drawer/ds-drawer.tsx +160 -0
- package/src/components/ds-drawer/ds-drawer.types.tsx +54 -0
- package/src/components/ds-drawer/index.ts +2 -0
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.module.scss +123 -0
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.tsx +396 -0
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.types.tsx +262 -0
- package/src/components/ds-dropdown-menu/index.tsx +2 -0
- package/src/components/ds-expandable-text-input/ds-expandable-text-input.module.scss +70 -0
- package/src/components/ds-expandable-text-input/ds-expandable-text-input.tsx +106 -0
- package/src/components/ds-expandable-text-input/ds-expandable-text-input.types.tsx +19 -0
- package/src/components/ds-expandable-text-input/index.ts +2 -0
- package/src/components/ds-file-upload/components/file-upload/file-upload.module.scss +90 -0
- package/src/components/ds-file-upload/components/file-upload/file-upload.tsx +106 -0
- package/src/components/ds-file-upload/components/file-upload/file-upload.types.tsx +94 -0
- package/src/components/ds-file-upload/components/file-upload/index.ts +2 -0
- package/src/components/ds-file-upload/components/file-upload-item/file-upload-item.module.scss +125 -0
- package/src/components/ds-file-upload/components/file-upload-item/file-upload-item.tsx +143 -0
- package/src/components/ds-file-upload/components/file-upload-item/file-upload-item.types.tsx +26 -0
- package/src/components/ds-file-upload/components/file-upload-item/index.ts +2 -0
- package/src/components/ds-file-upload/ds-file-upload-api.types.ts +38 -0
- package/src/components/ds-file-upload/ds-file-upload.tsx +46 -0
- package/src/components/ds-file-upload/ds-file-upload.types.tsx +54 -0
- package/src/components/ds-file-upload/errors/file-upload-errors.ts +27 -0
- package/src/components/ds-file-upload/hooks/index.ts +2 -0
- package/src/components/ds-file-upload/hooks/use-file-upload.ts +350 -0
- package/src/components/ds-file-upload/index.ts +7 -0
- package/src/components/ds-file-upload/types/accept-types.ts +106 -0
- package/src/components/ds-file-upload/utils/accept-utils.ts +25 -0
- package/src/components/ds-file-upload/utils/constants.ts +21 -0
- package/src/components/ds-file-upload/utils/file-factory.ts +18 -0
- package/src/components/ds-file-upload/utils/format-file-size.ts +15 -0
- package/src/components/ds-file-upload/utils/generate-helper-text.ts +39 -0
- package/src/components/ds-file-upload/utils/get-error-message.ts +17 -0
- package/src/components/ds-file-upload/utils/is-file-equal.ts +8 -0
- package/src/components/ds-form-control/ds-form-control.module.scss +135 -0
- package/src/components/ds-form-control/ds-form-control.tsx +94 -0
- package/src/components/ds-form-control/ds-form-control.types.tsx +58 -0
- package/src/components/ds-form-control/index.tsx +2 -0
- package/src/components/ds-grid/ds-grid.module.scss +0 -0
- package/src/components/ds-grid/ds-grid.tsx +43 -0
- package/src/components/ds-grid/ds-grid.types.ts +55 -0
- package/src/components/ds-grid/index.ts +2 -0
- package/src/components/ds-icon/ds-icon.module.scss +25 -0
- package/src/components/ds-icon/ds-icon.tsx +33 -0
- package/src/components/ds-icon/ds-icon.types.ts +53 -0
- package/src/components/ds-icon/index.ts +2 -0
- package/src/components/ds-icon/material-icons.ts +6203 -0
- package/src/components/ds-modal/ds-modal.module.scss +100 -0
- package/src/components/ds-modal/ds-modal.tsx +136 -0
- package/src/components/ds-modal/ds-modal.types.tsx +44 -0
- package/src/components/ds-modal/index.tsx +2 -0
- package/src/components/ds-number-input/ds-number-input.module.scss +15 -0
- package/src/components/ds-number-input/ds-number-input.tsx +74 -0
- package/src/components/ds-number-input/ds-number-input.types.tsx +76 -0
- package/src/components/ds-number-input/index.tsx +2 -0
- package/src/components/ds-panel/ds-panel.module.scss +95 -0
- package/src/components/ds-panel/ds-panel.tsx +46 -0
- package/src/components/ds-panel/ds-panel.types.ts +17 -0
- package/src/components/ds-panel/index.tsx +2 -0
- package/src/components/ds-password-input/ds-password-input.module.scss +10 -0
- package/src/components/ds-password-input/ds-password-input.tsx +67 -0
- package/src/components/ds-password-input/ds-password-input.types.tsx +62 -0
- package/src/components/ds-password-input/index.tsx +2 -0
- package/src/components/ds-popover/ds-popover.module.scss +23 -0
- package/src/components/ds-popover/ds-popover.tsx +33 -0
- package/src/components/ds-popover/ds-popover.types.tsx +24 -0
- package/src/components/ds-popover/index.tsx +2 -0
- package/src/components/ds-radio-group/ds-radio-group.module.scss +138 -0
- package/src/components/ds-radio-group/ds-radio-group.tsx +115 -0
- package/src/components/ds-radio-group/ds-radio-group.types.tsx +93 -0
- package/src/components/ds-radio-group/index.tsx +2 -0
- package/src/components/ds-select/ds-select.module.scss +66 -0
- package/src/components/ds-select/ds-select.tsx +239 -0
- package/src/components/ds-select/ds-select.types.tsx +80 -0
- package/src/components/ds-select/index.tsx +2 -0
- package/src/components/ds-select/select-items-chips.tsx +56 -0
- package/src/components/ds-smart-tabs/ds-smart-tabs.module.scss +69 -0
- package/src/components/ds-smart-tabs/ds-smart-tabs.tsx +113 -0
- package/src/components/ds-smart-tabs/ds-smart-tabs.types.tsx +74 -0
- package/src/components/ds-smart-tabs/index.tsx +2 -0
- package/src/components/ds-spinner/ds-spinner.module.scss +39 -0
- package/src/components/ds-spinner/ds-spinner.tsx +51 -0
- package/src/components/ds-spinner/ds-spinner.types.tsx +20 -0
- package/src/components/ds-spinner/index.tsx +2 -0
- package/src/components/ds-status-badge/ds-status-badge.module.scss +79 -0
- package/src/components/ds-status-badge/ds-status-badge.tsx +42 -0
- package/src/components/ds-status-badge/ds-status-badge.types.tsx +46 -0
- package/src/components/ds-status-badge/index.tsx +2 -0
- package/src/components/ds-stepper/components/ds-step-content.tsx +32 -0
- package/src/components/ds-stepper/components/ds-step-description.tsx +6 -0
- package/src/components/ds-stepper/components/ds-step-label.tsx +6 -0
- package/src/components/ds-stepper/components/ds-step-next-button.tsx +13 -0
- package/src/components/ds-stepper/components/ds-step.tsx +59 -0
- package/src/components/ds-stepper/ds-stepper.module.scss +134 -0
- package/src/components/ds-stepper/ds-stepper.tsx +34 -0
- package/src/components/ds-stepper/ds-stepper.types.ts +12 -0
- package/src/components/ds-stepper/hooks/use-stepper.ts +20 -0
- package/src/components/ds-stepper/hooks/use-steps.ts +18 -0
- package/src/components/ds-stepper/index.tsx +6 -0
- package/src/components/ds-system-status/ds-system-status.module.scss +87 -0
- package/src/components/ds-system-status/ds-system-status.tsx +33 -0
- package/src/components/ds-system-status/ds-system-status.types.tsx +37 -0
- package/src/components/ds-system-status/index.tsx +10 -0
- package/src/components/ds-table/components/core-table/core-table.module.scss +32 -0
- package/src/components/ds-table/components/core-table/core-table.tsx +83 -0
- package/src/components/ds-table/components/core-table/index.ts +1 -0
- package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.module.scss +115 -0
- package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.tsx +70 -0
- package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.types.ts +41 -0
- package/src/components/ds-table/components/ds-table-bulk-actions/index.ts +2 -0
- package/src/components/ds-table/components/ds-table-cell/ds-table-cell.module.scss +53 -0
- package/src/components/ds-table/components/ds-table-cell/ds-table-cell.tsx +95 -0
- package/src/components/ds-table/components/ds-table-cell/ds-table-cell.types.ts +67 -0
- package/src/components/ds-table/components/ds-table-cell/index.ts +2 -0
- package/src/components/ds-table/components/ds-table-header/ds-table-header.module.scss +81 -0
- package/src/components/ds-table/components/ds-table-header/ds-table-header.tsx +99 -0
- package/src/components/ds-table/components/ds-table-header/ds-table-header.types.ts +11 -0
- package/src/components/ds-table/components/ds-table-header/index.ts +2 -0
- package/src/components/ds-table/components/ds-table-row/ds-table-row.module.scss +137 -0
- package/src/components/ds-table/components/ds-table-row/ds-table-row.tsx +205 -0
- package/src/components/ds-table/components/ds-table-row/ds-table-row.types.ts +22 -0
- package/src/components/ds-table/components/ds-table-row/index.ts +2 -0
- package/src/components/ds-table/context/ds-table-context.tsx +39 -0
- package/src/components/ds-table/ds-table.module.scss +60 -0
- package/src/components/ds-table/ds-table.tsx +312 -0
- package/src/components/ds-table/ds-table.types.ts +377 -0
- package/src/components/ds-table/filters/adapters/create-checkbox-filter-adapter.tsx +116 -0
- package/src/components/ds-table/filters/adapters/create-dual-range-filter-adapter.tsx +171 -0
- package/src/components/ds-table/filters/adapters/create-filter-adapter.ts +131 -0
- package/src/components/ds-table/filters/adapters/index.ts +12 -0
- package/src/components/ds-table/filters/components/checkbox-filter/checkbox-filter.tsx +43 -0
- package/src/components/ds-table/filters/components/checkbox-filter/index.ts +2 -0
- package/src/components/ds-table/filters/components/range-filter/index.ts +2 -0
- package/src/components/ds-table/filters/components/range-filter/range-filter.module.scss +25 -0
- package/src/components/ds-table/filters/components/range-filter/range-filter.tsx +79 -0
- package/src/components/ds-table/filters/hooks/index.ts +1 -0
- package/src/components/ds-table/filters/hooks/use-table-filters.ts +234 -0
- package/src/components/ds-table/filters/index.ts +50 -0
- package/src/components/ds-table/filters/types/filter-adapter.types.ts +111 -0
- package/src/components/ds-table/hooks/use-drag-and-drop.tsx +107 -0
- package/src/components/ds-table/index.ts +4 -0
- package/src/components/ds-table/styles/_variables.scss +17 -0
- package/src/components/ds-table/styles/shared/ds-table-shared.module.scss +16 -0
- package/src/components/ds-table/utils/column-styling.ts +30 -0
- package/src/components/ds-table/utils/create-columns-grid-template.ts +23 -0
- package/src/components/ds-table/utils/merge-refs.ts +15 -0
- package/src/components/ds-table/utils/story-data-generator.ts +91 -0
- package/src/components/ds-text-input/ds-text-input.module.scss +27 -0
- package/src/components/ds-text-input/ds-text-input.tsx +75 -0
- package/src/components/ds-text-input/ds-text-input.types.tsx +110 -0
- package/src/components/ds-text-input/index.ts +2 -0
- package/src/components/ds-textarea/ds-textarea.module.scss +5 -0
- package/src/components/ds-textarea/ds-textarea.tsx +49 -0
- package/src/components/ds-textarea/ds-textarea.types.tsx +67 -0
- package/src/components/ds-textarea/index.tsx +2 -0
- package/src/components/ds-toast/ds-toast-context.tsx +79 -0
- package/src/components/ds-toast/ds-toast.module.scss +134 -0
- package/src/components/ds-toast/ds-toast.tsx +54 -0
- package/src/components/ds-toast/ds-toast.types.tsx +53 -0
- package/src/components/ds-toast/index.ts +3 -0
- package/src/components/ds-tooltip/ds-tooltip.module.scss +19 -0
- package/src/components/ds-tooltip/ds-tooltip.tsx +33 -0
- package/src/components/ds-tooltip/ds-tooltip.types.tsx +12 -0
- package/src/components/ds-tooltip/index.tsx +2 -0
- package/src/components/ds-typography/ds-typography.config.ts +32 -0
- package/src/components/ds-typography/ds-typography.module.scss +93 -0
- package/src/components/ds-typography/ds-typography.tsx +27 -0
- package/src/components/ds-typography/ds-typography.types.tsx +27 -0
- package/src/components/ds-typography/index.tsx +2 -0
- package/src/components/ds-vertical-tabs/ds-vertical-tabs.module.scss +60 -0
- package/src/components/ds-vertical-tabs/ds-vertical-tabs.tsx +80 -0
- package/src/components/ds-vertical-tabs/ds-vertical-tabs.types.ts +69 -0
- package/src/components/ds-vertical-tabs/index.ts +7 -0
- package/src/index.ts +34 -0
- package/src/styles/_colors.scss +65 -0
- package/src/styles/_grid.scss +111 -0
- package/src/styles/_mixin.scss +1 -0
- package/src/styles/_reset.scss +38 -0
- package/src/styles/_root.scss +390 -0
- package/src/styles/_scrollbars.scss +41 -0
- package/src/styles/_spacing.scss +47 -0
- package/src/styles/_typography.scss +301 -0
- package/src/styles/_utilities.scss +33 -0
- package/src/styles/_variables.scss +44 -0
- package/src/styles/mixins/_bounding-box.scss +53 -0
- package/src/styles/mixins/_list.scss +74 -0
- package/src/styles/shared/_dropdown.scss +89 -0
- package/src/styles/shared/_input.scss +365 -0
- package/src/styles/shared/_modal.scss +123 -0
- package/src/styles/styles.scss +12 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
@use '../../../../styles/typography';
|
|
2
|
+
|
|
3
|
+
$color-primary-default: var(--action-cta1);
|
|
4
|
+
$color-primary-hover: var(--action-hover-light);
|
|
5
|
+
$color-primary-active: var(--action-active-light);
|
|
6
|
+
$color-primary-disabled: var(--action-disabled);
|
|
7
|
+
|
|
8
|
+
$color-secondary-default: var(--action-cta3);
|
|
9
|
+
$color-secondary-hover: var(--neutral-4);
|
|
10
|
+
$color-secondary-disabled: var(--action-disabled);
|
|
11
|
+
|
|
12
|
+
$color-error-default: var(--system-status-error);
|
|
13
|
+
$color-error-hover: var(--utility-error);
|
|
14
|
+
$color-error-active: var(--utility-error);
|
|
15
|
+
$color-error-disabled: var(--action-disabled);
|
|
16
|
+
|
|
17
|
+
$color-white: var(--white);
|
|
18
|
+
$color-neutral-6: var(--utility-disabled);
|
|
19
|
+
$color-neutral-4: var(--neutral-4);
|
|
20
|
+
|
|
21
|
+
@mixin button-filled($background, $hover, $active, $disabled) {
|
|
22
|
+
background: $background;
|
|
23
|
+
color: $color-white;
|
|
24
|
+
|
|
25
|
+
&:disabled {
|
|
26
|
+
color: $color-neutral-6;
|
|
27
|
+
background: $disabled;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@mixin button-ghost($color, $hover, $active, $disabled) {
|
|
32
|
+
border: 2px solid $color;
|
|
33
|
+
color: $color;
|
|
34
|
+
|
|
35
|
+
&:disabled {
|
|
36
|
+
color: $disabled;
|
|
37
|
+
border-color: $disabled;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@mixin button-borderless($color, $hover, $active, $disabled) {
|
|
42
|
+
color: $color;
|
|
43
|
+
border: none;
|
|
44
|
+
|
|
45
|
+
&.content {
|
|
46
|
+
gap: 4px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:hover {
|
|
50
|
+
color: $hover;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:active {
|
|
54
|
+
color: $active;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:disabled {
|
|
58
|
+
color: $disabled;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@mixin button-round($background, $hover, $active, $disabled) {
|
|
63
|
+
@include button-filled($background, $hover, $active, $disabled);
|
|
64
|
+
border-radius: 32px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.button {
|
|
68
|
+
@include typography.regular;
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
border-radius: 4px;
|
|
73
|
+
white-space: nowrap;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
border: none;
|
|
76
|
+
padding: 0;
|
|
77
|
+
font: inherit;
|
|
78
|
+
background: none;
|
|
79
|
+
|
|
80
|
+
&:disabled {
|
|
81
|
+
cursor: not-allowed;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&:not(:disabled) {
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.content {
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
justify-content: center;
|
|
92
|
+
gap: 8px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&.small {
|
|
96
|
+
@include typography.p-base;
|
|
97
|
+
padding: 6px 12px;
|
|
98
|
+
|
|
99
|
+
.content {
|
|
100
|
+
gap: 6px;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&.medium {
|
|
105
|
+
@include typography.p-base;
|
|
106
|
+
@include typography.medium;
|
|
107
|
+
padding: 12px;
|
|
108
|
+
|
|
109
|
+
.content {
|
|
110
|
+
gap: 9px;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&.large {
|
|
115
|
+
@include typography.p-base;
|
|
116
|
+
@include typography.medium;
|
|
117
|
+
padding: 14px 12px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&.primary-filled {
|
|
121
|
+
@include button-filled(
|
|
122
|
+
$color-primary-default,
|
|
123
|
+
$color-primary-hover,
|
|
124
|
+
$color-primary-active,
|
|
125
|
+
$color-primary-disabled
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&.primary-ghost {
|
|
130
|
+
@include button-ghost(
|
|
131
|
+
$color-primary-default,
|
|
132
|
+
$color-primary-hover,
|
|
133
|
+
$color-primary-active,
|
|
134
|
+
$color-neutral-4
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&.primary-borderless {
|
|
139
|
+
@include button-borderless(
|
|
140
|
+
$color-primary-default,
|
|
141
|
+
$color-primary-hover,
|
|
142
|
+
$color-primary-active,
|
|
143
|
+
$color-primary-disabled
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&.primary-round {
|
|
148
|
+
@include button-round(
|
|
149
|
+
$color-primary-default,
|
|
150
|
+
$color-primary-hover,
|
|
151
|
+
$color-primary-active,
|
|
152
|
+
$color-primary-disabled
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&.primary-dashed {
|
|
157
|
+
@include button-ghost(
|
|
158
|
+
$color-primary-default,
|
|
159
|
+
$color-primary-hover,
|
|
160
|
+
$color-primary-active,
|
|
161
|
+
$color-neutral-4
|
|
162
|
+
);
|
|
163
|
+
border-style: dashed;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&.secondary-filled {
|
|
167
|
+
@include button-filled(
|
|
168
|
+
$color-secondary-default,
|
|
169
|
+
$color-secondary-hover,
|
|
170
|
+
$color-secondary-hover,
|
|
171
|
+
$color-secondary-disabled
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
&.secondary-ghost {
|
|
176
|
+
@include button-ghost(
|
|
177
|
+
$color-secondary-default,
|
|
178
|
+
$color-secondary-hover,
|
|
179
|
+
$color-secondary-hover,
|
|
180
|
+
$color-secondary-disabled
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
&.secondary-borderless {
|
|
185
|
+
@include button-borderless(
|
|
186
|
+
$color-secondary-default,
|
|
187
|
+
$color-secondary-hover,
|
|
188
|
+
$color-secondary-hover,
|
|
189
|
+
$color-secondary-disabled
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&.secondary-round {
|
|
194
|
+
@include button-round(
|
|
195
|
+
$color-secondary-default,
|
|
196
|
+
$color-secondary-hover,
|
|
197
|
+
$color-secondary-hover,
|
|
198
|
+
$color-secondary-disabled
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
&.secondary-dashed {
|
|
203
|
+
@include button-ghost(
|
|
204
|
+
$color-secondary-default,
|
|
205
|
+
$color-secondary-hover,
|
|
206
|
+
$color-secondary-hover,
|
|
207
|
+
$color-secondary-disabled
|
|
208
|
+
);
|
|
209
|
+
border-style: dashed;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&.error-filled {
|
|
213
|
+
@include button-filled(
|
|
214
|
+
$color-error-default,
|
|
215
|
+
$color-error-hover,
|
|
216
|
+
$color-error-active,
|
|
217
|
+
$color-error-disabled
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
&.error-ghost {
|
|
222
|
+
@include button-ghost(
|
|
223
|
+
$color-error-default,
|
|
224
|
+
$color-error-hover,
|
|
225
|
+
$color-error-active,
|
|
226
|
+
$color-error-disabled
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
&.error-borderless {
|
|
231
|
+
@include button-borderless(
|
|
232
|
+
$color-error-default,
|
|
233
|
+
$color-error-hover,
|
|
234
|
+
$color-error-active,
|
|
235
|
+
$color-error-disabled
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
&.error-round {
|
|
240
|
+
@include button-round(
|
|
241
|
+
$color-error-default,
|
|
242
|
+
$color-error-hover,
|
|
243
|
+
$color-error-active,
|
|
244
|
+
$color-error-disabled
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
&.error-dashed {
|
|
249
|
+
@include button-ghost(
|
|
250
|
+
$color-error-default,
|
|
251
|
+
$color-error-hover,
|
|
252
|
+
$color-error-active,
|
|
253
|
+
$color-error-disabled
|
|
254
|
+
);
|
|
255
|
+
border-style: dashed;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import styles from './ds-button-legacy.module.scss';
|
|
4
|
+
import type { DsButtonProps } from './ds-button-legacy.types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Design system Button component
|
|
8
|
+
*/
|
|
9
|
+
const DsButton: React.FC<DsButtonProps> = ({
|
|
10
|
+
schema = 'primary',
|
|
11
|
+
variant = 'filled',
|
|
12
|
+
size = 'medium',
|
|
13
|
+
disabled = false,
|
|
14
|
+
className,
|
|
15
|
+
contentClassName,
|
|
16
|
+
children,
|
|
17
|
+
...props
|
|
18
|
+
}) => {
|
|
19
|
+
const buttonClass = classNames(
|
|
20
|
+
styles.button,
|
|
21
|
+
styles[`${schema}-${variant}`],
|
|
22
|
+
styles[size],
|
|
23
|
+
{ [styles.disabled]: disabled },
|
|
24
|
+
className,
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<button type="button" className={buttonClass} disabled={disabled} {...props}>
|
|
29
|
+
<span className={classNames(styles.content, contentClassName)}>{children}</span>
|
|
30
|
+
</button>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default DsButton;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
|
|
3
|
+
export const buttonSchemas = ['primary', 'secondary', 'error'] as const;
|
|
4
|
+
export type ButtonSchema = (typeof buttonSchemas)[number];
|
|
5
|
+
|
|
6
|
+
export const buttonVariants = ['filled', 'ghost', 'borderless', 'round', 'dashed'] as const;
|
|
7
|
+
export type ButtonVariant = (typeof buttonVariants)[number];
|
|
8
|
+
|
|
9
|
+
export const buttonSizes = ['large', 'medium', 'small'] as const;
|
|
10
|
+
export type ButtonSize = (typeof buttonSizes)[number];
|
|
11
|
+
|
|
12
|
+
export interface DsButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
13
|
+
/**
|
|
14
|
+
* Color schema of the button
|
|
15
|
+
* @default 'primary'
|
|
16
|
+
*/
|
|
17
|
+
schema?: ButtonSchema;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Visual variant of the button
|
|
21
|
+
* @default 'filled'
|
|
22
|
+
*/
|
|
23
|
+
variant?: ButtonVariant;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Size of the button
|
|
27
|
+
* @default 'medium'
|
|
28
|
+
*/
|
|
29
|
+
size?: ButtonSize;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Whether the button is disabled
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Class name for the button content
|
|
39
|
+
*/
|
|
40
|
+
contentClassName?: string;
|
|
41
|
+
}
|