@autoguru/overdrive 4.44.7 → 4.44.9
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/components/Icon/Icon.d.ts +4 -4
- package/dist/components/Icon/Icon.d.ts.map +1 -1
- package/dist/components/Icon/Icon.js +20 -9
- package/dist/styles/layers.css.d.ts +13 -0
- package/dist/styles/layers.css.d.ts.map +1 -1
- package/dist/styles/layers.css.js +13 -0
- package/dist/styles/responsiveStyles.d.ts +35 -0
- package/dist/styles/responsiveStyles.d.ts.map +1 -0
- package/dist/styles/responsiveStyles.js +62 -0
- package/dist/styles/sprinkles.css.d.ts +18 -3
- package/dist/styles/sprinkles.css.d.ts.map +1 -1
- package/dist/styles/sprinkles.css.js +4 -3
- package/dist/themes/makeTheme.d.ts +9 -0
- package/dist/themes/makeTheme.d.ts.map +1 -1
- package/dist/themes/makeTheme.js +13 -0
- package/package.json +24 -24
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { IconType } from '@autoguru/icons';
|
|
2
|
-
import type
|
|
3
|
-
import { ResponsiveProp } from '../../utils/responsiveProps.css';
|
|
2
|
+
import { type FunctionComponent, type ReactElement, type SVGAttributes } from 'react';
|
|
3
|
+
import type { ResponsiveProp } from '../../utils/responsiveProps.css';
|
|
4
4
|
import { type BoxProps } from '../Box/Box';
|
|
5
5
|
import * as styles from './Icon.css';
|
|
6
|
-
export type IconEl = IconType | ReactElement<SVGAttributes<SVGElement>, 'svg'
|
|
6
|
+
export type IconEl = IconType | ReactElement<SVGAttributes<SVGElement>, 'svg'> | null;
|
|
7
7
|
export interface IconProps {
|
|
8
8
|
display?: Extract<BoxProps['display'], 'block' | 'inlineBlock' | 'inline-block'>;
|
|
9
9
|
className?: string;
|
|
10
10
|
size?: ResponsiveProp<keyof typeof styles.size | string>;
|
|
11
|
-
icon
|
|
11
|
+
icon?: IconEl;
|
|
12
12
|
}
|
|
13
13
|
export declare const Icon: FunctionComponent<IconProps>;
|
|
14
14
|
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../lib/components/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../lib/components/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAc,EAEb,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,KAAK,MAAM,MAAM,YAAY,CAAC;AAErC,MAAM,MAAM,MAAM,GACf,QAAQ,GACR,YAAY,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,GAC9C,IAAI,CAAC;AAER,MAAM,WAAW,SAAS;IACzB,OAAO,CAAC,EAAE,OAAO,CAChB,QAAQ,CAAC,SAAS,CAAC,EACnB,OAAO,GAAG,aAAa,GAAG,cAAc,CACxC,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,OAAO,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,IAAI,EAAE,iBAAiB,CAAC,SAAS,CAgC7C,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import React, { cloneElement } from 'react';
|
|
5
7
|
import { useNullCheck } from "../../hooks/useNullCheck/index.js";
|
|
6
8
|
import { elementStyles } from "../../styles/index.js";
|
|
7
9
|
import { resolveResponsiveStyle } from "../../utils/resolveResponsiveProps.js";
|
|
@@ -16,6 +18,19 @@ export const Icon = ({
|
|
|
16
18
|
}) => {
|
|
17
19
|
var _icon$props$ariaLabe;
|
|
18
20
|
useNullCheck(icon, 'Icon component received an empty icon prop.');
|
|
21
|
+
const boxProps = {
|
|
22
|
+
as: 'span',
|
|
23
|
+
display,
|
|
24
|
+
className: [resolveResponsiveStyle(size, styles.size), className],
|
|
25
|
+
odComponent: 'icon'
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// Handle null/undefined icons by showing fallback without trying to clone
|
|
29
|
+
if (!icon) {
|
|
30
|
+
return /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread({}, boxProps), {}, {
|
|
31
|
+
children: "\u2B24"
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
19
34
|
const iconElement = /*#__PURE__*/cloneElement(icon, {
|
|
20
35
|
className: elementStyles({
|
|
21
36
|
as: 'svg',
|
|
@@ -26,11 +41,7 @@ export const Icon = ({
|
|
|
26
41
|
'aria-label': (_icon$props$ariaLabe = icon.props['aria-label']) !== null && _icon$props$ariaLabe !== void 0 ? _icon$props$ariaLabe : undefined,
|
|
27
42
|
'aria-hidden': icon.props['aria-label'] ? undefined : true
|
|
28
43
|
});
|
|
29
|
-
return /*#__PURE__*/_jsx(Box, {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
className: [resolveResponsiveStyle(size, styles.size), className],
|
|
33
|
-
odComponent: "icon",
|
|
34
|
-
children: icon ? iconElement : '⬤'
|
|
35
|
-
});
|
|
44
|
+
return /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread({}, boxProps), {}, {
|
|
45
|
+
children: iconElement
|
|
46
|
+
}));
|
|
36
47
|
};
|
|
@@ -5,4 +5,17 @@ export declare const cssLayerTypography: string;
|
|
|
5
5
|
export declare const cssLayerStyleprops: string;
|
|
6
6
|
export declare const cssLayerComponent: string;
|
|
7
7
|
export declare const cssLayerUtil: string;
|
|
8
|
+
/**
|
|
9
|
+
* Map of CSS layer names to their corresponding layer objects
|
|
10
|
+
*/
|
|
11
|
+
export declare const cssLayerMap: {
|
|
12
|
+
readonly reset: string;
|
|
13
|
+
readonly theme: string;
|
|
14
|
+
readonly colorset: string;
|
|
15
|
+
readonly typography: string;
|
|
16
|
+
readonly styleprops: string;
|
|
17
|
+
readonly component: string;
|
|
18
|
+
readonly util: string;
|
|
19
|
+
};
|
|
20
|
+
export type CSSLayers = keyof typeof cssLayerMap;
|
|
8
21
|
//# sourceMappingURL=layers.css.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layers.css.d.ts","sourceRoot":"","sources":["../../lib/styles/layers.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,QAAuB,CAAC;AAClD,eAAO,MAAM,aAAa,QAAuB,CAAC;AAClD,eAAO,MAAM,WAAW,QAAqD,CAAC;AAC9E,eAAO,MAAM,kBAAkB,QAG9B,CAAC;AACF,eAAO,MAAM,kBAAkB,QAA4B,CAAC;AAC5D,eAAO,MAAM,iBAAiB,QAA2B,CAAC;AAC1D,eAAO,MAAM,YAAY,QAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"layers.css.d.ts","sourceRoot":"","sources":["../../lib/styles/layers.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,QAAuB,CAAC;AAClD,eAAO,MAAM,aAAa,QAAuB,CAAC;AAClD,eAAO,MAAM,WAAW,QAAqD,CAAC;AAC9E,eAAO,MAAM,kBAAkB,QAG9B,CAAC;AACF,eAAO,MAAM,kBAAkB,QAA4B,CAAC;AAC5D,eAAO,MAAM,iBAAiB,QAA2B,CAAC;AAC1D,eAAO,MAAM,YAAY,QAAsB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;CAQd,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,WAAW,CAAC"}
|
|
@@ -15,4 +15,17 @@ export const cssLayerTypography = globalLayer({
|
|
|
15
15
|
export const cssLayerStyleprops = globalLayer('styleprops');
|
|
16
16
|
export const cssLayerComponent = globalLayer('component');
|
|
17
17
|
export const cssLayerUtil = globalLayer('util');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Map of CSS layer names to their corresponding layer objects
|
|
21
|
+
*/
|
|
22
|
+
export const cssLayerMap = {
|
|
23
|
+
reset: cssLayerReset,
|
|
24
|
+
theme: cssLayerTheme,
|
|
25
|
+
colorset: cssColorSet,
|
|
26
|
+
typography: cssLayerTypography,
|
|
27
|
+
styleprops: cssLayerStyleprops,
|
|
28
|
+
component: cssLayerComponent,
|
|
29
|
+
util: cssLayerUtil
|
|
30
|
+
};
|
|
18
31
|
__vanilla_filescope__.endFileScope();
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { StyleRule } from '@vanilla-extract/css';
|
|
2
|
+
import { type Breakpoints } from '../themes/makeTheme';
|
|
3
|
+
import { type CSSLayers } from './layers.css';
|
|
4
|
+
/**
|
|
5
|
+
* Type for defining styles for each breakpoint
|
|
6
|
+
*/
|
|
7
|
+
export type ResponsiveStyleMap = Partial<Record<Breakpoints, StyleRule>>;
|
|
8
|
+
/**
|
|
9
|
+
* Creates a single responsive style class that applies different styles at different breakpoints
|
|
10
|
+
*
|
|
11
|
+
* @param styles - Object defining styles for each breakpoint
|
|
12
|
+
* @param layer - Optional CSS layer name to apply the styles within
|
|
13
|
+
* @returns A single vanilla-extract style class with responsive behavior
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const styles = responsiveStyles({
|
|
18
|
+
* mobile: { padding: '16px', fontSize: '14px' },
|
|
19
|
+
* tablet: { padding: '24px', fontSize: '16px' },
|
|
20
|
+
* desktop: { padding: '32px', fontSize: '18px' }
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* // With CSS layer
|
|
24
|
+
* const layeredStyles = responsiveStyles({
|
|
25
|
+
* mobile: { padding: '16px', fontSize: '14px' },
|
|
26
|
+
* tablet: { padding: '24px', fontSize: '16px' },
|
|
27
|
+
* desktop: { padding: '32px', fontSize: '18px' }
|
|
28
|
+
* }, 'component');
|
|
29
|
+
*
|
|
30
|
+
* // Usage in a component
|
|
31
|
+
* <div className={styles}>Responsive content</div>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare const responsiveStyles: (styles: ResponsiveStyleMap, layer?: CSSLayers) => string;
|
|
35
|
+
//# sourceMappingURL=responsiveStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responsiveStyles.d.ts","sourceRoot":"","sources":["../../lib/styles/responsiveStyles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGrE,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAG3D;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,gBAAgB,GAC5B,QAAQ,kBAAkB,EAC1B,QAAQ,SAAS,WAoCjB,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { style } from '@vanilla-extract/css';
|
|
4
|
+
import { breakpoints } from "../themes/makeTheme.js";
|
|
5
|
+
import { cssLayerMap } from "./layers.css.js";
|
|
6
|
+
import { responsiveConditions } from "./sprinkles.css.js";
|
|
7
|
+
/**
|
|
8
|
+
* Type for defining styles for each breakpoint
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Creates a single responsive style class that applies different styles at different breakpoints
|
|
12
|
+
*
|
|
13
|
+
* @param styles - Object defining styles for each breakpoint
|
|
14
|
+
* @param layer - Optional CSS layer name to apply the styles within
|
|
15
|
+
* @returns A single vanilla-extract style class with responsive behavior
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const styles = responsiveStyles({
|
|
20
|
+
* mobile: { padding: '16px', fontSize: '14px' },
|
|
21
|
+
* tablet: { padding: '24px', fontSize: '16px' },
|
|
22
|
+
* desktop: { padding: '32px', fontSize: '18px' }
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* // With CSS layer
|
|
26
|
+
* const layeredStyles = responsiveStyles({
|
|
27
|
+
* mobile: { padding: '16px', fontSize: '14px' },
|
|
28
|
+
* tablet: { padding: '24px', fontSize: '16px' },
|
|
29
|
+
* desktop: { padding: '32px', fontSize: '18px' }
|
|
30
|
+
* }, 'component');
|
|
31
|
+
*
|
|
32
|
+
* // Usage in a component
|
|
33
|
+
* <div className={styles}>Responsive content</div>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export const responsiveStyles = (styles, layer) => {
|
|
37
|
+
const responsiveStyle = {};
|
|
38
|
+
for (const [breakpoint, styleRule] of Object.entries(styles)) {
|
|
39
|
+
if (breakpoint in breakpoints) {
|
|
40
|
+
const breakpointKey = breakpoint;
|
|
41
|
+
if (breakpointKey === breakpoints[0]) {
|
|
42
|
+
// Default (mobile) styles are applied directly
|
|
43
|
+
Object.assign(responsiveStyle, styleRule);
|
|
44
|
+
} else {
|
|
45
|
+
// Larger breakpoints use media queries
|
|
46
|
+
const mediaQuery = responsiveConditions[breakpointKey]['@media'];
|
|
47
|
+
if (!responsiveStyle['@media']) {
|
|
48
|
+
responsiveStyle['@media'] = {};
|
|
49
|
+
}
|
|
50
|
+
responsiveStyle['@media'][mediaQuery] = styleRule;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (layer) {
|
|
55
|
+
return style({
|
|
56
|
+
'@layer': {
|
|
57
|
+
[cssLayerMap[layer]]: responsiveStyle
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return style(responsiveStyle);
|
|
62
|
+
};
|
|
@@ -28,8 +28,6 @@ export declare const sprinkles: ((props: {
|
|
|
28
28
|
backgroundColor?: "page" | "hard" | "soft" | "accent" | "success" | "info" | "danger" | "warning" | "transparent" | undefined;
|
|
29
29
|
backgroundColour?: "white" | "black900" | "black800" | "black700" | "black600" | "black500" | "black400" | "black300" | "black200" | "black100" | "gray900" | "gray800" | "gray700" | "gray600" | "gray500" | "gray400" | "gray300" | "gray200" | "gray100" | "green900" | "green800" | "green700" | "green600" | "green500" | "green400" | "green300" | "green200" | "green100" | "blue900" | "blue800" | "blue700" | "blue600" | "blue500" | "blue400" | "blue300" | "blue200" | "blue100" | "yellow900" | "yellow800" | "yellow700" | "yellow600" | "yellow500" | "yellow400" | "yellow300" | "yellow200" | "yellow100" | "red900" | "red800" | "red700" | "red600" | "red500" | "red400" | "red300" | "red200" | "red100" | "success" | "danger" | "warning" | "neutral" | "primary" | "brand" | "secondary" | "shine" | "information" | "transparent" | undefined;
|
|
30
30
|
opacity?: number | "1" | "0" | undefined;
|
|
31
|
-
lineHeight?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | undefined;
|
|
32
|
-
fontSize?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | undefined;
|
|
33
31
|
fontWeight?: "bold" | "normal" | "semiBold" | undefined;
|
|
34
32
|
textTransform?: "capitalize" | "lowercase" | "uppercase" | undefined;
|
|
35
33
|
textWrap?: "balance" | "nowrap" | "stable" | "pretty" | undefined;
|
|
@@ -38,7 +36,6 @@ export declare const sprinkles: ((props: {
|
|
|
38
36
|
pointerEvents?: "none" | "auto" | undefined;
|
|
39
37
|
userSelect?: "none" | "auto" | "text" | undefined;
|
|
40
38
|
useVar?: "gap" | undefined;
|
|
41
|
-
text?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | undefined;
|
|
42
39
|
bg?: "page" | "hard" | "soft" | "accent" | "success" | "info" | "danger" | "warning" | "transparent" | undefined;
|
|
43
40
|
fg?: "soft" | "success" | "info" | "danger" | "warning" | "normal" | "inverse" | undefined;
|
|
44
41
|
borderColor?: "page" | "hard" | "soft" | "accent" | "success" | "info" | "danger" | "warning" | "muted" | "default" | "disabled" | undefined;
|
|
@@ -83,6 +80,18 @@ export declare const sprinkles: ((props: {
|
|
|
83
80
|
desktop?: "fixed" | "absolute" | "relative" | "static" | "sticky" | undefined;
|
|
84
81
|
largeDesktop?: "fixed" | "absolute" | "relative" | "static" | "sticky" | undefined;
|
|
85
82
|
} | undefined) | import("@vanilla-extract/sprinkles").ResponsiveArray<1 | 2 | 3 | 4, "fixed" | "absolute" | "relative" | "static" | "sticky" | null>;
|
|
83
|
+
lineHeight?: ("1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | {
|
|
84
|
+
mobile?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | undefined;
|
|
85
|
+
tablet?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | undefined;
|
|
86
|
+
desktop?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | undefined;
|
|
87
|
+
largeDesktop?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | undefined;
|
|
88
|
+
} | undefined) | import("@vanilla-extract/sprinkles").ResponsiveArray<1 | 2 | 3 | 4, "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | null>;
|
|
89
|
+
fontSize?: ("1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | {
|
|
90
|
+
mobile?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | undefined;
|
|
91
|
+
tablet?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | undefined;
|
|
92
|
+
desktop?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | undefined;
|
|
93
|
+
largeDesktop?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | undefined;
|
|
94
|
+
} | undefined) | import("@vanilla-extract/sprinkles").ResponsiveArray<1 | 2 | 3 | 4, "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | null>;
|
|
86
95
|
textAlign?: ("left" | "right" | "center" | "centre" | {
|
|
87
96
|
mobile?: "left" | "right" | "center" | "centre" | undefined;
|
|
88
97
|
tablet?: "left" | "right" | "center" | "centre" | undefined;
|
|
@@ -341,6 +350,12 @@ export declare const sprinkles: ((props: {
|
|
|
341
350
|
desktop?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "full" | "auto" | "fit-content" | "max-content" | "min-content" | undefined;
|
|
342
351
|
largeDesktop?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "full" | "auto" | "fit-content" | "max-content" | "min-content" | undefined;
|
|
343
352
|
} | undefined);
|
|
353
|
+
text?: ("1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | {
|
|
354
|
+
mobile?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | undefined;
|
|
355
|
+
tablet?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | undefined;
|
|
356
|
+
desktop?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | undefined;
|
|
357
|
+
largeDesktop?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | undefined;
|
|
358
|
+
} | undefined) | import("@vanilla-extract/sprinkles").ResponsiveArray<1 | 2 | 3 | 4, "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | null>;
|
|
344
359
|
padding?: import("@vanilla-extract/sprinkles").ResponsiveArray<1 | 2 | 3 | 4, "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "none" | null> | ("1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "none" | {
|
|
345
360
|
mobile?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "none" | undefined;
|
|
346
361
|
tablet?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "none" | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sprinkles.css.d.ts","sourceRoot":"","sources":["../../lib/styles/sprinkles.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sprinkles.css.d.ts","sourceRoot":"","sources":["../../lib/styles/sprinkles.css.ts"],"names":[],"mappings":"AAqLA,eAAO,MAAM,oBAAoB;;;;;;;;;;;CAOhC,CAAC;AA2IF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAwD,CAAC;AAC/E,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AAExD;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACxC,SAAS,EACP,kBAAkB,GAClB,cAAc,GACd,oBAAoB,GACpB,kBAAkB,GAClB,mBAAmB,GACnB,iBAAiB,GACjB,QAAQ,CACV,CAAC;AAIF,eAAO,MAAM,WAAW;;;;;;;;;;CAcvB,CAAC"}
|
|
@@ -113,8 +113,6 @@ const baseProperties = defineProperties({
|
|
|
113
113
|
backgroundColour: mappedBackgroundColours,
|
|
114
114
|
opacity: [0, '1', '0'],
|
|
115
115
|
// Typography
|
|
116
|
-
lineHeight: mapValues(tokens.typography.size, size => size.lineHeight),
|
|
117
|
-
fontSize: mapValues(tokens.typography.size, size => size.fontSize),
|
|
118
116
|
fontWeight: tokens.typography.fontWeight,
|
|
119
117
|
textTransform: ['capitalize', 'lowercase', 'uppercase'],
|
|
120
118
|
textWrap: ['balance', 'pretty', 'stable', 'nowrap'],
|
|
@@ -131,7 +129,6 @@ const baseProperties = defineProperties({
|
|
|
131
129
|
}
|
|
132
130
|
},
|
|
133
131
|
shorthands: {
|
|
134
|
-
text: ['fontSize', 'lineHeight'],
|
|
135
132
|
bg: ['backgroundColor'],
|
|
136
133
|
fg: ['color'],
|
|
137
134
|
borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],
|
|
@@ -183,6 +180,9 @@ const responsiveProperties = defineProperties({
|
|
|
183
180
|
overflowX: ['auto', 'scroll', 'hidden'],
|
|
184
181
|
overflowY: ['auto', 'scroll', 'hidden'],
|
|
185
182
|
position: ['static', 'relative', 'absolute', 'fixed', 'sticky'],
|
|
183
|
+
// Typography
|
|
184
|
+
lineHeight: mapValues(tokens.typography.size, size => size.lineHeight),
|
|
185
|
+
fontSize: mapValues(tokens.typography.size, size => size.fontSize),
|
|
186
186
|
textAlign: {
|
|
187
187
|
left: 'left',
|
|
188
188
|
center: 'center',
|
|
@@ -262,6 +262,7 @@ const responsiveProperties = defineProperties({
|
|
|
262
262
|
borderWidthTop: ['borderTopWidth'],
|
|
263
263
|
placeItems: ['justifyContent', 'alignItems'],
|
|
264
264
|
size: ['width', 'height'],
|
|
265
|
+
text: ['fontSize', 'lineHeight'],
|
|
265
266
|
padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],
|
|
266
267
|
p: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],
|
|
267
268
|
paddingX: ['paddingLeft', 'paddingRight'],
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { BreakPoints, ColourMap, FlattenedColours, ThemeTokens } from '.';
|
|
2
2
|
export declare const breakpoints: BreakPoints;
|
|
3
|
+
export type Breakpoints = keyof typeof breakpoints;
|
|
4
|
+
/**
|
|
5
|
+
* Type guard to check if a value is a valid breakpoint key
|
|
6
|
+
*/
|
|
7
|
+
export declare const isBreakpoint: (value: string) => value is Breakpoints;
|
|
8
|
+
/**
|
|
9
|
+
* Get all available breakpoint keys
|
|
10
|
+
*/
|
|
11
|
+
export declare const getBreakpoint: () => readonly Breakpoints[];
|
|
3
12
|
export declare const mediaQuery: Record<import("./types").DeviceSize, string>;
|
|
4
13
|
/**
|
|
5
14
|
* Wraps theme tokens with `theme` CSS layer using the vanilla-extract method
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeTheme.d.ts","sourceRoot":"","sources":["../../lib/themes/makeTheme.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC;AAE/E,eAAO,MAAM,WAAW,EAAE,WAKzB,CAAC;AAEF,eAAO,MAAM,UAAU,8CAGtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGtD,CAAC;AAEH,eAAO,MAAM,iBAAiB,GAC7B,qBAAoB,WAAyB;;CAG5C,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEjE,eAAO,MAAM,gBAAgB,GAAI,SAAS,SAAS,KAAG,gBAepD,CAAC"}
|
|
1
|
+
{"version":3,"file":"makeTheme.d.ts","sourceRoot":"","sources":["../../lib/themes/makeTheme.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC;AAE/E,eAAO,MAAM,WAAW,EAAE,WAKzB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,WAAW,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,KAAK,IAAI,WAErD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,QAAO,SAAS,WAAW,EAEpD,CAAC;AAEF,eAAO,MAAM,UAAU,8CAGtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGtD,CAAC;AAEH,eAAO,MAAM,iBAAiB,GAC7B,qBAAoB,WAAyB;;CAG5C,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEjE,eAAO,MAAM,gBAAgB,GAAI,SAAS,SAAS,KAAG,gBAepD,CAAC"}
|
package/dist/themes/makeTheme.js
CHANGED
|
@@ -13,6 +13,19 @@ export const breakpoints = {
|
|
|
13
13
|
// IPad Pro width (1366 - 25%)
|
|
14
14
|
largeDesktop: '1920px' // 1080p width (1920 - 25%)
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Type guard to check if a value is a valid breakpoint key
|
|
18
|
+
*/
|
|
19
|
+
export const isBreakpoint = value => {
|
|
20
|
+
return value in breakpoints;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get all available breakpoint keys
|
|
25
|
+
*/
|
|
26
|
+
export const getBreakpoint = () => {
|
|
27
|
+
return Object.keys(breakpoints);
|
|
28
|
+
};
|
|
16
29
|
export const mediaQuery = mapValues(breakpoints, breakpoint => `screen and (min-width: ${breakpoint})`);
|
|
17
30
|
|
|
18
31
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autoguru/overdrive",
|
|
3
|
-
"version": "4.44.
|
|
3
|
+
"version": "4.44.9",
|
|
4
4
|
"description": "Overdrive is a product component library, and design system for AutoGuru.",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@autoguru/babel-preset": "3.2.0",
|
|
61
61
|
"@autoguru/eslint-plugin": "2.0.0",
|
|
62
|
-
"@autoguru/icons": "1.8.
|
|
62
|
+
"@autoguru/icons": "1.8.12",
|
|
63
63
|
"@autoguru/tsconfig": "1.3.1",
|
|
64
64
|
"@autoguru/utilities": "^1.3.3",
|
|
65
65
|
"@babel/cli": "7.28.0",
|
|
@@ -79,25 +79,25 @@
|
|
|
79
79
|
"@babel/preset-typescript": "7.27.1",
|
|
80
80
|
"@babel/runtime-corejs3": "7.28.0",
|
|
81
81
|
"@changesets/cli": "2.29.5",
|
|
82
|
-
"@chromatic-com/storybook": "4.0
|
|
82
|
+
"@chromatic-com/storybook": "4.1.0",
|
|
83
83
|
"@internationalized/date": "3.8.2",
|
|
84
84
|
"@octokit/rest": "22.0.0",
|
|
85
85
|
"@popperjs/core": "2.11.8",
|
|
86
86
|
"@react-stately/toggle": "3.8.5",
|
|
87
|
-
"@storybook/addon-a11y": "9.0
|
|
88
|
-
"@storybook/addon-docs": "9.0
|
|
89
|
-
"@storybook/addon-links": "9.0
|
|
90
|
-
"@storybook/addon-onboarding": "9.0
|
|
91
|
-
"@storybook/addon-vitest": "9.0
|
|
92
|
-
"@storybook/react-vite": "9.0
|
|
87
|
+
"@storybook/addon-a11y": "9.1.0",
|
|
88
|
+
"@storybook/addon-docs": "9.1.0",
|
|
89
|
+
"@storybook/addon-links": "9.1.0",
|
|
90
|
+
"@storybook/addon-onboarding": "9.1.0",
|
|
91
|
+
"@storybook/addon-vitest": "9.1.0",
|
|
92
|
+
"@storybook/react-vite": "9.1.0",
|
|
93
93
|
"@testing-library/dom": "^10.4.0",
|
|
94
94
|
"@testing-library/jest-dom": "6.6.3",
|
|
95
95
|
"@testing-library/react": "16.3.0",
|
|
96
96
|
"@testing-library/react-hooks": "8.0.1",
|
|
97
97
|
"@testing-library/user-event": "14.6.1",
|
|
98
|
-
"@types/node": "24.0
|
|
99
|
-
"@types/react": "19.1.
|
|
100
|
-
"@types/react-dom": "19.1.
|
|
98
|
+
"@types/node": "24.2.0",
|
|
99
|
+
"@types/react": "19.1.9",
|
|
100
|
+
"@types/react-dom": "19.1.7",
|
|
101
101
|
"@types/webpack-env": "1.18.8",
|
|
102
102
|
"@typescript-eslint/utils": "8.35.1",
|
|
103
103
|
"@vanilla-extract/babel-plugin": "1.2.0",
|
|
@@ -114,22 +114,22 @@
|
|
|
114
114
|
"babel-plugin-dev-expression": "0.2.3",
|
|
115
115
|
"babel-plugin-macros": "3.1.0",
|
|
116
116
|
"browserslist-config-autoguru": "2.5.0",
|
|
117
|
-
"chromatic": "13.1.
|
|
117
|
+
"chromatic": "13.1.3",
|
|
118
118
|
"clsx": "2.1.1",
|
|
119
119
|
"colord": "2.9.3",
|
|
120
120
|
"concurrently": "9.2.0",
|
|
121
|
-
"core-js": "3.
|
|
121
|
+
"core-js": "3.45.0",
|
|
122
122
|
"csstype": "3.1.3",
|
|
123
123
|
"deepmerge": "4.3.1",
|
|
124
|
-
"es-toolkit": "1.39.
|
|
124
|
+
"es-toolkit": "1.39.8",
|
|
125
125
|
"eslint": "9.30.1",
|
|
126
|
-
"eslint-plugin-storybook": "9.0
|
|
126
|
+
"eslint-plugin-storybook": "9.1.0",
|
|
127
127
|
"husky": "9.1.7",
|
|
128
128
|
"intersection-observer": "0.12.2",
|
|
129
129
|
"jsdom": "26.1.0",
|
|
130
|
-
"lint-staged": "16.1.
|
|
130
|
+
"lint-staged": "16.1.4",
|
|
131
131
|
"magic-string": "0.30.17",
|
|
132
|
-
"mini-css-extract-plugin": "2.9.
|
|
132
|
+
"mini-css-extract-plugin": "2.9.3",
|
|
133
133
|
"mockdate": "3.0.5",
|
|
134
134
|
"playwright": "1.53.2",
|
|
135
135
|
"plop": "4.0.1",
|
|
@@ -143,17 +143,17 @@
|
|
|
143
143
|
"react-dom": "19.1.0",
|
|
144
144
|
"react-focus-lock": "2.13.6",
|
|
145
145
|
"react-intersection-observer": "9.16.0",
|
|
146
|
-
"react-keyed-flatten-children": "5.0.
|
|
146
|
+
"react-keyed-flatten-children": "5.0.1",
|
|
147
147
|
"react-stately": "3.39.0",
|
|
148
148
|
"react-swipeable": "7.0.2",
|
|
149
149
|
"rollup-plugin-visualizer": "6.0.3",
|
|
150
|
-
"storybook": "9.0
|
|
150
|
+
"storybook": "9.1.0",
|
|
151
151
|
"storybook-addon-tag-badges": "2.0.1",
|
|
152
|
-
"typescript": "5.
|
|
152
|
+
"typescript": "5.9.2",
|
|
153
153
|
"url-loader": "4.1.1",
|
|
154
|
-
"vite": "7.0.
|
|
154
|
+
"vite": "7.0.6",
|
|
155
155
|
"vitest": "3.2.4",
|
|
156
|
-
"webpack": "5.
|
|
156
|
+
"webpack": "5.101.0"
|
|
157
157
|
},
|
|
158
158
|
"peerDependencies": {
|
|
159
159
|
"@autoguru/icons": ">=1.8.8",
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
"webpack": "*"
|
|
177
177
|
},
|
|
178
178
|
"volta": {
|
|
179
|
-
"node": "22.
|
|
179
|
+
"node": "22.18.0",
|
|
180
180
|
"yarn": "4.9.2"
|
|
181
181
|
},
|
|
182
182
|
"packageManager": "yarn@4.9.2"
|