@alexandregme/zljs 3.20.0 → 3.22.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/CHANGELOG.md +15 -1
- package/dist/{chunk-DM4EKQGH.js → chunk-GQX4SRDD.js} +4 -2
- package/dist/index.d.ts +17 -3
- package/dist/index.js +55 -19
- package/dist/next/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,18 @@ A change that needs action in an app has a **Migration** note. When updating, re
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [3.22.0] - 2026-11-24
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- `Icon` has the `SiSupabase` icon
|
|
16
|
+
|
|
17
|
+
## [3.21.0] - 2026-11-21
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- `Disclosure`: a line that opens and closes what is under it, made with the native `details` element. `summary` is the line that always shows and `children` is what it hides. `defaultOpen` starts it open, and `variant="outlined"` draws a border around it, for an item of a list. The types `DisclosureProps` and `DisclosureVariant` come with it
|
|
22
|
+
|
|
11
23
|
## [3.20.0] - 2026-11-21
|
|
12
24
|
|
|
13
25
|
### Added
|
|
@@ -611,7 +623,9 @@ Replace the shade with the class of the `color` being tested, for example `/(^|\
|
|
|
611
623
|
|
|
612
624
|
The message of `Error` is `text-zl-danger`. `none` and `ghost` didn't change.
|
|
613
625
|
|
|
614
|
-
[Unreleased]: https://github.com/alexandregme/zljs/compare/v3.
|
|
626
|
+
[Unreleased]: https://github.com/alexandregme/zljs/compare/v3.22.0...HEAD
|
|
627
|
+
[3.22.0]: https://github.com/alexandregme/zljs/compare/v3.21.0...v3.22.0
|
|
628
|
+
[3.21.0]: https://github.com/alexandregme/zljs/compare/v3.20.0...v3.21.0
|
|
615
629
|
[3.20.0]: https://github.com/alexandregme/zljs/compare/v3.19.0...v3.20.0
|
|
616
630
|
[3.19.0]: https://github.com/alexandregme/zljs/compare/v3.18.0...v3.19.0
|
|
617
631
|
[3.18.0]: https://github.com/alexandregme/zljs/compare/v3.17.0...v3.18.0
|
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
SiInstagram,
|
|
11
11
|
SiShopify,
|
|
12
12
|
SiGithub,
|
|
13
|
-
SiVercel
|
|
13
|
+
SiVercel,
|
|
14
|
+
SiSupabase
|
|
14
15
|
} from "react-icons/si";
|
|
15
16
|
var iconBrands = {
|
|
16
17
|
SiWhatsapp,
|
|
@@ -18,7 +19,8 @@ var iconBrands = {
|
|
|
18
19
|
SiInstagram,
|
|
19
20
|
SiShopify,
|
|
20
21
|
SiGithub,
|
|
21
|
-
SiVercel
|
|
22
|
+
SiVercel,
|
|
23
|
+
SiSupabase
|
|
22
24
|
};
|
|
23
25
|
var iconSizes = {
|
|
24
26
|
sm: 12,
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import 'react-hook-form';
|
|
|
12
12
|
*/
|
|
13
13
|
type Size = "sm" | "md" | "lg";
|
|
14
14
|
|
|
15
|
-
declare const iconNames: readonly ["Check", "X", "Plus", "Minus", "Search", "Menu", "ChevronDown", "ChevronUp", "ChevronLeft", "ChevronRight", "ChevronsUp", "ArrowUp", "Pencil", "Trash2", "Save", "RefreshCw", "Home", "MessageSquare", "Users", "Store", "ShoppingCart", "BarChart3", "Brain", "Send", "LogOut", "Download", "Share2", "User", "Key", "Contact", "Package", "Warehouse", "HandCoins", "Stethoscope", "LogIn", "Megaphone", "LayoutDashboard", "Smile", "Frown", "Cat", "ArrowRight", "Loader", "LoaderCircle", "CheckCircle", "XCircle", "AlertTriangle", "Info", "Route", "Navigation", "ListChecks", "Map", "MapPinOff", "Settings", "SiWhatsapp", "SiFacebook", "SiInstagram", "SiShopify", "SiGithub", "SiVercel"];
|
|
15
|
+
declare const iconNames: readonly ["Check", "X", "Plus", "Minus", "Search", "Menu", "ChevronDown", "ChevronUp", "ChevronLeft", "ChevronRight", "ChevronsUp", "ArrowUp", "Pencil", "Trash2", "Save", "RefreshCw", "Home", "MessageSquare", "Users", "Store", "ShoppingCart", "BarChart3", "Brain", "Send", "LogOut", "Download", "Share2", "User", "Key", "Contact", "Package", "Warehouse", "HandCoins", "Stethoscope", "LogIn", "Megaphone", "LayoutDashboard", "Smile", "Frown", "Cat", "ArrowRight", "Loader", "LoaderCircle", "CheckCircle", "XCircle", "AlertTriangle", "Info", "Route", "Navigation", "ListChecks", "Map", "MapPinOff", "Settings", "SiWhatsapp", "SiFacebook", "SiInstagram", "SiShopify", "SiGithub", "SiVercel", "SiSupabase"];
|
|
16
16
|
|
|
17
17
|
type IconName = (typeof iconNames)[number];
|
|
18
18
|
/** The sizes every component has, and `xl` for an icon that stands alone. */
|
|
@@ -193,6 +193,20 @@ type TextAreaProps = TextAreaName & {
|
|
|
193
193
|
|
|
194
194
|
declare const TextArea: ({ label: labelText, "aria-label": ariaLabel, name, placeholder, autoComplete, value, rows, error, disabled, required, onChange, onBlur, onKeyDown, ref, }: TextAreaProps) => react.JSX.Element;
|
|
195
195
|
|
|
196
|
+
type DisclosureVariant = "plain" | "outlined";
|
|
197
|
+
interface DisclosureProps {
|
|
198
|
+
/** Hidden until the user opens it. */
|
|
199
|
+
children: ReactNode;
|
|
200
|
+
/** Always visible: the line the user clicks to open and close. */
|
|
201
|
+
summary: ReactNode;
|
|
202
|
+
/** Starts open. The user can still close it. */
|
|
203
|
+
defaultOpen?: boolean;
|
|
204
|
+
/** `outlined` draws a border around it, for an item of a list. */
|
|
205
|
+
variant?: DisclosureVariant;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
declare const Disclosure: ({ children, summary, defaultOpen, variant, }: DisclosureProps) => react.JSX.Element;
|
|
209
|
+
|
|
196
210
|
declare const Icon: ({ name, size, color, "aria-label": ariaLabel, }: IconProps) => react.JSX.Element;
|
|
197
211
|
|
|
198
212
|
interface StatsCardProps {
|
|
@@ -775,5 +789,5 @@ declare const useAuth: () => UseAuthResult;
|
|
|
775
789
|
|
|
776
790
|
declare const ZustandProviders: ({ children, auth }: ZustandProvidersProps) => react.JSX.Element;
|
|
777
791
|
|
|
778
|
-
export { AccessPending, AuthAdapter, AuthProvider, AuthSession, Authorized, AuxiliaryColor, Button, Card, Checkbox, ConnectedModal, DataColor, DataGrid, Error, Form, HTTPClient, Heading, Icon, Input, InstallAppButton, Loader, Login, Modal, Navigation, Radio, ReduxProvider, ReduxProviderProps, Select, SemanticColor, ShareAppButton, Sidebar, SignOutButton, Spinner, StatsCard, Tabs, Tag, Text, TextArea, Toaster, TopNav, WhatsAppButton, ZustandProviders, ZustandProvidersProps, appInitialState, getAuthSession, splitURLasPath, toast, useAppStore, useAuth, useInstallApp, useIsDesktop, usePageStore, useRouterStore, useToastStore };
|
|
779
|
-
export type { AppState, AuthorizedProps, ButtonColor, ButtonProps, ButtonVariant, CardProps, CheckboxProps, CheckboxVariant, ConnectedModalProps, DataGridColumn, DataGridProps, ErrorProps, FormProps, HeadingProps, HttpClientConfig, HttpRequestConfig, IconName, IconProps, IconSize, InputProps, InstallApp, InstallAppButtonProps, InstallAppWay, LoaderProps, LoginProvider, LoginVendor, ModalProps, NavigationMode, NavigationProps, PageState, RadioProps, ReduxStore, RouterState, SelectOption, SelectProps, ShareAppButtonProps, SidebarItem, SidebarProps, SidebarSection, SidebarUser, Size, SpinnerProps, SpinnerVariant, StatsCardProps, TabsItem, TabsProps, TagColor, TagProps, TextAreaProps, TextProps, TextVariant, Toast, ToastState, ToastType, TopNavProps, WhatsAppButtonProps };
|
|
792
|
+
export { AccessPending, AuthAdapter, AuthProvider, AuthSession, Authorized, AuxiliaryColor, Button, Card, Checkbox, ConnectedModal, DataColor, DataGrid, Disclosure, Error, Form, HTTPClient, Heading, Icon, Input, InstallAppButton, Loader, Login, Modal, Navigation, Radio, ReduxProvider, ReduxProviderProps, Select, SemanticColor, ShareAppButton, Sidebar, SignOutButton, Spinner, StatsCard, Tabs, Tag, Text, TextArea, Toaster, TopNav, WhatsAppButton, ZustandProviders, ZustandProvidersProps, appInitialState, getAuthSession, splitURLasPath, toast, useAppStore, useAuth, useInstallApp, useIsDesktop, usePageStore, useRouterStore, useToastStore };
|
|
793
|
+
export type { AppState, AuthorizedProps, ButtonColor, ButtonProps, ButtonVariant, CardProps, CheckboxProps, CheckboxVariant, ConnectedModalProps, DataGridColumn, DataGridProps, DisclosureProps, DisclosureVariant, ErrorProps, FormProps, HeadingProps, HttpClientConfig, HttpRequestConfig, IconName, IconProps, IconSize, InputProps, InstallApp, InstallAppButtonProps, InstallAppWay, LoaderProps, LoginProvider, LoginVendor, ModalProps, NavigationMode, NavigationProps, PageState, RadioProps, ReduxStore, RouterState, SelectOption, SelectProps, ShareAppButtonProps, SidebarItem, SidebarProps, SidebarSection, SidebarUser, Size, SpinnerProps, SpinnerVariant, StatsCardProps, TabsItem, TabsProps, TagColor, TagProps, TextAreaProps, TextProps, TextVariant, Toast, ToastState, ToastType, TopNavProps, WhatsAppButtonProps };
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
usePageStore,
|
|
34
34
|
useRouterStore,
|
|
35
35
|
useToastStore
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-GQX4SRDD.js";
|
|
37
37
|
import {
|
|
38
38
|
Error,
|
|
39
39
|
FormInput,
|
|
@@ -584,9 +584,44 @@ var DataGrid = ({
|
|
|
584
584
|
] });
|
|
585
585
|
};
|
|
586
586
|
|
|
587
|
-
// core/
|
|
587
|
+
// core/disclosure/disclosure.styles.ts
|
|
588
588
|
import { tv as tv8 } from "tailwind-variants";
|
|
589
|
-
var
|
|
589
|
+
var disclosure = tv8({
|
|
590
|
+
slots: {
|
|
591
|
+
base: "w-full",
|
|
592
|
+
// outline-current: the summary has no color of its own, so the outline follows the text around it.
|
|
593
|
+
summary: "cursor-pointer rounded-sm py-1 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-current",
|
|
594
|
+
content: "pt-2"
|
|
595
|
+
},
|
|
596
|
+
variants: {
|
|
597
|
+
variant: {
|
|
598
|
+
plain: {},
|
|
599
|
+
outlined: { base: "rounded-lg border border-gray-200 bg-white p-3" }
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
defaultVariants: {
|
|
603
|
+
variant: "plain"
|
|
604
|
+
}
|
|
605
|
+
});
|
|
606
|
+
|
|
607
|
+
// core/disclosure/disclosure.tsx
|
|
608
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
609
|
+
var Disclosure = ({
|
|
610
|
+
children,
|
|
611
|
+
summary,
|
|
612
|
+
defaultOpen = false,
|
|
613
|
+
variant = "plain"
|
|
614
|
+
}) => {
|
|
615
|
+
const { base, summary: summaryClass, content } = disclosure({ variant });
|
|
616
|
+
return /* @__PURE__ */ jsxs9("details", { className: base(), open: defaultOpen, children: [
|
|
617
|
+
/* @__PURE__ */ jsx10("summary", { "data-testid": "disclosure-summary", className: summaryClass(), children: summary }),
|
|
618
|
+
/* @__PURE__ */ jsx10("div", { "data-testid": "disclosure-content", className: content(), children })
|
|
619
|
+
] });
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
// core/stats-card/stats-card.styles.ts
|
|
623
|
+
import { tv as tv9 } from "tailwind-variants";
|
|
624
|
+
var statsCard = tv9({
|
|
590
625
|
base: "p-4 rounded-lg",
|
|
591
626
|
variants: {
|
|
592
627
|
color: {
|
|
@@ -601,11 +636,11 @@ var statsCard = tv8({
|
|
|
601
636
|
});
|
|
602
637
|
|
|
603
638
|
// core/stats-card/stats-card.tsx
|
|
604
|
-
import { jsx as
|
|
639
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
605
640
|
var StatsCard = ({ label: label5, value, color }) => {
|
|
606
|
-
return /* @__PURE__ */
|
|
607
|
-
/* @__PURE__ */
|
|
608
|
-
/* @__PURE__ */
|
|
641
|
+
return /* @__PURE__ */ jsxs10("div", { "data-testid": "stats-card", className: statsCard({ color }), children: [
|
|
642
|
+
/* @__PURE__ */ jsx11(Text, { variant: "caption", children: label5 }),
|
|
643
|
+
/* @__PURE__ */ jsx11(Text, { variant: "display", children: value })
|
|
609
644
|
] });
|
|
610
645
|
};
|
|
611
646
|
|
|
@@ -615,7 +650,7 @@ var whatsappAppUrl = "whatsapp://send";
|
|
|
615
650
|
var whatsappMobileUserAgent = /Android|iPhone|iPad|iPod/i;
|
|
616
651
|
|
|
617
652
|
// core/whatsapp-button/whatsapp-button.tsx
|
|
618
|
-
import { jsx as
|
|
653
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
619
654
|
var WhatsAppButton = ({
|
|
620
655
|
phone,
|
|
621
656
|
message,
|
|
@@ -640,15 +675,15 @@ var WhatsAppButton = ({
|
|
|
640
675
|
}
|
|
641
676
|
onClick?.();
|
|
642
677
|
};
|
|
643
|
-
return /* @__PURE__ */
|
|
678
|
+
return /* @__PURE__ */ jsx12(Button, { color: "success", icon: "SiWhatsapp", onClick: handleClick, children });
|
|
644
679
|
};
|
|
645
680
|
|
|
646
681
|
// core/tabs/tabs.tsx
|
|
647
682
|
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
648
683
|
|
|
649
684
|
// core/tabs/tabs.styles.ts
|
|
650
|
-
import { tv as
|
|
651
|
-
var tabs =
|
|
685
|
+
import { tv as tv10 } from "tailwind-variants";
|
|
686
|
+
var tabs = tv10({
|
|
652
687
|
slots: {
|
|
653
688
|
// A border around the tabs and the panel, which holds them together. Takes
|
|
654
689
|
// the height of a parent that has one, and the panel gets what the list
|
|
@@ -671,7 +706,7 @@ var tabs = tv9({
|
|
|
671
706
|
});
|
|
672
707
|
|
|
673
708
|
// core/tabs/tabs.tsx
|
|
674
|
-
import { jsx as
|
|
709
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
675
710
|
var Tabs = ({
|
|
676
711
|
tabs: tabs2,
|
|
677
712
|
"aria-label": ariaLabel,
|
|
@@ -679,21 +714,21 @@ var Tabs = ({
|
|
|
679
714
|
onChange
|
|
680
715
|
}) => {
|
|
681
716
|
const { base, list, tab, text, panel } = tabs();
|
|
682
|
-
return /* @__PURE__ */
|
|
717
|
+
return /* @__PURE__ */ jsxs11(
|
|
683
718
|
RadixTabs.Root,
|
|
684
719
|
{
|
|
685
720
|
className: base(),
|
|
686
721
|
defaultValue: defaultTab,
|
|
687
722
|
onValueChange: onChange,
|
|
688
723
|
children: [
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
-
/* @__PURE__ */
|
|
691
|
-
/* @__PURE__ */
|
|
692
|
-
subtitle && /* @__PURE__ */
|
|
724
|
+
/* @__PURE__ */ jsx13(RadixTabs.List, { className: list(), "aria-label": ariaLabel, children: tabs2.map(({ id, label: label5, subtitle, count }) => /* @__PURE__ */ jsxs11(RadixTabs.Trigger, { value: id, className: tab(), children: [
|
|
725
|
+
/* @__PURE__ */ jsxs11("span", { className: text(), children: [
|
|
726
|
+
/* @__PURE__ */ jsx13(Text, { as: "span", children: label5 }),
|
|
727
|
+
subtitle && /* @__PURE__ */ jsx13(Text, { as: "span", variant: "caption", color: "muted", children: subtitle })
|
|
693
728
|
] }),
|
|
694
|
-
count !== void 0 && /* @__PURE__ */
|
|
729
|
+
count !== void 0 && /* @__PURE__ */ jsx13(Tag, { color: "primary", size: "md", children: count })
|
|
695
730
|
] }, id)) }),
|
|
696
|
-
tabs2.map(({ id, children }) => /* @__PURE__ */
|
|
731
|
+
tabs2.map(({ id, children }) => /* @__PURE__ */ jsx13(RadixTabs.Content, { value: id, className: panel(), children }, id))
|
|
697
732
|
]
|
|
698
733
|
}
|
|
699
734
|
);
|
|
@@ -779,6 +814,7 @@ export {
|
|
|
779
814
|
Checkbox,
|
|
780
815
|
ConnectedModal,
|
|
781
816
|
DataGrid,
|
|
817
|
+
Disclosure,
|
|
782
818
|
Error,
|
|
783
819
|
Form,
|
|
784
820
|
FormInput,
|
package/dist/next/index.js
CHANGED