@vygruppen/spor-react 2.5.3 → 3.0.0

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.0 build
3
3
  > tsup src/index.tsx --dts --treeshake --format cjs,esm
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -10,12 +10,12 @@
10
10
  ESM Build start
11
11
  DTS Build start
12
12
  "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
13
+ "toTime" is imported from external module "@internationalized/date" but never used in "dist/chunk-YVNVHFTG.mjs".
14
+ CJS dist/index.js 896.11 KB
15
+ CJS ⚡️ Build success in 4412ms
16
+ ESM dist/CountryCodeSelect-57KCWSW3.mjs 351.65 KB
17
+ ESM dist/index.mjs 2.01 KB
18
+ ESM dist/chunk-YVNVHFTG.mjs 416.38 KB
19
+ ESM ⚡️ Build success in 4414ms
20
+ DTS ⚡️ Build success in 17131ms
21
+ DTS dist/index.d.ts 259.10 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - d0f0c5ff: Remove deprecated components SelectItem, SelectItemLabel and SelectItemDescription.
8
+
9
+ To migrate, use Item, ItemLabel and ItemDescription, respectively.
10
+
11
+ - 6c1f3d08: Heading: Make `as` prop required
12
+
13
+ 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.
14
+
15
+ ### Patch Changes
16
+
17
+ - 08b926e3: DatePicker: Make it possible to override width of datepicker
18
+
3
19
  ## 2.5.3
4
20
 
5
21
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { createTexts, useTranslation, InfoSelect, SelectItem } from './chunk-MMDKHHXP.mjs';
1
+ import { createTexts, useTranslation, InfoSelect, Item } from './chunk-YVNVHFTG.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';
@@ -3226,11 +3226,7 @@ var Badge = forwardRef(
3226
3226
  }
3227
3227
  );
3228
3228
  var Code = forwardRef((props, ref) => /* @__PURE__ */ React49__default.createElement(Code$1, { ...props, ref }));
3229
- var Heading = ({
3230
- variant = "xl-display",
3231
- as = "h2",
3232
- ...props
3233
- }) => {
3229
+ var Heading = ({ as, variant = "xl-display", ...props }) => {
3234
3230
  return /* @__PURE__ */ React49__default.createElement(Text, { as, textStyle: variant, ...props });
3235
3231
  };
3236
3232
  var Text4 = forwardRef(
@@ -3579,7 +3575,7 @@ function DateField(props) {
3579
3575
  });
3580
3576
  const ref = useRef(null);
3581
3577
  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 }));
3578
+ 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
3579
  }
3584
3580
  var StyledField = forwardRef(
3585
3581
  ({ children, variant, ...otherProps }, ref) => {
@@ -3606,6 +3602,7 @@ function DatePicker({
3606
3602
  errorMessage,
3607
3603
  minHeight,
3608
3604
  showYearNavigation,
3605
+ width = "auto",
3609
3606
  ...props
3610
3607
  }) {
3611
3608
  const formControlProps = useFormControlContext();
@@ -3641,26 +3638,26 @@ function DatePicker({
3641
3638
  };
3642
3639
  const hasTrigger = responsiveVariant === "with-trigger";
3643
3640
  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,
3641
+ return /* @__PURE__ */ React49__default.createElement(I18nProvider, { locale }, /* @__PURE__ */ React49__default.createElement(
3642
+ Box,
3646
3643
  {
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
3644
+ position: "relative",
3645
+ display: "inline-flex",
3646
+ flexDirection: "column",
3647
+ width
3654
3648
  },
3655
3649
  /* @__PURE__ */ React49__default.createElement(
3656
- InputGroup,
3650
+ Popover,
3657
3651
  {
3658
- ...groupProps,
3659
- ref,
3660
- width: "auto",
3661
- display: "inline-flex"
3662
- },
3663
- /* @__PURE__ */ React49__default.createElement(PopoverAnchor, null, /* @__PURE__ */ React49__default.createElement(
3652
+ ...dialogProps,
3653
+ isOpen: state2.isOpen,
3654
+ onClose: () => state2.setOpen(false),
3655
+ onOpen: () => state2.setOpen(true),
3656
+ closeOnBlur: true,
3657
+ closeOnEsc: true,
3658
+ returnFocusOnClose: true
3659
+ },
3660
+ /* @__PURE__ */ React49__default.createElement(InputGroup, { ...groupProps, ref, display: "inline-flex" }, /* @__PURE__ */ React49__default.createElement(PopoverAnchor, null, /* @__PURE__ */ React49__default.createElement(
3664
3661
  StyledField,
3665
3662
  {
3666
3663
  variant: responsiveVariant,
@@ -3679,27 +3676,26 @@ function DatePicker({
3679
3676
  ...fieldProps
3680
3677
  }
3681
3678
  )
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,
3679
+ )), hasTrigger && /* @__PURE__ */ React49__default.createElement(CalendarTriggerButton, { ...buttonProps })),
3680
+ /* @__PURE__ */ React49__default.createElement(FormErrorMessage, { ...errorMessageProps }, errorMessage),
3681
+ state2.isOpen && !props.isDisabled && /* @__PURE__ */ React49__default.createElement(Portal, null, /* @__PURE__ */ React49__default.createElement(
3682
+ PopoverContent,
3696
3683
  {
3697
- ...calendarProps,
3698
- showYearNavigation
3699
- }
3684
+ color: "darkGrey",
3685
+ boxShadow: "md",
3686
+ sx: styles2.calendar
3687
+ },
3688
+ /* @__PURE__ */ React49__default.createElement(PopoverArrow, { sx: styles2.arrow }),
3689
+ /* @__PURE__ */ React49__default.createElement(PopoverBody, null, /* @__PURE__ */ React49__default.createElement(
3690
+ Calendar,
3691
+ {
3692
+ ...calendarProps,
3693
+ showYearNavigation
3694
+ }
3695
+ ))
3700
3696
  ))
3701
- ))
3702
- )));
3697
+ )
3698
+ ));
3703
3699
  }
