@worldcoin/mini-apps-ui-kit-react 0.0.2 → 0.0.4

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/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
  };
@@ -0,0 +1,35 @@
1
+ import * as o from "react";
2
+ function d({ nativeEvent: n }) {
3
+ return window.TouchEvent ? n instanceof TouchEvent : "touches" in n;
4
+ }
5
+ function l(n) {
6
+ return n.nativeEvent instanceof MouseEvent;
7
+ }
8
+ function M(n, m = {}) {
9
+ const { threshold: a = 400, onStart: r, onFinish: t, onCancel: s } = m, u = o.useRef(!1), c = o.useRef(!1), i = o.useRef();
10
+ return o.useMemo(() => {
11
+ if (typeof n != "function")
12
+ return {};
13
+ const h = (e) => {
14
+ !l(e) && !d(e) || (r && r(e), c.current = !0, i.current = setTimeout(() => {
15
+ n(e), u.current = !0;
16
+ }, a));
17
+ }, f = (e) => {
18
+ !l(e) && !d(e) || (u.current ? t && t(e) : c.current && s && s(e), u.current = !1, c.current = !1, i.current && window.clearTimeout(i.current));
19
+ };
20
+ return {
21
+ ...{
22
+ onMouseDown: h,
23
+ onMouseUp: f,
24
+ onMouseLeave: f
25
+ },
26
+ ...{
27
+ onTouchStart: h,
28
+ onTouchEnd: f
29
+ }
30
+ };
31
+ }, [n, a, s, t, r]);
32
+ }
33
+ export {
34
+ M as useLongPress
35
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worldcoin/mini-apps-ui-kit-react",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
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",
@@ -158,6 +150,7 @@
158
150
  "@radix-ui/react-select": "^2.1.2",
159
151
  "@radix-ui/react-slot": "^1.1.0",
160
152
  "@radix-ui/react-switch": "^1.1.1",
153
+ "@uidotdev/usehooks": "^2.4.1",
161
154
  "class-variance-authority": "^0.7.1",
162
155
  "clsx": "^2.1.1",
163
156
  "countries-list": "^3.1.1",
@@ -168,5 +161,15 @@
168
161
  },
169
162
  "description": "React components UI Kit library for Mini Apps",
170
163
  "author": "",
171
- "license": "ISC"
164
+ "license": "ISC",
165
+ "scripts": {
166
+ "storybook": "storybook dev -p 6006",
167
+ "format": "prettier --write \"**/*.{ts,tsx,md}\"",
168
+ "sb:move": "mv ./storybook-static ../../storybook-static",
169
+ "dev:sb": "concurrently \"tailwindcss -i ./styles/globals.css -o ./public/globals.css --watch\" \"pnpm storybook\"",
170
+ "build:tailwind": "tailwindcss -i ./styles/globals.css -o ./public/globals.css --minify",
171
+ "build:sb": "pnpm build:tailwind && storybook build",
172
+ "build": "pnpm build:tailwind && tsc -b ./tsconfig.lib.json && vite build",
173
+ "lint": "eslint ."
174
+ }
172
175
  }