torch-glare 1.1.15 → 1.2.8
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 -21
- package/README.md +25 -25
- package/apps/lib/components/ActionButton.tsx +65 -65
- package/apps/lib/components/ActionsGroup.tsx +38 -38
- package/apps/lib/components/AlertDialog.tsx +222 -222
- package/apps/lib/components/Avatar.tsx +49 -49
- package/apps/lib/components/Badge.tsx +116 -116
- package/apps/lib/components/BadgeField.tsx +203 -203
- package/apps/lib/components/Breadcrumb.tsx +316 -0
- package/apps/lib/components/Button.tsx +265 -265
- package/apps/lib/components/ButtonGroup.tsx +200 -0
- package/apps/lib/components/Calendar.tsx +103 -103
- package/apps/lib/components/Card.tsx +64 -64
- package/apps/lib/components/ChartBlockTool.ts +711 -0
- package/apps/lib/components/Checkbox.tsx +49 -49
- package/apps/lib/components/CountBadge.tsx +54 -54
- package/apps/lib/components/DataTable.tsx +232 -232
- package/apps/lib/components/DatePicker.tsx +223 -223
- package/apps/lib/components/Dialog.tsx +129 -129
- package/apps/lib/components/Divider.tsx +31 -31
- package/apps/lib/components/Drawer.tsx +118 -118
- package/apps/lib/components/DropdownMenu.tsx +399 -399
- package/apps/lib/components/FieldHint.tsx +76 -76
- package/apps/lib/components/Form.tsx +191 -191
- package/apps/lib/components/ImageAttachment.tsx +196 -196
- package/apps/lib/components/InnerLabelField.tsx +150 -150
- package/apps/lib/components/Input.tsx +206 -206
- package/apps/lib/components/InputField.tsx +149 -149
- package/apps/lib/components/InputOTP.tsx +85 -85
- package/apps/lib/components/Label.tsx +126 -126
- package/apps/lib/components/LabelField.tsx +77 -77
- package/apps/lib/components/LabeledCheckBox.tsx +55 -55
- package/apps/lib/components/LabeledRadio.tsx +48 -48
- package/apps/lib/components/LinkButton.tsx +93 -93
- package/apps/lib/components/LoginButton.tsx +56 -56
- package/apps/lib/components/PasswordLevel.tsx +58 -58
- package/apps/lib/components/Popover.tsx +274 -274
- package/apps/lib/components/ProfileMenu.tsx +90 -90
- package/apps/lib/components/Radio.tsx +65 -65
- package/apps/lib/components/RadioCard.tsx +66 -66
- package/apps/lib/components/ScrollArea.tsx +52 -52
- package/apps/lib/components/SearchField.tsx +51 -51
- package/apps/lib/components/Select.tsx +418 -418
- package/apps/lib/components/SimpleSelect.tsx +216 -216
- package/apps/lib/components/Skeleton.tsx +15 -15
- package/apps/lib/components/SlideDatePicker.tsx +193 -193
- package/apps/lib/components/SpinLoading.tsx +190 -190
- package/apps/lib/components/Switch.tsx +81 -81
- package/apps/lib/components/TabFormItem.tsx +161 -161
- package/apps/lib/components/Table.tsx +397 -397
- package/apps/lib/components/TextEditor.tsx +1069 -0
- package/apps/lib/components/Textarea.tsx +96 -96
- package/apps/lib/components/Toast.tsx +86 -86
- package/apps/lib/components/Toggle.tsx +127 -127
- package/apps/lib/components/ToggleButton.tsx +140 -0
- package/apps/lib/components/Tooltip.tsx +111 -111
- package/apps/lib/components/TransparentLabel.tsx +72 -72
- package/apps/lib/components/TreeDropDown.tsx +69 -69
- package/apps/lib/hooks/useActiveTreeItem.ts +60 -60
- package/apps/lib/hooks/useClickOutside.ts +26 -26
- package/apps/lib/hooks/useResize.ts +78 -78
- package/apps/lib/hooks/useTagSelection.ts +214 -214
- package/apps/lib/layouts/CNLayout.tsx +330 -330
- package/apps/lib/layouts/FieldSection.tsx +63 -63
- package/apps/lib/layouts/TreeSubLayout.tsx +187 -187
- package/apps/lib/providers/ThemeProvider.tsx +98 -98
- package/apps/lib/types/editorjs.d.ts +41 -0
- package/apps/lib/utils/cn.ts +6 -6
- package/apps/lib/utils/dateFormat.ts +98 -98
- package/apps/lib/utils/markdownParser.ts +351 -0
- package/apps/lib/utils/resize.ts +34 -34
- package/apps/lib/utils/types.ts +12 -12
- package/dist/src/commands/block.d.ts +5 -0
- package/dist/src/commands/block.d.ts.map +1 -0
- package/dist/src/commands/block.js +255 -0
- package/dist/src/commands/block.js.map +1 -0
- package/docs/BLOCKS.md +129 -0
- package/docs/CHANGELOG-1.1.16.md +108 -0
- package/docs/README.md +207 -207
- package/docs/components/action-button.md +630 -0
- package/docs/components/actions-group.md +702 -0
- package/docs/components/alert-dialog.md +760 -0
- package/docs/components/avatar.md +705 -0
- package/docs/components/badge-field.md +704 -0
- package/docs/components/badge.md +622 -0
- package/docs/components/button.md +614 -0
- package/docs/components/calendar.md +548 -0
- package/docs/components/card.md +617 -0
- package/docs/components/checkbox.md +691 -0
- package/docs/components/cn-layout.md +848 -0
- package/docs/components/count-badge.md +554 -0
- package/docs/components/data-table.md +842 -0
- package/docs/components/date-picker.md +773 -0
- package/docs/components/dialog.md +739 -0
- package/docs/components/divider.md +760 -0
- package/docs/components/drawer.md +769 -0
- package/docs/components/dropdown-menu.md +636 -0
- package/docs/components/field-hint.md +886 -0
- package/docs/components/field-section.md +775 -0
- package/docs/components/form.md +788 -0
- package/docs/components/image-attachment.md +908 -0
- package/docs/components/inner-label-field.md +809 -0
- package/docs/components/input-field.md +579 -0
- package/docs/components/input-otp.md +753 -0
- package/docs/components/input.md +628 -0
- package/docs/components/label-field.md +760 -0
- package/docs/components/label.md +750 -0
- package/docs/components/labeled-checkbox.md +634 -0
- package/docs/components/labeled-radio.md +789 -0
- package/docs/components/link-button.md +679 -0
- package/docs/components/login-button.md +866 -0
- package/docs/components/password-level.md +790 -0
- package/docs/components/popover.md +646 -0
- package/docs/components/profile-menu.md +645 -0
- package/docs/components/radio-card.md +794 -0
- package/docs/components/radio.md +727 -0
- package/docs/components/scroll-area.md +687 -0
- package/docs/components/search-field.md +694 -0
- package/docs/components/select.md +680 -0
- package/docs/components/simple-select.md +703 -0
- package/docs/components/skeleton.md +696 -0
- package/docs/components/slide-date-picker.md +829 -0
- package/docs/components/spin-loading.md +687 -0
- package/docs/components/switch.md +762 -0
- package/docs/components/tab-form-item.md +767 -0
- package/docs/components/table.md +943 -0
- package/docs/components/textarea.md +633 -0
- package/docs/components/toast.md +764 -0
- package/docs/components/toggle.md +815 -0
- package/docs/components/tooltip.md +501 -0
- package/docs/components/transparent-label.md +712 -0
- package/docs/components/tree-dropdown.md +732 -0
- package/docs/components/tree-sub-layout.md +703 -0
- package/docs/how-to/guides.md +1047 -0
- package/docs/reference/components.md +562 -0
- package/docs/reference/hooks.md +1500 -0
- package/docs/reference/providers.md +866 -0
- package/docs/reference/tailwind-plugins.md +870 -0
- package/docs/reference/types.md +1008 -0
- package/docs/reference/utilities.md +711 -0
- package/docs/tutorials/building-first-form.md +848 -0
- package/docs/tutorials/component-composition.md +900 -0
- package/docs/tutorials/getting-started.md +559 -0
- package/docs/tutorials/theming-basics.md +779 -0
- package/package.json +31 -31
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 TORCH corp.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 TORCH corp.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
# TORCH Glare Components Library
|
|
2
|
-
|
|
3
|
-
Welcome to the **TORCH Glare Components Library**! This library offers a comprehensive set of reusable React components designed to help you build modern, efficient user interfaces. It also includes a powerful CLI tool (**torch-glare CLI**) to simplify component management and integration.
|
|
4
|
-
|
|
5
|
-

