@uxf/ui 1.0.0-beta.57 → 1.0.0-beta.59

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 (141) hide show
  1. package/_private-utils/get-provider-config.js +2 -1
  2. package/avatar-file-input/avatar-file-input.d.ts +2 -2
  3. package/avatar-file-input/avatar-file-input.js +8 -8
  4. package/avatar-file-input/index.d.ts +1 -1
  5. package/avatar-file-input/index.js +14 -5
  6. package/button/button.stories.js +8 -5
  7. package/button/theme.d.ts +2 -1
  8. package/checkbox/index.d.ts +1 -1
  9. package/checkbox/index.js +15 -3
  10. package/checkbox-input/checkbox-input.d.ts +2 -3
  11. package/checkbox-input/checkbox-input.js +5 -3
  12. package/checkbox-input/checkbox-input.stories.d.ts +2 -3
  13. package/checkbox-input/index.d.ts +1 -1
  14. package/checkbox-input/index.js +14 -5
  15. package/chip/chip.d.ts +7 -0
  16. package/chip/chip.js +14 -0
  17. package/chip/chip.stories.d.ts +7 -0
  18. package/chip/chip.stories.js +22 -0
  19. package/chip/index.d.ts +1 -0
  20. package/chip/index.js +5 -0
  21. package/chip/theme.d.ts +5 -0
  22. package/chip/theme.js +2 -0
  23. package/color-radio-group/color-radio-group.d.ts +17 -0
  24. package/color-radio-group/color-radio-group.js +47 -0
  25. package/color-radio-group/color-radio-group.stories.d.ts +7 -0
  26. package/color-radio-group/color-radio-group.stories.js +79 -0
  27. package/color-radio-group/color-radio.d.ts +8 -0
  28. package/color-radio-group/color-radio.js +28 -0
  29. package/color-radio-group/index.d.ts +1 -0
  30. package/color-radio-group/index.js +5 -0
  31. package/combobox/combobox.d.ts +1 -2
  32. package/combobox/combobox.js +8 -7
  33. package/combobox/index.d.ts +1 -1
  34. package/combobox/index.js +14 -5
  35. package/config/icons-config.d.ts +2 -0
  36. package/config/icons-config.js +5 -0
  37. package/config/icons.d.ts +47 -0
  38. package/config/icons.js +14 -0
  39. package/css/button.css +171 -76
  40. package/css/chip.css +37 -0
  41. package/css/color-radio-group.css +26 -0
  42. package/css/color-radio.css +21 -0
  43. package/css/input.css +123 -68
  44. package/css/label.css +7 -0
  45. package/css/radio-group.css +41 -12
  46. package/css/radio.css +2 -2
  47. package/css/textarea.css +48 -10
  48. package/dropdown/dropdown.js +7 -7
  49. package/dropdown/index.d.ts +1 -1
  50. package/dropdown/index.js +15 -3
  51. package/error-message/error-message.d.ts +2 -2
  52. package/error-message/error-message.js +2 -1
  53. package/error-message/index.d.ts +1 -1
  54. package/error-message/index.js +14 -5
  55. package/form-control/form-control.js +2 -2
  56. package/hooks/use-dropdown.js +3 -1
  57. package/icon/icon.d.ts +2 -2
  58. package/icon/icon.js +11 -7
  59. package/icon/icon.stories.js +12 -8
  60. package/icon/index.d.ts +1 -5
  61. package/icon/index.js +14 -13
  62. package/icon/theme.d.ts +1 -2
  63. package/image-gallery/components/close-button.js +3 -3
  64. package/image-gallery/components/next-button.js +3 -3
  65. package/image-gallery/components/previous-button.js +3 -3
  66. package/input/index.d.ts +9 -10
  67. package/input/index.js +10 -13
  68. package/input/input-element.d.ts +2 -2
  69. package/input/input-element.js +5 -5
  70. package/input/input-left-addon.d.ts +3 -3
  71. package/input/input-left-addon.js +2 -1
  72. package/input/input-left-element.d.ts +3 -3
  73. package/input/input-left-element.js +2 -1
  74. package/input/input-right-addon.d.ts +2 -3
  75. package/input/input-right-addon.js +2 -1
  76. package/input/input-right-element.d.ts +3 -3
  77. package/input/input-right-element.js +2 -1
  78. package/input/input.d.ts +2 -2
  79. package/input/input.js +5 -4
  80. package/input/input.stories.d.ts +5 -5
  81. package/input/input.stories.js +13 -3
  82. package/label/index.d.ts +1 -1
  83. package/label/index.js +14 -5
  84. package/label/label.d.ts +1 -2
  85. package/label/label.js +4 -4
  86. package/package.json +4 -3
  87. package/radio/index.d.ts +1 -1
  88. package/radio/index.js +15 -3
  89. package/radio-group/index.d.ts +1 -1
  90. package/radio-group/index.js +15 -3
  91. package/radio-group/radio-group.js +2 -2
  92. package/radio-group/radio-group.stories.js +2 -2
  93. package/raster-image/index.d.ts +1 -1
  94. package/raster-image/index.js +14 -5
  95. package/raster-image/raster-image.d.ts +4 -4
  96. package/raster-image/raster-image.js +7 -5
  97. package/raster-image/raster-image.stories.d.ts +2 -3
  98. package/select/index.d.ts +1 -1
  99. package/select/index.js +14 -5
  100. package/select/select.d.ts +1 -2
  101. package/select/select.js +8 -7
  102. package/text-input/text-input.d.ts +1 -1
  103. package/text-input/text-input.js +4 -4
  104. package/text-input/text-input.stories.js +4 -1
  105. package/textarea/index.d.ts +1 -1
  106. package/textarea/index.js +14 -5
  107. package/textarea/textarea.d.ts +1 -2
  108. package/textarea/textarea.js +8 -8
  109. package/textarea/textarea.stories.js +32 -20
  110. package/toggle/index.d.ts +1 -1
  111. package/toggle/index.js +14 -5
  112. package/toggle/toggle.d.ts +2 -3
  113. package/toggle/toggle.js +7 -6
  114. package/toggle/toggle.stories.d.ts +2 -3
  115. package/utils/icons-config.js +43 -0
  116. package/utils/storybook-config.js +1 -1
  117. package/utils/tailwind-config.js +152 -0
  118. package/hooks/use-latest.d.ts +0 -2
  119. package/hooks/use-latest.js +0 -12
  120. package/icon/camera-icon.d.ts +0 -3
  121. package/icon/camera-icon.js +0 -11
  122. package/icon/chevron-down-icon.d.ts +0 -3
  123. package/icon/chevron-down-icon.js +0 -11
  124. package/icon/chevron-up-icon.d.ts +0 -3
  125. package/icon/chevron-up-icon.js +0 -11
  126. package/icon/pin-icon.d.ts +0 -3
  127. package/icon/pin-icon.js +0 -11
  128. package/image-gallery/components/icon-chevron-left.d.ts +0 -3
  129. package/image-gallery/components/icon-chevron-left.js +0 -11
  130. package/image-gallery/components/icon-chevron-right.d.ts +0 -3
  131. package/image-gallery/components/icon-chevron-right.js +0 -11
  132. package/image-gallery/components/icon-close.d.ts +0 -3
  133. package/image-gallery/components/icon-close.js +0 -11
  134. package/utils/cx.d.ts +0 -3
  135. package/utils/cx.js +0 -54
  136. package/utils/forward-ref.d.ts +0 -12
  137. package/utils/forward-ref.js +0 -10
  138. package/utils/rem.d.ts +0 -1
  139. package/utils/rem.js +0 -5
  140. package/utils/sr-only-mixin.d.ts +0 -2
  141. package/utils/sr-only-mixin.js +0 -14
