@redsift/pickers 11.6.0-muiv5-alpha.3 → 11.6.0-muiv5-alpha.5
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/{components/combobox/Combobox.d.ts → _internal/Combobox2.js} +7 -7
- package/_internal/Combobox2.js.map +1 -0
- package/{components/combobox-content/ComboboxContent.d.ts → _internal/ComboboxContent.js} +5 -5
- package/_internal/ComboboxContent.js.map +1 -0
- package/{components/combobox-content-footer/ComboboxContentFooter.d.ts → _internal/ComboboxContentFooter.js} +2 -2
- package/_internal/ComboboxContentFooter.js.map +1 -0
- package/{components/combobox-content-header/ComboboxContentHeader.d.ts → _internal/ComboboxContentHeader.js} +2 -2
- package/_internal/ComboboxContentHeader.js.map +1 -0
- package/{components/combobox-content-listbox/ComboboxContentListbox.d.ts → _internal/ComboboxContentListbox.js} +2 -2
- package/_internal/ComboboxContentListbox.js.map +1 -0
- package/{components/combobox-trigger/ComboboxTrigger.d.ts → _internal/ComboboxTrigger.js} +2 -2
- package/_internal/ComboboxTrigger.js.map +1 -0
- package/{components/item/Item.d.ts → _internal/Item2.js} +1 -1
- package/_internal/Item2.js.map +1 -0
- package/{components/menu-button/types.d.ts → _internal/MenuButton.js} +27 -2
- package/_internal/MenuButton.js.map +1 -0
- package/{components/menu-button-content/MenuButtonContent.d.ts → _internal/MenuButtonContent.js} +5 -5
- package/_internal/MenuButtonContent.js.map +1 -0
- package/{components/menu-button-content-footer/MenuButtonContentFooter.d.ts → _internal/MenuButtonContentFooter.js} +2 -2
- package/_internal/MenuButtonContentFooter.js.map +1 -0
- package/{components/menu-button-content-header/MenuButtonContentHeader.d.ts → _internal/MenuButtonContentHeader.js} +2 -2
- package/_internal/MenuButtonContentHeader.js.map +1 -0
- package/{components/menu-button-content-menu/MenuButtonContentMenu.d.ts → _internal/MenuButtonContentMenu.js} +2 -2
- package/_internal/MenuButtonContentMenu.js.map +1 -0
- package/{components/menu-button-trigger/MenuButtonTrigger.d.ts → _internal/MenuButtonTrigger.js} +2 -2
- package/_internal/MenuButtonTrigger.js.map +1 -0
- package/{components/select/types.d.ts → _internal/Select2.js} +20 -2
- package/_internal/Select2.js.map +1 -0
- package/{components/select-content/SelectContent.d.ts → _internal/SelectContent.js} +2 -2
- package/_internal/SelectContent.js.map +1 -0
- package/{components/select-trigger/SelectTrigger.d.ts → _internal/SelectTrigger.js} +2 -2
- package/_internal/SelectTrigger.js.map +1 -0
- package/{_virtual → _internal}/_rollupPluginBabelHelpers.js +1 -1
- package/_internal/combobox-content-footer.js +4 -0
- package/_internal/combobox-content-footer.js.map +1 -0
- package/_internal/combobox-content-header.js +4 -0
- package/_internal/combobox-content-header.js.map +1 -0
- package/_internal/combobox-content-listbox.js +6 -0
- package/_internal/combobox-content-listbox.js.map +1 -0
- package/_internal/combobox-content.js +9 -0
- package/_internal/combobox-content.js.map +1 -0
- package/_internal/combobox-trigger.js +6 -0
- package/_internal/combobox-trigger.js.map +1 -0
- package/_internal/combobox.js +10 -0
- package/_internal/combobox.js.map +1 -0
- package/_internal/item.js +2 -0
- package/_internal/item.js.map +1 -0
- package/_internal/menu-button-content-footer.js +4 -0
- package/_internal/menu-button-content-footer.js.map +1 -0
- package/_internal/menu-button-content-header.js +4 -0
- package/_internal/menu-button-content-header.js.map +1 -0
- package/_internal/menu-button-content-menu.js +3 -0
- package/_internal/menu-button-content-menu.js.map +1 -0
- package/_internal/menu-button-content.js +8 -0
- package/_internal/menu-button-content.js.map +1 -0
- package/_internal/menu-button-trigger.js +5 -0
- package/_internal/menu-button-trigger.js.map +1 -0
- package/_internal/menu-button.js +9 -0
- package/_internal/menu-button.js.map +1 -0
- package/_internal/select-content.js +4 -0
- package/_internal/select-content.js.map +1 -0
- package/_internal/select-trigger.js +5 -0
- package/_internal/select-trigger.js.map +1 -0
- package/_internal/select.js +6 -0
- package/_internal/select.js.map +1 -0
- package/{components/combobox-content-footer/types.d.ts → _internal/types.js} +1 -1
- package/_internal/types.js.map +1 -0
- package/{components/menu-button-content/types.d.ts → _internal/types10.js} +1 -1
- package/{components/menu-button-trigger/types.d.ts → _internal/types11.js} +1 -1
- package/{components/select-content/types.d.ts → _internal/types12.js} +1 -1
- package/{components/select-trigger/types.d.ts → _internal/types13.js} +1 -1
- package/{components/combobox-content-header/types.d.ts → _internal/types2.js} +1 -1
- package/{components/combobox-content-listbox/types.d.ts → _internal/types3.js} +2 -2
- package/{components/combobox-content/types.d.ts → _internal/types4.js} +1 -1
- package/{components/combobox-trigger/types.d.ts → _internal/types5.js} +2 -2
- package/{components/combobox/types.d.ts → _internal/types6.js} +1 -1
- package/{components/menu-button-content-footer/types.d.ts → _internal/types7.js} +1 -1
- package/{components/menu-button-content-header/types.d.ts → _internal/types8.js} +1 -1
- package/{components/menu-button-content-menu/types.d.ts → _internal/types9.js} +1 -1
- package/index.js +32 -18
- package/package.json +5 -5
- package/components/combobox/Combobox.js +0 -151
- package/components/combobox/Combobox.js.map +0 -1
- package/components/combobox/context.js +0 -6
- package/components/combobox/context.js.map +0 -1
- package/components/combobox/intl/en-US.json.js +0 -13
- package/components/combobox/intl/en-US.json.js.map +0 -1
- package/components/combobox/intl/fr-FR.json.js +0 -13
- package/components/combobox/intl/fr-FR.json.js.map +0 -1
- package/components/combobox/intl/index.js +0 -10
- package/components/combobox/intl/index.js.map +0 -1
- package/components/combobox/types.js +0 -22
- package/components/combobox/types.js.map +0 -1
- package/components/combobox-content/ComboboxContent.js +0 -70
- package/components/combobox-content/ComboboxContent.js.map +0 -1
- package/components/combobox-content-footer/ComboboxContentFooter.js +0 -28
- package/components/combobox-content-footer/ComboboxContentFooter.js.map +0 -1
- package/components/combobox-content-footer/styles.js +0 -12
- package/components/combobox-content-footer/styles.js.map +0 -1
- package/components/combobox-content-header/ComboboxContentHeader.js +0 -28
- package/components/combobox-content-header/ComboboxContentHeader.js.map +0 -1
- package/components/combobox-content-header/styles.js +0 -12
- package/components/combobox-content-header/styles.js.map +0 -1
- package/components/combobox-content-listbox/ComboboxContentListbox.js +0 -124
- package/components/combobox-content-listbox/ComboboxContentListbox.js.map +0 -1
- package/components/combobox-trigger/ComboboxTrigger.js +0 -352
- package/components/combobox-trigger/ComboboxTrigger.js.map +0 -1
- package/components/item/Item.js +0 -137
- package/components/item/Item.js.map +0 -1
- package/components/item/useMenuItem.js +0 -69
- package/components/item/useMenuItem.js.map +0 -1
- package/components/menu-button/MenuButton.d.ts +0 -29
- package/components/menu-button/MenuButton.js +0 -76
- package/components/menu-button/MenuButton.js.map +0 -1
- package/components/menu-button/context.js +0 -6
- package/components/menu-button/context.js.map +0 -1
- package/components/menu-button-content/MenuButtonContent.js +0 -68
- package/components/menu-button-content/MenuButtonContent.js.map +0 -1
- package/components/menu-button-content-footer/MenuButtonContentFooter.js +0 -28
- package/components/menu-button-content-footer/MenuButtonContentFooter.js.map +0 -1
- package/components/menu-button-content-footer/styles.js +0 -12
- package/components/menu-button-content-footer/styles.js.map +0 -1
- package/components/menu-button-content-header/MenuButtonContentHeader.js +0 -28
- package/components/menu-button-content-header/MenuButtonContentHeader.js.map +0 -1
- package/components/menu-button-content-header/styles.js +0 -12
- package/components/menu-button-content-header/styles.js.map +0 -1
- package/components/menu-button-content-menu/MenuButtonContentMenu.js +0 -41
- package/components/menu-button-content-menu/MenuButtonContentMenu.js.map +0 -1
- package/components/menu-button-trigger/MenuButtonTrigger.js +0 -167
- package/components/menu-button-trigger/MenuButtonTrigger.js.map +0 -1
- package/components/select/Select.d.ts +0 -22
- package/components/select/Select.js +0 -116
- package/components/select/Select.js.map +0 -1
- package/components/select/context.js +0 -6
- package/components/select/context.js.map +0 -1
- package/components/select-content/SelectContent.js +0 -62
- package/components/select-content/SelectContent.js.map +0 -1
- package/components/select-trigger/SelectTrigger.js +0 -249
- package/components/select-trigger/SelectTrigger.js.map +0 -1
- package/index.d.ts +0 -32
- /package/{_virtual → _internal}/_rollupPluginBabelHelpers.js.map +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMenuItem.js","sources":["../../../src/components/item/useMenuItem.ts"],"sourcesContent":["import { useCallback, useEffect, RefObject, KeyboardEvent } from 'react';\nimport { usePopoverContext } from '@redsift/popovers';\nimport { UseFocusWithinGroupProps, useFocusOnListItem } from '@redsift/design-system';\n\nexport function useMenuItem(props: {\n domElementRef: RefObject<Element>;\n id: string;\n isDisabled?: boolean;\n onClick?: () => void;\n isLinkMenuItem?: boolean;\n linkRef?: RefObject<HTMLAnchorElement>;\n hasPopup?: boolean;\n}): UseFocusWithinGroupProps & {\n isDisabled?: boolean;\n} {\n const { domElementRef, id, isDisabled, onClick, isLinkMenuItem, linkRef, hasPopup } = props;\n\n const { handleOpen, hideInsteadOfClose, setHideInsteadOfClose } = usePopoverContext();\n const {\n tabIndex,\n isFocused,\n handleKeyDown: handleFocusKeyDown,\n handleClick: handleFocusClick,\n } = useFocusOnListItem({ domElementRef, isDisabled: isDisabled!, id });\n\n useEffect(() => {\n if (hasPopup && !hideInsteadOfClose) {\n setHideInsteadOfClose?.(true);\n }\n }, [hasPopup, hideInsteadOfClose, setHideInsteadOfClose]);\n\n const handleKeyDown = useCallback((event: KeyboardEvent) => {\n const code = event.code;\n if (code === 'Enter' || code === 'Space') {\n if (isLinkMenuItem) {\n linkRef?.current?.click();\n } else {\n onClick?.();\n }\n }\n handleFocusKeyDown(event);\n handleOpen(false);\n }, []);\n\n const handleClick = useCallback(() => {\n handleFocusClick();\n onClick?.();\n handleOpen(false);\n }, []);\n\n useEffect(() => {\n if (isFocused && domElementRef.current) {\n (domElementRef as RefObject<SVGElement | HTMLElement>).current?.focus();\n }\n }, [isFocused]);\n\n return {\n tabIndex,\n isFocused,\n isDisabled,\n handleKeyDown,\n handleClick,\n };\n}\n"],"names":["useMenuItem","props","domElementRef","id","isDisabled","onClick","isLinkMenuItem","linkRef","hasPopup","handleOpen","hideInsteadOfClose","setHideInsteadOfClose","usePopoverContext","tabIndex","isFocused","handleKeyDown","handleFocusKeyDown","handleClick","handleFocusClick","useFocus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B,OAAO,CAAEkB,OAAO,MAAA,IAAA,IAAAD,gBAAA,KAAhBA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,gBAAA,CAAkBE,KAAK,EAAE,CAAA;AAC3B,OAAC,MAAM;AACLrB,QAAAA,OAAO,KAAPA,IAAAA,IAAAA,OAAO,KAAPA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,OAAO,EAAI,CAAA;AACb,OAAA;AACF,KAAA;IACAW,kBAAkB,CAACM,KAAK,CAAC,CAAA;IACzBb,UAAU,CAAC,KAAK,CAAC,CAAA;GAClB,EAAE,EAAE,CAAC,CAAA;AAEN,EAAA,MAAMQ,WAAW,GAAGI,WAAW,CAAC,MAAM;AACpCH,IAAAA,gBAAgB,EAAE,CAAA;AAClBb,IAAAA,OAAO,KAAPA,IAAAA,IAAAA,OAAO,KAAPA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,OAAO,EAAI,CAAA;IACXI,UAAU,CAAC,KAAK,CAAC,CAAA;GAClB,EAAE,EAAE,CAAC,CAAA;AAENW,EAAAA,SAAS,CAAC,MAAM;AACd,IAAA,IAAIN,SAAS,IAAIZ,aAAa,CAACuB,OAAO,EAAE;AAAA,MAAA,IAAAE,QAAA,CAAA;AACtC,MAAA,CAAAA,QAAA,GAACzB,aAAa,CAAyCuB,OAAO,MAAA,IAAA,IAAAE,QAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAA9DA,QAAA,CAAgEC,KAAK,EAAE,CAAA;AACzE,KAAA;AACF,GAAC,EAAE,CAACd,SAAS,CAAC,CAAC,CAAA;EAEf,OAAO;IACLD,QAAQ;IACRC,SAAS;IACTV,UAAU;IACVW,aAAa;AACbE,IAAAA,WAAAA;GACD,CAAA;AACH;;;;"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as _redsift_design_system from '@redsift/design-system';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { MenuButtonProps } from './types.js';
|
|
4
|
-
import { MenuButtonTriggerProps } from '../menu-button-trigger/types.js';
|
|
5
|
-
import { MenuButtonContentProps } from '../menu-button-content/types.js';
|
|
6
|
-
import { MenuButtonContentHeaderProps } from '../menu-button-content-header/types.js';
|
|
7
|
-
import { MenuButtonContentMenuProps } from '../menu-button-content-menu/types.js';
|
|
8
|
-
import { MenuButtonContentFooterProps } from '../menu-button-content-footer/types.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The MenuButton component.
|
|
12
|
-
*/
|
|
13
|
-
declare const BaseMenuButton: React.FC<MenuButtonProps> & {
|
|
14
|
-
displayName?: string;
|
|
15
|
-
className?: string;
|
|
16
|
-
};
|
|
17
|
-
declare const MenuButton: React.FC<MenuButtonProps> & {
|
|
18
|
-
displayName?: string | undefined;
|
|
19
|
-
className?: string | undefined;
|
|
20
|
-
} & {
|
|
21
|
-
Trigger: _redsift_design_system.Comp<MenuButtonTriggerProps, HTMLButtonElement>;
|
|
22
|
-
Content: _redsift_design_system.Comp<MenuButtonContentProps, HTMLDivElement> & {
|
|
23
|
-
Header: _redsift_design_system.Comp<MenuButtonContentHeaderProps, HTMLDivElement>;
|
|
24
|
-
Menu: _redsift_design_system.Comp<MenuButtonContentMenuProps, HTMLDivElement>;
|
|
25
|
-
Footer: _redsift_design_system.Comp<MenuButtonContentFooterProps, HTMLDivElement>;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export { BaseMenuButton, MenuButton };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Popover } from '@redsift/popovers';
|
|
4
|
-
import { MenuButtonContext } from './context.js';
|
|
5
|
-
import { useTheme, ThemeProvider, FocusWithinGroup, Flexbox, Text, Theme } from '@redsift/design-system';
|
|
6
|
-
import { MenuButtonTrigger } from '../menu-button-trigger/MenuButtonTrigger.js';
|
|
7
|
-
import { MenuButtonContent } from '../menu-button-content/MenuButtonContent.js';
|
|
8
|
-
|
|
9
|
-
const COMPONENT_NAME = 'MenuButton';
|
|
10
|
-
const CLASSNAME = 'redsift-menu-button';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* The MenuButton component.
|
|
14
|
-
*/
|
|
15
|
-
const BaseMenuButton = props => {
|
|
16
|
-
const {
|
|
17
|
-
color,
|
|
18
|
-
description,
|
|
19
|
-
descriptionProps,
|
|
20
|
-
isDisabled,
|
|
21
|
-
label,
|
|
22
|
-
labelProps,
|
|
23
|
-
minWidth = 'trigger-width',
|
|
24
|
-
theme: propsTheme,
|
|
25
|
-
triggerClassName,
|
|
26
|
-
variant,
|
|
27
|
-
wrapperProps
|
|
28
|
-
} = props;
|
|
29
|
-
const theme = useTheme(propsTheme);
|
|
30
|
-
|
|
31
|
-
/** MenuButton context. */
|
|
32
|
-
const state = {
|
|
33
|
-
color,
|
|
34
|
-
isDisabled: isDisabled || false,
|
|
35
|
-
theme,
|
|
36
|
-
triggerClassName,
|
|
37
|
-
variant
|
|
38
|
-
};
|
|
39
|
-
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
40
|
-
value: {
|
|
41
|
-
theme
|
|
42
|
-
}
|
|
43
|
-
}, /*#__PURE__*/React.createElement(FocusWithinGroup, {
|
|
44
|
-
focusType: "virtual-focus",
|
|
45
|
-
listRole: "menu",
|
|
46
|
-
focusOnInit: false
|
|
47
|
-
}, /*#__PURE__*/React.createElement(MenuButtonContext.Provider, {
|
|
48
|
-
value: state
|
|
49
|
-
}, /*#__PURE__*/React.createElement(Flexbox, _extends({
|
|
50
|
-
flexDirection: "column",
|
|
51
|
-
alignItems: "flex-start",
|
|
52
|
-
gap: "0px"
|
|
53
|
-
}, wrapperProps), label && typeof label === 'string' ? /*#__PURE__*/React.createElement(Text, labelProps, label) : label ? label : null, /*#__PURE__*/React.createElement(Popover, _extends({
|
|
54
|
-
theme: theme,
|
|
55
|
-
overrideDisplayName: {
|
|
56
|
-
content: 'MenuButtonContent',
|
|
57
|
-
trigger: 'MenuButtonTrigger'
|
|
58
|
-
},
|
|
59
|
-
placement: "bottom-end",
|
|
60
|
-
minWidth: minWidth
|
|
61
|
-
}, props)), description && typeof description === 'string' ? /*#__PURE__*/React.createElement(Text, _extends({
|
|
62
|
-
theme: theme,
|
|
63
|
-
marginTop: "8px",
|
|
64
|
-
variant: "caption",
|
|
65
|
-
color: theme === Theme.light ? 'dark-grey' : 'white'
|
|
66
|
-
}, descriptionProps), description) : description ? description : null))));
|
|
67
|
-
};
|
|
68
|
-
BaseMenuButton.className = CLASSNAME;
|
|
69
|
-
BaseMenuButton.displayName = COMPONENT_NAME;
|
|
70
|
-
const MenuButton = Object.assign(BaseMenuButton, {
|
|
71
|
-
Trigger: MenuButtonTrigger,
|
|
72
|
-
Content: MenuButtonContent
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
export { BaseMenuButton, MenuButton };
|
|
76
|
-
//# sourceMappingURL=MenuButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButton.js","sources":["../../../src/components/menu-button/MenuButton.tsx"],"sourcesContent":["import React from 'react';\nimport { MenuButtonContent } from '../menu-button-content';\nimport { MenuButtonTrigger } from '../menu-button-trigger';\n\nimport { MenuButtonProps } from './types';\nimport { Popover } from '@redsift/popovers';\nimport { MenuButtonContext } from './context';\nimport { FocusWithinGroup, Flexbox, Text, Theme, useTheme, ThemeProvider } from '@redsift/design-system';\n\nconst COMPONENT_NAME = 'MenuButton';\nconst CLASSNAME = 'redsift-menu-button';\n\n/**\n * The MenuButton component.\n */\nexport const BaseMenuButton: React.FC<MenuButtonProps> & {\n displayName?: string;\n className?: string;\n} = (props) => {\n const {\n color,\n description,\n descriptionProps,\n isDisabled,\n label,\n labelProps,\n minWidth = 'trigger-width',\n theme: propsTheme,\n triggerClassName,\n variant,\n wrapperProps,\n } = props;\n\n const theme = useTheme(propsTheme);\n\n /** MenuButton context. */\n const state = {\n color,\n isDisabled: isDisabled || false,\n theme,\n triggerClassName,\n variant,\n };\n\n return (\n <ThemeProvider value={{ theme }}>\n <FocusWithinGroup focusType=\"virtual-focus\" listRole=\"menu\" focusOnInit={false}>\n <MenuButtonContext.Provider value={state}>\n <Flexbox flexDirection=\"column\" alignItems=\"flex-start\" gap=\"0px\" {...wrapperProps}>\n {label && typeof label === 'string' ? <Text {...labelProps}>{label}</Text> : label ? label : null}\n <Popover\n theme={theme}\n overrideDisplayName={{ content: 'MenuButtonContent', trigger: 'MenuButtonTrigger' }}\n placement=\"bottom-end\"\n minWidth={minWidth}\n {...props}\n />\n {description && typeof description === 'string' ? (\n <Text\n theme={theme}\n marginTop=\"8px\"\n variant=\"caption\"\n color={theme === Theme.light ? 'dark-grey' : 'white'}\n {...descriptionProps}\n >\n {description}\n </Text>\n ) : description ? (\n description\n ) : null}\n </Flexbox>\n </MenuButtonContext.Provider>\n </FocusWithinGroup>\n </ThemeProvider>\n );\n};\nBaseMenuButton.className = CLASSNAME;\nBaseMenuButton.displayName = COMPONENT_NAME;\n\nexport const MenuButton = Object.assign(BaseMenuButton, {\n Trigger: MenuButtonTrigger,\n Content: MenuButtonContent,\n});\n"],"names":["COMPONENT_NAME","CLASSNAME","BaseMenuButton","props","color","description","descriptionProps","isDisabled","label","labelProps","minWidth","theme","propsTheme","triggerClassName","variant","wrapperProps","useTheme","state","React","createElement","ThemeProvider","value","FocusWithinGroup","focusType","listRole","focusOnInit","MenuButtonContext","Provider","Flexbox","_extends","flexDirection","alignItems","gap","Text","Popover","overrideDisplayName","content","trigger","placement","marginTop","Theme","light","className","displayName","MenuButton","Object","assign","Trigger","MenuButtonTrigger","Content","MenuButtonContent"],"mappings":";;;;;;;;AASA,MAAMA,cAAc,GAAG,YAAY,CAAA;AACnC,MAAMC,SAAS,GAAG,qBAAqB,CAAA;;AAEvC;AACA;AACA;AACaC,MAAAA,cAGZ,GAAIC,KAAK,IAAK;EACb,MAAM;IACJC,KAAK;I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AK,EAAEA,KAAM;AACbwB,IAAAA,mBAAmB,EAAE;AAAEC,MAAAA,OAAO,EAAE,mBAAmB;AAAEC,MAAAA,OAAO,EAAE,mBAAA;KAAsB;AACpFC,IAAAA,SAAS,EAAC,YAAY;AACtB5B,IAAAA,QAAQ,EAAEA,QAAAA;AAAS,GAAA,EACfP,KAAK,CACV,CAAC,EACDE,WAAW,IAAI,OAAOA,WAAW,KAAK,QAAQ,gBAC7Ca,KAAA,CAAAC,aAAA,CAACc,IAAI,EAAAJ,QAAA,CAAA;AACHlB,IAAAA,KAAK,EAAEA,KAAM;AACb4B,IAAAA,SAAS,EAAC,KAAK;AACfzB,IAAAA,OAAO,EAAC,SAAS;IACjBV,KAAK,EAAEO,KAAK,KAAK6B,KAAK,CAACC,KAAK,GAAG,WAAW,GAAG,OAAA;AAAQ,GAAA,EACjDnC,gBAAgB,CAAA,EAEnBD,WACG,CAAC,GACLA,WAAW,GACbA,WAAW,GACT,IACG,CACiB,CACZ,CACL,CAAC,CAAA;AAEpB,EAAC;AACDH,cAAc,CAACwC,SAAS,GAAGzC,SAAS,CAAA;AACpCC,cAAc,CAACyC,WAAW,GAAG3C,cAAc,CAAA;AAEpC,MAAM4C,UAAU,GAAGC,MAAM,CAACC,MAAM,CAAC5C,cAAc,EAAE;AACtD6C,EAAAA,OAAO,EAAEC,iBAAiB;AAC1BC,EAAAA,OAAO,EAAEC,iBAAAA;AACX,CAAC;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../src/components/menu-button/context.ts"],"sourcesContent":["import React from 'react';\nimport { MenuButtonState } from './types';\n\nexport const MenuButtonContext = React.createContext<MenuButtonState | null>(null);\n"],"names":["MenuButtonContext","React","createContext"],"mappings":";;AAGO,MAAMA,iBAAiB,gBAAGC,KAAK,CAACC,aAAa,CAAyB,IAAI;;;;"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { extends as _extends, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { forwardRef, useContext } from 'react';
|
|
3
|
-
import { getContainerProps, AppContainerContext, useTheme, partitionComponents, isComponent, Flexbox } from '@redsift/design-system';
|
|
4
|
-
import { usePopoverContext, useMergeRefs, FloatingPortal, StyledPopoverContent, PopoverContent } from '@redsift/popovers';
|
|
5
|
-
import classNames from 'classnames';
|
|
6
|
-
import { MenuButtonContentMenu } from '../menu-button-content-menu/MenuButtonContentMenu.js';
|
|
7
|
-
import { MenuButtonContentHeader } from '../menu-button-content-header/MenuButtonContentHeader.js';
|
|
8
|
-
import { MenuButtonContentFooter } from '../menu-button-content-footer/MenuButtonContentFooter.js';
|
|
9
|
-
|
|
10
|
-
const COMPONENT_NAME = 'MenuButtonContent';
|
|
11
|
-
const CLASSNAME = 'redsift-menu-button-content';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* The MenuButtonContent component.
|
|
15
|
-
*/
|
|
16
|
-
const BaseMenuButtonContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
17
|
-
const {
|
|
18
|
-
children,
|
|
19
|
-
className,
|
|
20
|
-
style
|
|
21
|
-
} = props;
|
|
22
|
-
const containerProps = getContainerProps(props);
|
|
23
|
-
const {
|
|
24
|
-
getFloatingProps,
|
|
25
|
-
isOpen,
|
|
26
|
-
refs,
|
|
27
|
-
strategy,
|
|
28
|
-
x,
|
|
29
|
-
y,
|
|
30
|
-
hideInsteadOfClose
|
|
31
|
-
} = usePopoverContext();
|
|
32
|
-
const popoverRef = useMergeRefs([refs.setFloating, ref]);
|
|
33
|
-
const appContainerState = useContext(AppContainerContext);
|
|
34
|
-
const theme = useTheme();
|
|
35
|
-
const [[header], [menu], [footer]] = partitionComponents(React.Children.toArray(children), [isComponent('MenuButtonContentHeader'), isComponent('MenuButtonContentMenu'), isComponent('MenuButtonContentFooter')]);
|
|
36
|
-
return /*#__PURE__*/React.createElement(FloatingPortal, {
|
|
37
|
-
root: appContainerState === null || appContainerState === void 0 ? void 0 : appContainerState.appContainerRef.current
|
|
38
|
-
}, isOpen || hideInsteadOfClose ? /*#__PURE__*/React.createElement(StyledPopoverContent, _extends({
|
|
39
|
-
$theme: theme,
|
|
40
|
-
ref: popoverRef
|
|
41
|
-
}, getFloatingProps(props), {
|
|
42
|
-
style: _objectSpread2({
|
|
43
|
-
position: strategy,
|
|
44
|
-
top: y !== null && y !== void 0 ? y : 0,
|
|
45
|
-
left: x !== null && x !== void 0 ? x : 0,
|
|
46
|
-
display: hideInsteadOfClose && !isOpen ? 'none' : 'flex'
|
|
47
|
-
}, style),
|
|
48
|
-
className: classNames(PopoverContent.className, BaseMenuButtonContent.className, className)
|
|
49
|
-
}), !header && !menu && !footer ? /*#__PURE__*/React.createElement(Flexbox, _extends({
|
|
50
|
-
flexDirection: "column",
|
|
51
|
-
gap: "0px",
|
|
52
|
-
width: "100%"
|
|
53
|
-
}, containerProps), /*#__PURE__*/React.createElement(MenuButtonContentMenu, null, children)) : /*#__PURE__*/React.createElement(Flexbox, _extends({
|
|
54
|
-
flexDirection: "column",
|
|
55
|
-
gap: "0px",
|
|
56
|
-
width: "100%"
|
|
57
|
-
}, containerProps), header, menu, footer)) : null);
|
|
58
|
-
});
|
|
59
|
-
BaseMenuButtonContent.className = CLASSNAME;
|
|
60
|
-
BaseMenuButtonContent.displayName = COMPONENT_NAME;
|
|
61
|
-
const MenuButtonContent = Object.assign(BaseMenuButtonContent, {
|
|
62
|
-
Header: MenuButtonContentHeader,
|
|
63
|
-
Menu: MenuButtonContentMenu,
|
|
64
|
-
Footer: MenuButtonContentFooter
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
export { BaseMenuButtonContent, MenuButtonContent };
|
|
68
|
-
//# sourceMappingURL=MenuButtonContent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButtonContent.js","sources":["../../../src/components/menu-button-content/MenuButtonContent.tsx"],"sourcesContent":["import React, { forwardRef, useContext } from 'react';\n\nimport {\n AppContainerContext,\n Comp,\n Flexbox,\n getContainerProps,\n isComponent,\n partitionComponents,\n useTheme,\n} from '@redsift/design-system';\nimport { MenuButtonContentProps } from './types';\nimport {\n FloatingPortal,\n PopoverContent,\n StyledPopoverContent,\n useMergeRefs,\n usePopoverContext,\n} from '@redsift/popovers';\nimport classNames from 'classnames';\nimport { MenuButtonContentFooter } from '../menu-button-content-footer';\nimport { MenuButtonContentHeader } from '../menu-button-content-header';\nimport { MenuButtonContentMenu } from '../menu-button-content-menu';\n\nconst COMPONENT_NAME = 'MenuButtonContent';\nconst CLASSNAME = 'redsift-menu-button-content';\n\n/**\n * The MenuButtonContent component.\n */\nexport const BaseMenuButtonContent: Comp<MenuButtonContentProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, style } = props;\n const containerProps = getContainerProps(props);\n\n const { getFloatingProps, isOpen, refs, strategy, x, y, hideInsteadOfClose } = usePopoverContext();\n const popoverRef = useMergeRefs([refs.setFloating, ref]);\n\n const appContainerState = useContext(AppContainerContext);\n const theme = useTheme();\n\n const [[header], [menu], [footer]] = partitionComponents(React.Children.toArray(children), [\n isComponent('MenuButtonContentHeader'),\n isComponent('MenuButtonContentMenu'),\n isComponent('MenuButtonContentFooter'),\n ]);\n\n return (\n <FloatingPortal root={appContainerState?.appContainerRef.current}>\n {isOpen || hideInsteadOfClose ? (\n <StyledPopoverContent\n $theme={theme!}\n ref={popoverRef}\n {...getFloatingProps(props)}\n style={{\n position: strategy,\n top: y ?? 0,\n left: x ?? 0,\n display: hideInsteadOfClose && !isOpen ? 'none' : 'flex',\n ...style,\n }}\n className={classNames(PopoverContent.className, BaseMenuButtonContent.className, className)}\n >\n {!header && !menu && !footer ? (\n <Flexbox flexDirection=\"column\" gap=\"0px\" width=\"100%\" {...containerProps}>\n <MenuButtonContentMenu>{children}</MenuButtonContentMenu>\n </Flexbox>\n ) : (\n <Flexbox flexDirection=\"column\" gap=\"0px\" width=\"100%\" {...containerProps}>\n {header}\n {menu}\n {footer}\n </Flexbox>\n )}\n </StyledPopoverContent>\n ) : null}\n </FloatingPortal>\n );\n});\nBaseMenuButtonContent.className = CLASSNAME;\nBaseMenuButtonContent.displayName = COMPONENT_NAME;\n\nexport const MenuButtonContent = Object.assign(BaseMenuButtonContent, {\n Header: MenuButtonContentHeader,\n Menu: MenuButtonContentMenu,\n Footer: MenuButtonContentFooter,\n});\n"],"names":["COMPONENT_NAME","CLASSNAME","BaseMenuButtonContent","forwardRef","props","ref","children","className","style","containerProps","getContainerProps","getFloatingProps","isOpen","refs","strategy","x","y","hideInsteadOfClose","usePopoverContext","popoverRef","useMergeRefs","setFloating","appContainerState","useContext","AppContainerContext","theme","useTheme","header","menu","footer","partitionComponents","React","Children","toArray","isComponent","createElement","FloatingPortal","root","appContainerRef","current","StyledPopoverContent","_extends","$theme","_objectSpread","position","top","left","display","classNames","PopoverContent","Flexbox","flexDirection","gap","width","MenuButtonContentMenu","displayName","MenuButtonContent","Object","assign","Header","MenuButtonContentHeader","Menu","Footer","MenuButtonContentFooter"],"mappings":";;;;;;;;;AAwBA,MAAMA,cAAc,GAAG,mBAAmB,CAAA;AAC1C,MAAMC,SAAS,GAAG,6BAA6B,CAAA;;AAE/C;AACA;AACA;AACO,MAAMC,qBAAmE,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC5G,MAAM;IAAEC,QAAQ;IAAEC,SAAS;AAAEC,IAAAA,KAAAA;AAAM,GAAC,GAAGJ,KAAK,CAAA;AAC5C,EAAA,MAAMK,cAAc,GAAGC,iBAAiB,CAACN,KAAK,CAAC,CAAA;EAE/C,MAAM;IAAEO,gBAAgB;IAAEC,MAAM;IAAEC,IAAI;IAAEC,QAAQ;IAAEC,CAAC;IAAEC,CAAC;AAAEC,IAAAA,kBAAAA;GAAoB,GAAGC,iBAAiB,EAAE,CAAA;EAClG,MAAMC,UAAU,GAAGC,YAAY,CAAC,CAACP,IAAI,CAACQ,WAAW,EAAEhB,GAAG,C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UAAU,CAACC,cAAc,CAAC1C,SAAS,EAAEL,qBAAqB,CAACK,SAAS,EAAEA,SAAS,CAAA;AAAE,GAAA,CAAA,EAE3F,CAACoB,MAAM,IAAI,CAACC,IAAI,IAAI,CAACC,MAAM,gBAC1BE,KAAA,CAAAI,aAAA,CAACe,OAAO,EAAAT,QAAA,CAAA;AAACU,IAAAA,aAAa,EAAC,QAAQ;AAACC,IAAAA,GAAG,EAAC,KAAK;AAACC,IAAAA,KAAK,EAAC,MAAA;AAAM,GAAA,EAAK5C,cAAc,CACvEsB,eAAAA,KAAA,CAAAI,aAAA,CAACmB,qBAAqB,EAAEhD,IAAAA,EAAAA,QAAgC,CACjD,CAAC,gBAEVyB,KAAA,CAAAI,aAAA,CAACe,OAAO,EAAAT,QAAA,CAAA;AAACU,IAAAA,aAAa,EAAC,QAAQ;AAACC,IAAAA,GAAG,EAAC,KAAK;AAACC,IAAAA,KAAK,EAAC,MAAA;GAAW5C,EAAAA,cAAc,CACtEkB,EAAAA,MAAM,EACNC,IAAI,EACJC,MACM,CAES,CAAC,GACrB,IACU,CAAC,CAAA;AAErB,CAAC,EAAC;AACF3B,qBAAqB,CAACK,SAAS,GAAGN,SAAS,CAAA;AAC3CC,qBAAqB,CAACqD,WAAW,GAAGvD,cAAc,CAAA;AAE3C,MAAMwD,iBAAiB,GAAGC,MAAM,CAACC,MAAM,CAACxD,qBAAqB,EAAE;AACpEyD,EAAAA,MAAM,EAAEC,uBAAuB;AAC/BC,EAAAA,IAAI,EAAEP,qBAAqB;AAC3BQ,EAAAA,MAAM,EAAEC,uBAAAA;AACV,CAAC;;;;"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { forwardRef } from 'react';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import { StyledMenuButtonContentFooter } from './styles.js';
|
|
5
|
-
|
|
6
|
-
const _excluded = ["children", "className"];
|
|
7
|
-
const COMPONENT_NAME = 'MenuButtonContentFooter';
|
|
8
|
-
const CLASSNAME = 'redsift-combobox-content-footer';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The MenuButtonContentFooter component.
|
|
12
|
-
*/
|
|
13
|
-
const MenuButtonContentFooter = /*#__PURE__*/forwardRef((props, ref) => {
|
|
14
|
-
const {
|
|
15
|
-
children,
|
|
16
|
-
className
|
|
17
|
-
} = props,
|
|
18
|
-
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
19
|
-
return /*#__PURE__*/React.createElement(StyledMenuButtonContentFooter, _extends({}, forwardedProps, {
|
|
20
|
-
className: classNames(MenuButtonContentFooter.className, className),
|
|
21
|
-
ref: ref
|
|
22
|
-
}), children);
|
|
23
|
-
});
|
|
24
|
-
MenuButtonContentFooter.className = CLASSNAME;
|
|
25
|
-
MenuButtonContentFooter.displayName = COMPONENT_NAME;
|
|
26
|
-
|
|
27
|
-
export { MenuButtonContentFooter };
|
|
28
|
-
//# sourceMappingURL=MenuButtonContentFooter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButtonContentFooter.js","sources":["../../../src/components/menu-button-content-footer/MenuButtonContentFooter.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\n\nimport { StyledMenuButtonContentFooter } from './styles';\nimport { MenuButtonContentFooterProps } from './types';\nimport { Comp } from '@redsift/design-system';\n\nconst COMPONENT_NAME = 'MenuButtonContentFooter';\nconst CLASSNAME = 'redsift-combobox-content-footer';\n\n/**\n * The MenuButtonContentFooter component.\n */\nexport const MenuButtonContentFooter: Comp<MenuButtonContentFooterProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, ...forwardedProps } = props;\n\n return (\n <StyledMenuButtonContentFooter\n {...forwardedProps}\n className={classNames(MenuButtonContentFooter.className, className)}\n ref={ref as RefObject<HTMLDivElement>}\n >\n {children}\n </StyledMenuButtonContentFooter>\n );\n});\nMenuButtonContentFooter.className = CLASSNAME;\nMenuButtonContentFooter.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","MenuButtonContentFooter","forwardRef","props","ref","children","className","forwardedProps","_objectWithoutProperties","_excluded","React","createElement","StyledMenuButtonContentFooter","_extends","classNames","displayName"],"mappings":";;;;;;AAOA,MAAMA,cAAc,GAAG,yBAAyB,CAAA;AAChD,MAAMC,SAAS,GAAG,iCAAiC,CAAA;;AAEnD;AACA;AACA;AACO,MAAMC,uBAA2E,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACpH,MAAM;MAAEC,QAAQ;AAAEC,MAAAA,SAAAA;AAA6B,KAAC,GAAGH,KAAK;AAAxBI,IAAAA,cAAc,GAAAC,wBAAA,CAAKL,KAAK,EAAAM,SAAA,CAAA,CAAA;EAExD,oBACEC,KAAA,CAAAC,aAAA,CAACC,6BAA6B,EAAAC,QAAA,KACxBN,cAAc,EAAA;IAClBD,SAAS,EAAEQ,UAAU,CAACb,uBAAuB,CAACK,SAAS,EAAEA,SAAS,CAAE;AACpEF,IAAAA,GAAG,EAAEA,GAAAA;AAAiC,GAAA,CAAA,EAErCC,QAC4B,CAAC,CAAA;AAEpC,CAAC,EAAC;AACFJ,uBAAuB,CAACK,SAAS,GAAGN,SAAS,CAAA;AAC7CC,uBAAuB,CAACc,WAAW,GAAGhB,cAAc;;;;"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { baseContainer } from '@redsift/design-system';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Component style.
|
|
6
|
-
*/
|
|
7
|
-
const StyledMenuButtonContentFooter = styled.div`
|
|
8
|
-
${baseContainer}
|
|
9
|
-
`;
|
|
10
|
-
|
|
11
|
-
export { StyledMenuButtonContentFooter };
|
|
12
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../src/components/menu-button-content-footer/styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { StyledMenuButtonContentFooterProps } from './types';\nimport { baseContainer } from '@redsift/design-system';\n\n/**\n * Component style.\n */\nexport const StyledMenuButtonContentFooter = styled.div<StyledMenuButtonContentFooterProps>`\n ${baseContainer}\n`;\n"],"names":["StyledMenuButtonContentFooter","styled","div","baseContainer"],"mappings":";;;AAIA;AACA;AACA;AACaA,MAAAA,6BAA6B,GAAGC,MAAM,CAACC,GAAwC,CAAA;AAC5F,EAAA,EAAIC,aAAc,CAAA;AAClB;;;;"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { forwardRef } from 'react';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import { StyledMenuButtonContentHeader } from './styles.js';
|
|
5
|
-
|
|
6
|
-
const _excluded = ["children", "className"];
|
|
7
|
-
const COMPONENT_NAME = 'MenuButtonContentHeader';
|
|
8
|
-
const CLASSNAME = 'redsift-combobox-content-header';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The MenuButtonContentHeader component.
|
|
12
|
-
*/
|
|
13
|
-
const MenuButtonContentHeader = /*#__PURE__*/forwardRef((props, ref) => {
|
|
14
|
-
const {
|
|
15
|
-
children,
|
|
16
|
-
className
|
|
17
|
-
} = props,
|
|
18
|
-
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
19
|
-
return /*#__PURE__*/React.createElement(StyledMenuButtonContentHeader, _extends({}, forwardedProps, {
|
|
20
|
-
className: classNames(MenuButtonContentHeader.className, className),
|
|
21
|
-
ref: ref
|
|
22
|
-
}), children);
|
|
23
|
-
});
|
|
24
|
-
MenuButtonContentHeader.className = CLASSNAME;
|
|
25
|
-
MenuButtonContentHeader.displayName = COMPONENT_NAME;
|
|
26
|
-
|
|
27
|
-
export { MenuButtonContentHeader };
|
|
28
|
-
//# sourceMappingURL=MenuButtonContentHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButtonContentHeader.js","sources":["../../../src/components/menu-button-content-header/MenuButtonContentHeader.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\n\nimport { StyledMenuButtonContentHeader } from './styles';\nimport { MenuButtonContentHeaderProps } from './types';\nimport { Comp } from '@redsift/design-system';\n\nconst COMPONENT_NAME = 'MenuButtonContentHeader';\nconst CLASSNAME = 'redsift-combobox-content-header';\n\n/**\n * The MenuButtonContentHeader component.\n */\nexport const MenuButtonContentHeader: Comp<MenuButtonContentHeaderProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, ...forwardedProps } = props;\n\n return (\n <StyledMenuButtonContentHeader\n {...forwardedProps}\n className={classNames(MenuButtonContentHeader.className, className)}\n ref={ref as RefObject<HTMLDivElement>}\n >\n {children}\n </StyledMenuButtonContentHeader>\n );\n});\nMenuButtonContentHeader.className = CLASSNAME;\nMenuButtonContentHeader.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","MenuButtonContentHeader","forwardRef","props","ref","children","className","forwardedProps","_objectWithoutProperties","_excluded","React","createElement","StyledMenuButtonContentHeader","_extends","classNames","displayName"],"mappings":";;;;;;AAOA,MAAMA,cAAc,GAAG,yBAAyB,CAAA;AAChD,MAAMC,SAAS,GAAG,iCAAiC,CAAA;;AAEnD;AACA;AACA;AACO,MAAMC,uBAA2E,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACpH,MAAM;MAAEC,QAAQ;AAAEC,MAAAA,SAAAA;AAA6B,KAAC,GAAGH,KAAK;AAAxBI,IAAAA,cAAc,GAAAC,wBAAA,CAAKL,KAAK,EAAAM,SAAA,CAAA,CAAA;EAExD,oBACEC,KAAA,CAAAC,aAAA,CAACC,6BAA6B,EAAAC,QAAA,KACxBN,cAAc,EAAA;IAClBD,SAAS,EAAEQ,UAAU,CAACb,uBAAuB,CAACK,SAAS,EAAEA,SAAS,CAAE;AACpEF,IAAAA,GAAG,EAAEA,GAAAA;AAAiC,GAAA,CAAA,EAErCC,QAC4B,CAAC,CAAA;AAEpC,CAAC,EAAC;AACFJ,uBAAuB,CAACK,SAAS,GAAGN,SAAS,CAAA;AAC7CC,uBAAuB,CAACc,WAAW,GAAGhB,cAAc;;;;"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { baseContainer } from '@redsift/design-system';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Component style.
|
|
6
|
-
*/
|
|
7
|
-
const StyledMenuButtonContentHeader = styled.div`
|
|
8
|
-
${baseContainer}
|
|
9
|
-
`;
|
|
10
|
-
|
|
11
|
-
export { StyledMenuButtonContentHeader };
|
|
12
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../src/components/menu-button-content-header/styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { StyledMenuButtonContentHeaderProps } from './types';\nimport { baseContainer } from '@redsift/design-system';\n\n/**\n * Component style.\n */\nexport const StyledMenuButtonContentHeader = styled.div<StyledMenuButtonContentHeaderProps>`\n ${baseContainer}\n`;\n"],"names":["StyledMenuButtonContentHeader","styled","div","baseContainer"],"mappings":";;;AAIA;AACA;AACA;AACaA,MAAAA,6BAA6B,GAAGC,MAAM,CAACC,GAAwC,CAAA;AAC5F,EAAA,EAAIC,aAAc,CAAA;AAClB;;;;"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { forwardRef, useContext, useEffect } from 'react';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import { FocusWithinGroupContext, Flexbox } from '@redsift/design-system';
|
|
5
|
-
|
|
6
|
-
const _excluded = ["children", "className"];
|
|
7
|
-
const COMPONENT_NAME = 'MenuButtonContentMenu';
|
|
8
|
-
const CLASSNAME = 'redsift-menu-button-content-menu';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The MenuButtonContentMenu component.
|
|
12
|
-
*/
|
|
13
|
-
const MenuButtonContentMenu = /*#__PURE__*/forwardRef((props, ref) => {
|
|
14
|
-
const {
|
|
15
|
-
children,
|
|
16
|
-
className
|
|
17
|
-
} = props,
|
|
18
|
-
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
19
|
-
const focusContext = useContext(FocusWithinGroupContext);
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
if (focusContext && focusContext.state.delayedAction && focusContext.state.tabStops.length) {
|
|
22
|
-
focusContext.dispatch(focusContext.state.delayedAction);
|
|
23
|
-
}
|
|
24
|
-
}, [focusContext.state.delayedAction, focusContext.state.tabStops.length]);
|
|
25
|
-
return /*#__PURE__*/React.createElement(Flexbox, _extends({
|
|
26
|
-
flexDirection: "column",
|
|
27
|
-
gap: "8px",
|
|
28
|
-
margin: "8px 0px",
|
|
29
|
-
width: "100%",
|
|
30
|
-
className: classNames(MenuButtonContentMenu.className, className),
|
|
31
|
-
role: "menu",
|
|
32
|
-
as: "ul"
|
|
33
|
-
}, forwardedProps, {
|
|
34
|
-
ref: ref
|
|
35
|
-
}), children);
|
|
36
|
-
});
|
|
37
|
-
MenuButtonContentMenu.className = CLASSNAME;
|
|
38
|
-
MenuButtonContentMenu.displayName = COMPONENT_NAME;
|
|
39
|
-
|
|
40
|
-
export { MenuButtonContentMenu };
|
|
41
|
-
//# sourceMappingURL=MenuButtonContentMenu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButtonContentMenu.js","sources":["../../../src/components/menu-button-content-menu/MenuButtonContentMenu.tsx"],"sourcesContent":["import React, { forwardRef, useContext, useEffect } from 'react';\nimport classNames from 'classnames';\n\nimport { Comp, Flexbox, FocusWithinGroupContext } from '@redsift/design-system';\nimport { MenuButtonContentMenuProps } from './types';\n\nconst COMPONENT_NAME = 'MenuButtonContentMenu';\nconst CLASSNAME = 'redsift-menu-button-content-menu';\n\n/**\n * The MenuButtonContentMenu component.\n */\nexport const MenuButtonContentMenu: Comp<MenuButtonContentMenuProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, ...forwardedProps } = props;\n\n const focusContext = useContext(FocusWithinGroupContext);\n\n useEffect(() => {\n if (focusContext && focusContext.state.delayedAction && focusContext.state.tabStops.length) {\n focusContext.dispatch(focusContext.state.delayedAction);\n }\n }, [focusContext.state.delayedAction, focusContext.state.tabStops.length]);\n\n return (\n <Flexbox\n flexDirection=\"column\"\n gap=\"8px\"\n margin=\"8px 0px\"\n width=\"100%\"\n className={classNames(MenuButtonContentMenu.className, className)}\n role=\"menu\"\n as=\"ul\"\n {...forwardedProps}\n ref={ref}\n >\n {children}\n </Flexbox>\n );\n});\nMenuButtonContentMenu.className = CLASSNAME;\nMenuButtonContentMenu.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","MenuButtonContentMenu","forwardRef","props","ref","children","className","forwardedProps","_objectWithoutProperties","_excluded","focusContext","useContext","FocusWithinGroupContext","useEffect","state","delayedAction","tabStops","length","dispatch","React","createElement","Flexbox","_extends","flexDirection","gap","margin","width","classNames","role","as","displayName"],"mappings":";;;;;;AAMA,MAAMA,cAAc,GAAG,uBAAuB,CAAA;AAC9C,MAAMC,SAAS,GAAG,kCAAkC,CAAA;;AAEpD;AACA;AACA;AACO,MAAMC,qBAAuE,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAChH,MAAM;MAAEC,QAAQ;AAAEC,MAAAA,SAAAA;AAA6B,KAAC,GAAGH,KAAK;AAAxBI,IAAAA,cAAc,GAAAC,wBAAA,CAAKL,KAAK,EAAAM,SAAA,CAAA,CAAA;AAExD,EAAA,MAAMC,YAAY,GAAGC,UAAU,CAACC,uBAAuB,CAAC,CAAA;AAExDC,EAAAA,SAAS,CAAC,MAAM;AACd,IAAA,IAAIH,YAAY,IAAIA,YAAY,CAACI,KAAK,CAACC,aAAa,IAAIL,YAAY,CAACI,KAAK,CAACE,QAAQ,CAACC,MAAM,EAAE;MAC1FP,YAAY,CAACQ,QAAQ,CAACR,YAAY,CAACI,KAAK,CAACC,aAAa,CAAC,CAAA;AACzD,KAAA;AACF,GAAC,EAAE,CAACL,YAAY,CAACI,KAAK,CAACC,aAAa,EAAEL,YAAY,CAACI,KAAK,CAACE,QAAQ,CAACC,MAAM,CAAC,CAAC,CAAA;AAE1E,EAAA,oBACEE,KAAA,CAAAC,aAAA,CAACC,OAAO,EAAAC,QAAA,CAAA;AACNC,IAAAA,aAAa,EAAC,QAAQ;AACtBC,IAAAA,GAAG,EAAC,KAAK;AACTC,IAAAA,MAAM,EAAC,SAAS;AAChBC,IAAAA,KAAK,EAAC,MAAM;IACZpB,SAAS,EAAEqB,UAAU,CAAC1B,qBAAqB,CAACK,SAAS,EAAEA,SAAS,CAAE;AAClEsB,IAAAA,IAAI,EAAC,MAAM;AACXC,IAAAA,EAAE,EAAC,IAAA;AAAI,GAAA,EACHtB,cAAc,EAAA;AAClBH,IAAAA,GAAG,EAAEA,GAAAA;AAAI,GAAA,CAAA,EAERC,QACM,CAAC,CAAA;AAEd,CAAC,EAAC;AACFJ,qBAAqB,CAACK,SAAS,GAAGN,SAAS,CAAA;AAC3CC,qBAAqB,CAAC6B,WAAW,GAAG/B,cAAc;;;;"}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { forwardRef, useContext } from 'react';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import { FocusWithinGroupContext, useTheme, isComponent, FocusWithinGroupActionType, EventKey } from '@redsift/design-system';
|
|
5
|
-
import { usePopoverContext, useMergeRefs } from '@redsift/popovers';
|
|
6
|
-
import { MenuButtonContext } from '../menu-button/context.js';
|
|
7
|
-
|
|
8
|
-
const COMPONENT_NAME = 'MenuButtonTrigger';
|
|
9
|
-
const CLASSNAME = 'redsift-menu-button-trigger';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* The MenuButtonTrigger component.
|
|
13
|
-
*/
|
|
14
|
-
const MenuButtonTrigger = /*#__PURE__*/forwardRef((props, ref) => {
|
|
15
|
-
const {
|
|
16
|
-
children
|
|
17
|
-
} = props;
|
|
18
|
-
const {
|
|
19
|
-
getReferenceProps,
|
|
20
|
-
isOpen,
|
|
21
|
-
handleOpen,
|
|
22
|
-
refs
|
|
23
|
-
} = usePopoverContext();
|
|
24
|
-
const childrenRef = children.ref;
|
|
25
|
-
const triggerRef = useMergeRefs([refs.setReference, ref, childrenRef]);
|
|
26
|
-
const focusContext = useContext(FocusWithinGroupContext);
|
|
27
|
-
const menuButtonContext = useContext(MenuButtonContext);
|
|
28
|
-
const theme = useTheme();
|
|
29
|
-
const renderedChildren = typeof children === 'function' ? children({
|
|
30
|
-
isOpen
|
|
31
|
-
}) : children;
|
|
32
|
-
const handleKeyDown = event => {
|
|
33
|
-
const code = event.code;
|
|
34
|
-
if (code === 'Escape' || code === 'Tab') {
|
|
35
|
-
if (isOpen) {
|
|
36
|
-
handleOpen(false);
|
|
37
|
-
}
|
|
38
|
-
} else if (code === 'ArrowDown') {
|
|
39
|
-
if (!isOpen) {
|
|
40
|
-
handleOpen(true);
|
|
41
|
-
}
|
|
42
|
-
if (focusContext.state.selectedId !== null) {
|
|
43
|
-
focusContext.dispatch({
|
|
44
|
-
type: FocusWithinGroupActionType.DELAY_ACTION,
|
|
45
|
-
payload: {
|
|
46
|
-
type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,
|
|
47
|
-
payload: {
|
|
48
|
-
key: EventKey.ArrowDown,
|
|
49
|
-
ctrlKey: event.ctrlKey
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
} else {
|
|
54
|
-
focusContext.dispatch({
|
|
55
|
-
type: FocusWithinGroupActionType.DELAY_ACTION,
|
|
56
|
-
payload: {
|
|
57
|
-
type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,
|
|
58
|
-
payload: {
|
|
59
|
-
key: EventKey.Home,
|
|
60
|
-
ctrlKey: event.ctrlKey
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
event.preventDefault();
|
|
66
|
-
event.stopPropagation();
|
|
67
|
-
} else if (code === 'ArrowUp') {
|
|
68
|
-
if (!isOpen) {
|
|
69
|
-
handleOpen(true);
|
|
70
|
-
}
|
|
71
|
-
focusContext.dispatch({
|
|
72
|
-
type: FocusWithinGroupActionType.DELAY_ACTION,
|
|
73
|
-
payload: {
|
|
74
|
-
type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,
|
|
75
|
-
payload: {
|
|
76
|
-
key: focusContext.state.selectedId !== null ? EventKey.ArrowUp : EventKey.Home,
|
|
77
|
-
ctrlKey: event.ctrlKey
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
event.preventDefault();
|
|
82
|
-
event.stopPropagation();
|
|
83
|
-
} else if (code === 'Home') {
|
|
84
|
-
if (!isOpen) {
|
|
85
|
-
handleOpen(true);
|
|
86
|
-
}
|
|
87
|
-
focusContext.dispatch({
|
|
88
|
-
type: FocusWithinGroupActionType.DELAY_ACTION,
|
|
89
|
-
payload: {
|
|
90
|
-
type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,
|
|
91
|
-
payload: {
|
|
92
|
-
key: EventKey.Home,
|
|
93
|
-
ctrlKey: event.ctrlKey
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
event.preventDefault();
|
|
98
|
-
event.stopPropagation();
|
|
99
|
-
} else if (code === 'End') {
|
|
100
|
-
if (!isOpen) {
|
|
101
|
-
handleOpen(true);
|
|
102
|
-
}
|
|
103
|
-
focusContext.dispatch({
|
|
104
|
-
type: FocusWithinGroupActionType.DELAY_ACTION,
|
|
105
|
-
payload: {
|
|
106
|
-
type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,
|
|
107
|
-
payload: {
|
|
108
|
-
key: EventKey.End,
|
|
109
|
-
ctrlKey: event.ctrlKey
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
event.preventDefault();
|
|
114
|
-
event.stopPropagation();
|
|
115
|
-
} else if (code === 'Enter') {
|
|
116
|
-
if (isOpen && focusContext.state.selectedId) {
|
|
117
|
-
var _document$getElementB, _document$getElementB2, _document$getElementB3, _document$getElementB4;
|
|
118
|
-
(_document$getElementB = document.getElementById(focusContext.state.selectedId)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.click();
|
|
119
|
-
(_document$getElementB2 = document.getElementById(focusContext.state.selectedId)) === null || _document$getElementB2 === void 0 ? void 0 : (_document$getElementB3 = _document$getElementB2.getElementsByTagName('a')) === null || _document$getElementB3 === void 0 ? void 0 : (_document$getElementB4 = _document$getElementB3[0]) === null || _document$getElementB4 === void 0 ? void 0 : _document$getElementB4.click();
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
const handleClick = event => {
|
|
124
|
-
event.preventDefault();
|
|
125
|
-
event.stopPropagation();
|
|
126
|
-
if (isOpen) {
|
|
127
|
-
handleOpen(false);
|
|
128
|
-
} else {
|
|
129
|
-
var _focusContext$state$a, _focusContext$state$a2;
|
|
130
|
-
handleOpen(true);
|
|
131
|
-
focusContext.dispatch({
|
|
132
|
-
type: FocusWithinGroupActionType.DELAY_ACTION,
|
|
133
|
-
payload: {
|
|
134
|
-
type: FocusWithinGroupActionType.FOCUS_ON_LIST,
|
|
135
|
-
payload: {
|
|
136
|
-
id: (_focusContext$state$a = (_focusContext$state$a2 = focusContext.state.activedescendant) === null || _focusContext$state$a2 === void 0 ? void 0 : _focusContext$state$a2[0]) !== null && _focusContext$state$a !== void 0 ? _focusContext$state$a : ''
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
if (isComponent('Button')(renderedChildren) || isComponent('IconButton')(renderedChildren)) {
|
|
143
|
-
var _props$children, _focusContext$state$a3, _menuButtonContext$co, _menuButtonContext$va;
|
|
144
|
-
return /*#__PURE__*/React.cloneElement(renderedChildren, _objectSpread2(_objectSpread2({}, getReferenceProps(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
145
|
-
ref: triggerRef
|
|
146
|
-
}, props), renderedChildren.props), {}, {
|
|
147
|
-
children: (_props$children = renderedChildren.props.children) !== null && _props$children !== void 0 ? _props$children : ''
|
|
148
|
-
}))), {}, {
|
|
149
|
-
theme,
|
|
150
|
-
'aria-activedescendant': isOpen ? (_focusContext$state$a3 = focusContext.state.activedescendant) === null || _focusContext$state$a3 === void 0 ? void 0 : _focusContext$state$a3[0] : undefined,
|
|
151
|
-
className: classNames(renderedChildren.props.className, menuButtonContext === null || menuButtonContext === void 0 ? void 0 : menuButtonContext.triggerClassName),
|
|
152
|
-
color: (_menuButtonContext$co = menuButtonContext === null || menuButtonContext === void 0 ? void 0 : menuButtonContext.color) !== null && _menuButtonContext$co !== void 0 ? _menuButtonContext$co : renderedChildren.props.color,
|
|
153
|
-
isActive: isOpen,
|
|
154
|
-
isDisabled: menuButtonContext === null || menuButtonContext === void 0 ? void 0 : menuButtonContext.isDisabled,
|
|
155
|
-
onClick: handleClick,
|
|
156
|
-
onKeyDown: handleKeyDown,
|
|
157
|
-
role: 'button',
|
|
158
|
-
variant: (_menuButtonContext$va = menuButtonContext === null || menuButtonContext === void 0 ? void 0 : menuButtonContext.variant) !== null && _menuButtonContext$va !== void 0 ? _menuButtonContext$va : renderedChildren.props.variant
|
|
159
|
-
}));
|
|
160
|
-
}
|
|
161
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, renderedChildren);
|
|
162
|
-
});
|
|
163
|
-
MenuButtonTrigger.className = CLASSNAME;
|
|
164
|
-
MenuButtonTrigger.displayName = COMPONENT_NAME;
|
|
165
|
-
|
|
166
|
-
export { MenuButtonTrigger };
|
|
167
|
-
//# sourceMappingURL=MenuButtonTrigger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButtonTrigger.js","sources":["../../../src/components/menu-button-trigger/MenuButtonTrigger.tsx"],"sourcesContent":["import React, { MouseEvent, ReactElement, forwardRef, useContext } from 'react';\nimport classNames from 'classnames';\n\nimport {\n Comp,\n EventKey,\n FocusWithinGroupActionType,\n FocusWithinGroupContext,\n isComponent,\n useTheme,\n} from '@redsift/design-system';\nimport { MenuButtonTriggerProps } from './types';\nimport { useMergeRefs, usePopoverContext } from '@redsift/popovers';\nimport { MenuButtonContext } from '../menu-button/context';\n\nconst COMPONENT_NAME = 'MenuButtonTrigger';\nconst CLASSNAME = 'redsift-menu-button-trigger';\n\n/**\n * The MenuButtonTrigger component.\n */\nexport const MenuButtonTrigger: Comp<MenuButtonTriggerProps, HTMLButtonElement> = forwardRef((props, ref) => {\n const { children } = props;\n\n const { getReferenceProps, isOpen, handleOpen, refs } = usePopoverContext();\n const childrenRef = (children as any).ref;\n const triggerRef = useMergeRefs([refs.setReference, ref, childrenRef]);\n\n const focusContext = useContext(FocusWithinGroupContext);\n const menuButtonContext = useContext(MenuButtonContext);\n const theme = useTheme();\n\n const renderedChildren = typeof children === 'function' ? children({ isOpen }) : children;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n const code = event.code;\n\n if (code === 'Escape' || code === 'Tab') {\n if (isOpen) {\n handleOpen(false);\n }\n } else if (code === 'ArrowDown') {\n if (!isOpen) {\n handleOpen(true);\n }\n if (focusContext.state.selectedId !== null) {\n focusContext.dispatch({\n type: FocusWithinGroupActionType.DELAY_ACTION,\n payload: {\n type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,\n payload: {\n key: EventKey.ArrowDown,\n ctrlKey: event.ctrlKey,\n },\n },\n });\n } else {\n focusContext.dispatch({\n type: FocusWithinGroupActionType.DELAY_ACTION,\n payload: {\n type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,\n payload: {\n key: EventKey.Home,\n ctrlKey: event.ctrlKey,\n },\n },\n });\n }\n event.preventDefault();\n event.stopPropagation();\n } else if (code === 'ArrowUp') {\n if (!isOpen) {\n handleOpen(true);\n }\n focusContext.dispatch({\n type: FocusWithinGroupActionType.DELAY_ACTION,\n payload: {\n type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,\n payload: {\n key: focusContext.state.selectedId !== null ? EventKey.ArrowUp : EventKey.Home,\n ctrlKey: event.ctrlKey,\n },\n },\n });\n event.preventDefault();\n event.stopPropagation();\n } else if (code === 'Home') {\n if (!isOpen) {\n handleOpen(true);\n }\n focusContext.dispatch({\n type: FocusWithinGroupActionType.DELAY_ACTION,\n payload: {\n type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,\n payload: {\n key: EventKey.Home,\n ctrlKey: event.ctrlKey,\n },\n },\n });\n event.preventDefault();\n event.stopPropagation();\n } else if (code === 'End') {\n if (!isOpen) {\n handleOpen(true);\n }\n focusContext.dispatch({\n type: FocusWithinGroupActionType.DELAY_ACTION,\n payload: {\n type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,\n payload: {\n key: EventKey.End,\n ctrlKey: event.ctrlKey,\n },\n },\n });\n event.preventDefault();\n event.stopPropagation();\n } else if (code === 'Enter') {\n if (isOpen && focusContext.state.selectedId) {\n document.getElementById(focusContext.state.selectedId)?.click();\n document.getElementById(focusContext.state.selectedId)?.getElementsByTagName('a')?.[0]?.click();\n }\n }\n };\n\n const handleClick = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n if (isOpen) {\n handleOpen(false);\n } else {\n handleOpen(true);\n focusContext.dispatch({\n type: FocusWithinGroupActionType.DELAY_ACTION,\n payload: {\n type: FocusWithinGroupActionType.FOCUS_ON_LIST,\n payload: {\n id: focusContext.state.activedescendant?.[0] ?? '',\n },\n },\n });\n }\n };\n\n if (isComponent('Button')(renderedChildren) || isComponent('IconButton')(renderedChildren)) {\n return React.cloneElement(renderedChildren, {\n ...getReferenceProps({\n ref: triggerRef,\n ...props,\n ...(renderedChildren as ReactElement).props,\n children: (renderedChildren as ReactElement).props.children ?? '',\n }),\n theme,\n 'aria-activedescendant': isOpen ? focusContext.state.activedescendant?.[0] : undefined,\n className: classNames((renderedChildren as ReactElement).props.className, menuButtonContext?.triggerClassName),\n color: menuButtonContext?.color ?? (renderedChildren as ReactElement).props.color,\n isActive: isOpen,\n isDisabled: menuButtonContext?.isDisabled,\n onClick: handleClick,\n onKeyDown: handleKeyDown,\n role: 'button',\n variant: menuButtonContext?.variant ?? (renderedChildren as ReactElement).props.variant,\n });\n }\n\n return <>{renderedChildren}</>;\n});\nMenuButtonTrigger.className = CLASSNAME;\nMenuButtonTrigger.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","MenuButtonTrigger","forwardRef","props","ref","children","getReferenceProps","isOpen","handleOpen","refs","usePopoverContext","childrenRef","triggerRef","useMergeRefs","setReference","focusContext","useContext","FocusWithinGroupContext","menuButtonContext","MenuButtonContext","theme","useTheme","renderedChildren","handleKeyDown","event","code","state","selectedId","dispatch","type","FocusWithinGroupActionType","DELAY_ACTION","payload","KEY_DOWN_ON_LIST","key","EventKey","ArrowDown","ctrlKey","Home","preventDefault","stopPropagation","ArrowUp","End","_document$getElementB","_document$getElementB2","_document$getElementB3","_document$getElementB4","document","getElementById","click","getElementsByTagName","handleClick","_focusContext$state$a","_focusContext$state$a2","FOCUS_ON_LIST","id","activedescendant","isComponent","_props$children","_focusContext$state$a3","_menuButtonContext$co","_menuButtonContext$va","React","cloneElement","_objectSpread","undefined","className","classNames","triggerClassName","color","isActive","isDisabled","onClick","onKeyDown","role","variant","createElement","Fragment","displayName"],"mappings":";;;;;;;AAeA,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
|
3
|
-
import { SelectProps } from './types.js';
|
|
4
|
-
import { SelectTriggerProps } from '../select-trigger/types.js';
|
|
5
|
-
import { SelectContentProps } from '../select-content/types.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* The Select component.
|
|
9
|
-
*/
|
|
10
|
-
declare const BaseSelect: React.FC<SelectProps> & {
|
|
11
|
-
displayName?: string;
|
|
12
|
-
className?: string;
|
|
13
|
-
};
|
|
14
|
-
declare const Select: React.FC<SelectProps> & {
|
|
15
|
-
displayName?: string | undefined;
|
|
16
|
-
className?: string | undefined;
|
|
17
|
-
} & {
|
|
18
|
-
Trigger: _redsift_design_system.Comp<SelectTriggerProps, HTMLButtonElement>;
|
|
19
|
-
Content: _redsift_design_system.Comp<SelectContentProps, HTMLDivElement>;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export { BaseSelect, Select };
|