@vygruppen/spor-react 9.12.0 → 9.13.1

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@9.12.0 build
2
+ > @vygruppen/spor-react@9.13.1 build
3
3
  > tsup src/index.tsx --dts --treeshake --format cjs,esm
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -9,12 +9,12 @@
9
9
  CJS Build start
10
10
  ESM Build start
11
11
  DTS Build start
12
+ CJS dist/index.js 526.31 KB
13
+ CJS ⚡️ Build success in 2183ms
12
14
  ESM dist/index.mjs 2.19 KB
13
- ESM dist/CountryCodeSelect-Q33DXFQF.mjs 1.19 KB
14
- ESM dist/chunk-D4Z4Q4GJ.mjs 413.15 KB
15
- ESM ⚡️ Build success in 2211ms
16
- CJS dist/index.js 526.05 KB
17
- CJS ⚡️ Build success in 2212ms
18
- DTS ⚡️ Build success in 13261ms
19
- DTS dist/index.d.ts 343.67 KB
20
- DTS dist/index.d.mts 343.67 KB
15
+ ESM dist/CountryCodeSelect-XKJDLCJZ.mjs 1.19 KB
16
+ ESM dist/chunk-NMEIV2NI.mjs 413.37 KB
17
+ ESM ⚡️ Build success in 2183ms
18
+ DTS ⚡️ Build success in 13025ms
19
+ DTS dist/index.d.ts 343.71 KB
20
+ DTS dist/index.d.mts 343.71 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 9.13.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 366d1f9: Adds onChange and fixes bug on RadioCard
8
+
9
+ ## 9.13.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 5d80df3: Updated packages
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [5d80df3]
18
+ - @vygruppen/spor-design-tokens@3.7.0
19
+ - @vygruppen/spor-icon-react@3.9.0
20
+
3
21
  ## 9.12.0
4
22
 
5
23
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- import { createTexts, useTranslation, InfoSelect, Item } from './chunk-D4Z4Q4GJ.mjs';
1
+ import { createTexts, useTranslation, InfoSelect, Item } from './chunk-NMEIV2NI.mjs';
2
2
  import React from 'react';
3
3
  import { getSupportedCallingCodes } from 'awesome-phonenumber';
4
4
 
