@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.
@@ -1,37 +1,22 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { Item as s, Indicator as d } 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 { cva as c } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
- import { forwardRef as i } from "react";
5
- import { Tick as m } from "../Icons/Tick.js";
6
- const n = c(
7
- "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",
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: o,
25
- value: r,
26
- className: n({ disabled: e }),
27
- disabled: e,
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__ */ a(d, { className: "flex items-center justify-center", children: /* @__PURE__ */ a(m, { className: "text-gray-0" }) })
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
- l.displayName = "RadioGroupItem";
18
+ m.displayName = "RadioGroupItem";
34
19
  export {
35
- l as RadioGroupItem,
36
- l as default
20
+ m as RadioGroupItem,
21
+ m as default
37
22
  };
@@ -1,41 +1,29 @@
1
- import { VariantProps } from "class-variance-authority";
2
- import { ElementType } from "react";
3
-
4
- export interface TypographyProps<T extends ElementType = "p">
5
- extends Omit<VariantProps<typeof typographyVariants>, "variant" | "level"> {
6
- /**
7
- * The HTML element to render the typography as
8
- * @default "p"
9
- */
10
- as?: T;
11
- /**
12
- * The variant and level combinations for typography
13
- * @default "body"
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
- props?:
31
- | ({
32
- variant?: "number" | "heading" | "body" | "subtitle" | "mono" | null | undefined;
33
- level?: 1 | 2 | 3 | 4 | 5 | 6 | null | undefined;
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 i } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
3
- import { forwardRef as o } from "react";
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 = i("", {
5
+ const c = o("", {
6
6
  variants: {
7
7
  variant: {
8
- number: "font-display font-semibold leading-[1.2] tracking-normal",
9
- heading: "font-display font-semibold leading-[1.2] tracking-[-0.01em]",
10
- subtitle: "font-sans font-medium leading-[1.2] tracking-normal",
11
- body: "font-sans font-normal leading-[1.3] tracking-normal",
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-[1]"
112
+ className: "text-sm leading-none"
113
113
  },
114
114
  {
115
115
  variant: "mono",
116
116
  level: 2,
117
- className: "text-xs leading-[1.25]"
117
+ className: "text-xs leading-narrow"
118
118
  },
119
119
  {
120
120
  variant: "mono",
121
121
  level: 3,
122
- className: "text-2xs leading-[1.25]"
122
+ className: "text-2xs leading-narrow"
123
123
  },
124
124
  {
125
125
  variant: "mono",
126
126
  level: 4,
127
- className: "text-[0.5rem] leading-[1.3]"
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 = o(
135
- ({ variant: a = "body", level: e = 2, children: t, as: l = "p", className: n, ...s }, r) => /* @__PURE__ */ m(
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: r,
140
- ...s,
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 u } from "./components/Flag/Flag.js";
6
- import { LazyFlag as c } from "./components/Flag/LazyFlag.js";
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 g, inputVariants as h } from "./components/Input/Input.js";
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 y } from "./components/NumberPad/NumberPad.js";
11
- import { OTPField as k } from "./components/OTPField/OTPField.js";
12
- import { Pill as I } from "./components/Pill/Pill.js";
13
- import { RadioGroup as S } from "./components/RadioGroup/RadioGroup.js";
14
- import { RadioGroupItem as b } from "./components/RadioGroup/RadioGroupItem.js";
15
- import { Select as R } from "./components/Select/Select.js";
16
- import { SearchField as z } from "./components/SearchField/SearchField.js";
17
- import { PhoneField as K } from "./components/PhoneField/PhoneField.js";
18
- import { Switch as O } from "./components/Switch/Switch.js";
19
- import { Token as q } from "./components/Token/Token.js";
20
- import { Typography as A, typographyVariants as E } from "./components/Typography/Typography.js";
21
- import { Drawer as J, DrawerClose as M, DrawerContent as Q, DrawerTrigger as U } from "./components/Drawer/Drawer.js";
22
- import { default as X } from "./tailwind/index.js";
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
- J as Drawer,
30
- M as DrawerClose,
31
- Q as DrawerContent,
32
- U as DrawerTrigger,
33
- u as Flag,
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
- c as LazyFlag,
38
+ s as LazyFlag,
37
39
  w as ListItem,
38
- y as NumberPad,
39
- k as OTPField,
40
- K as PhoneField,
41
- I as Pill,
42
- S as RadioGroup,
43
- b as RadioGroupItem,
44
- z as SearchField,
45
- R as Select,
46
- O as Switch,
47
- q as Token,
48
- A as Typography,
49
- g as iconVariants,
50
- h as inputVariants,
51
- E as typographyVariants,
52
- X as uiKitTailwindPlugin
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 i } from "../../../../../../../_virtual/create-plugin.js";
2
- import "../util/createPlugin.js";
3
- import { __exports as o } from "../../../../../../../_virtual/createPlugin.js";
4
- (function(t) {
5
- Object.defineProperty(t, "__esModule", {
6
- value: !0
7
- }), Object.defineProperty(t, "default", {
8
- enumerable: !0,
9
- get: function() {
10
- return n;
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
- const r = /* @__PURE__ */ u(o);
14
- function u(e) {
15
- return e && e.__esModule ? e : {
16
- default: e
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
+ };
@@ -1,28 +1,34 @@
1
- import { __exports as c } from "../../../../../../../_virtual/createPlugin.js";
2
- (function(u) {
3
- Object.defineProperty(u, "__esModule", {
4
- value: !0
5
- }), Object.defineProperty(u, "default", {
6
- enumerable: !0,
7
- get: function() {
8
- return o;
9
- }
10
- });
11
- function i(e, n) {
12
- return {
13
- handler: e,
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
- __options: r,
21
- handler: e(r),
22
- config: n(r)
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
- return t.__isOptionsFunction = !0, t.__pluginFunction = e, t.__configFunction = n, t;
26
- };
27
- const o = i;
28
- })(c);
29
+ const _ = o;
30
+ }(u), u);
31
+ }
32
+ export {
33
+ f as __require
34
+ };
@@ -1,9 +1,11 @@
1
- import { getDefaultExportFromCjs as e } from "../../../../../_virtual/_commonjsHelpers.js";
2
- import "./lib/public/create-plugin.js";
3
- import { __exports as r } from "../../../../../_virtual/create-plugin.js";
4
- let t = r;
5
- var o = (t.__esModule ? t : { default: t }).default;
6
- const p = /* @__PURE__ */ e(o);
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
- p as default
10
+ a as __require
9
11
  };
@@ -1,4 +1,4 @@
1
- import a from "../node_modules/.pnpm/tailwindcss@3.4.17/node_modules/tailwindcss/plugin.js";
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.1",
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": "^5.4.10",
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
  }