@redsift/pickers 11.6.0-muiv5-alpha.9 → 11.6.0-muiv5-alpha.11

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 (125) hide show
  1. package/{_internal → _virtual/_internal}/_rollupPluginBabelHelpers.js +1 -1
  2. package/{_internal → components/combobox/_internal}/Combobox2.js +6 -5
  3. package/components/combobox/_internal/Combobox2.js.map +1 -0
  4. package/components/combobox/_internal/combobox.js +3 -0
  5. package/components/combobox/_internal/context.js +6 -0
  6. package/components/combobox/_internal/context.js.map +1 -0
  7. package/{_internal → components/combobox/_internal}/types.js +1 -5
  8. package/components/combobox/_internal/types.js.map +1 -0
  9. package/components/combobox/intl/_internal/en-US.js +13 -0
  10. package/components/combobox/intl/_internal/en-US.js.map +1 -0
  11. package/components/combobox/intl/_internal/fr-FR.js +13 -0
  12. package/components/combobox/intl/_internal/fr-FR.js.map +1 -0
  13. package/components/combobox/intl/index.js +10 -0
  14. package/components/combobox/intl/index.js.map +1 -0
  15. package/{_internal → components/combobox-content/_internal}/ComboboxContent.js +6 -6
  16. package/components/combobox-content/_internal/ComboboxContent.js.map +1 -0
  17. package/components/combobox-content/_internal/combobox-content.js +2 -0
  18. package/{_internal → components/combobox-content-footer/_internal}/ComboboxContentFooter.js +3 -11
  19. package/components/combobox-content-footer/_internal/ComboboxContentFooter.js.map +1 -0
  20. package/components/combobox-content-footer/_internal/combobox-content-footer.js +2 -0
  21. package/components/combobox-content-footer/_internal/styles.js +12 -0
  22. package/components/combobox-content-footer/_internal/styles.js.map +1 -0
  23. package/{_internal → components/combobox-content-header/_internal}/ComboboxContentHeader.js +3 -11
  24. package/components/combobox-content-header/_internal/ComboboxContentHeader.js.map +1 -0
  25. package/components/combobox-content-header/_internal/combobox-content-header.js +2 -0
  26. package/components/combobox-content-header/_internal/styles.js +12 -0
  27. package/components/combobox-content-header/_internal/styles.js.map +1 -0
  28. package/{_internal → components/combobox-content-listbox/_internal}/ComboboxContentListbox.js +4 -3
  29. package/components/combobox-content-listbox/_internal/ComboboxContentListbox.js.map +1 -0
  30. package/components/combobox-content-listbox/_internal/combobox-content-listbox.js +2 -0
  31. package/{_internal → components/combobox-trigger/_internal}/ComboboxTrigger.js +5 -30
  32. package/components/combobox-trigger/_internal/ComboboxTrigger.js.map +1 -0
  33. package/components/combobox-trigger/_internal/combobox-trigger.js +2 -0
  34. package/{_internal → components/item/_internal}/Item2.js +6 -68
  35. package/components/item/_internal/Item2.js.map +1 -0
  36. package/components/item/_internal/item.js +2 -0
  37. package/components/item/_internal/useMenuItem.js +69 -0
  38. package/components/item/_internal/useMenuItem.js.map +1 -0
  39. package/{_internal → components/menu-button/_internal}/MenuButton.js +5 -4
  40. package/components/menu-button/_internal/MenuButton.js.map +1 -0
  41. package/components/menu-button/_internal/context.js +6 -0
  42. package/components/menu-button/_internal/context.js.map +1 -0
  43. package/components/menu-button/_internal/menu-button.js +2 -0
  44. package/{_internal → components/menu-button-content/_internal}/MenuButtonContent.js +5 -5
  45. package/components/menu-button-content/_internal/MenuButtonContent.js.map +1 -0
  46. package/components/menu-button-content/_internal/menu-button-content.js +2 -0
  47. package/{_internal → components/menu-button-content-footer/_internal}/MenuButtonContentFooter.js +3 -11
  48. package/components/menu-button-content-footer/_internal/MenuButtonContentFooter.js.map +1 -0
  49. package/components/menu-button-content-footer/_internal/menu-button-content-footer.js +2 -0
  50. package/components/menu-button-content-footer/_internal/styles.js +12 -0
  51. package/components/menu-button-content-footer/_internal/styles.js.map +1 -0
  52. package/{_internal → components/menu-button-content-header/_internal}/MenuButtonContentHeader.js +3 -11
  53. package/components/menu-button-content-header/_internal/MenuButtonContentHeader.js.map +1 -0
  54. package/components/menu-button-content-header/_internal/menu-button-content-header.js +2 -0
  55. package/components/menu-button-content-header/_internal/styles.js +12 -0
  56. package/components/menu-button-content-header/_internal/styles.js.map +1 -0
  57. package/{_internal → components/menu-button-content-menu/_internal}/MenuButtonContentMenu.js +2 -2
  58. package/components/menu-button-content-menu/_internal/MenuButtonContentMenu.js.map +1 -0
  59. package/components/menu-button-content-menu/_internal/menu-button-content-menu.js +2 -0
  60. package/{_internal → components/menu-button-trigger/_internal}/MenuButtonTrigger.js +3 -4
  61. package/components/menu-button-trigger/_internal/MenuButtonTrigger.js.map +1 -0
  62. package/components/menu-button-trigger/_internal/menu-button-trigger.js +2 -0
  63. package/{_internal → components/select/_internal}/Select2.js +5 -4
  64. package/components/select/_internal/Select2.js.map +1 -0
  65. package/components/select/_internal/context.js +6 -0
  66. package/components/select/_internal/context.js.map +1 -0
  67. package/components/select/_internal/select.js +2 -0
  68. package/{_internal → components/select-content/_internal}/SelectContent.js +2 -2
  69. package/components/select-content/_internal/SelectContent.js.map +1 -0
  70. package/components/select-content/_internal/select-content.js +2 -0
  71. package/{_internal → components/select-trigger/_internal}/SelectTrigger.js +3 -4
  72. package/components/select-trigger/_internal/SelectTrigger.js.map +1 -0
  73. package/components/select-trigger/_internal/select-trigger.js +2 -0
  74. package/index.js +17 -17
  75. package/package.json +5 -5
  76. package/_internal/Combobox2.js.map +0 -1
  77. package/_internal/ComboboxContent.js.map +0 -1
  78. package/_internal/ComboboxContentFooter.js.map +0 -1
  79. package/_internal/ComboboxContentHeader.js.map +0 -1
  80. package/_internal/ComboboxContentListbox.js.map +0 -1
  81. package/_internal/ComboboxTrigger.js.map +0 -1
  82. package/_internal/Item2.js.map +0 -1
  83. package/_internal/MenuButton.js.map +0 -1
  84. package/_internal/MenuButtonContent.js.map +0 -1
  85. package/_internal/MenuButtonContentFooter.js.map +0 -1
  86. package/_internal/MenuButtonContentHeader.js.map +0 -1
  87. package/_internal/MenuButtonContentMenu.js.map +0 -1
  88. package/_internal/MenuButtonTrigger.js.map +0 -1
  89. package/_internal/Select2.js.map +0 -1
  90. package/_internal/SelectContent.js.map +0 -1
  91. package/_internal/SelectTrigger.js.map +0 -1
  92. package/_internal/combobox-content-footer.js +0 -2
  93. package/_internal/combobox-content-header.js +0 -2
  94. package/_internal/combobox-content-listbox.js +0 -2
  95. package/_internal/combobox-content.js +0 -2
  96. package/_internal/combobox-trigger.js +0 -2
  97. package/_internal/combobox.js +0 -3
  98. package/_internal/item.js +0 -2
  99. package/_internal/menu-button-content-footer.js +0 -2
  100. package/_internal/menu-button-content-header.js +0 -2
  101. package/_internal/menu-button-content-menu.js +0 -2
  102. package/_internal/menu-button-content.js +0 -2
  103. package/_internal/menu-button-trigger.js +0 -2
  104. package/_internal/menu-button.js +0 -2
  105. package/_internal/select-content.js +0 -2
  106. package/_internal/select-trigger.js +0 -2
  107. package/_internal/select.js +0 -2
  108. package/_internal/types.js.map +0 -1
  109. /package/{_internal → _virtual/_internal}/_rollupPluginBabelHelpers.js.map +0 -0
  110. /package/{_internal → components/combobox/_internal}/combobox.js.map +0 -0
  111. /package/{_internal → components/combobox-content/_internal}/combobox-content.js.map +0 -0
  112. /package/{_internal → components/combobox-content-footer/_internal}/combobox-content-footer.js.map +0 -0
  113. /package/{_internal → components/combobox-content-header/_internal}/combobox-content-header.js.map +0 -0
  114. /package/{_internal → components/combobox-content-listbox/_internal}/combobox-content-listbox.js.map +0 -0
  115. /package/{_internal → components/combobox-trigger/_internal}/combobox-trigger.js.map +0 -0
  116. /package/{_internal → components/item/_internal}/item.js.map +0 -0
  117. /package/{_internal → components/menu-button/_internal}/menu-button.js.map +0 -0
  118. /package/{_internal → components/menu-button-content/_internal}/menu-button-content.js.map +0 -0
  119. /package/{_internal → components/menu-button-content-footer/_internal}/menu-button-content-footer.js.map +0 -0
  120. /package/{_internal → components/menu-button-content-header/_internal}/menu-button-content-header.js.map +0 -0
  121. /package/{_internal → components/menu-button-content-menu/_internal}/menu-button-content-menu.js.map +0 -0
  122. /package/{_internal → components/menu-button-trigger/_internal}/menu-button-trigger.js.map +0 -0
  123. /package/{_internal → components/select/_internal}/select.js.map +0 -0
  124. /package/{_internal → components/select-content/_internal}/select-content.js.map +0 -0
  125. /package/{_internal → components/select-trigger/_internal}/select-trigger.js.map +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Item2.js","sources":["../../../../src/components/item/Item.tsx"],"sourcesContent":["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":["COMPONENT_NAME","CLASSNAME","RenderedMenuItem","forwardRef","props","ref","borderRadius","children","className","color","propsColor","hasBorder","id","propsId","isActive","isDisabled","propsIsDisabled","isHovered","theme","propsTheme","onClick","forwardedProps","_objectWithoutProperties","_excluded","_id","useId","_ref","useRef","divRef","useMergeRefs","linkRef","isLinkMenuItem","isComponent","tabIndex","isFocused","handleKeyDown","handleClick","useMenuItem","domElementRef","hasPopup","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":";;;;;;;;AAkBA,MAAMA,cAAc,GAAG,MAAM,CAAA;AAC7B,MAAMC,SAAS,GAAG,cAAc,CAAA;AAEhC,MAAMC,gBAA6D,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC/F,MAAM;AACJC,MAAAA,YAAY,GAAG,GAAG;MAClBC,QAAQ;MACRC,SAAS;AACTC,MAAAA,KAAK,EAAEC,UAAU;MACjBC,SAAS;AACTC,MAAAA,EAAE,EAAEC,OAAO;MACXC,QAAQ;AACRC,MAAAA,UAAU,EAAEC,eAAe;MAC3BC,SAAS;AACTC,MAAAA,KAAK,EAAEC,UAAU;AACjBC,MAAAA,OAAAA;AAEF,KAAC,GAAGhB,KAAK;AADJiB,IAAAA,cAAc,GAAAC,wBAAA,CACflB,KAAK,EAAAmB,SAAA,CAAA,CAAA;AACT,EAAA,MAAM,CAACC,GAAG,CAAC,GAAGC,KAAK,EAAE,CA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AAK,CAACoE,KAAO;AAACnE,MAAAA,GAAG,EAAEA,GAAAA;KAAM,CAAA,CAAC,gBAEjE2C,KAAA,CAAAC,aAAA,CAAC/C,gBAAgB,EAAA4D,QAAA,CAAA,EAAA,EAAK1D,KAAK,EAAA;AAAEC,MAAAA,GAAG,EAAEA,GAAAA;AAAI,KAAA,CAAE,CACzC,CAAA;AACH,GAAA;AAEA,EAAA,OAAO,IAAI,CAAA;AACb,CAAC,EAAC;AACFgE,IAAI,CAAC7D,SAAS,GAAGP,SAAS,CAAA;AAC1BoE,IAAI,CAACkB,WAAW,GAAGvF,cAAc;;;;"}
