@vygruppen/spor-react 2.5.3 → 3.0.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@2.5.3 build
2
+ > @vygruppen/spor-react@3.0.1 build
3
3
  > tsup src/index.tsx --dts --treeshake --format cjs,esm
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -9,13 +9,13 @@
9
9
  CJS Build start
10
10
  ESM Build start
11
11
  DTS Build start
12
+ "toTime" is imported from external module "@internationalized/date" but never used in "dist/chunk-B6U7OYV3.mjs".
12
13
  "toTime" is imported from external module "@internationalized/date" but never used in "dist/index.js".
13
- "toTime" is imported from external module "@internationalized/date" but never used in "dist/chunk-MMDKHHXP.mjs".
14
- CJS dist/index.js 896.32 KB
15
- CJS ⚡️ Build success in 4550ms
16
- ESM dist/index.mjs 2.06 KB
17
- ESM dist/CountryCodeSelect-GJJH4VNO.mjs 351.67 KB
18
- ESM dist/chunk-MMDKHHXP.mjs 416.49 KB
19
- ESM ⚡️ Build success in 4552ms
20
- DTS ⚡️ Build success in 18294ms
21
- DTS dist/index.d.ts 259.41 KB
14
+ ESM dist/index.mjs 2.01 KB
15
+ ESM dist/CountryCodeSelect-ZP44HPNI.mjs 351.65 KB
16
+ ESM dist/chunk-B6U7OYV3.mjs 416.39 KB
17
+ ESM ⚡️ Build success in 4795ms
18
+ CJS dist/index.js 896.14 KB
19
+ CJS ⚡️ Build success in 4796ms
20
+ DTS ⚡️ Build success in 19473ms
21
+ DTS dist/index.d.ts 259.11 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 3.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 828e4f38: Fix a typing issue with Heading
8
+
9
+ ## 3.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - d0f0c5ff: Remove deprecated components SelectItem, SelectItemLabel and SelectItemDescription.
14
+
15
+ To migrate, use Item, ItemLabel and ItemDescription, respectively.
16
+
17
+ - 6c1f3d08: Heading: Make `as` prop required
18
+
19
+ This is a breaking change. Previously, this defaulted to "h2". Go through all usages and add `as="h1"` or whatever is correct for your context.
20
+
21
+ ### Patch Changes
22
+
23
+ - 08b926e3: DatePicker: Make it possible to override width of datepicker
24
+
3
25
  ## 2.5.3
4
26
 
5
27
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { createTexts, useTranslation, InfoSelect, SelectItem } from './chunk-MMDKHHXP.mjs';
1
+ import { createTexts, useTranslation, InfoSelect, Item } from './chunk-B6U7OYV3.mjs';
2
2
  import React from 'react';
3
3
 
4
4
  // ../../node_modules/awesome-phonenumber/index-esm.mjs
@@ -6621,7 +6621,7 @@ var CountryCodeSelect = (props) => {
6621
6621
  items: callingCodes,
6622
6622
  ...props
6623
6623
  },
6624
- (item) => /* @__PURE__ */ React.createElement(SelectItem, { key: item.key }, item.key)
6624
+ (item) => /* @__PURE__ */ React.createElement(Item, { key: item.key }, item.key)
6625
6625
  );
6626
6626
  };
6627
6627
  var CountryCodeSelect_default = CountryCodeSelect;
@@ -12,7 +12,7 @@ import { usePopover, Overlay, DismissButton, useOverlayTrigger, useButton, usePr
12
12
  import { motion } from 'framer-motion';
13
13
  import { DateFormatter, parseTime, createCalendar, Time, toCalendarDate, toCalendarDateTime, toCalendar, getMinimumDayInMonth, getMinimumMonthInYear, today, startOfWeek, startOfMonth, endOfWeek, endOfMonth, isSameDay, getDayOfWeek, maxDate, minDate, isEqualDay, getWeeksInMonth, getLocalTimeZone, GregorianCalendar, now, startOfYear, isSameMonth, isToday } from '@internationalized/date';
14
14
  export { Time } from '@internationalized/date';
15
- import { useOverlayTriggerState, useTimeFieldState, useComboBoxState, Item, useSelectState } from 'react-stately';
15
+ import { useOverlayTriggerState, Item, useTimeFieldState, useComboBoxState, useSelectState } from 'react-stately';
16
16
  export { Item, Section } from 'react-stately';
17
17
  import { useSwipeable } from 'react-swipeable';
18
18
  import { Global, keyframes } from '@emotion/react';
@@ -3227,8 +3227,8 @@ var Badge = forwardRef(
3227
3227
  );
3228
3228
  var Code = forwardRef((props, ref) => /* @__PURE__ */ React49__default.createElement(Code$1, { ...props, ref }));
3229
3229
  var Heading = ({
3230
+ as,
3230
3231
  variant = "xl-display",
3231
- as = "h2",
3232
3232
  ...props
3233
3233
  }) => {
3234
3234
  return /* @__PURE__ */ React49__default.createElement(Text, { as, textStyle: variant, ...props });
@@ -3579,7 +3579,7 @@ function DateField(props) {
3579
3579
  });
3580
3580
  const ref = useRef(null);
3581
3581
  const { fieldProps, labelProps } = useDateField(props, state2, ref);
3582
- return /* @__PURE__ */ React49__default.createElement(Box, { minWidth: "6rem" }, props.label && /* @__PURE__ */ React49__default.createElement(FormLabel, { ...props.labelProps, ...labelProps, sx: styles2.inputLabel }, props.label), /* @__PURE__ */ React49__default.createElement(Flex, { ...fieldProps, ref }, state2.segments.map((segment, i) => /* @__PURE__ */ React49__default.createElement(DateTimeSegment, { key: i, segment, state: state2 }))), /* @__PURE__ */ React49__default.createElement("input", { type: "hidden", value: (_a6 = state2.value) == null ? void 0 : _a6.toString(), name: props.name }));
3582
+ return /* @__PURE__ */ React49__default.createElement(Box, { minWidth: "6rem", width: "100%" }, props.label && /* @__PURE__ */ React49__default.createElement(FormLabel, { ...props.labelProps, ...labelProps, sx: styles2.inputLabel }, props.label), /* @__PURE__ */ React49__default.createElement(Flex, { ...fieldProps, ref }, state2.segments.map((segment, i) => /* @__PURE__ */ React49__default.createElement(DateTimeSegment, { key: i, segment, state: state2 }))), /* @__PURE__ */ React49__default.createElement("input", { type: "hidden", value: (_a6 = state2.value) == null ? void 0 : _a6.toString(), name: props.name }));
3583
3583
  }
