@uxf/ui 1.0.1 → 10.0.0-beta.11

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.
Files changed (77) hide show
  1. package/_select-base/_select-base.d.ts +1 -1
  2. package/_select-base/_select-base.js +3 -2
  3. package/chip/chip.d.ts +6 -6
  4. package/chip/chip.js +23 -9
  5. package/chip/chip.spec.d.ts +1 -0
  6. package/chip/chip.spec.js +9 -0
  7. package/chip/chip.stories.d.ts +1 -1
  8. package/chip/chip.stories.js +39 -13
  9. package/chip/index.d.ts +3 -1
  10. package/chip/index.js +3 -15
  11. package/chip/theme.d.ts +10 -0
  12. package/css/avatar-file-input.css +82 -0
  13. package/css/avatar.css +15 -0
  14. package/css/badge.css +23 -0
  15. package/css/button-group.css +22 -0
  16. package/css/button-list.css +61 -0
  17. package/css/button.css +335 -0
  18. package/css/calendar.css +215 -0
  19. package/css/checkbox-button.css +98 -0
  20. package/css/checkbox-input.css +24 -0
  21. package/css/checkbox.css +120 -0
  22. package/css/chip.css +490 -0
  23. package/css/color-radio-group.css +21 -0
  24. package/css/color-radio.css +33 -0
  25. package/css/component-structure-analyzer.css +31 -0
  26. package/css/date-picker.css +22 -0
  27. package/css/datetime-picker.css +11 -0
  28. package/css/dropdown.css +70 -0
  29. package/css/dropzone.css +85 -0
  30. package/css/error-message.css +3 -0
  31. package/css/file-input.css +80 -0
  32. package/css/flash-messages.css +28 -0
  33. package/css/form-component.css +7 -0
  34. package/css/icon.css +7 -0
  35. package/css/image-gallery.css +63 -0
  36. package/css/input-basic.css +18 -0
  37. package/css/input-with-popover.css +35 -0
  38. package/css/input.css +270 -0
  39. package/css/label.css +15 -0
  40. package/css/layout.css +47 -0
  41. package/css/list-item.css +29 -0
  42. package/css/loader.css +23 -0
  43. package/css/modal.css +65 -0
  44. package/css/multi-combobox.css +110 -0
  45. package/css/multi-select.css +27 -0
  46. package/css/pagination.css +93 -0
  47. package/css/paper.css +3 -0
  48. package/css/radio-group.css +169 -0
  49. package/css/radio.css +101 -0
  50. package/css/raster-image.css +20 -0
  51. package/css/select-base.css +50 -0
  52. package/css/tabs.css +131 -0
  53. package/css/text-link.css +12 -0
  54. package/css/textarea.css +115 -0
  55. package/css/time-picker.css +32 -0
  56. package/css/toggle.css +80 -0
  57. package/css/tooltip.css +7 -0
  58. package/css/typography.css +51 -0
  59. package/hooks/use-dropdown.d.ts +1 -1
  60. package/image-gallery/components/gallery.d.ts +2 -2
  61. package/image-gallery/components/gallery.js +12 -5
  62. package/image-gallery/image-gallery.d.ts +2 -0
  63. package/image-gallery/image-gallery.js +1 -1
  64. package/multi-combobox/_multi-combobox-base.js +2 -1
  65. package/multi-combobox/types.d.ts +3 -0
  66. package/multi-select/_multi-select-base.js +2 -1
  67. package/multi-select/types.d.ts +3 -2
  68. package/package.json +10 -6
  69. package/textarea/textarea.js +3 -3
  70. package/tooltip/use-tooltip.d.ts +1 -1
  71. package/tw-tokens/tw-z-index.d.ts +1 -0
  72. package/tw-tokens/tw-z-index.js +1 -0
  73. package/utils/storybook-config.d.ts +1 -1
  74. package/utils/storybook-config.js +1 -1
  75. package/utils/tailwind-config.js +1 -0
  76. package/select/theme.d.ts +0 -5
  77. package/select/theme.js +0 -2
