@autoguru/overdrive 4.35.2 → 4.36.0
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/Box/Box.d.ts +1 -1
- package/dist/components/Box/Box.d.ts.map +1 -1
- package/dist/components/Box/Box.js +5 -3
- package/dist/components/Box/index.d.ts +1 -1
- package/dist/components/Box/index.d.ts.map +1 -1
- package/dist/components/Box/useBoxStyles.d.ts +4 -3
- package/dist/components/Box/useBoxStyles.d.ts.map +1 -1
- package/dist/components/Box/useBoxStyles.js +2 -1
- package/dist/components/Icon/Icon.d.ts +2 -1
- package/dist/components/Icon/Icon.d.ts.map +1 -1
- package/dist/components/Icon/index.d.ts +1 -1
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/OptionGrid/OptionGrid.css.d.ts +31 -0
- package/dist/components/OptionGrid/OptionGrid.css.d.ts.map +1 -0
- package/dist/components/OptionGrid/OptionGrid.css.js +192 -0
- package/dist/components/OptionGrid/OptionGrid.d.ts +22 -0
- package/dist/components/OptionGrid/OptionGrid.d.ts.map +1 -0
- package/dist/components/OptionGrid/OptionGrid.js +99 -0
- package/dist/components/OptionList/IconTick.d.ts +3 -0
- package/dist/components/OptionList/IconTick.d.ts.map +1 -0
- package/dist/components/OptionList/IconTick.js +18 -0
- package/dist/components/OptionList/OptionList.css.d.ts +14 -0
- package/dist/components/OptionList/OptionList.css.d.ts.map +1 -0
- package/dist/components/OptionList/OptionList.css.js +111 -0
- package/dist/components/OptionList/OptionList.d.ts +54 -0
- package/dist/components/OptionList/OptionList.d.ts.map +1 -0
- package/dist/components/OptionList/OptionList.js +53 -0
- package/dist/components/OptionList/OptionListItem.d.ts +17 -0
- package/dist/components/OptionList/OptionListItem.d.ts.map +1 -0
- package/dist/components/OptionList/OptionListItem.js +76 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/Switch.js +2 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.css.d.ts +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.css.d.ts.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.css.js +8 -2
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +4 -7
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.js +12 -11
- package/dist/stories/helpers/index.d.ts +5 -5
- package/dist/stories/helpers/index.d.ts.map +1 -1
- package/dist/styles/focusOutline.css.d.ts +3 -0
- package/dist/styles/focusOutline.css.d.ts.map +1 -0
- package/dist/styles/focusOutline.css.js +14 -0
- package/dist/styles/sprinkles.css.d.ts +320 -21
- package/dist/styles/sprinkles.css.d.ts.map +1 -1
- package/dist/styles/sprinkles.css.js +129 -8
- package/dist/styles/stack.css.d.ts.map +1 -1
- package/dist/styles/stack.css.js +7 -7
- package/dist/themes/base/index.d.ts +3 -2
- package/dist/themes/base/index.d.ts.map +1 -1
- package/dist/themes/base/tokens.d.ts.map +1 -1
- package/dist/themes/base/tokens.js +4 -3
- package/dist/themes/flat_red/index.d.ts +3 -2
- package/dist/themes/flat_red/index.d.ts.map +1 -1
- package/dist/themes/neutral/index.d.ts +3 -2
- package/dist/themes/neutral/index.d.ts.map +1 -1
- package/dist/themes/neutral/tokens.d.ts.map +1 -1
- package/dist/themes/neutral/tokens.js +4 -3
- package/dist/themes/theme.css.d.ts +3 -2
- package/dist/themes/theme.css.d.ts.map +1 -1
- package/dist/themes/theme.css.js +4 -3
- package/dist/themes/tokens.d.ts +2 -1
- package/dist/themes/tokens.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/utils/dataAttrs.d.ts +7 -0
- package/dist/utils/dataAttrs.d.ts.map +1 -0
- package/dist/utils/dataAttrs.js +11 -0
- package/package.json +37 -29
|
@@ -2,7 +2,7 @@ import type { AllHTMLAttributes } from 'react';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
import type { BoxStyleProps } from './useBoxStyles';
|
|
5
|
-
export interface Props extends BoxStyleProps, Omit<AllHTMLAttributes<HTMLElement>, 'width' | 'height' | 'className' | 'is'> {
|
|
5
|
+
export interface Props extends BoxStyleProps, Omit<AllHTMLAttributes<HTMLElement>, 'as' | 'width' | 'height' | 'className' | 'is'> {
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
}
|
|
8
8
|
export declare const Box: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpD,MAAM,WAAW,KAChB,SAAQ,aAAa,EACpB,IAAI,CACH,iBAAiB,CAAC,WAAW,CAAC,EAC9B,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpD,MAAM,WAAW,KAChB,SAAQ,aAAa,EACpB,IAAI,CACH,iBAAiB,CAAC,WAAW,CAAC,EAC9B,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,IAAI,CAC9C;IACF,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAKD,eAAO,MAAM,GAAG,2EAoIf,CAAC;AAIF,eAAe,GAAG,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
const _excluded = ["is", "padding", "paddingX", "paddingY", "paddingTop", "paddingBottom", "paddingLeft", "paddingRight", "margin", "marginX", "marginY", "marginTop", "marginBottom", "marginLeft", "marginRight", "display", "width", "height", "position", "overflow", "userSelect", "textAlign", "pointerEvents", "borderColour", "borderColourX", "borderColourY", "borderColourTop", "borderColourRight", "borderColourBottom", "borderColourLeft", "borderWidth", "borderWidthX", "borderWidthY", "borderWidthTop", "borderWidthRight", "borderWidthBottom", "borderWidthLeft", "boxShadow", "borderRadius", "backgroundColour", "colour", "opacity", "className", "alignItems", "order", "flexDirection", "flexGrow", "flexShrink", "flexWrap", "justifyContent", "children"];
|
|
5
|
+
const _excluded = ["as", "is", "padding", "paddingX", "paddingY", "paddingTop", "paddingBottom", "paddingLeft", "paddingRight", "margin", "marginX", "marginY", "marginTop", "marginBottom", "marginLeft", "marginRight", "display", "width", "height", "position", "overflow", "userSelect", "textAlign", "pointerEvents", "borderColour", "borderColourX", "borderColourY", "borderColourTop", "borderColourRight", "borderColourBottom", "borderColourLeft", "borderWidth", "borderWidthX", "borderWidthY", "borderWidthTop", "borderWidthRight", "borderWidthBottom", "borderWidthLeft", "boxShadow", "borderRadius", "backgroundColour", "colour", "opacity", "className", "alignItems", "order", "flexDirection", "flexGrow", "flexShrink", "flexWrap", "justifyContent", "children"];
|
|
6
6
|
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; }
|
|
7
7
|
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; }
|
|
8
8
|
import clsx from 'clsx';
|
|
@@ -12,7 +12,8 @@ import { useBoxStyles } from "./useBoxStyles.js";
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
export const Box = forwardRef((_ref, ref) => {
|
|
14
14
|
let {
|
|
15
|
-
|
|
15
|
+
as = 'div',
|
|
16
|
+
is = as,
|
|
16
17
|
padding,
|
|
17
18
|
paddingX,
|
|
18
19
|
paddingY,
|
|
@@ -66,7 +67,7 @@ export const Box = forwardRef((_ref, ref) => {
|
|
|
66
67
|
} = _ref,
|
|
67
68
|
allOtherProps = _objectWithoutProperties(_ref, _excluded);
|
|
68
69
|
const cls = useBoxStyles({
|
|
69
|
-
is
|
|
70
|
+
is,
|
|
70
71
|
alignItems,
|
|
71
72
|
order,
|
|
72
73
|
backgroundColour,
|
|
@@ -116,6 +117,7 @@ export const Box = forwardRef((_ref, ref) => {
|
|
|
116
117
|
userSelect,
|
|
117
118
|
width
|
|
118
119
|
});
|
|
120
|
+
const Component = is;
|
|
119
121
|
return _jsx(Component, _objectSpread(_objectSpread({
|
|
120
122
|
ref: ref,
|
|
121
123
|
className: clsx(cls, className)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,KAAK,IAAI,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ElementType } from 'react';
|
|
3
3
|
import { Tokens } from '../../themes/tokens';
|
|
4
4
|
import { ResponsiveProp } from '../../utils/responsiveProps.css';
|
|
5
5
|
import * as styles from './useBoxStyles.css';
|
|
@@ -48,7 +48,8 @@ interface Flex {
|
|
|
48
48
|
justifyContent?: ResponsiveProp<keyof typeof styles.justifyContent>;
|
|
49
49
|
}
|
|
50
50
|
export interface BoxStyleProps extends Padding, Margin, Border, Flex {
|
|
51
|
-
|
|
51
|
+
as?: ElementType;
|
|
52
|
+
is?: ElementType;
|
|
52
53
|
boxShadow?: ResponsiveProp<keyof typeof styles.boxShadow>;
|
|
53
54
|
display?: keyof typeof styles.display;
|
|
54
55
|
position?: keyof typeof styles.position;
|
|
@@ -63,6 +64,6 @@ export interface BoxStyleProps extends Padding, Margin, Border, Flex {
|
|
|
63
64
|
pointerEvents?: keyof typeof styles.pointerEvents;
|
|
64
65
|
className?: Parameters<typeof clsx>[0];
|
|
65
66
|
}
|
|
66
|
-
export declare const useBoxStyles: ({ is, display, padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight, margin, marginX, marginY, marginTop, marginBottom, marginLeft, marginRight, boxShadow, borderWidth, borderWidthX, borderWidthY, borderWidthTop, borderWidthRight, borderWidthBottom, borderWidthLeft, borderColour, borderColourX, borderColourY, borderColourTop, borderColourRight, borderColourBottom, borderColourLeft, borderRadius, backgroundColour, colour, opacity, width, height, position, overflow, userSelect, textAlign, pointerEvents, alignItems, order, flexDirection, flexGrow, flexShrink, flexWrap, justifyContent, className, }: BoxStyleProps) => string;
|
|
67
|
+
export declare const useBoxStyles: ({ as, is, display, padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight, margin, marginX, marginY, marginTop, marginBottom, marginLeft, marginRight, boxShadow, borderWidth, borderWidthX, borderWidthY, borderWidthTop, borderWidthRight, borderWidthBottom, borderWidthLeft, borderColour, borderColourX, borderColourY, borderColourTop, borderColourRight, borderColourBottom, borderColourLeft, borderRadius, backgroundColour, colour, opacity, width, height, position, overflow, userSelect, textAlign, pointerEvents, alignItems, order, flexDirection, flexGrow, flexShrink, flexWrap, justifyContent, className, }: BoxStyleProps) => string;
|
|
67
68
|
export default useBoxStyles;
|
|
68
69
|
//# sourceMappingURL=useBoxStyles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBoxStyles.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/useBoxStyles.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"useBoxStyles.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/useBoxStyles.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAGzC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAE7C,UAAU,OAAO;IAChB,OAAO,CAAC,EAAE,cAAc,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,cAAc,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACjD,QAAQ,CAAC,EAAE,cAAc,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC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AAQ,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC,UAAU,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC,SAAS,CAAC;IAC1C,aAAa,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC,aAAa,CAAC;IAElD,SAAS,CAAC,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;CACvC;AAED,eAAO,MAAM,YAAY,+nBAoDtB,aAAa,WAqHf,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -3,11 +3,12 @@ import type { FunctionComponent, ReactElement, SVGAttributes } from 'react';
|
|
|
3
3
|
import { ResponsiveProp } from '../../utils/responsiveProps.css';
|
|
4
4
|
import type { BoxStyleProps } from '../Box';
|
|
5
5
|
import * as styles from './Icon.css';
|
|
6
|
+
export type IconEl = IconType | ReactElement<SVGAttributes<SVGElement>, 'svg'>;
|
|
6
7
|
export interface Props {
|
|
7
8
|
display?: Extract<BoxStyleProps['display'], 'block' | 'inlineBlock'>;
|
|
8
9
|
className?: string;
|
|
9
10
|
size?: ResponsiveProp<keyof typeof styles.size | string>;
|
|
10
|
-
icon:
|
|
11
|
+
icon: IconEl;
|
|
11
12
|
}
|
|
12
13
|
export declare const Icon: FunctionComponent<Props>;
|
|
13
14
|
export default Icon;
|
|
@@ -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,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAM5E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAG5C,OAAO,KAAK,MAAM,MAAM,YAAY,CAAC;AAErC,MAAM,WAAW,KAAK;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC,CAAC;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,OAAO,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IACzD,IAAI,EAAE,
|
|
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,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAM5E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAG5C,OAAO,KAAK,MAAM,MAAM,YAAY,CAAC;AAErC,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,YAAY,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,CAAC;AAE/E,MAAM,WAAW,KAAK;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC,CAAC;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,OAAO,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IACzD,IAAI,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,IAAI,EAAE,iBAAiB,CAAC,KAAK,CA0BzC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Icon } from './Icon';
|
|
1
|
+
export { Icon, type IconEl, type Props as IconProps } from './Icon';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,MAAM,EAAE,KAAK,KAAK,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type RecipeVariants } from '@vanilla-extract/recipes';
|
|
2
|
+
export declare const styledGridContainer: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
3
|
+
columns: {
|
|
4
|
+
'1': {};
|
|
5
|
+
'2': string;
|
|
6
|
+
'3': string;
|
|
7
|
+
'4': string;
|
|
8
|
+
'5': string;
|
|
9
|
+
};
|
|
10
|
+
}>;
|
|
11
|
+
export type StyledGridContainerProps = NonNullable<RecipeVariants<typeof styledGridContainer>>;
|
|
12
|
+
export declare const styledGridItem: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
13
|
+
[x: string]: {
|
|
14
|
+
[x: string]: string | import("@vanilla-extract/css").ComplexStyleRule;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
export type StyledGridItemProps = NonNullable<RecipeVariants<typeof styledGridItem>>;
|
|
18
|
+
export declare const styleIndicator: string;
|
|
19
|
+
export declare const styledCheckbox: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
20
|
+
[x: string]: {
|
|
21
|
+
[x: string]: string | import("@vanilla-extract/css").ComplexStyleRule;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
export type StyledCheckboxProps = NonNullable<RecipeVariants<typeof styledCheckbox>>;
|
|
25
|
+
export declare const styledRadioButton: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
26
|
+
[x: string]: {
|
|
27
|
+
[x: string]: string | import("@vanilla-extract/css").ComplexStyleRule;
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
30
|
+
export type StyledRadioButtonProps = NonNullable<RecipeVariants<typeof styledRadioButton>>;
|
|
31
|
+
//# sourceMappingURL=OptionGrid.css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptionGrid.css.d.ts","sourceRoot":"","sources":["../../../lib/components/OptionGrid/OptionGrid.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAOvE,eAAO,MAAM,mBAAmB;;;;;;;;EA8B9B,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,WAAW,CACjD,cAAc,CAAC,OAAO,mBAAmB,CAAC,CAC1C,CAAC;AAyBF,eAAO,MAAM,cAAc;;;;EAkCzB,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAC5C,cAAc,CAAC,OAAO,cAAc,CAAC,CACrC,CAAC;AAGF,eAAO,MAAM,cAAc,QAGzB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;EA2BzB,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAC5C,cAAc,CAAC,OAAO,cAAc,CAAC,CACrC,CAAC;AAwBF,eAAO,MAAM,iBAAiB;;;;EAoB5B,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAC/C,cAAc,CAAC,OAAO,iBAAiB,CAAC,CACxC,CAAC"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
5
|
+
__vanilla_filescope__.setFileScope("lib/components/OptionGrid/OptionGrid.css.ts", "@autoguru/overdrive");
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
import { style } from '@vanilla-extract/css';
|
|
9
|
+
import { recipe } from '@vanilla-extract/recipes';
|
|
10
|
+
import { focusOutline } from "../../styles/focusOutline.css.js";
|
|
11
|
+
import { odStyle } from "../../styles/sprinkles.css.js";
|
|
12
|
+
import { tokens } from "../../themes/base/tokens.js";
|
|
13
|
+
export const styledGridContainer = recipe({
|
|
14
|
+
base: odStyle({
|
|
15
|
+
display: {
|
|
16
|
+
mobile: 'flex'
|
|
17
|
+
},
|
|
18
|
+
flexDirection: {
|
|
19
|
+
mobile: 'column'
|
|
20
|
+
},
|
|
21
|
+
gap: '3'
|
|
22
|
+
}),
|
|
23
|
+
variants: {
|
|
24
|
+
columns: {
|
|
25
|
+
'1': {},
|
|
26
|
+
'2': odStyle({
|
|
27
|
+
display: {
|
|
28
|
+
tablet: 'grid'
|
|
29
|
+
},
|
|
30
|
+
gridColumns: {
|
|
31
|
+
tablet: '2'
|
|
32
|
+
}
|
|
33
|
+
}),
|
|
34
|
+
'3': odStyle({
|
|
35
|
+
display: {
|
|
36
|
+
tablet: 'grid'
|
|
37
|
+
},
|
|
38
|
+
gridColumns: {
|
|
39
|
+
tablet: '2',
|
|
40
|
+
desktop: '3'
|
|
41
|
+
}
|
|
42
|
+
}),
|
|
43
|
+
'4': odStyle({
|
|
44
|
+
display: {
|
|
45
|
+
tablet: 'grid'
|
|
46
|
+
},
|
|
47
|
+
gridColumns: {
|
|
48
|
+
tablet: '3',
|
|
49
|
+
desktop: '4'
|
|
50
|
+
}
|
|
51
|
+
}),
|
|
52
|
+
'5': odStyle({
|
|
53
|
+
display: {
|
|
54
|
+
tablet: 'grid'
|
|
55
|
+
},
|
|
56
|
+
gridColumns: {
|
|
57
|
+
tablet: '3',
|
|
58
|
+
desktop: '5'
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
defaultVariants: {
|
|
64
|
+
columns: '2'
|
|
65
|
+
}
|
|
66
|
+
}, "styledGridContainer");
|
|
67
|
+
const optionTransition = style({
|
|
68
|
+
transition: 'background 80ms ease-in'
|
|
69
|
+
}, "optionTransition");
|
|
70
|
+
const pseudoThickBorder = style({
|
|
71
|
+
selectors: {
|
|
72
|
+
'&[data-selected]:after': {
|
|
73
|
+
outlineColor: tokens.colours.gamut.black900,
|
|
74
|
+
outlineStyle: 'solid',
|
|
75
|
+
outlineWidth: tokens.border.width[2],
|
|
76
|
+
borderRadius: 'inherit',
|
|
77
|
+
content: '',
|
|
78
|
+
display: 'block',
|
|
79
|
+
position: 'absolute',
|
|
80
|
+
width: '100%',
|
|
81
|
+
height: '100%',
|
|
82
|
+
left: 0,
|
|
83
|
+
top: 0
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}, "pseudoThickBorder");
|
|
87
|
+
export const styledGridItem = recipe({
|
|
88
|
+
base: [{
|
|
89
|
+
minHeight: '80px',
|
|
90
|
+
userSelect: 'none'
|
|
91
|
+
}, odStyle(_objectSpread(_objectSpread({
|
|
92
|
+
alignItems: 'center',
|
|
93
|
+
background: {
|
|
94
|
+
initial: 'white',
|
|
95
|
+
focusVisible: 'gray200',
|
|
96
|
+
hover: 'gray200',
|
|
97
|
+
selected: 'white'
|
|
98
|
+
},
|
|
99
|
+
borderColor: {
|
|
100
|
+
initial: 'gray',
|
|
101
|
+
focusVisible: 'light',
|
|
102
|
+
hover: 'light',
|
|
103
|
+
selected: 'dark'
|
|
104
|
+
},
|
|
105
|
+
borderRadius: '2',
|
|
106
|
+
borderStyle: 'solid',
|
|
107
|
+
borderWidth: '1',
|
|
108
|
+
cursor: {
|
|
109
|
+
hover: 'pointer'
|
|
110
|
+
},
|
|
111
|
+
display: 'flex'
|
|
112
|
+
}, focusOutline), {}, {
|
|
113
|
+
gap: '2',
|
|
114
|
+
paddingX: '4',
|
|
115
|
+
paddingY: '3',
|
|
116
|
+
position: 'relative'
|
|
117
|
+
})), optionTransition, pseudoThickBorder]
|
|
118
|
+
}, "styledGridItem");
|
|
119
|
+
export const styleIndicator = style({
|
|
120
|
+
height: '26px',
|
|
121
|
+
width: '26px'
|
|
122
|
+
}, "styleIndicator");
|
|
123
|
+
export const styledCheckbox = recipe({
|
|
124
|
+
base: [odStyle({
|
|
125
|
+
alignItems: 'center',
|
|
126
|
+
background: {
|
|
127
|
+
initial: 'white',
|
|
128
|
+
focusVisible: 'gray300',
|
|
129
|
+
hover: 'gray300',
|
|
130
|
+
selected: 'gray900'
|
|
131
|
+
},
|
|
132
|
+
borderColor: {
|
|
133
|
+
initial: 'gray',
|
|
134
|
+
selected: 'dark'
|
|
135
|
+
},
|
|
136
|
+
borderRadius: '1',
|
|
137
|
+
borderStyle: 'solid',
|
|
138
|
+
borderWidth: '1',
|
|
139
|
+
color: {
|
|
140
|
+
initial: 'transparent',
|
|
141
|
+
focusVisible: 'white',
|
|
142
|
+
hover: 'white',
|
|
143
|
+
selected: 'white'
|
|
144
|
+
},
|
|
145
|
+
display: 'flex',
|
|
146
|
+
flexShrink: 0,
|
|
147
|
+
justifyContent: 'center',
|
|
148
|
+
size: '6'
|
|
149
|
+
}), optionTransition]
|
|
150
|
+
}, "styledCheckbox");
|
|
151
|
+
const pseudoRadio = style({
|
|
152
|
+
selectors: {
|
|
153
|
+
'&:after': {
|
|
154
|
+
borderRadius: 'inherit',
|
|
155
|
+
content: '',
|
|
156
|
+
display: 'block',
|
|
157
|
+
position: 'absolute',
|
|
158
|
+
transform: 'scale(0.475)',
|
|
159
|
+
width: '100%',
|
|
160
|
+
height: '100%',
|
|
161
|
+
left: 0,
|
|
162
|
+
top: 0
|
|
163
|
+
},
|
|
164
|
+
'&[data-hover]:after, &[data-focus-visible]:after': {
|
|
165
|
+
background: tokens.colours.gamut.gray200
|
|
166
|
+
},
|
|
167
|
+
'&[data-selected]:after': {
|
|
168
|
+
background: tokens.colours.gamut.white
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}, "pseudoRadio");
|
|
172
|
+
export const styledRadioButton = recipe({
|
|
173
|
+
base: [odStyle({
|
|
174
|
+
alignItems: 'center',
|
|
175
|
+
background: {
|
|
176
|
+
initial: 'white',
|
|
177
|
+
hover: 'gray300',
|
|
178
|
+
focusVisible: 'gray300',
|
|
179
|
+
selected: 'gray900'
|
|
180
|
+
},
|
|
181
|
+
borderColor: {
|
|
182
|
+
initial: 'gray',
|
|
183
|
+
selected: 'dark'
|
|
184
|
+
},
|
|
185
|
+
borderRadius: 'full',
|
|
186
|
+
borderStyle: 'solid',
|
|
187
|
+
borderWidth: '1',
|
|
188
|
+
position: 'relative',
|
|
189
|
+
size: '6'
|
|
190
|
+
}), pseudoRadio, optionTransition]
|
|
191
|
+
}, "styledRadioButton");
|
|
192
|
+
__vanilla_filescope__.endFileScope();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ListBoxProps } from 'react-aria-components';
|
|
3
|
+
import { type SelectionMode } from 'react-stately';
|
|
4
|
+
import type { WithTestId } from '../../types';
|
|
5
|
+
import { type IconEl } from '../Icon';
|
|
6
|
+
import { type StyledGridContainerProps } from './OptionGrid.css';
|
|
7
|
+
export interface OptionItem {
|
|
8
|
+
name: string;
|
|
9
|
+
label: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
icon?: IconEl;
|
|
12
|
+
description?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface OptionGridProps<T> extends Omit<ListBoxProps<T>, 'items'> {
|
|
15
|
+
label: string;
|
|
16
|
+
items: OptionItem[];
|
|
17
|
+
indicator?: 'none' | 'checkbox' | 'radio';
|
|
18
|
+
selectionMode?: SelectionMode;
|
|
19
|
+
columns?: StyledGridContainerProps['columns'];
|
|
20
|
+
}
|
|
21
|
+
export declare const OptionGrid: ({ className, columns, indicator, label, layout, selectionMode, testId, ...props }: WithTestId<OptionGridProps<OptionItem>>) => React.JSX.Element;
|
|
22
|
+
//# sourceMappingURL=OptionGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptionGrid.d.ts","sourceRoot":"","sources":["../../../lib/components/OptionGrid/OptionGrid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAIN,KAAK,YAAY,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAG5C,OAAO,EAMN,KAAK,wBAAwB,EAC7B,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IAIf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AACD,MAAM,WAAW,eAAe,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;IAIzE,KAAK,EAAE,MAAM,CAAC;IAId,KAAK,EAAE,UAAU,EAAE,CAAC;IAIpB,SAAS,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;IAI1C,aAAa,CAAC,EAAE,aAAa,CAAC;IAI9B,OAAO,CAAC,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAC;CAC9C;AAgBD,eAAO,MAAM,UAAU,sFASpB,WAAW,gBAAgB,UAAU,CAAC,CAAC,sBA6EzC,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
+
const _excluded = ["className", "columns", "indicator", "label", "layout", "selectionMode", "testId"];
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
import clsx from 'clsx';
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { ListBox, ListBoxItem, Text } from 'react-aria-components';
|
|
11
|
+
import { odStyle } from "../../styles/sprinkles.css.js";
|
|
12
|
+
import { dataAttrs } from "../../utils/dataAttrs.js";
|
|
13
|
+
import { Icon } from "../Icon/index.js";
|
|
14
|
+
import { IconTick } from "../OptionList/IconTick.js";
|
|
15
|
+
import { styledCheckbox, styledGridContainer, styledGridItem, styledRadioButton, styleIndicator } from "./OptionGrid.css.js";
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
+
export const OptionGrid = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
className,
|
|
20
|
+
columns,
|
|
21
|
+
indicator = 'checkbox',
|
|
22
|
+
label,
|
|
23
|
+
layout = 'grid',
|
|
24
|
+
selectionMode = 'multiple',
|
|
25
|
+
testId
|
|
26
|
+
} = _ref,
|
|
27
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
+
return _jsx(ListBox, _objectSpread(_objectSpread(_objectSpread({
|
|
29
|
+
"aria-label": label,
|
|
30
|
+
layout: layout,
|
|
31
|
+
selectionMode: selectionMode,
|
|
32
|
+
className: clsx([styledGridContainer({
|
|
33
|
+
columns
|
|
34
|
+
}), className])
|
|
35
|
+
}, dataAttrs({
|
|
36
|
+
'test-id': testId
|
|
37
|
+
})), props), {}, {
|
|
38
|
+
children: _ref2 => {
|
|
39
|
+
let {
|
|
40
|
+
description,
|
|
41
|
+
icon,
|
|
42
|
+
label,
|
|
43
|
+
name
|
|
44
|
+
} = _ref2;
|
|
45
|
+
return _jsx(ListBoxItem, {
|
|
46
|
+
className: styledGridItem(),
|
|
47
|
+
id: name,
|
|
48
|
+
textValue: label,
|
|
49
|
+
children: _ref3 => {
|
|
50
|
+
let {
|
|
51
|
+
isFocusVisible,
|
|
52
|
+
isHovered,
|
|
53
|
+
isSelected
|
|
54
|
+
} = _ref3;
|
|
55
|
+
const hasIndicator = indicator !== 'none';
|
|
56
|
+
const hasNoInteraction = !isFocusVisible && !isHovered && !isSelected;
|
|
57
|
+
const IndicatorIcon = () => {
|
|
58
|
+
if (icon && hasNoInteraction) return _jsx(Icon, {
|
|
59
|
+
icon: icon,
|
|
60
|
+
size: "100%"
|
|
61
|
+
});
|
|
62
|
+
const styledIndicator = indicator === 'radio' ? styledRadioButton : styledCheckbox;
|
|
63
|
+
return _jsx("div", _objectSpread(_objectSpread({
|
|
64
|
+
className: styledIndicator()
|
|
65
|
+
}, dataAttrs({
|
|
66
|
+
'focus-visible': isFocusVisible,
|
|
67
|
+
hover: isHovered,
|
|
68
|
+
selected: isSelected
|
|
69
|
+
})), {}, {
|
|
70
|
+
children: indicator === 'checkbox' && _jsx(IconTick, {})
|
|
71
|
+
}));
|
|
72
|
+
};
|
|
73
|
+
return _jsxs(_Fragment, {
|
|
74
|
+
children: [hasIndicator && _jsx("div", {
|
|
75
|
+
className: styleIndicator,
|
|
76
|
+
children: _jsx(IndicatorIcon, {})
|
|
77
|
+
}), _jsxs("div", {
|
|
78
|
+
children: [_jsx(Text, {
|
|
79
|
+
slot: "label",
|
|
80
|
+
elementType: "div",
|
|
81
|
+
className: odStyle({
|
|
82
|
+
fontSize: 'md'
|
|
83
|
+
}),
|
|
84
|
+
children: label
|
|
85
|
+
}), description && _jsx(Text, {
|
|
86
|
+
slot: "description",
|
|
87
|
+
elementType: "div",
|
|
88
|
+
className: odStyle({
|
|
89
|
+
fontSize: 'xs'
|
|
90
|
+
}),
|
|
91
|
+
children: description
|
|
92
|
+
})]
|
|
93
|
+
})]
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}));
|
|
99
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconTick.d.ts","sourceRoot":"","sources":["../../../lib/components/OptionList/IconTick.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,eAAO,MAAM,QAAQ,yBAgBpB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
export const IconTick = () => _jsx("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
width: "20",
|
|
8
|
+
height: "20",
|
|
9
|
+
viewBox: "0 0 20 20",
|
|
10
|
+
fill: "none",
|
|
11
|
+
"aria-hidden": true,
|
|
12
|
+
children: _jsx("path", {
|
|
13
|
+
fillRule: "evenodd",
|
|
14
|
+
clipRule: "evenodd",
|
|
15
|
+
d: "M15.2887 7.42963L8.48942 14.2289L4.71179 10.3673L6.08136 8.99777L8.48942 11.4801L13.9191 6.06006L15.2887 7.42963Z",
|
|
16
|
+
fill: "currentColor"
|
|
17
|
+
})
|
|
18
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const styleGroup: string;
|
|
2
|
+
export declare const styleGroupLabel: string;
|
|
3
|
+
export declare const styleDescription: string;
|
|
4
|
+
export declare const styledOptionItem: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
5
|
+
[x: string]: {
|
|
6
|
+
[x: string]: string | import("@vanilla-extract/css").ComplexStyleRule;
|
|
7
|
+
};
|
|
8
|
+
}>;
|
|
9
|
+
export declare const checkbox: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
10
|
+
[x: string]: {
|
|
11
|
+
[x: string]: string | import("@vanilla-extract/css").ComplexStyleRule;
|
|
12
|
+
};
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=OptionList.css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptionList.css.d.ts","sourceRoot":"","sources":["../../../lib/components/OptionList/OptionList.css.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,UAAU,QAA8B,CAAC;AAEtD,eAAO,MAAM,eAAe,QAI1B,CAAC;AAEH,eAAO,MAAM,gBAAgB,QAG3B,CAAC;AAoBH,eAAO,MAAM,gBAAgB;;;;EA4B3B,CAAC;AAoBH,eAAO,MAAM,QAAQ;;;;EAmBnB,CAAC"}
|