@xqmsg/ui-core 0.16.4 → 0.16.6
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/dist/89793640b494d7ea.svg +9 -0
- package/dist/components/button/google/index.d.ts +2 -1
- package/dist/components/button/index.d.ts +3 -0
- package/dist/components/button/microsoft/MicrosoftButton.stories.d.ts +5 -0
- package/dist/components/button/microsoft/index.d.ts +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/ui-core.cjs.development.js +136 -51
- package/dist/ui-core.cjs.development.js.map +1 -1
- package/dist/ui-core.cjs.production.min.js +1 -1
- package/dist/ui-core.cjs.production.min.js.map +1 -1
- package/dist/ui-core.esm.js +138 -54
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/button/google/index.tsx +15 -18
- package/src/components/button/index.tsx +9 -0
- package/src/components/button/microsoft/MicrosoftButton.stories.tsx +25 -0
- package/src/components/button/microsoft/assets/MicrosoftLogo.svg +9 -0
- package/src/components/button/microsoft/index.tsx +29 -0
- package/src/components/input/StackedCheckbox/StackedCheckbox.tsx +12 -4
- package/src/components/input/StackedPilledInput/index.tsx +6 -7
- package/src/components/input/index.tsx +8 -3
- package/src/index.tsx +3 -0
|
@@ -25,7 +25,7 @@ export interface StackedPilledInputProps extends InputFieldProps {
|
|
|
25
25
|
const StackedPilledInput = React.forwardRef<
|
|
26
26
|
HTMLInputElement,
|
|
27
27
|
StackedPilledInputProps
|
|
28
|
-
>(({ name, setValue, control, placeholder, disabled
|
|
28
|
+
>(({ name, setValue, control, placeholder, disabled }, _ref) => {
|
|
29
29
|
const watchedValue = useWatch({ control, name: name as string });
|
|
30
30
|
const [lastestFormValueToArray, setLatestFormValueToArray] = useState<
|
|
31
31
|
string[]
|
|
@@ -64,10 +64,11 @@ const StackedPilledInput = React.forwardRef<
|
|
|
64
64
|
|
|
65
65
|
const onHandleKeyDown = (e: React.KeyboardEvent) => {
|
|
66
66
|
if (
|
|
67
|
-
e.key === ' ' ||
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
(e.key === ' ' ||
|
|
68
|
+
e.key === 'Enter' ||
|
|
69
|
+
e.key === ',' ||
|
|
70
|
+
e.key === 'Tab') &&
|
|
71
|
+
localValue.length
|
|
71
72
|
) {
|
|
72
73
|
if (
|
|
73
74
|
e.key === 'Enter' &&
|
|
@@ -202,8 +203,6 @@ const StackedPilledInput = React.forwardRef<
|
|
|
202
203
|
};
|
|
203
204
|
|
|
204
205
|
const onBlur = () => {
|
|
205
|
-
clearErrors(name);
|
|
206
|
-
|
|
207
206
|
if (localValue.trim().length) {
|
|
208
207
|
const filteredUniqueValues = Array.from(
|
|
209
208
|
new Set([...lastestFormValueToArray, ...localValue.trim().split(',')])
|
|
@@ -142,10 +142,12 @@ export function Input<T extends FieldValues>({
|
|
|
142
142
|
return (
|
|
143
143
|
<StackedTextarea
|
|
144
144
|
className={`input-${inputType} ${className ?? ''}`}
|
|
145
|
+
aria-label={ariaLabel}
|
|
145
146
|
name={name}
|
|
146
147
|
id={name}
|
|
147
148
|
placeholder={placeholder}
|
|
148
149
|
maxLength={maxLength}
|
|
150
|
+
isRequired={isRequired}
|
|
149
151
|
isInvalid={isInvalid}
|
|
150
152
|
onChange={onChange}
|
|
151
153
|
onBlur={onBlur}
|
|
@@ -164,7 +166,6 @@ export function Input<T extends FieldValues>({
|
|
|
164
166
|
onChange={onChange}
|
|
165
167
|
onBlur={onBlur}
|
|
166
168
|
ref={ref}
|
|
167
|
-
disabled={disabled}
|
|
168
169
|
value={value}
|
|
169
170
|
defaultValue={defaultValue}
|
|
170
171
|
label={label as string}
|
|
@@ -242,9 +243,13 @@ export function Input<T extends FieldValues>({
|
|
|
242
243
|
id={name}
|
|
243
244
|
isInvalid={isInvalid}
|
|
244
245
|
position="relative"
|
|
245
|
-
py={
|
|
246
|
+
py={
|
|
247
|
+
(label || helperText || isInvalid) && inputType !== 'checkbox'
|
|
248
|
+
? 6
|
|
249
|
+
: 0
|
|
250
|
+
}
|
|
246
251
|
>
|
|
247
|
-
{label && (
|
|
252
|
+
{label && inputType !== 'checkbox' && (
|
|
248
253
|
<Label
|
|
249
254
|
tooltipText={tooltipText}
|
|
250
255
|
label={label}
|
package/src/index.tsx
CHANGED