@vygruppen/spor-react 3.8.1 → 4.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.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { DividerProps as DividerProps$1, As, BoxProps, StackProps as StackProps$1, AccordionProps as AccordionProps$1, AccordionItemProps, BreadcrumbProps as BreadcrumbProps$1, ButtonProps as ButtonProps$1, ButtonGroupProps as ButtonGroupProps$1, IconButtonProps as IconButtonProps$1, ComponentWithAs, ResponsiveValue, FlexProps, CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1, StackDirection, FormControlProps as FormControlProps$1, FormLabelProps as FormLabelProps$1, InputProps as InputProps$1, InputElementProps as InputElementProps$1, SelectProps, RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1, SwitchProps as SwitchProps$1, TextareaProps as TextareaProps$1, LinkProps as LinkProps$1, SkeletonTextProps as SkeletonTextProps$1, ModalHeaderProps as ModalHeaderProps$1, DrawerContentProps, DrawerProps as DrawerProps$1, PopoverProps, ChakraProviderProps, TabsProps as TabsProps$1, TableProps as TableProps$1, BadgeProps as BadgeProps$1, CodeProps as CodeProps$1, HeadingProps as HeadingProps$1, TextProps as TextProps$1 } from '@chakra-ui/react';
2
- export { AccordionButton, AccordionButtonProps, AccordionIcon, AccordionItem, AccordionItemProps, AccordionPanel, AccordionPanelProps, Box, BoxProps, Center, CenterProps, Collapse, CollapseProps, Container, ContainerProps, DarkMode, DrawerBody, DrawerCloseButton, DrawerFooter, DrawerOverlay, DrawerProps, Fade, FadeProps, Flex, FlexProps, FormHelperText, Grid, GridItem, GridItemProps, GridProps, HStack, Image, ImageProps, Img, ImgProps, InputGroup, InputGroupProps, LightMode, ListItem, ListItemProps, ListProps, Modal, ModalBody, ModalBodyProps, ModalCloseButton, ModalContent, ModalContentProps, ModalFooter, ModalFooterProps, ModalOverlay, ModalOverlayProps, ModalProps, OrderedList, Popover, PopoverAnchor, PopoverArrow, PopoverArrowProps, PopoverBody, PopoverBodyProps, PopoverCloseButton, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverFooter, PopoverFooterProps, PopoverHeader, PopoverHeaderProps, PopoverProps, PopoverTrigger, ScaleFade, ScaleFadeProps, SimpleGrid, SimpleGridProps, Slide, SlideFade, SlideFadeProps, SlideProps, Spacer, SpacerProps, Tab, TabList, TabListProps, TabPanel, TabPanelProps, TabPanels, TabPanelsProps, TabProps, TableBodyProps, TableCaption, TableCaptionProps, TableCellProps, TableColumnHeaderProps, TableFooterProps, TableHeadProps, TableRowProps, Tbody, Td, Tfoot, Th, Thead, Tr, UnorderedList, UseClipboardOptions, UseDisclosureProps, UseOutsideClickProps, VStack, Wrap, WrapItem, WrapItemProps, WrapProps, extendTheme, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToken } from '@chakra-ui/react';
2
+ export { AccordionButton, AccordionButtonProps, AccordionIcon, AccordionItem, AccordionItemProps, AccordionPanel, AccordionPanelProps, Box, BoxProps, Center, CenterProps, Collapse, CollapseProps, Container, ContainerProps, DarkMode, DrawerBody, DrawerCloseButton, DrawerFooter, DrawerOverlay, DrawerProps, Fade, FadeProps, Flex, FlexProps, FormHelperText, Grid, GridItem, GridItemProps, GridProps, HStack, Image, ImageProps, Img, ImgProps, InputGroup, InputGroupProps, LightMode, ListItem, ListItemProps, ListProps, Modal, ModalBody, ModalBodyProps, ModalCloseButton, ModalContent, ModalContentProps, ModalFooter, ModalFooterProps, ModalOverlay, ModalOverlayProps, ModalProps, OrderedList, Popover, PopoverAnchor, PopoverArrow, PopoverArrowProps, PopoverBody, PopoverBodyProps, PopoverCloseButton, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverFooter, PopoverFooterProps, PopoverHeader, PopoverHeaderProps, PopoverProps, PopoverTrigger, Portal, PortalProps, ScaleFade, ScaleFadeProps, SimpleGrid, SimpleGridProps, Slide, SlideFade, SlideFadeProps, SlideProps, Spacer, SpacerProps, Tab, TabList, TabListProps, TabPanel, TabPanelProps, TabPanels, TabPanelsProps, TabProps, TableBodyProps, TableCaption, TableCaptionProps, TableCellProps, TableColumnHeaderProps, TableFooterProps, TableHeadProps, TableRowProps, Tbody, Td, Tfoot, Th, Thead, Tr, UnorderedList, UseClipboardOptions, UseDisclosureProps, UseOutsideClickProps, VStack, Wrap, WrapItem, WrapItemProps, WrapProps, extendTheme, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToken } from '@chakra-ui/react';
3
3
  import tokens__default from '@vygruppen/spor-design-tokens';
