@autoguru/overdrive 4.9.7 → 4.9.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.
@@ -2,7 +2,7 @@ import clsx from 'clsx';
2
2
  import * as React from 'react';
3
3
  import { forwardRef } from 'react';
4
4
  import { useBoxStyles } from './useBoxStyles';
5
- export const Box = forwardRef(({ is: Component = 'div', 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, opacity, className = '', alignItems, flexDirection, flexGrow, flexShrink, flexWrap, justifyContent, children, ...allOtherProps }, ref) => {
5
+ export const Box = forwardRef(({ is: Component = 'div', padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight, margin, marginX, marginY, marginTop, marginBottom, marginLeft, marginRight, display, width = 'none', height, position, overflow, userSelect, textAlign, pointerEvents, borderColour, borderColourX, borderColourY, borderColourTop, borderColourRight, borderColourBottom, borderColourLeft, borderWidth, borderWidthX, borderWidthY, borderWidthTop, borderWidthRight, borderWidthBottom, borderWidthLeft, boxShadow, borderRadius, backgroundColour, opacity, className = '', alignItems, flexDirection, flexGrow, flexShrink, flexWrap, justifyContent, children, ...allOtherProps }, ref) => {
6
6
  const cls = useBoxStyles({
7
7
  is: Component,
8
8
  alignItems,
@@ -1 +1 @@
1
- {"version":3,"file":"argTypes.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/argTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,CAWrD,CAAC;AAgCF,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC,CAoDrE,CAAC"}
1
+ {"version":3,"file":"argTypes.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/argTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,CAWrD,CAAC;AAgCF,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC,CA2DrE,CAAC"}
@@ -39,6 +39,7 @@ const borderRadiusOptions = [
39
39
  'full',
40
40
  'pill',
41
41
  ];
42
+ const widthOptions = ['full', 'none'];
42
43
  export const boxArgTypes = {
43
44
  boxShadow: {
44
45
  options: boxShadowOptions,
@@ -53,7 +54,7 @@ export const boxArgTypes = {
53
54
  },
54
55
  },
55
56
  alignItems: {
56
- options: ['flexStart', 'center', 'flexEnd'],
57
+ options: ['flexStart', 'center', 'flexEnd', 'stretch'],
57
58
  control: {
58
59
  type: 'select',
59
60
  },
@@ -82,6 +83,13 @@ export const boxArgTypes = {
82
83
  none: 'none',
83
84
  },
84
85
  },
86
+ width: {
87
+ options: widthOptions,
88
+ defaultValue: null,
89
+ control: {
90
+ type: 'select',
91
+ },
92
+ },
85
93
  ...scaledProps.reduce((argTypes, prop) => {
86
94
  argTypes[prop] = {
87
95
  options: scaleOptions,
@@ -28,7 +28,7 @@ export declare const border: {
28
28
  };
29
29
  export declare const borderRadius: Record<string | number, any>;
30
30
  export declare const backgroundColours: Record<"red900" | "red800" | "red700" | "red600" | "red500" | "red400" | "red300" | "red200" | "red100" | "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" | "white" | "transparent", string>;
31
- export declare const width: Record<"full", string>;
31
+ export declare const width: Record<"none" | "full", string>;
32
32
  export declare const height: Record<"full", string>;
33
33
  export declare const position: Record<"fixed" | "absolute" | "relative", string>;
34
34
  export declare const textAlign: Record<"left" | "right" | "center", string>;
@@ -1 +1 @@
1
- {"version":3,"file":"useBoxStyles.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/useBoxStyles.css.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,OAAO;;;;;CAKnB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;CAKlB,CAAC;AAEF,eAAO,MAAM,SAAS,8BAAmD,CAAC;AAE1E,eAAO,MAAM,MAAM;;;;;;;;;;;;;;CAwBlB,CAAC;AAEF,eAAO,MAAM,YAAY,8BAGxB,CAAC;AAEF,eAAO,MAAM,iBAAiB,ulBAQ7B,CAAC;AAEF,eAAO,MAAM,KAAK,wBAIhB,CAAC;AAEH,eAAO,MAAM,MAAM,wBAIjB,CAAC;AAEH,eAAO,MAAM,QAAQ,mDASpB,CAAC;AAEF,eAAO,MAAM,SAAS,6CASrB,CAAC;AAEF,eAAO,MAAM,QAAQ,0DAUpB,CAAC;AAEF,eAAO,MAAM,OAAO,kGAanB,CAAC;AAE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CAAC;AAEF,eAAO,MAAM,aAAa,wBAExB,CAAC"}
@@ -41,6 +41,9 @@ export const width = styleVariants({
41
41
  full: {
42
42
  width: '100%',
43
43
  },
44
+ none: {
45
+ width: void 0,
46
+ }
44
47
  });
45
48
  export const height = styleVariants({
46
49
  full: {
@@ -1,7 +1,7 @@
1
1
  import { FunctionComponent, ReactNode } from 'react';
2
2
  import type { BoxStyleProps } from '../Box';
3
3
  import * as styles from './Stack.css';
4
- export interface Props extends Pick<BoxStyleProps, 'is' | 'width'> {
4
+ export interface Props extends Pick<BoxStyleProps, 'is' | 'width' | 'alignItems'> {
5
5
  space?: keyof typeof styles.child.spaces;
6
6
  className?: string;
7
7
  dividers?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../../lib/components/Stack/Stack.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAI5C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,WAAW,KAAM,SAAQ,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,OAAO,CAAC;IACjE,KAAK,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,QAAQ,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CAClC;AAOD,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAsC1C,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../../lib/components/Stack/Stack.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAI5C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,WAAW,KAChB,SAAQ,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,OAAO,GAAG,YAAY,CAAC;IAC1D,KAAK,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,QAAQ,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CAClC;AAOD,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,KAAK,CA0C1C,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -8,7 +8,7 @@ const supportedListTypes = [
8
8
  'ul',
9
9
  'ol',
10
10
  ];
11
- export const Stack = ({ space = '2', children, is = 'div', width, dividers = false, className = '', }) => {
11
+ export const Stack = ({ space = '2', children, is = 'div', alignItems, width, dividers = false, className = '', }) => {
12
12
  const items = flattenChildren(children);
13
13
  if (items.length < 2) {
14
14
  return React.createElement(React.Fragment, null, items);
@@ -16,7 +16,7 @@ export const Stack = ({ space = '2', children, is = 'div', width, dividers = fal
16
16
  let listItem = 'div';
17
17
  if (typeof is === 'string')
18
18
  listItem = supportedListTypes.includes(is) ? 'li' : 'div';
19
- return (React.createElement(Box, { is: is, className: className, width: width }, Children.map(items, (child, idx) => (React.createElement(Box, { is: listItem, className: [
19
+ return (React.createElement(Box, { is: is, className: className, width: width }, Children.map(items, (child, idx) => (React.createElement(Box, { is: listItem, display: alignItems ? 'flex' : void 0, flexDirection: "column", alignItems: alignItems, className: [
20
20
  styles.child.default,
21
21
  dividers ? undefined : styles.child.spaces[space],
22
22
  ] },
@@ -7,6 +7,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
7
7
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
8
 
9
9
  import * as React from 'react';
10
+ import { boxArgTypes } from "../Box/argTypes.js";
10
11
  import { Text } from "../Text/index.js";
11
12
  import { Stack } from "./index.js";
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -23,7 +24,6 @@ const spacingOptions = {
23
24
  8: '8',
24
25
  9: '9'
25
26
  };
26
- const widthOptions = ['full', null];
27
27
  export default {
28
28
  title: 'Foundation/Layout/Stack',
29
29
  component: Stack,
@@ -35,13 +35,8 @@ export default {
35
35
  type: 'select'
36
36
  }
37
37
  },
38
- width: {
39
- options: widthOptions,
40
- defaultValue: null,
41
- control: {
42
- type: 'select'
43
- }
44
- }
38
+ width: boxArgTypes.width,
39
+ alignItems: boxArgTypes.alignItems
45
40
  }
46
41
  };
47
42
 
@@ -78,4 +73,14 @@ const withDividersProps = _objectSpread(_objectSpread({}, standardProps), {}, {
78
73
  });
79
74
 
80
75
  export const withDividers = Template.bind(withDividersProps);
81
- withDividers.args = withDividersProps;
76
+ withDividers.args = withDividersProps;
77
+
78
+ const withAlignmentProps = _objectSpread(_objectSpread({}, standardProps), {}, {
79
+ is: 'div',
80
+ dividers: true,
81
+ space: '3',
82
+ alignItems: 'center'
83
+ });
84
+
85
+ export const withAlignment = Template.bind(withAlignmentProps);
86
+ withAlignment.args = withAlignmentProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autoguru/overdrive",
3
- "version": "4.9.7",
3
+ "version": "4.9.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",
@@ -45,7 +45,7 @@
45
45
  "@types/react-dom": "^18.0.6",
46
46
  "clsx": "1.1.1",
47
47
  "colord": "2.9.2",
48
- "csstype": "3.1.0",
48
+ "csstype": "3.1.1",
49
49
  "deepmerge": "^4.2.2",
50
50
  "eslint-plugin-jest": "26.2.2",
51
51
  "react": "^18.1.0",