3704
3700
  function RangeCalendar(props) {
3705
3701
  const locale = useCurrentLocale();
@@ -4383,7 +4379,6 @@ var Arrow = (props) => {
4383
4379
  var FormLabel3 = forwardRef((props, ref) => {
4384
4380
  return /* @__PURE__ */ React49__default.createElement(FormLabel, { ...props, ref });
4385
4381
  });
4386
- var SelectItem = Item;
4387
4382
  function ListBox({
4388
4383
  isLoading,
4389
4384
  listBoxRef,
@@ -4413,13 +4408,11 @@ function ItemLabel({ children }) {
4413
4408
  const styles2 = useMultiStyleConfig("ListBox", {});
4414
4409
  return /* @__PURE__ */ React49__default.createElement(Box, { ...labelProps, sx: styles2.label }, children);
4415
4410
  }
4416
- var SelectItemLabel = ItemLabel;
4417
4411
  function ItemDescription({ children }) {
4418
4412
  let { descriptionProps } = useOptionContext();
4419
4413
  const styles2 = useMultiStyleConfig("ListBox", {});
4420
4414
  return /* @__PURE__ */ React49__default.createElement(Box, { ...descriptionProps, sx: styles2.description }, children);
4421
4415
  }
4422
- var SelectItemDescription = ItemDescription;
4423
4416
  function Option({ item, state: state2 }) {
4424
4417
  const ref = useRef(null);
4425
4418
  const {
@@ -4883,7 +4876,7 @@ var PhoneNumberInput = forwardRef(
4883
4876
  height: "100%",
4884
4877
  value: "+47"
4885
4878
  },
4886
- /* @__PURE__ */ React49__default.createElement(SelectItem, { key: "+47" }, "+47")
4879
+ /* @__PURE__ */ React49__default.createElement(Item, { key: "+47" }, "+47")
4887
4880
  )
4888
4881
  },
4889
4882
  /* @__PURE__ */ React49__default.createElement(
@@ -4928,7 +4921,7 @@ var texts13 = createTexts({
4928
4921
  sv: "Telefonnummer"
4929
4922
  }
4930
4923
  });
4931
- var LazyCountryCodeSelect = React49__default.lazy(() => import('./CountryCodeSelect-GJJH4VNO.mjs'));
4924
+ var LazyCountryCodeSelect = React49__default.lazy(() => import('./CountryCodeSelect-57KCWSW3.mjs'));
4932
4925
  var Radio = forwardRef((props, ref) => {
4933
4926
  return /* @__PURE__ */ React49__default.createElement(Radio$1, { ...props, ref });
4934
4927
  });
@@ -14565,4 +14558,4 @@ var getToastComponent = (opts) => {
14565
14558
  return ({ id }) => /* @__PURE__ */ React49__default.createElement(BaseToast, { id, variant: opts.variant }, opts.text);
14566
14559
  };
14567
14560
 
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 };
14561
+ 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 }: any) => 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
@@ -2825,11 +2825,7 @@ var init_Code = __esm({
2825
2825
  exports.Heading = void 0;
2826
2826
  var init_Heading = __esm({
2827
2827
  "src/typography/Heading.tsx"() {
2828
- exports.Heading = ({
2829
- variant = "xl-display",
2830
- as = "h2",
2831
- ...props
2832
- }) => {
2828
+ exports.Heading = ({ as, variant = "xl-display", ...props }) => {
2833
2829
  return /* @__PURE__ */ React49__namespace.default.createElement(react.Text, { as, textStyle: variant, ...props });
2834
2830
  };
2835
2831
  }
@@ -3241,7 +3237,7 @@ function DateField(props) {
3241
3237
  });
3242
3238
  const ref = React49.useRef(null);
3243
3239
  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 }));
3240
+ 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
3241
  }
3246
3242
  var init_DateField = __esm({
3247
3243
  "src/datepicker/DateField.tsx"() {
@@ -3278,6 +3274,7 @@ function DatePicker({
3278
3274
  errorMessage,
3279
3275
  minHeight,
3280
3276
  showYearNavigation,
3277
+ width = "auto",
3281
3278
  ...props
3282
3279
  }) {
3283
3280
  const formControlProps = react.useFormControlContext();
@@ -3313,26 +3310,26 @@ function DatePicker({
3313
3310
  };
3314
3311
  const hasTrigger = responsiveVariant === "with-trigger";
3315
3312
  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,
3313
+ return /* @__PURE__ */ React49__namespace.default.createElement(reactAria.I18nProvider, { locale }, /* @__PURE__ */ React49__namespace.default.createElement(
3314
+ react.Box,
3318
3315
  {
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
3316
+ position: "relative",
3317
+ display: "inline-flex",
3318
+ flexDirection: "column",
3319
+ width
3326
3320
  },
3327
3321
  /* @__PURE__ */ React49__namespace.default.createElement(
3328
- react.InputGroup,
3322
+ react.Popover,
3329
3323
  {
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(
3324
+ ...dialogProps,
3325
+ isOpen: state2.isOpen,
3326
+ onClose: () => state2.setOpen(false),
3327
+ onOpen: () => state2.setOpen(true),
3328
+ closeOnBlur: true,
3329
+ closeOnEsc: true,
3330
+ returnFocusOnClose: true
3331
+ },
3332
+ /* @__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
3333
  StyledField,
3337
3334
  {
3338
3335
  variant: responsiveVariant,
@@ -3351,27 +3348,26 @@ function DatePicker({
3351
3348
  ...fieldProps
3352
3349
  }
3353
3350
  )
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,
3351
+ )), hasTrigger && /* @__PURE__ */ React49__namespace.default.createElement(CalendarTriggerButton, { ...buttonProps })),
3352
+ /* @__PURE__ */ React49__namespace.default.createElement(exports.FormErrorMessage, { ...errorMessageProps }, errorMessage),
3353
+ state2.isOpen && !props.isDisabled && /* @__PURE__ */ React49__namespace.default.createElement(react.Portal, null, /* @__PURE__ */ React49__namespace.default.createElement(
3354
+ react.PopoverContent,
3368
3355
  {
3369
- ...calendarProps,
3370
- showYearNavigation
3371
- }
3356
+ color: "darkGrey",
3357
+ boxShadow: "md",
3358
+ sx: styles2.calendar
3359
+ },
3360
+ /* @__PURE__ */ React49__namespace.default.createElement(react.PopoverArrow, { sx: styles2.arrow }),
3361
+ /* @__PURE__ */ React49__namespace.default.createElement(react.PopoverBody, null, /* @__PURE__ */ React49__namespace.default.createElement(
3362
+ Calendar,
3363
+ {
3364
+ ...calendarProps,
3365
+ showYearNavigation
3366
+ }
3367
+ ))
3372
3368
  ))
3373
- ))
3374
- )));
3369
+ )
3370
+ ));
3375
3371
  }
