@uxf/ui 1.0.0-beta.16 → 1.0.0-beta.22
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/package.json +7 -6
- package/button/button.css +0 -75
- package/button/button.d.ts +0 -15
- package/button/button.jsx +0 -17
- package/button/button.stories.d.ts +0 -10
- package/button/button.stories.jsx +0 -59
- package/button/button.stories.tsx +0 -98
- package/button/button.tsx +0 -36
- package/button/index.d.ts +0 -2
- package/button/index.js +0 -23
- package/button/index.ts +0 -2
- package/button/theme.d.ts +0 -18
- package/button/theme.js +0 -2
- package/button/theme.ts +0 -20
- package/image-gallery/components/close-button.d.ts +0 -6
- package/image-gallery/components/close-button.jsx +0 -13
- package/image-gallery/components/close-button.tsx +0 -19
- package/image-gallery/components/dot.d.ts +0 -6
- package/image-gallery/components/dot.jsx +0 -12
- package/image-gallery/components/dot.tsx +0 -17
- package/image-gallery/components/gallery.d.ts +0 -11
- package/image-gallery/components/gallery.jsx +0 -74
- package/image-gallery/components/gallery.tsx +0 -67
- package/image-gallery/components/icon-chevron-left.d.ts +0 -3
- package/image-gallery/components/icon-chevron-left.jsx +0 -12
- package/image-gallery/components/icon-chevron-left.tsx +0 -18
- package/image-gallery/components/icon-chevron-right.d.ts +0 -3
- package/image-gallery/components/icon-chevron-right.jsx +0 -12
- package/image-gallery/components/icon-chevron-right.tsx +0 -18
- package/image-gallery/components/icon-close.d.ts +0 -3
- package/image-gallery/components/icon-close.jsx +0 -12
- package/image-gallery/components/icon-close.tsx +0 -22
- package/image-gallery/components/next-button.d.ts +0 -6
- package/image-gallery/components/next-button.jsx +0 -13
- package/image-gallery/components/next-button.tsx +0 -19
- package/image-gallery/components/previous-button.d.ts +0 -6
- package/image-gallery/components/previous-button.jsx +0 -13
- package/image-gallery/components/previous-button.tsx +0 -19
- package/image-gallery/context.d.ts +0 -10
- package/image-gallery/context.jsx +0 -12
- package/image-gallery/context.tsx +0 -17
- package/image-gallery/image-gallery.d.ts +0 -6
- package/image-gallery/image-gallery.jsx +0 -58
- package/image-gallery/image-gallery.stories.d.ts +0 -13
- package/image-gallery/image-gallery.stories.jsx +0 -29
- package/image-gallery/image-gallery.stories.tsx +0 -33
- package/image-gallery/image-gallery.tsx +0 -59
- package/image-gallery/image.d.ts +0 -4
- package/image-gallery/image.jsx +0 -12
- package/image-gallery/image.tsx +0 -19
- package/image-gallery/index.d.ts +0 -3
- package/image-gallery/index.js +0 -25
- package/image-gallery/index.ts +0 -3
- package/image-gallery/types.d.ts +0 -6
- package/image-gallery/types.js +0 -2
- package/image-gallery/types.ts +0 -6
- package/image-gallery/use-image.d.ts +0 -2
- package/image-gallery/use-image.js +0 -16
- package/image-gallery/use-image.ts +0 -17
- package/input/index.d.ts +0 -13
- package/input/index.js +0 -19
- package/input/index.ts +0 -14
- package/input/input-basic.css +0 -18
- package/input/input-element.d.ts +0 -8
- package/input/input-element.jsx +0 -11
- package/input/input-element.tsx +0 -30
- package/input/input-left-addon.d.ts +0 -6
- package/input/input-left-addon.jsx +0 -10
- package/input/input-left-addon.tsx +0 -12
- package/input/input-left-element.d.ts +0 -6
- package/input/input-left-element.jsx +0 -10
- package/input/input-left-element.tsx +0 -11
- package/input/input-right-addon.d.ts +0 -6
- package/input/input-right-addon.jsx +0 -10
- package/input/input-right-addon.tsx +0 -11
- package/input/input-right-element.d.ts +0 -6
- package/input/input-right-element.jsx +0 -10
- package/input/input-right-element.tsx +0 -11
- package/input/input.css +0 -75
- package/input/input.d.ts +0 -9
- package/input/input.jsx +0 -65
- package/input/input.stories.d.ts +0 -14
- package/input/input.stories.jsx +0 -78
- package/input/input.stories.tsx +0 -79
- package/input/input.tsx +0 -70
- package/input/theme.d.ts +0 -6
- package/input/theme.js +0 -2
- package/input/theme.ts +0 -7
- package/text-input/index.d.ts +0 -1
- package/text-input/index.js +0 -17
- package/text-input/index.ts +0 -1
- package/text-input/text-input.css +0 -29
- package/text-input/text-input.d.ts +0 -22
- package/text-input/text-input.jsx +0 -32
- package/text-input/text-input.stories.d.ts +0 -9
- package/text-input/text-input.stories.jsx +0 -55
- package/text-input/text-input.stories.tsx +0 -72
- package/text-input/text-input.tsx +0 -99
- package/tsconfig.json +0 -7
- package/tsconfig.tsbuildinfo +0 -1
- package/types/form-control-props.d.ts +0 -24
- package/types/form-control-props.js +0 -2
- package/types/form-control-props.ts +0 -35
- package/types/index.d.ts +0 -1
- package/types/index.js +0 -17
- package/types/index.ts +0 -1
- package/utils/action.d.ts +0 -2
- package/utils/action.js +0 -11
- package/utils/action.ts +0 -14
- package/utils/component-structure-analyzer.css +0 -28
- package/utils/component-structure-analyzer.d.ts +0 -6
- package/utils/component-structure-analyzer.jsx +0 -10
- package/utils/component-structure-analyzer.tsx +0 -12
- package/utils/cx.d.ts +0 -3
- package/utils/cx.js +0 -54
- package/utils/cx.ts +0 -56
- package/utils/forwardRef.d.ts +0 -12
- package/utils/forwardRef.js +0 -10
- package/utils/forwardRef.ts +0 -30
- package/utils/storybook-config.d.ts +0 -18
- package/utils/storybook-config.jsx +0 -46
- package/utils/storybook-config.tsx +0 -42
package/utils/cx.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cx = void 0;
|
|
4
|
-
function toVal(mix) {
|
|
5
|
-
let k;
|
|
6
|
-
let y;
|
|
7
|
-
let str = "";
|
|
8
|
-
if (typeof mix === "string" || typeof mix === "number") {
|
|
9
|
-
str += mix;
|
|
10
|
-
}
|
|
11
|
-
else if (typeof mix === "object") {
|
|
12
|
-
if (Array.isArray(mix)) {
|
|
13
|
-
for (k = 0; k < mix.length; k++) {
|
|
14
|
-
if (mix[k]) {
|
|
15
|
-
if ((y = toVal(mix[k]))) {
|
|
16
|
-
if (str) {
|
|
17
|
-
str += " ";
|
|
18
|
-
}
|
|
19
|
-
str += y;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
for (k in mix) {
|
|
26
|
-
if (mix === null || mix === void 0 ? void 0 : mix[k]) {
|
|
27
|
-
if (str) {
|
|
28
|
-
str += " ";
|
|
29
|
-
}
|
|
30
|
-
str += k;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return str;
|
|
36
|
-
}
|
|
37
|
-
function cx(...classes) {
|
|
38
|
-
let i = 0;
|
|
39
|
-
let tmp;
|
|
40
|
-
let x;
|
|
41
|
-
let str = "";
|
|
42
|
-
while (i < classes.length) {
|
|
43
|
-
if ((tmp = classes[i++])) {
|
|
44
|
-
if ((x = toVal(tmp))) {
|
|
45
|
-
if (str) {
|
|
46
|
-
str += " ";
|
|
47
|
-
}
|
|
48
|
-
str += x;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return str;
|
|
53
|
-
}
|
|
54
|
-
exports.cx = cx;
|
package/utils/cx.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
export type ClassArray = ClassValue[];
|
|
2
|
-
export type ClassValue = ClassArray | Record<string, any> | string | number | null | boolean | undefined;
|
|
3
|
-
|
|
4
|
-
function toVal(mix: ClassValue) {
|
|
5
|
-
let k;
|
|
6
|
-
let y;
|
|
7
|
-
let str = "";
|
|
8
|
-
|
|
9
|
-
if (typeof mix === "string" || typeof mix === "number") {
|
|
10
|
-
str += mix;
|
|
11
|
-
} else if (typeof mix === "object") {
|
|
12
|
-
if (Array.isArray(mix)) {
|
|
13
|
-
for (k = 0; k < mix.length; k++) {
|
|
14
|
-
if (mix[k]) {
|
|
15
|
-
if ((y = toVal(mix[k]))) {
|
|
16
|
-
if (str) {
|
|
17
|
-
str += " ";
|
|
18
|
-
}
|
|
19
|
-
str += y;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
} else {
|
|
24
|
-
for (k in mix) {
|
|
25
|
-
if (mix?.[k]) {
|
|
26
|
-
if (str) {
|
|
27
|
-
str += " ";
|
|
28
|
-
}
|
|
29
|
-
str += k;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return str;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function cx(...classes: ClassValue[]): string {
|
|
39
|
-
let i = 0;
|
|
40
|
-
let tmp;
|
|
41
|
-
let x;
|
|
42
|
-
let str = "";
|
|
43
|
-
|
|
44
|
-
while (i < classes.length) {
|
|
45
|
-
if ((tmp = classes[i++])) {
|
|
46
|
-
if ((x = toVal(tmp))) {
|
|
47
|
-
if (str) {
|
|
48
|
-
str += " ";
|
|
49
|
-
}
|
|
50
|
-
str += x;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return str;
|
|
56
|
-
}
|
package/utils/forwardRef.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ForwardedRef, ForwardRefExoticComponent, PropsWithoutRef, ReactElement, RefAttributes } from 'react';
|
|
2
|
-
export declare type ForwardRefRenderFunction<T, P> = {
|
|
3
|
-
(props: P, ref: ForwardedRef<T>): ReactElement | null;
|
|
4
|
-
displayName?: string;
|
|
5
|
-
/** defaultProps are not supported on render functions */
|
|
6
|
-
defaultProps?: never;
|
|
7
|
-
/** propTypes are not supported on render functions */
|
|
8
|
-
propTypes?: never;
|
|
9
|
-
/** used by Chakra */
|
|
10
|
-
id?: string;
|
|
11
|
-
};
|
|
12
|
-
export declare const forwardRef: <T, P>(name: string, render: ForwardRefRenderFunction<T, P>) => ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>;
|
package/utils/forwardRef.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.forwardRef = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const forwardRef = (name, render) => {
|
|
6
|
-
const Component = (0, react_1.forwardRef)(render);
|
|
7
|
-
Component.displayName = name;
|
|
8
|
-
return Component;
|
|
9
|
-
};
|
|
10
|
-
exports.forwardRef = forwardRef;
|
package/utils/forwardRef.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ForwardedRef,
|
|
3
|
-
forwardRef as reactForwardRef,
|
|
4
|
-
ForwardRefExoticComponent,
|
|
5
|
-
PropsWithoutRef,
|
|
6
|
-
ReactElement,
|
|
7
|
-
RefAttributes,
|
|
8
|
-
} from 'react';
|
|
9
|
-
|
|
10
|
-
export type ForwardRefRenderFunction<T, P> = {
|
|
11
|
-
(props: P, ref: ForwardedRef<T>): ReactElement | null;
|
|
12
|
-
displayName?: string;
|
|
13
|
-
// explicit rejected with `never` required due to
|
|
14
|
-
// https://github.com/microsoft/TypeScript/issues/36826
|
|
15
|
-
/** defaultProps are not supported on render functions */
|
|
16
|
-
defaultProps?: never;
|
|
17
|
-
/** propTypes are not supported on render functions */
|
|
18
|
-
propTypes?: never;
|
|
19
|
-
/** used by Chakra */
|
|
20
|
-
id?: string;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const forwardRef = <T, P>(
|
|
24
|
-
name: string,
|
|
25
|
-
render: ForwardRefRenderFunction<T, P>
|
|
26
|
-
): ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>> => {
|
|
27
|
-
const Component = reactForwardRef(render);
|
|
28
|
-
Component.displayName = name;
|
|
29
|
-
return Component;
|
|
30
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import { ButtonColors, ButtonSizes, ButtonVariants } from "../button";
|
|
3
|
-
export declare const defaultConfig: StorybookConfig;
|
|
4
|
-
export interface StorybookConfig {
|
|
5
|
-
Button: {
|
|
6
|
-
sizes: Array<keyof ButtonSizes>;
|
|
7
|
-
variants: Array<keyof ButtonVariants>;
|
|
8
|
-
colors: Array<keyof ButtonColors>;
|
|
9
|
-
};
|
|
10
|
-
Input: {};
|
|
11
|
-
}
|
|
12
|
-
export declare function useStorybookConfig<T extends keyof StorybookConfig>(key: T): StorybookConfig[T];
|
|
13
|
-
interface StorybookContextProviderProps {
|
|
14
|
-
config: StorybookConfig;
|
|
15
|
-
children: ReactNode;
|
|
16
|
-
}
|
|
17
|
-
export declare function StorybookContextProvider(props: StorybookContextProviderProps): JSX.Element;
|
|
18
|
-
export {};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.StorybookContextProvider = exports.useStorybookConfig = exports.defaultConfig = void 0;
|
|
27
|
-
const react_1 = __importStar(require("react"));
|
|
28
|
-
exports.defaultConfig = {
|
|
29
|
-
Button: {
|
|
30
|
-
sizes: ["xs", "sm", "default", "lg", "xl"],
|
|
31
|
-
colors: ["default", "white", "success", "warning", "error"],
|
|
32
|
-
variants: ["outlined", "default"],
|
|
33
|
-
},
|
|
34
|
-
Input: {},
|
|
35
|
-
};
|
|
36
|
-
// Context
|
|
37
|
-
const Context = react_1.default.createContext(exports.defaultConfig);
|
|
38
|
-
// consumer
|
|
39
|
-
function useStorybookConfig(key) {
|
|
40
|
-
return (0, react_1.useContext)(Context)[key];
|
|
41
|
-
}
|
|
42
|
-
exports.useStorybookConfig = useStorybookConfig;
|
|
43
|
-
function StorybookContextProvider(props) {
|
|
44
|
-
return (<Context.Provider value={props.config}>{props.children}</Context.Provider>);
|
|
45
|
-
}
|
|
46
|
-
exports.StorybookContextProvider = StorybookContextProvider;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode, useContext } from "react";
|
|
2
|
-
import { ButtonColors, ButtonSizes, ButtonVariants } from "../button";
|
|
3
|
-
|
|
4
|
-
export const defaultConfig: StorybookConfig = {
|
|
5
|
-
Button: {
|
|
6
|
-
sizes: ["xs", "sm", "default", "lg", "xl"],
|
|
7
|
-
colors: ["default", "white", "success", "warning", "error"],
|
|
8
|
-
variants: ["outlined", "default"],
|
|
9
|
-
},
|
|
10
|
-
Input: {},
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export interface StorybookConfig {
|
|
14
|
-
Button: {
|
|
15
|
-
sizes: Array<keyof ButtonSizes>;
|
|
16
|
-
variants: Array<keyof ButtonVariants>;
|
|
17
|
-
colors: Array<keyof ButtonColors>;
|
|
18
|
-
};
|
|
19
|
-
Input: {};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Context
|
|
23
|
-
const Context = React.createContext(defaultConfig);
|
|
24
|
-
|
|
25
|
-
// consumer
|
|
26
|
-
export function useStorybookConfig<T extends keyof StorybookConfig>(
|
|
27
|
-
key: T
|
|
28
|
-
): StorybookConfig[T] {
|
|
29
|
-
return useContext(Context)[key];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Provider
|
|
33
|
-
interface StorybookContextProviderProps {
|
|
34
|
-
config: StorybookConfig;
|
|
35
|
-
children: ReactNode;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function StorybookContextProvider(props: StorybookContextProviderProps) {
|
|
39
|
-
return (
|
|
40
|
-
<Context.Provider value={props.config}>{props.children}</Context.Provider>
|
|
41
|
-
);
|
|
42
|
-
}
|