@vygruppen/spor-react 11.1.1 → 11.1.3
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/.turbo/turbo-build.log +6 -8
- package/CHANGELOG.md +12 -0
- package/dist/index.js +11949 -13873
- package/dist/index.mjs +14989 -1
- package/package.json +1 -1
- package/src/input/CountryCodeSelect.tsx +1 -1
- package/src/input/Input.tsx +1 -1
- package/src/input/PasswordInput.tsx +3 -1
- package/src/input/PhoneNumberInput.tsx +15 -31
- package/src/input/SearchInput.tsx +1 -1
- package/src/input/Textarea.tsx +5 -1
- package/dist/CountryCodeSelect-V422HKUV.mjs +0 -41
- package/dist/chunk-QFSW3GTE.mjs +0 -14962
package/package.json
CHANGED
package/src/input/Input.tsx
CHANGED
@@ -61,7 +61,7 @@ export const Input = forwardRef<InputProps, "input">(
|
|
61
61
|
overflow="hidden"
|
62
62
|
placeholder=" " // This is needed to make the label work as expected
|
63
63
|
/>
|
64
|
-
<FormLabel htmlFor={inputId} id={labelId}>
|
64
|
+
<FormLabel htmlFor={inputId} id={labelId} pointerEvents="none">
|
65
65
|
{label}
|
66
66
|
</FormLabel>
|
67
67
|
{rightIcon && (
|
@@ -25,7 +25,9 @@ export const PasswordInput = forwardRef<PasswordInputProps, "input">(
|
|
25
25
|
const inputId = id ?? formControlProps?.id ?? autoGeneratedId;
|
26
26
|
return (
|
27
27
|
<InputGroup position="relative">
|
28
|
-
{leftIcon &&
|
28
|
+
{leftIcon && (
|
29
|
+
<InputLeftElement pointerEvents="none">{leftIcon}</InputLeftElement>
|
30
|
+
)}
|
29
31
|
<ChakraInput
|
30
32
|
{...props}
|
31
33
|
id={inputId}
|
@@ -4,9 +4,10 @@ import {
|
|
4
4
|
forwardRef,
|
5
5
|
useControllableState,
|
6
6
|
} from "@chakra-ui/react";
|
7
|
-
import React
|
8
|
-
import {
|
7
|
+
import React from "react";
|
8
|
+
import { Input, createTexts, useTranslation } from "..";
|
9
9
|
import { AttachedInputs } from "./AttachedInputs";
|
10
|
+
import { CountryCodeSelect } from "./CountryCodeSelect";
|
10
11
|
|
11
12
|
type CountryCodeAndPhoneNumber = {
|
12
13
|
countryCode: string;
|
@@ -71,34 +72,19 @@ export const PhoneNumberInput = forwardRef<PhoneNumberInputProps, As>(
|
|
71
72
|
});
|
72
73
|
return (
|
73
74
|
<AttachedInputs {...boxProps}>
|
74
|
-
<
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
value="+47"
|
82
|
-
variant={variant}
|
83
|
-
>
|
84
|
-
<Item key="+47">+47</Item>
|
85
|
-
</InfoSelect>
|
75
|
+
<CountryCodeSelect
|
76
|
+
value={value.countryCode}
|
77
|
+
onChange={(countryCode) =>
|
78
|
+
onChange({
|
79
|
+
countryCode: countryCode as string,
|
80
|
+
nationalNumber: value.nationalNumber,
|
81
|
+
})
|
86
82
|
}
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
countryCode: countryCode as string,
|
93
|
-
nationalNumber: value.nationalNumber,
|
94
|
-
})
|
95
|
-
}
|
96
|
-
name={name ? `${name}-country-code` : "country-code"}
|
97
|
-
height="100%"
|
98
|
-
width="6.25rem"
|
99
|
-
variant={variant}
|
100
|
-
/>
|
101
|
-
</Suspense>
|
83
|
+
name={name ? `${name}-country-code` : "country-code"}
|
84
|
+
height="100%"
|
85
|
+
width="6.25rem"
|
86
|
+
variant={variant}
|
87
|
+
/>
|
102
88
|
<Input
|
103
89
|
ref={ref}
|
104
90
|
type="tel"
|
@@ -142,5 +128,3 @@ const texts = createTexts({
|
|
142
128
|
sv: "Landskod",
|
143
129
|
},
|
144
130
|
});
|
145
|
-
|
146
|
-
const LazyCountryCodeSelect = React.lazy(() => import("./CountryCodeSelect"));
|
@@ -39,7 +39,7 @@ export const SearchInput = forwardRef<SearchInputProps, "input">(
|
|
39
39
|
|
40
40
|
return (
|
41
41
|
<InputGroup position="relative" {...outerProps}>
|
42
|
-
<InputLeftElement>
|
42
|
+
<InputLeftElement pointerEvents="none">
|
43
43
|
<SearchOutline24Icon />
|
44
44
|
</InputLeftElement>
|
45
45
|
<ChakraInput
|
package/src/input/Textarea.tsx
CHANGED
@@ -35,7 +35,11 @@ export const Textarea = forwardRef<TextareaProps, "textarea">((props, ref) => {
|
|
35
35
|
<InputGroup position="relative" {...spacingProps}>
|
36
36
|
<ChakraTextarea {...rest} id={inputId} ref={ref} placeholder=" " />
|
37
37
|
{label && (
|
38
|
-
<FormLabel
|
38
|
+
<FormLabel
|
39
|
+
htmlFor={inputId}
|
40
|
+
id={`${inputId}-label`}
|
41
|
+
pointerEvents="none"
|
42
|
+
>
|
39
43
|
{label}
|
40
44
|
</FormLabel>
|
41
45
|
)}
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import { createTexts, useTranslation, InfoSelect, Item } from './chunk-QFSW3GTE.mjs';
|
2
|
-
import React from 'react';
|
3
|
-
import { getSupportedCallingCodes } from 'awesome-phonenumber';
|
4
|
-
|
5
|
-
var prioritizedCountryCodes = [
|
6
|
-
{ key: "+47", value: "+47" },
|
7
|
-
{ key: "+46", value: "+46" },
|
8
|
-
{ key: "+45", value: "+45" }
|
9
|
-
];
|
10
|
-
var sortedCallingCodes = getSupportedCallingCodes().sort((a, b) => Number(a) - Number(b)).map((code) => ({
|
11
|
-
key: `+${code}`,
|
12
|
-
value: `+${code}`
|
13
|
-
})).filter(
|
14
|
-
(code) => !prioritizedCountryCodes.some((pCode) => pCode.key === code.key)
|
15
|
-
);
|
16
|
-
var callingCodes = [...prioritizedCountryCodes, ...sortedCallingCodes];
|
17
|
-
var CountryCodeSelect = (props) => {
|
18
|
-
const { t } = useTranslation();
|
19
|
-
return /* @__PURE__ */ React.createElement(
|
20
|
-
InfoSelect,
|
21
|
-
{
|
22
|
-
label: t(texts.countryCode),
|
23
|
-
isLabelSrOnly: true,
|
24
|
-
items: callingCodes,
|
25
|
-
variant: props.variant,
|
26
|
-
...props
|
27
|
-
},
|
28
|
-
(item) => /* @__PURE__ */ React.createElement(Item, { key: item.key }, item.key)
|
29
|
-
);
|
30
|
-
};
|
31
|
-
var CountryCodeSelect_default = CountryCodeSelect;
|
32
|
-
var texts = createTexts({
|
33
|
-
countryCode: {
|
34
|
-
nb: "Landkode",
|
35
|
-
nn: "Landskode",
|
36
|
-
en: "Country code",
|
37
|
-
sv: "Landskod"
|
38
|
-
}
|
39
|
-
});
|
40
|
-
|
41
|
-
export { CountryCodeSelect, CountryCodeSelect_default as default };
|