3584
3584
  var StyledField = forwardRef(
3585
3585
  ({ children, variant, ...otherProps }, ref) => {
@@ -3606,6 +3606,7 @@ function DatePicker({
3606
3606
  errorMessage,
3607
3607
  minHeight,
3608
3608
  showYearNavigation,
3609
+ width = "auto",
3609
3610
  ...props
3610
3611
  }) {
3611
3612
  const formControlProps = useFormControlContext();
@@ -3641,26 +3642,26 @@ function DatePicker({
3641
3642
  };
3642
3643
  const hasTrigger = responsiveVariant === "with-trigger";
3643
3644
  const styles2 = useMultiStyleConfig("Datepicker", {});
3644
- return /* @__PURE__ */ React49__default.createElement(I18nProvider, { locale }, /* @__PURE__ */ React49__default.createElement(Box, { position: "relative", display: "inline-flex", flexDirection: "column" }, /* @__PURE__ */ React49__default.createElement(
3645
- Popover,
3645
+ return /* @__PURE__ */ React49__default.createElement(I18nProvider, { locale }, /* @__PURE__ */ React49__default.createElement(
3646
+ Box,
3646
3647
  {
3647
- ...dialogProps,
3648
- isOpen: state2.isOpen,
3649
- onClose: () => state2.setOpen(false),
3650
- onOpen: () => state2.setOpen(true),
3651
- closeOnBlur: true,
3652
- closeOnEsc: true,
3653
- returnFocusOnClose: true
3648
+ position: "relative",
3649
+ display: "inline-flex",
3650
+ flexDirection: "column",
3651
+ width
3654
3652
  },
3655
3653
  /* @__PURE__ */ React49__default.createElement(
3656
- InputGroup,
3654
+ Popover,
3657
3655
  {
3658
- ...groupProps,
3659
- ref,
3660
- width: "auto",
3661
- display: "inline-flex"
3662
- },
3663
- /* @__PURE__ */ React49__default.createElement(PopoverAnchor, null, /* @__PURE__ */ React49__default.createElement(
3656
+ ...dialogProps,
3657
+ isOpen: state2.isOpen,
3658
+ onClose: () => state2.setOpen(false),
3659
+ onOpen: () => state2.setOpen(true),
3660
+ closeOnBlur: true,
3661
+ closeOnEsc: true,
3662
+ returnFocusOnClose: true
3663
+ },
3664
+ /* @__PURE__ */ React49__default.createElement(InputGroup, { ...groupProps, ref, display: "inline-flex" }, /* @__PURE__ */ React49__default.createElement(PopoverAnchor, null, /* @__PURE__ */ React49__default.createElement(
3664
3665
  StyledField,
3665
3666
  {
3666
3667
  variant: responsiveVariant,
@@ -3679,27 +3680,26 @@ function DatePicker({
3679
3680
  ...fieldProps
3680
3681
  }
3681
3682
  )
3682
- )),
3683
- hasTrigger && /* @__PURE__ */ React49__default.createElement(CalendarTriggerButton, { ...buttonProps })
3684
- ),
3685
- /* @__PURE__ */ React49__default.createElement(FormErrorMessage, { ...errorMessageProps }, errorMessage),
3686
- state2.isOpen && !props.isDisabled && /* @__PURE__ */ React49__default.createElement(Portal, null, /* @__PURE__ */ React49__default.createElement(
3687
- PopoverContent,
3688
- {
3689
- color: "darkGrey",
3690
- boxShadow: "md",
3691
- sx: styles2.calendar
3692
- },
3693
- /* @__PURE__ */ React49__default.createElement(PopoverArrow, { sx: styles2.arrow }),
3694
- /* @__PURE__ */ React49__default.createElement(PopoverBody, null, /* @__PURE__ */ React49__default.createElement(
3695
- Calendar,
3683
+ )), hasTrigger && /* @__PURE__ */ React49__default.createElement(CalendarTriggerButton, { ...buttonProps })),
3684
+ /* @__PURE__ */ React49__default.createElement(FormErrorMessage, { ...errorMessageProps }, errorMessage),
3685
+ state2.isOpen && !props.isDisabled && /* @__PURE__ */ React49__default.createElement(Portal, null, /* @__PURE__ */ React49__default.createElement(
3686
+ PopoverContent,
3696
3687
  {
3697
- ...calendarProps,
3698
- showYearNavigation
3699
- }
3688
+ color: "darkGrey",
3689
+ boxShadow: "md",
3690
+ sx: styles2.calendar
3691
+ },
3692
+ /* @__PURE__ */ React49__default.createElement(PopoverArrow, { sx: styles2.arrow }),
3693
+ /* @__PURE__ */ React49__default.createElement(PopoverBody, null, /* @__PURE__ */ React49__default.createElement(
3694
+ Calendar,
3695
+ {
3696
+ ...calendarProps,
3697
+ showYearNavigation
3698
+ }
3699
+ ))
3700
3700
  ))
3701
- ))
3702
- )));
3701
+ )
3702
+ ));
3703
3703
  }
3704
3704
  function RangeCalendar(props) {
3705
3705
  const locale = useCurrentLocale();
@@ -4383,7 +4383,6 @@ var Arrow = (props) => {
4383
4383
  var FormLabel3 = forwardRef((props, ref) => {
4384
4384
  return /* @__PURE__ */ React49__default.createElement(FormLabel, { ...props, ref });
4385
4385
  });
4386
- var SelectItem = Item;
4387
4386
  function ListBox({
4388
4387
  isLoading,
4389
4388
  listBoxRef,
@@ -4413,13 +4412,11 @@ function ItemLabel({ children }) {
4413
4412
  const styles2 = useMultiStyleConfig("ListBox", {});
4414
4413
  return /* @__PURE__ */ React49__default.createElement(Box, { ...labelProps, sx: styles2.label }, children);
4415
4414
  }
4416
- var SelectItemLabel = ItemLabel;
4417
4415
  function ItemDescription({ children }) {
4418
4416
  let { descriptionProps } = useOptionContext();
4419
4417
  const styles2 = useMultiStyleConfig("ListBox", {});
4420
4418
  return /* @__PURE__ */ React49__default.createElement(Box, { ...descriptionProps, sx: styles2.description }, children);
4421
4419
  }
4422
- var SelectItemDescription = ItemDescription;
4423
4420
  function Option({ item, state: state2 }) {
4424
4421
  const ref = useRef(null);
4425
4422
  const {
@@ -4883,7 +4880,7 @@ var PhoneNumberInput = forwardRef(
4883
4880
  height: "100%",
4884
4881
  value: "+47"
4885
4882
  },
4886
- /* @__PURE__ */ React49__default.createElement(SelectItem, { key: "+47" }, "+47")
4883
+ /* @__PURE__ */ React49__default.createElement(Item, { key: "+47" }, "+47")
4887
4884
  )
4888
4885
  },
4889
4886
  /* @__PURE__ */ React49__default.createElement(
@@ -4928,7 +4925,7 @@ var texts13 = createTexts({
4928
4925
  sv: "Telefonnummer"
4929
4926
  }
4930
4927
  });
4931
- var LazyCountryCodeSelect = React49__default.lazy(() => import('./CountryCodeSelect-GJJH4VNO.mjs'));
4928
+ var LazyCountryCodeSelect = React49__default.lazy(() => import('./CountryCodeSelect-ZP44HPNI.mjs'));
4932
4929
  var Radio = forwardRef((props, ref) => {
4933
4930
  return /* @__PURE__ */ React49__default.createElement(Radio$1, { ...props, ref });
4934
4931
  });
@@ -14565,4 +14562,4 @@ var getToastComponent = (opts) => {
14565
14562
  return ({ id }) => /* @__PURE__ */ React49__default.createElement(BaseToast, { id, variant: opts.variant }, opts.text);
14566
14563
  };
14567
14564
 
14568
- export { Accordion, AttachedInputs, Badge, Button, ButtonGroup, Card, CardSelect, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, ColorInlineLoader, ColorSpinner, Combobox, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerContent, Expandable, ExpandableAlert, ExpandableItem, FloatingActionButton, FormControl, FormErrorMessage, FormLabel3 as FormLabel, Heading, IconButton, InfoSelect, InfoTag, Input, InputLeftElement2 as InputLeftElement, InputRightElement2 as InputRightElement, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightSpinner, LineIcon, ListBox, ModalHeader, NativeSelect, NumericStepper, PasswordInput, PhoneNumberInput, PlayPauseButton, PopoverWizardBody, ProgressBar, ProgressLoader, Radio, RadioGroup, SearchInput, SelectItem, SelectItemDescription, SelectItemLabel, SimpleDrawer, SimplePopover, Skeleton, SkeletonCircle, SkeletonText, SkipButton, SporProvider, Stack, StaticAlert, Stepper, StepperStep, Switch, Table, Tabs, Text4 as Text, TextLink, Textarea, TimePicker, TravelTag, VyLogo, WizardPopover, createTexts, fontFaces, theme, useToast, useTranslation };
14565
+ export { Accordion, AttachedInputs, Badge, Button, ButtonGroup, Card, CardSelect, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, ColorInlineLoader, ColorSpinner, Combobox, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerContent, Expandable, ExpandableAlert, ExpandableItem, FloatingActionButton, FormControl, FormErrorMessage, FormLabel3 as FormLabel, Heading, IconButton, InfoSelect, InfoTag, Input, InputLeftElement2 as InputLeftElement, InputRightElement2 as InputRightElement, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightSpinner, LineIcon, ListBox, ModalHeader, NativeSelect, NumericStepper, PasswordInput, PhoneNumberInput, PlayPauseButton, PopoverWizardBody, ProgressBar, ProgressLoader, Radio, RadioGroup, SearchInput, SimpleDrawer, SimplePopover, Skeleton, SkeletonCircle, SkeletonText, SkipButton, SporProvider, Stack, StaticAlert, Stepper, StepperStep, Switch, Table, Tabs, Text4 as Text, TextLink, Textarea, TimePicker, TravelTag, VyLogo, WizardPopover, createTexts, fontFaces, theme, useToast, useTranslation };
package/dist/index.d.ts CHANGED
@@ -10,7 +10,6 @@ import { DateValue } from '@internationalized/date';
10
10
  export { Time } from '@internationalized/date';
11
11
  import { AriaDatePickerProps, AriaDateRangePickerProps, AriaPositionProps, AriaComboBoxProps, AriaListBoxProps } from 'react-aria';
12
12
  import { TimeValue } from '@react-types/datepicker';
13
- import * as react_stately from 'react-stately';
14
13
  import { ListState, SelectState } from 'react-stately';
15
14
  export { Item, Section } from 'react-stately';
16
15
  import * as _chakra_ui_theme_tools_dist_component from '@chakra-ui/theme-tools/dist/component';
@@ -418,7 +417,7 @@ type CardProps = Exclude<BoxProps, "size"> & {
418
417
  */
419
418
  declare const Card: _chakra_ui_system_dist_system_types.ComponentWithAs<As, CardProps>;
420
419
 
421
- type DatePickerProps = AriaDatePickerProps<DateValue> & Pick<BoxProps, "minHeight"> & {
420
+ type DatePickerProps = AriaDatePickerProps<DateValue> & Pick<BoxProps, "minHeight" | "width"> & {
422
421
  variant: ResponsiveValue<"simple" | "with-trigger">;
423
422
  name?: string;
424
423
  showYearNavigation?: boolean;
@@ -432,7 +431,7 @@ type DatePickerProps = AriaDatePickerProps<DateValue> & Pick<BoxProps, "minHeigh
432
431
  * <DatePicker label="Dato" variant="simple" />
433
432
  * ```
434
433
  */
435
- declare function DatePicker({ variant, errorMessage, minHeight, showYearNavigation, ...props }: DatePickerProps): React__default.JSX.Element;
434
+ declare function DatePicker({ variant, errorMessage, minHeight, showYearNavigation, width, ...props }: DatePickerProps): React__default.JSX.Element;
436
435
 
437
436
  type DateRangePickerProps = AriaDateRangePickerProps<DateValue> & Pick<BoxProps, "minHeight"> & {
438
437
  startLabel?: string;
@@ -600,7 +599,7 @@ type AttachedInputsProps = FlexProps;
600
599
  * <AttachedInputs>
601
600
  * <Input />
602
601
  * <NativeSelect>
603
- * <SelectItem />
602
+ * <Item />
604
603
  * </NativeSelect>
605
604
  * </AttachedInputs>
606
605
  * ```
@@ -811,16 +810,16 @@ declare const FormLabel: _chakra_ui_system_dist_system_types.ComponentWithAs<"la
811
810
 
812
811
  type InfoSelectProps<T extends object> = {
813
812
  /**
814
- * Either a render function accepting an item, and returning a <SelectItem />,
815
- * or a list of <SelectItem />s.
813
+ * Either a render function accepting an item, and returning a <Item />,
814
+ * or a list of <Item />s.
816
815
  *
817
816
  * Render function example:
818
817
  * ```tsx
819
818
  * <Select items={items}>
820
819
  * {(item) => (
821
- * <SelectItem key={item.value} value={item.value}>
820
+ * <Item key={item.value} value={item.value}>
822
821
  * {item.label}
823
- * </SelectItem>
822
+ * </Item>
824
823
  * )}
825
824
  * </Select>
826
825
  * ```
@@ -828,12 +827,12 @@ type InfoSelectProps<T extends object> = {
828
827
  * For this to work, the members in `items` need either a `key`
829
828
  * or an `id` property.
830
829
  *
831
- * List of <SelectItem />s example:
830
+ * List of <Item />s example:
832
831
  * ```tsx
833
832
  * <Select label="Choose a color">
834
- * <SelectItem>Green</SelectItem>
835
- * <SelectItem>Blue</SelectItem>
836
- * <SelectItem>Yellow</SelectItem>
833
+ * <Item>Green</Item>
834
+ * <Item>Blue</Item>
835
+ * <Item>Yellow</Item>
837
836
  * </Select>
838
837
  * ```
839
838
  **/
@@ -897,9 +896,9 @@ type InfoSelectProps<T extends object> = {
897
896
  *
898
897
  * ```tsx
899
898
  * <Select label="Choose a color" disabledKeys={["blue", "yellow"]}>
900
- * <SelectItem key="green">Green</SelectItem>
901
- * <SelectItem key="blue">Blue</SelectItem>
902
- * <SelectItem key="yellow">Yellow</SelectItem>
899
+ * <Item key="green">Green</Item>
900
+ * <Item key="blue">Blue</Item>
901
+ * <Item key="yellow">Yellow</Item>
903
902
  * </Select>
904
903
  * ```
905
904
  **/
@@ -1001,9 +1000,6 @@ declare const InputLeftElement: _chakra_ui_system_dist_system_types.ComponentWit
1001
1000
  */
1002
1001
  declare const InputRightElement: _chakra_ui_system_dist_system_types.ComponentWithAs<"div", InputElementProps$1>;
1003
1002
 
1004
- /** @deprecated use Item instead */
1005
- declare const SelectItem: <T>(props: react_stately.ItemProps<T>) => JSX.Element;
1006
-
1007
1003
  type ListBoxProps<T> = AriaListBoxProps<T> & Omit<BoxProps, "filter" | "autoFocus" | "children"> & {
1008
1004
  /** External reference to the ListBox itself */
1009
1005
  listBoxRef: React__default.RefObject<HTMLUListElement>;
@@ -1058,8 +1054,6 @@ declare function ListBox<T extends object>({ isLoading, listBoxRef, state, maxWi
1058
1054
  declare function ItemLabel({ children }: {
1059
1055
  children: React__default.ReactNode;
1060
1056
  }): React__default.JSX.Element;
1061
- /** @deprecated use ItemLabel instead */
1062
- declare const SelectItemLabel: typeof ItemLabel;
1063
1057
  /**
1064
1058
  * Renders a description for an Item.
1065
1059
  *
@@ -1068,8 +1062,6 @@ declare const SelectItemLabel: typeof ItemLabel;
1068
1062
  declare function ItemDescription({ children }: {
1069
1063
  children: React__default.ReactNode;
1070
1064
  }): React__default.JSX.Element;
1071
- /** @deprecated Use ItemDescription instead */
1072
- declare const SelectItemDescription: typeof ItemDescription;
1073
1065
 
1074
1066
  type NativeSelectProps = Exclude<SelectProps, "colorScheme" | "variant" | "size"> & {
1075
1067
  label?: string;
@@ -6974,26 +6966,29 @@ type CodeProps = CodeProps$1 & {
6974
6966
  declare const Code: _chakra_ui_system_dist_system_types.ComponentWithAs<As, CodeProps>;
6975
6967
 
6976
6968
  type TextStyles = keyof typeof tokens__default.font.style;
6977
- type HeadingProps = Exclude<HeadingProps$1, "textStyle"> & {
6969
+ type HeadingProps = Omit<HeadingProps$1, "textStyle" | "as"> & {
6970
+ /** The heading level, e.g. h1, h2, h3... **/
6971
+ as: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
6978
6972
  /** The size and style of the heading */
6979
6973
  variant?: TextStyles;
6980
6974
  };
6981
6975
  /**
6982
6976
  * Create your own fancy headings with this component.
6983
6977
  *
6984
- * You can specify the variant, which is one of "xs", "sm", "md", "lg", "xl-sans", "xs-serif" and "2xl". The default is "xl-sans".
6978
+ * You have to specify what level of heading you want, depending on the context you are using the heading in.
6979
+ * You do this with the `as` prop. The options are h1, h2, h3, h4, h5 and h6.
6985
6980
  *
6986
6981
  * ```tsx
6987
- * <Heading variant="2xl">Look at me!</Heading>
6982
+ * <Heading as="h1">Page heading</Heading>
6988
6983
  * ```
6989
6984
  *
6990
- * You can also specify what level of heading you want. You do this with the `as` prop. The default is "h2".
6985
+ * You can specify the variant, which is one of "xs", "sm", "md", "lg", "xl-sans", "xs-serif" and "2xl". The default is "xl-sans".
6991
6986
  *
6992
6987
  * ```tsx
6993
- * <Heading as="h1">Page heading</Heading>
6988
+ * <Heading as="h1" variant="2xl">Look at me!</Heading>
6994
6989
  * ```
6995
6990
  */
6996
- declare const Heading: ({ variant, as, ...props }: any) => React__default.JSX.Element;
6991
+ declare const Heading: ({ as, variant, ...props }: HeadingProps) => React__default.JSX.Element;
6997
6992
 
6998
6993
  type TextProps = Omit<TextProps$1, "textStyle"> & {
6999
6994
  /** The size and style of the text.
@@ -7010,4 +7005,4 @@ type TextProps = Omit<TextProps$1, "textStyle"> & {
7010
7005
  */
7011
7006
  declare const Text: _chakra_ui_system_dist_system_types.ComponentWithAs<"p", TextProps>;
7012
7007
 
7013
- export { Accordion, AccordionProps, AttachedInputs, Badge, BadgeProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, Card, CardProps, CardSelect, Checkbox, CheckboxGroup, CheckboxGroupProps, CheckboxProps, ChoiceChip, ChoiceChipProps, ClosableAlert, CloseButton, CloseButtonProps, Code, CodeProps, ColorInlineLoader, ColorInlineLoaderProps, ColorSpinner, ColorSpinnerProps, Combobox, ComboboxProps, ContentLoader, ContentLoaderProps, DarkFullScreenLoader, DarkInlineLoader, DarkInlineLoaderProps, DarkSpinner, DarkSpinnerProps, DatePicker, DateRangePicker, Divider, DividerProps, Drawer, DrawerContent, ModalHeader as DrawerHeader, Expandable, ExpandableAlert, ExpandableItem, ExpandableItemProps, FloatingActionButton, FormControl, FormControlProps, FormErrorMessage, FormErrorMessageProps, FormLabel, FormLabelProps, Heading, HeadingProps, IconButton, IconButtonProps, InfoSelect, InfoTag, InfoTagProps, Input, InputElementProps, InputLeftElement, InputProps, InputRightElement, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightInlineLoaderProps, LightSpinner, LightSpinnerProps, LineIcon, LineIconProps, ListBox, ModalHeader, ModalHeaderProps, NativeSelect, NativeSelectProps, NumericStepper, PasswordInput, PasswordInputProps, PhoneNumberInput, PlayPauseButton, PopoverWizardBody, PopoverWizardProps, ProgressBar, ProgressLoader, Radio, RadioGroup, RadioGroupProps, RadioProps, SearchInput, SearchInputProps, SelectItem, SelectItemDescription, SelectItemLabel, SimpleDrawer, SimpleDrawerProps, SimplePopover, Skeleton, SkeletonCircle, SkeletonCircleProps, SkeletonProps, SkeletonText, SkeletonTextProps, SkipButton, SpinnerProps, SporProvider, Stack, StackProps, StaticAlert, Stepper, StepperStep, Switch, SwitchProps, Table, TableProps, Tabs, TabsProps, Text, TextLink, TextProps, Textarea, TextareaProps, TimePicker, ToastOptions, Translations, TravelTag, TravelTagProps, VyLogo, VyLogoProps, WizardPopover, WizardPopoverProps, createTexts, fontFaces, theme, useToast, useTranslation };
7008
+ export { Accordion, AccordionProps, AttachedInputs, Badge, BadgeProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, Card, CardProps, CardSelect, Checkbox, CheckboxGroup, CheckboxGroupProps, CheckboxProps, ChoiceChip, ChoiceChipProps, ClosableAlert, CloseButton, CloseButtonProps, Code, CodeProps, ColorInlineLoader, ColorInlineLoaderProps, ColorSpinner, ColorSpinnerProps, Combobox, ComboboxProps, ContentLoader, ContentLoaderProps, DarkFullScreenLoader, DarkInlineLoader, DarkInlineLoaderProps, DarkSpinner, DarkSpinnerProps, DatePicker, DateRangePicker, Divider, DividerProps, Drawer, DrawerContent, ModalHeader as DrawerHeader, Expandable, ExpandableAlert, ExpandableItem, ExpandableItemProps, FloatingActionButton, FormControl, FormControlProps, FormErrorMessage, FormErrorMessageProps, FormLabel, FormLabelProps, Heading, HeadingProps, IconButton, IconButtonProps, InfoSelect, InfoTag, InfoTagProps, Input, InputElementProps, InputLeftElement, InputProps, InputRightElement, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightInlineLoaderProps, LightSpinner, LightSpinnerProps, LineIcon, LineIconProps, ListBox, ModalHeader, ModalHeaderProps, NativeSelect, NativeSelectProps, NumericStepper, PasswordInput, PasswordInputProps, PhoneNumberInput, PlayPauseButton, PopoverWizardBody, PopoverWizardProps, ProgressBar, ProgressLoader, Radio, RadioGroup, RadioGroupProps, RadioProps, SearchInput, SearchInputProps, SimpleDrawer, SimpleDrawerProps, SimplePopover, Skeleton, SkeletonCircle, SkeletonCircleProps, SkeletonProps, SkeletonText, SkeletonTextProps, SkipButton, SpinnerProps, SporProvider, Stack, StackProps, StaticAlert, Stepper, StepperStep, Switch, SwitchProps, Table, TableProps, Tabs, TabsProps, Text, TextLink, TextProps, Textarea, TextareaProps, TimePicker, ToastOptions, Translations, TravelTag, TravelTagProps, VyLogo, VyLogoProps, WizardPopover, WizardPopoverProps, createTexts, fontFaces, theme, useToast, useTranslation };
package/dist/index.js CHANGED
@@ -2826,8 +2826,8 @@ exports.Heading = void 0;
2826
2826
  var init_Heading = __esm({
2827
2827
  "src/typography/Heading.tsx"() {
2828
2828
  exports.Heading = ({
2829
+ as,
2829
2830
  variant = "xl-display",
2830
- as = "h2",
2831
2831
  ...props
2832
2832
  }) => {
2833
2833
  return /* @__PURE__ */ React49__namespace.default.createElement(react.Text, { as, textStyle: variant, ...props });
@@ -3241,7 +3241,7 @@ function DateField(props) {
3241
3241
  });
3242
3242
  const ref = React49.useRef(null);
3243
3243
  const { fieldProps, labelProps } = reactAria.useDateField(props, state2, ref);
3244
- return /* @__PURE__ */ React49__namespace.default.createElement(react.Box, { minWidth: "6rem" }, props.label && /* @__PURE__ */ React49__namespace.default.createElement(react.FormLabel, { ...props.labelProps, ...labelProps, sx: styles2.inputLabel }, props.label), /* @__PURE__ */ React49__namespace.default.createElement(react.Flex, { ...fieldProps, ref }, state2.segments.map((segment, i) => /* @__PURE__ */ React49__namespace.default.createElement(DateTimeSegment, { key: i, segment, state: state2 }))), /* @__PURE__ */ React49__namespace.default.createElement("input", { type: "hidden", value: (_a6 = state2.value) == null ? void 0 : _a6.toString(), name: props.name }));
3244
+ return /* @__PURE__ */ React49__namespace.default.createElement(react.Box, { minWidth: "6rem", width: "100%" }, props.label && /* @__PURE__ */ React49__namespace.default.createElement(react.FormLabel, { ...props.labelProps, ...labelProps, sx: styles2.inputLabel }, props.label), /* @__PURE__ */ React49__namespace.default.createElement(react.Flex, { ...fieldProps, ref }, state2.segments.map((segment, i) => /* @__PURE__ */ React49__namespace.default.createElement(DateTimeSegment, { key: i, segment, state: state2 }))), /* @__PURE__ */ React49__namespace.default.createElement("input", { type: "hidden", value: (_a6 = state2.value) == null ? void 0 : _a6.toString(), name: props.name }));
3245
3245
  }
3246
3246
  var init_DateField = __esm({
3247
3247
  "src/datepicker/DateField.tsx"() {
@@ -3278,6 +3278,7 @@ function DatePicker({
3278
3278
  errorMessage,
3279
3279
  minHeight,
3280
3280
  showYearNavigation,
3281
+ width = "auto",
3281
3282
  ...props
3282
3283
  }) {
3283
3284
  const formControlProps = react.useFormControlContext();
@@ -3313,26 +3314,26 @@ function DatePicker({
3313
3314
  };
3314
3315
  const hasTrigger = responsiveVariant === "with-trigger";
3315
3316
  const styles2 = react.useMultiStyleConfig("Datepicker", {});
3316
- return /* @__PURE__ */ React49__namespace.default.createElement(reactAria.I18nProvider, { locale }, /* @__PURE__ */ React49__namespace.default.createElement(react.Box, { position: "relative", display: "inline-flex", flexDirection: "column" }, /* @__PURE__ */ React49__namespace.default.createElement(
3317
- react.Popover,
3317
+ return /* @__PURE__ */ React49__namespace.default.createElement(reactAria.I18nProvider, { locale }, /* @__PURE__ */ React49__namespace.default.createElement(
3318
+ react.Box,
3318
3319
  {
3319
- ...dialogProps,
3320
- isOpen: state2.isOpen,
3321
- onClose: () => state2.setOpen(false),
3322
- onOpen: () => state2.setOpen(true),
3323
- closeOnBlur: true,
3324
- closeOnEsc: true,
3325
- returnFocusOnClose: true
3320
+ position: "relative",
3321
+ display: "inline-flex",
3322
+ flexDirection: "column",
3323
+ width
3326
3324
  },
3327
3325
  /* @__PURE__ */ React49__namespace.default.createElement(
3328
- react.InputGroup,
3326
+ react.Popover,
3329
3327
  {
3330
- ...groupProps,
3331
- ref,
3332
- width: "auto",
3333
- display: "inline-flex"
3334
- },
3335
- /* @__PURE__ */ React49__namespace.default.createElement(react.PopoverAnchor, null, /* @__PURE__ */ React49__namespace.default.createElement(
3328
+ ...dialogProps,
3329
+ isOpen: state2.isOpen,
3330
+ onClose: () => state2.setOpen(false),
3331
+ onOpen: () => state2.setOpen(true),
3332
+ closeOnBlur: true,
3333
+ closeOnEsc: true,
3334
+ returnFocusOnClose: true
3335
+ },
3336
+ /* @__PURE__ */ React49__namespace.default.createElement(react.InputGroup, { ...groupProps, ref, display: "inline-flex" }, /* @__PURE__ */ React49__namespace.default.createElement(react.PopoverAnchor, null, /* @__PURE__ */ React49__namespace.default.createElement(
3336
3337
  StyledField,
3337
3338
  {
3338
3339
  variant: responsiveVariant,
@@ -3351,27 +3352,26 @@ function DatePicker({
3351
3352
  ...fieldProps
3352
3353
  }
3353
3354
  )
3354
- )),
3355
- hasTrigger && /* @__PURE__ */ React49__namespace.default.createElement(CalendarTriggerButton, { ...buttonProps })
3356
- ),
3357
- /* @__PURE__ */ React49__namespace.default.createElement(exports.FormErrorMessage, { ...errorMessageProps }, errorMessage),
3358
- state2.isOpen && !props.isDisabled && /* @__PURE__ */ React49__namespace.default.createElement(react.Portal, null, /* @__PURE__ */ React49__namespace.default.createElement(
3359
- react.PopoverContent,
3360
- {
3361
- color: "darkGrey",
3362
- boxShadow: "md",
3363
- sx: styles2.calendar
3364
- },
3365
- /* @__PURE__ */ React49__namespace.default.createElement(react.PopoverArrow, { sx: styles2.arrow }),
3366
- /* @__PURE__ */ React49__namespace.default.createElement(react.PopoverBody, null, /* @__PURE__ */ React49__namespace.default.createElement(
3367
- Calendar,
3355
+ )), hasTrigger && /* @__PURE__ */ React49__namespace.default.createElement(CalendarTriggerButton, { ...buttonProps })),
3356
+ /* @__PURE__ */ React49__namespace.default.createElement(exports.FormErrorMessage, { ...errorMessageProps }, errorMessage),
3357
+ state2.isOpen && !props.isDisabled && /* @__PURE__ */ React49__namespace.default.createElement(react.Portal, null, /* @__PURE__ */ React49__namespace.default.createElement(
3358
+ react.PopoverContent,
3368
3359
  {
3369
- ...calendarProps,
3370
- showYearNavigation
3371
- }
3360
+ color: "darkGrey",
3361
+ boxShadow: "md",
3362
+ sx: styles2.calendar
3363
+ },
3364
+ /* @__PURE__ */ React49__namespace.default.createElement(react.PopoverArrow, { sx: styles2.arrow }),
3365
+ /* @__PURE__ */ React49__namespace.default.createElement(react.PopoverBody, null, /* @__PURE__ */ React49__namespace.default.createElement(
3366
+ Calendar,
3367
+ {
3368
+ ...calendarProps,
3369
+ showYearNavigation
3370
+ }
3371
+ ))
3372
3372
  ))
3373
- ))
3374
- )));
3373
+ )
3374
+ ));
3375
3375
  }
3376
3376
  var init_DatePicker = __esm({
3377
3377
  "src/datepicker/DatePicker.tsx"() {
@@ -4996,12 +4996,9 @@ function ListBoxSection({ section, state: state2 }) {
4996
4996
  (item) => /* @__PURE__ */ React49__namespace.default.createElement(Option, { key: item.key, item, state: state2 })
4997
4997
  )));
4998
4998
  }
4999
- exports.SelectItem = void 0; exports.SelectItemLabel = void 0; exports.SelectItemDescription = void 0; var OptionContext, useOptionContext;
4999
+ var OptionContext, useOptionContext;
5000
5000
  var init_ListBox = __esm({
5001
5001
  "src/input/ListBox.tsx"() {
5002
- exports.SelectItem = reactStately.Item;
5003
- exports.SelectItemLabel = ItemLabel;
5004
- exports.SelectItemDescription = ItemDescription;
5005
5002
  OptionContext = React49__namespace.default.createContext({
5006
5003
  labelProps: {},
5007
5004
  descriptionProps: {}
@@ -12090,7 +12087,7 @@ var init_CountryCodeSelect = __esm({
12090
12087
  items: callingCodes,
12091
12088
  ...props
12092
12089
  },
12093
- (item) => /* @__PURE__ */ React49__namespace.default.createElement(exports.SelectItem, { key: item.key }, item.key)
12090
+ (item) => /* @__PURE__ */ React49__namespace.default.createElement(reactStately.Item, { key: item.key }, item.key)
12094
12091
  );
12095
12092
  };
12096
12093
  CountryCodeSelect_default = CountryCodeSelect;
@@ -12132,7 +12129,7 @@ var init_PhoneNumberInput = __esm({
12132
12129
  height: "100%",
12133
12130
  value: "+47"
12134
12131
  },
12135
- /* @__PURE__ */ React49__namespace.default.createElement(exports.SelectItem, { key: "+47" }, "+47")
12132
+ /* @__PURE__ */ React49__namespace.default.createElement(reactStately.Item, { key: "+47" }, "+47")
12136
12133
  )
12137
12134
  },
12138
12135
  /* @__PURE__ */ React49__namespace.default.createElement(
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, 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, 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, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, NumericStepper, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, PopoverWizardBody, ProgressBar, ProgressLoader, Radio, RadioGroup, ScaleFade, SearchInput, Section, SelectItem, SelectItemDescription, SelectItemLabel, SimpleDrawer, SimpleGrid, SimplePopover, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, 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-MMDKHHXP.mjs';
1
+ export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, 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, 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, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, NumericStepper, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, PopoverWizardBody, ProgressBar, ProgressLoader, Radio, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, SimplePopover, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, 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-B6U7OYV3.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
- "version": "2.5.3",
3
+ "version": "3.0.1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -34,7 +34,7 @@ export function DateField(props: DateFieldProps) {
34
34
  const { fieldProps, labelProps } = useDateField(props, state, ref);
35
35
 
36
36
  return (
37
- <Box minWidth="6rem">
37
+ <Box minWidth="6rem" width="100%">
38
38
  {props.label && (
39
39
  <FormLabel {...props.labelProps} {...labelProps} sx={styles.inputLabel}>
40
40
  {props.label}
@@ -26,7 +26,7 @@ import { StyledField } from "./StyledField";
26
26
  import { useCurrentLocale } from "./utils";
27
27
 
28
28
  type DatePickerProps = AriaDatePickerProps<DateValue> &
29
- Pick<BoxProps, "minHeight"> & {
29
+ Pick<BoxProps, "minHeight" | "width"> & {
30
30
  variant: ResponsiveValue<"simple" | "with-trigger">;
31
31
  name?: string;
32
32
  showYearNavigation?: boolean;
@@ -45,6 +45,7 @@ export function DatePicker({
45
45
  errorMessage,
46
46
  minHeight,
47
47
  showYearNavigation,
48
+ width = "auto",
48
49
  ...props
49
50
  }: DatePickerProps) {
50
51
  const formControlProps = useFormControlContext();
@@ -92,7 +93,12 @@ export function DatePicker({
92
93
 
93
94
  return (
94
95
  <I18nProvider locale={locale}>
95
- <Box position="relative" display="inline-flex" flexDirection="column">
96
+ <Box
97
+ position="relative"
98
+ display="inline-flex"
99
+ flexDirection="column"
100
+ width={width}
101
+ >
96
102
  <Popover
97
103
  {...dialogProps}
98
104
  isOpen={state.isOpen}
@@ -102,12 +108,7 @@ export function DatePicker({
102
108
  closeOnEsc
103
109
  returnFocusOnClose
104
110
  >
105
- <InputGroup
106
- {...groupProps}
107
- ref={ref}
108
- width="auto"
109
- display="inline-flex"
110
- >
111
+ <InputGroup {...groupProps} ref={ref} display="inline-flex">
111
112
  <PopoverAnchor>
112
113
  <StyledField
113
114
  variant={responsiveVariant}
@@ -9,7 +9,7 @@ type AttachedInputsProps = FlexProps;
9
9
  * <AttachedInputs>
10
10
  * <Input />
11
11
  * <NativeSelect>
12
- * <SelectItem />
12
+ * <Item />
13
13
  * </NativeSelect>
14
14
  * </AttachedInputs>
15
15
  * ```
@@ -1,11 +1,5 @@
1
1
  import React from "react";
2
- import {
3
- BoxProps,
4
- InfoSelect,
5
- SelectItem,
6
- createTexts,
7
- useTranslation,
8
- } from "..";
2
+ import { BoxProps, InfoSelect, Item, createTexts, useTranslation } from "..";
9
3
 
10
4
  import { getSupportedCallingCodes } from "awesome-phonenumber";
11
5
 
@@ -43,7 +37,7 @@ export const CountryCodeSelect = (props: CountryCodeSelectProps) => {
43
37
  items={callingCodes as any}
44
38
  {...props}
45
39
  >
46
- {(item) => <SelectItem key={item.key}>{item.key}</SelectItem>}
40
+ {(item) => <Item key={item.key}>{item.key}</Item>}
47
41
  </InfoSelect>
48
42
  );
49
43
  };
@@ -18,16 +18,16 @@ import { Popover } from "./Popover";
18
18
 
19
19
  type InfoSelectProps<T extends object> = {
20
20
  /**
21
- * Either a render function accepting an item, and returning a <SelectItem />,
22
- * or a list of <SelectItem />s.
21
+ * Either a render function accepting an item, and returning a <Item />,
22
+ * or a list of <Item />s.
23
23
  *
24
24
  * Render function example:
25
25
  * ```tsx
26
26
  * <Select items={items}>
27
27
  * {(item) => (
28
- * <SelectItem key={item.value} value={item.value}>
28
+ * <Item key={item.value} value={item.value}>
29
29
  * {item.label}
30
- * </SelectItem>
30
+ * </Item>
31
31
  * )}
32
32
  * </Select>
33
33
  * ```
@@ -35,12 +35,12 @@ type InfoSelectProps<T extends object> = {
35
35
  * For this to work, the members in `items` need either a `key`
36
36
  * or an `id` property.
37
37
  *
38
- * List of <SelectItem />s example:
38
+ * List of <Item />s example:
39
39
  * ```tsx
40
40
  * <Select label="Choose a color">
41
- * <SelectItem>Green</SelectItem>
42
- * <SelectItem>Blue</SelectItem>
43
- * <SelectItem>Yellow</SelectItem>
41
+ * <Item>Green</Item>
42
+ * <Item>Blue</Item>
43
+ * <Item>Yellow</Item>
44
44
  * </Select>
45
45
  * ```
46
46
  **/
@@ -104,9 +104,9 @@ type InfoSelectProps<T extends object> = {
104
104
  *
105
105
  * ```tsx
106
106
  * <Select label="Choose a color" disabledKeys={["blue", "yellow"]}>
107
- * <SelectItem key="green">Green</SelectItem>
108
- * <SelectItem key="blue">Blue</SelectItem>
109
- * <SelectItem key="yellow">Yellow</SelectItem>
107
+ * <Item key="green">Green</Item>
108
+ * <Item key="blue">Blue</Item>
109
+ * <Item key="yellow">Yellow</Item>
110
110
  * </Select>
111
111
  * ```
112
112
  **/
@@ -14,10 +14,8 @@ import {
14
14
  useListBoxSection,
15
15
  useOption,
16
16
  } from "react-aria";
17
- import { Item, type ListState, type SelectState } from "react-stately";
17
+ import { type ListState, type SelectState } from "react-stately";
18
18
 
19
- /** @deprecated use Item instead */
20
- export const SelectItem = Item;
21
19
  export { Item, Section } from "react-stately";
22
20
 
23
21
  type ListBoxProps<T> = AriaListBoxProps<T> &
@@ -111,8 +109,6 @@ export function ItemLabel({ children }: { children: React.ReactNode }) {
111
109
  </Box>
112
110
  );
113
111
  }
114
- /** @deprecated use ItemLabel instead */
115
- export const SelectItemLabel = ItemLabel;
116
112
 
117
113
  /**
118
114
  * Renders a description for an Item.
@@ -128,8 +124,6 @@ export function ItemDescription({ children }: { children: React.ReactNode }) {
128
124
  </Box>
129
125
  );
130
126
  }
131
- /** @deprecated Use ItemDescription instead */
132
- export const SelectItemDescription = ItemDescription;
133
127
 
134
128
  type OptionProps = {
135
129
  item: Node<unknown>;
@@ -5,7 +5,7 @@ import {
5
5
  useControllableState,
6
6
  } from "@chakra-ui/react";
7
7
  import React, { Suspense } from "react";
8
- import { InfoSelect, Input, SelectItem, createTexts, useTranslation } from "..";
8
+ import { InfoSelect, Input, Item, createTexts, useTranslation } from "..";
9
9
  import { AttachedInputs } from "./AttachedInputs";
10
10
 
11
11
  type CountryCodeAndPhoneNumber = {
@@ -65,7 +65,7 @@ export const PhoneNumberInput = forwardRef<PhoneNumberInputProps, As>(
65
65
  height="100%"
66
66
  value="+47"
67
67
  >
68
- <SelectItem key="+47">+47</SelectItem>
68
+ <Item key="+47">+47</Item>
69
69
  </InfoSelect>
70
70
  }
71
71
  >
@@ -4,29 +4,32 @@ import React from "react";
4
4
 
5
5
  type TextStyles = keyof typeof tokens.font.style;
6
6
 
7
- export type HeadingProps = Exclude<ChakraHeadingProps, "textStyle"> & {
7
+ export type HeadingProps = Omit<ChakraHeadingProps, "textStyle" | "as"> & {
8
+ /** The heading level, e.g. h1, h2, h3... **/
9
+ as: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
8
10
  /** The size and style of the heading */
9
11
  variant?: TextStyles;
10
12
  };
11
13
  /**
12
14
  * Create your own fancy headings with this component.
13
15
  *
14
- * You can specify the variant, which is one of "xs", "sm", "md", "lg", "xl-sans", "xs-serif" and "2xl". The default is "xl-sans".
16
+ * You have to specify what level of heading you want, depending on the context you are using the heading in.
17
+ * You do this with the `as` prop. The options are h1, h2, h3, h4, h5 and h6.
15
18
  *
16
19
  * ```tsx
17
- * <Heading variant="2xl">Look at me!</Heading>
20
+ * <Heading as="h1">Page heading</Heading>
18
21
  * ```
19
22
  *
20
- * You can also specify what level of heading you want. You do this with the `as` prop. The default is "h2".
23
+ * You can specify the variant, which is one of "xs", "sm", "md", "lg", "xl-sans", "xs-serif" and "2xl". The default is "xl-sans".
21
24
  *
22
25
  * ```tsx
23
- * <Heading as="h1">Page heading</Heading>
26
+ * <Heading as="h1" variant="2xl">Look at me!</Heading>
24
27
  * ```
25
28
  */
26
29
  export const Heading = ({
30
+ as,
27
31
  variant = "xl-display",
28
- as = "h2",
29
32
  ...props
30
- }: any) => {
33
+ }: HeadingProps) => {
31
34
  return <Text as={as} textStyle={variant} {...props} />;
32
35
  };