@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
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { SelectOption } from "./index";
|
|
2
3
|
declare const _default: {
|
|
3
4
|
title: string;
|
|
4
5
|
component: {
|
|
5
|
-
<ValueId = import("../_select-base").SelectBaseValueId, Option =
|
|
6
|
+
<ValueId = import("../_select-base").SelectBaseValueId, Option = SelectOption<ValueId>, Value = Option>(props: import("./select").SelectProps<ValueId, Option, ValueId>): React.JSX.Element;
|
|
6
7
|
displayName: string;
|
|
7
8
|
};
|
|
8
9
|
};
|
package/select/select.stories.js
CHANGED
|
@@ -28,16 +28,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.ComponentStructure = exports.Default = void 0;
|
|
30
30
|
const react_1 = __importStar(require("react"));
|
|
31
|
+
const action_1 = require("../utils/action");
|
|
31
32
|
const component_structure_analyzer_1 = __importDefault(require("../utils/component-structure-analyzer"));
|
|
32
33
|
const index_1 = require("./index");
|
|
33
|
-
const action_1 = require("../utils/action");
|
|
34
34
|
exports.default = {
|
|
35
35
|
title: "UI/Select",
|
|
36
36
|
component: index_1.Select,
|
|
37
37
|
};
|
|
38
38
|
const options = [
|
|
39
39
|
{ id: "one", label: "Option one" },
|
|
40
|
-
{ id: "two", label: "Option two" },
|
|
40
|
+
{ id: "two", label: "Option two disabled", disabled: true },
|
|
41
41
|
{ id: "three", label: "Option three" },
|
|
42
42
|
{ id: "four", label: "Option four" },
|
|
43
43
|
{ id: "five", label: "Option five" },
|
|
@@ -64,7 +64,13 @@ function Default() {
|
|
|
64
64
|
react_1.default.createElement(index_1.Select, { helperText: "Helper text of Select with hidden label", hiddenLabel: true, label: "Hidden label", onChange: onChange, options: options, placeholder: "Vyberte...", value: value }),
|
|
65
65
|
react_1.default.createElement(index_1.Select, { label: "Size sm", onChange: onChange, options: options, placeholder: "Vyberte...", value: value, size: "small" }),
|
|
66
66
|
react_1.default.createElement(index_1.Select, { label: "Size default", onChange: onChange, options: options, placeholder: "Vyberte...", value: value }),
|
|
67
|
-
react_1.default.createElement(index_1.Select, { label: "Size lg", onChange: onChange, options: options, placeholder: "Vyberte...", value: value, size: "large" })
|
|
67
|
+
react_1.default.createElement(index_1.Select, { label: "Size lg", onChange: onChange, options: options, placeholder: "Vyberte...", value: value, size: "large" }),
|
|
68
|
+
react_1.default.createElement(index_1.Select, { label: "RenderOption & RenderSelectedOption", onChange: onChange, options: options, placeholder: "Vyberte...", value: value, renderOption: (option, isSelected) => (react_1.default.createElement(react_1.default.Fragment, null,
|
|
69
|
+
"Option: ",
|
|
70
|
+
option.label,
|
|
71
|
+
isSelected && " (selected)")), renderSelectedOption: (option) => react_1.default.createElement(react_1.default.Fragment, null,
|
|
72
|
+
"Selected: ",
|
|
73
|
+
option.label) })));
|
|
68
74
|
return (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
69
75
|
react_1.default.createElement("div", { className: "light space-y-2 p-20 lg:w-1/2" }, storySelects),
|
|
70
76
|
react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20 lg:w-1/2" }, storySelects)));
|
package/tabs/README.md
ADDED
package/tabs/index.d.ts
CHANGED
package/text-input/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import React, { KeyboardEventHandler, ReactNode } from "react";
|
|
|
4
4
|
type EnterKeyHint = "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
5
5
|
type InputMode = "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
6
6
|
export interface TextInputProps extends FormControlProps<string>, Pick<InputProps, "size" | "variant"> {
|
|
7
|
+
autoFocus?: boolean;
|
|
7
8
|
autoComplete?: string;
|
|
8
9
|
className?: string;
|
|
9
10
|
enterKeyHint?: EnterKeyHint;
|
package/text-input/text-input.js
CHANGED
|
@@ -26,11 +26,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.TextInput = void 0;
|
|
27
27
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
28
28
|
const useInputFocus_1 = require("@uxf/core/hooks/useInputFocus");
|
|
29
|
+
const composeRefs_1 = require("@uxf/core/utils/composeRefs");
|
|
29
30
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
30
31
|
const input_1 = require("@uxf/ui/input");
|
|
31
32
|
const react_1 = __importStar(require("react"));
|
|
32
33
|
const form_component_1 = require("../form-component");
|
|
33
|
-
const composeRefs_1 = require("@uxf/core/utils/composeRefs");
|
|
34
34
|
exports.TextInput = (0, react_1.forwardRef)((props, ref) => {
|
|
35
35
|
var _a, _b;
|
|
36
36
|
const innerRef = (0, react_1.useRef)(null);
|
|
@@ -43,7 +43,7 @@ exports.TextInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
43
43
|
react_1.default.createElement(input_1.Input, { inputFocus: input, size: props.size, variant: props.variant },
|
|
44
44
|
props.leftAddon && react_1.default.createElement(input_1.Input.LeftAddon, null, props.leftAddon),
|
|
45
45
|
props.leftElement && react_1.default.createElement(input_1.Input.LeftElement, null, props.leftElement),
|
|
46
|
-
react_1.default.createElement(input_1.Input.Element, { "aria-describedby": errorId, autoComplete: props.autoComplete, form: props.form, id: id, inputMode: props.inputMode, isDisabled: props.isDisabled, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly, isRequired: props.isRequired, max: props.max, maxLength: props.maxLength, min: props.min, minLength: props.minLength, name: props.name, onChange: props.onChange, onKeyDown: props.onKeyDown, pattern: props.pattern, placeholder: props.placeholder, ref: (0, composeRefs_1.composeRefs)(innerRef, ref), step: props.step, type: props.type, value: props.value }),
|
|
46
|
+
react_1.default.createElement(input_1.Input.Element, { "aria-describedby": errorId, autoComplete: props.autoComplete, autoFocus: props.autoFocus, form: props.form, id: id, inputMode: props.inputMode, isDisabled: props.isDisabled, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly, isRequired: props.isRequired, max: props.max, maxLength: props.maxLength, min: props.min, minLength: props.minLength, name: props.name, onChange: props.onChange, onKeyDown: props.onKeyDown, pattern: props.pattern, placeholder: props.placeholder, ref: (0, composeRefs_1.composeRefs)(innerRef, ref), step: props.step, type: props.type, value: props.value }),
|
|
47
47
|
props.rightElement && react_1.default.createElement(input_1.Input.RightElement, null, props.rightElement),
|
|
48
48
|
props.rightAddon && react_1.default.createElement(input_1.Input.RightAddon, null, props.rightAddon))));
|
|
49
49
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# TextLink
|
|
2
|
+
|
|
3
|
+
## CSS dependencies
|
|
4
|
+
|
|
5
|
+
```css
|
|
6
|
+
@import url("@uxf/ui/text-link/text-link.css");
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Props configuration
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
// textLink.d.ts
|
|
13
|
+
|
|
14
|
+
declare module "@uxf/ui/icon/theme" {
|
|
15
|
+
export interface TextLinkVariants {
|
|
16
|
+
default: true;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
```
|
package/text-link/index.d.ts
CHANGED
package/text-link/text-link.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseAnchorProps } from "@uxf/core/hooks/useAnchorProps";
|
|
2
|
-
import React, { AnchorHTMLAttributes } from "react";
|
|
3
2
|
import { TextLinkVariants } from "@uxf/ui/text-link/theme";
|
|
3
|
+
import React, { AnchorHTMLAttributes } from "react";
|
|
4
4
|
export type TextLinkVariant = keyof TextLinkVariants;
|
|
5
5
|
export interface TextLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "type">, UseAnchorProps {
|
|
6
6
|
variant?: TextLinkVariant;
|
package/textarea/index.d.ts
CHANGED
package/textarea/textarea.js
CHANGED
|
@@ -33,11 +33,11 @@ const react_1 = __importStar(require("react"));
|
|
|
33
33
|
const form_component_1 = require("../form-component");
|
|
34
34
|
function autoHeightHandler(element, rows = 4) {
|
|
35
35
|
element.style.height = "auto";
|
|
36
|
-
if (rows
|
|
36
|
+
if (rows >= 1) {
|
|
37
37
|
const contentHeight = element.scrollHeight;
|
|
38
|
-
const lineHeight =
|
|
39
|
-
const fontSize =
|
|
40
|
-
const targetHeight = rows * fontSize * (lineHeight / fontSize);
|
|
38
|
+
const lineHeight = parseFloat(window.getComputedStyle(element).getPropertyValue("line-height"));
|
|
39
|
+
const fontSize = parseFloat(window.getComputedStyle(element).getPropertyValue("font-size"));
|
|
40
|
+
const targetHeight = parseInt((rows * fontSize * (lineHeight / fontSize)).toFixed(3), 10);
|
|
41
41
|
element.style.height = Math.max(targetHeight, contentHeight) + "px";
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -68,6 +68,6 @@ exports.Textarea = (0, react_1.forwardRef)((props, ref) => {
|
|
|
68
68
|
const onWrapperClick = () => { var _a; return (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus(); };
|
|
69
69
|
return (react_1.default.createElement(form_component_1.FormComponent, { className: rootClassName, errorId: errorId, form: props.form, helperText: props.helperText, hiddenLabel: props.hiddenLabel, inputId: id, isRequired: props.isRequired, label: props.label },
|
|
70
70
|
react_1.default.createElement("div", { className: "uxf-textarea__wrapper", onClick: onWrapperClick },
|
|
71
|
-
react_1.default.createElement("textarea", { "aria-describedby": errorId, "aria-invalid": props.isInvalid, autoComplete: props.autoComplete, className: "uxf-textarea__element", disabled: props.isDisabled, form: props.form, id: id, maxLength: props.maxLength, minLength: props.minLength, name: props.name, onBlur: input.onBlur, onChange: (event) => props.onChange(event.target.value, event), onFocus: input.onFocus, placeholder: props.placeholder, readOnly: props.isReadOnly, ref: (0, composeRefs_1.composeRefs)(innerRef, ref), required: props.isRequired, value: props.value }))));
|
|
71
|
+
react_1.default.createElement("textarea", { "aria-describedby": errorId, "aria-invalid": props.isInvalid, autoComplete: props.autoComplete, className: "uxf-textarea__element", disabled: props.isDisabled, form: props.form, id: id, maxLength: props.maxLength, minLength: props.minLength, name: props.name, onBlur: input.onBlur, onChange: (event) => props.onChange(event.target.value, event), onFocus: input.onFocus, placeholder: props.placeholder, readOnly: props.isReadOnly, rows: props.rows, ref: (0, composeRefs_1.composeRefs)(innerRef, ref), required: props.isRequired, value: props.value }))));
|
|
72
72
|
});
|
|
73
73
|
exports.Textarea.displayName = "UxfUiTextarea";
|
|
@@ -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/Textarea",
|
|
32
32
|
component: index_1.Textarea,
|
package/time-picker/index.d.ts
CHANGED
|
@@ -24,16 +24,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.TimePickerHour = void 0;
|
|
27
|
-
const
|
|
27
|
+
const classes_1 = require("@uxf/core/constants/classes");
|
|
28
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
28
29
|
const time_picker_context_1 = require("@uxf/datepicker/contexts/time-picker-context");
|
|
29
30
|
const use_hour_1 = require("@uxf/datepicker/hooks/use-hour");
|
|
30
|
-
const
|
|
31
|
-
const classes_1 = require("@uxf/core/constants/classes");
|
|
32
|
-
const button_1 = require("../button");
|
|
31
|
+
const react_1 = __importStar(require("react"));
|
|
33
32
|
const TimePickerHour = (props) => {
|
|
34
33
|
const hourRef = (0, react_1.useRef)(null);
|
|
35
34
|
// eslint-disable-next-line react/destructuring-assignment
|
|
36
|
-
const { focusedHour, isHourFocused, isHourSelected, onHourSelect, onHourFocus } = (0, react_1.useContext)(time_picker_context_1.TimePickerContext);
|
|
35
|
+
const { focusedHour, isHourFocused, isHourSelected, onHourSelect, onHourFocus, preventScroll } = (0, react_1.useContext)(time_picker_context_1.TimePickerContext);
|
|
37
36
|
const { onClick, onKeyDown, tabIndex, isSelected } = (0, use_hour_1.useHour)({
|
|
38
37
|
hour: props.hour,
|
|
39
38
|
hourRef,
|
|
@@ -42,8 +41,9 @@ const TimePickerHour = (props) => {
|
|
|
42
41
|
isHourSelected,
|
|
43
42
|
onHourSelect,
|
|
44
43
|
onHourFocus,
|
|
44
|
+
preventScroll,
|
|
45
45
|
});
|
|
46
|
-
return (react_1.default.createElement(
|
|
46
|
+
return (react_1.default.createElement("button", { className: (0, cx_1.cx)("uxf-calendar__cell uxf-calendar__cell-hour", isSelected && classes_1.CLASSES.IS_SELECTED), onClick: onClick, onKeyDown: onKeyDown, ref: hourRef, tabIndex: tabIndex }, props.label));
|
|
47
47
|
};
|
|
48
48
|
exports.TimePickerHour = TimePickerHour;
|
|
49
49
|
exports.TimePickerHour.displayName = "UxfUiTimePickerHour";
|
|
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.TimePickerHours = void 0;
|
|
7
|
+
const use_hours_1 = require("@uxf/datepicker/hooks/use-hours");
|
|
7
8
|
const react_1 = __importDefault(require("react"));
|
|
8
9
|
const time_picker_hour_1 = require("./time-picker-hour");
|
|
9
|
-
const use_hours_1 = require("@uxf/datepicker/hooks/use-hours");
|
|
10
10
|
const TimePickerHours = () => {
|
|
11
11
|
const { hours } = (0, use_hours_1.useHours)({});
|
|
12
|
-
return (react_1.default.createElement("div", { className: "uxf-time-picker__hours" }, hours.map((hour) => (react_1.default.createElement(time_picker_hour_1.TimePickerHour, { hour: hour.value, label: hour.label, key: hour.value })))));
|
|
12
|
+
return (react_1.default.createElement("div", { className: "uxf-time-picker__hours uxf-calendar__hours" }, hours.map((hour) => (react_1.default.createElement(time_picker_hour_1.TimePickerHour, { hour: hour.value, label: hour.label, key: hour.value })))));
|
|
13
13
|
};
|
|
14
14
|
exports.TimePickerHours = TimePickerHours;
|
|
15
15
|
exports.TimePickerHours.displayName = "UxfUiTimePickerHours";
|
|
@@ -24,16 +24,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.TimePickerMinute = void 0;
|
|
27
|
-
const
|
|
27
|
+
const classes_1 = require("@uxf/core/constants/classes");
|
|
28
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
28
29
|
const time_picker_context_1 = require("@uxf/datepicker/contexts/time-picker-context");
|
|
29
30
|
const use_minute_1 = require("@uxf/datepicker/hooks/use-minute");
|
|
30
|
-
const
|
|
31
|
-
const classes_1 = require("@uxf/core/constants/classes");
|
|
32
|
-
const button_1 = require("../button");
|
|
31
|
+
const react_1 = __importStar(require("react"));
|
|
33
32
|
const TimePickerMinute = (props) => {
|
|
34
33
|
const minuteRef = (0, react_1.useRef)(null);
|
|
35
34
|
// eslint-disable-next-line react/destructuring-assignment
|
|
36
|
-
const { focusedMinute, isMinuteFocused, isMinuteSelected, onMinuteSelect, onMinuteFocus } = (0, react_1.useContext)(time_picker_context_1.TimePickerContext);
|
|
35
|
+
const { focusedMinute, isMinuteFocused, isMinuteSelected, onMinuteSelect, onMinuteFocus, preventScroll } = (0, react_1.useContext)(time_picker_context_1.TimePickerContext);
|
|
37
36
|
const { isSelected, onClick, onKeyDown, tabIndex } = (0, use_minute_1.useMinute)({
|
|
38
37
|
minute: props.minute,
|
|
39
38
|
minuteRef,
|
|
@@ -42,8 +41,9 @@ const TimePickerMinute = (props) => {
|
|
|
42
41
|
isMinuteSelected,
|
|
43
42
|
onMinuteFocus,
|
|
44
43
|
onMinuteSelect,
|
|
44
|
+
preventScroll,
|
|
45
45
|
});
|
|
46
|
-
return (react_1.default.createElement(
|
|
46
|
+
return (react_1.default.createElement("button", { className: (0, cx_1.cx)("uxf-calendar__cell uxf-calendar__cell-minute", isSelected && classes_1.CLASSES.IS_SELECTED), onClick: onClick, onKeyDown: onKeyDown, ref: minuteRef, tabIndex: tabIndex }, props.label));
|
|
47
47
|
};
|
|
48
48
|
exports.TimePickerMinute = TimePickerMinute;
|
|
49
49
|
exports.TimePickerMinute.displayName = "UxfUiTimePickerMinute";
|
|
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.TimePickerMinutes = void 0;
|
|
7
|
+
const use_minutes_1 = require("@uxf/datepicker/hooks/use-minutes");
|
|
7
8
|
const react_1 = __importDefault(require("react"));
|
|
8
9
|
const time_picker_minute_1 = require("./time-picker-minute");
|
|
9
|
-
const use_minutes_1 = require("@uxf/datepicker/hooks/use-minutes");
|
|
10
10
|
const TimePickerMinutes = () => {
|
|
11
11
|
const { minutes } = (0, use_minutes_1.useMinutes)({});
|
|
12
|
-
return (react_1.default.createElement("div", { className: "uxf-time-picker__minutes" }, minutes.map((minute) => (react_1.default.createElement(time_picker_minute_1.TimePickerMinute, { minute: minute.value, label: minute.label, key: minute.value })))));
|
|
12
|
+
return (react_1.default.createElement("div", { className: "uxf-time-picker__minutes uxf-calendar__minutes" }, minutes.map((minute) => (react_1.default.createElement(time_picker_minute_1.TimePickerMinute, { minute: minute.value, label: minute.label, key: minute.value })))));
|
|
13
13
|
};
|
|
14
14
|
exports.TimePickerMinutes = TimePickerMinutes;
|
|
15
15
|
exports.TimePickerMinutes.displayName = "UxfUiTimePickerMinutes";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
1
|
import { OnTimeChangeType, TimeType } from "@uxf/datepicker/hooks/use-time-picker";
|
|
2
|
+
import { FC } from "react";
|
|
3
3
|
export interface TimePickerProps {
|
|
4
4
|
closePopoverHandler?: () => void;
|
|
5
5
|
onChange: (data: OnTimeChangeType) => void;
|
|
6
|
+
preventScroll?: boolean;
|
|
6
7
|
selectedTime: TimeType | null;
|
|
7
8
|
}
|
|
8
9
|
export declare const TimePicker: FC<TimePickerProps>;
|
|
@@ -24,19 +24,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.TimePicker = void 0;
|
|
27
|
+
const time_picker_context_1 = require("@uxf/datepicker/contexts/time-picker-context");
|
|
28
|
+
const use_time_picker_1 = require("@uxf/datepicker/hooks/use-time-picker");
|
|
27
29
|
const react_1 = __importStar(require("react"));
|
|
30
|
+
const button_1 = require("../button");
|
|
31
|
+
const icon_1 = require("../icon");
|
|
28
32
|
const time_picker_hours_1 = require("./time-picker-hours");
|
|
29
33
|
const time_picker_minutes_1 = require("./time-picker-minutes");
|
|
30
|
-
const use_time_picker_1 = require("@uxf/datepicker/hooks/use-time-picker");
|
|
31
|
-
const icon_1 = require("../icon");
|
|
32
|
-
const button_1 = require("../button");
|
|
33
|
-
const time_picker_context_1 = require("@uxf/datepicker/contexts/time-picker-context");
|
|
34
34
|
const TimePicker = (props) => {
|
|
35
35
|
const [viewMode, setViewMode] = (0, react_1.useState)("global");
|
|
36
36
|
const { goToNextMinute, goToPrevHour, goToPrevMinute, goToNextHour, ...contextProps } = (0, use_time_picker_1.useTimePicker)({
|
|
37
37
|
selectedTime: props.selectedTime,
|
|
38
38
|
onTimeChange: props.onChange,
|
|
39
39
|
onSelectCallback: () => setViewMode("global"),
|
|
40
|
+
preventScroll: props.preventScroll,
|
|
40
41
|
});
|
|
41
42
|
const timePickerComponents = (0, react_1.useMemo)(() => {
|
|
42
43
|
var _a, _b;
|
|
@@ -45,7 +46,7 @@ const TimePicker = (props) => {
|
|
|
45
46
|
react_1.default.createElement("div", { className: "uxf-time-picker__global__column" },
|
|
46
47
|
react_1.default.createElement(button_1.Button, { isIconButton: true, onClick: goToNextHour, title: "Nadch\u00E1zej\u00EDc\u00ED", variant: "text" },
|
|
47
48
|
react_1.default.createElement(icon_1.Icon, { name: "chevronUp", size: 16 })),
|
|
48
|
-
react_1.default.createElement(button_1.Button, { variant: "text", onClick: () => setViewMode("hour") }, (_b = (_a = props.selectedTime) === null || _a === void 0 ? void 0 : _a.hour) !== null && _b !== void 0 ? _b : "0"),
|
|
49
|
+
react_1.default.createElement(button_1.Button, { variant: "text", onClick: () => setViewMode("hour") }, (_b = (_a = props.selectedTime) === null || _a === void 0 ? void 0 : _a.hour.toString()) !== null && _b !== void 0 ? _b : "0"),
|
|
49
50
|
react_1.default.createElement(button_1.Button, { isIconButton: true, onClick: goToPrevHour, title: "P\u0159edchoz\u00ED", variant: "text" },
|
|
50
51
|
react_1.default.createElement(icon_1.Icon, { name: "chevronDown", size: 16 }))),
|
|
51
52
|
react_1.default.createElement("div", null, ":"),
|
|
@@ -55,7 +56,7 @@ const TimePicker = (props) => {
|
|
|
55
56
|
react_1.default.createElement(button_1.Button, { variant: "text", onClick: () => setViewMode("minute") }, props.selectedTime
|
|
56
57
|
? props.selectedTime.minute < 10
|
|
57
58
|
? "0" + props.selectedTime.minute
|
|
58
|
-
: props.selectedTime.minute
|
|
59
|
+
: props.selectedTime.minute.toString()
|
|
59
60
|
: "00"),
|
|
60
61
|
react_1.default.createElement(button_1.Button, { isIconButton: true, onClick: goToPrevMinute, title: "P\u0159edchoz\u00ED", variant: "text" },
|
|
61
62
|
react_1.default.createElement(icon_1.Icon, { name: "chevronDown", size: 16 }))))),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
+
export { ALLOWED_TIME_FORMAT, DISPLAY_TIME_FORMAT, OUTPUT_TIME_FORMAT, TimePickerInput } from "./time-picker-input";
|
|
1
2
|
export type { TimePickerInputProps } from "./time-picker-input";
|
|
2
|
-
export { TimePickerInput, DISPLAY_TIME_FORMAT, ALLOWED_TIME_FORMAT, OUTPUT_TIME_FORMAT } from "./time-picker-input";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TimePickerInput = exports.OUTPUT_TIME_FORMAT = exports.DISPLAY_TIME_FORMAT = exports.ALLOWED_TIME_FORMAT = void 0;
|
|
4
4
|
var time_picker_input_1 = require("./time-picker-input");
|
|
5
|
-
Object.defineProperty(exports, "TimePickerInput", { enumerable: true, get: function () { return time_picker_input_1.TimePickerInput; } });
|
|
6
|
-
Object.defineProperty(exports, "DISPLAY_TIME_FORMAT", { enumerable: true, get: function () { return time_picker_input_1.DISPLAY_TIME_FORMAT; } });
|
|
7
5
|
Object.defineProperty(exports, "ALLOWED_TIME_FORMAT", { enumerable: true, get: function () { return time_picker_input_1.ALLOWED_TIME_FORMAT; } });
|
|
6
|
+
Object.defineProperty(exports, "DISPLAY_TIME_FORMAT", { enumerable: true, get: function () { return time_picker_input_1.DISPLAY_TIME_FORMAT; } });
|
|
8
7
|
Object.defineProperty(exports, "OUTPUT_TIME_FORMAT", { enumerable: true, get: function () { return time_picker_input_1.OUTPUT_TIME_FORMAT; } });
|
|
8
|
+
Object.defineProperty(exports, "TimePickerInput", { enumerable: true, get: function () { return time_picker_input_1.TimePickerInput; } });
|
|
@@ -27,12 +27,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.TimePickerInput = exports.OUTPUT_TIME_FORMAT = exports.DISPLAY_TIME_FORMAT = exports.ALLOWED_TIME_FORMAT = void 0;
|
|
30
|
-
const
|
|
31
|
-
const time_picker_1 = require("../time-picker");
|
|
32
|
-
const _input_with_popover_1 = require("../_input-with-popover");
|
|
30
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
33
31
|
const dayjs_1 = __importStar(require("dayjs"));
|
|
34
32
|
const customParseFormat_1 = __importDefault(require("dayjs/plugin/customParseFormat"));
|
|
33
|
+
const react_1 = __importStar(require("react"));
|
|
34
|
+
const _input_with_popover_1 = require("../_input-with-popover");
|
|
35
35
|
const icon_1 = require("../icon");
|
|
36
|
+
const time_picker_1 = require("../time-picker");
|
|
36
37
|
(0, dayjs_1.extend)(customParseFormat_1.default);
|
|
37
38
|
exports.ALLOWED_TIME_FORMAT = ["HH:mm", "H:mm"];
|
|
38
39
|
exports.DISPLAY_TIME_FORMAT = "H:mm";
|
|
@@ -57,6 +58,7 @@ function getSelectedTime(value) {
|
|
|
57
58
|
exports.TimePickerInput = (0, react_1.forwardRef)((props, ref) => {
|
|
58
59
|
var _a, _b;
|
|
59
60
|
const onChange = props.onChange;
|
|
61
|
+
const className = (0, cx_1.cx)("uxf-time-picker-input", props.className);
|
|
60
62
|
const onInputChange = (0, react_1.useCallback)((value) => {
|
|
61
63
|
const parsedValue = (0, dayjs_1.default)(value, exports.ALLOWED_TIME_FORMAT, true);
|
|
62
64
|
if (value !== "" && parsedValue.isValid()) {
|
|
@@ -73,6 +75,6 @@ exports.TimePickerInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
73
75
|
}, [onChange]);
|
|
74
76
|
const value = getValue(props.value);
|
|
75
77
|
const selectedTime = getSelectedTime(props.value);
|
|
76
|
-
return (react_1.default.createElement(_input_with_popover_1._InputWithPopover, { ...props, onChange: onInputChange, placeholder: (_a = props.placeholder) !== null && _a !== void 0 ? _a : (0, dayjs_1.default)().format(exports.DISPLAY_TIME_FORMAT), ref: ref, value: value, triggerElement: (_b = props.triggerElement) !== null && _b !== void 0 ? _b : react_1.default.createElement(icon_1.Icon, { name: "clock", size: 20 }) }, ({ close }) => (react_1.default.createElement(time_picker_1.TimePicker, { closePopoverHandler: close, onChange: onTimePickerChange, selectedTime: selectedTime }))));
|
|
78
|
+
return (react_1.default.createElement(_input_with_popover_1._InputWithPopover, { ...props, className: className, onChange: onInputChange, placeholder: (_a = props.placeholder) !== null && _a !== void 0 ? _a : (0, dayjs_1.default)().format(exports.DISPLAY_TIME_FORMAT), ref: ref, value: value, triggerElement: (_b = props.triggerElement) !== null && _b !== void 0 ? _b : react_1.default.createElement(icon_1.Icon, { name: "clock", size: 20 }) }, ({ close }) => (react_1.default.createElement(time_picker_1.TimePicker, { closePopoverHandler: close, onChange: onTimePickerChange, preventScroll: true, selectedTime: selectedTime }))));
|
|
77
79
|
});
|
|
78
80
|
exports.TimePickerInput.displayName = "UxfUiTimePickerInput";
|
|
@@ -26,8 +26,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.Default = void 0;
|
|
27
27
|
const icon_1 = require("@uxf/ui//icon");
|
|
28
28
|
const react_1 = __importStar(require("react"));
|
|
29
|
-
const time_picker_input_1 = require("./time-picker-input");
|
|
30
29
|
const action_1 = require("../utils/action");
|
|
30
|
+
const time_picker_input_1 = require("./time-picker-input");
|
|
31
31
|
exports.default = {
|
|
32
32
|
title: "UI/TimePickerInput",
|
|
33
33
|
component: time_picker_input_1.TimePickerInput,
|
package/toggle/README.md
ADDED
package/toggle/index.d.ts
CHANGED
package/toggle/toggle.js
CHANGED
|
@@ -24,16 +24,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Toggle = void 0;
|
|
27
|
+
const react_1 = require("@headlessui/react");
|
|
27
28
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
28
29
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
exports.Toggle = (0, react_1.forwardRef)((props, ref) => {
|
|
30
|
+
const react_2 = __importStar(require("react"));
|
|
31
|
+
exports.Toggle = (0, react_2.forwardRef)((props, ref) => {
|
|
32
32
|
var _a, _b;
|
|
33
|
-
return (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
return (react_2.default.createElement(react_1.Switch.Group, null,
|
|
34
|
+
react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-toggle__wrapper", `uxf-toggle__wrapper--${(_a = props.variant) !== null && _a !== void 0 ? _a : "default"}`, props.hiddenLabel && "uxf-toggle__wrapper--hiddenLabel", props.className) },
|
|
35
|
+
react_2.default.createElement(react_1.Switch, { checked: props.value, className: (0, cx_1.cx)(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, "uxf-toggle", `uxf-toggle--${(_b = props.variant) !== null && _b !== void 0 ? _b : "default"}`), disabled: props.isDisabled, id: props.id, name: props.name, onChange: props.onChange, ref: ref, style: props.style },
|
|
36
|
+
react_2.default.createElement("span", { className: "uxf-toggle__inner" })),
|
|
37
|
+
react_2.default.createElement(react_1.Switch.Label, { hidden: props.hiddenLabel, className: "uxf-toggle__label" }, props.label))));
|
|
38
38
|
});
|
|
39
39
|
exports.Toggle.displayName = "UxfUiToggle";
|
package/toggle/toggle.stories.js
CHANGED
|
@@ -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/Toggle",
|
|
32
32
|
component: index_1.Toggle,
|
package/tooltip/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { TooltipProps } from "./tooltip";
|
|
2
1
|
export { Tooltip } from "./tooltip";
|
|
3
|
-
export type {
|
|
2
|
+
export type { TooltipProps } from "./tooltip";
|
|
4
3
|
export { useTooltip } from "./use-tooltip";
|
|
4
|
+
export type { TooltipOptions } from "./use-tooltip";
|
package/tooltip/tooltip.js
CHANGED
|
@@ -24,47 +24,49 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Tooltip = void 0;
|
|
27
|
-
const react_1 =
|
|
28
|
-
const use_tooltip_1 = require("./use-tooltip");
|
|
27
|
+
const react_1 = require("@floating-ui/react");
|
|
29
28
|
const composeRefs_1 = require("@uxf/core/utils/composeRefs");
|
|
30
29
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
30
|
+
const react_2 = __importStar(require("react"));
|
|
31
|
+
const use_tooltip_1 = require("./use-tooltip");
|
|
31
32
|
const STATIC_SIDES = {
|
|
32
33
|
top: "bottom",
|
|
33
34
|
right: "left",
|
|
34
35
|
bottom: "top",
|
|
35
36
|
left: "right",
|
|
36
37
|
};
|
|
37
|
-
exports.Tooltip = (0,
|
|
38
|
+
exports.Tooltip = (0, react_2.forwardRef)(({ children, className, content, style, ...options }, ref) => {
|
|
38
39
|
var _a, _b;
|
|
39
|
-
const arrowRef = (0,
|
|
40
|
+
const arrowRef = (0, react_2.useRef)(null);
|
|
40
41
|
const tooltip = (0, use_tooltip_1.useTooltip)({ arrowRef, ...options });
|
|
41
42
|
const arrowX = (_a = tooltip.middlewareData.arrow) === null || _a === void 0 ? void 0 : _a.x;
|
|
42
43
|
const arrowY = (_b = tooltip.middlewareData.arrow) === null || _b === void 0 ? void 0 : _b.y;
|
|
43
44
|
const staticSide = STATIC_SIDES[tooltip.placement.split("-")[0]];
|
|
44
|
-
const stableRef = (0,
|
|
45
|
-
return (
|
|
46
|
-
(0,
|
|
45
|
+
const stableRef = (0, react_2.useMemo)(() => (0, composeRefs_1.composeRefs)(ref, tooltip.refs.setReference, children.ref), [ref, tooltip.refs.setReference, children]);
|
|
46
|
+
return (react_2.default.createElement(react_2.default.Fragment, null,
|
|
47
|
+
(0, react_2.cloneElement)(children, tooltip.getReferenceProps({
|
|
47
48
|
ref: stableRef,
|
|
48
49
|
...children.props,
|
|
49
50
|
"data-state": tooltip.open ? "open" : "closed",
|
|
50
51
|
})),
|
|
51
|
-
tooltip.open && (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
52
|
+
tooltip.open && (react_2.default.createElement(react_1.FloatingPortal, null,
|
|
53
|
+
react_2.default.createElement("div", { ...tooltip.getFloatingProps({
|
|
54
|
+
className: (0, cx_1.cx)("uxf-tooltip", className),
|
|
55
|
+
ref: tooltip.refs.setFloating,
|
|
56
|
+
style: {
|
|
57
|
+
...tooltip.floatingStyles,
|
|
58
|
+
...style,
|
|
59
|
+
},
|
|
60
|
+
}) },
|
|
61
|
+
react_2.default.createElement("div", { className: "uxf-tooltip__arrow", ref: arrowRef, style: {
|
|
62
|
+
height: "16px",
|
|
63
|
+
left: arrowX !== undefined ? `${arrowX}px` : "",
|
|
64
|
+
position: "absolute",
|
|
65
|
+
top: arrowY !== undefined ? `${arrowY}px` : "",
|
|
66
|
+
transform: "rotate(45deg)",
|
|
67
|
+
width: "16px",
|
|
68
|
+
[staticSide]: "-6px",
|
|
69
|
+
} }),
|
|
70
|
+
content)))));
|
|
69
71
|
});
|
|
70
72
|
exports.Tooltip.displayName = "UxfUiTooltip";
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Default = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const tooltip_1 = require("./tooltip");
|
|
9
8
|
const chip_1 = require("../chip");
|
|
9
|
+
const tooltip_1 = require("./tooltip");
|
|
10
10
|
exports.default = {
|
|
11
11
|
title: "UI/Tooltip",
|
|
12
12
|
component: tooltip_1.Tooltip,
|