@worldcoin/mini-apps-ui-kit-react 0.0.8 → 1.0.0-canary.0
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 +8 -17
- package/dist/components/AlertDialog/AlertDialog.js +94 -0
- package/dist/components/AlertDialog/index.d.ts +1 -0
- package/dist/components/AlertDialog/index.js +13 -0
- package/dist/components/AlertDialog/types.d.ts +172 -0
- package/dist/components/AlertDialog/types.js +1 -0
- package/dist/components/AlertDialog/use-alert-dialog.d.ts +6 -0
- package/dist/components/AlertDialog/use-alert-dialog.js +11 -0
- package/dist/components/BottomBar/BottomBar.d.ts +13 -0
- package/dist/components/BottomBar/BottomBar.js +21 -0
- package/dist/components/BottomBar/index.d.ts +1 -0
- package/dist/components/BottomBar/index.js +4 -0
- package/dist/components/BulletList/BulletList.d.ts +10 -0
- package/dist/components/BulletList/BulletList.js +11 -0
- package/dist/components/BulletList/index.d.ts +1 -0
- package/dist/components/BulletList/index.js +4 -0
- package/dist/components/BulletListItem/BulletListItem.d.ts +7 -0
- package/dist/components/BulletListItem/BulletListItem.js +23 -0
- package/dist/components/BulletListItem/index.d.ts +1 -0
- package/dist/components/BulletListItem/index.js +4 -0
- package/dist/components/BulletPoint/BulletPoint.d.ts +6 -0
- package/dist/components/BulletPoint/BulletPoint.js +22 -0
- package/dist/components/BulletPoint/index.d.ts +1 -0
- package/dist/components/BulletPoint/index.js +1 -0
- package/dist/components/Button/Button.d.ts +10 -22
- package/dist/components/Button/Button.js +40 -72
- package/dist/components/Checkbox/Checkbox.d.ts +24 -4
- package/dist/components/Checkbox/Checkbox.js +5 -5
- package/dist/components/Chip/Chip.d.ts +2 -1
- package/dist/components/Chip/Chip.js +14 -8
- package/dist/components/ClearButton/Clear.js +14 -14
- package/dist/components/ClearButton/ClearButton.js +11 -11
- package/dist/components/ColorPicker/ColorPicker.js +14 -14
- package/dist/components/CountryDrawer/CountryDrawer.d.ts +12 -0
- package/dist/components/CountryDrawer/CountryDrawer.js +63 -0
- package/dist/components/CountryDrawer/index.d.ts +1 -0
- package/dist/components/CountryDrawer/index.js +4 -0
- package/dist/components/CountryDrawer/useCountryFiltering.d.ts +7 -0
- package/dist/components/CountryDrawer/useCountryFiltering.js +9 -0
- package/dist/components/CountryDrawer/useCountryGrouping.d.ts +13 -0
- package/dist/components/CountryDrawer/useCountryGrouping.js +17 -0
- package/dist/components/Drawer/Drawer.d.ts +28 -6
- package/dist/components/Drawer/Drawer.js +67 -28
- package/dist/components/Drawer/index.js +6 -4
- package/dist/components/Drawer/types.d.ts +167 -0
- package/dist/components/Drawer/types.js +1 -0
- package/dist/components/Drawer/use-drawer.d.ts +8 -0
- package/dist/components/Drawer/use-drawer.js +11 -0
- package/dist/components/Flag/LazyFlag.js +1 -1
- package/dist/components/Flag/flag-components/eu.d.ts +3 -0
- package/dist/components/Flag/flag-components/eu.js +83 -0
- package/dist/components/Flag/flag-components/index.d.ts +1 -0
- package/dist/components/Flag/flag-components/index.js +56 -54
- package/dist/components/Form/Form.js +2 -2
- package/dist/components/Icons/ArrowDown.js +26 -0
- package/dist/components/Icons/Eye.d.ts +8 -0
- package/dist/components/Icons/Eye.js +40 -0
- package/dist/components/Icons/EyeClosed.d.ts +8 -0
- package/dist/components/Icons/EyeClosed.js +60 -0
- package/dist/components/Icons/Fail.d.ts +8 -0
- package/dist/components/Icons/Fail.js +82 -0
- package/dist/components/Icons/MagicWand.d.ts +8 -0
- package/dist/components/Icons/MagicWand.js +60 -0
- package/dist/components/Icons/Magnifier.d.ts +1 -1
- package/dist/components/Icons/Magnifier.js +20 -11
- package/dist/components/Icons/Success.d.ts +8 -0
- package/dist/components/Icons/Success.js +82 -0
- package/dist/components/Icons/Tick.js +6 -7
- package/dist/components/Icons/XMark.d.ts +8 -0
- package/dist/components/Icons/XMark.js +27 -0
- package/dist/components/Input/Input.d.ts +26 -2
- package/dist/components/Input/Input.js +116 -51
- package/dist/components/ListItem/ListItem.d.ts +17 -6
- package/dist/components/ListItem/ListItem.js +29 -22
- package/dist/components/Marble/Marble.d.ts +2 -0
- package/dist/components/Marble/Marble.js +23 -0
- package/dist/components/Marble/index.d.ts +1 -0
- package/dist/components/Marble/index.js +4 -0
- package/dist/components/NumberPad/Delete.d.ts +1 -8
- package/dist/components/NumberPad/Delete.js +9 -10
- package/dist/components/NumberPad/NumberPad.js +30 -24
- package/dist/components/OTPField/OTPField.js +8 -8
- package/dist/components/PasswordField/PasswordField.d.ts +13 -0
- package/dist/components/PasswordField/PasswordField.js +45 -0
- package/dist/components/PasswordField/index.d.ts +1 -0
- package/dist/components/PasswordField/index.js +4 -0
- package/dist/components/PasteButton/PasteButton.d.ts +1 -1
- package/dist/components/PasteButton/PasteButton.js +21 -17
- package/dist/components/PhoneField/CountryListItem.d.ts +3 -4
- package/dist/components/PhoneField/CountryListItem.js +21 -25
- package/dist/components/PhoneField/CountrySelectorButton.d.ts +3 -4
- package/dist/components/PhoneField/CountrySelectorButton.js +17 -17
- package/dist/components/PhoneField/GroupedCountryList.d.ts +14 -0
- package/dist/components/PhoneField/GroupedCountryList.js +30 -0
- package/dist/components/PhoneField/PhoneField.d.ts +3 -14
- package/dist/components/PhoneField/PhoneField.js +71 -197
- package/dist/components/PhoneField/constants.js +4 -4
- package/dist/components/Pill/Pill.js +7 -7
- package/dist/components/Progress/Progress.d.ts +14 -0
- package/dist/components/Progress/Progress.js +31 -0
- package/dist/components/Progress/index.d.ts +1 -0
- package/dist/components/Progress/index.js +4 -0
- package/dist/components/RadioGroup/RadioGroupItem.js +1 -1
- package/dist/components/SearchField/SearchField.d.ts +6 -1
- package/dist/components/SearchField/SearchField.js +39 -35
- package/dist/components/Select/Select.js +46 -76
- package/dist/components/{Button → Spinner}/Spinner.d.ts +2 -2
- package/dist/components/Spinner/Spinner.js +36 -0
- package/dist/components/Spinner/index.d.ts +1 -0
- package/dist/components/Spinner/index.js +4 -0
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Tabs/Tabs.d.ts +11 -0
- package/dist/components/Tabs/Tabs.js +58 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tabs/index.js +5 -0
- package/dist/components/Tabs/types.d.ts +53 -0
- package/dist/components/Tabs/types.js +1 -0
- package/dist/components/TextArea/TextArea.d.ts +25 -0
- package/dist/components/TextArea/TextArea.js +54 -0
- package/dist/components/TextArea/index.d.ts +1 -0
- package/dist/components/TextArea/index.js +4 -0
- package/dist/components/Toast/Toast.d.ts +9 -0
- package/dist/components/Toast/Toast.js +51 -0
- package/dist/components/Toast/Toaster.d.ts +3 -0
- package/dist/components/Toast/Toaster.js +14 -0
- package/dist/components/Toast/index.d.ts +3 -0
- package/dist/components/Toast/index.js +12 -0
- package/dist/components/Toast/use-toast.d.ts +51 -0
- package/dist/components/Toast/use-toast.js +101 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +5 -0
- package/dist/components/ToggleGroup/ToggleGroup.js +28 -0
- package/dist/components/ToggleGroup/index.d.ts +1 -0
- package/dist/components/ToggleGroup/index.js +5 -0
- package/dist/components/ToggleGroup/types.d.ts +101 -0
- package/dist/components/ToggleGroup/types.js +1 -0
- package/dist/components/Token/Token.d.ts +4 -0
- package/dist/components/Token/Token.js +12 -7
- package/dist/components/Token/icons/btc.d.ts +2 -2
- package/dist/components/Token/icons/btc.js +13 -58
- package/dist/components/Token/icons/dai.d.ts +3 -0
- package/dist/components/Token/icons/dai.js +27 -0
- package/dist/components/Token/icons/eth.d.ts +2 -2
- package/dist/components/Token/icons/eth.js +11 -58
- package/dist/components/Token/icons/index.d.ts +2 -0
- package/dist/components/Token/icons/index.js +8 -4
- package/dist/components/Token/icons/types.d.ts +7 -0
- package/dist/components/Token/icons/types.js +1 -0
- package/dist/components/Token/icons/usdc.d.ts +2 -2
- package/dist/components/Token/icons/usdc.js +16 -56
- package/dist/components/Token/icons/usdt.d.ts +3 -0
- package/dist/components/Token/icons/usdt.js +27 -0
- package/dist/components/Token/icons/utils.d.ts +9 -0
- package/dist/components/Token/icons/utils.js +11 -0
- package/dist/components/Token/icons/wld.d.ts +2 -2
- package/dist/components/Token/icons/wld.js +10 -41
- package/dist/components/TopBar/TopBar.d.ts +11 -0
- package/dist/components/TopBar/TopBar.js +23 -0
- package/dist/components/TopBar/index.d.ts +1 -0
- package/dist/components/TopBar/index.js +4 -0
- package/dist/components/Typography/Typography.d.ts +12 -8
- package/dist/components/Typography/Typography.js +72 -60
- package/dist/components/WalletAddressField/WalletAddressField.d.ts +23 -0
- package/dist/components/WalletAddressField/WalletAddressField.js +81 -0
- package/dist/components/WalletAddressField/index.d.ts +1 -0
- package/dist/components/WalletAddressField/index.js +4 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +91 -45
- package/dist/lib/constants/dropdownStyles.d.ts +1 -1
- package/dist/lib/constants/dropdownStyles.js +2 -2
- package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@1_tagbd57u5fsqga6qdjecsll7fm/node_modules/@radix-ui/react-collection/dist/index.js +49 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.5_@types_react-dom@18.3.5_@types_react@18.3.18__@types__nitdfoqpcbroetgllwgz3is5ai/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +131 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.4_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3._ulc3jfxcmrz2rfz7bui53djdtu/node_modules/@radix-ui/react-portal/dist/index.js +17 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.0.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18_sejcxqoscaweil2bvgwwavaoha/node_modules/@radix-ui/react-primitive/dist/index.js +35 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-progress@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18._wpsg2ubedou6txnsnvgmus4txq/node_modules/@radix-ui/react-progress/dist/index.js +86 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react_ki7uy4u3diz5446cqygvbjwuge/node_modules/@radix-ui/react-roving-focus/dist/index.js +181 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.1.2_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.js +44 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-toast@1.2.6_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3.1_mux33mveszkw5z6iia6acnivvy/node_modules/@radix-ui/react-toast/dist/index.js +448 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-toggle-group@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react_3smwloudr6a3igss4kifyxcwju/node_modules/@radix-ui/react-toggle-group/dist/index.js +137 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-toggle@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3._yiv2ptaqcv244n5f7zfldmgupm/node_modules/@radix-ui/react-toggle/dist/index.js +31 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_re_omyrydx3gc2oidaiqb4gsovieq/node_modules/@radix-ui/react-visually-hidden/dist/index.js +30 -0
- package/dist/tailwind/index.d.ts +41 -25
- package/dist/tailwind/index.js +128 -85
- package/package.json +73 -1
- package/public/fonts/TWKLausanne-350.woff +0 -0
- package/public/fonts/TWKLausanne-350Italic.woff +0 -0
- package/public/fonts/TWKLausanne-500.woff +0 -0
- package/public/fonts/TWKLausanne-500Italic.woff +0 -0
- package/public/fonts/TWKLausanne-600.woff +0 -0
- package/public/fonts/TWKLausanne-600Italic.woff +0 -0
- package/public/globals.css +1 -1
- package/public/images/marbles/marble1.png +0 -0
- package/public/images/marbles/marble2.png +0 -0
- package/public/images/marbles/marble3.svg +36 -0
- package/dist/components/Button/Spinner.js +0 -36
- package/dist/components/PhoneField/ArrowDown.js +0 -27
- package/dist/components/Select/ArrowDown.d.ts +0 -2
- package/dist/components/Select/ArrowDown.js +0 -27
- /package/dist/components/{PhoneField → Icons}/ArrowDown.d.ts +0 -0
package/README.md
CHANGED
@@ -59,29 +59,20 @@ export default tseslint.config({
|
|
59
59
|
|
60
60
|
## Font Configuration
|
61
61
|
|
62
|
-
The library uses
|
62
|
+
The library uses the following font **[TWK Lausanne](https://weltkern.com/typefaces/lausanne)** as the sans-serif font for all text `(--font-sans)`.
|
63
63
|
|
64
|
-
|
65
|
-
- **[Sora](https://fonts.google.com/specimen/Sora)** as the display font for headings and numbers `(--font-display)`
|
66
|
-
- **[DM Mono](https://fonts.google.com/specimen/DM+Mono)** as the monospace font `(--font-mono)`
|
64
|
+
> **⚠️ License Notice**: TWK Lausanne is a commercial font that requires a license. Make sure you have obtained the appropriate license from [Weltkern](https://weltkern.com/typefaces/lausanne) before using it in your project.
|
67
65
|
|
68
|
-
|
69
|
-
|
70
|
-
```html
|
71
|
-
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
72
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
73
|
-
<link
|
74
|
-
href="https://fonts.googleapis.com/css2?family=DM+Mono:ital@0;1&family=Rubik:ital,wght@0,300..900;1,300..900&family=Sora:wght@600&display=swap"
|
75
|
-
rel="stylesheet"
|
76
|
-
/>
|
77
|
-
```
|
78
|
-
|
79
|
-
Or use the following code to load the fonts via CSS:
|
66
|
+
By default, the library sets `--font-sans` to **TWK Lausanne**, but you can override this CSS variable to use any other font of your choice:
|
80
67
|
|
81
68
|
```css
|
82
|
-
|
69
|
+
:root {
|
70
|
+
--font-sans: 'Your Font Name', sans-serif;
|
71
|
+
}
|
83
72
|
```
|
84
73
|
|
74
|
+
You must import the font in your application before using it. The library does not include the font files - you need to handle the font loading yourself according to your license agreement.
|
75
|
+
|
85
76
|
## Importing Styles
|
86
77
|
|
87
78
|
To use the UI Kit components with their proper styling, you need to import the styles in your application. Add the following import statement to your application's entry point (e.g., `app/layout.tsx` for Next.js or `main.tsx` for Vite):
|
@@ -0,0 +1,94 @@
|
|
1
|
+
"use client";
|
2
|
+
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
3
|
+
import { cn as s } from "../../lib/utils.js";
|
4
|
+
import * as i from "react";
|
5
|
+
import { Drawer as t } 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 g } from "../BottomBar/BottomBar.js";
|
7
|
+
import { Button as f } from "../Button/Button.js";
|
8
|
+
import { XMark as p } from "../Icons/XMark.js";
|
9
|
+
import { Typography as m } from "../Typography/Typography.js";
|
10
|
+
import { AlertDialogContext as D, useAlertDialog as A } from "./use-alert-dialog.js";
|
11
|
+
const y = ({ dismissible: e = !0, modal: l = !0, ...a }) => /* @__PURE__ */ r(D.Provider, { value: { dismissible: e }, children: /* @__PURE__ */ r(
|
12
|
+
t.Root,
|
13
|
+
{
|
14
|
+
shouldScaleBackground: !1,
|
15
|
+
dismissible: e,
|
16
|
+
modal: l,
|
17
|
+
...a
|
18
|
+
}
|
19
|
+
) });
|
20
|
+
y.displayName = "AlertDialog";
|
21
|
+
const h = i.forwardRef((e, l) => /* @__PURE__ */ r(t.Trigger, { ref: l, ...e }));
|
22
|
+
h.displayName = "AlertDialogTrigger";
|
23
|
+
const N = t.Portal, d = i.forwardRef((e, l) => /* @__PURE__ */ r(t.Close, { ref: l, ...e }));
|
24
|
+
d.displayName = "AlertDialogClose";
|
25
|
+
const c = i.forwardRef(({ className: e, ...l }, a) => /* @__PURE__ */ r(
|
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, {}),
|
36
|
+
/* @__PURE__ */ r(
|
37
|
+
t.Content,
|
38
|
+
{
|
39
|
+
ref: o,
|
40
|
+
className: s("fixed inset-x-0 bottom-0 z-50 mt-24 h-auto", e),
|
41
|
+
...a,
|
42
|
+
children: /* @__PURE__ */ r("div", { className: "flex flex-col rounded-[1.75rem] bg-gray-0 m-3 p-8", children: l })
|
43
|
+
}
|
44
|
+
)
|
45
|
+
] }));
|
46
|
+
u.displayName = "AlertDialogContent";
|
47
|
+
const x = ({ icon: e, children: l, ...a }) => {
|
48
|
+
const { dismissible: o } = A();
|
49
|
+
return /* @__PURE__ */ n(
|
50
|
+
"div",
|
51
|
+
{
|
52
|
+
className: s(
|
53
|
+
"flex justify-between gap-4 mb-4 w-full",
|
54
|
+
e ? "items-start" : "items-center"
|
55
|
+
),
|
56
|
+
...a,
|
57
|
+
children: [
|
58
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-6", children: [
|
59
|
+
e,
|
60
|
+
l
|
61
|
+
] }),
|
62
|
+
o && /* @__PURE__ */ r("div", { className: "shrink-0", children: /* @__PURE__ */ r(d, { asChild: !0, children: /* @__PURE__ */ r(f, { variant: "tertiary", size: "icon", children: /* @__PURE__ */ r(p, {}) }) }) })
|
63
|
+
]
|
64
|
+
}
|
65
|
+
);
|
66
|
+
};
|
67
|
+
x.displayName = "AlertDialogHeader";
|
68
|
+
const v = (e) => /* @__PURE__ */ r(g, { ...e });
|
69
|
+
v.displayName = "AlertDialogFooter";
|
70
|
+
const C = i.forwardRef(({ className: e, children: l, ...a }, o) => /* @__PURE__ */ r(t.Title, { ref: o, ...a, asChild: !0, children: /* @__PURE__ */ r(m, { variant: "heading", level: 2, children: l }) }));
|
71
|
+
C.displayName = "AlertDialogTitle";
|
72
|
+
const w = i.forwardRef(({ className: e, children: l, ...a }, o) => /* @__PURE__ */ r(
|
73
|
+
t.Description,
|
74
|
+
{
|
75
|
+
ref: o,
|
76
|
+
className: s("text-gray-500 mb-8", e),
|
77
|
+
...a,
|
78
|
+
asChild: !0,
|
79
|
+
children: /* @__PURE__ */ r(m, { children: l })
|
80
|
+
}
|
81
|
+
));
|
82
|
+
w.displayName = "AlertDialogDescription";
|
83
|
+
export {
|
84
|
+
y as AlertDialog,
|
85
|
+
d as AlertDialogClose,
|
86
|
+
u as AlertDialogContent,
|
87
|
+
w as AlertDialogDescription,
|
88
|
+
v as AlertDialogFooter,
|
89
|
+
x as AlertDialogHeader,
|
90
|
+
c as AlertDialogOverlay,
|
91
|
+
N as AlertDialogPortal,
|
92
|
+
C as AlertDialogTitle,
|
93
|
+
h as AlertDialogTrigger
|
94
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './AlertDialog';
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { AlertDialog as r, AlertDialogClose as o, AlertDialogContent as t, AlertDialogDescription as i, AlertDialogFooter as a, AlertDialogHeader as g, AlertDialogOverlay as D, AlertDialogPortal as A, AlertDialogTitle as n, AlertDialogTrigger as p } from "./AlertDialog.js";
|
2
|
+
export {
|
3
|
+
r as AlertDialog,
|
4
|
+
o as AlertDialogClose,
|
5
|
+
t as AlertDialogContent,
|
6
|
+
i as AlertDialogDescription,
|
7
|
+
a as AlertDialogFooter,
|
8
|
+
g as AlertDialogHeader,
|
9
|
+
D as AlertDialogOverlay,
|
10
|
+
A as AlertDialogPortal,
|
11
|
+
n as AlertDialogTitle,
|
12
|
+
p as AlertDialogTrigger
|
13
|
+
};
|
@@ -0,0 +1,172 @@
|
|
1
|
+
import { Drawer as DrawerPrimitive } from 'vaul';
|
2
|
+
export interface WithFadeFromProps {
|
3
|
+
/**
|
4
|
+
* Array of numbers from 0 to 100 that corresponds to % of the screen a given snap point should take up.
|
5
|
+
* Should go from least visible. Example `[0.2, 0.5, 0.8]`.
|
6
|
+
* You can also use px values, which doesn't take screen height into account.
|
7
|
+
*/
|
8
|
+
snapPoints: (number | string)[];
|
9
|
+
/**
|
10
|
+
* Index of a `snapPoint` from which the overlay fade should be applied. Defaults to the last snap point.
|
11
|
+
*/
|
12
|
+
fadeFromIndex: number;
|
13
|
+
}
|
14
|
+
export interface WithoutFadeFromProps {
|
15
|
+
/**
|
16
|
+
* Array of numbers from 0 to 100 that corresponds to % of the screen a given snap point should take up.
|
17
|
+
* Should go from least visible. Example `[0.2, 0.5, 0.8]`.
|
18
|
+
* You can also use px values, which doesn't take screen height into account.
|
19
|
+
*/
|
20
|
+
snapPoints?: (number | string)[];
|
21
|
+
fadeFromIndex?: never;
|
22
|
+
}
|
23
|
+
type BaseAlertDialogProps = {
|
24
|
+
/** The active snap point */
|
25
|
+
activeSnapPoint?: number | string | null;
|
26
|
+
/** Callback when the active snap point changes */
|
27
|
+
setActiveSnapPoint?: (snapPoint: number | string | null) => void;
|
28
|
+
/** The content of the drawer */
|
29
|
+
children?: React.ReactNode;
|
30
|
+
/** Whether the drawer is open */
|
31
|
+
open?: boolean;
|
32
|
+
/**
|
33
|
+
* Number between 0 and 1 that determines when the drawer should be closed.
|
34
|
+
* Example: threshold of 0.5 would close the drawer if the user swiped for 50% of the height of the drawer or more.
|
35
|
+
* @default 0.25
|
36
|
+
*/
|
37
|
+
closeThreshold?: number;
|
38
|
+
/**
|
39
|
+
* Duration for which the drawer is not draggable after scrolling content inside of the drawer.
|
40
|
+
* @default 500ms
|
41
|
+
*/
|
42
|
+
scrollLockTimeout?: number;
|
43
|
+
/**
|
44
|
+
* When `true`, don't move the drawer upwards if there's space, but rather only change it's height so it's fully scrollable when the keyboard is open
|
45
|
+
*/
|
46
|
+
fixed?: boolean;
|
47
|
+
/**
|
48
|
+
* When `true` only allows the drawer to be dragged by the `<AlertDialog.Handle />` component.
|
49
|
+
* @default false
|
50
|
+
*/
|
51
|
+
handleOnly?: boolean;
|
52
|
+
/**
|
53
|
+
* When `false` dragging, clicking outside, pressing esc, etc. will not close the drawer.
|
54
|
+
* Use this in comination with the `open` prop, otherwise you won't be able to open/close the drawer.
|
55
|
+
* @default true
|
56
|
+
*/
|
57
|
+
dismissible?: boolean;
|
58
|
+
/**
|
59
|
+
* When `false` it allows to interact with elements outside of the drawer without closing it.
|
60
|
+
* @default true
|
61
|
+
*/
|
62
|
+
modal?: boolean;
|
63
|
+
/**
|
64
|
+
* Direction of the drawer. Can be `top` or `bottom`, `left`, `right`.
|
65
|
+
* @default 'bottom'
|
66
|
+
*/
|
67
|
+
direction?: "top" | "bottom" | "left" | "right";
|
68
|
+
/**
|
69
|
+
* Opened by default, skips initial enter animation. Still reacts to `open` state changes
|
70
|
+
* @default false
|
71
|
+
*/
|
72
|
+
defaultOpen?: boolean;
|
73
|
+
/**
|
74
|
+
* When set to `true` prevents scrolling on the document body on mount, and restores it on unmount.
|
75
|
+
* @default false
|
76
|
+
*/
|
77
|
+
disablePreventScroll?: boolean;
|
78
|
+
/**
|
79
|
+
* When `true` Vaul will reposition inputs rather than scroll then into view if the keyboard is in the way.
|
80
|
+
* Setting it to `false` will fall back to the default browser behavior.
|
81
|
+
* @default true when {@link snapPoints} is defined
|
82
|
+
*/
|
83
|
+
repositionInputs?: boolean;
|
84
|
+
/**
|
85
|
+
* Disabled velocity based swiping for snap points.
|
86
|
+
* This means that a snap point won't be skipped even if the velocity is high enough.
|
87
|
+
* Useful if each snap point in a drawer is equally important.
|
88
|
+
* @default false
|
89
|
+
*/
|
90
|
+
snapToSequentialPoint?: boolean;
|
91
|
+
/** The container element to render the drawer into */
|
92
|
+
container?: HTMLElement | null;
|
93
|
+
/** Whether to prevent scroll restoration */
|
94
|
+
preventScrollRestoration?: boolean;
|
95
|
+
/** Whether to auto focus the drawer when opened */
|
96
|
+
autoFocus?: boolean;
|
97
|
+
/** Callback when the open state changes */
|
98
|
+
onOpenChange?: (open: boolean) => void;
|
99
|
+
/** Callback when dragging */
|
100
|
+
onDrag?: (event: React.PointerEvent<HTMLDivElement>, percentageDragged: number) => void;
|
101
|
+
/** Callback when releasing */
|
102
|
+
onRelease?: (event: React.PointerEvent<HTMLDivElement>, open: boolean) => void;
|
103
|
+
/** Callback when closing */
|
104
|
+
onClose?: () => void;
|
105
|
+
/**
|
106
|
+
* Gets triggered after the open or close animation ends, it receives an `open` argument with the `open` state of the drawer by the time the function was triggered.
|
107
|
+
* Useful to revert any state changes for example.
|
108
|
+
*/
|
109
|
+
onAnimationEnd?: (open: boolean) => void;
|
110
|
+
};
|
111
|
+
/**
|
112
|
+
* Props for the main AlertDialog component
|
113
|
+
*/
|
114
|
+
export type AlertDialogProps = BaseAlertDialogProps & (WithFadeFromProps | WithoutFadeFromProps);
|
115
|
+
/**
|
116
|
+
* Props for the AlertDialogContent component
|
117
|
+
*/
|
118
|
+
export interface AlertDialogContentProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> {
|
119
|
+
/** The content of the drawer */
|
120
|
+
children?: React.ReactNode;
|
121
|
+
/** Additional CSS classes to apply */
|
122
|
+
className?: string;
|
123
|
+
/** Whether to render the trigger without default styling */
|
124
|
+
asChild?: boolean;
|
125
|
+
/** Whether to close the drawer when clicking outside */
|
126
|
+
onCloseAutoFocus?: (event: Event) => void;
|
127
|
+
/** Called when the escape key is pressed */
|
128
|
+
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
129
|
+
/** Called when pointer down occurs outside drawer */
|
130
|
+
onPointerDownOutside?: (event: Event) => void;
|
131
|
+
/** Called when drawer starts to close */
|
132
|
+
onInteractOutside?: (event: Event) => void;
|
133
|
+
}
|
134
|
+
/**
|
135
|
+
* Props for the AlertDialogHeader component
|
136
|
+
*/
|
137
|
+
export interface AlertDialogHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "className"> {
|
138
|
+
/** Optional icon to display in the header */
|
139
|
+
icon?: React.ReactNode;
|
140
|
+
children?: React.ReactNode;
|
141
|
+
}
|
142
|
+
/**
|
143
|
+
* Props for the AlertDialogTitle component
|
144
|
+
*/
|
145
|
+
export interface AlertDialogTitleProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title> {
|
146
|
+
children?: React.ReactNode;
|
147
|
+
/** Whether to render the title without default styling */
|
148
|
+
asChild?: boolean;
|
149
|
+
}
|
150
|
+
/**
|
151
|
+
* Props for the AlertDialogDescription component
|
152
|
+
*/
|
153
|
+
export interface AlertDialogDescriptionProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description> {
|
154
|
+
children?: React.ReactNode;
|
155
|
+
/** Whether to render the description without default styling */
|
156
|
+
asChild?: boolean;
|
157
|
+
}
|
158
|
+
/**
|
159
|
+
* Props for the AlertDialogTrigger component
|
160
|
+
*/
|
161
|
+
export interface AlertDialogTriggerProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Trigger> {
|
162
|
+
/** Whether to render the trigger without default styling */
|
163
|
+
asChild?: boolean;
|
164
|
+
}
|
165
|
+
/**
|
166
|
+
* Props for the AlertDialogTrigger component
|
167
|
+
*/
|
168
|
+
export interface AlertDialogCloseProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close> {
|
169
|
+
/** Whether to render the trigger without default styling */
|
170
|
+
asChild?: boolean;
|
171
|
+
}
|
172
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1,6 @@
|
|
1
|
+
interface AlertDialogContextValue {
|
2
|
+
dismissible?: boolean;
|
3
|
+
}
|
4
|
+
declare const AlertDialogContext: import('react').Context<AlertDialogContextValue | undefined>;
|
5
|
+
declare const useAlertDialog: () => AlertDialogContextValue;
|
6
|
+
export { AlertDialogContext, useAlertDialog };
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { createContext as e, useContext as o } from "react";
|
2
|
+
const r = e(void 0), i = () => {
|
3
|
+
const t = o(r);
|
4
|
+
if (t === void 0)
|
5
|
+
throw new Error("useAlertDialog must be used within an AlertDialog");
|
6
|
+
return t;
|
7
|
+
};
|
8
|
+
export {
|
9
|
+
r as AlertDialogContext,
|
10
|
+
i as useAlertDialog
|
11
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
2
|
+
declare const bottomBarVariants: (props?: ({
|
3
|
+
direction?: "horizontal" | "vertical" | null | undefined;
|
4
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
5
|
+
export interface BottomBarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "className">, VariantProps<typeof bottomBarVariants> {
|
6
|
+
/**
|
7
|
+
* The direction of the bottom bar
|
8
|
+
* @default "horizontal"
|
9
|
+
*/
|
10
|
+
direction?: "horizontal" | "vertical";
|
11
|
+
}
|
12
|
+
export declare const BottomBar: import('react').ForwardRefExoticComponent<BottomBarProps & import('react').RefAttributes<HTMLDivElement>>;
|
13
|
+
export {};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use client";
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
3
|
+
import { cva as e } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
4
|
+
import { forwardRef as l } from "react";
|
5
|
+
const s = e("w-full gap-4", {
|
6
|
+
variants: {
|
7
|
+
direction: {
|
8
|
+
horizontal: "grid grid-cols-1 [&>*]:col-span-1 [&:has(>*:nth-child(2))]:grid-cols-2",
|
9
|
+
vertical: "flex flex-col-reverse"
|
10
|
+
}
|
11
|
+
},
|
12
|
+
defaultVariants: {
|
13
|
+
direction: "horizontal"
|
14
|
+
}
|
15
|
+
}), c = l(
|
16
|
+
({ children: r, direction: o, ...t }, a) => /* @__PURE__ */ i("div", { ref: a, className: s({ direction: o }), ...t, children: r })
|
17
|
+
);
|
18
|
+
c.displayName = "BottomBar";
|
19
|
+
export {
|
20
|
+
c as BottomBar
|
21
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './BottomBar';
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { ComponentProps, ReactElement } from 'react';
|
2
|
+
import { BulletListItemProps } from '../BulletListItem/BulletListItem';
|
3
|
+
export interface BulletListProps extends ComponentProps<"div"> {
|
4
|
+
/**
|
5
|
+
* Children should be BulletListItem components, but any ReactNode is accepted for compatibility
|
6
|
+
*/
|
7
|
+
children: ReactElement<BulletListItemProps>[] | ReactElement<BulletListItemProps>;
|
8
|
+
}
|
9
|
+
export declare const BulletList: import('react').ForwardRefExoticComponent<Omit<BulletListProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
10
|
+
export default BulletList;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
2
|
+
import { cn as s } from "../../lib/utils.js";
|
3
|
+
import { forwardRef as i } from "react";
|
4
|
+
const m = i(
|
5
|
+
({ children: t, className: r, ...o }, a) => /* @__PURE__ */ e("div", { ref: a, className: s("grid gap-y-5 content-start", r), ...o, children: t })
|
6
|
+
);
|
7
|
+
m.displayName = "BulletList";
|
8
|
+
export {
|
9
|
+
m as BulletList,
|
10
|
+
m as default
|
11
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './BulletList';
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
2
|
+
export interface BulletListItemProps extends ComponentProps<"div"> {
|
3
|
+
children?: ReactNode;
|
4
|
+
bulletPoint: ReactNode;
|
5
|
+
}
|
6
|
+
export declare const BulletListItem: import('react').ForwardRefExoticComponent<Omit<BulletListItemProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
7
|
+
export default BulletListItem;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { jsxs as s, jsx as a } from "react/jsx-runtime";
|
2
|
+
import { cn as i } from "../../lib/utils.js";
|
3
|
+
import { forwardRef as l } from "react";
|
4
|
+
import { Typography as p } from "../Typography/Typography.js";
|
5
|
+
const f = l(
|
6
|
+
({ children: r, className: t, bulletPoint: e, ...m }, o) => /* @__PURE__ */ s(
|
7
|
+
"div",
|
8
|
+
{
|
9
|
+
ref: o,
|
10
|
+
className: i("grid grid-cols-[auto_1fr] gap-x-3 items-center", t),
|
11
|
+
...m,
|
12
|
+
children: [
|
13
|
+
e,
|
14
|
+
/* @__PURE__ */ a(p, { className: "text-gray-500", children: r })
|
15
|
+
]
|
16
|
+
}
|
17
|
+
)
|
18
|
+
);
|
19
|
+
f.displayName = "BulletListItem";
|
20
|
+
export {
|
21
|
+
f as BulletListItem,
|
22
|
+
f as default
|
23
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './BulletListItem';
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
2
|
+
export interface BulletProps extends ComponentProps<"div"> {
|
3
|
+
children?: ReactNode;
|
4
|
+
}
|
5
|
+
declare const BulletPoint: import('react').ForwardRefExoticComponent<Omit<BulletProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
6
|
+
export default BulletPoint;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
2
|
+
import { cn as a } from "../../lib/utils.js";
|
3
|
+
import { forwardRef as i } from "react";
|
4
|
+
const m = i(({ children: e, ...t }, r) => {
|
5
|
+
const { className: o, ...s } = t;
|
6
|
+
return /* @__PURE__ */ l(
|
7
|
+
"div",
|
8
|
+
{
|
9
|
+
ref: r,
|
10
|
+
className: a(
|
11
|
+
"size-9 flex justify-center items-center rounded-full bg-gray-900",
|
12
|
+
o
|
13
|
+
),
|
14
|
+
...s,
|
15
|
+
children: e
|
16
|
+
}
|
17
|
+
);
|
18
|
+
});
|
19
|
+
m.displayName = "BulletPoint";
|
20
|
+
export {
|
21
|
+
m as default
|
22
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './BulletPoint';
|
@@ -0,0 +1 @@
|
|
1
|
+
import "./BulletPoint.js";
|
@@ -1,39 +1,27 @@
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
2
2
|
import { ButtonHTMLAttributes } from 'react';
|
3
3
|
declare const buttonVariants: (props?: ({
|
4
|
-
variant?: "primary" | "secondary" | "tertiary" |
|
5
|
-
size?: "sm" | "
|
6
|
-
|
7
|
-
isLoading?: boolean | null | undefined;
|
4
|
+
variant?: "primary" | "secondary" | "tertiary" | null | undefined;
|
5
|
+
size?: "sm" | "lg" | "icon" | null | undefined;
|
6
|
+
stateful?: boolean | null | undefined;
|
8
7
|
fullWidth?: boolean | null | undefined;
|
9
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
10
|
-
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
9
|
+
export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "className">, VariantProps<typeof buttonVariants> {
|
11
10
|
/**
|
12
11
|
* The variant style to use
|
13
12
|
* @default "primary"
|
14
13
|
*/
|
15
|
-
variant?: "primary" | "secondary" | "tertiary"
|
14
|
+
variant?: "primary" | "secondary" | "tertiary";
|
16
15
|
/**
|
17
16
|
* The size of the button
|
18
|
-
* @default "
|
17
|
+
* @default "lg"
|
19
18
|
*/
|
20
|
-
size?: "sm" | "
|
19
|
+
size?: "sm" | "lg" | "icon";
|
21
20
|
/**
|
22
|
-
* The
|
23
|
-
* @default
|
21
|
+
* The state of the button
|
22
|
+
* @default undefined
|
24
23
|
*/
|
25
|
-
|
26
|
-
/**
|
27
|
-
* Whether the button is in a loading state
|
28
|
-
* @default false
|
29
|
-
*/
|
30
|
-
isLoading?: boolean;
|
31
|
-
/**
|
32
|
-
* Optional icon to display in the button.
|
33
|
-
* The component passed to this prop must accept a `style` prop.
|
34
|
-
* The component should use currentColor to match the Input's styling.
|
35
|
-
*/
|
36
|
-
icon?: React.ReactNode;
|
24
|
+
state?: "pending" | "success" | "failed";
|
37
25
|
/**
|
38
26
|
* Whether the button should take up the full width of its container
|
39
27
|
* @default false
|