@redsift/pickers 11.5.0 → 11.6.0-muiv5-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/_virtual/_rollupPluginBabelHelpers.js +93 -0
  2. package/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
  3. package/components/combobox/Combobox.d.ts +29 -0
  4. package/components/combobox/Combobox.js +151 -0
  5. package/components/combobox/Combobox.js.map +1 -0
  6. package/components/combobox/context.js +6 -0
  7. package/components/combobox/context.js.map +1 -0
  8. package/components/combobox/intl/en-US.json.js +13 -0
  9. package/components/combobox/intl/en-US.json.js.map +1 -0
  10. package/components/combobox/intl/fr-FR.json.js +13 -0
  11. package/components/combobox/intl/fr-FR.json.js.map +1 -0
  12. package/components/combobox/intl/index.js +10 -0
  13. package/components/combobox/intl/index.js.map +1 -0
  14. package/components/combobox/types.d.ts +107 -0
  15. package/components/combobox/types.js +22 -0
  16. package/components/combobox/types.js.map +1 -0
  17. package/components/combobox-content/ComboboxContent.d.ts +17 -0
  18. package/components/combobox-content/ComboboxContent.js +70 -0
  19. package/components/combobox-content/ComboboxContent.js.map +1 -0
  20. package/components/combobox-content/types.d.ts +11 -0
  21. package/components/combobox-content-footer/ComboboxContentFooter.d.ts +9 -0
  22. package/components/combobox-content-footer/ComboboxContentFooter.js +28 -0
  23. package/components/combobox-content-footer/ComboboxContentFooter.js.map +1 -0
  24. package/components/combobox-content-footer/styles.js +12 -0
  25. package/components/combobox-content-footer/styles.js.map +1 -0
  26. package/components/combobox-content-footer/types.d.ts +11 -0
  27. package/components/combobox-content-header/ComboboxContentHeader.d.ts +9 -0
  28. package/components/combobox-content-header/ComboboxContentHeader.js +28 -0
  29. package/components/combobox-content-header/ComboboxContentHeader.js.map +1 -0
  30. package/components/combobox-content-header/styles.js +12 -0
  31. package/components/combobox-content-header/styles.js.map +1 -0
  32. package/components/combobox-content-header/types.d.ts +11 -0
  33. package/components/combobox-content-listbox/ComboboxContentListbox.d.ts +9 -0
  34. package/components/combobox-content-listbox/ComboboxContentListbox.js +124 -0
  35. package/components/combobox-content-listbox/ComboboxContentListbox.js.map +1 -0
  36. package/components/combobox-content-listbox/types.d.ts +12 -0
  37. package/components/combobox-trigger/ComboboxTrigger.d.ts +9 -0
  38. package/components/combobox-trigger/ComboboxTrigger.js +352 -0
  39. package/components/combobox-trigger/ComboboxTrigger.js.map +1 -0
  40. package/components/combobox-trigger/types.d.ts +27 -0
  41. package/components/item/Item.d.ts +8 -0
  42. package/components/item/Item.js +137 -0
  43. package/components/item/Item.js.map +1 -0
  44. package/components/item/useMenuItem.js +69 -0
  45. package/components/item/useMenuItem.js.map +1 -0
  46. package/components/menu-button/MenuButton.d.ts +29 -0
  47. package/components/menu-button/MenuButton.js +76 -0
  48. package/components/menu-button/MenuButton.js.map +1 -0
  49. package/components/menu-button/context.js +6 -0
  50. package/components/menu-button/context.js.map +1 -0
  51. package/components/menu-button/types.d.ts +45 -0
  52. package/components/menu-button-content/MenuButtonContent.d.ts +17 -0
  53. package/components/menu-button-content/MenuButtonContent.js +68 -0
  54. package/components/menu-button-content/MenuButtonContent.js.map +1 -0
  55. package/components/menu-button-content/types.d.ts +9 -0
  56. package/components/menu-button-content-footer/MenuButtonContentFooter.d.ts +9 -0
  57. package/components/menu-button-content-footer/MenuButtonContentFooter.js +28 -0
  58. package/components/menu-button-content-footer/MenuButtonContentFooter.js.map +1 -0
  59. package/components/menu-button-content-footer/styles.js +12 -0
  60. package/components/menu-button-content-footer/styles.js.map +1 -0
  61. package/components/menu-button-content-footer/types.d.ts +11 -0
  62. package/components/menu-button-content-header/MenuButtonContentHeader.d.ts +9 -0
  63. package/components/menu-button-content-header/MenuButtonContentHeader.js +28 -0
  64. package/components/menu-button-content-header/MenuButtonContentHeader.js.map +1 -0
  65. package/components/menu-button-content-header/styles.js +12 -0
  66. package/components/menu-button-content-header/styles.js.map +1 -0
  67. package/components/menu-button-content-header/types.d.ts +11 -0
  68. package/components/menu-button-content-menu/MenuButtonContentMenu.d.ts +9 -0
  69. package/components/menu-button-content-menu/MenuButtonContentMenu.js +41 -0
  70. package/components/menu-button-content-menu/MenuButtonContentMenu.js.map +1 -0
  71. package/components/menu-button-content-menu/types.d.ts +9 -0
  72. package/components/menu-button-trigger/MenuButtonTrigger.d.ts +9 -0
  73. package/components/menu-button-trigger/MenuButtonTrigger.js +167 -0
  74. package/components/menu-button-trigger/MenuButtonTrigger.js.map +1 -0
  75. package/components/menu-button-trigger/types.d.ts +15 -0
  76. package/components/select/Select.d.ts +22 -0
  77. package/components/select/Select.js +116 -0
  78. package/components/select/Select.js.map +1 -0
  79. package/components/select/context.js +6 -0
  80. package/components/select/context.js.map +1 -0
  81. package/components/select/types.d.ts +61 -0
  82. package/components/select-content/SelectContent.d.ts +9 -0
  83. package/components/select-content/SelectContent.js +62 -0
  84. package/components/select-content/SelectContent.js.map +1 -0
  85. package/components/select-content/types.d.ts +9 -0
  86. package/components/select-trigger/SelectTrigger.d.ts +9 -0
  87. package/components/select-trigger/SelectTrigger.js +249 -0
  88. package/components/select-trigger/SelectTrigger.js.map +1 -0
  89. package/components/select-trigger/types.d.ts +17 -0
  90. package/index.d.ts +31 -438
  91. package/index.js +17 -1822
  92. package/index.js.map +1 -1
  93. package/package.json +8 -8
