@cfx-dev/ui-components 0.0.5
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 +21 -0
- package/README.md +17 -0
- package/dist/Button.module-Z6njvP9Z.js +17 -0
- package/dist/Combination-AG9vHdSx.js +1478 -0
- package/dist/Icons-B26SczGZ.js +162 -0
- package/dist/Rail-DoYzqKk4.js +89 -0
- package/dist/assets/Avatar.css +1 -0
- package/dist/assets/Badge.css +1 -0
- package/dist/assets/Box.css +1 -0
- package/dist/assets/Button.css +1 -0
- package/dist/assets/Center.css +1 -0
- package/dist/assets/Checkbox.css +1 -0
- package/dist/assets/ControlBox.css +1 -0
- package/dist/assets/CountryFlag.css +1 -0
- package/dist/assets/Decorate.css +1 -0
- package/dist/assets/Dot.css +1 -0
- package/dist/assets/Flex.css +1 -0
- package/dist/assets/FlexRestricter.css +1 -0
- package/dist/assets/Flyout.css +1 -0
- package/dist/assets/Icon.css +1 -0
- package/dist/assets/Indicator.css +1 -0
- package/dist/assets/InfoPanel.css +1 -0
- package/dist/assets/Input.css +1 -0
- package/dist/assets/Interactive.css +1 -0
- package/dist/assets/Island.css +1 -0
- package/dist/assets/Loaf.css +1 -0
- package/dist/assets/Modal.css +1 -0
- package/dist/assets/NavList.css +1 -0
- package/dist/assets/Overlay.css +1 -0
- package/dist/assets/Pad.css +1 -0
- package/dist/assets/Page.css +1 -0
- package/dist/assets/Popover.css +1 -0
- package/dist/assets/PremiumBadge.css +1 -0
- package/dist/assets/Prose.css +1 -0
- package/dist/assets/Radio.css +1 -0
- package/dist/assets/Rail.css +1 -0
- package/dist/assets/RichInput.css +1 -0
- package/dist/assets/Select.css +1 -0
- package/dist/assets/Separator.css +1 -0
- package/dist/assets/Shroud.css +1 -0
- package/dist/assets/Spacer.css +1 -0
- package/dist/assets/Switch.css +1 -0
- package/dist/assets/Tabular.css +1 -0
- package/dist/assets/Text.css +1 -0
- package/dist/assets/Textarea.css +1 -0
- package/dist/assets/Title.css +1 -0
- package/dist/assets/global.css +1 -0
- package/dist/assets/themes.css +1 -0
- package/dist/components/Avatar/Avatar.d.ts +8 -0
- package/dist/components/Avatar/Avatar.js +22 -0
- package/dist/components/BackdropPortal/BackdropPortal.d.ts +6 -0
- package/dist/components/BackdropPortal/BackdropPortal.js +11 -0
- package/dist/components/Badge/Badge.d.ts +9 -0
- package/dist/components/Badge/Badge.js +18 -0
- package/dist/components/Button/Button.d.ts +22 -0
- package/dist/components/Button/Button.js +56 -0
- package/dist/components/Button/ButtonBar.d.ts +6 -0
- package/dist/components/Button/ButtonBar.js +13 -0
- package/dist/components/Checkbox/Checkbox.d.ts +12 -0
- package/dist/components/Checkbox/Checkbox.js +42 -0
- package/dist/components/ControlBox/ControlBox.d.ts +9 -0
- package/dist/components/ControlBox/ControlBox.js +19 -0
- package/dist/components/CountryFlag/CountryFlag.d.ts +9 -0
- package/dist/components/CountryFlag/CountryFlag.js +21 -0
- package/dist/components/Decorate/Decorate.d.ts +9 -0
- package/dist/components/Decorate/Decorate.js +20 -0
- package/dist/components/Dot/Dot.d.ts +6 -0
- package/dist/components/Dot/Dot.js +14 -0
- package/dist/components/Flyout/Flyout.d.ts +17 -0
- package/dist/components/Flyout/Flyout.js +60 -0
- package/dist/components/Icon/Icon.d.ts +11 -0
- package/dist/components/Icon/Icon.js +24 -0
- package/dist/components/Icons.d.ts +38 -0
- package/dist/components/Icons.js +6 -0
- package/dist/components/Indicator/Indicator.d.ts +6 -0
- package/dist/components/Indicator/Indicator.js +19 -0
- package/dist/components/InfoPanel/InfoPanel.d.ts +13 -0
- package/dist/components/InfoPanel/InfoPanel.js +34 -0
- package/dist/components/Input/Input.d.ts +37 -0
- package/dist/components/Input/Input.js +96 -0
- package/dist/components/Input/RichInput.d.ts +18 -0
- package/dist/components/Input/RichInput.js +63 -0
- package/dist/components/Interactive/Interactive.d.ts +6 -0
- package/dist/components/Interactive/Interactive.js +18 -0
- package/dist/components/Island/Island.d.ts +26 -0
- package/dist/components/Island/Island.js +34 -0
- package/dist/components/Layout/Box/Box.d.ts +21 -0
- package/dist/components/Layout/Box/Box.js +38 -0
- package/dist/components/Layout/Center/Center.d.ts +9 -0
- package/dist/components/Layout/Center/Center.js +22 -0
- package/dist/components/Layout/Flex/Flex.d.ts +26 -0
- package/dist/components/Layout/Flex/Flex.js +75 -0
- package/dist/components/Layout/Flex/FlexRestricter.d.ts +12 -0
- package/dist/components/Layout/Flex/FlexRestricter.js +20 -0
- package/dist/components/Layout/Pad/Pad.d.ts +15 -0
- package/dist/components/Layout/Pad/Pad.js +36 -0
- package/dist/components/Layout/Page/Page.d.ts +8 -0
- package/dist/components/Layout/Page/Page.js +21 -0
- package/dist/components/Layout/Scrollable/Rail.d.ts +13 -0
- package/dist/components/Layout/Scrollable/Rail.js +10 -0
- package/dist/components/Layout/Scrollable/Scrollable.d.ts +14 -0
- package/dist/components/Layout/Scrollable/Scrollable.js +89 -0
- package/dist/components/Layout/Scrollable/VirtualScrollable.d.ts +11 -0
- package/dist/components/Layout/Scrollable/VirtualScrollable.js +426 -0
- package/dist/components/Loaf/Loaf.d.ts +12 -0
- package/dist/components/Loaf/Loaf.js +27 -0
- package/dist/components/Modal/Modal.d.ts +18 -0
- package/dist/components/Modal/Modal.js +42 -0
- package/dist/components/NavList/NavList.d.ts +14 -0
- package/dist/components/NavList/NavList.js +33 -0
- package/dist/components/OnScreenSensor.d.ts +5 -0
- package/dist/components/OnScreenSensor.js +26 -0
- package/dist/components/Overlay/Overlay.d.ts +20 -0
- package/dist/components/Overlay/Overlay.js +28 -0
- package/dist/components/Popover/Popover.d.ts +12 -0
- package/dist/components/Popover/Popover.js +40 -0
- package/dist/components/PremiumBadge/PremiumBadge.d.ts +15 -0
- package/dist/components/PremiumBadge/PremiumBadge.js +38 -0
- package/dist/components/Prose/Prose.d.ts +6 -0
- package/dist/components/Prose/Prose.js +12 -0
- package/dist/components/Radio/Radio.d.ts +12 -0
- package/dist/components/Radio/Radio.js +45 -0
- package/dist/components/Select/Select.d.ts +16 -0
- package/dist/components/Select/Select.js +3293 -0
- package/dist/components/Separator/Separator.d.ts +8 -0
- package/dist/components/Separator/Separator.js +29 -0
- package/dist/components/Shroud/Shroud.d.ts +6 -0
- package/dist/components/Shroud/Shroud.js +41 -0
- package/dist/components/Spacer/Spacer.d.ts +5 -0
- package/dist/components/Spacer/Spacer.js +26 -0
- package/dist/components/Style/Style.d.ts +12 -0
- package/dist/components/Style/Style.js +23 -0
- package/dist/components/Switch/Switch.d.ts +17 -0
- package/dist/components/Switch/Switch.js +65 -0
- package/dist/components/Symbols.d.ts +5 -0
- package/dist/components/Symbols.js +7 -0
- package/dist/components/Tabular/Tabular.d.ts +30 -0
- package/dist/components/Tabular/Tabular.js +64 -0
- package/dist/components/Text/Text.d.ts +8 -0
- package/dist/components/Text/Text.js +61 -0
- package/dist/components/Text/Text.types.d.ts +33 -0
- package/dist/components/Text/Text.types.js +1 -0
- package/dist/components/Textarea/Textarea.d.ts +15 -0
- package/dist/components/Textarea/Textarea.js +57 -0
- package/dist/components/Title/Title.d.ts +13 -0
- package/dist/components/Title/Title.js +113 -0
- package/dist/components/outlets.d.ts +10 -0
- package/dist/components/outlets.js +7 -0
- package/dist/components/ui.d.ts +28 -0
- package/dist/components/ui.js +29 -0
- package/dist/functional-C0pE183N.js +30 -0
- package/dist/hooks-Bv1kQUpO.js +65 -0
- package/dist/index-C75OpfGQ.js +19577 -0
- package/dist/links-CgOD-Vfj.js +1142 -0
- package/dist/main.d.ts +68 -0
- package/dist/main.js +118 -0
- package/dist/math-i2ceybzU.js +16 -0
- package/dist/medium-Dc7QRuE0.js +118 -0
- package/dist/outlet-C4wpavcH.js +25 -0
- package/dist/outlets-BsMV5obW.js +13 -0
- package/dist/string-NVxCUbqk.js +54 -0
- package/dist/styles-scss/_colors.scss +211 -0
- package/dist/styles-scss/_ui.scss +195 -0
- package/dist/styles-scss/global.scss +71 -0
- package/dist/styles-scss/themes/dark.scss +24 -0
- package/dist/styles-scss/themes/light.scss +54 -0
- package/dist/styles-scss/themes.scss +2 -0
- package/dist/styles-scss/tokens.scss +274 -0
- package/dist/tslib.es6-Dd_EkEfR.js +48 -0
- package/dist/utils/clsx.d.ts +7 -0
- package/dist/utils/clsx.js +14 -0
- package/dist/utils/functional.d.ts +5 -0
- package/dist/utils/functional.js +8 -0
- package/dist/utils/getValue.d.ts +2 -0
- package/dist/utils/getValue.js +6 -0
- package/dist/utils/hooks.d.ts +13 -0
- package/dist/utils/hooks.js +9 -0
- package/dist/utils/links.d.ts +27 -0
- package/dist/utils/links.js +14 -0
- package/dist/utils/math.d.ts +2 -0
- package/dist/utils/math.js +5 -0
- package/dist/utils/mergeRefs.d.ts +3 -0
- package/dist/utils/mergeRefs.js +10 -0
- package/dist/utils/outlet.d.ts +4 -0
- package/dist/utils/outlet.js +6 -0
- package/dist/utils/string.d.ts +6 -0
- package/dist/utils/string.js +9 -0
- package/package.json +82 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adopted from MIT-licensed https://github.com/lukeed/clsx/blob/08a5a7f3f61fd05036c8599e4c4a4e5cdef43d7a/src/index.js
|
|
3
|
+
*/
|
|
4
|
+
type TPrim = string | number | boolean | void | undefined | null;
|
|
5
|
+
type TVal = TPrim | Record<string, TPrim> | Array<TPrim>;
|
|
6
|
+
export declare function clsx(...args: TVal[]): string;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function o(r) {
|
|
2
|
+
if (!r)
|
|
3
|
+
return "";
|
|
4
|
+
if (typeof r == "string" || typeof r == "number")
|
|
5
|
+
return r.toString();
|
|
6
|
+
const t = [];
|
|
7
|
+
return typeof r == "object" && (Array.isArray(r) ? r.forEach((e) => t.push(o(e))) : Object.values(r).forEach((e) => t.push(o(e)))), t.filter(Boolean).join(" ");
|
|
8
|
+
}
|
|
9
|
+
function n(...r) {
|
|
10
|
+
return [...r].map((t) => o(t)).filter(Boolean).join(" ");
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
n as clsx
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare function useInstance<T, Args extends any[]>(init: (...args: Args) => T, ...args: Args): T;
|
|
4
|
+
export declare function useDynamicRef<T>(value: T): React.MutableRefObject<T>;
|
|
5
|
+
export declare function useGlobalKeyboardEvent<T extends (event: KeyboardEvent) => void>(callbackRef: React.MutableRefObject<T>, eventName?: 'keydown' | 'keyup' | 'keypress', capturing?: boolean): void;
|
|
6
|
+
export declare namespace useGlobalKeyboardEvent {
|
|
7
|
+
var shouldProcessEvent: (event: KeyboardEvent) => boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function useKeyboardClose<T extends () => void>(callback: T): void;
|
|
10
|
+
export declare namespace useKeyboardClose {
|
|
11
|
+
var isCloseEvent: (event: KeyboardEvent) => boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function useWindowResize<T extends () => void>(callback: T): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare function isExternalUrl(url: string): boolean;
|
|
4
|
+
export interface ILinkSubstitute {
|
|
5
|
+
indices: [number, number];
|
|
6
|
+
url: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ILinkMatch {
|
|
9
|
+
key: string;
|
|
10
|
+
text: string;
|
|
11
|
+
url: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function matchLinks(text: string): ILinkSubstitute[];
|
|
14
|
+
export declare function matchLinkNodes(text: string): Generator<string | {
|
|
15
|
+
key: string;
|
|
16
|
+
text: string;
|
|
17
|
+
url: string;
|
|
18
|
+
}, void, unknown>;
|
|
19
|
+
export declare function defaultLinkReplacerx(key: string, text: string, url: string): React.ReactNode;
|
|
20
|
+
export declare function defaultLinkReplacer(text: string, url: string): string;
|
|
21
|
+
export declare function linkifyx(text: string, replacer?: typeof defaultLinkReplacerx): React.ReactNode;
|
|
22
|
+
export declare function linkify(text: string, replacer?: typeof defaultLinkReplacer): string;
|
|
23
|
+
export interface LinkifyProps {
|
|
24
|
+
text: string;
|
|
25
|
+
replacer?: typeof defaultLinkReplacerx;
|
|
26
|
+
}
|
|
27
|
+
export declare function Linkify(props: LinkifyProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import { L as t, b as l, d as n, i as k, e as m, c as f, a as o, m as p } from "../links-CgOD-Vfj.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "../string-NVxCUbqk.js";
|
|
5
|
+
export {
|
|
6
|
+
t as Linkify,
|
|
7
|
+
l as defaultLinkReplacer,
|
|
8
|
+
n as defaultLinkReplacerx,
|
|
9
|
+
k as isExternalUrl,
|
|
10
|
+
m as linkify,
|
|
11
|
+
f as linkifyx,
|
|
12
|
+
o as matchLinkNodes,
|
|
13
|
+
p as matchLinks
|
|
14
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function unicodeCharAt(string: string, index: number): string;
|
|
2
|
+
export declare function splitByIndices(text: string, indices: number[], unicodeIndices?: boolean): Map<number, string>;
|
|
3
|
+
export declare function replaceRange(str: string, replacement: string, start: number, end: number): string;
|
|
4
|
+
export declare function normalizeSlashes(str: string): string;
|
|
5
|
+
export declare function isTrueString(str: string): boolean;
|
|
6
|
+
export declare function isFalseString(str: string): boolean;
|
package/package.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cfx-dev/ui-components",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.0.5",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "dist/main.js",
|
|
8
|
+
"types": "dist/main.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/**/*"
|
|
11
|
+
],
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"**/*.css"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"dev": "vite",
|
|
17
|
+
"build": "tsc --p ./tsconfig-build.json && vite build",
|
|
18
|
+
"lint": "eslint --quiet \"src/**/*{ts,tsx}\" \"lib/**/*{ts,tsx}\"",
|
|
19
|
+
"lint:fix": "eslint --fix --quiet \"src/**/*{ts,tsx}\" \"lib/**/*{ts,tsx}\"",
|
|
20
|
+
"preview": "vite preview",
|
|
21
|
+
"prepublishOnly": "yarn build",
|
|
22
|
+
"storybook": "storybook dev -p 6006",
|
|
23
|
+
"build-storybook": "storybook build"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@radix-ui/react-select": "^1.0.0",
|
|
27
|
+
"@types/react-window": "^1.8.5",
|
|
28
|
+
"autolinker": "^3.14.3",
|
|
29
|
+
"flag-icons": "^6.1.1",
|
|
30
|
+
"react": "^18.2.0",
|
|
31
|
+
"react-dom": "^18.2.0",
|
|
32
|
+
"react-focus-lock": "^2.9.1",
|
|
33
|
+
"react-icons": "^4.4.0",
|
|
34
|
+
"react-window": "^1.8.8"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@radix-ui/react-select": "^1.0.0",
|
|
38
|
+
"@types/react-window": "^1.8.5",
|
|
39
|
+
"autolinker": "^3.14.3",
|
|
40
|
+
"flag-icons": "^6.1.1",
|
|
41
|
+
"react": "^18.2.0",
|
|
42
|
+
"react-dom": "^18.2.0",
|
|
43
|
+
"react-focus-lock": "^2.9.1",
|
|
44
|
+
"react-icons": "^4.4.0",
|
|
45
|
+
"react-window": "^1.8.8"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@cfx-dev/eslint-config-ui": "^0.0.10",
|
|
49
|
+
"@chromatic-com/storybook": "1.5.0",
|
|
50
|
+
"@storybook/addon-essentials": "^8.1.5",
|
|
51
|
+
"@storybook/addon-interactions": "^8.1.5",
|
|
52
|
+
"@storybook/addon-links": "^8.1.5",
|
|
53
|
+
"@storybook/addon-onboarding": "^8.1.5",
|
|
54
|
+
"@storybook/blocks": "^8.1.5",
|
|
55
|
+
"@storybook/react": "^8.1.5",
|
|
56
|
+
"@storybook/react-vite": "^8.1.5",
|
|
57
|
+
"@storybook/test": "^8.1.5",
|
|
58
|
+
"@stylistic/eslint-plugin": "^2.1.0",
|
|
59
|
+
"@types/node": "^20.12.13",
|
|
60
|
+
"@types/react": "^18.2.66",
|
|
61
|
+
"@types/react-dom": "^18.2.22",
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
|
63
|
+
"@typescript-eslint/parser": "^7.8.0",
|
|
64
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
65
|
+
"eslint": "^8.57.0",
|
|
66
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
67
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
|
68
|
+
"eslint-plugin-import": "^2.29.1",
|
|
69
|
+
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
70
|
+
"eslint-plugin-react": "^7.34.1",
|
|
71
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
72
|
+
"eslint-plugin-storybook": "^0.8.0",
|
|
73
|
+
"glob": "^10.4.1",
|
|
74
|
+
"sass": "^1.77.4",
|
|
75
|
+
"storybook": "^8.1.5",
|
|
76
|
+
"typescript": "^5.2.2",
|
|
77
|
+
"vite": "^5.2.0",
|
|
78
|
+
"vite-plugin-dts": "^3.9.1",
|
|
79
|
+
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
80
|
+
"vite-plugin-static-copy": "^1.0.5"
|
|
81
|
+
}
|
|
82
|
+
}
|