@alexandregme/zljs 0.6.0 → 1.0.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/dist/index.d.ts +4 -3
- package/dist/index.js +36 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -28,12 +28,13 @@ interface IconProps {
|
|
|
28
28
|
size?: Size;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
type ButtonVariant = "default" | "icon" | "
|
|
31
|
+
type ButtonVariant = "default" | "icon" | "link";
|
|
32
|
+
type ButtonColor = SemanticColor | "ghost";
|
|
32
33
|
interface ButtonProps {
|
|
33
34
|
children?: ReactNode;
|
|
34
35
|
type?: "button" | "submit" | "reset";
|
|
35
36
|
variant?: ButtonVariant;
|
|
36
|
-
color?:
|
|
37
|
+
color?: ButtonColor;
|
|
37
38
|
size?: Size;
|
|
38
39
|
icon?: IconName;
|
|
39
40
|
iconPosition?: "left" | "right";
|
|
@@ -455,4 +456,4 @@ declare class HTTPClient {
|
|
|
455
456
|
}
|
|
456
457
|
|
|
457
458
|
export { AppWrapper, Button, Checkbox, ConnectedModal, DataGrid, DocumentWrapper, Error, Form, GlobalState, HTTPClient, Heading, Icon, Input, Loader, Modal, PageWrapper, Radio, Select, Sidebar, Spinner, StatsCard, Tag, Text, TextArea, Toaster, WhatsAppButton, splitURLasPath, useAppStore, useModalStore, usePageStore, useRouterStore, useToastStore };
|
|
458
|
-
export type { AppState, AppWrapperProps, ButtonProps, ButtonVariant, CheckboxProps, ConnectedModalProps, DataGridColumn, DataGridProps, DocumentWrapperProps, ErrorProps, ExtendedStore, FormProps, GlobalStateProps, HeadingProps, HttpClientConfig, HttpRequestConfig, IconName, InitPageFunction, InputProps, LoaderProps, ModalEntry, ModalProps, ModalState, PageState, PageWrapperProps, RadioProps, RouterState, SelectOption, SelectProps, SidebarItem, SidebarProps, SidebarSection, SidebarUser, SpinnerProps, SpinnerVariant, StatsCardProps, TagProps, TextAreaProps, TextProps, TextVariant, Toast, ToastState, ToastType, WhatsAppButtonProps };
|
|
459
|
+
export type { AppState, AppWrapperProps, ButtonColor, ButtonProps, ButtonVariant, CheckboxProps, ConnectedModalProps, DataGridColumn, DataGridProps, DocumentWrapperProps, ErrorProps, ExtendedStore, FormProps, GlobalStateProps, HeadingProps, HttpClientConfig, HttpRequestConfig, IconName, InitPageFunction, InputProps, LoaderProps, ModalEntry, ModalProps, ModalState, PageState, PageWrapperProps, RadioProps, RouterState, SelectOption, SelectProps, SidebarItem, SidebarProps, SidebarSection, SidebarUser, SpinnerProps, SpinnerVariant, StatsCardProps, TagProps, TextAreaProps, TextProps, TextVariant, Toast, ToastState, ToastType, WhatsAppButtonProps };
|
package/dist/index.js
CHANGED
|
@@ -40,8 +40,7 @@ var button = tv({
|
|
|
40
40
|
variant: {
|
|
41
41
|
default: "px-4 py-2 text-white text-sm gap-2 rounded-md focus:ring-2 focus:ring-offset-2",
|
|
42
42
|
icon: "p-1 bg-transparent text-gray-500 hover:text-gray-700 hover:bg-gray-100 focus:ring-gray-500 rounded-md focus:ring-2 focus:ring-offset-2",
|
|
43
|
-
|
|
44
|
-
link: "text-xs underline bg-transparent hover:no-underline"
|
|
43
|
+
link: "text-xs hover:underline"
|
|
45
44
|
},
|
|
46
45
|
color: {
|
|
47
46
|
primary: "bg-blue-600 hover:bg-blue-700 focus:ring-blue-500",
|
|
@@ -49,6 +48,7 @@ var button = tv({
|
|
|
49
48
|
danger: "bg-red-600 hover:bg-red-700 focus:ring-red-500",
|
|
50
49
|
warning: "bg-yellow-500 hover:bg-yellow-600 focus:ring-yellow-500 text-gray-900",
|
|
51
50
|
info: "bg-cyan-500 hover:bg-cyan-600 focus:ring-cyan-500",
|
|
51
|
+
ghost: "bg-transparent text-neutral-400 hover:text-white hover:bg-neutral-800 focus:ring-neutral-600",
|
|
52
52
|
none: ""
|
|
53
53
|
},
|
|
54
54
|
size: {
|
|
@@ -58,6 +58,11 @@ var button = tv({
|
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
compoundVariants: [
|
|
61
|
+
{
|
|
62
|
+
variant: "default",
|
|
63
|
+
color: "none",
|
|
64
|
+
class: "bg-gray-100 text-gray-900 hover:bg-gray-200 focus:ring-gray-500"
|
|
65
|
+
},
|
|
61
66
|
{
|
|
62
67
|
variant: "default",
|
|
63
68
|
size: "sm",
|
|
@@ -81,17 +86,41 @@ var button = tv({
|
|
|
81
86
|
{
|
|
82
87
|
variant: "link",
|
|
83
88
|
color: "primary",
|
|
84
|
-
class: "
|
|
89
|
+
class: "text-blue-600 hover:text-blue-800"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
variant: "link",
|
|
93
|
+
color: "success",
|
|
94
|
+
class: "text-green-600 hover:text-green-800"
|
|
85
95
|
},
|
|
86
96
|
{
|
|
87
97
|
variant: "link",
|
|
88
98
|
color: "danger",
|
|
89
|
-
class: "
|
|
99
|
+
class: "text-red-600 hover:text-red-800"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
variant: "link",
|
|
103
|
+
color: "warning",
|
|
104
|
+
class: "text-yellow-600 hover:text-yellow-800"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
variant: "link",
|
|
108
|
+
color: "info",
|
|
109
|
+
class: "text-cyan-600 hover:text-cyan-800"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
variant: "link",
|
|
113
|
+
color: "ghost",
|
|
114
|
+
class: "text-neutral-400 hover:text-neutral-600"
|
|
90
115
|
},
|
|
91
116
|
{
|
|
92
117
|
variant: "link",
|
|
93
118
|
color: "none",
|
|
94
119
|
class: "text-slate-500 hover:text-slate-700"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
variant: "link",
|
|
123
|
+
class: "bg-transparent hover:bg-transparent"
|
|
95
124
|
}
|
|
96
125
|
],
|
|
97
126
|
defaultVariants: {
|
|
@@ -142,7 +171,7 @@ var Button = ({
|
|
|
142
171
|
"aria-label": ariaLabel,
|
|
143
172
|
className: button({
|
|
144
173
|
variant,
|
|
145
|
-
color: variant === "icon"
|
|
174
|
+
color: variant === "icon" && color !== "ghost" ? "none" : color,
|
|
146
175
|
size
|
|
147
176
|
}),
|
|
148
177
|
children: renderContent()
|
|
@@ -926,7 +955,7 @@ var Sidebar = ({
|
|
|
926
955
|
/* @__PURE__ */ jsx17(
|
|
927
956
|
Button,
|
|
928
957
|
{
|
|
929
|
-
|
|
958
|
+
color: "ghost",
|
|
930
959
|
icon: "LogOut",
|
|
931
960
|
"aria-label": "Logout",
|
|
932
961
|
onClick: onLogout
|
|
@@ -936,7 +965,7 @@ var Sidebar = ({
|
|
|
936
965
|
/* @__PURE__ */ jsx17("div", { className: toggleButton(), children: /* @__PURE__ */ jsx17(
|
|
937
966
|
Button,
|
|
938
967
|
{
|
|
939
|
-
|
|
968
|
+
color: "ghost",
|
|
940
969
|
icon: collapsed ? "ChevronRight" : "ChevronLeft",
|
|
941
970
|
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
942
971
|
onClick: () => setCollapsed(!collapsed),
|