@autoguru/overdrive 4.25.0 → 4.25.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/DropDown/DropDown.d.ts +5 -4
- package/dist/components/DropDown/DropDown.d.ts.map +1 -1
- package/dist/components/DropDown/DropDown.js +3 -3
- package/dist/components/DropDown/DropDownOption.d.ts.map +1 -1
- package/dist/components/DropDown/DropDownOption.js +6 -2
- package/dist/components/DropDown/DropDownOptionsList.d.ts +1 -1
- package/dist/components/DropDown/DropDownOptionsList.d.ts.map +1 -1
- package/dist/components/DropDown/DropDownOptionsList.js +3 -5
- package/dist/components/DropDown/stories.js +38 -11
- package/package.json +1 -1
|
@@ -4,16 +4,17 @@ import { ComponentProps, ReactNode } from 'react';
|
|
|
4
4
|
import { Button } from '../Button';
|
|
5
5
|
import { Flyout } from '../Flyout';
|
|
6
6
|
import { EPositionerAlignment } from '../Positioner';
|
|
7
|
-
type ButtonProps = Omit<ComponentProps<typeof Button>, 'is' | 'children'>;
|
|
7
|
+
type ButtonProps = Omit<ComponentProps<typeof Button>, 'is' | 'children' | 'onClick'>;
|
|
8
8
|
type FlyoutProps = Pick<ComponentProps<typeof Flyout>, 'alignment'>;
|
|
9
9
|
export interface Props extends ButtonProps, FlyoutProps {
|
|
10
|
-
|
|
10
|
+
children: ReactNode;
|
|
11
11
|
label: string;
|
|
12
12
|
icon?: IconType;
|
|
13
|
+
onClick?: ComponentProps<typeof Button>['onClick'];
|
|
13
14
|
}
|
|
14
|
-
export declare const DropDown: ({ options, label, icon, alignment, onClick: incomingOnClick, ...buttonProps }: {
|
|
15
|
+
export declare const DropDown: ({ children: options, label, icon, alignment, onClick: incomingOnClick, ...buttonProps }: {
|
|
15
16
|
[x: string]: any;
|
|
16
|
-
|
|
17
|
+
children: any;
|
|
17
18
|
label: any;
|
|
18
19
|
icon?: React.ReactElement<React.SVGAttributes<SVGElement>, "svg"> | undefined;
|
|
19
20
|
alignment?: EPositionerAlignment | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropDown.d.ts","sourceRoot":"","sources":["../../../lib/components/DropDown/DropDown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACN,cAAc,EAEd,SAAS,EAIT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAIrD,KAAK,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,IAAI,GAAG,UAAU,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"DropDown.d.ts","sourceRoot":"","sources":["../../../lib/components/DropDown/DropDown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACN,cAAc,EAEd,SAAS,EAIT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAIrD,KAAK,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,IAAI,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC;AACtF,KAAK,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC;AAEpE,MAAM,WAAW,KAAM,SAAQ,WAAW,EAAE,WAAW;IACtD,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,QAAQ;;;;;;;iBAqCpB,CAAC;AAEF,eAAe,QAAQ,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 = ["
|
|
5
|
+
const _excluded = ["children", "label", "icon", "alignment", "onClick"];
|
|
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 { ChevronDownIcon } from '@autoguru/icons';
|
|
@@ -19,7 +19,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
19
19
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
20
|
export const DropDown = _ref => {
|
|
21
21
|
let {
|
|
22
|
-
options,
|
|
22
|
+
children: options,
|
|
23
23
|
label,
|
|
24
24
|
icon = ChevronDownIcon,
|
|
25
25
|
alignment = EPositionerAlignment.BOTTOM_LEFT,
|
|
@@ -48,7 +48,7 @@ export const DropDown = _ref => {
|
|
|
48
48
|
alignment: alignment,
|
|
49
49
|
children: _jsx(DropDownOptionsList, {
|
|
50
50
|
ref: menuRef,
|
|
51
|
-
|
|
51
|
+
children: options
|
|
52
52
|
})
|
|
53
53
|
})]
|
|
54
54
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropDownOption.d.ts","sourceRoot":"","sources":["../../../lib/components/DropDown/DropDownOption.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1D,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAG7B,OAAO,EAAE,IAAI,EAAiB,MAAM,SAAS,CAAC;AAI9C,UAAU,KACT,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACjE,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"DropDownOption.d.ts","sourceRoot":"","sources":["../../../lib/components/DropDown/DropDownOption.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1D,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAG7B,OAAO,EAAE,IAAI,EAAiB,MAAM,SAAS,CAAC;AAI9C,UAAU,KACT,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACjE,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,KAAK,CAmCnD,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 = ["label", "icon", "className", "iconColour"];
|
|
5
|
+
const _excluded = ["label", "icon", "className", "display", "iconColour", "is"];
|
|
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 * as React from 'react';
|
|
@@ -18,7 +18,9 @@ export const DropDownOption = _ref => {
|
|
|
18
18
|
label,
|
|
19
19
|
icon,
|
|
20
20
|
className,
|
|
21
|
-
|
|
21
|
+
display = 'flex',
|
|
22
|
+
iconColour = 'dark',
|
|
23
|
+
is = 'button'
|
|
22
24
|
} = _ref,
|
|
23
25
|
boxProps = _objectWithoutProperties(_ref, _excluded);
|
|
24
26
|
const colourStyles = useTextStyles({
|
|
@@ -27,8 +29,10 @@ export const DropDownOption = _ref => {
|
|
|
27
29
|
return _jsx(Box, _objectSpread(_objectSpread({
|
|
28
30
|
className: [styles.root, className]
|
|
29
31
|
}, boxProps), {}, {
|
|
32
|
+
display: display,
|
|
30
33
|
paddingX: "3",
|
|
31
34
|
paddingY: "2",
|
|
35
|
+
is: is,
|
|
32
36
|
children: _jsxs(Inline, {
|
|
33
37
|
noWrap: true,
|
|
34
38
|
space: "2",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
interface Props {
|
|
4
|
-
|
|
4
|
+
children: ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export declare const DropDownOptionsList: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropDownOptionsList.d.ts","sourceRoot":"","sources":["../../../lib/components/DropDown/DropDownOptionsList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,
|
|
1
|
+
{"version":3,"file":"DropDownOptionsList.d.ts","sourceRoot":"","sources":["../../../lib/components/DropDown/DropDownOptionsList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AAO9C,UAAU,KAAK;IACd,QAAQ,EAAE,SAAS,CAAC;CACpB;AAED,eAAO,MAAM,mBAAmB,8EAU/B,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { forwardRef
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
5
|
import { Box } from "../Box/index.js";
|
|
6
6
|
import { Stack } from "../Stack/index.js";
|
|
7
7
|
import * as styles from "./DropDownOptionsList.css.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
export const DropDownOptionsList = forwardRef((_ref, ref) => {
|
|
10
10
|
let {
|
|
11
|
-
|
|
11
|
+
children
|
|
12
12
|
} = _ref;
|
|
13
13
|
return _jsx(Box, {
|
|
14
14
|
ref: ref,
|
|
@@ -20,9 +20,7 @@ export const DropDownOptionsList = forwardRef((_ref, ref) => {
|
|
|
20
20
|
dividers: true,
|
|
21
21
|
width: "full",
|
|
22
22
|
space: "none",
|
|
23
|
-
children:
|
|
24
|
-
children: option
|
|
25
|
-
}, index))
|
|
23
|
+
children: children
|
|
26
24
|
})
|
|
27
25
|
})
|
|
28
26
|
});
|
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
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
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 { DownloadIcon, TrashCanOutlineIcon } from '@autoguru/icons';
|
|
6
|
+
import { DownloadIcon, SettingsIcon, TrashCanOutlineIcon } from '@autoguru/icons';
|
|
7
7
|
import { action } from '@storybook/addon-actions';
|
|
8
8
|
import * as React from 'react';
|
|
9
|
+
import { Fragment } from 'react';
|
|
9
10
|
import { Box } from "../Box/index.js";
|
|
10
11
|
import { DropDown, DropDownOption } from "./index.js";
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
15
|
const onClick = action('onClick');
|
|
13
16
|
export default {
|
|
14
17
|
title: 'Components/DropDown',
|
|
@@ -59,21 +62,45 @@ const option2 = _jsx(DropDownOption, {
|
|
|
59
62
|
});
|
|
60
63
|
const standardProps = {
|
|
61
64
|
label: 'Attachment',
|
|
62
|
-
|
|
65
|
+
children: _jsxs(_Fragment, {
|
|
66
|
+
children: [option1, option2]
|
|
67
|
+
}),
|
|
63
68
|
onClick
|
|
64
69
|
};
|
|
65
|
-
export const
|
|
66
|
-
|
|
67
|
-
const
|
|
70
|
+
export const primary = Template.bind(standardProps);
|
|
71
|
+
primary.args = standardProps;
|
|
72
|
+
const secondaryProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
73
|
+
variant: 'secondary'
|
|
74
|
+
});
|
|
75
|
+
export const secondary = Template.bind(secondaryProps);
|
|
76
|
+
secondary.args = secondaryProps;
|
|
77
|
+
const minimalPrimaryProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
68
78
|
variant: 'primary',
|
|
69
|
-
|
|
79
|
+
minimal: true
|
|
80
|
+
});
|
|
81
|
+
export const minimalPrimary = Template.bind(minimalPrimaryProps);
|
|
82
|
+
minimalPrimary.args = minimalPrimaryProps;
|
|
83
|
+
const roundedSecondaryProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
84
|
+
variant: 'secondary',
|
|
85
|
+
rounded: true
|
|
86
|
+
});
|
|
87
|
+
export const roundedSecondary = Template.bind(roundedSecondaryProps);
|
|
88
|
+
roundedSecondary.args = roundedSecondaryProps;
|
|
89
|
+
const withCustomIconProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
90
|
+
variant: 'secondary',
|
|
91
|
+
minimal: true,
|
|
92
|
+
icon: SettingsIcon
|
|
70
93
|
});
|
|
71
|
-
export const
|
|
72
|
-
|
|
94
|
+
export const withCustomIcon = Template.bind(withCustomIconProps);
|
|
95
|
+
withCustomIcon.args = withCustomIconProps;
|
|
73
96
|
const withManyOptionsProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
97
|
+
children: _jsx(_Fragment, {
|
|
98
|
+
children: Array.from({
|
|
99
|
+
length: 99
|
|
100
|
+
}).map((_, index) => _jsx(Fragment, {
|
|
101
|
+
children: index % 2 == 0 ? option1 : option2
|
|
102
|
+
}, index))
|
|
103
|
+
})
|
|
77
104
|
});
|
|
78
105
|
export const withManyOptions = Template.bind(withManyOptionsProps);
|
|
79
106
|
withManyOptions.args = withManyOptionsProps;
|