@vygruppen/spor-react 10.5.0 → 10.6.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@10.5.0 build
2
+ > @vygruppen/spor-react@10.6.1 build
3
3
  > tsup src/index.tsx --dts --treeshake --format cjs,esm
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -10,11 +10,11 @@
10
10
  ESM Build start
11
11
  DTS Build start
12
12
  ESM dist/index.mjs 2.16 KB
13
- ESM dist/CountryCodeSelect-QMX6VHNM.mjs 1.22 KB
14
- ESM dist/chunk-CHJ6LT66.mjs 424.51 KB
15
- ESM ⚡️ Build success in 2272ms
16
- CJS dist/index.js 537.90 KB
17
- CJS ⚡️ Build success in 2273ms
18
- DTS ⚡️ Build success in 15423ms
19
- DTS dist/index.d.ts 339.25 KB
20
- DTS dist/index.d.mts 339.25 KB
13
+ ESM dist/CountryCodeSelect-SIB4RO26.mjs 1.22 KB
14
+ ESM dist/chunk-RQ4CWVFZ.mjs 425.08 KB
15
+ ESM ⚡️ Build success in 2278ms
16
+ CJS dist/index.js 538.54 KB
17
+ CJS ⚡️ Build success in 2279ms
18
+ DTS ⚡️ Build success in 15683ms
19
+ DTS dist/index.d.ts 339.80 KB
20
+ DTS dist/index.d.mts 339.80 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 10.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 22459d4: Added outline color of ExpandableAlert like the design
8
+
9
+ ## 10.6.0
10
+
11
+ ### Minor Changes
12
+
13
+ - be4754b: PhoneNumberInput: Added the option to display the input as optional
14
+
3
15
  ## 10.5.0
4
16
 
5
17
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- import { createTexts, useTranslation, InfoSelect, Item } from './chunk-CHJ6LT66.mjs';
1
+ import { createTexts, useTranslation, InfoSelect, Item } from './chunk-RQ4CWVFZ.mjs';
2
2
  import React from 'react';
3
3
  import { getSupportedCallingCodes } from 'awesome-phonenumber';
4
4
 
