@dust-tt/sparkle 0.2.222 → 0.2.224
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/cjs/index.js +72 -40
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/Collapsible.js +9 -9
- package/dist/esm/components/Collapsible.js.map +1 -1
- package/dist/esm/components/DataTable.d.ts +2 -1
- package/dist/esm/components/DataTable.d.ts.map +1 -1
- package/dist/esm/components/DataTable.js +7 -4
- package/dist/esm/components/DataTable.js.map +1 -1
- package/dist/esm/components/DropdownMenu.d.ts +2 -2
- package/dist/esm/components/DropdownMenu.d.ts.map +1 -1
- package/dist/esm/components/DropdownMenu.js +11 -11
- package/dist/esm/components/DropdownMenu.js.map +1 -1
- package/dist/esm/components/Item.js +11 -11
- package/dist/esm/components/Item.js.map +1 -1
- package/dist/esm/components/Tab.js +3 -3
- package/dist/esm/components/Tab.js.map +1 -1
- package/dist/esm/components/Tree.js +2 -2
- package/dist/esm/components/Tree.js.map +1 -1
- package/dist/esm/stories/DataTable.stories.d.ts.map +1 -1
- package/dist/esm/stories/DataTable.stories.js +14 -2
- package/dist/esm/stories/DataTable.stories.js.map +1 -1
- package/dist/sparkle.css +55 -16
- package/package.json +1 -1
- package/src/components/Collapsible.tsx +9 -9
- package/src/components/DataTable.tsx +16 -3
- package/src/components/DropdownMenu.tsx +19 -16
- package/src/components/Item.tsx +13 -13
- package/src/components/Tab.tsx +3 -3
- package/src/components/Tree.tsx +2 -2
- package/src/stories/DataTable.stories.tsx +15 -1
package/dist/sparkle.css
CHANGED
|
@@ -4474,27 +4474,56 @@ select {
|
|
|
4474
4474
|
color: rgb(37 99 235 / var(--tw-text-opacity));
|
|
4475
4475
|
}
|
|
4476
4476
|
|
|
4477
|
-
.s-group:hover .group-hover\:s-text-action-400 {
|
|
4477
|
+
.s-group\/col:hover .group-hover\/col\:s-text-action-400 {
|
|
4478
4478
|
--tw-text-opacity: 1;
|
|
4479
4479
|
color: rgb(96 165 250 / var(--tw-text-opacity));
|
|
4480
4480
|
}
|
|
4481
4481
|
|
|
4482
|
-
.s-group:hover .group-hover\:s-text-action-500 {
|
|
4482
|
+
.s-group\/col:hover .group-hover\/col\:s-text-action-500 {
|
|
4483
4483
|
--tw-text-opacity: 1;
|
|
4484
4484
|
color: rgb(59 130 246 / var(--tw-text-opacity));
|
|
4485
4485
|
}
|
|
4486
4486
|
|
|
4487
|
-
.s-group:hover .group-hover\:s-text-
|
|
4487
|
+
.s-group\/dm:hover .group-hover\/dm\:s-text-action-400 {
|
|
4488
|
+
--tw-text-opacity: 1;
|
|
4489
|
+
color: rgb(96 165 250 / var(--tw-text-opacity));
|
|
4490
|
+
}
|
|
4491
|
+
|
|
4492
|
+
.s-group\/dm:hover .group-hover\/dm\:s-text-action-500 {
|
|
4493
|
+
--tw-text-opacity: 1;
|
|
4494
|
+
color: rgb(59 130 246 / var(--tw-text-opacity));
|
|
4495
|
+
}
|
|
4496
|
+
|
|
4497
|
+
.s-group\/item:hover .group-hover\/item\:s-text-action-400 {
|
|
4498
|
+
--tw-text-opacity: 1;
|
|
4499
|
+
color: rgb(96 165 250 / var(--tw-text-opacity));
|
|
4500
|
+
}
|
|
4501
|
+
|
|
4502
|
+
.s-group\/item:hover .group-hover\/item\:s-text-action-500 {
|
|
4503
|
+
--tw-text-opacity: 1;
|
|
4504
|
+
color: rgb(59 130 246 / var(--tw-text-opacity));
|
|
4505
|
+
}
|
|
4506
|
+
|
|
4507
|
+
.s-group\/item:hover .group-hover\/item\:s-text-warning-300 {
|
|
4488
4508
|
--tw-text-opacity: 1;
|
|
4489
4509
|
color: rgb(252 165 165 / var(--tw-text-opacity));
|
|
4490
4510
|
}
|
|
4491
4511
|
|
|
4492
|
-
.s-group:hover .group-hover\:s-text-warning-400 {
|
|
4512
|
+
.s-group\/item:hover .group-hover\/item\:s-text-warning-400 {
|
|
4493
4513
|
--tw-text-opacity: 1;
|
|
4494
4514
|
color: rgb(248 113 113 / var(--tw-text-opacity));
|
|
4495
4515
|
}
|
|
4496
4516
|
|
|
4497
|
-
.s-group:hover .group-hover\:s-
|
|
4517
|
+
.s-group\/tab:hover .group-hover\/tab\:s-text-action-400 {
|
|
4518
|
+
--tw-text-opacity: 1;
|
|
4519
|
+
color: rgb(96 165 250 / var(--tw-text-opacity));
|
|
4520
|
+
}
|
|
4521
|
+
|
|
4522
|
+
.s-group\/item:hover .group-hover\/item\:s-opacity-100 {
|
|
4523
|
+
opacity: 1;
|
|
4524
|
+
}
|
|
4525
|
+
|
|
4526
|
+
.s-group\/tree:hover .group-hover\/tree\:s-opacity-100 {
|
|
4498
4527
|
opacity: 1;
|
|
4499
4528
|
}
|
|
4500
4529
|
|
|
@@ -4507,12 +4536,12 @@ select {
|
|
|
4507
4536
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
4508
4537
|
}
|
|
4509
4538
|
|
|
4510
|
-
.s-group:active .group-active\:s-text-action-700 {
|
|
4539
|
+
.s-group\/item:active .group-active\/item\:s-text-action-700 {
|
|
4511
4540
|
--tw-text-opacity: 1;
|
|
4512
4541
|
color: rgb(29 78 216 / var(--tw-text-opacity));
|
|
4513
4542
|
}
|
|
4514
4543
|
|
|
4515
|
-
.s-group:active .group-active\:s-text-warning-700 {
|
|
4544
|
+
.s-group\/item:active .group-active\/item\:s-text-warning-700 {
|
|
4516
4545
|
--tw-text-opacity: 1;
|
|
4517
4546
|
color: rgb(185 28 28 / var(--tw-text-opacity));
|
|
4518
4547
|
}
|
|
@@ -4894,37 +4923,47 @@ select {
|
|
|
4894
4923
|
color: rgb(248 113 113 / var(--tw-text-opacity));
|
|
4895
4924
|
}
|
|
4896
4925
|
|
|
4897
|
-
:is(.s-dark .s-group:hover .dark\:group-hover\:s-text-action-400) {
|
|
4926
|
+
:is(.s-dark .s-group\/col:hover .dark\:group-hover\/col\:s-text-action-400-dark) {
|
|
4898
4927
|
--tw-text-opacity: 1;
|
|
4899
|
-
color: rgb(
|
|
4928
|
+
color: rgb(37 99 235 / var(--tw-text-opacity));
|
|
4900
4929
|
}
|
|
4901
4930
|
|
|
4902
|
-
:is(.s-dark .s-group:hover .dark\:group-hover\:s-text-action-
|
|
4931
|
+
:is(.s-dark .s-group\/col:hover .dark\:group-hover\/col\:s-text-action-500-dark) {
|
|
4903
4932
|
--tw-text-opacity: 1;
|
|
4904
|
-
color: rgb(
|
|
4933
|
+
color: rgb(59 130 246 / var(--tw-text-opacity));
|
|
4905
4934
|
}
|
|
4906
4935
|
|
|
4907
|
-
:is(.s-dark .s-group:hover .dark\:group-hover\:s-text-action-
|
|
4936
|
+
:is(.s-dark .s-group\/dm:hover .dark\:group-hover\/dm\:s-text-action-400) {
|
|
4937
|
+
--tw-text-opacity: 1;
|
|
4938
|
+
color: rgb(96 165 250 / var(--tw-text-opacity));
|
|
4939
|
+
}
|
|
4940
|
+
|
|
4941
|
+
:is(.s-dark .s-group\/dm:hover .dark\:group-hover\/dm\:s-text-action-500-dark) {
|
|
4908
4942
|
--tw-text-opacity: 1;
|
|
4909
4943
|
color: rgb(59 130 246 / var(--tw-text-opacity));
|
|
4910
4944
|
}
|
|
4911
4945
|
|
|
4912
|
-
:is(.s-dark .s-group:hover .dark\:group-hover\:s-text-action-600-dark) {
|
|
4946
|
+
:is(.s-dark .s-group\/item:hover .dark\:group-hover\/item\:s-text-action-600-dark) {
|
|
4913
4947
|
--tw-text-opacity: 1;
|
|
4914
4948
|
color: rgb(96 165 250 / var(--tw-text-opacity));
|
|
4915
4949
|
}
|
|
4916
4950
|
|
|
4917
|
-
:is(.s-dark .s-group:hover .dark\:group-hover\:s-text-warning-600-dark) {
|
|
4951
|
+
:is(.s-dark .s-group\/item:hover .dark\:group-hover\/item\:s-text-warning-600-dark) {
|
|
4918
4952
|
--tw-text-opacity: 1;
|
|
4919
4953
|
color: rgb(248 113 113 / var(--tw-text-opacity));
|
|
4920
4954
|
}
|
|
4921
4955
|
|
|
4922
|
-
:is(.s-dark .s-group:
|
|
4956
|
+
:is(.s-dark .s-group\/tab:hover .dark\:group-hover\/tab\:s-text-action-500-dark) {
|
|
4957
|
+
--tw-text-opacity: 1;
|
|
4958
|
+
color: rgb(59 130 246 / var(--tw-text-opacity));
|
|
4959
|
+
}
|
|
4960
|
+
|
|
4961
|
+
:is(.s-dark .s-group\/item:active .dark\:group-active\/item\:s-text-action-400-dark) {
|
|
4923
4962
|
--tw-text-opacity: 1;
|
|
4924
4963
|
color: rgb(37 99 235 / var(--tw-text-opacity));
|
|
4925
4964
|
}
|
|
4926
4965
|
|
|
4927
|
-
:is(.s-dark .s-group:active .dark\:group-active\:s-text-warning-400-dark) {
|
|
4966
|
+
:is(.s-dark .s-group\/item:active .dark\:group-active\/item\:s-text-warning-400-dark) {
|
|
4928
4967
|
--tw-text-opacity: 1;
|
|
4929
4968
|
color: rgb(220 38 38 / var(--tw-text-opacity));
|
|
4930
4969
|
}
|
package/package.json
CHANGED
|
@@ -53,11 +53,11 @@ Collapsible.Button = function ({
|
|
|
53
53
|
const labelClasses = {
|
|
54
54
|
primary: {
|
|
55
55
|
base: "s-text-action-500 s-inline-flex s-transition-colors s-ease-out s-duration-400 s-box-border s-gap-x-2 s-select-none",
|
|
56
|
-
hover: "group-hover:s-text-action-400",
|
|
56
|
+
hover: "group-hover/col:s-text-action-400",
|
|
57
57
|
active: "active:s-text-action-600",
|
|
58
58
|
dark: {
|
|
59
59
|
base: "dark:s-text-action-500-dark",
|
|
60
|
-
hover: "dark:group-hover:s-text-action-400-dark",
|
|
60
|
+
hover: "dark:group-hover/col:s-text-action-400-dark",
|
|
61
61
|
active: "dark:active:s-text-action-600-dark",
|
|
62
62
|
disabled: "dark:s-element-500-dark",
|
|
63
63
|
},
|
|
@@ -66,11 +66,11 @@ Collapsible.Button = function ({
|
|
|
66
66
|
|
|
67
67
|
secondary: {
|
|
68
68
|
base: "s-text-element-900 s-inline-flex s-transition-colors s-ease-out s-duration-400 s-box-border s-gap-x-2 s-select-none",
|
|
69
|
-
hover: "group-hover:s-text-action-500",
|
|
69
|
+
hover: "group-hover/col:s-text-action-500",
|
|
70
70
|
active: "active:s-text-action-600",
|
|
71
71
|
dark: {
|
|
72
72
|
base: "dark:s-text-element-900-dark",
|
|
73
|
-
hover: "dark:group-hover:s-text-action-400-dark",
|
|
73
|
+
hover: "dark:group-hover/col:s-text-action-400-dark",
|
|
74
74
|
active: "dark:active:s-text-action-600-dark",
|
|
75
75
|
disabled: "dark:s-element-500-dark",
|
|
76
76
|
},
|
|
@@ -81,24 +81,24 @@ Collapsible.Button = function ({
|
|
|
81
81
|
const chevronClasses = {
|
|
82
82
|
primary: {
|
|
83
83
|
base: "s-text-element-600",
|
|
84
|
-
hover: "group-hover:s-text-action-400",
|
|
84
|
+
hover: "group-hover/col:s-text-action-400",
|
|
85
85
|
active: "active:s-text-action-700",
|
|
86
86
|
disabled: "s-element-500",
|
|
87
87
|
dark: {
|
|
88
88
|
base: "dark:s-text-element-600-dark",
|
|
89
|
-
hover: "dark:group-hover:s-text-action-500-dark",
|
|
89
|
+
hover: "dark:group-hover/col:s-text-action-500-dark",
|
|
90
90
|
active: "dark:active:s-text-action-700-dark",
|
|
91
91
|
disabled: "dark:s-element-500-dark",
|
|
92
92
|
},
|
|
93
93
|
},
|
|
94
94
|
secondary: {
|
|
95
95
|
base: "s-text-element-600",
|
|
96
|
-
hover: "group-hover:s-text-action-400",
|
|
96
|
+
hover: "group-hover/col:s-text-action-400",
|
|
97
97
|
active: "active:s-text-action-700",
|
|
98
98
|
disabled: "s-element-500",
|
|
99
99
|
dark: {
|
|
100
100
|
base: "dark:s-text-element-600-dark",
|
|
101
|
-
hover: "dark:group-hover:s-text-action-500-dark",
|
|
101
|
+
hover: "dark:group-hover/col:s-text-action-500-dark",
|
|
102
102
|
active: "dark:active:s-text-action-700-dark",
|
|
103
103
|
disabled: "dark:s-element-500-dark",
|
|
104
104
|
},
|
|
@@ -131,7 +131,7 @@ Collapsible.Button = function ({
|
|
|
131
131
|
className={classNames(
|
|
132
132
|
disabled ? "s-cursor-default" : "s-cursor-pointer",
|
|
133
133
|
className,
|
|
134
|
-
"s-group s-flex s-items-center s-justify-items-center s-gap-1 s-text-sm s-font-medium focus:s-outline-none focus:s-ring-0"
|
|
134
|
+
"s-group/col s-flex s-items-center s-justify-items-center s-gap-1 s-text-sm s-font-medium focus:s-outline-none focus:s-ring-0"
|
|
135
135
|
)}
|
|
136
136
|
>
|
|
137
137
|
<Icon
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
} from "@sparkle/components/DropdownMenu";
|
|
19
19
|
import { IconButton } from "@sparkle/components/IconButton";
|
|
20
20
|
import { ArrowDownIcon, ArrowUpIcon, MoreIcon } from "@sparkle/icons";
|
|
21
|
+
import { Tooltip } from "@sparkle/index_with_tw_base";
|
|
21
22
|
import { classNames } from "@sparkle/lib/utils";
|
|
22
23
|
|
|
23
24
|
import { Icon } from "./Icon";
|
|
@@ -251,7 +252,7 @@ DataTable.Row = function Row({
|
|
|
251
252
|
return (
|
|
252
253
|
<tr
|
|
253
254
|
className={classNames(
|
|
254
|
-
"s-group s-border-b s-border-structure-200 s-text-sm s-transition-colors s-duration-300 s-ease-out",
|
|
255
|
+
"s-group/dt s-border-b s-border-structure-200 s-text-sm s-transition-colors s-duration-300 s-ease-out",
|
|
255
256
|
onClick ? "s-cursor-pointer hover:s-bg-structure-50" : "",
|
|
256
257
|
className || ""
|
|
257
258
|
)}
|
|
@@ -260,7 +261,7 @@ DataTable.Row = function Row({
|
|
|
260
261
|
>
|
|
261
262
|
{children}
|
|
262
263
|
<td className="s-w-1 s-cursor-pointer s-pl-1 s-text-element-600">
|
|
263
|
-
{moreMenuItems && (
|
|
264
|
+
{moreMenuItems && moreMenuItems.length > 0 && (
|
|
264
265
|
<DropdownMenu className="s-mr-1.5 s-flex">
|
|
265
266
|
<DropdownMenu.Button
|
|
266
267
|
onClick={(e) => {
|
|
@@ -301,6 +302,7 @@ DataTable.Cell = function Cell({ children, className, ...props }: CellProps) {
|
|
|
301
302
|
|
|
302
303
|
interface CellContentProps extends React.TdHTMLAttributes<HTMLDivElement> {
|
|
303
304
|
avatarUrl?: string;
|
|
305
|
+
avatarTooltipLabel?: string;
|
|
304
306
|
icon?: React.ComponentType<{ className?: string }>;
|
|
305
307
|
iconClassName?: string;
|
|
306
308
|
roundedAvatar?: boolean;
|
|
@@ -312,6 +314,7 @@ DataTable.CellContent = function CellContent({
|
|
|
312
314
|
children,
|
|
313
315
|
className,
|
|
314
316
|
avatarUrl,
|
|
317
|
+
avatarTooltipLabel,
|
|
315
318
|
roundedAvatar,
|
|
316
319
|
icon,
|
|
317
320
|
iconClassName,
|
|
@@ -323,7 +326,17 @@ DataTable.CellContent = function CellContent({
|
|
|
323
326
|
className={classNames("s-flex s-items-center s-py-2", className || "")}
|
|
324
327
|
{...props}
|
|
325
328
|
>
|
|
326
|
-
{avatarUrl && (
|
|
329
|
+
{avatarUrl && avatarTooltipLabel && (
|
|
330
|
+
<Tooltip label={avatarTooltipLabel} position="above">
|
|
331
|
+
<Avatar
|
|
332
|
+
visual={avatarUrl}
|
|
333
|
+
size="xs"
|
|
334
|
+
className="s-mr-2"
|
|
335
|
+
isRounded={roundedAvatar ?? false}
|
|
336
|
+
/>
|
|
337
|
+
</Tooltip>
|
|
338
|
+
)}
|
|
339
|
+
{avatarUrl && !avatarTooltipLabel && (
|
|
327
340
|
<Avatar
|
|
328
341
|
visual={avatarUrl}
|
|
329
342
|
size="xs"
|
|
@@ -3,6 +3,7 @@ import React, {
|
|
|
3
3
|
ComponentType,
|
|
4
4
|
Fragment,
|
|
5
5
|
JSXElementConstructor,
|
|
6
|
+
MouseEvent,
|
|
6
7
|
MouseEventHandler,
|
|
7
8
|
MutableRefObject,
|
|
8
9
|
ReactElement,
|
|
@@ -28,11 +29,11 @@ const ButtonRefContext =
|
|
|
28
29
|
|
|
29
30
|
const labelClasses = {
|
|
30
31
|
base: "s-text-element-900 s-inline-flex s-transition-colors s-ease-out s-duration-400 s-box-border s-gap-x-2 s-select-none",
|
|
31
|
-
hover: "group-hover:s-text-action-500",
|
|
32
|
+
hover: "group-hover/dm:s-text-action-500",
|
|
32
33
|
active: "active:s-text-action-700",
|
|
33
34
|
dark: {
|
|
34
35
|
base: "dark:s-text-element-900-dark",
|
|
35
|
-
hover: "dark:group-hover:s-text-action-400",
|
|
36
|
+
hover: "dark:group-hover/dm:s-text-action-400",
|
|
36
37
|
active: "dark:active:s-text-action-600",
|
|
37
38
|
disabled: "dark:s-element-500-dark",
|
|
38
39
|
},
|
|
@@ -46,23 +47,23 @@ const labelSizeClasses = {
|
|
|
46
47
|
|
|
47
48
|
const iconClasses = {
|
|
48
49
|
base: "s-text-element-700 s-transition-colors s-ease-out s-duration-400",
|
|
49
|
-
hover: "group-hover:s-text-action-500",
|
|
50
|
+
hover: "group-hover/dm:s-text-action-500",
|
|
50
51
|
active: "active:s-text-action-700",
|
|
51
52
|
disabled: "s-opacity-50",
|
|
52
53
|
dark: {
|
|
53
54
|
base: "dark:s-text-element-700-dark",
|
|
54
|
-
hover: "dark:group-hover:s-text-action-500-dark",
|
|
55
|
+
hover: "dark:group-hover/dm:s-text-action-500-dark",
|
|
55
56
|
active: "dark:active:s-text-action-600",
|
|
56
57
|
},
|
|
57
58
|
};
|
|
58
59
|
|
|
59
60
|
const chevronClasses = {
|
|
60
61
|
base: "s-text-element-600 s-mt-0.5",
|
|
61
|
-
hover: "group-hover:s-text-action-400",
|
|
62
|
+
hover: "group-hover/dm:s-text-action-400",
|
|
62
63
|
disabled: "s-element-500",
|
|
63
64
|
dark: {
|
|
64
65
|
base: "dark:s-text-element-600-dark",
|
|
65
|
-
hover: "dark:group-hover:s-text-action-500-dark",
|
|
66
|
+
hover: "dark:group-hover/dm:s-text-action-500-dark",
|
|
66
67
|
disabled: "dark:s-element-500-dark",
|
|
67
68
|
},
|
|
68
69
|
};
|
|
@@ -155,7 +156,7 @@ DropdownMenu.Button = function ({
|
|
|
155
156
|
className={classNames(
|
|
156
157
|
disabled ? "s-cursor-default" : "s-cursor-pointer",
|
|
157
158
|
className,
|
|
158
|
-
"s-group s-flex s-justify-items-center s-text-sm s-font-medium focus:s-outline-none focus:s-ring-0",
|
|
159
|
+
"s-group/dm s-flex s-justify-items-center s-text-sm s-font-medium focus:s-outline-none focus:s-ring-0",
|
|
159
160
|
label ? "s-gap-1.5" : "s-gap-0"
|
|
160
161
|
)}
|
|
161
162
|
onClick={onClick}
|
|
@@ -188,7 +189,7 @@ DropdownMenu.Button = function ({
|
|
|
188
189
|
className={classNames(
|
|
189
190
|
disabled ? "s-cursor-default" : "s-cursor-pointer",
|
|
190
191
|
className,
|
|
191
|
-
"s-group s-flex s-justify-items-center s-text-sm s-font-medium focus:s-outline-none focus:s-ring-0",
|
|
192
|
+
"s-group/dm s-flex s-justify-items-center s-text-sm s-font-medium focus:s-outline-none focus:s-ring-0",
|
|
192
193
|
label ? (size === "md" ? "s-gap-2" : "s-gap-1.5") : "s-gap-0.5"
|
|
193
194
|
)}
|
|
194
195
|
>
|
|
@@ -207,7 +208,7 @@ DropdownMenu.Button = function ({
|
|
|
207
208
|
className={classNames(
|
|
208
209
|
disabled ? "s-cursor-default" : "s-cursor-pointer",
|
|
209
210
|
className,
|
|
210
|
-
"s-group s-flex s-justify-items-center s-text-sm s-font-medium focus:s-outline-none focus:s-ring-0",
|
|
211
|
+
"s-group/dm s-flex s-justify-items-center s-text-sm s-font-medium focus:s-outline-none focus:s-ring-0",
|
|
211
212
|
label ? (size === "md" ? "s-gap-2" : "s-gap-1.5") : "s-gap-0.5",
|
|
212
213
|
type === "submenu" ? "s-opacity-50" : ""
|
|
213
214
|
)}
|
|
@@ -240,7 +241,7 @@ export interface DropdownItemProps {
|
|
|
240
241
|
disabled?: boolean;
|
|
241
242
|
visual?: string | React.ReactNode;
|
|
242
243
|
icon?: ComponentType;
|
|
243
|
-
onClick?: () => void;
|
|
244
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
244
245
|
selected?: boolean;
|
|
245
246
|
hasChildren?: boolean;
|
|
246
247
|
children?: React.ReactNode;
|
|
@@ -265,23 +266,25 @@ DropdownMenu.Item = function ({
|
|
|
265
266
|
{hasChildren ? (
|
|
266
267
|
<DropdownMenu className="s-w-full s-gap-x-2 s-py-2">
|
|
267
268
|
<DropdownMenu.Button
|
|
269
|
+
className="s-w-full"
|
|
270
|
+
disabled={disabled}
|
|
268
271
|
label={label}
|
|
269
272
|
type="submenu"
|
|
270
|
-
className="s-w-full"
|
|
271
273
|
/>
|
|
272
274
|
{children}
|
|
273
275
|
</DropdownMenu>
|
|
274
276
|
) : (
|
|
275
277
|
<StandardItem.Dropdown
|
|
276
|
-
style={variant}
|
|
277
278
|
className="s-w-full"
|
|
279
|
+
description={description}
|
|
280
|
+
disabled={disabled}
|
|
278
281
|
href={href}
|
|
279
|
-
onClick={onClick}
|
|
280
|
-
label={label}
|
|
281
|
-
visual={visual}
|
|
282
282
|
icon={icon}
|
|
283
|
-
|
|
283
|
+
label={label}
|
|
284
|
+
onClick={onClick}
|
|
284
285
|
selected={selected}
|
|
286
|
+
style={variant}
|
|
287
|
+
visual={visual}
|
|
285
288
|
/>
|
|
286
289
|
)}
|
|
287
290
|
</Menu.Item>
|
package/src/components/Item.tsx
CHANGED
|
@@ -19,12 +19,12 @@ const labelStyleClasses = {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
const labelColorClasses = {
|
|
22
|
-
item: "s-text-element-600 dark:s-text-element-500-dark group-hover:s-text-action-500 group-active:s-text-action-700 dark:group-hover:s-text-action-600-dark dark:group-active:s-text-action-400-dark",
|
|
22
|
+
item: "s-text-element-600 dark:s-text-element-500-dark group-hover/item:s-text-action-500 group-active/item:s-text-action-700 dark:group-hover/item:s-text-action-600-dark dark:group-active/item:s-text-action-400-dark",
|
|
23
23
|
action:
|
|
24
|
-
"s-text-element-800 dark:s-text-element-800-dark group-hover:s-text-action-500 group-active:s-text-action-700 dark:group-hover:s-text-action-600-dark dark:group-active:s-text-action-400-dark",
|
|
25
|
-
link: "s-text-element-800 dark:s-text-element-800-dark group-hover:s-text-action-500 group-active:s-text-action-700 dark:group-hover:s-text-action-600-dark dark:group-active:s-text-action-400-dark",
|
|
24
|
+
"s-text-element-800 dark:s-text-element-800-dark group-hover/item:s-text-action-500 group-active/item:s-text-action-700 dark:group-hover/item:s-text-action-600-dark dark:group-active/item:s-text-action-400-dark",
|
|
25
|
+
link: "s-text-element-800 dark:s-text-element-800-dark group-hover/item:s-text-action-500 group-active/item:s-text-action-700 dark:group-hover/item:s-text-action-600-dark dark:group-active/item:s-text-action-400-dark",
|
|
26
26
|
warning:
|
|
27
|
-
"s-text-warning-500 dark:s-text-warning-400-dark group-hover:s-text-warning-400 group-active:s-text-warning-700 dark:group-hover:s-text-warning-600-dark dark:group-active:s-text-warning-400-dark",
|
|
27
|
+
"s-text-warning-500 dark:s-text-warning-400-dark group-hover/item:s-text-warning-400 group-active/item:s-text-warning-700 dark:group-hover/item:s-text-warning-600-dark dark:group-active/item:s-text-warning-400-dark",
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const spacingClasses = {
|
|
@@ -34,12 +34,12 @@ const spacingClasses = {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
const iconClasses = {
|
|
37
|
-
item: "s-text-element-600 group-hover:s-text-action-400 group-active:s-text-action-700 dark:group-hover:s-text-action-600-dark dark:group-active:s-text-action-400-dark",
|
|
37
|
+
item: "s-text-element-600 group-hover/item:s-text-action-400 group-active/item:s-text-action-700 dark:group-hover/item:s-text-action-600-dark dark:group-active/item:s-text-action-400-dark",
|
|
38
38
|
action:
|
|
39
|
-
"s-text-element-600 group-hover:s-text-action-400 group-active:s-text-action-700 dark:group-hover:s-text-action-600-dark dark:group-active:s-text-action-400-dark",
|
|
40
|
-
link: "s-text-brand group-hover:s-text-action-400 group-active:s-text-action-700 dark:group-hover:s-text-action-600-dark dark:group-active:s-text-action-400-dark",
|
|
39
|
+
"s-text-element-600 group-hover/item:s-text-action-400 group-active/item:s-text-action-700 dark:group-hover/item:s-text-action-600-dark dark:group-active/item:s-text-action-400-dark",
|
|
40
|
+
link: "s-text-brand group-hover/item:s-text-action-400 group-active/item:s-text-action-700 dark:group-hover/item:s-text-action-600-dark dark:group-active/item:s-text-action-400-dark",
|
|
41
41
|
warning:
|
|
42
|
-
"s-text-warning-400 group-hover:s-text-warning-300 group-active:s-text-warning-700 dark:group-hover:s-text-warning-600-dark dark:group-active:s-text-warning-400-dark",
|
|
42
|
+
"s-text-warning-400 group-hover/item:s-text-warning-300 group-active/item:s-text-warning-700 dark:group-hover/item:s-text-warning-600-dark dark:group-active/item:s-text-warning-400-dark",
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
type ItemProps = {
|
|
@@ -112,9 +112,9 @@ export function Item({
|
|
|
112
112
|
return (
|
|
113
113
|
<Link
|
|
114
114
|
className={classNames(
|
|
115
|
-
"s-duration-400 s-group s-box-border s-flex s-select-none s-text-sm s-transition-colors s-ease-out",
|
|
115
|
+
"s-duration-400 s-group/item s-box-border s-flex s-select-none s-text-sm s-transition-colors s-ease-out",
|
|
116
116
|
spacingClasses[spacing],
|
|
117
|
-
disabled ? "" : "s-cursor-pointer",
|
|
117
|
+
disabled ? "s-cursor-default" : "s-cursor-pointer",
|
|
118
118
|
className
|
|
119
119
|
)}
|
|
120
120
|
onClick={selected || disabled ? undefined : onClick}
|
|
@@ -161,15 +161,15 @@ export function Item({
|
|
|
161
161
|
? classNames(
|
|
162
162
|
"s-shrink-0 s-transition-all s-duration-200 s-ease-out",
|
|
163
163
|
hasAction === "hover"
|
|
164
|
-
? "s-opacity-0 group-hover:s-opacity-100"
|
|
164
|
+
? "s-opacity-0 group-hover/item:s-opacity-100"
|
|
165
165
|
: "",
|
|
166
166
|
disabled
|
|
167
167
|
? "s-text-element-500 dark:s-text-element-500-dark"
|
|
168
168
|
: selected
|
|
169
169
|
? "s-text-action-400 s-opacity-100 dark:s-text-action-600-dark"
|
|
170
170
|
: classNames(
|
|
171
|
-
"s-text-element-600 group-hover:s-text-action-400 group-active:s-text-action-700 dark:group-hover:s-text-action-600-dark dark:group-active:s-text-action-400-dark",
|
|
172
|
-
hasAction ? "group-hover:s-opacity-100" : ""
|
|
171
|
+
"s-text-element-600 group-hover/item:s-text-action-400 group-active/item:s-text-action-700 dark:group-hover/item:s-text-action-600-dark dark:group-active/item:s-text-action-400-dark",
|
|
172
|
+
hasAction ? "group-hover/item:s-opacity-100" : ""
|
|
173
173
|
)
|
|
174
174
|
)
|
|
175
175
|
: "s-hidden"
|
package/src/components/Tab.tsx
CHANGED
|
@@ -71,10 +71,10 @@ const tabClasses = {
|
|
|
71
71
|
const iconClasses = {
|
|
72
72
|
default: {
|
|
73
73
|
base: "s-text-element-600",
|
|
74
|
-
hover: "group-hover:s-text-action-400",
|
|
74
|
+
hover: "group-hover/tab:s-text-action-400",
|
|
75
75
|
dark: {
|
|
76
76
|
base: "dark:s-text-element-600-dark",
|
|
77
|
-
hover: "dark:group-hover:s-text-action-500-dark",
|
|
77
|
+
hover: "dark:group-hover/tab:s-text-action-500-dark",
|
|
78
78
|
},
|
|
79
79
|
},
|
|
80
80
|
selected: {
|
|
@@ -125,7 +125,7 @@ export function Tab<E>({
|
|
|
125
125
|
: iconClasses.default;
|
|
126
126
|
|
|
127
127
|
const finalTabClasses = classNames(
|
|
128
|
-
"s-group s-justify-center s-flex s-text-sm s-font-semibold s-py-2.5 s-transition-all ease-out s-duration-400 s-whitespace-nowrap s-select-none",
|
|
128
|
+
"s-group/tab s-justify-center s-flex s-text-sm s-font-semibold s-py-2.5 s-transition-all ease-out s-duration-400 s-whitespace-nowrap s-select-none",
|
|
129
129
|
variant === "default"
|
|
130
130
|
? tab.icon
|
|
131
131
|
? tab.hideLabel
|
package/src/components/Tree.tsx
CHANGED
|
@@ -130,7 +130,7 @@ Tree.Item = function ({
|
|
|
130
130
|
const childrenToRender = getChildren();
|
|
131
131
|
|
|
132
132
|
const treeItemStyleClasses = {
|
|
133
|
-
base: "s-group s-flex s-cursor-default s-flex-row s-items-center",
|
|
133
|
+
base: "s-group/tree s-flex s-cursor-default s-flex-row s-items-center",
|
|
134
134
|
isNavigatableBase:
|
|
135
135
|
"s-border s-transition-colors s-duration-300 s-ease-out s-cursor-pointer",
|
|
136
136
|
isNavigatableUnselected:
|
|
@@ -200,7 +200,7 @@ Tree.Item = function ({
|
|
|
200
200
|
className={classNames(
|
|
201
201
|
"s-flex s-gap-2 s-pl-4",
|
|
202
202
|
areActionsFading
|
|
203
|
-
? "s-transform s-opacity-0 s-duration-300 group-hover:s-opacity-100"
|
|
203
|
+
? "s-transform s-opacity-0 s-duration-300 group-hover/tree:s-opacity-100"
|
|
204
204
|
: ""
|
|
205
205
|
)}
|
|
206
206
|
>
|
|
@@ -21,6 +21,7 @@ type Data = {
|
|
|
21
21
|
lastUpdated: string;
|
|
22
22
|
size: string;
|
|
23
23
|
avatarUrl?: string;
|
|
24
|
+
avatarTooltipLabel?: string;
|
|
24
25
|
icon?: React.ComponentType<{ className?: string }>;
|
|
25
26
|
onClick?: () => void;
|
|
26
27
|
moreMenuItems?: DropdownItemProps[];
|
|
@@ -29,6 +30,17 @@ type Data = {
|
|
|
29
30
|
|
|
30
31
|
export const DataTableExample = () => {
|
|
31
32
|
const data: Data[] = [
|
|
33
|
+
{
|
|
34
|
+
name: "Soupinou with tooltip on avatar",
|
|
35
|
+
usedBy: 100,
|
|
36
|
+
addedBy: "User1",
|
|
37
|
+
lastUpdated: "July 8, 2023",
|
|
38
|
+
size: "32kb",
|
|
39
|
+
avatarUrl: "https://avatars.githubusercontent.com/u/138893015?s=200&v=4",
|
|
40
|
+
avatarTooltipLabel: "Meow",
|
|
41
|
+
roundedAvatar: true,
|
|
42
|
+
onClick: () => console.log("hehe"),
|
|
43
|
+
},
|
|
32
44
|
{
|
|
33
45
|
name: "Marketing",
|
|
34
46
|
description: "(23 items)",
|
|
@@ -49,8 +61,9 @@ export const DataTableExample = () => {
|
|
|
49
61
|
icon: FolderIcon,
|
|
50
62
|
moreMenuItems: [
|
|
51
63
|
{
|
|
52
|
-
label: "Edit",
|
|
64
|
+
label: "Edit (disabled)",
|
|
53
65
|
onClick: () => console.log("Edit"),
|
|
66
|
+
disabled: true,
|
|
54
67
|
},
|
|
55
68
|
],
|
|
56
69
|
},
|
|
@@ -99,6 +112,7 @@ export const DataTableExample = () => {
|
|
|
99
112
|
cell: (info) => (
|
|
100
113
|
<DataTable.CellContent
|
|
101
114
|
avatarUrl={info.row.original.avatarUrl}
|
|
115
|
+
avatarTooltipLabel={info.row.original.avatarTooltipLabel}
|
|
102
116
|
icon={info.row.original.icon}
|
|
103
117
|
description={info.row.original.description}
|
|
104
118
|
roundedAvatar={info.row.original.roundedAvatar}
|