@uxf/ui 11.31.0 → 11.32.0
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 +4 -3
- package/_input-with-popover/input-with-popover.js +2 -2
- package/alert-bubble/alert-bubble.stories.js +3 -5
- package/avatar/avatar.js +1 -1
- package/avatar/avatar.stories.js +1 -2
- package/avatar-file-input/avatar-file-input.js +3 -2
- package/avatar-file-input/avatar-file-input.stories.js +4 -5
- package/badge/badge.js +1 -1
- package/badge/badge.stories.js +2 -4
- package/button/button.stories.js +8 -9
- package/button/next-link.d.ts +0 -1
- package/button-group/button-group.stories.d.ts +1 -1
- package/button-group/button-group.stories.js +9 -10
- package/button-list/button-list.js +7 -6
- package/button-list/button-list.stories.d.ts +1 -1
- package/button-list/button-list.stories.js +14 -14
- package/calendar/calendar-day-cell.js +1 -1
- package/calendar/calendar-navigation.js +1 -1
- package/calendar/calendar.js +5 -5
- package/calendar/calendar.stories.js +3 -6
- package/checkbox/checkbox.stories.js +5 -6
- package/checkbox-button/checkbox-button.stories.js +4 -5
- package/checkbox-input/checkbox-input.js +3 -3
- package/checkbox-input/checkbox-input.stories.js +6 -7
- package/chip/chip.js +5 -4
- package/chip/chip.stories.js +2 -3
- package/color-radio/color-radio.js +3 -3
- package/color-radio/color-radio.stories.js +8 -9
- package/color-radio-group/color-radio-group.js +1 -1
- package/color-radio-group/color-radio-group.stories.js +4 -4
- package/color-scheme/get-color-scheme-class-name.js +1 -2
- package/color-scheme/get-color-scheme.js +1 -2
- package/color-scheme/use-color-scheme.js +1 -2
- package/color-scheme/use-handle-color-scheme.js +1 -2
- package/color-scheme/use-toggle-color-scheme.js +1 -2
- package/combobox/combobox.js +7 -7
- package/combobox/combobox.stories.js +8 -9
- package/context/context.d.ts +0 -1
- package/context/use-component-context.d.ts +1 -1
- package/create-component-preview-page/create-component-preview-page.js +3 -3
- package/css/checkbox-button.css +2 -6
- package/css/checkbox.css +1 -3
- package/css/color-radio-group.css +1 -2
- package/css/input.css +1 -1
- package/css/list-item.css +1 -3
- package/css/pagination.css +1 -2
- package/css/radio-group.css +2 -4
- package/css/radio.css +1 -2
- package/date-picker/date-picker-decade.js +6 -5
- package/date-picker/date-picker-month.js +8 -7
- package/date-picker/date-picker-year.js +7 -6
- package/date-picker/date-picker.stories.js +6 -8
- package/date-picker-input/date-picker-input.js +1 -1
- package/date-picker-input/date-picker-input.stories.js +3 -5
- package/date-range-picker/date-range-picker-decade.js +6 -5
- package/date-range-picker/date-range-picker-month.js +6 -6
- package/date-range-picker/date-range-picker-year.js +8 -7
- package/date-range-picker/date-range-picker.stories.js +3 -6
- package/date-range-picker-input/date-range-picker-input.js +1 -1
- package/date-range-picker-input/date-range-picker-input.stories.js +8 -10
- package/datetime-picker/datetime-picker.js +3 -3
- package/datetime-picker/datetime-picker.stories.js +5 -8
- package/datetime-picker-input/datetime-picker-input.js +1 -2
- package/datetime-picker-input/datetime-picker-input.stories.js +3 -5
- package/datetime-picker-input/get-datetime-string.js +1 -2
- package/dialog/dialog.js +1 -1
- package/dialog/dialog.stories.js +1 -2
- package/dropdown/dropdown.stories.js +4 -6
- package/dropzone/dropzone-list.js +2 -2
- package/dropzone/dropzone.stories.js +10 -11
- package/dropzone/index.d.ts +0 -1
- package/error-message/error-message.js +1 -1
- package/error-message/error-message.stories.js +1 -2
- package/file-input/file-input.js +3 -3
- package/file-input/file-input.stories.js +6 -8
- package/flash-messages/flash-messages-service.d.ts +0 -1
- package/flash-messages/flash-messages-service.js +2 -3
- package/flash-messages/flash-messages.js +4 -4
- package/flash-messages/flash-messages.stories.js +1 -2
- package/form-component/form-component.js +2 -2
- package/form-component/form-component.stories.js +5 -6
- package/hooks/use-async-loading.js +1 -2
- package/hooks/use-dropdown.d.ts +1 -2
- package/hooks/use-dropdown.js +1 -2
- package/hooks/use-input-submit.js +1 -2
- package/icon/icon.js +2 -2
- package/icon/icon.stories.js +10 -11
- package/image-gallery/components/gallery.js +3 -3
- package/image-gallery/context.d.ts +0 -1
- package/image-gallery/image-gallery.js +1 -1
- package/image-gallery/image-gallery.stories.js +3 -4
- package/image-gallery/image.js +1 -1
- package/image-gallery/index.d.ts +0 -1
- package/image-gallery/use-image.js +1 -2
- package/input/index.d.ts +0 -1
- package/input/input-arrow-icon.js +1 -2
- package/input/input-element.js +1 -1
- package/input/input.js +1 -1
- package/input/input.stories.js +13 -14
- package/label/label.stories.js +1 -2
- package/layout/layout.js +6 -6
- package/layout/layout.stories.js +1 -2
- package/layout/uxf-logo.js +3 -3
- package/list-item/list-item.stories.js +3 -4
- package/loader/loader.js +1 -1
- package/loader/loader.stories.js +1 -2
- package/lozenge/lozenge.js +1 -1
- package/lozenge/lozenge.stories.js +1 -2
- package/message/message-content.js +1 -1
- package/message/message-service.d.ts +0 -1
- package/message/message.js +1 -1
- package/message/message.stories.js +1 -2
- package/modal/modal-service.d.ts +0 -1
- package/modal/modal-service.js +3 -4
- package/modal/modal.js +1 -1
- package/modal/modal.stories.js +1 -2
- package/modal-dialog/modal-dialog.js +1 -2
- package/modal-dialog/modal-dialog.stories.js +11 -12
- package/modal-header/modal-header.js +3 -4
- package/modal-header/modal-header.stories.js +6 -6
- package/multi-combobox/multi-combobox.js +9 -8
- package/multi-combobox/multi-combobox.stories.js +8 -9
- package/multi-select/multi-select.js +6 -5
- package/multi-select/multi-select.stories.d.ts +1 -1
- package/multi-select/multi-select.stories.js +9 -10
- package/package.json +9 -9
- package/pagination/pagination.stories.js +6 -7
- package/paper/paper.js +1 -1
- package/paper/paper.stories.js +1 -2
- package/radio/radio.stories.js +9 -10
- package/radio-group/radio-group.js +1 -1
- package/radio-group/radio-group.stories.js +9 -10
- package/raster-image/empty-image.js +1 -2
- package/raster-image/img-sources.js +6 -7
- package/raster-image/raster-image.js +3 -4
- package/raster-image/raster-image.stories.js +2 -3
- package/raster-image/responsive-img-sources.js +1 -2
- package/readmes.d.ts +0 -1
- package/select/select.js +3 -4
- package/select/select.stories.js +15 -16
- package/tabs/components/tabs-button-list.js +3 -3
- package/tabs/components/tabs-button.js +3 -3
- package/tabs/components/tabs-panel.js +1 -2
- package/tabs/components/tabs-panels.js +1 -2
- package/tabs/components/tabs-root.js +1 -2
- package/tabs/panel.js +2 -2
- package/tabs/tabs.js +4 -2
- package/tabs/tabs.stories.js +20 -21
- package/text-input/text-input.stories.js +9 -10
- package/text-link/text-link.stories.js +1 -2
- package/textarea/textarea.js +1 -1
- package/textarea/textarea.stories.js +6 -8
- package/time-picker/time-picker-hours.js +1 -1
- package/time-picker/time-picker-minutes.js +1 -1
- package/time-picker/time-picker.js +2 -2
- package/time-picker/time-picker.stories.js +3 -6
- package/time-picker-input/time-picker-input.js +1 -1
- package/time-picker-input/time-picker-input.stories.js +4 -5
- package/toggle/toggle.js +1 -1
- package/toggle/toggle.stories.js +6 -7
- package/tooltip/tooltip.js +2 -2
- package/tooltip/tooltip.stories.js +1 -2
- package/tooltip/use-tooltip.d.ts +7 -7
- package/tooltip/use-tooltip.js +1 -2
- package/types/file-response.d.ts +1 -1
- package/typography/typography.stories.js +1 -2
- package/utils/action.js +1 -2
- package/utils/files/get-file-icon.js +1 -2
- package/utils/files/get-file-url.js +1 -2
- package/utils/get-dropzone-state.js +3 -3
- package/utils/mocks/upload-file.mock.js +1 -2
- package/utils/snap-test.js +4 -4
- package/utils/storybook-config.d.ts +1 -1
- package/utils/storybook-config.js +3 -3
|
@@ -3,7 +3,7 @@ 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.Default =
|
|
6
|
+
exports.Default = Default;
|
|
7
7
|
const button_1 = require("@uxf/ui/button");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const storybook_config_1 = require("../utils/storybook-config");
|
|
@@ -69,4 +69,3 @@ function Default() {
|
|
|
69
69
|
react_1.default.createElement("div", { className: "uxf-typo-h5" }, "simple"),
|
|
70
70
|
react_1.default.createElement("div", { className: "flex flex-col space-y-4 px-5" }, getConfirmForSize("simple", config.colors)))));
|
|
71
71
|
}
|
|
72
|
-
exports.Default = Default;
|
package/modal/modal-service.d.ts
CHANGED
package/modal/modal-service.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getModalRef = getModalRef;
|
|
4
|
+
exports.openModal = openModal;
|
|
5
|
+
exports.closeModal = closeModal;
|
|
4
6
|
const react_1 = require("react");
|
|
5
7
|
const modalRef = (0, react_1.createRef)();
|
|
6
8
|
function getModalRef() {
|
|
7
9
|
return modalRef;
|
|
8
10
|
}
|
|
9
|
-
exports.getModalRef = getModalRef;
|
|
10
11
|
function openModal(modal) {
|
|
11
12
|
if (modalRef.current) {
|
|
12
13
|
modalRef.current.open(modal);
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
|
-
exports.openModal = openModal;
|
|
16
16
|
function closeModal() {
|
|
17
17
|
if (modalRef.current) {
|
|
18
18
|
modalRef.current.close();
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
exports.closeModal = closeModal;
|
package/modal/modal.js
CHANGED
|
@@ -46,6 +46,6 @@ exports.Modal = (0, react_1.forwardRef)((props, ref) => {
|
|
|
46
46
|
return null;
|
|
47
47
|
});
|
|
48
48
|
}, []);
|
|
49
|
-
return content ? (react_1.default.createElement(dialog_1.Dialog, { className: `uxf-modal uxf-modal--variant-${(_a = content.variant) !== null && _a !== void 0 ? _a : "default"} uxf-modal--width-${(_b = content.width) !== null && _b !== void 0 ? _b : "default"} ${(_c = content.className) !== null && _c !== void 0 ? _c : ""}`, disableBackdropClose: content.disableBackdropClose, onClose: onClose, open:
|
|
49
|
+
return content ? (react_1.default.createElement(dialog_1.Dialog, { className: `uxf-modal uxf-modal--variant-${(_a = content.variant) !== null && _a !== void 0 ? _a : "default"} uxf-modal--width-${(_b = content.width) !== null && _b !== void 0 ? _b : "default"} ${(_c = content.className) !== null && _c !== void 0 ? _c : ""}`, disableBackdropClose: content.disableBackdropClose, onClose: onClose, open: true, variant: content.variant }, content.children)) : null;
|
|
50
50
|
});
|
|
51
51
|
exports.Modal.displayName = "UxfUiModal";
|
package/modal/modal.stories.js
CHANGED
|
@@ -3,7 +3,7 @@ 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.Default =
|
|
6
|
+
exports.Default = Default;
|
|
7
7
|
const button_1 = require("@uxf/ui/button");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const modal_1 = require("./modal");
|
|
@@ -64,4 +64,3 @@ function Default() {
|
|
|
64
64
|
return (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
65
65
|
react_1.default.createElement("div", { className: "space-y-2 p-20 lg:w-1/2" }, storyModals)));
|
|
66
66
|
}
|
|
67
|
-
exports.Default = Default;
|
|
@@ -3,7 +3,7 @@ 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.ModalDialog =
|
|
6
|
+
exports.ModalDialog = ModalDialog;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
function ModalDialog(props) {
|
|
9
9
|
var _a;
|
|
@@ -14,4 +14,3 @@ function ModalDialog(props) {
|
|
|
14
14
|
props.children && react_1.default.createElement("div", { className: "uxf-modal-dialog__text" }, props.children),
|
|
15
15
|
props.footer && react_1.default.createElement("div", { className: "uxf-modal-dialog__footer" }, props.footer)));
|
|
16
16
|
}
|
|
17
|
-
exports.ModalDialog = ModalDialog;
|
|
@@ -3,27 +3,26 @@ 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.Default =
|
|
6
|
+
exports.Default = Default;
|
|
7
7
|
const button_1 = require("@uxf/ui/button");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const icon_1 = require("../icon");
|
|
10
10
|
const modal_dialog_1 = require("./modal-dialog");
|
|
11
11
|
function Default() {
|
|
12
12
|
return (react_1.default.createElement("div", { className: "space-y-6 bg-neutral-200 p-6" },
|
|
13
|
-
react_1.default.createElement(modal_dialog_1.ModalDialog, {
|
|
13
|
+
react_1.default.createElement(modal_dialog_1.ModalDialog, { footer: react_1.default.createElement(react_1.default.Fragment, null,
|
|
14
14
|
react_1.default.createElement(button_1.Button, { variant: "text" }, "Close"),
|
|
15
|
-
react_1.default.createElement(button_1.Button, null, "Button")) }, "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam erat volutpat. Praesent dapibus. Vestibulum fermentum tortor id mi."),
|
|
16
|
-
react_1.default.createElement(modal_dialog_1.ModalDialog, {
|
|
15
|
+
react_1.default.createElement(button_1.Button, null, "Button")), title: "Default dialog" }, "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam erat volutpat. Praesent dapibus. Vestibulum fermentum tortor id mi."),
|
|
16
|
+
react_1.default.createElement(modal_dialog_1.ModalDialog, { footer: react_1.default.createElement(react_1.default.Fragment, null,
|
|
17
17
|
react_1.default.createElement(button_1.Button, { variant: "text" }, "Close"),
|
|
18
|
-
react_1.default.createElement(button_1.Button, { color: "warning" }, "Button")) }, "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam erat volutpat. Praesent dapibus. Vestibulum fermentum tortor id mi."),
|
|
19
|
-
react_1.default.createElement(modal_dialog_1.ModalDialog, {
|
|
18
|
+
react_1.default.createElement(button_1.Button, { color: "warning" }, "Button")), icon: react_1.default.createElement(icon_1.Icon, { color: "warning", name: "triangle-exclamation" }), title: "Warning dialog" }, "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam erat volutpat. Praesent dapibus. Vestibulum fermentum tortor id mi."),
|
|
19
|
+
react_1.default.createElement(modal_dialog_1.ModalDialog, { footer: react_1.default.createElement(react_1.default.Fragment, null,
|
|
20
20
|
react_1.default.createElement(button_1.Button, { variant: "text" }, "Cancel"),
|
|
21
|
-
react_1.default.createElement(button_1.Button, { color: "positive" }, "Save")) }, "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam erat volutpat. Praesent dapibus. Vestibulum fermentum tortor id mi."),
|
|
22
|
-
react_1.default.createElement(modal_dialog_1.ModalDialog, {
|
|
21
|
+
react_1.default.createElement(button_1.Button, { color: "positive" }, "Save")), icon: react_1.default.createElement(icon_1.Icon, { color: "positive", name: "youtube" }), title: "Positive dialog asda ksdjahs kjdhakj shdk jahksdjh kajsdh k" }, "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam erat volutpat. Praesent dapibus. Vestibulum fermentum tortor id mi."),
|
|
22
|
+
react_1.default.createElement(modal_dialog_1.ModalDialog, { footer: react_1.default.createElement(react_1.default.Fragment, null,
|
|
23
23
|
react_1.default.createElement(button_1.Button, { variant: "text" }, "Cancel"),
|
|
24
|
-
react_1.default.createElement(button_1.Button, { color: "negative" }, "Save")) }, "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam erat volutpat. Praesent dapibus. Vestibulum fermentum tortor id mi."),
|
|
25
|
-
react_1.default.createElement(modal_dialog_1.ModalDialog, {
|
|
24
|
+
react_1.default.createElement(button_1.Button, { color: "negative" }, "Save")), icon: react_1.default.createElement(icon_1.Icon, { color: "negative", name: "xmark" }), title: "Negative dialog" }, "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam erat volutpat. Praesent dapibus. Vestibulum fermentum tortor id mi."),
|
|
25
|
+
react_1.default.createElement(modal_dialog_1.ModalDialog, { footer: react_1.default.createElement(react_1.default.Fragment, null,
|
|
26
26
|
react_1.default.createElement(button_1.Button, { variant: "text" }, "Cancel"),
|
|
27
|
-
react_1.default.createElement(button_1.Button, { color: "info" }, "Save")) }, "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam erat volutpat. Praesent dapibus. Vestibulum fermentum tortor id mi.")));
|
|
27
|
+
react_1.default.createElement(button_1.Button, { color: "info" }, "Save")), icon: react_1.default.createElement(icon_1.Icon, { color: "info", name: "circle-info" }), title: "Info dialog" }, "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam erat volutpat. Praesent dapibus. Vestibulum fermentum tortor id mi.")));
|
|
28
28
|
}
|
|
29
|
-
exports.Default = Default;
|
|
@@ -3,7 +3,7 @@ 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.ModalHeader =
|
|
6
|
+
exports.ModalHeader = ModalHeader;
|
|
7
7
|
const show_1 = require("@uxf/core-react/components/show");
|
|
8
8
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
9
9
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
@@ -13,7 +13,7 @@ const icon_1 = require("../icon");
|
|
|
13
13
|
function ModalHeader(props) {
|
|
14
14
|
return (react_1.default.createElement("header", { className: (0, cx_1.cx)("uxf-modal-header", props.onGoBack && "uxf-modal-header--has-go-back") },
|
|
15
15
|
react_1.default.createElement(show_1.Show, { when: (0, is_not_nil_1.isNotNil)(props.onGoBack) },
|
|
16
|
-
react_1.default.createElement(button_1.Button, { onClick: props.onGoBack, size: "sm", variant: "text"
|
|
16
|
+
react_1.default.createElement(button_1.Button, { isIconButton: true, onClick: props.onGoBack, size: "sm", variant: "text" },
|
|
17
17
|
react_1.default.createElement(icon_1.Icon, { name: "angle-left" }))),
|
|
18
18
|
react_1.default.createElement("div", { className: "uxf-modal-header__text-wrapper" },
|
|
19
19
|
react_1.default.createElement("div", { className: "uxf-modal-header__title" }, props.title),
|
|
@@ -21,7 +21,6 @@ function ModalHeader(props) {
|
|
|
21
21
|
react_1.default.createElement("div", { className: "uxf-modal-header__description" }, props.description))),
|
|
22
22
|
props.actionsComponent,
|
|
23
23
|
react_1.default.createElement(show_1.Show, { when: (0, is_not_nil_1.isNotNil)(props.onClose) },
|
|
24
|
-
react_1.default.createElement(button_1.Button, { onClick: props.onClose, size: "sm", variant: "text"
|
|
24
|
+
react_1.default.createElement(button_1.Button, { isIconButton: true, onClick: props.onClose, size: "sm", variant: "text" },
|
|
25
25
|
react_1.default.createElement(icon_1.Icon, { name: "xmark" })))));
|
|
26
26
|
}
|
|
27
|
-
exports.ModalHeader = ModalHeader;
|
|
@@ -3,17 +3,17 @@ 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.Default =
|
|
6
|
+
exports.Default = Default;
|
|
7
|
+
const noop_1 = require("@uxf/core/utils/noop");
|
|
7
8
|
const react_1 = __importDefault(require("react"));
|
|
8
9
|
const button_1 = require("../button");
|
|
9
10
|
const icon_1 = require("../icon");
|
|
10
11
|
const modal_header_1 = require("./modal-header");
|
|
11
12
|
function Default() {
|
|
12
13
|
return (react_1.default.createElement("div", { className: "flex max-w-[480px] flex-col gap-4 p-8" },
|
|
13
|
-
react_1.default.createElement(modal_header_1.ModalHeader, { title: "Time of details"
|
|
14
|
+
react_1.default.createElement(modal_header_1.ModalHeader, { onClose: noop_1.noop, title: "Time of details" }),
|
|
14
15
|
react_1.default.createElement(modal_header_1.ModalHeader, { description: "View and manage your time off", title: "Time of details" }),
|
|
15
|
-
react_1.default.createElement(modal_header_1.ModalHeader, { description: "View and manage your time off", onClose:
|
|
16
|
-
react_1.default.createElement(modal_header_1.ModalHeader, { actionsComponent: react_1.default.createElement(button_1.Button, { onClick: () => alert("action!"), size: "sm", variant: "text"
|
|
17
|
-
react_1.default.createElement(icon_1.Icon, { name: "ellipsis-vertical" })), description: "View and manage your time off", onClose:
|
|
16
|
+
react_1.default.createElement(modal_header_1.ModalHeader, { description: "View and manage your time off", onClose: noop_1.noop, onGoBack: () => alert("going back!"), title: "Time of details" }),
|
|
17
|
+
react_1.default.createElement(modal_header_1.ModalHeader, { actionsComponent: react_1.default.createElement(button_1.Button, { isIconButton: true, onClick: () => alert("action!"), size: "sm", variant: "text" },
|
|
18
|
+
react_1.default.createElement(icon_1.Icon, { name: "ellipsis-vertical" })), description: "View and manage your time off", onClose: noop_1.noop, onGoBack: () => alert("going back!"), title: "Time of details" })));
|
|
18
19
|
}
|
|
19
|
-
exports.Default = Default;
|
|
@@ -30,6 +30,7 @@ const show_1 = require("@uxf/core-react/components/show");
|
|
|
30
30
|
const use_input_focus_1 = require("@uxf/core-react/hooks/use-input-focus");
|
|
31
31
|
const compose_refs_1 = require("@uxf/core-react/utils/compose-refs");
|
|
32
32
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
33
|
+
const empty_array_1 = require("@uxf/core/constants/empty-array");
|
|
33
34
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
34
35
|
const is_empty_1 = require("@uxf/core/utils/is-empty");
|
|
35
36
|
const is_not_empty_1 = require("@uxf/core/utils/is-not-empty");
|
|
@@ -59,7 +60,7 @@ function Option(props) {
|
|
|
59
60
|
const option = props.option;
|
|
60
61
|
return (react_3.default.createElement(react_2.Combobox.Option, { className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item uxf-multi-combobox__dropdown-item", optionState.active && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED), disabled: option.disabled, value: option }, (optionState) => {
|
|
61
62
|
var _a, _b;
|
|
62
|
-
return (react_3.default.createElement(react_3.default.Fragment, null, props.withCheckboxes ? (react_3.default.createElement(checkbox_input_1.CheckboxInput, { isDisabled: optionState.disabled, isFocused: optionState.active, label: option.label, name: option.id.toString(), onChange: props.handleCheckboxChange, value: optionState.selected })) : ((_b = (_a = props.renderOption) === null || _a === void 0 ? void 0 : _a.call(props, props.option)) !== null && _b !== void 0 ? _b : option.label)));
|
|
63
|
+
return (react_3.default.createElement(react_3.default.Fragment, null, props.withCheckboxes ? (react_3.default.createElement(checkbox_input_1.CheckboxInput, { isDisabled: optionState.disabled, isFocused: optionState.active, label: option.label, name: option.id.toString(), onChange: props.handleCheckboxChange, value: optionState.selected })) : (((_b = (_a = props.renderOption) === null || _a === void 0 ? void 0 : _a.call(props, props.option)) !== null && _b !== void 0 ? _b : option.label))));
|
|
63
64
|
}));
|
|
64
65
|
}
|
|
65
66
|
Option.displayName = "UxfUiMultiComboboxOption";
|
|
@@ -75,8 +76,8 @@ Options.displayName = "UxfUiMultiComboboxOptions";
|
|
|
75
76
|
function useMultiComboboxOptions(query, props) {
|
|
76
77
|
var _a, _b;
|
|
77
78
|
const isAsync = (0, is_not_nil_1.isNotNil)(props.loadOptions);
|
|
78
|
-
const options = (0, use_async_loading_1.useAsyncLoading)(query, (_a = props.options) !== null && _a !== void 0 ? _a :
|
|
79
|
-
const selectedOptions = (_b = props.value) !== null && _b !== void 0 ? _b :
|
|
79
|
+
const options = (0, use_async_loading_1.useAsyncLoading)(query, (_a = props.options) !== null && _a !== void 0 ? _a : empty_array_1.EMPTY_ARRAY, props.loadOptions);
|
|
80
|
+
const selectedOptions = (_b = props.value) !== null && _b !== void 0 ? _b : empty_array_1.EMPTY_ARRAY;
|
|
80
81
|
const filteredOptions = isAsync
|
|
81
82
|
? options
|
|
82
83
|
: options.filter((item) => (!selectedOptions.some((v) => v.id === item.id) || props.withCheckboxes) &&
|
|
@@ -133,12 +134,12 @@ exports.MultiCombobox = (0, react_3.forwardRef)((props, ref) => {
|
|
|
133
134
|
setQuery("");
|
|
134
135
|
};
|
|
135
136
|
const emptyMessage = (0, is_empty_1.isEmpty)(query)
|
|
136
|
-
? (_d = props.noQueryMessage) !== null && _d !== void 0 ? _d : "Pro zobrazení možností začněte psát"
|
|
137
|
+
? ((_d = props.noQueryMessage) !== null && _d !== void 0 ? _d : "Pro zobrazení možností začněte psát")
|
|
137
138
|
: selectedOptions.length === options.length && (0, is_not_empty_1.isNotEmpty)(selectedOptions)
|
|
138
|
-
? (_e = props.allOptionsSelectedMessage) !== null && _e !== void 0 ? _e : "Všechny možnosti jsou již vybrány"
|
|
139
|
+
? ((_e = props.allOptionsSelectedMessage) !== null && _e !== void 0 ? _e : "Všechny možnosti jsou již vybrány")
|
|
139
140
|
: (0, is_empty_1.isEmpty)(options)
|
|
140
|
-
? (_f = props.noOptionsMessage) !== null && _f !== void 0 ? _f : "Nabídka neosahuje žádné položky"
|
|
141
|
-
: (_g = props.notFoundMessage) !== null && _g !== void 0 ? _g : "Nic nenalezeno";
|
|
141
|
+
? ((_f = props.noOptionsMessage) !== null && _f !== void 0 ? _f : "Nabídka neosahuje žádné položky")
|
|
142
|
+
: ((_g = props.notFoundMessage) !== null && _g !== void 0 ? _g : "Nic nenalezeno");
|
|
142
143
|
const onBlur = (e) => {
|
|
143
144
|
/* TODO: refactor component to enable this */
|
|
144
145
|
// setQuery("");
|
|
@@ -152,7 +153,7 @@ exports.MultiCombobox = (0, react_3.forwardRef)((props, ref) => {
|
|
|
152
153
|
react_3.default.createElement("div", { className: "uxf-form-component__label" },
|
|
153
154
|
react_3.default.createElement(react_2.Combobox.Label, { as: label_1.Label, isHidden: props.hiddenLabel, onClick: isNotInteractive ? undefined : input.focus }, props.label)),
|
|
154
155
|
react_3.default.createElement("div", { className: "uxf-form-component__input" },
|
|
155
|
-
react_3.default.createElement(react_2.Combobox.Button, { "aria-
|
|
156
|
+
react_3.default.createElement(react_2.Combobox.Button, { "aria-describedby": errorId, "aria-invalid": props.isInvalid, as: "div", className: (0, cx_1.cx)("uxf-input uxf-multi-combobox__button", (renderProps.open || input.focused) && classes_1.CLASSES.IS_FOCUSED, renderProps.disabled && classes_1.CLASSES.IS_DISABLED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isInvalid && classes_1.CLASSES.IS_INVALID, 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), onBlur: input.onBlur, onFocus: input.onFocus, ref: stableRef },
|
|
156
157
|
props.leftAddon && react_3.default.createElement(input_1.Input.LeftAddon, null, props.leftAddon),
|
|
157
158
|
props.leftElement && react_3.default.createElement(input_1.Input.LeftElement, null, props.leftElement),
|
|
158
159
|
react_3.default.createElement("div", { className: "uxf-multi-combobox__selected-options" },
|
|
@@ -26,7 +26,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.Default = Default;
|
|
30
|
+
exports.Async = Async;
|
|
31
|
+
exports.ComponentStructure = ComponentStructure;
|
|
30
32
|
const react_1 = __importStar(require("react"));
|
|
31
33
|
const action_1 = require("../utils/action");
|
|
32
34
|
const component_structure_analyzer_1 = __importDefault(require("../utils/component-structure-analyzer"));
|
|
@@ -62,16 +64,15 @@ function Default() {
|
|
|
62
64
|
react_1.default.createElement(multi_combobox_1.MultiCombobox, { helperText: "Start typing to see options...", id: "multi-combobox-3", label: "MultiCombobox with helper text", name: "multi-combobox", onChange: onChange, options: options, placeholder: "Vyberte...", value: value }),
|
|
63
65
|
react_1.default.createElement(multi_combobox_1.MultiCombobox, { helperText: "Error message", id: "multi-combobox-4", isInvalid: true, isRequired: true, label: "MultiCombobox invalid", name: "multi-combobox-invalid", onChange: onChange, options: options, placeholder: "Vyberte...", value: value }),
|
|
64
66
|
react_1.default.createElement(multi_combobox_1.MultiCombobox, { dropdownPlacement: "top", id: "multi-combobox-5", label: "MultiCombobox with dropdown top", name: "multi-combobox", onChange: onChange, options: options, placeholder: "Vyberte...", value: value }),
|
|
65
|
-
react_1.default.createElement(multi_combobox_1.MultiCombobox, { id: "multi-combobox-6", label: "MultiCombobox with renderOption", name: "multi-combobox", onChange: onChange, options: options, placeholder: "Vyberte...",
|
|
67
|
+
react_1.default.createElement(multi_combobox_1.MultiCombobox, { id: "multi-combobox-6", label: "MultiCombobox with renderOption", name: "multi-combobox", onChange: onChange, options: options, placeholder: "Vyberte...", renderOption: (option) => react_1.default.createElement(react_1.default.Fragment, null,
|
|
66
68
|
"Option: ",
|
|
67
|
-
option.label) }),
|
|
68
|
-
react_1.default.createElement(multi_combobox_1.MultiCombobox, { id: "multi-combobox-disabled", label: "MultiCombobox disabled", name: "multi-combobox-disabled", onChange: onChange, options: options, placeholder: "Vyberte...",
|
|
69
|
+
option.label), value: value }),
|
|
70
|
+
react_1.default.createElement(multi_combobox_1.MultiCombobox, { id: "multi-combobox-disabled", isDisabled: true, label: "MultiCombobox disabled", name: "multi-combobox-disabled", onChange: onChange, options: options, placeholder: "Vyberte...", renderOption: (option) => react_1.default.createElement(react_1.default.Fragment, null,
|
|
69
71
|
"Option: ",
|
|
70
|
-
option.label),
|
|
72
|
+
option.label), value: value })));
|
|
71
73
|
return (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
72
74
|
react_1.default.createElement("div", { className: "space-y-2 p-20 lg:w-1/2" }, storyComboboxes)));
|
|
73
75
|
}
|
|
74
|
-
exports.Default = Default;
|
|
75
76
|
function Async() {
|
|
76
77
|
const [value, setValue] = (0, react_1.useState)(null);
|
|
77
78
|
const onChange = (0, action_1.action)("onChange", (v) => {
|
|
@@ -81,14 +82,12 @@ function Async() {
|
|
|
81
82
|
});
|
|
82
83
|
const loadOptions = (query) => Promise.resolve(options.filter((option) => !query || option.label.toLowerCase().includes(query.toLowerCase())));
|
|
83
84
|
const storyComboboxes = (react_1.default.createElement("div", { className: "space-y-8" },
|
|
84
|
-
react_1.default.createElement(multi_combobox_1.MultiCombobox, { id: "multi-combobox-async-1", label: "MultiCombobox", name: "multi-combobox", onChange: onChange,
|
|
85
|
+
react_1.default.createElement(multi_combobox_1.MultiCombobox, { id: "multi-combobox-async-1", label: "MultiCombobox", loadOptions: loadOptions, name: "multi-combobox", onChange: onChange, placeholder: "Vyberte...", value: value })));
|
|
85
86
|
return (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
86
87
|
react_1.default.createElement("div", { className: "space-y-2 p-20 lg:w-1/2" }, storyComboboxes)));
|
|
87
88
|
}
|
|
88
|
-
exports.Async = Async;
|
|
89
89
|
function ComponentStructure() {
|
|
90
90
|
const [value, onChange] = (0, react_1.useState)(null);
|
|
91
91
|
return (react_1.default.createElement(component_structure_analyzer_1.default, null,
|
|
92
92
|
react_1.default.createElement(multi_combobox_1.MultiCombobox, { helperText: "Start typing to see options...", id: "multi-combobox-structure", label: "MultiCombobox with helper text", name: "multi-combobox", onChange: onChange, options: options, value: value })));
|
|
93
93
|
}
|
|
94
|
-
exports.ComponentStructure = ComponentStructure;
|
|
@@ -30,6 +30,7 @@ const show_1 = require("@uxf/core-react/components/show");
|
|
|
30
30
|
const use_input_focus_1 = require("@uxf/core-react/hooks/use-input-focus");
|
|
31
31
|
const compose_refs_1 = require("@uxf/core-react/utils/compose-refs");
|
|
32
32
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
33
|
+
const empty_array_1 = require("@uxf/core/constants/empty-array");
|
|
33
34
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
34
35
|
const is_empty_1 = require("@uxf/core/utils/is-empty");
|
|
35
36
|
const is_not_empty_1 = require("@uxf/core/utils/is-not-empty");
|
|
@@ -56,7 +57,7 @@ function Option(props) {
|
|
|
56
57
|
const option = props.option;
|
|
57
58
|
return (react_3.default.createElement(react_2.Listbox.Option, { className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item uxf-multi-select__dropdown-item", optionState.active && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED), disabled: option.disabled, value: option }, (optionState) => {
|
|
58
59
|
var _a, _b;
|
|
59
|
-
return (react_3.default.createElement(react_3.default.Fragment, null, props.withCheckboxes ? (react_3.default.createElement(checkbox_input_1.CheckboxInput, { isDisabled: optionState.disabled, isFocused: optionState.active, label: option.label, name: option.id.toString(), onChange: props.handleCheckboxChange, value: optionState.selected })) : ((_b = (_a = props.renderOption) === null || _a === void 0 ? void 0 : _a.call(props, props.option)) !== null && _b !== void 0 ? _b : option.label)));
|
|
60
|
+
return (react_3.default.createElement(react_3.default.Fragment, null, props.withCheckboxes ? (react_3.default.createElement(checkbox_input_1.CheckboxInput, { isDisabled: optionState.disabled, isFocused: optionState.active, label: option.label, name: option.id.toString(), onChange: props.handleCheckboxChange, value: optionState.selected })) : (((_b = (_a = props.renderOption) === null || _a === void 0 ? void 0 : _a.call(props, props.option)) !== null && _b !== void 0 ? _b : option.label))));
|
|
60
61
|
}));
|
|
61
62
|
}
|
|
62
63
|
Option.displayName = "UxfUiMultiSelectOption";
|
|
@@ -79,7 +80,7 @@ exports.MultiSelect = (0, react_3.forwardRef)((props, ref) => {
|
|
|
79
80
|
const input = (0, use_input_focus_1.useInputFocus)(innerRef, props.onBlur, props.onFocus);
|
|
80
81
|
const stableRef = (0, react_3.useMemo)(() => (0, compose_refs_1.composeRefs)(innerRef, ref, dropdown.refs.setReference), [ref, dropdown.refs.setReference]);
|
|
81
82
|
const iconName = (_c = props.iconName) !== null && _c !== void 0 ? _c : "caretDown";
|
|
82
|
-
const selectedOptions = (_d = props.value) !== null && _d !== void 0 ? _d :
|
|
83
|
+
const selectedOptions = (_d = props.value) !== null && _d !== void 0 ? _d : empty_array_1.EMPTY_ARRAY;
|
|
83
84
|
const filteredOptions = props.options.filter((option) => !selectedOptions.some((v) => v.id === option.id) || props.withCheckboxes);
|
|
84
85
|
const inputKeyDownHandler = (e) => {
|
|
85
86
|
if (e.key === "Backspace" && (0, is_not_empty_1.isNotEmpty)(selectedOptions)) {
|
|
@@ -105,8 +106,8 @@ exports.MultiSelect = (0, react_3.forwardRef)((props, ref) => {
|
|
|
105
106
|
}
|
|
106
107
|
};
|
|
107
108
|
const emptyMessage = (0, is_empty_1.isEmpty)(filteredOptions) && (0, is_not_empty_1.isNotEmpty)(selectedOptions)
|
|
108
|
-
? (_e = props.allOptionsSelectedMessage) !== null && _e !== void 0 ? _e : "Všechny možnosti jsou již vybrány"
|
|
109
|
-
: (_f = props.noOptionsMessage) !== null && _f !== void 0 ? _f : "Nabídka neosahuje žádné položky";
|
|
109
|
+
? ((_e = props.allOptionsSelectedMessage) !== null && _e !== void 0 ? _e : "Všechny možnosti jsou již vybrány")
|
|
110
|
+
: ((_f = props.noOptionsMessage) !== null && _f !== void 0 ? _f : "Nabídka neosahuje žádné položky");
|
|
110
111
|
const isNotInteractive = props.isDisabled || props.isReadOnly;
|
|
111
112
|
return (react_3.default.createElement(react_2.Listbox, { as: "div", className: (0, cx_1.cx)("uxf-form-component uxf-multi-select", 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), "data-name": props.name, disabled: isNotInteractive, form: props.form, multiple: true, name: props.name, onChange: props.onChange, value: selectedOptions }, (renderProps) => {
|
|
112
113
|
var _a, _b;
|
|
@@ -114,7 +115,7 @@ exports.MultiSelect = (0, react_3.forwardRef)((props, ref) => {
|
|
|
114
115
|
react_3.default.createElement("div", { className: "uxf-form-component__label" },
|
|
115
116
|
react_3.default.createElement(react_2.Listbox.Label, { as: label_1.Label, isHidden: props.hiddenLabel, onClick: isNotInteractive ? undefined : input.focus }, props.label)),
|
|
116
117
|
react_3.default.createElement("div", { className: "uxf-form-component__input" },
|
|
117
|
-
react_3.default.createElement(react_2.Listbox.Button, { "aria-
|
|
118
|
+
react_3.default.createElement(react_2.Listbox.Button, { "aria-describedby": errorId, "aria-invalid": props.isInvalid, as: "div", className: (0, cx_1.cx)("uxf-input uxf-multi-select__button", (renderProps.open || input.focused) && classes_1.CLASSES.IS_FOCUSED, renderProps.disabled && classes_1.CLASSES.IS_DISABLED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isInvalid && classes_1.CLASSES.IS_INVALID, 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), id: id, onBlur: input.onBlur, onFocus: input.onFocus, onKeyDown: inputKeyDownHandler, ref: stableRef, tabIndex: isNotInteractive ? undefined : 0 },
|
|
118
119
|
props.leftAddon && react_3.default.createElement(input_1.Input.LeftAddon, null, props.leftAddon),
|
|
119
120
|
props.leftElement && react_3.default.createElement(input_1.Input.LeftElement, null, props.leftElement),
|
|
120
121
|
react_3.default.createElement("div", { className: (0, cx_1.cx)("uxf-input__element uxf-multi-select__input", (0, is_empty_1.isEmpty)(selectedOptions) && `${classes_1.CLASSES.IS_EMPTY} uxf-multi-select__input--is-empty`) }, (0, is_empty_1.isEmpty)(selectedOptions)
|
|
@@ -5,5 +5,5 @@ declare const _default: {
|
|
|
5
5
|
component: React.ForwardRefExoticComponent<import("./types").MultiSelectProps<import("./types").MultiSelectValueId, MultiSelectOption<import("./types").MultiSelectValueId>> & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
|
9
9
|
export declare function ComponentStructure(): React.JSX.Element;
|
|
@@ -26,7 +26,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.Default = Default;
|
|
30
|
+
exports.ComponentStructure = ComponentStructure;
|
|
30
31
|
const component_structure_analyzer_1 = __importDefault(require("@uxf/ui/utils/component-structure-analyzer"));
|
|
31
32
|
const react_1 = __importStar(require("react"));
|
|
32
33
|
const action_1 = require("../utils/action");
|
|
@@ -49,7 +50,7 @@ const options = [
|
|
|
49
50
|
{ id: "twelve", label: "Option twelve" },
|
|
50
51
|
{ id: "thirteen", label: "Option thirteen" },
|
|
51
52
|
];
|
|
52
|
-
|
|
53
|
+
function Default() {
|
|
53
54
|
const [value, setValue] = (0, react_1.useState)(null);
|
|
54
55
|
const onChange = (0, action_1.action)("onChange", (v) => {
|
|
55
56
|
// eslint-disable-next-line no-console
|
|
@@ -62,19 +63,17 @@ const Default = () => {
|
|
|
62
63
|
react_1.default.createElement(multi_select_1.MultiSelect, { helperText: "Start typing to see options...", id: "multi-select-3", label: "MultiSelect with helper text", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte...", value: value }),
|
|
63
64
|
react_1.default.createElement(multi_select_1.MultiSelect, { helperText: "Error message", id: "multi-select-4", isInvalid: true, isRequired: true, label: "MultiSelect invalid", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte...", value: value }),
|
|
64
65
|
react_1.default.createElement(multi_select_1.MultiSelect, { dropdownPlacement: "top", id: "multi-select-5", label: "MultiSelect with dropdown top", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte...", value: value }),
|
|
65
|
-
react_1.default.createElement(multi_select_1.MultiSelect, { id: "multi-select-6", label: "MultiSelect with renderOption", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte...",
|
|
66
|
+
react_1.default.createElement(multi_select_1.MultiSelect, { id: "multi-select-6", label: "MultiSelect with renderOption", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte...", renderOption: (option) => react_1.default.createElement(react_1.default.Fragment, null,
|
|
66
67
|
"Option: ",
|
|
67
|
-
option.label) }),
|
|
68
|
-
react_1.default.createElement(multi_select_1.MultiSelect, { id: "multi-select-disabled", label: "MultiSelect disabled", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte...",
|
|
68
|
+
option.label), value: value }),
|
|
69
|
+
react_1.default.createElement(multi_select_1.MultiSelect, { id: "multi-select-disabled", isDisabled: true, label: "MultiSelect disabled", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte...", renderOption: (option) => react_1.default.createElement(react_1.default.Fragment, null,
|
|
69
70
|
"Option: ",
|
|
70
|
-
option.label),
|
|
71
|
+
option.label), value: value })));
|
|
71
72
|
return (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
72
73
|
react_1.default.createElement("div", { className: "space-y-2 p-20 lg:w-1/2" }, component)));
|
|
73
|
-
}
|
|
74
|
-
exports.Default = Default;
|
|
74
|
+
}
|
|
75
75
|
function ComponentStructure() {
|
|
76
76
|
const [value, onChange] = (0, react_1.useState)(null);
|
|
77
77
|
return (react_1.default.createElement(component_structure_analyzer_1.default, null,
|
|
78
|
-
react_1.default.createElement(multi_select_1.MultiSelect, { helperText: "Start typing to see options...", label: "MultiSelect with helper text",
|
|
78
|
+
react_1.default.createElement(multi_select_1.MultiSelect, { helperText: "Start typing to see options...", id: "multi-select-structure", label: "MultiSelect with helper text", name: "multi-select-structure", onChange: onChange, options: options, value: value })));
|
|
79
79
|
}
|
|
80
|
-
exports.ComponentStructure = ComponentStructure;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/ui",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.32.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"author": "UX Fans s.r.o",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@floating-ui/react": "0.26.
|
|
18
|
+
"@floating-ui/react": "0.26.23",
|
|
19
19
|
"@headlessui/react": "1.7.14",
|
|
20
|
-
"@uxf/core": "11.
|
|
21
|
-
"@uxf/core-react": "11.
|
|
22
|
-
"@uxf/datepicker": "11.
|
|
23
|
-
"@uxf/styles": "11.
|
|
20
|
+
"@uxf/core": "11.32.0",
|
|
21
|
+
"@uxf/core-react": "11.32.0",
|
|
22
|
+
"@uxf/datepicker": "11.32.0",
|
|
23
|
+
"@uxf/styles": "11.32.0",
|
|
24
24
|
"color2k": "2.0.3",
|
|
25
|
-
"dayjs": "1.11.
|
|
25
|
+
"dayjs": "1.11.13",
|
|
26
26
|
"jump.js": "1.0.2",
|
|
27
27
|
"react-dropzone": "14.2.3",
|
|
28
28
|
"react-swipeable": "7.0.1"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/jump.js": "1.0.6",
|
|
36
|
-
"@types/react": "18.
|
|
37
|
-
"@types/react-dom": "18.
|
|
36
|
+
"@types/react": "18.3.5",
|
|
37
|
+
"@types/react-dom": "18.3.0"
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Default =
|
|
26
|
+
exports.Default = Default;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
const action_1 = require("../utils/action");
|
|
29
29
|
const pagination_1 = require("./pagination");
|
|
@@ -36,10 +36,9 @@ function Default() {
|
|
|
36
36
|
const onPageChange = (0, action_1.action)("onPageChange", setPage);
|
|
37
37
|
return (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
38
38
|
react_1.default.createElement("div", { className: "space-y-2 p-20 lg:w-1/2" },
|
|
39
|
-
react_1.default.createElement(pagination_1.Pagination, { count: 10,
|
|
40
|
-
react_1.default.createElement(pagination_1.Pagination, { count: 10,
|
|
41
|
-
react_1.default.createElement(pagination_1.Pagination, { count: 10,
|
|
42
|
-
react_1.default.createElement(pagination_1.Pagination, { count: 10,
|
|
43
|
-
react_1.default.createElement(pagination_1.Pagination, { count: 10,
|
|
39
|
+
react_1.default.createElement(pagination_1.Pagination, { count: 10, onPageChange: onPageChange, page: page, size: "xs" }),
|
|
40
|
+
react_1.default.createElement(pagination_1.Pagination, { count: 10, onPageChange: onPageChange, page: page, size: "sm" }),
|
|
41
|
+
react_1.default.createElement(pagination_1.Pagination, { count: 10, onPageChange: onPageChange, page: page, size: "default" }),
|
|
42
|
+
react_1.default.createElement(pagination_1.Pagination, { count: 10, onPageChange: onPageChange, page: page, size: "lg" }),
|
|
43
|
+
react_1.default.createElement(pagination_1.Pagination, { count: 10, onPageChange: onPageChange, page: page, size: "xl" }))));
|
|
44
44
|
}
|
|
45
|
-
exports.Default = Default;
|
package/paper/paper.js
CHANGED
|
@@ -28,6 +28,6 @@ const cx_1 = require("@uxf/core/utils/cx");
|
|
|
28
28
|
const react_1 = __importStar(require("react"));
|
|
29
29
|
exports.Paper = (0, react_1.forwardRef)((props, ref) => {
|
|
30
30
|
const paperClassName = (0, cx_1.cx)("uxf-paper", props.className);
|
|
31
|
-
return (react_1.default.createElement("div", {
|
|
31
|
+
return (react_1.default.createElement("div", { className: paperClassName, ref: ref }, props.children));
|
|
32
32
|
});
|
|
33
33
|
exports.Paper.displayName = "UxfUiPaper";
|
package/paper/paper.stories.js
CHANGED
|
@@ -3,7 +3,7 @@ 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.Default =
|
|
6
|
+
exports.Default = Default;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const paper_1 = require("./paper");
|
|
9
9
|
exports.default = {
|
|
@@ -15,4 +15,3 @@ function Default() {
|
|
|
15
15
|
react_1.default.createElement(paper_1.Paper, null,
|
|
16
16
|
react_1.default.createElement("div", { className: "flex items-center justify-center p-24" }, "Paper default"))));
|
|
17
17
|
}
|
|
18
|
-
exports.Default = Default;
|
package/radio/radio.stories.js
CHANGED
|
@@ -3,7 +3,7 @@ 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.Default =
|
|
6
|
+
exports.Default = Default;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const index_1 = require("./index");
|
|
9
9
|
exports.default = {
|
|
@@ -14,21 +14,20 @@ function Default() {
|
|
|
14
14
|
const radios = (react_1.default.createElement("div", { className: "dark:text-white" },
|
|
15
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
|
-
react_1.default.createElement(index_1.Radio, { checked: false,
|
|
18
|
-
react_1.default.createElement(index_1.Radio, { checked: true,
|
|
17
|
+
react_1.default.createElement(index_1.Radio, { checked: false, name: "radio-1", value: 1 }),
|
|
18
|
+
react_1.default.createElement(index_1.Radio, { checked: true, name: "radio-2", value: 2 })),
|
|
19
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
|
-
react_1.default.createElement(index_1.Radio, { checked: false, isInvalid: true,
|
|
22
|
-
react_1.default.createElement(index_1.Radio, { checked: true, isInvalid: true,
|
|
21
|
+
react_1.default.createElement(index_1.Radio, { checked: false, isInvalid: true, name: "radio-invalid-1", value: 1 }),
|
|
22
|
+
react_1.default.createElement(index_1.Radio, { checked: true, isInvalid: true, name: "radio-invalid-2", value: 2 })),
|
|
23
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
|
-
react_1.default.createElement(index_1.Radio, { checked: false, isDisabled: true,
|
|
26
|
-
react_1.default.createElement(index_1.Radio, { checked: true, isDisabled: true,
|
|
25
|
+
react_1.default.createElement(index_1.Radio, { checked: false, isDisabled: true, name: "radio-disabled-1", value: 1 }),
|
|
26
|
+
react_1.default.createElement(index_1.Radio, { checked: true, isDisabled: true, name: "radio-disabled-2", value: 2 })),
|
|
27
27
|
react_1.default.createElement("div", { className: "mb-2 mt-4 font-semibold" }, "size lg"),
|
|
28
28
|
react_1.default.createElement("div", { className: "flex flex-row gap-4" },
|
|
29
|
-
react_1.default.createElement(index_1.Radio, { checked: false,
|
|
30
|
-
react_1.default.createElement(index_1.Radio, { checked: true,
|
|
29
|
+
react_1.default.createElement(index_1.Radio, { checked: false, name: "radio-size-lg-1", size: "lg", value: 1 }),
|
|
30
|
+
react_1.default.createElement(index_1.Radio, { checked: true, name: "radio-size-lg-2", size: "lg", value: 2 }))));
|
|
31
31
|
return (react_1.default.createElement("div", { className: "flex" },
|
|
32
32
|
react_1.default.createElement("div", { className: "p-20" }, radios)));
|
|
33
33
|
}
|
|
34
|
-
exports.Default = Default;
|
|
@@ -45,7 +45,7 @@ exports.RadioGroup = (0, react_2.forwardRef)((props, ref) => {
|
|
|
45
45
|
react_2.default.createElement("div", { className: "uxf-form-component__input" },
|
|
46
46
|
react_2.default.createElement("div", { className: "uxf-radio-group__options-wrapper" }, props.options.map((option) => (react_2.default.createElement(react_1.RadioGroup.Option, { className: (0, cx_1.cx)("uxf-radio-group__option", props.isDisabled && classes_1.CLASSES.IS_DISABLED), disabled: option.disabled, key: option.id.toString(), value: option.id }, (o) => (react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-radio-group__option-wrapper", o.checked && classes_1.CLASSES.IS_SELECTED) },
|
|
47
47
|
react_2.default.createElement("span", { className: "uxf-radio-group__option-label" }, option.label),
|
|
48
|
-
react_2.default.createElement(radio_1.Radio, { checked: o.checked, isDisabled: props.isDisabled || o.disabled, isInvalid: props.isInvalid, ref: o.checked ? innerRef : undefined, size: radioSize, value: option.id
|
|
48
|
+
react_2.default.createElement(radio_1.Radio, { checked: o.checked, isDisabled: props.isDisabled || o.disabled, isInvalid: props.isInvalid, name: props.name, ref: o.checked ? innerRef : undefined, size: radioSize, value: option.id }))))))),
|
|
49
49
|
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)))));
|
|
50
50
|
});
|
|
51
51
|
exports.RadioGroup.displayName = "UxfUiRadioGroup";
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Default =
|
|
26
|
+
exports.Default = Default;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
const action_1 = require("../utils/action");
|
|
29
29
|
const index_1 = require("./index");
|
|
@@ -46,15 +46,14 @@ const options = [
|
|
|
46
46
|
},
|
|
47
47
|
];
|
|
48
48
|
function Default() {
|
|
49
|
-
|
|
49
|
+
var _a, _b;
|
|
50
|
+
const [value, setValue] = (0, react_1.useState)((_b = (_a = options.at(0)) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : null);
|
|
50
51
|
const onChange = (0, action_1.action)("onChange", setValue);
|
|
51
52
|
const testRadioGroups = (react_1.default.createElement("div", { className: "space-y-10" },
|
|
52
|
-
react_1.default.createElement(index_1.RadioGroup, { id: "radiogroup", label: "Light Radio group", onChange: onChange, options: options, value: value
|
|
53
|
-
react_1.default.createElement(index_1.RadioGroup, { id: "radiogroup", label: "Radio group variant radio button", onChange: onChange, options: options, value: value, variant: "radioButton"
|
|
54
|
-
react_1.default.createElement(index_1.RadioGroup, { hiddenLabel: true, id: "radiogroup", label: "Radio group variant row with hidden label", onChange: onChange, options: options, value: value, variant: "row"
|
|
55
|
-
react_1.default.createElement(index_1.RadioGroup, { id: "radiogroup", label: "Radio group variant column, radioSize default", onChange: onChange, options: options,
|
|
56
|
-
react_1.default.createElement(index_1.RadioGroup, { id: "radiogroup", label: "Radio group variant row, radioSize lg", onChange: onChange, options: options,
|
|
57
|
-
return
|
|
58
|
-
react_1.default.createElement("div", { className: "rounded p-8" }, testRadioGroups)));
|
|
53
|
+
react_1.default.createElement(index_1.RadioGroup, { id: "radiogroup", label: "Light Radio group", name: "radio-group-light", onChange: onChange, options: options, value: value }),
|
|
54
|
+
react_1.default.createElement(index_1.RadioGroup, { id: "radiogroup", label: "Radio group variant radio button", name: "radio-group", onChange: onChange, options: options, value: value, variant: "radioButton" }),
|
|
55
|
+
react_1.default.createElement(index_1.RadioGroup, { hiddenLabel: true, id: "radiogroup", label: "Radio group variant row with hidden label", name: "radio-group-hidden-label", onChange: onChange, options: options, value: value, variant: "row" }),
|
|
56
|
+
react_1.default.createElement(index_1.RadioGroup, { id: "radiogroup", label: "Radio group variant column, radioSize default", name: "radio-group-variant-column", onChange: onChange, options: options, radioSize: "default", value: value, variant: "column" }),
|
|
57
|
+
react_1.default.createElement(index_1.RadioGroup, { id: "radiogroup", label: "Radio group variant row, radioSize lg", name: "radio-group-variant-row", onChange: onChange, options: options, radioSize: "lg", value: value, variant: "row" })));
|
|
58
|
+
return react_1.default.createElement("div", { className: "rounded p-8" }, testRadioGroups);
|
|
59
59
|
}
|
|
60
|
-
exports.Default = Default;
|
|
@@ -3,11 +3,10 @@ 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.EmptyImage =
|
|
6
|
+
exports.EmptyImage = EmptyImage;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
function EmptyImage(props) {
|
|
9
9
|
return (react_1.default.createElement("picture", { className: `uxf-raster-image--no-image ${props.className}` },
|
|
10
10
|
react_1.default.createElement("img", { alt: props.alt, className: props.imgClassName, height: 1, src: "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==", width: 1 }),
|
|
11
11
|
props.noImageContent));
|
|
12
12
|
}
|
|
13
|
-
exports.EmptyImage = EmptyImage;
|