@kvdbil/components 14.2.5 → 14.2.7
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/cjs/icons/components/ErrorIcon.js +1 -1
- package/esm/icons/components/ErrorIcon.js +1 -1
- package/package.json +3 -3
- package/types/ColorCard.d.ts +1 -1
- package/types/Types.d.ts +17 -17
- package/types/components/Button/index.d.ts +1 -1
- package/types/components/CheckBox/index.d.ts +1 -1
- package/types/components/Chip/index.d.ts +1 -1
- package/types/components/Flex/index.d.ts +2 -2
- package/types/components/Hero/index.d.ts +10 -10
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/MenuItem/index.d.ts +1 -1
- package/types/components/Message/index.d.ts +2 -2
- package/types/components/OffCanvas/index.d.ts +2 -2
- package/types/components/Select/index.d.ts +1 -1
- package/types/components/Snackbar/index.d.ts +1 -1
- package/types/components/Stack/index.d.ts +1 -1
- package/types/components/Table/index.d.ts +1 -1
- package/types/components/Tabs/Tabs.d.ts +1 -1
- package/types/components/TimePicker/index.d.ts +1 -1
- package/types/components/Toggle/index.d.ts +1 -1
- package/types/shared/helpers.d.ts +1 -1
- package/types/shared/media-queries.d.ts +2 -2
- package/types/theme.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function
|
|
1
|
+
"use strict";function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if(r!=="default"){var l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,l.get?l:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var n=o(require("react"));exports.default=function({title:e="ErrorIcon",titleId:t,...r}){return n.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r},e?n.createElement("title",{id:t},e):null,n.createElement("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM12 8v4M12 16h.01"})))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";function
|
|
1
|
+
import*as e from"react";function l({title:t="ErrorIcon",titleId:r,...n}){return e.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":r,...n},t?e.createElement("title",{id:r},t):null,e.createElement("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},e.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM12 8v4M12 16h.01"})))}export{l as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kvdbil/components",
|
|
3
|
-
"version": "14.2.
|
|
3
|
+
"version": "14.2.7",
|
|
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",
|
package/types/ColorCard.d.ts
CHANGED
package/types/Types.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { SCREEN_SIZE } from './shared/media-queries';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
|
|
24
|
+
type ImageProps = {
|
|
25
25
|
src: string;
|
|
26
26
|
x?: ObjectPositionX;
|
|
27
27
|
y?: ObjectPositionY;
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
type VideoProps = {
|
|
30
30
|
src: string;
|
|
31
31
|
ytConfig?: Partial<YouTubeVideoProps>;
|
|
32
32
|
};
|
|
@@ -26,6 +26,6 @@ declare const fontSizes: {
|
|
|
26
26
|
fontFamily: "'Open Sans', sans-serif";
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
|
-
|
|
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
|
-
|
|
3
|
-
export
|
|
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
|
|
4
|
-
|
|
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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactElement } from 'react';
|
|
2
2
|
import { ColorWithNone, Notification, Origin } from '../../Types';
|
|
3
|
-
export
|
|
3
|
+
export type SnackbarProps = {
|
|
4
4
|
message: string;
|
|
5
5
|
color?: ColorWithNone;
|
|
6
6
|
type?: Notification;
|
|
@@ -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
|
-
|
|
7
|
+
type TabElement = ReactElement<TabProps>;
|
|
8
8
|
export interface TabsProps {
|
|
9
9
|
activeColor?: Color;
|
|
10
10
|
justify?: CSSProperties['justifyContent'];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const generateNameHash: (prefix: string) => string;
|
|
2
|
-
export declare const fadedColor: (hex: string, alpha?: number
|
|
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
|
|
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?:
|
|
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