@redsift/design-system 7.1.0 → 7.1.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/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { PressEvent } from '@react-types/shared';
3
3
  import * as styled_components from 'styled-components';
4
4
 
5
5
  /** Component Type. */
6
- declare type Comp<P, T = HTMLElement> = {
6
+ type Comp<P, T = HTMLElement> = {
7
7
  (props: P & {
8
8
  ref?: Ref<T>;
9
9
  }): ReactElement | null;
@@ -20,9 +20,9 @@ declare type Comp<P, T = HTMLElement> = {
20
20
  * JS falsy values.
21
21
  * (excluding `NaN` as it can't be distinguished from `number`)
22
22
  */
23
- declare type Falsy = false | undefined | null | 0 | '';
23
+ type Falsy = false | undefined | null | 0 | '';
24
24
  /** Get types of the values of a record. */
25
- declare type ValueOf<T extends Record<any, any>> = T[keyof T];
25
+ type ValueOf<T extends Record<any, any>> = T[keyof T];
26
26
  /**
27
27
  * Color palette.
28
28
  */
@@ -35,7 +35,7 @@ declare const ColorPalette: {
35
35
  readonly question: "question";
36
36
  readonly 'no-data': "no-data";
37
37
  };
38
- declare type ColorPalette = ValueOf<typeof ColorPalette>;
38
+ type ColorPalette = ValueOf<typeof ColorPalette>;
39
39
  declare const ProductColorPalette: {
40
40
  readonly website: "website";
41
41
  readonly ondmarc: "ondmarc";
@@ -44,7 +44,7 @@ declare const ProductColorPalette: {
44
44
  readonly hardenize: "hardenize";
45
45
  readonly tools: "tools";
46
46
  };
47
- declare type ProductColorPalette = ValueOf<typeof ProductColorPalette>;
47
+ type ProductColorPalette = ValueOf<typeof ProductColorPalette>;
48
48
 
49
49
  /**
50
50
  * Do not edit directly
@@ -274,11 +274,11 @@ declare const IconButtonVariant: {
274
274
  readonly secondary: "secondary";
275
275
  readonly unstyled: "unstyled";
276
276
  };
277
- declare type IconButtonVariant = ValueOf<typeof IconButtonVariant>;
277
+ type IconButtonVariant = ValueOf<typeof IconButtonVariant>;
278
278
  /**
279
279
  * Component color.
280
280
  */
281
- declare type IconButtonColor = typeof ColorPalette.default | typeof ColorPalette.error | ProductColorPalette;
281
+ type IconButtonColor = typeof ColorPalette.default | typeof ColorPalette.error | ProductColorPalette;
282
282
  /**
283
283
  * Component props.
284
284
  */
@@ -301,7 +301,7 @@ interface IconButtonProps extends ComponentProps<'button'> {
301
301
  /** Button variant. */
302
302
  variant?: IconButtonVariant;
303
303
  }
304
- declare type StyledIconButtonProps = Omit<IconButtonProps, 'isActive' | 'isDisabled' | 'variant' | 'color' | 'icon'> & {
304
+ type StyledIconButtonProps = Omit<IconButtonProps, 'isActive' | 'isDisabled' | 'variant' | 'color' | 'icon'> & {
305
305
  $color: IconButtonProps['color'];
306
306
  $isActive: IconButtonProps['isActive'];
307
307
  $isDisabled: IconButtonProps['isDisabled'];
@@ -333,7 +333,7 @@ interface AppBarProps extends Omit<ComponentProps<'header'>, 'title'> {
333
333
  /** Title of the page */
334
334
  title?: string | ReactElement;
335
335
  }
336
- declare type StyledAppBarProps = AppBarProps & {
336
+ type StyledAppBarProps = AppBarProps & {
337
337
  $isLoaded: boolean;
338
338
  $isSidePanelCollapsed: boolean;
339
339
  };
@@ -346,7 +346,7 @@ declare const AppBar: Comp<AppBarProps, HTMLHeadingElement>;
346
346
  /**
347
347
  * Context props.
348
348
  */
349
- declare type AppContainerState = {
349
+ type AppContainerState = {
350
350
  /** Collapses the side panel. */
351
351
  collapseSidePanel(): void;
352
352
  /** Expandes the side panel. */
@@ -371,7 +371,7 @@ interface AppContainerProps extends ComponentProps<'div'> {
371
371
  /** Product theme to apply to everything within. This overrides the CSS variables automatically. */
372
372
  productTheme?: ProductColorPalette;
373
373
  }
374
- declare type StyledAppContainerProps = Omit<AppContainerProps, 'productTheme'> & {
374
+ type StyledAppContainerProps = Omit<AppContainerProps, 'productTheme'> & {
375
375
  $productTheme?: string;
376
376
  };
377
377
 
@@ -389,7 +389,7 @@ interface AppContentProps extends ComponentProps<'main'> {
389
389
  /** Product theme to apply to everything within. This overrides the CSS variables automatically. */
390
390
  productTheme?: ProductColorPalette;
391
391
  }
392
- declare type StyledAppContentProps = Omit<AppContentProps, 'productTheme'> & {
392
+ type StyledAppContentProps = Omit<AppContentProps, 'productTheme'> & {
393
393
  $isLoaded: boolean;
394
394
  $isSidePanelCollapsed: boolean;
395
395
  $productTheme?: string;
@@ -411,7 +411,7 @@ interface AppSidePanelProps extends ComponentProps<'div'> {
411
411
  /** Place to display the logo app. */
412
412
  logo?: ReactElement | ComponentProps<'img'>;
413
413
  }
414
- declare type StyledAppSidePanelProps = Omit<AppSidePanelProps, 'isCollapsed'> & {
414
+ type StyledAppSidePanelProps = Omit<AppSidePanelProps, 'isCollapsed'> & {
415
415
  $isCollapsed: boolean;
416
416
  };
417
417
 
@@ -429,7 +429,7 @@ declare const IconSize: {
429
429
  readonly medium: "medium";
430
430
  readonly large: "large";
431
431
  };
432
- declare type IconSize = ValueOf<typeof IconSize>;
432
+ type IconSize = ValueOf<typeof IconSize>;
433
433
  /**
434
434
  * Component props.
435
435
  */
@@ -454,7 +454,7 @@ interface IconProps extends ComponentProps<'i'> {
454
454
  /** Additional properties to forward to the SVG tag. */
455
455
  svgProps?: ComponentProps<'svg'>;
456
456
  }
457
- declare type StyledIconProps = Omit<IconProps, 'color' | 'size' | 'icon' | 'svgProps'> & {
457
+ type StyledIconProps = Omit<IconProps, 'color' | 'size' | 'icon' | 'svgProps'> & {
458
458
  $color: IconProps['color'];
459
459
  $size: IconProps['size'];
460
460
  };
@@ -467,13 +467,13 @@ declare const Icon: Comp<IconProps, HTMLSpanElement>;
467
467
  /**
468
468
  * Context props.
469
469
  */
470
- declare type SideNavigationMenuContextProps = {
470
+ type SideNavigationMenuContextProps = {
471
471
  menuItems: Set<HTMLAnchorElement | HTMLButtonElement>;
472
472
  };
473
473
  /**
474
474
  * Reducer props.
475
475
  */
476
- declare type SideNavigationMenuReducerState = {
476
+ type SideNavigationMenuReducerState = {
477
477
  isExpanded: boolean;
478
478
  currentIndex: number;
479
479
  previousIndex: number;
@@ -483,7 +483,7 @@ declare enum SideNavigationMenuReducerActionType {
483
483
  Collapse = "collapse",
484
484
  Move = "move"
485
485
  }
486
- declare type SideNavigationMenuReducerAction = {
486
+ type SideNavigationMenuReducerAction = {
487
487
  type: SideNavigationMenuReducerActionType;
488
488
  index?: number;
489
489
  };
@@ -519,7 +519,7 @@ interface SideNavigationMenuProps extends ComponentProps<'div'> {
519
519
  /** Whether the component should hide icons or not. */
520
520
  withoutIcons?: boolean;
521
521
  }
522
- declare type StyledSideNavigationMenuProps = Omit<SideNavigationMenuProps, 'isDisabled' | 'isExpanded' | 'withoutIcons'> & {
522
+ type StyledSideNavigationMenuProps = Omit<SideNavigationMenuProps, 'isDisabled' | 'isExpanded' | 'withoutIcons'> & {
523
523
  $isDisabled: SideNavigationMenuProps['isDisabled'];
524
524
  $isExpanded: SideNavigationMenuProps['isExpanded'];
525
525
  $withoutIcons: SideNavigationMenuProps['withoutIcons'];
@@ -537,7 +537,7 @@ declare const BadgeVariant: {
537
537
  readonly dot: "dot";
538
538
  readonly standard: "standard";
539
539
  };
540
- declare type BadgeVariant = ValueOf<typeof BadgeVariant>;
540
+ type BadgeVariant = ValueOf<typeof BadgeVariant>;
541
541
  /**
542
542
  * Component props.
543
543
  */
@@ -551,7 +551,7 @@ interface BadgeProps extends ComponentProps<'div'> {
551
551
  /** Badge variant. */
552
552
  variant?: BadgeVariant;
553
553
  }
554
- declare type StyledBadgeProps = Omit<BadgeProps, 'color' | 'variant' | 'isReversed' | 'autoBreak'> & {
554
+ type StyledBadgeProps = Omit<BadgeProps, 'color' | 'variant' | 'isReversed' | 'autoBreak'> & {
555
555
  $autoBreak: BadgeProps['autoBreak'];
556
556
  $color: BadgeProps['color'];
557
557
  $isReversed: BadgeProps['isReversed'];
@@ -595,7 +595,7 @@ interface SideNavigationMenuItemProps extends ComponentProps<'a'> {
595
595
  /** Whether the component should hide icons or not. */
596
596
  withoutIcons?: boolean;
597
597
  }
598
- declare type StyledSideNavigationMenuItemProps = Omit<SideNavigationMenuItemProps, 'isCurrent' | 'isDisabled' | 'isSecondLevel' | 'withoutIcons'> & {
598
+ type StyledSideNavigationMenuItemProps = Omit<SideNavigationMenuItemProps, 'isCurrent' | 'isDisabled' | 'isSecondLevel' | 'withoutIcons'> & {
599
599
  $isCurrent: SideNavigationMenuItemProps['isCurrent'];
600
600
  $isDisabled: SideNavigationMenuItemProps['isDisabled'];
601
601
  $isSecondLevel: SideNavigationMenuItemProps['isSecondLevel'];
@@ -610,7 +610,7 @@ declare const SideNavigationMenuItem: Comp<SideNavigationMenuItemProps, HTMLAnch
610
610
  /**
611
611
  * Context props.
612
612
  */
613
- declare type SideNavigationMenuBarContextProps = {
613
+ type SideNavigationMenuBarContextProps = {
614
614
  menuItems: Set<HTMLAnchorElement | HTMLButtonElement>;
615
615
  };
616
616
  /**
@@ -626,7 +626,7 @@ interface SideNavigationMenuBarProps extends ComponentProps<'nav'> {
626
626
  /** Whether the component should hide icons or not. */
627
627
  withoutIcons?: boolean;
628
628
  }
629
- declare type StyledSideNavigationMenuBarProps = Omit<SideNavigationMenuBarProps, 'isDisabled' | 'withoutIcons'> & {
629
+ type StyledSideNavigationMenuBarProps = Omit<SideNavigationMenuBarProps, 'isDisabled' | 'withoutIcons'> & {
630
630
  $isDisabled: SideNavigationMenuBarProps['isDisabled'];
631
631
  $marginTop?: number;
632
632
  $withoutIcons: SideNavigationMenuBarProps['withoutIcons'];
@@ -641,7 +641,7 @@ interface Menu extends Omit<SideNavigationMenuProps, 'children'> {
641
641
  title: string;
642
642
  children: MenuItem[];
643
643
  }
644
- declare type MenuBarItems = (Menu | MenuItem)[];
644
+ type MenuBarItems = (Menu | MenuItem)[];
645
645
 
646
646
  /**
647
647
  * The SideNavigationMenuBar component.
@@ -667,7 +667,7 @@ interface BreadcrumbItemProps extends ComponentProps<'a'> {
667
667
  /** Whether the component is disabled or not. */
668
668
  isDisabled?: boolean;
669
669
  }
670
- declare type StyledBreadcrumbItemProps = Omit<BreadcrumbItemProps, 'isDisabled' | 'isCurrent'> & {
670
+ type StyledBreadcrumbItemProps = Omit<BreadcrumbItemProps, 'isDisabled' | 'isCurrent'> & {
671
671
  $isCurrent: BreadcrumbItemProps['isCurrent'];
672
672
  $isDisabled: BreadcrumbItemProps['isDisabled'];
673
673
  };
@@ -684,7 +684,7 @@ interface BreadcrumbsProps extends ComponentProps<'nav'> {
684
684
  /** Whether the component is disabled or not. */
685
685
  isDisabled?: boolean;
686
686
  }
687
- declare type StyledBreadcrumbsProps = Omit<BreadcrumbsProps, 'isDisabled'> & {
687
+ type StyledBreadcrumbsProps = Omit<BreadcrumbsProps, 'isDisabled'> & {
688
688
  $isDisabled: BreadcrumbsProps['isDisabled'];
689
689
  };
690
690
 
@@ -701,11 +701,11 @@ declare const ButtonVariant: {
701
701
  readonly secondary: "secondary";
702
702
  readonly unstyled: "unstyled";
703
703
  };
704
- declare type ButtonVariant = ValueOf<typeof ButtonVariant>;
704
+ type ButtonVariant = ValueOf<typeof ButtonVariant>;
705
705
  /**
706
706
  * Component color.
707
707
  */
708
- declare type ButtonColor = typeof ColorPalette.default | typeof ColorPalette.error | ProductColorPalette;
708
+ type ButtonColor = typeof ColorPalette.default | typeof ColorPalette.error | ProductColorPalette;
709
709
  /**
710
710
  * Component props.
711
711
  */
@@ -737,7 +737,7 @@ interface ButtonProps extends ComponentProps<'button'> {
737
737
  /** Button variant. */
738
738
  variant?: ButtonVariant;
739
739
  }
740
- declare type StyledButtonProps = Omit<ButtonProps, 'isActive' | 'isDisabled' | 'variant' | 'color' | 'size' | 'fullWidth'> & {
740
+ type StyledButtonProps = Omit<ButtonProps, 'isActive' | 'isDisabled' | 'variant' | 'color' | 'size' | 'fullWidth'> & {
741
741
  $color: ButtonProps['color'];
742
742
  $fullWidth?: ButtonProps['fullWidth'];
743
743
  $isActive: ButtonProps['isActive'];
@@ -774,7 +774,7 @@ interface LinkProps extends ComponentProps<'a'> {
774
774
  /** Whether the component is disabled or not. */
775
775
  isDisabled?: boolean;
776
776
  }
777
- declare type StyledLinkProps = Omit<LinkProps, 'isDisabled'> & {
777
+ type StyledLinkProps = Omit<LinkProps, 'isDisabled'> & {
778
778
  $isDisabled: LinkProps['isDisabled'];
779
779
  };
780
780
 
@@ -800,7 +800,7 @@ declare const Link: Comp<LinkProps, HTMLAnchorElement>;
800
800
  */
801
801
  interface ButtonLinkProps extends Omit<LinkProps, 'color'>, Pick<ButtonProps, 'color' | 'isActive' | 'isDisabled' | 'leftIcon' | 'rightIcon' | 'variant'> {
802
802
  }
803
- declare type StyledButtonLinkProps = Omit<ButtonLinkProps, 'isActive' | 'isDisabled' | 'variant' | 'color' | 'size'> & {
803
+ type StyledButtonLinkProps = Omit<ButtonLinkProps, 'isActive' | 'isDisabled' | 'variant' | 'color' | 'size'> & {
804
804
  $isActive: ButtonLinkProps['isActive'];
805
805
  $isDisabled: ButtonLinkProps['isDisabled'];
806
806
  $variant: ButtonLinkProps['variant'];
@@ -819,7 +819,7 @@ declare const ButtonLink: Comp<ButtonLinkProps, HTMLAnchorElement>;
819
819
  /**
820
820
  * Context props.
821
821
  */
822
- declare type CheckboxGroupState = {
822
+ type CheckboxGroupState = {
823
823
  /** Adds a value to the set of selected values. */
824
824
  addValue(value: string): void;
825
825
  /** Whether the checkbox group is disabled or not. */
@@ -840,7 +840,7 @@ declare const CheckboxGroupOrientation: {
840
840
  readonly horizontal: "horizontal";
841
841
  readonly vertical: "vertical";
842
842
  };
843
- declare type CheckboxGroupOrientation = ValueOf<typeof CheckboxGroupOrientation>;
843
+ type CheckboxGroupOrientation = ValueOf<typeof CheckboxGroupOrientation>;
844
844
  /**
845
845
  * Component props.
846
846
  */
@@ -874,7 +874,7 @@ interface CheckboxGroupProps extends Omit<ComponentProps<'div'>, 'onChange'> {
874
874
  */
875
875
  value?: string[];
876
876
  }
877
- declare type StyledCheckboxGroupProps = Omit<CheckboxGroupProps, 'isDisabled' | 'isInvalid' | 'isReadOnly' | 'orientation' | 'isRequired'> & {
877
+ type StyledCheckboxGroupProps = Omit<CheckboxGroupProps, 'isDisabled' | 'isInvalid' | 'isReadOnly' | 'orientation' | 'isRequired'> & {
878
878
  $isDisabled: CheckboxGroupProps['isDisabled'];
879
879
  $isInvalid: CheckboxGroupProps['isInvalid'];
880
880
  $isReadOnly: CheckboxGroupProps['isReadOnly'];
@@ -932,7 +932,7 @@ interface CheckboxProps extends Omit<ComponentProps<'label'>, 'onChange'> {
932
932
  */
933
933
  value?: HTMLInputElement['value'];
934
934
  }
935
- declare type StyledCheckboxProps = Omit<CheckboxProps, 'color' | 'isDisabled' | 'isInvalid' | 'isSelected' | 'isRequired' | 'size'> & {
935
+ type StyledCheckboxProps = Omit<CheckboxProps, 'color' | 'isDisabled' | 'isInvalid' | 'isSelected' | 'isRequired' | 'size'> & {
936
936
  $isDisabled: CheckboxProps['isDisabled'];
937
937
  $isInvalid: CheckboxProps['isInvalid'];
938
938
  $isFocusVisible: boolean;
@@ -952,7 +952,7 @@ declare const Checkbox: Comp<CheckboxProps, HTMLLabelElement>;
952
952
  */
953
953
  interface LinkButtonProps extends Omit<ButtonProps, 'color' | 'fullWidth' | 'leftIcon' | 'rightIcon' | 'size' | 'variant'> {
954
954
  }
955
- declare type StyledLinkButtonProps = Omit<LinkButtonProps, 'isDisabled'> & {
955
+ type StyledLinkButtonProps = Omit<LinkButtonProps, 'isDisabled'> & {
956
956
  $isDisabled: LinkButtonProps['isDisabled'];
957
957
  };
958
958
 
@@ -983,7 +983,7 @@ declare const ShieldVariant: {
983
983
  readonly question: "question";
984
984
  readonly email: "email";
985
985
  };
986
- declare type ShieldVariant = ValueOf<typeof ShieldVariant>;
986
+ type ShieldVariant = ValueOf<typeof ShieldVariant>;
987
987
  /**
988
988
  * Component props.
989
989
  */
@@ -1001,7 +1001,7 @@ interface ShieldProps extends ComponentProps<'div'> {
1001
1001
  /** Shield variant. */
1002
1002
  variant?: ShieldVariant;
1003
1003
  }
1004
- declare type StyledShieldProps = Omit<ShieldProps, 'color'> & {
1004
+ type StyledShieldProps = Omit<ShieldProps, 'color'> & {
1005
1005
  $color?: ColorPalette | ProductColorPalette | string;
1006
1006
  $isOutlined: ShieldProps['isOutlined'];
1007
1007
  $isReversed: ShieldProps['isReversed'];
package/index.js CHANGED
@@ -288,6 +288,7 @@ function _objectSpread2(target) {
288
288
  return target;
289
289
  }
290
290
  function _defineProperty(obj, key, value) {
291
+ key = _toPropertyKey(key);
291
292
  if (key in obj) {
292
293
  Object.defineProperty(obj, key, {
293
294
  value: value,
@@ -341,6 +342,20 @@ function _objectWithoutProperties(source, excluded) {
341
342
  }
342
343
  return target;
343
344
  }
345
+ function _toPrimitive(input, hint) {
346
+ if (typeof input !== "object" || input === null) return input;
347
+ var prim = input[Symbol.toPrimitive];
348
+ if (prim !== undefined) {
349
+ var res = prim.call(input, hint || "default");
350
+ if (typeof res !== "object") return res;
351
+ throw new TypeError("@@toPrimitive must return a primitive value.");
352
+ }
353
+ return (hint === "string" ? String : Number)(input);
354
+ }
355
+ function _toPropertyKey(arg) {
356
+ var key = _toPrimitive(arg, "string");
357
+ return typeof key === "symbol" ? key : String(key);
358
+ }
344
359
 
345
360
  /**
346
361
  * Component variant.