@autoguru/overdrive 4.15.3 → 4.17.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/Alert/Alert.css.d.ts +0 -1
- package/dist/components/Alert/Alert.css.d.ts.map +1 -1
- package/dist/components/Alert/Alert.css.js +0 -8
- package/dist/components/Alert/Alert.d.ts +3 -4
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Alert/Alert.js +3 -3
- package/dist/components/DatePicker/DatePicker.css.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.css.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.css.js +15 -2
- package/dist/components/DatePicker/DatePicker.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +25 -12
- package/dist/components/DatePicker/stories.js +21 -2
- package/dist/components/IntentStripe/IntentStripe.css.d.ts +2 -0
- package/dist/components/IntentStripe/IntentStripe.css.d.ts.map +1 -0
- package/dist/components/IntentStripe/IntentStripe.css.js +12 -0
- package/dist/components/IntentStripe/IntentStripe.d.ts +10 -0
- package/dist/components/IntentStripe/IntentStripe.d.ts.map +1 -0
- package/dist/components/IntentStripe/IntentStripe.js +19 -0
- package/dist/components/IntentStripe/index.d.ts +2 -0
- package/dist/components/IntentStripe/index.d.ts.map +1 -0
- package/dist/components/IntentStripe/index.js +3 -0
- package/dist/components/IntentStripe/stories.js +76 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -1
- package/package.json +1 -1
- package/readme.md +7 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Alert/Alert.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Alert.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Alert/Alert.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,QAGpB,CAAC"}
|
|
@@ -3,14 +3,6 @@
|
|
|
3
3
|
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
4
|
__vanilla_filescope__.setFileScope("lib/components/Alert/Alert.css.ts", "@autoguru/overdrive");
|
|
5
5
|
import { style } from '@vanilla-extract/css';
|
|
6
|
-
import { themeContractVars as vars } from "../../themes/theme.css.js";
|
|
7
|
-
export const intentBox = style({
|
|
8
|
-
position: 'absolute',
|
|
9
|
-
top: 0,
|
|
10
|
-
left: 0,
|
|
11
|
-
width: vars.space['1'],
|
|
12
|
-
height: '100%'
|
|
13
|
-
}, "intentBox");
|
|
14
6
|
export const contained = style({
|
|
15
7
|
minWidth: '280px',
|
|
16
8
|
maxWidth: '640px'
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ComponentProps, FunctionComponent, ReactNode } from 'react';
|
|
2
|
-
import { backgroundColours } from '../Box/useBoxStyles.css';
|
|
3
2
|
import { Button } from '../Button';
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { IntentStripe } from '../IntentStripe';
|
|
4
|
+
type IntentStripeProps = ComponentProps<typeof IntentStripe>;
|
|
5
|
+
export interface Props extends IntentStripeProps {
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
className?: string;
|
|
8
|
-
intent?: Intent;
|
|
9
8
|
inline?: boolean;
|
|
10
9
|
dismissible?: boolean;
|
|
11
10
|
onRequestClose?: ComponentProps<typeof Button>['onClick'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../lib/components/Alert/Alert.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../lib/components/Alert/Alert.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAK/C,KAAK,iBAAiB,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC;AAG7D,MAAM,WAAW,KAAM,SAAQ,iBAAiB;IAC/C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,cAAc,CAAC,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;CAC1D;AASD,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAwE1C,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { Box, useBoxStyles } from "../Box/index.js";
|
|
|
7
7
|
import { Button } from "../Button/index.js";
|
|
8
8
|
import { Column, Columns } from "../Columns/index.js";
|
|
9
9
|
import { Icon } from "../Icon/index.js";
|
|
10
|
+
import { IntentStripe } from "../IntentStripe/index.js";
|
|
10
11
|
import { Text, useTextStyles } from "../Text/index.js";
|
|
11
12
|
import * as styles from "./Alert.css.js";
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -45,9 +46,8 @@ export const Alert = _ref => {
|
|
|
45
46
|
borderRadius: "1",
|
|
46
47
|
boxShadow: inline ? 'none' : '4',
|
|
47
48
|
padding: "2",
|
|
48
|
-
children: [_jsx(
|
|
49
|
-
|
|
50
|
-
backgroundColour: intent
|
|
49
|
+
children: [_jsx(IntentStripe, {
|
|
50
|
+
intent: intent
|
|
51
51
|
}), _jsxs(Columns, {
|
|
52
52
|
noWrap: true,
|
|
53
53
|
spaceX: "2",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.css.d.ts","sourceRoot":"","sources":["../../../lib/components/DatePicker/DatePicker.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DatePicker.css.d.ts","sourceRoot":"","sources":["../../../lib/components/DatePicker/DatePicker.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK,QAqBhB,CAAC;AAGH,eAAO,MAAM,QAAQ,yCAWnB,CAAC;AACH,eAAO,MAAM,QAAQ,oCAOnB,CAAC;AAEH,eAAO,MAAM,OAAO,QAIlB,CAAC"}
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
4
|
__vanilla_filescope__.setFileScope("lib/components/DatePicker/DatePicker.css.ts", "@autoguru/overdrive");
|
|
5
5
|
import { style, styleVariants } from '@vanilla-extract/css';
|
|
6
|
+
import { themeContractVars as vars } from "../../themes/theme.css.js";
|
|
6
7
|
export const input = style({
|
|
7
8
|
top: 0,
|
|
8
9
|
right: 0,
|
|
10
|
+
bottom: 0,
|
|
11
|
+
left: 0,
|
|
9
12
|
opacity: 0,
|
|
10
13
|
cursor: 'pointer',
|
|
11
|
-
display: 'grid',
|
|
12
|
-
gridTemplateColumns: 'auto 50px',
|
|
13
14
|
selectors: {
|
|
14
15
|
'&::-webkit-calendar-picker-indicator': {
|
|
15
16
|
background: 'transparent',
|
|
@@ -25,6 +26,18 @@ export const input = style({
|
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
}, "input");
|
|
29
|
+
export const contents = styleVariants({
|
|
30
|
+
default: {
|
|
31
|
+
display: 'grid',
|
|
32
|
+
gridTemplateColumns: 'auto',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
justifyContent: 'flex-start',
|
|
35
|
+
gridGap: vars.space['1']
|
|
36
|
+
},
|
|
37
|
+
withLabel: {
|
|
38
|
+
gridTemplateColumns: 'auto auto'
|
|
39
|
+
}
|
|
40
|
+
}, "contents");
|
|
28
41
|
export const disabled = styleVariants({
|
|
29
42
|
default: {
|
|
30
43
|
cursor: 'not-allowed'
|
|
@@ -2,10 +2,12 @@ import { IconType } from '@autoguru/icons';
|
|
|
2
2
|
import { ComponentProps, FunctionComponent } from 'react';
|
|
3
3
|
import { Icon } from '../Icon';
|
|
4
4
|
export interface Props extends Partial<Pick<HTMLInputElement, 'min' | 'max' | 'value'>>, Pick<ComponentProps<typeof Icon>, 'size'> {
|
|
5
|
+
size: 'small' | 'medium' | 'large';
|
|
5
6
|
className?: string;
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
icon?: IconType;
|
|
8
9
|
isLoading?: boolean;
|
|
10
|
+
valueLabel?: string;
|
|
9
11
|
onChange(date: string): any;
|
|
10
12
|
}
|
|
11
13
|
export declare const DatePicker: FunctionComponent<Props>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../lib/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGzD,OAAO,EAAe,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../lib/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGzD,OAAO,EAAe,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGvE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAM/B,MAAM,WAAW,KAChB,SAAQ,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,KAAK,GAAG,OAAO,CAAC,CAAC,EAC/D,IAAI,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,EAAE,MAAM,CAAC;IAC1C,IAAI,EAAE,OAAO,GAAC,QAAQ,GAAC,OAAO,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAE;CACvB;AAOD,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,KAAK,CAsE/C,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -2,20 +2,24 @@
|
|
|
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 = ["className", "icon", "size", "disabled", "isLoading", "onChange"];
|
|
5
|
+
const _excluded = ["className", "icon", "size", "disabled", "isLoading", "valueLabel", "onChange"];
|
|
6
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
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
|
import { CalendarIcon } from '@autoguru/icons';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import * as React from 'react';
|
|
11
|
-
import { resolveResponsiveStyle } from "../../utils/resolveResponsiveProps.js";
|
|
12
11
|
import { Box, useBoxStyles } from "../Box/index.js";
|
|
13
12
|
import { Icon } from "../Icon/index.js";
|
|
14
|
-
import * as iconStyles from "../Icon/Icon.css.js";
|
|
15
13
|
import { ProgressSpinner } from "../ProgressSpinner/index.js";
|
|
14
|
+
import { Text } from "../Text/index.js";
|
|
16
15
|
import * as styles from "./DatePicker.css.js";
|
|
17
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
const textSizeMap = {
|
|
19
|
+
small: '2',
|
|
20
|
+
medium: '3',
|
|
21
|
+
large: '5'
|
|
22
|
+
};
|
|
19
23
|
export const DatePicker = _ref => {
|
|
20
24
|
let {
|
|
21
25
|
className = '',
|
|
@@ -23,6 +27,7 @@ export const DatePicker = _ref => {
|
|
|
23
27
|
size = 'medium',
|
|
24
28
|
disabled = false,
|
|
25
29
|
isLoading = false,
|
|
30
|
+
valueLabel,
|
|
26
31
|
onChange
|
|
27
32
|
} = _ref,
|
|
28
33
|
inputProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -34,7 +39,7 @@ export const DatePicker = _ref => {
|
|
|
34
39
|
return _jsxs(Box, {
|
|
35
40
|
position: "relative",
|
|
36
41
|
overflow: "hidden",
|
|
37
|
-
className: clsx(
|
|
42
|
+
className: clsx(className, {
|
|
38
43
|
[styles.disabled.default]: disabled,
|
|
39
44
|
[styles.disabled.root]: disabled
|
|
40
45
|
}),
|
|
@@ -49,14 +54,22 @@ export const DatePicker = _ref => {
|
|
|
49
54
|
[styles.disabled.default]: disabled
|
|
50
55
|
}, styles.input),
|
|
51
56
|
type: "date"
|
|
52
|
-
}, inputProps)),
|
|
53
|
-
className: clsx(styles.
|
|
54
|
-
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
}, inputProps)), _jsxs(Box, {
|
|
58
|
+
className: clsx(styles.contents.default, {
|
|
59
|
+
[styles.contents.withLabel]: Boolean(valueLabel)
|
|
60
|
+
}),
|
|
61
|
+
children: [isLoading ? _jsx(ProgressSpinner, {
|
|
62
|
+
className: clsx(styles.spinner, useBoxStyles({
|
|
63
|
+
position: 'absolute'
|
|
64
|
+
})),
|
|
65
|
+
size: size
|
|
66
|
+
}) : _jsx(Icon, {
|
|
67
|
+
icon: icon,
|
|
68
|
+
size: size
|
|
69
|
+
}), valueLabel && _jsx(Text, {
|
|
70
|
+
size: textSizeMap[size],
|
|
71
|
+
children: valueLabel
|
|
72
|
+
})]
|
|
60
73
|
})]
|
|
61
74
|
});
|
|
62
75
|
};
|
|
@@ -5,6 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
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; }
|
|
6
6
|
import { AccountEditIcon, AlertCircleIcon, CalendarIcon, CarIcon, CarMultipleIcon, CheckIcon, CurrencyUsdIcon, MagnifyIcon, PlusIcon, StarIcon } from '@autoguru/icons';
|
|
7
7
|
import * as React from 'react';
|
|
8
|
+
import { Box } from "../Box/index.js";
|
|
8
9
|
import { DatePicker } from "./index.js";
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
const iconOptions = {
|
|
@@ -40,7 +41,10 @@ export default {
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
|
-
const Template = args => _jsx(
|
|
44
|
+
const Template = args => _jsx(Box, {
|
|
45
|
+
display: "flex",
|
|
46
|
+
children: _jsx(DatePicker, _objectSpread({}, args))
|
|
47
|
+
});
|
|
44
48
|
const standardProps = {
|
|
45
49
|
isLoading: false,
|
|
46
50
|
disabled: false
|
|
@@ -54,6 +58,11 @@ const smallProps = {
|
|
|
54
58
|
};
|
|
55
59
|
export const small = Template.bind(smallProps);
|
|
56
60
|
small.args = smallProps;
|
|
61
|
+
const smallWithLabelProps = _objectSpread(_objectSpread({}, smallProps), {}, {
|
|
62
|
+
valueLabel: 'Today'
|
|
63
|
+
});
|
|
64
|
+
export const smallWithLabel = Template.bind(smallWithLabelProps);
|
|
65
|
+
smallWithLabel.args = smallWithLabelProps;
|
|
57
66
|
const mediumProps = {
|
|
58
67
|
size: 'medium',
|
|
59
68
|
isLoading: false,
|
|
@@ -61,10 +70,20 @@ const mediumProps = {
|
|
|
61
70
|
};
|
|
62
71
|
export const medium = Template.bind(mediumProps);
|
|
63
72
|
medium.args = mediumProps;
|
|
73
|
+
const mediumWithLabelProps = _objectSpread(_objectSpread({}, mediumProps), {}, {
|
|
74
|
+
valueLabel: 'Today'
|
|
75
|
+
});
|
|
76
|
+
export const mediumWithLabel = Template.bind(mediumWithLabelProps);
|
|
77
|
+
mediumWithLabel.args = mediumWithLabelProps;
|
|
64
78
|
const largeProps = {
|
|
65
79
|
size: 'large',
|
|
66
80
|
isLoading: false,
|
|
67
81
|
disabled: false
|
|
68
82
|
};
|
|
69
83
|
export const large = Template.bind(largeProps);
|
|
70
|
-
large.args = largeProps;
|
|
84
|
+
large.args = largeProps;
|
|
85
|
+
const largeWithLabelProps = _objectSpread(_objectSpread({}, largeProps), {}, {
|
|
86
|
+
valueLabel: 'Today'
|
|
87
|
+
});
|
|
88
|
+
export const largeWithLabel = Template.bind(largeWithLabelProps);
|
|
89
|
+
largeWithLabel.args = largeWithLabelProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntentStripe.css.d.ts","sourceRoot":"","sources":["../../../lib/components/IntentStripe/IntentStripe.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,QAIpB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
|
+
__vanilla_filescope__.setFileScope("lib/components/IntentStripe/IntentStripe.css.ts", "@autoguru/overdrive");
|
|
5
|
+
import { style } from '@vanilla-extract/css';
|
|
6
|
+
import { themeContractVars as vars } from "../../themes/theme.css.js";
|
|
7
|
+
export const intentBox = style({
|
|
8
|
+
top: 0,
|
|
9
|
+
left: 0,
|
|
10
|
+
width: vars.space['1']
|
|
11
|
+
}, "intentBox");
|
|
12
|
+
__vanilla_filescope__.endFileScope();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { backgroundColours } from '../Box/useBoxStyles.css';
|
|
3
|
+
type Intent = keyof Pick<typeof backgroundColours, 'danger' | 'information' | 'success' | 'warning'>;
|
|
4
|
+
export interface Props {
|
|
5
|
+
className?: string;
|
|
6
|
+
intent: Intent;
|
|
7
|
+
}
|
|
8
|
+
export declare const IntentStripe: FunctionComponent<Props>;
|
|
9
|
+
export default IntentStripe;
|
|
10
|
+
//# sourceMappingURL=IntentStripe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntentStripe.d.ts","sourceRoot":"","sources":["../../../lib/components/IntentStripe/IntentStripe.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAI5D,KAAK,MAAM,GAAG,MAAM,IAAI,CACvB,OAAO,iBAAiB,EACxB,QAAQ,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,CAChD,CAAC;AAEF,MAAM,WAAW,KAAK;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,KAAK,CASjD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Box } from "../Box/index.js";
|
|
5
|
+
import * as styles from "./IntentStripe.css.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export const IntentStripe = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
className = '',
|
|
10
|
+
intent = 'success'
|
|
11
|
+
} = _ref;
|
|
12
|
+
return _jsx(Box, {
|
|
13
|
+
className: [className, styles.intentBox],
|
|
14
|
+
position: "absolute",
|
|
15
|
+
height: "full",
|
|
16
|
+
backgroundColour: intent
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
export default IntentStripe;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/IntentStripe/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
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; }
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { Box } from "../Box/index.js";
|
|
8
|
+
import { IntentStripe } from "./index.js";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Components/IntentStripe',
|
|
13
|
+
component: IntentStripe,
|
|
14
|
+
argTypes: {
|
|
15
|
+
intent: {
|
|
16
|
+
options: ['information', 'success', 'warning', 'danger'],
|
|
17
|
+
defaultValue: 'primary',
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const MyStripe = args => _jsx(Box, {
|
|
25
|
+
position: "relative",
|
|
26
|
+
width: "full",
|
|
27
|
+
padding: "6",
|
|
28
|
+
backgroundColour: "gray200",
|
|
29
|
+
borderRadius: "1",
|
|
30
|
+
overflow: "hidden",
|
|
31
|
+
children: _jsx(IntentStripe, _objectSpread({}, args))
|
|
32
|
+
});
|
|
33
|
+
const template = args => _jsx(Box, {
|
|
34
|
+
style: {
|
|
35
|
+
display: 'grid',
|
|
36
|
+
gridAutoFlow: 'row dense',
|
|
37
|
+
gridGap: '24px',
|
|
38
|
+
width: '100%'
|
|
39
|
+
},
|
|
40
|
+
children: _jsx(MyStripe, _objectSpread({}, args))
|
|
41
|
+
});
|
|
42
|
+
const templateAllIntents = args => _jsxs(Box, {
|
|
43
|
+
style: {
|
|
44
|
+
display: 'grid',
|
|
45
|
+
gridAutoFlow: 'row dense',
|
|
46
|
+
gridGap: '24px',
|
|
47
|
+
width: '100%'
|
|
48
|
+
},
|
|
49
|
+
children: [_jsx(MyStripe, _objectSpread(_objectSpread({}, args), {}, {
|
|
50
|
+
intent: "success"
|
|
51
|
+
})), _jsx(MyStripe, _objectSpread(_objectSpread({}, args), {}, {
|
|
52
|
+
intent: "warning"
|
|
53
|
+
})), _jsx(MyStripe, _objectSpread(_objectSpread({}, args), {}, {
|
|
54
|
+
intent: "danger"
|
|
55
|
+
})), _jsx(MyStripe, _objectSpread(_objectSpread({}, args), {}, {
|
|
56
|
+
intent: "information"
|
|
57
|
+
}))]
|
|
58
|
+
});
|
|
59
|
+
const standardProps = {
|
|
60
|
+
intent: void 0,
|
|
61
|
+
className: void 0
|
|
62
|
+
};
|
|
63
|
+
export const Standard = template.bind(standardProps);
|
|
64
|
+
Standard.args = standardProps;
|
|
65
|
+
export const StandardAllIntents = templateAllIntents.bind(standardProps);
|
|
66
|
+
StandardAllIntents.args = standardProps;
|
|
67
|
+
const inlineProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
68
|
+
inline: true
|
|
69
|
+
});
|
|
70
|
+
export const InlineAllIntents = templateAllIntents.bind(inlineProps);
|
|
71
|
+
InlineAllIntents.args = inlineProps;
|
|
72
|
+
const noneDismissibleProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
73
|
+
dismissible: false
|
|
74
|
+
});
|
|
75
|
+
export const NoneDismissibleAllIntents = templateAllIntents.bind(noneDismissibleProps);
|
|
76
|
+
NoneDismissibleAllIntents.args = noneDismissibleProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;A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;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -61,4 +61,5 @@ export * from "./SliderProgress/index.js";
|
|
|
61
61
|
export * from "./HorizontalAutoScroller/index.js";
|
|
62
62
|
export * from "./FillHeightBox/index.js";
|
|
63
63
|
export * from "./StickyBox/index.js";
|
|
64
|
-
export * from "./ScrollPane/index.js";
|
|
64
|
+
export * from "./ScrollPane/index.js";
|
|
65
|
+
export * from "./IntentStripe/index.js";
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -10,11 +10,12 @@
|
|
|
10
10
|
</div>
|
|
11
11
|
|
|
12
12
|
---
|
|
13
|
+
[Storybook playground](http://overdrive.autoguru.io/).
|
|
13
14
|
|
|
14
15
|
Overdrive is a product component library, and design system for AutoGuru. Built
|
|
15
16
|
with [React](https://github.com/facebook/react),
|
|
16
17
|
[TypeScript](https://github.com/Microsoft/typescript),
|
|
17
|
-
[Vanilla Extract](https://
|
|
18
|
+
[Vanilla Extract](https://github.com/vanilla-extract-css/vanilla-extract/), and
|
|
18
19
|
[Storybook](https://github.com/storybooks/storybook).
|
|
19
20
|
|
|
20
21
|
## Usage
|
|
@@ -45,6 +46,11 @@ yarn add @autoguru/overdrive \
|
|
|
45
46
|
</OverdriveProvider>
|
|
46
47
|
```
|
|
47
48
|
|
|
49
|
+
## Docs
|
|
50
|
+
|
|
51
|
+
Find more about Overdrive API and usages in our [docs](http://overdrive.autoguru.io/?path=/docs/components-actions--no-wrap).
|
|
52
|
+
|
|
53
|
+
|
|
48
54
|
## Thanks
|
|
49
55
|
|
|
50
56
|
[Chromatic](https://www.chromaticqa.com) for providing component screenshot
|