@uxf/ui 1.0.0-beta.81 → 1.0.0-beta.83

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 (48) hide show
  1. package/avatar/index.d.ts +1 -1
  2. package/avatar/index.js +15 -3
  3. package/badge/index.d.ts +1 -1
  4. package/badge/index.js +15 -3
  5. package/chip/chip.d.ts +4 -1
  6. package/chip/chip.js +8 -3
  7. package/chip/chip.stories.d.ts +8 -1
  8. package/chip/chip.stories.js +16 -6
  9. package/chip/index.d.ts +1 -1
  10. package/chip/index.js +15 -3
  11. package/chip/theme.d.ts +12 -3
  12. package/combobox/combobox.d.ts +0 -1
  13. package/combobox/combobox.js +3 -5
  14. package/css/button.css +13 -12
  15. package/css/button.old.css +9 -9
  16. package/css/chip.css +144 -10
  17. package/css/chip.old.css +37 -0
  18. package/css/combobox.css +6 -2
  19. package/css/combobox.old.css +102 -0
  20. package/css/dropdown.css +1 -1
  21. package/css/dropdown.old.css +24 -0
  22. package/css/input.css +17 -11
  23. package/css/input.old.css +193 -0
  24. package/css/pagination.css +4 -3
  25. package/css/select.css +6 -2
  26. package/css/select.old.css +66 -0
  27. package/hooks/use-dropdown.js +3 -1
  28. package/input/input.stories.d.ts +1 -0
  29. package/input/input.stories.js +14 -4
  30. package/input/theme.d.ts +1 -0
  31. package/list-item/index.d.ts +1 -1
  32. package/list-item/index.js +15 -3
  33. package/package.json +1 -1
  34. package/select/select.d.ts +0 -1
  35. package/select/select.js +3 -5
  36. package/tabs/index.d.ts +1 -1
  37. package/tabs/index.js +15 -3
  38. package/text-link/index.d.ts +1 -1
  39. package/text-link/index.js +15 -3
  40. package/utils/storybook-config.d.ts +8 -1
  41. package/utils/storybook-config.js +6 -1
  42. package/checkbox-input/checkbox-input.d.ts +0 -2
  43. package/checkbox-input/checkbox-input.js +0 -12
  44. package/checkbox-input/checkbox-input.stories.d.ts +0 -7
  45. package/checkbox-input/checkbox-input.stories.js +0 -17
  46. package/checkbox-input/index.d.ts +0 -1
  47. package/checkbox-input/index.js +0 -17
  48. package/css/checkbox-input.css +0 -3
@@ -0,0 +1,102 @@
1
+ .uxf-combobox {
2
+ @apply relative;
3
+
4
+ &__button {
5
+ @apply relative flex h-12 w-full cursor-default flex-row items-center rounded-lg py-3 px-4 text-left
6
+ outline-none before:absolute before:inset-0 before:pointer-events-none before:border before:rounded-lg;
7
+
8
+ :root .light & {
9
+ @apply bg-gray-100 text-lightHigh before:border-gray-200;
10
+
11
+ .is-empty {
12
+ @apply text-lightLow;
13
+ }
14
+ }
15
+
16
+ :root .dark & {
17
+ @apply bg-gray-800 text-darkHigh before:border-gray-700;
18
+
19
+ .is-empty {
20
+ @apply text-darkLow;
21
+ }
22
+ }
23
+
24
+ &.is-focused {
25
+ @apply ring-2;
26
+
27
+ :root .light & {
28
+ @apply before:border-none ring-primary-500;
29
+ }
30
+
31
+ :root .dark & {
32
+ @apply ring-primary-500;
33
+ }
34
+ }
35
+
36
+ &.is-invalid {
37
+ @apply ring-1;
38
+
39
+ :root .light & {
40
+ @apply ring-error-500 text-error-500;
41
+
42
+ .uxf-combobox__input {
43
+ @apply placeholder:text-error-500;
44
+ }
45
+ }
46
+
47
+ :root .dark & {
48
+ @apply ring-error-500 text-error-500;
49
+
50
+ .uxf-combobox__input {
51
+ @apply placeholder:text-error-500;
52
+ }
53
+ }
54
+ }
55
+ }
56
+
57
+ &__input {
58
+ @apply flex-grow bg-inherit focus-visible:ring-0 focus-visible:border-0 focus-visible:outline-none;
59
+
60
+ :root .light & {
61
+ @apply placeholder:text-lightLow;
62
+ }
63
+
64
+ :root .dark & {
65
+ @apply placeholder:text-darkLow;
66
+ }
67
+ }
68
+
69
+ &__button-icon {
70
+ @apply transition duration-300;
71
+
72
+ :root .light & {
73
+ @apply text-lightMedium;
74
+ }
75
+
76
+ :root .dark & {
77
+ @apply text-darkMedium;
78
+ }
79
+
80
+ &.is-open {
81
+ @apply -scale-y-100;
82
+ }
83
+ }
84
+
85
+ input:-webkit-autofill {
86
+ &,
87
+ &:hover,
88
+ &:focus {
89
+ margin: 1px 0;
90
+
91
+ :root .dark & {
92
+ -webkit-box-shadow: inset 0 0 0 1000px theme("colors.gray.800");
93
+ caret-color: white;
94
+ -webkit-text-fill-color: theme("colors.gray.300");
95
+ }
96
+
97
+ :root .light & {
98
+ -webkit-box-shadow: inset 0 0 0 1000px theme("colors.gray.100");
99
+ }
100
+ }
101
+ }
102
+ }
package/css/dropdown.css CHANGED
@@ -11,7 +11,7 @@
11
11
  }
