@uxf/ui 1.0.0-beta.57 → 1.0.0-beta.58
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/_private-utils/get-provider-config.js +2 -1
- package/avatar-file-input/avatar-file-input.d.ts +2 -2
- package/avatar-file-input/avatar-file-input.js +8 -8
- package/avatar-file-input/index.d.ts +1 -1
- package/avatar-file-input/index.js +14 -5
- package/button/button.stories.js +8 -5
- package/button/theme.d.ts +2 -1
- package/checkbox/index.d.ts +1 -1
- package/checkbox/index.js +15 -3
- package/checkbox-input/checkbox-input.d.ts +2 -3
- package/checkbox-input/checkbox-input.js +5 -3
- package/checkbox-input/checkbox-input.stories.d.ts +2 -3
- package/checkbox-input/index.d.ts +1 -1
- package/checkbox-input/index.js +14 -5
- package/chip/chip.d.ts +7 -0
- package/chip/chip.js +14 -0
- package/chip/chip.stories.d.ts +7 -0
- package/chip/chip.stories.js +22 -0
- package/chip/index.d.ts +1 -0
- package/chip/index.js +5 -0
- package/chip/theme.d.ts +5 -0
- package/chip/theme.js +2 -0
- package/color-radio-group/color-radio-group.d.ts +17 -0
- package/color-radio-group/color-radio-group.js +47 -0
- package/color-radio-group/color-radio-group.stories.d.ts +7 -0
- package/color-radio-group/color-radio-group.stories.js +79 -0
- package/color-radio-group/color-radio.d.ts +8 -0
- package/color-radio-group/color-radio.js +28 -0
- package/color-radio-group/index.d.ts +1 -0
- package/color-radio-group/index.js +5 -0
- package/combobox/combobox.d.ts +1 -2
- package/combobox/combobox.js +8 -7
- package/combobox/index.d.ts +1 -1
- package/combobox/index.js +14 -5
- package/config/icons-config.d.ts +2 -0
- package/config/icons-config.js +5 -0
- package/config/icons.d.ts +47 -0
- package/config/icons.js +14 -0
- package/css/button.css +171 -76
- package/css/chip.css +37 -0
- package/css/color-radio-group.css +26 -0
- package/css/color-radio.css +21 -0
- package/css/input.css +123 -68
- package/css/label.css +7 -0
- package/css/radio-group.css +41 -12
- package/css/radio.css +2 -2
- package/css/textarea.css +48 -10
- package/dropdown/dropdown.js +7 -7
- package/dropdown/index.d.ts +1 -1
- package/dropdown/index.js +15 -3
- package/error-message/error-message.d.ts +2 -2
- package/error-message/error-message.js +2 -1
- package/error-message/index.d.ts +1 -1
- package/error-message/index.js +14 -5
- package/form-control/form-control.js +2 -2
- package/hooks/use-dropdown.js +3 -1
- package/icon/icon.d.ts +2 -2
- package/icon/icon.js +11 -7
- package/icon/icon.stories.js +12 -8
- package/icon/index.d.ts +1 -5
- package/icon/index.js +14 -13
- package/icon/theme.d.ts +1 -2
- package/image-gallery/components/close-button.js +3 -3
- package/image-gallery/components/next-button.js +3 -3
- package/image-gallery/components/previous-button.js +3 -3
- package/input/index.d.ts +9 -10
- package/input/index.js +10 -13
- package/input/input-element.d.ts +2 -2
- package/input/input-element.js +5 -5
- package/input/input-left-addon.d.ts +3 -3
- package/input/input-left-addon.js +2 -1
- package/input/input-left-element.d.ts +3 -3
- package/input/input-left-element.js +2 -1
- package/input/input-right-addon.d.ts +2 -3
- package/input/input-right-addon.js +2 -1
- package/input/input-right-element.d.ts +3 -3
- package/input/input-right-element.js +2 -1
- package/input/input.d.ts +2 -2
- package/input/input.js +5 -4
- package/input/input.stories.d.ts +5 -5
- package/input/input.stories.js +13 -3
- package/label/index.d.ts +1 -1
- package/label/index.js +14 -5
- package/label/label.d.ts +1 -2
- package/label/label.js +4 -4
- package/package.json +3 -2
- package/radio/index.d.ts +1 -1
- package/radio/index.js +15 -3
- package/radio-group/index.d.ts +1 -1
- package/radio-group/index.js +15 -3
- package/radio-group/radio-group.js +2 -2
- package/radio-group/radio-group.stories.js +2 -2
- package/raster-image/index.d.ts +1 -1
- package/raster-image/index.js +14 -5
- package/raster-image/raster-image.d.ts +4 -4
- package/raster-image/raster-image.js +7 -5
- package/raster-image/raster-image.stories.d.ts +2 -3
- package/select/index.d.ts +1 -1
- package/select/index.js +14 -5
- package/select/select.d.ts +1 -2
- package/select/select.js +8 -7
- package/text-input/text-input.d.ts +1 -1
- package/text-input/text-input.js +4 -4
- package/text-input/text-input.stories.js +4 -1
- package/textarea/index.d.ts +1 -1
- package/textarea/index.js +14 -5
- package/textarea/textarea.d.ts +1 -2
- package/textarea/textarea.js +8 -8
- package/textarea/textarea.stories.js +32 -20
- package/toggle/index.d.ts +1 -1
- package/toggle/index.js +14 -5
- package/toggle/toggle.d.ts +2 -3
- package/toggle/toggle.js +7 -6
- package/toggle/toggle.stories.d.ts +2 -3
- package/utils/icons-config.js +43 -0
- package/utils/storybook-config.js +1 -1
- package/utils/tailwind-config.js +152 -0
- package/hooks/use-latest.d.ts +0 -2
- package/hooks/use-latest.js +0 -12
- package/icon/camera-icon.d.ts +0 -3
- package/icon/camera-icon.js +0 -11
- package/icon/chevron-down-icon.d.ts +0 -3
- package/icon/chevron-down-icon.js +0 -11
- package/icon/chevron-up-icon.d.ts +0 -3
- package/icon/chevron-up-icon.js +0 -11
- package/icon/pin-icon.d.ts +0 -3
- package/icon/pin-icon.js +0 -11
- package/image-gallery/components/icon-chevron-left.d.ts +0 -3
- package/image-gallery/components/icon-chevron-left.js +0 -11
- package/image-gallery/components/icon-chevron-right.d.ts +0 -3
- package/image-gallery/components/icon-chevron-right.js +0 -11
- package/image-gallery/components/icon-close.d.ts +0 -3
- package/image-gallery/components/icon-close.js +0 -11
- package/utils/cx.d.ts +0 -3
- package/utils/cx.js +0 -54
- package/utils/forward-ref.d.ts +0 -12
- package/utils/forward-ref.js +0 -10
- package/utils/rem.d.ts +0 -1
- package/utils/rem.js +0 -5
- package/utils/sr-only-mixin.d.ts +0 -2
- package/utils/sr-only-mixin.js +0 -14
package/textarea/index.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports
|
|
7
|
-
var textarea_1 = require("./textarea");
|
|
8
|
-
Object.defineProperty(exports, "Textarea", { enumerable: true, get: function () { return __importDefault(textarea_1).default; } });
|
|
17
|
+
__exportStar(require("./textarea"), exports);
|
package/textarea/textarea.d.ts
CHANGED
|
@@ -14,5 +14,4 @@ export interface TextareaProps extends FormControlProps<string, HTMLTextAreaElem
|
|
|
14
14
|
placeholder?: string;
|
|
15
15
|
rows?: number;
|
|
16
16
|
}
|
|
17
|
-
declare const
|
|
18
|
-
export default _default;
|
|
17
|
+
export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
package/textarea/textarea.js
CHANGED
|
@@ -23,13 +23,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Textarea = void 0;
|
|
26
27
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
28
|
+
const useLatest_1 = require("@uxf/core/hooks/useLatest");
|
|
27
29
|
const composeRefs_1 = require("@uxf/core/utils/composeRefs");
|
|
28
30
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
31
|
+
const forwardRef_1 = require("@uxf/core/utils/forwardRef");
|
|
29
32
|
const react_1 = __importStar(require("react"));
|
|
30
33
|
const form_control_1 = require("../form-control");
|
|
31
|
-
const use_latest_1 = require("../hooks/use-latest");
|
|
32
|
-
const forward_ref_1 = require("../utils/forward-ref");
|
|
33
34
|
function autoHeightHandler(element, rows = 4) {
|
|
34
35
|
element.style.height = "auto";
|
|
35
36
|
if (rows > 1) {
|
|
@@ -41,14 +42,14 @@ function autoHeightHandler(element, rows = 4) {
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
const EVENTS = ["input", "cut", "paste", "drop"];
|
|
44
|
-
|
|
45
|
+
exports.Textarea = (0, forwardRef_1.forwardRef)("Textarea", (props, ref) => {
|
|
45
46
|
var _a;
|
|
46
47
|
const innerRef = (0, react_1.useRef)(null);
|
|
47
48
|
const [isFocused, setIsFocused] = (0, react_1.useState)(false);
|
|
48
49
|
const generatedId = (0, react_1.useId)();
|
|
49
50
|
const id = (_a = props.id) !== null && _a !== void 0 ? _a : generatedId;
|
|
50
51
|
const errorId = props.isInvalid ? `${id}--error-message` : undefined;
|
|
51
|
-
const rootClassName = (0, cx_1.cx)("uxf-textarea", isFocused && classes_1.CLASSES.IS_FOCUSED, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED);
|
|
52
|
+
const rootClassName = (0, cx_1.cx)("uxf-textarea", isFocused && classes_1.CLASSES.IS_FOCUSED, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY);
|
|
52
53
|
const onFocus = (e) => {
|
|
53
54
|
var _a;
|
|
54
55
|
setIsFocused(true);
|
|
@@ -59,7 +60,7 @@ function Textarea(props, ref) {
|
|
|
59
60
|
setIsFocused(false);
|
|
60
61
|
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
61
62
|
};
|
|
62
|
-
const latestRows = (0,
|
|
63
|
+
const latestRows = (0, useLatest_1.useLatest)(props.rows);
|
|
63
64
|
(0, react_1.useEffect)(() => {
|
|
64
65
|
const node = innerRef.current;
|
|
65
66
|
if (!node || props.disableAutoHeight) {
|
|
@@ -75,7 +76,6 @@ function Textarea(props, ref) {
|
|
|
75
76
|
};
|
|
76
77
|
}, [props.disableAutoHeight, latestRows]);
|
|
77
78
|
return (react_1.default.createElement(form_control_1.FormControl, { className: rootClassName, errorId: errorId, form: props.form, helperText: props.helperText, inputId: id, isRequired: props.isRequired, label: props.label },
|
|
78
|
-
react_1.default.createElement("div", { className:
|
|
79
|
+
react_1.default.createElement("div", { className: "uxf-textarea__wrapper", onClick: () => { var _a; return (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus(); } },
|
|
79
80
|
react_1.default.createElement("textarea", { "aria-describedby": errorId, "aria-invalid": props.isInvalid, autoComplete: props.autoComplete, className: "uxf-textarea__element", disabled: props.isDisabled, form: props.form, id: id, maxLength: props.maxLength, minLength: props.minLength, name: props.name, onBlur: onBlur, onChange: (event) => { var _a; return (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, event.target.value, event); }, onFocus: onFocus, placeholder: props.placeholder, readOnly: props.isReadOnly, ref: (0, composeRefs_1.composeRefs)(innerRef, ref), required: props.isRequired, value: props.value }))));
|
|
80
|
-
}
|
|
81
|
-
exports.default = (0, forward_ref_1.forwardRef)("Textarea", Textarea);
|
|
81
|
+
});
|
|
@@ -1,32 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.Default = void 0;
|
|
7
27
|
const index_1 = require("./index");
|
|
8
|
-
const react_1 =
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
9
29
|
exports.default = {
|
|
10
30
|
title: "UI/Textarea",
|
|
11
31
|
component: index_1.Textarea,
|
|
12
32
|
};
|
|
13
33
|
function Default() {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
react_1.default.createElement(index_1.Textarea, { id: "textarea-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
react_1.default.createElement(index_1.Textarea, { isDisabled: true, id: "textarea-disabled", label: "Textarea disabled", onChange: () => {
|
|
24
|
-
// eslint-disable-next-line no-console
|
|
25
|
-
console.log("textarea OnChange");
|
|
26
|
-
} }),
|
|
27
|
-
react_1.default.createElement(index_1.Textarea, { rows: 10, id: "textarea-rows10", label: "Textarea rows = 10", placeholder: "Placeholder text....", onChange: () => {
|
|
28
|
-
// eslint-disable-next-line no-console
|
|
29
|
-
console.log("textarea OnChange");
|
|
30
|
-
} })));
|
|
34
|
+
const [value, onChange] = (0, react_1.useState)("test");
|
|
35
|
+
const storyTextAreas = (react_1.default.createElement("div", { className: "space-y-2" },
|
|
36
|
+
react_1.default.createElement(index_1.Textarea, { id: "textarea", label: "Textarea", onChange: onChange, placeholder: "Placeholder text....", value: value }),
|
|
37
|
+
react_1.default.createElement(index_1.Textarea, { id: "textarea-readonly", label: "Readonly", isReadOnly: true, onChange: onChange, value: value }),
|
|
38
|
+
react_1.default.createElement(index_1.Textarea, { isDisabled: true, id: "textarea-disabled", label: "Textarea disabled", onChange: onChange, value: value }),
|
|
39
|
+
react_1.default.createElement(index_1.Textarea, { id: "textarea-rows10", isInvalid: true, label: "Textarea rows = 10, invalid", placeholder: "Placeholder text....", rows: 10, onChange: onChange, value: value })));
|
|
40
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
41
|
+
react_1.default.createElement("div", { className: "light space-y-2 p-20" }, storyTextAreas),
|
|
42
|
+
react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20" }, storyTextAreas)));
|
|
31
43
|
}
|
|
32
44
|
exports.Default = Default;
|
package/toggle/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./toggle";
|
package/toggle/index.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports
|
|
7
|
-
var toggle_1 = require("./toggle");
|
|
8
|
-
Object.defineProperty(exports, "Toggle", { enumerable: true, get: function () { return __importDefault(toggle_1).default; } });
|
|
17
|
+
__exportStar(require("./toggle"), exports);
|
package/toggle/toggle.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { CSSProperties } from "react";
|
|
1
|
+
import React, { CSSProperties } from "react";
|
|
2
2
|
import { FormControlProps } from "../types";
|
|
3
3
|
export interface ToggleProps extends FormControlProps<boolean> {
|
|
4
4
|
className?: string;
|
|
5
5
|
label: string;
|
|
6
6
|
style?: Partial<CSSProperties>;
|
|
7
7
|
}
|
|
8
|
-
declare
|
|
9
|
-
export default Toggle;
|
|
8
|
+
export declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
package/toggle/toggle.js
CHANGED
|
@@ -3,13 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Toggle = void 0;
|
|
6
7
|
const react_1 = require("@headlessui/react");
|
|
7
|
-
const react_2 = __importDefault(require("react"));
|
|
8
|
-
const cx_1 = require("@uxf/core/utils/cx");
|
|
9
8
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
10
|
+
const forwardRef_1 = require("@uxf/core/utils/forwardRef");
|
|
11
|
+
const react_2 = __importDefault(require("react"));
|
|
12
|
+
exports.Toggle = (0, forwardRef_1.forwardRef)("Toggle", (props, ref) => {
|
|
13
|
+
return (react_2.default.createElement(react_1.Switch, { checked: props.value, className: (0, cx_1.cx)(props.value && classes_1.CLASSES.IS_SELECTED, props.isDisabled && classes_1.CLASSES.IS_DISABLED, "uxf-toggle", props.className), disabled: props.isDisabled, onChange: props.onChange, style: props.style, ref: ref },
|
|
12
14
|
react_2.default.createElement("span", { className: "uxf-toggle__label" }, props.label),
|
|
13
15
|
react_2.default.createElement("span", { className: "uxf-toggle__inner" })));
|
|
14
|
-
}
|
|
15
|
-
exports.default = Toggle;
|
|
16
|
+
});
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { Toggle } from "./index";
|
|
1
|
+
import React from "react";
|
|
3
2
|
declare const _default: {
|
|
4
3
|
title: string;
|
|
5
|
-
component:
|
|
4
|
+
component: React.ForwardRefExoticComponent<import("./toggle").ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
5
|
};
|
|
7
6
|
export default _default;
|
|
8
7
|
export declare function Default(): JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** @type {import('@uxf/icons-generator/types').Config['icons']} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
camera: {
|
|
4
|
+
width: 512,
|
|
5
|
+
height: 512,
|
|
6
|
+
data: `<path d="M144 288C144 226.1 194.1 176 256 176C317.9 176 368 226.1 368 288C368 349.9 317.9 400 256 400C194.1 400 144 349.9 144 288zM256 224C220.7 224 192 252.7 192 288C192 323.3 220.7 352 256 352C291.3 352 320 323.3 320 288C320 252.7 291.3 224 256 224zM362.9 64.82L373.3 96H448C483.3 96 512 124.7 512 160V416C512 451.3 483.3 480 448 480H64C28.65 480 0 451.3 0 416V160C0 124.7 28.65 96 64 96H138.7L149.1 64.82C155.6 45.22 173.9 32 194.6 32H317.4C338.1 32 356.4 45.22 362.9 64.82H362.9zM64 144C55.16 144 48 151.2 48 160V416C48 424.8 55.16 432 64 432H448C456.8 432 464 424.8 464 416V160C464 151.2 456.8 144 448 144H338.7L317.4 80H194.6L173.3 144H64z" fill="currentColor"/>`,
|
|
7
|
+
},
|
|
8
|
+
caretDown: {
|
|
9
|
+
width: 320,
|
|
10
|
+
height: 512,
|
|
11
|
+
data: `<path d="M137.4 374.6a32.05 32.05 0 0 0 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9S301 191.9 288 191.9L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z" fill="currentColor"/>`,
|
|
12
|
+
},
|
|
13
|
+
check: {
|
|
14
|
+
width: 512,
|
|
15
|
+
height: 512,
|
|
16
|
+
data: `<path d="M470.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L192 338.7 425.4 105.4c12.5-12.5 32.8-12.5 45.3 0z" fill="currentColor"/>`,
|
|
17
|
+
},
|
|
18
|
+
chevronDown: {
|
|
19
|
+
width: 512,
|
|
20
|
+
height: 512,
|
|
21
|
+
data: `<path d="M256 429.3l22.6-22.6 192-192L493.3 192 448 146.7l-22.6 22.6L256 338.7 86.6 169.4 64 146.7 18.7 192l22.6 22.6 192 192L256 429.3z" fill="currentColor"/>`,
|
|
22
|
+
},
|
|
23
|
+
chevronLeft: {
|
|
24
|
+
width: 384,
|
|
25
|
+
height: 512,
|
|
26
|
+
data: `<path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 278.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z" fill="currentColor"/>`,
|
|
27
|
+
},
|
|
28
|
+
chevronRight: {
|
|
29
|
+
width: 384,
|
|
30
|
+
height: 512,
|
|
31
|
+
data: `<path d="M342.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L274.7 256 105.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z" fill="currentColor"/>`,
|
|
32
|
+
},
|
|
33
|
+
chevronUp: {
|
|
34
|
+
width: 512,
|
|
35
|
+
height: 512,
|
|
36
|
+
data: `<path d="M256 82.7l22.6 22.6 192 192L493.3 320 448 365.3l-22.6-22.6L256 173.3 86.6 342.6 64 365.3 18.7 320l22.6-22.6 192-192L256 82.7z" fill="currentColor"/>`,
|
|
37
|
+
},
|
|
38
|
+
xmarkLarge: {
|
|
39
|
+
width: 448,
|
|
40
|
+
height: 512,
|
|
41
|
+
data: `<path d="M393.4 41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L269.3 256l169.3 169.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 301.3 54.6 470.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 9.4 86.6c-12.5-12.5-12.5-32.7 0-45.2s32.8-12.5 45.3 0L224 210.7 393.4 41.4z" fill="currentColor"/>`,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -29,7 +29,7 @@ exports.defaultConfig = {
|
|
|
29
29
|
Button: {
|
|
30
30
|
sizes: ["xs", "sm", "default", "lg", "xl"],
|
|
31
31
|
colors: ["default", "white", "success", "warning", "error"],
|
|
32
|
-
variants: ["outlined", "
|
|
32
|
+
variants: ["default", "outlined", "text"],
|
|
33
33
|
},
|
|
34
34
|
Input: {},
|
|
35
35
|
Select: {},
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
const plugin = require("tailwindcss/plugin");
|
|
2
|
+
const { em } = require("@uxf/styles/units/em");
|
|
3
|
+
const { rem } = require("@uxf/styles/units/rem");
|
|
4
|
+
|
|
5
|
+
/** @type {Record<string, string>} */
|
|
6
|
+
const CONTAINERS = {
|
|
7
|
+
xs: rem(540),
|
|
8
|
+
sm: rem(720),
|
|
9
|
+
md: rem(928),
|
|
10
|
+
lg: rem(1024),
|
|
11
|
+
xl: rem(1216),
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @type {Record<string, string>} */
|
|
15
|
+
const SCREENS = {
|
|
16
|
+
xs: em(576),
|
|
17
|
+
sm: em(768),
|
|
18
|
+
md: em(992),
|
|
19
|
+
lg: em(1200),
|
|
20
|
+
xl: em(1440),
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @type {import('tailwindcss').Config} */
|
|
24
|
+
module.exports = {
|
|
25
|
+
content: [],
|
|
26
|
+
theme: {
|
|
27
|
+
containers: CONTAINERS,
|
|
28
|
+
screens: SCREENS,
|
|
29
|
+
extend: {
|
|
30
|
+
borderRadius: {
|
|
31
|
+
inherit: "inherit",
|
|
32
|
+
},
|
|
33
|
+
colors: {
|
|
34
|
+
inherit: "inherit",
|
|
35
|
+
primary: {
|
|
36
|
+
50: "#eff6ff",
|
|
37
|
+
100: "#dbeafe",
|
|
38
|
+
200: "#bfdbfe",
|
|
39
|
+
300: "#93c5fd",
|
|
40
|
+
400: "#60a5fa",
|
|
41
|
+
500: "#3b82f6",
|
|
42
|
+
600: "#2563eb",
|
|
43
|
+
700: "#1d4ed8",
|
|
44
|
+
800: "#1e40af",
|
|
45
|
+
900: "#1e3a8a",
|
|
46
|
+
},
|
|
47
|
+
success: {
|
|
48
|
+
50: "#f0fdf4",
|
|
49
|
+
100: "#dcfce7",
|
|
50
|
+
200: "#bbf7d0",
|
|
51
|
+
300: "#86efac",
|
|
52
|
+
400: "#4ade80",
|
|
53
|
+
500: "#22c55e",
|
|
54
|
+
600: "#16a34a",
|
|
55
|
+
700: "#15803d",
|
|
56
|
+
800: "#166534",
|
|
57
|
+
900: "#14532d",
|
|
58
|
+
},
|
|
59
|
+
warning: {
|
|
60
|
+
50: "#fff7ed",
|
|
61
|
+
100: "#ffedd5",
|
|
62
|
+
200: "#fed7aa",
|
|
63
|
+
300: "#fdba74",
|
|
64
|
+
400: "#fb923c",
|
|
65
|
+
500: "#f97316",
|
|
66
|
+
600: "#ea580c",
|
|
67
|
+
700: "#c2410c",
|
|
68
|
+
800: "#9a3412",
|
|
69
|
+
900: "#7c2d12",
|
|
70
|
+
},
|
|
71
|
+
error: {
|
|
72
|
+
50: "#fef2f2",
|
|
73
|
+
100: "#fee2e2",
|
|
74
|
+
200: "#fecaca",
|
|
75
|
+
300: "#fca5a5",
|
|
76
|
+
400: "#f87171",
|
|
77
|
+
500: "#ef4444",
|
|
78
|
+
600: "#dc2626",
|
|
79
|
+
700: "#b91c1c",
|
|
80
|
+
800: "#991b1b",
|
|
81
|
+
900: "#7f1d1d",
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
zIndex: {
|
|
85
|
+
1: "1",
|
|
86
|
+
focus: "5",
|
|
87
|
+
fixed: "10",
|
|
88
|
+
menu: "25",
|
|
89
|
+
header: "50",
|
|
90
|
+
modal: "100",
|
|
91
|
+
dropdown: "200",
|
|
92
|
+
flashMessage: "250",
|
|
93
|
+
tooltip: "300",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
corePlugins: {
|
|
98
|
+
aspectRatio: false,
|
|
99
|
+
container: false,
|
|
100
|
+
},
|
|
101
|
+
plugins: [
|
|
102
|
+
require("@tailwindcss/aspect-ratio"),
|
|
103
|
+
require("@tailwindcss/line-clamp"),
|
|
104
|
+
plugin(
|
|
105
|
+
({ addComponents, theme }) => {
|
|
106
|
+
const screens = theme("screens", SCREENS);
|
|
107
|
+
const containers = theme("containers", CONTAINERS);
|
|
108
|
+
|
|
109
|
+
const mqs = Object.entries(screens);
|
|
110
|
+
const widths = mqs
|
|
111
|
+
.map((item) => {
|
|
112
|
+
const key = item[0];
|
|
113
|
+
const value = item[1];
|
|
114
|
+
const width = containers[key];
|
|
115
|
+
if (width) {
|
|
116
|
+
return { [`@media (min-width: ${value})`]: { ".container": { "max-width": width } } };
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
.filter((i) => i);
|
|
120
|
+
|
|
121
|
+
addComponents([
|
|
122
|
+
{
|
|
123
|
+
".container": {
|
|
124
|
+
"margin-left": "auto",
|
|
125
|
+
"margin-right": "auto",
|
|
126
|
+
width: "100%",
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
...widths,
|
|
130
|
+
]);
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
content: [],
|
|
134
|
+
theme: {
|
|
135
|
+
containers: CONTAINERS,
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
),
|
|
139
|
+
plugin(({ addVariant }) => {
|
|
140
|
+
addVariant("is-active", "&.is-active");
|
|
141
|
+
addVariant("is-selected", "&.is-selected");
|
|
142
|
+
addVariant("is-hoverable", ["&.is-hoverable:active", "&.is-hoverable:hover"]);
|
|
143
|
+
addVariant("is-focused", "&.is-focused");
|
|
144
|
+
addVariant("is-required", ["&.is-required", "&:required"]);
|
|
145
|
+
addVariant("is-invalid", "&.is-invalid");
|
|
146
|
+
addVariant("is-loading", ["&.is-loading"]);
|
|
147
|
+
addVariant("is-readonly", ["&.is-readonly", "&:readonly"]);
|
|
148
|
+
addVariant("is-disabled", ["&.is-disabled", "&:disabled"]);
|
|
149
|
+
addVariant("is-empty", ["&.is-empty"]);
|
|
150
|
+
}),
|
|
151
|
+
],
|
|
152
|
+
};
|
package/hooks/use-latest.d.ts
DELETED
package/hooks/use-latest.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useLatest = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
function useLatest(current) {
|
|
6
|
-
const storedValue = (0, react_1.useRef)(current);
|
|
7
|
-
(0, react_1.useEffect)(() => {
|
|
8
|
-
storedValue.current = current;
|
|
9
|
-
});
|
|
10
|
-
return storedValue;
|
|
11
|
-
}
|
|
12
|
-
exports.useLatest = useLatest;
|
package/icon/camera-icon.d.ts
DELETED
package/icon/camera-icon.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
function CameraIcon(props) {
|
|
8
|
-
return (react_1.default.createElement("svg", { viewBox: "0 0 512 512", ...props },
|
|
9
|
-
react_1.default.createElement("path", { fill: "currentColor", d: "M144 288C144 226.1 194.1 176 256 176C317.9 176 368 226.1 368 288C368 349.9 317.9 400 256 400C194.1 400 144 349.9 144 288zM256 224C220.7 224 192 252.7 192 288C192 323.3 220.7 352 256 352C291.3 352 320 323.3 320 288C320 252.7 291.3 224 256 224zM362.9 64.82L373.3 96H448C483.3 96 512 124.7 512 160V416C512 451.3 483.3 480 448 480H64C28.65 480 0 451.3 0 416V160C0 124.7 28.65 96 64 96H138.7L149.1 64.82C155.6 45.22 173.9 32 194.6 32H317.4C338.1 32 356.4 45.22 362.9 64.82H362.9zM64 144C55.16 144 48 151.2 48 160V416C48 424.8 55.16 432 64 432H448C456.8 432 464 424.8 464 416V160C464 151.2 456.8 144 448 144H338.7L317.4 80H194.6L173.3 144H64z" })));
|
|
10
|
-
}
|
|
11
|
-
exports.default = CameraIcon;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
function ChevronDownIcon(props) {
|
|
8
|
-
return (react_1.default.createElement("svg", { viewBox: "0 0 512 512", ...props },
|
|
9
|
-
react_1.default.createElement("path", { fill: "currentColor", d: "M256 429.3l22.6-22.6 192-192L493.3 192 448 146.7l-22.6 22.6L256 338.7 86.6 169.4 64 146.7 18.7 192l22.6 22.6 192 192L256 429.3z" })));
|
|
10
|
-
}
|
|
11
|
-
exports.default = ChevronDownIcon;
|
package/icon/chevron-up-icon.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
function ChevronUpIcon(props) {
|
|
8
|
-
return (react_1.default.createElement("svg", { viewBox: "0 0 512 512", ...props },
|
|
9
|
-
react_1.default.createElement("path", { fill: "currentColor", d: "M256 82.7l22.6 22.6 192 192L493.3 320 448 365.3l-22.6-22.6L256 173.3 86.6 342.6 64 365.3 18.7 320l22.6-22.6 192-192L256 82.7z" })));
|
|
10
|
-
}
|
|
11
|
-
exports.default = ChevronUpIcon;
|
package/icon/pin-icon.d.ts
DELETED
package/icon/pin-icon.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
function PinIcon(props) {
|
|
8
|
-
return (react_1.default.createElement("svg", { viewBox: "0 0 29.65 40", ...props },
|
|
9
|
-
react_1.default.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M0 14.83C0 6.61 6.61 0 14.83 0c8.11 0 14.83 6.61 14.83 14.83 0 8.64-8.85 19.41-14.83 25.17C8.75 34.24 0 23.47 0 14.83zm9.28 0c0-3.09 2.45-5.55 5.55-5.55 2.99 0 5.44 2.45 5.44 5.55 0 2.99-2.45 5.44-5.44 5.44-3.1 0-5.55-2.46-5.55-5.44z", clipRule: "evenodd" })));
|
|
10
|
-
}
|
|
11
|
-
exports.default = PinIcon;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
function IconChevronLeft() {
|
|
8
|
-
return (react_1.default.createElement("svg", { className: "h-10 w-10 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2 },
|
|
9
|
-
react_1.default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" })));
|
|
10
|
-
}
|
|
11
|
-
exports.default = IconChevronLeft;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
function IconChevronRight() {
|
|
8
|
-
return (react_1.default.createElement("svg", { className: "h-10 w-10 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2 },
|
|
9
|
-
react_1.default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" })));
|
|
10
|
-
}
|
|
11
|
-
exports.default = IconChevronRight;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
function IconClose() {
|
|
8
|
-
return (react_1.default.createElement("svg", { fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, className: "h-10 w-10 text-white" },
|
|
9
|
-
react_1.default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })));
|
|
10
|
-
}
|
|
11
|
-
exports.default = IconClose;
|
package/utils/cx.d.ts
DELETED
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;
|