@@ -0,0 +1,2 @@
1
+ export { Item } from './Item2.js';
2
+ //# sourceMappingURL=item.js.map
@@ -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;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,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AA;AAENW,EAAAA,SAAS,CAAC,MAAM;AACd,IAAA,IAAIN,SAAS,IAAIZ,aAAa,CAACuB,OAAO,EAAE;AAAA,MAAA,IAAAE,QAAA,CAAA;AACtC,MAAA,CAAAA,QAAA,GAACzB,aAAa,CAAyCuB,OAAO,MAAA,IAAA,IAAAE,QAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAA9DA,QAAA,CAAgEC,KAAK,EAAE,CAAA;AACzE,KAAA;AACF,GAAC,EAAE,CAACd,SAAS,CAAC,CAAC,CAAA;EAEf,OAAO;IACLD,QAAQ;IACRC,SAAS;IACTV,UAAU;IACVW,aAAa;AACbE,IAAAA,WAAAA;GACD,CAAA;AACH;;;;"}
@@ -1,9 +1,10 @@
1
- import { a as _extends } from './_rollupPluginBabelHelpers.js';
1
+ import { extends as _extends } from '../../../_virtual/_internal/_rollupPluginBabelHelpers.js';
2
2
  import React from 'react';
3
3
  import { Popover } from '@redsift/popovers';
