@uxf/ui 1.0.0-beta.10 → 1.0.0-beta.100
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/_private-utils/get-provider-config.d.ts +2 -0
- package/_private-utils/get-provider-config.js +18 -0
- package/avatar/avatar.d.ts +5 -0
- package/avatar/avatar.js +14 -0
- package/avatar/avatar.spec.d.ts +1 -0
- package/avatar/avatar.spec.js +9 -0
- package/avatar/avatar.stories.d.ts +7 -0
- package/avatar/avatar.stories.js +21 -0
- package/avatar/index.d.ts +1 -0
- package/avatar/index.js +17 -0
- package/avatar-file-input/avatar-file-input.d.ts +7 -0
- package/avatar-file-input/avatar-file-input.js +47 -0
- package/avatar-file-input/avatar-file-input.stories.d.ts +7 -0
- package/avatar-file-input/avatar-file-input.stories.js +39 -0
- package/avatar-file-input/index.d.ts +1 -0
- package/{storybook → avatar-file-input}/index.js +1 -2
- package/badge/badge.d.ts +7 -0
- package/badge/badge.js +15 -0
- package/badge/badge.stories.d.ts +7 -0
- package/badge/badge.stories.js +39 -0
- package/badge/index.d.ts +1 -0
- package/badge/index.js +17 -0
- package/badge/theme.d.ts +5 -0
- package/badge/theme.js +2 -0
- package/button/button.d.ts +13 -13
- package/button/button.js +16 -12
- package/button/button.stories.d.ts +9 -5
- package/button/button.stories.js +56 -21
- package/button/index.d.ts +1 -2
- package/button/index.js +1 -8
- package/button/theme.d.ts +5 -2
- package/button/theme.js +0 -1
- package/checkbox/checkbox.d.ts +13 -0
- package/checkbox/checkbox.js +18 -0
- package/checkbox/checkbox.spec.d.ts +1 -0
- package/checkbox/checkbox.spec.js +11 -0
- package/checkbox/checkbox.stories.d.ts +7 -0
- package/checkbox/checkbox.stories.js +44 -0
- package/checkbox/index.d.ts +1 -0
- package/checkbox/index.js +17 -0
- package/checkbox-button/checkbox-button.d.ts +8 -0
- package/checkbox-button/checkbox-button.js +18 -0
- package/checkbox-button/checkbox-button.spec.d.ts +1 -0
- package/checkbox-button/checkbox-button.spec.js +10 -0
- package/checkbox-button/checkbox-button.stories.d.ts +7 -0
- package/checkbox-button/checkbox-button.stories.js +57 -0
- package/checkbox-button/index.d.ts +1 -0
- package/checkbox-button/index.js +17 -0
- package/checkbox-visual/checkbox-visual.d.ts +10 -0
- package/checkbox-visual/checkbox-visual.js +17 -0
- package/checkbox-visual/checkbox-visual.stories.d.ts +7 -0
- package/checkbox-visual/checkbox-visual.stories.js +44 -0
- package/checkbox-visual/index.d.ts +1 -0
- package/checkbox-visual/index.js +17 -0
- package/checkbox-visual/theme.d.ts +4 -0
- package/checkbox-visual/theme.js +2 -0
- package/chip/chip.d.ts +10 -0
- package/chip/chip.js +19 -0
- package/chip/chip.stories.d.ts +14 -0
- package/chip/chip.stories.js +32 -0
- package/chip/index.d.ts +1 -0
- package/chip/index.js +17 -0
- package/chip/theme.d.ts +14 -0
- package/chip/theme.js +2 -0
- package/color-radio-group/color-radio-group.d.ts +17 -0
- package/color-radio-group/color-radio-group.js +47 -0
- package/color-radio-group/color-radio-group.stories.d.ts +7 -0
- package/color-radio-group/color-radio-group.stories.js +79 -0
- package/color-radio-group/color-radio.d.ts +7 -0
- package/color-radio-group/color-radio.js +22 -0
- package/color-radio-group/index.d.ts +1 -0
- package/color-radio-group/index.js +17 -0
- package/color-scheme/color-scheme-defaults.d.ts +8 -0
- package/color-scheme/color-scheme-defaults.js +10 -0
- package/color-scheme/index.d.ts +2 -0
- package/color-scheme/index.js +7 -0
- package/color-scheme/use-handle-color-scheme.d.ts +9 -0
- package/color-scheme/use-handle-color-scheme.js +24 -0
- package/color-scheme/use-toggle-color-scheme.d.ts +1 -0
- package/color-scheme/use-toggle-color-scheme.js +30 -0
- package/combobox/combobox.d.ts +25 -0
- package/combobox/combobox.js +64 -0
- package/combobox/combobox.stories.d.ts +10 -0
- package/combobox/combobox.stories.js +82 -0
- package/combobox/index.d.ts +1 -0
- package/combobox/index.js +17 -0
- package/config/icons-config.d.ts +2 -0
- package/config/icons-config.js +5 -0
- package/config/icons.d.ts +82 -0
- package/config/icons.js +21 -0
- package/content/content-schema.d.ts +3 -0
- package/content/content-schema.js +2 -0
- package/content/types.d.ts +27 -0
- package/content/types.js +2 -0
- package/context/context.d.ts +17 -0
- package/context/context.js +5 -0
- package/context/index.d.ts +3 -0
- package/context/index.js +19 -0
- package/context/provider.d.ts +8 -0
- package/context/provider.js +17 -0
- package/context/use-component-context.d.ts +3 -0
- package/context/use-component-context.js +13 -0
- package/css/avatar-file-input.css +82 -0
- package/css/avatar.css +15 -0
- package/css/badge.css +23 -0
- package/css/button.css +221 -0
- package/css/button.old.css +231 -0
- package/css/checkbox-button.css +98 -0
- package/css/checkbox.css +147 -0
- package/css/chip.css +171 -0
- package/css/chip.old.css +37 -0
- package/css/color-radio-group.css +21 -0
- package/css/color-radio.css +21 -0
- package/css/combobox.css +108 -0
- package/css/combobox.old.css +102 -0
- package/css/component-structure-analyzer.css +31 -0
- package/css/date-picker-input.css +135 -0
- package/css/date-picker.css +90 -0
- package/css/dropdown.css +24 -0
- package/css/dropdown.old.css +24 -0
- package/css/error-message.css +3 -0
- package/css/file-input.css +95 -0
- package/css/flash-messages.css +28 -0
- package/css/form-control.css +7 -0
- package/css/icon.css +7 -0
- package/css/input-basic.css +18 -0
- package/css/input.css +205 -0
- package/css/input.old.css +193 -0
- package/css/label.css +15 -0
- package/css/layout.css +47 -0
- package/css/list-item.css +29 -0
- package/css/loader.css +11 -0
- package/css/multi-combobox.css +72 -0
- package/css/pagination.css +28 -0
- package/css/paper.css +3 -0
- package/css/radio-group.css +160 -0
- package/css/radio.css +105 -0
- package/css/raster-image.css +20 -0
- package/css/select.css +72 -0
- package/css/select.old.css +66 -0
- package/css/tabs.css +131 -0
- package/css/text-link.css +12 -0
- package/css/textarea.css +117 -0
- package/css/time-picker-input.css +138 -0
- package/css/time-picker.css +27 -0
- package/css/toggle.css +80 -0
- package/css/typography.css +51 -0
- package/date-picker-input/date-picker-day.d.ts +8 -0
- package/date-picker-input/date-picker-day.js +63 -0
- package/date-picker-input/date-picker-decade.d.ts +6 -0
- package/date-picker-input/date-picker-decade.js +71 -0
- package/date-picker-input/date-picker-input.d.ts +21 -0
- package/date-picker-input/date-picker-input.js +88 -0
- package/date-picker-input/date-picker-input.stories.d.ts +14 -0
- package/date-picker-input/date-picker-input.stories.js +54 -0
- package/date-picker-input/date-picker-month.d.ts +7 -0
- package/date-picker-input/date-picker-month.js +66 -0
- package/date-picker-input/date-picker-provider.d.ts +8 -0
- package/date-picker-input/date-picker-provider.js +26 -0
- package/date-picker-input/date-picker-year.d.ts +7 -0
- package/date-picker-input/date-picker-year.js +74 -0
- package/date-picker-input/date-picker.d.ts +3 -0
- package/date-picker-input/date-picker.js +53 -0
- package/date-picker-input/index.d.ts +3 -0
- package/date-picker-input/index.js +19 -0
- package/date-picker-input/types.d.ts +5 -0
- package/date-picker-input/types.js +2 -0
- package/dropdown/dropdown.d.ts +11 -0
- package/dropdown/dropdown.js +27 -0
- package/dropdown/dropdown.stories.d.ts +10 -0
- package/dropdown/dropdown.stories.js +30 -0
- package/dropdown/index.d.ts +1 -0
- package/dropdown/index.js +17 -0
- package/error-message/error-message.d.ts +7 -0
- package/error-message/error-message.js +11 -0
- package/error-message/error-message.stories.d.ts +8 -0
- package/error-message/error-message.stories.js +17 -0
- package/error-message/index.d.ts +1 -0
- package/error-message/index.js +17 -0
- package/file-input/file-input-base.d.ts +13 -0
- package/file-input/file-input-base.js +50 -0
- package/file-input/file-input.d.ts +10 -0
- package/file-input/file-input.js +43 -0
- package/file-input/file-input.stories.d.ts +7 -0
- package/file-input/file-input.stories.js +39 -0
- package/file-input/index.d.ts +1 -0
- package/file-input/index.js +17 -0
- package/file-input/types.d.ts +7 -0
- package/file-input/types.js +2 -0
- package/flash-messages/flash-message.d.ts +16 -0
- package/flash-messages/flash-message.js +46 -0
- package/flash-messages/flash-messages-service.d.ts +5 -0
- package/flash-messages/flash-messages-service.js +15 -0
- package/flash-messages/flash-messages.d.ts +8 -0
- package/flash-messages/flash-messages.js +55 -0
- package/flash-messages/flash-messages.stories.d.ts +7 -0
- package/flash-messages/flash-messages.stories.js +45 -0
- package/flash-messages/theme.d.ts +6 -0
- package/flash-messages/theme.js +2 -0
- package/form-control/form-control.d.ts +13 -0
- package/form-control/form-control.js +19 -0
- package/form-control/form-control.stories.d.ts +12 -0
- package/form-control/form-control.stories.js +25 -0
- package/form-control/index.d.ts +1 -0
- package/form-control/index.js +17 -0
- package/hooks/use-async-loading.d.ts +4 -0
- package/hooks/use-async-loading.js +32 -0
- package/hooks/use-dropdown.d.ts +2 -0
- package/hooks/use-dropdown.js +30 -0
- package/hooks/use-input-submit.d.ts +4 -0
- package/hooks/use-input-submit.js +40 -0
- package/icon/icon.d.ts +17 -0
- package/icon/icon.js +38 -0
- package/icon/icon.stories.d.ts +18 -0
- package/icon/icon.stories.js +53 -0
- package/icon/index.d.ts +1 -0
- package/icon/index.js +17 -0
- package/icon/theme.d.ts +2 -0
- package/icon/theme.js +2 -0
- package/icon/types.d.ts +2 -0
- package/icon/types.js +2 -0
- package/image-gallery/components/close-button.d.ts +6 -0
- package/image-gallery/components/close-button.js +12 -0
- package/image-gallery/components/dot.d.ts +6 -0
- package/image-gallery/components/dot.js +12 -0
- package/image-gallery/components/gallery.d.ts +11 -0
- package/image-gallery/components/gallery.js +72 -0
- package/image-gallery/components/next-button.d.ts +6 -0
- package/image-gallery/components/next-button.js +12 -0
- package/image-gallery/components/previous-button.d.ts +6 -0
- package/image-gallery/components/previous-button.js +12 -0
- package/image-gallery/context.d.ts +10 -0
- package/image-gallery/context.js +12 -0
- package/image-gallery/image-gallery.d.ts +6 -0
- package/image-gallery/image-gallery.js +55 -0
- package/image-gallery/image-gallery.stories.d.ts +13 -0
- package/image-gallery/image-gallery.stories.js +27 -0
- package/image-gallery/image.d.ts +4 -0
- package/image-gallery/image.js +14 -0
- package/image-gallery/index.d.ts +4 -0
- package/image-gallery/index.js +26 -0
- package/image-gallery/types.d.ts +7 -0
- package/image-gallery/types.js +2 -0
- package/image-gallery/use-image.d.ts +2 -0
- package/image-gallery/use-image.js +16 -0
- package/input/index.d.ts +12 -0
- package/input/index.js +16 -0
- package/input/input-element.d.ts +21 -0
- package/input/input-element.js +11 -0
- package/input/input-left-addon.d.ts +9 -0
- package/input/input-left-addon.js +12 -0
- package/input/input-left-element.d.ts +9 -0
- package/input/input-left-element.js +12 -0
- package/input/input-right-addon.d.ts +8 -0
- package/input/input-right-addon.js +12 -0
- package/input/input-right-element.d.ts +9 -0
- package/input/input-right-element.js +12 -0
- package/input/input.d.ts +8 -0
- package/input/input.js +65 -0
- package/input/input.stories.d.ts +15 -0
- package/input/input.stories.js +93 -0
- package/input/theme.d.ts +8 -0
- package/input/theme.js +2 -0
- package/label/index.d.ts +1 -0
- package/label/index.js +17 -0
- package/label/label.d.ts +12 -0
- package/label/label.js +14 -0
- package/label/label.stories.d.ts +7 -0
- package/label/label.stories.js +17 -0
- package/layout/index.d.ts +1 -0
- package/layout/index.js +17 -0
- package/layout/layout.d.ts +9 -0
- package/layout/layout.js +60 -0
- package/layout/layout.stories.d.ts +8 -0
- package/layout/layout.stories.js +21 -0
- package/layout/uxf-logo.d.ts +6 -0
- package/layout/uxf-logo.js +13 -0
- package/list-item/index.d.ts +1 -0
- package/list-item/index.js +17 -0
- package/list-item/list-item.d.ts +8 -0
- package/list-item/list-item.js +24 -0
- package/list-item/list-item.stories.d.ts +7 -0
- package/list-item/list-item.stories.js +32 -0
- package/loader/loader.d.ts +2 -0
- package/loader/loader.js +13 -0
- package/loader/loader.stories.d.ts +7 -0
- package/loader/loader.stories.js +21 -0
- package/mutli-combobox/index.d.ts +1 -0
- package/mutli-combobox/index.js +17 -0
- package/mutli-combobox/multi-combobox.d.ts +28 -0
- package/mutli-combobox/multi-combobox.js +101 -0
- package/mutli-combobox/multi-combobox.stories.d.ts +11 -0
- package/mutli-combobox/multi-combobox.stories.js +85 -0
- package/package.json +19 -36
- package/pagination/pagination.d.ts +7 -0
- package/pagination/pagination.js +49 -0
- package/pagination/pagination.stories.d.ts +7 -0
- package/pagination/pagination.stories.js +47 -0
- package/paper/paper.d.ts +5 -0
- package/paper/paper.js +13 -0
- package/paper/paper.stories.d.ts +7 -0
- package/paper/paper.stories.js +18 -0
- package/radio/index.d.ts +1 -0
- package/radio/index.js +17 -0
- package/radio/radio.d.ts +9 -0
- package/radio/radio.js +16 -0
- package/radio/radio.spec.d.ts +1 -0
- package/radio/radio.spec.js +10 -0
- package/radio/radio.stories.d.ts +7 -0
- package/radio/radio.stories.js +35 -0
- package/radio/theme.d.ts +4 -0
- package/radio/theme.js +2 -0
- package/radio-group/index.d.ts +1 -0
- package/radio-group/index.js +17 -0
- package/radio-group/radio-group.d.ts +24 -0
- package/radio-group/radio-group.js +49 -0
- package/radio-group/radio-group.spec.d.ts +1 -0
- package/radio-group/radio-group.spec.js +24 -0
- package/radio-group/radio-group.stories.d.ts +7 -0
- package/radio-group/radio-group.stories.js +58 -0
- package/radio-group/theme.d.ts +5 -0
- package/radio-group/theme.js +2 -0
- package/raster-image/index.d.ts +1 -0
- package/raster-image/index.js +17 -0
- package/raster-image/raster-image.d.ts +30 -0
- package/raster-image/raster-image.js +47 -0
- package/raster-image/raster-image.stories.d.ts +30 -0
- package/raster-image/raster-image.stories.js +17 -0
- package/scripts/generate-tw-tokens.js +94 -0
- package/select/index.d.ts +1 -0
- package/select/index.js +17 -0
- package/select/select.d.ts +24 -0
- package/select/select.js +58 -0
- package/select/select.stories.d.ts +9 -0
- package/select/select.stories.js +81 -0
- package/tabs/index.d.ts +1 -0
- package/tabs/index.js +17 -0
- package/tabs/tabs.d.ts +19 -0
- package/tabs/tabs.js +68 -0
- package/tabs/tabs.stories.d.ts +11 -0
- package/tabs/tabs.stories.js +48 -0
- package/text-input/index.d.ts +1 -0
- package/text-input/index.js +17 -0
- package/text-input/text-input.d.ts +31 -0
- package/text-input/text-input.js +57 -0
- package/text-input/text-input.spec.d.ts +1 -0
- package/text-input/text-input.spec.js +9 -0
- package/text-input/text-input.stories.d.ts +8 -0
- package/text-input/text-input.stories.js +56 -0
- package/text-link/index.d.ts +1 -0
- package/text-link/index.js +17 -0
- package/text-link/text-link.d.ts +5 -0
- package/text-link/text-link.js +19 -0
- package/text-link/text-link.stories.d.ts +7 -0
- package/text-link/text-link.stories.js +24 -0
- package/textarea/index.d.ts +1 -0
- package/textarea/index.js +17 -0
- package/textarea/textarea.d.ts +18 -0
- package/textarea/textarea.js +81 -0
- package/textarea/textarea.stories.d.ts +7 -0
- package/textarea/textarea.stories.js +44 -0
- package/time-picker-input/index.d.ts +2 -0
- package/time-picker-input/index.js +18 -0
- package/time-picker-input/time-picker-hour.d.ts +5 -0
- package/time-picker-input/time-picker-hour.js +47 -0
- package/time-picker-input/time-picker-hours.d.ts +2 -0
- package/time-picker-input/time-picker-hours.js +14 -0
- package/time-picker-input/time-picker-input.d.ts +22 -0
- package/time-picker-input/time-picker-input.js +89 -0
- package/time-picker-input/time-picker-input.stories.d.ts +7 -0
- package/time-picker-input/time-picker-input.stories.js +45 -0
- package/time-picker-input/time-picker-minute.d.ts +5 -0
- package/time-picker-input/time-picker-minute.js +47 -0
- package/time-picker-input/time-picker-minutes.d.ts +2 -0
- package/time-picker-input/time-picker-minutes.js +14 -0
- package/time-picker-input/time-picker.d.ts +8 -0
- package/time-picker-input/time-picker.js +69 -0
- package/toggle/index.d.ts +1 -0
- package/toggle/index.js +17 -0
- package/toggle/theme.d.ts +4 -0
- package/toggle/theme.js +2 -0
- package/toggle/toggle.d.ts +12 -0
- package/toggle/toggle.js +19 -0
- package/toggle/toggle.stories.d.ts +7 -0
- package/toggle/toggle.stories.js +52 -0
- package/tw-tokens/tw-box-shadow.d.ts +12 -0
- package/tw-tokens/tw-box-shadow.js +15 -0
- package/tw-tokens/tw-colors.d.ts +328 -0
- package/tw-tokens/tw-colors.js +331 -0
- package/tw-tokens/tw-containers.d.ts +8 -0
- package/tw-tokens/tw-containers.js +11 -0
- package/tw-tokens/tw-font-size.d.ts +55 -0
- package/tw-tokens/tw-font-size.js +32 -0
- package/tw-tokens/tw-font-weight.d.ts +12 -0
- package/tw-tokens/tw-font-weight.js +15 -0
- package/tw-tokens/tw-line-height.d.ts +17 -0
- package/tw-tokens/tw-line-height.js +20 -0
- package/tw-tokens/tw-screens.d.ts +8 -0
- package/tw-tokens/tw-screens.js +11 -0
- package/tw-tokens/tw-spacing.d.ts +39 -0
- package/tw-tokens/tw-spacing.js +42 -0
- package/tw-tokens/tw-z-index.d.ts +19 -0
- package/tw-tokens/tw-z-index.js +22 -0
- package/types/color.d.ts +2 -0
- package/types/color.js +2 -0
- package/types/form-control-props.d.ts +24 -0
- package/types/form-control-props.js +2 -0
- package/types/index.d.ts +2 -0
- package/types/index.js +18 -0
- package/typography/typography.spec.d.ts +1 -0
- package/typography/typography.spec.js +21 -0
- package/typography/typography.stories.d.ts +7 -0
- package/typography/typography.stories.js +28 -0
- package/utils/action.d.ts +2 -0
- package/utils/action.js +11 -0
- package/utils/component-structure-analyzer.d.ts +6 -0
- package/utils/component-structure-analyzer.js +10 -0
- package/utils/icons-config.js +78 -0
- package/utils/snap-test.d.ts +2 -0
- package/utils/snap-test.js +17 -0
- package/utils/storybook-config.d.ts +26 -0
- package/{storybook → utils}/storybook-config.js +12 -6
- package/utils/tailwind-config.js +189 -0
- package/stories/button.stories.tsx +0 -98
- package/storybook/index.d.ts +0 -1
- package/storybook/storybook-config.d.ts +0 -21
- package/tailwindui/button.css +0 -51
- package/types.d.ts +0 -3
- package/types.js +0 -3
|
@@ -0,0 +1,27 @@
|
|
|
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.Default = void 0;
|
|
7
|
+
const image_1 = require("@uxf/core/utils/image");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const image_2 = __importDefault(require("./image"));
|
|
10
|
+
const image_gallery_1 = __importDefault(require("./image-gallery"));
|
|
11
|
+
exports.default = {
|
|
12
|
+
title: "Lab/ImageGallery",
|
|
13
|
+
component: image_gallery_1.default,
|
|
14
|
+
parameters: { actions: { argTypesRegex: "^on.*" } },
|
|
15
|
+
};
|
|
16
|
+
const images = [
|
|
17
|
+
"https://opentopo.app/hero_image.jpeg",
|
|
18
|
+
"https://opentopo.app/generated/area-18/d/9/d9033d93-ea48-4f66-b0c1-6045c091b326_1024_1024_c.jpg",
|
|
19
|
+
"https://opentopo.app/generated/area-16/f/4/f4a4ca79-ea9e-44d1-a4ec-3c8ccfbcc218_1024_1024_c.jpg",
|
|
20
|
+
"https://opentopo.app/generated/area-1/8/b/8b84e378-1f55-4ce7-b750-b504091cb833_1024_1024_c.jpg",
|
|
21
|
+
"https://opentopo.app/generated/area-2/e/7/e7ec532b-20c2-407e-9305-fa7cfb71f01f_1024_1024_c.jpg",
|
|
22
|
+
];
|
|
23
|
+
function Default() {
|
|
24
|
+
return (react_1.default.createElement(image_gallery_1.default, null,
|
|
25
|
+
react_1.default.createElement("div", { className: "flex-direction flex gap-2" }, images.map((src, index) => (react_1.default.createElement(image_2.default, { key: (0, image_1.getImgUniqueIdentifier)(src) || index, src: src, className: "h-56 w-56 cursor-pointer object-cover transition-transform hover:scale-105" }))))));
|
|
26
|
+
}
|
|
27
|
+
exports.Default = Default;
|
|
@@ -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
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const use_image_1 = require("./use-image");
|
|
8
|
+
const resizer_1 = require("@uxf/core/utils/resizer");
|
|
9
|
+
function Image(props) {
|
|
10
|
+
var _a;
|
|
11
|
+
const openGallery = (0, use_image_1.useImage)(props);
|
|
12
|
+
return (react_1.default.createElement("img", { src: typeof props.src === "string" ? props.src : (_a = (0, resizer_1.resizerImageUrl)(props.src)) !== null && _a !== void 0 ? _a : "", alt: props.alt, title: props.title, className: props.className, onClick: openGallery }));
|
|
13
|
+
}
|
|
14
|
+
exports.default = Image;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.ImageGallery = exports.Image = void 0;
|
|
21
|
+
var image_1 = require("./image");
|
|
22
|
+
Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return __importDefault(image_1).default; } });
|
|
23
|
+
var image_gallery_1 = require("./image-gallery");
|
|
24
|
+
Object.defineProperty(exports, "ImageGallery", { enumerable: true, get: function () { return __importDefault(image_gallery_1).default; } });
|
|
25
|
+
__exportStar(require("./use-image"), exports);
|
|
26
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useImage = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const context_1 = require("./context");
|
|
6
|
+
function useImage(props) {
|
|
7
|
+
const { registerImage, unregisterImage, openGallery } = (0, context_1.useImageGalleryContext)();
|
|
8
|
+
(0, react_1.useEffect)(() => {
|
|
9
|
+
registerImage(props);
|
|
10
|
+
return () => {
|
|
11
|
+
unregisterImage(props);
|
|
12
|
+
};
|
|
13
|
+
}, [props, registerImage, unregisterImage]);
|
|
14
|
+
return (0, react_1.useCallback)(() => openGallery(props), [props, openGallery]);
|
|
15
|
+
}
|
|
16
|
+
exports.useImage = useImage;
|
package/input/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputLeftAddon } from "./input-left-addon";
|
|
3
|
+
import { InputLeftElement } from "./input-left-element";
|
|
4
|
+
import { InputRightAddon } from "./input-right-addon";
|
|
5
|
+
import { InputRightElement } from "./input-right-element";
|
|
6
|
+
export declare const Input: import("react").ForwardRefExoticComponent<import("./input").InputProps & import("react").RefAttributes<HTMLInputElement>> & {
|
|
7
|
+
Element: import("react").ForwardRefExoticComponent<import("./input-element").InputElementProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
8
|
+
LeftElement: typeof InputLeftElement;
|
|
9
|
+
RightElement: typeof InputRightElement;
|
|
10
|
+
LeftAddon: typeof InputLeftAddon;
|
|
11
|
+
RightAddon: typeof InputRightAddon;
|
|
12
|
+
};
|
package/input/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Input = void 0;
|
|
4
|
+
const input_1 = require("./input");
|
|
5
|
+
const input_element_1 = require("./input-element");
|
|
6
|
+
const input_left_addon_1 = require("./input-left-addon");
|
|
7
|
+
const input_left_element_1 = require("./input-left-element");
|
|
8
|
+
const input_right_addon_1 = require("./input-right-addon");
|
|
9
|
+
const input_right_element_1 = require("./input-right-element");
|
|
10
|
+
exports.Input = Object.assign(input_1.Input, {
|
|
11
|
+
Element: input_element_1.InputElement,
|
|
12
|
+
LeftElement: input_left_element_1.InputLeftElement,
|
|
13
|
+
RightElement: input_right_element_1.InputRightElement,
|
|
14
|
+
LeftAddon: input_left_addon_1.InputLeftAddon,
|
|
15
|
+
RightAddon: input_right_addon_1.InputRightAddon,
|
|
16
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FormControlProps } from "@uxf/ui/types/form-control-props";
|
|
2
|
+
import React, { KeyboardEventHandler } from "react";
|
|
3
|
+
declare type InputMode = "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
4
|
+
export interface InputElementProps extends FormControlProps<string> {
|
|
5
|
+
"aria-describedby"?: string;
|
|
6
|
+
"aria-invalid"?: boolean;
|
|
7
|
+
form?: string;
|
|
8
|
+
id?: string;
|
|
9
|
+
inputMode?: InputMode;
|
|
10
|
+
onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
type?: "email" | "number" | "password" | "search" | "tel" | "text" | "url" | "time";
|
|
13
|
+
maxLength?: number | undefined;
|
|
14
|
+
minLength?: number | undefined;
|
|
15
|
+
max?: number | string;
|
|
16
|
+
min?: number | string;
|
|
17
|
+
pattern?: string;
|
|
18
|
+
step?: number | string;
|
|
19
|
+
}
|
|
20
|
+
export declare const InputElement: React.ForwardRefExoticComponent<InputElementProps & React.RefAttributes<HTMLInputElement>>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
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.InputElement = void 0;
|
|
7
|
+
const forwardRef_1 = require("@uxf/core/utils/forwardRef");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
exports.InputElement = (0, forwardRef_1.forwardRef)("InputElement", (props, ref) => {
|
|
10
|
+
return (react_1.default.createElement("input", { "aria-describedby": props["aria-describedby"], "aria-invalid": props.isInvalid, 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: (event) => { var _a; return (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, event.target.value, event); }, 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 }));
|
|
11
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
interface InputLeftAddonProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function InputLeftAddon(props: InputLeftAddonProps): JSX.Element;
|
|
6
|
+
export declare namespace InputLeftAddon {
|
|
7
|
+
var displayName: string;
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
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.InputLeftAddon = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
function InputLeftAddon(props) {
|
|
9
|
+
return react_1.default.createElement("div", { className: "uxf-input__left-addon" }, props.children);
|
|
10
|
+
}
|
|
11
|
+
exports.InputLeftAddon = InputLeftAddon;
|
|
12
|
+
InputLeftAddon.displayName = "InputLeftAddon";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
interface InputLeftElementProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function InputLeftElement(props: InputLeftElementProps): JSX.Element;
|
|
6
|
+
export declare namespace InputLeftElement {
|
|
7
|
+
var displayName: string;
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
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.InputLeftElement = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
function InputLeftElement(props) {
|
|
9
|
+
return react_1.default.createElement("div", { className: "uxf-input__left-element" }, props.children);
|
|
10
|
+
}
|
|
11
|
+
exports.InputLeftElement = InputLeftElement;
|
|
12
|
+
InputLeftElement.displayName = "InputLeftElement";
|
|
@@ -0,0 +1,12 @@
|
|
|
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.InputRightAddon = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
function InputRightAddon(props) {
|
|
9
|
+
return react_1.default.createElement("div", { className: "uxf-input__right-addon" }, props.children);
|
|
10
|
+
}
|
|
11
|
+
exports.InputRightAddon = InputRightAddon;
|
|
12
|
+
InputRightAddon.displayName = "InputRightAddon";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
interface InputRightElementProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function InputRightElement(props: InputRightElementProps): JSX.Element;
|
|
6
|
+
export declare namespace InputRightElement {
|
|
7
|
+
var displayName: string;
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
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.InputRightElement = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
function InputRightElement(props) {
|
|
9
|
+
return react_1.default.createElement("div", { className: "uxf-input__right-element" }, props.children);
|
|
10
|
+
}
|
|
11
|
+
exports.InputRightElement = InputRightElement;
|
|
12
|
+
InputRightElement.displayName = "InputRightElement";
|
package/input/input.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { InputGroupSizes, InputGroupVariants } from "@uxf/ui/input/theme";
|
|
3
|
+
export interface InputProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
variant?: keyof InputGroupVariants;
|
|
6
|
+
size?: keyof InputGroupSizes;
|
|
7
|
+
}
|
|
8
|
+
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
package/input/input.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Input = void 0;
|
|
27
|
+
const composeRefs_1 = require("@uxf/core/utils/composeRefs");
|
|
28
|
+
const forwardRef_1 = require("@uxf/core/utils/forwardRef");
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
31
|
+
const classes_1 = require("@uxf/core/constants/classes");
|
|
32
|
+
function getChildrenById(children, componentName) {
|
|
33
|
+
return react_1.Children.toArray(children)
|
|
34
|
+
.filter(react_1.isValidElement)
|
|
35
|
+
.find((ch) => ch.type.displayName === componentName);
|
|
36
|
+
}
|
|
37
|
+
exports.Input = (0, forwardRef_1.forwardRef)("Input", (props, ref) => {
|
|
38
|
+
var _a, _b;
|
|
39
|
+
const inputWrapperRef = (0, react_1.useRef)(null);
|
|
40
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
41
|
+
const [focused, setFocused] = (0, react_1.useState)(false);
|
|
42
|
+
const mainInput = getChildrenById(props.children, "InputElement");
|
|
43
|
+
const leftAddon = getChildrenById(props.children, "InputLeftAddon");
|
|
44
|
+
const rightAddon = getChildrenById(props.children, "InputRightAddon");
|
|
45
|
+
const leftElement = getChildrenById(props.children, "InputLeftElement");
|
|
46
|
+
const rightElement = getChildrenById(props.children, "InputRightElement");
|
|
47
|
+
const inputGroupClasses = (0, cx_1.cx)("uxf-input", leftAddon && "uxf-input--has-left-addon", leftElement && "uxf-input--has-left-element", rightElement && "uxf-input--has-right-element", rightAddon && "uxf-input--has-right-addon", focused && classes_1.CLASSES.IS_FOCUSED, (mainInput === null || mainInput === void 0 ? void 0 : mainInput.props.isInvalid) && classes_1.CLASSES.IS_INVALID, (mainInput === null || mainInput === void 0 ? void 0 : mainInput.props.isDisabled) && classes_1.CLASSES.IS_DISABLED, (mainInput === null || mainInput === void 0 ? void 0 : mainInput.props.isReadOnly) && classes_1.CLASSES.IS_READONLY, `uxf-input--size-${(_a = props.size) !== null && _a !== void 0 ? _a : "default"}`, `uxf-input--variant-${(_b = props.variant) !== null && _b !== void 0 ? _b : "default"}`);
|
|
48
|
+
const onFocus = (e) => {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
setFocused(true);
|
|
51
|
+
(_b = mainInput === null || mainInput === void 0 ? void 0 : (_a = mainInput.props).onFocus) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
52
|
+
};
|
|
53
|
+
const onBlur = (e) => {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
setFocused(false);
|
|
56
|
+
(_b = mainInput === null || mainInput === void 0 ? void 0 : (_a = mainInput.props).onBlur) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
57
|
+
};
|
|
58
|
+
return (react_1.default.createElement("div", { className: inputGroupClasses },
|
|
59
|
+
leftAddon,
|
|
60
|
+
react_1.default.createElement("div", { className: "uxf-input__wrapper", ref: inputWrapperRef, onClick: () => { var _a; return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); } },
|
|
61
|
+
leftElement,
|
|
62
|
+
mainInput ? (0, react_1.cloneElement)(mainInput, { ref: (0, composeRefs_1.composeRefs)(ref, inputRef), onFocus, onBlur }) : null,
|
|
63
|
+
rightElement),
|
|
64
|
+
rightAddon));
|
|
65
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: React.ForwardRefExoticComponent<import("./input").InputProps & React.RefAttributes<HTMLInputElement>> & {
|
|
5
|
+
Element: React.ForwardRefExoticComponent<import("./input-element").InputElementProps & React.RefAttributes<HTMLInputElement>>;
|
|
6
|
+
LeftElement: typeof import("./input-left-element").InputLeftElement;
|
|
7
|
+
RightElement: typeof import("./input-right-element").InputRightElement;
|
|
8
|
+
LeftAddon: typeof import("./input-left-addon").InputLeftAddon;
|
|
9
|
+
RightAddon: typeof import("./input-right-addon").InputRightAddon;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
13
|
+
export declare function Default(): JSX.Element;
|
|
14
|
+
export declare function Sizes(): JSX.Element;
|
|
15
|
+
export declare function ComponentStructure(): JSX.Element;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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
|
+
const input_1 = require("@uxf/ui/input");
|
|
34
|
+
const storybook_config_1 = require("../utils/storybook-config");
|
|
35
|
+
exports.default = {
|
|
36
|
+
title: "UI/Input",
|
|
37
|
+
component: input_1.Input,
|
|
38
|
+
};
|
|
39
|
+
function Default() {
|
|
40
|
+
const [value, onChange] = (0, react_1.useState)("");
|
|
41
|
+
const [isInvalid, setInvalid] = (0, react_1.useState)(false);
|
|
42
|
+
const storyInputs = (react_1.default.createElement(react_1.default.Fragment, null,
|
|
43
|
+
react_1.default.createElement(input_1.Input, null,
|
|
44
|
+
react_1.default.createElement(input_1.Input.LeftAddon, null, "InputLeftAddon"),
|
|
45
|
+
react_1.default.createElement(input_1.Input.LeftElement, null, "InputLeftElement"),
|
|
46
|
+
react_1.default.createElement(input_1.Input.Element, { value: value, onChange: (0, action_1.action)("onChange", onChange), placeholder: "Placeholder", isInvalid: isInvalid }),
|
|
47
|
+
react_1.default.createElement(input_1.Input.RightElement, null, "InputRightElement"),
|
|
48
|
+
react_1.default.createElement(input_1.Input.RightAddon, null, "InputRightAddon")),
|
|
49
|
+
react_1.default.createElement(input_1.Input, null,
|
|
50
|
+
react_1.default.createElement(input_1.Input.LeftAddon, null, "https://"),
|
|
51
|
+
react_1.default.createElement(input_1.Input.Element, { value: value, onChange: (0, action_1.action)("onChange", onChange), placeholder: "Placeholder", isInvalid: isInvalid }),
|
|
52
|
+
react_1.default.createElement(input_1.Input.RightAddon, null, ".uxf.cz")),
|
|
53
|
+
react_1.default.createElement(input_1.Input, null,
|
|
54
|
+
react_1.default.createElement(input_1.Input.Element, { value: value, onChange: (0, action_1.action)("onChange", onChange), placeholder: "Placeholder", isInvalid: isInvalid }),
|
|
55
|
+
react_1.default.createElement(input_1.Input.RightAddon, null, ".test.cz")),
|
|
56
|
+
react_1.default.createElement(input_1.Input, null,
|
|
57
|
+
react_1.default.createElement(input_1.Input.LeftElement, null, "\uD83C\uDF37"),
|
|
58
|
+
react_1.default.createElement(input_1.Input.Element, { value: value, onChange: (0, action_1.action)("onChange", onChange), placeholder: "Placeholder", isInvalid: isInvalid }),
|
|
59
|
+
react_1.default.createElement(input_1.Input.RightElement, null, "\uD83D\uDD14")),
|
|
60
|
+
react_1.default.createElement(input_1.Input, null,
|
|
61
|
+
react_1.default.createElement(input_1.Input.Element, { value: value, onChange: (0, action_1.action)("onChange", onChange), placeholder: "Placeholder", isInvalid: isInvalid })),
|
|
62
|
+
react_1.default.createElement(input_1.Input, null,
|
|
63
|
+
react_1.default.createElement(input_1.Input.Element, { value: value, onChange: (0, action_1.action)("onChange", onChange), placeholder: "Disabled", isInvalid: isInvalid, isDisabled: true })),
|
|
64
|
+
react_1.default.createElement(input_1.Input, null,
|
|
65
|
+
react_1.default.createElement(input_1.Input.Element, { value: value, onChange: (0, action_1.action)("onChange", onChange), placeholder: "Read Only", isInvalid: isInvalid, isReadOnly: true }))));
|
|
66
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
67
|
+
react_1.default.createElement("input", { type: "checkbox", checked: isInvalid, onChange: (e) => setInvalid(e.target.checked) }),
|
|
68
|
+
react_1.default.createElement("div", { className: "light space-y-2 p-20" }, storyInputs),
|
|
69
|
+
react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20" }, storyInputs)));
|
|
70
|
+
}
|
|
71
|
+
exports.Default = Default;
|
|
72
|
+
function Sizes() {
|
|
73
|
+
const config = (0, storybook_config_1.useStorybookConfig)("Input");
|
|
74
|
+
const [value, setValue] = (0, react_1.useState)("");
|
|
75
|
+
return (react_1.default.createElement("div", { className: "space-y-4" }, config.sizes.map((size) => (react_1.default.createElement(input_1.Input, { key: size, size: size },
|
|
76
|
+
react_1.default.createElement(input_1.Input.LeftAddon, null, "LeftAddon"),
|
|
77
|
+
react_1.default.createElement(input_1.Input.LeftElement, null, "\uD83C\uDF37"),
|
|
78
|
+
react_1.default.createElement(input_1.Input.Element, { value: value, onChange: (0, action_1.action)("onChange", setValue), placeholder: size }),
|
|
79
|
+
react_1.default.createElement(input_1.Input.RightElement, null, "\uD83D\uDD14"),
|
|
80
|
+
react_1.default.createElement(input_1.Input.RightAddon, null, "RightAddon"))))));
|
|
81
|
+
}
|
|
82
|
+
exports.Sizes = Sizes;
|
|
83
|
+
function ComponentStructure() {
|
|
84
|
+
const [value, onChange] = (0, react_1.useState)("");
|
|
85
|
+
return (react_1.default.createElement(component_structure_analyzer_1.default, null,
|
|
86
|
+
react_1.default.createElement(input_1.Input, null,
|
|
87
|
+
react_1.default.createElement(input_1.Input.LeftAddon, null, "Left addon"),
|
|
88
|
+
react_1.default.createElement(input_1.Input.LeftElement, null, "Left element"),
|
|
89
|
+
react_1.default.createElement(input_1.Input.Element, { value: value, onChange: onChange }),
|
|
90
|
+
react_1.default.createElement(input_1.Input.RightElement, null, "Right element"),
|
|
91
|
+
react_1.default.createElement(input_1.Input.RightAddon, null, "Right addon"))));
|
|
92
|
+
}
|
|
93
|
+
exports.ComponentStructure = ComponentStructure;
|
package/input/theme.d.ts
ADDED
package/input/theme.js
ADDED
package/label/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./label";
|
package/label/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./label"), exports);
|
package/label/label.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { MouseEventHandler, ReactNode } from "react";
|
|
2
|
+
export interface LabelProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
form?: string;
|
|
6
|
+
htmlFor?: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
isHidden?: boolean;
|
|
9
|
+
isRequired?: boolean;
|
|
10
|
+
onClick?: MouseEventHandler<HTMLLabelElement>;
|
|
11
|
+
}
|
|
12
|
+
export declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
package/label/label.js
ADDED
|
@@ -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.Label = void 0;
|
|
7
|
+
const classes_1 = require("@uxf/core/constants/classes");
|
|
8
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
9
|
+
const forwardRef_1 = require("@uxf/core/utils/forwardRef");
|
|
10
|
+
const react_1 = __importDefault(require("react"));
|
|
11
|
+
exports.Label = (0, forwardRef_1.forwardRef)("Label", (props, ref) => {
|
|
12
|
+
const className = (0, cx_1.cx)("uxf-label", props.isHidden && "uxf-label--hidden", props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.className);
|
|
13
|
+
return (react_1.default.createElement("label", { className: className, form: props.form, htmlFor: props.htmlFor, id: props.id, onClick: props.onClick, ref: ref }, props.children));
|
|
14
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: React.ForwardRefExoticComponent<import("./label").LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare function Default(): JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
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.Default = void 0;
|
|
7
|
+
const index_1 = require("./index");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
exports.default = {
|
|
10
|
+
title: "UI/Label",
|
|
11
|
+
component: index_1.Label,
|
|
12
|
+
};
|
|
13
|
+
function Default() {
|
|
14
|
+
return (react_1.default.createElement("div", { className: "space-y-2" },
|
|
15
|
+
react_1.default.createElement(index_1.Label, null, "Label")));
|
|
16
|
+
}
|
|
17
|
+
exports.Default = Default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./layout";
|
package/layout/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./layout"), exports);
|