@alexandregme/zljs 3.4.0 → 3.6.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 +22 -2
- package/dist/{chunk-TYN56WKD.js → chunk-FAJRJZWI.js} +189 -36
- package/dist/index.d.ts +49 -2
- package/dist/index.js +6 -52
- package/dist/next/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,25 @@ A change that needs action in an app has a **Migration** note. When updating, re
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [3.6.0] - 2026-11-11
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- `AccessPending`, the screen of a user who signed in and has no access to the app yet. It shows the email of the account and a `SignOutButton`. Every text has an English default: `title`, `message`, `signOutLabel`, and the `confirmTitle`, `confirmLabel`, `cancelLabel` and `errorMessage` of the sign-out
|
|
16
|
+
|
|
17
|
+
## [3.5.0] - 2026-11-11
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- `Login`, the sign-in screen of an app, shared like `NotFound`. It takes `vendor`, the auth vendor behind the app's adapter (today only `supabase`), and `providers`, the OAuth providers the app turned on, and shows one button for each. A click calls `signInWithOAuth` of the adapter, and a failed sign-in fires an error toast. Every text has an English default: `title`, `message`, `providerLabel` and `errorMessage`
|
|
22
|
+
- The types `LoginVendor` and `LoginProvider`, to type the `vendor` and `providers` an app passes to `Login`
|
|
23
|
+
|
|
24
|
+
## [3.4.0] - 2026-11-10
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- `SignOutButton`, an icon button that signs the user out through the adapter. A click opens a `danger` modal that asks first, with the texts the button gets: `confirmTitle`, `confirmLabel` and `cancelLabel`. A failed sign-out fires an error toast with `errorMessage`
|
|
29
|
+
|
|
11
30
|
## [3.3.0] - 2026-11-10
|
|
12
31
|
|
|
13
32
|
### Added
|
|
@@ -18,7 +37,6 @@ A change that needs action in an app has a **Migration** note. When updating, re
|
|
|
18
37
|
- The types `AuthAdapter` and `AuthSession`, the contract an app implements to connect its provider
|
|
19
38
|
- `auth` on `ZustandProviders` and `AppProviders`, with the `adapter` and `appId` of `AuthProvider`, which mounts `AuthProvider` so the app doesn't. Without `auth`, nothing of auth is mounted
|
|
20
39
|
- `color` on `Modal` and `ConnectedModal`, a semantic color for the title and a light background in that color, such as `danger` for a question that can't be undone. `none`, the default, keeps the modal as it was
|
|
21
|
-
- `SignOutButton`, an icon button that signs the user out through the adapter. A click opens a `danger` modal that asks first, with the texts the button gets: `confirmTitle`, `confirmLabel` and `cancelLabel`. A failed sign-out fires an error toast with `errorMessage`
|
|
22
40
|
|
|
23
41
|
## [3.2.0] - 2026-11-10
|
|
24
42
|
|
|
@@ -435,7 +453,9 @@ Replace the shade with the class of the `color` being tested, for example `/(^|\
|
|
|
435
453
|
|
|
436
454
|
The message of `Error` is `text-zl-danger`. `none` and `ghost` didn't change.
|
|
437
455
|
|
|
438
|
-
[Unreleased]: https://github.com/alexandregme/zljs/compare/v3.
|
|
456
|
+
[Unreleased]: https://github.com/alexandregme/zljs/compare/v3.6.0...HEAD
|
|
457
|
+
[3.6.0]: https://github.com/alexandregme/zljs/compare/v3.5.0...v3.6.0
|
|
458
|
+
[3.5.0]: https://github.com/alexandregme/zljs/compare/v3.3.0...v3.5.0
|
|
439
459
|
[3.3.0]: https://github.com/alexandregme/zljs/compare/v3.2.0...v3.3.0
|
|
440
460
|
[3.2.0]: https://github.com/alexandregme/zljs/compare/v3.1.0...v3.2.0
|
|
441
461
|
[3.1.0]: https://github.com/alexandregme/zljs/compare/v3.0.0...v3.1.0
|
|
@@ -602,6 +602,57 @@ var Loader = ({ label = "Loading" }) => {
|
|
|
602
602
|
return /* @__PURE__ */ jsx9("div", { className: loader(), children: /* @__PURE__ */ jsx9(Spinner, { size: "lg", label }) });
|
|
603
603
|
};
|
|
604
604
|
|
|
605
|
+
// core/card/card.styles.ts
|
|
606
|
+
import { tv as tv9 } from "tailwind-variants";
|
|
607
|
+
var card = tv9({
|
|
608
|
+
slots: {
|
|
609
|
+
// A soft, wide shadow in the color of the card. shadow-sm only spreads 1 to
|
|
610
|
+
// 3px and reads as part of the border on a white page.
|
|
611
|
+
base: "flex flex-col gap-6 w-full p-6 rounded-2xl border shadow-lg",
|
|
612
|
+
header: "flex flex-col gap-1"
|
|
613
|
+
},
|
|
614
|
+
variants: {
|
|
615
|
+
color: {
|
|
616
|
+
primary: {
|
|
617
|
+
base: "border-zl-primary bg-zl-primary/15 shadow-zl-primary/20"
|
|
618
|
+
},
|
|
619
|
+
success: {
|
|
620
|
+
base: "border-zl-success bg-zl-success/15 shadow-zl-success/20"
|
|
621
|
+
},
|
|
622
|
+
danger: { base: "border-zl-danger bg-zl-danger/15 shadow-zl-danger/20" },
|
|
623
|
+
warning: {
|
|
624
|
+
base: "border-zl-warning bg-zl-warning/15 shadow-zl-warning/20"
|
|
625
|
+
},
|
|
626
|
+
info: { base: "border-zl-info bg-zl-info/15 shadow-zl-info/20" },
|
|
627
|
+
muted: { base: "border-zl-muted bg-zl-muted/15 shadow-zl-muted/20" },
|
|
628
|
+
none: { base: "border-gray-200 bg-white shadow-black/12" }
|
|
629
|
+
}
|
|
630
|
+
},
|
|
631
|
+
defaultVariants: {
|
|
632
|
+
color: "none"
|
|
633
|
+
}
|
|
634
|
+
});
|
|
635
|
+
|
|
636
|
+
// core/card/card.tsx
|
|
637
|
+
import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
638
|
+
var Card = ({
|
|
639
|
+
children,
|
|
640
|
+
title: title2,
|
|
641
|
+
titleLevel = 2,
|
|
642
|
+
message,
|
|
643
|
+
color = "none"
|
|
644
|
+
}) => {
|
|
645
|
+
const { base, header: header2 } = card({ color });
|
|
646
|
+
const messageColor = color === "none" ? "muted" : "none";
|
|
647
|
+
return /* @__PURE__ */ jsxs3("div", { "data-testid": "card", className: base(), children: [
|
|
648
|
+
(title2 || message) && /* @__PURE__ */ jsxs3("div", { className: header2(), children: [
|
|
649
|
+
title2 && /* @__PURE__ */ jsx10(Heading, { level: titleLevel, children: title2 }),
|
|
650
|
+
message && /* @__PURE__ */ jsx10(Text, { color: messageColor, children: message })
|
|
651
|
+
] }),
|
|
652
|
+
children
|
|
653
|
+
] });
|
|
654
|
+
};
|
|
655
|
+
|
|
605
656
|
// features/auth/state/auth.store.ts
|
|
606
657
|
import { create as create3 } from "zustand";
|
|
607
658
|
import { devtools as devtools3 } from "zustand/middleware";
|
|
@@ -638,28 +689,6 @@ var useAuthStore = create3()(
|
|
|
638
689
|
// features/auth/state/get-auth-session/get-auth-session.ts
|
|
639
690
|
var getAuthSession = () => useAuthStore.getState().session;
|
|
640
691
|
|
|
641
|
-
// features/auth/components/auth-provider/auth-provider.tsx
|
|
642
|
-
import { useEffect as useEffect2 } from "react";
|
|
643
|
-
import { Fragment as Fragment3, jsx as jsx10 } from "react/jsx-runtime";
|
|
644
|
-
var AuthProvider = ({
|
|
645
|
-
adapter,
|
|
646
|
-
appId,
|
|
647
|
-
children
|
|
648
|
-
}) => {
|
|
649
|
-
const configure = useAuthStore((s) => s.configure);
|
|
650
|
-
const setSession = useAuthStore((s) => s.setSession);
|
|
651
|
-
const reset = useAuthStore((s) => s.reset);
|
|
652
|
-
useEffect2(() => {
|
|
653
|
-
configure(adapter, appId);
|
|
654
|
-
const unsubscribe = adapter.onSessionChange(setSession);
|
|
655
|
-
return () => {
|
|
656
|
-
unsubscribe();
|
|
657
|
-
reset();
|
|
658
|
-
};
|
|
659
|
-
}, [adapter, appId, configure, setSession, reset]);
|
|
660
|
-
return /* @__PURE__ */ jsx10(Fragment3, { children });
|
|
661
|
-
};
|
|
662
|
-
|
|
663
692
|
// features/auth/hooks/use-auth/use-auth.ts
|
|
664
693
|
var requireAdapter = () => {
|
|
665
694
|
const { adapter } = useAuthStore.getState();
|
|
@@ -688,15 +717,15 @@ var useAuth = () => {
|
|
|
688
717
|
var SIGN_OUT_MODAL_ID = "zljs-sign-out";
|
|
689
718
|
|
|
690
719
|
// features/auth/components/sign-out/sign-out-modal.styles.ts
|
|
691
|
-
import { tv as
|
|
692
|
-
var signOutModal =
|
|
720
|
+
import { tv as tv10 } from "tailwind-variants";
|
|
721
|
+
var signOutModal = tv10({
|
|
693
722
|
slots: {
|
|
694
723
|
actions: "flex justify-end gap-2"
|
|
695
724
|
}
|
|
696
725
|
});
|
|
697
726
|
|
|
698
727
|
// features/auth/components/sign-out/sign-out-modal.tsx
|
|
699
|
-
import { jsx as jsx11, jsxs as
|
|
728
|
+
import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
700
729
|
var SignOutModal = ({
|
|
701
730
|
title: title2 = "Sign out?",
|
|
702
731
|
confirmLabel = "Sign out",
|
|
@@ -722,7 +751,7 @@ var SignOutModal = ({
|
|
|
722
751
|
title: title2,
|
|
723
752
|
size: "xs",
|
|
724
753
|
color: "danger",
|
|
725
|
-
children: /* @__PURE__ */
|
|
754
|
+
children: /* @__PURE__ */ jsxs4("div", { className: actions(), children: [
|
|
726
755
|
/* @__PURE__ */ jsx11(Button, { color: "ghost", onClick: stay, children: cancelLabel }),
|
|
727
756
|
/* @__PURE__ */ jsx11(Button, { color: "danger", onClick: leave, children: confirmLabel })
|
|
728
757
|
] })
|
|
@@ -731,7 +760,7 @@ var SignOutModal = ({
|
|
|
731
760
|
};
|
|
732
761
|
|
|
733
762
|
// features/auth/components/sign-out/sign-out-button.tsx
|
|
734
|
-
import { Fragment as
|
|
763
|
+
import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
735
764
|
var SignOutButton = ({
|
|
736
765
|
label = "Sign out",
|
|
737
766
|
confirmTitle,
|
|
@@ -743,7 +772,7 @@ var SignOutButton = ({
|
|
|
743
772
|
const ask = () => {
|
|
744
773
|
openModal(SIGN_OUT_MODAL_ID);
|
|
745
774
|
};
|
|
746
|
-
return /* @__PURE__ */
|
|
775
|
+
return /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
747
776
|
/* @__PURE__ */ jsx12(
|
|
748
777
|
Button,
|
|
749
778
|
{
|
|
@@ -766,12 +795,133 @@ var SignOutButton = ({
|
|
|
766
795
|
] });
|
|
767
796
|
};
|
|
768
797
|
|
|
798
|
+
// features/auth/components/access-pending/access-pending.styles.ts
|
|
799
|
+
import { tv as tv11 } from "tailwind-variants";
|
|
800
|
+
var accessPending = tv11({
|
|
801
|
+
slots: {
|
|
802
|
+
account: "flex items-center justify-between gap-3"
|
|
803
|
+
}
|
|
804
|
+
});
|
|
805
|
+
|
|
806
|
+
// features/auth/components/access-pending/access-pending.tsx
|
|
807
|
+
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
808
|
+
var AccessPending = ({
|
|
809
|
+
title: title2 = "Waiting for approval",
|
|
810
|
+
message = "Your access to this app has not been approved yet.",
|
|
811
|
+
signOutLabel,
|
|
812
|
+
confirmTitle,
|
|
813
|
+
confirmLabel,
|
|
814
|
+
cancelLabel,
|
|
815
|
+
errorMessage
|
|
816
|
+
}) => {
|
|
817
|
+
const { user } = useAuth();
|
|
818
|
+
const { account } = accessPending();
|
|
819
|
+
if (!user) {
|
|
820
|
+
return null;
|
|
821
|
+
}
|
|
822
|
+
return /* @__PURE__ */ jsx13(Card, { title: title2, titleLevel: 1, message, children: /* @__PURE__ */ jsxs6("div", { className: account(), children: [
|
|
823
|
+
/* @__PURE__ */ jsx13(Text, { variant: "caption", color: "muted", children: user.email }),
|
|
824
|
+
/* @__PURE__ */ jsx13(
|
|
825
|
+
SignOutButton,
|
|
826
|
+
{
|
|
827
|
+
label: signOutLabel,
|
|
828
|
+
confirmTitle,
|
|
829
|
+
confirmLabel,
|
|
830
|
+
cancelLabel,
|
|
831
|
+
errorMessage
|
|
832
|
+
}
|
|
833
|
+
)
|
|
834
|
+
] }) });
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
// features/auth/components/auth-provider/auth-provider.tsx
|
|
838
|
+
import { useEffect as useEffect2 } from "react";
|
|
839
|
+
import { Fragment as Fragment4, jsx as jsx14 } from "react/jsx-runtime";
|
|
840
|
+
var AuthProvider = ({
|
|
841
|
+
adapter,
|
|
842
|
+
appId,
|
|
843
|
+
children
|
|
844
|
+
}) => {
|
|
845
|
+
const configure = useAuthStore((s) => s.configure);
|
|
846
|
+
const setSession = useAuthStore((s) => s.setSession);
|
|
847
|
+
const reset = useAuthStore((s) => s.reset);
|
|
848
|
+
useEffect2(() => {
|
|
849
|
+
configure(adapter, appId);
|
|
850
|
+
const unsubscribe = adapter.onSessionChange(setSession);
|
|
851
|
+
return () => {
|
|
852
|
+
unsubscribe();
|
|
853
|
+
reset();
|
|
854
|
+
};
|
|
855
|
+
}, [adapter, appId, configure, setSession, reset]);
|
|
856
|
+
return /* @__PURE__ */ jsx14(Fragment4, { children });
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
// features/auth/components/login/login.const.ts
|
|
860
|
+
var loginVendors = {
|
|
861
|
+
supabase: {
|
|
862
|
+
google: "Google",
|
|
863
|
+
apple: "Apple",
|
|
864
|
+
github: "GitHub",
|
|
865
|
+
facebook: "Facebook"
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
|
|
869
|
+
// features/auth/components/login/login.styles.ts
|
|
870
|
+
import { tv as tv12 } from "tailwind-variants";
|
|
871
|
+
var login = tv12({
|
|
872
|
+
slots: {
|
|
873
|
+
options: "flex flex-col gap-3"
|
|
874
|
+
}
|
|
875
|
+
});
|
|
876
|
+
|
|
877
|
+
// features/auth/components/login/login.tsx
|
|
878
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
879
|
+
var LoginProviderButton = ({
|
|
880
|
+
id,
|
|
881
|
+
label,
|
|
882
|
+
onSignIn
|
|
883
|
+
}) => {
|
|
884
|
+
const signIn = () => {
|
|
885
|
+
onSignIn(id);
|
|
886
|
+
};
|
|
887
|
+
return /* @__PURE__ */ jsx15(Button, { size: "lg", fullWidth: true, onClick: signIn, children: label });
|
|
888
|
+
};
|
|
889
|
+
var Login = ({
|
|
890
|
+
vendor,
|
|
891
|
+
providers,
|
|
892
|
+
title: title2 = "Sign in",
|
|
893
|
+
message = "Choose how to sign in",
|
|
894
|
+
providerLabel = "Continue with",
|
|
895
|
+
errorMessage = "Could not sign in. Try again."
|
|
896
|
+
}) => {
|
|
897
|
+
const { signInWithOAuth } = useAuth();
|
|
898
|
+
const { options } = login();
|
|
899
|
+
const names = loginVendors[vendor];
|
|
900
|
+
const signIn = (id) => {
|
|
901
|
+
signInWithOAuth(id).catch(() => {
|
|
902
|
+
useToastStore.getState().error(errorMessage);
|
|
903
|
+
});
|
|
904
|
+
};
|
|
905
|
+
return /* @__PURE__ */ jsx15(Card, { title: title2, titleLevel: 1, message, children: /* @__PURE__ */ jsx15("div", { className: options(), children: providers.map((provider) => {
|
|
906
|
+
const id = String(provider);
|
|
907
|
+
return /* @__PURE__ */ jsx15(
|
|
908
|
+
LoginProviderButton,
|
|
909
|
+
{
|
|
910
|
+
id,
|
|
911
|
+
label: `${providerLabel} ${names[id]}`,
|
|
912
|
+
onSignIn: signIn
|
|
913
|
+
},
|
|
914
|
+
id
|
|
915
|
+
);
|
|
916
|
+
}) }) });
|
|
917
|
+
};
|
|
918
|
+
|
|
769
919
|
// features/providers/components/zustand-providers/zustand-providers.tsx
|
|
770
|
-
import { Fragment as Fragment5, jsx as
|
|
771
|
-
var ZustandProviders = ({ children, auth }) => /* @__PURE__ */
|
|
772
|
-
/* @__PURE__ */
|
|
773
|
-
/* @__PURE__ */
|
|
774
|
-
auth ? /* @__PURE__ */
|
|
920
|
+
import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
921
|
+
var ZustandProviders = ({ children, auth }) => /* @__PURE__ */ jsxs7(Fragment5, { children: [
|
|
922
|
+
/* @__PURE__ */ jsx16(Loader, {}),
|
|
923
|
+
/* @__PURE__ */ jsx16(Toaster, {}),
|
|
924
|
+
auth ? /* @__PURE__ */ jsx16(AuthProvider, { adapter: auth.adapter, appId: auth.appId, children }) : children
|
|
775
925
|
] });
|
|
776
926
|
|
|
777
927
|
// core/state/redux/redux-provider/redux-provider.tsx
|
|
@@ -808,7 +958,7 @@ var createReduxStore = ({
|
|
|
808
958
|
};
|
|
809
959
|
|
|
810
960
|
// core/state/redux/redux-provider/redux-provider.tsx
|
|
811
|
-
import { jsx as
|
|
961
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
812
962
|
var ReduxProvider = ({
|
|
813
963
|
children,
|
|
814
964
|
reducers = {},
|
|
@@ -824,7 +974,7 @@ var ReduxProvider = ({
|
|
|
824
974
|
coreReducers
|
|
825
975
|
})
|
|
826
976
|
);
|
|
827
|
-
return /* @__PURE__ */
|
|
977
|
+
return /* @__PURE__ */ jsx17(Provider, { store, children });
|
|
828
978
|
};
|
|
829
979
|
|
|
830
980
|
// core/state/zustand/router/router.utils.ts
|
|
@@ -898,10 +1048,13 @@ export {
|
|
|
898
1048
|
ConnectedModal,
|
|
899
1049
|
Spinner,
|
|
900
1050
|
Loader,
|
|
1051
|
+
Card,
|
|
901
1052
|
getAuthSession,
|
|
902
|
-
AuthProvider,
|
|
903
1053
|
useAuth,
|
|
904
1054
|
SignOutButton,
|
|
1055
|
+
AccessPending,
|
|
1056
|
+
AuthProvider,
|
|
1057
|
+
Login,
|
|
905
1058
|
ZustandProviders,
|
|
906
1059
|
ReduxProvider,
|
|
907
1060
|
splitURLasPath,
|
package/dist/index.d.ts
CHANGED
|
@@ -368,6 +368,23 @@ declare const useAppStore: zustand.UseBoundStore<Omit<zustand.StoreApi<AppState>
|
|
|
368
368
|
};
|
|
369
369
|
}>;
|
|
370
370
|
|
|
371
|
+
interface AccessPendingProps {
|
|
372
|
+
title?: string;
|
|
373
|
+
message?: string;
|
|
374
|
+
/** The accessible name of the sign-out button. */
|
|
375
|
+
signOutLabel?: string;
|
|
376
|
+
/** The question of the modal the button opens. */
|
|
377
|
+
confirmTitle?: string;
|
|
378
|
+
/** The button of the modal that signs out. */
|
|
379
|
+
confirmLabel?: string;
|
|
380
|
+
/** The button of the modal that keeps the user signed in. */
|
|
381
|
+
cancelLabel?: string;
|
|
382
|
+
/** The toast when signing out fails. */
|
|
383
|
+
errorMessage?: string;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
declare const AccessPending: ({ title, message, signOutLabel, confirmTitle, confirmLabel, cancelLabel, errorMessage, }: AccessPendingProps) => react.JSX.Element | null;
|
|
387
|
+
|
|
371
388
|
/** The current session, for code outside React, such as a thunk. */
|
|
372
389
|
declare const getAuthSession: () => AuthSession | null;
|
|
373
390
|
|
|
@@ -382,6 +399,36 @@ interface AuthProviderProps extends AuthConfig {
|
|
|
382
399
|
*/
|
|
383
400
|
declare const AuthProvider: ({ adapter, appId, children, }: AuthProviderProps) => react.JSX.Element;
|
|
384
401
|
|
|
402
|
+
/**
|
|
403
|
+
* The OAuth providers of each auth vendor, by the id the vendor knows, with
|
|
404
|
+
* the name each one shows on its button. A new vendor is a new key here.
|
|
405
|
+
*/
|
|
406
|
+
declare const loginVendors: {
|
|
407
|
+
readonly supabase: {
|
|
408
|
+
readonly google: "Google";
|
|
409
|
+
readonly apple: "Apple";
|
|
410
|
+
readonly github: "GitHub";
|
|
411
|
+
readonly facebook: "Facebook";
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
type LoginVendor = keyof typeof loginVendors;
|
|
416
|
+
type LoginProvider<V extends LoginVendor = LoginVendor> = keyof (typeof loginVendors)[V];
|
|
417
|
+
interface LoginProps<V extends LoginVendor = LoginVendor> {
|
|
418
|
+
/** The auth vendor behind the app's `AuthAdapter`. It sets which providers exist. */
|
|
419
|
+
vendor: V;
|
|
420
|
+
/** One button per provider, in this order. */
|
|
421
|
+
providers: LoginProvider<V>[];
|
|
422
|
+
title?: string;
|
|
423
|
+
message?: string;
|
|
424
|
+
/** Comes before the name of each provider, on its button. */
|
|
425
|
+
providerLabel?: string;
|
|
426
|
+
/** The toast when a sign-in fails. */
|
|
427
|
+
errorMessage?: string;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
declare const Login: <V extends LoginVendor>({ vendor, providers, title, message, providerLabel, errorMessage, }: LoginProps<V>) => react.JSX.Element;
|
|
431
|
+
|
|
385
432
|
interface SignOutButtonProps {
|
|
386
433
|
/** The accessible name of the icon button. */
|
|
387
434
|
label?: string;
|
|
@@ -509,5 +556,5 @@ declare class HTTPClient {
|
|
|
509
556
|
patch<T = unknown>(url: string, config?: HttpRequestConfig): Promise<T | undefined>;
|
|
510
557
|
}
|
|
511
558
|
|
|
512
|
-
export { AuthAdapter, AuthProvider, AuthSession, AuxiliaryColor, Button, Card, Checkbox, ConnectedModal, DataColor, DataGrid, Error, Form, HTTPClient, Heading, Icon, Input, Loader, Modal, Radio, ReduxProvider, ReduxProviderProps, Select, SemanticColor, Sidebar, SignOutButton, Spinner, StatsCard, Tag, Text, TextArea, Toaster, WhatsAppButton, ZustandProviders, ZustandProvidersProps, appInitialState, getAuthSession, splitURLasPath, useAppStore, useAuth, usePageStore, useRouterStore, useToastStore };
|
|
513
|
-
export type { AppState, ButtonColor, ButtonProps, ButtonVariant, CardProps, CheckboxProps, CheckboxVariant, ConnectedModalProps, DataGridColumn, DataGridProps, ErrorProps, FormProps, HeadingProps, HttpClientConfig, HttpRequestConfig, IconName, IconProps, InputProps, LoaderProps, ModalProps, PageState, RadioProps, ReduxStore, RouterState, SelectOption, SelectProps, SidebarItem, SidebarProps, SidebarSection, SidebarUser, Size, SpinnerProps, SpinnerVariant, StatsCardProps, TagColor, TagProps, TextAreaProps, TextProps, TextVariant, Toast, ToastState, ToastType, WhatsAppButtonProps };
|
|
559
|
+
export { AccessPending, AuthAdapter, AuthProvider, AuthSession, AuxiliaryColor, Button, Card, Checkbox, ConnectedModal, DataColor, DataGrid, Error, Form, HTTPClient, Heading, Icon, Input, Loader, Login, Modal, Radio, ReduxProvider, ReduxProviderProps, Select, SemanticColor, Sidebar, SignOutButton, Spinner, StatsCard, Tag, Text, TextArea, Toaster, WhatsAppButton, ZustandProviders, ZustandProvidersProps, appInitialState, getAuthSession, splitURLasPath, useAppStore, useAuth, usePageStore, useRouterStore, useToastStore };
|
|
560
|
+
export type { AppState, ButtonColor, ButtonProps, ButtonVariant, CardProps, CheckboxProps, CheckboxVariant, ConnectedModalProps, DataGridColumn, DataGridProps, ErrorProps, FormProps, HeadingProps, HttpClientConfig, HttpRequestConfig, IconName, IconProps, InputProps, LoaderProps, LoginProvider, LoginVendor, ModalProps, PageState, RadioProps, ReduxStore, RouterState, SelectOption, SelectProps, SidebarItem, SidebarProps, SidebarSection, SidebarUser, Size, SpinnerProps, SpinnerVariant, StatsCardProps, TagColor, TagProps, TextAreaProps, TextProps, TextVariant, Toast, ToastState, ToastType, WhatsAppButtonProps };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
+
AccessPending,
|
|
3
4
|
AuthProvider,
|
|
4
5
|
Button,
|
|
6
|
+
Card,
|
|
5
7
|
ConnectedModal,
|
|
6
8
|
Heading,
|
|
7
9
|
Icon,
|
|
8
10
|
Loader,
|
|
11
|
+
Login,
|
|
9
12
|
Modal,
|
|
10
13
|
ReduxProvider,
|
|
11
14
|
SignOutButton,
|
|
@@ -22,7 +25,7 @@ import {
|
|
|
22
25
|
usePageStore,
|
|
23
26
|
useRouterStore,
|
|
24
27
|
useToastStore
|
|
25
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-FAJRJZWI.js";
|
|
26
29
|
import {
|
|
27
30
|
Error,
|
|
28
31
|
FormInput,
|
|
@@ -771,57 +774,6 @@ var Sidebar = ({
|
|
|
771
774
|
] });
|
|
772
775
|
};
|
|
773
776
|
|
|
774
|
-
// core/card/card.styles.ts
|
|
775
|
-
import { tv as tv10 } from "tailwind-variants";
|
|
776
|
-
var card = tv10({
|
|
777
|
-
slots: {
|
|
778
|
-
// A soft, wide shadow in the color of the card. shadow-sm only spreads 1 to
|
|
779
|
-
// 3px and reads as part of the border on a white page.
|
|
780
|
-
base: "flex flex-col gap-6 w-full p-6 rounded-2xl border shadow-lg",
|
|
781
|
-
header: "flex flex-col gap-1"
|
|
782
|
-
},
|
|
783
|
-
variants: {
|
|
784
|
-
color: {
|
|
785
|
-
primary: {
|
|
786
|
-
base: "border-zl-primary bg-zl-primary/15 shadow-zl-primary/20"
|
|
787
|
-
},
|
|
788
|
-
success: {
|
|
789
|
-
base: "border-zl-success bg-zl-success/15 shadow-zl-success/20"
|
|
790
|
-
},
|
|
791
|
-
danger: { base: "border-zl-danger bg-zl-danger/15 shadow-zl-danger/20" },
|
|
792
|
-
warning: {
|
|
793
|
-
base: "border-zl-warning bg-zl-warning/15 shadow-zl-warning/20"
|
|
794
|
-
},
|
|
795
|
-
info: { base: "border-zl-info bg-zl-info/15 shadow-zl-info/20" },
|
|
796
|
-
muted: { base: "border-zl-muted bg-zl-muted/15 shadow-zl-muted/20" },
|
|
797
|
-
none: { base: "border-gray-200 bg-white shadow-black/12" }
|
|
798
|
-
}
|
|
799
|
-
},
|
|
800
|
-
defaultVariants: {
|
|
801
|
-
color: "none"
|
|
802
|
-
}
|
|
803
|
-
});
|
|
804
|
-
|
|
805
|
-
// core/card/card.tsx
|
|
806
|
-
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
807
|
-
var Card = ({
|
|
808
|
-
children,
|
|
809
|
-
title,
|
|
810
|
-
titleLevel = 2,
|
|
811
|
-
message,
|
|
812
|
-
color = "none"
|
|
813
|
-
}) => {
|
|
814
|
-
const { base, header: header2 } = card({ color });
|
|
815
|
-
const messageColor = color === "none" ? "muted" : "none";
|
|
816
|
-
return /* @__PURE__ */ jsxs11("div", { "data-testid": "card", className: base(), children: [
|
|
817
|
-
(title || message) && /* @__PURE__ */ jsxs11("div", { className: header2(), children: [
|
|
818
|
-
title && /* @__PURE__ */ jsx13(Heading, { level: titleLevel, children: title }),
|
|
819
|
-
message && /* @__PURE__ */ jsx13(Text, { color: messageColor, children: message })
|
|
820
|
-
] }),
|
|
821
|
-
children
|
|
822
|
-
] });
|
|
823
|
-
};
|
|
824
|
-
|
|
825
777
|
// core/http/http.client.ts
|
|
826
778
|
import axios from "axios";
|
|
827
779
|
var HTTPClient = class {
|
|
@@ -894,6 +846,7 @@ var HTTPClient = class {
|
|
|
894
846
|
}
|
|
895
847
|
};
|
|
896
848
|
export {
|
|
849
|
+
AccessPending,
|
|
897
850
|
AuthProvider,
|
|
898
851
|
Button,
|
|
899
852
|
Card,
|
|
@@ -909,6 +862,7 @@ export {
|
|
|
909
862
|
Icon,
|
|
910
863
|
Input,
|
|
911
864
|
Loader,
|
|
865
|
+
Login,
|
|
912
866
|
Modal,
|
|
913
867
|
Radio,
|
|
914
868
|
ReduxProvider,
|
package/dist/next/index.js
CHANGED