4
- import { a as MenuButtonContext, M as MenuButtonTrigger } from './MenuButtonTrigger.js';
4
+ import { MenuButtonContext } from './context.js';
5
5
  import { useTheme, ThemeProvider, FocusWithinGroup, Flexbox, Text, Theme } from '@redsift/design-system';
6
- import { M as MenuButtonContent } from './MenuButtonContent.js';
6
+ import { MenuButtonTrigger } from '../../menu-button-trigger/_internal/MenuButtonTrigger.js';
7
+ import { MenuButtonContent } from '../../menu-button-content/_internal/MenuButtonContent.js';
7
8
 
8
9
  const COMPONENT_NAME = 'MenuButton';
9
10
  const CLASSNAME = 'redsift-menu-button';
@@ -71,5 +72,5 @@ const MenuButton = Object.assign(BaseMenuButton, {
71
72
  Content: MenuButtonContent
72
73
  });
73
74
 
74
- export { BaseMenuButton as B, MenuButton as M };
75
+ export { BaseMenuButton, MenuButton };
75
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,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,IAAAA,OAAAA;GACD,CAAA;AAED,EAAA,oBACEI,KAAA,CAAAC,aAAA,CAACC,aAAa,EAAA;AAACC,IAAAA,KAAK,EAAE;AAAEV,MAAAA,KAAAA;AAAM,KAAA;AAAE,GAAA,eAC9BO,KAAA,CAAAC,aAAA,CAACG,gBAAgB,EAAA;AAACC,IAAAA,SAAS,EAAC,eAAe;AAACC,IAAAA,QAAQ,EAAC,MAAM;AAACC,IAAAA,WAAW,EAAE,KAAA;AAAM,GAAA,eAC7EP,KAAA,CAAAC,aAAA,CAACO,iB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AAM4C,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,2 @@
1
+ export { BaseMenuButton, MenuButton } from './MenuButton.js';
2
+ //# sourceMappingURL=menu-button.js.map
@@ -1,11 +1,11 @@
1
- import { a as _extends, b as _objectSpread2 } from './_rollupPluginBabelHelpers.js';
1
+ import { extends as _extends, objectSpread2 as _objectSpread2 } from '../../../_virtual/_internal/_rollupPluginBabelHelpers.js';
2
2
  import React, { forwardRef, useContext } from 'react';
3
3
  import { getContainerProps, AppContainerContext, useTheme, partitionComponents, isComponent, Flexbox } from '@redsift/design-system';
4
4
  import { usePopoverContext, useMergeRefs, FloatingPortal, StyledPopoverContent, PopoverContent } from '@redsift/popovers';
5
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';
6
+ import { MenuButtonContentMenu } from '../../menu-button-content-menu/_internal/MenuButtonContentMenu.js';
7
+ import { MenuButtonContentHeader } from '../../menu-button-content-header/_internal/MenuButtonContentHeader.js';
8
+ import { MenuButtonContentFooter } from '../../menu-button-content-footer/_internal/MenuButtonContentFooter.js';
9
9
 
10
10
  const COMPONENT_NAME = 'MenuButtonContent';
11
11
  const CLASSNAME = 'redsift-menu-button-content';
@@ -64,5 +64,5 @@ const MenuButtonContent = Object.assign(BaseMenuButtonContent, {
64
64
  Footer: MenuButtonContentFooter
65
65
  });
66
66
 
67
- export { BaseMenuButtonContent as B, MenuButtonContent as M };
67
+ export { BaseMenuButtonContent, MenuButtonContent };
68
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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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,2 @@
1
+ export { BaseMenuButtonContent, MenuButtonContent } from './MenuButtonContent.js';
2
+ //# sourceMappingURL=menu-button-content.js.map
@@ -1,15 +1,7 @@
1
- import { _ as _objectWithoutProperties, a as _extends } from './_rollupPluginBabelHelpers.js';
1
+ import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../_virtual/_internal/_rollupPluginBabelHelpers.js';
2
2
  import React, { forwardRef } from 'react';
3
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
- `;
4
+ import { StyledMenuButtonContentFooter } from './styles.js';
13
5
 
14
6
  const _excluded = ["children", "className"];
15
7
  const COMPONENT_NAME = 'MenuButtonContentFooter';
@@ -32,5 +24,5 @@ const MenuButtonContentFooter = /*#__PURE__*/forwardRef((props, ref) => {
32
24
  MenuButtonContentFooter.className = CLASSNAME;
33
25
  MenuButtonContentFooter.displayName = COMPONENT_NAME;
34
26
 
35
- export { MenuButtonContentFooter as M };
27
+ export { MenuButtonContentFooter };
36
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,2 @@
1
+ export { MenuButtonContentFooter } from './MenuButtonContentFooter.js';
2
+ //# sourceMappingURL=menu-button-content-footer.js.map
@@ -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;;;;"}
@@ -1,15 +1,7 @@
1
- import { _ as _objectWithoutProperties, a as _extends } from './_rollupPluginBabelHelpers.js';
1
+ import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../_virtual/_internal/_rollupPluginBabelHelpers.js';
2
2
  import React, { forwardRef } from 'react';
3
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
- `;
4
+ import { StyledMenuButtonContentHeader } from './styles.js';
13
5
 
14
6
  const _excluded = ["children", "className"];
15
7
  const COMPONENT_NAME = 'MenuButtonContentHeader';
