@uxf/ui 11.31.0 → 11.33.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.d.ts +1 -3
- package/button/button.js +2 -2
- package/button/button.stories.js +15 -11
- 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.d.ts +1 -0
- package/button-list/button-list.js +10 -9
- 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/button-list.css +1 -1
- package/css/checkbox-button.css +2 -6
- package/css/checkbox.css +1 -3
- package/css/color-radio-group.css +1 -2
- package/css/colors.css +5 -0
- package/css/dialog.css +1 -0
- package/css/input.css +1 -1
- package/css/list-item.css +1 -3
- package/css/modal-header.css +4 -4
- 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.d.ts +1 -1
- package/date-range-picker/date-range-picker.stories.js +4 -6
- package/date-range-picker-input/date-range-picker-input.js +2 -2
- 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.d.ts +1 -1
- package/time-picker/time-picker.js +2 -2
- package/time-picker/time-picker.stories.js +4 -7
- 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
package/layout/uxf-logo.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.UxfLogo = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const UxfLogo = (props) => {
|
|
9
|
-
return (react_1.default.createElement("svg", {
|
|
10
|
-
react_1.default.createElement("path", {
|
|
11
|
-
react_1.default.createElement("path", {
|
|
9
|
+
return (react_1.default.createElement("svg", { height: "40", width: "179" },
|
|
10
|
+
react_1.default.createElement("path", { clipRule: "evenodd", d: "M33.563 12.874a9.103 9.103 0 0 0 0-12.874L20.69 12.874l.107.105a9.103 9.103 0 0 0 12.766-.105Zm-20.69-6.437a9.103 9.103 0 0 1 .106 12.766l-.105.107L0 6.437a9.103 9.103 0 0 1 12.874 0ZM40 33.563 27.127 20.69l-.106.107a9.103 9.103 0 0 0 12.98 12.766Zm-20.69-6.437-.107-.105A9.103 9.103 0 0 0 6.437 40l12.874-12.874Z", fill: "#FF4F06", fillRule: "evenodd" }),
|
|
11
|
+
react_1.default.createElement("path", { clipRule: "evenodd", d: "m84.325 7.295 5.133 8.675h.199l5.158-8.675h6.078l-7.768 12.727 7.942 12.727h-6.19l-5.22-8.687h-.199l-5.22 8.687h-6.165l7.967-12.727-7.818-12.727h6.103Zm-24.194 0v16.07c0 .97.214 1.832.64 2.586a4.58 4.58 0 0 0 1.809 1.777c.779.431 1.686.647 2.722.647 1.044 0 1.953-.216 2.728-.647a4.591 4.591 0 0 0 1.802-1.777c.427-.754.64-1.616.64-2.585V7.296h5.382v16.53c0 1.856-.441 3.48-1.324 4.872-.882 1.392-2.115 2.475-3.697 3.25-1.583.775-3.426 1.162-5.531 1.162-2.113 0-3.96-.387-5.543-1.162-1.583-.775-2.813-1.858-3.692-3.25-.878-1.392-1.317-3.016-1.317-4.872V7.296h5.381ZM170.25 13.41c2.411 0 4.311.51 5.698 1.529 1.388 1.019 2.198 2.407 2.43 4.164l-4.847.298a2.555 2.555 0 0 0-.534-1.125 2.942 2.942 0 0 0-1.075-.808c-.444-.203-.972-.304-1.585-.304-.821 0-1.512.172-2.076.515-.563.344-.845.802-.845 1.374 0 .456.182.84.547 1.156.364.315.99.567 1.877.758l3.455.696c1.856.381 3.24.994 4.151 1.84.912.845 1.367 1.955 1.367 3.33 0 1.252-.366 2.35-1.1 3.294-.733.945-1.736 1.68-3.007 2.206-1.272.526-2.737.79-4.394.79-2.527 0-4.539-.529-6.034-1.585-1.496-1.057-2.372-2.496-2.629-4.32l5.208-.273c.157.77.538 1.357 1.143 1.759.605.402 1.38.603 2.324.603.928 0 1.676-.18 2.244-.54.567-.361.855-.827.864-1.4-.009-.48-.212-.875-.609-1.186-.398-.31-1.011-.55-1.84-.715l-3.306-.659c-1.864-.372-3.25-1.019-4.157-1.938-.908-.92-1.361-2.093-1.361-3.518 0-1.226.333-2.283 1-3.17.667-.886 1.608-1.57 2.821-2.05 1.214-.48 2.637-.72 4.27-.72Zm-36.686.373a12.285 12.285 0 0 0-3.051-.373c-1.525 0-2.865.23-4.021.69-1.156.46-2.098 1.114-2.827 1.964-.73.849-1.219 1.854-1.467 3.014l4.897.397c.182-.63.555-1.153 1.119-1.572.563-.418 1.321-.627 2.274-.627.903 0 1.601.215 2.094.646.493.43.74 1.04.74 1.827v.075c0 .405-.153.712-.46.92-.307.206-.8.362-1.479.465-.68.104-1.574.214-2.685.33-.944.09-1.845.248-2.703.472a7.698 7.698 0 0 0-2.293.994 4.727 4.727 0 0 0-1.591 1.74c-.39.721-.584 1.612-.584 2.673 0 1.259.275 2.31.826 3.15a5.147 5.147 0 0 0 2.256 1.902c.953.427 2.038.64 3.257.64.944 0 1.777-.126 2.498-.38a5.55 5.55 0 0 0 1.852-1.055 5.31 5.31 0 0 0 1.23-1.573h.149v2.648h5.022V19.873c0-1.135-.22-2.11-.659-2.927a5.655 5.655 0 0 0-1.796-2.007 8.039 8.039 0 0 0-2.598-1.156Zm-13.424-2.05V7.294h-16.853v25.454h5.381V22.235h10.354v-4.438h-10.354v-6.065h11.472Zm32.603 1.677c1.326 0 2.482.29 3.468.87.986.58 1.753 1.407 2.3 2.48.546 1.073.82 2.35.82 3.834V32.75h-5.295V21.539c.008-1.169-.29-2.082-.895-2.74-.605-.66-1.437-.989-2.498-.989-.713 0-1.34.153-1.883.46a3.166 3.166 0 0 0-1.268 1.336c-.302.584-.458 1.286-.466 2.107V32.75h-5.295V13.659h5.047v3.368H147a5.358 5.358 0 0 1 2.126-2.641c.994-.65 2.2-.976 3.616-.976Zm-20.061 10.782c.286-.087.512-.184.678-.292v2.026c0 .671-.17 1.272-.51 1.802-.34.53-.808.951-1.404 1.262-.597.31-1.285.466-2.064.466-.812 0-1.481-.189-2.007-.566-.526-.377-.789-.925-.789-1.646 0-.497.128-.914.385-1.25.257-.335.617-.602 1.082-.801a6.547 6.547 0 0 1 1.628-.435l.969-.143a24.15 24.15 0 0 0 1.069-.186c.356-.071.677-.15.963-.237Z", fill: props.isDark ? "#140939" : "#FFF", fillRule: "evenodd" })));
|
|
12
12
|
};
|
|
13
13
|
exports.UxfLogo = UxfLogo;
|
|
@@ -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 icon_1 = require("../icon");
|
|
9
9
|
const index_1 = require("./index");
|
|
@@ -25,9 +25,8 @@ function Default() {
|
|
|
25
25
|
react_1.default.createElement("div", { className: "border-gray500 border-b" }),
|
|
26
26
|
react_1.default.createElement(index_1.ListItem, { onClick: onClick }, "No end icon"),
|
|
27
27
|
react_1.default.createElement("div", { className: "border-gray500 border-b" }),
|
|
28
|
-
react_1.default.createElement(index_1.ListItem, { endElement: react_1.default.createElement(icon_1.Icon, {
|
|
29
|
-
react_1.default.createElement(index_1.ListItem, { endElement: react_1.default.createElement(icon_1.Icon, {
|
|
28
|
+
react_1.default.createElement(index_1.ListItem, { endElement: react_1.default.createElement(icon_1.Icon, { className: "text-success", name: "camera", size: 24 }), onClick: onClick }, "End element"),
|
|
29
|
+
react_1.default.createElement(index_1.ListItem, { endElement: react_1.default.createElement(icon_1.Icon, { className: "text-success", name: "camera", size: 24 }), endIcon: "chevronRight", onClick: onClick }, "End element and end icon")));
|
|
30
30
|
return (react_1.default.createElement("div", { className: "flex" },
|
|
31
31
|
react_1.default.createElement("div", { className: "grow gap-4 p-4" }, storyListItem)));
|
|
32
32
|
}
|
|
33
|
-
exports.Default = Default;
|
package/loader/loader.js
CHANGED
|
@@ -29,6 +29,6 @@ const react_1 = __importStar(require("react"));
|
|
|
29
29
|
exports.Loader = (0, react_1.forwardRef)((props, ref) => {
|
|
30
30
|
var _a;
|
|
31
31
|
const loaderClassName = (0, cx_1.cx)("uxf-loader", `uxf-loader--size-${(_a = props.size) !== null && _a !== void 0 ? _a : "default"}`, props.className);
|
|
32
|
-
return react_1.default.createElement("span", {
|
|
32
|
+
return react_1.default.createElement("span", { className: loaderClassName, ref: ref });
|
|
33
33
|
});
|
|
34
34
|
exports.Loader.displayName = "UxfUiLoader";
|
package/loader/loader.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 loader_1 = require("./loader");
|
|
9
9
|
exports.default = {
|
|
@@ -18,4 +18,3 @@ function Default() {
|
|
|
18
18
|
return (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
19
19
|
react_1.default.createElement("div", { className: "space-x-4 space-y-4 p-8" }, loaders)));
|
|
20
20
|
}
|
|
21
|
-
exports.Default = Default;
|
package/lozenge/lozenge.js
CHANGED
|
@@ -29,7 +29,7 @@ const react_1 = __importStar(require("react"));
|
|
|
29
29
|
exports.Lozenge = (0, react_1.forwardRef)((props, ref) => {
|
|
30
30
|
var _a, _b;
|
|
31
31
|
const lozengeClassName = (0, cx_1.cx)("uxf-lozenge", `uxf-lozenge--color-${(_a = props.color) !== null && _a !== void 0 ? _a : "default"}`, `uxf-lozenge--variant-${(_b = props.variant) !== null && _b !== void 0 ? _b : "default"}`, props.className);
|
|
32
|
-
return (react_1.default.createElement("div", {
|
|
32
|
+
return (react_1.default.createElement("div", { className: lozengeClassName, ref: ref },
|
|
33
33
|
react_1.default.createElement("span", { className: "uxf-lozenge__text" }, props.children)));
|
|
34
34
|
});
|
|
35
35
|
exports.Lozenge.displayName = "UxfLozenge";
|
|
@@ -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 lozenge_1 = require("@uxf/ui/lozenge");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const storybook_config_1 = require("../utils/storybook-config");
|
|
@@ -14,4 +14,3 @@ function Default() {
|
|
|
14
14
|
" / ",
|
|
15
15
|
color))))));
|
|
16
16
|
}
|
|
17
|
-
exports.Default = Default;
|
|
@@ -35,7 +35,7 @@ const MessageContent = (props) => {
|
|
|
35
35
|
react_1.default.createElement("p", { className: "uxf-message__description" }, props.description)),
|
|
36
36
|
props.children),
|
|
37
37
|
react_1.default.createElement("div", { className: "uxf-message__buttons-wrapper" },
|
|
38
|
-
react_1.default.createElement(button_1.Button, { className: "uxf-message__cancel-button",
|
|
38
|
+
react_1.default.createElement(button_1.Button, { className: "uxf-message__cancel-button", isFullWidth: isCentered, onClick: onCancelClick, variant: "secondary" }, props.cancelLabel),
|
|
39
39
|
props.onAccept ? (react_1.default.createElement(button_1.Button, { className: "uxf-message__accept-button", color: BUTTON_COLOR[props.color], isFullWidth: isCentered, onClick: onAcceptClick }, (_c = props.acceptLabel) !== null && _c !== void 0 ? _c : "Ok")) : null)));
|
|
40
40
|
};
|
|
41
41
|
exports.MessageContent = MessageContent;
|
package/message/message.js
CHANGED
|
@@ -41,7 +41,7 @@ exports.Message = (0, react_1.forwardRef)((props, ref) => {
|
|
|
41
41
|
close: innerRef.current.close,
|
|
42
42
|
message: innerRef.current.message,
|
|
43
43
|
}), []);
|
|
44
|
-
return content ? (react_1.default.createElement(dialog_1.Dialog, { className: (0, cx_1.cx)("uxf-message", `uxf-message--variant-${(_a = content.variant) !== null && _a !== void 0 ? _a : "simple"}`, `uxf-message--color-${content.color}`, content.className), disableBackdropClose: true, onClose: close, open:
|
|
44
|
+
return content ? (react_1.default.createElement(dialog_1.Dialog, { className: (0, cx_1.cx)("uxf-message", `uxf-message--variant-${(_a = content.variant) !== null && _a !== void 0 ? _a : "simple"}`, `uxf-message--color-${content.color}`, content.className), disableBackdropClose: true, onClose: close, open: true },
|
|
45
45
|
react_1.default.createElement(message_content_1.MessageContent, { CustomIconComponent: content.CustomIconComponent, acceptLabel: content.acceptLabel, cancelLabel: content.cancelLabel, color: content.color, description: content.description, icon: content.icon, onAccept: content.onAccept, onCancel: content.onCancel, onClose: close, title: content.title, variant: content.variant }, content.children))) : null;
|
|
46
46
|
});
|
|
47
47
|
exports.Message.displayName = "UxfUiMessage";
|
|
@@ -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.33.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.33.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;
|