@autoguru/overdrive 4.4.5 → 4.5.2
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/DatePicker/DatePicker.css.d.ts +4 -0
- package/dist/components/DatePicker/DatePicker.css.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.css.js +36 -0
- package/dist/components/DatePicker/DatePicker.d.ts +12 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.js +26 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/index.d.ts.map +1 -0
- package/dist/components/DatePicker/index.js +1 -0
- package/dist/components/DatePicker/stories.js +75 -0
- package/dist/components/Toaster/Toast.css.d.ts.map +1 -1
- package/dist/components/Toaster/Toast.css.js +3 -2
- package/dist/components/Toaster/Toast.d.ts.map +1 -1
- package/dist/components/Toaster/Toast.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker.css.d.ts","sourceRoot":"","sources":["../../../lib/components/DatePicker/DatePicker.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,QAqBhB,CAAC;AACH,eAAO,MAAM,QAAQ,oCAOnB,CAAC;AAEH,eAAO,MAAM,OAAO,QAIlB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { style, styleVariants } from '@vanilla-extract/css';
|
|
2
|
+
export const input = style({
|
|
3
|
+
top: 0,
|
|
4
|
+
right: 0,
|
|
5
|
+
opacity: 0,
|
|
6
|
+
cursor: 'pointer',
|
|
7
|
+
display: 'grid',
|
|
8
|
+
gridTemplateColumns: 'auto 50px',
|
|
9
|
+
selectors: {
|
|
10
|
+
'&::-webkit-calendar-picker-indicator': {
|
|
11
|
+
background: 'transparent',
|
|
12
|
+
bottom: 0,
|
|
13
|
+
color: 'transparent',
|
|
14
|
+
cursor: 'pointer',
|
|
15
|
+
height: 'auto',
|
|
16
|
+
left: 0,
|
|
17
|
+
position: 'absolute',
|
|
18
|
+
right: 0,
|
|
19
|
+
top: 0,
|
|
20
|
+
width: 'auto',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
export const disabled = styleVariants({
|
|
25
|
+
default: {
|
|
26
|
+
cursor: 'not-allowed',
|
|
27
|
+
},
|
|
28
|
+
root: {
|
|
29
|
+
opacity: '0.3',
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
export const spinner = style({
|
|
33
|
+
top: '50%',
|
|
34
|
+
left: '50%',
|
|
35
|
+
transform: 'translate(-50%, -50%)',
|
|
36
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IconType } from '@autoguru/icons';
|
|
2
|
+
import { ComponentProps, FunctionComponent } from 'react';
|
|
3
|
+
import { Icon } from '../Icon';
|
|
4
|
+
export interface Props extends Partial<Pick<HTMLInputElement, 'min' | 'max' | 'value'>>, Pick<ComponentProps<typeof Icon>, 'size'> {
|
|
5
|
+
className?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
icon?: IconType;
|
|
8
|
+
isLoading?: boolean;
|
|
9
|
+
onChange(date: string): any;
|
|
10
|
+
}
|
|
11
|
+
export declare const DatePicker: FunctionComponent<Props>;
|
|
12
|
+
//# sourceMappingURL=DatePicker.d.ts.map
|
|
@@ -0,0 +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;AAIvE,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,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAE;CACvB;AAED,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,KAAK,CA2D/C,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CalendarIcon } from '@autoguru/icons';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { resolveResponsiveStyle } from '../../utils/resolveResponsiveProps';
|
|
5
|
+
import { Box, useBoxStyles } from '../Box';
|
|
6
|
+
import { Icon } from '../Icon';
|
|
7
|
+
import * as iconStyles from '../Icon/Icon.css';
|
|
8
|
+
import { ProgressSpinner } from '../ProgressSpinner';
|
|
9
|
+
import * as styles from './DatePicker.css';
|
|
10
|
+
export const DatePicker = ({ className = '', icon = CalendarIcon, size = 'medium', disabled = false, isLoading = false, onChange, ...inputProps }) => {
|
|
11
|
+
const onChangeEvent = (event) => {
|
|
12
|
+
if (typeof onChange === 'function') {
|
|
13
|
+
onChange(event.currentTarget.value);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
return (React.createElement(Box, { position: "relative", overflow: "hidden", className: clsx(resolveResponsiveStyle(size, iconStyles.size), className, {
|
|
17
|
+
[styles.disabled.default]: disabled,
|
|
18
|
+
[styles.disabled.root]: disabled,
|
|
19
|
+
}) },
|
|
20
|
+
React.createElement(Box, { position: "absolute", height: "full", width: "full", is: "input", disabled: disabled, onChange: onChangeEvent, className: clsx({
|
|
21
|
+
[styles.disabled.default]: disabled,
|
|
22
|
+
}, styles.input), type: "date", ...inputProps }),
|
|
23
|
+
isLoading ? (React.createElement(ProgressSpinner, { className: clsx(styles.spinner, useBoxStyles({
|
|
24
|
+
position: 'absolute',
|
|
25
|
+
})), size: size })) : (React.createElement(Icon, { icon: icon, size: size }))));
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/DatePicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DatePicker } from './DatePicker';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
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
|
+
|
|
9
|
+
import { AccountEditIcon, AlertCircleIcon, CalendarIcon, CarIcon, CarMultipleIcon, CheckIcon, CurrencyUsdIcon, MagnifyIcon, PlusIcon, StarIcon } from '@autoguru/icons';
|
|
10
|
+
import * as React from 'react';
|
|
11
|
+
import { DatePicker } from "./index.js";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
const iconOptions = {
|
|
14
|
+
MagnifyIcon,
|
|
15
|
+
CarIcon,
|
|
16
|
+
CarMultipleIcon,
|
|
17
|
+
CalendarIcon,
|
|
18
|
+
AccountEditIcon,
|
|
19
|
+
AlertCircleIcon,
|
|
20
|
+
CurrencyUsdIcon,
|
|
21
|
+
PlusIcon,
|
|
22
|
+
StarIcon,
|
|
23
|
+
CheckIcon
|
|
24
|
+
};
|
|
25
|
+
export default {
|
|
26
|
+
title: 'Components/DatePicker',
|
|
27
|
+
component: DatePicker,
|
|
28
|
+
decorators: [],
|
|
29
|
+
argTypes: {
|
|
30
|
+
icon: {
|
|
31
|
+
defaultValue: void 0,
|
|
32
|
+
description: 'Input field Icon',
|
|
33
|
+
options: iconOptions,
|
|
34
|
+
control: {
|
|
35
|
+
type: 'select'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
options: ['small', 'medium', 'large'],
|
|
40
|
+
control: {
|
|
41
|
+
type: 'select'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const Template = args => _jsx(DatePicker, _objectSpread({}, args));
|
|
48
|
+
|
|
49
|
+
const standardProps = {
|
|
50
|
+
isLoading: false,
|
|
51
|
+
disabled: false
|
|
52
|
+
};
|
|
53
|
+
export const standard = Template.bind(standardProps);
|
|
54
|
+
standard.args = standardProps;
|
|
55
|
+
const smallProps = {
|
|
56
|
+
size: 'small',
|
|
57
|
+
isLoading: false,
|
|
58
|
+
disabled: false
|
|
59
|
+
};
|
|
60
|
+
export const small = Template.bind(smallProps);
|
|
61
|
+
small.args = smallProps;
|
|
62
|
+
const mediumProps = {
|
|
63
|
+
size: 'medium',
|
|
64
|
+
isLoading: false,
|
|
65
|
+
disabled: false
|
|
66
|
+
};
|
|
67
|
+
export const medium = Template.bind(mediumProps);
|
|
68
|
+
medium.args = mediumProps;
|
|
69
|
+
const largeProps = {
|
|
70
|
+
size: 'large',
|
|
71
|
+
isLoading: false,
|
|
72
|
+
disabled: false
|
|
73
|
+
};
|
|
74
|
+
export const large = Template.bind(largeProps);
|
|
75
|
+
large.args = largeProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Toaster/Toast.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"Toast.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Toaster/Toast.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,QAOf,CAAC;AAEH,eAAO,MAAM,KAAK,QAEhB,CAAC"}
|
|
@@ -4,8 +4,9 @@ export const root = style({
|
|
|
4
4
|
zIndex: 3000,
|
|
5
5
|
justifyItems: 'center',
|
|
6
6
|
top: vars.space['3'],
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
left: '50vw',
|
|
8
|
+
transition: `translateX .400s ${vars.animation.easing.standard}`,
|
|
9
|
+
transform: 'translateX(-50%)',
|
|
9
10
|
});
|
|
10
11
|
export const alert = style({
|
|
11
12
|
pointerEvents: 'initial',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../lib/components/Toaster/Toast.tsx"],"names":[],"mappings":"AAEA,OAAO,EACN,cAAc,EAGd,SAAS,EAOT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAOjC,aAAK,WAAW,GAAG,SAAS,CAAC;AAC7B,aAAK,WAAW,GAAG,QAAQ,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AAWpE,UAAU,OACT,SAAQ,QAAQ,CACf,MAAM,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC,CACtE;IACD,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChD;
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../lib/components/Toaster/Toast.tsx"],"names":[],"mappings":"AAEA,OAAO,EACN,cAAc,EAGd,SAAS,EAOT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAOjC,aAAK,WAAW,GAAG,SAAS,CAAC;AAC7B,aAAK,WAAW,GAAG,QAAQ,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AAWpE,UAAU,OACT,SAAQ,QAAQ,CACf,MAAM,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC,CACtE;IACD,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChD;AAyED,eAAO,MAAM,aAAa;;iBAQzB,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,OAwE3B,CAAC"}
|
|
@@ -42,7 +42,7 @@ const InternalToastProvider = ({ children }) => {
|
|
|
42
42
|
return (React.createElement(ToastControllerContext.Provider, { value: addToast },
|
|
43
43
|
children,
|
|
44
44
|
React.createElement(Portal, null,
|
|
45
|
-
React.createElement(Box, {
|
|
45
|
+
React.createElement(Box, { display: "flex", position: "fixed", alignItems: "center", justifyContent: "center", className: styles.root },
|
|
46
46
|
React.createElement(Stack, { space: "2" }, toasts.map((item) => (React.createElement(Toast, { key: item.id, ...item, remove: removeToast }))))))));
|
|
47
47
|
};
|
|
48
48
|
export const ToastProvider = ({ children }) => {
|