@kvdbil/components 14.2.6 → 14.2.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvdbil/components",
3
- "version": "14.2.6",
3
+ "version": "14.2.8",
4
4
  "sideEffects": false,
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -24,7 +24,8 @@
24
24
  "lint": "eslint --fix --ext .js,.jsx,.ts,.tsx,.mdx src",
25
25
  "analyze": "rollup -c rollup.config.analyze.js",
26
26
  "create-declaration": "yarn tsc --p tsconfig.production.json --emitDeclarationOnly --noEmit false --declaration true --declarationDir dist/types",
27
- "prepare": "husky install"
27
+ "prepare": "husky install",
28
+ "validate-code": "yarn type-check && yarn lint && yarn test && echo '✅ Code is valid!'"
28
29
  },
29
30
  "peerDependencies": {
30
31
  "react": ">= 17.0.0",
@@ -108,7 +109,6 @@
108
109
  "jest-environment-jsdom": "^28.0.0",
109
110
  "jest-styled-components": "^7.0.3",
110
111
  "jest-watch-typeahead": "^0.6.1",
111
- "node-sass": "^8.0.0",
112
112
  "prettier": "^1.16.4",
113
113
  "react": "^17.0.2",
114
114
  "react-collapse": "^5.0.1",
@@ -1,4 +1,4 @@
1
- declare type Variants = Record<string, string | Record<string, string>>;
1
+ type Variants = Record<string, string | Record<string, string>>;
2
2
  interface ColorCardProps {
3
3
  colorName: string;
4
4
  variants: Variants;
package/types/Types.d.ts CHANGED
@@ -1,23 +1,23 @@
1
1
  import { SCREEN_SIZE } from './shared/media-queries';
2
- export declare type Color = 'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'error' | 'warning' | 'neutral';
3
- export declare type ColorShade = "main" | "darker" | "dark" | "light" | "lighter" | "lighter2";
4
- export declare type TextColor = 'dark' | 'light' | 'disabled';
5
- export declare type ColorWithNone = 'none' | Color;
6
- export declare type Variant = 'solid' | 'outline' | 'flat';
7
- export declare type Size = 'small' | 'smaller' | 'regular' | 'large';
8
- export declare type CheckboxSize = 'regular' | 'large';
9
- export declare type RadioButtonSize = 'regular' | 'large';
10
- export declare type Speed = 'slow' | 'default' | 'fast';
11
- export declare type Locale = 'en' | 'sv';
12
- export declare type Notification = 'info' | 'error' | 'success' | 'text';
13
- export declare type VerticalPosition = 'top' | 'bottom';
14
- export declare type HorizontalPosition = 'left' | 'right' | 'center';
15
- export declare type StampType = 'ecofriendly' | 'releasing' | 'carguide' | 'certified' | 'export';
16
- export declare type Origin = {
2
+ export type Color = 'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'error' | 'warning' | 'neutral';
3
+ export type ColorShade = "main" | "darker" | "dark" | "light" | "lighter" | "lighter2";
4
+ export type TextColor = 'dark' | 'light' | 'disabled';
5
+ export type ColorWithNone = 'none' | Color;
6
+ export type Variant = 'solid' | 'outline' | 'flat';
7
+ export type Size = 'small' | 'smaller' | 'regular' | 'large';
8
+ export type CheckboxSize = 'regular' | 'large';
9
+ export type RadioButtonSize = 'regular' | 'large';
10
+ export type Speed = 'slow' | 'default' | 'fast';
11
+ export type Locale = 'en' | 'sv';
12
+ export type Notification = 'info' | 'error' | 'success' | 'text';
13
+ export type VerticalPosition = 'top' | 'bottom';
14
+ export type HorizontalPosition = 'left' | 'right' | 'center';
15
+ export type StampType = 'ecofriendly' | 'releasing' | 'carguide' | 'certified' | 'export';
16
+ export type Origin = {
17
17
  vertical: VerticalPosition;
18
18
  horizontal: HorizontalPosition;
19
19
  };
20
- export declare type MqSizes = SCREEN_SIZE;
20
+ export type MqSizes = SCREEN_SIZE;
21
21
  /**
22
22
  * Used to prefix all keys in a type with a `$` sign. Props prefixed with `$` are called transient props.
23
23
  * Used for styled-components to prevent passing props to root element.
@@ -30,6 +30,6 @@ export declare type MqSizes = SCREEN_SIZE;
30
30
  * $prop: string;
31
31
  * }
32
32
  */
33
- export declare type TransientProps<Type> = {
33
+ export type TransientProps<Type> = {
34
34
  [Prop in keyof Type as `$${string & Prop}`]: Type[Prop];
35
35
  };
@@ -15,6 +15,6 @@ interface Props {
15
15
  minWidth?: string;
16
16
  as?: keyof JSX.IntrinsicElements;
17
17
  }
18
- export declare type ButtonProps = ComponentPropsWithRef<'button'> & Props;
18
+ export type ButtonProps = ComponentPropsWithRef<'button'> & Props;
19
19
  export declare const Button: React.ForwardRefExoticComponent<Pick<ButtonProps, "form" | "slot" | "style" | "title" | "type" | "name" | "key" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "as" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "size" | "minWidth" | "fullWidth" | "sufixIcon" | "prefixIcon" | "isLoading" | "variant" | "colorShade" | "isDisabled"> & React.RefAttributes<HTMLElement>>;
20
20
  export default Button;
@@ -1,6 +1,6 @@
1
1
  import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
  import { CheckboxSize, Color } from '../../Types';
3
- declare type ComponentPropsWithoutSize = Omit<ComponentPropsWithoutRef<'input'>, 'size'>;
3
+ type ComponentPropsWithoutSize = Omit<ComponentPropsWithoutRef<'input'>, 'size'>;
4
4
  export interface CheckBoxProps extends ComponentPropsWithoutSize {
5
5
  name?: string;
6
6
  size?: CheckboxSize;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { ComponentType, MouseEvent, ReactNode } from 'react';
3
3
  import { DefaultTheme } from 'styled-components';
4
4
  import { Color, Size, Variant } from '../../Types';
5
- export declare type ChipColor = Color | 'neutralLight';
5
+ export type ChipColor = Color | 'neutralLight';
6
6
  export interface ChipProps {
7
7
  color?: ChipColor;
8
8
  children: ReactNode;
@@ -10,7 +10,7 @@ import { SCREEN_SIZE } from '../../shared/media-queries';
10
10
  * direction: 'row' | 'column' | 'row-reverse' | 'column-reverse'
11
11
  * direction: { mobileS: 'column', tablet: 'row' }
12
12
  */
13
- declare type CSSPropertyWithResponsive<P extends keyof CSSProperties> = CSSProperties[P] | Partial<Record<Partial<SCREEN_SIZE> | 'initial', CSSProperties[P]>>;
13
+ type CSSPropertyWithResponsive<P extends keyof CSSProperties> = CSSProperties[P] | Partial<Record<Partial<SCREEN_SIZE> | 'initial', CSSProperties[P]>>;
14
14
  export interface FlexProps {
15
15
  direction?: CSSPropertyWithResponsive<'flexDirection'>;
16
16
  justify?: CSSPropertyWithResponsive<'justifyContent'>;
@@ -22,6 +22,6 @@ export interface FlexProps {
22
22
  grow?: CSSPropertyWithResponsive<'flexGrow'>;
23
23
  shrink?: CSSPropertyWithResponsive<'flexShrink'>;
24
24
  }
25
- export declare type Props = FlexProps & HTMLAttributes<HTMLDivElement>;
25
+ export type Props = FlexProps & HTMLAttributes<HTMLDivElement>;
26
26
  declare const Flex: ({ direction, justify, align, gap, rowGap, wrap, basis, grow, shrink, ...props }: Props) => JSX.Element;
27
27
  export default Flex;
@@ -1,17 +1,17 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { CSSProperties } from 'styled-components';
3
- declare type Justify = Exclude<CSSProperties['justifyContent'], number>;
4
- declare type Align = Exclude<CSSProperties['alignItems'], number>;
5
- declare type Direction = CSSProperties['flexDirection'];
6
- declare type DarkOrLight = 'dark' | 'light';
3
+ type Justify = Exclude<CSSProperties['justifyContent'], number>;
4
+ type Align = Exclude<CSSProperties['alignItems'], number>;
5
+ type Direction = CSSProperties['flexDirection'];
6
+ type DarkOrLight = 'dark' | 'light';
7
7
  export declare const colorAnimation: import("styled-components").Keyframes;
8
- declare type ObjectPositionX = number | 'center' | 'left' | 'right';
9
- declare type ObjectPositionY = number | 'center' | 'top' | 'bottom';
10
- declare type DynamicGutter = {
8
+ type ObjectPositionX = number | 'center' | 'left' | 'right';
9
+ type ObjectPositionY = number | 'center' | 'top' | 'bottom';
10
+ type DynamicGutter = {
11
11
  tabletVw: number;
12
12
  laptopVw: number;
13
13
  };
14
- declare type YouTubeVideoProps = {
14
+ type YouTubeVideoProps = {
15
15
  autoplay: 0 | 1;
16
16
  controls: 0 | 1;
17
17
  disablekb: 0 | 1;
@@ -21,12 +21,12 @@ declare type YouTubeVideoProps = {
21
21
  start: number;
22
22
  showInfo: 0 | 1;
23
23
  };
24
- declare type ImageProps = {
24
+ type ImageProps = {
25
25
  src: string;
26
26
  x?: ObjectPositionX;
27
27
  y?: ObjectPositionY;
28
28
  };
29
- declare type VideoProps = {
29
+ type VideoProps = {
30
30
  src: string;
31
31
  ytConfig?: Partial<YouTubeVideoProps>;
32
32
  };
@@ -1,4 +1,4 @@
1
- declare type IconModule = [string, CallableFunction];
1
+ type IconModule = [string, CallableFunction];
2
2
  export interface IconsProps {
3
3
  background: string;
4
4
  color: string;
@@ -26,6 +26,6 @@ declare const fontSizes: {
26
26
  fontFamily: "'Open Sans', sans-serif";
27
27
  };
28
28
  };
29
- declare type Level = keyof typeof fontSizes;
29
+ type Level = keyof typeof fontSizes;
30
30
  export declare const MenuItem: ({ preamble, title, level, component: Component, children, ...props }: MenuItemProps) => JSX.Element;
31
31
  export default MenuItem;
@@ -1,6 +1,6 @@
1
1
  import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
- declare type MessageType = 'text' | 'info' | 'success' | 'warning' | 'error';
3
- export declare type Props = {
2
+ type MessageType = 'text' | 'info' | 'success' | 'warning' | 'error';
3
+ export type Props = {
4
4
  children: ReactNode;
5
5
  type: MessageType;
6
6
  withIcon?: boolean;
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { CSSTransitionProps } from 'react-transition-group/CSSTransition';
3
- export declare type DIRECTION = 'left' | 'right';
4
- declare type TransitionProps = Partial<Pick<CSSTransitionProps, 'timeout' | 'classNames' | 'addEndListener' | 'appear' | 'mountOnEnter'>>;
3
+ export type DIRECTION = 'left' | 'right';
4
+ type TransitionProps = Partial<Pick<CSSTransitionProps, 'timeout' | 'classNames' | 'addEndListener' | 'appear' | 'mountOnEnter'>>;
5
5
  export interface OffCanvasProps {
6
6
  animationName?: string;
7
7
  animationDuration?: number;
@@ -5,7 +5,7 @@ export interface DropdownIndicatorProps extends SelectDropdownIndicatorProps {
5
5
  isFocused: boolean;
6
6
  isDisabled: boolean;
7
7
  }
8
- declare type OptionType = {
8
+ type OptionType = {
9
9
  label: string | ReactNode;
10
10
  value: string;
11
11
  };
@@ -1,6 +1,6 @@
1
1
  import { ComponentPropsWithoutRef, ReactElement } from 'react';
2
2
  import { ColorWithNone, Notification, Origin } from '../../Types';
3
- export declare type SnackbarProps = {
3
+ export type SnackbarProps = {
4
4
  message: string;
5
5
  color?: ColorWithNone;
6
6
  type?: Notification;
@@ -1,5 +1,5 @@
1
1
  import { Props as FlexProps } from '../Flex';
2
- export declare type StackProps = Omit<FlexProps, 'gap'> & {
2
+ export type StackProps = Omit<FlexProps, 'gap'> & {
3
3
  spacing?: FlexProps['gap'];
4
4
  };
5
5
  declare const Stack: ({ ...props }: StackProps) => JSX.Element;
@@ -1,4 +1,4 @@
1
- declare type Column = string;
1
+ type Column = string;
2
2
  export interface TableProps {
3
3
  columns?: Column[];
4
4
  data?: Record<Column, string>[];
@@ -4,7 +4,7 @@ import { ReactElement } from 'react';
4
4
  import { TabProps } from './Tab';
5
5
  import { CSSProperties } from 'styled-components';
6
6
  import theme from '../../theme';
7
- declare type TabElement = ReactElement<TabProps>;
7
+ type TabElement = ReactElement<TabProps>;
8
8
  export interface TabsProps {
9
9
  activeColor?: Color;
10
10
  justify?: CSSProperties['justifyContent'];
@@ -6,7 +6,7 @@ export interface TimeSlotProps {
6
6
  isDisabled?: boolean;
7
7
  isSelected?: boolean;
8
8
  }
9
- declare type Times = Date | Date[];
9
+ type Times = Date | Date[];
10
10
  export interface TimePickerProps {
11
11
  timeSlots: TimeSlotProps[];
12
12
  selectedTimes?: Times;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Color } from '../../Types';
3
- declare type LeftOrRight = 'LEFT' | 'RIGHT';
3
+ type LeftOrRight = 'LEFT' | 'RIGHT';
4
4
  export interface ToggleProps {
5
5
  color: Color;
6
6
  active?: LeftOrRight;
@@ -1,2 +1,2 @@
1
1
  export declare const generateNameHash: (prefix: string) => string;
2
- export declare const fadedColor: (hex: string, alpha?: number | undefined) => string;
2
+ export declare const fadedColor: (hex: string, alpha?: number) => string;
@@ -13,7 +13,7 @@ declare const mqNumberSizes: Record<SCREEN_SIZE, number>;
13
13
  declare const mqSizesOrder: {
14
14
  [key: string]: number;
15
15
  };
16
- export declare type SCREEN_SIZE = keyof typeof mqSizes;
16
+ export type SCREEN_SIZE = keyof typeof mqSizes;
17
17
  declare const mediaQueries: {
18
18
  mobileS: (limit: string) => string;
19
19
  mobileM: (limit: string) => string;
@@ -24,5 +24,5 @@ declare const mediaQueries: {
24
24
  desktop: (limit: string) => string;
25
25
  desktopL: (limit: string) => string;
26
26
  };
27
- declare const mq: (from: SCREEN_SIZE | null, to?: keyof MqSizes | undefined) => string;
27
+ declare const mq: (from: SCREEN_SIZE | null, to?: SCREEN_SIZE) => string;
28
28
  export { mq, mqSizes, mqNumberSizes, mqSizesOrder, mediaQueries };
package/types/theme.d.ts CHANGED
@@ -118,5 +118,5 @@ export interface Theme {
118
118
  };
119
119
  }
120
120
  declare const theme: Theme;
121
- export declare type TypographyEntryType = keyof typeof theme.typography;
121
+ export type TypographyEntryType = keyof typeof theme.typography;
122
122
  export default theme;