@launchpad-ui/dropdown 0.6.146 → 0.6.147
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/index.es.js +83 -100
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +108 -103
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
@@ -1,110 +1,93 @@
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
2
1
|
import { Popover } from "@launchpad-ui/popover";
|
3
2
|
import { mergeRefs } from "@react-aria/utils";
|
4
3
|
import { cx } from "classix";
|
5
|
-
import {
|
4
|
+
import { Children, cloneElement, forwardRef, useEffect, useRef, useState } from "react";
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
6
6
|
import { Button } from "@launchpad-ui/button";
|
7
7
|
import { Icon } from "@launchpad-ui/icons";
|
8
|
+
/**
|
9
|
+
* @deprecated use `Menu` from `@launchpad-ui/components` instead
|
10
|
+
*
|
11
|
+
* https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs
|
12
|
+
*/
|
8
13
|
const Dropdown = (props) => {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
const parseChildren = () => {
|
69
|
-
const [targetChild, contentChild] = Children.toArray(children);
|
70
|
-
return {
|
71
|
-
target: targetChild,
|
72
|
-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
73
|
-
content: contentChild
|
74
|
-
};
|
75
|
-
};
|
76
|
-
const popoverTargetClasses = cx("Dropdown-target", targetClassName);
|
77
|
-
const popoverClasses = cx("Dropdown", popoverClassName);
|
78
|
-
return /* @__PURE__ */ jsxs(
|
79
|
-
Popover,
|
80
|
-
{
|
81
|
-
isOpen,
|
82
|
-
placement,
|
83
|
-
onInteraction: onInteraction || handlePopoverInteraction,
|
84
|
-
restrictHeight: false,
|
85
|
-
disabled,
|
86
|
-
targetClassName: popoverTargetClasses,
|
87
|
-
popoverClassName: popoverClasses,
|
88
|
-
"data-test-id": testId,
|
89
|
-
...rest,
|
90
|
-
children: [
|
91
|
-
renderTrigger(),
|
92
|
-
renderContent()
|
93
|
-
]
|
94
|
-
}
|
95
|
-
);
|
14
|
+
const { placement, disabled, targetClassName, popoverClassName, isOpen: isOpenProp, onInteraction, onSelect, onStateChange, children, "data-test-id": testId = "dropdown",...rest } = props;
|
15
|
+
const triggerRef = useRef(null);
|
16
|
+
const [isOpen, setIsOpen] = useState(isOpenProp ?? false);
|
17
|
+
const [hasOpened, setHasOpened] = useState(isOpen);
|
18
|
+
useEffect(() => {
|
19
|
+
if (isOpenProp !== void 0) setIsOpen(isOpenProp);
|
20
|
+
}, [isOpenProp]);
|
21
|
+
useEffect(() => {
|
22
|
+
if (hasOpened && isOpen === false) setTimeout(() => {
|
23
|
+
const current = triggerRef.current;
|
24
|
+
if (!current) return;
|
25
|
+
const hasModal = current.closest?.(".has-overlay");
|
26
|
+
!hasModal && current.focus?.();
|
27
|
+
});
|
28
|
+
}, [isOpen, hasOpened]);
|
29
|
+
useEffect(() => {
|
30
|
+
setHasOpened(isOpen);
|
31
|
+
onStateChange?.({ isOpen });
|
32
|
+
}, [isOpen]);
|
33
|
+
const renderTrigger = () => {
|
34
|
+
const { target } = parseChildren();
|
35
|
+
return /* @__PURE__ */ cloneElement(target, {
|
36
|
+
"aria-haspopup": true,
|
37
|
+
"aria-expanded": !!isOpen,
|
38
|
+
ref: target.ref ? mergeRefs(target.ref, triggerRef) : triggerRef,
|
39
|
+
isopen: isOpen?.toString()
|
40
|
+
});
|
41
|
+
};
|
42
|
+
const renderContent = () => {
|
43
|
+
return /* @__PURE__ */ cloneElement(parseChildren().content, { onSelect: handleSelect });
|
44
|
+
};
|
45
|
+
const handleSelect = (item) => {
|
46
|
+
setIsOpen(false);
|
47
|
+
onSelect?.(item, { isOpen: false });
|
48
|
+
};
|
49
|
+
const handlePopoverInteraction = (nextIsOpen) => {
|
50
|
+
setIsOpen(nextIsOpen);
|
51
|
+
};
|
52
|
+
const parseChildren = () => {
|
53
|
+
const [targetChild, contentChild] = Children.toArray(children);
|
54
|
+
return {
|
55
|
+
target: targetChild,
|
56
|
+
content: contentChild
|
57
|
+
};
|
58
|
+
};
|
59
|
+
const popoverTargetClasses = cx("Dropdown-target", targetClassName);
|
60
|
+
const popoverClasses = cx("Dropdown", popoverClassName);
|
61
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
62
|
+
isOpen,
|
63
|
+
placement,
|
64
|
+
onInteraction: onInteraction || handlePopoverInteraction,
|
65
|
+
restrictHeight: false,
|
66
|
+
disabled,
|
67
|
+
targetClassName: popoverTargetClasses,
|
68
|
+
popoverClassName: popoverClasses,
|
69
|
+
"data-test-id": testId,
|
70
|
+
...rest,
|
71
|
+
children: [renderTrigger(), renderContent()]
|
72
|
+
});
|
96
73
|
};
|
97
74
|
const DropdownButton = /* @__PURE__ */ forwardRef((props, ref) => {
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
75
|
+
const { children, hideCaret, "data-test-id": testId = "dropdown-button",...rest } = props;
|
76
|
+
return /* @__PURE__ */ jsxs(Button, {
|
77
|
+
...rest,
|
78
|
+
"data-test-id": testId,
|
79
|
+
ref,
|
80
|
+
children: [
|
81
|
+
children,
|
82
|
+
" ",
|
83
|
+
!hideCaret && /* @__PURE__ */ jsx(Icon, {
|
84
|
+
name: "chevron-down",
|
85
|
+
size: "small"
|
86
|
+
})
|
87
|
+
]
|
88
|
+
});
|
104
89
|
});
|
105
90
|
DropdownButton.displayName = "DropdownButton";
|
106
|
-
export {
|
107
|
-
|
108
|
-
|
109
|
-
};
|
110
|
-
//# sourceMappingURL=index.es.js.map
|
91
|
+
export { Dropdown, DropdownButton };
|
92
|
+
|
93
|
+
//# sourceMappingURL=index.es.js.map
|
package/dist/index.es.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/Dropdown.tsx","../src/DropdownButton.tsx"],"sourcesContent":["import type { PopoverProps } from '@launchpad-ui/popover';\nimport type { AriaAttributes, ForwardedRef, FunctionComponentElement, ReactElement } from 'react';\n\nimport { Popover } from '@launchpad-ui/popover';\nimport { mergeRefs } from '@react-aria/utils';\nimport { cx } from 'classix';\nimport { Children, cloneElement, useEffect, useRef, useState } from 'react';\n\ntype DropdownState = {\n\tisOpen?: boolean;\n};\n\ntype DropdownProps<T extends string | object | number> = PopoverProps & {\n\tonSelect?: (item: T, stateChanges: DropdownState) => void;\n\tonStateChange?: (state: DropdownState) => void;\n};\n\n/**\n * @deprecated use `Menu` from `@launchpad-ui/components` instead\n *\n * https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs\n */\nconst Dropdown = <T extends string | object | number>(props: DropdownProps<T>) => {\n\tconst {\n\t\tplacement,\n\t\tdisabled,\n\t\ttargetClassName,\n\t\tpopoverClassName,\n\t\tisOpen: isOpenProp,\n\t\tonInteraction,\n\t\tonSelect,\n\t\tonStateChange,\n\t\tchildren,\n\t\t'data-test-id': testId = 'dropdown',\n\t\t...rest\n\t} = props;\n\n\tconst triggerRef = useRef<HTMLElement | null>(null);\n\tconst [isOpen, setIsOpen] = useState(isOpenProp ?? false);\n\tconst [hasOpened, setHasOpened] = useState(isOpen);\n\n\tuseEffect(() => {\n\t\tif (isOpenProp !== undefined) {\n\t\t\tsetIsOpen(isOpenProp);\n\t\t}\n\t}, [isOpenProp]);\n\n\tuseEffect(() => {\n\t\t// Focus the button upon closing for convenient tabbing\n\t\tif (hasOpened && isOpen === false) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst current = triggerRef.current;\n\t\t\t\tif (!current) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If a dropdown menu item triggers a modal, we do not want to focus the trigger. Instead\n\t\t\t\t// we let the modal components control their own focus.\n\t\t\t\t// Note that this is not ideal since closing the modal will not cause the dropdown trigger\n\t\t\t\t// to regain focus.\n\t\t\t\tconst hasModal = current.closest?.('.has-overlay');\n\n\t\t\t\t!hasModal && current.focus?.();\n\t\t\t});\n\t\t}\n\t}, [isOpen, hasOpened]);\n\n\t// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n\tuseEffect(() => {\n\t\tsetHasOpened(isOpen);\n\t\tonStateChange?.({ isOpen });\n\t}, [isOpen]);\n\n\tconst renderTrigger = () => {\n\t\tconst { target } = parseChildren();\n\t\treturn cloneElement(target, {\n\t\t\t'aria-haspopup': true,\n\t\t\t'aria-expanded': !!isOpen,\n\t\t\tref: target.ref ? mergeRefs(target.ref, triggerRef) : triggerRef,\n\t\t\tisopen: isOpen?.toString(),\n\t\t});\n\t};\n\n\tconst renderContent = () => {\n\t\treturn cloneElement(parseChildren().content, {\n\t\t\tonSelect: handleSelect,\n\t\t});\n\t};\n\n\tconst handleSelect = (item: T) => {\n\t\tsetIsOpen(false);\n\t\tonSelect?.(item, { isOpen: false });\n\t};\n\n\tconst handlePopoverInteraction = (nextIsOpen: boolean) => {\n\t\tsetIsOpen(nextIsOpen);\n\t};\n\n\tconst parseChildren = () => {\n\t\tconst [targetChild, contentChild] = Children.toArray(children);\n\t\treturn {\n\t\t\ttarget: targetChild as FunctionComponentElement<\n\t\t\t\tAriaAttributes & { ref: ForwardedRef<HTMLElement | undefined>; isopen: string }\n\t\t\t>,\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: <explanation>\n\t\t\tcontent: contentChild as ReactElement<any>,\n\t\t};\n\t};\n\n\tconst popoverTargetClasses = cx('Dropdown-target', targetClassName);\n\tconst popoverClasses = cx('Dropdown', popoverClassName);\n\n\treturn (\n\t\t<Popover\n\t\t\tisOpen={isOpen}\n\t\t\tplacement={placement}\n\t\t\tonInteraction={onInteraction || handlePopoverInteraction}\n\t\t\trestrictHeight={false}\n\t\t\tdisabled={disabled}\n\t\t\ttargetClassName={popoverTargetClasses}\n\t\t\tpopoverClassName={popoverClasses}\n\t\t\tdata-test-id={testId}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{renderTrigger()}\n\t\t\t{renderContent()}\n\t\t</Popover>\n\t);\n};\n\nexport { Dropdown };\nexport type { DropdownProps };\n","import type { ButtonProps } from '@launchpad-ui/button';\n\nimport { Button } from '@launchpad-ui/button';\nimport { Icon } from '@launchpad-ui/icons';\nimport { forwardRef } from 'react';\n\ntype DropdownButtonProps = ButtonProps & {\n\thideCaret?: boolean;\n};\n\nconst DropdownButton = forwardRef<HTMLButtonElement, DropdownButtonProps>((props, ref) => {\n\tconst { children, hideCaret, 'data-test-id': testId = 'dropdown-button', ...rest } = props;\n\n\treturn (\n\t\t<Button {...rest} data-test-id={testId} ref={ref}>\n\t\t\t{children} {!hideCaret && <Icon name=\"chevron-down\" size=\"small\" />}\n\t\t</Button>\n\t);\n});\n\nDropdownButton.displayName = 'DropdownButton';\n\nexport { DropdownButton };\nexport type { DropdownButtonProps };\n"],"
|
1
|
+
{"version":3,"file":"index.es.js","names":["props: DropdownProps<T>","item: T","nextIsOpen: boolean"],"sources":["../src/Dropdown.tsx","../src/DropdownButton.tsx"],"sourcesContent":["import type { PopoverProps } from '@launchpad-ui/popover';\nimport type { AriaAttributes, ForwardedRef, FunctionComponentElement, ReactElement } from 'react';\n\nimport { Popover } from '@launchpad-ui/popover';\nimport { mergeRefs } from '@react-aria/utils';\nimport { cx } from 'classix';\nimport { Children, cloneElement, useEffect, useRef, useState } from 'react';\n\ntype DropdownState = {\n\tisOpen?: boolean;\n};\n\ntype DropdownProps<T extends string | object | number> = PopoverProps & {\n\tonSelect?: (item: T, stateChanges: DropdownState) => void;\n\tonStateChange?: (state: DropdownState) => void;\n};\n\n/**\n * @deprecated use `Menu` from `@launchpad-ui/components` instead\n *\n * https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs\n */\nconst Dropdown = <T extends string | object | number>(props: DropdownProps<T>) => {\n\tconst {\n\t\tplacement,\n\t\tdisabled,\n\t\ttargetClassName,\n\t\tpopoverClassName,\n\t\tisOpen: isOpenProp,\n\t\tonInteraction,\n\t\tonSelect,\n\t\tonStateChange,\n\t\tchildren,\n\t\t'data-test-id': testId = 'dropdown',\n\t\t...rest\n\t} = props;\n\n\tconst triggerRef = useRef<HTMLElement | null>(null);\n\tconst [isOpen, setIsOpen] = useState(isOpenProp ?? false);\n\tconst [hasOpened, setHasOpened] = useState(isOpen);\n\n\tuseEffect(() => {\n\t\tif (isOpenProp !== undefined) {\n\t\t\tsetIsOpen(isOpenProp);\n\t\t}\n\t}, [isOpenProp]);\n\n\tuseEffect(() => {\n\t\t// Focus the button upon closing for convenient tabbing\n\t\tif (hasOpened && isOpen === false) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst current = triggerRef.current;\n\t\t\t\tif (!current) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If a dropdown menu item triggers a modal, we do not want to focus the trigger. Instead\n\t\t\t\t// we let the modal components control their own focus.\n\t\t\t\t// Note that this is not ideal since closing the modal will not cause the dropdown trigger\n\t\t\t\t// to regain focus.\n\t\t\t\tconst hasModal = current.closest?.('.has-overlay');\n\n\t\t\t\t!hasModal && current.focus?.();\n\t\t\t});\n\t\t}\n\t}, [isOpen, hasOpened]);\n\n\t// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n\tuseEffect(() => {\n\t\tsetHasOpened(isOpen);\n\t\tonStateChange?.({ isOpen });\n\t}, [isOpen]);\n\n\tconst renderTrigger = () => {\n\t\tconst { target } = parseChildren();\n\t\treturn cloneElement(target, {\n\t\t\t'aria-haspopup': true,\n\t\t\t'aria-expanded': !!isOpen,\n\t\t\tref: target.ref ? mergeRefs(target.ref, triggerRef) : triggerRef,\n\t\t\tisopen: isOpen?.toString(),\n\t\t});\n\t};\n\n\tconst renderContent = () => {\n\t\treturn cloneElement(parseChildren().content, {\n\t\t\tonSelect: handleSelect,\n\t\t});\n\t};\n\n\tconst handleSelect = (item: T) => {\n\t\tsetIsOpen(false);\n\t\tonSelect?.(item, { isOpen: false });\n\t};\n\n\tconst handlePopoverInteraction = (nextIsOpen: boolean) => {\n\t\tsetIsOpen(nextIsOpen);\n\t};\n\n\tconst parseChildren = () => {\n\t\tconst [targetChild, contentChild] = Children.toArray(children);\n\t\treturn {\n\t\t\ttarget: targetChild as FunctionComponentElement<\n\t\t\t\tAriaAttributes & { ref: ForwardedRef<HTMLElement | undefined>; isopen: string }\n\t\t\t>,\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: <explanation>\n\t\t\tcontent: contentChild as ReactElement<any>,\n\t\t};\n\t};\n\n\tconst popoverTargetClasses = cx('Dropdown-target', targetClassName);\n\tconst popoverClasses = cx('Dropdown', popoverClassName);\n\n\treturn (\n\t\t<Popover\n\t\t\tisOpen={isOpen}\n\t\t\tplacement={placement}\n\t\t\tonInteraction={onInteraction || handlePopoverInteraction}\n\t\t\trestrictHeight={false}\n\t\t\tdisabled={disabled}\n\t\t\ttargetClassName={popoverTargetClasses}\n\t\t\tpopoverClassName={popoverClasses}\n\t\t\tdata-test-id={testId}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{renderTrigger()}\n\t\t\t{renderContent()}\n\t\t</Popover>\n\t);\n};\n\nexport { Dropdown };\nexport type { DropdownProps };\n","import type { ButtonProps } from '@launchpad-ui/button';\n\nimport { Button } from '@launchpad-ui/button';\nimport { Icon } from '@launchpad-ui/icons';\nimport { forwardRef } from 'react';\n\ntype DropdownButtonProps = ButtonProps & {\n\thideCaret?: boolean;\n};\n\nconst DropdownButton = forwardRef<HTMLButtonElement, DropdownButtonProps>((props, ref) => {\n\tconst { children, hideCaret, 'data-test-id': testId = 'dropdown-button', ...rest } = props;\n\n\treturn (\n\t\t<Button {...rest} data-test-id={testId} ref={ref}>\n\t\t\t{children} {!hideCaret && <Icon name=\"chevron-down\" size=\"small\" />}\n\t\t</Button>\n\t);\n});\n\nDropdownButton.displayName = 'DropdownButton';\n\nexport { DropdownButton };\nexport type { DropdownButtonProps };\n"],"mappings":";;;;;;;;;;;;AAsBA,MAAM,WAAW,CAAqCA,UAA4B;CACjF,MAAM,EACL,WACA,UACA,iBACA,kBACA,QAAQ,YACR,eACA,UACA,eACA,UACA,gBAAgB,SAAS,WACzB,GAAG,MACH,GAAG;CAEJ,MAAM,aAAa,OAA2B,KAAK;CACnD,MAAM,CAAC,QAAQ,UAAU,GAAG,SAAS,cAAc,MAAM;CACzD,MAAM,CAAC,WAAW,aAAa,GAAG,SAAS,OAAO;AAElD,WAAU,MAAM;AACf,MAAI,oBAAA,EACH,WAAU,WAAW;CAEtB,GAAE,CAAC,UAAW,EAAC;AAEhB,WAAU,MAAM;AAEf,MAAI,aAAa,WAAW,MAC3B,YAAW,MAAM;GAChB,MAAM,UAAU,WAAW;AAC3B,QAAK,QACJ;GAOD,MAAM,WAAW,QAAQ,UAAU,eAAe;AAElD,IAAC,YAAY,QAAQ,SAAS;EAC9B,EAAC;CAEH,GAAE,CAAC,QAAQ,SAAU,EAAC;AAGvB,WAAU,MAAM;AACf,eAAa,OAAO;AACpB,kBAAgB,EAAE,OAAQ,EAAC;CAC3B,GAAE,CAAC,MAAO,EAAC;CAEZ,MAAM,gBAAgB,MAAM;EAC3B,MAAM,EAAE,QAAQ,GAAG,eAAe;AAClC,yBAAO,aAAa,QAAQ;GAC3B,iBAAiB;GACjB,mBAAmB;GACnB,KAAK,OAAO,MAAM,UAAU,OAAO,KAAK,WAAW,GAAG;GACtD,QAAQ,QAAQ,UAAA;EAChB,EAAC;CACF;CAED,MAAM,gBAAgB,MAAM;AAC3B,yBAAO,aAAa,eAAe,CAAC,SAAS,EAC5C,UAAU,aACV,EAAC;CACF;CAED,MAAM,eAAe,CAACC,SAAY;AACjC,YAAU,MAAM;AAChB,aAAW,MAAM,EAAE,QAAQ,MAAO,EAAC;CACnC;CAED,MAAM,2BAA2B,CAACC,eAAwB;AACzD,YAAU,WAAW;CACrB;CAED,MAAM,gBAAgB,MAAM;EAC3B,MAAM,CAAC,aAAa,aAAa,GAAG,SAAS,QAAQ,SAAS;AAC9D,SAAO;GACN,QAAQ;GAIR,SAAS;EACT;CACD;CAED,MAAM,uBAAuB,GAAG,mBAAmB,gBAAgB;CACnE,MAAM,iBAAiB,GAAG,YAAY,iBAAiB;AAEvD,wBACC,KAAC,SAAA;EACQ;EACG;EACX,eAAe,iBAAiB;EAChC,gBAAgB;EACN;EACV,iBAAiB;EACjB,kBAAkB;EAClB,gBAAc;EACd,GAAI;aAEH,eAAe,EACf,eAAe;GACP;AAEX;ACtHD,MAAM,iCAAiB,WAAmD,CAAC,OAAO,QAAQ;CACzF,MAAM,EAAE,UAAU,WAAW,gBAAgB,SAAS,kBAAmB,GAAG,MAAM,GAAG;AAErF,wBACC,KAAC,QAAA;EAAO,GAAI;EAAM,gBAAc;EAAa;;GAC3C;GAAS;IAAG,6BAAa,IAAC,MAAA;IAAK,MAAK;IAAe,MAAK;;;GACjD;AAEV,EAAC;AAEF,eAAe,cAAc"}
|
package/dist/index.js
CHANGED
@@ -1,110 +1,115 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
10
|
+
key = keys[i];
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
14
|
+
});
|
15
|
+
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
19
|
+
value: mod,
|
20
|
+
enumerable: true
|
21
|
+
}) : target, mod));
|
22
|
+
const __launchpad_ui_popover = __toESM(require("@launchpad-ui/popover"));
|
23
|
+
const __react_aria_utils = __toESM(require("@react-aria/utils"));
|
24
|
+
const classix = __toESM(require("classix"));
|
25
|
+
const react = __toESM(require("react"));
|
26
|
+
const react_jsx_runtime = __toESM(require("react/jsx-runtime"));
|
27
|
+
const __launchpad_ui_button = __toESM(require("@launchpad-ui/button"));
|
28
|
+
const __launchpad_ui_icons = __toESM(require("@launchpad-ui/icons"));
|
29
|
+
/**
|
30
|
+
* @deprecated use `Menu` from `@launchpad-ui/components` instead
|
31
|
+
*
|
32
|
+
* https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs
|
33
|
+
*/
|
10
34
|
const Dropdown = (props) => {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
const parseChildren = () => {
|
71
|
-
const [targetChild, contentChild] = react.Children.toArray(children);
|
72
|
-
return {
|
73
|
-
target: targetChild,
|
74
|
-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
75
|
-
content: contentChild
|
76
|
-
};
|
77
|
-
};
|
78
|
-
const popoverTargetClasses = classix.cx("Dropdown-target", targetClassName);
|
79
|
-
const popoverClasses = classix.cx("Dropdown", popoverClassName);
|
80
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
81
|
-
popover.Popover,
|
82
|
-
{
|
83
|
-
isOpen,
|
84
|
-
placement,
|
85
|
-
onInteraction: onInteraction || handlePopoverInteraction,
|
86
|
-
restrictHeight: false,
|
87
|
-
disabled,
|
88
|
-
targetClassName: popoverTargetClasses,
|
89
|
-
popoverClassName: popoverClasses,
|
90
|
-
"data-test-id": testId,
|
91
|
-
...rest,
|
92
|
-
children: [
|
93
|
-
renderTrigger(),
|
94
|
-
renderContent()
|
95
|
-
]
|
96
|
-
}
|
97
|
-
);
|
35
|
+
const { placement, disabled, targetClassName, popoverClassName, isOpen: isOpenProp, onInteraction, onSelect, onStateChange, children, "data-test-id": testId = "dropdown",...rest } = props;
|
36
|
+
const triggerRef = (0, react.useRef)(null);
|
37
|
+
const [isOpen, setIsOpen] = (0, react.useState)(isOpenProp ?? false);
|
38
|
+
const [hasOpened, setHasOpened] = (0, react.useState)(isOpen);
|
39
|
+
(0, react.useEffect)(() => {
|
40
|
+
if (isOpenProp !== void 0) setIsOpen(isOpenProp);
|
41
|
+
}, [isOpenProp]);
|
42
|
+
(0, react.useEffect)(() => {
|
43
|
+
if (hasOpened && isOpen === false) setTimeout(() => {
|
44
|
+
const current = triggerRef.current;
|
45
|
+
if (!current) return;
|
46
|
+
const hasModal = current.closest?.(".has-overlay");
|
47
|
+
!hasModal && current.focus?.();
|
48
|
+
});
|
49
|
+
}, [isOpen, hasOpened]);
|
50
|
+
(0, react.useEffect)(() => {
|
51
|
+
setHasOpened(isOpen);
|
52
|
+
onStateChange?.({ isOpen });
|
53
|
+
}, [isOpen]);
|
54
|
+
const renderTrigger = () => {
|
55
|
+
const { target } = parseChildren();
|
56
|
+
return /* @__PURE__ */ (0, react.cloneElement)(target, {
|
57
|
+
"aria-haspopup": true,
|
58
|
+
"aria-expanded": !!isOpen,
|
59
|
+
ref: target.ref ? (0, __react_aria_utils.mergeRefs)(target.ref, triggerRef) : triggerRef,
|
60
|
+
isopen: isOpen?.toString()
|
61
|
+
});
|
62
|
+
};
|
63
|
+
const renderContent = () => {
|
64
|
+
return /* @__PURE__ */ (0, react.cloneElement)(parseChildren().content, { onSelect: handleSelect });
|
65
|
+
};
|
66
|
+
const handleSelect = (item) => {
|
67
|
+
setIsOpen(false);
|
68
|
+
onSelect?.(item, { isOpen: false });
|
69
|
+
};
|
70
|
+
const handlePopoverInteraction = (nextIsOpen) => {
|
71
|
+
setIsOpen(nextIsOpen);
|
72
|
+
};
|
73
|
+
const parseChildren = () => {
|
74
|
+
const [targetChild, contentChild] = react.Children.toArray(children);
|
75
|
+
return {
|
76
|
+
target: targetChild,
|
77
|
+
content: contentChild
|
78
|
+
};
|
79
|
+
};
|
80
|
+
const popoverTargetClasses = (0, classix.cx)("Dropdown-target", targetClassName);
|
81
|
+
const popoverClasses = (0, classix.cx)("Dropdown", popoverClassName);
|
82
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__launchpad_ui_popover.Popover, {
|
83
|
+
isOpen,
|
84
|
+
placement,
|
85
|
+
onInteraction: onInteraction || handlePopoverInteraction,
|
86
|
+
restrictHeight: false,
|
87
|
+
disabled,
|
88
|
+
targetClassName: popoverTargetClasses,
|
89
|
+
popoverClassName: popoverClasses,
|
90
|
+
"data-test-id": testId,
|
91
|
+
...rest,
|
92
|
+
children: [renderTrigger(), renderContent()]
|
93
|
+
});
|
98
94
|
};
|
99
|
-
const DropdownButton = /* @__PURE__ */ react.forwardRef((props, ref) => {
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
95
|
+
const DropdownButton = /* @__PURE__ */ (0, react.forwardRef)((props, ref) => {
|
96
|
+
const { children, hideCaret, "data-test-id": testId = "dropdown-button",...rest } = props;
|
97
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__launchpad_ui_button.Button, {
|
98
|
+
...rest,
|
99
|
+
"data-test-id": testId,
|
100
|
+
ref,
|
101
|
+
children: [
|
102
|
+
children,
|
103
|
+
" ",
|
104
|
+
!hideCaret && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__launchpad_ui_icons.Icon, {
|
105
|
+
name: "chevron-down",
|
106
|
+
size: "small"
|
107
|
+
})
|
108
|
+
]
|
109
|
+
});
|
106
110
|
});
|
107
111
|
DropdownButton.displayName = "DropdownButton";
|
108
112
|
exports.Dropdown = Dropdown;
|
109
113
|
exports.DropdownButton = DropdownButton;
|
110
|
-
|
114
|
+
|
115
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/Dropdown.tsx","../src/DropdownButton.tsx"],"sourcesContent":["import type { PopoverProps } from '@launchpad-ui/popover';\nimport type { AriaAttributes, ForwardedRef, FunctionComponentElement, ReactElement } from 'react';\n\nimport { Popover } from '@launchpad-ui/popover';\nimport { mergeRefs } from '@react-aria/utils';\nimport { cx } from 'classix';\nimport { Children, cloneElement, useEffect, useRef, useState } from 'react';\n\ntype DropdownState = {\n\tisOpen?: boolean;\n};\n\ntype DropdownProps<T extends string | object | number> = PopoverProps & {\n\tonSelect?: (item: T, stateChanges: DropdownState) => void;\n\tonStateChange?: (state: DropdownState) => void;\n};\n\n/**\n * @deprecated use `Menu` from `@launchpad-ui/components` instead\n *\n * https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs\n */\nconst Dropdown = <T extends string | object | number>(props: DropdownProps<T>) => {\n\tconst {\n\t\tplacement,\n\t\tdisabled,\n\t\ttargetClassName,\n\t\tpopoverClassName,\n\t\tisOpen: isOpenProp,\n\t\tonInteraction,\n\t\tonSelect,\n\t\tonStateChange,\n\t\tchildren,\n\t\t'data-test-id': testId = 'dropdown',\n\t\t...rest\n\t} = props;\n\n\tconst triggerRef = useRef<HTMLElement | null>(null);\n\tconst [isOpen, setIsOpen] = useState(isOpenProp ?? false);\n\tconst [hasOpened, setHasOpened] = useState(isOpen);\n\n\tuseEffect(() => {\n\t\tif (isOpenProp !== undefined) {\n\t\t\tsetIsOpen(isOpenProp);\n\t\t}\n\t}, [isOpenProp]);\n\n\tuseEffect(() => {\n\t\t// Focus the button upon closing for convenient tabbing\n\t\tif (hasOpened && isOpen === false) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst current = triggerRef.current;\n\t\t\t\tif (!current) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If a dropdown menu item triggers a modal, we do not want to focus the trigger. Instead\n\t\t\t\t// we let the modal components control their own focus.\n\t\t\t\t// Note that this is not ideal since closing the modal will not cause the dropdown trigger\n\t\t\t\t// to regain focus.\n\t\t\t\tconst hasModal = current.closest?.('.has-overlay');\n\n\t\t\t\t!hasModal && current.focus?.();\n\t\t\t});\n\t\t}\n\t}, [isOpen, hasOpened]);\n\n\t// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n\tuseEffect(() => {\n\t\tsetHasOpened(isOpen);\n\t\tonStateChange?.({ isOpen });\n\t}, [isOpen]);\n\n\tconst renderTrigger = () => {\n\t\tconst { target } = parseChildren();\n\t\treturn cloneElement(target, {\n\t\t\t'aria-haspopup': true,\n\t\t\t'aria-expanded': !!isOpen,\n\t\t\tref: target.ref ? mergeRefs(target.ref, triggerRef) : triggerRef,\n\t\t\tisopen: isOpen?.toString(),\n\t\t});\n\t};\n\n\tconst renderContent = () => {\n\t\treturn cloneElement(parseChildren().content, {\n\t\t\tonSelect: handleSelect,\n\t\t});\n\t};\n\n\tconst handleSelect = (item: T) => {\n\t\tsetIsOpen(false);\n\t\tonSelect?.(item, { isOpen: false });\n\t};\n\n\tconst handlePopoverInteraction = (nextIsOpen: boolean) => {\n\t\tsetIsOpen(nextIsOpen);\n\t};\n\n\tconst parseChildren = () => {\n\t\tconst [targetChild, contentChild] = Children.toArray(children);\n\t\treturn {\n\t\t\ttarget: targetChild as FunctionComponentElement<\n\t\t\t\tAriaAttributes & { ref: ForwardedRef<HTMLElement | undefined>; isopen: string }\n\t\t\t>,\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: <explanation>\n\t\t\tcontent: contentChild as ReactElement<any>,\n\t\t};\n\t};\n\n\tconst popoverTargetClasses = cx('Dropdown-target', targetClassName);\n\tconst popoverClasses = cx('Dropdown', popoverClassName);\n\n\treturn (\n\t\t<Popover\n\t\t\tisOpen={isOpen}\n\t\t\tplacement={placement}\n\t\t\tonInteraction={onInteraction || handlePopoverInteraction}\n\t\t\trestrictHeight={false}\n\t\t\tdisabled={disabled}\n\t\t\ttargetClassName={popoverTargetClasses}\n\t\t\tpopoverClassName={popoverClasses}\n\t\t\tdata-test-id={testId}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{renderTrigger()}\n\t\t\t{renderContent()}\n\t\t</Popover>\n\t);\n};\n\nexport { Dropdown };\nexport type { DropdownProps };\n","import type { ButtonProps } from '@launchpad-ui/button';\n\nimport { Button } from '@launchpad-ui/button';\nimport { Icon } from '@launchpad-ui/icons';\nimport { forwardRef } from 'react';\n\ntype DropdownButtonProps = ButtonProps & {\n\thideCaret?: boolean;\n};\n\nconst DropdownButton = forwardRef<HTMLButtonElement, DropdownButtonProps>((props, ref) => {\n\tconst { children, hideCaret, 'data-test-id': testId = 'dropdown-button', ...rest } = props;\n\n\treturn (\n\t\t<Button {...rest} data-test-id={testId} ref={ref}>\n\t\t\t{children} {!hideCaret && <Icon name=\"chevron-down\" size=\"small\" />}\n\t\t</Button>\n\t);\n});\n\nDropdownButton.displayName = 'DropdownButton';\n\nexport { DropdownButton };\nexport type { DropdownButtonProps };\n"],"
|
1
|
+
{"version":3,"file":"index.js","names":["props: DropdownProps<T>","item: T","nextIsOpen: boolean"],"sources":["../src/Dropdown.tsx","../src/DropdownButton.tsx"],"sourcesContent":["import type { PopoverProps } from '@launchpad-ui/popover';\nimport type { AriaAttributes, ForwardedRef, FunctionComponentElement, ReactElement } from 'react';\n\nimport { Popover } from '@launchpad-ui/popover';\nimport { mergeRefs } from '@react-aria/utils';\nimport { cx } from 'classix';\nimport { Children, cloneElement, useEffect, useRef, useState } from 'react';\n\ntype DropdownState = {\n\tisOpen?: boolean;\n};\n\ntype DropdownProps<T extends string | object | number> = PopoverProps & {\n\tonSelect?: (item: T, stateChanges: DropdownState) => void;\n\tonStateChange?: (state: DropdownState) => void;\n};\n\n/**\n * @deprecated use `Menu` from `@launchpad-ui/components` instead\n *\n * https://launchpad.launchdarkly.com/?path=/docs/components-collections-menu--docs\n */\nconst Dropdown = <T extends string | object | number>(props: DropdownProps<T>) => {\n\tconst {\n\t\tplacement,\n\t\tdisabled,\n\t\ttargetClassName,\n\t\tpopoverClassName,\n\t\tisOpen: isOpenProp,\n\t\tonInteraction,\n\t\tonSelect,\n\t\tonStateChange,\n\t\tchildren,\n\t\t'data-test-id': testId = 'dropdown',\n\t\t...rest\n\t} = props;\n\n\tconst triggerRef = useRef<HTMLElement | null>(null);\n\tconst [isOpen, setIsOpen] = useState(isOpenProp ?? false);\n\tconst [hasOpened, setHasOpened] = useState(isOpen);\n\n\tuseEffect(() => {\n\t\tif (isOpenProp !== undefined) {\n\t\t\tsetIsOpen(isOpenProp);\n\t\t}\n\t}, [isOpenProp]);\n\n\tuseEffect(() => {\n\t\t// Focus the button upon closing for convenient tabbing\n\t\tif (hasOpened && isOpen === false) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst current = triggerRef.current;\n\t\t\t\tif (!current) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If a dropdown menu item triggers a modal, we do not want to focus the trigger. Instead\n\t\t\t\t// we let the modal components control their own focus.\n\t\t\t\t// Note that this is not ideal since closing the modal will not cause the dropdown trigger\n\t\t\t\t// to regain focus.\n\t\t\t\tconst hasModal = current.closest?.('.has-overlay');\n\n\t\t\t\t!hasModal && current.focus?.();\n\t\t\t});\n\t\t}\n\t}, [isOpen, hasOpened]);\n\n\t// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n\tuseEffect(() => {\n\t\tsetHasOpened(isOpen);\n\t\tonStateChange?.({ isOpen });\n\t}, [isOpen]);\n\n\tconst renderTrigger = () => {\n\t\tconst { target } = parseChildren();\n\t\treturn cloneElement(target, {\n\t\t\t'aria-haspopup': true,\n\t\t\t'aria-expanded': !!isOpen,\n\t\t\tref: target.ref ? mergeRefs(target.ref, triggerRef) : triggerRef,\n\t\t\tisopen: isOpen?.toString(),\n\t\t});\n\t};\n\n\tconst renderContent = () => {\n\t\treturn cloneElement(parseChildren().content, {\n\t\t\tonSelect: handleSelect,\n\t\t});\n\t};\n\n\tconst handleSelect = (item: T) => {\n\t\tsetIsOpen(false);\n\t\tonSelect?.(item, { isOpen: false });\n\t};\n\n\tconst handlePopoverInteraction = (nextIsOpen: boolean) => {\n\t\tsetIsOpen(nextIsOpen);\n\t};\n\n\tconst parseChildren = () => {\n\t\tconst [targetChild, contentChild] = Children.toArray(children);\n\t\treturn {\n\t\t\ttarget: targetChild as FunctionComponentElement<\n\t\t\t\tAriaAttributes & { ref: ForwardedRef<HTMLElement | undefined>; isopen: string }\n\t\t\t>,\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: <explanation>\n\t\t\tcontent: contentChild as ReactElement<any>,\n\t\t};\n\t};\n\n\tconst popoverTargetClasses = cx('Dropdown-target', targetClassName);\n\tconst popoverClasses = cx('Dropdown', popoverClassName);\n\n\treturn (\n\t\t<Popover\n\t\t\tisOpen={isOpen}\n\t\t\tplacement={placement}\n\t\t\tonInteraction={onInteraction || handlePopoverInteraction}\n\t\t\trestrictHeight={false}\n\t\t\tdisabled={disabled}\n\t\t\ttargetClassName={popoverTargetClasses}\n\t\t\tpopoverClassName={popoverClasses}\n\t\t\tdata-test-id={testId}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{renderTrigger()}\n\t\t\t{renderContent()}\n\t\t</Popover>\n\t);\n};\n\nexport { Dropdown };\nexport type { DropdownProps };\n","import type { ButtonProps } from '@launchpad-ui/button';\n\nimport { Button } from '@launchpad-ui/button';\nimport { Icon } from '@launchpad-ui/icons';\nimport { forwardRef } from 'react';\n\ntype DropdownButtonProps = ButtonProps & {\n\thideCaret?: boolean;\n};\n\nconst DropdownButton = forwardRef<HTMLButtonElement, DropdownButtonProps>((props, ref) => {\n\tconst { children, hideCaret, 'data-test-id': testId = 'dropdown-button', ...rest } = props;\n\n\treturn (\n\t\t<Button {...rest} data-test-id={testId} ref={ref}>\n\t\t\t{children} {!hideCaret && <Icon name=\"chevron-down\" size=\"small\" />}\n\t\t</Button>\n\t);\n});\n\nDropdownButton.displayName = 'DropdownButton';\n\nexport { DropdownButton };\nexport type { DropdownButtonProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,WAAW,CAAqCA,UAA4B;CACjF,MAAM,EACL,WACA,UACA,iBACA,kBACA,QAAQ,YACR,eACA,UACA,eACA,UACA,gBAAgB,SAAS,WACzB,GAAG,MACH,GAAG;CAEJ,MAAM,aAAa,CAAA,GAAA,MAAA,QAA2B,KAAK;CACnD,MAAM,CAAC,QAAQ,UAAU,GAAG,CAAA,GAAA,MAAA,UAAS,cAAc,MAAM;CACzD,MAAM,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,MAAA,UAAS,OAAO;AAElD,EAAA,GAAA,MAAA,WAAU,MAAM;AACf,MAAI,oBAAA,EACH,WAAU,WAAW;CAEtB,GAAE,CAAC,UAAW,EAAC;AAEhB,EAAA,GAAA,MAAA,WAAU,MAAM;AAEf,MAAI,aAAa,WAAW,MAC3B,YAAW,MAAM;GAChB,MAAM,UAAU,WAAW;AAC3B,QAAK,QACJ;GAOD,MAAM,WAAW,QAAQ,UAAU,eAAe;AAElD,IAAC,YAAY,QAAQ,SAAS;EAC9B,EAAC;CAEH,GAAE,CAAC,QAAQ,SAAU,EAAC;AAGvB,EAAA,GAAA,MAAA,WAAU,MAAM;AACf,eAAa,OAAO;AACpB,kBAAgB,EAAE,OAAQ,EAAC;CAC3B,GAAE,CAAC,MAAO,EAAC;CAEZ,MAAM,gBAAgB,MAAM;EAC3B,MAAM,EAAE,QAAQ,GAAG,eAAe;AAClC,yBAAO,CAAA,GAAA,MAAA,cAAa,QAAQ;GAC3B,iBAAiB;GACjB,mBAAmB;GACnB,KAAK,OAAO,MAAM,CAAA,GAAA,mBAAA,WAAU,OAAO,KAAK,WAAW,GAAG;GACtD,QAAQ,QAAQ,UAAA;EAChB,EAAC;CACF;CAED,MAAM,gBAAgB,MAAM;AAC3B,yBAAO,CAAA,GAAA,MAAA,cAAa,eAAe,CAAC,SAAS,EAC5C,UAAU,aACV,EAAC;CACF;CAED,MAAM,eAAe,CAACC,SAAY;AACjC,YAAU,MAAM;AAChB,aAAW,MAAM,EAAE,QAAQ,MAAO,EAAC;CACnC;CAED,MAAM,2BAA2B,CAACC,eAAwB;AACzD,YAAU,WAAW;CACrB;CAED,MAAM,gBAAgB,MAAM;EAC3B,MAAM,CAAC,aAAa,aAAa,GAAG,MAAA,SAAS,QAAQ,SAAS;AAC9D,SAAO;GACN,QAAQ;GAIR,SAAS;EACT;CACD;CAED,MAAM,uBAAuB,CAAA,GAAA,QAAA,IAAG,mBAAmB,gBAAgB;CACnE,MAAM,iBAAiB,CAAA,GAAA,QAAA,IAAG,YAAY,iBAAiB;AAEvD,wBACC,CAAA,GAAA,kBAAA,MAAC,uBAAA,SAAA;EACQ;EACG;EACX,eAAe,iBAAiB;EAChC,gBAAgB;EACN;EACV,iBAAiB;EACjB,kBAAkB;EAClB,gBAAc;EACd,GAAI;aAEH,eAAe,EACf,eAAe;GACP;AAEX;ACtHD,MAAM,iCAAiB,CAAA,GAAA,MAAA,YAAmD,CAAC,OAAO,QAAQ;CACzF,MAAM,EAAE,UAAU,WAAW,gBAAgB,SAAS,kBAAmB,GAAG,MAAM,GAAG;AAErF,wBACC,CAAA,GAAA,kBAAA,MAAC,sBAAA,QAAA;EAAO,GAAI;EAAM,gBAAc;EAAa;;GAC3C;GAAS;IAAG,6BAAa,CAAA,GAAA,kBAAA,KAAC,qBAAA,MAAA;IAAK,MAAK;IAAe,MAAK;;;GACjD;AAEV,EAAC;AAEF,eAAe,cAAc"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@launchpad-ui/dropdown",
|
3
|
-
"version": "0.6.
|
3
|
+
"version": "0.6.147",
|
4
4
|
"status": "beta",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -32,8 +32,8 @@
|
|
32
32
|
"dependencies": {
|
33
33
|
"@react-aria/utils": "3.28.2",
|
34
34
|
"classix": "2.2.0",
|
35
|
-
"@launchpad-ui/button": "~0.12.
|
36
|
-
"@launchpad-ui/icons": "~0.21.
|
35
|
+
"@launchpad-ui/button": "~0.12.51",
|
36
|
+
"@launchpad-ui/icons": "~0.21.10",
|
37
37
|
"@launchpad-ui/popover": "~0.11.41",
|
38
38
|
"@launchpad-ui/tokens": "~0.12.3"
|
39
39
|
},
|