@uxf/ui 10.0.0-beta.9 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_file-input-base/file-input-base.js +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 +5 -3
- package/chip/chip.stories.js +37 -31
- 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/create-component-preview-page/create-component-preview-page.d.ts +8 -0
- package/create-component-preview-page/create-component-preview-page.js +40 -0
- package/create-component-preview-page/index.d.ts +2 -0
- package/create-component-preview-page/index.js +18 -0
- package/create-component-preview-page/ui-components.d.ts +237 -0
- package/create-component-preview-page/ui-components.js +263 -0
- package/create-component-preview-page/ui-readmes.d.ts +2 -0
- package/create-component-preview-page/ui-readmes.js +102 -0
- 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 +5 -3
- 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/date-picker.stories.js +2 -1
- 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 +11 -0
- package/{modal/modal-dialog.js → dialog/dialog.js} +9 -10
- 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/dialog/theme.d.ts +4 -0
- package/dialog/theme.js +2 -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-list.js +2 -16
- 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 +6 -4
- package/modal/modal.js +9 -9
- package/modal/modal.stories.js +12 -0
- package/modal/theme.d.ts +7 -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 -12
- 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-input.stories.js +2 -1
- 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/files/get-file-icon.d.ts +2 -0
- package/utils/files/get-file-icon.js +19 -0
- 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,32 +24,66 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.FlashMessages = void 0;
|
|
27
|
-
const react_1 =
|
|
27
|
+
const react_1 = require("@headlessui/react");
|
|
28
|
+
const react_2 = __importStar(require("react"));
|
|
28
29
|
const flash_message_1 = require("./flash-message");
|
|
29
|
-
exports.FlashMessages = (0,
|
|
30
|
-
const [notifications, setNotifications] = (0,
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
exports.FlashMessages = (0, react_2.forwardRef)((props, ref) => {
|
|
31
|
+
const [notifications, setNotifications] = (0, react_2.useState)([]);
|
|
32
|
+
const permanentNotificationsRef = (0, react_2.useRef)(null);
|
|
33
|
+
const permanentNotifications = notifications.filter((notification) => !notification.autoDismiss);
|
|
34
|
+
const dismissableNotifications = notifications.filter((notification) => !!notification.autoDismiss);
|
|
35
|
+
const [showDivider, setShowDivider] = (0, react_2.useState)(false);
|
|
36
|
+
(0, react_2.useEffect)(() => {
|
|
37
|
+
const dividerHandler = () => {
|
|
38
|
+
if (permanentNotificationsRef.current &&
|
|
39
|
+
permanentNotificationsRef.current.scrollHeight > permanentNotificationsRef.current.clientHeight &&
|
|
40
|
+
dismissableNotifications.length > 0) {
|
|
41
|
+
setShowDivider(true);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
setShowDivider(false);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
dividerHandler();
|
|
48
|
+
window.addEventListener("resize", dividerHandler);
|
|
49
|
+
return () => window.removeEventListener("resize", dividerHandler);
|
|
50
|
+
}, [dismissableNotifications.length, notifications]);
|
|
51
|
+
const open = (0, react_2.useCallback)((notification) => setNotifications((prev) => {
|
|
52
|
+
var _a;
|
|
53
|
+
return [
|
|
54
|
+
...prev,
|
|
55
|
+
{
|
|
56
|
+
...notification,
|
|
57
|
+
variant: notification.variant || "success",
|
|
58
|
+
autoDismiss: (_a = notification.autoDismiss) !== null && _a !== void 0 ? _a : true,
|
|
59
|
+
dismissTimeout: notification.dismissTimeout || 5000,
|
|
60
|
+
id: notification.id || Math.round(Math.random() * 1000),
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
}), []);
|
|
64
|
+
const close = (0, react_2.useCallback)((notification) => setNotifications((prev) => prev.filter((n) => n !== notification)), []);
|
|
65
|
+
const closeAll = (0, react_2.useCallback)(() => setNotifications([]), []);
|
|
66
|
+
const innerRef = (0, react_2.useRef)({
|
|
42
67
|
close,
|
|
43
68
|
closeAll,
|
|
44
69
|
open,
|
|
45
70
|
});
|
|
46
|
-
(0,
|
|
71
|
+
(0, react_2.useImperativeHandle)(ref, () => ({
|
|
47
72
|
close: innerRef.current.close,
|
|
48
73
|
closeAll: innerRef.current.closeAll,
|
|
49
74
|
open: innerRef.current.open,
|
|
50
75
|
}), []);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
76
|
+
return notifications.length > 0 ? (react_2.default.createElement("div", { className: "uxf-flash-messages" },
|
|
77
|
+
dismissableNotifications.length > 0 && (react_2.default.createElement("div", { className: "uxf-flash-messages__dismissable" },
|
|
78
|
+
react_2.default.createElement("div", null, dismissableNotifications.map((notification) => {
|
|
79
|
+
return (react_2.default.createElement(react_1.Transition, { key: notification.id, appear: true, show: true, enterFrom: "uxf-flash-message-wrapper--enter-from", enterTo: "uxf-flash-message-wrapper--enter-to", className: "uxf-flash-message-wrapper" },
|
|
80
|
+
react_2.default.createElement(flash_message_1.FlashMessage, { notification: notification, onClose: () => close(notification) })));
|
|
81
|
+
})))),
|
|
82
|
+
showDivider && react_2.default.createElement("hr", { className: "uxf-flash-messages__divider" }),
|
|
83
|
+
permanentNotifications.length > 0 && (react_2.default.createElement("div", { ref: permanentNotificationsRef, className: "uxf-flash-messages__permanent" },
|
|
84
|
+
react_2.default.createElement("div", null, permanentNotifications.map((notification) => {
|
|
85
|
+
return (react_2.default.createElement(react_1.Transition, { key: notification.id, appear: true, show: true, enterFrom: "uxf-flash-message-wrapper--enter-from", enterTo: "uxf-flash-message-wrapper--enter-to", className: "uxf-flash-message-wrapper" },
|
|
86
|
+
react_2.default.createElement(flash_message_1.FlashMessage, { notification: notification, onClose: () => close(notification) })));
|
|
87
|
+
})))))) : null;
|
|
54
88
|
});
|
|
55
89
|
exports.FlashMessages.displayName = "UxfUiFlashMessages";
|
|
@@ -20,6 +20,18 @@ function Default() {
|
|
|
20
20
|
react_1.default.createElement(icon_1.Icon, { name: "check", size: 20 }),
|
|
21
21
|
react_1.default.createElement("span", null, "Everything is alright."))),
|
|
22
22
|
}) }, "Click to fire Flash message, variant success"),
|
|
23
|
+
react_1.default.createElement(button_1.Button, { onClick: () => (0, flash_messages_service_1.flashMessage)({
|
|
24
|
+
message: (react_1.default.createElement("div", { className: "flex items-center space-x-4" },
|
|
25
|
+
react_1.default.createElement(icon_1.Icon, { name: "check", size: 20 }),
|
|
26
|
+
react_1.default.createElement("span", null, "Everything is alright."))),
|
|
27
|
+
variant: "error",
|
|
28
|
+
}) }, "Click to fire Flash message, variant error"),
|
|
29
|
+
react_1.default.createElement(button_1.Button, { onClick: () => (0, flash_messages_service_1.flashMessage)({
|
|
30
|
+
message: (react_1.default.createElement("div", { className: "flex items-center space-x-4" },
|
|
31
|
+
react_1.default.createElement(icon_1.Icon, { name: "check", size: 20 }),
|
|
32
|
+
react_1.default.createElement("span", null, "Everything is alright."))),
|
|
33
|
+
variant: "info",
|
|
34
|
+
}) }, "Click to fire Flash message, variant info"),
|
|
23
35
|
react_1.default.createElement(button_1.Button, { onClick: () => (0, flash_messages_service_1.flashMessage)({
|
|
24
36
|
message: (react_1.default.createElement("div", { className: "flex items-center space-x-4" },
|
|
25
37
|
react_1.default.createElement(icon_1.Icon, { name: "xmarkLarge", size: 20 }),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { getFlashMessagesRef, flashMessage } from "./flash-messages-service";
|
|
2
|
-
export type { FlashMessagesRef } from "./flash-messages";
|
|
3
1
|
export { FlashMessages } from "./flash-messages";
|
|
2
|
+
export type { FlashMessagesRef } from "./flash-messages";
|
|
3
|
+
export { flashMessage, getFlashMessagesRef } from "./flash-messages-service";
|
package/flash-messages/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var flash_messages_service_1 = require("./flash-messages-service");
|
|
5
|
-
Object.defineProperty(exports, "getFlashMessagesRef", { enumerable: true, get: function () { return flash_messages_service_1.getFlashMessagesRef; } });
|
|
6
|
-
Object.defineProperty(exports, "flashMessage", { enumerable: true, get: function () { return flash_messages_service_1.flashMessage; } });
|
|
3
|
+
exports.getFlashMessagesRef = exports.flashMessage = exports.FlashMessages = void 0;
|
|
7
4
|
var flash_messages_1 = require("./flash-messages");
|
|
8
5
|
Object.defineProperty(exports, "FlashMessages", { enumerable: true, get: function () { return flash_messages_1.FlashMessages; } });
|
|
6
|
+
var flash_messages_service_1 = require("./flash-messages-service");
|
|
7
|
+
Object.defineProperty(exports, "flashMessage", { enumerable: true, get: function () { return flash_messages_service_1.flashMessage; } });
|
|
8
|
+
Object.defineProperty(exports, "getFlashMessagesRef", { enumerable: true, get: function () { return flash_messages_service_1.getFlashMessagesRef; } });
|
package/hooks/use-dropdown.d.ts
CHANGED
|
@@ -3,21 +3,33 @@ import { Placement, Strategy } from "@floating-ui/react";
|
|
|
3
3
|
export declare function useDropdown(placement: Placement, matchWidth?: boolean, strategy?: Strategy): {
|
|
4
4
|
placement: Placement;
|
|
5
5
|
strategy: Strategy;
|
|
6
|
-
middlewareData: import("@floating-ui/
|
|
6
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
7
7
|
x: number;
|
|
8
8
|
y: number;
|
|
9
|
+
isPositioned: boolean;
|
|
9
10
|
update: () => void;
|
|
11
|
+
floatingStyles: import("react").CSSProperties;
|
|
12
|
+
refs: {
|
|
13
|
+
reference: import("react").MutableRefObject<import("@floating-ui/react-dom").ReferenceType | null>;
|
|
14
|
+
floating: import("react").MutableRefObject<HTMLElement | null>;
|
|
15
|
+
setReference: (node: import("@floating-ui/react-dom").ReferenceType | null) => void;
|
|
16
|
+
setFloating: (node: HTMLElement | null) => void;
|
|
17
|
+
} & import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
18
|
+
elements: {
|
|
19
|
+
reference: import("@floating-ui/react-dom").ReferenceType | null;
|
|
20
|
+
floating: HTMLElement | null;
|
|
21
|
+
} & import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
10
22
|
context: {
|
|
11
23
|
x: number;
|
|
12
24
|
y: number;
|
|
13
25
|
strategy: Strategy;
|
|
14
26
|
placement: Placement;
|
|
15
|
-
middlewareData: import("@floating-ui/
|
|
16
|
-
update: () => void;
|
|
27
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
17
28
|
isPositioned: boolean;
|
|
29
|
+
update: () => void;
|
|
18
30
|
floatingStyles: import("react").CSSProperties;
|
|
19
31
|
open: boolean;
|
|
20
|
-
onOpenChange: (open: boolean) => void;
|
|
32
|
+
onOpenChange: (open: boolean, event?: Event | undefined) => void;
|
|
21
33
|
events: import("@floating-ui/react").FloatingEvents;
|
|
22
34
|
dataRef: import("react").MutableRefObject<import("@floating-ui/react").ContextData>;
|
|
23
35
|
nodeId: string | undefined;
|
|
@@ -25,8 +37,4 @@ export declare function useDropdown(placement: Placement, matchWidth?: boolean,
|
|
|
25
37
|
refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
26
38
|
elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
27
39
|
};
|
|
28
|
-
refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
29
|
-
elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
30
|
-
isPositioned: boolean;
|
|
31
|
-
floatingStyles: import("react").CSSProperties;
|
|
32
40
|
};
|
package/icon/README.md
ADDED
package/icon/icon.stories.js
CHANGED
|
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.SpriteIconNotExists = exports.SpriteIcon = exports.CustomComponent = exports.ColorAndSizes = exports.AllIcons = void 0;
|
|
7
|
-
const icon_1 = require("./icon");
|
|
8
7
|
const react_1 = __importDefault(require("react"));
|
|
9
8
|
const context_1 = require("../context");
|
|
9
|
+
const icon_1 = require("./icon");
|
|
10
10
|
// import Docs from "./icon.docs.mdx";
|
|
11
11
|
exports.default = {
|
|
12
12
|
title: "UI/Icon",
|
package/icon/index.d.ts
CHANGED
|
@@ -7,10 +7,9 @@ exports.CloseButton = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const icon_1 = require("../../icon");
|
|
9
9
|
const CloseButton = (props) => {
|
|
10
|
-
var _a;
|
|
10
|
+
var _a, _b;
|
|
11
11
|
return (react_1.default.createElement("button", { className: "uxf-image-gallery__close-button", onClick: () => props.onClick() },
|
|
12
|
-
react_1.default.createElement("span", { className: "uxf-image-gallery__close-button-text" }, (_a = props.text) !== null && _a !== void 0 ? _a : "Zavřít"),
|
|
13
|
-
react_1.default.createElement(icon_1.Icon, { className: "uxf-image-gallery__close-button-icon", name: "xmarkLarge" })));
|
|
12
|
+
react_1.default.createElement("span", { className: "uxf-image-gallery__close-button-text" }, (_a = props.text) !== null && _a !== void 0 ? _a : "Zavřít"), (_b = props.buttonElement) !== null && _b !== void 0 ? _b : react_1.default.createElement(icon_1.Icon, { className: "uxf-image-gallery__close-button-icon", name: "xmarkLarge" })));
|
|
14
13
|
};
|
|
15
14
|
exports.CloseButton = CloseButton;
|
|
16
15
|
exports.CloseButton.displayName = "UxfUiCloseButton";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
1
|
+
import { FC, ReactElement } from "react";
|
|
2
2
|
import { ImageGalleryImageProps } from "../types";
|
|
3
3
|
export interface GalleryProps {
|
|
4
4
|
closeButtonTitle?: string;
|
|
@@ -8,5 +8,8 @@ export interface GalleryProps {
|
|
|
8
8
|
onPrevious: () => void;
|
|
9
9
|
imageIndex: number;
|
|
10
10
|
images: ImageGalleryImageProps[];
|
|
11
|
+
prevButtonElement?: ReactElement;
|
|
12
|
+
nextButtonElement?: ReactElement;
|
|
13
|
+
closeButtonElement?: ReactElement;
|
|
11
14
|
}
|
|
12
15
|
export declare const Gallery: FC<GalleryProps>;
|
|
@@ -27,10 +27,11 @@ exports.Gallery = void 0;
|
|
|
27
27
|
const image_1 = require("@uxf/core/utils/image");
|
|
28
28
|
const resizer_1 = require("@uxf/core/utils/resizer");
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
|
+
const react_swipeable_1 = require("react-swipeable");
|
|
30
31
|
const close_button_1 = require("./close-button");
|
|
31
32
|
const dot_1 = require("./dot");
|
|
32
|
-
const
|
|
33
|
-
const
|
|
33
|
+
const next_button_1 = require("./next-button");
|
|
34
|
+
const prev_button_1 = require("./prev-button");
|
|
34
35
|
const Gallery = (props) => {
|
|
35
36
|
var _a;
|
|
36
37
|
(0, react_1.useEffect)(() => {
|
|
@@ -65,10 +66,10 @@ const Gallery = (props) => {
|
|
|
65
66
|
return (react_1.default.createElement("div", { className: "uxf-image-gallery", role: "dialog", "aria-modal": true },
|
|
66
67
|
react_1.default.createElement("div", { "aria-hidden": true, className: "uxf-image-gallery__backdrop", onClick: !props.disableBackdropClose ? props.onClose : undefined }),
|
|
67
68
|
react_1.default.createElement("div", { className: "uxf-image-gallery__close-button-wrapper" },
|
|
68
|
-
react_1.default.createElement(close_button_1.CloseButton, { onClick: props.onClose, text: props.closeButtonTitle })),
|
|
69
|
+
react_1.default.createElement(close_button_1.CloseButton, { buttonElement: props.closeButtonElement, onClick: props.onClose, text: props.closeButtonTitle })),
|
|
69
70
|
props.images.length > 1 && (react_1.default.createElement("div", { className: "uxf-image-gallery__buttons" },
|
|
70
|
-
react_1.default.createElement(
|
|
71
|
-
react_1.default.createElement(
|
|
71
|
+
react_1.default.createElement(prev_button_1.PrevButton, { buttonElement: props.prevButtonElement, onClick: props.onPrevious }),
|
|
72
|
+
react_1.default.createElement(next_button_1.NextButton, { buttonElement: props.nextButtonElement, onClick: props.onNext }))),
|
|
72
73
|
react_1.default.createElement("div", { className: "uxf-image-gallery__content", ...handlers },
|
|
73
74
|
react_1.default.createElement("div", { className: "uxf-image-gallery__inner" },
|
|
74
75
|
react_1.default.createElement("img", { alt: "", className: "uxf-image-gallery__image", src: typeof imageSrc === "string" ? imageSrc : (_a = (0, resizer_1.resizerImageUrl)(imageSrc)) !== null && _a !== void 0 ? _a : "" }),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NextButton = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const icon_1 = require("../../icon");
|
|
9
|
+
const NextButton = (props) => {
|
|
10
|
+
var _a;
|
|
11
|
+
return (react_1.default.createElement("button", { className: "uxf-image-gallery__button uxf-image-gallery__button--next", onClick: props.onClick }, (_a = props.buttonElement) !== null && _a !== void 0 ? _a : react_1.default.createElement(icon_1.Icon, { className: "uxf-image-gallery__button-icon", name: "chevronRight" })));
|
|
12
|
+
};
|
|
13
|
+
exports.NextButton = NextButton;
|
|
14
|
+
exports.NextButton.displayName = "UxfUiNextButton";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PrevButton = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const icon_1 = require("../../icon");
|
|
9
|
+
const PrevButton = (props) => {
|
|
10
|
+
var _a;
|
|
11
|
+
return (react_1.default.createElement("button", { className: "uxf-image-gallery__button uxf-image-gallery__button--prev", onClick: props.onClick }, (_a = props.buttonElement) !== null && _a !== void 0 ? _a : react_1.default.createElement(icon_1.Icon, { className: "uxf-image-gallery__button-icon", name: "chevronLeft" })));
|
|
12
|
+
};
|
|
13
|
+
exports.PrevButton = PrevButton;
|
|
14
|
+
exports.PrevButton.displayName = "UxfUiPrevButton";
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { FC, ReactNode } from "react";
|
|
1
|
+
import { FC, ReactElement, ReactNode } from "react";
|
|
2
2
|
import { GalleryProps } from "./components/gallery";
|
|
3
3
|
export interface ImageGalleryProps {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
closeButtonTitle?: string;
|
|
6
6
|
disableBackdropClose?: GalleryProps["disableBackdropClose"];
|
|
7
|
+
prevButtonElement?: ReactElement;
|
|
8
|
+
nextButtonElement?: ReactElement;
|
|
9
|
+
closeButtonElement?: ReactElement;
|
|
7
10
|
}
|
|
8
11
|
export declare const ImageGallery: FC<ImageGalleryProps>;
|
|
@@ -25,8 +25,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.ImageGallery = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
|
-
const context_1 = require("./context");
|
|
29
28
|
const gallery_1 = require("./components/gallery");
|
|
29
|
+
const context_1 = require("./context");
|
|
30
30
|
const ImageGallery = (props) => {
|
|
31
31
|
const [images, setImages] = (0, react_1.useState)([]);
|
|
32
32
|
const [imageIndex, setImageIndex] = (0, react_1.useState)(null);
|
|
@@ -48,7 +48,7 @@ const ImageGallery = (props) => {
|
|
|
48
48
|
const contextValue = { registerImage, unregisterImage, openGallery };
|
|
49
49
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
50
50
|
react_1.default.createElement(context_1.ImageGalleryProvider, { value: contextValue }, props.children),
|
|
51
|
-
typeof moduloImageIndex === "number" && (react_1.default.createElement(gallery_1.Gallery, { closeButtonTitle: props.closeButtonTitle, disableBackdropClose: props.disableBackdropClose, onClose: () => setImageIndex(null), onNext: onNext, onPrevious: onPrevious, imageIndex: moduloImageIndex, images: images }))));
|
|
51
|
+
typeof moduloImageIndex === "number" && (react_1.default.createElement(gallery_1.Gallery, { closeButtonTitle: props.closeButtonTitle, disableBackdropClose: props.disableBackdropClose, onClose: () => setImageIndex(null), onNext: onNext, onPrevious: onPrevious, imageIndex: moduloImageIndex, images: images, nextButtonElement: props.nextButtonElement, prevButtonElement: props.prevButtonElement, closeButtonElement: props.closeButtonElement }))));
|
|
52
52
|
};
|
|
53
53
|
exports.ImageGallery = ImageGallery;
|
|
54
54
|
exports.ImageGallery.displayName = "UxfUiImageGallery";
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Default = void 0;
|
|
7
7
|
const image_1 = require("@uxf/core/utils/image");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const icon_1 = require("../icon");
|
|
9
10
|
const index_1 = require("./index");
|
|
10
11
|
exports.default = {
|
|
11
12
|
title: "Lab/ImageGallery",
|
|
@@ -31,8 +32,11 @@ const images = [
|
|
|
31
32
|
title: "Obr. 5",
|
|
32
33
|
},
|
|
33
34
|
];
|
|
35
|
+
const nextButtonElement = react_1.default.createElement(icon_1.Icon, { className: "uxf-image-gallery__button-icon", name: "chevronRight" });
|
|
36
|
+
const prevButtonElement = react_1.default.createElement(icon_1.Icon, { className: "uxf-image-gallery__button-icon", name: "chevronLeft" });
|
|
37
|
+
const closeButtonElement = react_1.default.createElement(icon_1.Icon, { className: "uxf-image-gallery__button-icon", name: "xmarkLarge" });
|
|
34
38
|
function Default() {
|
|
35
|
-
return (react_1.default.createElement(index_1.ImageGallery,
|
|
39
|
+
return (react_1.default.createElement(index_1.ImageGallery, { prevButtonElement: prevButtonElement, nextButtonElement: nextButtonElement, closeButtonElement: closeButtonElement },
|
|
36
40
|
react_1.default.createElement("div", { className: "flex-direction flex gap-2" }, images.map((image, index) => (react_1.default.createElement(index_1.ImageGallery.Image, { key: (0, image_1.getImgUniqueIdentifier)(image.src) || index, src: image.src, className: "h-56 w-56 cursor-pointer object-cover transition-transform hover:scale-105", customContent: image.title }))))));
|
|
37
41
|
}
|
|
38
42
|
exports.Default = Default;
|
package/image-gallery/image.d.ts
CHANGED
package/image-gallery/image.js
CHANGED
|
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Image = void 0;
|
|
7
|
+
const resizer_1 = require("@uxf/core/utils/resizer");
|
|
7
8
|
const react_1 = __importDefault(require("react"));
|
|
8
9
|
const use_image_1 = require("./use-image");
|
|
9
|
-
const resizer_1 = require("@uxf/core/utils/resizer");
|
|
10
10
|
const Image = (props) => {
|
|
11
11
|
var _a;
|
|
12
12
|
const openGallery = (0, use_image_1.useImage)(props);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useImage = void 0;
|
|
4
|
+
const useOnMount_1 = require("@uxf/core/hooks/useOnMount");
|
|
4
5
|
const react_1 = require("react");
|
|
5
6
|
const context_1 = require("./context");
|
|
6
|
-
const useOnMount_1 = require("@uxf/core/hooks/useOnMount");
|
|
7
7
|
function useImage(props) {
|
|
8
8
|
const { registerImage, unregisterImage, openGallery } = (0, context_1.useImageGalleryContext)();
|
|
9
9
|
(0, useOnMount_1.useOnMount)(() => {
|
package/input/README.md
ADDED
package/input/input-element.d.ts
CHANGED
package/input/input-element.js
CHANGED
|
@@ -28,6 +28,6 @@ const react_1 = __importStar(require("react"));
|
|
|
28
28
|
exports.InputElement = (0, react_1.forwardRef)((props, ref) => {
|
|
29
29
|
const onChange = (event) => props.onChange(event.target.value, event);
|
|
30
30
|
const filteredProps = Object.fromEntries(Object.entries(props).filter((p) => p[0].startsWith("aria-") || p[0].startsWith("data-")));
|
|
31
|
-
return (react_1.default.createElement("input", { ...filteredProps, "aria-describedby": props["aria-describedby"], "aria-invalid": props.isInvalid, autoComplete: props.autoComplete, className: "uxf-input__element", disabled: props.isDisabled, form: props.form, id: props.id, inputMode: props.inputMode, max: props.max, maxLength: props.maxLength, min: props.min, minLength: props.minLength, onBlur: props.onBlur, onChange: onChange, onFocus: props.onFocus, onKeyDown: props.onKeyDown, pattern: props.pattern, placeholder: props.placeholder, readOnly: props.isReadOnly, ref: ref, step: props.step, tabIndex: props.isReadOnly ? -1 : undefined, type: props.type, value: props.value }));
|
|
31
|
+
return (react_1.default.createElement("input", { ...filteredProps, "aria-describedby": props["aria-describedby"], "aria-invalid": props.isInvalid, autoComplete: props.autoComplete, autoFocus: props.autoFocus, className: "uxf-input__element", disabled: props.isDisabled, form: props.form, id: props.id, inputMode: props.inputMode, max: props.max, maxLength: props.maxLength, min: props.min, minLength: props.minLength, onBlur: props.onBlur, onChange: onChange, onFocus: props.onFocus, onKeyDown: props.onKeyDown, pattern: props.pattern, placeholder: props.placeholder, readOnly: props.isReadOnly, ref: ref, step: props.step, tabIndex: props.isReadOnly ? -1 : undefined, type: props.type, value: props.value }));
|
|
32
32
|
});
|
|
33
33
|
exports.InputElement.displayName = "UxfUiInputElement";
|
package/input/input.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { ReactNode, Ref } from "react";
|
|
2
|
-
import { InputGroupSizes, InputGroupVariants } from "@uxf/ui/input/theme";
|
|
3
1
|
import { useInputFocus } from "@uxf/core/hooks/useInputFocus";
|
|
2
|
+
import { InputGroupSizes, InputGroupVariants } from "@uxf/ui/input/theme";
|
|
3
|
+
import React, { ReactNode, Ref } from "react";
|
|
4
4
|
export interface InputProps {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
customInputElementDisplayName?: string;
|
package/input/input.js
CHANGED
|
@@ -24,11 +24,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Input = void 0;
|
|
27
|
-
const composeRefs_1 = require("@uxf/core/utils/composeRefs");
|
|
28
|
-
const react_1 = __importStar(require("react"));
|
|
29
|
-
const cx_1 = require("@uxf/core/utils/cx");
|
|
30
27
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
31
28
|
const useInputFocus_1 = require("@uxf/core/hooks/useInputFocus");
|
|
29
|
+
const composeRefs_1 = require("@uxf/core/utils/composeRefs");
|
|
30
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
31
|
+
const react_1 = __importStar(require("react"));
|
|
32
32
|
const isApplicable = (...args) => {
|
|
33
33
|
return args.some((i) => !!i);
|
|
34
34
|
};
|
package/input/input.stories.js
CHANGED
|
@@ -27,10 +27,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.ComponentStructure = exports.Sizes = exports.Default = void 0;
|
|
30
|
-
const react_1 = __importStar(require("react"));
|
|
31
|
-
const component_structure_analyzer_1 = __importDefault(require("@uxf/ui/utils/component-structure-analyzer"));
|
|
32
|
-
const action_1 = require("@uxf/ui/utils/action");
|
|
33
30
|
const input_1 = require("@uxf/ui/input");
|
|
31
|
+
const action_1 = require("@uxf/ui/utils/action");
|
|
32
|
+
const component_structure_analyzer_1 = __importDefault(require("@uxf/ui/utils/component-structure-analyzer"));
|
|
33
|
+
const react_1 = __importStar(require("react"));
|
|
34
34
|
const storybook_config_1 = require("../utils/storybook-config");
|
|
35
35
|
exports.default = {
|
|
36
36
|
title: "UI/Input",
|
package/label/README.md
ADDED
package/label/index.d.ts
CHANGED
package/label/label.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/Label",
|
|
11
11
|
component: index_1.Label,
|
package/layout/index.d.ts
CHANGED
package/layout/layout.js
CHANGED
|
@@ -24,38 +24,38 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Layout = void 0;
|
|
27
|
-
const react_1 =
|
|
28
|
-
const react_2 = require("
|
|
27
|
+
const react_1 = require("@headlessui/react");
|
|
28
|
+
const react_2 = __importStar(require("react"));
|
|
29
29
|
const icon_1 = require("../icon");
|
|
30
30
|
const uxf_logo_1 = require("./uxf-logo");
|
|
31
31
|
const Layout = (props) => {
|
|
32
32
|
var _a, _b;
|
|
33
|
-
const [sidebarOpen, setSidebarOpen] = (0,
|
|
34
|
-
return (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
33
|
+
const [sidebarOpen, setSidebarOpen] = (0, react_2.useState)(false);
|
|
34
|
+
return (react_2.default.createElement("div", { className: "uxf-layout" },
|
|
35
|
+
react_2.default.createElement("div", { className: "uxf-sidebar" },
|
|
36
|
+
react_2.default.createElement("div", { className: "uxf-sidebar__content" }, props.sidebar)),
|
|
37
|
+
react_2.default.createElement("div", { className: "uxf-app-bar" },
|
|
38
|
+
react_2.default.createElement("div", { className: "uxf-app-bar__left-container" },
|
|
39
|
+
react_2.default.createElement("button", { type: "button", className: "uxf-app-bar__menu-button", onClick: () => setSidebarOpen(true) },
|
|
40
|
+
react_2.default.createElement(icon_1.Icon, { name: "bars", className: "text-white", size: 26 })),
|
|
41
|
+
react_2.default.createElement("div", { className: "uxf-app-bar__logo" }, (_a = props.logo) !== null && _a !== void 0 ? _a : react_2.default.createElement(uxf_logo_1.UxfLogo, null))),
|
|
42
|
+
react_2.default.createElement("div", { className: "uxf-app-bar__right-container" }, props.toolbarRight)),
|
|
43
|
+
react_2.default.createElement(react_1.Transition.Root, { show: sidebarOpen, as: react_2.Fragment },
|
|
44
|
+
react_2.default.createElement(react_1.Dialog, { as: "div", className: "relative z-40 md:hidden", onClose: setSidebarOpen },
|
|
45
|
+
react_2.default.createElement(react_1.Transition.Child, { as: react_2.Fragment, enter: "transition-opacity ease-linear duration-300", enterFrom: "opacity-0", enterTo: "opacity-100", leave: "transition-opacity ease-linear duration-300", leaveFrom: "opacity-100", leaveTo: "opacity-0" },
|
|
46
|
+
react_2.default.createElement("div", { className: "fixed inset-0 bg-gray-600/75" })),
|
|
47
|
+
react_2.default.createElement("div", { className: "fixed inset-0 z-40 flex" },
|
|
48
|
+
react_2.default.createElement(react_1.Transition.Child, { as: react_2.Fragment, enter: "transition ease-in-out duration-300 transform", enterFrom: "-translate-x-full", enterTo: "translate-x-0", leave: "transition ease-in-out duration-300 transform", leaveFrom: "translate-x-0", leaveTo: "-translate-x-full" },
|
|
49
|
+
react_2.default.createElement(react_1.Dialog.Panel, { className: "relative flex w-full max-w-xs flex-1 flex-col bg-white pb-4 pt-5" },
|
|
50
|
+
react_2.default.createElement(react_1.Transition.Child, { as: react_2.Fragment, enter: "ease-in-out duration-300", enterFrom: "opacity-0", enterTo: "opacity-100", leave: "ease-in-out duration-300", leaveFrom: "opacity-100", leaveTo: "opacity-0" },
|
|
51
|
+
react_2.default.createElement("div", { className: "absolute right-0 top-0 -mr-12 pt-2" },
|
|
52
|
+
react_2.default.createElement("button", { type: "button", className: "ml-1 flex h-10 w-10 items-center justify-center rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white", onClick: () => setSidebarOpen(false) },
|
|
53
|
+
react_2.default.createElement("span", { className: "sr-only" }, "Close sidebar"),
|
|
54
|
+
react_2.default.createElement(icon_1.Icon, { name: "xmarkLarge", size: 24, className: "text-white" })))),
|
|
55
|
+
react_2.default.createElement("div", { className: "uxf-drawer__logo" }, (_b = props.logo) !== null && _b !== void 0 ? _b : react_2.default.createElement(uxf_logo_1.UxfLogo, { isDark: true })),
|
|
56
|
+
react_2.default.createElement("div", { className: "uxf-drawer__content" }, props.sidebar))),
|
|
57
|
+
react_2.default.createElement("div", { className: "w-14 shrink-0", "aria-hidden": "true" })))),
|
|
58
|
+
react_2.default.createElement("main", { className: "uxf-layout__content" }, props.children)));
|
|
59
59
|
};
|
|
60
60
|
exports.Layout = Layout;
|
|
61
61
|
exports.Layout.displayName = "UxfUiLayout";
|