@uxf/ui 10.0.0-beta.7 → 10.0.0-beta.76
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 +9 -1
- package/_select-base/_select-base.d.ts +1 -1
- package/_select-base/_select-base.js +4 -3
- package/alert-bubble/alert-bubble.d.ts +8 -0
- package/alert-bubble/alert-bubble.js +22 -0
- package/alert-bubble/alert-bubble.spec.d.ts +1 -0
- package/alert-bubble/alert-bubble.spec.js +9 -0
- package/alert-bubble/alert-bubble.stories.d.ts +7 -0
- package/alert-bubble/alert-bubble.stories.js +50 -0
- package/alert-bubble/index.d.ts +3 -0
- package/alert-bubble/index.js +5 -0
- package/alert-bubble/theme.d.ts +16 -0
- package/alert-bubble/theme.js +2 -0
- package/avatar-file-input/avatar-file-input.d.ts +3 -0
- package/avatar-file-input/avatar-file-input.js +10 -4
- package/avatar-file-input/avatar-file-input.stories.js +2 -2
- package/avatar-file-input/theme.d.ts +5 -0
- package/avatar-file-input/theme.js +2 -0
- package/button/theme.d.ts +1 -0
- package/calendar/calendar-day-cell.d.ts +3 -0
- package/calendar/calendar-day-cell.js +14 -14
- package/{date-picker/date-picker-navigation.d.ts → calendar/calendar-navigation.d.ts} +2 -3
- package/{date-picker/date-picker-navigation.js → calendar/calendar-navigation.js} +6 -6
- package/calendar/calendar-provider.js +1 -1
- package/calendar/calendar.d.ts +5 -0
- package/calendar/calendar.js +5 -8
- package/calendar/index.d.ts +4 -1
- package/calendar/index.js +5 -15
- package/chip/chip.js +6 -4
- package/chip/chip.stories.js +37 -28
- package/combobox/combobox.d.ts +1 -1
- package/combobox/combobox.stories.d.ts +2 -1
- package/combobox/combobox.stories.js +6 -2
- package/config/icons-config.d.ts +1 -1
- package/config/icons-config.js +1 -1
- package/config/icons.d.ts +13 -3
- package/config/icons.js +3 -1
- package/css/alert-bubble.css +100 -0
- package/css/avatar-file-input.css +54 -20
- package/css/avatar.css +3 -3
- package/css/badge.css +5 -5
- package/css/button-group.css +1 -1
- package/css/button-list.css +2 -2
- package/css/button.css +72 -26
- package/css/calendar.css +115 -51
- package/css/checkbox-button.css +8 -8
- package/css/checkbox.css +9 -9
- package/css/chip.css +217 -318
- package/css/color-radio-group.css +1 -1
- package/css/color-radio.css +3 -3
- package/css/component-structure-analyzer.css +12 -12
- package/css/date-picker.css +10 -3
- package/css/date-range-picker.css +21 -0
- package/css/datetime-picker.css +2 -2
- package/css/dialog.css +55 -0
- package/css/dropdown.css +10 -2
- package/css/dropzone.css +7 -7
- package/css/error-message.css +1 -1
- package/css/file-input.css +2 -2
- package/css/flash-messages.css +133 -9
- package/css/icon.css +1 -1
- package/css/image-gallery.css +7 -7
- package/css/input-with-popover.css +1 -1
- package/css/input.css +8 -8
- package/css/layout.css +4 -4
- package/css/list-item.css +2 -2
- package/css/message.css +92 -0
- package/css/modal.css +10 -54
- package/css/multi-combobox.css +10 -10
- package/css/pagination.css +14 -14
- package/css/paper.css +1 -1
- package/css/radio-group.css +3 -3
- package/css/radio.css +7 -7
- package/css/raster-image.css +1 -1
- package/css/select-base.css +1 -1
- package/css/tabs.css +13 -13
- package/css/text-link.css +4 -4
- package/css/textarea.css +68 -76
- package/css/time-picker.css +12 -16
- package/css/toggle.css +1 -1
- package/css/tooltip.css +2 -2
- package/date-picker/date-picker-content.d.ts +5 -2
- package/date-picker/date-picker-content.js +2 -1
- package/date-picker/date-picker-decade.js +6 -6
- package/date-picker/date-picker-month.js +6 -6
- package/date-picker/date-picker-year.js +2 -2
- package/date-picker/date-picker.d.ts +4 -1
- package/date-picker/date-picker.js +3 -1
- package/date-picker-input/date-picker-input.d.ts +2 -0
- package/date-picker-input/date-picker-input.js +3 -1
- package/date-range-picker/date-range-picker-content.d.ts +5 -0
- package/date-range-picker/date-range-picker-content.js +56 -0
- package/date-range-picker/date-range-picker-decade.d.ts +6 -0
- package/date-range-picker/date-range-picker-decade.js +72 -0
- package/date-range-picker/date-range-picker-month.d.ts +8 -0
- package/date-range-picker/date-range-picker-month.js +69 -0
- package/date-range-picker/date-range-picker-year.d.ts +7 -0
- package/date-range-picker/date-range-picker-year.js +80 -0
- package/date-range-picker/date-range-picker.d.ts +11 -0
- package/date-range-picker/date-range-picker.js +51 -0
- package/date-range-picker/date-range-picker.spec.d.ts +1 -0
- package/date-range-picker/date-range-picker.spec.js +9 -0
- package/date-range-picker/date-range-picker.stories.d.ts +7 -0
- package/date-range-picker/date-range-picker.stories.js +43 -0
- package/date-range-picker/index.d.ts +3 -0
- package/date-range-picker/index.js +5 -0
- package/date-range-picker/types.d.ts +5 -0
- package/date-range-picker/types.js +2 -0
- package/date-range-picker-input/date-range-picker-input.d.ts +17 -0
- package/date-range-picker-input/date-range-picker-input.js +62 -0
- package/date-range-picker-input/date-range-picker-input.spec.d.ts +1 -0
- package/date-range-picker-input/date-range-picker-input.spec.js +9 -0
- package/date-range-picker-input/date-range-picker-input.stories.d.ts +10 -0
- package/date-range-picker-input/date-range-picker-input.stories.js +53 -0
- package/date-range-picker-input/index.d.ts +2 -0
- package/date-range-picker-input/index.js +5 -0
- package/datetime-picker/datetime-picker.d.ts +3 -1
- package/datetime-picker/datetime-picker.js +2 -2
- package/datetime-picker-input/datetime-picker-input.d.ts +2 -0
- package/datetime-picker-input/datetime-picker-input.js +3 -1
- package/dialog/dialog.d.ts +9 -0
- package/{modal/modal-dialog.js → dialog/dialog.js} +8 -9
- package/dialog/dialog.spec.d.ts +1 -0
- package/dialog/dialog.spec.js +9 -0
- package/dialog/dialog.stories.d.ts +7 -0
- package/dialog/dialog.stories.js +47 -0
- package/dialog/index.d.ts +2 -0
- package/dialog/index.js +5 -0
- package/dropzone/dropzone-input.js +10 -6
- package/file-input/file-input.d.ts +3 -0
- package/file-input/file-input.js +5 -5
- package/flash-messages/flash-message.js +1 -1
- package/flash-messages/flash-messages.js +44 -10
- package/flash-messages/flash-messages.stories.js +12 -0
- package/image-gallery/components/close-button.d.ts +2 -1
- package/image-gallery/components/close-button.js +2 -3
- package/image-gallery/components/gallery.d.ts +4 -1
- package/image-gallery/components/gallery.js +5 -4
- package/image-gallery/components/next-button.d.ts +7 -0
- package/image-gallery/components/next-button.js +14 -0
- package/image-gallery/components/prev-button.d.ts +7 -0
- package/image-gallery/components/prev-button.js +14 -0
- package/image-gallery/image-gallery.d.ts +4 -1
- package/image-gallery/image-gallery.js +1 -1
- package/image-gallery/image-gallery.stories.js +5 -1
- package/message/index.d.ts +3 -0
- package/message/index.js +7 -0
- package/message/message-content.d.ts +17 -0
- package/message/message-content.js +41 -0
- package/message/message-service.d.ts +13 -0
- package/message/message-service.js +29 -0
- package/message/message.d.ts +20 -0
- package/message/message.js +47 -0
- package/message/message.spec.d.ts +1 -0
- package/message/message.spec.js +9 -0
- package/message/message.stories.d.ts +7 -0
- package/message/message.stories.js +82 -0
- package/message/theme.d.ts +12 -0
- package/message/theme.js +2 -0
- package/modal/index.d.ts +2 -1
- package/modal/index.js +3 -3
- package/modal/modal.d.ts +5 -4
- package/modal/modal.js +9 -9
- package/modal/modal.stories.js +12 -0
- package/modal/theme.d.ts +3 -0
- package/multi-combobox/_multi-combobox-base.js +9 -3
- package/multi-combobox/multi-combobox.stories.js +6 -3
- package/multi-combobox/types.d.ts +4 -0
- package/multi-select/_multi-select-base.js +2 -2
- package/multi-select/multi-select.stories.js +5 -2
- package/package.json +10 -8
- package/radio-group/index.d.ts +1 -1
- package/radio-group/radio-group.d.ts +3 -3
- package/radio-group/radio-group.js +2 -2
- package/radio-group/radio-group.stories.js +4 -4
- package/raster-image/raster-image.js +1 -1
- package/select/select.d.ts +1 -1
- package/select/select.stories.d.ts +2 -1
- package/select/select.stories.js +8 -2
- package/textarea/textarea.js +5 -5
- package/time-picker/time-picker-hour.js +3 -3
- package/time-picker/time-picker-hours.js +1 -1
- package/time-picker/time-picker-minute.js +3 -3
- package/time-picker/time-picker-minutes.js +1 -1
- package/time-picker/time-picker.d.ts +1 -0
- package/time-picker/time-picker.js +3 -2
- package/time-picker-input/time-picker-input.js +3 -1
- package/tooltip/tooltip.js +20 -18
- package/utils/icons-config.js +13 -3
- package/utils/mocks/uploadFIle.mock.js +1 -1
- package/utils/storybook-config.d.ts +11 -1
- package/utils/storybook-config.js +9 -1
- package/utils/tailwind-config.js +8 -0
- package/image-gallery/components/arrow-button.d.ts +0 -7
- package/image-gallery/components/arrow-button.js +0 -14
- package/modal/modal-dialog.d.ts +0 -11
|
@@ -26,7 +26,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports._FileInputBase = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
exports._FileInputBase = (0, react_1.forwardRef)((props, ref) => {
|
|
29
|
-
const onChange = (e) =>
|
|
29
|
+
const onChange = async (e) => {
|
|
30
|
+
if (e.target.files) {
|
|
31
|
+
const res = await props.onUploadFile(e.target.files[0]);
|
|
32
|
+
props.onChange(res, e);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
props.onChange(null, e);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
30
38
|
return (react_1.default.createElement("input", { accept: props.accept, "aria-invalid": props.isInvalid, "aria-describedby": props["aria-describedby"], className: props.className, disabled: props.isDisabled, form: props.form, id: props.id, name: props.name, onBlur: props.onBlur, onChange: onChange, onFocus: props.onFocus, readOnly: props.isReadOnly, ref: ref, required: props.isRequired, tabIndex: props.isDisabled ? -1 : undefined, type: "file" }));
|
|
31
39
|
});
|
|
32
40
|
exports._FileInputBase.displayName = "UxfUiFileInputBase";
|
|
@@ -28,7 +28,7 @@ export interface SelectBaseProps<Value, Option> extends FormControlProps<Value |
|
|
|
28
28
|
label: ReactNode;
|
|
29
29
|
options?: Option[];
|
|
30
30
|
placeholder?: string;
|
|
31
|
-
renderOption?: (option: Option) => ReactNode;
|
|
31
|
+
renderOption?: (option: Option, isSelected: boolean) => ReactNode;
|
|
32
32
|
size?: keyof InputGroupSizes;
|
|
33
33
|
variant?: keyof InputGroupVariants;
|
|
34
34
|
leftAddon?: ReactNode;
|
|
@@ -54,9 +54,10 @@ const Options = (props) => {
|
|
|
54
54
|
var _a, _b;
|
|
55
55
|
const HUIComponent = props.HUIComponent;
|
|
56
56
|
return (react_2.default.createElement(HUIComponent.Options, { className: (0, cx_1.cx)("uxf-dropdown", `uxf-dropdown--size-${(_a = props.size) !== null && _a !== void 0 ? _a : "default"}`, `uxf-dropdown--variant-${(_b = props.variant) !== null && _b !== void 0 ? _b : "default"}`, props.placement === "bottom" && "uxf-dropdown--bottom", props.placement === "top" && "uxf-dropdown--top"), ref: props.forwardRef, static: true, style: props.style }, props.options && props.options.length > 0 ? (props.options.map((option) => {
|
|
57
|
-
var _a
|
|
57
|
+
var _a;
|
|
58
58
|
const optionKey = (_a = props.keyExtractor) === null || _a === void 0 ? void 0 : _a.call(props, option);
|
|
59
|
-
|
|
59
|
+
const _option = option;
|
|
60
|
+
return (react_2.default.createElement(HUIComponent.Option, { disabled: _option.disabled, className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item", optionState.active && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED), key: optionKey !== null && optionKey !== void 0 ? optionKey : _option.id, value: option }, (optionState) => { var _a, _b; return (_b = (_a = props.renderOption) === null || _a === void 0 ? void 0 : _a.call(props, option, optionState.selected)) !== null && _b !== void 0 ? _b : option.label; }));
|
|
60
61
|
})) : (react_2.default.createElement("div", { className: "uxf-dropdown__empty-wrapper" }, props.emptyMessage))));
|
|
61
62
|
};
|
|
62
63
|
Options.displayName = "UxfUiSelectBaseOptions";
|
|
@@ -70,7 +71,7 @@ const _SelectBase = (props) => {
|
|
|
70
71
|
const dropdown = (0, use_dropdown_1.useDropdown)((_b = props.dropdownPlacement) !== null && _b !== void 0 ? _b : "bottom", true, props.dropdownStrategy);
|
|
71
72
|
const stableRef = (0, react_2.useMemo)(() => (0, composeRefs_1.composeRefs)(innerRef, props.forwardRef, dropdown.refs.setReference), [dropdown.refs.setReference, props.forwardRef]);
|
|
72
73
|
const HUIComponent = props.HUIComponent;
|
|
73
|
-
return (react_2.default.createElement(HUIComponent, { as: "div", className: (0, cx_1.cx)("uxf-form-component uxf-select-base", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.className), disabled: props.isDisabled || props.isReadOnly, onChange: props.onChange, value: props.value }, (renderProps) => (react_2.default.createElement(react_2.default.Fragment, null,
|
|
74
|
+
return (react_2.default.createElement(HUIComponent, { as: "div", by: "id", className: (0, cx_1.cx)("uxf-form-component uxf-select-base", 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-testid": id, disabled: props.isDisabled || props.isReadOnly, onChange: props.onChange, value: props.value }, (renderProps) => (react_2.default.createElement(react_2.default.Fragment, null,
|
|
74
75
|
react_2.default.createElement("div", { className: "uxf-form-component__label" },
|
|
75
76
|
react_2.default.createElement(HUIComponent.Label, { as: label_1.Label, isHidden: props.hiddenLabel, onClick: props.isDisabled || props.isReadOnly ? undefined : input.focus }, props.label)),
|
|
76
77
|
react_2.default.createElement("div", { className: "uxf-form-component__input" },
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { AlertBubbleColor, AlertBubbleSize } from "./theme";
|
|
3
|
+
export interface AlertBubbleProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
color?: AlertBubbleColor;
|
|
6
|
+
size?: AlertBubbleSize;
|
|
7
|
+
}
|
|
8
|
+
export declare const AlertBubble: FC<AlertBubbleProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AlertBubble = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const icon_1 = require("../icon");
|
|
9
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
10
|
+
const ICON = {
|
|
11
|
+
default: "triangle-exclamation",
|
|
12
|
+
error: "xmark",
|
|
13
|
+
warning: "triangle-exclamation",
|
|
14
|
+
success: "check",
|
|
15
|
+
};
|
|
16
|
+
const AlertBubble = (props) => {
|
|
17
|
+
var _a, _b, _c;
|
|
18
|
+
return (react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-alert-bubble", `uxf-alert-bubble--color-${(_a = props.color) !== null && _a !== void 0 ? _a : "default"}`, `uxf-alert-bubble--size-${(_b = props.size) !== null && _b !== void 0 ? _b : "default"}`, props.className) },
|
|
19
|
+
react_1.default.createElement(icon_1.Icon, { className: "uxf-alert-bubble__icon", name: ICON[(_c = props.color) !== null && _c !== void 0 ? _c : "default"] })));
|
|
20
|
+
};
|
|
21
|
+
exports.AlertBubble = AlertBubble;
|
|
22
|
+
exports.AlertBubble.displayName = "UxfUiAlertBubble";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const snap_test_1 = require("../utils/snap-test");
|
|
7
|
+
const alert_bubble_stories_1 = require("./alert-bubble.stories");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
(0, snap_test_1.snapTest)("render stories", react_1.default.createElement(alert_bubble_stories_1.Default, null));
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Default = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const storybook_config_1 = require("../utils/storybook-config");
|
|
29
|
+
const alert_bubble_1 = require("./alert-bubble");
|
|
30
|
+
exports.default = {
|
|
31
|
+
title: "UI/AlertBubble",
|
|
32
|
+
component: alert_bubble_1.AlertBubble,
|
|
33
|
+
};
|
|
34
|
+
function Default() {
|
|
35
|
+
const config = (0, storybook_config_1.useStorybookConfig)("AlertBubble");
|
|
36
|
+
const storyAlertBubbles = config.colors.map((color) => (react_1.default.createElement(react_1.Fragment, { key: color }, config.sizes.map((size) => (react_1.default.createElement("div", { key: `${size}${color}`, className: "space-y-2 pb-4" },
|
|
37
|
+
react_1.default.createElement("div", { className: "text-sm dark:text-gray-100" },
|
|
38
|
+
"Color: ",
|
|
39
|
+
react_1.default.createElement("span", { className: "font-semibold" }, color),
|
|
40
|
+
", Size:",
|
|
41
|
+
" ",
|
|
42
|
+
react_1.default.createElement("span", { className: "font-semibold" }, size)),
|
|
43
|
+
react_1.default.createElement("div", { className: "flex flex-row items-start gap-2" },
|
|
44
|
+
react_1.default.createElement(alert_bubble_1.AlertBubble, { color: color, size: size })),
|
|
45
|
+
react_1.default.createElement("hr", null)))))));
|
|
46
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
47
|
+
react_1.default.createElement("div", { className: "light space-y-2 p-20" }, storyAlertBubbles),
|
|
48
|
+
react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20" }, storyAlertBubbles)));
|
|
49
|
+
}
|
|
50
|
+
exports.Default = Default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlertBubble = void 0;
|
|
4
|
+
var alert_bubble_1 = require("./alert-bubble");
|
|
5
|
+
Object.defineProperty(exports, "AlertBubble", { enumerable: true, get: function () { return alert_bubble_1.AlertBubble; } });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface AlertBubbleColors {
|
|
2
|
+
default: true;
|
|
3
|
+
success: true;
|
|
4
|
+
error: true;
|
|
5
|
+
warning: true;
|
|
6
|
+
}
|
|
7
|
+
export type AlertBubbleColor = keyof AlertBubbleColors;
|
|
8
|
+
export interface AlertBubbleSizes {
|
|
9
|
+
xs: true;
|
|
10
|
+
sm: true;
|
|
11
|
+
default: true;
|
|
12
|
+
lg: true;
|
|
13
|
+
xl: true;
|
|
14
|
+
"2xl": true;
|
|
15
|
+
}
|
|
16
|
+
export type AlertBubbleSize = keyof AlertBubbleSizes;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import { FileInputBaseProps } from "../_file-input-base";
|
|
3
|
+
import { AvatarFileInputVariant } from "./theme";
|
|
3
4
|
export interface AvatarFileInputProps extends FileInputBaseProps {
|
|
4
5
|
helperText?: ReactNode;
|
|
5
6
|
label?: ReactNode;
|
|
7
|
+
changeFileLabel?: ReactNode;
|
|
8
|
+
variant?: AvatarFileInputVariant;
|
|
6
9
|
}
|
|
7
10
|
export declare const AvatarFileInput: React.ForwardRefExoticComponent<AvatarFileInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -31,17 +31,23 @@ const forwardRef_1 = require("@uxf/core/utils/forwardRef");
|
|
|
31
31
|
const react_1 = __importStar(require("react"));
|
|
32
32
|
const _file_input_base_1 = require("../_file-input-base");
|
|
33
33
|
const icon_1 = require("../icon");
|
|
34
|
+
const avatar_1 = require("../avatar");
|
|
35
|
+
const file_1 = require("@uxf/core/utils/file");
|
|
34
36
|
exports.AvatarFileInput = (0, forwardRef_1.forwardRef)("UxfUiAvatarFileInput", (props, ref) => {
|
|
37
|
+
var _a, _b;
|
|
35
38
|
const generatedId = (0, react_1.useId)();
|
|
36
39
|
const id = props.id || generatedId;
|
|
37
40
|
const innerRef = (0, react_1.useRef)(null);
|
|
38
41
|
const input = (0, useInputFocus_1.useInputFocus)(innerRef, props.onBlur, props.onFocus);
|
|
39
42
|
const errorId = props.isInvalid && props.id ? `${props.id}--errormessage` : undefined;
|
|
40
43
|
const stateClassNames = (0, cx_1.cx)(input.focused && classes_1.CLASSES.IS_FOCUSED, (props.isDisabled || props.isReadOnly) && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
const label = props.value && props.changeFileLabel ? props.changeFileLabel : props.label;
|
|
45
|
+
return (react_1.default.createElement("div", { className: `uxf-avatar-file-input uxf-avatar-file-input--variant-${(_a = props.variant) !== null && _a !== void 0 ? _a : "default"} ${(_b = props.className) !== null && _b !== void 0 ? _b : ""}` },
|
|
46
|
+
react_1.default.createElement("div", { className: "uxf-avatar-file-input__label-wrapper" },
|
|
47
|
+
props.value ? (react_1.default.createElement(avatar_1.Avatar, { className: (0, cx_1.cx)("uxf-avatar-file-input__image", stateClassNames), src: (0, file_1.getFileUrl)(props.value) })) : (react_1.default.createElement("label", { className: (0, cx_1.cx)("uxf-avatar-file-input__label", stateClassNames), htmlFor: id, tabIndex: 0 },
|
|
48
|
+
react_1.default.createElement(icon_1.Icon, { className: (0, cx_1.cx)("uxf-avatar-file-input__label-icon", stateClassNames), name: "cloud", size: 28 }))),
|
|
49
|
+
(props.label && typeof props.label === "string") ||
|
|
50
|
+
(props.value && props.changeFileLabel && typeof props.changeFileLabel === "string") ? (react_1.default.createElement("label", { className: (0, cx_1.cx)("uxf-avatar-file-input__label-text", stateClassNames), htmlFor: id, tabIndex: 0 }, label)) : (label)),
|
|
45
51
|
react_1.default.createElement(_file_input_base_1._FileInputBase, { accept: props.accept, "aria-describedby": errorId, "aria-invalid": props.isInvalid, className: "uxf-avatar-file-input__input", form: props.form, id: id, isDisabled: props.isDisabled, isFocused: props.isFocused, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly, isRequired: props.isRequired, name: props.name, onBlur: input.onBlur, onChange: props.onChange, onFocus: input.onFocus, onUploadError: props.onUploadError, onUploadFile: props.onUploadFile, ref: ref, value: props.value }),
|
|
46
52
|
props.helperText && (react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-helper-text", errorId && classes_1.CLASSES.IS_INVALID), id: errorId }, props.helperText))));
|
|
47
53
|
});
|
|
@@ -46,8 +46,8 @@ function Default() {
|
|
|
46
46
|
console.log("Upload error", err);
|
|
47
47
|
};
|
|
48
48
|
const storyAvatarFileInputs = (react_1.default.createElement("div", { className: "space-y-8" },
|
|
49
|
-
react_1.default.createElement(index_1.AvatarFileInput, { onChange: onChange, onUploadError: onUploadError, onUploadFile: uploadFIle_mock_1.uploadFile, value: value }),
|
|
50
|
-
react_1.default.createElement(index_1.AvatarFileInput, { isDisabled: true, onChange: onChange, onUploadError: onUploadError, onUploadFile: uploadFIle_mock_1.uploadFile, value: value }),
|
|
49
|
+
react_1.default.createElement(index_1.AvatarFileInput, { label: "Nahrajte fotku", onChange: onChange, onUploadError: onUploadError, onUploadFile: uploadFIle_mock_1.uploadFile, value: value, variant: "square" }),
|
|
50
|
+
react_1.default.createElement(index_1.AvatarFileInput, { isDisabled: true, onChange: onChange, onUploadError: onUploadError, onUploadFile: uploadFIle_mock_1.uploadFile, value: value, variant: "square" }),
|
|
51
51
|
react_1.default.createElement(index_1.AvatarFileInput, { id: "afi", isInvalid: true, label: "Vyberte Avatar", onChange: onChange, onUploadError: onUploadError, onUploadFile: uploadFIle_mock_1.uploadFile, value: value })));
|
|
52
52
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
53
53
|
react_1.default.createElement("div", { className: "light space-y-2 p-20" }, storyAvatarFileInputs),
|
package/button/theme.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CalendarDay } from "@uxf/datepicker/utils/get-days";
|
|
3
|
+
import { UseDatePickerReturnType } from "@uxf/datepicker/hooks/use-date-picker";
|
|
4
|
+
import { UseDateRangePickerReturnType } from "@uxf/datepicker/hooks/use-date-range-picker";
|
|
3
5
|
interface CalendarDayProps {
|
|
4
6
|
day: CalendarDay;
|
|
7
|
+
datePickerProps: UseDatePickerReturnType | UseDateRangePickerReturnType;
|
|
5
8
|
}
|
|
6
9
|
export declare const CalendarDayCell: React.NamedExoticComponent<CalendarDayProps>;
|
|
7
10
|
export {};
|
|
@@ -26,7 +26,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.CalendarDayCell = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
const use_day_1 = require("@uxf/datepicker/hooks/use-day");
|
|
29
|
-
const date_picker_context_1 = require("@uxf/datepicker/contexts/date-picker-context");
|
|
30
29
|
const composeRefs_1 = require("@uxf/core/utils/composeRefs");
|
|
31
30
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
32
31
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
@@ -34,29 +33,30 @@ const useOnMount_1 = require("@uxf/core/hooks/useOnMount");
|
|
|
34
33
|
exports.CalendarDayCell = (0, react_1.memo)((props) => {
|
|
35
34
|
const dayCellRef = (0, react_1.useRef)(null);
|
|
36
35
|
const innerRef = (0, react_1.useRef)(null);
|
|
37
|
-
const {
|
|
38
|
-
const { disabledDate, isSelected, onClick, onKeyDown, onMouseEnter, tabIndex, isToday } = (0, use_day_1.useDay)({
|
|
36
|
+
const { disabledDate, isHovered, isSelected, isInsideRange, isToday, isWithinHoverRange, onClick, onKeyDown, onMouseEnter, tabIndex, } = (0, use_day_1.useDay)({
|
|
39
37
|
date: props.day.date,
|
|
40
|
-
focusedDate,
|
|
41
|
-
isDateBlocked,
|
|
42
|
-
isDateFocused,
|
|
43
|
-
isDateHovered,
|
|
44
|
-
isDateSelected,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
focusedDate: props.datePickerProps.focusedDate,
|
|
39
|
+
isDateBlocked: props.datePickerProps.isDateBlocked,
|
|
40
|
+
isDateFocused: props.datePickerProps.isDateFocused,
|
|
41
|
+
isDateHovered: props.datePickerProps.isDateHovered,
|
|
42
|
+
isDateSelected: props.datePickerProps.isDateSelected,
|
|
43
|
+
isDateInsideRange: "isDateInsideRange" in props.datePickerProps ? props.datePickerProps.isDateInsideRange : () => false,
|
|
44
|
+
onDateFocus: props.datePickerProps.onDateFocus,
|
|
45
|
+
onDateHover: props.datePickerProps.onDateHover,
|
|
46
|
+
onDateSelect: props.datePickerProps.onDateSelect,
|
|
48
47
|
dayRef: dayCellRef,
|
|
48
|
+
preventScroll: props.datePickerProps.preventScroll,
|
|
49
49
|
});
|
|
50
50
|
(0, useOnMount_1.useOnMount)(() => {
|
|
51
51
|
const node = innerRef.current;
|
|
52
52
|
if (node && (isToday || isSelected)) {
|
|
53
|
-
node.focus({ preventScroll:
|
|
53
|
+
node.focus({ preventScroll: props.datePickerProps.preventScroll });
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
if (!props.day.dayLabel) {
|
|
57
57
|
return react_1.default.createElement("div", null);
|
|
58
58
|
}
|
|
59
|
-
return (react_1.default.createElement("button", { className: (0, cx_1.cx)("uxf-calendar__cell uxf-calendar__cell-day", disabledDate && classes_1.CLASSES.IS_DISABLED, isToday && "uxf-calendar__cell
|
|
60
|
-
react_1.default.createElement("span", { className: "uxf-
|
|
59
|
+
return (react_1.default.createElement("button", { className: (0, cx_1.cx)("uxf-calendar__cell uxf-calendar__cell-day", disabledDate && classes_1.CLASSES.IS_DISABLED, isToday && "uxf-calendar__cell--today", isSelected && "uxf-calendar__cell--selected", isInsideRange && "uxf-calendar__cell--inside-range", isWithinHoverRange && "uxf-calendar__cell--is-within-hover-range", isHovered && "uxf-calendar__cell--is-hovered", !props.day.currentMonth && "uxf-calendar__cell--not-current-month"), ref: disabledDate ? undefined : (0, composeRefs_1.composeRefs)(dayCellRef, innerRef), onClick: onClick, onKeyDown: onKeyDown, onMouseEnter: onMouseEnter, tabIndex: tabIndex, type: "button" },
|
|
60
|
+
react_1.default.createElement("span", { className: "uxf-calendar__cell__inner" }, props.day.dayLabel)));
|
|
61
61
|
});
|
|
62
62
|
exports.CalendarDayCell.displayName = "UxfUiCalendarDayCell";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
import { ButtonProps } from "../button";
|
|
3
|
-
interface
|
|
3
|
+
export interface CalendarNavigationProps {
|
|
4
4
|
prevButtonProps: ButtonProps;
|
|
5
5
|
selectButtonProps: ButtonProps;
|
|
6
6
|
nextButtonProps: ButtonProps;
|
|
7
7
|
}
|
|
8
|
-
export declare const
|
|
9
|
-
export {};
|
|
8
|
+
export declare const CalendarNavigation: FC<CalendarNavigationProps>;
|
|
@@ -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.
|
|
6
|
+
exports.CalendarNavigation = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const button_1 = require("../button");
|
|
9
9
|
const icon_1 = require("../icon");
|
|
10
|
-
const
|
|
11
|
-
return (react_1.default.createElement("div", { className: "uxf-
|
|
10
|
+
const CalendarNavigation = (props) => {
|
|
11
|
+
return (react_1.default.createElement("div", { className: "uxf-calendar-navigation" },
|
|
12
12
|
react_1.default.createElement(button_1.Button, { isIconButton: true, size: "sm", variant: "white", ...props.prevButtonProps },
|
|
13
13
|
react_1.default.createElement(icon_1.Icon, { name: "arrow-left", size: 16 })),
|
|
14
|
-
props.selectButtonProps.onClick ? (react_1.default.createElement(button_1.Button, { variant: "text", size: "sm", color: "default", ...props.selectButtonProps })) : (react_1.default.createElement("p", { className: "uxf-
|
|
14
|
+
props.selectButtonProps.onClick ? (react_1.default.createElement(button_1.Button, { variant: "text", size: "sm", color: "default", ...props.selectButtonProps })) : (react_1.default.createElement("p", { className: "uxf-calendar-navigation__title" }, props.selectButtonProps.children)),
|
|
15
15
|
react_1.default.createElement(button_1.Button, { isIconButton: true, size: "sm", variant: "white", ...props.nextButtonProps },
|
|
16
16
|
react_1.default.createElement(icon_1.Icon, { name: "arrow-right", size: 16 }))));
|
|
17
17
|
};
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
18
|
+
exports.CalendarNavigation = CalendarNavigation;
|
|
19
|
+
exports.CalendarNavigation.displayName = "UxfUiCalendarNavigation";
|
|
@@ -20,7 +20,7 @@ const CalendarProvider = (props) => {
|
|
|
20
20
|
selectedDate: (_a = props.selectedDate) !== null && _a !== void 0 ? _a : null,
|
|
21
21
|
});
|
|
22
22
|
return (react_1.default.createElement(date_picker_context_1.DatePickerContext.Provider, { value: calendarProps },
|
|
23
|
-
react_1.default.createElement(calendar_1.Calendar,
|
|
23
|
+
react_1.default.createElement(calendar_1.Calendar, { datePickerProps: calendarProps })));
|
|
24
24
|
};
|
|
25
25
|
exports.CalendarProvider = CalendarProvider;
|
|
26
26
|
exports.CalendarProvider.displayName = "UxfUiCalendarProvider";
|
package/calendar/calendar.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { UseDatePickerReturnType } from "@uxf/datepicker/hooks/use-date-picker";
|
|
3
|
+
import { UseDateRangePickerReturnType } from "@uxf/datepicker/hooks/use-date-range-picker";
|
|
2
4
|
export interface CalendarProps {
|
|
5
|
+
datePickerProps: UseDatePickerReturnType | UseDateRangePickerReturnType;
|
|
3
6
|
className?: string;
|
|
7
|
+
month?: number;
|
|
4
8
|
onChange?: (data: Date | null) => void;
|
|
5
9
|
selectedDate?: Date | null;
|
|
10
|
+
year?: number;
|
|
6
11
|
}
|
|
7
12
|
export declare const Calendar: React.ForwardRefExoticComponent<CalendarProps & React.RefAttributes<HTMLDivElement>>;
|
package/calendar/calendar.js
CHANGED
|
@@ -31,23 +31,20 @@ const cx_1 = require("@uxf/core/utils/cx");
|
|
|
31
31
|
const react_1 = __importStar(require("react"));
|
|
32
32
|
const use_month_1 = require("@uxf/datepicker/hooks/use-month");
|
|
33
33
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
34
|
-
const date_picker_context_1 = require("@uxf/datepicker/contexts/date-picker-context");
|
|
35
34
|
const calendar_day_cell_1 = require("./calendar-day-cell");
|
|
36
35
|
exports.Calendar = (0, react_1.forwardRef)((props, ref) => {
|
|
36
|
+
var _a, _b;
|
|
37
37
|
const calendarClassName = (0, cx_1.cx)("uxf-calendar", props.className);
|
|
38
|
-
const { activeMonths, firstDayOfWeek } = (0, react_1.useContext)(date_picker_context_1.DatePickerContext);
|
|
39
|
-
const currentMonth = activeMonths[0].month;
|
|
40
|
-
const currentYear = activeMonths[0].year;
|
|
41
38
|
const { days, weekdayLabels } = (0, use_month_1.useMonth)({
|
|
42
39
|
dayLabelFormat: (date) => (0, dayjs_1.default)(date).format("D"),
|
|
43
|
-
firstDayOfWeek,
|
|
44
|
-
month:
|
|
40
|
+
firstDayOfWeek: props.datePickerProps.firstDayOfWeek,
|
|
41
|
+
month: (_a = props.month) !== null && _a !== void 0 ? _a : props.datePickerProps.activeMonths[0].month,
|
|
45
42
|
monthLabelFormat: (date) => (0, dayjs_1.default)(date).format("MMMM YYYY"),
|
|
46
43
|
weekdayLabelFormat: (date) => (0, dayjs_1.default)(date).format("dd"),
|
|
47
|
-
year:
|
|
44
|
+
year: (_b = props.year) !== null && _b !== void 0 ? _b : props.datePickerProps.activeMonths[0].year,
|
|
48
45
|
});
|
|
49
46
|
return (react_1.default.createElement("div", { ref: ref, className: calendarClassName },
|
|
50
47
|
react_1.default.createElement("div", { className: "uxf-calendar__weekdays" }, weekdayLabels.map((weekdayLabel, index) => (react_1.default.createElement("span", { key: `${index}`, className: "uxf-calendar__weekday" }, weekdayLabel)))),
|
|
51
|
-
react_1.default.createElement("div", { className: "uxf-calendar__days" }, days.map((day, index) => (react_1.default.createElement(calendar_day_cell_1.CalendarDayCell, { day: day, key: day.dayLabel + index }))))));
|
|
48
|
+
react_1.default.createElement("div", { className: "uxf-calendar__days" }, days.map((day, index) => (react_1.default.createElement(calendar_day_cell_1.CalendarDayCell, { datePickerProps: props.datePickerProps, day: day, key: day.dayLabel + index }))))));
|
|
52
49
|
});
|
|
53
50
|
exports.Calendar.displayName = "UxfUiCalendar";
|
package/calendar/index.d.ts
CHANGED
package/calendar/index.js
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
3
|
+
exports.CalendarNavigation = exports.Calendar = void 0;
|
|
4
|
+
var calendar_1 = require("./calendar");
|
|
5
|
+
Object.defineProperty(exports, "Calendar", { enumerable: true, get: function () { return calendar_1.Calendar; } });
|
|
6
|
+
var calendar_navigation_1 = require("./calendar-navigation");
|
|
7
|
+
Object.defineProperty(exports, "CalendarNavigation", { enumerable: true, get: function () { return calendar_navigation_1.CalendarNavigation; } });
|
package/chip/chip.js
CHANGED
|
@@ -30,23 +30,25 @@ const useAnchorProps_1 = require("@uxf/core/hooks/useAnchorProps");
|
|
|
30
30
|
const CloseButton = (props) => {
|
|
31
31
|
const onClose = (e) => {
|
|
32
32
|
var _a;
|
|
33
|
+
e.preventDefault();
|
|
33
34
|
e.stopPropagation();
|
|
34
35
|
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
35
36
|
};
|
|
36
37
|
return (react_1.default.createElement("button", { className: "uxf-chip__button", onClick: onClose, tabIndex: props.suppressFocus ? -1 : undefined, type: "button" },
|
|
37
|
-
react_1.default.createElement("span", { className: "uxf-
|
|
38
|
-
react_1.default.createElement("svg", { className: "uxf-
|
|
38
|
+
react_1.default.createElement("span", { className: "uxf-chip__button-label" }, "Odebrat polo\u017Eku"),
|
|
39
|
+
react_1.default.createElement("svg", { className: "uxf-chip__button-icon", stroke: "currentColor", fill: "none", viewBox: "0 0 8 8" },
|
|
39
40
|
react_1.default.createElement("path", { strokeLinecap: "round", strokeWidth: "1.5", d: "M1 1l6 6m0-6L1 7" }))));
|
|
40
41
|
};
|
|
41
42
|
exports.Chip = (0, react_1.forwardRef)((props, ref) => {
|
|
42
43
|
var _a, _b, _c;
|
|
43
|
-
const { children, className,
|
|
44
|
+
const { children, className, onClose, suppressFocus, tabIndex, ...restProps } = props;
|
|
44
45
|
const chipClassName = (0, cx_1.cx)("uxf-chip", `uxf-chip--color-${(_a = props.color) !== null && _a !== void 0 ? _a : "default"}`, `uxf-chip--size-${(_b = props.size) !== null && _b !== void 0 ? _b : "default"}`, `uxf-chip--variant-${(_c = props.variant) !== null && _c !== void 0 ? _c : "default"}`, onClose && "has-button", className);
|
|
45
46
|
const anchorProps = (0, useAnchorProps_1.useAnchorProps)({
|
|
46
47
|
className: (0, cx_1.cx)(chipClassName),
|
|
48
|
+
tabIndex: suppressFocus ? -1 : tabIndex,
|
|
47
49
|
...restProps,
|
|
48
50
|
});
|
|
49
|
-
return (react_1.default.createElement("a", {
|
|
51
|
+
return (react_1.default.createElement("a", { ref: ref, ...anchorProps },
|
|
50
52
|
typeof children === "string" ? react_1.default.createElement("span", { className: "uxf-chip__text" }, children) : children,
|
|
51
53
|
!!onClose && react_1.default.createElement(CloseButton, { onClose: onClose })));
|
|
52
54
|
});
|
package/chip/chip.stories.js
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.Default = void 0;
|
|
7
|
-
const react_1 =
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
8
28
|
const chip_1 = require("@uxf/ui/chip");
|
|
9
29
|
const storybook_config_1 = require("../utils/storybook-config");
|
|
10
30
|
exports.default = {
|
|
@@ -16,34 +36,23 @@ exports.default = {
|
|
|
16
36
|
},
|
|
17
37
|
},
|
|
18
38
|
};
|
|
19
|
-
const getChipsForSize = (
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
react_1.default.createElement(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
39
|
+
const getChipsForSize = (colors) => {
|
|
40
|
+
const sizes = ["small", "default", "large"];
|
|
41
|
+
const variants = ["low", "medium", "default"];
|
|
42
|
+
return sizes.map((size) => (react_1.default.createElement(react_1.Fragment, { key: size },
|
|
43
|
+
react_1.default.createElement("div", { className: "uxf-typo-h5" }, size),
|
|
44
|
+
react_1.default.createElement("div", { className: "flex flex-col space-y-4 px-5" },
|
|
45
|
+
react_1.default.createElement("div", { className: "grid grid-cols-3 gap-4", key: size }, variants.map((variant) => (react_1.default.createElement("div", { className: "flex flex-col gap-2", key: `${size}${variant}` }, colors.map((color) => (react_1.default.createElement("div", { className: "flex flex-col items-start space-y-2", key: `${size}${variant}${color}` },
|
|
46
|
+
react_1.default.createElement(chip_1.Chip, { color: color, size: size, variant: variant }, color),
|
|
47
|
+
react_1.default.createElement(chip_1.Chip, { color: color, size: size, onClose: () => null, variant: variant }, color),
|
|
48
|
+
react_1.default.createElement(chip_1.Chip, { color: color, href: "https://uxf.cz", onClose: () => null, size: size, target: "_blank", variant: variant },
|
|
49
|
+
"#",
|
|
50
|
+
color))))))))))));
|
|
30
51
|
};
|
|
31
52
|
function Default() {
|
|
32
53
|
const config = (0, storybook_config_1.useStorybookConfig)("Chip");
|
|
33
54
|
return (react_1.default.createElement("div", { className: "flex lg:flex-row" },
|
|
34
|
-
react_1.default.createElement("div", { className: "light space-y-4 rounded bg-white p-10" },
|
|
35
|
-
|
|
36
|
-
react_1.default.createElement("div", { className: "flex flex-col space-y-4 px-5" }, getChipsForSize("small", config.colors)),
|
|
37
|
-
react_1.default.createElement("div", { className: "uxf-typo-h5" }, "default"),
|
|
38
|
-
react_1.default.createElement("div", { className: "flex flex-col space-y-4 px-5" }, getChipsForSize("default", config.colors)),
|
|
39
|
-
react_1.default.createElement("div", { className: "uxf-typo-h5" }, "large"),
|
|
40
|
-
react_1.default.createElement("div", { className: "flex flex-col space-y-4 px-5" }, getChipsForSize("large", config.colors))),
|
|
41
|
-
react_1.default.createElement("div", { className: "dark space-y-4 rounded bg-gray-900 p-10 text-white" },
|
|
42
|
-
react_1.default.createElement("div", { className: "uxf-typo-h5" }, "small"),
|
|
43
|
-
react_1.default.createElement("div", { className: "flex flex-col space-y-4 px-5" }, getChipsForSize("small", config.colors)),
|
|
44
|
-
react_1.default.createElement("div", { className: "uxf-typo-h5" }, "default"),
|
|
45
|
-
react_1.default.createElement("div", { className: "flex flex-col space-y-4 px-5" }, getChipsForSize("default", config.colors)),
|
|
46
|
-
react_1.default.createElement("div", { className: "uxf-typo-h5" }, "large"),
|
|
47
|
-
react_1.default.createElement("div", { className: "flex flex-col space-y-4 px-5" }, getChipsForSize("large", config.colors)))));
|
|
55
|
+
react_1.default.createElement("div", { className: "light space-y-4 rounded bg-white p-10" }, getChipsForSize(config.colors)),
|
|
56
|
+
react_1.default.createElement("div", { className: "dark space-y-4 rounded bg-gray-900 p-10 text-white" }, getChipsForSize(config.colors))));
|
|
48
57
|
}
|
|
49
58
|
exports.Default = Default;
|
package/combobox/combobox.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface ComboboxProps<ValueId = SelectBaseValueId, Option = ComboboxOpt
|
|
|
14
14
|
loadOptions?: (query: string) => Promise<Option[]>;
|
|
15
15
|
noQueryMessage?: string;
|
|
16
16
|
notFoundMessage?: string;
|
|
17
|
-
renderOption?: (option: Option) => ReactNode;
|
|
17
|
+
renderOption?: (option: Option, isSelected: boolean) => ReactNode;
|
|
18
18
|
}
|
|
19
19
|
export declare const Combobox: {
|
|
20
20
|
<ValueId = SelectBaseValueId, Option = ComboboxOption<ValueId>, Value = Option>(props: ComboboxProps<ValueId, Option, Value>): React.JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { ComboboxOption } from "./combobox";
|
|
2
3
|
declare const _default: {
|
|
3
4
|
title: string;
|
|
4
5
|
component: {
|
|
5
|
-
<ValueId = import("../_select-base").SelectBaseValueId, Option =
|
|
6
|
+
<ValueId = import("../_select-base").SelectBaseValueId, Option = ComboboxOption<ValueId>, Value = Option>(props: import("./combobox").ComboboxProps<ValueId, Option, Value>): React.JSX.Element;
|
|
6
7
|
displayName: string;
|
|
7
8
|
};
|
|
8
9
|
};
|