@uxf/ui 10.0.0-beta.8 → 10.0.0-beta.80
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 +15 -1
- package/_file-input-base/index.d.ts +1 -1
- package/_input-with-popover/input-with-popover.d.ts +4 -3
- package/_input-with-popover/input-with-popover.js +26 -26
- package/_select-base/_select-base.d.ts +2 -2
- package/_select-base/_select-base.js +4 -3
- package/_select-base/index.d.ts +1 -1
- 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/README.md +8 -0
- package/avatar/avatar.stories.js +1 -1
- package/avatar/index.d.ts +1 -1
- package/avatar-file-input/README.md +1 -0
- package/avatar-file-input/avatar-file-input.d.ts +3 -0
- package/avatar-file-input/avatar-file-input.js +12 -6
- package/avatar-file-input/avatar-file-input.stories.js +5 -5
- package/avatar-file-input/index.d.ts +1 -1
- package/avatar-file-input/theme.d.ts +5 -0
- package/avatar-file-input/theme.js +2 -0
- package/badge/README.md +1 -0
- package/badge/badge.d.ts +1 -1
- package/badge/badge.stories.js +1 -1
- package/badge/index.d.ts +1 -1
- package/button/README.md +68 -0
- package/button/button.stories.js +0 -1
- package/button/index.d.ts +1 -1
- package/button/theme.d.ts +1 -0
- package/button-group/README.md +1 -0
- package/button-group/button-group.js +1 -1
- package/button-group/button-group.stories.js +1 -1
- package/button-group/index.d.ts +1 -1
- package/button-list/README.md +1 -0
- package/button-list/button-list.d.ts +1 -1
- package/button-list/button-list.js +22 -22
- package/button-list/index.d.ts +1 -1
- package/calendar/README.md +1 -0
- package/calendar/calendar-day-cell.d.ts +4 -1
- package/calendar/calendar-day-cell.js +18 -18
- 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 +2 -2
- package/calendar/calendar.d.ts +5 -0
- package/calendar/calendar.js +6 -9
- package/calendar/calendar.stories.js +1 -1
- package/calendar/index.d.ts +4 -1
- package/calendar/index.js +5 -15
- package/checkbox/README.md +1 -0
- package/checkbox/checkbox.stories.js +1 -1
- package/checkbox/index.d.ts +1 -1
- package/checkbox-button/README.md +1 -0
- package/checkbox-button/checkbox-button.js +2 -2
- package/checkbox-button/checkbox-button.stories.js +1 -1
- package/checkbox-button/index.d.ts +1 -1
- package/checkbox-input/README.md +1 -0
- package/checkbox-input/checkbox-input.d.ts +1 -1
- package/checkbox-input/checkbox-input.stories.js +1 -1
- package/checkbox-input/index.d.ts +1 -1
- package/chip/README.md +1 -0
- package/chip/chip.d.ts +1 -1
- package/chip/chip.js +7 -5
- package/chip/chip.stories.js +37 -28
- package/chip/index.d.ts +2 -2
- package/color-radio/README.md +8 -0
- package/color-radio/color-radio.js +1 -1
- package/color-radio/index.d.ts +1 -1
- package/color-radio-group/README.md +9 -0
- package/color-radio-group/color-radio-group.js +3 -3
- package/color-radio-group/color-radio-group.stories.js +1 -1
- package/color-radio-group/index.d.ts +1 -1
- package/combobox/README.md +12 -0
- package/combobox/combobox.d.ts +1 -1
- package/combobox/combobox.stories.d.ts +2 -1
- package/combobox/combobox.stories.js +7 -3
- package/combobox/index.d.ts +1 -1
- 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/content/types.d.ts +1 -1
- package/context/provider.js +1 -1
- package/css/alert-bubble.css +100 -0
- package/css/avatar-file-input.css +54 -20
- package/css/avatar.css +4 -4
- package/css/badge.css +5 -5
- package/css/button-group.css +1 -1
- package/css/button-list.css +2 -2
- package/css/button.css +78 -32
- package/css/calendar.css +115 -51
- package/css/checkbox-button.css +10 -10
- 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 +11 -3
- package/css/dropzone.css +6 -6
- 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 +8 -8
- package/css/input-with-popover.css +1 -1
- package/css/input.css +10 -10
- 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 +12 -12
- 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 +16 -16
- package/css/text-link.css +4 -4
- package/css/textarea.css +68 -76
- package/css/time-picker.css +12 -16
- package/css/toggle.css +3 -3
- package/css/tooltip.css +2 -2
- package/date-picker/README.md +9 -0
- package/date-picker/date-picker-content.d.ts +5 -2
- package/date-picker/date-picker-content.js +4 -3
- package/date-picker/date-picker-decade.js +10 -10
- 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 +4 -2
- package/date-picker/index.d.ts +1 -1
- package/date-picker-input/README.md +11 -0
- package/date-picker-input/date-picker-input.d.ts +2 -0
- package/date-picker-input/date-picker-input.js +5 -3
- package/date-picker-input/date-picker-input.stories.js +1 -1
- package/date-picker-input/index.d.ts +1 -1
- package/date-picker-input/index.js +3 -3
- package/date-range-picker/README.md +1 -0
- 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/README.md +1 -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/README.md +13 -0
- package/datetime-picker/datetime-picker.d.ts +3 -1
- package/datetime-picker/datetime-picker.js +5 -5
- package/datetime-picker/index.d.ts +1 -1
- package/datetime-picker/index.js +2 -2
- package/datetime-picker-input/README.md +1 -0
- package/datetime-picker-input/datetime-picker-input.d.ts +2 -0
- package/datetime-picker-input/datetime-picker-input.js +5 -3
- package/datetime-picker-input/datetime-picker-input.stories.js +1 -1
- package/datetime-picker-input/index.d.ts +1 -1
- package/datetime-picker-input/index.js +2 -2
- 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/dropdown/README.md +1 -0
- package/dropdown/dropdown.stories.js +2 -2
- package/dropdown/index.d.ts +1 -1
- package/dropzone/README.md +8 -0
- package/dropzone/dropzone-input.js +10 -6
- package/dropzone/dropzone.stories.js +7 -7
- package/error-message/README.md +7 -0
- package/error-message/error-message.stories.js +1 -1
- package/file-input/README.md +11 -0
- package/file-input/file-input.d.ts +3 -0
- package/file-input/file-input.js +10 -22
- package/file-input/file-input.stories.js +5 -5
- package/file-input/index.d.ts +1 -1
- package/flash-messages/README.md +23 -0
- package/flash-messages/flash-message.d.ts +1 -1
- package/flash-messages/flash-message.js +1 -1
- package/flash-messages/flash-messages.js +52 -18
- package/flash-messages/flash-messages.stories.js +12 -0
- package/flash-messages/index.d.ts +2 -2
- package/flash-messages/index.js +4 -4
- package/form-component/README.md +7 -0
- package/form-component/index.d.ts +1 -1
- package/hooks/use-dropdown.d.ts +16 -8
- package/icon/README.md +11 -0
- package/icon/icon.stories.js +1 -1
- package/icon/index.d.ts +1 -1
- 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 +6 -5
- 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 +2 -2
- package/image-gallery/image-gallery.stories.js +5 -1
- package/image-gallery/image.d.ts +1 -1
- package/image-gallery/image.js +1 -1
- package/image-gallery/use-image.js +1 -1
- package/input/README.md +8 -0
- package/input/input-element.d.ts +1 -0
- package/input/input-element.js +1 -1
- package/input/input.d.ts +2 -2
- package/input/input.js +3 -3
- package/input/input.stories.js +3 -3
- package/label/README.md +7 -0
- package/label/index.d.ts +1 -1
- package/label/label.stories.js +1 -1
- package/layout/index.d.ts +1 -1
- package/layout/layout.js +28 -28
- package/list-item/README.md +7 -0
- package/list-item/index.d.ts +1 -1
- package/list-item/list-item.stories.js +1 -1
- package/loader/README.md +7 -0
- package/loader/index.d.ts +1 -1
- package/message/README.md +1 -0
- 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/README.md +24 -0
- package/modal/index.d.ts +3 -2
- 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/README.md +10 -0
- package/multi-combobox/_multi-combobox-base.js +28 -22
- package/multi-combobox/multi-combobox.js +1 -1
- package/multi-combobox/multi-combobox.stories.js +7 -4
- package/multi-combobox/types.d.ts +5 -1
- package/multi-select/README.md +11 -0
- package/multi-select/_multi-select-base.js +21 -21
- package/multi-select/index.d.ts +1 -1
- package/multi-select/multi-select.js +1 -1
- package/multi-select/multi-select.stories.js +6 -3
- package/multi-select/types.d.ts +1 -1
- package/package.json +17 -10
- package/pagination/README.md +31 -0
- package/pagination/index.d.ts +1 -1
- package/pagination/pagination.d.ts +1 -1
- package/pagination/pagination.js +2 -2
- package/pagination/pagination.stories.d.ts +0 -3
- package/pagination/pagination.stories.js +14 -30
- package/paper/README.md +7 -0
- package/paper/index.d.ts +1 -1
- package/paper/paper.stories.js +1 -1
- package/radio/README.md +7 -0
- package/radio/index.d.ts +1 -1
- package/radio/radio.stories.js +1 -1
- package/radio-group/README.md +8 -0
- package/radio-group/index.d.ts +2 -2
- package/radio-group/radio-group.d.ts +3 -3
- package/radio-group/radio-group.js +2 -2
- package/radio-group/radio-group.stories.js +5 -5
- package/raster-image/README.md +7 -0
- package/raster-image/index.d.ts +1 -1
- package/raster-image/raster-image.js +1 -1
- package/scripts/generate-tw-tokens.js +40 -32
- package/select/README.md +11 -0
- package/select/index.d.ts +1 -1
- package/select/select.d.ts +1 -1
- package/select/select.js +1 -1
- package/select/select.stories.d.ts +2 -1
- package/select/select.stories.js +9 -3
- package/tabs/README.md +7 -0
- package/tabs/index.d.ts +1 -1
- package/text-input/README.md +10 -0
- package/text-input/index.d.ts +1 -1
- package/text-input/text-input.d.ts +1 -0
- package/text-input/text-input.js +2 -2
- package/text-link/README.md +19 -0
- package/text-link/index.d.ts +1 -1
- package/text-link/text-link.d.ts +1 -1
- package/textarea/README.md +9 -0
- package/textarea/index.d.ts +1 -1
- package/textarea/textarea.js +5 -5
- package/textarea/textarea.stories.js +1 -1
- package/time-picker/README.md +8 -0
- package/time-picker/index.d.ts +1 -1
- package/time-picker/time-picker-hour.js +6 -6
- package/time-picker/time-picker-hours.js +2 -2
- package/time-picker/time-picker-minute.js +6 -6
- package/time-picker/time-picker-minutes.js +2 -2
- package/time-picker/time-picker.d.ts +2 -1
- package/time-picker/time-picker.js +7 -6
- package/time-picker-input/README.md +9 -0
- package/time-picker-input/index.d.ts +1 -1
- package/time-picker-input/index.js +3 -3
- package/time-picker-input/time-picker-input.js +6 -4
- package/time-picker-input/time-picker-input.stories.js +1 -1
- package/toggle/README.md +7 -0
- package/toggle/index.d.ts +1 -1
- package/toggle/toggle.js +8 -8
- package/toggle/toggle.stories.js +1 -1
- package/tooltip/README.md +7 -0
- package/tooltip/index.d.ts +2 -2
- package/tooltip/tooltip.js +27 -25
- package/tooltip/tooltip.stories.js +1 -1
- package/tooltip/use-tooltip.d.ts +19 -11
- package/tooltip/use-tooltip.js +15 -15
- package/tw-tokens/tw-colors.d.ts +283 -282
- package/tw-tokens/tw-colors.js +283 -282
- package/tw-tokens/tw-line-height.d.ts +8 -8
- package/tw-tokens/tw-line-height.js +8 -8
- package/tw-tokens/tw-spacing.d.ts +34 -34
- package/tw-tokens/tw-spacing.js +34 -34
- package/tw-tokens/tw-z-index.d.ts +7 -7
- package/tw-tokens/tw-z-index.js +7 -7
- package/types/index.d.ts +1 -1
- package/types/index.js +1 -1
- package/typography/README.md +7 -0
- package/utils/action.d.ts +2 -1
- package/utils/action.js +2 -2
- package/utils/icons-config.js +13 -3
- package/utils/mocks/{uploadFIle.mock.js → upload-file.mock.js} +1 -1
- package/utils/snap-test.js +1 -1
- package/utils/storybook-config.d.ts +12 -2
- package/utils/storybook-config.js +9 -1
- package/utils/tailwind-config.js +10 -1
- 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
- /package/utils/mocks/{uploadFIle.mock.d.ts → upload-file.mock.d.ts} +0 -0
|
@@ -24,7 +24,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports._MultiSelectBase = void 0;
|
|
27
|
-
const react_1 = require("@
|
|
27
|
+
const react_1 = require("@floating-ui/react");
|
|
28
|
+
const react_2 = require("@headlessui/react");
|
|
28
29
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
29
30
|
const useInputFocus_1 = require("@uxf/core/hooks/useInputFocus");
|
|
30
31
|
const composeRefs_1 = require("@uxf/core/utils/composeRefs");
|
|
@@ -33,14 +34,13 @@ const icon_1 = require("@uxf/ui//icon");
|
|
|
33
34
|
const chip_1 = require("@uxf/ui/chip");
|
|
34
35
|
const use_dropdown_1 = require("@uxf/ui/hooks/use-dropdown");
|
|
35
36
|
const label_1 = require("@uxf/ui/label");
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
exports._MultiSelectBase = (0, react_2.forwardRef)((props, ref) => {
|
|
37
|
+
const react_3 = __importStar(require("react"));
|
|
38
|
+
exports._MultiSelectBase = (0, react_3.forwardRef)((props, ref) => {
|
|
39
39
|
var _a, _b, _c;
|
|
40
|
-
const innerRef = (0,
|
|
40
|
+
const innerRef = (0, react_3.useRef)(null);
|
|
41
41
|
const input = (0, useInputFocus_1.useInputFocus)(innerRef, props.onBlur, props.onFocus);
|
|
42
42
|
const dropdown = (0, use_dropdown_1.useDropdown)((_a = props.dropdownPlacement) !== null && _a !== void 0 ? _a : "bottom", true, props.dropdownStrategy);
|
|
43
|
-
const stableRef = (0,
|
|
43
|
+
const stableRef = (0, react_3.useMemo)(() => (0, composeRefs_1.composeRefs)(innerRef, ref, dropdown.refs.setReference), [ref, dropdown.refs.setReference]);
|
|
44
44
|
const iconName = (_b = props.iconName) !== null && _b !== void 0 ? _b : "caretDown";
|
|
45
45
|
const selectedOptions = (_c = props.value) !== null && _c !== void 0 ? _c : [];
|
|
46
46
|
const filteredOptions = props.options.filter((option) => !selectedOptions.map((i) => i.id).includes(option.id));
|
|
@@ -54,25 +54,25 @@ exports._MultiSelectBase = (0, react_2.forwardRef)((props, ref) => {
|
|
|
54
54
|
props.onChange((_b = (_a = props.value) === null || _a === void 0 ? void 0 : _a.filter((v) => v.id !== valueId)) !== null && _b !== void 0 ? _b : []);
|
|
55
55
|
};
|
|
56
56
|
const withoutPopover = !props.withPopover;
|
|
57
|
-
return (
|
|
57
|
+
return (react_3.default.createElement(react_2.Listbox, { as: "div", className: (0, cx_1.cx)(withoutPopover && "uxf-form-component", "uxf-multi-combobox", 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, multiple: true, onChange: handleSelectValueChange, value: selectedOptions }, (renderProps) => {
|
|
58
58
|
var _a, _b;
|
|
59
|
-
const inputElement = (
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
const inputElement = (react_3.default.createElement(react_3.default.Fragment, null,
|
|
60
|
+
react_3.default.createElement(react_2.Listbox.Button, { "aria-invalid": props.isInvalid, "aria-describedby": props.errorId, as: "div", className: (0, cx_1.cx)("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, tabIndex: props.isDisabled || props.isReadOnly ? undefined : 0, ref: stableRef },
|
|
61
|
+
react_3.default.createElement("div", { className: (0, cx_1.cx)("uxf-multi-select__input", selectedOptions.length === 0 && "uxf-multi-select__input--is-empty") }, selectedOptions.length === 0
|
|
62
62
|
? props.placeholder
|
|
63
|
-
: selectedOptions.map((item) => (
|
|
64
|
-
|
|
65
|
-
renderProps.open && (
|
|
66
|
-
|
|
67
|
-
var _a;
|
|
63
|
+
: selectedOptions.map((item) => (react_3.default.createElement(chip_1.Chip, { className: "uxf-multi-combobox__input-chip", color: item.color, key: item.id, onClose: handleRemove(item.id), size: "large", suppressFocus: true }, item.label)))),
|
|
64
|
+
react_3.default.createElement(icon_1.Icon, { className: (0, cx_1.cx)("uxf-select-base__arrow-icon", renderProps.open && classes_1.CLASSES.IS_OPEN), name: iconName })),
|
|
65
|
+
renderProps.open && (react_3.default.createElement(react_1.FloatingPortal, null,
|
|
66
|
+
react_3.default.createElement(react_2.Listbox.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"}`, dropdown.placement === "bottom" && "uxf-dropdown--bottom", dropdown.placement === "top" && "uxf-dropdown--top"), ref: dropdown.refs.setFloating, static: true, style: dropdown.floatingStyles }, filteredOptions.map((option) => {
|
|
67
|
+
var _a, _b, _c;
|
|
68
68
|
const optionKey = (_a = props.keyExtractor) === null || _a === void 0 ? void 0 : _a.call(props, option);
|
|
69
|
-
return (
|
|
69
|
+
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), key: optionKey !== null && optionKey !== void 0 ? optionKey : option.id, value: option, disabled: option.disabled }, (_c = (_b = props.renderOption) === null || _b === void 0 ? void 0 : _b.call(props, option)) !== null && _c !== void 0 ? _c : option.label));
|
|
70
70
|
})))),
|
|
71
|
-
props.helperText && withoutPopover && (
|
|
72
|
-
return (
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
props.helperText && withoutPopover && (react_3.default.createElement("div", { className: (0, cx_1.cx)("uxf-helper-text", props.isInvalid && classes_1.CLASSES.IS_INVALID), id: props.errorId }, props.helperText))));
|
|
72
|
+
return (react_3.default.createElement(react_3.default.Fragment, null, withoutPopover ? (react_3.default.createElement(react_3.default.Fragment, null,
|
|
73
|
+
react_3.default.createElement("div", { className: "uxf-form-component__label" },
|
|
74
|
+
react_3.default.createElement(react_2.Listbox.Label, { as: label_1.Label, isHidden: props.hiddenLabel, onClick: props.isDisabled || props.isReadOnly ? undefined : input.focus }, props.label)),
|
|
75
|
+
react_3.default.createElement("div", { className: "uxf-form-component__input" }, inputElement))) : (inputElement)));
|
|
76
76
|
}));
|
|
77
77
|
});
|
|
78
78
|
exports._MultiSelectBase.displayName = "UxfUiMultiSelectBase";
|
package/multi-select/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { MultiSelect } from "./multi-select";
|
|
2
|
-
export type { MultiSelectOption, MultiSelectProps,
|
|
2
|
+
export type { MultiSelectOption, MultiSelectProps, MultiSelectTypeRef, MultiSelectValueId } from "./types";
|
|
@@ -27,9 +27,9 @@ exports.MultiSelect = void 0;
|
|
|
27
27
|
const react_1 = require("@headlessui/react");
|
|
28
28
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
29
29
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
30
|
-
const form_component_1 = require("../form-component");
|
|
31
30
|
const icon_1 = require("@uxf/ui/icon");
|
|
32
31
|
const react_2 = __importStar(require("react"));
|
|
32
|
+
const form_component_1 = require("../form-component");
|
|
33
33
|
const _multi_select_base_1 = require("./_multi-select-base");
|
|
34
34
|
exports.MultiSelect = (0, react_2.forwardRef)((props, ref) => {
|
|
35
35
|
var _a, _b, _c;
|
|
@@ -29,8 +29,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.ComponentStructure = exports.Default = void 0;
|
|
30
30
|
const component_structure_analyzer_1 = __importDefault(require("@uxf/ui/utils/component-structure-analyzer"));
|
|
31
31
|
const react_1 = __importStar(require("react"));
|
|
32
|
-
const index_1 = require("./index");
|
|
33
32
|
const action_1 = require("../utils/action");
|
|
33
|
+
const index_1 = require("./index");
|
|
34
34
|
exports.default = {
|
|
35
35
|
title: "UI/MultiSelect",
|
|
36
36
|
component: index_1.MultiSelect,
|
|
@@ -40,7 +40,7 @@ const options = [
|
|
|
40
40
|
{ id: "two", label: "Option blue", color: "blue" },
|
|
41
41
|
{ id: "three", label: "Option green", color: "green" },
|
|
42
42
|
{ id: "four", label: "Option four" },
|
|
43
|
-
{ id: "five", label: "Option five" },
|
|
43
|
+
{ id: "five", label: "Option five disabled", disabled: true },
|
|
44
44
|
{ id: "six", label: "Option with diacritics (ěščřžýáíé)" },
|
|
45
45
|
];
|
|
46
46
|
const Default = () => {
|
|
@@ -52,7 +52,10 @@ const Default = () => {
|
|
|
52
52
|
});
|
|
53
53
|
const component = (react_1.default.createElement(react_1.default.Fragment, null,
|
|
54
54
|
react_1.default.createElement(index_1.MultiSelect, { id: "multi-select-1", label: "MultiSelect", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte pros\u00EDm jednu nebo v\u00EDce mo\u017Enost\u00ED", value: value }),
|
|
55
|
-
react_1.default.createElement(index_1.MultiSelect, { id: "multi-select-2", label: "MultiSelect with popover", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte...", value: value, withPopover: true })
|
|
55
|
+
react_1.default.createElement(index_1.MultiSelect, { id: "multi-select-2", label: "MultiSelect with popover", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte...", value: value, withPopover: true }),
|
|
56
|
+
react_1.default.createElement(index_1.MultiSelect, { id: "multi-select-3", label: "MultiSelect with renderOption", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte...", value: value, renderOption: (option) => react_1.default.createElement(react_1.default.Fragment, null,
|
|
57
|
+
"Option: ",
|
|
58
|
+
option.label) })));
|
|
56
59
|
return (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
57
60
|
react_1.default.createElement("div", { className: "light space-y-2 p-20 lg:w-1/2" }, component),
|
|
58
61
|
react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20 lg:w-1/2" }, component)));
|
package/multi-select/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Placement, Strategy } from "@floating-ui/react";
|
|
2
|
+
import { InputGroupSizes, InputGroupVariants } from "@uxf/ui/input/theme";
|
|
2
3
|
import { ReactNode } from "react";
|
|
3
4
|
import { ChipColor } from "../chip";
|
|
4
5
|
import { IconsSet } from "../icon/theme";
|
|
5
6
|
import { FormControlProps } from "../types";
|
|
6
|
-
import { InputGroupSizes, InputGroupVariants } from "@uxf/ui/input/theme";
|
|
7
7
|
export type MultiSelectValueId = number | string;
|
|
8
8
|
export type MultiSelectOption<T = MultiSelectValueId> = {
|
|
9
9
|
color?: ChipColor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/ui",
|
|
3
|
-
"version": "10.0.0-beta.
|
|
3
|
+
"version": "10.0.0-beta.80",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -8,24 +8,31 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"prepareCss": "rm -rf ./css && mkdir css && cp ./**/*.css ./css/",
|
|
10
10
|
"build": "npm run prepareCss && tsc -P tsconfig.json",
|
|
11
|
+
"tw-tokens:check": "ts-node ./scripts/generate-tw-tokens.js --mode=\"check\" --twConfig=\"./utils/tailwind-config.js\" --outputPath=\"./tw-tokens/\"",
|
|
12
|
+
"tw-tokens:gen": "ts-node ./scripts/generate-tw-tokens.js --twConfig=\"./utils/tailwind-config.js\" --outputPath=\"./tw-tokens/\"",
|
|
11
13
|
"typecheck": "../../node_modules/.bin/tsc --noEmit --skipLibCheck"
|
|
12
14
|
},
|
|
13
15
|
"author": "UX Fans s.r.o",
|
|
14
16
|
"license": "MIT",
|
|
15
17
|
"dependencies": {
|
|
16
|
-
"@floating-ui/react": "0.
|
|
18
|
+
"@floating-ui/react": "0.26.0",
|
|
17
19
|
"@headlessui/react": "1.7.14",
|
|
18
|
-
"@uxf/core": "10.0.0-beta.
|
|
19
|
-
"@uxf/datepicker": "
|
|
20
|
-
"@uxf/styles": "
|
|
21
|
-
"color2k": "
|
|
22
|
-
"dayjs": "
|
|
23
|
-
"jump.js": "
|
|
20
|
+
"@uxf/core": "10.0.0-beta.80",
|
|
21
|
+
"@uxf/datepicker": "10.0.0-beta.80",
|
|
22
|
+
"@uxf/styles": "10.0.0-beta.80",
|
|
23
|
+
"color2k": "2.0.2",
|
|
24
|
+
"dayjs": "1.11.10",
|
|
25
|
+
"jump.js": "1.0.2",
|
|
24
26
|
"react-dropzone": "14.2.3",
|
|
25
27
|
"react-swipeable": "7.0.1"
|
|
26
28
|
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"react": ">= 18.2.0",
|
|
31
|
+
"react-dom": ">= 18.2.0"
|
|
32
|
+
},
|
|
27
33
|
"devDependencies": {
|
|
28
|
-
"@types/jump.js": "
|
|
29
|
-
"@
|
|
34
|
+
"@types/jump.js": "1.0.4",
|
|
35
|
+
"@types/react": "18.2.27",
|
|
36
|
+
"@types/react-dom": "18.2.12"
|
|
30
37
|
}
|
|
31
38
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Pagination
|
|
2
|
+
|
|
3
|
+
## CSS dependencies
|
|
4
|
+
|
|
5
|
+
```css
|
|
6
|
+
@import url("@uxf/ui/pagination/pagination.css");
|
|
7
|
+
@import url("@uxf/ui/icon/icon.css");
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Required icons
|
|
11
|
+
|
|
12
|
+
- `chevronsLeft`
|
|
13
|
+
- `chevronLeft`
|
|
14
|
+
- `chevronRight`
|
|
15
|
+
- `chevronsRight`
|
|
16
|
+
|
|
17
|
+
## Props configuration
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
// pagination.d.ts
|
|
21
|
+
|
|
22
|
+
declare module "@uxf/ui/pagination/theme" {
|
|
23
|
+
export interface PaginationSizes {
|
|
24
|
+
xs: true;
|
|
25
|
+
sm: true;
|
|
26
|
+
default: true;
|
|
27
|
+
lg: true;
|
|
28
|
+
xl: true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
package/pagination/index.d.ts
CHANGED
package/pagination/pagination.js
CHANGED
|
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Pagination = void 0;
|
|
7
|
+
const usePagination_1 = require("@uxf/core/hooks/usePagination");
|
|
8
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
7
9
|
const react_1 = __importDefault(require("react"));
|
|
8
10
|
const icon_1 = require("../icon");
|
|
9
|
-
const cx_1 = require("@uxf/core/utils/cx");
|
|
10
|
-
const usePagination_1 = require("@uxf/core/hooks/usePagination");
|
|
11
11
|
const Pagination = (props) => {
|
|
12
12
|
var _a;
|
|
13
13
|
const isCurrentPageFirst = props.page === 1;
|
|
@@ -24,44 +24,28 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Default = void 0;
|
|
27
|
-
const pagination_1 = require("./pagination");
|
|
28
27
|
const react_1 = __importStar(require("react"));
|
|
29
|
-
// import Docs from "./pagination.docs.mdx";
|
|
30
28
|
const action_1 = require("../utils/action");
|
|
29
|
+
const pagination_1 = require("./pagination");
|
|
31
30
|
exports.default = {
|
|
32
31
|
title: "UI/Pagination",
|
|
33
32
|
component: pagination_1.Pagination,
|
|
34
|
-
parameters: {
|
|
35
|
-
docs: {
|
|
36
|
-
// page: Docs,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
33
|
};
|
|
40
34
|
function Default() {
|
|
41
35
|
const [page, setPage] = (0, react_1.useState)(1);
|
|
42
36
|
const onPageChange = (0, action_1.action)("onPageChange", setPage);
|
|
43
|
-
return (react_1.default.createElement("div",
|
|
44
|
-
react_1.default.createElement("
|
|
45
|
-
|
|
46
|
-
react_1.default.createElement(
|
|
47
|
-
|
|
48
|
-
react_1.default.createElement(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
react_1.default.createElement(
|
|
53
|
-
|
|
54
|
-
react_1.default.createElement(
|
|
55
|
-
|
|
56
|
-
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "sm" }),
|
|
57
|
-
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "default" }),
|
|
58
|
-
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "lg" }),
|
|
59
|
-
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "xl" })),
|
|
60
|
-
react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20 text-white lg:w-1/2" },
|
|
61
|
-
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "xs" }),
|
|
62
|
-
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "sm" }),
|
|
63
|
-
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "default" }),
|
|
64
|
-
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "lg" }),
|
|
65
|
-
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "xl" })))));
|
|
37
|
+
return (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
38
|
+
react_1.default.createElement("div", { className: "light space-y-2 p-20 lg:w-1/2" },
|
|
39
|
+
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "xs" }),
|
|
40
|
+
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "sm" }),
|
|
41
|
+
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "default" }),
|
|
42
|
+
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "lg" }),
|
|
43
|
+
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "xl" })),
|
|
44
|
+
react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20 text-white lg:w-1/2" },
|
|
45
|
+
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "xs" }),
|
|
46
|
+
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "sm" }),
|
|
47
|
+
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "default" }),
|
|
48
|
+
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "lg" }),
|
|
49
|
+
react_1.default.createElement(pagination_1.Pagination, { count: 10, page: page, onPageChange: onPageChange, size: "xl" }))));
|
|
66
50
|
}
|
|
67
51
|
exports.Default = Default;
|
package/paper/README.md
ADDED
package/paper/index.d.ts
CHANGED
package/paper/paper.stories.js
CHANGED
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Default = void 0;
|
|
7
|
-
const paper_1 = require("./paper");
|
|
8
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const paper_1 = require("./paper");
|
|
9
9
|
exports.default = {
|
|
10
10
|
title: "UI/Paper",
|
|
11
11
|
component: paper_1.Paper,
|
package/radio/README.md
ADDED
package/radio/index.d.ts
CHANGED
package/radio/radio.stories.js
CHANGED
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Default = void 0;
|
|
7
|
-
const index_1 = require("./index");
|
|
8
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const index_1 = require("./index");
|
|
9
9
|
exports.default = {
|
|
10
10
|
title: "UI/Radio",
|
|
11
11
|
component: index_1.Radio,
|
package/radio-group/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { RadioGroupOption, RadioGroupOptionValue, RadioGroupProps } from "./radio-group";
|
|
2
|
-
export type { RadioGroupVariant } from "./theme";
|
|
3
1
|
export { RadioGroup } from "./radio-group";
|
|
2
|
+
export type { RadioGroupOption, RadioGroupOptionValueId, RadioGroupProps } from "./radio-group";
|
|
3
|
+
export type { RadioGroupVariant } from "./theme";
|
|
@@ -2,13 +2,13 @@ import React, { CSSProperties, ReactNode } from "react";
|
|
|
2
2
|
import { RadioSize } from "../radio";
|
|
3
3
|
import { FormControlProps } from "../types";
|
|
4
4
|
import { RadioGroupVariant } from "./theme";
|
|
5
|
-
export type
|
|
5
|
+
export type RadioGroupOptionValueId = string | number;
|
|
6
6
|
export interface RadioGroupOption {
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
id: RadioGroupOptionValueId;
|
|
8
9
|
label: string;
|
|
9
|
-
value: RadioGroupOptionValue;
|
|
10
10
|
}
|
|
11
|
-
export interface RadioGroupProps extends FormControlProps<
|
|
11
|
+
export interface RadioGroupProps extends FormControlProps<RadioGroupOptionValueId | null> {
|
|
12
12
|
className?: string;
|
|
13
13
|
helperText?: ReactNode;
|
|
14
14
|
forceColumn?: boolean;
|
|
@@ -43,9 +43,9 @@ exports.RadioGroup = (0, react_2.forwardRef)((props, ref) => {
|
|
|
43
43
|
react_2.default.createElement("div", { className: "uxf-form-component__label" },
|
|
44
44
|
react_2.default.createElement(react_1.RadioGroup.Label, { as: label_1.Label, className: "uxf-radio-group__label", isHidden: props.hiddenLabel, ref: ref }, props.label)),
|
|
45
45
|
react_2.default.createElement("div", { className: "uxf-form-component__input" },
|
|
46
|
-
react_2.default.createElement("div", { className: "uxf-radio-group__options-wrapper" }, props.options.map((option) => (react_2.default.createElement(react_1.RadioGroup.Option, { className: (0, cx_1.cx)("uxf-radio-group__option", props.isDisabled && classes_1.CLASSES.IS_DISABLED), disabled: option.disabled, key: option.
|
|
46
|
+
react_2.default.createElement("div", { className: "uxf-radio-group__options-wrapper" }, props.options.map((option) => (react_2.default.createElement(react_1.RadioGroup.Option, { className: (0, cx_1.cx)("uxf-radio-group__option", props.isDisabled && classes_1.CLASSES.IS_DISABLED), disabled: option.disabled, key: option.id.toString(), value: option.id }, (o) => (react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-radio-group__option-wrapper", o.checked && classes_1.CLASSES.IS_SELECTED) },
|
|
47
47
|
react_2.default.createElement("span", { className: "uxf-radio-group__option-label" }, option.label),
|
|
48
|
-
react_2.default.createElement(radio_1.Radio, { checked: o.checked, isDisabled: props.isDisabled || o.disabled, isInvalid: props.isInvalid, ref: o.checked ? innerRef : undefined, size: radioSize, value: option.
|
|
48
|
+
react_2.default.createElement(radio_1.Radio, { checked: o.checked, isDisabled: props.isDisabled || o.disabled, isInvalid: props.isInvalid, ref: o.checked ? innerRef : undefined, size: radioSize, value: option.id }))))))),
|
|
49
49
|
props.helperText && (react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-helper-text", props.isInvalid && classes_1.CLASSES.IS_INVALID), id: errorId }, props.helperText)))));
|
|
50
50
|
});
|
|
51
51
|
exports.RadioGroup.displayName = "UxfUiRadioGroup";
|
|
@@ -24,29 +24,29 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Default = void 0;
|
|
27
|
-
const index_1 = require("./index");
|
|
28
27
|
const react_1 = __importStar(require("react"));
|
|
29
28
|
const action_1 = require("../utils/action");
|
|
29
|
+
const index_1 = require("./index");
|
|
30
30
|
exports.default = {
|
|
31
31
|
title: "UI/RadioGroup",
|
|
32
32
|
component: index_1.RadioGroup,
|
|
33
33
|
};
|
|
34
34
|
const options = [
|
|
35
35
|
{
|
|
36
|
-
|
|
36
|
+
id: "1",
|
|
37
37
|
label: "Radio one",
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
|
-
|
|
40
|
+
id: "2",
|
|
41
41
|
label: "Radio two",
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
|
-
|
|
44
|
+
id: "3",
|
|
45
45
|
label: "Radio three-sixty",
|
|
46
46
|
},
|
|
47
47
|
];
|
|
48
48
|
function Default() {
|
|
49
|
-
const [value, setValue] = (0, react_1.useState)(options[0].
|
|
49
|
+
const [value, setValue] = (0, react_1.useState)(options[0].id);
|
|
50
50
|
const onChange = (0, action_1.action)("onChange", setValue);
|
|
51
51
|
const testRadioGroups = (react_1.default.createElement("div", { className: "space-y-10" },
|
|
52
52
|
react_1.default.createElement(index_1.RadioGroup, { id: "radiogroup", label: "Light Radio group", onChange: onChange, options: options, value: value }),
|
package/raster-image/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ const RasterImage = (props) => {
|
|
|
42
42
|
: props.width && props.height
|
|
43
43
|
? Math.ceil((props.height / props.width) * w)
|
|
44
44
|
: "auto", key: `${w}-${i}`, options: props.options, quality: props.quality, src: props.src, width: w }))).reverse()) !== null && _f !== void 0 ? _f : (react_1.default.createElement(image_1.ImgSources, { height: (_g = props.height) !== null && _g !== void 0 ? _g : "auto", options: props.options, quality: props.quality, src: props.src, width: (_h = props.width) !== null && _h !== void 0 ? _h : "auto" })),
|
|
45
|
-
react_1.default.createElement("img", { alt: props.alt, className: (0, cx_1.cx)(imgClassName), height: props.height, loading: props.loading, src: resizerSrc, width: props.width })));
|
|
45
|
+
react_1.default.createElement("img", { alt: props.alt, className: (0, cx_1.cx)(imgClassName), height: (0, image_1.getImgElementHeight)(props.src, props.width, props.height), loading: props.loading, src: resizerSrc, width: (0, image_1.getImgElementWidth)(props.src, props.width, props.height) })));
|
|
46
46
|
};
|
|
47
47
|
exports.RasterImage = RasterImage;
|
|
48
48
|
exports.RasterImage.displayName = "UxfUiRasterImage";
|
|
@@ -47,48 +47,56 @@ const TW_TOKENS = [
|
|
|
47
47
|
|
|
48
48
|
let error = false;
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
async function generateTwTokens() {
|
|
51
|
+
try {
|
|
52
|
+
const mode = process.argv.filter((c) => c.includes("--mode="))[0]?.split("=")[1];
|
|
53
|
+
const twConfig = process.argv.filter((c) => c.includes("--twConfig="))[0]?.split("=")[1];
|
|
54
|
+
const outputPath = process.argv.filter((c) => c.includes("--outputPath="))[0]?.split("=")[1];
|
|
55
|
+
|
|
56
|
+
if (!twConfig) {
|
|
57
|
+
throw Error(`Provide valid path to tailwind config. Use "--twConfig" argument.`);
|
|
58
|
+
}
|
|
54
59
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
if (!outputPath) {
|
|
61
|
+
throw Error(`Provide valid output path to tailwind tokens. Use "--outputPath" argument.`);
|
|
62
|
+
}
|
|
58
63
|
|
|
59
|
-
|
|
60
|
-
throw Error(`Provide valid output path to tailwind tokens. Use "--outputPath" argument.`);
|
|
61
|
-
}
|
|
64
|
+
const loadedTwConfig = resolveConfig(require(path.resolve(process.cwd(), twConfig)));
|
|
62
65
|
|
|
63
|
-
|
|
66
|
+
const outputDir = path.resolve(process.cwd(), outputPath);
|
|
64
67
|
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
if (mode !== "check" && !fs.existsSync(outputDir)) {
|
|
69
|
+
fs.mkdirSync(outputDir);
|
|
70
|
+
}
|
|
67
71
|
|
|
68
|
-
const
|
|
72
|
+
for (const token of TW_TOKENS) {
|
|
73
|
+
const result = resolveProperty(token, loadedTwConfig.theme) || "";
|
|
69
74
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
const filePath = path.resolve(process.cwd(), `${outputPath}tw-${camelToSnakeCase(token)}.ts`);
|
|
76
|
+
|
|
77
|
+
if (!result && mode !== "check" && fs.existsSync(filePath)) {
|
|
78
|
+
fs.rmSync(filePath);
|
|
79
|
+
}
|
|
73
80
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
const newContent = await prettier.format(result, {
|
|
82
|
+
parser: "typescript",
|
|
83
|
+
tabWidth: 4,
|
|
84
|
+
});
|
|
78
85
|
|
|
79
|
-
|
|
80
|
-
|
|
86
|
+
if (mode === "check") {
|
|
87
|
+
const oldContent = fs.existsSync(filePath) ? fs.readFileSync(filePath).toString() : "";
|
|
81
88
|
|
|
82
|
-
|
|
83
|
-
|
|
89
|
+
if (newContent !== oldContent) {
|
|
90
|
+
throw new Error("Generated tailwind tokens doesn't match with current tailwind config.");
|
|
91
|
+
}
|
|
92
|
+
} else if (newContent) {
|
|
93
|
+
fs.writeFileSync(filePath, newContent, "utf-8");
|
|
84
94
|
}
|
|
85
|
-
} else if (newContent) {
|
|
86
|
-
fs.writeFileSync(filePath, newContent, "utf-8");
|
|
87
95
|
}
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
96
|
+
} catch (err) {
|
|
97
|
+
console.error(err.message);
|
|
98
|
+
error = true;
|
|
99
|
+
}
|
|
92
100
|
}
|
|
93
101
|
|
|
94
|
-
process.exit(error ? 1 : 0);
|
|
102
|
+
generateTwTokens().then(() => process.exit(error ? 1 : 0));
|
package/select/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Select
|
|
2
|
+
|
|
3
|
+
## CSS dependencies
|
|
4
|
+
|
|
5
|
+
```css
|
|
6
|
+
@import url("@uxf/ui/form-component/form-component.css");
|
|
7
|
+
@import url("@uxf/ui/input/input-basic.css");
|
|
8
|
+
@import url("@uxf/ui/input/input.css");
|
|
9
|
+
@import url("@uxf/ui/label/label.css");
|
|
10
|
+
@import url("@uxf/ui/dropdown/dropdown.css");
|
|
11
|
+
```
|
package/select/index.d.ts
CHANGED
package/select/select.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface SelectProps<ValueId = SelectValue, Option = SelectOption<ValueI
|
|
|
13
13
|
noQueryMessage?: string;
|
|
14
14
|
notFoundMessage?: string;
|
|
15
15
|
options: Option[];
|
|
16
|
-
renderOption?: (option: Option) => ReactNode;
|
|
16
|
+
renderOption?: (option: Option, isSelected: boolean) => ReactNode;
|
|
17
17
|
renderSelectedOption?: (option: Option) => ReactNode;
|
|
18
18
|
}
|
|
19
19
|
export declare const Select: {
|
package/select/select.js
CHANGED
|
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Select = void 0;
|
|
7
7
|
const react_1 = require("@headlessui/react");
|
|
8
|
+
const classes_1 = require("@uxf/core/constants/classes");
|
|
8
9
|
const react_2 = __importDefault(require("react"));
|
|
9
10
|
const _select_base_1 = require("../_select-base");
|
|
10
|
-
const classes_1 = require("@uxf/core/constants/classes");
|
|
11
11
|
const Select = (props) => {
|
|
12
12
|
var _a, _b, _c, _d;
|
|
13
13
|
const onChange = (v) => { var _a; return props.onChange((_a = v === null || v === void 0 ? void 0 : v.id) !== null && _a !== void 0 ? _a : null); };
|