@vygruppen/spor-react 2.1.1 → 2.1.2
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 +8 -8
- package/CHANGELOG.md +6 -0
- package/dist/{CountryCodeSelect-EO6T7EEK.mjs → CountryCodeSelect-OAKJCDQJ.mjs} +11 -4
- package/dist/{chunk-5HQ3SCBT.mjs → chunk-KS4FJCVG.mjs} +5 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -8
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/input/CountryCodeSelect.tsx +11 -3
- package/src/input/PhoneNumberInput.tsx +5 -5
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> @vygruppen/spor-react@2.1.
|
2
|
+
> @vygruppen/spor-react@2.1.2 build
|
3
3
|
> tsup src/index.tsx --dts --treeshake --format cjs,esm
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
@@ -9,13 +9,13 @@
|
|
9
9
|
[34mCJS[39m Build start
|
10
10
|
[34mESM[39m Build start
|
11
11
|
[34mDTS[39m Build start
|
12
|
-
"toTime" is imported from external module "@internationalized/date" but never used in "dist/chunk-
|
12
|
+
"toTime" is imported from external module "@internationalized/date" but never used in "dist/chunk-KS4FJCVG.mjs".
|
13
13
|
"toTime" is imported from external module "@internationalized/date" but never used in "dist/index.js".
|
14
14
|
[32mESM[39m [1mdist/index.mjs [22m[32m1.96 KB[39m
|
15
|
-
[32mESM[39m [1mdist/CountryCodeSelect-
|
16
|
-
[32mESM[39m [1mdist/chunk-
|
17
|
-
[32mESM[39m ⚡️ Build success in
|
18
|
-
[32mCJS[39m [1mdist/index.js [22m[32m876.
|
19
|
-
[32mCJS[39m ⚡️ Build success in
|
20
|
-
[32mDTS[39m ⚡️ Build success in
|
15
|
+
[32mESM[39m [1mdist/CountryCodeSelect-OAKJCDQJ.mjs [22m[32m351.63 KB[39m
|
16
|
+
[32mESM[39m [1mdist/chunk-KS4FJCVG.mjs [22m[32m400.24 KB[39m
|
17
|
+
[32mESM[39m ⚡️ Build success in 4709ms
|
18
|
+
[32mCJS[39m [1mdist/index.js [22m[32m876.93 KB[39m
|
19
|
+
[32mCJS[39m ⚡️ Build success in 4716ms
|
20
|
+
[32mDTS[39m ⚡️ Build success in 17721ms
|
21
21
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m251.13 KB[39m
|
package/CHANGELOG.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { createTexts, useTranslation, InfoSelect, Item } from './chunk-
|
1
|
+
import { createTexts, useTranslation, InfoSelect, Item } from './chunk-KS4FJCVG.mjs';
|
2
2
|
import React from 'react';
|
3
3
|
|
4
4
|
// ../../node_modules/awesome-phonenumber/index-esm.mjs
|
@@ -6598,11 +6598,18 @@ var {
|
|
6598
6598
|
} = index;
|
6599
6599
|
|
6600
6600
|
// src/input/CountryCodeSelect.tsx
|
6601
|
-
var
|
6601
|
+
var prioritizedCountryCodes = [
|
6602
|
+
{ key: "+47", value: "+47" },
|
6603
|
+
{ key: "+46", value: "+46" },
|
6604
|
+
{ key: "+45", value: "+45" }
|
6605
|
+
];
|
6606
|
+
var sortedCallingCodes = getSupportedCallingCodes().sort((a, b) => Number(a) - Number(b)).map((code) => ({
|
6602
6607
|
key: `+${code}`,
|
6603
6608
|
value: `+${code}`
|
6604
|
-
})).filter(
|
6605
|
-
|
6609
|
+
})).filter(
|
6610
|
+
(code) => !prioritizedCountryCodes.some((pCode) => pCode.key === code.key)
|
6611
|
+
);
|
6612
|
+
var callingCodes = [...prioritizedCountryCodes, ...sortedCallingCodes];
|
6606
6613
|
var CountryCodeSelect = (props) => {
|
6607
6614
|
const { t } = useTranslation();
|
6608
6615
|
return /* @__PURE__ */ React.createElement(
|
@@ -4442,7 +4442,7 @@ var PhoneNumberInput = forwardRef(
|
|
4442
4442
|
onChange: externalOnChange,
|
4443
4443
|
defaultValue: {
|
4444
4444
|
countryCode: "+47",
|
4445
|
-
|
4445
|
+
nationalNumber: ""
|
4446
4446
|
}
|
4447
4447
|
});
|
4448
4448
|
return /* @__PURE__ */ React48__default.createElement(AttachedInputs, { ...boxProps }, /* @__PURE__ */ React48__default.createElement(
|
@@ -4466,7 +4466,7 @@ var PhoneNumberInput = forwardRef(
|
|
4466
4466
|
value: value.countryCode,
|
4467
4467
|
onChange: (countryCode) => onChange({
|
4468
4468
|
countryCode,
|
4469
|
-
|
4469
|
+
nationalNumber: value.nationalNumber
|
4470
4470
|
}),
|
4471
4471
|
name: name ? `${name}-country-code` : "country-code",
|
4472
4472
|
height: "100%",
|
@@ -4478,11 +4478,11 @@ var PhoneNumberInput = forwardRef(
|
|
4478
4478
|
{
|
4479
4479
|
ref,
|
4480
4480
|
label: t2(texts12.phoneNumber),
|
4481
|
-
value: value.
|
4481
|
+
value: value.nationalNumber,
|
4482
4482
|
name: name ? `${name}-phone-number` : "phone-number",
|
4483
4483
|
onChange: (e) => onChange({
|
4484
4484
|
countryCode: value.countryCode,
|
4485
|
-
|
4485
|
+
nationalNumber: e.target.value
|
4486
4486
|
}),
|
4487
4487
|
position: "relative",
|
4488
4488
|
left: "-1px"
|
@@ -4498,7 +4498,7 @@ var texts12 = createTexts({
|
|
4498
4498
|
sv: "Telefonnummer"
|
4499
4499
|
}
|
4500
4500
|
});
|
4501
|
-
var LazyCountryCodeSelect = React48__default.lazy(() => import('./CountryCodeSelect-
|
4501
|
+
var LazyCountryCodeSelect = React48__default.lazy(() => import('./CountryCodeSelect-OAKJCDQJ.mjs'));
|
4502
4502
|
var Radio = forwardRef((props, ref) => {
|
4503
4503
|
return /* @__PURE__ */ React48__default.createElement(Radio$1, { ...props, ref });
|
4504
4504
|
});
|
package/dist/index.d.ts
CHANGED
@@ -962,7 +962,7 @@ declare const PasswordInput: _chakra_ui_system_dist_system_types.ComponentWithAs
|
|
962
962
|
|
963
963
|
type CountryCodeAndPhoneNumber = {
|
964
964
|
countryCode: string;
|
965
|
-
|
965
|
+
nationalNumber: string;
|
966
966
|
};
|
967
967
|
type PhoneNumberInputProps = BoxProps & {
|
968
968
|
/** The root name.
|
package/dist/index.js
CHANGED
@@ -11598,16 +11598,23 @@ __export(CountryCodeSelect_exports, {
|
|
11598
11598
|
CountryCodeSelect: () => CountryCodeSelect,
|
11599
11599
|
default: () => CountryCodeSelect_default
|
11600
11600
|
});
|
11601
|
-
var callingCodes, CountryCodeSelect, CountryCodeSelect_default, texts12;
|
11601
|
+
var prioritizedCountryCodes, sortedCallingCodes, callingCodes, CountryCodeSelect, CountryCodeSelect_default, texts12;
|
11602
11602
|
var init_CountryCodeSelect = __esm({
|
11603
11603
|
"src/input/CountryCodeSelect.tsx"() {
|
11604
11604
|
init_src();
|
11605
11605
|
init_index_esm();
|
11606
|
-
|
11606
|
+
prioritizedCountryCodes = [
|
11607
|
+
{ key: "+47", value: "+47" },
|
11608
|
+
{ key: "+46", value: "+46" },
|
11609
|
+
{ key: "+45", value: "+45" }
|
11610
|
+
];
|
11611
|
+
sortedCallingCodes = getSupportedCallingCodes().sort((a, b) => Number(a) - Number(b)).map((code) => ({
|
11607
11612
|
key: `+${code}`,
|
11608
11613
|
value: `+${code}`
|
11609
|
-
})).filter(
|
11610
|
-
|
11614
|
+
})).filter(
|
11615
|
+
(code) => !prioritizedCountryCodes.some((pCode) => pCode.key === code.key)
|
11616
|
+
);
|
11617
|
+
callingCodes = [...prioritizedCountryCodes, ...sortedCallingCodes];
|
11611
11618
|
CountryCodeSelect = (props) => {
|
11612
11619
|
const { t: t2 } = exports.useTranslation();
|
11613
11620
|
return /* @__PURE__ */ React48__namespace.default.createElement(
|
@@ -11645,7 +11652,7 @@ var init_PhoneNumberInput = __esm({
|
|
11645
11652
|
onChange: externalOnChange,
|
11646
11653
|
defaultValue: {
|
11647
11654
|
countryCode: "+47",
|
11648
|
-
|
11655
|
+
nationalNumber: ""
|
11649
11656
|
}
|
11650
11657
|
});
|
11651
11658
|
return /* @__PURE__ */ React48__namespace.default.createElement(exports.AttachedInputs, { ...boxProps }, /* @__PURE__ */ React48__namespace.default.createElement(
|
@@ -11669,7 +11676,7 @@ var init_PhoneNumberInput = __esm({
|
|
11669
11676
|
value: value.countryCode,
|
11670
11677
|
onChange: (countryCode) => onChange({
|
11671
11678
|
countryCode,
|
11672
|
-
|
11679
|
+
nationalNumber: value.nationalNumber
|
11673
11680
|
}),
|
11674
11681
|
name: name ? `${name}-country-code` : "country-code",
|
11675
11682
|
height: "100%",
|
@@ -11681,11 +11688,11 @@ var init_PhoneNumberInput = __esm({
|
|
11681
11688
|
{
|
11682
11689
|
ref,
|
11683
11690
|
label: t2(texts13.phoneNumber),
|
11684
|
-
value: value.
|
11691
|
+
value: value.nationalNumber,
|
11685
11692
|
name: name ? `${name}-phone-number` : "phone-number",
|
11686
11693
|
onChange: (e) => onChange({
|
11687
11694
|
countryCode: value.countryCode,
|
11688
|
-
|
11695
|
+
nationalNumber: e.target.value
|
11689
11696
|
}),
|
11690
11697
|
position: "relative",
|
11691
11698
|
left: "-1px"
|
package/dist/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Button, ButtonGroup, Card, CardSelect, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, ColorInlineLoader, ColorSpinner, Container, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkMode, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, ModalHeader as DrawerHeader, DrawerOverlay, Expandable, ExpandableAlert, ExpandableItem, Flex, FloatingActionButton, FormControl, FormErrorMessage, FormHelperText, FormLabel, Grid, GridItem, HStack, Heading, IconButton, Image, Img, InfoSelect, InfoTag, Input, InputGroup, InputLeftElement, InputRightElement, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightMode, LightSpinner, LineIcon, ListBox, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, PopoverWizardBody, ProgressBar, ProgressLoader, Radio, RadioGroup, SearchInput, Item as SelectItem, SelectItemDescription, SelectItemLabel, SimpleDrawer, SimpleGrid, SimplePopover, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Spacer, SporProvider, Stack, StaticAlert, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, Tr, TravelTag, VStack, VyLogo, WizardPopover, Wrap, WrapItem, createTexts, extendTheme, fontFaces, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToast, useToken, useTranslation } from './chunk-
|
1
|
+
export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Button, ButtonGroup, Card, CardSelect, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, ColorInlineLoader, ColorSpinner, Container, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkMode, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, ModalHeader as DrawerHeader, DrawerOverlay, Expandable, ExpandableAlert, ExpandableItem, Flex, FloatingActionButton, FormControl, FormErrorMessage, FormHelperText, FormLabel, Grid, GridItem, HStack, Heading, IconButton, Image, Img, InfoSelect, InfoTag, Input, InputGroup, InputLeftElement, InputRightElement, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightMode, LightSpinner, LineIcon, ListBox, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, PopoverWizardBody, ProgressBar, ProgressLoader, Radio, RadioGroup, SearchInput, Item as SelectItem, SelectItemDescription, SelectItemLabel, SimpleDrawer, SimpleGrid, SimplePopover, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Spacer, SporProvider, Stack, StaticAlert, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, Tr, TravelTag, VStack, VyLogo, WizardPopover, Wrap, WrapItem, createTexts, extendTheme, fontFaces, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToast, useToken, useTranslation } from './chunk-KS4FJCVG.mjs';
|
package/package.json
CHANGED
@@ -9,14 +9,22 @@ import {
|
|
9
9
|
|
10
10
|
import { getSupportedCallingCodes } from "awesome-phonenumber";
|
11
11
|
|
12
|
-
const
|
12
|
+
const prioritizedCountryCodes = [
|
13
|
+
{ key: "+47", value: "+47" },
|
14
|
+
{ key: "+46", value: "+46" },
|
15
|
+
{ key: "+45", value: "+45" },
|
16
|
+
];
|
17
|
+
|
18
|
+
const sortedCallingCodes = getSupportedCallingCodes()
|
13
19
|
.sort((a, b) => Number(a) - Number(b))
|
14
20
|
.map((code) => ({
|
15
21
|
key: `+${code}`,
|
16
22
|
value: `+${code}`,
|
17
23
|
}))
|
18
|
-
.filter(
|
19
|
-
|
24
|
+
.filter(
|
25
|
+
(code) => !prioritizedCountryCodes.some((pCode) => pCode.key === code.key)
|
26
|
+
);
|
27
|
+
const callingCodes = [...prioritizedCountryCodes, ...sortedCallingCodes];
|
20
28
|
|
21
29
|
type CountryCodeSelectProps = {
|
22
30
|
value: string;
|
@@ -10,7 +10,7 @@ import { AttachedInputs } from "./AttachedInputs";
|
|
10
10
|
|
11
11
|
type CountryCodeAndPhoneNumber = {
|
12
12
|
countryCode: string;
|
13
|
-
|
13
|
+
nationalNumber: string;
|
14
14
|
};
|
15
15
|
type PhoneNumberInputProps = BoxProps & {
|
16
16
|
/** The root name.
|
@@ -51,7 +51,7 @@ export const PhoneNumberInput = forwardRef<PhoneNumberInputProps, As>(
|
|
51
51
|
onChange: externalOnChange,
|
52
52
|
defaultValue: {
|
53
53
|
countryCode: "+47",
|
54
|
-
|
54
|
+
nationalNumber: "",
|
55
55
|
},
|
56
56
|
});
|
57
57
|
return (
|
@@ -74,7 +74,7 @@ export const PhoneNumberInput = forwardRef<PhoneNumberInputProps, As>(
|
|
74
74
|
onChange={(countryCode) =>
|
75
75
|
onChange({
|
76
76
|
countryCode: countryCode as string,
|
77
|
-
|
77
|
+
nationalNumber: value.nationalNumber,
|
78
78
|
})
|
79
79
|
}
|
80
80
|
name={name ? `${name}-country-code` : "country-code"}
|
@@ -85,12 +85,12 @@ export const PhoneNumberInput = forwardRef<PhoneNumberInputProps, As>(
|
|
85
85
|
<Input
|
86
86
|
ref={ref}
|
87
87
|
label={t(texts.phoneNumber)}
|
88
|
-
value={value.
|
88
|
+
value={value.nationalNumber}
|
89
89
|
name={name ? `${name}-phone-number` : "phone-number"}
|
90
90
|
onChange={(e) =>
|
91
91
|
onChange({
|
92
92
|
countryCode: value.countryCode,
|
93
|
-
|
93
|
+
nationalNumber: e.target.value,
|
94
94
|
})
|
95
95
|
}
|
96
96
|
position="relative"
|