|
|
6
|
-
|
|
7
|
-
## Documentation
|
|
8
|
-
You can find the complete documentation at: [https://glare.torchcorp.com](https://glare.torchcorp.com)
|
|
9
|
-
|
|
10
|
-
## Contributing
|
|
11
|
-
We’re excited to welcome contributors! To get started:
|
|
12
|
-
|
|
13
|
-
1. Fork the repository.
|
|
14
|
-
2. Create a new branch.
|
|
15
|
-
3. Implement your changes.
|
|
16
|
-
4. Commit with a descriptive message.
|
|
17
|
-
5. Push your branch and open a pull request.
|
|
18
|
-
|
|
19
|
-
### Contribution Guidelines
|
|
20
|
-
- Adhere to the existing code style.
|
|
21
|
-
- Update or add documentation where applicable.
|
|
22
|
-
|
|
23
|
-
## License
|
|
24
|
-
This project is licensed under the **MIT License**.
|
|
25
|
-
|
|
1
|
+
# TORCH Glare Components Library
|
|
2
|
+
|
|
3
|
+
Welcome to the **TORCH Glare Components Library**! This library offers a comprehensive set of reusable React components designed to help you build modern, efficient user interfaces. It also includes a powerful CLI tool (**torch-glare CLI**) to simplify component management and integration.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Documentation
|
|
8
|
+
You can find the complete documentation at: [https://glare.torchcorp.com](https://glare.torchcorp.com)
|
|
9
|
+
|
|
10
|
+
## Contributing
|
|
11
|
+
We’re excited to welcome contributors! To get started:
|
|
12
|
+
|
|
13
|
+
1. Fork the repository.
|
|
14
|
+
2. Create a new branch.
|
|
15
|
+
3. Implement your changes.
|
|
16
|
+
4. Commit with a descriptive message.
|
|
17
|
+
5. Push your branch and open a pull request.
|
|
18
|
+
|
|
19
|
+
### Contribution Guidelines
|
|
20
|
+
- Adhere to the existing code style.
|
|
21
|
+
- Update or add documentation where applicable.
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
This project is licensed under the **MIT License**.
|
|
25
|
+
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import React, { ButtonHTMLAttributes } from "react";
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
-
import { Button } from "./Button";
|
|
4
|
-
import { cn } from "../utils/cn";
|
|
5
|
-
import { ButtonVariant, Themes } from "../utils/types";
|
|
6
|
-
|
|
7
|
-
const buttonVariants = cva("!rounded-[4px]", {
|
|
8
|
-
variants: {
|
|
9
|
-
size: {
|
|
10
|
-
XS: "h-[18px] w-[18px] text-[12px]",
|
|
11
|
-
S: "h-[22px] w-[22px] text-[12px]",
|
|
12
|
-
M: "h-[32px] w-[32px] text-[18px]",
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
defaultVariants: {
|
|
16
|
-
size: "M",
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
interface Props
|
|
22
|
-
extends ButtonHTMLAttributes<HTMLButtonElement>,
|
|
23
|
-
VariantProps<typeof buttonVariants> {
|
|
24
|
-
is_loading?: boolean;
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
asChild?: boolean;
|
|
27
|
-
as?: React.ElementType;
|
|
28
|
-
theme?: Themes
|
|
29
|
-
variant?: ButtonVariant
|
|
30
|
-
}
|
|
31
|
-
export const ActionButton = function ({
|
|
32
|
-
size,
|
|
33
|
-
asChild,
|
|
34
|
-
as: Tag = "button",
|
|
35
|
-
className,
|
|
36
|
-
variant,
|
|
37
|
-
type = "button",
|
|
38
|
-
children,
|
|
39
|
-
theme,
|
|
40
|
-
...props
|
|
41
|
-
}: Props) {
|
|
42
|
-
return (
|
|
43
|
-
<Button
|
|
44
|
-
theme={theme}
|
|
45
|
-
asChild={asChild}
|
|
46
|
-
buttonType="icon"
|
|
47
|
-
type={type}
|
|
48
|
-
size={
|
|
49
|
-
size == "XS" ? "S" :
|
|
50
|
-
size == "S" ? "M" :
|
|
51
|
-
size == "M" ? "L" : "S"
|
|
52
|
-
}
|
|
53
|
-
variant={variant}
|
|
54
|
-
className={cn(
|
|
55
|
-
buttonVariants({
|
|
56
|
-
size,
|
|
57
|
-
})
|
|
58
|
-
, className
|
|
59
|
-
)}
|
|
60
|
-
{...props}
|
|
61
|
-
>
|
|
62
|
-
{children}
|
|
63
|
-
</Button>
|
|
64
|
-
);
|
|
65
|
-
};
|
|
1
|
+
import React, { ButtonHTMLAttributes } from "react";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Button } from "./Button";
|
|
4
|
+
import { cn } from "../utils/cn";
|
|
5
|
+
import { ButtonVariant, Themes } from "../utils/types";
|
|
6
|
+
|
|
7
|
+
const buttonVariants = cva("!rounded-[4px]", {
|
|
8
|
+
variants: {
|
|
9
|
+
size: {
|
|
10
|
+
XS: "h-[18px] w-[18px] text-[12px]",
|
|
11
|
+
S: "h-[22px] w-[22px] text-[12px]",
|
|
12
|
+
M: "h-[32px] w-[32px] text-[18px]",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
size: "M",
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
interface Props
|
|
22
|
+
extends ButtonHTMLAttributes<HTMLButtonElement>,
|
|
23
|
+
VariantProps<typeof buttonVariants> {
|
|
24
|
+
is_loading?: boolean;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
asChild?: boolean;
|
|
27
|
+
as?: React.ElementType;
|
|
28
|
+
theme?: Themes
|
|
29
|
+
variant?: ButtonVariant
|
|
30
|
+
}
|
|
31
|
+
export const ActionButton = function ({
|
|
32
|
+
size,
|
|
33
|
+
asChild,
|
|
34
|
+
as: Tag = "button",
|
|
35
|
+
className,
|
|
36
|
+
variant,
|
|
37
|
+
type = "button",
|
|
38
|
+
children,
|
|
39
|
+
theme,
|
|
40
|
+
...props
|
|
41
|
+
}: Props) {
|
|
42
|
+
return (
|
|
43
|
+
<Button
|
|
44
|
+
theme={theme}
|
|
45
|
+
asChild={asChild}
|
|
46
|
+
buttonType="icon"
|
|
47
|
+
type={type}
|
|
48
|
+
size={
|
|
49
|
+
size == "XS" ? "S" :
|
|
50
|
+
size == "S" ? "M" :
|
|
51
|
+
size == "M" ? "L" : "S"
|
|
52
|
+
}
|
|
53
|
+
variant={variant}
|
|
54
|
+
className={cn(
|
|
55
|
+
buttonVariants({
|
|
56
|
+
size,
|
|
57
|
+
})
|
|
58
|
+
, className
|
|
59
|
+
)}
|
|
60
|
+
{...props}
|
|
61
|
+
>
|
|
62
|
+
{children}
|
|
63
|
+
</Button>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import React, { HTMLAttributes } from "react";
|
|
2
|
-
import { cn } from "../utils/cn";
|
|
3
|
-
import { Themes } from "../utils/types";
|
|
4
|
-
import { Divider } from "./Divider";
|
|
5
|
-
|
|
6
|
-
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
withDivider?: boolean; // to display the divider line if you pass it see on figma design file
|
|
8
|
-
theme?: Themes
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const ActionsGroup: React.FC<Props> = ({
|
|
12
|
-
withDivider,
|
|
13
|
-
className,
|
|
14
|
-
children,
|
|
15
|
-
theme,
|
|
16
|
-
...props
|
|
17
|
-
}) => {
|
|
18
|
-
return (
|
|
19
|
-
<section
|
|
20
|
-
{...props}
|
|
21
|
-
data-theme={theme}
|
|
22
|
-
className={cn("flex items-center gap-2 w-full", className)}
|
|
23
|
-
>
|
|
24
|
-
{withDivider && (
|
|
25
|
-
<Divider />
|
|
26
|
-
)}
|
|
27
|
-
{children}
|
|
28
|
-
{withDivider && (
|
|
29
|
-
<Divider />
|
|
30
|
-
)}
|
|
31
|
-
</section>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// <div className="flex border-t border-solid border-border-presentation-global-primary flex-1 px-2" />
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export default ActionsGroup;
|
|
1
|
+
import React, { HTMLAttributes } from "react";
|
|
2
|
+
import { cn } from "../utils/cn";
|
|
3
|
+
import { Themes } from "../utils/types";
|
|
4
|
+
import { Divider } from "./Divider";
|
|
5
|
+
|
|
6
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
withDivider?: boolean; // to display the divider line if you pass it see on figma design file
|
|
8
|
+
theme?: Themes
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const ActionsGroup: React.FC<Props> = ({
|
|
12
|
+
withDivider,
|
|
13
|
+
className,
|
|
14
|
+
children,
|
|
15
|
+
theme,
|
|
16
|
+
...props
|
|
17
|
+
}) => {
|
|
18
|
+
return (
|
|
19
|
+
<section
|
|
20
|
+
{...props}
|
|
21
|
+
data-theme={theme}
|
|
22
|
+
className={cn("flex items-center gap-2 w-full", className)}
|
|
23
|
+
>
|
|
24
|
+
{withDivider && (
|
|
25
|
+
<Divider />
|
|
26
|
+
)}
|
|
27
|
+
{children}
|
|
28
|
+
{withDivider && (
|
|
29
|
+
<Divider />
|
|
30
|
+
)}
|
|
31
|
+
</section>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// <div className="flex border-t border-solid border-border-presentation-global-primary flex-1 px-2" />
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export default ActionsGroup;
|