4
4
  import * as tokens from '@vygruppen/spor-design-tokens';
5
5
  export { tokens };
@@ -266,9 +266,7 @@ type ButtonProps = Exclude<ButtonProps$1, "colorScheme" | "loadingText" | "size"
266
266
  *
267
267
  * Defaults to "primary"
268
268
  */
269
- variant?: "control" | "primary" | "secondary"
270
- /** @deprecated Use `secondary` instead */
271
- | "tertiary" | "additional" | "ghost" | "floating";
269
+ variant?: "control" | "primary" | "secondary" | "additional" | "ghost" | "floating";
272
270
  };
273
271
  /**
274
272
  * Buttons are used to trigger actions.
@@ -278,8 +276,7 @@ type ButtonProps = Exclude<ButtonProps$1, "colorScheme" | "loadingText" | "size"
278
276
  * - `control`: This button is used for ticket controls only.
279
277
  * - `primary`: This is our main button. It's used for the main actions in a view, like a call to action. There should only be a single primary button in each view.
280
278
  * - `secondary`: Used for secondary actions in a view, and when you need to make several actions available at the same time.
281
- * - `tertiary`: Used for non-essential actions, as well as in combination with the primary button.
282
- * - `additional`: Used for additional choices, like a less important tertiary action.
279
+ * - `additional`: Used for additional choices, like a less important secondary action.
283
280
  * - `ghost`: Used inside other interactive elements, like date pickers and input fields.
284
281
  * - `floating`: Used for floating actions, like a menu button in a menu.
285
282
  *
@@ -292,7 +289,7 @@ type ButtonProps = Exclude<ButtonProps$1, "colorScheme" | "loadingText" | "size"
292
289
  * There are also different sizes. You can specify which one you want with the `size` prop. The available sizes are "lg", "md", "sm" and "xs".
293
290
  *
294
291
  * ```tsx
295
- * <Button variant="tertiary" size="sm" onClick={cancelOrder}>
292
+ * <Button variant="secondary" size="sm" onClick={cancelOrder}>
296
293
  * Cancel trip
297
294
  * </Button>
298
295
  * ```
@@ -309,7 +306,7 @@ type ButtonGroupProps = ButtonGroupProps$1;
309
306
  *
310
307
  * ```tsx
311
308
  * <ButtonGroup>
312
- * <Button variant="tertiary">Cancel</Button>
309
+ * <Button variant="secondary">Cancel</Button>
313
310
  * <Button variant="primary">Save</Button>
314
311
  * </ButtonGroup>
315
312
  * ```
@@ -337,7 +334,7 @@ type ButtonGroupProps = ButtonGroupProps$1;
337
334
  declare const ButtonGroup: _chakra_ui_system_dist_system_types.ComponentWithAs<"div", ButtonGroupProps$1>;
338
335
 
339
336
  type IconButtonProps = Omit<IconButtonProps$1, "variant"> & {
340
- variant: "control" | "primary" | "secondary" | "tertiary" | "additional" | "ghost" | "floating";
337
+ variant: "control" | "primary" | "secondary" | "additional" | "ghost" | "floating";
341
338
  };
342
339
  /**
343
340
  * An icon-only button.
@@ -349,8 +346,7 @@ type IconButtonProps = Omit<IconButtonProps$1, "variant"> & {
349
346
  * - `control`: This button is used for ticket controls only.
350
347
  * - `primary`: This is our main button. It's used for the main actions in a view, like a call to action. There should only be a single primary button in each view.
351
348
  * - `secondary`: Used for secondary actions in a view, and when you need to make several actions available at the same time.
352
- * - `tertiary`: Used for non-essential actions, as well as in combination with the primary button.
353
- * - `additional`: Used for additional choices, like a less important tertiary action.
349
+ * - `additional`: Used for additional choices, like a less important secondary action.
354
350
  * - `ghost`: Used inside other interactive elements, like date pickers and input fields.
355
351
  * - `floating`: Used for floating actions, like a menu button in a menu.
356
352
  *
@@ -393,13 +389,7 @@ type CloseButtonProps = Omit<IconButtonProps, "variant" | "aria-label"> & {
393
389
  declare const CloseButton: _chakra_ui_system_dist_system_types.ComponentWithAs<"button", CloseButtonProps>;
394
390
 
395
391
  type FloatingActionButtonProps = BoxProps & {
396
- variant?:
397
- /** @deprecated dark is deprecated please use accent*/
398
- "green"
399
- /** @deprecated dark is deprecated please use accent*/
400
- | "light"
401
- /** @deprecated dark is deprecated please use accent*/
402
- | "dark" | "accent" | "base" | "brand";
392
+ variant?: "accent" | "base" | "brand";
403
393
  placement?: "bottom right" | "bottom left" | "top right" | "top left";
