torch-glare 1.2.9 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/lib/components/Button.tsx +115 -64
- package/apps/lib/components/SectionCard.tsx +71 -0
- package/apps/lib/components/Stepper.tsx +374 -0
- package/apps/lib/components/TableDnDWrapper.ts +495 -0
- package/apps/lib/components/TextEditor.tsx +53 -1
- package/apps/lib/components/Timeline.tsx +283 -0
- package/apps/lib/utils/types.ts +8 -4
- package/dist/src/shared/getDependenciesAndInstallNestedComponents.d.ts.map +1 -1
- package/dist/src/shared/getDependenciesAndInstallNestedComponents.js +18 -2
- package/dist/src/shared/getDependenciesAndInstallNestedComponents.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,15 +5,16 @@ import { cn } from "../utils/cn";
|
|
|
5
5
|
import { ButtonVariant, Themes } from "../utils/types";
|
|
6
6
|
|
|
7
7
|
interface Props
|
|
8
|
-
extends
|
|
9
|
-
|
|
8
|
+
extends
|
|
9
|
+
ButtonHTMLAttributes<HTMLButtonElement>,
|
|
10
|
+
VariantProps<typeof buttonVariants> {
|
|
10
11
|
is_loading?: boolean;
|
|
11
12
|
disabled?: boolean;
|
|
12
13
|
asChild?: boolean;
|
|
13
14
|
variant?: ButtonVariant;
|
|
14
15
|
as?: React.ElementType;
|
|
15
|
-
theme?: Themes
|
|
16
|
-
containerClassName?: string
|
|
16
|
+
theme?: Themes;
|
|
17
|
+
containerClassName?: string;
|
|
17
18
|
}
|
|
18
19
|
export const Button = forwardRef<HTMLButtonElement, Props>(
|
|
19
20
|
(
|
|
@@ -32,7 +33,7 @@ export const Button = forwardRef<HTMLButtonElement, Props>(
|
|
|
32
33
|
containerClassName,
|
|
33
34
|
...props
|
|
34
35
|
},
|
|
35
|
-
ref
|
|
36
|
+
ref,
|
|
36
37
|
) => {
|
|
37
38
|
const Component = asChild ? Slot : Tag;
|
|
38
39
|
|
|
@@ -51,34 +52,45 @@ export const Button = forwardRef<HTMLButtonElement, Props>(
|
|
|
51
52
|
buttonType,
|
|
52
53
|
disabled,
|
|
53
54
|
}),
|
|
54
|
-
className
|
|
55
|
+
className,
|
|
55
56
|
)}
|
|
56
57
|
>
|
|
57
58
|
{asChild ? (
|
|
58
59
|
React.cloneElement(
|
|
59
60
|
children as React.ReactElement,
|
|
60
61
|
{},
|
|
61
|
-
<div
|
|
62
|
+
<div
|
|
63
|
+
className={cn(
|
|
64
|
+
"flex items-center justify-center [&>:is(i,svg):first-child]:mr-[3px] [&>:is(i,svg):last-child]:ml-[3px] [&>:is(i,svg):only-child]:m-0 [&:has(>:is(i,svg):last-child):not(:has(>:is(i,svg):first-child))]:pl-[6px] [&:has(>:is(i,svg):first-child):not(:has(>:is(i,svg):last-child))]:pr-[6px]",
|
|
65
|
+
containerClassName,
|
|
66
|
+
)}
|
|
67
|
+
>
|
|
62
68
|
{(children as React.ReactElement<any>).props.children}
|
|
63
69
|
{is_loading && <LoadingIcon size={size} />}
|
|
64
|
-
</div
|
|
70
|
+
</div>,
|
|
65
71
|
)
|
|
66
72
|
) : (
|
|
67
|
-
<div
|
|
73
|
+
<div
|
|
74
|
+
className={cn(
|
|
75
|
+
"flex items-center justify-center [&>:is(i,svg):first-child]:mr-[3px] [&>:is(i,svg):last-child]:ml-[3px] [&>:is(i,svg):only-child]:m-0 [&:has(>:is(i,svg):last-child):not(:has(>:is(i,svg):first-child))]:pl-[6px] [&:has(>:is(i,svg):first-child):not(:has(>:is(i,svg):last-child))]:pr-[6px]",
|
|
76
|
+
containerClassName,
|
|
77
|
+
)}
|
|
78
|
+
>
|
|
68
79
|
{children}
|
|
69
80
|
{is_loading && <LoadingIcon size={size} />}
|
|
70
81
|
</div>
|
|
71
82
|
)}
|
|
72
83
|
</Component>
|
|
73
84
|
);
|
|
74
|
-
}
|
|
85
|
+
},
|
|
75
86
|
);
|
|
76
87
|
|
|
77
|
-
Button.displayName = "Button"
|
|
88
|
+
Button.displayName = "Button";
|
|
78
89
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
90
|
+
export function LoadingIcon({
|
|
91
|
+
size,
|
|
92
|
+
className,
|
|
93
|
+
}: {
|
|
82
94
|
size?: "S" | "M" | "L" | "XL" | null;
|
|
83
95
|
className?: string;
|
|
84
96
|
}) {
|
|
@@ -88,7 +100,7 @@ export function LoadingIcon({ size, className }: {
|
|
|
88
100
|
S: "w-[12px] h-[12px]",
|
|
89
101
|
M: "w-[18px] h-[18px]",
|
|
90
102
|
L: "w-[20px] h-[20px]",
|
|
91
|
-
XL: "w-[20px] h-[20px]"
|
|
103
|
+
XL: "w-[20px] h-[20px]",
|
|
92
104
|
},
|
|
93
105
|
},
|
|
94
106
|
defaultVariants: {
|
|
@@ -115,91 +127,130 @@ export function LoadingIcon({ size, className }: {
|
|
|
115
127
|
);
|
|
116
128
|
}
|
|
117
129
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
130
|
export const buttonVariants = cva(
|
|
122
131
|
"flex items-center whitespace-nowrap justify-center transition-[background,color] duration-200 ease-in-out border border-transparent outline-none leading-none [&-i]:!leading-none",
|
|
123
132
|
{
|
|
124
133
|
variants: {
|
|
125
134
|
variant: {
|
|
126
|
-
//
|
|
135
|
+
// Sec variants: base = button-secondary, hover picks up fill color
|
|
127
136
|
PrimeStyle: [
|
|
128
|
-
"bg-background-presentation-
|
|
137
|
+
"bg-background-presentation-button-secondary",
|
|
129
138
|
"text-content-presentation-action-light-primary",
|
|
130
|
-
"hover:bg-background-presentation-
|
|
131
|
-
"hover:text-content-presentation-
|
|
132
|
-
"focus:lg:focus:md:border lg:focus:md:border-border-presentation-state-focus",
|
|
133
|
-
"active:bg-background-presentation-
|
|
139
|
+
"hover:bg-background-presentation-button-hover",
|
|
140
|
+
"hover:text-content-presentation-global-hover",
|
|
141
|
+
"focus:lg:focus:md:border lg:focus:md:border-border-presentation-state-focus",
|
|
142
|
+
"active:bg-background-presentation-button-hover active:text-content-presentation-global-hover",
|
|
134
143
|
],
|
|
135
|
-
|
|
136
|
-
"bg-background-presentation-
|
|
144
|
+
BluSecStyle: [
|
|
145
|
+
"bg-background-presentation-button-secondary",
|
|
137
146
|
"text-content-presentation-action-light-primary",
|
|
138
|
-
"hover:bg-background-presentation-
|
|
139
|
-
"hover:text-content-presentation-
|
|
147
|
+
"hover:bg-background-presentation-button-fill-blue-primary",
|
|
148
|
+
"hover:text-content-presentation-global-hover",
|
|
140
149
|
"focus:lg:border focus:lg:border-border-presentation-state-focus",
|
|
141
|
-
"active:bg-background-presentation-
|
|
150
|
+
"active:bg-background-presentation-button-fill-blue-primary active:text-content-presentation-global-hover",
|
|
142
151
|
],
|
|
143
152
|
YelSecStyle: [
|
|
144
|
-
"bg-background-presentation-
|
|
153
|
+
"bg-background-presentation-button-secondary",
|
|
145
154
|
"text-content-presentation-action-light-primary",
|
|
146
|
-
"hover:bg-background-presentation-
|
|
155
|
+
"hover:bg-background-presentation-button-fill-yellow-primary",
|
|
147
156
|
"hover:text-content-presentation-action-light-primary",
|
|
148
157
|
"focus:lg:border focus:lg:border-border-presentation-state-focus",
|
|
149
|
-
"active:bg-background-presentation-
|
|
158
|
+
"active:bg-background-presentation-button-fill-yellow-primary active:text-content-presentation-action-light-primary",
|
|
150
159
|
],
|
|
151
160
|
RedSecStyle: [
|
|
152
|
-
"bg-background-presentation-
|
|
161
|
+
"bg-background-presentation-button-secondary",
|
|
153
162
|
"text-content-presentation-action-light-primary",
|
|
154
|
-
"hover:bg-background-presentation-
|
|
155
|
-
"hover:text-content-presentation-
|
|
163
|
+
"hover:bg-background-presentation-button-fill-red-primary",
|
|
164
|
+
"hover:text-content-presentation-global-hover",
|
|
156
165
|
"focus:lg:border focus:lg:border-border-presentation-state-focus",
|
|
157
|
-
"active:bg-background-presentation-
|
|
166
|
+
"active:bg-background-presentation-button-fill-red-primary active:text-content-presentation-global-hover",
|
|
158
167
|
],
|
|
159
168
|
BorderStyle: [
|
|
160
169
|
"text-content-presentation-action-light-primary",
|
|
161
170
|
"border border-border-presentation-action-disabled",
|
|
162
|
-
"bg-background-presentation-
|
|
163
|
-
"hover:bg-background-presentation-
|
|
164
|
-
"hover:text-content-presentation-
|
|
171
|
+
"bg-background-presentation-button-borderstyle",
|
|
172
|
+
"hover:bg-background-presentation-button-hover",
|
|
173
|
+
"hover:text-content-presentation-global-hover",
|
|
165
174
|
"focus:lg:border focus:lg:border-border-presentation-state-focus",
|
|
166
175
|
"focus:lg:text-content-presentation-action-light-primary",
|
|
167
|
-
"focus:hover:lg:text-content-presentation-
|
|
168
|
-
"active:bg-background-presentation-
|
|
176
|
+
"focus:hover:lg:text-content-presentation-global-hover",
|
|
177
|
+
"active:bg-background-presentation-button-hover active:text-content-presentation-global-hover",
|
|
169
178
|
],
|
|
179
|
+
// Cont variants: transparent base, hover shows button-contstyle-hover
|
|
170
180
|
PrimeContStyle: [
|
|
171
181
|
"text-content-presentation-action-light-primary",
|
|
172
182
|
"border-transparent bg-transparent",
|
|
173
|
-
"hover:bg-background-presentation-
|
|
183
|
+
"hover:bg-background-presentation-button-contstyle-hover",
|
|
174
184
|
"hover:text-content-presentation-action-light-primary",
|
|
175
185
|
"focus:lg:border focus:lg:border-border-presentation-state-focus",
|
|
176
|
-
"focus:lg:bg-background-presentation-
|
|
177
|
-
"active:bg-background-presentation-
|
|
186
|
+
"focus:lg:bg-background-presentation-button-borderstyle",
|
|
187
|
+
"active:bg-background-presentation-button-contstyle-hover active:text-content-presentation-action-light-primary",
|
|
178
188
|
],
|
|
179
|
-
|
|
189
|
+
BluContStyle: [
|
|
180
190
|
"text-content-presentation-action-light-primary",
|
|
181
191
|
"border-transparent bg-transparent",
|
|
182
|
-
"hover:bg-background-presentation-
|
|
183
|
-
"hover:text-content-presentation-
|
|
192
|
+
"hover:bg-background-presentation-button-contstyle-hover",
|
|
193
|
+
"hover:text-content-presentation-global-information-hover",
|
|
184
194
|
"focus:lg:border focus:lg:border-border-presentation-state-focus",
|
|
185
|
-
"focus:lg:bg-background-presentation-
|
|
186
|
-
"active:bg-background-presentation-
|
|
195
|
+
"focus:lg:bg-background-presentation-button-borderstyle",
|
|
196
|
+
"active:bg-background-presentation-button-contstyle-hover active:text-content-presentation-global-information-hover",
|
|
187
197
|
],
|
|
188
198
|
RedContStyle: [
|
|
189
199
|
"text-content-presentation-action-light-primary",
|
|
190
200
|
"border-transparent bg-transparent",
|
|
191
|
-
"hover:bg-background-presentation-
|
|
192
|
-
"hover:text-content-presentation-
|
|
201
|
+
"hover:bg-background-presentation-button-contstyle-hover",
|
|
202
|
+
"hover:text-content-presentation-global-negative-hover",
|
|
203
|
+
"focus:lg:border focus:lg:border-border-presentation-state-focus",
|
|
204
|
+
"focus:lg:bg-background-presentation-button-borderstyle",
|
|
205
|
+
"active:bg-background-presentation-button-contstyle-hover active:text-content-presentation-global-negative-hover",
|
|
206
|
+
],
|
|
207
|
+
// Col variants: filled solid color base, hover deepens to -secondary
|
|
208
|
+
PrimeColStyle: [
|
|
209
|
+
"bg-background-presentation-button-primary",
|
|
210
|
+
"text-content-presentation-global-primary-inverse",
|
|
211
|
+
"hover:bg-background-presentation-button-hover",
|
|
212
|
+
"hover:text-content-presentation-global-primary-inverse",
|
|
213
|
+
"focus:lg:border focus:lg:border-border-presentation-state-focus",
|
|
214
|
+
"active:bg-background-presentation-button-hover active:text-content-presentation-global-primary-inverse",
|
|
215
|
+
],
|
|
216
|
+
BluColStyle: [
|
|
217
|
+
"bg-background-presentation-button-fill-blue-primary",
|
|
218
|
+
"text-content-presentation-action-dark-primary",
|
|
219
|
+
"hover:bg-background-presentation-button-fill-blue-secondary",
|
|
220
|
+
"hover:text-content-presentation-action-dark-primary",
|
|
221
|
+
"focus:lg:border focus:lg:border-border-presentation-state-focus",
|
|
222
|
+
"active:bg-background-presentation-button-fill-blue-secondary active:text-content-presentation-action-dark-primary",
|
|
223
|
+
],
|
|
224
|
+
RedColStyle: [
|
|
225
|
+
"bg-background-presentation-button-fill-red-primary",
|
|
226
|
+
"text-content-presentation-action-dark-primary",
|
|
227
|
+
"hover:bg-background-presentation-button-fill-red-secondary",
|
|
228
|
+
"hover:text-content-presentation-action-dark-primary",
|
|
229
|
+
"focus:lg:border focus:lg:border-border-presentation-state-focus",
|
|
230
|
+
"active:bg-background-presentation-button-fill-red-secondary active:text-content-presentation-action-dark-primary",
|
|
231
|
+
],
|
|
232
|
+
GreenColStyle: [
|
|
233
|
+
"bg-background-presentation-button-fill-green-primary",
|
|
234
|
+
"text-content-presentation-action-dark-primary",
|
|
235
|
+
"hover:bg-background-presentation-button-fill-green-secondary",
|
|
236
|
+
"hover:text-content-presentation-action-dark-primary",
|
|
237
|
+
"focus:lg:border focus:lg:border-border-presentation-state-focus",
|
|
238
|
+
"active:bg-background-presentation-button-fill-green-secondary active:text-content-presentation-action-dark-primary",
|
|
239
|
+
],
|
|
240
|
+
YelColStyle: [
|
|
241
|
+
"bg-background-presentation-button-fill-yellow-primary",
|
|
242
|
+
"text-content-presentation-global-primary",
|
|
243
|
+
"hover:bg-background-presentation-button-fill-yellow-secondary",
|
|
244
|
+
"hover:text-content-presentation-global-primary",
|
|
193
245
|
"focus:lg:border focus:lg:border-border-presentation-state-focus",
|
|
194
|
-
"
|
|
195
|
-
"active:bg-background-presentation-action-contstyle-hover active:text-content-presentation-action-negative-hover",
|
|
246
|
+
"active:bg-background-presentation-button-fill-yellow-secondary active:text-content-presentation-global-primary",
|
|
196
247
|
],
|
|
197
248
|
},
|
|
198
249
|
size: {
|
|
199
|
-
S: "h-[22px] px-[6px] typography-body-small-medium rounded-[4px] [&_i]:text-[12px]",
|
|
200
|
-
M: "h-[28px] px-[14px] typography-body-large-medium rounded-[
|
|
201
|
-
L: "h-[34px] px-[22px] typography-body-large-medium rounded-[
|
|
202
|
-
XL: "h-[40px] px-[30px] typography-headers-medium-medium rounded-[
|
|
250
|
+
S: "h-[22px] py-[2px] px-[6px] typography-body-small-medium rounded-[4px] [&_i]:text-[12px]",
|
|
251
|
+
M: "h-[28px] py-[2px] px-[14px] typography-body-large-medium rounded-[6px] [&_i]:text-[18px]",
|
|
252
|
+
L: "h-[34px] py-[5px] px-[22px] typography-body-large-medium rounded-[8px] [&_i]:text-[20px]",
|
|
253
|
+
XL: "h-[40px] py-[8px] px-[30px] typography-headers-medium-medium rounded-[8px] [&_i]:text-[22px]",
|
|
203
254
|
},
|
|
204
255
|
is_loading: {
|
|
205
256
|
true: "[&_i]:hidden",
|
|
@@ -222,12 +273,12 @@ export const buttonVariants = cva(
|
|
|
222
273
|
is_loading: true,
|
|
223
274
|
className: [
|
|
224
275
|
"cursor-wait",
|
|
225
|
-
"bg-background-presentation-
|
|
226
|
-
"text-content-presentation-
|
|
227
|
-
"hover:bg-background-presentation-
|
|
228
|
-
"hover:text-content-presentation-
|
|
276
|
+
"bg-background-presentation-button-hover",
|
|
277
|
+
"text-content-presentation-global-hover",
|
|
278
|
+
"hover:bg-background-presentation-button-hover",
|
|
279
|
+
"hover:text-content-presentation-global-hover",
|
|
229
280
|
"focus:lg:border focus:lg:border-transparent",
|
|
230
|
-
"active:bg-background-presentation-
|
|
281
|
+
"active:bg-background-presentation-button-hover active:text-content-presentation-global-hover",
|
|
231
282
|
],
|
|
232
283
|
},
|
|
233
284
|
{
|
|
@@ -235,7 +286,7 @@ export const buttonVariants = cva(
|
|
|
235
286
|
className: [
|
|
236
287
|
"cursor-not-allowed",
|
|
237
288
|
"pointer-events-none",
|
|
238
|
-
"bg-background-presentation-
|
|
289
|
+
"bg-background-presentation-button-disabled",
|
|
239
290
|
"text-content-presentation-state-disabled",
|
|
240
291
|
"border-transparent",
|
|
241
292
|
],
|
|
@@ -261,5 +312,5 @@ export const buttonVariants = cva(
|
|
|
261
312
|
className: "w-[40px] h-[40px] p-0 leading-[0]",
|
|
262
313
|
},
|
|
263
314
|
],
|
|
264
|
-
}
|
|
315
|
+
},
|
|
265
316
|
);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { forwardRef, HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../utils/cn";
|
|
4
|
+
|
|
5
|
+
const titleBadge = cva(
|
|
6
|
+
"flex pt-2 pb-2 pl-[16px] pr-[22px] justify-center items-center gap-[6px] rounded-[10px] self-start typography-headers-medium-medium text-[#F4F4F4]",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
color: {
|
|
10
|
+
Blue: "bg-blue-sparkle-900",
|
|
11
|
+
Yellow: "bg-yellow-950",
|
|
12
|
+
Green: "bg-green-cyan-900",
|
|
13
|
+
Red: "bg-medium-red-900",
|
|
14
|
+
Orange: "bg-red-orange-900",
|
|
15
|
+
Purple: "bg-violet-900",
|
|
16
|
+
Pink: "bg-medium-violet-red-900",
|
|
17
|
+
Gray: "bg-background-presentation-button-primary",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: { color: "Blue" },
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export type SectionColor = NonNullable<VariantProps<typeof titleBadge>["color"]>;
|
|
25
|
+
|
|
26
|
+
export interface SectionCardProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
27
|
+
color?: SectionColor;
|
|
28
|
+
title?: ReactNode;
|
|
29
|
+
containerClassName?: string;
|
|
30
|
+
headerClassName?: string;
|
|
31
|
+
bodyClassName?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const SectionCard = forwardRef<HTMLDivElement, SectionCardProps>(
|
|
35
|
+
(
|
|
36
|
+
{
|
|
37
|
+
children,
|
|
38
|
+
color,
|
|
39
|
+
title,
|
|
40
|
+
className,
|
|
41
|
+
containerClassName,
|
|
42
|
+
headerClassName,
|
|
43
|
+
bodyClassName,
|
|
44
|
+
...props
|
|
45
|
+
},
|
|
46
|
+
ref,
|
|
47
|
+
) => {
|
|
48
|
+
return (
|
|
49
|
+
<div
|
|
50
|
+
ref={ref}
|
|
51
|
+
className={cn(
|
|
52
|
+
"flex w-[1100px] pt-[6px] pb-[24px] px-0 flex-col rounded-[16px] bg-background-presentation-form-base shadow-[0_0_32px_2px_rgba(0,0,0,0.05)]",
|
|
53
|
+
className,
|
|
54
|
+
containerClassName,
|
|
55
|
+
)}
|
|
56
|
+
{...props}
|
|
57
|
+
>
|
|
58
|
+
{title && (
|
|
59
|
+
<div className={cn("flex px-[6px] flex-col gap-[10px]", headerClassName)}>
|
|
60
|
+
<div className={cn(titleBadge({ color }))}>{title}</div>
|
|
61
|
+
</div>
|
|
62
|
+
)}
|
|
63
|
+
<div className={cn("flex px-[42px] flex-col gap-[2px]", bodyClassName)}>
|
|
64
|
+
{children}
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
},
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
SectionCard.displayName = "SectionCard";
|