12
12
 
13
13
  &__item {
14
- @apply relative cursor-default select-none py-3 px-4 text-gray-800;
14
+ @apply relative cursor-default select-none py-2 px-4 text-gray-800;
15
15
 
16
16
  &.is-active {
17
17
  @apply bg-primary-500 text-white;
@@ -0,0 +1,24 @@
1
+ .uxf-dropdown {
2
+ @apply absolute z-10 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black
3
+ ring-opacity-5 focus:outline-none sm:text-sm;
4
+
5
+ &--bottom {
6
+ @apply mt-1;
7
+ }
8
+
9
+ &--top {
10
+ @apply -translate-y-1;
11
+ }
12
+
13
+ &__item {
14
+ @apply relative cursor-default select-none py-3 px-4 text-gray-800;
15
+
16
+ &.is-active {
17
+ @apply bg-primary-500 text-white;
18
+ }
19
+ }
20
+
21
+ &__items {
22
+ @apply absolute flex flex-col border border-black bg-white;
23
+ }
24
+ }
package/css/input.css CHANGED
@@ -1,8 +1,8 @@
1
1
  .uxf-input {
2
- @apply rounded-lg text-base;
2
+ @apply rounded-md bg-white;
3
3
 
4
4
  :root .light & {
5
- @apply bg-gray-100 text-gray-900;
5
+ @apply bg-white text-gray-900;
6
6
  }
7
7
 
8
8
  :root .dark & {
@@ -10,7 +10,7 @@
10
10
  }
11
11
 
12
12
  &__element {
13
- @apply bg-transparent outline-none;
13
+ @apply bg-transparent outline-none placeholder:font-light;
14
14
 
15
15
  :root .light & {
16
16
  @apply placeholder:text-gray-400;
@@ -31,7 +31,7 @@
31
31
 
32
32
  &__left-addon,
33
33
  &__right-addon {
34
- @apply border px-2;
34
+ @apply border px-2 bg-gray-100;
35
35
 
36
36
  :root .light & {
37
37
  @apply border-gray-200;
@@ -43,15 +43,15 @@
43
43
  }
44
44
 
45
45
  &__left-addon {
46
- @apply rounded-l-lg border-r-0;
46
+ @apply rounded-l-md border-r-0;
47
47
  }
48
48
 
49
49
  &__right-addon {
50
- @apply rounded-r-lg border-l-0;
50
+ @apply rounded-r-md border-l-0;
51
51
  }
52
52
 
53
53
  &__wrapper {
54
- @apply rounded-lg border px-4 text-base;
54
+ @apply rounded-md border px-4;
55
55
 
56
56
  :root .light & {
57
57
  @apply border-gray-200;
@@ -62,15 +62,21 @@
62
62
  }
63
63
  }
64
64
 
65
+ &--size-small {
66
+ .uxf-input__wrapper {
67
+ @apply h-8 text-sm;
68
+ }
69
+ }
70
+
65
71
  &--size-default {
66
72
  .uxf-input__wrapper {
67
- @apply h-12;
73
+ @apply h-9 text-base;
68
74
  }
69
75
  }
70
76
 
71
77
  &--size-large {
72
78
  .uxf-input__wrapper {
73
- @apply h-14 text-lg;
79
+ @apply h-10 text-lg;
74
80
  }
75
81
  }
76
82
 
@@ -104,11 +110,11 @@
104
110
  @apply cursor-not-allowed;
105
111
 
106
112
  :root .light & {
107
- @apply bg-gray-300;
113
+ @apply bg-gray-100;
108
114
  }
109
115
 
110
116
  :root .dark & {
111
- @apply bg-gray-600;
117
+ @apply bg-gray-800;
112
118
  }
113
119
 
114
120
  .uxf-input__element {
@@ -0,0 +1,193 @@
1
+ .uxf-input {
2
+ @apply rounded-lg text-base;
3
+
4
+ :root .light & {
5
+ @apply bg-gray-100 text-gray-900;
6
+ }
7
+
8
+ :root .dark & {
9
+ @apply bg-gray-800 text-gray-300;
10
+ }
11
+
12
+ &__element {
13
+ @apply bg-transparent outline-none;
14
+
15
+ :root .light & {
16
+ @apply placeholder:text-gray-400;
17
+ }
18
+
19
+ :root .dark & {
20
+ @apply placeholder:text-gray-400;
21
+ }
22
+ }
23
+
24
+ &__left-element {
25
+ @apply mr-2;
26
+ }
27
+
28
+ &__right-element {
29
+ @apply ml-2;
30
+ }
31
+
32
+ &__left-addon,
33
+ &__right-addon {
34
+ @apply border px-2;
35
+
36
+ :root .light & {
37
+ @apply border-gray-200;
38
+ }
39
+
40
+ :root .dark & {
41
+ @apply border-gray-700;
42
+ }
43
+ }
44
+
45
+ &__left-addon {
46
+ @apply rounded-l-lg border-r-0;
47
+ }
48
+
49
+ &__right-addon {
50
+ @apply rounded-r-lg border-l-0;
51
+ }
52
+
53
+ &__wrapper {
54
+ @apply rounded-lg border px-4 text-base;
55
+
56
+ :root .light & {
57
+ @apply border-gray-200;
58
+ }
59
+
60
+ :root .dark & {
61
+ @apply border-gray-700;
62
+ }
63
+ }
64
+
65
+ &--size-default {
66
+ .uxf-input__wrapper {
67
+ @apply h-12;
68
+ }
69
+ }
70
+
71
+ &--size-large {
72
+ .uxf-input__wrapper {
73
+ @apply h-14 text-lg;
74
+ }
75
+ }
76
+
77
+ &--has-right-addon {
78
+ .uxf-input__wrapper {
79
+ @apply rounded-r-none;
80
+ }
81
+ }
82
+
83
+ &--has-left-addon {
84
+ .uxf-input__wrapper {
85
+ @apply rounded-l-none;
86
+ }
87
+ }
88
+
89
+ &.is-focused {
90
+ .uxf-input__wrapper {
91
+ @apply ring-1 ring-inset ring-offset-0;
92
+
93
+ :root .light & {
94
+ @apply border-primary-500 ring-primary-500;
95
+ }
96
+
97
+ :root .dark & {
98
+ @apply border-primary-500 ring-primary-500;
99
+ }
100
+ }
101
+ }
102
+
103
+ &.is-disabled {
104
+ @apply cursor-not-allowed;
105
+
106
+ :root .light & {
107
+ @apply bg-gray-300;
108
+ }
109
+
110
+ :root .dark & {
111
+ @apply bg-gray-600;
112
+ }
113
+
114
+ .uxf-input__element {
115
+ @apply cursor-not-allowed;
116
+ }
117
+ }
118
+
119
+ &.is-readonly {
120
+ @apply cursor-text;
121
+
122
+ .uxf-input__element {
123
+ @apply cursor-text;
124
+ }
125
+
126
+ .uxf-input__wrapper {
127
+ @apply ring-0;
128
+ }
129
+
130
+ .uxf-input__wrapper,
131
+ .uxf-input__left-addon,
132
+ .uxf-input__right-addon {
133
+ :root .light & {
134
+ @apply border-gray-300;
135
+ }
136
+
137
+ :root .dark & {
138
+ @apply border-gray-500;
139
+ }
140
+ }
141
+ }
142
+
143
+ &.is-invalid {
144
+ &.is-focused {
145
+ .uxf-input__wrapper {
146
+ :root .light & {
147
+ @apply ring-error-500 border-error-500;
148
+ }
149
+
150
+ :root .dark & {
151
+ @apply ring-error-500 border-error-500;
152
+ }
153
+ }
154
+ }
155
+
156
+ .uxf-input__wrapper {
157
+ @apply border-error-500 placeholder:text-error-300;
158
+
159
+ .uxf-input__left-element,
160
+ .uxf-input__right-element {
161
+ @apply text-error-500;
162
+ }
163
+
164
+ .uxf-input__element {
165
+ :root .light & {
166
+ @apply border-gray-300 text-error-500;
167
+ }
168
+
169
+ :root .dark & {
170
+ @apply border-gray-500 text-error-500;
171
+ }
172
+ }
173
+ }
174
+ }
175
+
176
+ input:-webkit-autofill {
177
+ &,
178
+ &:hover,
179
+ &:focus {
180
+ margin: 1px 0;
181
+
182
+ :root .dark & {
183
+ -webkit-box-shadow: inset 0 0 0 1000px theme("colors.gray.800");
184
+ caret-color: white;
185
+ -webkit-text-fill-color: theme("colors.gray.300");
186
+ }
187
+
188
+ :root .light & {
189
+ -webkit-box-shadow: inset 0 0 0 1000px theme("colors.gray.100");
190
+ }
191
+ }
192
+ }
193
+ }
@@ -2,7 +2,8 @@
2
2
  @apply isolate inline-flex rounded-md -space-x-px;
3
3
 
4
4
  &__button {
5
- @apply relative inline-flex items-center border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50 focus:z-10 cursor-pointer h-10;
5
+ @apply relative inline-flex items-center border border-gray-300 bg-white px-4 py-2
6
+ text-sm font-medium text-gray-500 hover:bg-gray-50 focus:z-10 cursor-pointer h-10;
6
7
 
7
8
  &.is-selected {
8
9
  @apply z-10 bg-indigo-50 border border-primary-500 text-primary-600;
@@ -21,7 +22,7 @@
21
22
  }
22
23
 
23
24
  &.is-ellipsis {
24
- @apply text-neutral-300 hover:bg-white pointer-events-none
25
+ @apply text-neutral-300 hover:bg-white pointer-events-none;
25
26
  }
26
27
  }
27
- }
28
+ }
package/css/select.css CHANGED
@@ -2,12 +2,16 @@
2
2
  @apply relative;
3
3
 
4
4
  &__button {
5
- @apply relative flex h-12 w-full cursor-default flex-row items-center rounded-lg py-3 px-4 text-left
5
+ @apply relative flex h-9 w-full cursor-default flex-row items-center rounded-lg py-3 px-4 text-left
6
6
  outline-none focus-visible:ring-2 before:absolute before:inset-0 before:pointer-events-none before:border
7
7
  before:rounded-lg;
8
8
 
9
+ .uxf-icon {
10
+ @apply h-4;
11
+ }
12
+
9
13
  :root .light & {
10
- @apply bg-gray-100 text-lightHigh before:border-gray-200 focus-visible:before:border-none
14
+ @apply bg-white text-lightHigh before:border-gray-200 focus-visible:before:border-none
11
15
  focus-visible:ring-primary-500;
12
16
 
13
17
  .is-empty {
@@ -0,0 +1,66 @@
1
+ .uxf-select {
2
+ @apply relative;
3
+
4
+ &__button {
5
+ @apply relative flex h-12 w-full cursor-default flex-row items-center rounded-lg py-3 px-4 text-left
6
+ outline-none focus-visible:ring-2 before:absolute before:inset-0 before:pointer-events-none before:border
7
+ before:rounded-lg;
8
+
9
+ :root .light & {
10
+ @apply bg-gray-100 text-lightHigh before:border-gray-200 focus-visible:before:border-none
11
+ focus-visible:ring-primary-500;
12
+
13
+ .is-empty {
14
+ @apply text-lightLow;
15
+ }
16
+ }
17
+
18
+ :root .dark & {
19
+ @apply bg-gray-800 text-darkHigh before:border-gray-700 focus-visible:ring-primary-500;
20
+
21
+ .is-empty {
22
+ @apply text-darkLow;
23
+ }
24
+ }
25
+
26
+ &.is-invalid {
27
+ @apply ring-1;
28
+
29
+ :root .light & {
30
+ @apply ring-error-500 text-error-500;
31
+
32
+ .is-empty {
33
+ @apply text-error-500;
34
+ }
35
+ }
36
+
37
+ :root .dark & {
38
+ @apply ring-error-500 text-error-500;
39
+
40
+ .is-empty {
41
+ @apply text-error-500;
42
+ }
43
+ }
44
+ }
45
+ }
46
+
47
+ &__button-text {
48
+ @apply flex-grow;
49
+ }
50
+
51
+ &__button-icon {
52
+ @apply transition duration-300;
53
+
54
+ :root .light & {
55
+ @apply text-lightMedium;
56
+ }
57
+
58
+ :root .dark & {
59
+ @apply text-darkMedium;
60
+ }
61
+
62
+ &.is-open {
63
+ @apply -scale-y-100;
64
+ }
65
+ }
66
+ }
@@ -13,7 +13,9 @@ function useDropdown(placement, matchWidth = false) {
13
13
  Object.assign(elements.floating.style, {
14
14
  left: x + "px",
15
15
  maxHeight: Math.max(50, availableHeight) + "px",
16
- maxWidth: matchWidth ? availableWidth + "px" : undefined,
16
+ maxWidth: matchWidth
17
+ ? Math.min(availableWidth, elements.reference.getBoundingClientRect().width) + "px"
18
+ : availableWidth,
17
19
  position: strategy,
18
20
  top: y + "px",
19
21
  });
@@ -11,4 +11,5 @@ declare const _default: {
11
11
  };
12
12
  export default _default;
13
13
  export declare function Default(): JSX.Element;
14
+ export declare function Sizes(): JSX.Element;
14
15
  export declare function ComponentStructure(): JSX.Element;
@@ -26,11 +26,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.ComponentStructure = exports.Default = void 0;
29
+ exports.ComponentStructure = exports.Sizes = exports.Default = void 0;
30
30
  const react_1 = __importStar(require("react"));
31
31
  const component_structure_analyzer_1 = __importDefault(require("@uxf/ui/utils/component-structure-analyzer"));
32
32
  const action_1 = require("@uxf/ui/utils/action");
33
33
  const input_1 = require("@uxf/ui/input");
34
+ const storybook_config_1 = require("../utils/storybook-config");
34
35
  exports.default = {
35
36
  title: "UI/Input",
36
37
  component: input_1.Input,
@@ -61,15 +62,24 @@ function Default() {
61
62
  react_1.default.createElement(input_1.Input, null,
62
63
  react_1.default.createElement(input_1.Input.Element, { value: value, onChange: (0, action_1.action)("onChange", onChange), placeholder: "Disabled", isInvalid: isInvalid, isDisabled: true })),
63
64
  react_1.default.createElement(input_1.Input, null,
64
- react_1.default.createElement(input_1.Input.Element, { value: value, onChange: (0, action_1.action)("onChange", onChange), placeholder: "Read Only", isInvalid: isInvalid, isReadOnly: true })),
65
- react_1.default.createElement(input_1.Input, { size: "large" },
66
- react_1.default.createElement(input_1.Input.Element, { value: value, onChange: (0, action_1.action)("onChange", onChange), placeholder: "Size large", isInvalid: isInvalid }))));
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 }))));
67
66
  return (react_1.default.createElement(react_1.default.Fragment, null,
68
67
  react_1.default.createElement("input", { type: "checkbox", checked: isInvalid, onChange: (e) => setInvalid(e.target.checked) }),
69
68
  react_1.default.createElement("div", { className: "light space-y-2 p-20" }, storyInputs),
70
69
  react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20" }, storyInputs)));
71
70
  }
72
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;
73
83
  function ComponentStructure() {
74
84
  const [value, onChange] = (0, react_1.useState)("");
75
85
  return (react_1.default.createElement(component_structure_analyzer_1.default, null,
package/input/theme.d.ts CHANGED
@@ -2,6 +2,7 @@ export interface InputGroupVariants {
2
2
  default: true;
3
3
  }
4
4
  export interface InputGroupSizes {
5
+ small: true;
5
6
  default: true;
6
7
  large: true;
7
8
  }
@@ -1 +1 @@
1
- export { ListItem } from "./list-item";
1
+ export * from "./list-item";
@@ -1,5 +1,17 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ListItem = void 0;
4
- var list_item_1 = require("./list-item");
5
- Object.defineProperty(exports, "ListItem", { enumerable: true, get: function () { return list_item_1.ListItem; } });
17
+ __exportStar(require("./list-item"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/ui",
3
- "version": "1.0.0-beta.81",
3
+ "version": "1.0.0-beta.83",
4
4
  "description": "",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -14,7 +14,6 @@ export interface SelectProps<Value = SelectValue, Option = SelectOption<Value>>
14
14
  helperText?: ReactNode;
15
15
  hiddenLabel?: boolean;
16
16
  iconName?: keyof IconsSet;
17
- iconSize?: number;
18
17
  id?: string;
19
18
  keyExtractor?: (option: Option) => string | number;
20
19
  label?: ReactNode;
package/select/select.js CHANGED
@@ -35,7 +35,7 @@ const use_dropdown_1 = require("../hooks/use-dropdown");
35
35
  const icon_1 = require("../icon");
36
36
  const label_1 = require("../label");
37
37
  exports.Select = (0, forwardRef_1.forwardRef)("Select", (props, ref) => {
38
- var _a, _b, _c, _d;
38
+ var _a, _b, _c;
39
39
  const generatedId = (0, react_2.useId)();
40
40
  const id = (_a = props.id) !== null && _a !== void 0 ? _a : generatedId;
41
41
  const selectedOption = props.options.find((option) => option.id === props.value);
@@ -44,14 +44,12 @@ exports.Select = (0, forwardRef_1.forwardRef)("Select", (props, ref) => {
44
44
  const input = (0, useInputFocus_1.useInputFocus)(innerRef, props.onBlur, props.onFocus);
45
45
  const dropdown = (0, use_dropdown_1.useDropdown)((_b = props.dropdownPlacement) !== null && _b !== void 0 ? _b : "bottom", true);
46
46
  const stableRef = (0, react_2.useMemo)(() => (0, composeRefs_1.composeRefs)(innerRef, ref, dropdown.reference), [ref, dropdown.reference]);
47
- const getIconClassName = (open) => (0, cx_1.cx)("uxf-select__button-icon", open && "is-open");
48
- const iconName = (_c = props.iconName) !== null && _c !== void 0 ? _c : "caretDown";
49
- const iconSize = (_d = props.iconSize) !== null && _d !== void 0 ? _d : 24;
47
+ const iconName = (_c = props.iconName) !== null && _c !== void 0 ? _c : "chevronDown";
50
48
  return (react_2.default.createElement(react_1.Listbox, { as: "div", className: (0, cx_1.cx)("uxf-select", 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), onChange: (v) => { var _a; return (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, v.id); }, value: selectedOption, disabled: props.isDisabled || props.isReadOnly }, (renderProps) => (react_2.default.createElement(react_2.default.Fragment, null,
51
49
  react_2.default.createElement(react_1.Listbox.Label, { as: label_1.Label, isHidden: props.hiddenLabel, onClick: props.isDisabled || props.isReadOnly ? undefined : input.focus }, props.label),
52
50
  react_2.default.createElement(react_1.Listbox.Button, { as: "div", className: (0, cx_1.cx)("uxf-select__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" && "is-open--bottom", dropdown.placement === "top" && "is-open--top", renderProps.open && "is-open"), onBlur: input.onBlur, onFocus: input.onFocus, tabIndex: props.isDisabled || props.isReadOnly ? undefined : 0, ref: stableRef, "aria-invalid": props.isInvalid, "aria-describedby": errorId },
53
51
  react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-select__button-text", !(selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) && "is-empty") }, (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) || props.placeholder),
54
- react_2.default.createElement(icon_1.Icon, { className: getIconClassName(renderProps.open), name: iconName, size: iconSize })),
52
+ react_2.default.createElement(icon_1.Icon, { className: (0, cx_1.cx)("uxf-select__button-icon", renderProps.open && "is-open"), name: iconName })),
55
53
  react_2.default.createElement(react_1.Listbox.Options, { ref: dropdown.floating, className: (0, cx_1.cx)("uxf-dropdown", dropdown.placement === "bottom" && "uxf-dropdown--bottom", dropdown.placement === "top" && "uxf-dropdown--top") }, props.options.map((option) => {
56
54
  var _a, _b, _c, _d;
57
55
  return (react_2.default.createElement(react_1.Listbox.Option, { key: (_b = (_a = props.keyExtractor) === null || _a === void 0 ? void 0 : _a.call(props, option)) !== null && _b !== void 0 ? _b : option.id, value: option, className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item", optionState.active && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED) }, (_d = (_c = props.renderOption) === null || _c === void 0 ? void 0 : _c.call(props, option)) !== null && _d !== void 0 ? _d : option.label));
package/tabs/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { Tabs } from "./tabs";
1
+ export * from "./tabs";