@@ -0,0 +1,47 @@
1
+ export declare const ICONS: {
2
+ readonly camera: {
3
+ readonly w: 512;
4
+ readonly h: 512;
5
+ };
6
+ readonly caretDown: {
7
+ readonly w: 320;
8
+ readonly h: 512;
9
+ };
10
+ readonly check: {
11
+ readonly w: 512;
12
+ readonly h: 512;
13
+ };
14
+ readonly chevronDown: {
15
+ readonly w: 512;
16
+ readonly h: 512;
17
+ };
18
+ readonly chevronLeft: {
19
+ readonly w: 384;
20
+ readonly h: 512;
21
+ };
22
+ readonly chevronRight: {
23
+ readonly w: 384;
24
+ readonly h: 512;
25
+ };
26
+ readonly chevronUp: {
27
+ readonly w: 512;
28
+ readonly h: 512;
29
+ };
30
+ readonly xmarkLarge: {
31
+ readonly w: 448;
32
+ readonly h: 512;
33
+ };
34
+ };
35
+ export declare type IconsType = keyof typeof ICONS;
36
+ declare module "@uxf/ui/icon/theme" {
37
+ interface IconsSet {
38
+ camera: true;
39
+ caretDown: true;
40
+ check: true;
41
+ chevronDown: true;
42
+ chevronLeft: true;
43
+ chevronRight: true;
44
+ chevronUp: true;
45
+ xmarkLarge: true;
46
+ }
47
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ // this file is generated automatically, do not change anything manually in the contents of this file
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ICONS = void 0;
5
+ exports.ICONS = {
6
+ camera: { w: 512, h: 512 },
7
+ caretDown: { w: 320, h: 512 },
8
+ check: { w: 512, h: 512 },
9
+ chevronDown: { w: 512, h: 512 },
10
+ chevronLeft: { w: 384, h: 512 },
11
+ chevronRight: { w: 384, h: 512 },
12
+ chevronUp: { w: 512, h: 512 },
13
+ xmarkLarge: { w: 448, h: 512 },
14
+ };
package/css/button.css CHANGED
@@ -1,108 +1,203 @@
1
1
  @keyframes spinner {
2
- to {transform: rotate(360deg);}
2
+ to {
3
+ transform: rotate(360deg);
4
+ }
3
5
  }
4
6
 
5
7
  .uxf-button {
6
- @apply inline-flex items-center rounded font-medium shadow-md shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 relative cursor-pointer;
7
-
8
- &__text {
9
- @apply truncate;
10
- }
11
-
12
- &--full-width {
13
- @apply w-full flex flex-row justify-center;
14
- }
15
-
16
- &.is-disabled {
17
- @apply opacity-50 pointer-events-none shadow-none;
18
- }
19
-
20
- &.is-loading:after {
21
- content: '';
22
- width: 20px;
23
- height: 20px;
24
- border-radius: 50%;
25
- border-top: 2px solid;
26
- border-right: 2px solid transparent;
27
- animation: spinner .8s linear infinite;
28
- margin-left: 8px;
29
- }
30
-
31
- &--size-xs {
32
- @apply px-2.5 py-1.5 text-xs;
8
+ @apply inline-flex items-center rounded-lg before:rounded-lg font-medium
9
+ focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 relative cursor-pointer transition before:transition;
33
10
 
34
- &.is-loading:after {
35
- width: 14px;
36
- height: 14px;
11
+ &__text {
12
+ @apply truncate;
37
13
  }
38
- }
39
14
 
40
- &--size-sm {
41
- @apply px-3 py-2 text-sm leading-4;
42
-
43
- &.is-loading:after {
44
- width: 16px;
45
- height: 16px;
15
+ &--full-width {
16
+ @apply w-full flex flex-row justify-center;
46
17
  }
47
- }
48
18
 
49
- &--size-default {
50
- @apply px-4 py-2 text-sm;
51
- }
19
+ &.is-disabled {
20
+ @apply pointer-events-none;
21
+ }
52
22
 
53
- &--size-lg {
54
- @apply px-4 py-2 text-base;
55
- }
23
+ &.is-loading {
24
+ @apply pointer-events-none;
25
+ }
56
26
 
57
- &--size-xl {
58
- @apply border px-6 py-3 text-base;
59
- }
27
+ &.is-loading:after {
28
+ content: '';
29
+ width: 20px;
30
+ height: 20px;
31
+ border-radius: 50%;
32
+ border-top: 2px solid;
33
+ border-right: 2px solid transparent;
34
+ animation: spinner .8s linear infinite;
35
+ margin-left: 8px;
36
+ }
60
37
 
61
- &--variant-outlined {
62
- @apply border bg-white;
38
+ &--size-xs {
39
+ @apply px-2.5 py-1.5 text-xs;
63
40
 
64
- &.uxf-button--color-default {
65
- @apply border-primary-500 text-primary-700 hover:bg-primary-50 focus:ring-primary-500;
41
+ &.is-loading:after {
42
+ width: 14px;
43
+ height: 14px;
44
+ }
66
45
  }
67
46
 
68
- &.uxf-button--color-white {
69
- @apply border-gray-300 text-gray-700 hover:bg-gray-50 focus:ring-gray-500;
47
+ &--size-sm {
48
+ @apply px-3 py-2 text-sm leading-4;
49
+
50
+ &.is-loading:after {
51
+ width: 16px;
52
+ height: 16px;
53
+ }
70
54
  }
71
55
 
72
- &.uxf-button--color-success {
73
- @apply border-success-500 text-success-700 hover:bg-success-50 focus:ring-success-500;
56
+ &--size-default {
57
+ @apply px-4 py-3 text-base;
74
58
  }
75
59
 
76
- &.uxf-button--color-warning {
77
- @apply border-warning-500 text-warning-700 hover:bg-warning-50 focus:ring-warning-500;
60
+ &--size-lg {
61
+ @apply px-8 py-5 text-base;
78
62
  }
79
63
 
80
- &.uxf-button--color-error {
81
- @apply border-error-500 text-error-700 hover:bg-error-50 focus:ring-error-500;
64
+ &--size-xl {
65
+ @apply px-10 py-6 text-base;
82
66
  }
83
- }
84
67
 
85
- &--variant-default {
86
- @apply border-transparent text-white;
68
+ &--variant-outlined {
69
+ @apply before:absolute before:pointer-events-none before:inset-0 before:border hover:before:border-2 bg-transparent;
87
70
 
88
- &.uxf-button--color-default {
89
- @apply bg-primary-500 hover:bg-primary-600 focus:ring-primary-400;
90
- }
71
+ :root .light & {
72
+ @apply before:border-gray-300 hover:bg-primary-100 hover:before:border-primary-400 focus-visible:ring-primary-500 focus-visible:ring-offset-white;
91
73
 
92
- &.uxf-button--color-white {
93
- @apply bg-gray-50 text-gray-700 shadow-none hover:bg-gray-100 focus:ring-gray-500;
94
- }
74
+ &.is-disabled {
75
+ @apply before:border-gray-100 text-gray-400;
76
+ }
77
+ }
78
+
79
+ :root .dark & {
80
+ @apply before:border-gray-300 hover:bg-gray-700 hover:before:border-gray-300 focus-visible:ring-primary-500 focus-visible:ring-offset-gray-900;
95
81
 
96
- &.uxf-button--color-success {
97
- @apply bg-success-500 hover:bg-success-600 focus:ring-success-400;
82
+ &.is-disabled {
83
+ @apply before:border-gray-700 text-gray-600;
84
+ }
85
+ }
98
86
  }
99
87
 
100
- &.uxf-button--color-warning {
101
- @apply bg-warning-500 hover:bg-warning-600 focus:ring-warning-400;
88
+ &--variant-default {
89
+ @apply text-white;
90
+
91
+ &.uxf-button--color-default {
92
+ :root .light & {
93
+ @apply text-white bg-primary-500 hover:bg-primary-400 focus-visible:ring-primary-500;
94
+
95
+ &.is-disabled {
96
+ @apply bg-gray-100 text-gray-400;
97
+ }
98
+ }
99
+
100
+ :root .dark & {
101
+ @apply text-white bg-primary-500 hover:bg-primary-400 focus-visible:ring-primary-500 focus-visible:ring-offset-gray-900;
102
+
103
+ &.is-disabled {
104
+ @apply bg-gray-700 text-gray-400;
105
+ }
106
+ }
107
+ }
108
+
109
+ &.uxf-button--color-white {
110
+ :root .light & {
111
+ @apply bg-white hover:bg-gray-200 focus-visible:ring-gray-200;
112
+
113
+ &.is-disabled {
114
+ @apply bg-gray-100 text-gray-400;
115
+ }
116
+ }
117
+
118
+ :root .dark & {
119
+ @apply bg-white hover:bg-gray-200 focus-visible:ring-gray-200;
120
+
121
+ &.is-disabled {
122
+ @apply bg-gray-100 text-gray-400;
123
+ }
124
+ }
125
+
126
+ @apply bg-gray-50 text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500;
127
+ }
128
+
129
+ &.uxf-button--color-success {
130
+ :root .light & {
131
+ @apply text-white bg-success-500 hover:bg-success-400 focus-visible:ring-success-500;
132
+
133
+ &.is-disabled {
134
+ @apply bg-gray-100 text-gray-400;
135
+ }
136
+ }
137
+
138
+ :root .dark & {
139
+ @apply text-white bg-success-500 hover:bg-success-400 focus-visible:ring-success-500 focus-visible:ring-offset-gray-900;
140
+
141
+ &.is-disabled {
142
+ @apply bg-gray-700 text-gray-400;
143
+ }
144
+ }
145
+ }
146
+
147
+ &.uxf-button--color-warning {
148
+ :root .light & {
149
+ @apply text-white bg-warning-500 hover:bg-warning-400 focus-visible:ring-warning-500;
150
+
151
+ &.is-disabled {
152
+ @apply bg-gray-100 text-gray-400;
153
+ }
154
+ }
155
+
156
+ :root .dark & {
157
+ @apply text-white bg-warning-500 hover:bg-warning-400 focus-visible:ring-warning-500 focus-visible:ring-offset-gray-900;
158
+
159
+ &.is-disabled {
160
+ @apply bg-gray-700 text-gray-400;
161
+ }
162
+ }
163
+ }
164
+
165
+ &.uxf-button--color-error {
166
+ :root .light & {
167
+ @apply text-white bg-error-500 hover:bg-error-400 focus-visible:ring-error-500;
168
+
169
+ &.is-disabled {
170
+ @apply bg-gray-100 text-gray-400;
171
+ }
172
+ }
173
+
174
+ :root .dark & {
175
+ @apply text-white bg-error-500 hover:bg-error-400 focus-visible:ring-error-500 focus-visible:ring-offset-gray-900;
176
+
177
+ &.is-disabled {
178
+ @apply bg-gray-700 text-gray-400;
179
+ }
180
+ }
181
+ }
102
182
  }
103
183
 
104
- &.uxf-button--color-error {
105
- @apply bg-error-500 hover:bg-error-600 focus:ring-error-400;
184
+ &--variant-text {
185
+ @apply before:border-transparent;
186
+
187
+ :root .light & {
188
+ @apply hover:bg-black/10 focus-visible:ring-primary-500 focus-visible:ring-offset-white;
189
+
190
+ &.is-disabled {
191
+ @apply text-gray-400;
192
+ }
193
+ }
194
+
195
+ :root .dark & {
196
+ @apply hover:bg-white/10 focus-visible:ring-primary-500 focus-visible:ring-offset-gray-900;
197
+
198
+ &.is-disabled {
199
+ @apply text-gray-600;
200
+ }
201
+ }
106
202
  }
107
- }
108
203
  }
package/css/chip.css ADDED
@@ -0,0 +1,37 @@
1
+ .uxf-chip {
2
+ @apply inline-block rounded-lg py-1 px-2 text-xs;
3
+
4
+ &__text {
5
+ @apply truncate;
6
+ }
7
+
8
+ &--color-success {
9
+ :root .light & {
10
+ @apply text-success-600 bg-success-100;
11
+ }
12
+
13
+ :root .dark & {
14
+ @apply text-white bg-success-700;
15
+ }
16
+ }
17
+
18
+ &--color-warning {
19
+ :root .light & {
20
+ @apply text-warning-600 bg-warning-100;
21
+ }
22
+
23
+ :root .dark & {
24
+ @apply text-white bg-warning-700;
25
+ }
26
+ }
27
+
28
+ &--color-error {
29
+ :root .light & {
30
+ @apply text-error-600 bg-error-100;
31
+ }
32
+
33
+ :root .dark & {
34
+ @apply text-white bg-error-700;
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,26 @@
1
+ .uxf-color-radio-group {
2
+ &__option {
3
+ @apply rounded-full outline-none focus-visible:ring-offset-2 focus-visible:ring-2;
4
+
5
+ :root .light & {
6
+ @apply focus-visible:ring-[color:var(--option-color)] focus-visible:ring-offset-white;
7
+ }
8
+
9
+ :root .dark & {
10
+ @apply focus-visible:ring-[color:var(--option-color)] focus-visible:ring-offset-gray-900;
11
+ }
12
+ }
13
+
14
+ &__label {
15
+ @apply mb-2;
16
+ }
17
+
18
+ &__label--hidden {
19
+ @apply sr-only;
20
+ }
21
+
22
+ &__options-wrapper {
23
+ @apply flex flex-wrap gap-3.5;
24
+ }
25
+ }
26
+
@@ -0,0 +1,21 @@
1
+ .uxf-color-radio {
2
+ @apply shrink-0 inline-flex items-center justify-center rounded-full h-7 w-7 bg-[color:var(--bg-color)];
3
+
4
+ &__label {
5
+ @apply sr-only;
6
+ }
7
+
8
+ &__icon {
9
+ @apply w-4 h-4 text-white opacity-0 transition-opacity;
10
+ }
11
+
12
+ &__icon--dark {
13
+ @apply text-gray-900;
14
+ }
15
+
16
+ &.is-selected {
17
+ .uxf-color-radio__icon {
18
+ @apply opacity-100;
19
+ }
20
+ }
21
+ }
package/css/input.css CHANGED
@@ -1,98 +1,153 @@
1
1
  .uxf-input {
2
- @apply rounded-md shadow-sm sm:text-sm;
2
+ @apply rounded-lg text-base;
3
3
 
4
- &__left-element,
5
- &__right-element {
6
- @apply text-gray-400;
7
- }
4
+ :root .light & {
5
+ @apply bg-gray-100 text-gray-900;
6
+ }
8
7
 
9
- &__left-element {
10
- @apply mr-2;
11
- }
12
- &__right-element {
13
- @apply ml-2;
14
- }
8
+ :root .dark & {
9
+ @apply bg-gray-800 text-gray-300;
10
+ }
15
11
 
16
- &__left-addon,
17
- &__right-addon {
18
- @apply border border-gray-300 bg-gray-50 px-2 text-gray-500;
19
- }
12
+ &__element {
13
+ :root .light & {
14
+ @apply placeholder:text-gray-400;
15
+ }
20
16
 
21
- &__left-addon {
22
- @apply rounded-l-md border-r-0;
23
- }
17
+ :root .dark & {
18
+ @apply placeholder:text-gray-400;
19
+ }
20
+ }
21
+
22
+ &__left-element {
23
+ @apply mr-2;
24
+ }
24
25
 
25
- &__right-addon {
26
- @apply rounded-r-md border-l-0;
27
- }
26
+ &__right-element {
27
+ @apply ml-2;
28
+ }
28
29
 
29
- &__wrapper {
30
- @apply h-10 rounded-md border border-gray-300 px-3;
31
- }
30
+ &__left-addon,
31
+ &__right-addon {
32
+ @apply border px-2;
32
33
 
33
- &__element {
34
- @apply bg-transparent outline-none;
35
- }
34
+ :root .light & {
35
+ @apply border-gray-200;
36
+ }
36
37
 
37
- &--has-right-addon {
38
- .uxf-input__wrapper {
39
- @apply rounded-r-none;
38
+ :root .dark & {
39
+ @apply border-gray-700;
40
+ }
40
41
  }
41
- }
42
42
 
43
- &--has-left-addon {
44
- .uxf-input__wrapper {
45
- @apply rounded-l-none;
43
+ &__left-addon {
44
+ @apply rounded-l-lg border-r-0;
46
45
  }
47
- }
48
46
 
49
- &.is-focused {
50
- .uxf-input__wrapper {
51
- @apply border-primary-500 ring-1 ring-inset ring-primary-500 ring-offset-0;
47
+ &__right-addon {
48
+ @apply rounded-r-lg border-l-0;
52
49
  }
53
- }
54
50
 
55
- &.is-disabled {
56
- @apply cursor-not-allowed;
51
+ &__wrapper {
52
+ @apply h-12 rounded-lg border px-4;
57
53
 
58
- .uxf-input__element {
59
- @apply cursor-not-allowed text-gray-500;
60
- }
61
- .uxf-input__wrapper {
62
- @apply bg-gray-50;
54
+ :root .light & {
55
+ @apply border-gray-200;
56
+ }
57
+
58
+ :root .dark & {
59
+ @apply border-gray-700;
60
+ }
63
61
  }
64
- }
65
62
 
66
- &.is-readonly {
67
- @apply cursor-not-allowed;
63
+ &__element {
64
+ @apply bg-transparent outline-none;
65
+ }
68
66
 
69
- .uxf-input__element {
70
- @apply cursor-not-allowed;
67
+ &--has-right-addon {
68
+ .uxf-input__wrapper {
69
+ @apply rounded-r-none;
70
+ }
71
71
  }
72
72
 
73
- .uxf-input__wrapper {
74
- @apply ring-0 border-gray-300;
73
+ &--has-left-addon {
74
+ .uxf-input__wrapper {
75
+ @apply rounded-l-none;
76
+ }
75
77
  }
76
- }
77
78
 
78
- &.is-invalid {
79
79
  &.is-focused {
80
- .uxf-input__wrapper {
81
- @apply ring-1 ring-inset ring-error-500 border-error-500 ring-offset-0;
82
- }
80
+ .uxf-input__wrapper {
81
+ @apply ring-2 ring-inset ring-offset-0;
82
+
83
+ :root .light & {
84
+ @apply ring-primary-500;
85
+ }
86
+
87
+ :root .dark & {
88
+ @apply ring-primary-500;
89
+ }
90
+ }
91
+ }
92
+
93
+ &.is-disabled {
94
+ @apply cursor-not-allowed;
95
+
96
+ :root .light & {
97
+ @apply bg-gray-300;
98
+ }
99
+
100
+ :root .dark & {
101
+ @apply bg-gray-600;
102
+ }
103
+
104
+ .uxf-input__element {
105
+ @apply cursor-not-allowed;
106
+ }
83
107
  }
84
108
 
85
- .uxf-input__wrapper {
86
- @apply border-error-500 placeholder-error-300;
109
+ &.is-readonly {
110
+ @apply cursor-text;
111
+
112
+ .uxf-input__element {
113
+ @apply cursor-text;
114
+ }
115
+
116
+ .uxf-input__wrapper {
117
+ @apply ring-0;
118
+ }
87
119
 
88
- .uxf-input__left-element,
89
- .uxf-input__right-element {
90
- @apply text-error-500;
91
- }
120
+ .uxf-input__wrapper,
121
+ .uxf-input__left-addon,
122
+ .uxf-input__right-addon {
123
+ :root .light & {
124
+ @apply border-gray-300;
125
+ }
126
+
127
+ :root .dark & {
128
+ @apply border-gray-500;
129
+ }
130
+ }
131
+ }
92
132
 
93
- .uxf-input__element {
94
- @apply text-error-900 placeholder-error-300;
95
- }
133
+ &.is-invalid {
134
+ &.is-focused {
135
+ .uxf-input__wrapper {
136
+ @apply ring-1 ring-inset ring-error-500 border-error-500 ring-offset-0;
137
+ }
138
+ }
139
+
140
+ .uxf-input__wrapper {
141
+ @apply border-error-500 placeholder-error-300;
142
+
143
+ .uxf-input__left-element,
144
+ .uxf-input__right-element {
145
+ @apply text-error-500;
146
+ }
147
+
148
+ .uxf-input__element {
149
+ @apply text-error-900 placeholder-error-300;
150
+ }
151
+ }
96
152
  }
97
- }
98
153
  }
package/css/label.css CHANGED
@@ -1,6 +1,13 @@
1
1
  .uxf-label {
2
2
  @apply mb-1 block text-sm font-medium text-gray-700;
3
3
 
4
+ :root .light & {
5
+ @apply text-gray-900;
6
+ }
7
+ :root .dark & {
8
+ @apply text-white;
9
+ }
10
+
4
11
  &.is-required::after {
5
12
  content: " *";
6
13
  }