@dust-tt/sparkle 0.3.23-rc-1 → 0.3.24
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/Button.d.ts.map +1 -1
- package/dist/esm/components/Button.js +3 -3
- package/dist/esm/components/Button.js.map +1 -1
- package/dist/esm/components/ButtonsSwitch.d.ts +1 -0
- package/dist/esm/components/ButtonsSwitch.d.ts.map +1 -1
- package/dist/esm/components/ButtonsSwitch.js +8 -2
- package/dist/esm/components/ButtonsSwitch.js.map +1 -1
- package/dist/esm/components/Spinner.d.ts.map +1 -1
- package/dist/esm/components/Spinner.js +10 -0
- package/dist/esm/components/Spinner.js.map +1 -1
- package/dist/esm/components/SplitButton.d.ts +2 -29
- package/dist/esm/components/SplitButton.d.ts.map +1 -1
- package/dist/esm/components/SplitButton.js +10 -33
- package/dist/esm/components/SplitButton.js.map +1 -1
- package/dist/esm/components/index.d.ts +1 -1
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/icons/src/actions/atom.svg +1 -1
- package/dist/esm/logo/platforms/Canva.d.ts +5 -0
- package/dist/esm/logo/platforms/Canva.d.ts.map +1 -0
- package/dist/esm/logo/platforms/Canva.js +14 -0
- package/dist/esm/logo/platforms/Canva.js.map +1 -0
- package/dist/esm/logo/platforms/index.d.ts +1 -0
- package/dist/esm/logo/platforms/index.d.ts.map +1 -1
- package/dist/esm/logo/platforms/index.js +1 -0
- package/dist/esm/logo/platforms/index.js.map +1 -1
- package/dist/esm/stories/SplitButton.stories.d.ts +3 -3
- package/dist/esm/stories/SplitButton.stories.d.ts.map +1 -1
- package/dist/esm/stories/SplitButton.stories.js +9 -54
- package/dist/esm/stories/SplitButton.stories.js.map +1 -1
- package/dist/sparkle.css +58 -18
- package/package.json +1 -1
- package/src/components/Button.tsx +12 -3
- package/src/components/ButtonsSwitch.tsx +8 -2
- package/src/components/Spinner.tsx +10 -0
- package/src/components/SplitButton.tsx +19 -122
- package/src/components/index.ts +1 -1
- package/src/icons/src/actions/atom.svg +1 -1
- package/src/logo/platforms/Canva.tsx +39 -0
- package/src/logo/platforms/index.ts +1 -0
- package/src/stories/SplitButton.stories.tsx +46 -63
|
@@ -1,78 +1,18 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
|
-
import { BUTTON_SIZES, BUTTON_VARIANTS } from "@sparkle/components/Button";
|
|
5
4
|
import { ArrowUpIcon, ChevronDownIcon } from "@sparkle/icons/app";
|
|
6
5
|
|
|
7
|
-
import {
|
|
8
|
-
Button,
|
|
9
|
-
CameraIcon,
|
|
10
|
-
FlexSplitButton,
|
|
11
|
-
PlusIcon,
|
|
12
|
-
RobotIcon,
|
|
13
|
-
SplitButton,
|
|
14
|
-
} from "../index_with_tw_base";
|
|
6
|
+
import { Button, FlexSplitButton } from "../index_with_tw_base";
|
|
15
7
|
|
|
16
|
-
const meta: Meta<React.ComponentProps<typeof
|
|
8
|
+
const meta: Meta<React.ComponentProps<typeof FlexSplitButton>> = {
|
|
17
9
|
title: "Primitives/SplitButton",
|
|
18
|
-
component:
|
|
19
|
-
argTypes: {
|
|
20
|
-
variant: {
|
|
21
|
-
description: "The visual style variant of the button",
|
|
22
|
-
options: BUTTON_VARIANTS,
|
|
23
|
-
control: { type: "select" },
|
|
24
|
-
},
|
|
25
|
-
size: {
|
|
26
|
-
description: "The size of the button",
|
|
27
|
-
options: BUTTON_SIZES,
|
|
28
|
-
control: { type: "select" },
|
|
29
|
-
},
|
|
30
|
-
},
|
|
10
|
+
component: FlexSplitButton,
|
|
31
11
|
};
|
|
32
12
|
|
|
33
13
|
export default meta;
|
|
34
14
|
type Story = StoryObj<typeof meta>;
|
|
35
15
|
|
|
36
|
-
export const ExampleButton: Story = {
|
|
37
|
-
args: {
|
|
38
|
-
variant: "outline",
|
|
39
|
-
size: "md",
|
|
40
|
-
defaultAction: {
|
|
41
|
-
label: "First",
|
|
42
|
-
icon: PlusIcon,
|
|
43
|
-
tooltip: "First tooltip",
|
|
44
|
-
},
|
|
45
|
-
actions: [
|
|
46
|
-
{
|
|
47
|
-
label: "First",
|
|
48
|
-
icon: PlusIcon,
|
|
49
|
-
tooltip: "First tooltip",
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
label: "Second",
|
|
53
|
-
icon: RobotIcon,
|
|
54
|
-
tooltip: "Disabled tooltip",
|
|
55
|
-
disabled: true,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
label: "Photo",
|
|
59
|
-
icon: CameraIcon,
|
|
60
|
-
tooltip: "Disabled photo",
|
|
61
|
-
disabled: true,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
label: "Third",
|
|
65
|
-
tooltip: "Third tooltip",
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
label: "Fourth",
|
|
69
|
-
tooltip: "Loading tooltip",
|
|
70
|
-
isLoading: true,
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
|
|
76
16
|
export const FlexSplitButtonVariants: Story = {
|
|
77
17
|
render: () => (
|
|
78
18
|
<div className="s-flex s-gap-3">
|
|
@@ -111,3 +51,46 @@ export const FlexSplitButtonVariants: Story = {
|
|
|
111
51
|
</div>
|
|
112
52
|
),
|
|
113
53
|
};
|
|
54
|
+
|
|
55
|
+
export const FlexSplitButtonLoading: Story = {
|
|
56
|
+
render: () => (
|
|
57
|
+
<div className="s-flex s-gap-3">
|
|
58
|
+
<FlexSplitButton
|
|
59
|
+
label="Sending"
|
|
60
|
+
variant="highlight"
|
|
61
|
+
icon={ArrowUpIcon}
|
|
62
|
+
isLoading
|
|
63
|
+
splitAction={
|
|
64
|
+
<Button size="mini" variant="highlight" icon={ChevronDownIcon} />
|
|
65
|
+
}
|
|
66
|
+
/>
|
|
67
|
+
<FlexSplitButton
|
|
68
|
+
label="Sending"
|
|
69
|
+
variant="primary"
|
|
70
|
+
icon={ArrowUpIcon}
|
|
71
|
+
isLoading
|
|
72
|
+
splitAction={
|
|
73
|
+
<Button size="mini" variant="primary" icon={ChevronDownIcon} />
|
|
74
|
+
}
|
|
75
|
+
/>
|
|
76
|
+
<FlexSplitButton
|
|
77
|
+
label="Sending"
|
|
78
|
+
variant="outline"
|
|
79
|
+
icon={ArrowUpIcon}
|
|
80
|
+
isLoading
|
|
81
|
+
splitAction={
|
|
82
|
+
<Button size="mini" variant="outline" icon={ChevronDownIcon} />
|
|
83
|
+
}
|
|
84
|
+
/>
|
|
85
|
+
<FlexSplitButton
|
|
86
|
+
label="Sending"
|
|
87
|
+
variant="ghost"
|
|
88
|
+
icon={ArrowUpIcon}
|
|
89
|
+
isLoading
|
|
90
|
+
splitAction={
|
|
91
|
+
<Button size="mini" variant="ghost" icon={ChevronDownIcon} />
|
|
92
|
+
}
|
|
93
|
+
/>
|
|
94
|
+
</div>
|
|
95
|
+
),
|
|
96
|
+
};
|