@drivenets/design-system 0.19.0 → 0.20.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 +28 -0
- package/dist/index.cjs +12409 -10548
- package/dist/index.d.cts +678 -312
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +679 -313
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12404 -10550
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +1 -1
- package/package.json +29 -29
- package/src/components/ds-checkbox/ds-checkbox.figma.ts +3 -0
- package/src/components/ds-checkbox/ds-checkbox.module.scss +102 -20
- package/src/components/ds-checkbox/ds-checkbox.tsx +30 -2
- package/src/components/ds-checkbox/ds-checkbox.types.ts +10 -0
- package/src/components/ds-code-input/collapsed-code-field/collapsed-code-field.module.scss +169 -0
- package/src/components/ds-code-input/collapsed-code-field/collapsed-code-field.tsx +92 -0
- package/src/components/ds-code-input/collapsed-code-field/index.ts +1 -0
- package/src/components/ds-code-input/ds-code-input-panel/ds-code-input-panel.module.scss +110 -0
- package/src/components/ds-code-input/ds-code-input-panel/ds-code-input-panel.tsx +61 -0
- package/src/components/ds-code-input/ds-code-input-panel/index.ts +1 -0
- package/src/components/ds-code-input/ds-code-input.module.scss +25 -0
- package/src/components/ds-code-input/ds-code-input.tsx +401 -0
- package/src/components/ds-code-input/ds-code-input.types.ts +166 -0
- package/src/components/ds-code-input/ds-code-input.utils.ts +94 -0
- package/src/components/ds-code-input/ds-code-input.utils.unit.test.ts +166 -0
- package/src/components/ds-code-input/index.ts +2 -0
- package/src/components/ds-code-input/use-collapsed-viewport.ts +289 -0
- package/src/components/ds-code-input/use-editor-host.ts +87 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-builder/ds-filters-bar-builder.ts +11 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-builder/ds-filters-bar-builder.types.ts +41 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-builder/index.ts +1 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-clear-all.ts +11 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-conditions/ds-filters-bar-conditions.ts +11 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-conditions/ds-filters-bar-conditions.types.ts +30 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-conditions/index.ts +1 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-pinned.ts +31 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-query/ds-filters-bar-query.ts +11 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-query/ds-filters-bar-query.types.ts +22 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-query/index.ts +1 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-saved-filters.ts +19 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-search.ts +11 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-summary.ts +11 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-toolbar.ts +11 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-view-switch.ts +11 -0
- package/src/components/ds-filters-bar/components/ds-filters-bar-view.ts +11 -0
- package/src/components/ds-filters-bar/components/index.ts +11 -0
- package/src/components/ds-filters-bar/ds-filters-bar.context.ts +69 -0
- package/src/components/ds-filters-bar/ds-filters-bar.tsx +120 -0
- package/src/components/ds-filters-bar/ds-filters-bar.types.ts +440 -0
- package/src/components/ds-filters-bar/ds-filters-bar.unit.test.ts +216 -0
- package/src/components/ds-filters-bar/ds-filters-bar.utils.ts +141 -0
- package/src/components/ds-filters-bar/index.ts +1 -0
- package/src/components/ds-form-control/ds-form-control.module.scss +18 -0
- package/src/components/ds-form-control/ds-form-control.tsx +43 -9
- package/src/components/ds-form-control/ds-form-control.types.ts +2 -1
- package/src/components/ds-icon/custom-icons/index.ts +2 -0
- package/src/components/ds-icon/custom-icons/special-adv-filters.tsx +28 -0
- package/src/components/ds-pin-toggle/ds-pin-toggle.figma.ts +27 -0
- package/src/components/ds-pin-toggle/ds-pin-toggle.module.scss +41 -0
- package/src/components/ds-pin-toggle/ds-pin-toggle.tsx +43 -0
- package/src/components/ds-pin-toggle/ds-pin-toggle.types.ts +29 -0
- package/src/components/ds-pin-toggle/index.ts +2 -0
- package/src/components/ds-popover/components/popover-trigger/index.ts +1 -0
- package/src/components/ds-popover/components/popover-trigger/popover-trigger.tsx +15 -0
- package/src/components/ds-popover/ds-popover.context.ts +18 -0
- package/src/components/ds-popover/ds-popover.hover-intent.ts +65 -0
- package/src/components/ds-popover/ds-popover.tsx +163 -41
- package/src/components/ds-popover/ds-popover.types.ts +59 -1
- package/src/components/ds-popover/ds-popover.utils.ts +60 -0
- package/src/components/ds-popover/ds-popover.utils.unit.test.ts +25 -0
- package/src/components/ds-saved-filters/components/ds-saved-filters-delete-confirm.tsx +53 -0
- package/src/components/ds-saved-filters/components/ds-saved-filters-name-entry.tsx +64 -0
- package/src/components/ds-saved-filters/components/ds-saved-filters-name-modal.tsx +50 -0
- package/src/components/ds-saved-filters/components/ds-saved-filters-row/ds-saved-filters-row.module.scss +68 -0
- package/src/components/ds-saved-filters/components/ds-saved-filters-row/ds-saved-filters-row.tsx +83 -0
- package/src/components/ds-saved-filters/components/ds-saved-filters-row/index.ts +1 -0
- package/src/components/ds-saved-filters/components/ds-saved-filters-save.tsx +164 -0
- package/src/components/ds-saved-filters/components/ds-saved-filters-trigger/ds-saved-filters-trigger.module.scss +21 -0
- package/src/components/ds-saved-filters/components/ds-saved-filters-trigger/ds-saved-filters-trigger.tsx +237 -0
- package/src/components/ds-saved-filters/components/ds-saved-filters-trigger/index.ts +1 -0
- package/src/components/ds-saved-filters/components/index.ts +2 -0
- package/src/components/ds-saved-filters/ds-saved-filters.ts +6 -0
- package/src/components/ds-saved-filters/ds-saved-filters.types.ts +106 -0
- package/src/components/ds-saved-filters/ds-saved-filters.utils.ts +35 -0
- package/src/components/ds-saved-filters/hooks/index.ts +1 -0
- package/src/components/ds-saved-filters/hooks/use-picker-outside-dismiss.ts +42 -0
- package/src/components/ds-saved-filters/index.ts +2 -0
- package/src/components/ds-segment-group/ds-segment-group.module.scss +65 -37
- package/src/components/ds-segment-group/ds-segment-group.tsx +17 -5
- package/src/components/ds-segment-group/ds-segment-group.types.ts +20 -5
- package/src/components/ds-segment-group/figma/ds-segment-group-v2-item.figma.ts +109 -0
- package/src/components/ds-segment-group/figma/ds-segment-group-v2.figma.ts +31 -0
- package/src/components/ds-tag/ds-tag.figma.ts +23 -3
- package/src/components/ds-tag/ds-tag.module.scss +71 -7
- package/src/components/ds-tag/ds-tag.tsx +115 -14
- package/src/components/ds-tag/ds-tag.types.ts +70 -3
- package/src/components/ds-tag/ds-tag.unit.test.ts +23 -4
- package/src/components/ds-tag/index.ts +2 -2
- package/src/components/ds-text-input/ds-input-field-v02.figma.ts +2 -0
- package/src/components/ds-toggle/ds-toggle.tsx +19 -15
- package/src/components/ds-toggle/ds-toggle.types.ts +6 -0
- package/src/components/ds-toggle-filter-data/ds-toggle-filter-data.module.scss +69 -0
- package/src/components/ds-toggle-filter-data/ds-toggle-filter-data.tsx +55 -0
- package/src/components/ds-toggle-filter-data/ds-toggle-filter-data.types.ts +43 -0
- package/src/components/ds-toggle-filter-data/index.ts +1 -0
- package/src/components/ds-tooltip/ds-tooltip.module.scss +8 -0
- package/src/components/ds-tooltip/ds-tooltip.tsx +1 -1
- package/src/components/ds-tree/ds-tree.tsx +10 -10
- package/src/components/ds-tree/ds-tree.types.ts +40 -7
- package/src/index.ts +2 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { CSSProperties, MouseEvent, ReactNode, Ref } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface DsToggleFilterDataProps {
|
|
4
|
+
/**
|
|
5
|
+
* Ref to the pill element
|
|
6
|
+
*/
|
|
7
|
+
ref?: Ref<HTMLButtonElement>;
|
|
8
|
+
/**
|
|
9
|
+
* Emphasized leading segment naming the data the pill filters on
|
|
10
|
+
*/
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Secondary-colored trailing segment, typically the count the `label` refers to
|
|
14
|
+
*/
|
|
15
|
+
value: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the pill is toggled on. Controlled — pair it with `onActiveChange` and re-render with
|
|
18
|
+
* the next value. Surfaced as `aria-pressed`, which stays exposed while `disabled`.
|
|
19
|
+
*/
|
|
20
|
+
active: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the pill is disabled. Neither callback fires while set.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Additional CSS class names
|
|
28
|
+
*/
|
|
29
|
+
className?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Additional styles to apply
|
|
32
|
+
*/
|
|
33
|
+
style?: CSSProperties;
|
|
34
|
+
/**
|
|
35
|
+
* Called on click and on keyboard activation with the next `active` value
|
|
36
|
+
*/
|
|
37
|
+
onActiveChange?: (active: boolean) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Called with the raw click event, before `onActiveChange`. Observational only — it cannot veto
|
|
40
|
+
* the toggle.
|
|
41
|
+
*/
|
|
42
|
+
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DsToggleFilterData } from './ds-toggle-filter-data';
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
@use '../../styles/typography';
|
|
2
2
|
|
|
3
|
+
.positioner {
|
|
4
|
+
// Zag marks the *content* pointer-transparent when the tooltip is not
|
|
5
|
+
// interactive, but leaves this wrapper clickable — so an open tooltip swallows
|
|
6
|
+
// clicks meant for whatever it overlaps. Interactive content re-enables itself
|
|
7
|
+
// with `pointer-events: auto`, which still applies under a `none` parent.
|
|
8
|
+
pointer-events: none;
|
|
9
|
+
}
|
|
10
|
+
|
|
3
11
|
.tooltip {
|
|
4
12
|
--arrow-size: 7px;
|
|
5
13
|
color: var(--font-on-action);
|
|
@@ -36,7 +36,7 @@ const DsTooltip: FC<DsTooltipProps> = ({
|
|
|
36
36
|
>
|
|
37
37
|
<Tooltip.Trigger asChild>{children}</Tooltip.Trigger>
|
|
38
38
|
<Portal>
|
|
39
|
-
<Tooltip.Positioner>
|
|
39
|
+
<Tooltip.Positioner className={styles.positioner}>
|
|
40
40
|
<Tooltip.Content
|
|
41
41
|
className={classNames(styles.tooltip, slotProps?.content?.className)}
|
|
42
42
|
style={slotProps?.content?.style}
|
|
@@ -79,14 +79,14 @@ const DsTreeTree = ({ className, style, children }: DsTreeTreeProps) => (
|
|
|
79
79
|
</TreeView.Tree>
|
|
80
80
|
);
|
|
81
81
|
|
|
82
|
-
const DsTreeBranch = ({ className, style, children }: DsTreeBranchProps) => (
|
|
83
|
-
<TreeView.Branch className={classNames(styles.branch, className)} style={style}>
|
|
82
|
+
const DsTreeBranch = ({ className, style, children, ...rest }: DsTreeBranchProps) => (
|
|
83
|
+
<TreeView.Branch {...rest} className={classNames(styles.branch, className)} style={style}>
|
|
84
84
|
{children}
|
|
85
85
|
</TreeView.Branch>
|
|
86
86
|
);
|
|
87
87
|
|
|
88
|
-
const DsTreeBranchControl = ({ className, style, children }: DsTreeBranchControlProps) => (
|
|
89
|
-
<TreeView.BranchControl className={classNames(styles.branchControl, className)} style={style}>
|
|
88
|
+
const DsTreeBranchControl = ({ className, style, children, ...rest }: DsTreeBranchControlProps) => (
|
|
89
|
+
<TreeView.BranchControl {...rest} className={classNames(styles.branchControl, className)} style={style}>
|
|
90
90
|
{children}
|
|
91
91
|
</TreeView.BranchControl>
|
|
92
92
|
);
|
|
@@ -97,8 +97,8 @@ const DsTreeBranchIndicator = ({ className, style, children }: DsTreeBranchIndic
|
|
|
97
97
|
</TreeView.BranchIndicator>
|
|
98
98
|
);
|
|
99
99
|
|
|
100
|
-
const DsTreeBranchText = ({ className, style, children }: DsTreeBranchTextProps) => (
|
|
101
|
-
<TreeView.BranchText className={classNames(styles.branchText, className)} style={style}>
|
|
100
|
+
const DsTreeBranchText = ({ className, style, children, ...rest }: DsTreeBranchTextProps) => (
|
|
101
|
+
<TreeView.BranchText {...rest} className={classNames(styles.branchText, className)} style={style}>
|
|
102
102
|
{children}
|
|
103
103
|
</TreeView.BranchText>
|
|
104
104
|
);
|
|
@@ -113,14 +113,14 @@ const DsTreeBranchIndentGuide = ({ className, style }: DsTreeBranchIndentGuidePr
|
|
|
113
113
|
<TreeView.BranchIndentGuide className={classNames(styles.branchIndentGuide, className)} style={style} />
|
|
114
114
|
);
|
|
115
115
|
|
|
116
|
-
const DsTreeItem = ({ className, style, children, onClick }: DsTreeItemProps) => (
|
|
117
|
-
<TreeView.Item className={classNames(styles.item, className)} style={style} onClick={onClick}>
|
|
116
|
+
const DsTreeItem = ({ className, style, children, onClick, ...rest }: DsTreeItemProps) => (
|
|
117
|
+
<TreeView.Item {...rest} className={classNames(styles.item, className)} style={style} onClick={onClick}>
|
|
118
118
|
{children}
|
|
119
119
|
</TreeView.Item>
|
|
120
120
|
);
|
|
121
121
|
|
|
122
|
-
const DsTreeItemText = ({ className, style, children }: DsTreeItemTextProps) => (
|
|
123
|
-
<TreeView.ItemText className={classNames(styles.itemText, className)} style={style}>
|
|
122
|
+
const DsTreeItemText = ({ className, style, children, ...rest }: DsTreeItemTextProps) => (
|
|
123
|
+
<TreeView.ItemText {...rest} className={classNames(styles.itemText, className)} style={style}>
|
|
124
124
|
{children}
|
|
125
125
|
</TreeView.ItemText>
|
|
126
126
|
);
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
AriaAttributes,
|
|
3
|
+
CSSProperties,
|
|
4
|
+
FocusEventHandler,
|
|
5
|
+
KeyboardEventHandler,
|
|
6
|
+
MouseEvent,
|
|
7
|
+
MouseEventHandler,
|
|
8
|
+
PointerEventHandler,
|
|
9
|
+
ReactNode,
|
|
10
|
+
Ref,
|
|
11
|
+
} from 'react';
|
|
2
12
|
import type { TreeView as ArkTreeView } from '@ark-ui/react/tree-view';
|
|
3
13
|
import type { IconType } from '../ds-icon';
|
|
4
14
|
import type { FilterStatus } from '../ds-filter-status-icon';
|
|
@@ -96,7 +106,7 @@ export interface DsTreeRootProps<T extends DsTreeNode = DsTreeNode> extends DsTr
|
|
|
96
106
|
/**
|
|
97
107
|
* Whether clicking anywhere on a branch row toggles its expansion in addition
|
|
98
108
|
* to clicking the branch indicator.
|
|
99
|
-
* @default
|
|
109
|
+
* @default true
|
|
100
110
|
*/
|
|
101
111
|
expandOnClick?: boolean;
|
|
102
112
|
|
|
@@ -148,26 +158,49 @@ export interface DsTreeRootProps<T extends DsTreeNode = DsTreeNode> extends DsTr
|
|
|
148
158
|
|
|
149
159
|
export type DsTreeTreeProps = DsTreeBasePropsWithChildren;
|
|
150
160
|
|
|
151
|
-
|
|
161
|
+
/**
|
|
162
|
+
* Props a wrapping `asChild` trigger (`DsPopover.Trigger`, `DsTooltip`) injects onto
|
|
163
|
+
* the element it wraps. Row parts forward these so wrapping a row actually wires up
|
|
164
|
+
* instead of silently doing nothing.
|
|
165
|
+
*/
|
|
166
|
+
export interface DsTreeRowTriggerProps<T extends HTMLElement = HTMLElement> {
|
|
167
|
+
id?: string;
|
|
168
|
+
ref?: Ref<T>;
|
|
169
|
+
tabIndex?: number;
|
|
170
|
+
'aria-haspopup'?: AriaAttributes['aria-haspopup'];
|
|
171
|
+
'aria-expanded'?: AriaAttributes['aria-expanded'];
|
|
172
|
+
'aria-controls'?: string;
|
|
173
|
+
'data-state'?: string;
|
|
174
|
+
onClick?: MouseEventHandler<T>;
|
|
175
|
+
onPointerDown?: PointerEventHandler<T>;
|
|
176
|
+
onPointerEnter?: PointerEventHandler<T>;
|
|
177
|
+
onPointerLeave?: PointerEventHandler<T>;
|
|
178
|
+
onFocus?: FocusEventHandler<T>;
|
|
179
|
+
onBlur?: FocusEventHandler<T>;
|
|
180
|
+
onKeyDown?: KeyboardEventHandler<T>;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export type DsTreeBranchProps = DsTreeBasePropsWithChildren & DsTreeRowTriggerProps<HTMLDivElement>;
|
|
152
184
|
|
|
153
|
-
export type DsTreeBranchControlProps = DsTreeBasePropsWithChildren
|
|
185
|
+
export type DsTreeBranchControlProps = DsTreeBasePropsWithChildren & DsTreeRowTriggerProps<HTMLDivElement>;
|
|
154
186
|
|
|
155
187
|
export type DsTreeBranchIndicatorProps = DsTreeBasePropsWithChildren;
|
|
156
188
|
|
|
157
|
-
export type DsTreeBranchTextProps = DsTreeBasePropsWithChildren
|
|
189
|
+
export type DsTreeBranchTextProps = DsTreeBasePropsWithChildren & DsTreeRowTriggerProps<HTMLSpanElement>;
|
|
158
190
|
|
|
159
191
|
export type DsTreeBranchContentProps = DsTreeBasePropsWithChildren;
|
|
160
192
|
|
|
161
193
|
export type DsTreeBranchIndentGuideProps = DsTreeBaseProps;
|
|
162
194
|
|
|
163
|
-
export interface DsTreeItemProps
|
|
195
|
+
export interface DsTreeItemProps
|
|
196
|
+
extends DsTreeBasePropsWithChildren, Omit<DsTreeRowTriggerProps<HTMLDivElement>, 'onClick'> {
|
|
164
197
|
/**
|
|
165
198
|
* Called when the leaf item is clicked. Receives the native mouse event.
|
|
166
199
|
*/
|
|
167
200
|
onClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
168
201
|
}
|
|
169
202
|
|
|
170
|
-
export type DsTreeItemTextProps = DsTreeBasePropsWithChildren
|
|
203
|
+
export type DsTreeItemTextProps = DsTreeBasePropsWithChildren & DsTreeRowTriggerProps<HTMLSpanElement>;
|
|
171
204
|
|
|
172
205
|
export type DsTreeItemIndicatorProps = DsTreeBaseProps;
|
|
173
206
|
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './components/ds-checkbox';
|
|
|
13
13
|
export * from './components/ds-checkbox-group';
|
|
14
14
|
export * from './components/ds-chip';
|
|
15
15
|
export * from './components/ds-chip-group';
|
|
16
|
+
export * from './components/ds-code-input';
|
|
16
17
|
export * from './components/ds-comment-bubble';
|
|
17
18
|
export * from './components/ds-comment-card';
|
|
18
19
|
export * from './components/ds-comment-indicator';
|
|
@@ -40,6 +41,7 @@ export * from './components/ds-modal';
|
|
|
40
41
|
export * from './components/ds-number-input';
|
|
41
42
|
export * from './components/ds-panel';
|
|
42
43
|
export * from './components/ds-password-input';
|
|
44
|
+
export * from './components/ds-pin-toggle';
|
|
43
45
|
export * from './components/ds-popover';
|
|
44
46
|
export * from './components/ds-progress-arc';
|
|
45
47
|
export * from './components/ds-progress-donut';
|