torch-glare 1.0.2
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/LICENSE +21 -0
- package/README.md +207 -0
- package/cli/bin/addComponent.js +278 -0
- package/cli/bin/addHooks.js +75 -0
- package/cli/bin/addLayout.js +71 -0
- package/cli/bin/addProvider.js +71 -0
- package/cli/bin/addUtils.js +74 -0
- package/cli/bin/cli.js +73 -0
- package/cli/bin/init/init.js +15 -0
- package/cli/bin/init/tailwindInit.js +174 -0
- package/cli/bin/update.js +147 -0
- package/lib/components/ActionButton.tsx +63 -0
- package/lib/components/ActionsGroup.tsx +34 -0
- package/lib/components/AlertDialog.tsx +211 -0
- package/lib/components/Badge.tsx +116 -0
- package/lib/components/BadgeField.tsx +192 -0
- package/lib/components/Button.tsx +277 -0
- package/lib/components/Card.tsx +63 -0
- package/lib/components/Checkbox.tsx +122 -0
- package/lib/components/CountBadge.tsx +54 -0
- package/lib/components/DatePicker.tsx +464 -0
- package/lib/components/Drawer.tsx +118 -0
- package/lib/components/DropdownMenu.tsx +399 -0
- package/lib/components/FieldHint.tsx +76 -0
- package/lib/components/ImageAttachment.tsx +180 -0
- package/lib/components/InnerLabelField.tsx +155 -0
- package/lib/components/Input.tsx +179 -0
- package/lib/components/InputField.tsx +147 -0
- package/lib/components/Label.tsx +107 -0
- package/lib/components/LabelField.tsx +75 -0
- package/lib/components/LabeledCheckBox.tsx +65 -0
- package/lib/components/LabeledRadio.tsx +45 -0
- package/lib/components/LinkButton.tsx +94 -0
- package/lib/components/LoginButton.tsx +56 -0
- package/lib/components/PasswordLevel.tsx +58 -0
- package/lib/components/Popover.tsx +274 -0
- package/lib/components/ProfileMenu.tsx +90 -0
- package/lib/components/Radio.tsx +77 -0
- package/lib/components/RadioCard.tsx +72 -0
- package/lib/components/RingLoading.tsx +190 -0
- package/lib/components/SearchField.tsx +49 -0
- package/lib/components/Select.tsx +417 -0
- package/lib/components/SlideDatePicker.tsx +120 -0
- package/lib/components/SpinLoading.tsx +190 -0
- package/lib/components/Switcher.tsx +56 -0
- package/lib/components/TabFormItem.tsx +158 -0
- package/lib/components/Table.tsx +395 -0
- package/lib/components/Textarea.tsx +108 -0
- package/lib/components/Tooltip.tsx +111 -0
- package/lib/components/TransparentLabel.tsx +72 -0
- package/lib/components/TreeDropDown.tsx +69 -0
- package/lib/hooks/MobileSlidePicker/components/Picker.tsx +218 -0
- package/lib/hooks/MobileSlidePicker/components/PickerColumn.tsx +238 -0
- package/lib/hooks/MobileSlidePicker/components/PickerItem.tsx +64 -0
- package/lib/hooks/MobileSlidePicker/index.ts +10 -0
- package/lib/hooks/useActiveTreeItem.tsx +61 -0
- package/lib/hooks/useClickOutside.tsx +20 -0
- package/lib/hooks/useResize.tsx +78 -0
- package/lib/layouts/CLayout.tsx +326 -0
- package/lib/layouts/FieldSection.tsx +64 -0
- package/lib/layouts/TreeSubLayout.tsx +187 -0
- package/lib/providers/ThemeProvider.tsx +99 -0
- package/lib/utils/cn.ts +6 -0
- package/lib/utils/convertImageFileToDataUrl.ts +17 -0
- package/lib/utils/resize.ts +35 -0
- package/lib/utils/types.ts +12 -0
- package/package.json +28 -0
- package/torch-glare.js +24 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { InputHTMLAttributes, forwardRef } from "react";
|
|
3
|
+
import { cn } from "../utils/cn";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { Themes } from "../utils/types";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const glareRadioStyles = cva(
|
|
9
|
+
[
|
|
10
|
+
"w-[12px]",
|
|
11
|
+
"h-[12px]",
|
|
12
|
+
"rounded-full",
|
|
13
|
+
"border",
|
|
14
|
+
"border-border-presentation-action-checkbox-primary",
|
|
15
|
+
"bg-background-presentation-action-borderstyle",
|
|
16
|
+
"transition-[background,border-color,background-color] duration-200",
|
|
17
|
+
"hover:bg-blue-sparkle-alpha-15 hover:border-border-presentation-state-focus",
|
|
18
|
+
"appearance-none",
|
|
19
|
+
"checked:border-background-presentation-state-information-primary checked:hover:bg-white checked:bg-white",
|
|
20
|
+
"disabled:bg-background-presentation-action-disabled disabled:border-border-presentation-global-primary",
|
|
21
|
+
"disabled:cursor-not-allowed",
|
|
22
|
+
],
|
|
23
|
+
{
|
|
24
|
+
variants: {
|
|
25
|
+
size: {
|
|
26
|
+
S: ["w-[12px] checked:border-[5px]", "h-[12px]"],
|
|
27
|
+
M: ["w-[24px] checked:border-[9px]", "h-[24px]"],
|
|
28
|
+
L: ["w-[24px] checked:border-[9px]", "h-[24px]"],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
size: "M",
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
interface Props extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "children"> {
|
|
38
|
+
size?: "S" | "M" | "L";
|
|
39
|
+
children?: React.ReactNode;
|
|
40
|
+
theme?: Themes
|
|
41
|
+
radioClassName?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const Radio = forwardRef<HTMLInputElement, Props>(
|
|
45
|
+
({ size = "M", className, children, theme, radioClassName, ...props }, ref) => {
|
|
46
|
+
return (
|
|
47
|
+
children ?
|
|
48
|
+
<label data-theme={theme} htmlFor={props.id} className={cn("flex items-center justify-start gap-1", className)}>
|
|
49
|
+
<input
|
|
50
|
+
{...props}
|
|
51
|
+
ref={ref}
|
|
52
|
+
type="radio"
|
|
53
|
+
className={cn(
|
|
54
|
+
glareRadioStyles({
|
|
55
|
+
size,
|
|
56
|
+
}),
|
|
57
|
+
radioClassName
|
|
58
|
+
)}
|
|
59
|
+
/>
|
|
60
|
+
{children}
|
|
61
|
+
</label>
|
|
62
|
+
:
|
|
63
|
+
<input
|
|
64
|
+
{...props}
|
|
65
|
+
ref={ref}
|
|
66
|
+
type="radio"
|
|
67
|
+
className={cn(
|
|
68
|
+
glareRadioStyles({
|
|
69
|
+
size,
|
|
70
|
+
}),
|
|
71
|
+
radioClassName
|
|
72
|
+
)}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
Radio.displayName = "Radio";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { forwardRef, InputHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import { cn } from "../utils/cn";
|
|
3
|
+
import { Radio } from "./Radio";
|
|
4
|
+
import { Card, CardContent, CardDescription, CardHeader } from "./Card";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
interface Props extends InputHTMLAttributes<HTMLInputElement> {
|
|
8
|
+
headerLabel?: ReactNode;
|
|
9
|
+
id: string;
|
|
10
|
+
description?: ReactNode;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
theme?: "dark" | "light" | "default";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const RadioCard = forwardRef<HTMLInputElement, Props>(
|
|
17
|
+
(
|
|
18
|
+
{ headerLabel, description, disabled, className, id, children, theme, ...props },
|
|
19
|
+
ref
|
|
20
|
+
) => {
|
|
21
|
+
return (
|
|
22
|
+
<Card
|
|
23
|
+
data-theme={theme}
|
|
24
|
+
asChild
|
|
25
|
+
className={cn(
|
|
26
|
+
"relative border-border-presentation-global-primary group",
|
|
27
|
+
// Disabled state
|
|
28
|
+
disabled && "!bg-background-presentation-action-disabled",
|
|
29
|
+
disabled && "cursor-not-allowed",
|
|
30
|
+
disabled && "hover:border-border-presentation-global-primary",
|
|
31
|
+
// Checked state
|
|
32
|
+
props.checked && "border-border-presentation-global-primary",
|
|
33
|
+
props.checked && "hover:border-border-presentation-global-primary"
|
|
34
|
+
)}
|
|
35
|
+
>
|
|
36
|
+
<label htmlFor={id}
|
|
37
|
+
>
|
|
38
|
+
<section
|
|
39
|
+
className={"absolute top-0 left-0 w-full p-[10px] flex justify-end"}
|
|
40
|
+
>
|
|
41
|
+
<Radio
|
|
42
|
+
{...props}
|
|
43
|
+
theme={theme}
|
|
44
|
+
radioClassName="group-hover:border-border-presentation-state-focus"
|
|
45
|
+
size="M"
|
|
46
|
+
ref={ref}
|
|
47
|
+
id={id}
|
|
48
|
+
checked={props.checked}
|
|
49
|
+
disabled={disabled}
|
|
50
|
+
/>
|
|
51
|
+
</section>
|
|
52
|
+
|
|
53
|
+
<CardHeader >
|
|
54
|
+
{headerLabel}
|
|
55
|
+
</CardHeader>
|
|
56
|
+
|
|
57
|
+
<CardContent >
|
|
58
|
+
{description && (
|
|
59
|
+
<CardDescription >
|
|
60
|
+
{description}
|
|
61
|
+
</CardDescription>
|
|
62
|
+
)}
|
|
63
|
+
{children}
|
|
64
|
+
</CardContent>
|
|
65
|
+
</label >
|
|
66
|
+
</Card>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
RadioCard.displayName = "RadioCard"
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../utils/cn";
|
|
4
|
+
|
|
5
|
+
export const loadingFrame = cva("relative flex justify-center items-center", {
|
|
6
|
+
variants: {
|
|
7
|
+
size: {
|
|
8
|
+
S: "w-[200px] h-[200px]",
|
|
9
|
+
M: "w-[400px] h-[400px]",
|
|
10
|
+
L: "w-[500px] h-[500px]",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
size: "S",
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const loadingAnimationTextContainer = cva("", {
|
|
19
|
+
variants: {
|
|
20
|
+
size: {
|
|
21
|
+
S: "w-[150px] h-[150px]",
|
|
22
|
+
M: "w-[200px] h-[200px]",
|
|
23
|
+
L: "w-[300px] h-[300px]",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
size: "S",
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
32
|
+
size?: "S" | "M" | "L"; // this is used to change the size style of the component
|
|
33
|
+
theme?: "light" | "dark" | "default";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default function RingLoading({ className, theme = "light", size = "M", ...props }: Props) {
|
|
37
|
+
return (
|
|
38
|
+
<section data-theme={theme} {...props} className={cn(loadingFrame({ size }), className)}>
|
|
39
|
+
<DarkRingLoadingIcon
|
|
40
|
+
data-theme={theme}
|
|
41
|
+
className="w-full h-full animate-spin bg-transparent object-cover object-center hidden data-[theme=dark]:flex"
|
|
42
|
+
/>
|
|
43
|
+
|
|
44
|
+
{/* Light Theme Loader */}
|
|
45
|
+
<RingLoadingIcon
|
|
46
|
+
data-theme={theme}
|
|
47
|
+
className="w-full h-full animate-spin bg-transparent object-cover object-center hidden data-[theme=light]:flex"
|
|
48
|
+
/>
|
|
49
|
+
<section
|
|
50
|
+
className={cn(
|
|
51
|
+
"absolute flex justify-center items-center top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"
|
|
52
|
+
)}
|
|
53
|
+
>
|
|
54
|
+
{props.children}
|
|
55
|
+
</section>
|
|
56
|
+
</section>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
const DarkRingLoadingIcon = (props: HTMLAttributes<HTMLOrSVGElement>) => (
|
|
64
|
+
<svg
|
|
65
|
+
{...props}
|
|
66
|
+
id="e7Ze8cPfGzd1"
|
|
67
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
68
|
+
xmlnsXlink="http://www.w3.org/1999/xlink"
|
|
69
|
+
viewBox="0 0 216 216"
|
|
70
|
+
shapeRendering="geometricPrecision"
|
|
71
|
+
textRendering="geometricPrecision"
|
|
72
|
+
>
|
|
73
|
+
<defs>
|
|
74
|
+
<filter
|
|
75
|
+
id="e7Ze8cPfGzd3-filter"
|
|
76
|
+
x="-150%"
|
|
77
|
+
width="400%"
|
|
78
|
+
y="-150%"
|
|
79
|
+
height="400%"
|
|
80
|
+
>
|
|
81
|
+
<feGaussianBlur
|
|
82
|
+
id="e7Ze8cPfGzd3-filter-blur-0"
|
|
83
|
+
stdDeviation="4,4"
|
|
84
|
+
result="result"
|
|
85
|
+
/>
|
|
86
|
+
</filter>
|
|
87
|
+
<linearGradient
|
|
88
|
+
id="e7Ze8cPfGzd4-fill"
|
|
89
|
+
x1="16"
|
|
90
|
+
y1="116"
|
|
91
|
+
x2="126.065"
|
|
92
|
+
y2="28.6871"
|
|
93
|
+
spreadMethod="pad"
|
|
94
|
+
gradientUnits="userSpaceOnUse"
|
|
95
|
+
gradientTransform="translate(0 0)"
|
|
96
|
+
>
|
|
97
|
+
<stop
|
|
98
|
+
id="e7Ze8cPfGzd4-fill-0"
|
|
99
|
+
offset="0%"
|
|
100
|
+
stopColor="rgba(83,23,255,0)"
|
|
101
|
+
/>
|
|
102
|
+
<stop id="e7Ze8cPfGzd4-fill-1" offset="100%" stopColor="#b900d8" />
|
|
103
|
+
</linearGradient>
|
|
104
|
+
<filter
|
|
105
|
+
id="e7Ze8cPfGzd5-filter"
|
|
106
|
+
x="-150%"
|
|
107
|
+
width="400%"
|
|
108
|
+
y="-150%"
|
|
109
|
+
height="400%"
|
|
110
|
+
>
|
|
111
|
+
<feGaussianBlur
|
|
112
|
+
id="e7Ze8cPfGzd5-filter-blur-0"
|
|
113
|
+
stdDeviation="8,8"
|
|
114
|
+
result="result"
|
|
115
|
+
/>
|
|
116
|
+
</filter>
|
|
117
|
+
<linearGradient
|
|
118
|
+
id="e7Ze8cPfGzd6-fill"
|
|
119
|
+
x1="16"
|
|
120
|
+
y1="116"
|
|
121
|
+
x2="126.065"
|
|
122
|
+
y2="28.6871"
|
|
123
|
+
spreadMethod="pad"
|
|
124
|
+
gradientUnits="userSpaceOnUse"
|
|
125
|
+
gradientTransform="translate(0 0)"
|
|
126
|
+
>
|
|
127
|
+
<stop
|
|
128
|
+
id="e7Ze8cPfGzd6-fill-0"
|
|
129
|
+
offset="0%"
|
|
130
|
+
stopColor="rgba(83,23,255,0)"
|
|
131
|
+
/>
|
|
132
|
+
<stop id="e7Ze8cPfGzd6-fill-1" offset="100%" stopColor="#b900d8" />
|
|
133
|
+
</linearGradient>
|
|
134
|
+
<linearGradient
|
|
135
|
+
id="e7Ze8cPfGzd7-fill"
|
|
136
|
+
x1="16"
|
|
137
|
+
y1="116"
|
|
138
|
+
x2="126.065"
|
|
139
|
+
y2="28.6871"
|
|
140
|
+
spreadMethod="pad"
|
|
141
|
+
gradientUnits="userSpaceOnUse"
|
|
142
|
+
gradientTransform="translate(0 0)"
|
|
143
|
+
>
|
|
144
|
+
<stop
|
|
145
|
+
id="e7Ze8cPfGzd7-fill-0"
|
|
146
|
+
offset="0%"
|
|
147
|
+
stopColor="rgba(83,23,255,0.3)"
|
|
148
|
+
/>
|
|
149
|
+
<stop id="e7Ze8cPfGzd7-fill-1" offset="100%" stopColor="#e75cff" />
|
|
150
|
+
</linearGradient>
|
|
151
|
+
</defs>
|
|
152
|
+
<path
|
|
153
|
+
d="M116,16c55.228,0,100,44.7715,100,100c0,55.228-44.772,100-100,100-55.2285,0-100-44.772-100-100C16,60.7715,60.7715,16,116,16Zm0,195c52.467,0,95-42.533,95-95s-42.533-95-95-95-95,42.5329-95,95c0,52.467,42.5329,95,95,95Z"
|
|
154
|
+
transform="translate(-8-8)"
|
|
155
|
+
fillOpacity="0.1"
|
|
156
|
+
/>
|
|
157
|
+
<g transform="translate(-7.999968-8)" filter="url(#e7Ze8cPfGzd3-filter)">
|
|
158
|
+
<path
|
|
159
|
+
d="M116,18.5c0-1.3807-1.119-2.5033-2.5-2.4688-12.28.3071-24.4062,2.8745-35.7684,7.5808-12.1325,5.0255-23.1564,12.3915-32.4423,21.6773-9.2858,9.2859-16.6518,20.3098-21.6773,32.4424C18.9057,89.0939,16.3383,101.22,16.0312,113.5c-.0345,1.381,1.0881,2.5,2.4688,2.5s2.4966-1.12,2.5329-2.5c.3059-11.623,2.7434-23.0994,7.1985-33.8549c4.7742-11.5259,11.7719-21.9987,20.5934-30.8202s19.2943-15.8193,30.8203-20.5935c10.7555-4.4551,22.2319-6.8926,33.8549-7.1985c1.38-.0363,2.5-1.1522,2.5-2.5329Z"
|
|
160
|
+
fill="url(#e7Ze8cPfGzd4-fill)"
|
|
161
|
+
/>
|
|
162
|
+
</g>
|
|
163
|
+
<g transform="translate(-8-8)" filter="url(#e7Ze8cPfGzd5-filter)">
|
|
164
|
+
<path
|
|
165
|
+
d="M116,18.5c0-1.3807-1.119-2.5033-2.5-2.4688-12.28.3071-24.4062,2.8745-35.7684,7.5808-12.1325,5.0255-23.1564,12.3915-32.4423,21.6773-9.2858,9.2859-16.6518,20.3098-21.6773,32.4424C18.9057,89.0939,16.3383,101.22,16.0312,113.5c-.0345,1.381,1.0881,2.5,2.4688,2.5s2.4966-1.12,2.5329-2.5c.3059-11.623,2.7434-23.0994,7.1985-33.8549c4.7742-11.5259,11.7719-21.9987,20.5934-30.8202s19.2943-15.8193,30.8203-20.5935c10.7555-4.4551,22.2319-6.8926,33.8549-7.1985c1.38-.0363,2.5-1.1522,2.5-2.5329Z"
|
|
166
|
+
fill="url(#e7Ze8cPfGzd6-fill)"
|
|
167
|
+
/>
|
|
168
|
+
</g>
|
|
169
|
+
<path
|
|
170
|
+
d="M116,18.5c0-1.3807-1.119-2.5033-2.5-2.4688-12.28.3071-24.4062,2.8745-35.7684,7.5808-12.1325,5.0255-23.1564,12.3915-32.4423,21.6773-9.2858,9.2859-16.6518,20.3098-21.6773,32.4424C18.9057,89.0939,16.3383,101.22,16.0312,113.5c-.0345,1.381,1.0881,2.5,2.4688,2.5s2.4966-1.12,2.5329-2.5c.3059-11.623,2.7434-23.0994,7.1985-33.8549c4.7742-11.5259,11.7719-21.9987,20.5934-30.8202s19.2943-15.8193,30.8203-20.5935c10.7555-4.4551,22.2319-6.8926,33.8549-7.1985c1.38-.0363,2.5-1.1522,2.5-2.5329Z"
|
|
171
|
+
transform="translate(-8-8)"
|
|
172
|
+
fill="url(#e7Ze8cPfGzd7-fill)"
|
|
173
|
+
/>
|
|
174
|
+
</svg>
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
const RingLoadingIcon = (props: HTMLAttributes<HTMLOrSVGElement>) => (
|
|
180
|
+
<svg {...props} width="200" height="200" viewBox="0 0 200 200" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
181
|
+
<path d="M200 100C200 155.228 155.228 200 100 200C44.7715 200 0 155.228 0 100C0 44.7715 44.7715 0 100 0C155.228 0 200 44.7715 200 100ZM5 100C5 152.467 47.5329 195 100 195C152.467 195 195 152.467 195 100C195 47.5329 152.467 5 100 5C47.5329 5 5 47.5329 5 100Z" fill="black" fillOpacity="0.1" />
|
|
182
|
+
<path d="M197.5 100C198.881 100 200.003 98.8805 199.969 97.5002C199.662 85.22 197.094 73.0938 192.388 61.7317C187.362 49.5991 179.997 38.5752 170.711 29.2893C161.425 20.0035 150.401 12.6375 138.268 7.61205C126.906 2.90567 114.78 0.338305 102.5 0.031247C101.119 -0.00326585 100 1.11929 100 2.5C100 3.88071 101.12 4.99656 102.5 5.03289C114.123 5.33884 125.599 7.77635 136.355 12.2314C147.881 17.0056 158.354 24.0033 167.175 32.8249C175.997 41.6464 182.994 52.1191 187.769 63.6451C192.224 74.4006 194.661 85.8767 194.967 97.5002C195.003 98.8805 196.119 100 197.5 100Z" fill="url(#paint0_linear_10856_138364)" />
|
|
183
|
+
<defs>
|
|
184
|
+
<linearGradient id="paint0_linear_10856_138364" x1="3.4045" y1="-9.09091" x2="225.705" y2="19.8973" gradientUnits="userSpaceOnUse">
|
|
185
|
+
<stop stopColor="#D500F9" />
|
|
186
|
+
<stop offset="1" stopColor="#5317FF" />
|
|
187
|
+
</linearGradient>
|
|
188
|
+
</defs>
|
|
189
|
+
</svg>
|
|
190
|
+
);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { forwardRef, ReactNode } from "react";
|
|
2
|
+
import { Props, InputField } from "./InputField";
|
|
3
|
+
import { cn } from "../utils/cn";
|
|
4
|
+
|
|
5
|
+
interface SearchProps extends Props {
|
|
6
|
+
Searchplaceholder?: ReactNode
|
|
7
|
+
secondaryPlaceholder?: ReactNode
|
|
8
|
+
}
|
|
9
|
+
// Use InputField types in the SearchInput component
|
|
10
|
+
export const SearchField = forwardRef<HTMLInputElement, SearchProps>(
|
|
11
|
+
({ Searchplaceholder, secondaryPlaceholder, className, ...props }, forwardedRef) => {
|
|
12
|
+
return (
|
|
13
|
+
<div className={cn("mb-[10px] w-full h-fit justify-center items-center rounded-[12px] p-[3px] bg-[rgba(106,112,144,0.60)] shadow-[0px_0px_18px_0px_rgba(0,0,0,0.75)] backdrop-blur-[21px]", className)}>
|
|
14
|
+
<InputField
|
|
15
|
+
{...props}
|
|
16
|
+
ref={forwardedRef}
|
|
17
|
+
type="text"
|
|
18
|
+
variant="SystemStyle"
|
|
19
|
+
size="M"
|
|
20
|
+
className="h-[54px] rounded-[9px] p-[15px] border-border-system-global-primary bg-[rgba(0,0,0,0.60)]"
|
|
21
|
+
icon={
|
|
22
|
+
<SearchInputPlaceholder value={props.value} secondaryPlaceholder={secondaryPlaceholder} Searchplaceholder={Searchplaceholder} />
|
|
23
|
+
}
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
SearchField.displayName = " SearchField"; // Set displayName for debugging
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
function SearchInputPlaceholder({ Searchplaceholder, secondaryPlaceholder, value }: { Searchplaceholder?: ReactNode, secondaryPlaceholder?: ReactNode, value: any }) {
|
|
34
|
+
return (
|
|
35
|
+
<div className="flex gap-[10px] justify-center items-center ">
|
|
36
|
+
<i className="ri-search-2-line text-[24px] text-[#E5E5E5]"></i>
|
|
37
|
+
|
|
38
|
+
{
|
|
39
|
+
value == "" ? (
|
|
40
|
+
<div className="flex gap-[5px] justify-center items-center">
|
|
41
|
+
<p className="text-content-system-global-primary typography-headers-medium-regular leading-none opacity-[0.8] ">{Searchplaceholder}</p>
|
|
42
|
+
<p className="text-content-system-global-primary typography-body-medium-medium leading-none opacity-30 mix-blend-luminosity">{secondaryPlaceholder}</p>
|
|
43
|
+
</div>
|
|
44
|
+
) : null
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
</div>
|
|
48
|
+
)
|
|
49
|
+
}
|