@@ -32,5 +24,5 @@ const MenuButtonContentHeader = /*#__PURE__*/forwardRef((props, ref) => {
32
24
  MenuButtonContentHeader.className = CLASSNAME;
33
25
  MenuButtonContentHeader.displayName = COMPONENT_NAME;
34
26
 
35
- export { MenuButtonContentHeader as M };
27
+ export { MenuButtonContentHeader };
36
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,2 @@
1
+ export { MenuButtonContentHeader } from './MenuButtonContentHeader.js';
2
+ //# sourceMappingURL=menu-button-content-header.js.map
@@ -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;;;;"}
@@ -1,4 +1,4 @@
1
- import { _ as _objectWithoutProperties, a as _extends } from './_rollupPluginBabelHelpers.js';
1
+ import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../_virtual/_internal/_rollupPluginBabelHelpers.js';
2
2
  import React, { forwardRef, useContext, useEffect } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import { FocusWithinGroupContext, Flexbox } from '@redsift/design-system';
@@ -37,5 +37,5 @@ const MenuButtonContentMenu = /*#__PURE__*/forwardRef((props, ref) => {
37
37
  MenuButtonContentMenu.className = CLASSNAME;
38
38
  MenuButtonContentMenu.displayName = COMPONENT_NAME;
39
39
 
40
- export { MenuButtonContentMenu as M };
40
+ export { MenuButtonContentMenu };
41
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,2 @@
1
+ export { MenuButtonContentMenu } from './MenuButtonContentMenu.js';
2
+ //# sourceMappingURL=menu-button-content-menu.js.map
@@ -1,10 +1,9 @@
1
- import { b as _objectSpread2 } from './_rollupPluginBabelHelpers.js';
1
+ import { objectSpread2 as _objectSpread2 } from '../../../_virtual/_internal/_rollupPluginBabelHelpers.js';
2
2
  import React, { forwardRef, useContext } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import { FocusWithinGroupContext, useTheme, isComponent, FocusWithinGroupActionType, EventKey } from '@redsift/design-system';
5
5
  import { usePopoverContext, useMergeRefs } from '@redsift/popovers';
6
-
7
- const MenuButtonContext = /*#__PURE__*/React.createContext(null);
6
+ import { MenuButtonContext } from '../../menu-button/_internal/context.js';
8
7
 
9
8
  const COMPONENT_NAME = 'MenuButtonTrigger';
10
9
  const CLASSNAME = 'redsift-menu-button-trigger';
@@ -164,5 +163,5 @@ const MenuButtonTrigger = /*#__PURE__*/forwardRef((props, ref) => {
164
163
  MenuButtonTrigger.className = CLASSNAME;
165
164
  MenuButtonTrigger.displayName = COMPONENT_NAME;
166
165
 
167
- export { MenuButtonTrigger as M, MenuButtonContext as a };
166
+ export { MenuButtonTrigger };
168
167
  //# sourceMappingURL=MenuButtonTrigger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuButtonTrigger.js","sources":["../../../../src/components/menu-button-trigger/MenuButtonTrigger.tsx"],"sourcesContent":["import React, { MouseEvent, ReactElement, forwardRef, useContext } from 'react';\nimport classNames from 'classnames';\n\nimport {\n Comp,\n EventKey,\n FocusWithinGroupActionType,\n FocusWithinGroupContext,\n isComponent,\n useTheme,\n} from '@redsift/design-system';\nimport { MenuButtonTriggerProps } from './types';\nimport { useMergeRefs, usePopoverContext } from '@redsift/popovers';\nimport { MenuButtonContext } from '../menu-button/context';\n\nconst COMPONENT_NAME = 'MenuButtonTrigger';\nconst CLASSNAME = 'redsift-menu-button-trigger';\n\n/**\n * The MenuButtonTrigger component.\n */\nexport const MenuButtonTrigger: Comp<MenuButtonTriggerProps, HTMLButtonElement> = forwardRef((props, ref) => {\n const { children } = props;\n\n const { getReferenceProps, isOpen, handleOpen, refs } = usePopoverContext();\n const childrenRef = (children as any).ref;\n const triggerRef = useMergeRefs([refs.setReference, ref, childrenRef]);\n\n const focusContext = useContext(FocusWithinGroupContext);\n const menuButtonContext = useContext(MenuButtonContext);\n const theme = useTheme();\n\n const renderedChildren = typeof children === 'function' ? children({ isOpen }) : children;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n const code = event.code;\n\n if (code === 'Escape' || code === 'Tab') {\n if (isOpen) {\n handleOpen(false);\n }\n } else if (code === 'ArrowDown') {\n if (!isOpen) {\n handleOpen(true);\n }\n if (focusContext.state.selectedId !== null) {\n focusContext.dispatch({\n type: FocusWithinGroupActionType.DELAY_ACTION,\n payload: {\n type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,\n payload: {\n key: EventKey.ArrowDown,\n ctrlKey: event.ctrlKey,\n },\n },\n });\n } else {\n focusContext.dispatch({\n type: FocusWithinGroupActionType.DELAY_ACTION,\n payload: {\n type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,\n payload: {\n key: EventKey.Home,\n ctrlKey: event.ctrlKey,\n },\n },\n });\n }\n event.preventDefault();\n event.stopPropagation();\n } else if (code === 'ArrowUp') {\n if (!isOpen) {\n handleOpen(true);\n }\n focusContext.dispatch({\n type: FocusWithinGroupActionType.DELAY_ACTION,\n payload: {\n type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,\n payload: {\n key: focusContext.state.selectedId !== null ? EventKey.ArrowUp : EventKey.Home,\n ctrlKey: event.ctrlKey,\n },\n },\n });\n event.preventDefault();\n event.stopPropagation();\n } else if (code === 'Home') {\n if (!isOpen) {\n handleOpen(true);\n }\n focusContext.dispatch({\n type: FocusWithinGroupActionType.DELAY_ACTION,\n payload: {\n type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,\n payload: {\n key: EventKey.Home,\n ctrlKey: event.ctrlKey,\n },\n },\n });\n event.preventDefault();\n event.stopPropagation();\n } else if (code === 'End') {\n if (!isOpen) {\n handleOpen(true);\n }\n focusContext.dispatch({\n type: FocusWithinGroupActionType.DELAY_ACTION,\n payload: {\n type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST,\n payload: {\n key: EventKey.End,\n ctrlKey: event.ctrlKey,\n },\n },\n });\n event.preventDefault();\n event.stopPropagation();\n } else if (code === 'Enter') {\n if (isOpen && focusContext.state.selectedId) {\n document.getElementById(focusContext.state.selectedId)?.click();\n document.getElementById(focusContext.state.selectedId)?.getElementsByTagName('a')?.[0]?.click();\n }\n }\n };\n\n const handleClick = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n if (isOpen) {\n handleOpen(false);\n } else {\n handleOpen(true);\n focusContext.dispatch({\n type: FocusWithinGroupActionType.DELAY_ACTION,\n payload: {\n type: FocusWithinGroupActionType.FOCUS_ON_LIST,\n payload: {\n id: focusContext.state.activedescendant?.[0] ?? '',\n },\n },\n });\n }\n };\n\n if (isComponent('Button')(renderedChildren) || isComponent('IconButton')(renderedChildren)) {\n return React.cloneElement(renderedChildren, {\n ...getReferenceProps({\n ref: triggerRef,\n ...props,\n ...(renderedChildren as ReactElement).props,\n children: (renderedChildren as ReactElement).props.children ?? '',\n }),\n theme,\n 'aria-activedescendant': isOpen ? focusContext.state.activedescendant?.[0] : undefined,\n className: classNames((renderedChildren as ReactElement).props.className, menuButtonContext?.triggerClassName),\n color: menuButtonContext?.color ?? (renderedChildren as ReactElement).props.color,\n isActive: isOpen,\n isDisabled: menuButtonContext?.isDisabled,\n onClick: handleClick,\n onKeyDown: handleKeyDown,\n role: 'button',\n variant: menuButtonContext?.variant ?? (renderedChildren as ReactElement).props.variant,\n });\n }\n\n return <>{renderedChildren}</>;\n});\nMenuButtonTrigger.className = CLASSNAME;\nMenuButtonTrigger.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","MenuButtonTrigger","forwardRef","props","ref","children","getReferenceProps","isOpen","handleOpen","refs","usePopoverContext","childrenRef","triggerRef","useMergeRefs","setReference","focusContext","useContext","FocusWithinGroupContext","menuButtonContext","MenuButtonContext","theme","useTheme","renderedChildren","handleKeyDown","event","code","state","selectedId","dispatch","type","FocusWithinGroupActionType","DELAY_ACTION","payload","KEY_DOWN_ON_LIST","key","EventKey","ArrowDown","ctrlKey","Home","preventDefault","stopPropagation","ArrowUp","End","_document$getElementB","_document$getElementB2","_document$getElementB3","_document$getElementB4","document","getElementById","click","getElementsByTagName","handleClick","_focusContext$state$a","_focusContext$state$a2","FOCUS_ON_LIST","id","activedescendant","isComponent","_props$children","_focusContext$state$a3","_menuButtonContext$co","_menuButtonContext$va","React","cloneElement","_objectSpread","undefined","className","classNames","triggerClassName","color","isActive","isDisabled","onClick","onKeyDown","role","variant","createElement","Fragment","displayName"],"mappings":";;;;;;;AAeA,MAAMA,cAAc,GAAG,mBAAmB,CAAA;AAC1C,MAAMC,SAAS,GAAG,6BAA6B,CAAA;;AAE/C;AACA;AACA;AACO,MAAMC,iBAAkE,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC3G,MAAM;AAAEC,IAAAA,QAAAA;AAAS,GAAC,GAAGF,KAAK,CAAA;EAE1B,MAAM;IAAEG,iBAAiB;IAAEC,MAAM;IAAEC,UAAU;AAAEC,IAAAA,IAAAA;GAAM,GAAGC,iBAAiB,EAAE,CAAA;AAC3E,EAAA,MAAMC,WAAW,GAAIN,QAAQ,CAASD,GAAG,CAAA;AACzC,EAAA,MAAMQ,UAAU,GAAGC,YAAY,CAAC,CAACJ,IAAI,CAACK,YAAY,EAAEV,GAAG,EAAEO,WAA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AA,GAAAA,KAAAA,CAAAA,GAAAA,iBAAiB,CAAEqD,UAAU;AACzCC,MAAAA,OAAO,EAAErB,WAAW;AACpBsB,MAAAA,SAAS,EAAElD,aAAa;AACxBmD,MAAAA,IAAI,EAAE,QAAQ;AACdC,MAAAA,OAAO,GAAAd,qBAAA,GAAE3C,iBAAiB,KAAjBA,IAAAA,IAAAA,iBAAiB,uBAAjBA,iBAAiB,CAAEyD,OAAO,MAAA,IAAA,IAAAd,qBAAA,KAAAA,KAAAA,CAAAA,GAAAA,qBAAA,GAAKvC,gBAAgB,CAAkBnB,KAAK,CAACwE,OAAAA;AAAO,KAAA,CACxF,CAAC,CAAA;AACJ,GAAA;EAEA,oBAAOb,KAAA,CAAAc,aAAA,CAAAd,KAAA,CAAAe,QAAA,EAAGvD,IAAAA,EAAAA,gBAAmB,CAAC,CAAA;AAChC,CAAC,EAAC;AACFrB,iBAAiB,CAACiE,SAAS,GAAGlE,SAAS,CAAA;AACvCC,iBAAiB,CAAC6E,WAAW,GAAG/E,cAAc;;;;"}
@@ -0,0 +1,2 @@
1
+ export { MenuButtonTrigger } from './MenuButtonTrigger.js';
2
+ //# sourceMappingURL=menu-button-trigger.js.map
@@ -1,9 +1,10 @@
1
- import { a as _extends } from './_rollupPluginBabelHelpers.js';
1
+ import { extends as _extends } from '../../../_virtual/_internal/_rollupPluginBabelHelpers.js';
2
2
  import React, { useState, useEffect, useReducer, useMemo } from 'react';
3
3
  import { Popover } from '@redsift/popovers';
4
- import { a as SelectContext, S as SelectTrigger } from './SelectTrigger.js';
4
+ import { SelectContext } from './context.js';
5
5
  import { useTheme, ListboxReducer, ListboxActionType, ThemeProvider, FocusWithinGroup, ListboxContext, Flexbox, Text, Theme } from '@redsift/design-system';
6
- import { S as SelectContent } from './SelectContent.js';
6
+ import { SelectTrigger } from '../../select-trigger/_internal/SelectTrigger.js';
7
+ import { SelectContent } from '../../select-content/_internal/SelectContent.js';
7
8
 
8
9
  const COMPONENT_NAME = 'Select';
9
10
  const CLASSNAME = 'redsift-select';
@@ -111,5 +112,5 @@ const Select = Object.assign(BaseSelect, {
111
112
  Content: SelectContent
112
113
  });
113
114
 
114
- export { BaseSelect as B, Select as S };
115
+ export { BaseSelect, Select };
115
116
  //# sourceMappingURL=Select2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select2.js","sources":["../../../../src/components/select/Select.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useReducer, useState } from 'react';\nimport { SelectContent } from '../select-content';\nimport { SelectTrigger } from '../select-trigger';\n\nimport { SelectProps } from './types';\nimport { Popover } from '@redsift/popovers';\nimport { SelectContext } from './context';\nimport {\n ListboxReducer,\n ListboxState,\n ListboxContextProps,\n FocusWithinGroup,\n ListboxContext,\n Flexbox,\n Text,\n ListboxActionType,\n Theme,\n useTheme,\n ThemeProvider,\n} from '@redsift/design-system';\n\nconst COMPONENT_NAME = 'Select';\nconst CLASSNAME = 'redsift-select';\n\n/**\n * The Select component.\n */\nexport const BaseSelect: React.FC<SelectProps> & {\n displayName?: string;\n className?: string;\n} = (props) => {\n const {\n color,\n defaultValue,\n description,\n descriptionProps,\n isDisabled,\n isInvalid,\n minWidth = 'trigger-width',\n onChange,\n theme: propsTheme,\n triggerClassName,\n value,\n variant,\n wrapperProps,\n } = props;\n\n const theme = useTheme(propsTheme);\n\n const [selectedValue, setValue] = useState<string>(value || defaultValue || '');\n useEffect(() => {\n if (value) {\n state.setValue(value);\n }\n }, [value]);\n\n /** Listbox context */\n const [listboxState, listboxDispatch] = useReducer(ListboxReducer, {\n isDisabled,\n selectedValues: [selectedValue],\n } as ListboxState);\n const listboxContext = useMemo<ListboxContextProps>(\n () => ({\n state: listboxState,\n dispatch: listboxDispatch,\n }),\n [listboxState]\n );\n useEffect(() => {\n listboxDispatch({\n type: ListboxActionType.UPDATE_OPTIONS,\n payload: {\n isDisabled: isDisabled || false,\n },\n });\n }, [isDisabled, theme]);\n\n /** Select context. */\n const state = {\n color,\n isDisabled: isDisabled || false,\n isInvalid: isInvalid || false,\n setValue(value: string) {\n if (isDisabled) {\n return;\n }\n\n const previousValue = selectedValue;\n setValue(value);\n if (value !== previousValue && onChange) {\n onChange(value);\n }\n },\n theme,\n triggerClassName,\n value: selectedValue,\n variant,\n };\n\n return (\n <ThemeProvider value={{ theme }}>\n <FocusWithinGroup focusType=\"virtual-focus\" focusOnInit={false}>\n <SelectContext.Provider value={state}>\n <ListboxContext.Provider value={listboxContext}>\n <Flexbox flexDirection=\"column\" alignItems=\"flex-start\" gap=\"0px\" {...wrapperProps}>\n <Popover\n theme={theme}\n overrideDisplayName={{ content: 'SelectContent', trigger: 'SelectTrigger' }}\n placement=\"bottom-start\"\n role=\"listbox\"\n minWidth={minWidth}\n {...props}\n />\n {description && typeof description === 'string' ? (\n <Text\n theme={theme}\n marginTop=\"8px\"\n variant=\"caption\"\n color={isInvalid ? 'error' : theme === Theme.light ? 'dark-grey' : 'white'}\n {...descriptionProps}\n >\n {description}\n </Text>\n ) : description ? (\n description\n ) : null}\n </Flexbox>\n </ListboxContext.Provider>\n </SelectContext.Provider>\n </FocusWithinGroup>\n </ThemeProvider>\n );\n};\nBaseSelect.className = CLASSNAME;\nBaseSelect.displayName = COMPONENT_NAME;\n\nexport const Select = Object.assign(BaseSelect, {\n Trigger: SelectTrigger,\n Content: SelectContent,\n});\n"],"names":["COMPONENT_NAME","CLASSNAME","BaseSelect","props","color","defaultValue","description","descriptionProps","isDisabled","isInvalid","minWidth","onChange","theme","propsTheme","triggerClassName","value","variant","wrapperProps","useTheme","selectedValue","setValue","useState","useEffect","state","listboxState","listboxDispatch","useReducer","ListboxReducer","selectedValues","listboxContext","useMemo","dispatch","type","ListboxActionType","UPDATE_OPTIONS","payload","previousValue","React","createElement","ThemeProvider","FocusWithinGroup","focusType","focusOnInit","SelectContext","Provider","ListboxContext","Flexbox","_extends","flexDirection","alignItems","gap","Popover","overrideDisplayName","content","trigger","placement","role","Text","marginTop","Theme","light","className","displayName","Select","Object","assign","Trigger","SelectT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EAAC,YAAY;AAACC,IAAAA,GAAG,EAAC,KAAA;GAAUjC,EAAAA,YAAY,gBAChFoB,KAAA,CAAAC,aAAA,CAACa,OAAO,EAAAJ,QAAA,CAAA;AACNnC,IAAAA,KAAK,EAAEA,KAAM;AACbwC,IAAAA,mBAAmB,EAAE;AAAEC,MAAAA,OAAO,EAAE,eAAe;AAAEC,MAAAA,OAAO,EAAE,eAAA;KAAkB;AAC5EC,IAAAA,SAAS,EAAC,cAAc;AACxBC,IAAAA,IAAI,EAAC,SAAS;AACd9C,IAAAA,QAAQ,EAAEA,QAAAA;AAAS,GAAA,EACfP,KAAK,CACV,CAAC,EACDG,WAAW,IAAI,OAAOA,WAAW,KAAK,QAAQ,gBAC7C+B,KAAA,CAAAC,aAAA,CAACmB,IAAI,EAAAV,QAAA,CAAA;AACHnC,IAAAA,KAAK,EAAEA,KAAM;AACb8C,IAAAA,SAAS,EAAC,KAAK;AACf1C,IAAAA,OAAO,EAAC,SAAS;AACjBZ,IAAAA,KAAK,EAAEK,SAAS,GAAG,OAAO,GAAGG,KAAK,KAAK+C,KAAK,CAACC,KAAK,GAAG,WAAW,GAAG,OAAA;AAAQ,GAAA,EACvErD,gBAAgB,CAAA,EAEnBD,WACG,CAAC,GACLA,WAAW,GACbA,WAAW,GACT,IACG,CACc,CACH,CACR,CACL,CAAC,CAAA;AAEpB,EAAC;AACDJ,UAAU,CAAC2D,SAAS,GAAG5D,SAAS,CAAA;AAChCC,UAAU,CAAC4D,WAAW,GAAG9D,cAAc,CAAA;AAEhC,MAAM+D,MAAM,GAAGC,MAAM,CAACC,MAAM,CAAC/D,UAAU,EAAE;AAC9CgE,EAAAA,OAAO,EAAEC,aAAa;AACtBC,EAAAA,OAAO,EAAEC,aAAAA;AACX,CAAC;;;;"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+
3
+ const SelectContext = /*#__PURE__*/React.createContext(null);
4
+
5
+ export { SelectContext };
6
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sources":["../../../../src/components/select/context.ts"],"sourcesContent":["import React from 'react';\nimport { SelectState } from './types';\n\nexport const SelectContext = React.createContext<SelectState | null>(null);\n"],"names":["SelectContext","React","createContext"],"mappings":";;AAGO,MAAMA,aAAa,gBAAGC,KAAK,CAACC,aAAa,CAAqB,IAAI;;;;"}
@@ -0,0 +1,2 @@
1
+ export { BaseSelect, Select } from './Select2.js';
2
+ //# sourceMappingURL=select.js.map
@@ -1,4 +1,4 @@
1
- import { a as _extends, b as _objectSpread2 } from './_rollupPluginBabelHelpers.js';
1
+ import { extends as _extends, objectSpread2 as _objectSpread2 } from '../../../_virtual/_internal/_rollupPluginBabelHelpers.js';
2
2
  import React, { forwardRef, useContext, useEffect } from 'react';
3
3
  import { getContainerProps, AppContainerContext, FocusWithinGroupContext, ListboxContext, useTheme, Flexbox } from '@redsift/design-system';
4
4
  import { usePopoverContext, useMergeRefs, FloatingPortal, StyledPopoverContent, PopoverContent } from '@redsift/popovers';
@@ -58,5 +58,5 @@ const SelectContent = /*#__PURE__*/forwardRef((props, ref) => {
58
58
  SelectContent.className = CLASSNAME;
59
59
  SelectContent.displayName = COMPONENT_NAME;
60
60
 
61
- export { SelectContent as S };
61
+ export { SelectContent };
62
62
  //# sourceMappingURL=SelectContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectContent.js","sources":["../../../../src/components/select-content/SelectContent.tsx"],"sourcesContent":["import React, { forwardRef, useContext, useEffect } from 'react';\n\nimport {\n AppContainerContext,\n Comp,\n Flexbox,\n FocusWithinGroupContext,\n ListboxContext,\n getContainerProps,\n useTheme,\n} from '@redsift/design-system';\nimport { SelectContentProps } from './types';\nimport {\n FloatingPortal,\n PopoverContent,\n StyledPopoverContent,\n useMergeRefs,\n usePopoverContext,\n} from '@redsift/popovers';\nimport classNames from 'classnames';\n\nconst COMPONENT_NAME = 'SelectContent';\nconst CLASSNAME = 'redsift-select-content';\n\n/**\n * The SelectContent component.\n */\nexport const SelectContent: Comp<SelectContentProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, style } = props;\n const containerProps = getContainerProps(props);\n\n const { getFloatingProps, isOpen, refs, strategy, x, y } = usePopoverContext();\n const popoverRef = useMergeRefs([refs.setFloating, ref]);\n\n const appContainerState = useContext(AppContainerContext);\n const focusContext = useContext(FocusWithinGroupContext);\n const listboxState = useContext(ListboxContext);\n const theme = useTheme();\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 <FloatingPortal root={appContainerState?.appContainerRef.current}>\n {isOpen && (\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 ...style,\n }}\n className={classNames(PopoverContent.className, SelectContent.className, className)}\n aria-disabled={listboxState.state.isDisabled}\n >\n <Flexbox flexDirection=\"column\" gap=\"0px\" margin=\"8px 0px\" width=\"100%\" {...containerProps}>\n {children}\n </Flexbox>\n </StyledPopoverContent>\n )}\n </FloatingPortal>\n );\n});\nSelectContent.className = CLASSNAME;\nSelectContent.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","SelectContent","forwardRef","props","ref","children","className","style","containerProps","getContainerProps","getFloatingProps","isOpen","refs","strategy","x","y","usePopoverContext","popoverRef","useMergeRefs","setFloating","appContainerState","useContext","AppContainerContext","focusContext","FocusWithinGroupContext","listboxState","ListboxContext","theme","useTheme","useEffect","state","delayedAction","tabStops","length","dispatch","React","createElement","FloatingPortal","root","appContainerRef","current","StyledPopoverContent","_extends","$theme","_objectSpread","position","top","left","classNames","PopoverContent","isDisabled","Flexbox","flexDirection","gap","margin","width","displayName"],"mappings":";;;;;;AAqBA,MAAMA,cAAc,GAAG,eAAe,CAAA;AACtC,MAAMC,SAAS,GAAG,wBAA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iB,CAAEmB,eAAe,CAACC,OAAAA;GACtD7B,EAAAA,MAAM,iBACLwB,KAAA,CAAAC,aAAA,CAACK,oBAAoB,EAAAC,QAAA,CAAA;AACnBC,IAAAA,MAAM,EAAEhB,KAAO;AACfvB,IAAAA,GAAG,EAAEa,UAAAA;GACDP,EAAAA,gBAAgB,CAACP,KAAK,CAAC,EAAA;AAC3BI,IAAAA,KAAK,EAAAqC,cAAA,CAAA;AACHC,MAAAA,QAAQ,EAAEhC,QAAQ;AAClBiC,MAAAA,GAAG,EAAE/B,CAAC,KAAA,IAAA,IAADA,CAAC,KAADA,KAAAA,CAAAA,GAAAA,CAAC,GAAI,CAAC;AACXgC,MAAAA,IAAI,EAAEjC,CAAC,KAAA,IAAA,IAADA,CAAC,KAAA,KAAA,CAAA,GAADA,CAAC,GAAI,CAAA;AAAC,KAAA,EACTP,KAAK,CACR;AACFD,IAAAA,SAAS,EAAE0C,UAAU,CAACC,cAAc,CAAC3C,SAAS,EAAEL,aAAa,CAACK,SAAS,EAAEA,SAAS,CAAE;IACpF,eAAemB,EAAAA,YAAY,CAACK,KAAK,CAACoB,UAAAA;AAAW,GAAA,CAAA,eAE7Cf,KAAA,CAAAC,aAAA,CAACe,OAAO,EAAAT,QAAA,CAAA;AAACU,IAAAA,aAAa,EAAC,QAAQ;AAACC,IAAAA,GAAG,EAAC,KAAK;AAACC,IAAAA,MAAM,EAAC,SAAS;AAACC,IAAAA,KAAK,EAAC,MAAA;AAAM,GAAA,EAAK/C,cAAc,CAAA,EACvFH,QACM,CACW,CAEV,CAAC,CAAA;AAErB,CAAC,EAAC;AACFJ,aAAa,CAACK,SAAS,GAAGN,SAAS,CAAA;AACnCC,aAAa,CAACuD,WAAW,GAAGzD,cAAc;;;;"}
@@ -0,0 +1,2 @@
1
+ export { SelectContent } from './SelectContent.js';
2
+ //# sourceMappingURL=select-content.js.map
@@ -1,12 +1,11 @@
1
- import { b as _objectSpread2 } from './_rollupPluginBabelHelpers.js';
1
+ import { objectSpread2 as _objectSpread2 } from '../../../_virtual/_internal/_rollupPluginBabelHelpers.js';
2
2
  import React, { forwardRef, useContext, useRef, useEffect } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import { FocusWithinGroupContext, ListboxContext, useTheme, isComponent, Icon, FocusWithinGroupActionType, EventKey, ListboxActionType } from '@redsift/design-system';
5
5
  import { usePopoverContext, useMergeRefs } from '@redsift/popovers';
6
+ import { SelectContext } from '../../select/_internal/context.js';
6
7
  import { mdiChevronDown } from '@redsift/icons';
7
8
 
8
- const SelectContext = /*#__PURE__*/React.createContext(null);
9
-
10
9
  const COMPONENT_NAME = 'SelectTrigger';
11
10
  const CLASSNAME = 'redsift-select-trigger';
12
11
 
@@ -246,5 +245,5 @@ const SelectTrigger = /*#__PURE__*/forwardRef((props, ref) => {
246
245
  SelectTrigger.className = CLASSNAME;
247
246
  SelectTrigger.displayName = COMPONENT_NAME;
248
247
 
249
- export { SelectTrigger as S, SelectContext as a };
248
+ export { SelectTrigger };
250
249
  //# sourceMappingURL=SelectTrigger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectTrigger.js","sources":["../../../../src/components/select-trigger/SelectTrigger.tsx"],"sourcesContent":["import React, { MouseEvent, ReactElement, forwardRef, useContext, useEffect, useRef } from 'react';\nimport classNames from 'classnames';\n\nimport {\n Comp,\n EventKey,\n FocusWithinGroupActionType,\n FocusWithinGroupContext,\n Icon,\n ListboxActionType,\n ListboxContext,\n isComponent,\n useTheme,\n} from '@redsift/design-system';\nimport { SelectTriggerProps } from './types';\nimport { useMergeRefs, usePopoverContext } from '@redsift/popovers';\nimport { SelectContext } from '../select/context';\nimport { mdiChevronDown } from '@redsift/icons';\n\nconst COMPONENT_NAME = 'SelectTrigger';\nconst CLASSNAME = 'redsift-select-trigger';\n\n/**\n * The SelectTrigger component.\n */\nexport const SelectTrigger: Comp<SelectTriggerProps, HTMLButtonElement> = forwardRef((props, ref) => {\n const { children, hideExpandButton } = 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 selectContext = useContext(SelectContext);\n const listboxState = useContext(ListboxContext);\n const theme = useTheme();\n\n const renderedChildren =\n typeof children === 'function' ? children({ value: selectContext?.value, isOpen }) : children;\n\n const _inputRef = useRef<HTMLInputElement>();\n const inputRef = renderedChildren.props.inputRef ?? _inputRef;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n const code = event.code;\n\n if (code === 'Escape') {\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 if (!focusContext.state.activedescendant?.[0]) {\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 } else {\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 event.preventDefault();\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 } 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 } 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 } else if (code === 'Enter') {\n if (isOpen && focusContext.state.selectedId) {\n listboxState.dispatch({\n type: ListboxActionType.SET,\n payload: {\n values: [focusContext.state.activedescendant?.[1] ?? ''],\n activedescendant: focusContext.state.activedescendant,\n },\n });\n }\n }\n };\n\n const handleClick = (event: MouseEvent) => {\n event.preventDefault();\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 useEffect(() => {\n selectContext?.setValue(listboxState.state.selectedValues[0]);\n handleOpen(false);\n }, [listboxState.state]);\n\n if (isComponent('TextField')(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 'aria-activedescendant': isOpen ? focusContext.state.activedescendant?.[0] : undefined,\n className: classNames((renderedChildren as ReactElement).props.className, selectContext?.triggerClassName),\n color: selectContext?.color ?? (renderedChildren as ReactElement).props.color,\n inputRef,\n internal: (value?: string, isDisabled?: boolean, isInvalid?: boolean, isRequired?: boolean) => {\n return (\n <>\n {typeof (renderedChildren as ReactElement).props.internal === 'function'\n ? (renderedChildren as ReactElement).props.internal(value, isDisabled, isInvalid, isRequired)\n : (renderedChildren as ReactElement).props.internal}\n {hideExpandButton ? null : (\n <Icon\n color={isDisabled ? 'no-data' : 'question'}\n icon={mdiChevronDown}\n style={{\n transition: 'transform 300ms ease-out',\n transform: `rotate(${isOpen ? '-180deg' : '0'})`,\n cursor: 'pointer',\n }}\n />\n )}\n </>\n );\n },\n isActive: isOpen,\n isDisabled: selectContext?.isDisabled,\n isReadOnly: true,\n theme,\n role: 'combobox',\n onClick: handleClick,\n onKeyDown: handleKeyDown,\n style: { ...(renderedChildren as ReactElement).props.style, caretColor: 'transparent', cursor: 'pointer' },\n variant: selectContext?.variant ?? (renderedChildren as ReactElement).props.variant,\n ...(selectContext?.isInvalid === true && { color: 'error' }),\n ...(typeof children !== 'function' &&\n selectContext?.value && {\n value: selectContext.value,\n }),\n inputProps: {\n ...(renderedChildren as ReactElement).props.inputProps,\n style: { ...(renderedChildren as ReactElement).props.inputProps?.style, cursor: 'pointer' },\n },\n });\n } else if (isComponent('Button')(renderedChildren)) {\n const children = (renderedChildren as ReactElement).props.children;\n const label = typeof children === 'string' ? children : children?.textContent;\n\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 'aria-activedescendant': isOpen ? focusContext.state.activedescendant?.[0] : undefined,\n 'aria-label': (renderedChildren as ReactElement).props['aria-label'] ?? label,\n className: classNames((renderedChildren as ReactElement).props.className, selectContext?.triggerClassName),\n color: selectContext?.color ?? (renderedChildren as ReactElement).props.color,\n isActive: isOpen,\n isDisabled: selectContext?.isDisabled,\n onClick: handleClick,\n onKeyDown: handleKeyDown,\n rightIcon: (renderedChildren as ReactElement).props.rightIcon ?? mdiChevronDown,\n rightIconProps: (renderedChildren as ReactElement).props.rightIcon\n ? (renderedChildren as ReactElement).props.rightIconProps\n : (renderedChildren as ReactElement).props.rightIconProps ?? {\n style: {\n transition: 'transform 300ms ease-out',\n transform: `rotate(${isOpen ? '-180deg' : '0'})`,\n },\n },\n role: 'combobox',\n theme,\n variant: selectContext?.variant ?? (renderedChildren as ReactElement).props.variant,\n ...(selectContext?.isInvalid === true && { color: 'error' }),\n ...(typeof children !== 'function' &&\n selectContext?.value && {\n children: selectContext.value,\n }),\n });\n }\n\n return <>{renderedChildren}</>;\n});\nSelectTrigger.className = CLASSNAME;\nSelectTrigger.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","SelectTrigger","forwardRef","props","ref","_renderedChildren$pro","children","hideExpandButton","getReferenceProps","isOpen","handleOpen","refs","usePopoverContext","childrenRef","triggerRef","useMergeRefs","setReference","focusContext","useContext","FocusWithinGroupContext","selectContext","SelectContext","listboxState","ListboxContext","theme","useTheme","renderedChildren","value","_inputRef","useRef","inputRef","handleKeyDown","event","code","_focusContext$state$a","state","selectedId","dispatch","type","FocusWithinGroupActionType","DELAY_ACTION","payload","KEY_DOWN_ON_LIST","key","EventKey","ArrowDown","ctrlKey","activedescendant","Home","_focusContext$state$a2","_focusContext$state$a3","FOCUS_ON_LIST","id","preventDefault","ArrowUp","End","_focusContext$state$a4","_focusContext$state$a5","ListboxActionType","SET","values","handleClick","_focusContext$state$a6","_focusContext$state$a7","useEffect","setValue","selectedValues","isComponent","_props$children","_focusContext$state$a8","_selectContext$color","_selectContext$varian","_props$inputProps","React","cloneElement","_objectSpread","undefined","className","classNames","triggerClassName","color","internal","isDisabled","isInvalid","isRequired","createElement","Fragment","Icon","icon","mdiChevronDown","style","transition","transform","cursor","isActive","isReadOnly","role","onClick","onKeyDown","caretColor","variant","inputProps","_props$children2","_focusContext$state$a9","_props$ariaLabel","_selectContext$color2","_props$rightIcon","_props$rightIconProps","_selectContext$varian2","label","textContent","rightIcon","rightIconProps","displayName"],"mappings":";;;;;;;;AAmBA,MAAMA,cAAc,GAAG,eAAe,CAAA;AACtC,MAAMC,SAAS,GAAG,wBAA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