@autoguru/overdrive 4.4.5 → 4.5.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.
@@ -0,0 +1,3 @@
1
+ export declare const input: string;
2
+ export declare const disabled: string;
3
+ //# sourceMappingURL=DatePicker.css.d.ts.map
@@ -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,QAGnB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { style } 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 = style({
25
+ cursor: 'not-allowed',
26
+ opacity: '0.3',
27
+ });
@@ -0,0 +1,11 @@
1
+ import { IconType } from '@autoguru/icons';
2
+ import { ComponentProps, FunctionComponent } from 'react';
3
+ import { Icon } from '../Icon';
4
+ export interface Props extends Pick<HTMLInputElement, 'min' | 'max' | 'value'>, Pick<ComponentProps<typeof Icon>, 'size'> {
5
+ className?: string;
6
+ disabled?: boolean;
7
+ onChange(date: string): any;
8
+ icon?: IconType;
9
+ }
10
+ export declare const DatePicker: FunctionComponent<Props>;
11
+ //# 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;AAK/B,MAAM,WAAW,KAChB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,KAAK,GAAG,OAAO,CAAC,EACtD,IAAI,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,EAAE,MAAM,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAE;IAEvB,IAAI,CAAC,EAAE,QAAQ,CAAC;CAChB;AAED,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,KAAK,CAoC/C,CAAC"}
@@ -0,0 +1,18 @@
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 } from '../Box';
6
+ import { Icon } from '../Icon';
7
+ import * as iconStyles from '../Icon/Icon.css';
8
+ import * as styles from './DatePicker.css';
9
+ export const DatePicker = ({ className = '', icon = CalendarIcon, size = 'medium', disabled = false, onChange, ...inputProps }) => {
10
+ const onChangeEvent = (event) => {
11
+ if (typeof onChange === 'function') {
12
+ onChange(event.currentTarget.value);
13
+ }
14
+ };
15
+ return (React.createElement(Box, { position: "relative", overflow: "hidden", className: clsx(resolveResponsiveStyle(size, iconStyles.size), className, { [styles.disabled]: disabled }) },
16
+ React.createElement(Box, { position: "absolute", height: "full", width: "full", is: "input", disabled: disabled, onChange: onChangeEvent, className: clsx(styles.input, { [styles.disabled]: disabled }), type: "date", ...inputProps }),
17
+ React.createElement(Icon, { icon: icon, size: size })));
18
+ };
@@ -0,0 +1,2 @@
1
+ export { DatePicker } from './DatePicker';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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,51 @@
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
+ export const standard = Template.bind(standardProps);
51
+ standard.args = standardProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autoguru/overdrive",
3
- "version": "4.4.5",
3
+ "version": "4.5.0",
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",