@dust-tt/sparkle 0.2.210-rc74 → 0.2.210
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.d.ts +4 -4
- package/dist/cjs/components/Checkbox.d.ts +3 -3
- package/dist/cjs/components/DataTable.d.ts +3 -3
- package/dist/cjs/components/Tree.d.ts +6 -9
- package/dist/cjs/components/WindowUtility.d.ts +15 -0
- package/dist/cjs/icons/solid/index.d.ts +0 -13
- package/dist/cjs/icons/stroke/index.d.ts +0 -13
- package/dist/cjs/index.js +128 -209
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/stories/Checkbox.stories.d.ts +0 -2
- package/dist/cjs/stories/Tree.stories.d.ts +1 -0
- package/dist/esm/_index.d.ts +4 -4
- package/dist/esm/components/Checkbox.d.ts +3 -3
- package/dist/esm/components/DataTable.d.ts +3 -3
- package/dist/esm/components/Tree.d.ts +6 -9
- package/dist/esm/components/WindowUtility.d.ts +15 -0
- package/dist/esm/icons/solid/index.d.ts +0 -13
- package/dist/esm/icons/stroke/index.d.ts +0 -13
- package/dist/esm/index.js +129 -184
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/stories/Checkbox.stories.d.ts +0 -2
- package/dist/esm/stories/Tree.stories.d.ts +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/_index.ts +0 -52
- package/src/components/Checkbox.tsx +12 -42
- package/src/components/DataTable.tsx +86 -63
- package/src/components/Tree.tsx +66 -71
- package/src/components/WindowUtility.tsx +67 -0
- package/src/icons/solid/index.ts +0 -14
- package/src/icons/stroke/index.ts +0 -13
- package/src/stories/Checkbox.stories.tsx +2 -63
- package/src/stories/Tree.stories.tsx +189 -152
- package/dist/cjs/icons/solid/ArrowDownS.d.ts +0 -4
- package/dist/cjs/icons/solid/ArrowLeftS.d.ts +0 -4
- package/dist/cjs/icons/solid/ArrowRightS.d.ts +0 -4
- package/dist/cjs/icons/solid/ArrowUpS.d.ts +0 -4
- package/dist/cjs/icons/solid/ChevronDoubleLeft.d.ts +0 -4
- package/dist/cjs/icons/solid/ChevronDoubleRight.d.ts +0 -4
- package/dist/cjs/icons/solid/Company.d.ts +0 -4
- package/dist/cjs/icons/solid/Filter.d.ts +0 -4
- package/dist/cjs/icons/solid/Heart.d.ts +0 -4
- package/dist/cjs/icons/solid/History.d.ts +0 -4
- package/dist/cjs/icons/solid/Home.d.ts +0 -4
- package/dist/cjs/icons/solid/MarkPen.d.ts +0 -4
- package/dist/cjs/icons/solid/Translate.d.ts +0 -4
- package/dist/cjs/icons/stroke/ArrowDownS.d.ts +0 -4
- package/dist/cjs/icons/stroke/ArrowLeftS.d.ts +0 -4
- package/dist/cjs/icons/stroke/ArrowRightS.d.ts +0 -4
- package/dist/cjs/icons/stroke/ArrowUpS.d.ts +0 -4
- package/dist/cjs/icons/stroke/ChevronDoubleLeft.d.ts +0 -4
- package/dist/cjs/icons/stroke/ChevronDoubleRight.d.ts +0 -4
- package/dist/cjs/icons/stroke/Company.d.ts +0 -4
- package/dist/cjs/icons/stroke/Filter.d.ts +0 -4
- package/dist/cjs/icons/stroke/Heart.d.ts +0 -4
- package/dist/cjs/icons/stroke/History.d.ts +0 -4
- package/dist/cjs/icons/stroke/Home.d.ts +0 -4
- package/dist/cjs/icons/stroke/MarkPen.d.ts +0 -4
- package/dist/cjs/icons/stroke/Translate.d.ts +0 -4
- package/dist/esm/icons/solid/ArrowDownS.d.ts +0 -4
- package/dist/esm/icons/solid/ArrowLeftS.d.ts +0 -4
- package/dist/esm/icons/solid/ArrowRightS.d.ts +0 -4
- package/dist/esm/icons/solid/ArrowUpS.d.ts +0 -4
- package/dist/esm/icons/solid/ChevronDoubleLeft.d.ts +0 -4
- package/dist/esm/icons/solid/ChevronDoubleRight.d.ts +0 -4
- package/dist/esm/icons/solid/Company.d.ts +0 -4
- package/dist/esm/icons/solid/Filter.d.ts +0 -4
- package/dist/esm/icons/solid/Heart.d.ts +0 -4
- package/dist/esm/icons/solid/History.d.ts +0 -4
- package/dist/esm/icons/solid/Home.d.ts +0 -4
- package/dist/esm/icons/solid/MarkPen.d.ts +0 -4
- package/dist/esm/icons/solid/Translate.d.ts +0 -4
- package/dist/esm/icons/stroke/ArrowDownS.d.ts +0 -4
- package/dist/esm/icons/stroke/ArrowLeftS.d.ts +0 -4
- package/dist/esm/icons/stroke/ArrowRightS.d.ts +0 -4
- package/dist/esm/icons/stroke/ArrowUpS.d.ts +0 -4
- package/dist/esm/icons/stroke/ChevronDoubleLeft.d.ts +0 -4
- package/dist/esm/icons/stroke/ChevronDoubleRight.d.ts +0 -4
- package/dist/esm/icons/stroke/Company.d.ts +0 -4
- package/dist/esm/icons/stroke/Filter.d.ts +0 -4
- package/dist/esm/icons/stroke/Heart.d.ts +0 -4
- package/dist/esm/icons/stroke/History.d.ts +0 -4
- package/dist/esm/icons/stroke/Home.d.ts +0 -4
- package/dist/esm/icons/stroke/MarkPen.d.ts +0 -4
- package/dist/esm/icons/stroke/Translate.d.ts +0 -4
- package/src/icons/solid/ArrowDownS.tsx +0 -15
- package/src/icons/solid/ArrowLeftS.tsx +0 -15
- package/src/icons/solid/ArrowRightS.tsx +0 -15
- package/src/icons/solid/ArrowUpS.tsx +0 -15
- package/src/icons/solid/ChevronDoubleLeft.tsx +0 -22
- package/src/icons/solid/ChevronDoubleRight.tsx +0 -22
- package/src/icons/solid/Company.tsx +0 -20
- package/src/icons/solid/Filter.tsx +0 -18
- package/src/icons/solid/Heart.tsx +0 -18
- package/src/icons/solid/History.tsx +0 -18
- package/src/icons/solid/Home.tsx +0 -20
- package/src/icons/solid/MarkPen.tsx +0 -18
- package/src/icons/solid/Translate.tsx +0 -18
- package/src/icons/src/solid/arrow-down-s.svg +0 -3
- package/src/icons/src/solid/arrow-left-s.svg +0 -3
- package/src/icons/src/solid/arrow-right-s.svg +0 -3
- package/src/icons/src/solid/arrow-up-s.svg +0 -3
- package/src/icons/src/solid/chevron-double-left.svg +0 -4
- package/src/icons/src/solid/chevron-double-right.svg +0 -4
- package/src/icons/src/solid/company.svg +0 -3
- package/src/icons/src/solid/filter.svg +0 -3
- package/src/icons/src/solid/heart.svg +0 -3
- package/src/icons/src/solid/history.svg +0 -3
- package/src/icons/src/solid/home.svg +0 -3
- package/src/icons/src/solid/mark-pen.svg +0 -3
- package/src/icons/src/solid/translate.svg +0 -3
- package/src/icons/src/stroke/arrow-down-s.svg +0 -3
- package/src/icons/src/stroke/arrow-left-s.svg +0 -3
- package/src/icons/src/stroke/arrow-right-s.svg +0 -3
- package/src/icons/src/stroke/arrow-up-s.svg +0 -3
- package/src/icons/src/stroke/chevron-double-left.svg +0 -4
- package/src/icons/src/stroke/chevron-double-right.svg +0 -4
- package/src/icons/src/stroke/company.svg +0 -9
- package/src/icons/src/stroke/filter.svg +0 -3
- package/src/icons/src/stroke/heart.svg +0 -3
- package/src/icons/src/stroke/history.svg +0 -3
- package/src/icons/src/stroke/home.svg +0 -3
- package/src/icons/src/stroke/mark-pen.svg +0 -3
- package/src/icons/src/stroke/translate.svg +0 -3
- package/src/icons/stroke/ArrowDownS.tsx +0 -15
- package/src/icons/stroke/ArrowLeftS.tsx +0 -15
- package/src/icons/stroke/ArrowRightS.tsx +0 -15
- package/src/icons/stroke/ArrowUpS.tsx +0 -15
- package/src/icons/stroke/ChevronDoubleLeft.tsx +0 -16
- package/src/icons/stroke/ChevronDoubleRight.tsx +0 -16
- package/src/icons/stroke/Company.tsx +0 -24
- package/src/icons/stroke/Filter.tsx +0 -15
- package/src/icons/stroke/Heart.tsx +0 -20
- package/src/icons/stroke/History.tsx +0 -18
- package/src/icons/stroke/Home.tsx +0 -20
- package/src/icons/stroke/MarkPen.tsx +0 -18
- package/src/icons/stroke/Translate.tsx +0 -18
- package/src/logo/src/platforms/Zendesk.svg +0 -6
package/src/components/Tree.tsx
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
ChatBubbleBottomCenterText,
|
|
5
|
+
DocumentText,
|
|
6
|
+
Folder,
|
|
7
|
+
Square3Stack3D,
|
|
8
|
+
} from "@sparkle/icons/stroke";
|
|
9
|
+
import { ChevronDownIcon, ChevronRightIcon, Spinner } from "@sparkle/index";
|
|
4
10
|
import { classNames } from "@sparkle/lib/utils";
|
|
5
11
|
|
|
6
12
|
import { Checkbox, CheckboxProps } from "./Checkbox";
|
|
@@ -8,25 +14,12 @@ import { Icon } from "./Icon";
|
|
|
8
14
|
import { IconButton } from "./IconButton";
|
|
9
15
|
|
|
10
16
|
export interface TreeProps {
|
|
11
|
-
children?: ReactNode;
|
|
17
|
+
children?: React.ReactNode;
|
|
12
18
|
isBoxed?: boolean;
|
|
13
19
|
isLoading?: boolean;
|
|
14
|
-
variant?: "navigator" | "finder";
|
|
15
20
|
}
|
|
16
21
|
|
|
17
|
-
export function Tree({
|
|
18
|
-
children,
|
|
19
|
-
isLoading,
|
|
20
|
-
isBoxed = false,
|
|
21
|
-
variant = "finder",
|
|
22
|
-
}: TreeProps) {
|
|
23
|
-
const modifiedChildren = React.Children.map(children, (child) => {
|
|
24
|
-
if (React.isValidElement<TreeItemProps>(child) && variant === "navigator") {
|
|
25
|
-
return React.cloneElement(child, { isNavigatable: true });
|
|
26
|
-
}
|
|
27
|
-
return child;
|
|
28
|
-
});
|
|
29
|
-
|
|
22
|
+
export function Tree({ children, isLoading, isBoxed = false }: TreeProps) {
|
|
30
23
|
return isLoading ? (
|
|
31
24
|
<div className="s-py-2 s-pl-4">
|
|
32
25
|
<Spinner size="xs" variant="dark" />
|
|
@@ -40,16 +33,24 @@ export function Tree({
|
|
|
40
33
|
: ""
|
|
41
34
|
)}
|
|
42
35
|
>
|
|
43
|
-
{
|
|
36
|
+
{children}
|
|
44
37
|
</div>
|
|
45
38
|
);
|
|
46
39
|
}
|
|
47
40
|
|
|
41
|
+
const visualTable = {
|
|
42
|
+
file: DocumentText,
|
|
43
|
+
folder: Folder,
|
|
44
|
+
database: Square3Stack3D,
|
|
45
|
+
channel: ChatBubbleBottomCenterText,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
48
|
interface TreeItemProps {
|
|
49
49
|
label?: string;
|
|
50
50
|
type?: "node" | "item" | "leaf";
|
|
51
|
+
variant?: "file" | "folder" | "database" | "channel";
|
|
51
52
|
size?: "sm" | "md";
|
|
52
|
-
visual?:
|
|
53
|
+
visual?: React.ReactNode;
|
|
53
54
|
checkbox?: CheckboxProps;
|
|
54
55
|
onChevronClick?: () => void;
|
|
55
56
|
collapsed?: boolean;
|
|
@@ -57,7 +58,6 @@ interface TreeItemProps {
|
|
|
57
58
|
className?: string;
|
|
58
59
|
actions?: React.ReactNode;
|
|
59
60
|
areActionsFading?: boolean;
|
|
60
|
-
isNavigatable?: boolean;
|
|
61
61
|
isSelected?: boolean;
|
|
62
62
|
onItemClick?: () => void;
|
|
63
63
|
}
|
|
@@ -76,6 +76,7 @@ Tree.Item = function ({
|
|
|
76
76
|
label,
|
|
77
77
|
type = "node",
|
|
78
78
|
className = "",
|
|
79
|
+
variant = "file",
|
|
79
80
|
size = "sm",
|
|
80
81
|
visual,
|
|
81
82
|
checkbox,
|
|
@@ -86,7 +87,6 @@ Tree.Item = function ({
|
|
|
86
87
|
areActionsFading = true,
|
|
87
88
|
renderTreeItems,
|
|
88
89
|
children,
|
|
89
|
-
isNavigatable = false,
|
|
90
90
|
isSelected = false,
|
|
91
91
|
onItemClick,
|
|
92
92
|
}: TreeItemPropsWithChildren | TreeItemPropsWithRender) {
|
|
@@ -111,34 +111,16 @@ Tree.Item = function ({
|
|
|
111
111
|
|
|
112
112
|
const childrenToRender = getChildren();
|
|
113
113
|
|
|
114
|
-
const treeItemStyleClasses = {
|
|
115
|
-
base: "s-group s-flex s-cursor-default s-flex-row s-items-center",
|
|
116
|
-
isNavigatableBase:
|
|
117
|
-
"s-border s-transition-colors s-duration-300 s-ease-out s-cursor-pointer",
|
|
118
|
-
isNavigatableUnselected:
|
|
119
|
-
"s-border-structure-200/0 s-bg-white/0 hover:s-border-structure-200 hover:s-bg-white",
|
|
120
|
-
isNavigatableSelected: "s-border-structure-200 s-bg-white",
|
|
121
|
-
};
|
|
122
|
-
|
|
123
114
|
return (
|
|
124
115
|
<>
|
|
125
116
|
<div
|
|
126
117
|
className={classNames(
|
|
127
118
|
className ? className : "",
|
|
128
|
-
|
|
119
|
+
"s-group s-flex s-cursor-default s-flex-row s-items-center s-gap-4",
|
|
120
|
+
size === "sm" ? "s-py-1" : "s-py-2",
|
|
129
121
|
onItemClick ? "s-cursor-pointer" : "",
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
? size === "sm"
|
|
133
|
-
? "s-gap-1 s-rounded-lg s-py-1 s-pl-1.5 s-pr-3"
|
|
134
|
-
: "s-gap-2 s-rounded-lg s-py-2 s-pl-2.5 s-pr-4"
|
|
135
|
-
: size === "sm"
|
|
136
|
-
? "s-gap-1 s-py-1"
|
|
137
|
-
: "s-gap-2 s-py-2",
|
|
138
|
-
isNavigatable
|
|
139
|
-
? isSelected
|
|
140
|
-
? treeItemStyleClasses.isNavigatableSelected
|
|
141
|
-
: treeItemStyleClasses.isNavigatableUnselected
|
|
122
|
+
isSelected
|
|
123
|
+
? "s-rounded-md s-border s-border-neutral-200 s-bg-white"
|
|
142
124
|
: ""
|
|
143
125
|
)}
|
|
144
126
|
onClick={onItemClick ? onItemClick : undefined}
|
|
@@ -147,10 +129,10 @@ Tree.Item = function ({
|
|
|
147
129
|
<IconButton
|
|
148
130
|
icon={
|
|
149
131
|
childrenToRender && !effectiveCollapsed
|
|
150
|
-
?
|
|
151
|
-
:
|
|
132
|
+
? ChevronDownIcon
|
|
133
|
+
: ChevronRightIcon
|
|
152
134
|
}
|
|
153
|
-
size="
|
|
135
|
+
size="sm"
|
|
154
136
|
variant="secondary"
|
|
155
137
|
onClick={(e) => {
|
|
156
138
|
e.stopPropagation();
|
|
@@ -161,37 +143,50 @@ Tree.Item = function ({
|
|
|
161
143
|
/>
|
|
162
144
|
)}
|
|
163
145
|
{type === "leaf" && <div className="s-w-5"></div>}
|
|
164
|
-
{checkbox && <Checkbox {...checkbox}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
size={size === "sm" ? "sm" : "md"}
|
|
168
|
-
className="s-flex-shrink-0 s-text-element-600"
|
|
169
|
-
/>
|
|
170
|
-
|
|
171
|
-
<div
|
|
172
|
-
className={classNames(
|
|
173
|
-
"s-truncate s-font-medium s-text-element-900",
|
|
174
|
-
size === "sm" ? "s-ml-1 s-text-sm" : "s-ml-1 s-text-base"
|
|
175
|
-
)}
|
|
176
|
-
>
|
|
177
|
-
{label}
|
|
178
|
-
</div>
|
|
179
|
-
<div className="s-grow" />
|
|
180
|
-
{actions && (
|
|
146
|
+
{checkbox && <Checkbox {...checkbox} />}
|
|
147
|
+
|
|
148
|
+
<div className="s-flex s-w-full s-items-center">
|
|
181
149
|
<div
|
|
182
150
|
className={classNames(
|
|
183
|
-
"s-
|
|
184
|
-
|
|
185
|
-
? "s-transform s-opacity-0 s-duration-300 group-hover:s-opacity-100"
|
|
186
|
-
: ""
|
|
151
|
+
"s-grid s-w-full s-grid-cols-[auto,1fr,auto] s-items-center",
|
|
152
|
+
size === "sm" ? "s-gap-1.5" : "s-gap-2"
|
|
187
153
|
)}
|
|
188
154
|
>
|
|
189
|
-
{
|
|
155
|
+
{visual ? (
|
|
156
|
+
visual
|
|
157
|
+
) : (
|
|
158
|
+
<Icon
|
|
159
|
+
visual={visualTable[variant]}
|
|
160
|
+
size="sm"
|
|
161
|
+
className="s-flex-shrink-0 s-text-element-700"
|
|
162
|
+
/>
|
|
163
|
+
)}
|
|
164
|
+
|
|
165
|
+
<div
|
|
166
|
+
className={classNames(
|
|
167
|
+
"s-truncate s-font-medium s-text-element-900",
|
|
168
|
+
size === "sm" ? "s-text-sm" : "s-text-base"
|
|
169
|
+
)}
|
|
170
|
+
>
|
|
171
|
+
{label}
|
|
172
|
+
</div>
|
|
173
|
+
{actions && (
|
|
174
|
+
<div
|
|
175
|
+
className={classNames(
|
|
176
|
+
"s-inline-block s-pl-5",
|
|
177
|
+
areActionsFading
|
|
178
|
+
? "s-transform s-opacity-0 s-duration-300 group-hover:s-opacity-100"
|
|
179
|
+
: ""
|
|
180
|
+
)}
|
|
181
|
+
>
|
|
182
|
+
{actions}
|
|
183
|
+
</div>
|
|
184
|
+
)}
|
|
190
185
|
</div>
|
|
191
|
-
|
|
186
|
+
</div>
|
|
192
187
|
</div>
|
|
193
188
|
{React.Children.count(childrenToRender) > 0 && (
|
|
194
|
-
<div className="s-pl-
|
|
189
|
+
<div className="s-pl-5">{childrenToRender}</div>
|
|
195
190
|
)}
|
|
196
191
|
</>
|
|
197
192
|
);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
|
|
3
|
+
// Define breakpoints
|
|
4
|
+
export const breakpoints = {
|
|
5
|
+
xs: 0,
|
|
6
|
+
sm: 640,
|
|
7
|
+
md: 768,
|
|
8
|
+
lg: 1024,
|
|
9
|
+
xl: 1280,
|
|
10
|
+
xxl: 1536,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// Helper function to determine active breakpoint
|
|
14
|
+
function getActiveBreakpoint(width: number): keyof typeof breakpoints {
|
|
15
|
+
if (width >= breakpoints.xxl) {
|
|
16
|
+
return "xxl";
|
|
17
|
+
}
|
|
18
|
+
if (width >= breakpoints.xl) {
|
|
19
|
+
return "xl";
|
|
20
|
+
}
|
|
21
|
+
if (width >= breakpoints.lg) {
|
|
22
|
+
return "lg";
|
|
23
|
+
}
|
|
24
|
+
if (width >= breakpoints.md) {
|
|
25
|
+
return "md";
|
|
26
|
+
}
|
|
27
|
+
if (width >= breakpoints.sm) {
|
|
28
|
+
return "sm";
|
|
29
|
+
}
|
|
30
|
+
return "xs";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
interface WindowSizeState {
|
|
35
|
+
width: number | undefined;
|
|
36
|
+
height: number | undefined;
|
|
37
|
+
activeBreakpoint: keyof typeof breakpoints;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Custom hook to get window size and active breakpoint
|
|
41
|
+
export function useWindowSize() {
|
|
42
|
+
const [windowSize, setWindowSize] = useState<WindowSizeState>({
|
|
43
|
+
width: undefined,
|
|
44
|
+
height: undefined,
|
|
45
|
+
activeBreakpoint: "xs"
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
function handleResize() {
|
|
50
|
+
const width = window.innerWidth;
|
|
51
|
+
setWindowSize({
|
|
52
|
+
width,
|
|
53
|
+
height: window.innerHeight,
|
|
54
|
+
activeBreakpoint: getActiveBreakpoint(width),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
window.addEventListener("resize", handleResize);
|
|
59
|
+
handleResize();
|
|
60
|
+
|
|
61
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
62
|
+
}, []);
|
|
63
|
+
|
|
64
|
+
return windowSize;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default useWindowSize;
|
package/src/icons/solid/index.ts
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
export { default as ArrowDown } from "./ArrowDown";
|
|
2
2
|
export { default as ArrowDownCircle } from "./ArrowDownCircle";
|
|
3
3
|
export { default as ArrowDownOnSquare } from "./ArrowDownOnSquare";
|
|
4
|
-
export { default as ArrowDownS } from "./ArrowDownS";
|
|
5
4
|
export { default as ArrowLeft } from "./ArrowLeft";
|
|
6
|
-
export { default as ArrowLeftS } from "./ArrowLeftS";
|
|
7
5
|
export { default as ArrowPath } from "./ArrowPath";
|
|
8
6
|
export { default as ArrowRight } from "./ArrowRight";
|
|
9
|
-
export { default as ArrowRightS } from "./ArrowRightS";
|
|
10
7
|
export { default as ArrowUp } from "./ArrowUp";
|
|
11
8
|
export { default as ArrowUpOnSquare } from "./ArrowUpOnSquare";
|
|
12
|
-
export { default as ArrowUpS } from "./ArrowUpS";
|
|
13
9
|
export { default as Attachment } from "./Attachment";
|
|
14
10
|
export { default as Backspace } from "./Backspace";
|
|
15
11
|
export { default as Bookmark } from "./Bookmark";
|
|
@@ -22,8 +18,6 @@ export { default as ChatBubbleLeftRight } from "./ChatBubbleLeftRight";
|
|
|
22
18
|
export { default as ChatBubbleThought } from "./ChatBubbleThought";
|
|
23
19
|
export { default as Check } from "./Check";
|
|
24
20
|
export { default as CheckCircle } from "./CheckCircle";
|
|
25
|
-
export { default as ChevronDoubleLeft } from "./ChevronDoubleLeft";
|
|
26
|
-
export { default as ChevronDoubleRight } from "./ChevronDoubleRight";
|
|
27
21
|
export { default as ChevronDown } from "./ChevronDown";
|
|
28
22
|
export { default as ChevronLeft } from "./ChevronLeft";
|
|
29
23
|
export { default as ChevronRight } from "./ChevronRight";
|
|
@@ -40,7 +34,6 @@ export { default as CloudX } from "./CloudX";
|
|
|
40
34
|
export { default as Cog6Tooth } from "./Cog6Tooth";
|
|
41
35
|
export { default as Command } from "./Command";
|
|
42
36
|
export { default as CommandLine } from "./CommandLine";
|
|
43
|
-
export { default as Company } from "./Company";
|
|
44
37
|
export { default as Cube } from "./Cube";
|
|
45
38
|
export { default as Dash } from "./Dash";
|
|
46
39
|
export { default as Document } from "./Document";
|
|
@@ -55,7 +48,6 @@ export { default as ExclamationCircle } from "./ExclamationCircle";
|
|
|
55
48
|
export { default as ExternalLink } from "./ExternalLink";
|
|
56
49
|
export { default as Eye } from "./Eye";
|
|
57
50
|
export { default as EyeSlash } from "./EyeSlash";
|
|
58
|
-
export { default as Filter } from "./Filter";
|
|
59
51
|
export { default as Fire } from "./Fire";
|
|
60
52
|
export { default as Flag } from "./Flag";
|
|
61
53
|
export { default as Folder } from "./Folder";
|
|
@@ -66,11 +58,8 @@ export { default as GlobeAlt } from "./GlobeAlt";
|
|
|
66
58
|
export { default as Grab } from "./Grab";
|
|
67
59
|
export { default as HandThumbDown } from "./HandThumbDown";
|
|
68
60
|
export { default as HandThumbUp } from "./HandThumbUp";
|
|
69
|
-
export { default as Heart } from "./Heart";
|
|
70
61
|
export { default as HeartAlt } from "./HeartAlt";
|
|
71
62
|
export { default as Hexagon } from "./Hexagon";
|
|
72
|
-
export { default as History } from "./History";
|
|
73
|
-
export { default as Home } from "./Home";
|
|
74
63
|
export { default as Image } from "./Image";
|
|
75
64
|
export { default as InformationCircle } from "./InformationCircle";
|
|
76
65
|
export { default as Key } from "./Key";
|
|
@@ -85,7 +74,6 @@ export { default as Login } from "./Login";
|
|
|
85
74
|
export { default as Logout } from "./Logout";
|
|
86
75
|
export { default as Magic } from "./Magic";
|
|
87
76
|
export { default as MagnifyingGlass } from "./MagnifyingGlass";
|
|
88
|
-
export { default as MarkPen } from "./MarkPen";
|
|
89
77
|
export { default as Menu } from "./Menu";
|
|
90
78
|
export { default as More } from "./More";
|
|
91
79
|
export { default as MovingMail } from "./MovingMail";
|
|
@@ -118,7 +106,6 @@ export { default as Tag } from "./Tag";
|
|
|
118
106
|
export { default as Template } from "./Template";
|
|
119
107
|
export { default as TestTube } from "./TestTube";
|
|
120
108
|
export { default as Time } from "./Time";
|
|
121
|
-
export { default as Translate } from "./Translate";
|
|
122
109
|
export { default as Trash } from "./Trash";
|
|
123
110
|
export { default as Triangle } from "./Triangle";
|
|
124
111
|
export { default as User } from "./User";
|
|
@@ -128,4 +115,3 @@ export { default as UserPlus } from "./UserPlus";
|
|
|
128
115
|
export { default as Wrench } from "./Wrench";
|
|
129
116
|
export { default as XCircle } from "./XCircle";
|
|
130
117
|
export { default as XMark } from "./XMark";
|
|
131
|
-
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
export { default as ArrowDown } from "./ArrowDown";
|
|
2
2
|
export { default as ArrowDownCircle } from "./ArrowDownCircle";
|
|
3
3
|
export { default as ArrowDownOnSquare } from "./ArrowDownOnSquare";
|
|
4
|
-
export { default as ArrowDownS } from "./ArrowDownS";
|
|
5
4
|
export { default as ArrowLeft } from "./ArrowLeft";
|
|
6
|
-
export { default as ArrowLeftS } from "./ArrowLeftS";
|
|
7
5
|
export { default as ArrowPath } from "./ArrowPath";
|
|
8
6
|
export { default as ArrowRight } from "./ArrowRight";
|
|
9
|
-
export { default as ArrowRightS } from "./ArrowRightS";
|
|
10
7
|
export { default as ArrowUp } from "./ArrowUp";
|
|
11
8
|
export { default as ArrowUpOnSquare } from "./ArrowUpOnSquare";
|
|
12
|
-
export { default as ArrowUpS } from "./ArrowUpS";
|
|
13
9
|
export { default as Attachment } from "./Attachment";
|
|
14
10
|
export { default as Backspace } from "./Backspace";
|
|
15
11
|
export { default as Bookmark } from "./Bookmark";
|
|
@@ -22,8 +18,6 @@ export { default as ChatBubbleLeftRight } from "./ChatBubbleLeftRight";
|
|
|
22
18
|
export { default as ChatBubbleThought } from "./ChatBubbleThought";
|
|
23
19
|
export { default as Check } from "./Check";
|
|
24
20
|
export { default as CheckCircle } from "./CheckCircle";
|
|
25
|
-
export { default as ChevronDoubleLeft } from "./ChevronDoubleLeft";
|
|
26
|
-
export { default as ChevronDoubleRight } from "./ChevronDoubleRight";
|
|
27
21
|
export { default as ChevronDown } from "./ChevronDown";
|
|
28
22
|
export { default as ChevronLeft } from "./ChevronLeft";
|
|
29
23
|
export { default as ChevronRight } from "./ChevronRight";
|
|
@@ -40,7 +34,6 @@ export { default as CloudX } from "./CloudX";
|
|
|
40
34
|
export { default as Cog6Tooth } from "./Cog6Tooth";
|
|
41
35
|
export { default as Command } from "./Command";
|
|
42
36
|
export { default as CommandLine } from "./CommandLine";
|
|
43
|
-
export { default as Company } from "./Company";
|
|
44
37
|
export { default as Cube } from "./Cube";
|
|
45
38
|
export { default as Dash } from "./Dash";
|
|
46
39
|
export { default as Document } from "./Document";
|
|
@@ -55,7 +48,6 @@ export { default as ExclamationCircle } from "./ExclamationCircle";
|
|
|
55
48
|
export { default as ExternalLink } from "./ExternalLink";
|
|
56
49
|
export { default as Eye } from "./Eye";
|
|
57
50
|
export { default as EyeSlash } from "./EyeSlash";
|
|
58
|
-
export { default as Filter } from "./Filter";
|
|
59
51
|
export { default as Fire } from "./Fire";
|
|
60
52
|
export { default as Flag } from "./Flag";
|
|
61
53
|
export { default as Folder } from "./Folder";
|
|
@@ -66,11 +58,8 @@ export { default as GlobeAlt } from "./GlobeAlt";
|
|
|
66
58
|
export { default as Grab } from "./Grab";
|
|
67
59
|
export { default as HandThumbDown } from "./HandThumbDown";
|
|
68
60
|
export { default as HandThumbUp } from "./HandThumbUp";
|
|
69
|
-
export { default as Heart } from "./Heart";
|
|
70
61
|
export { default as HeartAlt } from "./HeartAlt";
|
|
71
62
|
export { default as Hexagon } from "./Hexagon";
|
|
72
|
-
export { default as History } from "./History";
|
|
73
|
-
export { default as Home } from "./Home";
|
|
74
63
|
export { default as Image } from "./Image";
|
|
75
64
|
export { default as InformationCircle } from "./InformationCircle";
|
|
76
65
|
export { default as Key } from "./Key";
|
|
@@ -85,7 +74,6 @@ export { default as Login } from "./Login";
|
|
|
85
74
|
export { default as Logout } from "./Logout";
|
|
86
75
|
export { default as Magic } from "./Magic";
|
|
87
76
|
export { default as MagnifyingGlass } from "./MagnifyingGlass";
|
|
88
|
-
export { default as MarkPen } from "./MarkPen";
|
|
89
77
|
export { default as Menu } from "./Menu";
|
|
90
78
|
export { default as More } from "./More";
|
|
91
79
|
export { default as MovingMail } from "./MovingMail";
|
|
@@ -118,7 +106,6 @@ export { default as Tag } from "./Tag";
|
|
|
118
106
|
export { default as Template } from "./Template";
|
|
119
107
|
export { default as TestTube } from "./TestTube";
|
|
120
108
|
export { default as Time } from "./Time";
|
|
121
|
-
export { default as Translate } from "./Translate";
|
|
122
109
|
export { default as Trash } from "./Trash";
|
|
123
110
|
export { default as Triangle } from "./Triangle";
|
|
124
111
|
export { default as User } from "./User";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import React from "react";
|
|
3
2
|
|
|
4
3
|
import { Checkbox } from "../index_with_tw_base";
|
|
5
4
|
|
|
@@ -10,67 +9,6 @@ const meta = {
|
|
|
10
9
|
|
|
11
10
|
export default meta;
|
|
12
11
|
type Story = StoryObj<typeof meta>;
|
|
13
|
-
export const CheckBoxExample = () => {
|
|
14
|
-
// No-op function for onChange
|
|
15
|
-
const handleChange = () => {
|
|
16
|
-
// This function intentionally left blank
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<div className="s-flex s-flex-col s-gap-10">
|
|
21
|
-
SM
|
|
22
|
-
<div className="s-flex s-gap-10">
|
|
23
|
-
Selectable
|
|
24
|
-
<Checkbox variant="selectable" onChange={handleChange} />
|
|
25
|
-
<Checkbox checked variant="selectable" onChange={handleChange} />
|
|
26
|
-
<Checkbox
|
|
27
|
-
checked="partial"
|
|
28
|
-
variant="selectable"
|
|
29
|
-
onChange={handleChange}
|
|
30
|
-
/>
|
|
31
|
-
Checkable
|
|
32
|
-
<Checkbox variant="checkable" onChange={handleChange} />
|
|
33
|
-
<Checkbox checked variant="checkable" onChange={handleChange} />
|
|
34
|
-
<Checkbox
|
|
35
|
-
checked="partial"
|
|
36
|
-
variant="checkable"
|
|
37
|
-
onChange={handleChange}
|
|
38
|
-
/>
|
|
39
|
-
</div>
|
|
40
|
-
XS
|
|
41
|
-
<div className="s-flex s-gap-10">
|
|
42
|
-
Selectable
|
|
43
|
-
<Checkbox size="xs" variant="selectable" onChange={handleChange} />
|
|
44
|
-
<Checkbox
|
|
45
|
-
size="xs"
|
|
46
|
-
checked
|
|
47
|
-
variant="selectable"
|
|
48
|
-
onChange={handleChange}
|
|
49
|
-
/>
|
|
50
|
-
<Checkbox
|
|
51
|
-
size="xs"
|
|
52
|
-
checked="partial"
|
|
53
|
-
variant="selectable"
|
|
54
|
-
onChange={handleChange}
|
|
55
|
-
/>
|
|
56
|
-
Checkable
|
|
57
|
-
<Checkbox size="xs" variant="checkable" onChange={handleChange} />
|
|
58
|
-
<Checkbox
|
|
59
|
-
size="xs"
|
|
60
|
-
checked
|
|
61
|
-
variant="checkable"
|
|
62
|
-
onChange={handleChange}
|
|
63
|
-
/>
|
|
64
|
-
<Checkbox
|
|
65
|
-
size="xs"
|
|
66
|
-
checked="partial"
|
|
67
|
-
variant="checkable"
|
|
68
|
-
onChange={handleChange}
|
|
69
|
-
/>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
);
|
|
73
|
-
};
|
|
74
12
|
|
|
75
13
|
export const Selectable: Story = {
|
|
76
14
|
args: {
|
|
@@ -94,7 +32,8 @@ export const Unchecked: Story = {
|
|
|
94
32
|
|
|
95
33
|
export const PartialChecked: Story = {
|
|
96
34
|
args: {
|
|
97
|
-
checked:
|
|
35
|
+
checked: false,
|
|
36
|
+
partialChecked: true,
|
|
98
37
|
variant: "checkable",
|
|
99
38
|
},
|
|
100
39
|
};
|