@vygruppen/spor-react 11.3.6 → 11.3.7

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@11.3.6 build /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@11.3.7 build /home/runner/work/spor/spor/packages/spor-react
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -10,12 +10,12 @@ CLI Target: node16
10
10
  CJS Build start
11
11
  ESM Build start
12
12
  DTS Build start
13
- CJS dist/index.js 287.92 KB
14
- CJS dist/index.js.map 591.55 KB
15
- CJS ⚡️ Build success in 2575ms
16
- ESM dist/index.mjs 269.06 KB
17
- ESM dist/index.mjs.map 591.55 KB
18
- ESM ⚡️ Build success in 2575ms
19
- DTS ⚡️ Build success in 17931ms
20
- DTS dist/index.d.ts 341.83 KB
21
- DTS dist/index.d.mts 341.83 KB
13
+ CJS dist/index.js 288.05 KB
14
+ CJS dist/index.js.map 592.13 KB
15
+ CJS ⚡️ Build success in 2507ms
16
+ ESM dist/index.mjs 269.19 KB
17
+ ESM dist/index.mjs.map 592.13 KB
18
+ ESM ⚡️ Build success in 2507ms
19
+ DTS ⚡️ Build success in 17542ms
20
+ DTS dist/index.d.ts 342.06 KB
21
+ DTS dist/index.d.mts 342.06 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 11.3.7
4
+
5
+ ### Patch Changes
6
+
7
+ - d4cfe80: Update PhoneNumberInput name prop
8
+
3
9
  ## 11.3.6
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1346,9 +1346,12 @@ type PhoneNumberInputProps = Omit<BoxProps, "onChange"> & {
1346
1346
  label?: string;
1347
1347
  /** The root name.
1348
1348
  *
1349
- * Please note that when specifying the name, the rendered names will be `${name}-country-code` and `${name}-phone-number`, respectively
1349
+ * Please note that when specifying the name, the rendered names will be `${name}-country-code` and `${name}-phone-number` unless a name is provided for both countryCode and nationalNumber.
1350
1350
  */
1351
- name?: string;
1351
+ name?: string | {
1352
+ countryCode: string;
1353
+ nationalNumber: string;
1354
+ };
1352
1355
  /** Callback for when the country code or phone number changes */
1353
1356
  onChange?: (change: CountryCodeAndPhoneNumber) => void;
1354
1357
  /** The optional value of the country code and phone number */
@@ -1363,7 +1366,7 @@ type PhoneNumberInputProps = Omit<BoxProps, "onChange"> & {
1363
1366
  * <PhoneNumberInput name="phone" />
1364
1367
  * ```
1365
1368
  *
1366
- * > Please note that when specifying the name, the rendered names will be `${name}-country-code` and `${name}-phone-number`, respectively
1369
+ * > Please note that when specifying the name, the rendered names will be `${name}-country-code` and `${name}-phone-number` unless a name is provided for both countryCode and nationalNumber.
1367
1370
  *
1368
1371
  * The field can be controlled as well:
1369
1372
  * ```tsx
@@ -9481,4 +9484,4 @@ declare const useMediaQuery: typeof useMediaQuery$1;
9481
9484
  **/
9482
9485
  declare function slugify(text: string | string[], maxLength?: number): string;
9483
9486
 
9484
- export { Accordion, type AccordionProps, AttachedInputs, Badge, type BadgeProps, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, CardSelect, CargonetLogo, type CargonetLogoProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, ChoiceChip, type ChoiceChipProps, ClosableAlert, CloseButton, type CloseButtonProps, Code, type CodeProps, ColorInlineLoader, type ColorInlineLoaderProps, ColorSpinner, type ColorSpinnerProps, Combobox, type ComboboxProps, ContentLoader, type ContentLoaderProps, DarkFullScreenLoader, DarkInlineLoader, type DarkInlineLoaderProps, DarkSpinner, type DarkSpinnerProps, DatePicker, DateRangePicker, Divider, type DividerProps, Drawer, type DrawerBodyProps, DrawerContent, ModalHeader as DrawerHeader, Expandable, ExpandableAlert, ExpandableItem, type ExpandableItemProps, FloatingActionButton, FormErrorMessage, type FormErrorMessageProps, FormLabel, type FormLabelProps, FullScreenDrawer, Heading, type HeadingProps, IconButton, type IconButtonProps, InfoSelect, InfoTag, type InfoTagProps, Input, type InputElementProps, InputLeftElement, type InputProps, InputRightElement, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, type LightInlineLoaderProps, LightSpinner, type LightSpinnerProps, LineIcon, type LineIconProps, ListBox, ModalHeader, type ModalHeaderProps, NativeSelect, type NativeSelectProps, Nudge, type NudgeProps, NumericStepper, Pagination, PasswordInput, type PasswordInputProps, PhoneNumberInput, PlayPauseButton, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardGroupContext, type RadioCardProps, RadioGroup, type RadioGroupProps, type RadioProps, SearchInput, type SearchInputProps, ServiceAlert, SimpleDrawer, type SimpleDrawerProps, Skeleton, SkeletonCircle, type SkeletonCircleProps, type SkeletonProps, SkeletonText, type SkeletonTextProps, SkipButton, type SpinnerProps, SporProvider, Stack, type StackProps, StaticAlert, StaticCard, type StaticCardProps, Stepper, StepperStep, Switch, type SwitchProps, Table, type TableProps, Tabs, type TabsProps, Text, TextLink, type TextProps, Textarea, type TextareaProps, TimePicker, type ToastOptions, Tooltip, type TooltipProps, type TranslationObject, type Translations, TravelTag, type TravelTagProps, VyLogo, VyLogoPride, type VyLogoPrideProps, type VyLogoProps, WizardNudge, type WizardNudgeProps, brandTheme, createTexts, fontFaces, slugify, theme, useMediaQuery, useToast, useTranslation };
9487
+ export { Accordion, type AccordionProps, AttachedInputs, Badge, type BadgeProps, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, CardSelect, CargonetLogo, type CargonetLogoProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, ChoiceChip, type ChoiceChipProps, ClosableAlert, CloseButton, type CloseButtonProps, Code, type CodeProps, ColorInlineLoader, type ColorInlineLoaderProps, ColorSpinner, type ColorSpinnerProps, Combobox, type ComboboxProps, ContentLoader, type ContentLoaderProps, type CountryCodeAndPhoneNumber, DarkFullScreenLoader, DarkInlineLoader, type DarkInlineLoaderProps, DarkSpinner, type DarkSpinnerProps, DatePicker, DateRangePicker, Divider, type DividerProps, Drawer, type DrawerBodyProps, DrawerContent, ModalHeader as DrawerHeader, Expandable, ExpandableAlert, ExpandableItem, type ExpandableItemProps, FloatingActionButton, FormErrorMessage, type FormErrorMessageProps, FormLabel, type FormLabelProps, FullScreenDrawer, Heading, type HeadingProps, IconButton, type IconButtonProps, InfoSelect, InfoTag, type InfoTagProps, Input, type InputElementProps, InputLeftElement, type InputProps, InputRightElement, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, type LightInlineLoaderProps, LightSpinner, type LightSpinnerProps, LineIcon, type LineIconProps, ListBox, ModalHeader, type ModalHeaderProps, NativeSelect, type NativeSelectProps, Nudge, type NudgeProps, NumericStepper, Pagination, PasswordInput, type PasswordInputProps, PhoneNumberInput, type PhoneNumberInputProps, PlayPauseButton, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardGroupContext, type RadioCardProps, RadioGroup, type RadioGroupProps, type RadioProps, SearchInput, type SearchInputProps, ServiceAlert, SimpleDrawer, type SimpleDrawerProps, Skeleton, SkeletonCircle, type SkeletonCircleProps, type SkeletonProps, SkeletonText, type SkeletonTextProps, SkipButton, type SpinnerProps, SporProvider, Stack, type StackProps, StaticAlert, StaticCard, type StaticCardProps, Stepper, StepperStep, Switch, type SwitchProps, Table, type TableProps, Tabs, type TabsProps, Text, TextLink, type TextProps, Textarea, type TextareaProps, TimePicker, type ToastOptions, Tooltip, type TooltipProps, type TranslationObject, type Translations, TravelTag, type TravelTagProps, VyLogo, VyLogoPride, type VyLogoPrideProps, type VyLogoProps, WizardNudge, type WizardNudgeProps, brandTheme, createTexts, fontFaces, slugify, theme, useMediaQuery, useToast, useTranslation };
package/dist/index.d.ts CHANGED
@@ -1346,9 +1346,12 @@ type PhoneNumberInputProps = Omit<BoxProps, "onChange"> & {
1346
1346
  label?: string;
1347
1347
  /** The root name.
1348
1348
  *
1349
- * Please note that when specifying the name, the rendered names will be `${name}-country-code` and `${name}-phone-number`, respectively
1349
+ * Please note that when specifying the name, the rendered names will be `${name}-country-code` and `${name}-phone-number` unless a name is provided for both countryCode and nationalNumber.
1350
1350
  */
1351
- name?: string;
1351
+ name?: string | {
1352
+ countryCode: string;
1353
+ nationalNumber: string;
1354
+ };
1352
1355
  /** Callback for when the country code or phone number changes */
1353
1356
  onChange?: (change: CountryCodeAndPhoneNumber) => void;
1354
1357
  /** The optional value of the country code and phone number */
@@ -1363,7 +1366,7 @@ type PhoneNumberInputProps = Omit<BoxProps, "onChange"> & {
1363
1366
  * <PhoneNumberInput name="phone" />
1364
1367
  * ```
1365
1368
  *
1366
- * > Please note that when specifying the name, the rendered names will be `${name}-country-code` and `${name}-phone-number`, respectively
1369
+ * > Please note that when specifying the name, the rendered names will be `${name}-country-code` and `${name}-phone-number` unless a name is provided for both countryCode and nationalNumber.
1367
1370
  *
1368
1371
  * The field can be controlled as well:
1369
1372
  * ```tsx
@@ -9481,4 +9484,4 @@ declare const useMediaQuery: typeof useMediaQuery$1;
9481
9484
  **/
9482
9485
  declare function slugify(text: string | string[], maxLength?: number): string;
9483
9486
 
9484
- export { Accordion, type AccordionProps, AttachedInputs, Badge, type BadgeProps, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, CardSelect, CargonetLogo, type CargonetLogoProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, ChoiceChip, type ChoiceChipProps, ClosableAlert, CloseButton, type CloseButtonProps, Code, type CodeProps, ColorInlineLoader, type ColorInlineLoaderProps, ColorSpinner, type ColorSpinnerProps, Combobox, type ComboboxProps, ContentLoader, type ContentLoaderProps, DarkFullScreenLoader, DarkInlineLoader, type DarkInlineLoaderProps, DarkSpinner, type DarkSpinnerProps, DatePicker, DateRangePicker, Divider, type DividerProps, Drawer, type DrawerBodyProps, DrawerContent, ModalHeader as DrawerHeader, Expandable, ExpandableAlert, ExpandableItem, type ExpandableItemProps, FloatingActionButton, FormErrorMessage, type FormErrorMessageProps, FormLabel, type FormLabelProps, FullScreenDrawer, Heading, type HeadingProps, IconButton, type IconButtonProps, InfoSelect, InfoTag, type InfoTagProps, Input, type InputElementProps, InputLeftElement, type InputProps, InputRightElement, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, type LightInlineLoaderProps, LightSpinner, type LightSpinnerProps, LineIcon, type LineIconProps, ListBox, ModalHeader, type ModalHeaderProps, NativeSelect, type NativeSelectProps, Nudge, type NudgeProps, NumericStepper, Pagination, PasswordInput, type PasswordInputProps, PhoneNumberInput, PlayPauseButton, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardGroupContext, type RadioCardProps, RadioGroup, type RadioGroupProps, type RadioProps, SearchInput, type SearchInputProps, ServiceAlert, SimpleDrawer, type SimpleDrawerProps, Skeleton, SkeletonCircle, type SkeletonCircleProps, type SkeletonProps, SkeletonText, type SkeletonTextProps, SkipButton, type SpinnerProps, SporProvider, Stack, type StackProps, StaticAlert, StaticCard, type StaticCardProps, Stepper, StepperStep, Switch, type SwitchProps, Table, type TableProps, Tabs, type TabsProps, Text, TextLink, type TextProps, Textarea, type TextareaProps, TimePicker, type ToastOptions, Tooltip, type TooltipProps, type TranslationObject, type Translations, TravelTag, type TravelTagProps, VyLogo, VyLogoPride, type VyLogoPrideProps, type VyLogoProps, WizardNudge, type WizardNudgeProps, brandTheme, createTexts, fontFaces, slugify, theme, useMediaQuery, useToast, useTranslation };
9487
+ export { Accordion, type AccordionProps, AttachedInputs, Badge, type BadgeProps, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, CardSelect, CargonetLogo, type CargonetLogoProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, ChoiceChip, type ChoiceChipProps, ClosableAlert, CloseButton, type CloseButtonProps, Code, type CodeProps, ColorInlineLoader, type ColorInlineLoaderProps, ColorSpinner, type ColorSpinnerProps, Combobox, type ComboboxProps, ContentLoader, type ContentLoaderProps, type CountryCodeAndPhoneNumber, DarkFullScreenLoader, DarkInlineLoader, type DarkInlineLoaderProps, DarkSpinner, type DarkSpinnerProps, DatePicker, DateRangePicker, Divider, type DividerProps, Drawer, type DrawerBodyProps, DrawerContent, ModalHeader as DrawerHeader, Expandable, ExpandableAlert, ExpandableItem, type ExpandableItemProps, FloatingActionButton, FormErrorMessage, type FormErrorMessageProps, FormLabel, type FormLabelProps, FullScreenDrawer, Heading, type HeadingProps, IconButton, type IconButtonProps, InfoSelect, InfoTag, type InfoTagProps, Input, type InputElementProps, InputLeftElement, type InputProps, InputRightElement, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, type LightInlineLoaderProps, LightSpinner, type LightSpinnerProps, LineIcon, type LineIconProps, ListBox, ModalHeader, type ModalHeaderProps, NativeSelect, type NativeSelectProps, Nudge, type NudgeProps, NumericStepper, Pagination, PasswordInput, type PasswordInputProps, PhoneNumberInput, type PhoneNumberInputProps, PlayPauseButton, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardGroupContext, type RadioCardProps, RadioGroup, type RadioGroupProps, type RadioProps, SearchInput, type SearchInputProps, ServiceAlert, SimpleDrawer, type SimpleDrawerProps, Skeleton, SkeletonCircle, type SkeletonCircleProps, type SkeletonProps, SkeletonText, type SkeletonTextProps, SkipButton, type SpinnerProps, SporProvider, Stack, type StackProps, StaticAlert, StaticCard, type StaticCardProps, Stepper, StepperStep, Switch, type SwitchProps, Table, type TableProps, Tabs, type TabsProps, Text, TextLink, type TextProps, Textarea, type TextareaProps, TimePicker, type ToastOptions, Tooltip, type TooltipProps, type TranslationObject, type Translations, TravelTag, type TravelTagProps, VyLogo, VyLogoPride, type VyLogoPrideProps, type VyLogoProps, WizardNudge, type WizardNudgeProps, brandTheme, createTexts, fontFaces, slugify, theme, useMediaQuery, useToast, useTranslation };
package/dist/index.js CHANGED
@@ -1117,7 +1117,7 @@ var PhoneNumberInput = react.forwardRef(
1117
1117
  countryCode,
1118
1118
  nationalNumber: value.nationalNumber
1119
1119
  }),
1120
- name: name ? `${name}-country-code` : "country-code",
1120
+ name: name ? typeof name !== "string" && name.countryCode ? name.countryCode : `${name}-country-code` : "country-code",
1121
1121
  height: "100%",
1122
1122
  width: "6.25rem",
1123
1123
  variant
@@ -1129,7 +1129,7 @@ var PhoneNumberInput = react.forwardRef(
1129
1129
  type: "tel",
1130
1130
  label,
1131
1131
  value: value.nationalNumber,
1132
- name: name ? `${name}-phone-number` : "phone-number",
1132
+ name: name ? typeof name !== "string" && name.nationalNumber ? name.nationalNumber : `${name}-phone-number` : "phone-number",
1133
1133
  onChange: (e) => {
1134
1134
  const strippedValue = e.target.value.replace(/[^\d\s-]/g, "");
1135
1135
  onChange({