@vygruppen/spor-react 5.1.1 → 5.3.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.
package/dist/index.d.mts CHANGED
@@ -408,7 +408,7 @@ type FloatingActionButtonProps = BoxProps & {
408
408
  * placement="bottom right"
409
409
  * />
410
410
  */
411
- declare const FloatingActionButton: ComponentWithAs<ComponentWithAs<"a" | "button">, FloatingActionButtonProps>;
411
+ declare const FloatingActionButton: ComponentWithAs<ComponentWithAs<"a" | "button", {}>, FloatingActionButtonProps>;
412
412
 
413
413
  type CardProps = Exclude<BoxProps, "size"> & {
414
414
  size?: "sm" | "lg";
@@ -456,20 +456,25 @@ declare const Card: _chakra_ui_system_dist_system_types.ComponentWithAs<As, Card
456
456
  * <DatePicker label="Dato" variant="base" />
457
457
  * ```
458
458
  */
459
- declare const DatePicker: React__default.ForwardRefExoticComponent<AriaDatePickerProps<DateValue> & Pick<BoxProps, "width" | "minHeight"> & {
459
+ declare const DatePicker: React__default.ForwardRefExoticComponent<Omit<AriaDatePickerProps<DateValue>, "onChange"> & Pick<BoxProps, "width" | "minHeight"> & {
460
460
  variant: ResponsiveValue<"base" | "floating" | "ghost">;
461
461
  name?: string | undefined;
462
462
  showYearNavigation?: boolean | undefined;
463
463
  withPortal?: boolean | undefined;
464
+ onChange?: ((value: DateValue | null) => void) | undefined;
464
465
  } & React__default.RefAttributes<HTMLDivElement>>;
465
466
 
466
- type DateRangePickerProps = AriaDateRangePickerProps<DateValue> & Pick<BoxProps, "minHeight"> & {
467
+ type DateRangePickerProps = Omit<AriaDateRangePickerProps<DateValue>, "onChange"> & Pick<BoxProps, "minHeight"> & {
467
468
  startLabel?: string;
468
469
  startName?: string;
469
470
  endLabel?: string;
470
471
  endName?: string;
471
472
  variant: ResponsiveValue<"base" | "floating" | "ghost">;
472
473
  withPortal?: boolean;
474
+ onChange?: (dates: {
475
+ start: DateValue | null;
476
+ end: DateValue | null;
477
+ } | null) => void;
473
478
  };
474
479
  /**
475
480
  * A date range picker component.
@@ -501,7 +506,7 @@ type TimePickerProps = Omit<BoxProps, "defaultValue" | "onChange"> & {
501
506
  **/
502
507
  defaultValue?: TimeValue | null;
503
508
  /** Callback for when the time changes */
504
- onChange?: (value: TimeValue) => void;
509
+ onChange?: (value: TimeValue | null) => void;
505
510
  /** The maxiumum number of minutes to move when the step buttons are used.
506
511
  *
507
512
  * Defaults to 30 minutes.
@@ -939,6 +944,7 @@ type InfoSelectProps<T extends object> = {
939
944
  disabledKeys?: string[];
940
945
  /** Whether or not the input is invalid */
941
946
  "aria-invalid"?: boolean;
947
+ variant?: "base" | "floating";
942
948
  };
943
949
  /**
944
950
  * A styled select component.
@@ -975,7 +981,7 @@ type InfoSelectProps<T extends object> = {
975
981
  *
976
982
  * @see https://spor.vy.no/components/info-select
977
983
  */
978
- declare function InfoSelect<T extends object>({ placeholder, width, height, onChange, value, isLabelSrOnly, defaultValue, ...props }: InfoSelectProps<T>): React__default.JSX.Element;
984
+ declare function InfoSelect<T extends object>({ placeholder, width, height, onChange, value, isLabelSrOnly, defaultValue, variant, ...props }: InfoSelectProps<T>): React__default.JSX.Element;
979
985
 
980
986
  type InputProps = Omit<InputProps$1, "variant" | "size"> & {
981
987
  /** The input's label */
@@ -1818,8 +1824,28 @@ type WizardPopoverProps = PopoverProps & {
1818
1824
  */
1819
1825
  declare const WizardPopover: ({ children, triggerElement, withCloseButton, }: WizardPopoverProps) => React.JSX.Element;
1820
1826
 
1827
+ type ProgressIndicatorProps = {
1828
+ numberOfSteps: number;
1829
+ activeStep: number;
1830
+ };
1831
+ /**
1832
+ * A progress indicator is used to show which step of a process a user is currently in
1833
+ * to give them a sense of progress.
1834
+ *
1835
+ * You specify the active step, which starts at 1 (not 0)
1836
+ *
1837
+ * ```tsx
1838
+ * <ProgressIndicator
1839
+ * numberOfSteps={3}
1840
+ * activeStep={2}
1841
+ * />
1842
+ * ```
1843
+ */
1844
+ declare const ProgressIndicator: ({ numberOfSteps, activeStep, }: ProgressIndicatorProps) => React__default.JSX.Element;
1845
+
1821
1846
  type SporProviderProps = ChakraProviderProps & {
1822
1847
  language?: Language;
1848
+ brand?: Brand;
1823
1849
  };
1824
1850
  /**
1825
1851
  * This component is used to provide the specified theme of colors and other
@@ -1857,7 +1883,7 @@ type SporProviderProps = ChakraProviderProps & {
1857
1883
  * );
1858
1884
  * ```
1859
1885
  */
1860
- declare const SporProvider: ({ theme, language, children, ...props }: SporProviderProps) => React__default.JSX.Element;
1886
+ declare const SporProvider: ({ theme, language, brand, children, ...props }: SporProviderProps) => React__default.JSX.Element;
1861
1887
 
1862
1888
  type StepperProps = {
1863
1889
  onClick: (clickedStep: number) => void;
@@ -1967,6 +1993,10 @@ declare const textStyles: {
1967
1993
  /** A string of CSS that should be injected in the global CSS space */
1968
1994
  declare const fontFaces: string;
1969
1995
 
1996
+ declare enum Brand {
1997
+ VyDigital = "VyDigital",
1998
+ VyUtvikling = "VyUtvikling"
1999
+ }
1970
2000
  declare const theme: {
1971
2001
  components: {
1972
2002
  Accordion: {
@@ -3185,7 +3215,7 @@ declare const theme: {
3185
3215
  }>;
3186
3216
  } | undefined;
3187
3217
  defaultProps?: {
3188
- size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "4xl" | "5xl" | "6xl" | "full" | undefined;
3218
+ size?: "sm" | "md" | "lg" | "xs" | "2xl" | "xl" | "3xl" | "4xl" | "5xl" | "6xl" | "full" | undefined;
3189
3219
  variant?: string | number | undefined;
3190
3220
  colorScheme?: string | undefined;
3191
3221
  } | undefined;
@@ -3529,29 +3559,13 @@ declare const theme: {
3529
3559
  };
3530
3560
  backgroundColor: string;
3531
3561
  color: string;
3532
- } | {
3533
- _hover: {
3534
- boxShadow: string;
3535
- };
3536
- _focus: {
3537
- boxShadow: string;
3538
- };
3539
- backgroundColor?: undefined;
3540
- color: string;
3541
3562
  };
3542
3563
  _active: {
3543
3564
  boxShadow: string;
3544
3565
  backgroundColor: string;
3545
- } | {
3546
- boxShadow: string;
3547
- backgroundColor?: undefined;
3548
3566
  };
3549
3567
  _expanded: {
3550
3568
  boxShadow: string;
3551
- backgroundColor: string;
3552
- } | {
3553
- boxShadow: string;
3554
- backgroundColor?: undefined;
3555
3569
  };
3556
3570
  _invalid: {
3557
3571
  _focus: _chakra_ui_styled_system.SystemStyleObject;
@@ -3587,13 +3601,28 @@ declare const theme: {
3587
3601
  }>;
3588
3602
  } | undefined;
3589
3603
  variants?: {
3590
- [key: string]: _chakra_ui_styled_system.PartsStyleInterpolation<{
3591
- keys: ("button" | "label" | "container" | "arrowIcon")[];
3592
- }>;
3604
+ base: (props: _chakra_ui_styled_system.StyleFunctionProps) => {};
3605
+ floating: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
3606
+ button: {
3607
+ _active: {
3608
+ backgroundColor: string;
3609
+ boxShadow: string;
3610
+ };
3611
+ _focus: _chakra_ui_styled_system.SystemStyleObject;
3612
+ _focusVisible: _chakra_ui_styled_system.SystemStyleObject;
3613
+ "&[data-focus]:not([data-focus-visible])": _chakra_ui_styled_system.SystemStyleObject;
3614
+ _hover: {
3615
+ backgroundColor: string;
3616
+ boxShadow: string;
3617
+ };
3618
+ boxShadow: string;
3619
+ backgroundColor: string;
3620
+ };
3621
+ };
3593
3622
  } | undefined;
3594
3623
  defaultProps?: {
3595
3624
  size?: string | number | undefined;
3596
- variant?: string | number | undefined;
3625
+ variant?: "base" | "floating" | undefined;
3597
3626
  colorScheme?: string | undefined;
3598
3627
  } | undefined;
3599
3628
  parts: ("button" | "label" | "container" | "arrowIcon")[];
@@ -4048,24 +4077,18 @@ declare const theme: {
4048
4077
  borderRadius: string;
4049
4078
  color: string;
4050
4079
  cursor: string;
4051
- _hover: {
4052
- backgroundColor: string;
4053
- outline: string;
4054
- };
4080
+ outline: string;
4055
4081
  _active: {
4056
4082
  backgroundColor: string;
4057
- outline: string;
4058
4083
  };
4059
4084
  _focus: {
4060
- outline: string;
4085
+ backgroundColor: string;
4086
+ };
4087
+ _hover: {
4061
4088
  backgroundColor: string;
4062
4089
  };
4063
4090
  _selected: {
4064
- color: string;
4065
4091
  backgroundColor: string;
4066
- } | {
4067
- color: string;
4068
- backgroundColor?: undefined;
4069
4092
  };
4070
4093
  };
4071
4094
  label: {};
@@ -4253,7 +4276,7 @@ declare const theme: {
4253
4276
  }>;
4254
4277
  } | undefined;
4255
4278
  defaultProps?: {
4256
- size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "4xl" | "5xl" | "6xl" | "full" | undefined;
4279
+ size?: "sm" | "md" | "lg" | "xs" | "2xl" | "xl" | "3xl" | "4xl" | "5xl" | "6xl" | "full" | undefined;
4257
4280
  variant?: string | number | undefined;
4258
4281
  colorScheme?: string | undefined;
4259
4282
  } | undefined;
@@ -4329,6 +4352,45 @@ declare const theme: {
4329
4352
  } | undefined;
4330
4353
  parts: ("body" | "footer" | "header" | "content" | "closeButton" | "arrow" | "popper")[];
4331
4354
  };
4355
+ ProgressIndicator: {
4356
+ baseStyle?: ((props: _chakra_ui_styled_system.StyleFunctionProps) => {
4357
+ root: {
4358
+ width: string;
4359
+ };
4360
+ container: {
4361
+ display: string;
4362
+ alignItems: string;
4363
+ gap: number;
4364
+ justifyContent: ("center" | "space-between")[];
4365
+ };
4366
+ progressDot: {
4367
+ height: number;
4368
+ width: number;
4369
+ "&[aria-current='step']": {
4370
+ circle: {
4371
+ fill: string;
4372
+ };
4373
+ };
4374
+ circle: {
4375
+ fill: string;
4376
+ };
4377
+ };
4378
+ }) | undefined;
4379
+ sizes?: {
4380
+ [key: string]: _chakra_ui_styled_system.PartsStyleInterpolation<{
4381
+ keys: ("container" | "root" | "progressDot")[];
4382
+ }>;
4383
+ } | undefined;
4384
+ variants?: {
4385
+ base: (props: _chakra_ui_styled_system.StyleFunctionProps) => {};
4386
+ } | undefined;
4387
+ defaultProps?: {
4388
+ size?: string | number | undefined;
4389
+ variant?: "base" | undefined;
4390
+ colorScheme?: string | undefined;
4391
+ } | undefined;
4392
+ parts: ("container" | "root" | "progressDot")[];
4393
+ };
4332
4394
  Radio: {
4333
4395
  baseStyle?: {
4334
4396
  container: {
@@ -4733,7 +4795,7 @@ declare const theme: {
4733
4795
  variant?: "solid" | "outline" | undefined;
4734
4796
  colorScheme?: string | undefined;
4735
4797
  } | undefined;
4736
- parts: ("track" | "container" | "thumb")[];
4798
+ parts: ("label" | "track" | "container" | "thumb")[];
4737
4799
  };
4738
4800
  Table: {
4739
4801
  baseStyle?: {
@@ -4880,7 +4942,7 @@ declare const theme: {
4880
4942
  } | undefined;
4881
4943
  defaultProps?: {
4882
4944
  size?: "sm" | "md" | "lg" | undefined;
4883
- variant?: "outline" | "unstyled" | "simple" | undefined;
4945
+ variant?: "outline" | "simple" | "unstyled" | undefined;
4884
4946
  colorScheme?: string | undefined;
4885
4947
  } | undefined;
4886
4948
  parts: ("caption" | "table" | "tbody" | "td" | "tfoot" | "th" | "thead" | "tr")[];
@@ -5686,7 +5748,7 @@ declare const theme: {
5686
5748
  }>;
5687
5749
  } | undefined;
5688
5750
  defaultProps?: {
5689
- size?: "sm" | "md" | "lg" | "xl" | "2xl" | "2xs" | "xs" | "full" | undefined;
5751
+ size?: "sm" | "md" | "lg" | "xs" | "2xl" | "xl" | "full" | "2xs" | undefined;
5690
5752
  variant?: string | number | undefined;
5691
5753
  colorScheme?: string | undefined;
5692
5754
  } | undefined;
@@ -5848,7 +5910,7 @@ declare const theme: {
5848
5910
  [key: string]: _chakra_ui_styled_system.SystemStyleInterpolation;
5849
5911
  } | undefined;
5850
5912
  defaultProps?: {
5851
- size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "4xl" | undefined;
5913
+ size?: "sm" | "md" | "lg" | "xs" | "2xl" | "xl" | "3xl" | "4xl" | undefined;
5852
5914
  variant?: string | number | undefined;
5853
5915
  colorScheme?: string | undefined;
5854
5916
  } | undefined;
@@ -6187,7 +6249,7 @@ declare const theme: {
6187
6249
  } | undefined;
6188
6250
  defaultProps?: {
6189
6251
  size?: "sm" | "md" | "lg" | "xs" | undefined;
6190
- variant?: "outline" | "unstyled" | "filled" | "flushed" | undefined;
6252
+ variant?: "outline" | "filled" | "unstyled" | "flushed" | undefined;
6191
6253
  colorScheme?: string | undefined;
6192
6254
  } | undefined;
6193
6255
  parts: ("root" | "field" | "stepper" | "stepperGroup")[];
@@ -6245,7 +6307,7 @@ declare const theme: {
6245
6307
  } | undefined;
6246
6308
  defaultProps?: {
6247
6309
  size?: "sm" | "md" | "lg" | "xs" | undefined;
6248
- variant?: "outline" | "unstyled" | "filled" | "flushed" | undefined;
6310
+ variant?: "outline" | "filled" | "unstyled" | "flushed" | undefined;
6249
6311
  colorScheme?: string | undefined;
6250
6312
  } | undefined;
6251
6313
  };
@@ -6557,7 +6619,7 @@ declare const theme: {
6557
6619
  [key: string]: _chakra_ui_styled_system.SystemStyleInterpolation;
6558
6620
  } | undefined;
6559
6621
  defaultProps?: {
6560
- size?: "sm" | "md" | "lg" | "xl" | "xs" | undefined;
6622
+ size?: "sm" | "md" | "lg" | "xs" | "xl" | undefined;
6561
6623
  variant?: string | number | undefined;
6562
6624
  colorScheme?: string | undefined;
6563
6625
  } | undefined;
@@ -7160,6 +7222,18 @@ declare const theme: {
7160
7222
  };
7161
7223
  direction: "ltr";
7162
7224
  };
7225
+ declare const brandTheme: {
7226
+ VyDigital: {
7227
+ colors: {
7228
+ accent: string;
7229
+ };
7230
+ };
7231
+ VyUtvikling: {
7232
+ colors: {
7233
+ accent: string;
7234
+ };
7235
+ };
7236
+ };
7163
7237
 
7164
7238
  type BaseToastProps = {
7165
7239
  children: React__default.ReactNode;
@@ -7297,4 +7371,4 @@ type TextProps = Omit<TextProps$1, "textStyle"> & {
7297
7371
  */
7298
7372
  declare const Text: _chakra_ui_system_dist_system_types.ComponentWithAs<"p", TextProps>;
7299
7373
 
7300
- export { Accordion, AccordionProps, AttachedInputs, Badge, BadgeProps, Breadcrumb, BreadcrumbItem, BreadcrumbLink, 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 };
7374
+ export { Accordion, AccordionProps, AttachedInputs, Badge, BadgeProps, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, 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, ProgressIndicator, 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, brandTheme, createTexts, fontFaces, theme, useToast, useTranslation };