@techsio/ui-kit 0.46.0 → 0.48.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/dist/internal/molecules/vertical-navigation.context.js +15 -0
- package/dist/internal/molecules/vertical-navigation.styles.js +68 -0
- package/dist/molecules/vertical-navigation.js +228 -0
- package/dist/organisms/data-table.js +51 -46
- package/dist/src/internal/molecules/vertical-navigation.context.d.ts +25 -0
- package/dist/src/internal/molecules/vertical-navigation.context.d.ts.map +1 -0
- package/dist/src/internal/molecules/vertical-navigation.styles.d.ts +143 -0
- package/dist/src/internal/molecules/vertical-navigation.styles.d.ts.map +1 -0
- package/dist/src/molecules/vertical-navigation.d.ts +44 -0
- package/dist/src/molecules/vertical-navigation.d.ts.map +1 -0
- package/dist/src/organisms/data-table.d.ts.map +1 -1
- package/dist/src/types/zag.d.ts +1 -0
- package/dist/src/types/zag.d.ts.map +1 -1
- package/dist/stories/changelog/changelog.stories.d.ts.map +1 -1
- package/dist/stories/molecules/vertical-navigation.stories.d.ts +75 -0
- package/dist/stories/molecules/vertical-navigation.stories.d.ts.map +1 -0
- package/dist/test/vertical-navigation.behavior.spec.d.ts +2 -0
- package/dist/test/vertical-navigation.behavior.spec.d.ts.map +1 -0
- package/dist/test/vertical-navigation.playwright.config.d.ts +4 -0
- package/dist/test/vertical-navigation.playwright.config.d.ts.map +1 -0
- package/package.json +2 -1
- package/src/tokens/components/components.css +1 -0
- package/src/tokens/components/molecules/_vertical-navigation.css +155 -0
- package/src/tokens/components/organisms/_data-table.css +30 -7
- package/src/tokens/components/organisms/_table.css +0 -17
- package/src/tokens/figma/akros/variables.css +438 -0
- package/src/tokens/figma/brand-overrides.css +1 -1
- package/src/tokens/figma/business/variables.css +2 -2
- package/src/tokens/figma/dark/variables.css +39 -1
- package/src/tokens/figma/light/variables.css +431 -6
- package/src/tokens/figma/neo/variables.css +2 -2
- package/src/tokens/figma/neo-dark/variables.css +1 -1
- package/src/tokens/figma/variables.css +430 -5
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
const VerticalNavigationContext = createContext(null);
|
|
3
|
+
const VerticalNavigationDepthContext = createContext(0);
|
|
4
|
+
const VerticalNavigationBranchContext = createContext(null);
|
|
5
|
+
function useVerticalNavigationContext() {
|
|
6
|
+
const context = useContext(VerticalNavigationContext);
|
|
7
|
+
if (!context) throw new Error("VerticalNavigation parts must be used within VerticalNavigation.Root");
|
|
8
|
+
return context;
|
|
9
|
+
}
|
|
10
|
+
function useVerticalNavigationBranchContext() {
|
|
11
|
+
const context = useContext(VerticalNavigationBranchContext);
|
|
12
|
+
if (!context) throw new Error("VerticalNavigation branch parts must be used within VerticalNavigation.Branch");
|
|
13
|
+
return context;
|
|
14
|
+
}
|
|
15
|
+
export { VerticalNavigationBranchContext, VerticalNavigationContext, VerticalNavigationDepthContext, useVerticalNavigationBranchContext, useVerticalNavigationContext };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { tv } from "../../utils.js";
|
|
2
|
+
const verticalNavigationStyles = tv({
|
|
3
|
+
slots: {
|
|
4
|
+
root: "min-w-0 text-vertical-navigation-fg",
|
|
5
|
+
list: "flex min-w-0 list-none flex-col gap-vertical-navigation-list",
|
|
6
|
+
item: "min-w-0",
|
|
7
|
+
row: "vertical-navigation-row flex min-w-0 items-start gap-vertical-navigation-row rounded-vertical-navigation-item bg-vertical-navigation-item-bg data-current-path:font-vertical-navigation-path",
|
|
8
|
+
link: "vertical-navigation-control focus-visible:vertical-navigation-focus flex min-w-0 flex-1 items-center justify-start gap-vertical-navigation-row whitespace-normal rounded-vertical-navigation-item bg-vertical-navigation-item-bg text-start text-inherit hover:bg-vertical-navigation-item-bg-hover data-current:bg-vertical-navigation-item-bg-current data-current-path:font-vertical-navigation-path data-current:font-vertical-navigation-current data-current:text-vertical-navigation-item-fg-current data-disabled:text-vertical-navigation-item-fg-disabled data-disabled:hover:bg-vertical-navigation-item-bg",
|
|
9
|
+
trigger: "vertical-navigation-control focus-visible:vertical-navigation-focus flex w-full min-w-0 items-center justify-between whitespace-normal rounded-vertical-navigation-item bg-vertical-navigation-item-bg text-start text-inherit hover:bg-vertical-navigation-item-bg-hover disabled:text-vertical-navigation-item-fg-disabled disabled:hover:bg-vertical-navigation-item-bg",
|
|
10
|
+
indicator: "inline-flex shrink-0 data-[state=open]:rotate-180",
|
|
11
|
+
content: "data-guide:vertical-navigation-guide min-w-0 rounded-vertical-navigation-group py-vertical-navigation-group data-indented:ms-vertical-navigation-indent",
|
|
12
|
+
group: "flex min-w-0 flex-col gap-vertical-navigation-group rounded-vertical-navigation-group p-vertical-navigation-group",
|
|
13
|
+
groupLabel: "mb-vertical-navigation-label font-vertical-navigation-label text-vertical-navigation-label-fg text-vertical-navigation-label-sm",
|
|
14
|
+
separator: "my-vertical-navigation-group h-vertical-navigation-separator border-0 bg-vertical-navigation-separator-bg"
|
|
15
|
+
},
|
|
16
|
+
variants: {
|
|
17
|
+
variant: {
|
|
18
|
+
primary: {},
|
|
19
|
+
secondary: {}
|
|
20
|
+
},
|
|
21
|
+
size: {
|
|
22
|
+
sm: {
|
|
23
|
+
root: "text-vertical-navigation-sm",
|
|
24
|
+
link: "min-h-vertical-navigation-item-sm px-vertical-navigation-item-x-sm py-vertical-navigation-item-y-sm",
|
|
25
|
+
trigger: "min-h-vertical-navigation-item-sm px-vertical-navigation-item-x-sm py-vertical-navigation-item-y-sm",
|
|
26
|
+
indicator: "text-vertical-navigation-icon-sm",
|
|
27
|
+
groupLabel: "px-vertical-navigation-item-x-sm"
|
|
28
|
+
},
|
|
29
|
+
md: {
|
|
30
|
+
root: "text-vertical-navigation-md",
|
|
31
|
+
link: "min-h-vertical-navigation-item-md px-vertical-navigation-item-x-md py-vertical-navigation-item-y-md",
|
|
32
|
+
trigger: "min-h-vertical-navigation-item-md px-vertical-navigation-item-x-md py-vertical-navigation-item-y-md",
|
|
33
|
+
indicator: "text-vertical-navigation-icon-md",
|
|
34
|
+
groupLabel: "px-vertical-navigation-item-x-md"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
tone: {
|
|
38
|
+
plain: {
|
|
39
|
+
content: "bg-vertical-navigation-group-bg-plain text-vertical-navigation-group-fg-plain",
|
|
40
|
+
group: "bg-vertical-navigation-group-bg-plain text-vertical-navigation-group-fg-plain"
|
|
41
|
+
},
|
|
42
|
+
subtle: {
|
|
43
|
+
content: "bg-vertical-navigation-group-bg-subtle text-vertical-navigation-group-fg-subtle",
|
|
44
|
+
group: "bg-vertical-navigation-group-bg-subtle text-vertical-navigation-group-fg-subtle"
|
|
45
|
+
},
|
|
46
|
+
accent: {
|
|
47
|
+
content: "bg-vertical-navigation-group-bg-accent text-vertical-navigation-group-fg-accent",
|
|
48
|
+
group: "bg-vertical-navigation-group-bg-accent text-vertical-navigation-group-fg-accent"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
compoundVariants: [
|
|
53
|
+
{
|
|
54
|
+
tone: "accent",
|
|
55
|
+
variant: "secondary",
|
|
56
|
+
class: {
|
|
57
|
+
content: "bg-vertical-navigation-group-bg-secondary text-vertical-navigation-group-fg-secondary",
|
|
58
|
+
group: "bg-vertical-navigation-group-bg-secondary text-vertical-navigation-group-fg-secondary"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
defaultVariants: {
|
|
63
|
+
size: "md",
|
|
64
|
+
tone: "plain",
|
|
65
|
+
variant: "primary"
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
export { verticalNavigationStyles };
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { mergeProps, normalizeProps, useMachine } from "@zag-js/react";
|
|
4
|
+
import { useContext, useId } from "react";
|
|
5
|
+
import { Button } from "../atoms/button.js";
|
|
6
|
+
import { Icon } from "../atoms/icon.js";
|
|
7
|
+
import { LinkButton } from "../atoms/link-button.js";
|
|
8
|
+
import { VerticalNavigationBranchContext, VerticalNavigationContext, VerticalNavigationDepthContext, useVerticalNavigationBranchContext, useVerticalNavigationContext } from "../internal/molecules/vertical-navigation.context.js";
|
|
9
|
+
import { verticalNavigationStyles } from "../internal/molecules/vertical-navigation.styles.js";
|
|
10
|
+
import * as __rspack_external__zag_js_collapsible_508ff486 from "@zag-js/collapsible";
|
|
11
|
+
function VerticalNavigation({ size = "md", maxIndentDepth = 3, dir, className, children, ...props }) {
|
|
12
|
+
return /*#__PURE__*/ jsx(VerticalNavigationContext.Provider, {
|
|
13
|
+
value: {
|
|
14
|
+
size,
|
|
15
|
+
maxIndentDepth,
|
|
16
|
+
dir
|
|
17
|
+
},
|
|
18
|
+
children: /*#__PURE__*/ jsx(VerticalNavigationDepthContext.Provider, {
|
|
19
|
+
value: 0,
|
|
20
|
+
children: /*#__PURE__*/ jsx(VerticalNavigationBranchContext.Provider, {
|
|
21
|
+
value: null,
|
|
22
|
+
children: /*#__PURE__*/ jsx("nav", {
|
|
23
|
+
...props,
|
|
24
|
+
className: verticalNavigationStyles({
|
|
25
|
+
size
|
|
26
|
+
}).root({
|
|
27
|
+
className
|
|
28
|
+
}),
|
|
29
|
+
"data-part": "root",
|
|
30
|
+
"data-scope": "vertical-navigation",
|
|
31
|
+
dir: dir,
|
|
32
|
+
children: children
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
VerticalNavigation.Root = VerticalNavigation;
|
|
39
|
+
VerticalNavigation.List = function({ children, className, ...props }) {
|
|
40
|
+
useVerticalNavigationContext();
|
|
41
|
+
const depth = useContext(VerticalNavigationDepthContext);
|
|
42
|
+
return /*#__PURE__*/ jsx(VerticalNavigationDepthContext.Provider, {
|
|
43
|
+
value: depth + 1,
|
|
44
|
+
children: /*#__PURE__*/ jsx("ul", {
|
|
45
|
+
...props,
|
|
46
|
+
className: verticalNavigationStyles().list({
|
|
47
|
+
className
|
|
48
|
+
}),
|
|
49
|
+
"data-depth": depth,
|
|
50
|
+
"data-part": "list",
|
|
51
|
+
"data-scope": "vertical-navigation",
|
|
52
|
+
children: children
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
VerticalNavigation.Item = function({ className, ...props }) {
|
|
57
|
+
useVerticalNavigationContext();
|
|
58
|
+
return /*#__PURE__*/ jsx(VerticalNavigationBranchContext.Provider, {
|
|
59
|
+
value: null,
|
|
60
|
+
children: /*#__PURE__*/ jsx("li", {
|
|
61
|
+
...props,
|
|
62
|
+
className: verticalNavigationStyles().item({
|
|
63
|
+
className
|
|
64
|
+
}),
|
|
65
|
+
"data-part": "item",
|
|
66
|
+
"data-scope": "vertical-navigation"
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
VerticalNavigation.Row = function({ className, ...props }) {
|
|
71
|
+
useVerticalNavigationContext();
|
|
72
|
+
const branch = useContext(VerticalNavigationBranchContext);
|
|
73
|
+
return /*#__PURE__*/ jsx("div", {
|
|
74
|
+
...props,
|
|
75
|
+
className: verticalNavigationStyles().row({
|
|
76
|
+
className
|
|
77
|
+
}),
|
|
78
|
+
"data-current-path": branch?.containsCurrent || void 0,
|
|
79
|
+
"data-part": "row",
|
|
80
|
+
"data-scope": "vertical-navigation"
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
VerticalNavigation.Link = function({ current = false, className, ...props }) {
|
|
84
|
+
const { size } = useVerticalNavigationContext();
|
|
85
|
+
const branch = useContext(VerticalNavigationBranchContext);
|
|
86
|
+
return /*#__PURE__*/ jsx(LinkButton, {
|
|
87
|
+
...props,
|
|
88
|
+
"aria-current": current ? "page" : void 0,
|
|
89
|
+
className: verticalNavigationStyles({
|
|
90
|
+
size
|
|
91
|
+
}).link({
|
|
92
|
+
className
|
|
93
|
+
}),
|
|
94
|
+
"data-current": current || void 0,
|
|
95
|
+
"data-current-path": branch?.containsCurrent || void 0,
|
|
96
|
+
"data-part": "link",
|
|
97
|
+
"data-scope": "vertical-navigation",
|
|
98
|
+
size: "current",
|
|
99
|
+
theme: "unstyled"
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
VerticalNavigation.Branch = function({ id, open, defaultOpen, onOpenChange, disabled, getRootNode, containsCurrent = false, children, className, ...props }) {
|
|
103
|
+
const { dir } = useVerticalNavigationContext();
|
|
104
|
+
const generatedId = useId();
|
|
105
|
+
const service = useMachine(__rspack_external__zag_js_collapsible_508ff486.machine, {
|
|
106
|
+
id: id ?? generatedId,
|
|
107
|
+
dir,
|
|
108
|
+
open,
|
|
109
|
+
defaultOpen,
|
|
110
|
+
onOpenChange,
|
|
111
|
+
disabled,
|
|
112
|
+
getRootNode
|
|
113
|
+
});
|
|
114
|
+
const api = __rspack_external__zag_js_collapsible_508ff486.connect(service, normalizeProps);
|
|
115
|
+
return /*#__PURE__*/ jsx(VerticalNavigationBranchContext.Provider, {
|
|
116
|
+
value: {
|
|
117
|
+
api,
|
|
118
|
+
containsCurrent
|
|
119
|
+
},
|
|
120
|
+
children: /*#__PURE__*/ jsx("li", {
|
|
121
|
+
...mergeProps(props, api.getRootProps()),
|
|
122
|
+
className: verticalNavigationStyles().item({
|
|
123
|
+
className
|
|
124
|
+
}),
|
|
125
|
+
"data-current-path": containsCurrent || void 0,
|
|
126
|
+
"data-part": "branch",
|
|
127
|
+
"data-scope": "vertical-navigation",
|
|
128
|
+
children: children
|
|
129
|
+
})
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
VerticalNavigation.BranchTrigger = function({ className, disabled, ...props }) {
|
|
133
|
+
const { size } = useVerticalNavigationContext();
|
|
134
|
+
const { api } = useVerticalNavigationBranchContext();
|
|
135
|
+
return /*#__PURE__*/ jsx(Button, {
|
|
136
|
+
...mergeProps(props, api.getTriggerProps()),
|
|
137
|
+
className: verticalNavigationStyles({
|
|
138
|
+
size
|
|
139
|
+
}).trigger({
|
|
140
|
+
className
|
|
141
|
+
}),
|
|
142
|
+
"data-part": "branch-trigger",
|
|
143
|
+
"data-scope": "vertical-navigation",
|
|
144
|
+
disabled: disabled || api.disabled,
|
|
145
|
+
size: "current",
|
|
146
|
+
theme: "unstyled"
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
VerticalNavigation.BranchIndicator = function({ className, ...props }) {
|
|
150
|
+
const { size } = useVerticalNavigationContext();
|
|
151
|
+
const { api } = useVerticalNavigationBranchContext();
|
|
152
|
+
return /*#__PURE__*/ jsx("span", {
|
|
153
|
+
...mergeProps(props, api.getIndicatorProps()),
|
|
154
|
+
"aria-hidden": "true",
|
|
155
|
+
className: verticalNavigationStyles({
|
|
156
|
+
size
|
|
157
|
+
}).indicator({
|
|
158
|
+
className
|
|
159
|
+
}),
|
|
160
|
+
"data-part": "branch-indicator",
|
|
161
|
+
"data-scope": "vertical-navigation",
|
|
162
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
163
|
+
icon: "token-icon-vertical-navigation-chevron",
|
|
164
|
+
size: "current"
|
|
165
|
+
})
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
VerticalNavigation.BranchContent = function({ tone = "plain", variant = "primary", indent = true, showGuide = false, className, ...props }) {
|
|
169
|
+
const { maxIndentDepth } = useVerticalNavigationContext();
|
|
170
|
+
const { api } = useVerticalNavigationBranchContext();
|
|
171
|
+
const depth = useContext(VerticalNavigationDepthContext);
|
|
172
|
+
return /*#__PURE__*/ jsx("div", {
|
|
173
|
+
...mergeProps(props, api.getContentProps()),
|
|
174
|
+
className: verticalNavigationStyles({
|
|
175
|
+
tone,
|
|
176
|
+
variant
|
|
177
|
+
}).content({
|
|
178
|
+
className
|
|
179
|
+
}),
|
|
180
|
+
"data-guide": showGuide || void 0,
|
|
181
|
+
"data-indented": indent && depth <= maxIndentDepth || void 0,
|
|
182
|
+
"data-part": "branch-content",
|
|
183
|
+
"data-scope": "vertical-navigation",
|
|
184
|
+
"data-tone": tone,
|
|
185
|
+
"data-variant": variant
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
VerticalNavigation.Group = function({ tone = "plain", variant = "primary", className, ...props }) {
|
|
189
|
+
useVerticalNavigationContext();
|
|
190
|
+
return /*#__PURE__*/ jsx("div", {
|
|
191
|
+
...props,
|
|
192
|
+
className: verticalNavigationStyles({
|
|
193
|
+
tone,
|
|
194
|
+
variant
|
|
195
|
+
}).group({
|
|
196
|
+
className
|
|
197
|
+
}),
|
|
198
|
+
"data-part": "group",
|
|
199
|
+
"data-scope": "vertical-navigation",
|
|
200
|
+
"data-tone": tone,
|
|
201
|
+
"data-variant": variant
|
|
202
|
+
});
|
|
203
|
+
};
|
|
204
|
+
VerticalNavigation.GroupLabel = function({ className, ...props }) {
|
|
205
|
+
const { size } = useVerticalNavigationContext();
|
|
206
|
+
return /*#__PURE__*/ jsx("h2", {
|
|
207
|
+
...props,
|
|
208
|
+
className: verticalNavigationStyles({
|
|
209
|
+
size
|
|
210
|
+
}).groupLabel({
|
|
211
|
+
className
|
|
212
|
+
}),
|
|
213
|
+
"data-part": "group-label",
|
|
214
|
+
"data-scope": "vertical-navigation"
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
VerticalNavigation.Separator = function({ className, ...props }) {
|
|
218
|
+
useVerticalNavigationContext();
|
|
219
|
+
return /*#__PURE__*/ jsx("hr", {
|
|
220
|
+
...props,
|
|
221
|
+
className: verticalNavigationStyles().separator({
|
|
222
|
+
className
|
|
223
|
+
}),
|
|
224
|
+
"data-part": "separator",
|
|
225
|
+
"data-scope": "vertical-navigation"
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
export { VerticalNavigation };
|
|
@@ -21,20 +21,20 @@ import { Table } from "./table.js";
|
|
|
21
21
|
const dataTableVariants = tv({
|
|
22
22
|
slots: {
|
|
23
23
|
wrapper: [
|
|
24
|
-
"flex w-full flex-col overflow-hidden rounded-table",
|
|
25
|
-
"border-(length:--border-table
|
|
24
|
+
"flex w-full flex-col overflow-hidden rounded-data-table",
|
|
25
|
+
"border-(length:--border-width-data-table) border-data-table-border"
|
|
26
26
|
],
|
|
27
27
|
toolbar: [
|
|
28
|
-
"flex items-center justify-between gap-
|
|
29
|
-
"bg-table-
|
|
30
|
-
"
|
|
31
|
-
"border-b-(length:--border-table
|
|
28
|
+
"flex items-center justify-between gap-data-table-toolbar",
|
|
29
|
+
"bg-data-table-toolbar-bg text-data-table-toolbar-fg",
|
|
30
|
+
"p-data-table-toolbar",
|
|
31
|
+
"border-b-(length:--border-width-data-table) border-data-table-border"
|
|
32
32
|
],
|
|
33
33
|
toolbarSearch: [
|
|
34
34
|
"min-w-0 flex-1"
|
|
35
35
|
],
|
|
36
36
|
toolbarActions: [
|
|
37
|
-
"flex shrink-0 items-center gap-
|
|
37
|
+
"flex shrink-0 items-center gap-data-table-toolbar"
|
|
38
38
|
],
|
|
39
39
|
scroll: [
|
|
40
40
|
"relative w-full overflow-auto"
|
|
@@ -48,68 +48,68 @@ const dataTableVariants = tv({
|
|
|
48
48
|
"data-[disabled=true]:cursor-default"
|
|
49
49
|
],
|
|
50
50
|
sortIcon: [
|
|
51
|
-
"text-fg
|
|
52
|
-
"data-[active=true]:text-fg-
|
|
51
|
+
"text-data-table-sort-icon-fg",
|
|
52
|
+
"data-[active=true]:text-data-table-sort-icon-fg-active"
|
|
53
53
|
],
|
|
54
54
|
dragHandle: [
|
|
55
|
-
"inline-flex cursor-grab items-center rounded-table text-fg
|
|
55
|
+
"inline-flex cursor-grab items-center rounded-data-table text-data-table-drag-handle-fg",
|
|
56
56
|
"opacity-0 transition-opacity duration-200 motion-reduce:transition-none",
|
|
57
|
-
"hover:bg-table-row-bg-hover hover:opacity-100 focus-visible:opacity-100",
|
|
57
|
+
"hover:bg-data-table-row-bg-hover hover:opacity-100 focus-visible:opacity-100",
|
|
58
58
|
"group-hover/header:opacity-100 group-hover/row:opacity-100",
|
|
59
59
|
"group-focus-within/header:opacity-100 group-focus-within/row:opacity-100",
|
|
60
60
|
"group-data-dragging/header:opacity-100 group-data-dragging/row:opacity-100",
|
|
61
61
|
"active:cursor-grabbing"
|
|
62
62
|
],
|
|
63
63
|
resizeHandle: [
|
|
64
|
-
"absolute end-0 top-0 h-full
|
|
64
|
+
"w-(length:--size-data-table-resize-handle) absolute end-0 top-0 h-full cursor-col-resize touch-none select-none",
|
|
65
65
|
"opacity-0 transition-opacity duration-200 motion-reduce:transition-none",
|
|
66
|
-
"bg-table-
|
|
66
|
+
"bg-data-table-resize-handle-bg hover:opacity-100 focus-visible:opacity-100",
|
|
67
67
|
"group-hover/header:opacity-100"
|
|
68
68
|
],
|
|
69
69
|
filterRow: [
|
|
70
|
-
"bg-table-
|
|
70
|
+
"bg-data-table-filter-row-bg"
|
|
71
71
|
],
|
|
72
72
|
filterCell: [
|
|
73
|
-
"
|
|
73
|
+
"p-data-table-filter-cell",
|
|
74
74
|
"min-w-fit",
|
|
75
|
-
"border-b-(length:--border-table
|
|
75
|
+
"border-b-(length:--border-width-data-table) border-data-table-border"
|
|
76
76
|
],
|
|
77
77
|
filterControl: [
|
|
78
|
-
"flex flex-wrap items-center gap-
|
|
78
|
+
"flex flex-wrap items-center gap-data-table-filter-control"
|
|
79
79
|
],
|
|
80
80
|
editorControl: [
|
|
81
|
-
"flex flex-col gap-
|
|
81
|
+
"flex flex-col gap-data-table-editor"
|
|
82
82
|
],
|
|
83
83
|
editorError: [
|
|
84
|
-
"text-
|
|
84
|
+
"text-data-table-editor-error-fg text-data-table-sm"
|
|
85
85
|
],
|
|
86
86
|
actionsCell: [
|
|
87
87
|
"flex items-center justify-end gap-100"
|
|
88
88
|
],
|
|
89
89
|
empty: [
|
|
90
90
|
"flex flex-col items-center justify-center gap-200",
|
|
91
|
-
"p-
|
|
91
|
+
"p-data-table-empty text-center text-data-table-empty-fg"
|
|
92
92
|
],
|
|
93
93
|
paginationBar: [
|
|
94
|
-
"flex flex-wrap items-center justify-between gap-
|
|
95
|
-
"bg-table-
|
|
96
|
-
"
|
|
97
|
-
"border-t-(length:--border-table
|
|
94
|
+
"flex flex-wrap items-center justify-between gap-data-table-pagination",
|
|
95
|
+
"bg-data-table-pagination-bg text-data-table-pagination-fg",
|
|
96
|
+
"p-data-table-pagination",
|
|
97
|
+
"border-t-(length:--border-width-data-table) border-data-table-border"
|
|
98
98
|
],
|
|
99
99
|
detailBox: [
|
|
100
|
-
"w-full p-
|
|
100
|
+
"w-full p-data-table-detail"
|
|
101
101
|
],
|
|
102
102
|
paginationInfo: [
|
|
103
|
-
"whitespace-nowrap text-table-sm"
|
|
103
|
+
"whitespace-nowrap text-data-table-sm"
|
|
104
104
|
],
|
|
105
105
|
paginationControls: [
|
|
106
|
-
"flex items-center gap-
|
|
106
|
+
"flex items-center gap-data-table-pagination"
|
|
107
107
|
]
|
|
108
108
|
},
|
|
109
109
|
variants: {
|
|
110
110
|
outlined: {
|
|
111
111
|
true: {
|
|
112
|
-
wrapper: "shadow-table-outline"
|
|
112
|
+
wrapper: "shadow-data-table-outline"
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -245,9 +245,9 @@ const BUILTIN_COLUMN_IDS = new Set([
|
|
|
245
245
|
function pinClass(column, kind) {
|
|
246
246
|
if (!column.getIsPinned()) return;
|
|
247
247
|
return [
|
|
248
|
-
"header" === kind ? "bg-table-header-bg" : "data-table-frozen-cell",
|
|
249
|
-
isLastStartPinned(column) ? "border-e-(length:--border-table
|
|
250
|
-
isFirstEndPinned(column) ? "border-s-(length:--border-table
|
|
248
|
+
"header" === kind ? "bg-data-table-header-bg" : "data-table-frozen-cell",
|
|
249
|
+
isLastStartPinned(column) ? "border-e-(length:--border-width-data-table) border-data-table-border" : "",
|
|
250
|
+
isFirstEndPinned(column) ? "border-s-(length:--border-width-data-table) border-data-table-border" : ""
|
|
251
251
|
].join(" ");
|
|
252
252
|
}
|
|
253
253
|
function HeaderDragHandle({ styles, setActivatorNodeRef, listeners, attributes, label }) {
|
|
@@ -392,21 +392,26 @@ function rowDragClass(dnd, opts) {
|
|
|
392
392
|
return [
|
|
393
393
|
"group/row",
|
|
394
394
|
"focus-visible:outline-(style:--default-ring-style) focus-visible:outline-(length:--default-ring-width) focus-visible:outline-primary",
|
|
395
|
-
"data-[selected=true]:[--dt-row-tint:var(--color-table-row-bg-selected)]",
|
|
396
|
-
"group-hover/row:[--dt-row-tint:var(--color-table-row-bg-hover)]",
|
|
397
|
-
"hover:[--dt-row-tint:var(--color-table-row-bg-hover)]",
|
|
398
|
-
striped ? `${(rowIndex ?? 0) % 2 === 0 ? "bg-table-row-striped-primary [--dt-row-tint:var(--color-table-row-striped-primary)]" : "bg-table-row-striped-secondary [--dt-row-tint:var(--color-table-row-striped-secondary)]"} border-b-0` : "",
|
|
395
|
+
"data-[selected=true]:[--dt-row-tint:var(--color-data-table-row-bg-selected)]",
|
|
396
|
+
"group-hover/row:[--dt-row-tint:var(--color-data-table-row-bg-hover)]",
|
|
397
|
+
"hover:[--dt-row-tint:var(--color-data-table-row-bg-hover)]",
|
|
398
|
+
striped ? `${(rowIndex ?? 0) % 2 === 0 ? "bg-data-table-row-bg-striped-primary [--dt-row-tint:var(--color-data-table-row-bg-striped-primary)]" : "bg-data-table-row-bg-striped-secondary [--dt-row-tint:var(--color-data-table-row-bg-striped-secondary)]"} border-b-0` : "",
|
|
399
399
|
tintNestedRows ? "data-[depth]:data-table-row-nested-tint" : "",
|
|
400
|
-
dnd?.isDragging ? "shadow-table-outline" : "",
|
|
400
|
+
dnd?.isDragging ? "shadow-data-table-outline" : "",
|
|
401
401
|
dnd?.dropSide === "top" ? "border-primary border-t-2" : "",
|
|
402
402
|
dnd?.dropSide === "bottom" ? "border-primary border-b-2" : "",
|
|
403
403
|
className ?? ""
|
|
404
404
|
].filter(Boolean).join(" ");
|
|
405
405
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
}
|
|
406
|
+
function opaqueSurface(tint) {
|
|
407
|
+
return {
|
|
408
|
+
backgroundColor: "var(--color-data-table-bg)",
|
|
409
|
+
backgroundImage: `linear-gradient(var(${tint}), var(${tint}))`
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
const OPAQUE_HEADER_BG = opaqueSurface("--color-data-table-header-bg");
|
|
413
|
+
const OPAQUE_FILTER_ROW_BG = opaqueSurface("--color-data-table-filter-row-bg");
|
|
414
|
+
const OPAQUE_PAGINATION_BG = opaqueSurface("--color-data-table-pagination-bg");
|
|
410
415
|
function sortState(column, enableSorting) {
|
|
411
416
|
if (!(enableSorting && column.getCanSort())) return;
|
|
412
417
|
const sorted = column.getIsSorted();
|
|
@@ -1094,7 +1099,7 @@ function DataTable(props) {
|
|
|
1094
1099
|
className: `${styles.filterCell()} ${pinClass(column, "header") ?? ""}`,
|
|
1095
1100
|
"data-pinned": column.getIsPinned() || void 0,
|
|
1096
1101
|
style: {
|
|
1097
|
-
...
|
|
1102
|
+
...OPAQUE_FILTER_ROW_BG,
|
|
1098
1103
|
...getPinningStyles(column, "header"),
|
|
1099
1104
|
...stickyHeader ? {
|
|
1100
1105
|
position: "sticky",
|
|
@@ -1111,9 +1116,9 @@ function DataTable(props) {
|
|
|
1111
1116
|
})
|
|
1112
1117
|
}, column.id)),
|
|
1113
1118
|
hasActionsColumn && /*#__PURE__*/ jsx("td", {
|
|
1114
|
-
className: stickyActions ? `${styles.filterCell()} sticky end-0 bg-table-
|
|
1119
|
+
className: stickyActions ? `${styles.filterCell()} sticky end-0 bg-data-table-filter-row-bg` : styles.filterCell(),
|
|
1115
1120
|
style: {
|
|
1116
|
-
...
|
|
1121
|
+
...OPAQUE_FILTER_ROW_BG,
|
|
1117
1122
|
...stickyHeader ? {
|
|
1118
1123
|
position: "sticky",
|
|
1119
1124
|
top: headerHeight
|
|
@@ -1368,7 +1373,7 @@ function DataTable(props) {
|
|
|
1368
1373
|
children: translations.emptyTitle
|
|
1369
1374
|
}),
|
|
1370
1375
|
/*#__PURE__*/ jsx("p", {
|
|
1371
|
-
className: "text-table-sm",
|
|
1376
|
+
className: "text-data-table-sm",
|
|
1372
1377
|
children: translations.emptyDescription
|
|
1373
1378
|
})
|
|
1374
1379
|
]
|
|
@@ -1424,7 +1429,7 @@ function DataTable(props) {
|
|
|
1424
1429
|
children: header.isPlaceholder ? null : flexRender(header.column.columnDef.footer, header.getContext())
|
|
1425
1430
|
}, header.id)),
|
|
1426
1431
|
hasActionsColumn && /*#__PURE__*/ jsx(Table.Cell, {
|
|
1427
|
-
className: stickyActions ? "sticky end-0 bg-table-footer-bg" : void 0,
|
|
1432
|
+
className: stickyActions ? "sticky end-0 bg-data-table-footer-bg" : void 0,
|
|
1428
1433
|
numeric: true,
|
|
1429
1434
|
style: stickyActions ? {
|
|
1430
1435
|
zIndex: DATA_TABLE_Z.stickyActionsCell
|
|
@@ -1686,7 +1691,7 @@ DataTable.Pagination = function() {
|
|
|
1686
1691
|
}));
|
|
1687
1692
|
return /*#__PURE__*/ jsxs("div", {
|
|
1688
1693
|
className: styles.paginationBar(),
|
|
1689
|
-
style:
|
|
1694
|
+
style: OPAQUE_PAGINATION_BG,
|
|
1690
1695
|
children: [
|
|
1691
1696
|
/*#__PURE__*/ jsx("span", {
|
|
1692
1697
|
className: styles.paginationInfo(),
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Api } from "@zag-js/collapsible";
|
|
2
|
+
import type { PropTypes } from "@zag-js/react";
|
|
3
|
+
export type VerticalNavigationSize = "sm" | "md";
|
|
4
|
+
export type VerticalNavigationTone = "plain" | "subtle" | "accent";
|
|
5
|
+
export type VerticalNavigationVariant = "primary" | "secondary";
|
|
6
|
+
export declare const VerticalNavigationContext: import("react").Context<{
|
|
7
|
+
size: VerticalNavigationSize;
|
|
8
|
+
maxIndentDepth: number;
|
|
9
|
+
dir?: "ltr" | "rtl";
|
|
10
|
+
} | null>;
|
|
11
|
+
export declare const VerticalNavigationDepthContext: import("react").Context<number>;
|
|
12
|
+
export declare const VerticalNavigationBranchContext: import("react").Context<{
|
|
13
|
+
api: Api<PropTypes>;
|
|
14
|
+
containsCurrent: boolean;
|
|
15
|
+
} | null>;
|
|
16
|
+
export declare function useVerticalNavigationContext(): {
|
|
17
|
+
size: VerticalNavigationSize;
|
|
18
|
+
maxIndentDepth: number;
|
|
19
|
+
dir?: "ltr" | "rtl";
|
|
20
|
+
};
|
|
21
|
+
export declare function useVerticalNavigationBranchContext(): {
|
|
22
|
+
api: Api<PropTypes>;
|
|
23
|
+
containsCurrent: boolean;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=vertical-navigation.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertical-navigation.context.d.ts","sourceRoot":"","sources":["../../../../src/internal/molecules/vertical-navigation.context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,MAAM,MAAM,sBAAsB,GAAG,IAAI,GAAG,IAAI,CAAA;AAChD,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAClE,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,WAAW,CAAA;AAE/D,eAAO,MAAM,yBAAyB;UAC9B,sBAAsB;oBACZ,MAAM;UAChB,KAAK,GAAG,KAAK;SACN,CAAA;AACf,eAAO,MAAM,8BAA8B,iCAAmB,CAAA;AAC9D,eAAO,MAAM,+BAA+B;SACrC,GAAG,CAAC,SAAS,CAAC;qBACF,OAAO;SACX,CAAA;AAEf,wBAAgB,4BAA4B;UAVpC,sBAAsB;oBACZ,MAAM;UAChB,KAAK,GAAG,KAAK;EAgBpB;AAED,wBAAgB,kCAAkC;SAd3C,GAAG,CAAC,SAAS,CAAC;qBACF,OAAO;EAqBzB"}
|