@@ -0,0 +1,69 @@
1
+ import { useEffect, useCallback } from 'react';
2
+ import { usePopoverContext } from '@redsift/popovers';
3
+ import { useFocusOnListItem } from '@redsift/design-system';
4
+
5
+ function useMenuItem(props) {
6
+ const {
7
+ domElementRef,
8
+ id,
9
+ isDisabled,
10
+ onClick,
11
+ isLinkMenuItem,
12
+ linkRef,
13
+ hasPopup
14
+ } = props;
15
+ const {
16
+ handleOpen,
17
+ hideInsteadOfClose,
18
+ setHideInsteadOfClose
19
+ } = usePopoverContext();
20
+ const {
21
+ tabIndex,
22
+ isFocused,
23
+ handleKeyDown: handleFocusKeyDown,
24
+ handleClick: handleFocusClick
25
+ } = useFocusOnListItem({
26
+ domElementRef,
27
+ isDisabled: isDisabled,
28
+ id
29
+ });
30
+ useEffect(() => {
31
+ if (hasPopup && !hideInsteadOfClose) {
32
+ setHideInsteadOfClose === null || setHideInsteadOfClose === void 0 ? void 0 : setHideInsteadOfClose(true);
33
+ }
34
+ }, [hasPopup, hideInsteadOfClose, setHideInsteadOfClose]);
35
+ const handleKeyDown = useCallback(event => {
36
+ const code = event.code;
37
+ if (code === 'Enter' || code === 'Space') {
38
+ if (isLinkMenuItem) {
39
+ var _linkRef$current;
40
+ linkRef === null || linkRef === void 0 ? void 0 : (_linkRef$current = linkRef.current) === null || _linkRef$current === void 0 ? void 0 : _linkRef$current.click();
41
+ } else {
42
+ onClick === null || onClick === void 0 ? void 0 : onClick();
43
+ }
44
+ }
45
+ handleFocusKeyDown(event);
46
+ handleOpen(false);
47
+ }, []);
48
+ const handleClick = useCallback(() => {
49
+ handleFocusClick();
50
+ onClick === null || onClick === void 0 ? void 0 : onClick();
51
+ handleOpen(false);
52
+ }, []);
53
+ useEffect(() => {
54
+ if (isFocused && domElementRef.current) {
55
+ var _current;
56
+ (_current = domElementRef.current) === null || _current === void 0 ? void 0 : _current.focus();
57
+ }
58
+ }, [isFocused]);
59
+ return {
60
+ tabIndex,
61
+ isFocused,
62
+ isDisabled,
63
+ handleKeyDown,
64
+ handleClick
65
+ };
66
+ }
67
+
68
+ export { useMenuItem };
69
+ //# sourceMappingURL=useMenuItem.js.map
@@ -0,0 +1 @@
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","useFocusOnListItem","useEffect","useCallback","event","code","_linkRef$current","current","click","_current","focus"],"mappings":";;;;AAIO,SAASA,WAAWA,CAACC,KAQ3B,EAEC;EACA,MAAM;IAAEC,aAAa;IAAEC,EAAE;IAAEC,UAAU;IAAEC,OAAO;IAAEC,cAAc;IAAEC,OAAO;AAAEC,IAAAA,QAAAA;AAAS,GAAC,GAAGP,KAAK,CAAA;EAE3F,MAAM;IAAEQ,UAAU;IAAEC,kBAAkB;AAAEC,IAAAA,qBAAAA;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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;;;;"}
@@ -0,0 +1,29 @@
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 };
@@ -0,0 +1,76 @@
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
@@ -0,0 +1 @@
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,GAA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AU,EAAGD,KAAY,CAAC,GAAGA,KAAK,GAAGA,KAAK,GAAG,IAAI,eACjGU,KAAA,CAAAC,aAAA,CAACe,OAAO,EAAAL,QAAA,CAAA;AACNlB,IAAAA,KAAK,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;;;;"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+
3
+ const MenuButtonContext = /*#__PURE__*/React.createContext(null);
4
+
5
+ export { MenuButtonContext };
6
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
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;;;;"}
@@ -0,0 +1,45 @@
1
+ import { ButtonColor, ButtonVariant, TextProps, Theme, FlexboxProps } from '@redsift/design-system';
2
+ import { PopoverProps } from '@redsift/popovers';
3
+ import { ReactElement } from 'react';
4
+
5
+ /**
6
+ * Context props.
7
+ */
8
+ type MenuButtonState = {
9
+ /** Button color that will be forward to the trigger. */
10
+ readonly color?: ButtonColor;
11
+ /** Whether the trigger is disabled or not. */
12
+ readonly isDisabled: boolean;
13
+ /** Class name to append to the trigger. */
14
+ readonly triggerClassName?: string;
15
+ /** Button variant that will be forward to the trigger. */
16
+ readonly variant?: ButtonVariant;
17
+ };
18
+ /**
19
+ * Component props.
20
+ */
21
+ interface MenuButtonProps extends PopoverProps {
22
+ /** Button color that will be forward to the trigger. */
23
+ color?: ButtonColor;
24
+ /** Description of the menu button. */
25
+ description?: string | ReactElement;
26
+ /** Additional description properties. */
27
+ descriptionProps?: Omit<TextProps, 'ref'>;
28
+ /** Whether the component is disabled or not. */
29
+ isDisabled?: boolean;
30
+ /** Label of the menu button. */
31
+ label?: string | ReactElement;
32
+ /** Additional label properties. */
33
+ labelProps?: Omit<TextProps, 'ref'>;
34
+ /** Class name to append to the trigger. */
35
+ triggerClassName?: string;
36
+ /** Button variant that will be forward to the trigger. */
37
+ variant?: ButtonVariant;
38
+ /** Theme. */
39
+ theme?: Theme;
40
+ /** Props to forward to the wrapper. */
41
+ wrapperProps?: Omit<FlexboxProps, 'ref'>;
42
+ }
43
+ type StyledMenuButtonProps = MenuButtonProps;
44
+
45
+ export { MenuButtonProps, MenuButtonState, StyledMenuButtonProps };
@@ -0,0 +1,17 @@
1
+ import { Comp } from '@redsift/design-system';
2
+ import { MenuButtonContentProps } from './types.js';
3
+ import { MenuButtonContentHeaderProps } from '../menu-button-content-header/types.js';
4
+ import { MenuButtonContentMenuProps } from '../menu-button-content-menu/types.js';
5
+ import { MenuButtonContentFooterProps } from '../menu-button-content-footer/types.js';
6
+
7
+ /**
8
+ * The MenuButtonContent component.
9
+ */
10
+ declare const BaseMenuButtonContent: Comp<MenuButtonContentProps, HTMLDivElement>;
11
+ declare const MenuButtonContent: Comp<MenuButtonContentProps, HTMLDivElement> & {
12
+ Header: Comp<MenuButtonContentHeaderProps, HTMLDivElement>;
13
+ Menu: Comp<MenuButtonContentMenuProps, HTMLDivElement>;
14
+ Footer: Comp<MenuButtonContentFooterProps, HTMLDivElement>;
15
+ };
16
+
17
+ export { BaseMenuButtonContent, MenuButtonContent };
@@ -0,0 +1,68 @@
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
@@ -0,0 +1 @@
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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D,SAAS,EAAEyC,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;;;;"}
@@ -0,0 +1,9 @@
1
+ import { PopoverContentProps } from '@redsift/popovers';
2
+
3
+ /**
4
+ * Component props.
5
+ */
6
+ interface MenuButtonContentProps extends PopoverContentProps {
7
+ }
8
+
9
+ export { MenuButtonContentProps };
@@ -0,0 +1,9 @@
1
+ import { MenuButtonContentFooterProps } from './types.js';
2
+ import { Comp } from '@redsift/design-system';
3
+
4
+ /**
5
+ * The MenuButtonContentFooter component.
6
+ */
7
+ declare const MenuButtonContentFooter: Comp<MenuButtonContentFooterProps, HTMLDivElement>;
8
+
9
+ export { MenuButtonContentFooter };
@@ -0,0 +1,28 @@
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
@@ -0,0 +1 @@
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;;;;"}
@@ -0,0 +1,12 @@
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
@@ -0,0 +1 @@
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;;;;"}
@@ -0,0 +1,11 @@
1
+ import { ContainerProps } from '@redsift/design-system';
2
+ import { ComponentProps } from 'react';
3
+
4
+ /**
5
+ * Component props.
6
+ */
7
+ interface MenuButtonContentFooterProps extends ComponentProps<'div'>, ContainerProps {
8
+ }
9
+ type StyledMenuButtonContentFooterProps = MenuButtonContentFooterProps & {};
10
+
11
+ export { MenuButtonContentFooterProps, StyledMenuButtonContentFooterProps };
@@ -0,0 +1,9 @@
1
+ import { MenuButtonContentHeaderProps } from './types.js';
2
+ import { Comp } from '@redsift/design-system';
3
+
4
+ /**
5
+ * The MenuButtonContentHeader component.
6
+ */
7
+ declare const MenuButtonContentHeader: Comp<MenuButtonContentHeaderProps, HTMLDivElement>;
8
+
9
+ export { MenuButtonContentHeader };
@@ -0,0 +1,28 @@
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
@@ -0,0 +1 @@
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;;;;"}
@@ -0,0 +1,12 @@
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
@@ -0,0 +1 @@
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;;;;"}
@@ -0,0 +1,11 @@
1
+ import { ContainerProps } from '@redsift/design-system';
2
+ import { ComponentProps } from 'react';
3
+
4
+ /**
5
+ * Component props.
6
+ */
7
+ interface MenuButtonContentHeaderProps extends ComponentProps<'div'>, ContainerProps {
8
+ }
9
+ type StyledMenuButtonContentHeaderProps = MenuButtonContentHeaderProps & {};
10
+
11
+ export { MenuButtonContentHeaderProps, StyledMenuButtonContentHeaderProps };
@@ -0,0 +1,9 @@
1
+ import { Comp } from '@redsift/design-system';
2
+ import { MenuButtonContentMenuProps } from './types.js';
3
+
4
+ /**
5
+ * The MenuButtonContentMenu component.
6
+ */
7
+ declare const MenuButtonContentMenu: Comp<MenuButtonContentMenuProps, HTMLDivElement>;
8
+
9
+ export { MenuButtonContentMenu };
@@ -0,0 +1,41 @@
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
@@ -0,0 +1 @@
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"],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qBAAqB,CAACK,SAAS,GAAGN,SAAS,CAAA;AAC3CC,qBAAqB,CAAC6B,WAAW,GAAG/B,cAAc;;;;"}
@@ -0,0 +1,9 @@
1
+ import { FlexboxProps } from '@redsift/design-system';
2
+
3
+ /**
4
+ * Component props.
5
+ */
6
+ interface MenuButtonContentMenuProps extends FlexboxProps {
7
+ }
8
+
9
+ export { MenuButtonContentMenuProps };
@@ -0,0 +1,9 @@
1
+ import { Comp } from '@redsift/design-system';
2
+ import { MenuButtonTriggerProps } from './types.js';
3
+
4
+ /**
5
+ * The MenuButtonTrigger component.
6
+ */
7
+ declare const MenuButtonTrigger: Comp<MenuButtonTriggerProps, HTMLButtonElement>;
8
+
9
+ export { MenuButtonTrigger };