404
394
  icon: React__default.ReactNode;
405
395
  children: React__default.ReactNode;
@@ -412,7 +402,7 @@ type FloatingActionButtonProps = BoxProps & {
412
402
  *
413
403
  * ```tsx
414
404
  * <FloatingActionButton
415
- * variant="green"
405
+ * variant="accent"
416
406
  * icon={<TicketControlFill30Icon />}
417
407
  * placement="bottom right"
418
408
  * />
@@ -459,10 +449,10 @@ declare const Card: _chakra_ui_system_dist_system_types.ComponentWithAs<As, Card
459
449
  /**
460
450
  * A date picker component.
461
451
  *
462
- * There are two versions of this component a simple one, and one with a trigger button for showing the calendar. Use whatever fits your design.
452
+ * There are three different variants `base`, `floating` and `ghost`.
463
453
  *
464
454
  * ```tsx
465
- * <DatePicker label="Dato" variant="simple" />
455
+ * <DatePicker label="Dato" variant="base" />
466
456
  * ```
467
457
  */
468
458
  declare const DatePicker: React__default.ForwardRefExoticComponent<AriaDatePickerProps<DateValue> & Pick<BoxProps, "width" | "minHeight"> & {
@@ -483,10 +473,10 @@ type DateRangePickerProps = AriaDateRangePickerProps<DateValue> & Pick<BoxProps,
483
473
  /**
484
474
  * A date range picker component.
485
475
  *
486
- * There are two versions of this component a simple one, and one with a trigger button for showing the calendar. Use whatever fits your design.
476
+ * There are three variants to choose from`base`, `floating` and `ghost`.
487
477
  *
488
478
  * ```tsx
489
- * <DateRangePicker startLabel="From" startName="from" endLabel="To" endName="to" variant="simple" />
479
+ * <DateRangePicker startLabel="From" startName="from" endLabel="To" endName="to" variant="base" />
490
480
  * ```
491
481
  */
492
482
  declare function DateRangePicker({ variant, minHeight, startName, endName, withPortal, ...props }: DateRangePickerProps): React__default.JSX.Element;
@@ -1424,13 +1414,11 @@ type TravelTagProps = TagProps & BoxProps & {
1424
1414
  declare const TravelTag: _chakra_ui_system_dist_system_types.ComponentWithAs<As, TravelTagProps>;
1425
1415
 
1426
1416
  type LinkProps = Omit<LinkProps$1, "variant"> & {
1427
- variant?: "primary" | "secondary"
1428
- /** @deprecated Use `secondary` instead */
1429
- | "tertiary";
1417
+ variant?: "primary" | "secondary";
1430
1418
  };
1431
1419
  /** Link to different sites or parts of site
1432
1420
  *
1433
- * You can specify the `variant` prop to get different link designs. `tertiary` should only be used on dark backgrounds.
1421
+ * You can specify the `variant` prop to get different link designs.
1434
1422
  */
1435
1423
  declare const TextLink: _chakra_ui_system_dist_system_types.ComponentWithAs<"a", LinkProps>;
1436
1424
 
@@ -1895,15 +1883,7 @@ type StepperStepProps = {
1895
1883
  declare const StepperStep: ({ children, stepNumber }: StepperStepProps) => React__default.JSX.Element;
1896
1884
 
1897
1885
  type TabsProps = Exclude<TabsProps$1, "colorScheme" | "variant" | "orientation" | "size"> & {
1898
- colorScheme:
1899
- /** @deprecated dark is deprecated please use accent*/
1900
- "dark"
1901
- /** @deprecated light is deprecated please use default*/
1902
- | "light"
1903
- /** @deprecated green is deprecated please use accent*/
1904
- | "green"
1905
- /** @deprecated grey is deprecated please use default*/
1906
- | "grey" | "base" | "accent";
1886
+ colorScheme: "base" | "accent";
1907
1887
  /** Defaults to `md` */
1908
1888
  size?: "sm" | "md" | "lg" | "xl";
1909
1889
  /** Defaults to `round` */
@@ -2341,20 +2321,6 @@ declare const theme: {
2341
2321
  backgroundColor: string;
2342
2322
  };
2343
2323
  };
2344
- tertiary: {
2345
- _hover: {
2346
- backgroundColor: string;
2347
- };
2348
- _active: {
2349
- backgroundColor: string;
2350
- };
2351
- _focus: _chakra_ui_styled_system.SystemStyleObject;
2352
- _focusVisible: _chakra_ui_styled_system.SystemStyleObject;
2353
- "&[data-focus]:not([data-focus-visible])": _chakra_ui_styled_system.SystemStyleObject;
2354
- backgroundColor: string;
2355
- color: string;
2356
- fontWeight: string;
2357
- };
2358
2324
  additional: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
2359
2325
  _hover: {
2360
2326
  boxShadow: string;
@@ -2405,7 +2371,7 @@ declare const theme: {
2405
2371
  } | undefined;
2406
2372
  defaultProps?: {
2407
2373
  size?: "sm" | "md" | "lg" | "xs" | undefined;
2408
- variant?: "control" | "primary" | "secondary" | "tertiary" | "additional" | "ghost" | "floating" | undefined;
2374
+ variant?: "control" | "primary" | "secondary" | "additional" | "ghost" | "floating" | undefined;
2409
2375
  colorScheme?: string | undefined;
2410
2376
  } | undefined;
2411
2377
  };
@@ -2908,21 +2874,10 @@ declare const theme: {
2908
2874
  paddingY: number;
2909
2875
  alignItems: string;
2910
2876
  _hover: {
2911
- boxShadow: string;
2912
2877
  zIndex: number;
2913
2878
  };
2914
- _focusWithin: {
2915
- boxShadow: string;
2916
- };
2917
- _invalid: {
2918
- boxShadow: string;
2919
- };
2920
2879
  _disabled: {
2921
2880
  pointerEvents: string;
2922
- boxShadow: string;
2923
- _focus: {
2924
- boxShadow: string;
2925
- };
2926
2881
  };
2927
2882
  };
2928
2883
  inputLabel: {
@@ -2966,7 +2921,7 @@ declare const theme: {
2966
2921
  arrow: {
2967
2922
  [x: string]: string;
2968
2923
  };
2969
- calendar: {
2924
+ calendarPopover: {
2970
2925
  backgroundColor: string;
2971
2926
  color: string;
2972
2927
  boxShadow: string;
@@ -3028,11 +2983,29 @@ declare const theme: {
3028
2983
  }) | undefined;
3029
2984
  sizes?: {
3030
2985
  [key: string]: _chakra_ui_styled_system.PartsStyleInterpolation<{
3031
- keys: ("dateCell" | "weekdays" | "weekend" | "calendar" | "calendarTriggerButton" | "dateTimeSegment" | "inputLabel" | "wrapper" | "arrow")[];
2986
+ keys: ("dateCell" | "weekdays" | "weekend" | "calendar" | "calendarTriggerButton" | "dateTimeSegment" | "inputLabel" | "wrapper" | "calendarPopover" | "arrow")[];
3032
2987
  }>;
3033
2988
  } | undefined;
3034
2989
  variants?: {
3035
2990
  base: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
2991
+ wrapper: {
2992
+ boxShadow: string;
2993
+ _hover: {
2994
+ boxShadow: string;
2995
+ };
2996
+ _focusWithin: {
2997
+ boxShadow: string;
2998
+ };
2999
+ _invalid: {
3000
+ boxShadow: string;
3001
+ };
3002
+ _disabled: {
3003
+ boxShadow: string;
3004
+ _focus: {
3005
+ boxShadow: string;
3006
+ };
3007
+ };
3008
+ };
3036
3009
  calendar: {
3037
3010
  backgroundColor: string;
3038
3011
  color: string;
@@ -3049,6 +3022,24 @@ declare const theme: {
3049
3022
  };
3050
3023
  };
3051
3024
  floating: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
3025
+ wrapper: {
3026
+ boxShadow: string;
3027
+ _hover: {
3028
+ boxShadow: string;
3029
+ };
3030
+ _focusWithin: {
3031
+ boxShadow: string;
3032
+ };
3033
+ _invalid: {
3034
+ boxShadow: string;
3035
+ };
3036
+ _disabled: {
3037
+ boxShadow: string;
3038
+ _focus: {
3039
+ boxShadow: string;
3040
+ };
3041
+ };
3042
+ };
3052
3043
  calendar: {
3053
3044
  backgroundColor: string;
3054
3045
  color: string;
@@ -3062,6 +3053,24 @@ declare const theme: {
3062
3053
  };
3063
3054
  };
3064
3055
  ghost: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
3056
+ wrapper: {
3057
+ boxShadow: string;
3058
+ _hover: {
3059
+ boxShadow: string;
3060
+ };
3061
+ _focusWithin: {
3062
+ boxShadow: string;
3063
+ };
3064
+ _invalid: {
3065
+ boxShadow: string;
3066
+ };
3067
+ _disabled: {
3068
+ boxShadow: string;
3069
+ _focus: {
3070
+ boxShadow: string;
3071
+ };
3072
+ };
3073
+ };
3065
3074
  calendar: {
3066
3075
  backgroundColor: string;
3067
3076
  color: string;
@@ -3084,7 +3093,7 @@ declare const theme: {
3084
3093
  variant?: "base" | "ghost" | "floating" | undefined;
3085
3094
  colorScheme?: string | undefined;
3086
3095
  } | undefined;
3087
- parts: ("dateCell" | "weekdays" | "weekend" | "calendar" | "calendarTriggerButton" | "dateTimeSegment" | "inputLabel" | "wrapper" | "arrow")[];
3096
+ parts: ("dateCell" | "weekdays" | "weekend" | "calendar" | "calendarTriggerButton" | "dateTimeSegment" | "inputLabel" | "wrapper" | "calendarPopover" | "arrow")[];
3088
3097
  };
3089
3098
  Divider: {
3090
3099
  baseStyle?: ((props: _chakra_ui_styled_system.StyleFunctionProps) => {
@@ -3123,6 +3132,7 @@ declare const theme: {
3123
3132
  overlay: {
3124
3133
  backgroundColor: string;
3125
3134
  zIndex: string;
3135
+ color: string;
3126
3136
  };
3127
3137
  dialogContainer: {
3128
3138
  display: string;
@@ -3132,7 +3142,7 @@ declare const theme: {
3132
3142
  overflow: string;
3133
3143
  };
3134
3144
  dialog: {
3135
- background: string;
3145
+ backgroundColor: string;
3136
3146
  color: string;
3137
3147
  zIndex: string;
3138
3148
  maxHeight: string | undefined;
@@ -3435,7 +3445,7 @@ declare const theme: {
3435
3445
  } | undefined;
3436
3446
  defaultProps?: {
3437
3447
  size?: string | number | undefined;
3438
- variant?: "base" | "green" | "light" | "dark" | "accent" | "brand" | undefined;
3448
+ variant?: "base" | "green" | "light" | "accent" | "brand" | "dark" | undefined;
3439
3449
  colorScheme?: string | undefined;
3440
3450
  } | undefined;
3441
3451
  parts: ("text" | "container" | "icon")[];
@@ -3962,26 +3972,10 @@ declare const theme: {
3962
3972
  "&[data-focus]:not([data-focus-visible])": _chakra_ui_styled_system.SystemStyleObject;
3963
3973
  color: string;
3964
3974
  };
3965
- tertiary: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
3966
- _hover: {
3967
- color: string;
3968
- backgroundColor: string;
3969
- boxShadow: string;
3970
- };
3971
- _active: {
3972
- color: string;
3973
- backgroundColor: string;
3974
- boxShadow: string;
3975
- };
3976
- _focus: _chakra_ui_styled_system.SystemStyleObject;
3977
- _focusVisible: _chakra_ui_styled_system.SystemStyleObject;
3978
- "&[data-focus]:not([data-focus-visible])": _chakra_ui_styled_system.SystemStyleObject;
3979
- color: string;
3980
- };
3981
3975
  } | undefined;
3982
3976
  defaultProps?: {
3983
3977
  size?: string | number | undefined;
3984
- variant?: "primary" | "secondary" | "tertiary" | undefined;
3978
+ variant?: "primary" | "secondary" | undefined;
3985
3979
  colorScheme?: string | undefined;
3986
3980
  } | undefined;
3987
3981
  };
@@ -4239,7 +4233,7 @@ declare const theme: {
4239
4233
  parts: ("body" | "dialog" | "footer" | "header" | "overlay" | "closeButton" | "dialogContainer")[];
4240
4234
  };
4241
4235
  Popover: {
4242
- baseStyle?: {
4236
+ baseStyle?: ((props: _chakra_ui_styled_system.StyleFunctionProps) => {
4243
4237
  popper: {
4244
4238
  zIndex: string;
4245
4239
  };
@@ -4265,15 +4259,23 @@ declare const theme: {
4265
4259
  clipPath: string;
4266
4260
  };
4267
4261
  closeButton: {
4268
- position: string;
4262
+ _active: {
4263
+ backgroundColor: string;
4264
+ };
4269
4265
  borderRadius: string;
4270
4266
  top: number;
4271
4267
  insetEnd: number;
4272
4268
  width: number;
4273
4269
  height: number;
4274
4270
  padding: number;
4271
+ _focus: _chakra_ui_styled_system.SystemStyleObject;
4272
+ _focusVisible: _chakra_ui_styled_system.SystemStyleObject;
4273
+ "&[data-focus]:not([data-focus-visible])": _chakra_ui_styled_system.SystemStyleObject;
4274
+ position: string;
4275
+ color: string;
4276
+ hover: string;
4275
4277
  };
4276
- } | undefined;
4278
+ }) | undefined;
4277
4279
  sizes?: {
4278
4280
  sm: {
4279
4281
  content: {