@@ -1756,10 +1756,11 @@ var PhoneNumberInput = forwardRef(
1756
1756
  value: externalValue,
1757
1757
  onChange: externalOnChange,
1758
1758
  variant,
1759
+ isOptional,
1759
1760
  ...boxProps
1760
1761
  }, ref) => {
1761
1762
  const { t: t2 } = useTranslation();
1762
- const label = externalLabel ?? t2(texts4.phoneNumber);
1763
+ const label = externalLabel ?? isOptional ? t2(texts4.phoneNumberOptional) : t2(texts4.phoneNumber);
1763
1764
  const [value, onChange] = useControllableState({
1764
1765
  value: externalValue,
1765
1766
  onChange: externalOnChange,
@@ -1827,6 +1828,12 @@ var texts4 = createTexts({
1827
1828
  en: "Phone number",
1828
1829
  sv: "Telefonnummer"
1829
1830
  },
1831
+ phoneNumberOptional: {
1832
+ nb: "Telefonnummer (valgfritt)",
1833
+ nn: "Telefonnummer (valgfritt)",
1834
+ en: "Phone number (optional)",
1835
+ sv: "Telefonnummer (valfritt)"
1836
+ },
1830
1837
  countryCodeLabel: {
1831
1838
  nb: "Landskode",
1832
1839
  nn: "Landskode",
@@ -1834,7 +1841,7 @@ var texts4 = createTexts({
1834
1841
  sv: "Landskod"
1835
1842
  }
1836
1843
  });
1837
- var LazyCountryCodeSelect = React85__default.lazy(() => import('./CountryCodeSelect-QMX6VHNM.mjs'));
1844
+ var LazyCountryCodeSelect = React85__default.lazy(() => import('./CountryCodeSelect-SIB4RO26.mjs'));
1838
1845
  var Radio = forwardRef((props, ref) => {
1839
1846
  return /* @__PURE__ */ React85__default.createElement(Radio$1, { ...props, ref });
1840
1847
  });
@@ -2808,7 +2815,7 @@ var ExpandableAlert = ({
2808
2815
  allowToggle: true,
2809
2816
  flexGrow: "1"
2810
2817
  },
2811
- /* @__PURE__ */ React85__default.createElement(AccordionItem, null, /* @__PURE__ */ React85__default.createElement(AccordionButton, { sx: styles3.container }, /* @__PURE__ */ React85__default.createElement(
2818
+ /* @__PURE__ */ React85__default.createElement(AccordionItem, { sx: styles3.accordion }, /* @__PURE__ */ React85__default.createElement(AccordionButton, { sx: styles3.container }, /* @__PURE__ */ React85__default.createElement(
2812
2819
  Flex,
2813
2820
  {
2814
2821
  justifyContent: "space-between",
@@ -10758,7 +10765,7 @@ var config3 = helpers2.defineMultiStyleConfig({
10758
10765
  var alert_default = config3;
10759
10766
 
10760
10767
  // src/theme/components/alert-expandable.ts
10761
- var parts2 = anatomy("alertExpandable").parts("container");
10768
+ var parts2 = anatomy("alertExpandable").parts("container", "accordion");
10762
10769
  var helpers3 = createMultiStyleConfigHelpers(parts2.keys);
10763
10770
  var config4 = helpers3.defineMultiStyleConfig({
10764
10771
  baseStyle: {
@@ -10778,6 +10785,9 @@ var config4 = helpers3.defineMultiStyleConfig({
10778
10785
  },
10779
10786
  variants: {
10780
10787
  info: {
10788
+ accordion: {
10789
+ outlineColor: "cloudy"
10790
+ },
10781
10791
  container: {
10782
10792
  _hover: {
10783
10793
  outlineColor: "sky"
@@ -10788,6 +10798,9 @@ var config4 = helpers3.defineMultiStyleConfig({
10788
10798
  }
10789
10799
  },
10790
10800
  success: {
10801
+ accordion: {
10802
+ outlineColor: "coralGreen"
10803
+ },
10791
10804
  container: {
10792
10805
  _hover: {
10793
10806
  outlineColor: "blueGreen"
@@ -10798,6 +10811,9 @@ var config4 = helpers3.defineMultiStyleConfig({
10798
10811
  }
10799
10812
  },
10800
10813
  warning: {
10814
+ accordion: {
10815
+ outlineColor: "primrose"
10816
+ },
10801
10817
  container: {
10802
10818
  _hover: {
10803
10819
  outlineColor: "sunshine"
@@ -10808,6 +10824,9 @@ var config4 = helpers3.defineMultiStyleConfig({
10808
10824
  }
10809
10825
  },
10810
10826
  "alt-transport": {
10827
+ accordion: {
10828
+ outlineColor: "burntYellow"
10829
+ },
10811
10830
  container: {
10812
10831
  _hover: {
10813
10832
  outlineColor: "golden"
@@ -10818,6 +10837,9 @@ var config4 = helpers3.defineMultiStyleConfig({
10818
10837
  }
10819
10838
  },
10820
10839
  error: {
10840
+ accordion: {
10841
+ outlineColor: "salmon"
10842
+ },
10821
10843
  container: {
10822
10844
  _hover: {
10823
10845
  outlineColor: "apricot"
package/dist/index.d.mts CHANGED
@@ -1356,6 +1356,7 @@ type PhoneNumberInputProps = Omit<BoxProps, "onChange"> & {
1356
1356
  /** The optional value of the country code and phone number */
1357
1357
  value?: CountryCodeAndPhoneNumber;
1358
1358
  variant?: "base" | "floating";
1359
+ isOptional?: boolean;
1359
1360
  };
1360
1361
  /**
1361
1362
  * A component for entering phone numbers.
@@ -2557,11 +2558,14 @@ declare const theme: {
2557
2558
  } | undefined;
2558
2559
  sizes?: {
2559
2560
  [key: string]: _chakra_ui_styled_system.PartsStyleInterpolation<{
2560
- keys: "container"[];
2561
+ keys: ("container" | "accordion")[];
2561
2562
  }>;
2562
2563
  } | undefined;
2563
2564
  variants?: {
2564
2565
  info: {
2566
+ accordion: {
2567
+ outlineColor: string;
2568
+ };
2565
2569
  container: {
2566
2570
  _hover: {
2567
2571
  outlineColor: string;
@@ -2572,6 +2576,9 @@ declare const theme: {
2572
2576
  };
2573
2577
  };
2574
2578
  success: {
2579
+ accordion: {
2580
+ outlineColor: string;
2581
+ };
2575
2582
  container: {
2576
2583
  _hover: {
2577
2584
  outlineColor: string;
@@ -2582,6 +2589,9 @@ declare const theme: {
2582
2589
  };
2583
2590
  };
2584
2591
  warning: {
2592
+ accordion: {
2593
+ outlineColor: string;
2594
+ };
2585
2595
  container: {
2586
2596
  _hover: {
2587
2597
  outlineColor: string;
@@ -2592,6 +2602,9 @@ declare const theme: {
2592
2602
  };
2593
2603
  };
2594
2604
  "alt-transport": {
2605
+ accordion: {
2606
+ outlineColor: string;
2607
+ };
2595
2608
  container: {
2596
2609
  _hover: {
2597
2610
  outlineColor: string;
@@ -2602,6 +2615,9 @@ declare const theme: {
2602
2615
  };
2603
2616
  };
2604
2617
  error: {
2618
+ accordion: {
2619
+ outlineColor: string;
2620
+ };
2605
2621
  container: {
2606
2622
  _hover: {
2607
2623
  outlineColor: string;
@@ -2627,7 +2643,7 @@ declare const theme: {
2627
2643
  variant?: "error" | "info" | "success" | "warning" | "alt-transport" | "service" | undefined;
2628
2644
  colorScheme?: string | undefined;
2629
2645
  } | undefined;
2630
- parts: "container"[];
2646
+ parts: ("container" | "accordion")[];
2631
2647
  };
2632
2648
  AlertService: {
2633
2649
  baseStyle?: {
package/dist/index.d.ts CHANGED
@@ -1356,6 +1356,7 @@ type PhoneNumberInputProps = Omit<BoxProps, "onChange"> & {
1356
1356
  /** The optional value of the country code and phone number */
1357
1357
  value?: CountryCodeAndPhoneNumber;
1358
1358
  variant?: "base" | "floating";
1359
+ isOptional?: boolean;
1359
1360
  };
1360
1361
  /**
1361
1362
  * A component for entering phone numbers.
@@ -2557,11 +2558,14 @@ declare const theme: {
2557
2558
  } | undefined;
2558
2559
  sizes?: {
2559
2560
  [key: string]: _chakra_ui_styled_system.PartsStyleInterpolation<{
2560
- keys: "container"[];
2561
+ keys: ("container" | "accordion")[];
2561
2562
  }>;
2562
2563
  } | undefined;
2563
2564
  variants?: {
2564
2565
  info: {
2566
+ accordion: {
2567
+ outlineColor: string;
2568
+ };
2565
2569
  container: {
2566
2570
  _hover: {
2567
2571
  outlineColor: string;
@@ -2572,6 +2576,9 @@ declare const theme: {
2572
2576
  };
2573
2577
  };
2574
2578
  success: {
2579
+ accordion: {
2580
+ outlineColor: string;
2581
+ };
2575
2582
  container: {
2576
2583
  _hover: {
2577
2584
  outlineColor: string;
@@ -2582,6 +2589,9 @@ declare const theme: {
2582
2589
  };
2583
2590
  };
2584
2591
  warning: {
2592
+ accordion: {
2593
+ outlineColor: string;
2594
+ };
2585
2595
  container: {
2586
2596
  _hover: {
2587
2597
  outlineColor: string;
@@ -2592,6 +2602,9 @@ declare const theme: {
2592
2602
  };
2593
2603
  };
2594
2604
  "alt-transport": {
2605
+ accordion: {
2606
+ outlineColor: string;
2607
+ };
2595
2608
  container: {
2596
2609
  _hover: {
2597
2610
  outlineColor: string;
@@ -2602,6 +2615,9 @@ declare const theme: {
2602
2615
  };
2603
2616
  };
2604
2617
  error: {
2618
+ accordion: {
2619
+ outlineColor: string;
2620
+ };
2605
2621
  container: {
2606
2622
  _hover: {
2607
2623
  outlineColor: string;
@@ -2627,7 +2643,7 @@ declare const theme: {
2627
2643
  variant?: "error" | "info" | "success" | "warning" | "alt-transport" | "service" | undefined;
2628
2644
  colorScheme?: string | undefined;
2629
2645
  } | undefined;
2630
- parts: "container"[];
2646
+ parts: ("container" | "accordion")[];
2631
2647
  };
2632
2648
  AlertService: {
2633
2649
  baseStyle?: {
package/dist/index.js CHANGED
@@ -1968,10 +1968,11 @@ var init_PhoneNumberInput = __esm({
1968
1968
  value: externalValue,
1969
1969
  onChange: externalOnChange,
1970
1970
  variant,
1971
+ isOptional,
1971
1972
  ...boxProps
1972
1973
  }, ref) => {
1973
1974
  const { t: t2 } = useTranslation();
1974
- const label = externalLabel ?? t2(texts5.phoneNumber);
1975
+ const label = externalLabel ?? isOptional ? t2(texts5.phoneNumberOptional) : t2(texts5.phoneNumber);
1975
1976
  const [value, onChange] = react.useControllableState({
1976
1977
  value: externalValue,
1977
1978
  onChange: externalOnChange,
@@ -2039,6 +2040,12 @@ var init_PhoneNumberInput = __esm({
2039
2040
  en: "Phone number",
2040
2041
  sv: "Telefonnummer"
2041
2042
  },
2043
+ phoneNumberOptional: {
2044
+ nb: "Telefonnummer (valgfritt)",
2045
+ nn: "Telefonnummer (valgfritt)",
2046
+ en: "Phone number (optional)",
2047
+ sv: "Telefonnummer (valfritt)"
2048
+ },
2042
2049
  countryCodeLabel: {
2043
2050
  nb: "Landskode",
2044
2051
  nn: "Landskode",
@@ -3315,7 +3322,7 @@ var init_ExpandableAlert = __esm({
3315
3322
  allowToggle: true,
3316
3323
  flexGrow: "1"
3317
3324
  },
3318
- /* @__PURE__ */ React86__namespace.default.createElement(react.AccordionItem, null, /* @__PURE__ */ React86__namespace.default.createElement(react.AccordionButton, { sx: styles3.container }, /* @__PURE__ */ React86__namespace.default.createElement(
3325
+ /* @__PURE__ */ React86__namespace.default.createElement(react.AccordionItem, { sx: styles3.accordion }, /* @__PURE__ */ React86__namespace.default.createElement(react.AccordionButton, { sx: styles3.container }, /* @__PURE__ */ React86__namespace.default.createElement(
3319
3326
  react.Flex,
3320
3327
  {
3321
3328
  justifyContent: "space-between",
@@ -12140,7 +12147,7 @@ var init_alert_expandable = __esm({
12140
12147
  "src/theme/components/alert-expandable.ts"() {
12141
12148
  init_dist4();
12142
12149
  init_dist3();
12143
- parts2 = anatomy("alertExpandable").parts("container");
12150
+ parts2 = anatomy("alertExpandable").parts("container", "accordion");
12144
12151
  helpers3 = createMultiStyleConfigHelpers(parts2.keys);
12145
12152
  config4 = helpers3.defineMultiStyleConfig({
12146
12153
  baseStyle: {
@@ -12160,6 +12167,9 @@ var init_alert_expandable = __esm({
12160
12167
  },
12161
12168
  variants: {
12162
12169
  info: {
12170
+ accordion: {
12171
+ outlineColor: "cloudy"
12172
+ },
12163
12173
  container: {
12164
12174
  _hover: {
12165
12175
  outlineColor: "sky"
@@ -12170,6 +12180,9 @@ var init_alert_expandable = __esm({
12170
12180
  }
12171
12181
  },
12172
12182
  success: {
12183
+ accordion: {
12184
+ outlineColor: "coralGreen"
12185
+ },
12173
12186
  container: {
12174
12187
  _hover: {
12175
12188
  outlineColor: "blueGreen"
@@ -12180,6 +12193,9 @@ var init_alert_expandable = __esm({
12180
12193
  }
12181
12194
  },
12182
12195
  warning: {
12196
+ accordion: {
12197
+ outlineColor: "primrose"
12198
+ },
12183
12199
  container: {
12184
12200
  _hover: {
12185
12201
  outlineColor: "sunshine"
@@ -12190,6 +12206,9 @@ var init_alert_expandable = __esm({
12190
12206
  }
12191
12207
  },
12192
12208
  "alt-transport": {
12209
+ accordion: {
12210
+ outlineColor: "burntYellow"
12211
+ },
12193
12212
  container: {
12194
12213
  _hover: {
12195
12214
  outlineColor: "golden"
@@ -12200,6 +12219,9 @@ var init_alert_expandable = __esm({
12200
12219
  }
12201
12220
  },
12202
12221
  error: {
12222
+ accordion: {
12223
+ outlineColor: "salmon"
12224
+ },
12203
12225
  container: {
12204
12226
  _hover: {
12205
12227
  outlineColor: "apricot"
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, CardSelect, CargonetLogo, 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, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardGroupContext, RadioGroup, ScaleFade, SearchInput, Section, ServiceAlert, 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, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, VyLogoPride, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-CHJ6LT66.mjs';
1
+ export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, CardSelect, CargonetLogo, 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, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardGroupContext, RadioGroup, ScaleFade, SearchInput, Section, ServiceAlert, 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, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, VyLogoPride, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-RQ4CWVFZ.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
- "version": "10.5.0",
3
+ "version": "10.6.1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -54,7 +54,7 @@ export const ExpandableAlert = ({
54
54
  allowToggle
55
55
  flexGrow="1"
56
56
  >
57
- <AccordionItem>
57
+ <AccordionItem sx={styles.accordion}>
58
58
  <AccordionButton sx={styles.container}>
59
59
  <Flex
60
60
  justifyContent="space-between"
@@ -25,6 +25,7 @@ type PhoneNumberInputProps = Omit<BoxProps, "onChange"> & {
25
25
  /** The optional value of the country code and phone number */
26
26
  value?: CountryCodeAndPhoneNumber;
27
27
  variant?: "base" | "floating";
28
+ isOptional?: boolean;
28
29
  };
29
30
  /**
30
31
  * A component for entering phone numbers.
@@ -51,12 +52,16 @@ export const PhoneNumberInput = forwardRef<PhoneNumberInputProps, As>(
51
52
  value: externalValue,
52
53
  onChange: externalOnChange,
53
54
  variant,
55
+ isOptional,
54
56
  ...boxProps
55
57
  },
56
58
  ref,
57
59
  ) => {
58
60
  const { t } = useTranslation();
59
- const label = externalLabel ?? t(texts.phoneNumber);
61
+ const label =
62
+ externalLabel ?? isOptional
63
+ ? t(texts.phoneNumberOptional)
64
+ : t(texts.phoneNumber);
60
65
  const [value, onChange] = useControllableState({
61
66
  value: externalValue,
62
67
  onChange: externalOnChange,
@@ -125,6 +130,12 @@ const texts = createTexts({
125
130
  en: "Phone number",
126
131
  sv: "Telefonnummer",
127
132
  },
133
+ phoneNumberOptional: {
134
+ nb: "Telefonnummer (valgfritt)",
135
+ nn: "Telefonnummer (valgfritt)",
136
+ en: "Phone number (optional)",
137
+ sv: "Telefonnummer (valfritt)",
138
+ },
128
139
  countryCodeLabel: {
129
140
  nb: "Landskode",
130
141
  nn: "Landskode",
@@ -1,7 +1,7 @@
1
1
  import { anatomy } from "@chakra-ui/anatomy";
2
2
  import { createMultiStyleConfigHelpers } from "@chakra-ui/styled-system";
3
3
 
4
- const parts = anatomy("alertExpandable").parts("container");
4
+ const parts = anatomy("alertExpandable").parts("container", "accordion");
5
5
  const helpers = createMultiStyleConfigHelpers(parts.keys);
6
6
 
7
7
  const config = helpers.defineMultiStyleConfig({
@@ -22,6 +22,9 @@ const config = helpers.defineMultiStyleConfig({
22
22
  },
23
23
  variants: {
24
24
  info: {
25
+ accordion: {
26
+ outlineColor: "cloudy",
27
+ },
25
28
  container: {
26
29
  _hover: {
27
30
  outlineColor: "sky",
@@ -32,6 +35,9 @@ const config = helpers.defineMultiStyleConfig({
32
35
  },
33
36
  },
34
37
  success: {
38
+ accordion: {
39
+ outlineColor: "coralGreen",
40
+ },
35
41
  container: {
36
42
  _hover: {
37
43
  outlineColor: "blueGreen",
@@ -42,6 +48,9 @@ const config = helpers.defineMultiStyleConfig({
42
48
  },
43
49
  },
44
50
  warning: {
51
+ accordion: {
52
+ outlineColor: "primrose",
53
+ },
45
54
  container: {
46
55
  _hover: {
47
56
  outlineColor: "sunshine",
@@ -52,6 +61,9 @@ const config = helpers.defineMultiStyleConfig({
52
61
  },
53
62
  },
54
63
  "alt-transport": {
64
+ accordion: {
65
+ outlineColor: "burntYellow",
66
+ },
55
67
  container: {
56
68
  _hover: {
57
69
  outlineColor: "golden",
@@ -62,6 +74,9 @@ const config = helpers.defineMultiStyleConfig({
62
74
  },
63
75
  },
64
76
  error: {
77
+ accordion: {
78
+ outlineColor: "salmon",
79
+ },
65
80
  container: {
66
81
  _hover: {
67
82
  outlineColor: "apricot",