@uxf/ui 1.0.0-beta.145 → 1.0.0-beta.147
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/_file-input-base/file-input-base.js +25 -5
- package/_input-with-popover/input-with-popover.js +3 -3
- package/_select-base/_select-base.js +9 -7
- package/avatar/avatar.js +25 -5
- package/badge/badge.js +25 -5
- package/button/button.js +25 -5
- package/checkbox/checkbox.js +25 -5
- package/checkbox-button/checkbox-button.d.ts +1 -1
- package/checkbox-button/checkbox-button.js +25 -5
- package/checkbox-input/checkbox-input.js +2 -2
- package/chip/chip.js +25 -5
- package/color-radio/color-radio.js +25 -5
- package/color-radio/color-radio.stories.js +3 -3
- package/color-radio-group/color-radio-group.d.ts +1 -0
- package/color-radio-group/color-radio-group.js +5 -5
- package/color-scheme/index.d.ts +1 -0
- package/color-scheme/index.js +3 -1
- package/color-scheme/use-color-scheme.d.ts +1 -0
- package/color-scheme/use-color-scheme.js +19 -0
- package/css/avatar-file-input.css +6 -6
- package/css/badge.css +1 -1
- package/css/button.css +18 -18
- package/css/checkbox-button.css +8 -8
- package/css/checkbox.css +11 -15
- package/css/color-radio-group.css +1 -1
- package/css/color-radio.css +1 -1
- package/css/date-picker.css +4 -4
- package/css/dropdown.css +1 -1
- package/css/dropzone.css +3 -3
- package/css/error-message.css +1 -1
- package/css/file-input.css +4 -4
- package/css/flash-messages.css +3 -3
- package/css/{form-control.css → form-component.css} +1 -1
- package/css/input.css +8 -8
- package/css/list-item.css +2 -2
- package/css/modal.css +5 -9
- package/css/multi-combobox.css +6 -6
- package/css/multi-select.css +2 -2
- package/css/pagination.css +1 -1
- package/css/radio-group.css +23 -14
- package/css/radio.css +8 -8
- package/css/tabs.css +8 -8
- package/css/text-link.css +2 -2
- package/css/textarea.css +5 -5
- package/css/time-picker.css +2 -0
- package/css/toggle.css +5 -5
- package/date-picker-input/date-picker-input.js +26 -3
- package/date-picker-input/date-picker.js +1 -0
- package/dropdown/dropdown.js +27 -6
- package/dropzone/dropzone-input.js +2 -2
- package/file-input/file-input.js +4 -4
- package/{form-control/form-control.d.ts → form-component/form-component.d.ts} +2 -2
- package/form-component/form-component.js +41 -0
- package/{form-control/form-control.spec.js → form-component/form-component.spec.js} +2 -2
- package/{form-control/form-control.stories.d.ts → form-component/form-component.stories.d.ts} +1 -1
- package/form-component/form-component.stories.js +25 -0
- package/form-component/index.d.ts +2 -0
- package/form-component/index.js +5 -0
- package/hooks/use-dropdown.d.ts +34 -1
- package/icon/icon.js +25 -5
- package/input/input.js +2 -2
- package/label/label.js +25 -5
- package/layout/layout.js +2 -2
- package/list-item/list-item.js +25 -5
- package/list-item/list-item.stories.js +2 -2
- package/loader/loader.js +25 -5
- package/loader/loader.stories.js +2 -2
- package/multi-combobox/_multi-combobox-base.js +6 -6
- package/multi-combobox/multi-combobox.js +4 -4
- package/multi-select/_multi-select-base.js +5 -5
- package/multi-select/multi-select.js +4 -4
- package/package.json +5 -5
- package/paper/paper.js +25 -5
- package/radio/radio.js +25 -5
- package/radio/radio.stories.js +4 -4
- package/radio-group/radio-group.js +5 -5
- package/radio-group/radio-group.stories.js +1 -0
- package/radio-group/theme.d.ts +1 -0
- package/select/select.js +3 -3
- package/tabs/tabs.js +2 -2
- package/text-input/text-input.js +4 -4
- package/text-link/text-link.js +25 -5
- package/textarea/textarea.js +4 -4
- package/time-picker-input/time-picker-hour.js +1 -0
- package/time-picker-input/time-picker-input.js +25 -5
- package/time-picker-input/time-picker-minute.js +1 -0
- package/toggle/toggle.d.ts +1 -1
- package/toggle/toggle.js +25 -5
- package/tooltip/tooltip.js +2 -2
- package/tooltip/use-tooltip.d.ts +19 -1
- package/tw-tokens/tw-colors.d.ts +26 -0
- package/tw-tokens/tw-colors.js +26 -0
- package/types/form-control-props.d.ts +4 -4
- package/utils/tailwind-config.js +13 -6
- package/form-control/form-control.js +0 -21
- package/form-control/form-control.stories.js +0 -25
- package/form-control/index.d.ts +0 -2
- package/form-control/index.js +0 -5
- /package/{form-control/form-control.spec.d.ts → form-component/form-component.spec.d.ts} +0 -0
|
@@ -1,12 +1,32 @@
|
|
|
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._FileInputBase = void 0;
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
exports._FileInputBase = (0, forwardRef_1.forwardRef)("UxfUiFileInputBase", (props, ref) => {
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
exports._FileInputBase = (0, react_1.forwardRef)((props, ref) => {
|
|
10
29
|
const onChange = (e) => props.onChange(null, e);
|
|
11
30
|
return (react_1.default.createElement("input", { accept: props.accept, "aria-invalid": props.isInvalid, "aria-describedby": props["aria-describedby"], className: props.className, disabled: props.isDisabled, form: props.form, id: props.id, name: props.name, onBlur: props.onBlur, onChange: onChange, onFocus: props.onFocus, readOnly: props.isReadOnly, ref: ref, required: props.isRequired, tabIndex: props.isDisabled ? -1 : undefined, type: "file" }));
|
|
12
31
|
});
|
|
32
|
+
exports._FileInputBase.displayName = "UxfUiFileInputBase";
|
|
@@ -31,7 +31,7 @@ const cx_1 = require("@uxf/core/utils/cx");
|
|
|
31
31
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
32
32
|
const react_2 = require("@floating-ui/react");
|
|
33
33
|
const composeRefs_1 = require("@uxf/core/utils/composeRefs");
|
|
34
|
-
const
|
|
34
|
+
const form_component_1 = require("../form-component");
|
|
35
35
|
const react_3 = require("@headlessui/react");
|
|
36
36
|
function useErrorProps(error, id, isInvalid) {
|
|
37
37
|
const errorId = isInvalid ? `${id}--error-message` : undefined;
|
|
@@ -61,7 +61,7 @@ exports._InputWithPopover = (0, react_1.forwardRef)((props, ref) => {
|
|
|
61
61
|
Object.assign(elements.floating.style, {
|
|
62
62
|
left: x + "px",
|
|
63
63
|
maxHeight: Math.max(50, availableHeight) + "px",
|
|
64
|
-
maxWidth: availableWidth,
|
|
64
|
+
maxWidth: Math.max(240, availableWidth) + "px",
|
|
65
65
|
position: strategy,
|
|
66
66
|
top: y + "px",
|
|
67
67
|
});
|
|
@@ -76,7 +76,7 @@ exports._InputWithPopover = (0, react_1.forwardRef)((props, ref) => {
|
|
|
76
76
|
const onChange = () => props.onChange;
|
|
77
77
|
const isInteractive = !props.isDisabled && !props.isReadOnly;
|
|
78
78
|
const showRemoveButton = !!(props.value && isInteractive && props.isClearable);
|
|
79
|
-
return (react_1.default.createElement(
|
|
79
|
+
return (react_1.default.createElement(form_component_1.FormComponent, { className: rootClassName, errorId: error.errorId, form: props.form, helperText: props.helperText, hiddenLabel: props.hiddenLabel, inputId: id, isRequired: props.isRequired, label: props.label },
|
|
80
80
|
react_1.default.createElement(react_3.Popover, { className: "uxf-iwp__popover" },
|
|
81
81
|
react_1.default.createElement(react_3.Popover.Button, { as: input_1.Input, inputFocus: input, size: props.size, variant: props.variant, ref: stableRef },
|
|
82
82
|
props.leftAddon && react_1.default.createElement(input_1.Input.LeftAddon, null, props.leftAddon),
|
|
@@ -36,9 +36,9 @@ const react_1 = __importStar(require("react"));
|
|
|
36
36
|
const Options = (props) => {
|
|
37
37
|
const Component = props.component;
|
|
38
38
|
return (react_1.default.createElement(Component.Options, { className: (0, cx_1.cx)("uxf-dropdown", props.placement === "bottom" && "uxf-dropdown--bottom", props.placement === "top" && "uxf-dropdown--top"), ref: props.forwardRef }, props.options && props.options.length > 0 ? (props.options.map((option) => {
|
|
39
|
-
var _a;
|
|
39
|
+
var _a, _b, _c, _d;
|
|
40
40
|
const optionKey = (_a = props.keyExtractor) === null || _a === void 0 ? void 0 : _a.call(props, option);
|
|
41
|
-
return (react_1.default.createElement(Component.Option, { className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item", optionState.active && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED), key: optionKey !== null && optionKey !== void 0 ? optionKey : option.id, value: option },
|
|
41
|
+
return (react_1.default.createElement(Component.Option, { className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item", optionState.active && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED), key: optionKey !== null && optionKey !== void 0 ? optionKey : option.id, value: option }, (_d = (_c = (_b = props.renderOption) === null || _b === void 0 ? void 0 : _b.call(props, option)) !== null && _c !== void 0 ? _c : optionKey) !== null && _d !== void 0 ? _d : option.label));
|
|
42
42
|
})) : (react_1.default.createElement("div", { className: "uxf-dropdown__empty-wrapper" }, props.emptyMessage))));
|
|
43
43
|
};
|
|
44
44
|
Options.displayName = "UxfUiSelectBaseOptions";
|
|
@@ -50,14 +50,16 @@ const _SelectBase = (props) => {
|
|
|
50
50
|
const errorId = props.isInvalid ? `${id}--error-message` : undefined;
|
|
51
51
|
const input = (0, useInputFocus_1.useInputFocus)(innerRef, props.onBlur, props.onFocus);
|
|
52
52
|
const dropdown = (0, use_dropdown_1.useDropdown)((_b = props.dropdownPlacement) !== null && _b !== void 0 ? _b : "bottom", true);
|
|
53
|
-
const stableRef = (0, react_1.useMemo)(() => (0, composeRefs_1.composeRefs)(dropdown.reference), [dropdown.reference]);
|
|
53
|
+
const stableRef = (0, react_1.useMemo)(() => (0, composeRefs_1.composeRefs)(innerRef, props.forwardRef, dropdown.reference), [dropdown.reference, props.forwardRef]);
|
|
54
54
|
const iconName = (_c = props.iconName) !== null && _c !== void 0 ? _c : "chevronDown";
|
|
55
55
|
const Component = props.HUIComponent;
|
|
56
|
-
return (react_1.default.createElement(Component, { as: "div", className: (0, cx_1.cx)("uxf-form-
|
|
57
|
-
react_1.default.createElement("div", { className: "uxf-form-
|
|
56
|
+
return (react_1.default.createElement(Component, { as: "div", className: (0, cx_1.cx)("uxf-form-component uxf-sb", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.className), disabled: props.isDisabled || props.isReadOnly, onChange: props.onChange, value: props.value }, (renderProps) => (react_1.default.createElement(react_1.default.Fragment, null,
|
|
57
|
+
react_1.default.createElement("div", { className: "uxf-form-component__label" },
|
|
58
58
|
react_1.default.createElement(Component.Label, { as: label_1.Label, isHidden: props.hiddenLabel, onClick: props.isDisabled || props.isReadOnly ? undefined : input.focus }, props.label)),
|
|
59
|
-
react_1.default.createElement("div", { className: "uxf-form-
|
|
60
|
-
react_1.default.createElement(Component.Button, { "aria-invalid": props.isInvalid, "aria-describedby": errorId, as: input_1.Input, className: (0, cx_1.cx)("uxf-sb__button", dropdown.placement === "bottom" && `${classes_1.CLASSES.IS_OPEN}--bottom`, dropdown.placement === "top" && `${classes_1.CLASSES.IS_OPEN}--top`, renderProps.open && classes_1.CLASSES.IS_OPEN), customInputElementDisplayName: props.customInputElementDisplayName, inputFocus: input, isDisabled: props.isDisabled, isFocused: renderProps.open, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly,
|
|
59
|
+
react_1.default.createElement("div", { className: "uxf-form-component__input" },
|
|
60
|
+
react_1.default.createElement(Component.Button, { "aria-invalid": props.isInvalid, "aria-describedby": errorId, as: input_1.Input, className: (0, cx_1.cx)("uxf-sb__button", dropdown.placement === "bottom" && `${classes_1.CLASSES.IS_OPEN}--bottom`, dropdown.placement === "top" && `${classes_1.CLASSES.IS_OPEN}--top`, renderProps.open && classes_1.CLASSES.IS_OPEN), customInputElementDisplayName: props.customInputElementDisplayName, inputFocus: input, isDisabled: props.isDisabled, isFocused: renderProps.open, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly,
|
|
61
|
+
// ref={composeRefs(innerRef, props.forwardRef) as any as RefObject<HTMLButtonElement>}
|
|
62
|
+
size: props.size, variant: props.variant, wrapperRef: stableRef },
|
|
61
63
|
props.leftAddon && react_1.default.createElement(input_1.Input.LeftAddon, null, props.leftAddon),
|
|
62
64
|
props.leftElement && react_1.default.createElement(input_1.Input.LeftElement, null, props.leftElement),
|
|
63
65
|
props.children,
|
package/avatar/avatar.js
CHANGED
|
@@ -1,14 +1,34 @@
|
|
|
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.Avatar = void 0;
|
|
7
27
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
8
|
-
const react_1 =
|
|
9
|
-
const forwardRef_1 = require("@uxf/core/utils/forwardRef");
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
10
29
|
const icon_1 = require("../icon");
|
|
11
|
-
exports.Avatar = (0,
|
|
30
|
+
exports.Avatar = (0, react_1.forwardRef)((props, ref) => {
|
|
12
31
|
const avatarClassName = (0, cx_1.cx)("uxf-avatar", props.className);
|
|
13
32
|
return (react_1.default.createElement("div", { ref: ref, className: avatarClassName }, props.src ? react_1.default.createElement("img", { alt: "", className: "uxf-avatar__image", src: props.src }) : react_1.default.createElement(icon_1.Icon, { name: "user", size: 16 })));
|
|
14
33
|
});
|
|
34
|
+
exports.Avatar.displayName = "UxfUiAvatar";
|
package/badge/badge.js
CHANGED
|
@@ -1,15 +1,35 @@
|
|
|
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.Badge = void 0;
|
|
7
27
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
8
|
-
const react_1 =
|
|
9
|
-
|
|
10
|
-
exports.Badge = (0, forwardRef_1.forwardRef)("UxfUiBadge", (props, ref) => {
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
29
|
+
exports.Badge = (0, react_1.forwardRef)((props, ref) => {
|
|
11
30
|
var _a;
|
|
12
31
|
const badgeClassName = (0, cx_1.cx)("uxf-badge", `uxf-badge--size-${(_a = props.size) !== null && _a !== void 0 ? _a : "medium"}`, props.className);
|
|
13
32
|
return (react_1.default.createElement("div", { ref: ref, className: badgeClassName },
|
|
14
33
|
react_1.default.createElement("span", null, props.children)));
|
|
15
34
|
});
|
|
35
|
+
exports.Badge.displayName = "UxfUiBadge";
|
package/button/button.js
CHANGED
|
@@ -1,14 +1,33 @@
|
|
|
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.Button = void 0;
|
|
7
27
|
const useAnchorProps_1 = require("@uxf/core/hooks/useAnchorProps");
|
|
8
28
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
9
|
-
const react_1 =
|
|
10
|
-
|
|
11
|
-
exports.Button = (0, forwardRef_1.forwardRef)("UxfUiButton", (props, ref) => {
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
exports.Button = (0, react_1.forwardRef)((props, ref) => {
|
|
12
31
|
// eslint-disable-next-line react/destructuring-assignment
|
|
13
32
|
const { color, isIconButton, isFullWidth, size, variant, className, ...restProps } = props;
|
|
14
33
|
const anchorProps = (0, useAnchorProps_1.useAnchorProps)({
|
|
@@ -17,3 +36,4 @@ exports.Button = (0, forwardRef_1.forwardRef)("UxfUiButton", (props, ref) => {
|
|
|
17
36
|
});
|
|
18
37
|
return (react_1.default.createElement("a", { ref: ref, ...anchorProps }, typeof props.children === "string" ? (react_1.default.createElement("span", { className: "uxf-button__text" }, props.children)) : (props.children)));
|
|
19
38
|
});
|
|
39
|
+
exports.Button.displayName = "UxfUiButton";
|
package/checkbox/checkbox.js
CHANGED
|
@@ -1,16 +1,35 @@
|
|
|
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.Checkbox = void 0;
|
|
7
27
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
8
28
|
const useClickableProps_1 = require("@uxf/core/hooks/useClickableProps");
|
|
9
29
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
10
|
-
const
|
|
11
|
-
const react_1 = __importDefault(require("react"));
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
12
31
|
const icon_1 = require("../icon");
|
|
13
|
-
exports.Checkbox = (0,
|
|
32
|
+
exports.Checkbox = (0, react_1.forwardRef)((props, ref) => {
|
|
14
33
|
var _a, _b, _c;
|
|
15
34
|
const onChange = () => props.onChange(!props.value);
|
|
16
35
|
const clickableProps = (0, useClickableProps_1.useClickableProps)({
|
|
@@ -30,3 +49,4 @@ exports.Checkbox = (0, forwardRef_1.forwardRef)("UxfUiCheckbox", (props, ref) =>
|
|
|
30
49
|
const innerClassName = "uxf-checkbox__inner";
|
|
31
50
|
return (react_1.default.createElement("div", { ...clickableProps, ref: ref }, (_c = (_b = props.renderContent) === null || _b === void 0 ? void 0 : _b.call(props, innerClassName, props.value)) !== null && _c !== void 0 ? _c : react_1.default.createElement(icon_1.Icon, { className: innerClassName, name: "check" })));
|
|
32
51
|
});
|
|
52
|
+
exports.Checkbox.displayName = "UxfUiCheckbox";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { CSSProperties, ReactNode } from "react";
|
|
2
2
|
import { FormControlProps } from "../types";
|
|
3
|
-
export interface CheckboxButtonProps extends FormControlProps<boolean> {
|
|
3
|
+
export interface CheckboxButtonProps extends FormControlProps<boolean | undefined> {
|
|
4
4
|
className?: string;
|
|
5
5
|
label: ReactNode;
|
|
6
6
|
style?: CSSProperties;
|
|
@@ -1,18 +1,38 @@
|
|
|
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.CheckboxButton = void 0;
|
|
7
27
|
const react_1 = require("@headlessui/react");
|
|
8
|
-
const react_2 =
|
|
28
|
+
const react_2 = __importStar(require("react"));
|
|
9
29
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
10
30
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
11
|
-
const forwardRef_1 = require("@uxf/core/utils/forwardRef");
|
|
12
31
|
const icon_1 = require("../icon");
|
|
13
|
-
exports.CheckboxButton = (0,
|
|
32
|
+
exports.CheckboxButton = (0, react_2.forwardRef)((props, ref) => {
|
|
14
33
|
return (react_2.default.createElement(react_1.Switch, { checked: props.value, className: (0, cx_1.cx)("uxf-checkbox-button", props.className, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.value && classes_1.CLASSES.IS_SELECTED), disabled: props.isDisabled, name: props.name, onChange: props.onChange, ref: ref, style: props.style },
|
|
15
34
|
react_2.default.createElement("span", { className: "uxf-checkbox-button__label" }, props.label),
|
|
16
35
|
react_2.default.createElement("span", { className: "uxf-checkbox-button__icon" },
|
|
17
36
|
react_2.default.createElement(icon_1.Icon, { name: "check" }))));
|
|
18
37
|
});
|
|
38
|
+
exports.CheckboxButton.displayName = "UxfUiCheckboxButton";
|
|
@@ -25,13 +25,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.CheckboxInput = void 0;
|
|
27
27
|
const react_1 = require("@headlessui/react");
|
|
28
|
-
const forwardRef_1 = require("@uxf/core/utils/forwardRef");
|
|
29
28
|
const react_2 = __importStar(require("react"));
|
|
30
29
|
const checkbox_1 = require("../checkbox");
|
|
31
|
-
exports.CheckboxInput = (0,
|
|
30
|
+
exports.CheckboxInput = (0, react_2.forwardRef)((props, ref) => {
|
|
32
31
|
var _a;
|
|
33
32
|
return (react_2.default.createElement(react_1.Switch.Group, null,
|
|
34
33
|
react_2.default.createElement("div", { className: `uxf-checkbox-input__wrapper ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` },
|
|
35
34
|
react_2.default.createElement(react_1.Switch, { as: react_2.Fragment, checked: props.value, name: props.name, onChange: props.onChange }, ({ checked }) => (react_2.default.createElement(checkbox_1.Checkbox, { className: "uxf-checkbox-input", indeterminate: props.indeterminate, isDisabled: props.isDisabled, isFocused: props.isFocused, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly, isRequired: props.isRequired, onChange: props.onChange, ref: ref, size: props.size, style: props.style, value: checked }))),
|
|
36
35
|
react_2.default.createElement(react_1.Switch.Label, { className: "uxf-checkbox-input__label" }, props.label))));
|
|
37
36
|
});
|
|
37
|
+
exports.CheckboxInput.displayName = "UxfUiCheckboxInput";
|
package/chip/chip.js
CHANGED
|
@@ -1,13 +1,32 @@
|
|
|
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.Chip = void 0;
|
|
7
27
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
exports.Chip = (0, forwardRef_1.forwardRef)("UxfUiChip", (props, ref) => {
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
29
|
+
exports.Chip = (0, react_1.forwardRef)((props, ref) => {
|
|
11
30
|
var _a, _b;
|
|
12
31
|
const chipClassName = (0, cx_1.cx)("uxf-chip", `uxf-chip--color-${(_a = props.color) !== null && _a !== void 0 ? _a : "default"}`, `uxf-chip--size-${(_b = props.size) !== null && _b !== void 0 ? _b : "default"}`, props.onClose && "has-button", props.className);
|
|
13
32
|
return (react_1.default.createElement("div", { ref: ref, className: chipClassName },
|
|
@@ -17,3 +36,4 @@ exports.Chip = (0, forwardRef_1.forwardRef)("UxfUiChip", (props, ref) => {
|
|
|
17
36
|
react_1.default.createElement("svg", { stroke: "currentColor", fill: "none", viewBox: "0 0 8 8" },
|
|
18
37
|
react_1.default.createElement("path", { strokeLinecap: "round", strokeWidth: "1.5", d: "M1 1l6 6m0-6L1 7" }))))));
|
|
19
38
|
});
|
|
39
|
+
exports.Chip.displayName = "UxfUiChip";
|
|
@@ -1,17 +1,36 @@
|
|
|
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.ColorRadio = void 0;
|
|
7
27
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
8
28
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
9
|
-
const forwardRef_1 = require("@uxf/core/utils/forwardRef");
|
|
10
29
|
const color2k_1 = require("color2k");
|
|
11
|
-
const react_1 =
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
12
31
|
const useClickableProps_1 = require("@uxf/core/hooks/useClickableProps");
|
|
13
32
|
const icon_1 = require("../icon");
|
|
14
|
-
exports.ColorRadio = (0,
|
|
33
|
+
exports.ColorRadio = (0, react_1.forwardRef)((props, ref) => {
|
|
15
34
|
var _a, _b, _c;
|
|
16
35
|
const colorRadioStyle = {
|
|
17
36
|
"--bg-color": props.color,
|
|
@@ -37,3 +56,4 @@ exports.ColorRadio = (0, forwardRef_1.forwardRef)("UxfUiColorRadio", (props, ref
|
|
|
37
56
|
return (react_1.default.createElement("div", { ...clickableProps, ref: ref },
|
|
38
57
|
react_1.default.createElement("span", { className: "uxf-color-radio__color-label" }, props.colorLabel), (_c = (_b = props.renderContent) === null || _b === void 0 ? void 0 : _b.call(props, innerClassName, props.checked, props.colorLabel, props.value)) !== null && _c !== void 0 ? _c : (react_1.default.createElement(icon_1.Icon, { className: innerClassName, name: "check" }))));
|
|
39
58
|
});
|
|
59
|
+
exports.ColorRadio.displayName = "UxfUiColorRadio";
|
|
@@ -12,15 +12,15 @@ exports.default = {
|
|
|
12
12
|
};
|
|
13
13
|
function Default() {
|
|
14
14
|
const radios = (react_1.default.createElement(react_1.default.Fragment, null,
|
|
15
|
-
react_1.default.createElement("div", { className: "mt-4
|
|
15
|
+
react_1.default.createElement("div", { className: "mb-2 mt-4 font-semibold" }, "Default"),
|
|
16
16
|
react_1.default.createElement("div", { className: "flex flex-row gap-4" },
|
|
17
17
|
react_1.default.createElement(color_radio_1.ColorRadio, { checked: false, color: "#ff0000", colorLabel: "Red", value: 1 }),
|
|
18
18
|
react_1.default.createElement(color_radio_1.ColorRadio, { checked: true, color: "#cc0000", colorLabel: "Red", value: 2 })),
|
|
19
|
-
react_1.default.createElement("div", { className: "mt-4
|
|
19
|
+
react_1.default.createElement("div", { className: "mb-2 mt-4 font-semibold" }, "Invalid"),
|
|
20
20
|
react_1.default.createElement("div", { className: "flex flex-row gap-4" },
|
|
21
21
|
react_1.default.createElement(color_radio_1.ColorRadio, { checked: false, color: "#ff0000", colorLabel: "Red", isInvalid: true, value: 1 }),
|
|
22
22
|
react_1.default.createElement(color_radio_1.ColorRadio, { checked: true, color: "#ff0000", colorLabel: "Red", isInvalid: true, value: 2 })),
|
|
23
|
-
react_1.default.createElement("div", { className: "mt-4
|
|
23
|
+
react_1.default.createElement("div", { className: "mb-2 mt-4 font-semibold" }, "Disabled"),
|
|
24
24
|
react_1.default.createElement("div", { className: "flex flex-row gap-4" },
|
|
25
25
|
react_1.default.createElement(color_radio_1.ColorRadio, { checked: false, color: "#ff0000", colorLabel: "Red", isDisabled: true, value: 1 }),
|
|
26
26
|
react_1.default.createElement(color_radio_1.ColorRadio, { checked: true, color: "#ff0000", colorLabel: "Red", isDisabled: true, value: 2 }))));
|
|
@@ -2,6 +2,7 @@ import React, { CSSProperties, ReactNode } from "react";
|
|
|
2
2
|
import { FormControlProps, HexColor } from "../types";
|
|
3
3
|
export type ColorRadioGroupOptionValue = HexColor;
|
|
4
4
|
export interface ColorRadioGroupOption {
|
|
5
|
+
disabled?: boolean;
|
|
5
6
|
label: string;
|
|
6
7
|
value: ColorRadioGroupOptionValue;
|
|
7
8
|
}
|
|
@@ -30,20 +30,20 @@ const use_input_submit_1 = require("../hooks/use-input-submit");
|
|
|
30
30
|
const label_1 = require("../label");
|
|
31
31
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
32
32
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
33
|
-
const forwardRef_1 = require("@uxf/core/utils/forwardRef");
|
|
34
33
|
const color_radio_1 = require("../color-radio");
|
|
35
|
-
exports.ColorRadioGroup = (0,
|
|
34
|
+
exports.ColorRadioGroup = (0, react_2.forwardRef)((props, ref) => {
|
|
36
35
|
const innerRef = (0, react_2.useRef)(null);
|
|
37
36
|
(0, use_input_submit_1.useInputSubmit)(innerRef, "radio-group", props.isDisabled);
|
|
38
37
|
const errorId = props.isInvalid ? `${props.id}--errormessage` : undefined;
|
|
39
|
-
const rootClassName = (0, cx_1.cx)("uxf-form-
|
|
38
|
+
const rootClassName = (0, cx_1.cx)("uxf-form-component uxf-color-radio-group__wrapper", props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.className);
|
|
40
39
|
return (react_2.default.createElement(react_1.RadioGroup, { className: rootClassName, id: props.id, onChange: props.onChange, style: props.style, value: props.value },
|
|
41
|
-
react_2.default.createElement("div", { className: "uxf-form-
|
|
40
|
+
react_2.default.createElement("div", { className: "uxf-form-component__label" },
|
|
42
41
|
react_2.default.createElement(react_1.RadioGroup.Label, { as: label_1.Label, className: "uxf-color-radio-group__label", isHidden: props.hiddenLabel, ref: ref }, props.label)),
|
|
43
|
-
react_2.default.createElement("div", { className: "uxf-form-
|
|
42
|
+
react_2.default.createElement("div", { className: "uxf-form-component__input" },
|
|
44
43
|
react_2.default.createElement("div", { className: "uxf-color-radio-group__options-wrapper" }, props.options.map((option) => {
|
|
45
44
|
const optionStyle = { "--option-color": option.value };
|
|
46
45
|
return (react_2.default.createElement(react_1.RadioGroup.Option, { className: (0, cx_1.cx)("uxf-color-radio-group__option", props.isDisabled && classes_1.CLASSES.IS_DISABLED), key: option.value.toString(), value: option.value, style: optionStyle }, (o) => (react_2.default.createElement(color_radio_1.ColorRadio, { checked: o.checked, isDisabled: props.isDisabled || o.disabled, colorLabel: option.label, color: option.value, ref: o.checked ? innerRef : undefined, value: option.value }))));
|
|
47
46
|
})),
|
|
48
47
|
props.helperText && (react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-helper-text", props.isInvalid && classes_1.CLASSES.IS_INVALID), id: errorId }, props.helperText)))));
|
|
49
48
|
});
|
|
49
|
+
exports.ColorRadioGroup.displayName = "UxfUiColorRadioGroup";
|
package/color-scheme/index.d.ts
CHANGED
package/color-scheme/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useToggleColorScheme = exports.COLOR_SCHEME_DEFAULTS = void 0;
|
|
3
|
+
exports.useToggleColorScheme = exports.useColorScheme = exports.COLOR_SCHEME_DEFAULTS = void 0;
|
|
4
4
|
var color_scheme_defaults_1 = require("./color-scheme-defaults");
|
|
5
5
|
Object.defineProperty(exports, "COLOR_SCHEME_DEFAULTS", { enumerable: true, get: function () { return color_scheme_defaults_1.COLOR_SCHEME_DEFAULTS; } });
|
|
6
|
+
var use_color_scheme_1 = require("./use-color-scheme");
|
|
7
|
+
Object.defineProperty(exports, "useColorScheme", { enumerable: true, get: function () { return use_color_scheme_1.useColorScheme; } });
|
|
6
8
|
var use_toggle_color_scheme_1 = require("./use-toggle-color-scheme");
|
|
7
9
|
Object.defineProperty(exports, "useToggleColorScheme", { enumerable: true, get: function () { return use_toggle_color_scheme_1.useToggleColorScheme; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useColorScheme(): () => "dark" | "light" | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useColorScheme = void 0;
|
|
4
|
+
const isServer_1 = require("@uxf/core/utils/isServer");
|
|
5
|
+
function useColorScheme() {
|
|
6
|
+
return () => {
|
|
7
|
+
if (isServer_1.isServer) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const bodyClassList = document.body.classList;
|
|
11
|
+
if (bodyClassList.contains("light")) {
|
|
12
|
+
return "light";
|
|
13
|
+
}
|
|
14
|
+
if (bodyClassList.contains("dark")) {
|
|
15
|
+
return "dark";
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
exports.useColorScheme = useColorScheme;
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
|
|
27
27
|
&.is-invalid {
|
|
28
28
|
:root .light & {
|
|
29
|
-
@apply text-error
|
|
29
|
+
@apply text-error;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
:root .dark & {
|
|
33
|
-
@apply text-error
|
|
33
|
+
@apply text-error;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
|
|
42
42
|
&.is-invalid {
|
|
43
43
|
:root .light & {
|
|
44
|
-
@apply border-error
|
|
44
|
+
@apply border-error;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
:root .dark & {
|
|
48
|
-
@apply border-error
|
|
48
|
+
@apply border-error;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
|
|
72
72
|
&.is-invalid {
|
|
73
73
|
:root .light & {
|
|
74
|
-
@apply text-error
|
|
74
|
+
@apply text-error;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
:root .dark & {
|
|
78
|
-
@apply text-error
|
|
78
|
+
@apply text-error;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}
|