@drivenets/design-system 0.18.0 → 0.19.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 +26 -0
- package/dist/index.cjs +15850 -10821
- package/dist/index.d.cts +785 -239
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +785 -239
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15835 -10822
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +1 -1
- package/package.json +13 -13
- package/src/components/ds-bot-button/ds-bot-button.figma.ts +38 -0
- package/src/components/ds-bot-button/ds-bot-button.module.scss +41 -0
- package/src/components/ds-bot-button/ds-bot-button.tsx +48 -0
- package/src/components/ds-bot-button/ds-bot-button.types.ts +33 -0
- package/src/components/ds-bot-button/index.ts +2 -0
- package/src/components/ds-bot-button/net-gen-logo.tsx +46 -0
- package/src/components/ds-bulk-actions/components/action-button.tsx +42 -0
- package/src/components/ds-bulk-actions/components/menu-entries.tsx +76 -0
- package/src/components/ds-bulk-actions/components/overflow.tsx +75 -0
- package/src/components/ds-bulk-actions/ds-bulk-actions.figma.ts +28 -0
- package/src/components/ds-bulk-actions/ds-bulk-actions.module.scss +199 -0
- package/src/components/ds-bulk-actions/ds-bulk-actions.tsx +220 -0
- package/src/components/ds-bulk-actions/ds-bulk-actions.types.ts +170 -0
- package/src/components/ds-bulk-actions/ds-bulk-actions.unit.test.ts +195 -0
- package/src/components/ds-bulk-actions/ds-bulk-actions.utils.ts +91 -0
- package/src/components/ds-bulk-actions/ds-bulk-actions.utils.unit.test.ts +134 -0
- package/src/components/ds-bulk-actions/hooks/compute-bulk-actions-overflow.ts +85 -0
- package/src/components/ds-bulk-actions/hooks/use-bulk-actions-overflow.ts +153 -0
- package/src/components/ds-bulk-actions/index.ts +18 -0
- package/src/components/ds-button-v3/ds-button-v3.module.scss +2 -2
- package/src/components/ds-catalog-layout/ds-catalog-layout.figma.ts +1 -1
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.tsx +2 -0
- package/src/components/ds-empty-state/ds-empty-state.module.scss +16 -0
- package/src/components/ds-empty-state/ds-empty-state.tsx +45 -0
- package/src/components/ds-empty-state/ds-empty-state.types.ts +38 -0
- package/src/components/ds-empty-state/index.ts +3 -0
- package/src/components/ds-file-upload/ds-file-upload.tsx +4 -1
- package/src/components/ds-form-control/ds-form-control.tsx +18 -10
- package/src/components/ds-illustration/ds-illustration.figma.ts +34 -0
- package/src/components/ds-illustration/ds-illustration.module.scss +6 -0
- package/src/components/ds-illustration/ds-illustration.tsx +29 -0
- package/src/components/ds-illustration/ds-illustration.types.ts +45 -0
- package/src/components/ds-illustration/illustrations/configuration.tsx +51 -0
- package/src/components/ds-illustration/illustrations/device.tsx +133 -0
- package/src/components/ds-illustration/illustrations/done.tsx +107 -0
- package/src/components/{ds-catalog-layout/catalog-layout-empty-illustration.tsx → ds-illustration/illustrations/empty-inbox.tsx} +10 -14
- package/src/components/ds-illustration/illustrations/error.tsx +86 -0
- package/src/components/ds-illustration/illustrations/go-filter.tsx +51 -0
- package/src/components/ds-illustration/illustrations/illustration-clouds.tsx +10 -0
- package/src/components/ds-illustration/illustrations/index.ts +39 -0
- package/src/components/ds-illustration/illustrations/no-connection.tsx +54 -0
- package/src/components/ds-illustration/illustrations/no-credit-card.tsx +48 -0
- package/src/components/ds-illustration/illustrations/no-device.tsx +61 -0
- package/src/components/ds-illustration/illustrations/no-documents.tsx +52 -0
- package/src/components/ds-illustration/illustrations/no-gps.tsx +57 -0
- package/src/components/ds-illustration/illustrations/no-images.tsx +82 -0
- package/src/components/ds-illustration/illustrations/no-items-cart.tsx +86 -0
- package/src/components/ds-illustration/illustrations/no-messages.tsx +51 -0
- package/src/components/ds-illustration/illustrations/no-search-result.tsx +76 -0
- package/src/components/ds-illustration/illustrations/no-tasks.tsx +61 -0
- package/src/components/ds-illustration/illustrations/site.tsx +80 -0
- package/src/components/ds-illustration/index.ts +3 -0
- package/src/components/ds-main-menu/components/expanded-item/expanded-item.tsx +108 -0
- package/src/components/ds-main-menu/components/expanded-item/expanded-item.types.ts +8 -0
- package/src/components/ds-main-menu/components/expanded-item/index.ts +1 -0
- package/src/components/ds-main-menu/components/menu-graphic/index.ts +1 -0
- package/src/components/ds-main-menu/components/menu-graphic/menu-graphic.tsx +16 -0
- package/src/components/ds-main-menu/components/menu-graphic/menu-graphic.types.ts +7 -0
- package/src/components/ds-main-menu/components/tile-link/index.ts +1 -0
- package/src/components/ds-main-menu/components/tile-link/tile-link.tsx +85 -0
- package/src/components/ds-main-menu/components/tile-link/tile-link.types.ts +8 -0
- package/src/components/ds-main-menu/components/utility-link/index.ts +1 -0
- package/src/components/ds-main-menu/components/utility-link/utility-link.tsx +37 -0
- package/src/components/ds-main-menu/components/utility-link/utility-link.types.ts +7 -0
- package/src/components/ds-main-menu/ds-main-menu.figma.ts +17 -0
- package/src/components/ds-main-menu/ds-main-menu.module.scss +349 -0
- package/src/components/ds-main-menu/ds-main-menu.tsx +102 -0
- package/src/components/ds-main-menu/ds-main-menu.types.ts +86 -0
- package/src/components/ds-main-menu/ds-main-menu.utils.ts +40 -0
- package/src/components/ds-main-menu/index.ts +9 -0
- package/src/components/ds-modal/figma/ds-modal-footer.figma.ts +1 -1
- package/src/components/ds-popover/ds-popover.tsx +2 -1
- package/src/components/ds-popover/ds-popover.types.ts +7 -0
- package/src/components/ds-site-node/ds-site-node.tsx +2 -2
- package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.module.scss +12 -2
- package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.tsx +2 -3
- package/src/components/ds-table/components/ds-table-group-header-cell/ds-table-group-header-cell.module.scss +1 -6
- package/src/components/ds-table/components/ds-table-group-header-cell/ds-table-group-header-cell.tsx +6 -3
- package/src/components/ds-table/components/ds-table-header/ds-table-header.module.scss +18 -7
- package/src/components/ds-table/components/ds-table-header/ds-table-header.tsx +27 -21
- package/src/components/ds-table/components/ds-table-header-label.module.scss +12 -0
- package/src/components/ds-table/components/ds-table-header-label.tsx +28 -0
- package/src/components/ds-table/components/ds-table-row/ds-table-row.module.scss +0 -1
- package/src/components/ds-table/context/ds-table-context.tsx +8 -0
- package/src/components/ds-table/ds-table.module.scss +26 -16
- package/src/components/ds-table/ds-table.tsx +46 -14
- package/src/components/ds-table/ds-table.types.ts +33 -3
- package/src/components/ds-table/hooks/use-column-resize.ts +114 -11
- package/src/components/ds-table/hooks/use-scrollbar-spacer.ts +108 -0
- package/src/components/ds-table/hooks/use-scrollbar-spacer.unit.test.ts +26 -0
- package/src/components/ds-table/styles/_variables.scss +0 -2
- package/src/components/ds-table/utils/column-size.ts +274 -1
- package/src/components/ds-table/utils/column-size.unit.test.ts +157 -0
- package/src/components/ds-table/utils/constants.ts +13 -5
- package/src/components/ds-table/utils/table-columns.tsx +27 -13
- package/src/components/ds-table/utils/table-columns.unit.test.ts +44 -0
- package/src/components/ds-tag-filter/ds-tag-filter.module.scss +7 -35
- package/src/components/ds-tag-filter/ds-tag-filter.tsx +34 -57
- package/src/components/ds-tag-filter/ds-tag-filter.types.ts +2 -1
- package/src/components/ds-tag-filter/hooks/use-tag-overflow-calculation.ts +13 -18
- package/src/components/ds-toggle/ds-toggle.module.scss +18 -0
- package/src/components/ds-toggle/ds-toggle.tsx +15 -13
- package/src/components/ds-tooltip/ds-tooltip.tsx +6 -2
- package/src/components/ds-tooltip/ds-tooltip.types.ts +17 -0
- package/src/components/ds-top-bar-navigation/ds-top-bar-navigation.figma.ts +35 -0
- package/src/components/ds-top-bar-navigation/ds-top-bar-navigation.module.scss +150 -0
- package/src/components/ds-top-bar-navigation/ds-top-bar-navigation.tsx +161 -0
- package/src/components/ds-top-bar-navigation/ds-top-bar-navigation.types.ts +117 -0
- package/src/components/ds-top-bar-navigation/index.ts +2 -0
- package/src/index.ts +6 -0
- package/src/utils/use-is-horizontally-overflowing.ts +35 -0
- package/src/components/ds-site-node/hooks/use-is-overflowing.ts +0 -31
- package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.module.scss +0 -112
- package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.tsx +0 -67
- package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.types.ts +0 -41
- package/src/components/ds-table/components/ds-table-bulk-actions/index.ts +0 -2
package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.module.scss
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
@use '../../../../styles/typography';
|
|
2
|
-
|
|
3
|
-
.bulkActionsContainer {
|
|
4
|
-
position: absolute;
|
|
5
|
-
bottom: 20px;
|
|
6
|
-
left: 50%;
|
|
7
|
-
transform: translateX(-50%);
|
|
8
|
-
background-color: var(--color-dap-gray-050);
|
|
9
|
-
border-radius: 8px;
|
|
10
|
-
box-shadow: 0 4px 12px #0445cc66;
|
|
11
|
-
z-index: 1;
|
|
12
|
-
display: flex;
|
|
13
|
-
align-items: center;
|
|
14
|
-
border-radius: 8px;
|
|
15
|
-
overflow: hidden;
|
|
16
|
-
animation-duration: 0.3s;
|
|
17
|
-
animation-timing-function: ease-out;
|
|
18
|
-
animation-fill-mode: forwards;
|
|
19
|
-
|
|
20
|
-
&.entering {
|
|
21
|
-
animation-name: slideUpFadeIn;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&.exiting {
|
|
25
|
-
animation-name: slideDownFadeOut;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.bulkActionsContent {
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: center;
|
|
32
|
-
padding-right: 6px;
|
|
33
|
-
padding-left: 6px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.selectedCountContainer {
|
|
37
|
-
background-color: var(--color-dap-blue-600);
|
|
38
|
-
display: flex;
|
|
39
|
-
align-items: center;
|
|
40
|
-
padding: 6px 22px;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.selectedCountBadge {
|
|
44
|
-
color: var(--color-dap-gray-050);
|
|
45
|
-
margin: 0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.bulkActionsInfo {
|
|
49
|
-
color: var(--color-dap-gray-600);
|
|
50
|
-
text-wrap: nowrap;
|
|
51
|
-
padding-left: 8px;
|
|
52
|
-
padding-right: 56px;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.bulkActionsActions {
|
|
56
|
-
display: flex;
|
|
57
|
-
align-items: center;
|
|
58
|
-
gap: 8px;
|
|
59
|
-
|
|
60
|
-
> .actionButton {
|
|
61
|
-
display: flex;
|
|
62
|
-
flex-direction: column;
|
|
63
|
-
align-items: center;
|
|
64
|
-
justify-content: center;
|
|
65
|
-
gap: var(--3xs);
|
|
66
|
-
border-right: 1px solid var(--color-dap-gray-400);
|
|
67
|
-
width: 68px;
|
|
68
|
-
height: 48px;
|
|
69
|
-
border-radius: 0;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
> .actionButton:first-child {
|
|
73
|
-
border-left: 1px solid var(--color-dap-gray-400);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.escapeButtonContent {
|
|
78
|
-
display: flex;
|
|
79
|
-
flex-direction: column;
|
|
80
|
-
justify-content: center;
|
|
81
|
-
align-items: center;
|
|
82
|
-
color: var(--color-dap-gray-600);
|
|
83
|
-
gap: 2px !important;
|
|
84
|
-
width: 36px;
|
|
85
|
-
padding-left: 4px;
|
|
86
|
-
|
|
87
|
-
&:hover {
|
|
88
|
-
color: var(--color-dap-gray-500);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
@keyframes slideUpFadeIn {
|
|
93
|
-
0% {
|
|
94
|
-
opacity: 0;
|
|
95
|
-
transform: translate(-50%, 100%);
|
|
96
|
-
}
|
|
97
|
-
100% {
|
|
98
|
-
opacity: 1;
|
|
99
|
-
transform: translate(-50%, 0);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
@keyframes slideDownFadeOut {
|
|
104
|
-
0% {
|
|
105
|
-
opacity: 1;
|
|
106
|
-
transform: translate(-50%, 0);
|
|
107
|
-
}
|
|
108
|
-
100% {
|
|
109
|
-
opacity: 0;
|
|
110
|
-
transform: translate(-50%, 100%);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import classnames from 'classnames';
|
|
4
|
-
import { DsButton } from '../../../ds-button';
|
|
5
|
-
import { DsIcon } from '../../../ds-icon';
|
|
6
|
-
import styles from './ds-table-bulk-actions.module.scss';
|
|
7
|
-
import type { BulkActionsProps } from './ds-table-bulk-actions.types';
|
|
8
|
-
import { DsTypography } from '../../../ds-typography';
|
|
9
|
-
|
|
10
|
-
const DsTableBulkActions: React.FC<BulkActionsProps> = ({ numSelectedRows, actions, onClearSelection }) => {
|
|
11
|
-
const [isRendered, setIsRendered] = useState(false);
|
|
12
|
-
const [animationClass, setAnimationClass] = useState('');
|
|
13
|
-
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (numSelectedRows > 0) {
|
|
16
|
-
setIsRendered(true);
|
|
17
|
-
setAnimationClass(styles.entering);
|
|
18
|
-
} else if (isRendered) {
|
|
19
|
-
setAnimationClass(styles.exiting);
|
|
20
|
-
const timer = setTimeout(() => {
|
|
21
|
-
setIsRendered(false);
|
|
22
|
-
setAnimationClass('');
|
|
23
|
-
}, 300);
|
|
24
|
-
return () => clearTimeout(timer);
|
|
25
|
-
}
|
|
26
|
-
}, [numSelectedRows, isRendered]);
|
|
27
|
-
|
|
28
|
-
if (!isRendered) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<div className={classnames(styles.bulkActionsContainer, animationClass)}>
|
|
34
|
-
<div className={styles.selectedCountContainer}>
|
|
35
|
-
<DsTypography variant="heading1" className={styles.selectedCountBadge}>
|
|
36
|
-
{numSelectedRows}
|
|
37
|
-
</DsTypography>
|
|
38
|
-
</div>
|
|
39
|
-
<div className={styles.bulkActionsContent}>
|
|
40
|
-
<DsTypography variant="body-md-semi-bold" className={styles.bulkActionsInfo}>
|
|
41
|
-
Items selected
|
|
42
|
-
</DsTypography>
|
|
43
|
-
|
|
44
|
-
<div className={styles.bulkActionsActions}>
|
|
45
|
-
{actions.map((action, index) => (
|
|
46
|
-
<button key={index} type="button" className={styles.actionButton} onClick={action.onClick}>
|
|
47
|
-
<DsIcon icon={action.icon} />
|
|
48
|
-
<DsTypography variant="body-xs-md">{action.label}</DsTypography>
|
|
49
|
-
</button>
|
|
50
|
-
))}
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
<DsButton
|
|
54
|
-
variant="borderless"
|
|
55
|
-
size="small"
|
|
56
|
-
color="neutral-2"
|
|
57
|
-
contentClassName={styles.escapeButtonContent}
|
|
58
|
-
onClick={onClearSelection}
|
|
59
|
-
>
|
|
60
|
-
<DsIcon icon="close" />
|
|
61
|
-
</DsButton>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export default DsTableBulkActions;
|
package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.types.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { IconType } from '../../../ds-icon';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Represents a bulk action that can be performed on selected table rows
|
|
5
|
-
*/
|
|
6
|
-
export interface Action {
|
|
7
|
-
/**
|
|
8
|
-
* Icon to be displayed for the action
|
|
9
|
-
*/
|
|
10
|
-
icon: IconType;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Label text for the action
|
|
14
|
-
*/
|
|
15
|
-
label: string;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Function to be called when the action is clicked
|
|
19
|
-
*/
|
|
20
|
-
onClick: () => void;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Props for the bulk actions component
|
|
25
|
-
*/
|
|
26
|
-
export interface BulkActionsProps {
|
|
27
|
-
/**
|
|
28
|
-
* Number of rows currently selected in the table
|
|
29
|
-
*/
|
|
30
|
-
numSelectedRows: number;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Array of actions to be displayed in the bulk actions bar
|
|
34
|
-
*/
|
|
35
|
-
actions: Action[];
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Function to be called when the selection should be cleared
|
|
39
|
-
*/
|
|
40
|
-
onClearSelection: () => void;
|
|
41
|
-
}
|