@dust-tt/sparkle 0.3.3 → 0.3.5
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 +1 -1
- package/dist/esm/components/Avatar.d.ts +4 -2
- package/dist/esm/components/Avatar.d.ts.map +1 -1
- package/dist/esm/components/Avatar.js +10 -2
- package/dist/esm/components/Avatar.js.map +1 -1
- package/dist/esm/components/Card.d.ts +2 -2
- package/dist/esm/components/Card.d.ts.map +1 -1
- package/dist/esm/components/Card.js +11 -13
- package/dist/esm/components/Card.js.map +1 -1
- package/dist/esm/components/Checkbox.d.ts +1 -0
- package/dist/esm/components/Checkbox.d.ts.map +1 -1
- package/dist/esm/components/Checkbox.js +4 -5
- package/dist/esm/components/Checkbox.js.map +1 -1
- package/dist/esm/components/Chip.js +25 -40
- package/dist/esm/components/Chip.js.map +1 -1
- package/dist/esm/components/IconButton.d.ts +9 -7
- package/dist/esm/components/IconButton.d.ts.map +1 -1
- package/dist/esm/components/IconButton.js +13 -15
- package/dist/esm/components/IconButton.js.map +1 -1
- package/dist/esm/components/Label.d.ts +6 -2
- package/dist/esm/components/Label.d.ts.map +1 -1
- package/dist/esm/components/Label.js +16 -6
- package/dist/esm/components/Label.js.map +1 -1
- package/dist/esm/components/NavigationList.d.ts.map +1 -1
- package/dist/esm/components/NavigationList.js +4 -5
- package/dist/esm/components/NavigationList.js.map +1 -1
- package/dist/esm/components/Notification.js +11 -11
- package/dist/esm/components/Notification.js.map +1 -1
- package/dist/esm/icons/app/Atom.js +2 -2
- package/dist/esm/icons/app/Atom.js.map +1 -1
- package/dist/esm/icons/app/CodeBlock.js +2 -2
- package/dist/esm/icons/app/CodeBlock.js.map +1 -1
- package/dist/esm/icons/app/ContactsRobot.js +1 -1
- package/dist/esm/icons/app/ContactsRobot.js.map +1 -1
- package/dist/esm/icons/app/ContactsUser.js +1 -1
- package/dist/esm/icons/app/ContactsUser.js.map +1 -1
- package/dist/esm/icons/app/Robot.js +1 -1
- package/dist/esm/icons/app/SidebarLeftClose.d.ts.map +1 -1
- package/dist/esm/icons/app/SidebarLeftClose.js +1 -2
- package/dist/esm/icons/app/SidebarLeftClose.js.map +1 -1
- package/dist/esm/icons/app/SidebarLeftOpen.d.ts.map +1 -1
- package/dist/esm/icons/app/SidebarLeftOpen.js +1 -2
- package/dist/esm/icons/app/SidebarLeftOpen.js.map +1 -1
- package/dist/esm/icons/app/SidebarRightClose.d.ts.map +1 -1
- package/dist/esm/icons/app/SidebarRightClose.js +1 -2
- package/dist/esm/icons/app/SidebarRightClose.js.map +1 -1
- package/dist/esm/icons/app/SidebarRightOpen.d.ts.map +1 -1
- package/dist/esm/icons/app/SidebarRightOpen.js +1 -2
- package/dist/esm/icons/app/SidebarRightOpen.js.map +1 -1
- package/dist/esm/icons/src/app/atom.svg +2 -2
- package/dist/esm/icons/src/app/code-block.svg +2 -2
- package/dist/esm/icons/src/app/contacts-robot.svg +1 -1
- package/dist/esm/icons/src/app/contacts-user.svg +1 -1
- package/dist/esm/icons/src/app/robot.svg +1 -1
- package/dist/esm/icons/src/app/sidebar-left-close.svg +1 -2
- package/dist/esm/icons/src/app/sidebar-left-open.svg +1 -2
- package/dist/esm/icons/src/app/sidebar-right-close.svg +1 -2
- package/dist/esm/icons/src/app/sidebar-right-open.svg +1 -2
- package/dist/esm/stories/Card.stories.js +2 -2
- package/dist/esm/stories/Card.stories.js.map +1 -1
- package/dist/esm/stories/IconButton.stories.d.ts +1 -10
- package/dist/esm/stories/IconButton.stories.d.ts.map +1 -1
- package/dist/esm/styles/global.css +1 -1
- package/package.json +1 -1
- package/src/components/Avatar.tsx +12 -4
- package/src/components/Card.tsx +27 -33
- package/src/components/Checkbox.tsx +5 -7
- package/src/components/Chip.tsx +70 -70
- package/src/components/IconButton.tsx +64 -59
- package/src/components/Label.tsx +28 -11
- package/src/components/NavigationList.tsx +2 -5
- package/src/components/Notification.tsx +12 -12
- package/src/icons/app/Atom.tsx +2 -2
- package/src/icons/app/CodeBlock.tsx +2 -2
- package/src/icons/app/ContactsRobot.tsx +1 -1
- package/src/icons/app/ContactsUser.tsx +1 -1
- package/src/icons/app/Robot.tsx +1 -1
- package/src/icons/app/SidebarLeftClose.tsx +1 -4
- package/src/icons/app/SidebarLeftOpen.tsx +1 -4
- package/src/icons/app/SidebarRightClose.tsx +1 -4
- package/src/icons/app/SidebarRightOpen.tsx +1 -4
- package/src/icons/src/app/atom.svg +2 -2
- package/src/icons/src/app/code-block.svg +2 -2
- package/src/icons/src/app/contacts-robot.svg +1 -1
- package/src/icons/src/app/contacts-user.svg +1 -1
- package/src/icons/src/app/robot.svg +1 -1
- package/src/icons/src/app/sidebar-left-close.svg +1 -2
- package/src/icons/src/app/sidebar-left-open.svg +1 -2
- package/src/icons/src/app/sidebar-right-close.svg +1 -2
- package/src/icons/src/app/sidebar-right-open.svg +1 -2
- package/src/stories/Card.stories.tsx +2 -2
- package/src/styles/global.css +1 -1
package/src/components/Chip.tsx
CHANGED
|
@@ -29,62 +29,75 @@ export const CHIP_COLORS = [
|
|
|
29
29
|
|
|
30
30
|
type ChipColorType = (typeof CHIP_COLORS)[number];
|
|
31
31
|
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
32
|
+
const chipVariants = cva("s-inline-flex s-box-border s-items-center", {
|
|
33
|
+
variants: {
|
|
34
|
+
size: {
|
|
35
|
+
mini: "s-rounded-md s-min-h-5 s-text-xs s-font-medium s-px-1.5 s-py-1 s-gap-0.5",
|
|
36
|
+
xs: "s-rounded-lg s-min-h-7 s-heading-xs s-px-3 s-gap-1",
|
|
37
|
+
sm: "s-rounded-xl s-min-h-9 s-heading-sm s-px-4 s-gap-1.5",
|
|
38
|
+
},
|
|
39
|
+
color: {
|
|
40
|
+
primary: cn(
|
|
41
|
+
"s-bg-muted-background s-border-border",
|
|
42
|
+
"s-text-primary-900",
|
|
43
|
+
"dark:s-bg-muted-background-night dark:s-border-border-night",
|
|
44
|
+
"dark:s-text-primary-900-night"
|
|
45
|
+
),
|
|
46
|
+
highlight: cn(
|
|
47
|
+
"s-bg-highlight-100 s-border-highlight-200",
|
|
48
|
+
"s-text-highlight-900",
|
|
49
|
+
"dark:s-bg-highlight-100-night dark:s-border-highlight-200-night",
|
|
50
|
+
"dark:s-text-highlight-900-night"
|
|
51
|
+
),
|
|
52
|
+
success: cn(
|
|
53
|
+
"s-bg-success-100 s-border-success-200",
|
|
54
|
+
"s-text-success-900",
|
|
55
|
+
"dark:s-bg-success-100-night dark:s-border-success-200-night",
|
|
56
|
+
"dark:s-text-success-900-night"
|
|
57
|
+
),
|
|
58
|
+
info: cn(
|
|
59
|
+
"s-bg-info-100 s-border-info-200",
|
|
60
|
+
"s-text-info-900",
|
|
61
|
+
"dark:s-bg-info-100-night dark:s-border-info-200-night",
|
|
62
|
+
"dark:s-text-info-900-night"
|
|
63
|
+
),
|
|
64
|
+
warning: cn(
|
|
65
|
+
"s-bg-warning-100 s-border-warning-200",
|
|
66
|
+
"s-text-warning-900",
|
|
67
|
+
"dark:s-bg-warning-100-night dark:s-border-warning-200-night",
|
|
68
|
+
"dark:s-text-warning-900-night"
|
|
69
|
+
),
|
|
70
|
+
green: cn(
|
|
71
|
+
"s-bg-green-100 s-border-green-200",
|
|
72
|
+
"s-text-green-900",
|
|
73
|
+
"dark:s-bg-green-100-night dark:s-border-green-200-night",
|
|
74
|
+
"dark:s-text-green-900-night"
|
|
75
|
+
),
|
|
76
|
+
blue: cn(
|
|
77
|
+
"s-bg-blue-100 s-border-blue-200",
|
|
78
|
+
"s-text-blue-900",
|
|
79
|
+
"dark:s-bg-blue-100-night dark:s-border-blue-200-night",
|
|
80
|
+
"dark:s-text-blue-900-night"
|
|
81
|
+
),
|
|
82
|
+
rose: cn(
|
|
83
|
+
"s-bg-rose-100 s-border-rose-200",
|
|
84
|
+
"s-text-rose-900",
|
|
85
|
+
"dark:s-bg-rose-100-night dark:s-border-rose-200-night",
|
|
86
|
+
"dark:s-text-rose-900-night"
|
|
87
|
+
),
|
|
88
|
+
golden: cn(
|
|
89
|
+
"s-bg-golden-100 s-border-golden-200",
|
|
90
|
+
"s-text-golden-900",
|
|
91
|
+
"dark:s-bg-golden-100-night dark:s-border-golden-200-night",
|
|
92
|
+
"dark:s-text-golden-900-night"
|
|
93
|
+
),
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
defaultVariants: {
|
|
97
|
+
size: "xs",
|
|
98
|
+
color: "primary",
|
|
99
|
+
},
|
|
100
|
+
});
|
|
88
101
|
|
|
89
102
|
const closeIconVariants: Record<ChipColorType, string> = {
|
|
90
103
|
primary: cn(
|
|
@@ -125,19 +138,6 @@ const closeIconVariants: Record<ChipColorType, string> = {
|
|
|
125
138
|
),
|
|
126
139
|
};
|
|
127
140
|
|
|
128
|
-
const chipVariants = cva("s-inline-flex s-box-border s-items-center", {
|
|
129
|
-
variants: {
|
|
130
|
-
size: sizeVariants,
|
|
131
|
-
text: textVariants,
|
|
132
|
-
background: backgroundVariants,
|
|
133
|
-
},
|
|
134
|
-
defaultVariants: {
|
|
135
|
-
size: "xs",
|
|
136
|
-
text: "primary",
|
|
137
|
-
background: "primary",
|
|
138
|
-
},
|
|
139
|
-
});
|
|
140
|
-
|
|
141
141
|
type ChipBaseProps = {
|
|
142
142
|
size?: ChipSizeType;
|
|
143
143
|
color?: ChipColorType;
|
|
@@ -187,7 +187,7 @@ const Chip = React.forwardRef<HTMLDivElement, ChipProps>(
|
|
|
187
187
|
const chipContent = (
|
|
188
188
|
<div
|
|
189
189
|
className={cn(
|
|
190
|
-
chipVariants({ size,
|
|
190
|
+
chipVariants({ size, color }),
|
|
191
191
|
className,
|
|
192
192
|
onClick && "s-cursor-pointer"
|
|
193
193
|
)}
|
|
@@ -2,78 +2,73 @@ import { cva } from "class-variance-authority";
|
|
|
2
2
|
import React, { ComponentType, MouseEventHandler } from "react";
|
|
3
3
|
|
|
4
4
|
import { Tooltip } from "@sparkle/components";
|
|
5
|
-
import { Button,
|
|
5
|
+
import { Button, BUTTON_VARIANTS } from "@sparkle/components/Button";
|
|
6
6
|
import { cn } from "@sparkle/lib/utils";
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
11
|
-
size?: React.ComponentProps<typeof Button>["size"];
|
|
12
|
-
tooltip?: string;
|
|
13
|
-
tooltipPosition?: React.ComponentProps<typeof Tooltip>["side"];
|
|
14
|
-
icon: ComponentType;
|
|
15
|
-
className?: string;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const styleVariants: Record<ButtonVariantType, string> = {
|
|
20
|
-
primary: cn(
|
|
21
|
-
"s-text-highlight-500 dark:s-text-highlight-500-night",
|
|
22
|
-
"hover:s-text-highlight-400 dark:hover:s-text-highlight-500-night",
|
|
23
|
-
"active:s-text-highlight-600 dark:active:s-text-highlight-600-night",
|
|
24
|
-
"s-text-primary-500 dark:s-text-primary-500-night"
|
|
25
|
-
),
|
|
26
|
-
warning: cn(
|
|
27
|
-
"s-text-warning-500 dark:s-text-warning-500-night",
|
|
28
|
-
"hover:s-text-warning-400 dark:hover:s-text-warning-500-night",
|
|
29
|
-
"active:s-text-warning-600 dark:active:s-text-warning-600-night",
|
|
30
|
-
"s-text-primary-500 dark:s-text-primary-500-night"
|
|
31
|
-
),
|
|
32
|
-
highlight: cn(
|
|
33
|
-
"s-text-foreground dark:s-text-foreground-night",
|
|
34
|
-
"hover:s-text-highlight-400 dark:hover:s-text-highlight-500-night",
|
|
35
|
-
"active:s-text-highlight-600 dark:active:s-text-highlight-600-night",
|
|
36
|
-
"s-text-primary-500 dark:s-text-primary-500-night"
|
|
37
|
-
),
|
|
38
|
-
outline: cn(
|
|
39
|
-
"s-text-primary-700 dark:s-text-primary-700-night",
|
|
40
|
-
"hover:s-text-primary-400 dark:hover:s-text-primary-400-night",
|
|
41
|
-
"active:s-text-highlight-600 dark:active:s-text-highlight-600-night",
|
|
42
|
-
"s-text-primary-500 dark:s-text-primary-500-night"
|
|
43
|
-
),
|
|
44
|
-
ghost: cn(
|
|
45
|
-
"s-text-white dark:s-text-primary-950",
|
|
46
|
-
"hover:s-text-primary-100 dark:hover:s-text-primary-100-night",
|
|
47
|
-
"active:s-text-primary-200 dark:active:s-text-primary-200-night",
|
|
48
|
-
"s-text-white/50 dark:s-text-primary-950/50"
|
|
49
|
-
),
|
|
50
|
-
"ghost-secondary": cn(
|
|
51
|
-
"s-text-white",
|
|
52
|
-
"hover:s-text-primary-100 dark:hover:s-text-primary-100-night",
|
|
53
|
-
"active:s-text-primary-200 dark:active:s-text-primary-200-night",
|
|
54
|
-
"s-text-white/50 dark:s-text-primary-950/50"
|
|
55
|
-
),
|
|
56
|
-
};
|
|
8
|
+
export const ICON_BUTTON_VARIANTS = BUTTON_VARIANTS;
|
|
9
|
+
export type IconButtonVariantType = (typeof ICON_BUTTON_VARIANTS)[number];
|
|
57
10
|
|
|
58
11
|
const iconButtonVariants = cva(
|
|
59
12
|
"s-transition-all s-ease-out s-duration-300 s-cursor-pointer hover:s-scale-110",
|
|
60
13
|
{
|
|
61
14
|
variants: {
|
|
62
|
-
variant:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"s-text-
|
|
66
|
-
"s-
|
|
15
|
+
variant: {
|
|
16
|
+
primary: cn(
|
|
17
|
+
"s-text-highlight-500 dark:s-text-highlight-500-night",
|
|
18
|
+
"hover:s-text-highlight-400 dark:hover:s-text-highlight-500-night",
|
|
19
|
+
"active:s-text-highlight-600 dark:active:s-text-highlight-600-night",
|
|
20
|
+
"s-text-primary-500 dark:s-text-primary-500-night"
|
|
21
|
+
),
|
|
22
|
+
warning: cn(
|
|
23
|
+
"s-text-warning-500 dark:s-text-warning-500-night",
|
|
24
|
+
"hover:s-text-warning-400 dark:hover:s-text-warning-500-night",
|
|
25
|
+
"active:s-text-warning-600 dark:active:s-text-warning-600-night",
|
|
26
|
+
"s-text-primary-500 dark:s-text-primary-500-night"
|
|
27
|
+
),
|
|
28
|
+
highlight: cn(
|
|
29
|
+
"s-text-foreground dark:s-text-foreground-night",
|
|
30
|
+
"hover:s-text-highlight-400 dark:hover:s-text-highlight-500-night",
|
|
31
|
+
"active:s-text-highlight-600 dark:active:s-text-highlight-600-night",
|
|
32
|
+
"s-text-primary-500 dark:s-text-primary-500-night"
|
|
33
|
+
),
|
|
34
|
+
outline: cn(
|
|
35
|
+
"s-text-primary-700 dark:s-text-primary-700-night",
|
|
36
|
+
"hover:s-text-primary-400 dark:hover:s-text-primary-400-night",
|
|
37
|
+
"active:s-text-highlight-600 dark:active:s-text-highlight-600-night",
|
|
38
|
+
"s-text-primary-500 dark:s-text-primary-500-night"
|
|
39
|
+
),
|
|
40
|
+
ghost: cn(
|
|
41
|
+
"s-text-white dark:s-text-primary-950",
|
|
42
|
+
"hover:s-text-primary-100 dark:hover:s-text-primary-100-night",
|
|
43
|
+
"active:s-text-primary-200 dark:active:s-text-primary-200-night",
|
|
44
|
+
"s-text-white/50 dark:s-text-primary-950/50"
|
|
45
|
+
),
|
|
46
|
+
"ghost-secondary": cn(
|
|
47
|
+
"s-text-white",
|
|
48
|
+
"hover:s-text-primary-100 dark:hover:s-text-primary-100-night",
|
|
49
|
+
"active:s-text-primary-200 dark:active:s-text-primary-200-night",
|
|
50
|
+
"s-text-white/50 dark:s-text-primary-950/50"
|
|
67
51
|
),
|
|
68
52
|
},
|
|
69
53
|
},
|
|
70
54
|
defaultVariants: {
|
|
71
55
|
variant: "outline",
|
|
72
|
-
disabled: false,
|
|
73
56
|
},
|
|
74
57
|
}
|
|
75
58
|
);
|
|
76
59
|
|
|
60
|
+
export interface IconButtonProps
|
|
61
|
+
extends Omit<
|
|
62
|
+
React.ComponentPropsWithoutRef<typeof Button>,
|
|
63
|
+
"label" | "variant"
|
|
64
|
+
> {
|
|
65
|
+
variant?: IconButtonVariantType;
|
|
66
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
67
|
+
tooltip?: string;
|
|
68
|
+
tooltipPosition?: React.ComponentProps<typeof Tooltip>["side"];
|
|
69
|
+
icon: ComponentType;
|
|
70
|
+
}
|
|
71
|
+
|
|
77
72
|
const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
78
73
|
(
|
|
79
74
|
{
|
|
@@ -90,16 +85,26 @@ const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
|
90
85
|
) => (
|
|
91
86
|
<Button
|
|
92
87
|
tooltip={tooltip}
|
|
93
|
-
className={cn(
|
|
88
|
+
className={cn(
|
|
89
|
+
iconButtonVariants({ variant }),
|
|
90
|
+
disabled &&
|
|
91
|
+
cn(
|
|
92
|
+
"s-text-primary-500 dark:s-text-primary-500-night",
|
|
93
|
+
"s-cursor-default hover:s-scale-100"
|
|
94
|
+
),
|
|
95
|
+
className
|
|
96
|
+
)}
|
|
94
97
|
onClick={onClick}
|
|
95
98
|
disabled={disabled}
|
|
96
99
|
ref={ref}
|
|
97
100
|
size={size}
|
|
98
101
|
icon={icon}
|
|
99
|
-
variant=
|
|
102
|
+
variant="ghost"
|
|
100
103
|
{...props}
|
|
101
104
|
/>
|
|
102
105
|
)
|
|
103
106
|
);
|
|
104
107
|
|
|
105
|
-
|
|
108
|
+
IconButton.displayName = "IconButton";
|
|
109
|
+
|
|
110
|
+
export { IconButton, iconButtonVariants };
|
package/src/components/Label.tsx
CHANGED
|
@@ -1,33 +1,50 @@
|
|
|
1
1
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
|
|
4
5
|
import { cn } from "@sparkle/lib/utils";
|
|
5
6
|
|
|
7
|
+
const labelVariants = cva(
|
|
8
|
+
cn(
|
|
9
|
+
"s-heading-sm",
|
|
10
|
+
"peer-disabled:s-cursor-not-allowed peer-disabled:s-opacity-70"
|
|
11
|
+
),
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
variant: {
|
|
15
|
+
default: cn("s-text-foreground", "dark:s-text-foreground-night"),
|
|
16
|
+
muted: cn(
|
|
17
|
+
"s-text-muted-foreground",
|
|
18
|
+
"dark:s-text-muted-foreground-night"
|
|
19
|
+
),
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: "default",
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
|
|
6
28
|
export interface LabelProps
|
|
7
|
-
extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root
|
|
29
|
+
extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>,
|
|
30
|
+
VariantProps<typeof labelVariants> {
|
|
8
31
|
isMuted?: boolean;
|
|
9
32
|
}
|
|
10
33
|
|
|
11
34
|
const Label = React.forwardRef<
|
|
12
35
|
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
13
36
|
LabelProps
|
|
14
|
-
>(({ className, isMuted = false, ...props }, ref) => {
|
|
15
|
-
const
|
|
16
|
-
"s-heading-sm",
|
|
17
|
-
isMuted
|
|
18
|
-
? "s-text-muted-foreground dark:s-text-muted-foreground-night"
|
|
19
|
-
: "s-text-foreground dark:s-text-foreground-night",
|
|
20
|
-
"peer-disabled:s-cursor-not-allowed peer-disabled:s-opacity-70"
|
|
21
|
-
);
|
|
37
|
+
>(({ className, variant, isMuted = false, ...props }, ref) => {
|
|
38
|
+
const effectiveVariant = isMuted ? "muted" : variant;
|
|
22
39
|
|
|
23
40
|
return (
|
|
24
41
|
<LabelPrimitive.Root
|
|
25
42
|
ref={ref}
|
|
26
|
-
className={cn(labelVariants, className)}
|
|
43
|
+
className={cn(labelVariants({ variant: effectiveVariant }), className)}
|
|
27
44
|
{...props}
|
|
28
45
|
/>
|
|
29
46
|
);
|
|
30
47
|
});
|
|
31
48
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
32
49
|
|
|
33
|
-
export { Label };
|
|
50
|
+
export { Label, labelVariants };
|
|
@@ -3,7 +3,6 @@ import { cva, type VariantProps } from "class-variance-authority";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
Icon,
|
|
7
6
|
LinkWrapper,
|
|
8
7
|
LinkWrapperProps,
|
|
9
8
|
ScrollArea,
|
|
@@ -82,7 +81,6 @@ const NavigationListItem = React.forwardRef<
|
|
|
82
81
|
className,
|
|
83
82
|
selected,
|
|
84
83
|
label,
|
|
85
|
-
icon,
|
|
86
84
|
href,
|
|
87
85
|
target,
|
|
88
86
|
rel,
|
|
@@ -107,13 +105,13 @@ const NavigationListItem = React.forwardRef<
|
|
|
107
105
|
case "unread":
|
|
108
106
|
return "s-bg-highlight-500 dark:s-bg-highlight-500-night";
|
|
109
107
|
case "blocked":
|
|
110
|
-
return "s-bg-
|
|
108
|
+
return "s-bg-golden-500 dark:s-bg-golden-500-night";
|
|
111
109
|
default:
|
|
112
110
|
return "";
|
|
113
111
|
}
|
|
114
112
|
};
|
|
115
113
|
|
|
116
|
-
const shouldShowStatusDot = status
|
|
114
|
+
const shouldShowStatusDot = status !== "idle";
|
|
117
115
|
|
|
118
116
|
return (
|
|
119
117
|
<div
|
|
@@ -155,7 +153,6 @@ const NavigationListItem = React.forwardRef<
|
|
|
155
153
|
)}
|
|
156
154
|
/>
|
|
157
155
|
)}
|
|
158
|
-
{icon && <Icon visual={icon} size="sm" />}
|
|
159
156
|
{label && (
|
|
160
157
|
<span className="s-grow s-overflow-hidden s-text-ellipsis s-whitespace-nowrap group-hover/menu-item:s-pr-8 group-data-[selected=true]/menu-item:s-pr-8">
|
|
161
158
|
{label}
|
|
@@ -23,6 +23,16 @@ const NotificationsContext = React.createContext<(n: NotificationType) => void>(
|
|
|
23
23
|
(n) => n
|
|
24
24
|
);
|
|
25
25
|
|
|
26
|
+
const notificationVariants = cva("s-pt-0.5", {
|
|
27
|
+
variants: {
|
|
28
|
+
type: {
|
|
29
|
+
success: "s-text-success-600 dark:s-text-success-400-night",
|
|
30
|
+
error: "s-text-warning-500 dark:s-text-warning-500-night",
|
|
31
|
+
info: "s-text-info-600 dark:s-text-info-400-night",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
26
36
|
function NotificationContent({
|
|
27
37
|
type,
|
|
28
38
|
title,
|
|
@@ -42,16 +52,6 @@ function NotificationContent({
|
|
|
42
52
|
}
|
|
43
53
|
})();
|
|
44
54
|
|
|
45
|
-
const variantClassName = cva("s-pt-0.5", {
|
|
46
|
-
variants: {
|
|
47
|
-
type: {
|
|
48
|
-
success: "s-text-success-600 dark:s-text-success-400-night",
|
|
49
|
-
error: "s-text-warning-500 dark:s-text-warning-500-night",
|
|
50
|
-
info: "s-text-info-600 dark:s-text-info-400-night",
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
|
|
55
55
|
return (
|
|
56
56
|
<div
|
|
57
57
|
className={cn(
|
|
@@ -65,14 +65,14 @@ function NotificationContent({
|
|
|
65
65
|
<Icon
|
|
66
66
|
size="lg"
|
|
67
67
|
visual={icon}
|
|
68
|
-
className={
|
|
68
|
+
className={notificationVariants({ type })}
|
|
69
69
|
aria-hidden="true"
|
|
70
70
|
/>
|
|
71
71
|
<div className="s-flex s-min-w-0 s-flex-grow s-flex-col">
|
|
72
72
|
<div
|
|
73
73
|
className={cn(
|
|
74
74
|
"s-heading-md s-line-clamp-1 s-h-6 s-grow",
|
|
75
|
-
|
|
75
|
+
notificationVariants({ type })
|
|
76
76
|
)}
|
|
77
77
|
>
|
|
78
78
|
{title || type}
|
package/src/icons/app/Atom.tsx
CHANGED
|
@@ -6,13 +6,13 @@ const SvgAtom = (props: SVGProps<SVGSVGElement>) => (
|
|
|
6
6
|
width="1em"
|
|
7
7
|
height="1em"
|
|
8
8
|
fill="none"
|
|
9
|
-
viewBox="0 0 24
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
10
|
{...props}
|
|
11
11
|
>
|
|
12
12
|
<path
|
|
13
13
|
fill="currentColor"
|
|
14
14
|
fillRule="evenodd"
|
|
15
|
-
d="M14.974 2.
|
|
15
|
+
d="M14.974 2.272c.831-.247 1.733-.266 2.526.19.793.455 1.227 1.242 1.428 2.081.2.837.196 1.818.047 2.852-.029.195-.065.393-.104.595.196.068.387.137.571.21.975.388 1.83.875 2.46 1.466.63.593 1.098 1.36 1.098 2.271 0 .911-.468 1.679-1.099 2.272-.628.591-1.484 1.078-2.459 1.466-.184.073-.375.142-.57.21.038.202.074.4.103.596.15 1.034.153 2.014-.047 2.851-.201.84-.635 1.627-1.428 2.082-.793.456-1.695.436-2.526.19-.83-.246-1.681-.74-2.506-1.386a13.017 13.017 0 0 1-.468-.386c-.157.135-.312.264-.468.386-.825.646-1.677 1.14-2.506 1.386-.831.246-1.733.266-2.526-.19-.793-.455-1.227-1.242-1.428-2.082-.2-.837-.196-1.817-.047-2.85.029-.196.064-.395.103-.597a13.144 13.144 0 0 1-.57-.21c-.975-.388-1.83-.875-2.46-1.466C1.469 13.616 1 12.849 1 11.937c0-.91.468-1.678 1.099-2.271.628-.591 1.484-1.078 2.459-1.466.184-.073.374-.142.57-.21-.04-.202-.074-.4-.103-.595-.15-1.034-.153-2.015.047-2.852.201-.84.635-1.626 1.428-2.082.793-.455 1.695-.436 2.526-.19.83.247 1.681.74 2.506 1.386.156.122.312.251.468.386.156-.135.312-.264.468-.386.825-.645 1.677-1.14 2.506-1.385ZM7.06 16.416c-.022.118-.04.234-.056.348-.128.885-.11 1.597.013 2.108.121.507.319.726.482.82.163.094.452.155.955.006.506-.15 1.134-.49 1.84-1.044.092-.07.182-.145.274-.222a21.47 21.47 0 0 1-1.368-1.674 21.655 21.655 0 0 1-2.14-.342Zm9.878 0a21.63 21.63 0 0 1-2.141.342 21.474 21.474 0 0 1-1.368 1.674c.092.077.183.151.274.222.707.554 1.335.894 1.84 1.044.504.149.793.088.956-.006.163-.094.36-.313.482-.82.123-.51.141-1.223.013-2.108-.016-.114-.035-.23-.056-.348ZM12 16.911l-.114-.002.113.128.114-.127-.113.002Zm0-7.958c-.582 0-1.15.022-1.698.061a23.703 23.703 0 0 0-1.697 2.922 23.707 23.707 0 0 0 1.697 2.925 23.977 23.977 0 0 0 3.395 0 23.76 23.76 0 0 0 1.697-2.925 23.748 23.748 0 0 0-1.697-2.922A23.981 23.981 0 0 0 12 8.953Zm4.33 5.471c-.019.033-.04.066-.058.099l.168-.035-.054-.163c-.02.033-.037.067-.056.1Zm-8.77.064.168.034c-.02-.033-.04-.065-.058-.098-.02-.032-.038-.066-.057-.099l-.053.163Zm10.808-4.566a21.36 21.36 0 0 1-.772 2.015c.301.685.56 1.36.772 2.015.113-.04.224-.081.331-.124.835-.332 1.445-.704 1.828-1.065.381-.358.473-.638.473-.826 0-.187-.092-.467-.473-.825-.383-.361-.993-.733-1.828-1.065a10.848 10.848 0 0 0-.33-.125Zm-12.737 0c-.113.04-.223.082-.33.125-.835.332-1.445.704-1.828 1.065-.381.358-.473.638-.473.825 0 .188.092.468.473.826.383.361.993.733 1.828 1.065.107.043.217.084.33.124.212-.655.471-1.33.772-2.015-.301-.684-.56-1.36-.772-2.015Zm1.929-.535.053.161.057-.098.058-.097-.168.034Zm8.77.063.056.098.053-.16c-.055-.012-.111-.025-.168-.036l.06.098ZM8.455 4.178c-.503-.149-.792-.088-.955.006-.163.094-.36.312-.482.82-.123.51-.141 1.222-.013 2.108.016.114.035.23.056.347.676-.145 1.393-.26 2.14-.343.446-.602.904-1.163 1.368-1.674-.091-.077-.183-.15-.273-.22-.707-.554-1.335-.894-1.84-1.044Zm8.045.006c-.163-.094-.452-.155-.955-.006-.506.15-1.134.49-1.84 1.043-.091.071-.184.144-.275.22.464.512.922 1.073 1.368 1.675.747.083 1.464.198 2.14.343.021-.118.04-.233.057-.347.128-.886.11-1.597-.013-2.108-.121-.508-.319-.726-.482-.82Zm-4.613 2.78h.225A17.75 17.75 0 0 0 12 6.837l-.112.127Z"
|
|
16
16
|
clipRule="evenodd"
|
|
17
17
|
/>
|
|
18
18
|
</svg>
|
|
@@ -6,12 +6,12 @@ const SvgCodeBlock = (props: SVGProps<SVGSVGElement>) => (
|
|
|
6
6
|
width="1em"
|
|
7
7
|
height="1em"
|
|
8
8
|
fill="none"
|
|
9
|
-
viewBox="0 0 24
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
10
|
{...props}
|
|
11
11
|
>
|
|
12
12
|
<path
|
|
13
13
|
fill="currentColor"
|
|
14
|
-
d="m3.414
|
|
14
|
+
d="m3.414 7.99 2.293-2.293-1.414-1.415L.586 7.99l3.707 3.707 1.414-1.414L3.414 7.99Zm6.172 0L7.293 5.697l1.414-1.415 3.707 3.708-3.707 3.707-1.414-1.414L9.586 7.99Zm4.414-3h4.001a3 3 0 0 1 3 2.998c.001 3 .001 5.023 0 8.024a3 3 0 0 1-2.999 2.998H5.996a2.996 2.996 0 0 1-2.996-3v-3.015h2v3.015a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V7.99a1 1 0 0 0-1-1h-4v-2Z"
|
|
15
15
|
/>
|
|
16
16
|
</svg>
|
|
17
17
|
);
|
|
@@ -11,7 +11,7 @@ const SvgContactsRobot = (props: SVGProps<SVGSVGElement>) => (
|
|
|
11
11
|
>
|
|
12
12
|
<path
|
|
13
13
|
fill="currentColor"
|
|
14
|
-
d="
|
|
14
|
+
d="M21 22H6a3 3 0 0 1-3-3V5a3 3 0 0 1 3-3h15v20ZM6 18a1 1 0 1 0 0 2h13v-2H6Zm6-7a3 3 0 0 0-3 3h6a3 3 0 0 0-3-3Zm-2-5a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1h-4Zm.75 1a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5Zm2.5 0a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5Z"
|
|
15
15
|
/>
|
|
16
16
|
</svg>
|
|
17
17
|
);
|
|
@@ -11,7 +11,7 @@ const SvgContactsUser = (props: SVGProps<SVGSVGElement>) => (
|
|
|
11
11
|
>
|
|
12
12
|
<path
|
|
13
13
|
fill="currentColor"
|
|
14
|
-
d="
|
|
14
|
+
d="M21 22H6a3 3 0 0 1-3-3V5a3 3 0 0 1 3-3h15v20Zm-2-2v-2H6a1 1 0 1 0 0 2h13Zm-7-10a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm-3 4h6a3 3 0 1 0-6 0Z"
|
|
15
15
|
/>
|
|
16
16
|
</svg>
|
|
17
17
|
);
|
package/src/icons/app/Robot.tsx
CHANGED
|
@@ -11,7 +11,7 @@ const SvgRobot = (props: SVGProps<SVGSVGElement>) => (
|
|
|
11
11
|
>
|
|
12
12
|
<path
|
|
13
13
|
fill="currentColor"
|
|
14
|
-
d="M12 14a8 8 0 0 1 8 8H4a8 8 0 0 1 8-
|
|
14
|
+
d="M12 14a8 8 0 0 1 8 8H4a8 8 0 0 1 8-8Zm2-11h3a3 3 0 0 1 3 3v4a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h3V2h4v1ZM8 5a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm8 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4Z"
|
|
15
15
|
/>
|
|
16
16
|
</svg>
|
|
17
17
|
);
|
|
@@ -9,12 +9,9 @@ const SvgSidebarLeftClose = (props: SVGProps<SVGSVGElement>) => (
|
|
|
9
9
|
viewBox="0 0 24 24"
|
|
10
10
|
{...props}
|
|
11
11
|
>
|
|
12
|
-
<path fill="currentColor" d="m11 12 3-3v6l-3-3Z" />
|
|
13
12
|
<path
|
|
14
13
|
fill="currentColor"
|
|
15
|
-
|
|
16
|
-
d="M5 21a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H5Zm14-2a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H9v14h10Z"
|
|
17
|
-
clipRule="evenodd"
|
|
14
|
+
d="M19 3a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14ZM5 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H5Zm4 12H6V7h3v10Zm4-2-3-3 3-3v6Z"
|
|
18
15
|
/>
|
|
19
16
|
</svg>
|
|
20
17
|
);
|
|
@@ -9,12 +9,9 @@ const SvgSidebarLeftOpen = (props: SVGProps<SVGSVGElement>) => (
|
|
|
9
9
|
viewBox="0 0 24 24"
|
|
10
10
|
{...props}
|
|
11
11
|
>
|
|
12
|
-
<path fill="currentColor" d="m11 9 3 3-3 3V9Z" />
|
|
13
12
|
<path
|
|
14
13
|
fill="currentColor"
|
|
15
|
-
|
|
16
|
-
d="M5 21a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H5Zm14-2a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H9v14h10Z"
|
|
17
|
-
clipRule="evenodd"
|
|
14
|
+
d="M19 3a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14ZM5 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H5Zm4 12H6V7h3v10Zm5-5-3 3V9l3 3Z"
|
|
18
15
|
/>
|
|
19
16
|
</svg>
|
|
20
17
|
);
|
|
@@ -9,12 +9,9 @@ const SvgSidebarRightClose = (props: SVGProps<SVGSVGElement>) => (
|
|
|
9
9
|
viewBox="0 0 24 24"
|
|
10
10
|
{...props}
|
|
11
11
|
>
|
|
12
|
-
<path fill="currentColor" d="m13 12-3 3V9l3 3Z" />
|
|
13
12
|
<path
|
|
14
13
|
fill="currentColor"
|
|
15
|
-
|
|
16
|
-
d="M19 3a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14ZM5 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h10V5H5Z"
|
|
17
|
-
clipRule="evenodd"
|
|
14
|
+
d="M19 3a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14ZM5 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H5Zm13 12h-3V7h3v10Zm-4-5-3 3V9l3 3Z"
|
|
18
15
|
/>
|
|
19
16
|
</svg>
|
|
20
17
|
);
|
|
@@ -9,12 +9,9 @@ const SvgSidebarRightOpen = (props: SVGProps<SVGSVGElement>) => (
|
|
|
9
9
|
viewBox="0 0 24 24"
|
|
10
10
|
{...props}
|
|
11
11
|
>
|
|
12
|
-
<path fill="currentColor" d="m13 15-3-3 3-3v6Z" />
|
|
13
12
|
<path
|
|
14
13
|
fill="currentColor"
|
|
15
|
-
|
|
16
|
-
d="M19 3a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14ZM5 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h10V5H5Z"
|
|
17
|
-
clipRule="evenodd"
|
|
14
|
+
d="M19 3a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14ZM5 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H5Zm13 12h-3V7h3v10Zm-5-2-3-3 3-3v6Z"
|
|
18
15
|
/>
|
|
19
16
|
</svg>
|
|
20
17
|
);
|