@worldcoin/mini-apps-ui-kit-react 1.0.0-canary.0 → 1.0.0-canary.10
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/README.md +15 -17
- package/dist/components/AlertDialog/AlertDialog.d.ts +22 -0
- package/dist/components/AlertDialog/AlertDialog.js +45 -48
- package/dist/components/AlertDialog/index.js +6 -7
- package/dist/components/Button/Button.d.ts +1 -7
- package/dist/components/Button/Button.js +26 -38
- package/dist/components/Chip/Chip.d.ts +3 -3
- package/dist/components/Chip/Chip.js +22 -14
- package/dist/components/CircularIcon/CircularIcon.d.ts +8 -0
- package/dist/components/CircularIcon/CircularIcon.js +32 -0
- package/dist/components/CircularIcon/index.d.ts +1 -0
- package/dist/components/CircularIcon/index.js +4 -0
- package/dist/components/ColorPicker/ColorPicker.js +10 -16
- package/dist/components/CountryDrawer/CountryDrawer.js +1 -0
- 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/PhoneField/PhoneField.js +35 -35
- package/dist/components/Tabs/Tabs.js +25 -28
- package/dist/components/Tabs/types.d.ts +2 -2
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/components/TopBar/TopBar.d.ts +1 -1
- package/dist/components/Typography/Typography.js +6 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +78 -75
- package/package.json +9 -1
- package/public/globals.css +3 -1
package/README.md
CHANGED
@@ -7,11 +7,11 @@ React components UI Kit library for Mini Apps
|
|
7
7
|
## Getting Started
|
8
8
|
|
9
9
|
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
10
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs
|
10
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs**/**vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
11
11
|
|
12
|
-
## Tailwind Configuration
|
12
|
+
## Tailwind **Configuration**
|
13
13
|
|
14
|
-
-
|
14
|
+
- `./**styles**/globals.css`: is the main entrypoint for the tailwind css styles
|
15
15
|
- `./public/globals.css`: compiled tailwind css styles
|
16
16
|
- `./src/tailwind`: tailwind plugin with uiKit tailwind presets
|
17
17
|
|
@@ -107,32 +107,30 @@ This method enables tree-shaking and reduces your final bundle size by only incl
|
|
107
107
|
|
108
108
|
## Icons
|
109
109
|
|
110
|
-
The library uses [
|
110
|
+
The library uses [Iconoir](https://iconoir.com/) for its icon system. To use icons in your project, you'll need to install the [React package](https://www.npmjs.com/package/iconoir-react):
|
111
111
|
|
112
112
|
```bash
|
113
|
-
npm install
|
113
|
+
npm install iconoir-react
|
114
114
|
# or
|
115
|
-
yarn add
|
115
|
+
yarn add iconoir-react
|
116
116
|
```
|
117
117
|
|
118
118
|
Then you can import and use icons in your components:
|
119
119
|
|
120
120
|
```jsx
|
121
|
-
import {
|
121
|
+
import { Home } from 'iconoir-react';
|
122
122
|
|
123
123
|
function MyComponent() {
|
124
|
-
return <
|
124
|
+
return <Home width={24} height={24} />;
|
125
125
|
}
|
126
126
|
```
|
127
127
|
|
128
|
-
|
129
|
-
-
|
130
|
-
-
|
131
|
-
-
|
132
|
-
-
|
133
|
-
- Technology
|
134
|
-
- And many more...
|
128
|
+
Iconoir provides a comprehensive set of 1,600+ unique SVG icons, designed on a 24x24 pixels grid. The icons are:
|
129
|
+
- 100% free and open source
|
130
|
+
- Available in SVG, React, React Native, Flutter, Figma and Framer
|
131
|
+
- Optimized for performance
|
132
|
+
- Customizable with different sizes, colors, and styles
|
135
133
|
|
136
|
-
You can browse the complete icon set at [
|
134
|
+
You can browse the complete icon set at [iconoir.com](https://iconoir.com/).
|
137
135
|
|
138
|
-
|
136
|
+
Iconoir is available under the MIT License. Please refer to their [website](https://iconoir.com/) for more details.
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { BottomBarProps } from '../BottomBar';
|
2
|
+
import { AlertDialogCloseProps, AlertDialogContentProps, AlertDialogDescriptionProps, AlertDialogHeaderProps, AlertDialogProps, AlertDialogTitleProps, AlertDialogTriggerProps } from './types';
|
3
|
+
import * as React from "react";
|
4
|
+
declare const AlertDialog: {
|
5
|
+
({ dismissible, modal, ...props }: AlertDialogProps): import("react/jsx-runtime").JSX.Element;
|
6
|
+
displayName: string;
|
7
|
+
};
|
8
|
+
declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
9
|
+
declare const AlertDialogPortal: typeof import('vaul').Portal;
|
10
|
+
declare const AlertDialogClose: React.ForwardRefExoticComponent<AlertDialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
11
|
+
declare const AlertDialogContent: React.ForwardRefExoticComponent<AlertDialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
12
|
+
declare const AlertDialogHeader: {
|
13
|
+
({ icon, children, ...props }: AlertDialogHeaderProps): import("react/jsx-runtime").JSX.Element;
|
14
|
+
displayName: string;
|
15
|
+
};
|
16
|
+
declare const AlertDialogFooter: {
|
17
|
+
(props: BottomBarProps): import("react/jsx-runtime").JSX.Element;
|
18
|
+
displayName: string;
|
19
|
+
};
|
20
|
+
declare const AlertDialogTitle: React.ForwardRefExoticComponent<AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
21
|
+
declare const AlertDialogDescription: React.ForwardRefExoticComponent<AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
22
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogTrigger, AlertDialogClose, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, };
|
@@ -2,50 +2,48 @@
|
|
2
2
|
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
3
3
|
import { cn as s } from "../../lib/utils.js";
|
4
4
|
import * as i from "react";
|
5
|
-
import { Drawer as
|
6
|
-
import { BottomBar as
|
7
|
-
import { Button as
|
8
|
-
import { XMark as
|
5
|
+
import { Drawer as o } from "../../node_modules/.pnpm/vaul@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3.18_react-dom@18.3._7iqkcrcg5qjc3n2ixm6rnrnx3e/node_modules/vaul/dist/index.js";
|
6
|
+
import { BottomBar as c } from "../BottomBar/BottomBar.js";
|
7
|
+
import { Button as g } from "../Button/Button.js";
|
8
|
+
import { XMark as f } from "../Icons/XMark.js";
|
9
9
|
import { Typography as m } from "../Typography/Typography.js";
|
10
|
-
import { AlertDialogContext as
|
11
|
-
const
|
12
|
-
|
10
|
+
import { AlertDialogContext as p, useAlertDialog as D } from "./use-alert-dialog.js";
|
11
|
+
const A = ({ dismissible: e = !0, modal: l = !0, ...t }) => /* @__PURE__ */ r(p.Provider, { value: { dismissible: e }, children: /* @__PURE__ */ r(
|
12
|
+
o.Root,
|
13
13
|
{
|
14
14
|
shouldScaleBackground: !1,
|
15
15
|
dismissible: e,
|
16
16
|
modal: l,
|
17
|
-
...
|
17
|
+
...t
|
18
18
|
}
|
19
19
|
) });
|
20
|
-
|
21
|
-
const h = i.forwardRef((e, l) => /* @__PURE__ */ r(
|
20
|
+
A.displayName = "AlertDialog";
|
21
|
+
const h = i.forwardRef((e, l) => /* @__PURE__ */ r(o.Trigger, { ref: l, ...e }));
|
22
22
|
h.displayName = "AlertDialogTrigger";
|
23
|
-
const
|
23
|
+
const u = o.Portal, d = i.forwardRef((e, l) => /* @__PURE__ */ r(o.Close, { ref: l, ...e }));
|
24
24
|
d.displayName = "AlertDialogClose";
|
25
|
-
const
|
26
|
-
t.Overlay,
|
27
|
-
{
|
28
|
-
ref: a,
|
29
|
-
className: s("fixed inset-0 z-50 bg-gray-900/40", e),
|
30
|
-
...l
|
31
|
-
}
|
32
|
-
));
|
33
|
-
c.displayName = "AlertDialogOverlay";
|
34
|
-
const u = i.forwardRef(({ className: e, children: l, ...a }, o) => /* @__PURE__ */ n(N, { children: [
|
35
|
-
/* @__PURE__ */ r(c, {}),
|
25
|
+
const y = i.forwardRef(({ className: e, children: l, ...t }, a) => /* @__PURE__ */ n(u, { children: [
|
36
26
|
/* @__PURE__ */ r(
|
37
|
-
|
27
|
+
o.Overlay,
|
38
28
|
{
|
39
|
-
ref:
|
29
|
+
ref: a,
|
30
|
+
className: s("fixed inset-0 z-50 bg-gray-900/40", e),
|
31
|
+
...t
|
32
|
+
}
|
33
|
+
),
|
34
|
+
/* @__PURE__ */ r(
|
35
|
+
o.Content,
|
36
|
+
{
|
37
|
+
ref: a,
|
40
38
|
className: s("fixed inset-x-0 bottom-0 z-50 mt-24 h-auto", e),
|
41
|
-
...
|
39
|
+
...t,
|
42
40
|
children: /* @__PURE__ */ r("div", { className: "flex flex-col rounded-[1.75rem] bg-gray-0 m-3 p-8", children: l })
|
43
41
|
}
|
44
42
|
)
|
45
43
|
] }));
|
46
|
-
|
47
|
-
const
|
48
|
-
const { dismissible:
|
44
|
+
y.displayName = "AlertDialogContent";
|
45
|
+
const N = ({ icon: e, children: l, ...t }) => {
|
46
|
+
const { dismissible: a } = D();
|
49
47
|
return /* @__PURE__ */ n(
|
50
48
|
"div",
|
51
49
|
{
|
@@ -53,42 +51,41 @@ const x = ({ icon: e, children: l, ...a }) => {
|
|
53
51
|
"flex justify-between gap-4 mb-4 w-full",
|
54
52
|
e ? "items-start" : "items-center"
|
55
53
|
),
|
56
|
-
...
|
54
|
+
...t,
|
57
55
|
children: [
|
58
56
|
/* @__PURE__ */ n("div", { className: "flex flex-col gap-6", children: [
|
59
57
|
e,
|
60
58
|
l
|
61
59
|
] }),
|
62
|
-
|
60
|
+
a && /* @__PURE__ */ r("div", { className: "shrink-0", children: /* @__PURE__ */ r(d, { asChild: !0, children: /* @__PURE__ */ r(g, { variant: "tertiary", size: "icon", children: /* @__PURE__ */ r(f, {}) }) }) })
|
63
61
|
]
|
64
62
|
}
|
65
63
|
);
|
66
64
|
};
|
67
|
-
|
68
|
-
const
|
69
|
-
|
70
|
-
const
|
71
|
-
|
72
|
-
const
|
73
|
-
|
65
|
+
N.displayName = "AlertDialogHeader";
|
66
|
+
const x = (e) => /* @__PURE__ */ r(c, { ...e });
|
67
|
+
x.displayName = "AlertDialogFooter";
|
68
|
+
const v = i.forwardRef(({ className: e, children: l, ...t }, a) => /* @__PURE__ */ r(o.Title, { ref: a, ...t, asChild: !0, children: /* @__PURE__ */ r(m, { variant: "heading", level: 2, children: l }) }));
|
69
|
+
v.displayName = "AlertDialogTitle";
|
70
|
+
const C = i.forwardRef(({ className: e, children: l, ...t }, a) => /* @__PURE__ */ r(
|
71
|
+
o.Description,
|
74
72
|
{
|
75
|
-
ref:
|
73
|
+
ref: a,
|
76
74
|
className: s("text-gray-500 mb-8", e),
|
77
|
-
...
|
75
|
+
...t,
|
78
76
|
asChild: !0,
|
79
77
|
children: /* @__PURE__ */ r(m, { children: l })
|
80
78
|
}
|
81
79
|
));
|
82
|
-
|
80
|
+
C.displayName = "AlertDialogDescription";
|
83
81
|
export {
|
84
|
-
|
82
|
+
A as AlertDialog,
|
85
83
|
d as AlertDialogClose,
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
C as AlertDialogTitle,
|
84
|
+
y as AlertDialogContent,
|
85
|
+
C as AlertDialogDescription,
|
86
|
+
x as AlertDialogFooter,
|
87
|
+
N as AlertDialogHeader,
|
88
|
+
u as AlertDialogPortal,
|
89
|
+
v as AlertDialogTitle,
|
93
90
|
h as AlertDialogTrigger
|
94
91
|
};
|
@@ -1,13 +1,12 @@
|
|
1
|
-
import { AlertDialog as
|
1
|
+
import { AlertDialog as o, AlertDialogClose as r, AlertDialogContent as t, AlertDialogDescription as i, AlertDialogFooter as a, AlertDialogHeader as g, AlertDialogPortal as D, AlertDialogTitle as A, AlertDialogTrigger as n } from "./AlertDialog.js";
|
2
2
|
export {
|
3
|
-
|
4
|
-
|
3
|
+
o as AlertDialog,
|
4
|
+
r as AlertDialogClose,
|
5
5
|
t as AlertDialogContent,
|
6
6
|
i as AlertDialogDescription,
|
7
7
|
a as AlertDialogFooter,
|
8
8
|
g as AlertDialogHeader,
|
9
|
-
D as
|
10
|
-
A as
|
11
|
-
n as
|
12
|
-
p as AlertDialogTrigger
|
9
|
+
D as AlertDialogPortal,
|
10
|
+
A as AlertDialogTitle,
|
11
|
+
n as AlertDialogTrigger
|
13
12
|
};
|
@@ -3,10 +3,9 @@ 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
|
-
export interface ButtonProps extends
|
8
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
10
9
|
/**
|
11
10
|
* The variant style to use
|
12
11
|
* @default "primary"
|
@@ -17,11 +16,6 @@ export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement
|
|
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,15 +1,12 @@
|
|
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
|
-
|
10
|
-
import { typographyVariants as u } from "../Typography/Typography.js";
|
11
|
-
const v = m(
|
12
|
-
"flex items-center justify-center rounded-full gap-2 font-display leading-[1.2] tracking-normal transition-colors",
|
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(
|
9
|
+
"flex items-center justify-center rounded-full gap-2 font-sans leading-[1.2] tracking-normal transition-colors",
|
13
10
|
{
|
14
11
|
variants: {
|
15
12
|
variant: {
|
@@ -22,10 +19,6 @@ const v = m(
|
|
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,35 +30,30 @@ const v = m(
|
|
37
30
|
fullWidth: !1
|
38
31
|
}
|
39
32
|
}
|
40
|
-
),
|
41
|
-
({ variant:
|
42
|
-
i ?
|
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
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
fullWidth:
|
37
|
+
ref: g,
|
38
|
+
...a,
|
39
|
+
className: n(
|
40
|
+
b({
|
41
|
+
variant: t,
|
42
|
+
size: r,
|
43
|
+
fullWidth: e
|
51
44
|
}),
|
52
|
-
|
45
|
+
m({
|
53
46
|
variant: "label",
|
54
|
-
level:
|
55
|
-
})
|
47
|
+
level: r === "lg" ? 1 : 2
|
48
|
+
}),
|
49
|
+
a.className
|
56
50
|
),
|
57
|
-
|
58
|
-
children: [
|
59
|
-
!r && n,
|
60
|
-
r === "pending" && /* @__PURE__ */ a(c, { className: "absolute size-6" }),
|
61
|
-
r === "success" && /* @__PURE__ */ a(y, { className: "absolute size-6" }),
|
62
|
-
r === "failed" && /* @__PURE__ */ a(f, { className: "absolute size-6" })
|
63
|
-
]
|
51
|
+
children: o
|
64
52
|
}
|
65
53
|
)
|
66
54
|
);
|
67
|
-
|
55
|
+
f.displayName = "Button";
|
68
56
|
export {
|
69
|
-
|
70
|
-
|
57
|
+
f as Button,
|
58
|
+
f as default
|
71
59
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
2
|
-
import { ReactNode } from 'react';
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
3
3
|
type ChipVariant = "default" | "success" | "warning" | "error" | "important";
|
4
|
-
export interface ChipProps {
|
4
|
+
export interface ChipProps extends HTMLAttributes<HTMLDivElement> {
|
5
5
|
/**
|
6
6
|
* The variant of the chip. Default value is "default".
|
7
7
|
*/
|
@@ -20,7 +20,7 @@ export interface ChipProps {
|
|
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;
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { Slot as
|
3
|
-
import { cva as
|
4
|
-
import { forwardRef as
|
5
|
-
import { Typography as
|
6
|
-
const
|
1
|
+
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { Slot as l } 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";
|
3
|
+
import { cva as f } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
4
|
+
import { forwardRef as m } from "react";
|
5
|
+
import { Typography as c } from "../Typography/Typography.js";
|
6
|
+
const d = f(
|
7
7
|
"inline-flex h-7 items-center gap-2 rounded-full px-4 font-sans text-sm font-medium leading-none",
|
8
8
|
{
|
9
9
|
variants: {
|
@@ -24,14 +24,22 @@ const c = l(
|
|
24
24
|
isIcon: !1
|
25
25
|
}
|
26
26
|
}
|
27
|
-
),
|
28
|
-
({
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
), p = m(
|
28
|
+
({ icon: r, label: e, variant: a = "default", className: i, ...n }, s) => /* @__PURE__ */ o(
|
29
|
+
"div",
|
30
|
+
{
|
31
|
+
ref: s,
|
32
|
+
className: d({ variant: a, className: i, isIcon: !!r }),
|
33
|
+
...n,
|
34
|
+
children: [
|
35
|
+
r && /* @__PURE__ */ t(l, { style: { width: "1rem", height: "1rem" }, children: r }),
|
36
|
+
/* @__PURE__ */ t(c, { variant: "subtitle", level: 4, children: e })
|
37
|
+
]
|
38
|
+
}
|
39
|
+
)
|
32
40
|
);
|
33
|
-
|
41
|
+
p.displayName = "Chip";
|
34
42
|
export {
|
35
|
-
|
36
|
-
|
43
|
+
p as Chip,
|
44
|
+
p as default
|
37
45
|
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
export type CircularIconSize = "xs" | "sm" | "md" | "lg" | "xl";
|
3
|
+
export interface CircularIconProps {
|
4
|
+
children?: ReactNode;
|
5
|
+
className?: string;
|
6
|
+
size?: CircularIconSize;
|
7
|
+
}
|
8
|
+
export declare function CircularIcon({ children, className, size }: CircularIconProps): import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
2
|
+
import { Slot as m } 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";
|
3
|
+
import { cn as l } from "../../lib/utils.js";
|
4
|
+
const o = {
|
5
|
+
xs: "size-6",
|
6
|
+
sm: "size-11",
|
7
|
+
md: "size-12",
|
8
|
+
lg: "size-16",
|
9
|
+
xl: "size-[5.5rem]"
|
10
|
+
}, t = {
|
11
|
+
xs: "size-[0.875rem]",
|
12
|
+
sm: "size-[1.5rem]",
|
13
|
+
md: "size-[1.625rem]",
|
14
|
+
lg: "size-[2.125rem]",
|
15
|
+
xl: "size-12"
|
16
|
+
};
|
17
|
+
function a({ children: i, className: r, size: e = "md" }) {
|
18
|
+
return /* @__PURE__ */ s(
|
19
|
+
"div",
|
20
|
+
{
|
21
|
+
className: l(
|
22
|
+
"rounded-full flex items-center justify-center",
|
23
|
+
o[e],
|
24
|
+
r
|
25
|
+
),
|
26
|
+
children: /* @__PURE__ */ s(m, { className: t[e], children: i })
|
27
|
+
}
|
28
|
+
);
|
29
|
+
}
|
30
|
+
export {
|
31
|
+
a as CircularIcon
|
32
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './CircularIcon';
|
@@ -1,35 +1,29 @@
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
2
|
-
import { Item as n, Indicator as
|
3
|
-
import { forwardRef as
|
4
|
-
const f =
|
2
|
+
import { Item as n, Indicator as d, Root as i } from "../../node_modules/.pnpm/@radix-ui_react-radio-group@1.2.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@_2u6lfd2xt65wmbxn7lgvaxqbmy/node_modules/@radix-ui/react-radio-group/dist/index.js";
|
3
|
+
import { forwardRef as a } from "react";
|
4
|
+
const f = a(
|
5
5
|
({ value: e, ...r }, o) => /* @__PURE__ */ t(
|
6
6
|
n,
|
7
7
|
{
|
8
8
|
ref: o,
|
9
9
|
value: e,
|
10
|
-
className: "size-[
|
10
|
+
className: "size-[3.25rem] cursor-default rounded-full outline-none flex items-center justify-center relative disabled:opacity-90 disabled:cursor-not-allowed",
|
11
11
|
style: {
|
12
12
|
background: e
|
13
13
|
},
|
14
14
|
...r,
|
15
|
-
children: /* @__PURE__ */ t(
|
16
|
-
i,
|
17
|
-
{
|
18
|
-
className: "absolute flex size-[2.75rem] items-center rounded-full justify-center",
|
19
|
-
style: { boxShadow: `0px 0px 0px 4px ${e}` }
|
20
|
-
}
|
21
|
-
)
|
15
|
+
children: /* @__PURE__ */ t(d, { className: "size-11 rounded-full bg-transparent border-2 border-gray-0" })
|
22
16
|
}
|
23
17
|
)
|
24
|
-
), p =
|
25
|
-
({ value: e, onChange: r, children: o, ...
|
26
|
-
|
18
|
+
), p = a(
|
19
|
+
({ value: e, onChange: r, children: o, ...s }, l) => /* @__PURE__ */ t(
|
20
|
+
i,
|
27
21
|
{
|
28
|
-
ref:
|
22
|
+
ref: l,
|
29
23
|
value: e,
|
30
24
|
onValueChange: r,
|
31
25
|
className: "flex gap-4 items-center",
|
32
|
-
...
|
26
|
+
...s,
|
33
27
|
children: o
|
34
28
|
}
|
35
29
|
)
|
@@ -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';
|