@autoguru/overdrive 4.24.1 → 4.25.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/DropDown/DropDown.d.ts +23 -0
- package/dist/components/DropDown/DropDown.d.ts.map +1 -0
- package/dist/components/DropDown/DropDown.js +56 -0
- package/dist/components/DropDown/DropDownOption.css.d.ts +3 -0
- package/dist/components/DropDown/DropDownOption.css.d.ts.map +1 -0
- package/dist/components/DropDown/DropDownOption.css.js +26 -0
- package/dist/components/DropDown/DropDownOption.d.ts +12 -0
- package/dist/components/DropDown/DropDownOption.d.ts.map +1 -0
- package/dist/components/DropDown/DropDownOption.js +49 -0
- package/dist/components/DropDown/DropDownOptionsList.css.d.ts +3 -0
- package/dist/components/DropDown/DropDownOptionsList.css.d.ts.map +1 -0
- package/dist/components/DropDown/DropDownOptionsList.css.js +12 -0
- package/dist/components/DropDown/DropDownOptionsList.d.ts +8 -0
- package/dist/components/DropDown/DropDownOptionsList.d.ts.map +1 -0
- package/dist/components/DropDown/DropDownOptionsList.js +29 -0
- package/dist/components/DropDown/index.d.ts +3 -0
- package/dist/components/DropDown/index.d.ts.map +1 -0
- package/dist/components/DropDown/index.js +4 -0
- package/dist/components/DropDown/stories.js +79 -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/dist/utils/refs.d.ts +2 -0
- package/dist/utils/refs.d.ts.map +1 -0
- package/dist/utils/refs.js +12 -0
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IconType } from '@autoguru/icons';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
4
|
+
import { Button } from '../Button';
|
|
5
|
+
import { Flyout } from '../Flyout';
|
|
6
|
+
import { EPositionerAlignment } from '../Positioner';
|
|
7
|
+
type ButtonProps = Omit<ComponentProps<typeof Button>, 'is' | 'children'>;
|
|
8
|
+
type FlyoutProps = Pick<ComponentProps<typeof Flyout>, 'alignment'>;
|
|
9
|
+
export interface Props extends ButtonProps, FlyoutProps {
|
|
10
|
+
options: ReactNode[];
|
|
11
|
+
label: string;
|
|
12
|
+
icon?: IconType;
|
|
13
|
+
}
|
|
14
|
+
export declare const DropDown: ({ options, label, icon, alignment, onClick: incomingOnClick, ...buttonProps }: {
|
|
15
|
+
[x: string]: any;
|
|
16
|
+
options: any;
|
|
17
|
+
label: any;
|
|
18
|
+
icon?: React.ReactElement<React.SVGAttributes<SVGElement>, "svg"> | undefined;
|
|
19
|
+
alignment?: EPositionerAlignment | undefined;
|
|
20
|
+
onClick: any;
|
|
21
|
+
}) => JSX.Element;
|
|
22
|
+
export default DropDown;
|
|
23
|
+
//# sourceMappingURL=DropDown.d.ts.map
|
|
@@ -0,0 +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;AAC1E,KAAK,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC;AAEpE,MAAM,WAAW,KAAM,SAAQ,WAAW,EAAE,WAAW;IACtD,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,CAAC;CAChB;AAED,eAAO,MAAM,QAAQ;;;;;;;iBAmCpB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
+
const _excluded = ["options", "label", "icon", "alignment", "onClick"];
|
|
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
|
+
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
|
+
import { ChevronDownIcon } from '@autoguru/icons';
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import { useCallback, useRef, useState } from 'react';
|
|
11
|
+
import { Button } from "../Button/index.js";
|
|
12
|
+
import { Flyout } from "../Flyout/index.js";
|
|
13
|
+
import { Icon } from "../Icon/index.js";
|
|
14
|
+
import { useOutsideClick } from "../OutsideClick/index.js";
|
|
15
|
+
import { EPositionerAlignment } from "../Positioner/index.js";
|
|
16
|
+
import { DropDownOptionsList } from "./DropDownOptionsList.js";
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
|
+
export const DropDown = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
options,
|
|
23
|
+
label,
|
|
24
|
+
icon = ChevronDownIcon,
|
|
25
|
+
alignment = EPositionerAlignment.BOTTOM_LEFT,
|
|
26
|
+
onClick: incomingOnClick
|
|
27
|
+
} = _ref,
|
|
28
|
+
buttonProps = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
+
const buttonRef = useRef(null);
|
|
30
|
+
const menuRef = useRef(null);
|
|
31
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
32
|
+
const onMenuClick = useCallback(event => {
|
|
33
|
+
if (typeof incomingOnClick === 'function') incomingOnClick(event);
|
|
34
|
+
setIsOpen(!isOpen);
|
|
35
|
+
}, [isOpen, incomingOnClick]);
|
|
36
|
+
useOutsideClick([menuRef], () => setIsOpen(false));
|
|
37
|
+
return _jsxs(_Fragment, {
|
|
38
|
+
children: [_jsxs(Button, _objectSpread(_objectSpread({
|
|
39
|
+
ref: buttonRef,
|
|
40
|
+
onClick: onMenuClick
|
|
41
|
+
}, buttonProps), {}, {
|
|
42
|
+
children: [label, _jsx(Icon, {
|
|
43
|
+
icon: icon
|
|
44
|
+
})]
|
|
45
|
+
})), _jsx(Flyout, {
|
|
46
|
+
triggerRef: buttonRef,
|
|
47
|
+
isOpen: isOpen,
|
|
48
|
+
alignment: alignment,
|
|
49
|
+
children: _jsx(DropDownOptionsList, {
|
|
50
|
+
ref: menuRef,
|
|
51
|
+
options: options
|
|
52
|
+
})
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
export default DropDown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropDownOption.css.d.ts","sourceRoot":"","sources":["../../../lib/components/DropDown/DropDownOption.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,QAOf,CAAC;AAEH,eAAO,MAAM,MAAM,QAWjB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
|
+
__vanilla_filescope__.setFileScope("lib/components/DropDown/DropDownOption.css.ts", "@autoguru/overdrive");
|
|
5
|
+
import { style } from '@vanilla-extract/css';
|
|
6
|
+
import { themeContractVars as vars } from "../../themes/theme.css.js";
|
|
7
|
+
export const root = style({
|
|
8
|
+
transition: 'background-color 0.2s cubic-bezier(0, 0, 0.2, 1) 0s',
|
|
9
|
+
cursor: 'pointer',
|
|
10
|
+
':hover': {
|
|
11
|
+
backgroundColor: vars.colours.background.light
|
|
12
|
+
}
|
|
13
|
+
}, "root");
|
|
14
|
+
export const action = style({
|
|
15
|
+
transition: "opacity 0.3s ".concat(vars.animation.easing.standard, " 0.1s"),
|
|
16
|
+
willChange: 'transform',
|
|
17
|
+
pointerEvents: 'none',
|
|
18
|
+
opacity: 0,
|
|
19
|
+
selectors: {
|
|
20
|
+
["".concat(root, ":hover &")]: {
|
|
21
|
+
opacity: '1',
|
|
22
|
+
pointerEvents: 'initial'
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}, "action");
|
|
26
|
+
__vanilla_filescope__.endFileScope();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IconType } from '@autoguru/icons';
|
|
2
|
+
import { ComponentProps, FunctionComponent } from 'react';
|
|
3
|
+
import { Box } from '../Box';
|
|
4
|
+
import { Text } from '../Text';
|
|
5
|
+
interface Props extends Omit<ComponentProps<typeof Box>, 'paddingX' | 'paddingY'> {
|
|
6
|
+
icon?: IconType;
|
|
7
|
+
label: string;
|
|
8
|
+
iconColour?: ComponentProps<typeof Text>['colour'];
|
|
9
|
+
}
|
|
10
|
+
export declare const DropDownOption: FunctionComponent<Props>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=DropDownOption.d.ts.map
|
|
@@ -0,0 +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,CA+BnD,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
+
const _excluded = ["label", "icon", "className", "iconColour"];
|
|
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
|
+
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
|
+
import * as React from 'react';
|
|
9
|
+
import { Box } from "../Box/index.js";
|
|
10
|
+
import { Icon } from "../Icon/index.js";
|
|
11
|
+
import { Inline } from "../Inline/index.js";
|
|
12
|
+
import { Text, useTextStyles } from "../Text/index.js";
|
|
13
|
+
import * as styles from "./DropDownOption.css.js";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
export const DropDownOption = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
label,
|
|
19
|
+
icon,
|
|
20
|
+
className,
|
|
21
|
+
iconColour = 'dark'
|
|
22
|
+
} = _ref,
|
|
23
|
+
boxProps = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
+
const colourStyles = useTextStyles({
|
|
25
|
+
colour: iconColour
|
|
26
|
+
});
|
|
27
|
+
return _jsx(Box, _objectSpread(_objectSpread({
|
|
28
|
+
className: [styles.root, className]
|
|
29
|
+
}, boxProps), {}, {
|
|
30
|
+
paddingX: "3",
|
|
31
|
+
paddingY: "2",
|
|
32
|
+
children: _jsxs(Inline, {
|
|
33
|
+
noWrap: true,
|
|
34
|
+
space: "2",
|
|
35
|
+
width: "full",
|
|
36
|
+
alignX: "spaceBetween",
|
|
37
|
+
alignY: "center",
|
|
38
|
+
children: [_jsx(Text, {
|
|
39
|
+
is: "p",
|
|
40
|
+
size: "3",
|
|
41
|
+
children: label
|
|
42
|
+
}), icon ? _jsx(Icon, {
|
|
43
|
+
className: colourStyles,
|
|
44
|
+
size: "medium",
|
|
45
|
+
icon: icon
|
|
46
|
+
}) : null]
|
|
47
|
+
})
|
|
48
|
+
}));
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropDownOptionsList.css.d.ts","sourceRoot":"","sources":["../../../lib/components/DropDown/DropDownOptionsList.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,QAEf,CAAC;AACH,eAAO,MAAM,IAAI,QAEf,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/DropDown/DropDownOptionsList.css.ts", "@autoguru/overdrive");
|
|
5
|
+
import { style } from '@vanilla-extract/css';
|
|
6
|
+
export const root = style({
|
|
7
|
+
minWidth: 250
|
|
8
|
+
}, "root");
|
|
9
|
+
export const list = style({
|
|
10
|
+
maxHeight: 300
|
|
11
|
+
}, "list");
|
|
12
|
+
__vanilla_filescope__.endFileScope();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
interface Props {
|
|
4
|
+
options: ReactNode[];
|
|
5
|
+
}
|
|
6
|
+
export declare const DropDownOptionsList: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=DropDownOptionsList.d.ts.map
|
|
@@ -0,0 +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,EAAwB,SAAS,EAAE,MAAM,OAAO,CAAC;AAOxD,UAAU,KAAK;IACd,OAAO,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,eAAO,MAAM,mBAAmB,8EAY/B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { forwardRef, Fragment } from 'react';
|
|
5
|
+
import { Box } from "../Box/index.js";
|
|
6
|
+
import { Stack } from "../Stack/index.js";
|
|
7
|
+
import * as styles from "./DropDownOptionsList.css.js";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
export const DropDownOptionsList = forwardRef((_ref, ref) => {
|
|
10
|
+
let {
|
|
11
|
+
options
|
|
12
|
+
} = _ref;
|
|
13
|
+
return _jsx(Box, {
|
|
14
|
+
ref: ref,
|
|
15
|
+
className: styles.root,
|
|
16
|
+
children: _jsx(Box, {
|
|
17
|
+
className: styles.list,
|
|
18
|
+
overflow: "auto",
|
|
19
|
+
children: _jsx(Stack, {
|
|
20
|
+
dividers: true,
|
|
21
|
+
width: "full",
|
|
22
|
+
space: "none",
|
|
23
|
+
children: options.map((option, index) => _jsx(Fragment, {
|
|
24
|
+
children: option
|
|
25
|
+
}, index))
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/DropDown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 { DownloadIcon, TrashCanOutlineIcon } from '@autoguru/icons';
|
|
7
|
+
import { action } from '@storybook/addon-actions';
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import { Box } from "../Box/index.js";
|
|
10
|
+
import { DropDown, DropDownOption } from "./index.js";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
const onClick = action('onClick');
|
|
13
|
+
export default {
|
|
14
|
+
title: 'Components/DropDown',
|
|
15
|
+
component: DropDown,
|
|
16
|
+
decorators: [story => _jsx("div", {
|
|
17
|
+
style: {
|
|
18
|
+
display: 'grid',
|
|
19
|
+
gridGap: '12px',
|
|
20
|
+
gridAutoFlow: 'row dense'
|
|
21
|
+
},
|
|
22
|
+
children: story()
|
|
23
|
+
})],
|
|
24
|
+
argTypes: {
|
|
25
|
+
size: {
|
|
26
|
+
options: ['small', 'medium'],
|
|
27
|
+
defaultValue: 'medium',
|
|
28
|
+
control: {
|
|
29
|
+
type: 'select'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
variant: {
|
|
33
|
+
options: ['primary', 'secondary', 'danger', 'information', 'warning', 'danger'],
|
|
34
|
+
defaultValue: 'primary',
|
|
35
|
+
control: {
|
|
36
|
+
type: 'select'
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const Template = args => _jsx(Box, {
|
|
42
|
+
style: {
|
|
43
|
+
height: '100vh',
|
|
44
|
+
width: '100vw',
|
|
45
|
+
maxHeight: '350px'
|
|
46
|
+
},
|
|
47
|
+
display: "flex",
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
justifyContent: "center",
|
|
50
|
+
children: _jsx(DropDown, _objectSpread({}, args))
|
|
51
|
+
});
|
|
52
|
+
const option1 = _jsx(DropDownOption, {
|
|
53
|
+
label: "Download",
|
|
54
|
+
icon: DownloadIcon
|
|
55
|
+
});
|
|
56
|
+
const option2 = _jsx(DropDownOption, {
|
|
57
|
+
label: "Delete",
|
|
58
|
+
icon: TrashCanOutlineIcon
|
|
59
|
+
});
|
|
60
|
+
const standardProps = {
|
|
61
|
+
label: 'Attachment',
|
|
62
|
+
options: [option1, option2],
|
|
63
|
+
onClick
|
|
64
|
+
};
|
|
65
|
+
export const standard = Template.bind(standardProps);
|
|
66
|
+
standard.args = standardProps;
|
|
67
|
+
const primaryProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
68
|
+
variant: 'primary',
|
|
69
|
+
options: [option1, option2]
|
|
70
|
+
});
|
|
71
|
+
export const primary = Template.bind(primaryProps);
|
|
72
|
+
primary.args = primaryProps;
|
|
73
|
+
const withManyOptionsProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
74
|
+
options: Array.from({
|
|
75
|
+
length: 99
|
|
76
|
+
}).map((_, index) => index % 2 == 0 ? option1 : option2)
|
|
77
|
+
});
|
|
78
|
+
export const withManyOptions = Template.bind(withManyOptionsProps);
|
|
79
|
+
withManyOptions.args = withManyOptionsProps;
|
|
@@ -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;AAC1B,cAAc,QAAQ,CAAC;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CAAC;AAC3B,cAAc,WAAW,CAAC;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;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -63,4 +63,5 @@ export * from "./FillHeightBox/index.js";
|
|
|
63
63
|
export * from "./StickyBox/index.js";
|
|
64
64
|
export * from "./ScrollPane/index.js";
|
|
65
65
|
export * from "./IntentStripe/index.js";
|
|
66
|
-
export * from "./EditableText/index.js";
|
|
66
|
+
export * from "./EditableText/index.js";
|
|
67
|
+
export * from "./DropDown/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../lib/utils/refs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,eACR,MAAM,GAAG,CAAC,sBAKtB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export const mergeRefs = function () {
|
|
4
|
+
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
5
|
+
refs[_key] = arguments[_key];
|
|
6
|
+
}
|
|
7
|
+
return node => {
|
|
8
|
+
for (const ref of refs.filter(Boolean)) {
|
|
9
|
+
ref.current = node;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
};
|