@worldcoin/mini-apps-ui-kit-react 0.0.1 → 0.0.3
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/LICENSE.md +21 -0
- package/README.md +42 -5
- package/dist/_virtual/plugin.js +7 -0
- package/dist/components/Flag/index.d.ts +1 -0
- package/dist/components/Flag/index.js +6 -4
- package/dist/components/PhoneField/PhoneField.d.ts +6 -1
- package/dist/components/PhoneField/PhoneField.js +121 -117
- package/dist/components/PhoneField/constants.d.ts +1 -1
- package/dist/components/PhoneField/constants.js +4 -4
- package/dist/components/PhoneField/index.d.ts +1 -0
- package/dist/components/PhoneField/index.js +3 -1
- package/dist/components/PhoneField/utils.d.ts +1 -0
- package/dist/components/PhoneField/utils.js +20 -11
- package/dist/components/Pill/Pill.js +0 -1
- package/dist/components/RadioGroup/RadioGroup.js +18 -24
- package/dist/components/RadioGroup/RadioGroupItem.js +15 -30
- package/dist/components/Typography/Typography.d.ts +21 -33
- package/dist/components/Typography/Typography.js +15 -15
- package/dist/index.js +41 -37
- package/dist/node_modules/.pnpm/tailwindcss@3.4.17/node_modules/tailwindcss/lib/public/create-plugin.js +24 -19
- package/dist/node_modules/.pnpm/tailwindcss@3.4.17/node_modules/tailwindcss/lib/util/createPlugin.js +31 -25
- package/dist/node_modules/.pnpm/tailwindcss@3.4.17/node_modules/tailwindcss/plugin.js +9 -7
- package/dist/tailwind/index.js +6 -1
- package/package.json +15 -13
- package/public/globals.css +1 -1885
- package/public/SFMono-Regular.otf +0 -0
@@ -1,37 +1,22 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { Item as
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
{
|
9
|
-
variants: {
|
10
|
-
disabled: {
|
11
|
-
true: "cursor-not-allowed opacity-20",
|
12
|
-
// TODO: rework opacity to match design when it's provided
|
13
|
-
false: ""
|
14
|
-
}
|
15
|
-
},
|
16
|
-
defaultVariants: {
|
17
|
-
disabled: !1
|
18
|
-
}
|
19
|
-
}
|
20
|
-
), l = i(
|
21
|
-
({ value: r, disabled: e, ...t }, o) => /* @__PURE__ */ a(
|
22
|
-
s,
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
2
|
+
import { Item as o, Indicator as s } 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 c } from "react";
|
4
|
+
import { Tick as i } from "../Icons/Tick.js";
|
5
|
+
const m = c(
|
6
|
+
({ value: a, disabled: r, ...t }, d) => /* @__PURE__ */ e(
|
7
|
+
o,
|
23
8
|
{
|
24
|
-
ref:
|
25
|
-
value:
|
26
|
-
className:
|
27
|
-
disabled:
|
9
|
+
ref: d,
|
10
|
+
value: a,
|
11
|
+
className: "h-6 w-6 rounded-full border-[0.09375rem] transition-all data-[state=checked]:border-gray-900 data-[state=unchecked]:border-gray-400 data-[state=checked]:bg-gray-900 data-[state=unchecked]:bg-transparent disabled:cursor-not-allowed disabled:opacity-20",
|
12
|
+
disabled: r,
|
28
13
|
...t,
|
29
|
-
children: /* @__PURE__ */
|
14
|
+
children: /* @__PURE__ */ e(s, { className: "flex items-center justify-center", children: /* @__PURE__ */ e(i, { className: "text-gray-0" }) })
|
30
15
|
}
|
31
16
|
)
|
32
17
|
);
|
33
|
-
|
18
|
+
m.displayName = "RadioGroupItem";
|
34
19
|
export {
|
35
|
-
|
36
|
-
|
20
|
+
m as RadioGroupItem,
|
21
|
+
m as default
|
37
22
|
};
|
@@ -1,41 +1,29 @@
|
|
1
|
-
import { VariantProps } from
|
2
|
-
import { ElementType } from
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
*/
|
15
|
-
variant?:
|
16
|
-
| {
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
2
|
+
import { ElementType } from 'react';
|
3
|
+
export interface TypographyProps<T extends ElementType = "p"> extends Omit<VariantProps<typeof typographyVariants>, "variant" | "level"> {
|
4
|
+
/**
|
5
|
+
* The HTML element to render the typography as
|
6
|
+
* @default "p"
|
7
|
+
*/
|
8
|
+
as?: T;
|
9
|
+
/**
|
10
|
+
* The variant and level combinations for typography
|
11
|
+
* @default "body"
|
12
|
+
*/
|
13
|
+
variant?: {
|
17
14
|
variant: "number";
|
18
15
|
level: 1 | 2 | 3 | 4 | 5 | 6;
|
19
|
-
|
20
|
-
| {
|
16
|
+
} | {
|
21
17
|
variant: "subtitle" | "body" | "mono";
|
22
18
|
level: 1 | 2 | 3 | 4;
|
23
|
-
|
24
|
-
| {
|
19
|
+
} | {
|
25
20
|
variant: "heading";
|
26
21
|
level: 1 | 2 | 3;
|
27
|
-
|
22
|
+
};
|
28
23
|
}
|
29
|
-
export declare const typographyVariants: (
|
30
|
-
|
31
|
-
|
|
32
|
-
|
33
|
-
|
34
|
-
} & import("class-variance-authority/types").ClassProp)
|
35
|
-
| undefined,
|
36
|
-
) => string;
|
37
|
-
export declare const Typography: import("react").ForwardRefExoticComponent<
|
38
|
-
Omit<TypographyProps<"p"> & Omit<any, "ref">, "ref"> &
|
39
|
-
import("react").RefAttributes<HTMLElement>
|
40
|
-
>;
|
24
|
+
export declare const typographyVariants: (props?: ({
|
25
|
+
variant?: "number" | "heading" | "body" | "subtitle" | "mono" | null | undefined;
|
26
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6 | null | undefined;
|
27
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
28
|
+
export declare const Typography: import('react').ForwardRefExoticComponent<Omit<TypographyProps<"p"> & Omit<any, "ref">, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
41
29
|
export default Typography;
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
2
|
-
import { cva as
|
3
|
-
import { forwardRef as
|
2
|
+
import { cva as o } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
3
|
+
import { forwardRef as i } from "react";
|
4
4
|
import { cn as v } from "../../lib/utils.js";
|
5
|
-
const c =
|
5
|
+
const c = o("", {
|
6
6
|
variants: {
|
7
7
|
variant: {
|
8
|
-
number: "font-display font-semibold leading-
|
9
|
-
heading: "font-display font-semibold
|
10
|
-
subtitle: "font-sans font-medium leading-
|
11
|
-
body: "font-sans font-normal leading-
|
8
|
+
number: "font-display font-semibold leading-narrow tracking-normal",
|
9
|
+
heading: "font-display font-semibold tracking-[-0.01em] leading-narrow",
|
10
|
+
subtitle: "font-sans font-medium leading-narrow tracking-normal",
|
11
|
+
body: "font-sans font-normal leading-compact tracking-normal",
|
12
12
|
mono: "font-mono font-normal tracking-normal"
|
13
13
|
},
|
14
14
|
level: {
|
@@ -109,35 +109,35 @@ const c = i("", {
|
|
109
109
|
{
|
110
110
|
variant: "mono",
|
111
111
|
level: 1,
|
112
|
-
className: "text-sm leading-
|
112
|
+
className: "text-sm leading-none"
|
113
113
|
},
|
114
114
|
{
|
115
115
|
variant: "mono",
|
116
116
|
level: 2,
|
117
|
-
className: "text-xs leading-
|
117
|
+
className: "text-xs leading-narrow"
|
118
118
|
},
|
119
119
|
{
|
120
120
|
variant: "mono",
|
121
121
|
level: 3,
|
122
|
-
className: "text-2xs leading-
|
122
|
+
className: "text-2xs leading-narrow"
|
123
123
|
},
|
124
124
|
{
|
125
125
|
variant: "mono",
|
126
126
|
level: 4,
|
127
|
-
className: "text-[0.5rem] leading-
|
127
|
+
className: "text-[0.5rem] leading-compact"
|
128
128
|
}
|
129
129
|
],
|
130
130
|
defaultVariants: {
|
131
131
|
variant: "body",
|
132
132
|
level: 2
|
133
133
|
}
|
134
|
-
}), d =
|
135
|
-
({ variant: a = "body", level: e = 2, children: t, as: l = "p", className: n, ...
|
134
|
+
}), d = i(
|
135
|
+
({ variant: a = "body", level: e = 2, children: t, as: l = "p", className: n, ...r }, s) => /* @__PURE__ */ m(
|
136
136
|
l,
|
137
137
|
{
|
138
138
|
className: v(c({ variant: a, level: e, className: n })),
|
139
|
-
ref:
|
140
|
-
...
|
139
|
+
ref: s,
|
140
|
+
...r,
|
141
141
|
children: t
|
142
142
|
}
|
143
143
|
)
|
package/dist/index.js
CHANGED
@@ -2,52 +2,56 @@ import { Button as t } from "./components/Button/Button.js";
|
|
2
2
|
import { Checkbox as m } from "./components/Checkbox/Checkbox.js";
|
3
3
|
import { Chip as f } from "./components/Chip/Chip.js";
|
4
4
|
import { ColorPickerGroup as x, ColorPickerItem as n } from "./components/ColorPicker/ColorPicker.js";
|
5
|
-
import { Flag as
|
6
|
-
import { LazyFlag as
|
5
|
+
import { Flag as d } from "./components/Flag/Flag.js";
|
6
|
+
import { LazyFlag as s } from "./components/Flag/LazyFlag.js";
|
7
|
+
import { isSupportedCountryCode as c } from "./components/Flag/utils.js";
|
7
8
|
import * as r from "./components/Form/Form.js";
|
8
|
-
import { Input as F, iconVariants as
|
9
|
+
import { Input as F, iconVariants as h, inputVariants as y } from "./components/Input/Input.js";
|
9
10
|
import { ListItem as w } from "./components/ListItem/ListItem.js";
|
10
|
-
import { NumberPad as
|
11
|
-
import { OTPField as
|
12
|
-
import { Pill as
|
13
|
-
import { RadioGroup as
|
14
|
-
import { RadioGroupItem as
|
15
|
-
import { Select as
|
16
|
-
import { SearchField as
|
17
|
-
import { PhoneField as
|
18
|
-
import {
|
19
|
-
import {
|
20
|
-
import {
|
21
|
-
import {
|
22
|
-
import {
|
11
|
+
import { NumberPad as k } from "./components/NumberPad/NumberPad.js";
|
12
|
+
import { OTPField as I } from "./components/OTPField/OTPField.js";
|
13
|
+
import { Pill as V } from "./components/Pill/Pill.js";
|
14
|
+
import { RadioGroup as b } from "./components/RadioGroup/RadioGroup.js";
|
15
|
+
import { RadioGroupItem as R } from "./components/RadioGroup/RadioGroupItem.js";
|
16
|
+
import { Select as z } from "./components/Select/Select.js";
|
17
|
+
import { SearchField as K } from "./components/SearchField/SearchField.js";
|
18
|
+
import { PhoneField as O } from "./components/PhoneField/PhoneField.js";
|
19
|
+
import { getValidatedCountryCode as q } from "./components/PhoneField/utils.js";
|
20
|
+
import { Switch as A } from "./components/Switch/Switch.js";
|
21
|
+
import { Token as H } from "./components/Token/Token.js";
|
22
|
+
import { Typography as M, typographyVariants as Q } from "./components/Typography/Typography.js";
|
23
|
+
import { Drawer as W, DrawerClose as X, DrawerContent as Y, DrawerTrigger as Z } from "./components/Drawer/Drawer.js";
|
24
|
+
import { default as rr } from "./tailwind/index.js";
|
23
25
|
export {
|
24
26
|
t as Button,
|
25
27
|
m as Checkbox,
|
26
28
|
f as Chip,
|
27
29
|
x as ColorPickerGroup,
|
28
30
|
n as ColorPickerItem,
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
W as Drawer,
|
32
|
+
X as DrawerClose,
|
33
|
+
Y as DrawerContent,
|
34
|
+
Z as DrawerTrigger,
|
35
|
+
d as Flag,
|
34
36
|
r as Form,
|
35
37
|
F as Input,
|
36
|
-
|
38
|
+
s as LazyFlag,
|
37
39
|
w as ListItem,
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
h as
|
51
|
-
|
52
|
-
|
40
|
+
k as NumberPad,
|
41
|
+
I as OTPField,
|
42
|
+
O as PhoneField,
|
43
|
+
V as Pill,
|
44
|
+
b as RadioGroup,
|
45
|
+
R as RadioGroupItem,
|
46
|
+
K as SearchField,
|
47
|
+
z as Select,
|
48
|
+
A as Switch,
|
49
|
+
H as Token,
|
50
|
+
M as Typography,
|
51
|
+
q as getValidatedCountryCode,
|
52
|
+
h as iconVariants,
|
53
|
+
y as inputVariants,
|
54
|
+
c as isSupportedCountryCode,
|
55
|
+
Q as typographyVariants,
|
56
|
+
rr as uiKitTailwindPlugin
|
53
57
|
};
|
@@ -1,20 +1,25 @@
|
|
1
|
-
import { __exports as
|
2
|
-
import "../util/createPlugin.js";
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
import { __exports as r } from "../../../../../../../_virtual/create-plugin.js";
|
2
|
+
import { __require as _ } from "../util/createPlugin.js";
|
3
|
+
var u;
|
4
|
+
function o() {
|
5
|
+
return u ? r : (u = 1, function(t) {
|
6
|
+
Object.defineProperty(t, "__esModule", {
|
7
|
+
value: !0
|
8
|
+
}), Object.defineProperty(t, "default", {
|
9
|
+
enumerable: !0,
|
10
|
+
get: function() {
|
11
|
+
return a;
|
12
|
+
}
|
13
|
+
});
|
14
|
+
const n = /* @__PURE__ */ i(_());
|
15
|
+
function i(e) {
|
16
|
+
return e && e.__esModule ? e : {
|
17
|
+
default: e
|
18
|
+
};
|
11
19
|
}
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
}
|
19
|
-
const n = r.default;
|
20
|
-
})(i);
|
20
|
+
const a = n.default;
|
21
|
+
}(r), r);
|
22
|
+
}
|
23
|
+
export {
|
24
|
+
o as __require
|
25
|
+
};
|
package/dist/node_modules/.pnpm/tailwindcss@3.4.17/node_modules/tailwindcss/lib/util/createPlugin.js
CHANGED
@@ -1,28 +1,34 @@
|
|
1
|
-
import { __exports as
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
config: n
|
15
|
-
};
|
16
|
-
}
|
17
|
-
i.withOptions = function(e, n = () => ({})) {
|
18
|
-
const t = function(r) {
|
1
|
+
import { __exports as u } from "../../../../../../../_virtual/createPlugin.js";
|
2
|
+
var c;
|
3
|
+
function f() {
|
4
|
+
return c ? u : (c = 1, function(i) {
|
5
|
+
Object.defineProperty(i, "__esModule", {
|
6
|
+
value: !0
|
7
|
+
}), Object.defineProperty(i, "default", {
|
8
|
+
enumerable: !0,
|
9
|
+
get: function() {
|
10
|
+
return _;
|
11
|
+
}
|
12
|
+
});
|
13
|
+
function o(e, n) {
|
19
14
|
return {
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
handler: e,
|
16
|
+
config: n
|
17
|
+
};
|
18
|
+
}
|
19
|
+
o.withOptions = function(e, n = () => ({})) {
|
20
|
+
const r = function(t) {
|
21
|
+
return {
|
22
|
+
__options: t,
|
23
|
+
handler: e(t),
|
24
|
+
config: n(t)
|
25
|
+
};
|
23
26
|
};
|
27
|
+
return r.__isOptionsFunction = !0, r.__pluginFunction = e, r.__configFunction = n, r;
|
24
28
|
};
|
25
|
-
|
26
|
-
};
|
27
|
-
|
28
|
-
|
29
|
+
const _ = o;
|
30
|
+
}(u), u);
|
31
|
+
}
|
32
|
+
export {
|
33
|
+
f as __require
|
34
|
+
};
|
@@ -1,9 +1,11 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
import { __require as i } from "./lib/public/create-plugin.js";
|
2
|
+
var r, u;
|
3
|
+
function a() {
|
4
|
+
if (u) return r;
|
5
|
+
u = 1;
|
6
|
+
let e = i();
|
7
|
+
return r = (e.__esModule ? e : { default: e }).default, r;
|
8
|
+
}
|
7
9
|
export {
|
8
|
-
|
10
|
+
a as __require
|
9
11
|
};
|
package/dist/tailwind/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import a from "../
|
1
|
+
import a from "../_virtual/plugin.js";
|
2
2
|
const n = a(
|
3
3
|
function({ addBase: r }) {
|
4
4
|
r({
|
@@ -90,6 +90,11 @@ const n = a(
|
|
90
90
|
100: "var(--info-100)"
|
91
91
|
}
|
92
92
|
},
|
93
|
+
lineHeight: {
|
94
|
+
none: "1",
|
95
|
+
narrow: "1.2",
|
96
|
+
compact: "1.3"
|
97
|
+
},
|
93
98
|
extend: {
|
94
99
|
boxShadow: {
|
95
100
|
card: "0 0.625rem 1.875rem 0 #191C201A",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@worldcoin/mini-apps-ui-kit-react",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.3",
|
4
4
|
"type": "module",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -99,16 +99,6 @@
|
|
99
99
|
},
|
100
100
|
"./styles.css": "./public/globals.css"
|
101
101
|
},
|
102
|
-
"scripts": {
|
103
|
-
"storybook": "storybook dev -p 6006",
|
104
|
-
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
|
105
|
-
"sb:move": "mv ./storybook-static ../../storybook-static",
|
106
|
-
"dev:sb": "concurrently \"tailwindcss -i ./styles/globals.css -o ./public/globals.css --watch\" \"pnpm storybook\"",
|
107
|
-
"build:tailwind": "tailwindcss -i ./styles/globals.css -o ./public/globals.css",
|
108
|
-
"build:sb": "pnpm build:tailwind && storybook build",
|
109
|
-
"build": "pnpm build:tailwind && tsc -b ./tsconfig.lib.json && vite build",
|
110
|
-
"lint": "eslint ."
|
111
|
-
},
|
112
102
|
"peerDependencies": {
|
113
103
|
"react": "^18 || ^19",
|
114
104
|
"react-dom": "^18 || ^19",
|
@@ -126,9 +116,11 @@
|
|
126
116
|
"@storybook/addon-interactions": "^8.4.7",
|
127
117
|
"@storybook/addon-onboarding": "^8.4.7",
|
128
118
|
"@storybook/blocks": "^8.4.7",
|
119
|
+
"@storybook/manager-api": "^8.5.5",
|
129
120
|
"@storybook/react": "^8.4.7",
|
130
121
|
"@storybook/react-vite": "^8.4.7",
|
131
122
|
"@storybook/test": "^8.4.7",
|
123
|
+
"@storybook/theming": "^8.5.5",
|
132
124
|
"@types/glob": "^8.1.0",
|
133
125
|
"@types/react": "^18.3.12",
|
134
126
|
"@types/react-dom": "^18.3.1",
|
@@ -148,7 +140,7 @@
|
|
148
140
|
"tailwindcss": "^3.4.15",
|
149
141
|
"typescript": "~5.6.2",
|
150
142
|
"typescript-eslint": "^8.11.0",
|
151
|
-
"vite": "
|
143
|
+
"vite": ">=5.4.12",
|
152
144
|
"vite-plugin-dts": "^4.3.0"
|
153
145
|
},
|
154
146
|
"dependencies": {
|
@@ -168,5 +160,15 @@
|
|
168
160
|
},
|
169
161
|
"description": "React components UI Kit library for Mini Apps",
|
170
162
|
"author": "",
|
171
|
-
"license": "ISC"
|
163
|
+
"license": "ISC",
|
164
|
+
"scripts": {
|
165
|
+
"storybook": "storybook dev -p 6006",
|
166
|
+
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
|
167
|
+
"sb:move": "mv ./storybook-static ../../storybook-static",
|
168
|
+
"dev:sb": "concurrently \"tailwindcss -i ./styles/globals.css -o ./public/globals.css --watch\" \"pnpm storybook\"",
|
169
|
+
"build:tailwind": "tailwindcss -i ./styles/globals.css -o ./public/globals.css --minify",
|
170
|
+
"build:sb": "pnpm build:tailwind && storybook build",
|
171
|
+
"build": "pnpm build:tailwind && tsc -b ./tsconfig.lib.json && vite build",
|
172
|
+
"lint": "eslint ."
|
173
|
+
}
|
172
174
|
}
|