@autoguru/overdrive 4.20.0 → 4.22.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/StickyBox/StickyBox.css.d.ts +1 -0
- package/dist/components/StickyBox/StickyBox.css.d.ts.map +1 -1
- package/dist/components/StickyBox/StickyBox.css.js +4 -0
- package/dist/components/StickyBox/StickyBox.d.ts +1 -0
- package/dist/components/StickyBox/StickyBox.d.ts.map +1 -1
- package/dist/components/StickyBox/StickyBox.js +7 -2
- package/dist/components/StickyBox/stories.js +7 -1
- package/dist/components/TextInput/stories.js +3 -1
- package/dist/components/private/InputBase/withEnhancedInput.css.d.ts.map +1 -1
- package/dist/components/private/InputBase/withEnhancedInput.css.js +0 -1
- package/dist/components/private/InputBase/withEnhancedInput.d.ts +2 -1
- package/dist/components/private/InputBase/withEnhancedInput.d.ts.map +1 -1
- package/dist/components/private/InputBase/withEnhancedInput.js +5 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyBox.css.d.ts","sourceRoot":"","sources":["../../../lib/components/StickyBox/StickyBox.css.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,IAAI,QAGf,CAAC;AAEH,eAAO,MAAM,OAAO,QAGlB,CAAC;AAEH,eAAO,MAAM,MAAM,QAEjB,CAAC;AAEH,eAAO,MAAM,MAAM,uBAQlB,CAAC;AAEF,eAAO,MAAM,GAAG,uBASf,CAAC;AAEF,eAAO,MAAM,MAAM,uBASlB,CAAC"}
|
|
1
|
+
{"version":3,"file":"StickyBox.css.d.ts","sourceRoot":"","sources":["../../../lib/components/StickyBox/StickyBox.css.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,IAAI,QAGf,CAAC;AACH,eAAO,MAAM,UAAU,QAGrB,CAAC;AAEH,eAAO,MAAM,OAAO,QAGlB,CAAC;AAEH,eAAO,MAAM,MAAM,QAEjB,CAAC;AAEH,eAAO,MAAM,MAAM,uBAQlB,CAAC;AAEF,eAAO,MAAM,GAAG,uBASf,CAAC;AAEF,eAAO,MAAM,MAAM,uBASlB,CAAC"}
|
|
@@ -9,6 +9,10 @@ export const root = style({
|
|
|
9
9
|
position: 'sticky',
|
|
10
10
|
transition: "box-shadow 0.3s ".concat(vars.animation.easing.standard, " 0s")
|
|
11
11
|
}, "root");
|
|
12
|
+
export const simpleRoot = style({
|
|
13
|
+
position: 'sticky',
|
|
14
|
+
height: 'fit-content'
|
|
15
|
+
}, "simpleRoot");
|
|
12
16
|
export const content = style({
|
|
13
17
|
height: 'fit-content',
|
|
14
18
|
transition: "transform 0.3s ".concat(vars.animation.easing.standard, " 0s")
|
|
@@ -4,6 +4,7 @@ interface Props extends ComponentProps<typeof Box> {
|
|
|
4
4
|
top?: 'none' | '1' | '2' | '3' | '5' | '7' | 'subHeader';
|
|
5
5
|
bottom?: 'none' | '1' | '2' | '3' | 'subHeader';
|
|
6
6
|
zIndex?: 0 | 1 | 2 | 3 | 99;
|
|
7
|
+
noPopShadow?: boolean;
|
|
7
8
|
className?: string;
|
|
8
9
|
}
|
|
9
10
|
export declare const StickyBox: FunctionComponent<Props>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyBox.d.ts","sourceRoot":"","sources":["../../../lib/components/StickyBox/StickyBox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAE/E,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAI7B,UAAU,KAAM,SAAQ,cAAc,CAAC,OAAO,GAAG,CAAC;IACjD,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,WAAW,CAAC;IACzD,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,WAAW,CAAC;IAChD,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,SAAS,EAAE,iBAAiB,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"StickyBox.d.ts","sourceRoot":"","sources":["../../../lib/components/StickyBox/StickyBox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAE/E,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAI7B,UAAU,KAAM,SAAQ,cAAc,CAAC,OAAO,GAAG,CAAC;IACjD,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,WAAW,CAAC;IACzD,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,WAAW,CAAC;IAChD,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,SAAS,EAAE,iBAAiB,CAAC,KAAK,CA6D9C,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 = ["top", "bottom", "zIndex", "className", "backgroundColour", "boxShadow", "children"];
|
|
5
|
+
const _excluded = ["top", "bottom", "noPopShadow", "zIndex", "className", "backgroundColour", "boxShadow", "children"];
|
|
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 clsx from 'clsx';
|
|
@@ -16,6 +16,7 @@ export const StickyBox = _ref => {
|
|
|
16
16
|
let {
|
|
17
17
|
top = 'none',
|
|
18
18
|
bottom = 'none',
|
|
19
|
+
noPopShadow = false,
|
|
19
20
|
zIndex = 2,
|
|
20
21
|
className = '',
|
|
21
22
|
backgroundColour,
|
|
@@ -38,7 +39,11 @@ export const StickyBox = _ref => {
|
|
|
38
39
|
});
|
|
39
40
|
return () => parentElement.removeEventListener('scroll', onScroll);
|
|
40
41
|
}, [(_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.parentElement]);
|
|
41
|
-
return _jsx(Box, _objectSpread(_objectSpread({
|
|
42
|
+
return noPopShadow ? _jsx(Box, _objectSpread(_objectSpread({
|
|
43
|
+
className: [className, styles.simpleRoot, styles.top[top], styles.zIndex[zIndex]]
|
|
44
|
+
}, rest), {}, {
|
|
45
|
+
children: children
|
|
46
|
+
})) : _jsx(Box, _objectSpread(_objectSpread({
|
|
42
47
|
ref: containerRef,
|
|
43
48
|
overflow: "hidden",
|
|
44
49
|
className: clsx(className, styles.root, styles.top[top], styles.zIndex[zIndex]),
|
|
@@ -61,4 +61,10 @@ const standardProps = {
|
|
|
61
61
|
top: 'none'
|
|
62
62
|
};
|
|
63
63
|
export const standard = Template.bind(standardProps);
|
|
64
|
-
standard.args = standardProps;
|
|
64
|
+
standard.args = standardProps;
|
|
65
|
+
const withNoPopShadowProps = {
|
|
66
|
+
top: 'none',
|
|
67
|
+
noPopShadow: true
|
|
68
|
+
};
|
|
69
|
+
export const withNoPopShadow = Template.bind(withNoPopShadowProps);
|
|
70
|
+
withNoPopShadow.args = withNoPopShadowProps;
|
|
@@ -6,6 +6,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
6
6
|
import { AccountEditIcon, AlertCircleIcon, CalendarIcon, CarIcon, CarMultipleIcon, CheckIcon, CurrencyUsdIcon, PlusIcon, StarIcon } from '@autoguru/icons';
|
|
7
7
|
import { action } from '@storybook/addon-actions';
|
|
8
8
|
import * as React from 'react';
|
|
9
|
+
import { boxArgTypes } from "../Box/argTypes.js";
|
|
9
10
|
import { TextInput } from "./index.js";
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
12
|
export default {
|
|
@@ -59,7 +60,8 @@ const argTypes = {
|
|
|
59
60
|
control: {
|
|
60
61
|
type: 'select'
|
|
61
62
|
}
|
|
62
|
-
}
|
|
63
|
+
},
|
|
64
|
+
backgroundColour: boxArgTypes['backgroundColour']
|
|
63
65
|
};
|
|
64
66
|
const Template = args => _jsx(TextInput, _objectSpread({}, args));
|
|
65
67
|
const sharedProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withEnhancedInput.css.d.ts","sourceRoot":"","sources":["../../../../lib/components/private/InputBase/withEnhancedInput.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK;;
|
|
1
|
+
{"version":3,"file":"withEnhancedInput.css.d.ts","sourceRoot":"","sources":["../../../../lib/components/private/InputBase/withEnhancedInput.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK;;CAoBjB,CAAC;AAIF,eAAO,MAAM,KAAK,4BAOhB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;CAe5B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;CAqD3B,CAAC;AAEF,eAAO,MAAM,QAAQ,QAKnB,CAAC;AAEH,eAAO,MAAM,UAAU,QAErB,CAAC;AACH,eAAO,MAAM,UAAU,QAErB,CAAC;AACH,eAAO,MAAM,QAAQ,oCAOnB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IconType } from '@autoguru/icons';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { AriaAttributes, ChangeEventHandler, ComponentProps, ComponentType, FocusEventHandler, KeyboardEventHandler, MouseEventHandler, MutableRefObject, ReactNode, Ref } from 'react';
|
|
4
|
+
import { Box } from '../../Box';
|
|
4
5
|
import { NotchedBase } from './NotchedBase';
|
|
5
6
|
import * as styles from './withEnhancedInput.css';
|
|
6
7
|
export interface EventHandlers<PrimitiveElementType> {
|
|
@@ -13,7 +14,7 @@ export interface EventHandlers<PrimitiveElementType> {
|
|
|
13
14
|
onMouseLeave?: MouseEventHandler<PrimitiveElementType>;
|
|
14
15
|
onReset?(): void;
|
|
15
16
|
}
|
|
16
|
-
export interface EnhanceInputPrimitiveProps extends AriaAttributes, Pick<ComponentProps<typeof NotchedBase>, 'notch' | 'placeholder' | 'attach' | 'borderMerged' | 'isFocused'> {
|
|
17
|
+
export interface EnhanceInputPrimitiveProps extends AriaAttributes, Pick<ComponentProps<typeof NotchedBase>, 'notch' | 'placeholder' | 'attach' | 'borderMerged' | 'isFocused'>, Pick<ComponentProps<typeof Box>, 'backgroundColour'> {
|
|
17
18
|
name: string;
|
|
18
19
|
id?: string;
|
|
19
20
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withEnhancedInput.d.ts","sourceRoot":"","sources":["../../../../lib/components/private/InputBase/withEnhancedInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACN,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,iBAAiB,EAEjB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,GAAG,EAGH,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"withEnhancedInput.d.ts","sourceRoot":"","sources":["../../../../lib/components/private/InputBase/withEnhancedInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACN,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,iBAAiB,EAEjB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,GAAG,EAGH,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,GAAG,EAAgB,MAAM,WAAW,CAAC;AAM9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,yBAAyB,CAAC;AAGlD,MAAM,WAAW,aAAa,CAAC,oBAAoB;IAClD,QAAQ,CAAC,EAAE,kBAAkB,CAAC,oBAAoB,CAAC,CAAC;IACpD,MAAM,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IACjD,OAAO,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAClD,SAAS,CAAC,EAAE,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAClD,YAAY,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IACvD,YAAY,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAEvD,OAAO,CAAC,IAAI,IAAI,CAAC;CACjB;AAGD,MAAM,WAAW,0BAChB,SAAQ,cAAc,EACrB,IAAI,CACH,cAAc,CAAC,OAAO,WAAW,CAAC,EAClC,OAAO,GAAG,aAAa,GAAG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CAAC,CAAC;KAC5C,CAAC;IACF,SAAS,CAAC,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACpD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACnB,GAAG,aAAa,GAChB,IAAI,CACH,cAAc,CAAC,OAAO,WAAW,CAAC,EAClC,QAAQ,GAAG,cAAc,GAAG,WAAW,CACvC,CAAC;AAEH,UAAU,oBAAoB,CAAC,SAAS,GAAG,MAAM;IAChD,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CAC5E;AAED,eAAO,MAAM,iBAAiB,sQAY1B,oBAAoB,+JA4PtB,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 = ["placeholder", "name", "id", "hintText", "disabled", "className", "isTouched", "isValid", "isLoading", "notch", "reserveHintSpace", "size", "value", "onChange", "onReset", "onMouseLeave", "onMouseEnter", "onBlur", "onFocus", "onKeyDown", "prefixIcon", "suffixIcon", "wrapperRef", "autoFocus", "attach", "borderMerged"];
|
|
5
|
+
const _excluded = ["placeholder", "name", "id", "hintText", "disabled", "className", "isTouched", "isValid", "isLoading", "notch", "reserveHintSpace", "size", "backgroundColour", "value", "onChange", "onReset", "onMouseLeave", "onMouseEnter", "onBlur", "onFocus", "onKeyDown", "prefixIcon", "suffixIcon", "wrapperRef", "autoFocus", "attach", "borderMerged"];
|
|
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 { invariant, wrapEvent } from '@autoguru/utilities';
|
|
@@ -43,6 +43,7 @@ export const withEnhancedInput = function (WrappingComponent) {
|
|
|
43
43
|
notch = true,
|
|
44
44
|
reserveHintSpace = false,
|
|
45
45
|
size = 'medium',
|
|
46
|
+
backgroundColour = 'transparent',
|
|
46
47
|
value: incomingValue = defaultValue || '',
|
|
47
48
|
onChange: incomingOnChange,
|
|
48
49
|
onReset,
|
|
@@ -74,9 +75,11 @@ export const withEnhancedInput = function (WrappingComponent) {
|
|
|
74
75
|
}, inputStateStyles);
|
|
75
76
|
const inputItselfClassName = clsx(useBoxStyles({
|
|
76
77
|
is: primitiveType === 'textarea' ? 'textarea' : 'input',
|
|
78
|
+
backgroundColour,
|
|
77
79
|
width: 'full',
|
|
78
80
|
position: 'relative',
|
|
79
|
-
display: 'flex'
|
|
81
|
+
display: 'flex',
|
|
82
|
+
borderRadius: '1'
|
|
80
83
|
}), styles.input.itself.root, styles.types[primitiveType], styles.inputItselfSize[size].root.any, styles.inputItselfSize[size].root[primitiveType], {
|
|
81
84
|
[styles.inputItselfSize[size].prefixed.any]: Boolean(prefixIcon),
|
|
82
85
|
[styles.inputItselfSize[size].prefixed[primitiveType]]: Boolean(prefixIcon),
|