@@ -1702,7 +1702,7 @@ var PhoneNumberInput = forwardRef(
1702
1702
  InfoSelect,
1703
1703
  {
1704
1704
  isLabelSrOnly: true,
1705
- label: "",
1705
+ label: t2(texts4.countryCodeLabel),
1706
1706
  width: "6.25rem",
1707
1707
  height: "100%",
1708
1708
  value: "+47"
@@ -1750,9 +1750,15 @@ var texts4 = createTexts({
1750
1750
  nn: "Telefonnummer",
1751
1751
  en: "Phone number",
1752
1752
  sv: "Telefonnummer"
1753
+ },
1754
+ countryCodeLabel: {
1755
+ nb: "Landskode",
1756
+ nn: "Landskode",
1757
+ en: "Country code",
1758
+ sv: "Landskod"
1753
1759
  }
1754
1760
  });
1755
- var LazyCountryCodeSelect = React87__default.lazy(() => import('./CountryCodeSelect-Q33DXFQF.mjs'));
1761
+ var LazyCountryCodeSelect = React87__default.lazy(() => import('./CountryCodeSelect-XKJDLCJZ.mjs'));
1756
1762
  var Radio = forwardRef((props, ref) => {
1757
1763
  return /* @__PURE__ */ React87__default.createElement(Radio$1, { ...props, ref });
1758
1764
  });
@@ -1896,6 +1902,7 @@ var RadioCardGroup = ({
1896
1902
  direction: direction2 = "row",
1897
1903
  groupLabel,
1898
1904
  defaultValue,
1905
+ onChange,
1899
1906
  ...props
1900
1907
  }) => {
1901
1908
  const [selectedValue, setSelectedValue] = useState(
@@ -1903,6 +1910,7 @@ var RadioCardGroup = ({
1903
1910
  );
1904
1911
  const handleChange = (value) => {
1905
1912
  setSelectedValue(value);
1913
+ onChange && onChange(value);
1906
1914
  };
1907
1915
  return /* @__PURE__ */ React87__default.createElement(
1908
1916
  RadioCardGroupContext.Provider,
@@ -1955,7 +1963,9 @@ var RadioCard = forwardRef(
1955
1963
  }
1956
1964
  if (event.key === "ArrowRight" || event.key === "ArrowDown" || event.key === "ArrowLeft" || event.key === "ArrowUp") {
1957
1965
  const nextRadioCard = event.currentTarget.nextElementSibling;
1958
- nextRadioCard.focus();
1966
+ if (nextRadioCard) {
1967
+ nextRadioCard.focus();
1968
+ }
1959
1969
  }
1960
1970
  };
1961
1971
  return /* @__PURE__ */ React87__default.createElement(Box, { as: "label", "aria-label": String(children), onKeyDown: handleKeyDown }, /* @__PURE__ */ React87__default.createElement(
package/dist/index.d.mts CHANGED
@@ -118,6 +118,7 @@ type RadioCardGroupProps = BoxProps & {
118
118
  direction?: "row" | "column";
119
119
  groupLabel?: string;
120
120
  defaultValue?: string;
121
+ onChange?: (value: string) => void;
121
122
  };
122
123
  declare const RadioCardGroup: React.FC<RadioCardGroupProps>;
123
124
 
package/dist/index.d.ts CHANGED
@@ -118,6 +118,7 @@ type RadioCardGroupProps = BoxProps & {
118
118
  direction?: "row" | "column";
119
119
  groupLabel?: string;
120
120
  defaultValue?: string;
121
+ onChange?: (value: string) => void;
121
122
  };
122
123
  declare const RadioCardGroup: React.FC<RadioCardGroupProps>;
123
124
 
package/dist/index.js CHANGED
@@ -1913,7 +1913,7 @@ var init_PhoneNumberInput = __esm({
1913
1913
  InfoSelect,
1914
1914
  {
1915
1915
  isLabelSrOnly: true,
1916
- label: "",
1916
+ label: t2(texts5.countryCodeLabel),
1917
1917
  width: "6.25rem",
1918
1918
  height: "100%",
1919
1919
  value: "+47"
@@ -1961,6 +1961,12 @@ var init_PhoneNumberInput = __esm({
1961
1961
  nn: "Telefonnummer",
1962
1962
  en: "Phone number",
1963
1963
  sv: "Telefonnummer"
1964
+ },
1965
+ countryCodeLabel: {
1966
+ nb: "Landskode",
1967
+ nn: "Landskode",
1968
+ en: "Country code",
1969
+ sv: "Landskod"
1964
1970
  }
1965
1971
  });
1966
1972
  LazyCountryCodeSelect = React88__namespace.default.lazy(() => Promise.resolve().then(() => (init_CountryCodeSelect(), CountryCodeSelect_exports)));
@@ -2164,6 +2170,7 @@ var init_RadioCardGroup = __esm({
2164
2170
  direction: direction2 = "row",
2165
2171
  groupLabel,
2166
2172
  defaultValue,
2173
+ onChange,
2167
2174
  ...props
2168
2175
  }) => {
2169
2176
  const [selectedValue, setSelectedValue] = React88.useState(
@@ -2171,6 +2178,7 @@ var init_RadioCardGroup = __esm({
2171
2178
  );
2172
2179
  const handleChange = (value) => {
2173
2180
  setSelectedValue(value);
2181
+ onChange && onChange(value);
2174
2182
  };
2175
2183
  return /* @__PURE__ */ React88__namespace.default.createElement(
2176
2184
  exports.RadioCardGroupContext.Provider,
@@ -2227,7 +2235,9 @@ var init_RadioCard = __esm({
2227
2235
  }
2228
2236
  if (event.key === "ArrowRight" || event.key === "ArrowDown" || event.key === "ArrowLeft" || event.key === "ArrowUp") {
2229
2237
  const nextRadioCard = event.currentTarget.nextElementSibling;
2230
- nextRadioCard.focus();
2238
+ if (nextRadioCard) {
2239
+ nextRadioCard.focus();
2240
+ }
2231
2241
  }
2232
2242
  };
2233
2243
  return /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { as: "label", "aria-label": String(children), onKeyDown: handleKeyDown }, /* @__PURE__ */ React88__namespace.default.createElement(
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, Card, CardSelect, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, Collapse, ColorInlineLoader, ColorSpinner, Combobox, Container, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkMode, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, ModalHeader as DrawerHeader, DrawerOverlay, Expandable, ExpandableAlert, ExpandableItem, Fade, Flex, FloatingActionButton, FormControl, FormErrorMessage, FormHelperText, FormLabel, FullScreenDrawer, Grid, GridItem, HStack, Heading, IconButton, Image, Img, InfoSelect, InfoTag, Input, InputGroup, InputLeftElement, InputRightElement, Item, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightMode, LightSpinner, LineIcon, ListBox, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, Nudge, NumericStepper, OrderedList, Pagination, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, PressableCard, PrideProvider, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardGroupContext, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, StaticCard, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, TogglePride, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, VyLogoDefault, VyLogoPride, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, usePride, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-D4Z4Q4GJ.mjs';
1
+ export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, Card, CardSelect, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, Collapse, ColorInlineLoader, ColorSpinner, Combobox, Container, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkMode, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, ModalHeader as DrawerHeader, DrawerOverlay, Expandable, ExpandableAlert, ExpandableItem, Fade, Flex, FloatingActionButton, FormControl, FormErrorMessage, FormHelperText, FormLabel, FullScreenDrawer, Grid, GridItem, HStack, Heading, IconButton, Image, Img, InfoSelect, InfoTag, Input, InputGroup, InputLeftElement, InputRightElement, Item, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightMode, LightSpinner, LineIcon, ListBox, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, Nudge, NumericStepper, OrderedList, Pagination, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, PressableCard, PrideProvider, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardGroupContext, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, StaticCard, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, TogglePride, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, VyLogoDefault, VyLogoPride, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, usePride, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-NMEIV2NI.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
- "version": "9.12.0",
3
+ "version": "9.13.1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -17,31 +17,31 @@
17
17
  "directory": "packages/spor-react"
18
18
  },
19
19
  "dependencies": {
20
- "@chakra-ui/react": "^2.6.1",
20
+ "@chakra-ui/react": "^2.8.2",
21
21
  "@chakra-ui/theme-tools": "^2.0.12",
22
- "@emotion/react": "^11.10.4",
23
- "@emotion/styled": "^11.10.4",
24
- "@internationalized/date": "^3.0.1",
25
- "@vygruppen/spor-design-tokens": ">3.6.0",
26
- "@vygruppen/spor-icon-react": ">3.6.0",
27
- "@vygruppen/spor-loader": ">0.3.1",
28
- "awesome-phonenumber": "^5.10.0",
22
+ "@emotion/react": "^11.11.4",
23
+ "@emotion/styled": "^11.11.5",
24
+ "@internationalized/date": "^3.5.4",
25
+ "@vygruppen/spor-design-tokens": "^3.7.0",
26
+ "@vygruppen/spor-icon-react": "^3.9.0",
27
+ "@vygruppen/spor-loader": "^0.4.0",
28
+ "awesome-phonenumber": "^5.11.0",
29
29
  "deepmerge": "^4.3.1",
30
30
  "framer-motion": "^9.1.7",
31
- "lottie-react": "^2.3.1",
32
- "react-aria": "^3.30.0",
33
- "react-stately": "^3.28.0",
34
- "react-swipeable": "^7.0.0"
31
+ "lottie-react": "^2.4.0",
32
+ "react-aria": "^3.33.1",
33
+ "react-stately": "^3.31.1",
34
+ "react-swipeable": "^7.0.1"
35
35
  },
36
36
  "devDependencies": {
37
- "@testing-library/jest-dom": "^6.1.3",
38
- "@testing-library/react": "^14.0.0",
39
- "react": "^18.2.0",
40
- "react-dom": "^18.2.0",
37
+ "@testing-library/jest-dom": "^6.4.5",
38
+ "@testing-library/react": "^14.3.1",
39
+ "react": "^18.3.1",
40
+ "react-dom": "^18.3.1",
41
41
  "tsup": "^7.2.0",
42
42
  "vitest": "^0.26.3",
43
43
  "vitest-axe": "^0.1.0",
44
- "vitest-canvas-mock": "^0.2.0"
44
+ "vitest-canvas-mock": "^0.2.2"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": "^18.2.0",
@@ -69,7 +69,7 @@ export const PhoneNumberInput = forwardRef<PhoneNumberInputProps, As>(
69
69
  fallback={
70
70
  <InfoSelect
71
71
  isLabelSrOnly
72
- label=""
72
+ label={t(texts.countryCodeLabel)}
73
73
  width="6.25rem"
74
74
  height="100%"
75
75
  value="+47"
@@ -120,6 +120,12 @@ const texts = createTexts({
120
120
  en: "Phone number",
121
121
  sv: "Telefonnummer",
122
122
  },
123
+ countryCodeLabel: {
124
+ nb: "Landskode",
125
+ nn: "Landskode",
126
+ en: "Country code",
127
+ sv: "Landskod",
128
+ },
123
129
  });
124
130
 
125
131
  const LazyCountryCodeSelect = React.lazy(() => import("./CountryCodeSelect"));
@@ -73,7 +73,9 @@ export const RadioCard = forwardRef(
73
73
  ) {
74
74
  const nextRadioCard = event.currentTarget
75
75
  .nextElementSibling as HTMLElement;
76
- nextRadioCard.focus();
76
+ if (nextRadioCard) {
77
+ nextRadioCard.focus();
78
+ }
77
79
  }
78
80
  };
79
81
 
@@ -27,6 +27,7 @@ type RadioCardGroupProps = BoxProps & {
27
27
  direction?: "row" | "column";
28
28
  groupLabel?: string;
29
29
  defaultValue?: string;
30
+ onChange?: (value: string) => void;
30
31
  };
31
32
 
32
33
  export const RadioCardGroup: React.FC<RadioCardGroupProps> = ({
@@ -36,6 +37,7 @@ export const RadioCardGroup: React.FC<RadioCardGroupProps> = ({
36
37
  direction = "row",
37
38
  groupLabel,
38
39
  defaultValue,
40
+ onChange,
39
41
  ...props
40
42
  }: RadioCardGroupProps) => {
41
43
  const [selectedValue, setSelectedValue] = useState<string>(
@@ -44,6 +46,7 @@ export const RadioCardGroup: React.FC<RadioCardGroupProps> = ({
44
46
 
45
47
  const handleChange = (value: string) => {
46
48
  setSelectedValue(value);
49
+ onChange && onChange(value);
47
50
  };
48
51
 
49
52
  return (