@worldcoin/mini-apps-ui-kit-react 1.0.0-canary.21 → 1.0.0-canary.23
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 +4 -35
- package/dist/components/Button/Button.js +6 -4
- package/dist/components/Checkbox/Checkbox.js +2 -1
- package/dist/components/Chip/Chip.d.ts +1 -1
- package/dist/components/CircularState/CircularState.d.ts +8 -0
- package/dist/components/CircularState/CircularState.js +41 -0
- package/dist/components/CircularState/index.d.ts +2 -0
- package/dist/components/ClearButton/ClearButton.js +2 -0
- package/dist/components/ColorPicker/ColorPicker.js +2 -1
- package/dist/components/CountryDrawer/CountryDrawer.js +3 -1
- package/dist/components/Flag/constants.d.ts +22 -0
- package/dist/components/Flag/constants.js +234 -1
- package/dist/components/Icons/Clock.d.ts +2 -0
- package/dist/components/Icons/Clock.js +30 -0
- package/dist/components/Icons/Warning.d.ts +2 -0
- package/dist/components/Icons/Warning.js +26 -0
- package/dist/components/LiveFeedback/LiveFeedback.js +18 -0
- package/dist/components/NumberPad/Delete.js +1 -0
- package/dist/components/NumberPad/NumberPad.js +5 -3
- package/dist/components/OTPField/OTPField.js +3 -1
- package/dist/components/PasteButton/PasteButton.js +2 -0
- package/dist/components/PhoneField/GroupedCountryList.js +2 -1
- package/dist/components/PhoneField/constants.d.ts +0 -2
- package/dist/components/PhoneField/constants.js +1 -25
- package/dist/components/PhoneField/utils.js +4 -4
- package/dist/components/Progress/Progress.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +2 -1
- package/dist/components/Select/Select.js +3 -2
- package/dist/components/Switch/Switch.js +2 -1
- package/dist/components/Tabs/Tabs.js +3 -1
- package/dist/components/Toast/use-toast.d.ts +2 -10
- package/dist/components/Toast/use-toast.js +9 -2
- package/dist/components/ToggleGroup/ToggleGroup.js +10 -1
- package/dist/components/Token/icons/doge.d.ts +3 -0
- package/dist/components/Token/icons/doge.js +29 -0
- package/dist/components/Token/icons/index.d.ts +5 -0
- package/dist/components/Token/icons/index.js +11 -1
- package/dist/components/Token/icons/link.d.ts +3 -0
- package/dist/components/Token/icons/link.js +27 -0
- package/dist/components/Token/icons/sol.d.ts +3 -0
- package/dist/components/Token/icons/sol.js +93 -0
- package/dist/components/Token/icons/sui.d.ts +3 -0
- package/dist/components/Token/icons/sui.js +29 -0
- package/dist/components/Token/icons/xrp.d.ts +3 -0
- package/dist/components/Token/icons/xrp.js +34 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/lib/haptics.d.ts +28 -0
- package/dist/lib/haptics.js +45 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.2_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.js +35 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.0.3_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18_ecf5vqfgocrxupsewlhf3pl374/node_modules/@radix-ui/react-primitive/dist/index.js +38 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.0_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.js +88 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.1.3_@types_react-dom@18.3.5_@types_react@18.3.18__@types_re_cidkwodbmpmiwtvvmizcw56fem/node_modules/@radix-ui/react-visually-hidden/dist/index.js +33 -0
- package/package.json +19 -13
- package/public/flags/EU.svg +49 -49
- package/public/globals.css +2 -2
- package/dist/node_modules/.pnpm/countries-list@3.1.1/node_modules/countries-list/mjs/index.js +0 -10
@@ -1,4 +1,5 @@
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
2
|
+
import haptics from "../../lib/haptics.js";
|
2
3
|
import * as React from "react";
|
3
4
|
import { cn } from "../../lib/utils.js";
|
4
5
|
import { MagicWand } from "../Icons/MagicWand.js";
|
@@ -11,6 +12,7 @@ const PasteButton = React.forwardRef(
|
|
11
12
|
const text = await navigator.clipboard.readText();
|
12
13
|
inputRef.current.value = text;
|
13
14
|
onPaste == null ? void 0 : onPaste(text);
|
15
|
+
haptics.impact("light");
|
14
16
|
}
|
15
17
|
} catch (error) {
|
16
18
|
console.error("Failed to read clipboard:", error);
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
2
|
+
import { withHaptics } from "../../lib/haptics.js";
|
2
3
|
import { Magnifier } from "../Icons/Magnifier.js";
|
3
4
|
import CountryListItem from "./CountryListItem.js";
|
4
5
|
import { Typography } from "../Typography/Typography.js";
|
@@ -21,7 +22,7 @@ function GroupedCountryList({
|
|
21
22
|
{
|
22
23
|
countryCode: country.countryCode,
|
23
24
|
countryName: country.name,
|
24
|
-
onClick: onSelect,
|
25
|
+
onClick: withHaptics(onSelect),
|
25
26
|
isSelected: value === country.countryCode
|
26
27
|
}
|
27
28
|
) }, country.countryCode)),
|
@@ -1,28 +1,4 @@
|
|
1
|
-
import { countries as a } from "../../node_modules/.pnpm/countries-list@3.1.1/node_modules/countries-list/mjs/index.js";
|
2
|
-
import { defaultCountries as R, parseCountry as M } from "../../node_modules/.pnpm/react-international-phone@4.4.0_react@18.3.1/node_modules/react-international-phone/dist/index.js";
|
3
|
-
import { countryCodes } from "../Flag/constants.js";
|
4
|
-
const supportedCountryCodesSet = new Set(
|
5
|
-
countryCodes.map((c) => c.toLowerCase())
|
6
|
-
);
|
7
|
-
const supportedDefaultCountryCodes = R.filter(
|
8
|
-
(defaultCountry) => supportedCountryCodesSet.has(M(defaultCountry).iso2)
|
9
|
-
);
|
10
|
-
const defaultCountryCodesSet = new Set(R.map((c) => M(c).iso2));
|
11
|
-
const unsupportedCountryCodes = Array.from(supportedCountryCodesSet).filter(
|
12
|
-
(iso2) => !defaultCountryCodesSet.has(iso2)
|
13
|
-
);
|
14
|
-
const customCountries = Object.entries(a).filter(([iso2]) => unsupportedCountryCodes.includes(iso2.toLowerCase())).map(([iso2, country]) => {
|
15
|
-
const { name, phone } = country;
|
16
|
-
const dialCode = phone[0].toString();
|
17
|
-
const iso2Lower = iso2.toLowerCase();
|
18
|
-
return [name, iso2Lower, dialCode];
|
19
|
-
});
|
20
|
-
const extendedCountryDataList = [
|
21
|
-
...supportedDefaultCountryCodes,
|
22
|
-
...customCountries
|
23
|
-
].sort((a2, b) => a2[0].localeCompare(b[0]));
|
24
1
|
const DIAL_CODE_PREFIX = "+";
|
25
2
|
export {
|
26
|
-
DIAL_CODE_PREFIX
|
27
|
-
extendedCountryDataList
|
3
|
+
DIAL_CODE_PREFIX
|
28
4
|
};
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import { parseCountry as M } from "../../node_modules/.pnpm/react-international-phone@4.4.0_react@18.3.1/node_modules/react-international-phone/dist/index.js";
|
1
|
+
import { defaultCountries as R, parseCountry as M } from "../../node_modules/.pnpm/react-international-phone@4.4.0_react@18.3.1/node_modules/react-international-phone/dist/index.js";
|
2
2
|
import { isSupportedCountryCode } from "../Flag/utils.js";
|
3
|
-
import {
|
3
|
+
import { DIAL_CODE_PREFIX } from "./constants.js";
|
4
4
|
const getValidatedCountryCode = (code, defaultCountryCode) => {
|
5
5
|
const upperCaseCode = code.toUpperCase();
|
6
6
|
return isSupportedCountryCode(upperCaseCode) ? upperCaseCode : defaultCountryCode;
|
7
7
|
};
|
8
8
|
const getCountryDataListByCodes = (countryCodes) => {
|
9
9
|
if (!(countryCodes == null ? void 0 : countryCodes.length)) {
|
10
|
-
return
|
10
|
+
return R;
|
11
11
|
}
|
12
12
|
const countryCodeSet = new Set(countryCodes);
|
13
|
-
return
|
13
|
+
return R.filter((country) => {
|
14
14
|
const countryCode = M(country).iso2.toUpperCase();
|
15
15
|
return countryCodeSet.has(countryCode);
|
16
16
|
});
|
@@ -21,7 +21,7 @@ const Progress = ({ value, asChild, max, getValueLabel, className }) => {
|
|
21
21
|
children: /* @__PURE__ */ jsx(
|
22
22
|
Indicator,
|
23
23
|
{
|
24
|
-
className: "ease-[cubic-bezier(0.65, 0, 0.35, 1)] size-full bg-current transition-transform duration-
|
24
|
+
className: "ease-[cubic-bezier(0.65, 0, 0.35, 1)] size-full bg-current transition-transform duration-700",
|
25
25
|
style: { transform: `translateX(-${100 - Math.min(value, 100)}%)` }
|
26
26
|
}
|
27
27
|
)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
2
|
+
import { withHaptics } from "../../lib/haptics.js";
|
2
3
|
import { Root as Root2 } 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
4
|
import { cva } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
4
5
|
import { forwardRef } from "react";
|
@@ -27,7 +28,7 @@ const RadioGroup = forwardRef(
|
|
27
28
|
{
|
28
29
|
ref,
|
29
30
|
defaultValue,
|
30
|
-
onValueChange,
|
31
|
+
onValueChange: withHaptics(onValueChange),
|
31
32
|
className: radioGroupVariants({ orientation }),
|
32
33
|
disabled,
|
33
34
|
orientation,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use client";
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
3
3
|
import { DROPDOWN_CONTAINER_STYLES } from "../../lib/constants/dropdownStyles.js";
|
4
|
+
import { withHaptics } from "../../lib/haptics.js";
|
4
5
|
import { Root as Root2, Trigger, Value, Icon, Portal, Content as Content2, Viewport, Item, ItemText } from "../../node_modules/.pnpm/@radix-ui_react-select@2.1.4_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3._atdh45n5c7sked5b6tbwgdz7re/node_modules/@radix-ui/react-select/dist/index.js";
|
5
6
|
import { cva } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
6
7
|
import { forwardRef, useState, useEffect } from "react";
|
@@ -21,7 +22,7 @@ const selectVariants = cva(
|
|
21
22
|
{
|
22
23
|
variants: {
|
23
24
|
error: {
|
24
|
-
true: "border-error-600 focus:border-error-600 bg-gray-0"
|
25
|
+
true: "!border-error-600 !focus:border-error-600 !bg-gray-0"
|
25
26
|
},
|
26
27
|
isLabel: {
|
27
28
|
true: "pt-6 pb-2 placeholder:text-transparent",
|
@@ -76,7 +77,7 @@ const Select = forwardRef(
|
|
76
77
|
{
|
77
78
|
value,
|
78
79
|
open: isOpen,
|
79
|
-
onValueChange: onChange,
|
80
|
+
onValueChange: withHaptics(onChange),
|
80
81
|
defaultOpen,
|
81
82
|
onOpenChange: handleOpenChange,
|
82
83
|
name,
|
@@ -1,5 +1,6 @@
|
|
1
1
|
"use client";
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
3
|
+
import { withHaptics } from "../../lib/haptics.js";
|
3
4
|
import { Root, Thumb } from "../../node_modules/.pnpm/@radix-ui_react-switch@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3._udl6ccyllphugejc6sszfrese4/node_modules/@radix-ui/react-switch/dist/index.js";
|
4
5
|
import { forwardRef } from "react";
|
5
6
|
const Switch = forwardRef(
|
@@ -9,7 +10,7 @@ const Switch = forwardRef(
|
|
9
10
|
{
|
10
11
|
ref,
|
11
12
|
checked,
|
12
|
-
onCheckedChange,
|
13
|
+
onCheckedChange: withHaptics(onCheckedChange),
|
13
14
|
disabled,
|
14
15
|
className: "relative inline-flex h-6 w-10 items-center rounded-full border-2 transition-all data-[state=checked]:border-gray-900 data-[state=checked]:bg-gray-900 data-[state=unchecked]:border-gray-300 data-[state=unchecked]:bg-gray-300 disabled:cursor-not-allowed disabled:opacity-20",
|
15
16
|
...rest,
|
@@ -1,12 +1,13 @@
|
|
1
1
|
"use client";
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
3
|
+
import { withHaptics } from "../../lib/haptics.js";
|
3
4
|
import { Slot } 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";
|
4
5
|
import { Root as Root2, Item as Item2 } from "../../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";
|
5
6
|
import * as React from "react";
|
6
7
|
import { cn } from "../../lib/utils.js";
|
7
8
|
import { Typography } from "../Typography/Typography.js";
|
8
9
|
const Tabs = React.forwardRef(
|
9
|
-
({ children, className, ...props }, ref) => {
|
10
|
+
({ children, className, onValueChange, ...props }, ref) => {
|
10
11
|
return /* @__PURE__ */ jsx(
|
11
12
|
Root2,
|
12
13
|
{
|
@@ -16,6 +17,7 @@ const Tabs = React.forwardRef(
|
|
16
17
|
style: {
|
17
18
|
gridTemplateColumns: `repeat(${React.Children.count(children)}, 1fr)`
|
18
19
|
},
|
20
|
+
onValueChange: withHaptics(onValueChange),
|
19
21
|
...props,
|
20
22
|
children
|
21
23
|
}
|
@@ -34,16 +34,8 @@ declare const toast: ({ ...props }: Toast) => {
|
|
34
34
|
};
|
35
35
|
declare function useToast(): {
|
36
36
|
toast: {
|
37
|
-
success: (props: Omit<Toast, "variant">) =>
|
38
|
-
|
39
|
-
dismiss: () => void;
|
40
|
-
update: (props: ToasterToast) => void;
|
41
|
-
};
|
42
|
-
error: (props: Omit<Toast, "variant">) => {
|
43
|
-
id: string;
|
44
|
-
dismiss: () => void;
|
45
|
-
update: (props: ToasterToast) => void;
|
46
|
-
};
|
37
|
+
success: (props: Omit<Toast, "variant">) => void;
|
38
|
+
error: (props: Omit<Toast, "variant">) => void;
|
47
39
|
};
|
48
40
|
dismiss: (toastId?: string) => void;
|
49
41
|
toasts: ToasterToast[];
|
@@ -1,4 +1,5 @@
|
|
1
1
|
"use client";
|
2
|
+
import haptics from "../../lib/haptics.js";
|
2
3
|
import { useState, useEffect } from "react";
|
3
4
|
const TOAST_LIMIT = 1;
|
4
5
|
const TOAST_REMOVE_DELAY = 1e6;
|
@@ -113,8 +114,14 @@ function useToast() {
|
|
113
114
|
return {
|
114
115
|
...state,
|
115
116
|
toast: {
|
116
|
-
success: (props) =>
|
117
|
-
|
117
|
+
success: (props) => {
|
118
|
+
toast({ ...props, variant: "success" });
|
119
|
+
haptics.notification("success");
|
120
|
+
},
|
121
|
+
error: (props) => {
|
122
|
+
toast({ ...props, variant: "error" });
|
123
|
+
haptics.notification("error");
|
124
|
+
}
|
118
125
|
},
|
119
126
|
dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId })
|
120
127
|
};
|
@@ -1,9 +1,18 @@
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
2
|
+
import { withHaptics } from "../../lib/haptics.js";
|
2
3
|
import { Root as Root2, Item as Item2 } from "../../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";
|
3
4
|
import * as React from "react";
|
4
5
|
import { cn } from "../../lib/utils.js";
|
5
6
|
import { typographyVariants } from "../Typography/Typography.js";
|
6
|
-
const ToggleGroupRoot = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(
|
7
|
+
const ToggleGroupRoot = React.forwardRef(({ onValueChange, ...props }, ref) => /* @__PURE__ */ jsx(
|
8
|
+
Root2,
|
9
|
+
{
|
10
|
+
ref,
|
11
|
+
className: cn("inline-flex gap-5"),
|
12
|
+
onValueChange: withHaptics(onValueChange),
|
13
|
+
...props
|
14
|
+
}
|
15
|
+
));
|
7
16
|
ToggleGroupRoot.displayName = "ToggleGroup";
|
8
17
|
const ToggleGroupItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
9
18
|
Item2,
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
2
|
+
import { getBackgroundClass, getIconFillClass } from "./utils.js";
|
3
|
+
const DOGE = (props) => /* @__PURE__ */ jsxs(
|
4
|
+
"svg",
|
5
|
+
{
|
6
|
+
width: "88",
|
7
|
+
height: "88",
|
8
|
+
viewBox: "0 0 88 88",
|
9
|
+
fill: "none",
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
11
|
+
...props,
|
12
|
+
style: { color: "#988430" },
|
13
|
+
children: [
|
14
|
+
/* @__PURE__ */ jsx("rect", { width: "88", height: "88", rx: "44", className: getBackgroundClass(props) }),
|
15
|
+
/* @__PURE__ */ jsx(
|
16
|
+
"path",
|
17
|
+
{
|
18
|
+
fillRule: "evenodd",
|
19
|
+
clipRule: "evenodd",
|
20
|
+
d: "M63.871 34.1006C59.9176 23.8914 50.1446 22 50.1446 22H22.2619L22.3695 32.3989H27.9223V55.6198H22.2615V66H49.3728C55.9067 66 61.1444 59.4339 61.1444 59.4339C69.5318 47.5297 63.8705 34.1006 63.8705 34.1006H63.871ZM49.5183 52.4379C49.5183 52.4379 47.3917 55.506 45.0779 55.506H40.4495L40.3398 32.4244H46.2796C46.2796 32.4244 49.0317 32.9998 50.9543 38.4459C50.9543 38.4459 53.5033 46.2433 49.5183 52.4379Z",
|
21
|
+
className: getIconFillClass(props)
|
22
|
+
}
|
23
|
+
)
|
24
|
+
]
|
25
|
+
}
|
26
|
+
);
|
27
|
+
export {
|
28
|
+
DOGE as default
|
29
|
+
};
|
@@ -4,3 +4,8 @@ export { default as DAI } from './dai';
|
|
4
4
|
export { default as USDC } from './usdc';
|
5
5
|
export { default as USDT } from './usdt';
|
6
6
|
export { default as WLD } from './wld';
|
7
|
+
export { default as SOL } from './sol';
|
8
|
+
export { default as SUI } from './sui';
|
9
|
+
export { default as DOGE } from './doge';
|
10
|
+
export { default as XRP } from './xrp';
|
11
|
+
export { default as LINK } from './link';
|
@@ -4,11 +4,21 @@ import { default as default4 } from "./dai.js";
|
|
4
4
|
import { default as default5 } from "./usdc.js";
|
5
5
|
import { default as default6 } from "./usdt.js";
|
6
6
|
import { default as default7 } from "./wld.js";
|
7
|
+
import { default as default8 } from "./sol.js";
|
8
|
+
import { default as default9 } from "./sui.js";
|
9
|
+
import { default as default10 } from "./doge.js";
|
10
|
+
import { default as default11 } from "./xrp.js";
|
11
|
+
import { default as default12 } from "./link.js";
|
7
12
|
export {
|
8
13
|
default2 as BTC,
|
9
14
|
default4 as DAI,
|
15
|
+
default10 as DOGE,
|
10
16
|
default3 as ETH,
|
17
|
+
default12 as LINK,
|
18
|
+
default8 as SOL,
|
19
|
+
default9 as SUI,
|
11
20
|
default5 as USDC,
|
12
21
|
default6 as USDT,
|
13
|
-
default7 as WLD
|
22
|
+
default7 as WLD,
|
23
|
+
default11 as XRP
|
14
24
|
};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
2
|
+
import { getBackgroundClass, getIconFillClass } from "./utils.js";
|
3
|
+
const LINK = (props) => /* @__PURE__ */ jsxs(
|
4
|
+
"svg",
|
5
|
+
{
|
6
|
+
width: "88",
|
7
|
+
height: "88",
|
8
|
+
viewBox: "0 0 88 88",
|
9
|
+
fill: "none",
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
11
|
+
...props,
|
12
|
+
style: { color: "#2A5ADA" },
|
13
|
+
children: [
|
14
|
+
/* @__PURE__ */ jsx("rect", { width: "88", height: "88", rx: "44", className: getBackgroundClass(props) }),
|
15
|
+
/* @__PURE__ */ jsx(
|
16
|
+
"path",
|
17
|
+
{
|
18
|
+
d: "M44 20L39.5963 22.5321L27.5963 29.4679L23.1926 32V56L27.5963 58.5321L39.7064 65.4679L44.1101 68L48.5137 65.4679L60.4036 58.5321L64.8073 56V32L60.4036 29.4679L48.4036 22.5321L44 20ZM32 50.9358V37.0642L44 30.1284L56 37.0642V50.9358L44 57.8716L32 50.9358Z",
|
19
|
+
className: getIconFillClass(props)
|
20
|
+
}
|
21
|
+
)
|
22
|
+
]
|
23
|
+
}
|
24
|
+
);
|
25
|
+
export {
|
26
|
+
LINK as default
|
27
|
+
};
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
2
|
+
import { getBackgroundClass, getIconFillClass } from "./utils.js";
|
3
|
+
const SOL = (props) => /* @__PURE__ */ jsxs(
|
4
|
+
"svg",
|
5
|
+
{
|
6
|
+
width: "88",
|
7
|
+
height: "88",
|
8
|
+
viewBox: "0 0 88 88",
|
9
|
+
fill: "none",
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
11
|
+
...props,
|
12
|
+
children: [
|
13
|
+
/* @__PURE__ */ jsx("rect", { width: "88", height: "88", rx: "44", className: getBackgroundClass(props) }),
|
14
|
+
/* @__PURE__ */ jsxs("g", { "clip-path": "url(#clip0_2277_732)", children: [
|
15
|
+
/* @__PURE__ */ jsx(
|
16
|
+
"path",
|
17
|
+
{
|
18
|
+
d: "M27.6616 54.1925C27.9537 53.8944 28.3553 53.7205 28.7813 53.7205H67.4088C68.1146 53.7205 68.4676 54.59 67.9686 55.0993L60.338 62.888C60.0459 63.1862 59.6443 63.3601 59.2184 63.3601H20.5909C19.885 63.3601 19.5321 62.4905 20.031 61.9812L27.6616 54.1925Z",
|
19
|
+
className: props.variant !== "color" || props.disabled ? getIconFillClass(props) : void 0,
|
20
|
+
fill: props.variant === "color" ? "url(#paint0_linear_2277_732)" : void 0
|
21
|
+
}
|
22
|
+
),
|
23
|
+
/* @__PURE__ */ jsx(
|
24
|
+
"path",
|
25
|
+
{
|
26
|
+
d: "M27.6616 25.1121C27.9659 24.8139 28.3675 24.64 28.7813 24.64H67.4088C68.1146 24.64 68.4676 25.5096 67.9686 26.0189L60.338 33.8076C60.0459 34.1057 59.6443 34.2796 59.2184 34.2796H20.5909C19.885 34.2796 19.5321 33.4101 20.031 32.9008L27.6616 25.1121Z",
|
27
|
+
className: props.variant !== "color" || props.disabled ? getIconFillClass(props) : void 0,
|
28
|
+
fill: props.variant === "color" ? "url(#paint1_linear_2277_732)" : void 0
|
29
|
+
}
|
30
|
+
),
|
31
|
+
/* @__PURE__ */ jsx(
|
32
|
+
"path",
|
33
|
+
{
|
34
|
+
d: "M60.338 39.5591C60.0459 39.261 59.6443 39.0871 59.2184 39.0871H20.5909C19.885 39.0871 19.5321 39.9566 20.031 40.4659L27.6616 48.2547C27.9537 48.5528 28.3553 48.7267 28.7813 48.7267H67.4088C68.1146 48.7267 68.4676 47.8571 67.9686 47.3478L60.338 39.5591Z",
|
35
|
+
className: props.variant !== "color" || props.disabled ? getIconFillClass(props) : void 0,
|
36
|
+
fill: props.variant === "color" ? "url(#paint2_linear_2277_732)" : void 0
|
37
|
+
}
|
38
|
+
)
|
39
|
+
] }),
|
40
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
41
|
+
/* @__PURE__ */ jsxs(
|
42
|
+
"linearGradient",
|
43
|
+
{
|
44
|
+
id: "paint0_linear_2277_732",
|
45
|
+
x1: "63.7187",
|
46
|
+
y1: "19.9873",
|
47
|
+
x2: "36.1134",
|
48
|
+
y2: "71.7889",
|
49
|
+
gradientUnits: "userSpaceOnUse",
|
50
|
+
children: [
|
51
|
+
/* @__PURE__ */ jsx("stop", { "stop-color": "#00FFA3" }),
|
52
|
+
/* @__PURE__ */ jsx("stop", { offset: "1", "stop-color": "#DC1FFF" })
|
53
|
+
]
|
54
|
+
}
|
55
|
+
),
|
56
|
+
/* @__PURE__ */ jsxs(
|
57
|
+
"linearGradient",
|
58
|
+
{
|
59
|
+
id: "paint1_linear_2277_732",
|
60
|
+
x1: "52.0295",
|
61
|
+
y1: "13.758",
|
62
|
+
x2: "24.4242",
|
63
|
+
y2: "65.5596",
|
64
|
+
gradientUnits: "userSpaceOnUse",
|
65
|
+
children: [
|
66
|
+
/* @__PURE__ */ jsx("stop", { "stop-color": "#00FFA3" }),
|
67
|
+
/* @__PURE__ */ jsx("stop", { offset: "1", "stop-color": "#DC1FFF" })
|
68
|
+
]
|
69
|
+
}
|
70
|
+
),
|
71
|
+
/* @__PURE__ */ jsxs(
|
72
|
+
"linearGradient",
|
73
|
+
{
|
74
|
+
id: "paint2_linear_2277_732",
|
75
|
+
x1: "57.8369",
|
76
|
+
y1: "16.8528",
|
77
|
+
x2: "30.2316",
|
78
|
+
y2: "68.6544",
|
79
|
+
gradientUnits: "userSpaceOnUse",
|
80
|
+
children: [
|
81
|
+
/* @__PURE__ */ jsx("stop", { "stop-color": "#00FFA3" }),
|
82
|
+
/* @__PURE__ */ jsx("stop", { offset: "1", "stop-color": "#DC1FFF" })
|
83
|
+
]
|
84
|
+
}
|
85
|
+
),
|
86
|
+
/* @__PURE__ */ jsx("clipPath", { id: "clip0_2277_732", children: /* @__PURE__ */ jsx("rect", { width: "48.4", height: "38.72", fill: "white", transform: "translate(19.8 24.64)" }) })
|
87
|
+
] })
|
88
|
+
]
|
89
|
+
}
|
90
|
+
);
|
91
|
+
export {
|
92
|
+
SOL as default
|
93
|
+
};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
2
|
+
import { getBackgroundClass, getIconFillClass } from "./utils.js";
|
3
|
+
const SUI = (props) => /* @__PURE__ */ jsxs(
|
4
|
+
"svg",
|
5
|
+
{
|
6
|
+
width: "88",
|
7
|
+
height: "88",
|
8
|
+
viewBox: "0 0 88 88",
|
9
|
+
fill: "none",
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
11
|
+
...props,
|
12
|
+
style: { color: "#61BFFF" },
|
13
|
+
children: [
|
14
|
+
/* @__PURE__ */ jsx("rect", { width: "88", height: "88", rx: "44", className: getBackgroundClass(props) }),
|
15
|
+
/* @__PURE__ */ jsx(
|
16
|
+
"path",
|
17
|
+
{
|
18
|
+
fillRule: "evenodd",
|
19
|
+
clipRule: "evenodd",
|
20
|
+
d: "M55.6288 39.886C57.6422 42.4157 58.8555 45.6295 58.8555 49.1143C58.8555 52.5991 57.6164 55.9032 55.5385 58.4587L55.3578 58.6781L55.3061 58.3942C55.2674 58.1618 55.2158 57.9166 55.1642 57.6714C54.1316 53.1153 50.7501 49.2046 45.1744 46.0296C41.4186 43.9 39.2631 41.3316 38.6953 38.4146C38.3339 36.5303 38.6049 34.633 39.1212 33.0068C39.6503 31.3805 40.4247 30.0253 41.083 29.2122L43.2513 26.5663C43.6256 26.1017 44.3484 26.1017 44.7227 26.5663L55.6288 39.886ZM59.0491 37.2401L44.542 19.5064C44.2709 19.1708 43.7418 19.1708 43.4707 19.5064L28.9507 37.2401L28.8991 37.3047C26.2403 40.6217 24.6399 44.8293 24.6399 49.4111C24.6399 60.0849 33.3132 68.7453 43.9999 68.7453C54.6866 68.7453 63.3599 60.0849 63.3599 49.4111C63.3599 44.8293 61.7595 40.6217 59.0878 37.3047L59.0491 37.2401ZM32.4226 39.8344L33.7133 38.2469L33.752 38.5437C33.7778 38.776 33.8165 39.0084 33.8682 39.2407C34.7071 43.6418 37.7143 47.3202 42.7221 50.1597C47.0846 52.6378 49.6143 55.4902 50.35 58.6265C50.6597 59.9301 50.7114 61.2207 50.5823 62.3436L50.5694 62.4081L50.5049 62.434C48.543 63.3891 46.3231 63.9311 43.987 63.9311C35.7913 63.9311 29.1443 57.2971 29.1443 49.1143C29.1443 45.6037 30.3705 42.3641 32.4226 39.8344Z",
|
21
|
+
className: getIconFillClass(props)
|
22
|
+
}
|
23
|
+
)
|
24
|
+
]
|
25
|
+
}
|
26
|
+
);
|
27
|
+
export {
|
28
|
+
SUI as default
|
29
|
+
};
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
2
|
+
import { getBackgroundClass, getIconFillClass } from "./utils.js";
|
3
|
+
const XRP = (props) => /* @__PURE__ */ jsxs(
|
4
|
+
"svg",
|
5
|
+
{
|
6
|
+
width: "88",
|
7
|
+
height: "88",
|
8
|
+
viewBox: "0 0 88 88",
|
9
|
+
fill: "none",
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
11
|
+
...props,
|
12
|
+
style: { color: "#23292F" },
|
13
|
+
children: [
|
14
|
+
/* @__PURE__ */ jsx("rect", { width: "88", height: "88", rx: "44", className: getBackgroundClass(props) }),
|
15
|
+
/* @__PURE__ */ jsx(
|
16
|
+
"path",
|
17
|
+
{
|
18
|
+
d: "M60.9687 24.125H67.9062L53.4687 38.42C48.2403 43.5941 39.7634 43.5941 34.5312 38.42L20.0881 24.125H27.0312L38 34.9841C39.5981 36.5592 41.7519 37.4421 43.9958 37.4421C46.2397 37.4421 48.3934 36.5592 49.9916 34.9841L60.9687 24.125Z",
|
19
|
+
className: getIconFillClass(props)
|
20
|
+
}
|
21
|
+
),
|
22
|
+
/* @__PURE__ */ jsx(
|
23
|
+
"path",
|
24
|
+
{
|
25
|
+
d: "M26.9422 63.875H20L34.5312 49.4919C39.7597 44.3178 48.2366 44.3178 53.4688 49.4919L68 63.875H61.0625L50 52.9278C48.4019 51.3527 46.2481 50.4697 44.0042 50.4697C41.7603 50.4697 39.6066 51.3527 38.0084 52.9278L26.9422 63.875Z",
|
26
|
+
className: getIconFillClass(props)
|
27
|
+
}
|
28
|
+
)
|
29
|
+
]
|
30
|
+
}
|
31
|
+
);
|
32
|
+
export {
|
33
|
+
XRP as default
|
34
|
+
};
|
package/dist/index.d.ts
CHANGED
@@ -2,6 +2,7 @@ export { Button } from './components/Button';
|
|
2
2
|
export { Checkbox } from './components/Checkbox';
|
3
3
|
export { Chip } from './components/Chip';
|
4
4
|
export { CircularIcon } from './components/CircularIcon';
|
5
|
+
export { CircularState } from './components/CircularState';
|
5
6
|
export { ColorPickerItem, ColorPickerGroup } from './components/ColorPicker';
|
6
7
|
export { Flag } from './components/Flag';
|
7
8
|
export type { CountryCode } from './components/Flag';
|
package/dist/index.js
CHANGED
@@ -3,6 +3,7 @@ import { Button } from "./components/Button/Button.js";
|
|
3
3
|
import { Checkbox } from "./components/Checkbox/Checkbox.js";
|
4
4
|
import { Chip } from "./components/Chip/Chip.js";
|
5
5
|
import { CircularIcon } from "./components/CircularIcon/CircularIcon.js";
|
6
|
+
import { CircularState } from "./components/CircularState/CircularState.js";
|
6
7
|
import { ColorPickerGroup, ColorPickerItem } from "./components/ColorPicker/ColorPicker.js";
|
7
8
|
import { Flag } from "./components/Flag/Flag.js";
|
8
9
|
import * as Form from "./components/Form/Form.js";
|
@@ -53,6 +54,7 @@ export {
|
|
53
54
|
Checkbox,
|
54
55
|
Chip,
|
55
56
|
CircularIcon,
|
57
|
+
CircularState,
|
56
58
|
ColorPickerGroup,
|
57
59
|
ColorPickerItem,
|
58
60
|
CountryDrawer,
|
@@ -0,0 +1,28 @@
|
|
1
|
+
type NotificationType = "success" | "warning" | "error";
|
2
|
+
type ImpactStyle = "light" | "medium" | "heavy" | "soft" | "rigid";
|
3
|
+
interface HapticFeedbackParams {
|
4
|
+
hapticsType: "impact" | "notification" | "selectionChanged";
|
5
|
+
style?: ImpactStyle | NotificationType;
|
6
|
+
}
|
7
|
+
declare global {
|
8
|
+
interface Window {
|
9
|
+
MiniKit?: {
|
10
|
+
commands?: {
|
11
|
+
sendHapticFeedback?: (params: HapticFeedbackParams) => void;
|
12
|
+
};
|
13
|
+
};
|
14
|
+
}
|
15
|
+
}
|
16
|
+
declare const haptics: {
|
17
|
+
notification: (type: NotificationType) => void;
|
18
|
+
selection: () => void;
|
19
|
+
impact: (style: ImpactStyle) => void;
|
20
|
+
};
|
21
|
+
/**
|
22
|
+
* Wraps a function with haptic feedback
|
23
|
+
* @param fn The function to wrap (can be undefined)
|
24
|
+
* @param hapticFn The haptic feedback function to call (defaults to selection)
|
25
|
+
* @returns A new function that triggers haptic feedback and calls the original function if provided
|
26
|
+
*/
|
27
|
+
export declare function withHaptics<T extends (...args: any[]) => any>(fn: T | undefined, hapticFn?: () => void): T;
|
28
|
+
export default haptics;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
const sendHapticFeedback = (params) => {
|
2
|
+
var _a, _b, _c;
|
3
|
+
try {
|
4
|
+
(_c = (_b = (_a = window.MiniKit) == null ? void 0 : _a.commands) == null ? void 0 : _b.sendHapticFeedback) == null ? void 0 : _c.call(_b, params);
|
5
|
+
} catch (error) {
|
6
|
+
console.warn("Haptic feedback not supported:", error);
|
7
|
+
}
|
8
|
+
};
|
9
|
+
const haptics = {
|
10
|
+
notification: (type) => {
|
11
|
+
sendHapticFeedback({
|
12
|
+
hapticsType: "notification",
|
13
|
+
style: type
|
14
|
+
});
|
15
|
+
},
|
16
|
+
selection: () => {
|
17
|
+
sendHapticFeedback({
|
18
|
+
hapticsType: "selectionChanged"
|
19
|
+
});
|
20
|
+
},
|
21
|
+
impact: (style) => {
|
22
|
+
sendHapticFeedback({
|
23
|
+
hapticsType: "impact",
|
24
|
+
style
|
25
|
+
});
|
26
|
+
}
|
27
|
+
};
|
28
|
+
function withHaptics(fn, hapticFn = haptics.selection) {
|
29
|
+
return (...args) => {
|
30
|
+
if (!fn) {
|
31
|
+
hapticFn();
|
32
|
+
return void 0;
|
33
|
+
}
|
34
|
+
const result = fn(...args);
|
35
|
+
if (result instanceof Promise) {
|
36
|
+
return result.finally(() => hapticFn());
|
37
|
+
}
|
38
|
+
hapticFn();
|
39
|
+
return result;
|
40
|
+
};
|
41
|
+
}
|
42
|
+
export {
|
43
|
+
haptics as default,
|
44
|
+
withHaptics
|
45
|
+
};
|