@@ -0,0 +1,50 @@
1
+ .uxf-select-base {
2
+ &__button-text {
3
+ @apply truncate;
4
+
5
+ align-items: center;
6
+ cursor: default;
7
+ display: inline-flex;
8
+ flex-grow: 1;
9
+ height: 100%;
10
+ min-width: 0;
11
+ }
12
+
13
+ .uxf-input__element {
14
+ align-items: center;
15
+ display: flex;
16
+ min-width: 0;
17
+
18
+ &.is-empty {
19
+ @apply font-light;
20
+
21
+ :root .light & {
22
+ @apply text-gray-400;
23
+ }
24
+
25
+ :root .dark & {
26
+ @apply text-gray-400;
27
+ }
28
+ }
29
+ }
30
+
31
+ .uxf-input__element-text {
32
+ @apply truncate;
33
+ }
34
+
35
+ &.is-invalid {
36
+ .uxf-input__element.is-empty {
37
+ @apply text-error-300;
38
+ }
39
+ }
40
+
41
+ &__arrow-icon {
42
+ @apply w-3 h-5;
43
+
44
+ z-index: 1;
45
+
46
+ &.is-open {
47
+ @apply -scale-y-100;
48
+ }
49
+ }
50
+ }
package/css/tabs.css ADDED
@@ -0,0 +1,131 @@
1
+ .uxf-tabs {
2
+ @apply w-full;
3
+
4
+ &--grow {
5
+ .uxf-tabs__tab {
6
+ @apply grow;
7
+ }
8
+ }
9
+
10
+ &__tab-list__wrapper {
11
+ @apply w-full mb-6 overflow-auto;
12
+
13
+ &--default {
14
+ @apply relative before:absolute before:pointer-events-none before:bottom-0 before:w-full before:border-b-2;
15
+
16
+ :root .light & {
17
+ @apply before:border-b-gray-100;
18
+ }
19
+
20
+ :root .dark & {
21
+ @apply before:border-b-gray-800;
22
+ }
23
+ }
24
+
25
+ &--segmented {
26
+ @apply rounded-lg;
27
+
28
+ :root .light & {
29
+ @apply bg-gray-100;
30
+ }
31
+
32
+ :root .dark & {
33
+ @apply bg-gray-700;
34
+ }
35
+ }
36
+ }
37
+
38
+ &__tab-list {
39
+ @apply flex items-center text-base font-semibold overflow-x-auto whitespace-nowrap w-full;
40
+
41
+ scrollbar-width: none;
42
+
43
+ &::-webkit-scrollbar {
44
+ display: none;
45
+ }
46
+
47
+ &--default {
48
+ @apply py-1.5 px-1 space-x-2;
49
+ }
50
+
51
+ &--segmented {
52
+ @apply p-1 space-x-1;
53
+ }
54
+ }
55
+
56
+ &__tab {
57
+ @apply inline-flex text-center items-center justify-center px-2 py-2 whitespace-nowrap transition-colors
58
+ outline-none cursor-pointer is-disabled:pointer-events-none
59
+ focus-visible:ring-2 focus-visible:ring-offset-1 overflow-visible;
60
+
61
+ &--default {
62
+ @apply relative rounded-lg before:absolute before:bottom-[-6px] before:w-full before:border-b-2
63
+ before:opacity-0 before:transition;
64
+
65
+ :root .light & {
66
+ @apply text-lightMedium hover:bg-gray-100 focus-visible:ring-primary;
67
+ }
68
+
69
+ :root .dark & {
70
+ @apply text-darkMedium hover:bg-gray-800 focus-visible:ring-primary
71
+ focus-visible:ring-offset-gray-900;
72
+ }
73
+
74
+ &.is-active {
75
+ @apply before:opacity-100 ;
76
+
77
+ :root .light & {
78
+ @apply text-lightHigh before:border-b-primary hover:bg-transparent;
79
+ }
80
+
81
+ :root .dark & {
82
+ @apply text-darkHigh before:border-b-primary hover:bg-transparent;
83
+ }
84
+ }
85
+
86
+ &.is-disabled {
87
+ :root .light & {
88
+ @apply text-lightLow;
89
+ }
90
+
91
+ :root .dark & {
92
+ @apply text-darkLow;
93
+ }
94
+ }
95
+ }
96
+
97
+ &--segmented {
98
+ @apply rounded;
99
+
100
+ :root .light & {
101
+ @apply text-lightMedium bg-gray-100 hover:text-primary-600 hover:bg-primary-100
102
+ focus-visible:ring-primary focus-visible:ring-offset-gray-100;
103
+ }
104
+
105
+ :root .dark & {
106
+ @apply text-darkMedium bg-gray-700 hover:bg-gray-800 focus-visible:ring-primary
107
+ focus-visible:ring-offset-gray-700;
108
+ }
109
+
110
+ &.is-active {
111
+ :root .light & {
112
+ @apply text-white bg-primary;
113
+ }
114
+
115
+ :root .dark & {
116
+ @apply text-white bg-primary;
117
+ }
118
+ }
119
+
120
+ &.is-disabled {
121
+ :root .light & {
122
+ @apply text-gray-400;
123
+ }
124
+
125
+ :root .dark & {
126
+ @apply text-gray-500;
127
+ }
128
+ }
129
+ }
130
+ }
131
+ }
@@ -0,0 +1,12 @@
1
+ .uxf-text-link {
2
+ @apply underline transition outline-none relative before:absolute before:-inset-1
3
+ focus-visible:before:border-2 focus-visible:before:rounded-lg;
4
+
5
+ :root .light & {
6
+ @apply text-primary is-hoverable:text-primary-400 focus-visible:before:border-primary;
7
+ }
8
+
9
+ :root .dark & {
10
+ @apply text-primary is-hoverable:text-primary-400 focus-visible:before:border-primary;
11
+ }
12
+ }
@@ -0,0 +1,115 @@
1
+ .uxf-textarea {
2
+ :root .light & {
3
+ --bg-color: theme("colors.white");
4
+ --border-color: theme("colors.gray.200");
5
+ --color: theme("colors.gray.900");
6
+ }
7
+
8
+ :root .dark & {
9
+ --bg-color: theme("colors.gray.800");
10
+ --border-color: theme("colors.gray.700");
11
+ --color: theme("colors.gray.300");
12
+ }
13
+
14
+ &__wrapper {
15
+ background-color: var(--bg-color);
16
+ border-radius: theme("borderRadius.md");
17
+ border: 1px solid var(--border-color);
18
+ box-shadow: theme("boxShadow.sm");
19
+ color: var(--color);
20
+ padding: theme("spacing.2");
21
+ }
22
+
23
+ &__element {
24
+ appearance: none;
25
+ background-color: transparent;
26
+ outline: none;
27
+ overflow-y: hidden;
28
+ resize: none;
29
+ width: 100%;
30
+
31
+ &::placeholder {
32
+ color: theme("colors.gray.400");
33
+ }
34
+ }
35
+
36
+ &.is-focused {
37
+ :root .light &,
38
+ :root .dark & {
39
+ --border-color: theme("colors.primary.DEFAULT");
40
+ }
41
+
42
+ .uxf-textarea__wrapper {
43
+ @apply ring-2 ring-inset ring-[--border-color] ring-offset-0;
44
+ }
45
+ }
46
+
47
+ &.is-invalid {
48
+ :root .light &,
49
+ :root .dark & {
50
+ --border-color: var(--color);
51
+ --color: theme("colors.error.DEFAULT");
52
+ }
53
+ }
54
+
55
+ &.is-readonly {
56
+ cursor: text;
57
+ pointer-events: none;
58
+
59
+ :root .light & {
60
+ --bg-color: theme("colors.gray.300");
61
+ --border-color: theme("colors.gray.200");
62
+ }
63
+
64
+ :root .dark & {
65
+ --bg-color: theme("colors.gray.500");
66
+ --border-color: theme("colors.gray.700");
67
+ }
68
+
69
+ .uxf-textarea__wrapper {
70
+ @apply ring-0;
71
+ }
72
+ }
73
+
74
+ &.is-disabled {
75
+ cursor: not-allowed;
76
+
77
+ :root .light & {
78
+ --bg-color: theme("colors.gray.300");
79
+ }
80
+
81
+ :root .dark & {
82
+ --bg-color: theme("colors.gray.600");
83
+ }
84
+ }
85
+
86
+ &.is-readonly,
87
+ &.is-disabled {
88
+ .uxf-textarea__element {
89
+ cursor: inherit;
90
+ }
91
+ }
92
+
93
+ input:-webkit-autofill {
94
+ &,
95
+ &:hover,
96
+ &:focus {
97
+ appearance: none;
98
+ transition: background-color 5000s ease-in-out 0s !important;
99
+
100
+ :root .light & {
101
+ -webkit-box-shadow: inset 0 0 0 1000px theme("colors.white");
102
+ box-shadow: inset 0 0 0 1000px theme("colors.white");
103
+ background-color: theme("colors.white");
104
+ }
105
+
106
+ :root .dark & {
107
+ -webkit-text-fill-color: theme("colors.gray.300");
108
+ -webkit-box-shadow: inset 0 0 0 1000px theme("colors.gray.800");
109
+ box-shadow: inset 0 0 0 1000px theme("colors.gray.800");
110
+ background-color: theme("colors.gray.800");
111
+ caret-color: white;
112
+ }
113
+ }
114
+ }
115
+ }
@@ -0,0 +1,32 @@
1
+ .uxf-time-picker {
2
+ &__global {
3
+ @apply flex items-center justify-between px-4 w-[180px] mx-auto;
4
+
5
+ &__column {
6
+ @apply flex flex-col items-center shrink-0;
7
+
8
+ width: 48px;
9
+
10
+ & > :nth-child(1),
11
+ & > :nth-child(3) {
12
+ height: 24px
13
+ }
14
+ }
15
+ }
16
+
17
+ &__hours,
18
+ &__minutes {
19
+ @apply grid grid-cols-4 place-items-center gap-1 mx-auto;
20
+
21
+ text-align: center;
22
+ width: 200px;
23
+ }
24
+
25
+ :root .light & {
26
+ @apply text-gray-900;
27
+ }
28
+
29
+ :root .dark & {
30
+ @apply bg-gray-900 text-white;
31
+ }
32
+ }
package/css/toggle.css ADDED
@@ -0,0 +1,80 @@
1
+ .uxf-toggle {
2
+ @apply relative inline-flex shrink-0 h-6 w-12 items-center rounded-full p-0.5 outline-none ring-offset-2
3
+ focus-visible:ring-2 [&>*]:active:w-[30px];
4
+
5
+ &__wrapper {
6
+ @apply flex items-center justify-between space-x-4 p-4;
7
+
8
+ &--reversed {
9
+ @apply flex-row-reverse space-x-0;
10
+
11
+ .uxf-toggle__label {
12
+ @apply pr-4;
13
+ }
14
+ }
15
+ }
16
+
17
+ &__label {
18
+ @apply w-full;
19
+
20
+ :root .light & {
21
+ @apply text-lightMedium;
22
+ }
23
+
24
+ :root .dark & {
25
+ @apply text-darkMedium;
26
+ }
27
+ }
28
+
29
+ &__inner {
30
+ @apply inline-block h-5 w-5 transform rounded-full bg-white transition-all;
31
+ }
32
+
33
+ &.is-disabled {
34
+ @apply pointer-events-none;
35
+ }
36
+
37
+ &.is-selected {
38
+ @apply [&>*]:translate-x-6 [&>*]:active:translate-x-[14px];
39
+ }
40
+
41
+ :root .light & {
42
+ @apply bg-gray-200 focus-visible:ring-primary;
43
+
44
+ &__inner {
45
+ @apply bg-white;
46
+ }
47
+
48
+ &.is-selected {
49
+ @apply bg-primary;
50
+ }
51
+
52
+ &.is-disabled {
53
+ @apply bg-gray-100;
54
+
55
+ .uxf-toggle__inner {
56
+ @apply bg-gray-400;
57
+ }
58
+ }
59
+ }
60
+
61
+ :root .dark & {
62
+ @apply bg-gray-400 focus-visible:ring-primary focus-visible:ring-offset-gray-900;
63
+
64
+ &.is-selected {
65
+ @apply bg-primary;
66
+ }
67
+
68
+ &__inner {
69
+ @apply bg-gray-900;
70
+ }
71
+
72
+ &.is-disabled {
73
+ @apply bg-gray-700;
74
+
75
+ .uxf-toggle__inner {
76
+ @apply bg-gray-500;
77
+ }
78
+ }
79
+ }
80
+ }
@@ -0,0 +1,7 @@
1
+ .uxf-tooltip {
2
+ @apply w-max max-w-[calc(100vw-20px)] bg-lightHigh p-3 text-white rounded-lg z-tooltip;
3
+
4
+ &__arrow {
5
+ @apply bg-lightHigh rounded-sm z-tooltip;
6
+ }
7
+ }
@@ -0,0 +1,51 @@
1
+ .uxf-typo-h1 {
2
+ @apply text-desktopH1 font-bold;
3
+ }
4
+
5
+ .uxf-typo-h2 {
6
+ @apply text-desktopH2 font-bold;
7
+ }
8
+
9
+ .uxf-typo-h3 {
10
+ @apply text-desktopH3 font-bold;
11
+ }
12
+
13
+ .uxf-typo-h4 {
14
+ @apply text-desktopH4 font-bold;
15
+ }
16
+
17
+ .uxf-typo-h5 {
18
+ @apply text-desktopH5 font-bold;
19
+ }
20
+
21
+ .uxf-typo-h6 {
22
+ @apply text-desktopH6 font-bold;
23
+ }
24
+
25
+ .uxf-typo-body {
26
+ @apply text-body;
27
+ }
28
+
29
+ .uxf-typo-body2 {
30
+ @apply text-body2;
31
+ }
32
+
33
+ .uxf-typo-button {
34
+ @apply text-body font-bold;
35
+ }
36
+
37
+ .uxf-typo-caption {
38
+ @apply text-caption;
39
+ }
40
+
41
+ .uxf-typo-medium {
42
+ @apply text-medium font-medium;
43
+ }
44
+
45
+ .uxf-typo-medium2 {
46
+ @apply text-medium2 font-medium;
47
+ }
48
+
49
+ .uxf-typo-overline {
50
+ @apply text-overline font-bold;
51
+ }
@@ -10,8 +10,8 @@ export declare function useDropdown(placement: Placement, matchWidth?: boolean,
10
10
  context: {
11
11
  x: number;
12
12
  y: number;
13
- placement: Placement;
14
13
  strategy: Strategy;
14
+ placement: Placement;
15
15
  middlewareData: import("@floating-ui/react").MiddlewareData;
16
16
  update: () => void;
17
17
  isPositioned: boolean;
@@ -1,7 +1,8 @@
1
1
  import { FC } from "react";
2
2
  import { ImageGalleryImageProps } from "../types";
3
- interface GalleryProps {
3
+ export interface GalleryProps {
4
4
  closeButtonTitle?: string;
5
+ disableBackdropClose?: boolean;
5
6
  onClose: () => void;
6
7
  onNext: () => void;
7
8
  onPrevious: () => void;
@@ -9,4 +10,3 @@ interface GalleryProps {
9
10
  images: ImageGalleryImageProps[];
10
11
  }
11
12
  export declare const Gallery: FC<GalleryProps>;
12
- export {};
@@ -30,6 +30,7 @@ const react_1 = __importStar(require("react"));
30
30
  const close_button_1 = require("./close-button");
31
31
  const dot_1 = require("./dot");
32
32
  const arrow_button_1 = require("./arrow-button");
33
+ const react_swipeable_1 = require("react-swipeable");
33
34
  const Gallery = (props) => {
34
35
  var _a;
35
36
  (0, react_1.useEffect)(() => {
@@ -56,15 +57,21 @@ const Gallery = (props) => {
56
57
  }, []);
57
58
  const imageSrc = props.images[props.imageIndex].src;
58
59
  const customContent = props.images[props.imageIndex].customContent;
59
- return (react_1.default.createElement("div", { className: "uxf-image-gallery" },
60
+ const handlers = (0, react_swipeable_1.useSwipeable)({
61
+ onSwipedLeft: () => props.onNext(),
62
+ onSwipedRight: () => props.onPrevious(),
63
+ swipeDuration: 500,
64
+ });
65
+ return (react_1.default.createElement("div", { className: "uxf-image-gallery", role: "dialog", "aria-modal": true },
66
+ react_1.default.createElement("div", { "aria-hidden": true, className: "uxf-image-gallery__backdrop", onClick: !props.disableBackdropClose ? props.onClose : undefined }),
60
67
  react_1.default.createElement("div", { className: "uxf-image-gallery__close-button-wrapper" },
61
68
  react_1.default.createElement(close_button_1.CloseButton, { onClick: props.onClose, text: props.closeButtonTitle })),
62
- react_1.default.createElement("div", { className: "uxf-image-gallery__content" },
69
+ props.images.length > 1 && (react_1.default.createElement("div", { className: "uxf-image-gallery__buttons" },
70
+ react_1.default.createElement(arrow_button_1.ArrowButton, { onClick: props.onPrevious, type: "prev" }),
71
+ react_1.default.createElement(arrow_button_1.ArrowButton, { onClick: props.onNext, type: "next" }))),
72
+ react_1.default.createElement("div", { className: "uxf-image-gallery__content", ...handlers },
63
73
  react_1.default.createElement("div", { className: "uxf-image-gallery__inner" },
64
74
  react_1.default.createElement("img", { alt: "", className: "uxf-image-gallery__image", src: typeof imageSrc === "string" ? imageSrc : (_a = (0, resizer_1.resizerImageUrl)(imageSrc)) !== null && _a !== void 0 ? _a : "" }),
65
- props.images.length > 1 && (react_1.default.createElement("div", { className: "uxf-image-gallery__buttons" },
66
- react_1.default.createElement(arrow_button_1.ArrowButton, { onClick: props.onPrevious, type: "prev" }),
67
- react_1.default.createElement(arrow_button_1.ArrowButton, { onClick: props.onNext, type: "next" }))),
68
75
  react_1.default.createElement("div", { className: "uxf-image-gallery__custom-content" }, customContent))),
69
76
  props.images.length > 1 && (react_1.default.createElement("div", { className: "uxf-image-gallery__dots" }, props.images.map((image, index) => (react_1.default.createElement(dot_1.Dot, { key: (0, image_1.getImgUniqueIdentifier)(image.src) || index, active: index === props.imageIndex })))))));
70
77
  };
@@ -1,6 +1,8 @@
1
1
  import { FC, ReactNode } from "react";
2
+ import { GalleryProps } from "./components/gallery";
2
3
  export interface ImageGalleryProps {
3
4
  children: ReactNode;
4
5
  closeButtonTitle?: string;
6
+ disableBackdropClose?: GalleryProps["disableBackdropClose"];
5
7
  }
6
8
  export declare const ImageGallery: FC<ImageGalleryProps>;
@@ -48,7 +48,7 @@ const ImageGallery = (props) => {
48
48
  const contextValue = { registerImage, unregisterImage, openGallery };
49
49
  return (react_1.default.createElement(react_1.default.Fragment, null,
50
50
  react_1.default.createElement(context_1.ImageGalleryProvider, { value: contextValue }, props.children),
51
- typeof moduloImageIndex === "number" && (react_1.default.createElement(gallery_1.Gallery, { closeButtonTitle: props.closeButtonTitle, onClose: () => setImageIndex(null), onNext: onNext, onPrevious: onPrevious, imageIndex: moduloImageIndex, images: images }))));
51
+ typeof moduloImageIndex === "number" && (react_1.default.createElement(gallery_1.Gallery, { closeButtonTitle: props.closeButtonTitle, disableBackdropClose: props.disableBackdropClose, onClose: () => setImageIndex(null), onNext: onNext, onPrevious: onPrevious, imageIndex: moduloImageIndex, images: images }))));
52
52
  };
53
53
  exports.ImageGallery = ImageGallery;
54
54
  exports.ImageGallery.displayName = "UxfUiImageGallery";
@@ -91,13 +91,14 @@ exports._MultiComboboxBase = (0, react_2.forwardRef)((props, ref) => {
91
91
  : (_g = props.notFoundMessage) !== null && _g !== void 0 ? _g : "Nic nenalezeno";
92
92
  const withoutPopover = !props.withPopover;
93
93
  return (react_2.default.createElement(react_1.Combobox, { as: "div", by: "id", className: (0, cx_1.cx)(withoutPopover && "uxf-form-component", "uxf-multi-combobox", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.className), disabled: props.isDisabled || props.isReadOnly, multiple: true, onChange: handleComboboxValueChange, value: selectedOptions }, (renderProps) => {
94
+ var _a, _b;
94
95
  const inputElement = (react_2.default.createElement(react_2.default.Fragment, null,
95
96
  react_2.default.createElement(react_1.Combobox.Button, { "aria-invalid": props.isInvalid, "aria-describedby": props.errorId, as: "div", className: (0, cx_1.cx)("uxf-multi-combobox__button", (renderProps.open || input.focused) && classes_1.CLASSES.IS_FOCUSED, renderProps.disabled && classes_1.CLASSES.IS_DISABLED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isInvalid && classes_1.CLASSES.IS_INVALID, dropdown.placement === "bottom" && `${classes_1.CLASSES.IS_OPEN}--bottom`, dropdown.placement === "top" && `${classes_1.CLASSES.IS_OPEN}--top`, renderProps.open && classes_1.CLASSES.IS_OPEN), onBlur: input.onBlur, onFocus: input.onFocus, ref: stableRef },
96
97
  selectedOptions.map((item) => (react_2.default.createElement(chip_1.Chip, { className: "uxf-multi-combobox__input-chip", color: item.color, key: item.id, onClose: handleRemove(item.id), size: "large", suppressFocus: true }, item.label))),
97
98
  react_2.default.createElement(react_1.Combobox.Input, { autoComplete: "off", className: "uxf-multi-combobox__input", onChange: handleInputChange, onKeyDown: handleInputKeyDown, placeholder: props.placeholder, type: "text", value: query }),
98
99
  react_2.default.createElement(icon_1.Icon, { className: (0, cx_1.cx)("uxf-select-base__arrow-icon", (props.withPopover ? props.isPopoverOpen : renderProps.open) && classes_1.CLASSES.IS_OPEN), name: iconName })),
99
100
  renderProps.open && (react_2.default.createElement(react_3.FloatingPortal, null,
100
- react_2.default.createElement(react_1.Combobox.Options, { className: (0, cx_1.cx)("uxf-dropdown", dropdown.placement === "bottom" && "uxf-dropdown--bottom", dropdown.placement === "top" && "uxf-dropdown--top"), ref: dropdown.refs.setFloating, static: true, style: dropdown.floatingStyles }, filteredData.length > 0 ? (filteredData.map((option) => {
101
+ react_2.default.createElement(react_1.Combobox.Options, { className: (0, cx_1.cx)("uxf-dropdown", `uxf-dropdown--size-${(_a = props.size) !== null && _a !== void 0 ? _a : "default"}`, `uxf-dropdown--variant-${(_b = props.variant) !== null && _b !== void 0 ? _b : "default"}`, dropdown.placement === "bottom" && "uxf-dropdown--bottom", dropdown.placement === "top" && "uxf-dropdown--top"), ref: dropdown.refs.setFloating, static: true, style: dropdown.floatingStyles }, filteredData.length > 0 ? (filteredData.map((option) => {
101
102
  var _a, _b, _c, _d;
102
103
  const label = (_b = (_a = props.renderOption) === null || _a === void 0 ? void 0 : _a.call(props, option)) !== null && _b !== void 0 ? _b : option.label;
103
104
  return (react_2.default.createElement(react_1.Combobox.Option, { className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item", optionState.active && withoutPopover && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED), key: (_d = (_c = props.keyExtractor) === null || _c === void 0 ? void 0 : _c.call(props, option)) !== null && _d !== void 0 ? _d : option.id, value: option }, (optionState) => (react_2.default.createElement(react_2.default.Fragment, null, props.withCheckboxes ? (react_2.default.createElement(checkbox_input_1.CheckboxInput, { isDisabled: optionState.disabled, isFocused: optionState.active, label: label, onChange: handleCheckboxChange(option.id), value: optionState.selected })) : (label)))));
@@ -3,6 +3,7 @@ import { ReactNode } from "react";
3
3
  import { ChipColor } from "../chip";
4
4
  import { IconsSet } from "../icon/theme";
5
5
  import { FormControlProps } from "../types";
6
+ import { InputGroupSizes, InputGroupVariants } from "@uxf/ui/input/theme";
6
7
  export type MultiComboboxValueId = number | string;
7
8
  export type MultiComboboxValue<ValueId = MultiComboboxValueId> = {
8
9
  id: ValueId;
@@ -30,6 +31,8 @@ export interface MultiComboboxProps<ValueId = MultiComboboxValueId, Option = Mul
30
31
  options?: Option[];
31
32
  placeholder?: string;
32
33
  renderOption?: (option: Option) => ReactNode;
34
+ size?: keyof InputGroupSizes;
35
+ variant?: keyof InputGroupVariants;
33
36
  withCheckboxes?: boolean;
34
37
  withPopover?: boolean;
35
38
  }
@@ -55,6 +55,7 @@ exports._MultiSelectBase = (0, react_2.forwardRef)((props, ref) => {
55
55
  };
56
56
  const withoutPopover = !props.withPopover;
57
57
  return (react_2.default.createElement(react_1.Listbox, { as: "div", className: (0, cx_1.cx)(withoutPopover && "uxf-form-component", "uxf-multi-combobox", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.className), disabled: props.isDisabled || props.isReadOnly, multiple: true, onChange: handleSelectValueChange, value: selectedOptions }, (renderProps) => {
58
+ var _a, _b;
58
59
  const inputElement = (react_2.default.createElement(react_2.default.Fragment, null,
59
60
  react_2.default.createElement(react_1.Listbox.Button, { "aria-invalid": props.isInvalid, "aria-describedby": props.errorId, as: "div", className: (0, cx_1.cx)("uxf-multi-combobox__button", (renderProps.open || input.focused) && classes_1.CLASSES.IS_FOCUSED, renderProps.disabled && classes_1.CLASSES.IS_DISABLED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isInvalid && classes_1.CLASSES.IS_INVALID, dropdown.placement === "bottom" && `${classes_1.CLASSES.IS_OPEN}--bottom`, dropdown.placement === "top" && `${classes_1.CLASSES.IS_OPEN}--top`, renderProps.open && classes_1.CLASSES.IS_OPEN), onBlur: input.onBlur, onFocus: input.onFocus, tabIndex: props.isDisabled || props.isReadOnly ? undefined : 0, ref: stableRef },
60
61
  react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-multi-select__input", selectedOptions.length === 0 && "uxf-multi-select__input--is-empty") }, selectedOptions.length === 0
@@ -62,7 +63,7 @@ exports._MultiSelectBase = (0, react_2.forwardRef)((props, ref) => {
62
63
  : selectedOptions.map((item) => (react_2.default.createElement(chip_1.Chip, { className: "uxf-multi-combobox__input-chip", color: item.color, key: item.id, onClose: handleRemove(item.id), size: "large", suppressFocus: true }, item.label)))),
63
64
  react_2.default.createElement(icon_1.Icon, { className: (0, cx_1.cx)("uxf-select-base__arrow-icon", renderProps.open && classes_1.CLASSES.IS_OPEN), name: iconName })),
64
65
  renderProps.open && (react_2.default.createElement(react_3.FloatingPortal, null,
65
- react_2.default.createElement(react_1.Listbox.Options, { className: (0, cx_1.cx)("uxf-dropdown", dropdown.placement === "bottom" && "uxf-dropdown--bottom", dropdown.placement === "top" && "uxf-dropdown--top"), ref: dropdown.refs.setFloating, static: true, style: dropdown.floatingStyles }, filteredOptions.map((option) => {
66
+ react_2.default.createElement(react_1.Listbox.Options, { className: (0, cx_1.cx)("uxf-dropdown", `uxf-dropdown--size-${(_a = props.size) !== null && _a !== void 0 ? _a : "default"}`, `uxf-dropdown--variant-${(_b = props.variant) !== null && _b !== void 0 ? _b : "default"}`, dropdown.placement === "bottom" && "uxf-dropdown--bottom", dropdown.placement === "top" && "uxf-dropdown--top"), ref: dropdown.refs.setFloating, static: true, style: dropdown.floatingStyles }, filteredOptions.map((option) => {
66
67
  var _a;
67
68
  const optionKey = (_a = props.keyExtractor) === null || _a === void 0 ? void 0 : _a.call(props, option);
68
69
  return (react_2.default.createElement(react_1.Listbox.Option, { className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item uxf-multi-select__dropdown-item", optionState.active && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED), key: optionKey !== null && optionKey !== void 0 ? optionKey : option.id, value: option }, optionKey !== null && optionKey !== void 0 ? optionKey : option.label));
@@ -2,8 +2,8 @@ import { Placement, Strategy } from "@floating-ui/react";
2
2
  import { ReactNode } from "react";
3
3
  import { ChipColor } from "../chip";
4
4
  import { IconsSet } from "../icon/theme";
5
- import { SelectSizes } from "../select/theme";
6
5
  import { FormControlProps } from "../types";
6
+ import { InputGroupSizes, InputGroupVariants } from "@uxf/ui/input/theme";
7
7
  export type MultiSelectValueId = number | string;
8
8
  export type MultiSelectOption<T = MultiSelectValueId> = {
9
9
  color?: ChipColor;
@@ -25,7 +25,8 @@ export interface MultiSelectProps<ValueId = MultiSelectValueId, Option = MultiSe
25
25
  options: Option[];
26
26
  placeholder?: string;
27
27
  renderOption?: (option: Option) => ReactNode;
28
- size?: keyof SelectSizes;
28
+ size?: keyof InputGroupSizes;
29
+ variant?: keyof InputGroupVariants;
29
30
  withPopover?: boolean;
30
31
  }
31
32
  export type MultiSelectTypeRef = HTMLDivElement;