@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,24 +24,24 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.ButtonList = void 0;
|
|
27
|
-
const react_1 =
|
|
27
|
+
const react_1 = require("@floating-ui/react");
|
|
28
28
|
const react_2 = require("@headlessui/react");
|
|
29
|
-
const button_1 = require("../button");
|
|
30
|
-
const cx_1 = require("@uxf/core/utils/cx");
|
|
31
|
-
const icon_1 = require("../icon");
|
|
32
29
|
const useAnchorProps_1 = require("@uxf/core/hooks/useAnchorProps");
|
|
30
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
31
|
+
const react_3 = __importStar(require("react"));
|
|
32
|
+
const button_1 = require("../button");
|
|
33
33
|
const use_dropdown_1 = require("../hooks/use-dropdown");
|
|
34
|
-
const
|
|
35
|
-
const MenuButton = (0,
|
|
34
|
+
const icon_1 = require("../icon");
|
|
35
|
+
const MenuButton = (0, react_3.forwardRef)((props, ref) => {
|
|
36
36
|
// eslint-disable-next-line react/destructuring-assignment,@typescript-eslint/no-unused-vars
|
|
37
37
|
const { variant, color, isIconButton, isFullWidth, size, icon, label, className, ...restProps } = props;
|
|
38
38
|
const anchorProps = (0, useAnchorProps_1.useAnchorProps)({
|
|
39
39
|
...restProps,
|
|
40
40
|
className: (0, cx_1.cx)("uxf-button-list__menu-button", className),
|
|
41
41
|
});
|
|
42
|
-
return (
|
|
43
|
-
icon &&
|
|
44
|
-
label &&
|
|
42
|
+
return (react_3.default.createElement("a", { ref: ref, ...anchorProps },
|
|
43
|
+
icon && react_3.default.createElement(icon_1.Icon, { name: icon, className: "uxf-button-list__menu-button-icon" }),
|
|
44
|
+
label && react_3.default.createElement("span", { className: "uxf-button-list__menu-button-label" }, label)));
|
|
45
45
|
});
|
|
46
46
|
MenuButton.displayName = "MenuButton";
|
|
47
47
|
const ButtonList = (props) => {
|
|
@@ -51,25 +51,25 @@ const ButtonList = (props) => {
|
|
|
51
51
|
const openButtonIcon = ((_a = props.openButton) === null || _a === void 0 ? void 0 : _a.icon) === null ? null : (_c = (_b = props.openButton) === null || _b === void 0 ? void 0 : _b.icon) !== null && _c !== void 0 ? _c : "ellipsis-vertical";
|
|
52
52
|
const openButtonLabel = (_e = (_d = props.openButton) === null || _d === void 0 ? void 0 : _d.label) !== null && _e !== void 0 ? _e : null;
|
|
53
53
|
const dropdown = (0, use_dropdown_1.useDropdown)((_f = props.menuPlacement) !== null && _f !== void 0 ? _f : "bottom-start", false, props.menuStrategy);
|
|
54
|
-
return (
|
|
54
|
+
return (react_3.default.createElement("div", { className: (0, cx_1.cx)("uxf-button-list", props.className) },
|
|
55
55
|
buttonsToRender.map((button, index) => {
|
|
56
56
|
var _a, _b, _c;
|
|
57
57
|
const { icon, label, ...restProps } = button;
|
|
58
|
-
return (
|
|
59
|
-
icon &&
|
|
60
|
-
label &&
|
|
58
|
+
return (react_3.default.createElement(button_1.Button, { key: index, ...restProps, color: (_a = restProps.color) !== null && _a !== void 0 ? _a : props.color, size: (_b = restProps.size) !== null && _b !== void 0 ? _b : props.size, variant: (_c = restProps.variant) !== null && _c !== void 0 ? _c : props.variant, className: (0, cx_1.cx)(restProps.className, "uxf-button-list__button") },
|
|
59
|
+
icon && react_3.default.createElement(icon_1.Icon, { name: icon, className: "uxf-button-list__button-icon" }),
|
|
60
|
+
label && react_3.default.createElement("span", { className: "uxf-button-list__button-label" }, label)));
|
|
61
61
|
}),
|
|
62
|
-
restButtons.length > 0 && (
|
|
62
|
+
restButtons.length > 0 && (react_3.default.createElement(react_2.Menu, { as: "div", className: "uxf-button-list__menu" }, ({ open }) => {
|
|
63
63
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
64
|
-
return (
|
|
65
|
-
|
|
66
|
-
openButtonIcon && (
|
|
67
|
-
openButtonLabel && (
|
|
68
|
-
open && (
|
|
69
|
-
|
|
64
|
+
return (react_3.default.createElement(react_3.default.Fragment, null,
|
|
65
|
+
react_3.default.createElement(react_2.Menu.Button, { as: button_1.Button, ...props.openButton, color: (_b = (_a = props.openButton) === null || _a === void 0 ? void 0 : _a.color) !== null && _b !== void 0 ? _b : props.color, size: (_d = (_c = props.openButton) === null || _c === void 0 ? void 0 : _c.size) !== null && _d !== void 0 ? _d : props.size, variant: (_f = (_e = props.openButton) === null || _e === void 0 ? void 0 : _e.variant) !== null && _f !== void 0 ? _f : props.variant, className: (0, cx_1.cx)((_g = props.openButton) === null || _g === void 0 ? void 0 : _g.className, "uxf-button-list__open-button"), isIconButton: !!openButtonIcon && !openButtonLabel, ref: dropdown.refs.setReference },
|
|
66
|
+
openButtonIcon && (react_3.default.createElement(icon_1.Icon, { name: openButtonIcon, className: "uxf-button-list__open-button-icon" })),
|
|
67
|
+
openButtonLabel && (react_3.default.createElement("span", { className: "uxf-button-list__open-button-label" }, openButtonLabel))),
|
|
68
|
+
open && (react_3.default.createElement(react_1.FloatingPortal, null,
|
|
69
|
+
react_3.default.createElement(react_2.Menu.Items, { className: "uxf-button-list__menu-items", ref: dropdown.refs.setFloating, style: dropdown.floatingStyles }, restButtons.map((button, index) => {
|
|
70
70
|
var _a, _b, _c;
|
|
71
|
-
return (
|
|
72
|
-
|
|
71
|
+
return (react_3.default.createElement(react_2.Menu.Item, { key: index },
|
|
72
|
+
react_3.default.createElement(MenuButton, { ...button, color: (_a = button.color) !== null && _a !== void 0 ? _a : props.color, size: (_b = button.size) !== null && _b !== void 0 ? _b : props.size, variant: (_c = button.variant) !== null && _c !== void 0 ? _c : props.variant })));
|
|
73
73
|
}))))));
|
|
74
74
|
}))));
|
|
75
75
|
};
|
package/button-list/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Calendar
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { UseDatePickerReturnType } from "@uxf/datepicker/hooks/use-date-picker";
|
|
2
|
+
import { UseDateRangePickerReturnType } from "@uxf/datepicker/hooks/use-date-range-picker";
|
|
2
3
|
import { CalendarDay } from "@uxf/datepicker/utils/get-days";
|
|
4
|
+
import React from "react";
|
|
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 {};
|
|
@@ -24,39 +24,39 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.CalendarDayCell = void 0;
|
|
27
|
-
const react_1 = __importStar(require("react"));
|
|
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
|
-
const composeRefs_1 = require("@uxf/core/utils/composeRefs");
|
|
31
|
-
const cx_1 = require("@uxf/core/utils/cx");
|
|
32
27
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
33
28
|
const useOnMount_1 = require("@uxf/core/hooks/useOnMount");
|
|
29
|
+
const composeRefs_1 = require("@uxf/core/utils/composeRefs");
|
|
30
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
31
|
+
const use_day_1 = require("@uxf/datepicker/hooks/use-day");
|
|
32
|
+
const react_1 = __importStar(require("react"));
|
|
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";
|
|
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CalendarProvider = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
7
|
const date_picker_context_1 = require("@uxf/datepicker/contexts/date-picker-context");
|
|
9
8
|
const use_date_picker_1 = require("@uxf/datepicker/hooks/use-date-picker");
|
|
9
|
+
const react_1 = __importDefault(require("react"));
|
|
10
10
|
const calendar_1 = require("./calendar");
|
|
11
11
|
const CalendarProvider = (props) => {
|
|
12
12
|
var _a;
|
|
@@ -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
|
+
import { UseDatePickerReturnType } from "@uxf/datepicker/hooks/use-date-picker";
|
|
2
|
+
import { UseDateRangePickerReturnType } from "@uxf/datepicker/hooks/use-date-range-picker";
|
|
1
3
|
import React from "react";
|
|
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
|
@@ -28,26 +28,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.Calendar = void 0;
|
|
30
30
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
31
|
-
const react_1 = __importStar(require("react"));
|
|
32
31
|
const use_month_1 = require("@uxf/datepicker/hooks/use-month");
|
|
33
32
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
34
|
-
const
|
|
33
|
+
const react_1 = __importStar(require("react"));
|
|
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";
|
|
@@ -26,8 +26,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.Default = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
const action_1 = require("../utils/action");
|
|
29
|
-
const calendar_provider_1 = require("./calendar-provider");
|
|
30
29
|
const calendar_1 = require("./calendar");
|
|
30
|
+
const calendar_provider_1 = require("./calendar-provider");
|
|
31
31
|
exports.default = {
|
|
32
32
|
title: "UI/Calendar",
|
|
33
33
|
component: calendar_1.Calendar,
|
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; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Checkbox
|
|
@@ -25,8 +25,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Default = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
|
-
const checkbox_1 = require("./checkbox");
|
|
29
28
|
const action_1 = require("../utils/action");
|
|
29
|
+
const checkbox_1 = require("./checkbox");
|
|
30
30
|
exports.default = {
|
|
31
31
|
title: "UI/Checkbox",
|
|
32
32
|
component: checkbox_1.Checkbox,
|
package/checkbox/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# CheckboxButton
|
|
@@ -25,9 +25,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.CheckboxButton = void 0;
|
|
27
27
|
const react_1 = require("@headlessui/react");
|
|
28
|
-
const react_2 = __importStar(require("react"));
|
|
29
|
-
const cx_1 = require("@uxf/core/utils/cx");
|
|
30
28
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
29
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
30
|
+
const react_2 = __importStar(require("react"));
|
|
31
31
|
const icon_1 = require("../icon");
|
|
32
32
|
exports.CheckboxButton = (0, react_2.forwardRef)((props, ref) => {
|
|
33
33
|
return (react_2.default.createElement(react_1.Switch, { checked: props.value, className: (0, cx_1.cx)("uxf-checkbox-button", props.className, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.value && classes_1.CLASSES.IS_SELECTED), disabled: props.isDisabled, id: props.id, name: props.name, onChange: props.onChange, ref: ref, style: props.style },
|
|
@@ -24,9 +24,9 @@ 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/CheckboxButton",
|
|
32
32
|
component: index_1.CheckboxButton,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# CheckboxInput
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { CSSProperties, ReactNode } from "react";
|
|
2
|
-
import { FormControlProps } from "../types";
|
|
3
2
|
import { CheckboxSize } from "../checkbox";
|
|
3
|
+
import { FormControlProps } from "../types";
|
|
4
4
|
export interface CheckboxInputProps extends FormControlProps<boolean | undefined> {
|
|
5
5
|
className?: string;
|
|
6
6
|
id?: string;
|
|
@@ -25,8 +25,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Default = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
|
-
const checkbox_input_1 = require("./checkbox-input");
|
|
29
28
|
const action_1 = require("../utils/action");
|
|
29
|
+
const checkbox_input_1 = require("./checkbox-input");
|
|
30
30
|
exports.default = {
|
|
31
31
|
title: "UI/CheckboxInput",
|
|
32
32
|
component: checkbox_input_1.CheckboxInput,
|
package/chip/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Chip
|
package/chip/chip.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { UseAnchorProps } from "@uxf/core/hooks/useAnchorProps";
|
|
1
2
|
import { ChipColor, ChipSize, ChipVariant } from "@uxf/ui/chip/theme";
|
|
2
3
|
import React, { AnchorHTMLAttributes, MouseEventHandler } from "react";
|
|
3
|
-
import { UseAnchorProps } from "@uxf/core/hooks/useAnchorProps";
|
|
4
4
|
export interface ChipProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "color" | "type">, UseAnchorProps {
|
|
5
5
|
color?: ChipColor;
|
|
6
6
|
onClose?: MouseEventHandler;
|
package/chip/chip.js
CHANGED
|
@@ -24,29 +24,31 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Chip = void 0;
|
|
27
|
+
const useAnchorProps_1 = require("@uxf/core/hooks/useAnchorProps");
|
|
27
28
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
28
29
|
const react_1 = __importStar(require("react"));
|
|
29
|
-
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,11 +1,31 @@
|
|
|
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 = __importDefault(require("react"));
|
|
8
27
|
const chip_1 = require("@uxf/ui/chip");
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
9
29
|
const storybook_config_1 = require("../utils/storybook-config");
|
|
10
30
|
exports.default = {
|
|
11
31
|
title: "UI/Chip",
|
|
@@ -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/chip/index.d.ts
CHANGED
|
@@ -25,9 +25,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.ColorRadio = void 0;
|
|
27
27
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
28
|
+
const useClickableProps_1 = require("@uxf/core/hooks/useClickableProps");
|
|
28
29
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
29
30
|
const react_1 = __importStar(require("react"));
|
|
30
|
-
const useClickableProps_1 = require("@uxf/core/hooks/useClickableProps");
|
|
31
31
|
const icon_1 = require("../icon");
|
|
32
32
|
function readableColorIsBlack(bgColor) {
|
|
33
33
|
const color = bgColor.substring(1, 7);
|
package/color-radio/index.d.ts
CHANGED
|
@@ -25,12 +25,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.ColorRadioGroup = void 0;
|
|
27
27
|
const react_1 = require("@headlessui/react");
|
|
28
|
+
const classes_1 = require("@uxf/core/constants/classes");
|
|
29
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
28
30
|
const react_2 = __importStar(require("react"));
|
|
31
|
+
const color_radio_1 = require("../color-radio");
|
|
29
32
|
const use_input_submit_1 = require("../hooks/use-input-submit");
|
|
30
33
|
const label_1 = require("../label");
|
|
31
|
-
const cx_1 = require("@uxf/core/utils/cx");
|
|
32
|
-
const classes_1 = require("@uxf/core/constants/classes");
|
|
33
|
-
const color_radio_1 = require("../color-radio");
|
|
34
34
|
exports.ColorRadioGroup = (0, react_2.forwardRef)((props, ref) => {
|
|
35
35
|
const innerRef = (0, react_2.useRef)(null);
|
|
36
36
|
(0, use_input_submit_1.useInputSubmit)(innerRef, "radio-group", props.isDisabled);
|
|
@@ -24,9 +24,9 @@ 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/ColorRadioGroup",
|
|
32
32
|
component: index_1.ColorRadioGroup,
|