3376
3372
  var init_DatePicker = __esm({
3377
3373
  "src/datepicker/DatePicker.tsx"() {
@@ -4996,12 +4992,9 @@ function ListBoxSection({ section, state: state2 }) {
4996
4992
  (item) => /* @__PURE__ */ React49__namespace.default.createElement(Option, { key: item.key, item, state: state2 })
4997
4993
  )));
4998
4994
  }
4999
- exports.SelectItem = void 0; exports.SelectItemLabel = void 0; exports.SelectItemDescription = void 0; var OptionContext, useOptionContext;
4995
+ var OptionContext, useOptionContext;
5000
4996
  var init_ListBox = __esm({
5001
4997
  "src/input/ListBox.tsx"() {
5002
- exports.SelectItem = reactStately.Item;
5003
- exports.SelectItemLabel = ItemLabel;
5004
- exports.SelectItemDescription = ItemDescription;
5005
4998
  OptionContext = React49__namespace.default.createContext({
5006
4999
  labelProps: {},
5007
5000
  descriptionProps: {}
@@ -12090,7 +12083,7 @@ var init_CountryCodeSelect = __esm({
12090
12083
  items: callingCodes,
12091
12084
  ...props
12092
12085
  },
12093
- (item) => /* @__PURE__ */ React49__namespace.default.createElement(exports.SelectItem, { key: item.key }, item.key)
12086
+ (item) => /* @__PURE__ */ React49__namespace.default.createElement(reactStately.Item, { key: item.key }, item.key)
12094
12087
  );
12095
12088
  };
12096
12089
  CountryCodeSelect_default = CountryCodeSelect;
@@ -12132,7 +12125,7 @@ var init_PhoneNumberInput = __esm({
12132
12125
  height: "100%",
12133
12126
  value: "+47"
12134
12127
  },
12135
- /* @__PURE__ */ React49__namespace.default.createElement(exports.SelectItem, { key: "+47" }, "+47")
12128
+ /* @__PURE__ */ React49__namespace.default.createElement(reactStately.Item, { key: "+47" }, "+47")
12136
12129
  )
12137
12130
  },
12138
12131
  /* @__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-YVNVHFTG.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.0",
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,28 @@ 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
- export const Heading = ({
27
- variant = "xl-display",
28
- as = "h2",
29
- ...props
30
- }: any) => {
29
+ export const Heading = ({ as, variant = "xl-display", ...props }: any) => {
31
30
  return <Text as={as} textStyle={variant} {...props} />;
32
31
  };