@redsift/pickers 11.5.0 → 11.6.0-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 (71) hide show
  1. package/_internal/Combobox2.js +150 -0
  2. package/_internal/Combobox2.js.map +1 -0
  3. package/_internal/ComboboxContent.js +70 -0
  4. package/_internal/ComboboxContent.js.map +1 -0
  5. package/_internal/ComboboxContentFooter.js +36 -0
  6. package/_internal/ComboboxContentFooter.js.map +1 -0
  7. package/_internal/ComboboxContentHeader.js +36 -0
  8. package/_internal/ComboboxContentHeader.js.map +1 -0
  9. package/_internal/ComboboxContentListbox.js +123 -0
  10. package/_internal/ComboboxContentListbox.js.map +1 -0
  11. package/_internal/ComboboxTrigger.js +377 -0
  12. package/_internal/ComboboxTrigger.js.map +1 -0
  13. package/_internal/Item2.js +199 -0
  14. package/_internal/Item2.js.map +1 -0
  15. package/_internal/MenuButton.js +75 -0
  16. package/_internal/MenuButton.js.map +1 -0
  17. package/_internal/MenuButtonContent.js +68 -0
  18. package/_internal/MenuButtonContent.js.map +1 -0
  19. package/_internal/MenuButtonContentFooter.js +36 -0
  20. package/_internal/MenuButtonContentFooter.js.map +1 -0
  21. package/_internal/MenuButtonContentHeader.js +36 -0
  22. package/_internal/MenuButtonContentHeader.js.map +1 -0
  23. package/_internal/MenuButtonContentMenu.js +41 -0
  24. package/_internal/MenuButtonContentMenu.js.map +1 -0
  25. package/_internal/MenuButtonTrigger.js +168 -0
  26. package/_internal/MenuButtonTrigger.js.map +1 -0
  27. package/_internal/Select2.js +115 -0
  28. package/_internal/Select2.js.map +1 -0
  29. package/_internal/SelectContent.js +62 -0
  30. package/_internal/SelectContent.js.map +1 -0
  31. package/_internal/SelectTrigger.js +250 -0
  32. package/_internal/SelectTrigger.js.map +1 -0
  33. package/_internal/_rollupPluginBabelHelpers.js +93 -0
  34. package/_internal/_rollupPluginBabelHelpers.js.map +1 -0
  35. package/_internal/combobox-content-footer.js +2 -0
  36. package/_internal/combobox-content-footer.js.map +1 -0
  37. package/_internal/combobox-content-header.js +2 -0
  38. package/_internal/combobox-content-header.js.map +1 -0
  39. package/_internal/combobox-content-listbox.js +2 -0
  40. package/_internal/combobox-content-listbox.js.map +1 -0
  41. package/_internal/combobox-content.js +2 -0
  42. package/_internal/combobox-content.js.map +1 -0
  43. package/_internal/combobox-trigger.js +2 -0
  44. package/_internal/combobox-trigger.js.map +1 -0
  45. package/_internal/combobox.js +3 -0
  46. package/_internal/combobox.js.map +1 -0
  47. package/_internal/item.js +2 -0
  48. package/_internal/item.js.map +1 -0
  49. package/_internal/menu-button-content-footer.js +2 -0
  50. package/_internal/menu-button-content-footer.js.map +1 -0
  51. package/_internal/menu-button-content-header.js +2 -0
  52. package/_internal/menu-button-content-header.js.map +1 -0
  53. package/_internal/menu-button-content-menu.js +2 -0
  54. package/_internal/menu-button-content-menu.js.map +1 -0
  55. package/_internal/menu-button-content.js +2 -0
  56. package/_internal/menu-button-content.js.map +1 -0
  57. package/_internal/menu-button-trigger.js +2 -0
  58. package/_internal/menu-button-trigger.js.map +1 -0
  59. package/_internal/menu-button.js +2 -0
  60. package/_internal/menu-button.js.map +1 -0
  61. package/_internal/select-content.js +2 -0
  62. package/_internal/select-content.js.map +1 -0
  63. package/_internal/select-trigger.js +2 -0
  64. package/_internal/select-trigger.js.map +1 -0
  65. package/_internal/select.js +2 -0
  66. package/_internal/select.js.map +1 -0
  67. package/_internal/types.js +26 -0
  68. package/_internal/types.js.map +1 -0
  69. package/index.js +17 -1822
  70. package/index.js.map +1 -1
  71. package/package.json +8 -8
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Item2.js","sources":["../../src/components/item/useMenuItem.ts","../../src/components/item/Item.tsx"],"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","import React, { forwardRef, RefObject, useContext, useRef } from 'react';\nimport classNames from 'classnames';\nimport { useMenuItem } from './useMenuItem';\nimport { useMergeRefs } from '@redsift/popovers';\nimport {\n ButtonsColorPalette,\n Comp,\n ConditionalWrapper,\n FocusWithinGroupContext,\n isComponent,\n StyledGradientBorder,\n useTheme,\n RenderedListboxItem,\n ItemProps,\n StyledItem,\n useId,\n} from '@redsift/design-system';\n\nconst COMPONENT_NAME = 'Item';\nconst CLASSNAME = 'redsift-item';\n\nconst RenderedMenuItem: Comp<Omit<ItemProps, 'value'>, HTMLElement> = forwardRef((props, ref) => {\n const {\n borderRadius = '0',\n children,\n className,\n color: propsColor,\n hasBorder,\n id: propsId,\n isActive,\n isDisabled: propsIsDisabled,\n isHovered,\n theme: propsTheme,\n onClick,\n ...forwardedProps\n } = props;\n const [_id] = useId();\n const id = propsId ?? _id;\n const _ref = useRef<HTMLElement>();\n const divRef = useMergeRefs([ref, _ref]);\n const linkRef = useRef<HTMLAnchorElement>(null);\n\n const isLinkMenuItem = isComponent('Link')(children);\n const { tabIndex, isFocused, isDisabled, handleKeyDown, handleClick } = useMenuItem({\n domElementRef: _ref as RefObject<Element>,\n id,\n isDisabled: propsIsDisabled!,\n onClick: onClick as any,\n isLinkMenuItem,\n linkRef,\n hasPopup: props['aria-haspopup'] !== undefined,\n });\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : 'primary';\n const isGradient = color === ButtonsColorPalette.radar;\n\n return (\n <ConditionalWrapper\n condition={isGradient}\n wrapper={(children) => (\n <StyledGradientBorder\n $borderRadius={borderRadius}\n $color={color}\n $isActive={isActive}\n $isDisabled={isDisabled}\n $isHovered={isHovered}\n $theme={theme}\n width=\"auto\"\n >\n {children}\n </StyledGradientBorder>\n )}\n >\n <StyledItem\n as=\"li\"\n role={isLinkMenuItem ? 'none' : 'menuitem'}\n {...forwardedProps}\n id={id}\n $borderRadius={borderRadius}\n $color={color}\n $hasBorder={hasBorder}\n $hasCheckbox={false}\n $isActive={isActive}\n $isDisabled={isDisabled}\n $isGradient={isGradient}\n $isHovered={isHovered || isFocused}\n $theme={theme}\n aria-disabled={isDisabled}\n className={classNames(Item.className, className)}\n onClick={isDisabled ? undefined : handleClick}\n ref={divRef}\n onKeyDown={handleKeyDown}\n tabIndex={tabIndex}\n >\n {isLinkMenuItem\n ? React.cloneElement(children, {\n role: 'menuitem',\n ref: linkRef,\n })\n : children}\n </StyledItem>\n </ConditionalWrapper>\n );\n});\n\n/**\n * The Item component.\n */\nexport const Item: Comp<ItemProps, HTMLElement> = forwardRef((props, ref) => {\n const { value } = props;\n const focusContext = useContext(FocusWithinGroupContext);\n const isListbox = focusContext.state.listRole === 'listbox';\n\n if (!focusContext.state.filter) {\n return isListbox ? (\n <RenderedListboxItem {...props} value={props.value!} ref={ref} />\n ) : (\n <RenderedMenuItem {...props} ref={ref} />\n );\n }\n\n const { value: filterValue, type, caseSensitive } = focusContext.state.filter;\n\n if (!filterValue) {\n return isListbox ? (\n <RenderedListboxItem {...props} value={props.value!} ref={ref} />\n ) : (\n <RenderedMenuItem {...props} ref={ref} />\n );\n } else if (\n caseSensitive &&\n ((type === 'startsWith' && value!.startsWith(filterValue)) ||\n (type === 'contains' && value!.includes(filterValue)) ||\n (type === 'endsWith' && value!.endsWith(filterValue)))\n ) {\n return isListbox ? (\n <RenderedListboxItem {...props} value={props.value!} ref={ref} />\n ) : (\n <RenderedMenuItem {...props} ref={ref} />\n );\n } else if (\n !caseSensitive &&\n ((type === 'startsWith' && value!.toLowerCase().startsWith(filterValue.toLowerCase())) ||\n (type === 'contains' && value!.toLowerCase().includes(filterValue.toLowerCase())) ||\n (type === 'endsWith' && value!.toLowerCase().endsWith(filterValue.toLowerCase())))\n ) {\n return isListbox ? (\n <RenderedListboxItem {...props} value={props.value!} ref={ref} />\n ) : (\n <RenderedMenuItem {...props} ref={ref} />\n );\n }\n\n return null;\n});\nItem.className = CLASSNAME;\nItem.displayName = COMPONENT_NAME;\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","COMPONENT_NAME","CLASSNAME","RenderedMenuItem","forwardRef","ref","borderRadius","children","className","color","propsColor","hasBorder","propsId","isActive","propsIsDisabled","isHovered","theme","propsTheme","forwardedProps","_objectWithoutProperties","_excluded","_id","useId","_ref","useRef","divRef","useMergeRefs","isComponent","undefined","useTheme","Object","values","ButtonsColorPalette","includes","isGradient","radar","React","createElement","ConditionalWrapper","condition","wrapper","StyledGradientBorder","$borderRadius","$color","$isActive","$isDisabled","$isHovered","$theme","width","StyledItem","_extends","as","role","$hasBorder","$hasCheckbox","$isGradient","classNames","Item","onKeyDown","cloneElement","value","focusContext","useContext","FocusWithinGroupContext","isListbox","state","listRole","filter","RenderedListboxItem","filterValue","type","caseSensitive","startsWith","endsWith","toLowerCase","displayName"],"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;GAAuB,GAAGC,iBAAiB,EAAE,CAAA;EACrF,MAAM;IACJC,QAAQ;IACRC,SAAS;AACTC,IAAAA,aAAa,EAAEC,kBAAkB;AACjCC,IAAAA,WAAW,EAAEC,gBAAAA;GACd,GAAGC,kBAAkB,CAAC;IAAEjB,aAAa;AAAEE,IAAAA,UAAU,EAAEA,UAAW;AAAED,IAAAA,EAAAA;AAAG,GAAC,CAAC,CAAA;AAEtEiB,EAAAA,SAAS,CAAC,MAAM;AACd,IAAA,IAAIZ,QAAQ,IAAI,CAACE,kBAAkB,EAAE;AACnCC,MAAAA,qBAAqB,aAArBA,qBAAqB,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAArBA,qBAAqB,CAAG,IAAI,CAAC,CAAA;AAC/B,KAAA;GACD,EAAE,CAACH,QAAQ,EAAEE,kBAAkB,EAAEC,qBAAqB,CAAC,CAAC,CAAA;AAEzD,EAAA,MAAMI,aAAa,GAAGM,WAAW,CAAEC,KAAoB,IAAK;AAC1D,IAAA,MAAMC,IAAI,GAAGD,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EvF,KAAK,CAACuF,KAAO;AAACvD,MAAAA,GAAG,EAAEA,GAAAA;KAAM,CAAA,CAAC,gBAEjE+B,KAAA,CAAAC,aAAA,CAAClC,gBAAgB,EAAA+C,QAAA,CAAA,EAAA,EAAK7E,KAAK,EAAA;AAAEgC,MAAAA,GAAG,EAAEA,GAAAA;AAAI,KAAA,CAAE,CACzC,CAAA;AACH,GAAC,MAAM,IACL,CAACkE,aAAa,KACZD,IAAI,KAAK,YAAY,IAAIV,KAAK,CAAEc,WAAW,EAAE,CAACF,UAAU,CAACH,WAAW,CAACK,WAAW,EAAE,CAAC,IAClFJ,IAAI,KAAK,UAAU,IAAIV,KAAK,CAAEc,WAAW,EAAE,CAACzC,QAAQ,CAACoC,WAAW,CAACK,WAAW,EAAE,CAAE,IAChFJ,IAAI,KAAK,UAAU,IAAIV,KAAK,CAAEc,WAAW,EAAE,CAACD,QAAQ,CAACJ,WAAW,CAACK,WAAW,EAAE,CAAE,CAAC,EACpF;IACA,OAAOV,SAAS,gBACd5B,KAAA,CAAAC,aAAA,CAAC+B,mBAAmB,EAAAlB,QAAA,CAAA,EAAA,EAAK7E,KAAK,EAAA;MAAEuF,KAAK,EAAEvF,KAAK,CAACuF,KAAO;AAACvD,MAAAA,GAAG,EAAEA,GAAAA;KAAM,CAAA,CAAC,gBAEjE+B,KAAA,CAAAC,aAAA,CAAClC,gBAAgB,EAAA+C,QAAA,CAAA,EAAA,EAAK7E,KAAK,EAAA;AAAEgC,MAAAA,GAAG,EAAEA,GAAAA;AAAI,KAAA,CAAE,CACzC,CAAA;AACH,GAAA;AAEA,EAAA,OAAO,IAAI,CAAA;AACb,CAAC,EAAC;AACFoD,IAAI,CAACjD,SAAS,GAAGN,SAAS,CAAA;AAC1BuD,IAAI,CAACkB,WAAW,GAAG1E,cAAc;;;;"}
@@ -0,0 +1,75 @@
1
+ import { a as _extends } from './_rollupPluginBabelHelpers.js';
2
+ import React from 'react';
3
+ import { Popover } from '@redsift/popovers';
4
+ import { a as MenuButtonContext, M as MenuButtonTrigger } from './MenuButtonTrigger.js';
5
+ import { useTheme, ThemeProvider, FocusWithinGroup, Flexbox, Text, Theme } from '@redsift/design-system';
6
+ import { M as MenuButtonContent } from './MenuButtonContent.js';
7
+
8
+ const COMPONENT_NAME = 'MenuButton';
9
+ const CLASSNAME = 'redsift-menu-button';
10
+
11
+ /**
12
+ * The MenuButton component.
13
+ */
14
+ const BaseMenuButton = props => {
15
+ const {
16
+ color,
17
+ description,
18
+ descriptionProps,
19
+ isDisabled,
20
+ label,
21
+ labelProps,
22
+ minWidth = 'trigger-width',
23
+ theme: propsTheme,
24
+ triggerClassName,
25
+ variant,
26
+ wrapperProps
27
+ } = props;
28
+ const theme = useTheme(propsTheme);
29
+
30
+ /** MenuButton context. */
31
+ const state = {
32
+ color,
33
+ isDisabled: isDisabled || false,
34
+ theme,
35
+ triggerClassName,
36
+ variant
37
+ };
38
+ return /*#__PURE__*/React.createElement(ThemeProvider, {
39
+ value: {
40
+ theme
41
+ }
42
+ }, /*#__PURE__*/React.createElement(FocusWithinGroup, {
43
+ focusType: "virtual-focus",
44
+ listRole: "menu",
45
+ focusOnInit: false
46
+ }, /*#__PURE__*/React.createElement(MenuButtonContext.Provider, {
47
+ value: state
48
+ }, /*#__PURE__*/React.createElement(Flexbox, _extends({
49
+ flexDirection: "column",
50
+ alignItems: "flex-start",
51
+ gap: "0px"
52
+ }, wrapperProps), label && typeof label === 'string' ? /*#__PURE__*/React.createElement(Text, labelProps, label) : label ? label : null, /*#__PURE__*/React.createElement(Popover, _extends({
53
+ theme: theme,
54
+ overrideDisplayName: {
55
+ content: 'MenuButtonContent',
56
+ trigger: 'MenuButtonTrigger'
57
+ },
58
+ placement: "bottom-end",
59
+ minWidth: minWidth
60
+ }, props)), description && typeof description === 'string' ? /*#__PURE__*/React.createElement(Text, _extends({
61
+ theme: theme,
62
+ marginTop: "8px",
63
+ variant: "caption",
64
+ color: theme === Theme.light ? 'dark-grey' : 'white'
65
+ }, descriptionProps), description) : description ? description : null))));
66
+ };
67
+ BaseMenuButton.className = CLASSNAME;
68
+ BaseMenuButton.displayName = COMPONENT_NAME;
69
+ const MenuButton = Object.assign(BaseMenuButton, {
70
+ Trigger: MenuButtonTrigger,
71
+ Content: MenuButtonContent
72
+ });
73
+
74
+ export { BaseMenuButton as B, MenuButton as M };
75
+ //# 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,GAAG,YAAY,CAAA;AACnC,MAAMC,SAAS,GAAG,qBAAqB,CAAA;;AAEvC;AACA;AACA;AACaC,MAAAA,cAGZ,GAAIC,KAAK,IAAK;EACb,MAAM;IACJC,KAAK;IACLC,WAAW;IACXC,gBAAgB;IAChBC,UAAU;IACVC,KAAK;IACLC,UAAU;AACVC,IAAAA,QAAQ,GAAG,eAAe;AAC1BC,IAAAA,KAAK,EAAEC,UAAU;IACjBC,gBAAgB;IAChBC,OAAO;AACPC,IAAAA,YAAAA;AACF,GAAC,GAAGZ,KAAK,CAAA;AAET,EAAA,MAAMQ,KAAK,GAAGK,QAAQ,CAACJ,UAAU,CAAC,CAAA;;AAElC;AACA,EAAA,MAAMK,KAAK,GAAG;IACZb,KAAK;IACLG,UAAU,EAAEA,UAAU,IAAI,KAAK;IAC/BI,KAAK;IACLE,gBAAgB;AAChBC,IAA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fzB,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,68 @@
1
+ import { a as _extends, b as _objectSpread2 } from './_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 { M as MenuButtonContentMenu } from './MenuButtonContentMenu.js';
7
+ import { M as MenuButtonContentHeader } from './MenuButtonContentHeader.js';
8
+ import { M as MenuButtonContentFooter } from './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 as B, MenuButtonContent as M };
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,EAAEhB,GA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EyC,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,36 @@
1
+ import { _ as _objectWithoutProperties, a as _extends } from './_rollupPluginBabelHelpers.js';
2
+ import React, { forwardRef } from 'react';
3
+ import classNames from 'classnames';
4
+ import styled from 'styled-components';
5
+ import { baseContainer } from '@redsift/design-system';
6
+
7
+ /**
8
+ * Component style.
9
+ */
10
+ const StyledMenuButtonContentFooter = styled.div`
11
+ ${baseContainer}
12
+ `;
13
+
14
+ const _excluded = ["children", "className"];
15
+ const COMPONENT_NAME = 'MenuButtonContentFooter';
16
+ const CLASSNAME = 'redsift-combobox-content-footer';
17
+
18
+ /**
19
+ * The MenuButtonContentFooter component.
20
+ */
21
+ const MenuButtonContentFooter = /*#__PURE__*/forwardRef((props, ref) => {
22
+ const {
23
+ children,
24
+ className
25
+ } = props,
26
+ forwardedProps = _objectWithoutProperties(props, _excluded);
27
+ return /*#__PURE__*/React.createElement(StyledMenuButtonContentFooter, _extends({}, forwardedProps, {
28
+ className: classNames(MenuButtonContentFooter.className, className),
29
+ ref: ref
30
+ }), children);
31
+ });
32
+ MenuButtonContentFooter.className = CLASSNAME;
33
+ MenuButtonContentFooter.displayName = COMPONENT_NAME;
34
+
35
+ export { MenuButtonContentFooter as M };
36
+ //# sourceMappingURL=MenuButtonContentFooter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuButtonContentFooter.js","sources":["../../src/components/menu-button-content-footer/styles.ts","../../src/components/menu-button-content-footer/MenuButtonContentFooter.tsx"],"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","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":["StyledMenuButtonContentFooter","styled","div","baseContainer","COMPONENT_NAME","CLASSNAME","MenuButtonContentFooter","forwardRef","props","ref","children","className","forwardedProps","_objectWithoutProperties","_excluded","React","createElement","_extends","classNames","displayName"],"mappings":";;;;;;AAIA;AACA;AACA;AACO,MAAMA,6BAA6B,GAAGC,MAAM,CAACC,GAAwC,CAAA;AAC5F,EAAA,EAAIC,aAAc,CAAA;AAClB,CAAC;;;ACFD,MAAMC,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,CAAChB,6BAA6B,EAAAiB,QAAA,KACxBL,cAAc,EAAA;IAClBD,SAAS,EAAEO,UAAU,CAACZ,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,CAACa,WAAW,GAAGf,cAAc;;;;"}
@@ -0,0 +1,36 @@
1
+ import { _ as _objectWithoutProperties, a as _extends } from './_rollupPluginBabelHelpers.js';
2
+ import React, { forwardRef } from 'react';
3
+ import classNames from 'classnames';
4
+ import styled from 'styled-components';
5
+ import { baseContainer } from '@redsift/design-system';
6
+
7
+ /**
8
+ * Component style.
9
+ */
10
+ const StyledMenuButtonContentHeader = styled.div`
11
+ ${baseContainer}
12
+ `;
13
+
14
+ const _excluded = ["children", "className"];
15
+ const COMPONENT_NAME = 'MenuButtonContentHeader';
16
+ const CLASSNAME = 'redsift-combobox-content-header';
17
+
18
+ /**
19
+ * The MenuButtonContentHeader component.
20
+ */
21
+ const MenuButtonContentHeader = /*#__PURE__*/forwardRef((props, ref) => {
22
+ const {
23
+ children,
24
+ className
25
+ } = props,
26
+ forwardedProps = _objectWithoutProperties(props, _excluded);
27
+ return /*#__PURE__*/React.createElement(StyledMenuButtonContentHeader, _extends({}, forwardedProps, {
28
+ className: classNames(MenuButtonContentHeader.className, className),
29
+ ref: ref
30
+ }), children);
31
+ });
32
+ MenuButtonContentHeader.className = CLASSNAME;
33
+ MenuButtonContentHeader.displayName = COMPONENT_NAME;
34
+
35
+ export { MenuButtonContentHeader as M };
36
+ //# sourceMappingURL=MenuButtonContentHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuButtonContentHeader.js","sources":["../../src/components/menu-button-content-header/styles.ts","../../src/components/menu-button-content-header/MenuButtonContentHeader.tsx"],"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","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":["StyledMenuButtonContentHeader","styled","div","baseContainer","COMPONENT_NAME","CLASSNAME","MenuButtonContentHeader","forwardRef","props","ref","children","className","forwardedProps","_objectWithoutProperties","_excluded","React","createElement","_extends","classNames","displayName"],"mappings":";;;;;;AAIA;AACA;AACA;AACO,MAAMA,6BAA6B,GAAGC,MAAM,CAACC,GAAwC,CAAA;AAC5F,EAAA,EAAIC,aAAc,CAAA;AAClB,CAAC;;;ACFD,MAAMC,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,CAAChB,6BAA6B,EAAAiB,QAAA,KACxBL,cAAc,EAAA;IAClBD,SAAS,EAAEO,UAAU,CAACZ,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,CAACa,WAAW,GAAGf,cAAc;;;;"}
@@ -0,0 +1,41 @@
1
+ import { _ as _objectWithoutProperties, a as _extends } from './_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 as M };
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"],"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;;;;"}
@@ -0,0 +1,168 @@
1
+ import { b as _objectSpread2 } from './_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
+
7
+ const MenuButtonContext = /*#__PURE__*/React.createContext(null);
8
+
9
+ const COMPONENT_NAME = 'MenuButtonTrigger';
10
+ const CLASSNAME = 'redsift-menu-button-trigger';
11
+
12
+ /**
13
+ * The MenuButtonTrigger component.
14
+ */
15
+ const MenuButtonTrigger = /*#__PURE__*/forwardRef((props, ref) => {
16
+ const {
17
+ children
18
+ } = props;
19
+ const {
20
+ getReferenceProps,
21
+ isOpen,
22
+ handleOpen,
23
+ refs
24
+ } = usePopoverContext();
25
+ const childrenRef = children.ref;
26
+ const triggerRef = useMergeRefs([refs.setReference, ref, childrenRef]);
27
+ const focusContext = useContext(FocusWithinGroupContext);
28
+ const menuButtonContext = useContext(MenuButtonContext);
29
+ const theme = useTheme();
30
+ const renderedChildren = typeof children === 'function' ? children({
31
+ isOpen
32
+ }) : children;
33
+ const handleKeyDown = event => {
34
+ const code = event.code;
35
+ if (code === 'Escape' || code === 'Tab') {
36
+ if (isOpen) {
37
+ handleOpen(false);
38
+ }
39
+ } else if (code === 'ArrowDown') {
40
+ if (!isOpen) {
41
+ handleOpen(true);
42
+ }
43
+ if (focusContext.state.selectedId !== null) {
44
+ focusContext.dispatch({
45
+ type: FocusWithinGroupActionType.DELAY_ACTION,
46
+ payload: {
47
+ type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,
48
+ payload: {
49
+ key: EventKey.ArrowDown,
50
+ ctrlKey: event.ctrlKey
51
+ }
52
+ }
53
+ });
54
+ } else {
55
+ focusContext.dispatch({
56
+ type: FocusWithinGroupActionType.DELAY_ACTION,
57
+ payload: {
58
+ type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,
59
+ payload: {
60
+ key: EventKey.Home,
61
+ ctrlKey: event.ctrlKey
62
+ }
63
+ }
64
+ });
65
+ }
66
+ event.preventDefault();
67
+ event.stopPropagation();
68
+ } else if (code === 'ArrowUp') {
69
+ if (!isOpen) {
70
+ handleOpen(true);
71
+ }
72
+ focusContext.dispatch({
73
+ type: FocusWithinGroupActionType.DELAY_ACTION,
74
+ payload: {
75
+ type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,
76
+ payload: {
77
+ key: focusContext.state.selectedId !== null ? EventKey.ArrowUp : EventKey.Home,
78
+ ctrlKey: event.ctrlKey
79
+ }
80
+ }
81
+ });
82
+ event.preventDefault();
83
+ event.stopPropagation();
84
+ } else if (code === 'Home') {
85
+ if (!isOpen) {
86
+ handleOpen(true);
87
+ }
88
+ focusContext.dispatch({
89
+ type: FocusWithinGroupActionType.DELAY_ACTION,
90
+ payload: {
91
+ type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,
92
+ payload: {
93
+ key: EventKey.Home,
94
+ ctrlKey: event.ctrlKey
95
+ }
96
+ }
97
+ });
98
+ event.preventDefault();
99
+ event.stopPropagation();
100
+ } else if (code === 'End') {
101
+ if (!isOpen) {
102
+ handleOpen(true);
103
+ }
104
+ focusContext.dispatch({
105
+ type: FocusWithinGroupActionType.DELAY_ACTION,
106
+ payload: {
107
+ type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,
108
+ payload: {
109
+ key: EventKey.End,
110
+ ctrlKey: event.ctrlKey
111
+ }
112
+ }
113
+ });
114
+ event.preventDefault();
115
+ event.stopPropagation();
116
+ } else if (code === 'Enter') {
117
+ if (isOpen && focusContext.state.selectedId) {
118
+ var _document$getElementB, _document$getElementB2, _document$getElementB3, _document$getElementB4;
119
+ (_document$getElementB = document.getElementById(focusContext.state.selectedId)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.click();
120
+ (_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();
121
+ }
122
+ }
123
+ };
124
+ const handleClick = event => {
125
+ event.preventDefault();
126
+ event.stopPropagation();
127
+ if (isOpen) {
128
+ handleOpen(false);
129
+ } else {
130
+ var _focusContext$state$a, _focusContext$state$a2;
131
+ handleOpen(true);
132
+ focusContext.dispatch({
133
+ type: FocusWithinGroupActionType.DELAY_ACTION,
134
+ payload: {
135
+ type: FocusWithinGroupActionType.FOCUS_ON_LIST,
136
+ payload: {
137
+ 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 : ''
138
+ }
139
+ }
140
+ });
141
+ }
142
+ };
143
+ if (isComponent('Button')(renderedChildren) || isComponent('IconButton')(renderedChildren)) {
144
+ var _props$children, _focusContext$state$a3, _menuButtonContext$co, _menuButtonContext$va;
145
+ return /*#__PURE__*/React.cloneElement(renderedChildren, _objectSpread2(_objectSpread2({}, getReferenceProps(_objectSpread2(_objectSpread2(_objectSpread2({
146
+ ref: triggerRef
147
+ }, props), renderedChildren.props), {}, {
148
+ children: (_props$children = renderedChildren.props.children) !== null && _props$children !== void 0 ? _props$children : ''
149
+ }))), {}, {
150
+ theme,
151
+ 'aria-activedescendant': isOpen ? (_focusContext$state$a3 = focusContext.state.activedescendant) === null || _focusContext$state$a3 === void 0 ? void 0 : _focusContext$state$a3[0] : undefined,
152
+ className: classNames(renderedChildren.props.className, menuButtonContext === null || menuButtonContext === void 0 ? void 0 : menuButtonContext.triggerClassName),
153
+ color: (_menuButtonContext$co = menuButtonContext === null || menuButtonContext === void 0 ? void 0 : menuButtonContext.color) !== null && _menuButtonContext$co !== void 0 ? _menuButtonContext$co : renderedChildren.props.color,
154
+ isActive: isOpen,
155
+ isDisabled: menuButtonContext === null || menuButtonContext === void 0 ? void 0 : menuButtonContext.isDisabled,
156
+ onClick: handleClick,
157
+ onKeyDown: handleKeyDown,
158
+ role: 'button',
159
+ variant: (_menuButtonContext$va = menuButtonContext === null || menuButtonContext === void 0 ? void 0 : menuButtonContext.variant) !== null && _menuButtonContext$va !== void 0 ? _menuButtonContext$va : renderedChildren.props.variant
160
+ }));
161
+ }
162
+ return /*#__PURE__*/React.createElement(React.Fragment, null, renderedChildren);
163
+ });
164
+ MenuButtonTrigger.className = CLASSNAME;
165
+ MenuButtonTrigger.displayName = COMPONENT_NAME;
166
+
167
+ export { MenuButtonTrigger as M, MenuButtonContext as a };
168
+ //# sourceMappingURL=MenuButtonTrigger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuButtonTrigger.js","sources":["../../src/components/menu-button/context.ts","../../src/components/menu-button-trigger/MenuButtonTrigger.tsx"],"sourcesContent":["import React from 'react';\nimport { MenuButtonState } from './types';\n\nexport const MenuButtonContext = React.createContext<MenuButtonState | null>(null);\n","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":["MenuButtonContext","React","createContext","COMPONENT_NAME","CLASSNAME","MenuButtonTrigger","forwardRef","props","ref","children","getReferenceProps","isOpen","handleOpen","refs","usePopoverContext","childrenRef","triggerRef","useMergeRefs","setReference","focusContext","useContext","FocusWithinGroupContext","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","cloneElement","_objectSpread","undefined","className","classNames","triggerClassName","color","isActive","isDisabled","onClick","onKeyDown","role","variant","createElement","Fragment","displayName"],"mappings":";;;;;;AAGO,MAAMA,iBAAiB,gBAAGC,KAAK,CAACC,aAAa,CAAyB,IAAI;;ACYjF,MAAMC,cAAc,GAAG,mBAAmB,CA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