@worldcoin/mini-apps-ui-kit-react 1.0.0-canary.8 → 1.0.0-canary.9
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/components/Button/Button.d.ts +0 -6
- package/dist/components/Button/Button.js +24 -37
- package/dist/components/Chip/Chip.d.ts +1 -1
- package/dist/components/LiveFeedback/LiveFeedback.d.ts +20 -0
- package/dist/components/LiveFeedback/LiveFeedback.js +48 -0
- package/dist/components/LiveFeedback/index.d.ts +1 -0
- package/dist/components/LiveFeedback/index.js +2 -0
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +100 -99
- package/package.json +1 -1
- package/public/globals.css +2 -2296
@@ -3,7 +3,6 @@ import { ButtonHTMLAttributes } from 'react';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
4
4
|
variant?: "primary" | "secondary" | "tertiary" | null | undefined;
|
5
5
|
size?: "sm" | "lg" | "icon" | null | undefined;
|
6
|
-
stateful?: boolean | null | undefined;
|
7
6
|
fullWidth?: boolean | null | undefined;
|
8
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
9
8
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
@@ -17,11 +16,6 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, Va
|
|
17
16
|
* @default "lg"
|
18
17
|
*/
|
19
18
|
size?: "sm" | "lg" | "icon";
|
20
|
-
/**
|
21
|
-
* The state of the button
|
22
|
-
* @default undefined
|
23
|
-
*/
|
24
|
-
state?: "pending" | "success" | "failed";
|
25
19
|
/**
|
26
20
|
* Whether the button should take up the full width of its container
|
27
21
|
* @default false
|
@@ -1,14 +1,11 @@
|
|
1
1
|
"use client";
|
2
|
-
import {
|
3
|
-
import { cn as
|
4
|
-
import { Slot as
|
5
|
-
import { cva as
|
6
|
-
import { forwardRef as
|
7
|
-
import {
|
8
|
-
|
9
|
-
import { Spinner as y } from "../Spinner/Spinner.js";
|
10
|
-
import { typographyVariants as u } from "../Typography/Typography.js";
|
11
|
-
const v = d(
|
2
|
+
import { jsx as l } from "react/jsx-runtime";
|
3
|
+
import { cn as n } from "../../lib/utils.js";
|
4
|
+
import { Slot as s } from "../../node_modules/.pnpm/@radix-ui_react-slot@1.1.1_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.js";
|
5
|
+
import { cva as y } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
6
|
+
import { forwardRef as d } from "react";
|
7
|
+
import { typographyVariants as m } from "../Typography/Typography.js";
|
8
|
+
const b = y(
|
12
9
|
"flex items-center justify-center rounded-full gap-2 font-sans leading-[1.2] tracking-normal transition-colors",
|
13
10
|
{
|
14
11
|
variants: {
|
@@ -22,10 +19,6 @@ const v = d(
|
|
22
19
|
lg: "h-14 min-w-14 px-4",
|
23
20
|
icon: "size-10"
|
24
21
|
},
|
25
|
-
stateful: {
|
26
|
-
true: "border-none bg-transparent fill-transparent text-transparent hover:bg-transparent active:bg-transparent disabled:bg-transparent disabled:text-transparent",
|
27
|
-
false: ""
|
28
|
-
},
|
29
22
|
fullWidth: {
|
30
23
|
true: "w-full",
|
31
24
|
false: ""
|
@@ -37,36 +30,30 @@ const v = d(
|
|
37
30
|
fullWidth: !1
|
38
31
|
}
|
39
32
|
}
|
40
|
-
),
|
41
|
-
({ variant:
|
42
|
-
|
33
|
+
), f = d(
|
34
|
+
({ variant: t = "primary", size: r = "lg", fullWidth: e, asChild: i, children: o, ...a }, g) => /* @__PURE__ */ l(
|
35
|
+
i ? s : "button",
|
43
36
|
{
|
44
|
-
ref:
|
45
|
-
...
|
46
|
-
className:
|
47
|
-
|
48
|
-
variant:
|
49
|
-
size:
|
50
|
-
|
51
|
-
fullWidth: i
|
37
|
+
ref: g,
|
38
|
+
...a,
|
39
|
+
className: n(
|
40
|
+
b({
|
41
|
+
variant: t,
|
42
|
+
size: r,
|
43
|
+
fullWidth: e
|
52
44
|
}),
|
53
|
-
|
45
|
+
m({
|
54
46
|
variant: "label",
|
55
|
-
level:
|
47
|
+
level: r === "lg" ? 1 : 2
|
56
48
|
}),
|
57
|
-
|
49
|
+
a.className
|
58
50
|
),
|
59
|
-
children:
|
60
|
-
!a && l,
|
61
|
-
a === "pending" && /* @__PURE__ */ r(y, { className: "absolute size-6" }),
|
62
|
-
a === "success" && /* @__PURE__ */ r(c, { className: "absolute size-6" }),
|
63
|
-
a === "failed" && /* @__PURE__ */ r(f, { className: "absolute size-6" })
|
64
|
-
]
|
51
|
+
children: o
|
65
52
|
}
|
66
53
|
)
|
67
54
|
);
|
68
|
-
|
55
|
+
f.displayName = "Button";
|
69
56
|
export {
|
70
|
-
|
71
|
-
|
57
|
+
f as Button,
|
58
|
+
f as default
|
72
59
|
};
|
@@ -20,7 +20,7 @@ export interface ChipProps extends HTMLAttributes<HTMLDivElement> {
|
|
20
20
|
className?: string;
|
21
21
|
}
|
22
22
|
export declare const Chip: import('react').ForwardRefExoticComponent<ChipProps & VariantProps<(props?: ({
|
23
|
-
variant?: "error" | "
|
23
|
+
variant?: "error" | "default" | "success" | "warning" | "important" | null | undefined;
|
24
24
|
isIcon?: boolean | null | undefined;
|
25
25
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string> & import('react').RefAttributes<HTMLDivElement>>;
|
26
26
|
export default Chip;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { default as React } from 'react';
|
2
|
+
interface LiveFeedbackProps {
|
3
|
+
/** The current state of the feedback. Controls which icon and label are shown. */
|
4
|
+
state?: "pending" | "success" | "failed";
|
5
|
+
/** The content to wrap with live feedback, typically a button or form element */
|
6
|
+
children: React.ReactNode;
|
7
|
+
/** Optional className to apply to the wrapper div */
|
8
|
+
className?: string;
|
9
|
+
/** Optional labels to show next to the icons for each state */
|
10
|
+
label?: {
|
11
|
+
/** Text to show during the pending state */
|
12
|
+
pending: string;
|
13
|
+
/** Text to show when operation succeeds */
|
14
|
+
success: string;
|
15
|
+
/** Text to show when operation fails */
|
16
|
+
failed: string;
|
17
|
+
};
|
18
|
+
}
|
19
|
+
declare function LiveFeedback({ state, children, className, label }: LiveFeedbackProps): import("react/jsx-runtime").JSX.Element;
|
20
|
+
export default LiveFeedback;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { jsxs as s, jsx as r, Fragment as c } from "react/jsx-runtime";
|
2
|
+
import { cn as n } from "../../lib/utils.js";
|
3
|
+
import { Fail as f } from "../Icons/Fail.js";
|
4
|
+
import { Success as p } from "../Icons/Success.js";
|
5
|
+
import { Spinner as t } from "../Spinner/Spinner.js";
|
6
|
+
import { Typography as d } from "../Typography/Typography.js";
|
7
|
+
function x({ state: e, children: m, className: o, label: i }) {
|
8
|
+
return /* @__PURE__ */ s("div", { className: n("relative", o), children: [
|
9
|
+
/* @__PURE__ */ r(
|
10
|
+
"div",
|
11
|
+
{
|
12
|
+
className: n(
|
13
|
+
"w-full h-full",
|
14
|
+
e && "invisible"
|
15
|
+
// Hide children but preserve space
|
16
|
+
),
|
17
|
+
children: m
|
18
|
+
}
|
19
|
+
),
|
20
|
+
e && /* @__PURE__ */ s(
|
21
|
+
"div",
|
22
|
+
{
|
23
|
+
className: n(
|
24
|
+
"absolute inset-0 flex items-center justify-center gap-2",
|
25
|
+
e === "success" && "text-success-600",
|
26
|
+
e === "failed" && "text-error-600"
|
27
|
+
),
|
28
|
+
children: [
|
29
|
+
e === "pending" && /* @__PURE__ */ s(c, { children: [
|
30
|
+
/* @__PURE__ */ r(t, { className: "size-6" }),
|
31
|
+
(i == null ? void 0 : i.pending) && /* @__PURE__ */ r(d, { variant: "label", level: 2, children: i.pending })
|
32
|
+
] }),
|
33
|
+
e === "success" && /* @__PURE__ */ s(c, { children: [
|
34
|
+
/* @__PURE__ */ r(p, { className: "size-6" }),
|
35
|
+
(i == null ? void 0 : i.success) && /* @__PURE__ */ r(d, { variant: "label", level: 2, children: i.success })
|
36
|
+
] }),
|
37
|
+
e === "failed" && /* @__PURE__ */ s(c, { children: [
|
38
|
+
/* @__PURE__ */ r(f, { className: "size-6" }),
|
39
|
+
(i == null ? void 0 : i.failed) && /* @__PURE__ */ r(d, { variant: "label", level: 2, children: i.failed })
|
40
|
+
] })
|
41
|
+
]
|
42
|
+
}
|
43
|
+
)
|
44
|
+
] });
|
45
|
+
}
|
46
|
+
export {
|
47
|
+
x as default
|
48
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './LiveFeedback';
|
@@ -11,7 +11,7 @@ const b = p, x = l.forwardRef(({ className: r, ...a }, t) => /* @__PURE__ */ e(
|
|
11
11
|
{
|
12
12
|
ref: t,
|
13
13
|
className: s(
|
14
|
-
"fixed top-0 z-[100] flex max-h-screen w-full p-
|
14
|
+
"fixed top-0 z-[100] flex max-h-screen w-full p-6 right-0 left-0 flex-col",
|
15
15
|
r
|
16
16
|
),
|
17
17
|
...a
|
package/dist/index.d.ts
CHANGED
@@ -33,4 +33,5 @@ export * from './components/TopBar';
|
|
33
33
|
export * from './components/CountryDrawer';
|
34
34
|
export * from './components/ToggleGroup';
|
35
35
|
export * from './components/Tabs';
|
36
|
+
export * from './components/LiveFeedback';
|
36
37
|
export { default as uiKitTailwindPlugin } from './tailwind';
|
package/dist/index.js
CHANGED
@@ -1,105 +1,106 @@
|
|
1
|
-
import { Button as
|
2
|
-
import { Checkbox as
|
3
|
-
import { Chip as
|
4
|
-
import { ColorPickerGroup as
|
5
|
-
import { Flag as
|
6
|
-
import { LazyFlag as
|
7
|
-
import { isSupportedCountryCode as
|
1
|
+
import { Button as a } from "./components/Button/Button.js";
|
2
|
+
import { Checkbox as l } from "./components/Checkbox/Checkbox.js";
|
3
|
+
import { Chip as x } from "./components/Chip/Chip.js";
|
4
|
+
import { ColorPickerGroup as g, ColorPickerItem as n } from "./components/ColorPicker/ColorPicker.js";
|
5
|
+
import { Flag as u } from "./components/Flag/Flag.js";
|
6
|
+
import { LazyFlag as D } from "./components/Flag/LazyFlag.js";
|
7
|
+
import { isSupportedCountryCode as c } from "./components/Flag/utils.js";
|
8
8
|
import * as r from "./components/Form/Form.js";
|
9
|
-
import { Input as
|
10
|
-
import { ListItem as
|
11
|
-
import { NumberPad as
|
12
|
-
import { OTPField as
|
13
|
-
import { Pill as
|
14
|
-
import { RadioGroup as
|
15
|
-
import { RadioGroupItem as
|
16
|
-
import { Select as
|
17
|
-
import { SearchField as
|
18
|
-
import { PhoneField as
|
19
|
-
import { getValidatedCountryCode as
|
20
|
-
import { Spinner as
|
21
|
-
import { Switch as
|
22
|
-
import { Token as
|
23
|
-
import { Toast as
|
24
|
-
import { Toaster as
|
25
|
-
import { reducer as
|
26
|
-
import { Typography as
|
27
|
-
import { Drawer as
|
28
|
-
import { Progress as
|
9
|
+
import { Input as A, iconVariants as F, inputVariants as P } from "./components/Input/Input.js";
|
10
|
+
import { ListItem as h } from "./components/ListItem/ListItem.js";
|
11
|
+
import { NumberPad as B } from "./components/NumberPad/NumberPad.js";
|
12
|
+
import { OTPField as G } from "./components/OTPField/OTPField.js";
|
13
|
+
import { Pill as V } from "./components/Pill/Pill.js";
|
14
|
+
import { RadioGroup as L } from "./components/RadioGroup/RadioGroup.js";
|
15
|
+
import { RadioGroupItem as H } from "./components/RadioGroup/RadioGroupItem.js";
|
16
|
+
import { Select as v } from "./components/Select/Select.js";
|
17
|
+
import { SearchField as K } from "./components/SearchField/SearchField.js";
|
18
|
+
import { PhoneField as N } from "./components/PhoneField/PhoneField.js";
|
19
|
+
import { getValidatedCountryCode as W } from "./components/PhoneField/utils.js";
|
20
|
+
import { Spinner as q } from "./components/Spinner/Spinner.js";
|
21
|
+
import { Switch as J } from "./components/Switch/Switch.js";
|
22
|
+
import { Token as U } from "./components/Token/Token.js";
|
23
|
+
import { Toast as Y, ToastProvider as Z, ToastViewport as $ } from "./components/Toast/Toast.js";
|
24
|
+
import { Toaster as or } from "./components/Toast/Toaster.js";
|
25
|
+
import { reducer as tr, toast as pr, useToast as mr } from "./components/Toast/use-toast.js";
|
26
|
+
import { Typography as ir, typographyVariants as lr } from "./components/Typography/Typography.js";
|
27
|
+
import { Drawer as xr, DrawerClose as sr, DrawerContent as gr, DrawerHeader as nr, DrawerTitle as dr, DrawerTrigger as ur } from "./components/Drawer/Drawer.js";
|
28
|
+
import { Progress as Dr } from "./components/Progress/Progress.js";
|
29
29
|
import "./components/TextArea/TextArea.js";
|
30
|
-
import { WalletAddressField as
|
31
|
-
import { AlertDialog as
|
32
|
-
import { BottomBar as
|
33
|
-
import { BulletList as
|
34
|
-
import { BulletListItem as
|
30
|
+
import { WalletAddressField as cr } from "./components/WalletAddressField/WalletAddressField.js";
|
31
|
+
import { AlertDialog as Ar, AlertDialogClose as Fr, AlertDialogContent as Pr, AlertDialogDescription as yr, AlertDialogFooter as hr, AlertDialogHeader as Ir, AlertDialogPortal as Br, AlertDialogTitle as br, AlertDialogTrigger as Gr } from "./components/AlertDialog/AlertDialog.js";
|
32
|
+
import { BottomBar as Vr } from "./components/BottomBar/BottomBar.js";
|
33
|
+
import { BulletList as Lr } from "./components/BulletList/BulletList.js";
|
34
|
+
import { BulletListItem as Hr } from "./components/BulletListItem/BulletListItem.js";
|
35
35
|
import "./components/BulletPoint/BulletPoint.js";
|
36
|
-
import { Marble as
|
37
|
-
import { TopBar as
|
38
|
-
import { CountryDrawer as
|
39
|
-
import { ToggleGroupItem as
|
40
|
-
import { TabItem as
|
41
|
-
import
|
36
|
+
import { Marble as vr } from "./components/Marble/Marble.js";
|
37
|
+
import { TopBar as Kr } from "./components/TopBar/TopBar.js";
|
38
|
+
import { CountryDrawer as Nr } from "./components/CountryDrawer/CountryDrawer.js";
|
39
|
+
import { ToggleGroupItem as Wr, ToggleGroupRoot as jr } from "./components/ToggleGroup/ToggleGroup.js";
|
40
|
+
import { TabItem as Er, Tabs as Jr } from "./components/Tabs/Tabs.js";
|
41
|
+
import "react/jsx-runtime";
|
42
|
+
import { default as Ur } from "./tailwind/index.js";
|
42
43
|
export {
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
44
|
+
Ar as AlertDialog,
|
45
|
+
Fr as AlertDialogClose,
|
46
|
+
Pr as AlertDialogContent,
|
47
|
+
yr as AlertDialogDescription,
|
48
|
+
hr as AlertDialogFooter,
|
49
|
+
Ir as AlertDialogHeader,
|
50
|
+
Br as AlertDialogPortal,
|
51
|
+
br as AlertDialogTitle,
|
52
|
+
Gr as AlertDialogTrigger,
|
53
|
+
Vr as BottomBar,
|
54
|
+
Lr as BulletList,
|
55
|
+
Hr as BulletListItem,
|
56
|
+
a as Button,
|
57
|
+
l as Checkbox,
|
58
|
+
x as Chip,
|
59
|
+
g as ColorPickerGroup,
|
60
|
+
n as ColorPickerItem,
|
61
|
+
Nr as CountryDrawer,
|
62
|
+
xr as Drawer,
|
63
|
+
sr as DrawerClose,
|
64
|
+
gr as DrawerContent,
|
65
|
+
nr as DrawerHeader,
|
66
|
+
dr as DrawerTitle,
|
67
|
+
ur as DrawerTrigger,
|
68
|
+
u as Flag,
|
68
69
|
r as Form,
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
70
|
+
A as Input,
|
71
|
+
D as LazyFlag,
|
72
|
+
h as ListItem,
|
73
|
+
vr as Marble,
|
74
|
+
B as NumberPad,
|
75
|
+
G as OTPField,
|
76
|
+
N as PhoneField,
|
77
|
+
V as Pill,
|
78
|
+
Dr as Progress,
|
79
|
+
L as RadioGroup,
|
80
|
+
H as RadioGroupItem,
|
81
|
+
K as SearchField,
|
82
|
+
v as Select,
|
83
|
+
q as Spinner,
|
84
|
+
J as Switch,
|
85
|
+
Er as TabItem,
|
86
|
+
Jr as Tabs,
|
87
|
+
Y as Toast,
|
88
|
+
Z as ToastProvider,
|
89
|
+
$ as ToastViewport,
|
90
|
+
or as Toaster,
|
91
|
+
Wr as ToggleGroupItem,
|
92
|
+
jr as ToggleGroupRoot,
|
93
|
+
U as Token,
|
94
|
+
Kr as TopBar,
|
95
|
+
ir as Typography,
|
96
|
+
cr as WalletAddressField,
|
97
|
+
W as getValidatedCountryCode,
|
98
|
+
F as iconVariants,
|
99
|
+
P as inputVariants,
|
100
|
+
c as isSupportedCountryCode,
|
101
|
+
tr as reducer,
|
102
|
+
pr as toast,
|
103
|
+
lr as typographyVariants,
|
104
|
+
Ur as uiKitTailwindPlugin,
|
105
|
+
mr as useToast
|
105
106
|
};
|