@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.
@@ -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 { jsxs as g, jsx as r } from "react/jsx-runtime";
3
- import { cn as m } from "../../lib/utils.js";
4
- import { Slot as b } 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 d } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
6
- import { forwardRef as p } from "react";
7
- import { Fail as f } from "../Icons/Fail.js";
8
- import { Success as c } from "../Icons/Success.js";
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
- ), x = p(
41
- ({ variant: s = "primary", size: t = "lg", fullWidth: i, asChild: n, state: a, children: l, ...e }, o) => /* @__PURE__ */ g(
42
- n ? b : "button",
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: o,
45
- ...e,
46
- className: m(
47
- v({
48
- variant: s,
49
- size: t,
50
- stateful: !!a,
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
- u({
45
+ m({
54
46
  variant: "label",
55
- level: t === "lg" ? 1 : 2
47
+ level: r === "lg" ? 1 : 2
56
48
  }),
57
- e.className
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
- x.displayName = "Button";
55
+ f.displayName = "Button";
69
56
  export {
70
- x as Button,
71
- x as default
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" | "success" | "default" | "warning" | "important" | null | undefined;
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';
@@ -0,0 +1,2 @@
1
+ import "react/jsx-runtime";
2
+ import "../Typography/Typography.js";
@@ -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-4 right-0 left-0 flex-col",
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 m } from "./components/Button/Button.js";
2
- import { Checkbox as i } from "./components/Checkbox/Checkbox.js";
3
- import { Chip as f } from "./components/Chip/Chip.js";
4
- import { ColorPickerGroup as s, ColorPickerItem as g } from "./components/ColorPicker/ColorPicker.js";
5
- import { Flag as d } from "./components/Flag/Flag.js";
6
- import { LazyFlag as T } from "./components/Flag/LazyFlag.js";
7
- import { isSupportedCountryCode as C } from "./components/Flag/utils.js";
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 w, iconVariants as A, inputVariants as F } from "./components/Input/Input.js";
10
- import { ListItem as y } from "./components/ListItem/ListItem.js";
11
- import { NumberPad as I } from "./components/NumberPad/NumberPad.js";
12
- import { OTPField as b } from "./components/OTPField/OTPField.js";
13
- import { Pill as S } from "./components/Pill/Pill.js";
14
- import { RadioGroup as k } from "./components/RadioGroup/RadioGroup.js";
15
- import { RadioGroupItem as R } from "./components/RadioGroup/RadioGroupItem.js";
16
- import { Select as _ } from "./components/Select/Select.js";
17
- import { SearchField as z } from "./components/SearchField/SearchField.js";
18
- import { PhoneField as M } from "./components/PhoneField/PhoneField.js";
19
- import { getValidatedCountryCode as O } from "./components/PhoneField/utils.js";
20
- import { Spinner as j } from "./components/Spinner/Spinner.js";
21
- import { Switch as E } from "./components/Switch/Switch.js";
22
- import { Token as Q } from "./components/Token/Token.js";
23
- import { Toast as X, ToastProvider as Y, ToastViewport as Z } from "./components/Toast/Toast.js";
24
- import { Toaster as rr } from "./components/Toast/Toaster.js";
25
- import { reducer as er, toast as tr, useToast as pr } from "./components/Toast/use-toast.js";
26
- import { Typography as ar, typographyVariants as ir } from "./components/Typography/Typography.js";
27
- import { Drawer as fr, DrawerClose as xr, DrawerContent as sr, DrawerHeader as gr, DrawerTitle as nr, DrawerTrigger as dr } from "./components/Drawer/Drawer.js";
28
- import { Progress as Tr } from "./components/Progress/Progress.js";
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 Cr } from "./components/WalletAddressField/WalletAddressField.js";
31
- import { AlertDialog as wr, AlertDialogClose as Ar, AlertDialogContent as Fr, AlertDialogDescription as Pr, AlertDialogFooter as yr, AlertDialogHeader as hr, AlertDialogPortal as Ir, AlertDialogTitle as Br, AlertDialogTrigger as br } from "./components/AlertDialog/AlertDialog.js";
32
- import { BottomBar as Sr } from "./components/BottomBar/BottomBar.js";
33
- import { BulletList as kr } from "./components/BulletList/BulletList.js";
34
- import { BulletListItem as Rr } from "./components/BulletListItem/BulletListItem.js";
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 _r } from "./components/Marble/Marble.js";
37
- import { TopBar as zr } from "./components/TopBar/TopBar.js";
38
- import { CountryDrawer as Mr } from "./components/CountryDrawer/CountryDrawer.js";
39
- import { ToggleGroupItem as Or, ToggleGroupRoot as Wr } from "./components/ToggleGroup/ToggleGroup.js";
40
- import { TabItem as qr, Tabs as Er } from "./components/Tabs/Tabs.js";
41
- import { default as Qr } from "./tailwind/index.js";
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
- wr as AlertDialog,
44
- Ar as AlertDialogClose,
45
- Fr as AlertDialogContent,
46
- Pr as AlertDialogDescription,
47
- yr as AlertDialogFooter,
48
- hr as AlertDialogHeader,
49
- Ir as AlertDialogPortal,
50
- Br as AlertDialogTitle,
51
- br as AlertDialogTrigger,
52
- Sr as BottomBar,
53
- kr as BulletList,
54
- Rr as BulletListItem,
55
- m as Button,
56
- i as Checkbox,
57
- f as Chip,
58
- s as ColorPickerGroup,
59
- g as ColorPickerItem,
60
- Mr as CountryDrawer,
61
- fr as Drawer,
62
- xr as DrawerClose,
63
- sr as DrawerContent,
64
- gr as DrawerHeader,
65
- nr as DrawerTitle,
66
- dr as DrawerTrigger,
67
- d as Flag,
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
- w as Input,
70
- T as LazyFlag,
71
- y as ListItem,
72
- _r as Marble,
73
- I as NumberPad,
74
- b as OTPField,
75
- M as PhoneField,
76
- S as Pill,
77
- Tr as Progress,
78
- k as RadioGroup,
79
- R as RadioGroupItem,
80
- z as SearchField,
81
- _ as Select,
82
- j as Spinner,
83
- E as Switch,
84
- qr as TabItem,
85
- Er as Tabs,
86
- X as Toast,
87
- Y as ToastProvider,
88
- Z as ToastViewport,
89
- rr as Toaster,
90
- Or as ToggleGroupItem,
91
- Wr as ToggleGroupRoot,
92
- Q as Token,
93
- zr as TopBar,
94
- ar as Typography,
95
- Cr as WalletAddressField,
96
- O as getValidatedCountryCode,
97
- A as iconVariants,
98
- F as inputVariants,
99
- C as isSupportedCountryCode,
100
- er as reducer,
101
- tr as toast,
102
- ir as typographyVariants,
103
- Qr as uiKitTailwindPlugin,
104
- pr as useToast
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worldcoin/mini-apps-ui-kit-react",
3
- "version": "1.0.0-canary.8",
3
+ "version": "1.0.0-canary.9",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",