@apipass/design-system 3.1.0 → 3.3.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 (92) hide show
  1. package/dist/lib/embedded-styles.js +1 -1
  2. package/dist/lib/lib.index.cjs +1 -1
  3. package/dist/lib/lib.index.js +755 -750
  4. package/dist/lib/lib.index.js.map +1 -1
  5. package/dist/lib/style.css +1 -1
  6. package/dist/lib/ui/hooks/useOverlayPortal.cjs +2 -0
  7. package/dist/lib/ui/hooks/useOverlayPortal.cjs.map +1 -0
  8. package/dist/lib/ui/hooks/useOverlayPortal.js +17 -0
  9. package/dist/lib/ui/hooks/useOverlayPortal.js.map +1 -0
  10. package/dist/lib/ui/primitives/ComboBox/ComboBox.cjs +1 -1
  11. package/dist/lib/ui/primitives/ComboBox/ComboBox.cjs.map +1 -1
  12. package/dist/lib/ui/primitives/ComboBox/ComboBox.js +31 -30
  13. package/dist/lib/ui/primitives/ComboBox/ComboBox.js.map +1 -1
  14. package/dist/lib/ui/primitives/DateRangePicker/DateRangePicker.cjs +1 -1
  15. package/dist/lib/ui/primitives/DateRangePicker/DateRangePicker.cjs.map +1 -1
  16. package/dist/lib/ui/primitives/DateRangePicker/DateRangePicker.js +187 -178
  17. package/dist/lib/ui/primitives/DateRangePicker/DateRangePicker.js.map +1 -1
  18. package/dist/lib/ui/primitives/Dialog/Dialog.cjs +1 -1
  19. package/dist/lib/ui/primitives/Dialog/Dialog.cjs.map +1 -1
  20. package/dist/lib/ui/primitives/Dialog/Dialog.js +52 -41
  21. package/dist/lib/ui/primitives/Dialog/Dialog.js.map +1 -1
  22. package/dist/lib/ui/primitives/JsonViewer/JsonViewer.cjs +2 -0
  23. package/dist/lib/ui/primitives/JsonViewer/JsonViewer.cjs.map +1 -0
  24. package/dist/lib/ui/primitives/JsonViewer/JsonViewer.js +121 -0
  25. package/dist/lib/ui/primitives/JsonViewer/JsonViewer.js.map +1 -0
  26. package/dist/lib/ui/primitives/Menu/Menu.cjs +1 -1
  27. package/dist/lib/ui/primitives/Menu/Menu.cjs.map +1 -1
  28. package/dist/lib/ui/primitives/Menu/Menu.js +68 -57
  29. package/dist/lib/ui/primitives/Menu/Menu.js.map +1 -1
  30. package/dist/lib/ui/primitives/Search/Search.cjs +1 -1
  31. package/dist/lib/ui/primitives/Search/Search.cjs.map +1 -1
  32. package/dist/lib/ui/primitives/Search/Search.js +21 -20
  33. package/dist/lib/ui/primitives/Search/Search.js.map +1 -1
  34. package/dist/lib/ui/primitives/Select/Select.cjs +1 -1
  35. package/dist/lib/ui/primitives/Select/Select.cjs.map +1 -1
  36. package/dist/lib/ui/primitives/Select/Select.js +31 -30
  37. package/dist/lib/ui/primitives/Select/Select.js.map +1 -1
  38. package/dist/lib/ui/primitives/Tooltip/Tooltip.cjs +1 -1
  39. package/dist/lib/ui/primitives/Tooltip/Tooltip.cjs.map +1 -1
  40. package/dist/lib/ui/primitives/Tooltip/Tooltip.js +56 -53
  41. package/dist/lib/ui/primitives/Tooltip/Tooltip.js.map +1 -1
  42. package/dist/lib/vendor/@codemirror/lang-json/dist/index.cjs +2 -0
  43. package/dist/lib/vendor/@codemirror/lang-json/dist/index.cjs.map +1 -0
  44. package/dist/lib/vendor/@codemirror/lang-json/dist/index.js +28 -0
  45. package/dist/lib/vendor/@codemirror/lang-json/dist/index.js.map +1 -0
  46. package/dist/lib/vendor/@codemirror/language/dist/index.cjs +2 -0
  47. package/dist/lib/vendor/@codemirror/language/dist/index.cjs.map +1 -0
  48. package/dist/lib/vendor/@codemirror/language/dist/index.js +791 -0
  49. package/dist/lib/vendor/@codemirror/language/dist/index.js.map +1 -0
  50. package/dist/lib/vendor/@codemirror/state/dist/index.cjs +6 -0
  51. package/dist/lib/vendor/@codemirror/state/dist/index.cjs.map +1 -0
  52. package/dist/lib/vendor/@codemirror/state/dist/index.js +2633 -0
  53. package/dist/lib/vendor/@codemirror/state/dist/index.js.map +1 -0
  54. package/dist/lib/vendor/@codemirror/view/dist/index.cjs +5 -0
  55. package/dist/lib/vendor/@codemirror/view/dist/index.cjs.map +1 -0
  56. package/dist/lib/vendor/@codemirror/view/dist/index.js +6068 -0
  57. package/dist/lib/vendor/@codemirror/view/dist/index.js.map +1 -0
  58. package/dist/lib/vendor/@lezer/common/dist/index.cjs +2 -0
  59. package/dist/lib/vendor/@lezer/common/dist/index.cjs.map +1 -0
  60. package/dist/lib/vendor/@lezer/common/dist/index.js +1392 -0
  61. package/dist/lib/vendor/@lezer/common/dist/index.js.map +1 -0
  62. package/dist/lib/vendor/@lezer/highlight/dist/index.cjs +2 -0
  63. package/dist/lib/vendor/@lezer/highlight/dist/index.cjs.map +1 -0
  64. package/dist/lib/vendor/@lezer/highlight/dist/index.js +638 -0
  65. package/dist/lib/vendor/@lezer/highlight/dist/index.js.map +1 -0
  66. package/dist/lib/vendor/@lezer/json/dist/index.cjs +2 -0
  67. package/dist/lib/vendor/@lezer/json/dist/index.cjs.map +1 -0
  68. package/dist/lib/vendor/@lezer/json/dist/index.js +35 -0
  69. package/dist/lib/vendor/@lezer/json/dist/index.js.map +1 -0
  70. package/dist/lib/vendor/@lezer/lr/dist/index.cjs +2 -0
  71. package/dist/lib/vendor/@lezer/lr/dist/index.cjs.map +1 -0
  72. package/dist/lib/vendor/@lezer/lr/dist/index.js +1269 -0
  73. package/dist/lib/vendor/@lezer/lr/dist/index.js.map +1 -0
  74. package/dist/lib/vendor/@marijn/find-cluster-break/src/index.cjs +2 -0
  75. package/dist/lib/vendor/@marijn/find-cluster-break/src/index.cjs.map +1 -0
  76. package/dist/lib/vendor/@marijn/find-cluster-break/src/index.js +70 -0
  77. package/dist/lib/vendor/@marijn/find-cluster-break/src/index.js.map +1 -0
  78. package/dist/lib/vendor/style-mod/src/style-mod.cjs +4 -0
  79. package/dist/lib/vendor/style-mod/src/style-mod.cjs.map +1 -0
  80. package/dist/lib/vendor/style-mod/src/style-mod.js +110 -0
  81. package/dist/lib/vendor/style-mod/src/style-mod.js.map +1 -0
  82. package/dist/lib/vendor/w3c-keyname/index.cjs +2 -0
  83. package/dist/lib/vendor/w3c-keyname/index.cjs.map +1 -0
  84. package/dist/lib/vendor/w3c-keyname/index.js +89 -0
  85. package/dist/lib/vendor/w3c-keyname/index.js.map +1 -0
  86. package/dist/types/ui/hooks/index.d.ts +1 -0
  87. package/dist/types/ui/hooks/useOverlayPortal.d.ts +15 -0
  88. package/dist/types/ui/primitives/Dialog/Dialog.d.ts +1 -1
  89. package/dist/types/ui/primitives/JsonViewer/JsonViewer.d.ts +16 -0
  90. package/dist/types/ui/primitives/Menu/Menu.d.ts +1 -1
  91. package/dist/types/ui/primitives/index.d.ts +1 -0
  92. package/package.json +7 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.cjs","sources":["../../../../../src/ui/primitives/Menu/Menu.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { IconChevronDown } from \"icons\";\nimport {\n Button,\n ButtonProps,\n Description,\n DescriptionProps,\n IconButton,\n Keyboard,\n KeyboardProps,\n Label,\n LabelProps,\n TextHeading,\n type TextHeadingProps,\n} from \"primitives\";\nimport type React from \"react\";\nimport {\n Menu as RACMenu,\n MenuItem as RACMenuItem,\n MenuTrigger as RACMenuTrigger,\n Popover as RACPopover,\n Separator as RACSeparator,\n type MenuItemProps as RACMenuItemProps,\n type MenuProps as RACMenuProps,\n type MenuTriggerProps as RACMenuTriggerProps,\n type PopoverProps as RACPopoverProps,\n type SeparatorProps as RACSeparatorProps,\n} from \"react-aria-components\";\nimport \"./menu.css\";\n\nexport type MenuProps<T> = RACMenuProps<T>;\nexport function Menu<T extends object>({ className, ...props }: MenuProps<T>) {\n return <RACMenu className={clsx(className, \"menu\")} {...props} />;\n}\n\nexport type MenuTriggerProps = RACMenuTriggerProps;\nexport function MenuTrigger({ ...props }: MenuTriggerProps) {\n return <RACMenuTrigger {...props} />;\n}\n\nexport interface MenuButtonProps<T>\n extends RACMenuProps<T>,\n Omit<RACMenuTriggerProps, \"children\"> {\n label: string;\n variant?: ButtonProps[\"variant\"];\n placement?: MenuPopoverProps[\"placement\"];\n icon?: React.ReactNode;\n}\nexport function MenuButton<T extends object>({\n label,\n children,\n icon,\n placement,\n variant,\n ...props\n}: MenuButtonProps<T>) {\n return (\n <MenuTrigger>\n {icon ? (\n <IconButton variant={variant} aria-label={label}>\n {icon}\n </IconButton>\n ) : (\n <Button variant={variant}>{label}</Button>\n )}\n <MenuPopover placement={placement}>\n <Menu {...props}>{children}</Menu>\n </MenuPopover>\n </MenuTrigger>\n );\n}\n\nexport type MenuPopoverProps = RACPopoverProps;\nexport function MenuPopover({ ...props }: MenuPopoverProps) {\n return <RACPopover {...props} />;\n}\n\nexport type MenuItemProps = RACMenuItemProps;\nexport function MenuItem({ className, ...props }: MenuItemProps) {\n const classNames = clsx(className, \"menu-item\");\n const textValue =\n props.textValue ||\n (typeof props.children === \"string\" ? props.children : undefined);\n return (\n <RACMenuItem {...props} className={classNames} textValue={textValue}>\n {({ hasSubmenu }) => (\n <>\n {props.children}\n {hasSubmenu && <IconChevronDown />}\n </>\n )}\n </RACMenuItem>\n );\n}\n\nexport type MenuHeaderProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function MenuHeader({ className, ...props }: MenuHeaderProps) {\n const classNames = clsx(className, \"menu-header\");\n return <div {...props} className={classNames} />;\n}\n\nexport type MenuSectionProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function MenuSection({ className, ...props }: MenuSectionProps) {\n const classNames = clsx(className, \"menu-section\");\n return <div {...props} className={classNames} />;\n}\n\nexport type MenuHeadingProps = TextHeadingProps;\nexport function MenuHeading({ className, ...props }: MenuHeadingProps) {\n const classNames = clsx(className, \"menu-heading\");\n return <TextHeading {...props} className={classNames} />;\n}\n\nexport type MenuSeparatorProps = RACSeparatorProps;\nexport function MenuSeparator({ className, ...props }: MenuSeparatorProps) {\n const classNames = clsx(className, \"menu-separator\");\n return <RACSeparator {...props} className={classNames} />;\n}\n\nexport type MenuLabelProps = LabelProps;\nexport function MenuLabel({ className, ...props }: MenuLabelProps) {\n const classNames = clsx(className, \"menu-label\");\n return <Label {...props} className={classNames} />;\n}\n\nexport type MenuDescriptionProps = DescriptionProps;\nexport function MenuDescription({ className, ...props }: MenuDescriptionProps) {\n const classNames = clsx(className, \"menu-description\");\n return <Description {...props} className={classNames} />;\n}\n\nexport type MenuShortcutProps = KeyboardProps;\nexport function MenuShortcut({\n children,\n className,\n ...props\n}: MenuShortcutProps) {\n const classNames = clsx(className, \"menu-shortcut\");\n return (\n <Keyboard {...props} className={classNames}>\n {children}\n </Keyboard>\n );\n}\n"],"names":["Menu","className","props","jsx","RACMenu","clsx","MenuTrigger","RACMenuTrigger","MenuButton","label","children","icon","placement","variant","IconButton","Button","MenuPopover","RACPopover","MenuItem","classNames","textValue","RACMenuItem","hasSubmenu","jsxs","Fragment","IconChevronDown","MenuHeader","MenuSection","MenuHeading","TextHeading","MenuSeparator","RACSeparator","MenuLabel","Label","MenuDescription","Description","MenuShortcut","Keyboard"],"mappings":"qaA+BO,SAASA,EAAuB,CAAE,UAAAC,EAAW,GAAGC,GAAuB,CAC5E,OAAOC,EAAAA,IAACC,QAAQ,UAAWC,EAAAA,KAAKJ,EAAW,MAAM,EAAI,GAAGC,EAAO,CACjE,CAGO,SAASI,EAAY,CAAE,GAAGJ,GAA2B,CAC1D,OAAOC,MAACI,EAAAA,YAAA,CAAgB,GAAGL,CAAA,CAAO,CACpC,CAUO,SAASM,EAA6B,CAC3C,MAAAC,EACA,SAAAC,EACA,KAAAC,EACA,UAAAC,EACA,QAAAC,EACA,GAAGX,CACL,EAAuB,CACrB,cACGI,EAAA,CACE,SAAA,CAAAK,EACCR,EAAAA,IAACW,EAAAA,WAAA,CAAW,QAAAD,EAAkB,aAAYJ,EACvC,WACH,EAEAN,EAAAA,IAACY,EAAAA,OAAA,CAAO,QAAAF,EAAmB,SAAAJ,EAAM,EAEnCN,EAAAA,IAACa,GAAY,UAAAJ,EACX,SAAAT,EAAAA,IAACH,GAAM,GAAGE,E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EAAAA,IAAC4B,EAAAA,UAAA,CAAc,GAAG7B,EAAO,UAAWiB,EAAY,CACzD,CAGO,SAASa,EAAU,CAAE,UAAA/B,EAAW,GAAGC,GAAyB,CACjE,MAAMiB,EAAad,EAAAA,KAAKJ,EAAW,YAAY,EAC/C,OAAOE,EAAAA,IAAC8B,EAAAA,MAAA,CAAO,GAAG/B,EAAO,UAAWiB,EAAY,CAClD,CAGO,SAASe,EAAgB,CAAE,UAAAjC,EAAW,GAAGC,GAA+B,CAC7E,MAAMiB,EAAad,EAAAA,KAAKJ,EAAW,kBAAkB,EACrD,OAAOE,EAAAA,IAACgC,EAAAA,YAAA,CAAa,GAAGjC,EAAO,UAAWiB,EAAY,CACxD,CAGO,SAASiB,EAAa,CAC3B,SAAA1B,EACA,UAAAT,EACA,GAAGC,CACL,EAAsB,CACpB,MAAMiB,EAAad,EAAAA,KAAKJ,EAAW,eAAe,EAClD,aACGoC,EAAAA,SAAA,CAAU,GAAGnC,EAAO,UAAWiB,EAC7B,SAAAT,EACH,CAEJ"}
1
+ {"version":3,"file":"Menu.cjs","sources":["../../../../../src/ui/primitives/Menu/Menu.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useOverlayPortalContainer } from \"hooks\";\nimport { IconChevronDown } from \"icons\";\nimport {\n Button,\n ButtonProps,\n Description,\n DescriptionProps,\n IconButton,\n Keyboard,\n KeyboardProps,\n Label,\n LabelProps,\n TextHeading,\n type TextHeadingProps,\n} from \"primitives\";\nimport type React from \"react\";\nimport {\n Menu as RACMenu,\n MenuItem as RACMenuItem,\n MenuTrigger as RACMenuTrigger,\n Popover as RACPopover,\n Separator as RACSeparator,\n type MenuItemProps as RACMenuItemProps,\n type MenuProps as RACMenuProps,\n type MenuTriggerProps as RACMenuTriggerProps,\n type PopoverProps as RACPopoverProps,\n type SeparatorProps as RACSeparatorProps,\n} from \"react-aria-components\";\nimport \"./menu.css\";\n\nexport type MenuProps<T> = RACMenuProps<T>;\nexport function Menu<T extends object>({ className, ...props }: MenuProps<T>) {\n return <RACMenu className={clsx(className, \"menu\")} {...props} />;\n}\n\nexport type MenuTriggerProps = RACMenuTriggerProps;\nexport function MenuTrigger({ ...props }: MenuTriggerProps) {\n return <RACMenuTrigger {...props} />;\n}\n\nexport interface MenuButtonProps<T>\n extends RACMenuProps<T>,\n Omit<RACMenuTriggerProps, \"children\"> {\n label: string;\n variant?: ButtonProps[\"variant\"];\n placement?: MenuPopoverProps[\"placement\"];\n icon?: React.ReactNode;\n}\nexport function MenuButton<T extends object>({\n label,\n children,\n icon,\n placement,\n variant,\n ...props\n}: MenuButtonProps<T>) {\n return (\n <MenuTrigger>\n {icon ? (\n <IconButton variant={variant} aria-label={label}>\n {icon}\n </IconButton>\n ) : (\n <Button variant={variant}>{label}</Button>\n )}\n <MenuPopover placement={placement}>\n <Menu {...props}>{children}</Menu>\n </MenuPopover>\n </MenuTrigger>\n );\n}\n\nexport type MenuPopoverProps = RACPopoverProps;\nexport function MenuPopover({\n UNSTABLE_portalContainer,\n ...props\n}: MenuPopoverProps) {\n // Sem container explícito o menu faz portal no document.body — fora da shadow\n // root do MFE, sem CSS. Ver ui/hooks/useOverlayPortal.\n const portalContainer = useOverlayPortalContainer();\n return (\n <RACPopover\n {...props}\n UNSTABLE_portalContainer={UNSTABLE_portalContainer ?? portalContainer}\n />\n );\n}\n\nexport type MenuItemProps = RACMenuItemProps;\nexport function MenuItem({ className, ...props }: MenuItemProps) {\n const classNames = clsx(className, \"menu-item\");\n const textValue =\n props.textValue ||\n (typeof props.children === \"string\" ? props.children : undefined);\n return (\n <RACMenuItem {...props} className={classNames} textValue={textValue}>\n {({ hasSubmenu }) => (\n <>\n {props.children}\n {hasSubmenu && <IconChevronDown />}\n </>\n )}\n </RACMenuItem>\n );\n}\n\nexport type MenuHeaderProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function MenuHeader({ className, ...props }: MenuHeaderProps) {\n const classNames = clsx(className, \"menu-header\");\n return <div {...props} className={classNames} />;\n}\n\nexport type MenuSectionProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function MenuSection({ className, ...props }: MenuSectionProps) {\n const classNames = clsx(className, \"menu-section\");\n return <div {...props} className={classNames} />;\n}\n\nexport type MenuHeadingProps = TextHeadingProps;\nexport function MenuHeading({ className, ...props }: MenuHeadingProps) {\n const classNames = clsx(className, \"menu-heading\");\n return <TextHeading {...props} className={classNames} />;\n}\n\nexport type MenuSeparatorProps = RACSeparatorProps;\nexport function MenuSeparator({ className, ...props }: MenuSeparatorProps) {\n const classNames = clsx(className, \"menu-separator\");\n return <RACSeparator {...props} className={classNames} />;\n}\n\nexport type MenuLabelProps = LabelProps;\nexport function MenuLabel({ className, ...props }: MenuLabelProps) {\n const classNames = clsx(className, \"menu-label\");\n return <Label {...props} className={classNames} />;\n}\n\nexport type MenuDescriptionProps = DescriptionProps;\nexport function MenuDescription({ className, ...props }: MenuDescriptionProps) {\n const classNames = clsx(className, \"menu-description\");\n return <Description {...props} className={classNames} />;\n}\n\nexport type MenuShortcutProps = KeyboardProps;\nexport function MenuShortcut({\n children,\n className,\n ...props\n}: MenuShortcutProps) {\n const classNames = clsx(className, \"menu-shortcut\");\n return (\n <Keyboard {...props} className={classNames}>\n {children}\n </Keyboard>\n );\n}\n"],"names":["Menu","className","props","jsx","RACMenu","clsx","MenuTrigger","RACMenuTrigger","MenuButton","label","children","icon","placement","variant","IconButton","Button","MenuPopover","UNSTABLE_portalContainer","portalContainer","useOverlayPortalContainer","RACPopover","MenuItem","classNames","textValue","RACMenuItem","hasSubmenu","jsxs","Fragment","IconChevronDown","MenuHeader","MenuSection","MenuHeading","TextHeading","MenuSeparator","RACSeparator","MenuLabel","Label","MenuDescription","Description","MenuShortcut","Keyboard"],"mappings":"mdAgCO,SAASA,EAAuB,CAAE,UAAAC,EAAW,GAAGC,GAAuB,CAC5E,OAAOC,EAAAA,IAACC,QAAQ,UAAWC,EAAAA,KAAKJ,EAAW,MAAM,EAAI,GAAGC,EAAO,CACjE,CAGO,SAAS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xs as c, Fragment as i } from "react/jsx-runtime";
2
- import { clsx as s } from "../../../vendor/clsx/dist/clsx.js";
1
+ import { jsx as t, jsxs as u, Fragment as i } from "react/jsx-runtime";
2
+ import { clsx as o } from "../../../vendor/clsx/dist/clsx.js";
3
3
  import { Menu as m, MenuTrigger as l, Popover as f, MenuItem as d, Separator as M } from "react-aria-components";
4
4
  /* empty css */
5
5
  import { IconChevronDown as N } from "../../icons/IconChevronDown.js";
6
- import { Label as h, Description as g, Keyboard as p } from "../Fieldset/Fieldset.js";
6
+ import { Label as h, Description as p, Keyboard as g } from "../Fieldset/Fieldset.js";
7
7
  import { IconButton as x } from "../IconButton/IconButton.js";
8
8
  import { Button as v } from "../Button/Button.js";
9
- import { TextHeading as I } from "../Text/Text.js";
10
- function b({ className: e, ...n }) {
11
- return /* @__PURE__ */ t(m, { className: s(e, "menu"), ...n });
9
+ import { useOverlayPortalContainer as I } from "../../hooks/useOverlayPortal.js";
10
+ import { TextHeading as S } from "../Text/Text.js";
11
+ function T({ className: n, ...e }) {
12
+ return /* @__PURE__ */ t(m, { className: o(n, "menu"), ...e });
12
13
  }
13
- function S({ ...e }) {
14
- return /* @__PURE__ */ t(l, { ...e });
14
+ function b({ ...n }) {
15
+ return /* @__PURE__ */ t(l, { ...n });
15
16
  }
16
- function w({
17
- label: e,
18
- children: n,
17
+ function A({
18
+ label: n,
19
+ children: e,
19
20
  icon: r,
20
- placement: o,
21
- variant: u,
22
- ...a
21
+ placement: s,
22
+ variant: a,
23
+ ...c
23
24
  }) {
24
- return /* @__PURE__ */ c(S, { children: [
25
- r ? /* @__PURE__ */ t(x, { variant: u, "aria-label": e, children: r }) : /* @__PURE__ */ t(v, { variant: u, children: e }),
26
- /* @__PURE__ */ t(T, { placement: o, children: /* @__PURE__ */ t(b, { ...a, children: n }) })
25
+ return /* @__PURE__ */ u(b, { children: [
26
+ r ? /* @__PURE__ */ t(x, { variant: a, "aria-label": n, children: r }) : /* @__PURE__ */ t(v, { variant: a, children: n }),
27
+ /* @__PURE__ */ t(B, { placement: s, children: /* @__PURE__ */ t(T, { ...c, children: e }) })
27
28
  ] });
28
29
  }
29
- function T({ ...e }) {
30
- return /* @__PURE__ */ t(f, { ...e });
30
+ function B({
31
+ UNSTABLE_portalContainer: n,
32
+ ...e
33
+ }) {
34
+ const r = I();
35
+ return /* @__PURE__ */ t(
36
+ f,
37
+ {
38
+ ...e,
39
+ UNSTABLE_portalContainer: n ?? r
40
+ }
41
+ );
31
42
  }
32
- function C({ className: e, ...n }) {
33
- const r = s(e, "menu-item"), o = n.textValue || (typeof n.children == "string" ? n.children : void 0);
34
- return /* @__PURE__ */ t(d, { ...n, className: r, textValue: o, children: ({ hasSubmenu: u }) => /* @__PURE__ */ c(i, { children: [
35
- n.children,
36
- u && /* @__PURE__ */ t(N, {})
43
+ function E({ className: n, ...e }) {
44
+ const r = o(n, "menu-item"), s = e.textValue || (typeof e.children == "string" ? e.children : void 0);
45
+ return /* @__PURE__ */ t(d, { ...e, className: r, textValue: s, children: ({ hasSubmenu: a }) => /* @__PURE__ */ u(i, { children: [
46
+ e.children,
47
+ a && /* @__PURE__ */ t(N, {})
37
48
  ] }) });
38
49
  }
39
- function F({ className: e, ...n }) {
40
- const r = s(e, "menu-header");
41
- return /* @__PURE__ */ t("div", { ...n, className: r });
50
+ function F({ className: n, ...e }) {
51
+ const r = o(n, "menu-header");
52
+ return /* @__PURE__ */ t("div", { ...e, className: r });
42
53
  }
43
- function K({ className: e, ...n }) {
44
- const r = s(e, "menu-section");
45
- return /* @__PURE__ */ t("div", { ...n, className: r });
54
+ function K({ className: n, ...e }) {
55
+ const r = o(n, "menu-section");
56
+ return /* @__PURE__ */ t("div", { ...e, className: r });
46
57
  }
47
- function k({ className: e, ...n }) {
48
- const r = s(e, "menu-heading");
49
- return /* @__PURE__ */ t(I, { ...n, className: r });
58
+ function O({ className: n, ...e }) {
59
+ const r = o(n, "menu-heading");
60
+ return /* @__PURE__ */ t(S, { ...e, className: r });
50
61
  }
51
- function q({ className: e, ...n }) {
52
- const r = s(e, "menu-separator");
53
- return /* @__PURE__ */ t(M, { ...n, className: r });
62
+ function U({ className: n, ...e }) {
63
+ const r = o(n, "menu-separator");
64
+ return /* @__PURE__ */ t(M, { ...e, className: r });
54
65
  }
55
- function z({ className: e, ...n }) {
56
- const r = s(e, "menu-label");
57
- return /* @__PURE__ */ t(h, { ...n, className: r });
66
+ function _({ className: n, ...e }) {
67
+ const r = o(n, "menu-label");
68
+ return /* @__PURE__ */ t(h, { ...e, className: r });
58
69
  }
59
- function A({ className: e, ...n }) {
60
- const r = s(e, "menu-description");
61
- return /* @__PURE__ */ t(g, { ...n, className: r });
70
+ function k({ className: n, ...e }) {
71
+ const r = o(n, "menu-description");
72
+ return /* @__PURE__ */ t(p, { ...e, className: r });
62
73
  }
63
- function E({
64
- children: e,
65
- className: n,
74
+ function q({
75
+ children: n,
76
+ className: e,
66
77
  ...r
67
78
  }) {
68
- const o = s(n, "menu-shortcut");
69
- return /* @__PURE__ */ t(p, { ...r, className: o, children: e });
79
+ const s = o(e, "menu-shortcut");
80
+ return /* @__PURE__ */ t(g, { ...r, className: s, children: n });
70
81
  }
71
82
  export {
72
- b as Menu,
73
- w as MenuButton,
74
- A as MenuDescription,
83
+ T as Menu,
84
+ A as MenuButton,
85
+ k as MenuDescription,
75
86
  F as MenuHeader,
76
- k as MenuHeading,
77
- C as MenuItem,
78
- z as MenuLabel,
79
- T as MenuPopover,
87
+ O as MenuHeading,
88
+ E as MenuItem,
89
+ _ as MenuLabel,
90
+ B as MenuPopover,
80
91
  K as MenuSection,
81
- q as MenuSeparator,
82
- E as MenuShortcut,
83
- S as MenuTrigger
92
+ U as MenuSeparator,
93
+ q as MenuShortcut,
94
+ b as MenuTrigger
84
95
  };
85
96
  //# sourceMappingURL=Menu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.js","sources":["../../../../../src/ui/primitives/Menu/Menu.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { IconChevronDown } from \"icons\";\nimport {\n Button,\n ButtonProps,\n Description,\n DescriptionProps,\n IconButton,\n Keyboard,\n KeyboardProps,\n Label,\n LabelProps,\n TextHeading,\n type TextHeadingProps,\n} from \"primitives\";\nimport type React from \"react\";\nimport {\n Menu as RACMenu,\n MenuItem as RACMenuItem,\n MenuTrigger as RACMenuTrigger,\n Popover as RACPopover,\n Separator as RACSeparator,\n type MenuItemProps as RACMenuItemProps,\n type MenuProps as RACMenuProps,\n type MenuTriggerProps as RACMenuTriggerProps,\n type PopoverProps as RACPopoverProps,\n type SeparatorProps as RACSeparatorProps,\n} from \"react-aria-components\";\nimport \"./menu.css\";\n\nexport type MenuProps<T> = RACMenuProps<T>;\nexport function Menu<T extends object>({ className, ...props }: MenuProps<T>) {\n return <RACMenu className={clsx(className, \"menu\")} {...props} />;\n}\n\nexport type MenuTriggerProps = RACMenuTriggerProps;\nexport function MenuTrigger({ ...props }: MenuTriggerProps) {\n return <RACMenuTrigger {...props} />;\n}\n\nexport interface MenuButtonProps<T>\n extends RACMenuProps<T>,\n Omit<RACMenuTriggerProps, \"children\"> {\n label: string;\n variant?: ButtonProps[\"variant\"];\n placement?: MenuPopoverProps[\"placement\"];\n icon?: React.ReactNode;\n}\nexport function MenuButton<T extends object>({\n label,\n children,\n icon,\n placement,\n variant,\n ...props\n}: MenuButtonProps<T>) {\n return (\n <MenuTrigger>\n {icon ? (\n <IconButton variant={variant} aria-label={label}>\n {icon}\n </IconButton>\n ) : (\n <Button variant={variant}>{label}</Button>\n )}\n <MenuPopover placement={placement}>\n <Menu {...props}>{children}</Menu>\n </MenuPopover>\n </MenuTrigger>\n );\n}\n\nexport type MenuPopoverProps = RACPopoverProps;\nexport function MenuPopover({ ...props }: MenuPopoverProps) {\n return <RACPopover {...props} />;\n}\n\nexport type MenuItemProps = RACMenuItemProps;\nexport function MenuItem({ className, ...props }: MenuItemProps) {\n const classNames = clsx(className, \"menu-item\");\n const textValue =\n props.textValue ||\n (typeof props.children === \"string\" ? props.children : undefined);\n return (\n <RACMenuItem {...props} className={classNames} textValue={textValue}>\n {({ hasSubmenu }) => (\n <>\n {props.children}\n {hasSubmenu && <IconChevronDown />}\n </>\n )}\n </RACMenuItem>\n );\n}\n\nexport type MenuHeaderProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function MenuHeader({ className, ...props }: MenuHeaderProps) {\n const classNames = clsx(className, \"menu-header\");\n return <div {...props} className={classNames} />;\n}\n\nexport type MenuSectionProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function MenuSection({ className, ...props }: MenuSectionProps) {\n const classNames = clsx(className, \"menu-section\");\n return <div {...props} className={classNames} />;\n}\n\nexport type MenuHeadingProps = TextHeadingProps;\nexport function MenuHeading({ className, ...props }: MenuHeadingProps) {\n const classNames = clsx(className, \"menu-heading\");\n return <TextHeading {...props} className={classNames} />;\n}\n\nexport type MenuSeparatorProps = RACSeparatorProps;\nexport function MenuSeparator({ className, ...props }: MenuSeparatorProps) {\n const classNames = clsx(className, \"menu-separator\");\n return <RACSeparator {...props} className={classNames} />;\n}\n\nexport type MenuLabelProps = LabelProps;\nexport function MenuLabel({ className, ...props }: MenuLabelProps) {\n const classNames = clsx(className, \"menu-label\");\n return <Label {...props} className={classNames} />;\n}\n\nexport type MenuDescriptionProps = DescriptionProps;\nexport function MenuDescription({ className, ...props }: MenuDescriptionProps) {\n const classNames = clsx(className, \"menu-description\");\n return <Description {...props} className={classNames} />;\n}\n\nexport type MenuShortcutProps = KeyboardProps;\nexport function MenuShortcut({\n children,\n className,\n ...props\n}: MenuShortcutProps) {\n const classNames = clsx(className, \"menu-shortcut\");\n return (\n <Keyboard {...props} className={classNames}>\n {children}\n </Keyboard>\n );\n}\n"],"names":["Menu","className","props","jsx","RACMenu","clsx","MenuTrigger","RACMenuTrigger","MenuButton","label","children","icon","placement","variant","IconButton","Button","MenuPopover","RACPopover","MenuItem","classNames","textValue","RACMenuItem","hasSubmenu","jsxs","Fragment","IconChevronDown","MenuHeader","MenuSection","MenuHeading","TextHeading","MenuSeparator","RACSeparator","MenuLabel","Label","MenuDescription","Description","MenuShortcut","Keyboard"],"mappings":";;;;;;;;;AA+BO,SAASA,EAAuB,EAAE,WAAAC,GAAW,GAAGC,KAAuB;AAC5E,SAAO,gBAAAC,EAACC,KAAQ,WAAWC,EAAKJ,GAAW,MAAM,GAAI,GAAGC,GAAO;AACjE;AAGO,SAASI,EAAY,EAAE,GAAGJ,KAA2B;AAC1D,SAAO,gBAAAC,EAACI,GAAA,EAAgB,GAAGL,EAAA,CAAO;AACpC;AAUO,SAASM,EAA6B;AAAA,EAC3C,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGX;AACL,GAAuB;AACrB,2BACGI,GAAA,EACE,UAAA;AAAA,IAAAK,IACC,gBAAAR,EAACW,GAAA,EAAW,SAAAD,GAAkB,cAAYJ,GACvC,aACH,IAEA,gBAAAN,EAACY,GAAA,EAAO,SAAAF,GAAmB,UAAAJ,GAAM;AAAA,IAEnC,gBAAAN,EAACa,KAAY,WAAAJ,GACX,UAAA,gBAAAT,EAACH,KAAM,GAAGE,GAAQ,UAAAQ,GAAS,EAAA,CAC7B;AAAA,EAAA,GACF;AAEJ;AAGO,SAASM,EAAY,EAAE,GAAGd,KAA2B;AAC1D,SAAO,gBAAAC,EAACc,GAAA,EAAY,GAAGf,EAAA,CAAO;AAChC;AAGO,SAASgB,EAAS,EAAE,WAAAjB,GAAW,GAAGC,KAAwB;AAC/D,QAAMiB,IAAad,EAAKJ,GAAW,WAAW,GACxCmB,IACJlB,EAAM,cACL,OAAOA,EAAM,YAAa,WAAWA,EAAM,WAAW;AACzD,SACE,gBAAAC,EAACkB,GAAA,EAAa,GAAGnB,GAAO,WAAWiB,GAAY,WAAAC,GAC5C,UAAA,CAAC,EAAE,YAAAE,EAAA,MACF,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAtB,EAAM;AAAA,IACNoB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GoC,GAAA,EAAU,GAAGnC,GAAO,WAAWiB,GAC7B,UAAAT,GACH;AAEJ;"}
1
+ {"version":3,"file":"Menu.js","sources":["../../../../../src/ui/primitives/Menu/Menu.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useOverlayPortalContainer } from \"hooks\";\nimport { IconChevronDown } from \"icons\";\nimport {\n Button,\n ButtonProps,\n Description,\n DescriptionProps,\n IconButton,\n Keyboard,\n KeyboardProps,\n Label,\n LabelProps,\n TextHeading,\n type TextHeadingProps,\n} from \"primitives\";\nimport type React from \"react\";\nimport {\n Menu as RACMenu,\n MenuItem as RACMenuItem,\n MenuTrigger as RACMenuTrigger,\n Popover as RACPopover,\n Separator as RACSeparator,\n type MenuItemProps as RACMenuItemProps,\n type MenuProps as RACMenuProps,\n type MenuTriggerProps as RACMenuTriggerProps,\n type PopoverProps as RACPopoverProps,\n type SeparatorProps as RACSeparatorProps,\n} from \"react-aria-components\";\nimport \"./menu.css\";\n\nexport type MenuProps<T> = RACMenuProps<T>;\nexport function Menu<T extends object>({ className, ...props }: MenuProps<T>) {\n return <RACMenu className={clsx(className, \"menu\")} {...props} />;\n}\n\nexport type MenuTriggerProps = RACMenuTriggerProps;\nexport function MenuTrigger({ ...props }: MenuTriggerProps) {\n return <RACMenuTrigger {...props} />;\n}\n\nexport interface MenuButtonProps<T>\n extends RACMenuProps<T>,\n Omit<RACMenuTriggerProps, \"children\"> {\n label: string;\n variant?: ButtonProps[\"variant\"];\n placement?: MenuPopoverProps[\"placement\"];\n icon?: React.ReactNode;\n}\nexport function MenuButton<T extends object>({\n label,\n children,\n icon,\n placement,\n variant,\n ...props\n}: MenuButtonProps<T>) {\n return (\n <MenuTrigger>\n {icon ? (\n <IconButton variant={variant} aria-label={label}>\n {icon}\n </IconButton>\n ) : (\n <Button variant={variant}>{label}</Button>\n )}\n <MenuPopover placement={placement}>\n <Menu {...props}>{children}</Menu>\n </MenuPopover>\n </MenuTrigger>\n );\n}\n\nexport type MenuPopoverProps = RACPopoverProps;\nexport function MenuPopover({\n UNSTABLE_portalContainer,\n ...props\n}: MenuPopoverProps) {\n // Sem container explícito o menu faz portal no document.body — fora da shadow\n // root do MFE, sem CSS. Ver ui/hooks/useOverlayPortal.\n const portalContainer = useOverlayPortalContainer();\n return (\n <RACPopover\n {...props}\n UNSTABLE_portalContainer={UNSTABLE_portalContainer ?? portalContainer}\n />\n );\n}\n\nexport type MenuItemProps = RACMenuItemProps;\nexport function MenuItem({ className, ...props }: MenuItemProps) {\n const classNames = clsx(className, \"menu-item\");\n const textValue =\n props.textValue ||\n (typeof props.children === \"string\" ? props.children : undefined);\n return (\n <RACMenuItem {...props} className={classNames} textValue={textValue}>\n {({ hasSubmenu }) => (\n <>\n {props.children}\n {hasSubmenu && <IconChevronDown />}\n </>\n )}\n </RACMenuItem>\n );\n}\n\nexport type MenuHeaderProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function MenuHeader({ className, ...props }: MenuHeaderProps) {\n const classNames = clsx(className, \"menu-header\");\n return <div {...props} className={classNames} />;\n}\n\nexport type MenuSectionProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function MenuSection({ className, ...props }: MenuSectionProps) {\n const classNames = clsx(className, \"menu-section\");\n return <div {...props} className={classNames} />;\n}\n\nexport type MenuHeadingProps = TextHeadingProps;\nexport function MenuHeading({ className, ...props }: MenuHeadingProps) {\n const classNames = clsx(className, \"menu-heading\");\n return <TextHeading {...props} className={classNames} />;\n}\n\nexport type MenuSeparatorProps = RACSeparatorProps;\nexport function MenuSeparator({ className, ...props }: MenuSeparatorProps) {\n const classNames = clsx(className, \"menu-separator\");\n return <RACSeparator {...props} className={classNames} />;\n}\n\nexport type MenuLabelProps = LabelProps;\nexport function MenuLabel({ className, ...props }: MenuLabelProps) {\n const classNames = clsx(className, \"menu-label\");\n return <Label {...props} className={classNames} />;\n}\n\nexport type MenuDescriptionProps = DescriptionProps;\nexport function MenuDescription({ className, ...props }: MenuDescriptionProps) {\n const classNames = clsx(className, \"menu-description\");\n return <Description {...props} className={classNames} />;\n}\n\nexport type MenuShortcutProps = KeyboardProps;\nexport function MenuShortcut({\n children,\n className,\n ...props\n}: MenuShortcutProps) {\n const classNames = clsx(className, \"menu-shortcut\");\n return (\n <Keyboard {...props} className={classNames}>\n {children}\n </Keyboard>\n );\n}\n"],"names":["Menu","className","props","jsx","RACMenu","clsx","MenuTrigger","RACMenuTrigger","MenuButton","label","children","icon","placement","variant","IconButton","Button","MenuPopover","UNSTABLE_portalContainer","portalContainer","useOverlayPortalContainer","RACPopover","MenuItem","classNames","textValue","RACMenuItem","hasSubmenu","jsxs","Fragment","IconChevronDown","MenuHeader","MenuSection","MenuHeading","TextHeading","MenuSeparator","RACSeparator","MenuLabel","Label","MenuDescription","Description","MenuShortcut","Keyboard"],"mappings":";;;;;;;;;;AAgCO,SAASA,EAAuB,EAAE,WAAAC,GAAW,GAAGC,KAAuB;AAC5E,SAAO,gBAAAC,EAACC,KAAQ,WAAWC,EAAKJ,GAAW,MAAM,GAAI,GAAGC,GAAO;AACjE;AAGO,SAASI,EAAY,EAAE,GAAGJ,KAA2B;AAC1D,SAAO,gBAAAC,EAACI,GAAA,EAAgB,GAAGL,EAAA,CAAO;AACpC;AAUO,SAASM,EAA6B;AAAA,EAC3C,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGX;AACL,GAAuB;AACrB,2BACGI,GAAA,EACE,UAAA;AAAA,IAAAK,IACC,gBAAAR,EAACW,GAAA,EAAW,SAAAD,GAAkB,cAAYJ,GACvC,aACH,IAEA,gBAAAN,EAACY,GAAA,EAAO,SAAAF,GAAmB,UAAAJ,GAAM;AAAA,IAEnC,gBAAAN,EAACa,KAAY,WAAAJ,GACX,UAAA,gBAAAT,EAACH,KAAM,GAAGE,GAAQ,UAAAQ,GAAS,EAAA,CAC7B;AAAA,EAAA,GACF;AAEJ;AAGO,SAASM,EAAY;AAAA,EAC1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BAAAE,EAAC+B,GAAA,EAAc,GAAGhC,GAAO,WAAWoB,GAAY;AACzD;AAGO,SAASa,EAAU,EAAE,WAAAlC,GAAW,GAAGC,KAAyB;AACjE,QAAMoB,IAAajB,EAAKJ,GAAW,YAAY;AAC/C,SAAO,gBAAAE,EAACiC,GAAA,EAAO,GAAGlC,GAAO,WAAWoB,GAAY;AAClD;AAGO,SAASe,EAAgB,EAAE,WAAApC,GAAW,GAAGC,KAA+B;AAC7E,QAAMoB,IAAajB,EAAKJ,GAAW,kBAAkB;AACrD,SAAO,gBAAAE,EAACmC,GAAA,EAAa,GAAGpC,GAAO,WAAWoB,GAAY;AACxD;AAGO,SAASiB,EAAa;AAAA,EAC3B,UAAA7B;AAAA,EACA,WAAAT;AAAA,EACA,GAAGC;AACL,GAAsB;AACpB,QAAMoB,IAAajB,EAAKJ,GAAW,eAAe;AAClD,2BACGuC,GAAA,EAAU,GAAGtC,GAAO,WAAWoB,GAC7B,UAAAZ,GACH;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),d=require("../../../vendor/clsx/dist/clsx.cjs"),a=require("react"),l=require("react-aria-components");;/* empty css */const p=require("../../icons/IconX.cjs"),q=require("../../icons/IconSearch.cjs"),b=require("../Fieldset/Fieldset.cjs"),S=require("../Input/Input.cjs"),h=require("../IconButton/IconButton.cjs"),x=require("../ListBox/ListBox.cjs"),f=a.forwardRef(function({className:m,results:s,onSearch:o,...i},n){const[u,j]=a.useState(""),c=a.useRef(null),t=e=>{j(e),o&&o(e)},I=d.clsx(m,"search-input-container");return r.jsxs(l.ComboBox,{className:I,children:[r.jsx(b.Label,{hidden:!0,children:i["aria-label"]||"Search"}),r.jsx(S.Input,{type:"search",className:"search-input",value:u,onInput:e=>t(e.currentTarget.value),ref:e=>{c.current=e,typeof n=="function"?n(e):n&&(n.current=e)},...i}),r.jsx("span",{className:"search-icon",children:u?r.jsx(h.IconButton,{"aria-label":"Clear search",onPress:()=>t(""),size:"small",variant:"subtle",children:r.jsx(p.IconX,{})}):r.jsx(h.IconButton,{"aria-label":"Clear search",onPress:()=>{var e;return(e=c==null?void 0:c.current)==null?void 0:e.focus()},size:"small",variant:"subtle",children:r.jsx(q.IconSearch,{})})}),r.jsx(l.Popover,{children:r.jsx(x.ListBox,{children:s==null?void 0:s.map(e=>r.jsx(x.ListBoxItem,{onAction:()=>t(e),children:e},e))})})]})});exports.Search=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),d=require("../../../vendor/clsx/dist/clsx.cjs"),a=require("react"),u=require("react-aria-components");;/* empty css */const q=require("../../icons/IconX.cjs"),S=require("../../icons/IconSearch.cjs"),b=require("../../hooks/useOverlayPortal.cjs"),B=require("../Fieldset/Fieldset.cjs"),f=require("../Input/Input.cjs"),h=require("../IconButton/IconButton.cjs"),x=require("../ListBox/ListBox.cjs"),v=a.forwardRef(function({className:m,results:c,onSearch:o,...i},n){const[l,j]=a.useState(""),t=a.useRef(null),s=e=>{j(e),o&&o(e)},p=d.clsx(m,"search-input-container"),I=b.useOverlayPortalContainer();return r.jsxs(u.ComboBox,{className:p,children:[r.jsx(B.Label,{hidden:!0,children:i["aria-label"]||"Search"}),r.jsx(f.Input,{type:"search",className:"search-input",value:l,onInput:e=>s(e.currentTarget.value),ref:e=>{t.current=e,typeof n=="function"?n(e):n&&(n.current=e)},...i}),r.jsx("span",{className:"search-icon",children:l?r.jsx(h.IconButton,{"aria-label":"Clear search",onPress:()=>s(""),size:"small",variant:"subtle",children:r.jsx(q.IconX,{})}):r.jsx(h.IconButton,{"aria-label":"Clear search",onPress:()=>{var e;return(e=t==null?void 0:t.current)==null?void 0:e.focus()},size:"small",variant:"subtle",children:r.jsx(S.IconSearch,{})})}),r.jsx(u.Popover,{UNSTABLE_portalContainer:I,children:r.jsx(x.ListBox,{children:c==null?void 0:c.map(e=>r.jsx(x.ListBoxItem,{onAction:()=>s(e),children:e},e))})})]})});exports.Search=v;
2
2
  //# sourceMappingURL=Search.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Search.cjs","sources":["../../../../../src/ui/primitives/Search/Search.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { IconSearch, IconX } from \"icons\";\nimport { IconButton, Input, Label, ListBox, ListBoxItem } from \"primitives\";\nimport React, { useRef, useState } from \"react\";\nimport {\n ComboBox as RACComboBox,\n Popover as RACPopover,\n type InputProps as RACInputProps,\n} from \"react-aria-components\";\nimport \"./search.css\";\n\nexport type SearchProps = Omit<RACInputProps, \"results\"> & {\n results?: string[];\n onSearch?: (search: string) => void;\n};\nexport const Search = React.forwardRef(function Search(\n { className, results, onSearch, ...props }: SearchProps,\n ref: React.ForwardedRef<HTMLInputElement>,\n) {\n const [searchTerm, setSearchTerm] = useState(\"\");\n const inputRef = useRef<HTMLInputElement | null>(null);\n const onInputInput = (search: string) => {\n setSearchTerm(search);\n if (onSearch) {\n onSearch(search);\n }\n };\n\n const classNames = clsx(className, \"search-input-container\");\n\n return (\n <RACComboBox className={classNames}>\n <Label hidden>{props[\"aria-label\"] || \"Search\"}</Label>\n <Input\n type=\"search\"\n className=\"search-input\"\n value={searchTerm}\n onInput={(e) => onInputInput(e.currentTarget.value)}\n ref={(node) => {\n inputRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n {...props}\n />\n <span className=\"search-icon\">\n {searchTerm ? (\n <IconButton\n aria-label=\"Clear search\"\n onPress={() => onInputInput(\"\")}\n size=\"small\"\n variant=\"subtle\"\n >\n <IconX />\n </IconButton>\n ) : (\n <IconButton\n aria-label=\"Clear search\"\n onPress={() => inputRef?.current?.focus()}\n size=\"small\"\n variant=\"subtle\"\n >\n <IconSearch />\n </IconButton>\n )}\n </span>\n <RACPopover>\n <ListBox>\n {results?.map((a) => (\n <ListBoxItem key={a} onAction={() => onInputInput(a)}>\n {a}\n </ListBoxItem>\n ))}\n </ListBox>\n </RACPopover>\n </RACComboBox>\n );\n});\n"],"names":["Search","React","className","results","onSearch","props","ref","searchTerm","setSearchTerm","useState","inputRef","useRef","onInputInput","search","classNames","clsx","jsxs","RACComboBox","jsx","Label","Input","node","IconButton","IconX","_a","IconSearch","RACPopover","ListBox","a","ListBoxItem"],"mappings":"4dAeaA,EAASC,EAAM,WAAW,SACrC,CAAE,UAAAC,EAAW,QAAAC,EAAS,SAAAC,EAAU,GAAGC,CAAA,EACnCC,EACA,CACA,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAAA,SAAS,EAAE,EACzCC,EAAWC,EAAAA,OAAgC,IAAI,EAC/CC,EAAgBC,GAAmB,CACvCL,EAAcK,CAAM,EAChBT,GACFA,EAASS,CAAM,CAEnB,EAEMC,EAAaC,EAAAA,KAAKb,EAAW,wBAAwB,EAE3D,OACEc,EAAAA,KAACC,EAAAA,SAAA,CAAY,UAAWH,EACtB,SAAA,CAAAI,MAACC,EAAAA,OAAM,OAAM,GAAE,SAAAd,EAAM,YAAY,GAAK,SAAS,EAC/Ca,EAAAA,IAACE,EAAAA,MAAA,CACC,KAAK,SACL,UAAU,eACV,MAAOb,EACP,QAAU,GAAMK,EAAa,EAAE,cAAc,KAAK,EAClD,IAAMS,GAAS,CACbX,EAAS,QAAUW,EACf,OAAOf,GAAQ,WACjBA,EAAIe,CAAI,EACCf,IACTA,EAAI,QAAUe,EAElB,EACC,GAAGhB,CAAA,CAAA,EAENa,EAAAA,IAAC,OAAA,CAAK,UAAU,cACb,SAAAX,EACCW,EAAAA,IAACI,EAAAA,WAAA,CACC,aAAW,eACX,QAAS,IAAMV,EAAa,EAAE,EAC9B,KAAK,QACL,QAAQ,SAER,eAACW,EAAAA,MAAA,CAAA,CAAM,CAAA,CAAA,EAGTL,EAAAA,IAACI,EAAAA,WAAA,CACC,aAAW,eACX,QAAS,IAAA,OAAM,OAAAE,EAAAd,GAAA,YAAAA,EAAU,UAAV,YAAAc,EAAmB,SAClC,KAAK,QACL,QAAQ,SAER,eAACC,EAAAA,WAAA,CAAA,CAAW,CAAA,CAAA,EAGlB,QACCC,EAAAA,QAAA,CACC,SAAAR,MAACS,EAAAA,SACE,SAAAxB,GAAA,YAAAA,EAAS,IAAKyB,GACbV,EAAAA,IAACW,EAAAA,aAAoB,SAAU,IAAMjB,EAAagB,CAAC,EAChD,YADeA,CAElB,GAEJ,CAAA,CACF,CAAA,EACF,CAEJ,CAAC"}
1
+ {"version":3,"file":"Search.cjs","sources":["../../../../../src/ui/primitives/Search/Search.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { useOverlayPortalContainer } from \"hooks\";\nimport { IconSearch, IconX } from \"icons\";\nimport { IconButton, Input, Label, ListBox, ListBoxItem } from \"primitives\";\nimport React, { useRef, useState } from \"react\";\nimport {\n ComboBox as RACComboBox,\n Popover as RACPopover,\n type InputProps as RACInputProps,\n} from \"react-aria-components\";\nimport \"./search.css\";\n\nexport type SearchProps = Omit<RACInputProps, \"results\"> & {\n results?: string[];\n onSearch?: (search: string) => void;\n};\nexport const Search = React.forwardRef(function Search(\n { className, results, onSearch, ...props }: SearchProps,\n ref: React.ForwardedRef<HTMLInputElement>,\n) {\n const [searchTerm, setSearchTerm] = useState(\"\");\n const inputRef = useRef<HTMLInputElement | null>(null);\n const onInputInput = (search: string) => {\n setSearchTerm(search);\n if (onSearch) {\n onSearch(search);\n }\n };\n\n const classNames = clsx(className, \"search-input-container\");\n // Sem container explícito o dropdown faz portal no document.body — fora da\n // shadow root do MFE, sem CSS. Ver ui/hooks/useOverlayPortal.\n const portalContainer = useOverlayPortalContainer();\n\n return (\n <RACComboBox className={classNames}>\n <Label hidden>{props[\"aria-label\"] || \"Search\"}</Label>\n <Input\n type=\"search\"\n className=\"search-input\"\n value={searchTerm}\n onInput={(e) => onInputInput(e.currentTarget.value)}\n ref={(node) => {\n inputRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n {...props}\n />\n <span className=\"search-icon\">\n {searchTerm ? (\n <IconButton\n aria-label=\"Clear search\"\n onPress={() => onInputInput(\"\")}\n size=\"small\"\n variant=\"subtle\"\n >\n <IconX />\n </IconButton>\n ) : (\n <IconButton\n aria-label=\"Clear search\"\n onPress={() => inputRef?.current?.focus()}\n size=\"small\"\n variant=\"subtle\"\n >\n <IconSearch />\n </IconButton>\n )}\n </span>\n <RACPopover UNSTABLE_portalContainer={portalContainer}>\n <ListBox>\n {results?.map((a) => (\n <ListBoxItem key={a} onAction={() => onInputInput(a)}>\n {a}\n </ListBoxItem>\n ))}\n </ListBox>\n </RACPopover>\n </RACComboBox>\n );\n});\n"],"names":["Search","React","className","results","onSearch","props","ref","searchTerm","setSearchTerm","useState","inputRef","useRef","onInputInput","search","classNames","clsx","portalContainer","useOverlayPortalContainer","jsxs","RACComboBox","jsx","Label","Input","node","IconButton","IconX","_a","IconSearch","RACPopover","ListBox","a","ListBoxItem"],"mappings":"0gBAgBaA,EAASC,EAAM,WAAW,SACrC,CAAE,UAAAC,EAAW,QAAAC,EAAS,SAAAC,EAAU,GAAGC,CAAA,EACnCC,EACA,CACA,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAAA,SAAS,EAAE,EACzCC,EAAWC,EAAAA,OAAgC,IAAI,EAC/CC,EAAgBC,GAAmB,CACvCL,EAAcK,CAAM,EAChBT,GACFA,EAASS,CAAM,CAEnB,EAEMC,EAAaC,EAAAA,KAAKb,EAAW,wBAAwB,EAGrDc,EAAkBC,EAAAA,0BAAA,EAExB,OACEC,EAAAA,KAACC,EAAAA,SAAA,CAAY,UAAWL,EACtB,SAAA,CAAAM,MAACC,EAAAA,OAAM,OAAM,GAAE,SAAAhB,EAAM,YAAY,GAAK,SAAS,EAC/Ce,EAAAA,IAACE,EAAAA,MAAA,CACC,KAAK,SACL,UAAU,eACV,MAAOf,EACP,QAAU,GAAMK,EAAa,EAAE,cAAc,KAAK,EAClD,IAAMW,GAAS,CACbb,EAAS,QAAUa,EACf,OAAOjB,GAAQ,WACjBA,EAAIiB,CAAI,EACCjB,IACTA,EAAI,QAAUiB,EAElB,EACC,GAAGlB,CAAA,CAAA,EAENe,EAAAA,IAAC,OAAA,CAAK,UAAU,cACb,SAAAb,EACCa,EAAAA,IAACI,EAAAA,WAAA,CACC,aAAW,eACX,QAAS,IAAMZ,EAAa,EAAE,EAC9B,KAAK,QACL,QAAQ,SAER,eAACa,EAAAA,MAAA,CAAA,CAAM,CAAA,CAAA,EAGTL,EAAAA,IAACI,EAAAA,WAAA,CACC,aAAW,eACX,QAAS,IAAA,OAAM,OAAAE,EAAAhB,GAAA,YAAAA,EAAU,UAAV,YAAAgB,EAAmB,SAClC,KAAK,QACL,QAAQ,SAER,eAACC,EAAAA,WAAA,CAAA,CAAW,CAAA,CAAA,EAGlB,EACAP,EAAAA,IAACQ,EAAAA,SAAW,yBAA0BZ,EACpC,eAACa,EAAAA,QAAA,CACE,SAAA1B,GAAA,YAAAA,EAAS,IAAK2B,SACZC,cAAA,CAAoB,SAAU,IAAMnB,EAAakB,CAAC,EAChD,SAAAA,CAAA,EADeA,CAElB,EACD,CACH,CAAA,CACF,CAAA,EACF,CAEJ,CAAC"}
@@ -1,27 +1,28 @@
1
- import { jsxs as u, jsx as e } from "react/jsx-runtime";
2
- import { clsx as f } from "../../../vendor/clsx/dist/clsx.js";
3
- import d, { useState as I, useRef as b } from "react";
4
- import { ComboBox as x, Popover as v } from "react-aria-components";
1
+ import { jsxs as f, jsx as e } from "react/jsx-runtime";
2
+ import { clsx as d } from "../../../vendor/clsx/dist/clsx.js";
3
+ import I, { useState as b, useRef as x } from "react";
4
+ import { ComboBox as v, Popover as B } from "react-aria-components";
5
5
  /* empty css */
6
- import { IconX as B } from "../../icons/IconX.js";
6
+ import { IconX as C } from "../../icons/IconX.js";
7
7
  import { IconSearch as S } from "../../icons/IconSearch.js";
8
- import { Label as N } from "../Fieldset/Fieldset.js";
9
- import { Input as C } from "../Input/Input.js";
8
+ import { useOverlayPortalContainer as N } from "../../hooks/useOverlayPortal.js";
9
+ import { Label as L } from "../Fieldset/Fieldset.js";
10
+ import { Input as P } from "../Input/Input.js";
10
11
  import { IconButton as m } from "../IconButton/IconButton.js";
11
- import { ListBox as L, ListBoxItem as P } from "../ListBox/ListBox.js";
12
- const D = d.forwardRef(function({ className: l, results: a, onSearch: n, ...i }, o) {
13
- const [s, p] = I(""), t = b(null), c = (r) => {
14
- p(r), n && n(r);
15
- }, h = f(l, "search-input-container");
16
- return /* @__PURE__ */ u(x, { className: h, children: [
17
- /* @__PURE__ */ e(N, { hidden: !0, children: i["aria-label"] || "Search" }),
12
+ import { ListBox as T, ListBoxItem as y } from "../ListBox/ListBox.js";
13
+ const q = I.forwardRef(function({ className: l, results: a, onSearch: c, ...i }, o) {
14
+ const [s, p] = b(""), t = x(null), n = (r) => {
15
+ p(r), c && c(r);
16
+ }, h = d(l, "search-input-container"), u = N();
17
+ return /* @__PURE__ */ f(v, { className: h, children: [
18
+ /* @__PURE__ */ e(L, { hidden: !0, children: i["aria-label"] || "Search" }),
18
19
  /* @__PURE__ */ e(
19
- C,
20
+ P,
20
21
  {
21
22
  type: "search",
22
23
  className: "search-input",
23
24
  value: s,
24
- onInput: (r) => c(r.currentTarget.value),
25
+ onInput: (r) => n(r.currentTarget.value),
25
26
  ref: (r) => {
26
27
  t.current = r, typeof o == "function" ? o(r) : o && (o.current = r);
27
28
  },
@@ -32,10 +33,10 @@ const D = d.forwardRef(function({ className: l, results: a, onSearch: n, ...i },
32
33
  m,
33
34
  {
34
35
  "aria-label": "Clear search",
35
- onPress: () => c(""),
36
+ onPress: () => n(""),
36
37
  size: "small",
37
38
  variant: "subtle",
38
- children: /* @__PURE__ */ e(B, {})
39
+ children: /* @__PURE__ */ e(C, {})
39
40
  }
40
41
  ) : /* @__PURE__ */ e(
41
42
  m,
@@ -50,10 +51,10 @@ const D = d.forwardRef(function({ className: l, results: a, onSearch: n, ...i },
50
51
  children: /* @__PURE__ */ e(S, {})
51
52
  }
52
53
  ) }),
53
- /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(L, { children: a == null ? void 0 : a.map((r) => /* @__PURE__ */ e(P, { onAction: () => c(r), children: r }, r)) }) })
54
+ /* @__PURE__ */ e(B, { UNSTABLE_portalContainer: u, children: /* @__PURE__ */ e(T, { children: a == null ? void 0 : a.map((r) => /* @__PURE__ */ e(y, { onAction: () => n(r), children: r }, r)) }) })
54
55
  ] });
55
56
  });
56
57
  export {
57
- D as Search
58
+ q as Search
58
59
  };
59
60
  //# sourceMappingURL=Search.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Search.js","sources":["../../../../../src/ui/primitives/Search/Search.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { IconSearch, IconX } from \"icons\";\nimport { IconButton, Input, Label, ListBox, ListBoxItem } from \"primitives\";\nimport React, { useRef, useState } from \"react\";\nimport {\n ComboBox as RACComboBox,\n Popover as RACPopover,\n type InputProps as RACInputProps,\n} from \"react-aria-components\";\nimport \"./search.css\";\n\nexport type SearchProps = Omit<RACInputProps, \"results\"> & {\n results?: string[];\n onSearch?: (search: string) => void;\n};\nexport const Search = React.forwardRef(function Search(\n { className, results, onSearch, ...props }: SearchProps,\n ref: React.ForwardedRef<HTMLInputElement>,\n) {\n const [searchTerm, setSearchTerm] = useState(\"\");\n const inputRef = useRef<HTMLInputElement | null>(null);\n const onInputInput = (search: string) => {\n setSearchTerm(search);\n if (onSearch) {\n onSearch(search);\n }\n };\n\n const classNames = clsx(className, \"search-input-container\");\n\n return (\n <RACComboBox className={classNames}>\n <Label hidden>{props[\"aria-label\"] || \"Search\"}</Label>\n <Input\n type=\"search\"\n className=\"search-input\"\n value={searchTerm}\n onInput={(e) => onInputInput(e.currentTarget.value)}\n ref={(node) => {\n inputRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n {...props}\n />\n <span className=\"search-icon\">\n {searchTerm ? (\n <IconButton\n aria-label=\"Clear search\"\n onPress={() => onInputInput(\"\")}\n size=\"small\"\n variant=\"subtle\"\n >\n <IconX />\n </IconButton>\n ) : (\n <IconButton\n aria-label=\"Clear search\"\n onPress={() => inputRef?.current?.focus()}\n size=\"small\"\n variant=\"subtle\"\n >\n <IconSearch />\n </IconButton>\n )}\n </span>\n <RACPopover>\n <ListBox>\n {results?.map((a) => (\n <ListBoxItem key={a} onAction={() => onInputInput(a)}>\n {a}\n </ListBoxItem>\n ))}\n </ListBox>\n </RACPopover>\n </RACComboBox>\n );\n});\n"],"names":["Search","React","className","results","onSearch","props","ref","searchTerm","setSearchTerm","useState","inputRef","useRef","onInputInput","search","classNames","clsx","jsxs","RACComboBox","jsx","Label","Input","e","node","IconButton","IconX","_a","IconSearch","RACPopover","ListBox","a","ListBoxItem"],"mappings":";;;;;;;;;;;AAeO,MAAMA,IAASC,EAAM,WAAW,SACrC,EAAE,WAAAC,GAAW,SAAAC,GAAS,UAAAC,GAAU,GAAGC,EAAA,GACnCC,GACA;AACA,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAE,GACzCC,IAAWC,EAAgC,IAAI,GAC/CC,IAAe,CAACC,MAAmB;AACvC,IAAAL,EAAcK,CAAM,GAChBT,KACFA,EAASS,CAAM;AAAA,EAEnB,GAEMC,IAAaC,EAAKb,GAAW,wBAAwB;AAE3D,SACE,gBAAAc,EAACC,GAAA,EAAY,WAAWH,GACtB,UAAA;AAAA,IAAA,gBAAAI,EAACC,KAAM,QAAM,IAAE,UAAAd,EAAM,YAAY,KAAK,UAAS;AAAA,IAC/C,gBAAAa;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,WAAU;AAAA,QACV,OAAOb;AAAA,QACP,SAAS,CAACc,MAAMT,EAAaS,EAAE,cAAc,KAAK;AAAA,QAClD,KAAK,CAACC,MAAS;AACb,UAAAZ,EAAS,UAAUY,GACf,OAAOhB,KAAQ,aACjBA,EAAIgB,CAAI,IACChB,MACTA,EAAI,UAAUgB;AAAA,QAElB;AAAA,QACC,GAAGjB;AAAA,MAAA;AAAA,IAAA;AAAA,IAEN,gBAAAa,EAAC,QAAA,EAAK,WAAU,eACb,UAAAX,IACC,gBAAAW;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,cAAW;AAAA,QACX,SAAS,MAAMX,EAAa,EAAE;AAAA,QAC9B,MAAK;AAAA,QACL,SAAQ;AAAA,QAER,4BAACY,GAAA,CAAA,CAAM;AAAA,MAAA;AAAA,IAAA,IAGT,gBAAAN;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,cAAW;AAAA,QACX,SAAS,MAAA;;AAAM,kBAAAE,IAAAf,KAAA,gBAAAA,EAAU,YAAV,gBAAAe,EAAmB;AAAA;AAAA,QAClC,MAAK;AAAA,QACL,SAAQ;AAAA,QAER,4BAACC,GAAA,CAAA,CAAW;AAAA,MAAA;AAAA,IAAA,GAGlB;AAAA,sBACCC,GAAA,EACC,UAAA,gBAAAT,EAACU,KACE,UAAAzB,KAAA,gBAAAA,EAAS,IAAI,CAAC0B,MACb,gBAAAX,EAACY,KAAoB,UAAU,MAAMlB,EAAaiB,CAAC,GAChD,eADeA,CAElB,IAEJ,EAAA,CACF;AAAA,EAAA,GACF;AAEJ,CAAC;"}
1
+ {"version":3,"file":"Search.js","sources":["../../../../../src/ui/primitives/Search/Search.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { useOverlayPortalContainer } from \"hooks\";\nimport { IconSearch, IconX } from \"icons\";\nimport { IconButton, Input, Label, ListBox, ListBoxItem } from \"primitives\";\nimport React, { useRef, useState } from \"react\";\nimport {\n ComboBox as RACComboBox,\n Popover as RACPopover,\n type InputProps as RACInputProps,\n} from \"react-aria-components\";\nimport \"./search.css\";\n\nexport type SearchProps = Omit<RACInputProps, \"results\"> & {\n results?: string[];\n onSearch?: (search: string) => void;\n};\nexport const Search = React.forwardRef(function Search(\n { className, results, onSearch, ...props }: SearchProps,\n ref: React.ForwardedRef<HTMLInputElement>,\n) {\n const [searchTerm, setSearchTerm] = useState(\"\");\n const inputRef = useRef<HTMLInputElement | null>(null);\n const onInputInput = (search: string) => {\n setSearchTerm(search);\n if (onSearch) {\n onSearch(search);\n }\n };\n\n const classNames = clsx(className, \"search-input-container\");\n // Sem container explícito o dropdown faz portal no document.body — fora da\n // shadow root do MFE, sem CSS. Ver ui/hooks/useOverlayPortal.\n const portalContainer = useOverlayPortalContainer();\n\n return (\n <RACComboBox className={classNames}>\n <Label hidden>{props[\"aria-label\"] || \"Search\"}</Label>\n <Input\n type=\"search\"\n className=\"search-input\"\n value={searchTerm}\n onInput={(e) => onInputInput(e.currentTarget.value)}\n ref={(node) => {\n inputRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n {...props}\n />\n <span className=\"search-icon\">\n {searchTerm ? (\n <IconButton\n aria-label=\"Clear search\"\n onPress={() => onInputInput(\"\")}\n size=\"small\"\n variant=\"subtle\"\n >\n <IconX />\n </IconButton>\n ) : (\n <IconButton\n aria-label=\"Clear search\"\n onPress={() => inputRef?.current?.focus()}\n size=\"small\"\n variant=\"subtle\"\n >\n <IconSearch />\n </IconButton>\n )}\n </span>\n <RACPopover UNSTABLE_portalContainer={portalContainer}>\n <ListBox>\n {results?.map((a) => (\n <ListBoxItem key={a} onAction={() => onInputInput(a)}>\n {a}\n </ListBoxItem>\n ))}\n </ListBox>\n </RACPopover>\n </RACComboBox>\n );\n});\n"],"names":["Search","React","className","results","onSearch","props","ref","searchTerm","setSearchTerm","useState","inputRef","useRef","onInputInput","search","classNames","clsx","portalContainer","useOverlayPortalContainer","jsxs","RACComboBox","jsx","Label","Input","e","node","IconButton","IconX","_a","IconSearch","RACPopover","ListBox","a","ListBoxItem"],"mappings":";;;;;;;;;;;;AAgBO,MAAMA,IAASC,EAAM,WAAW,SACrC,EAAE,WAAAC,GAAW,SAAAC,GAAS,UAAAC,GAAU,GAAGC,EAAA,GACnCC,GACA;AACA,QAAM,CAACC,G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GAAA,EACE,UAAA3B,KAAA,gBAAAA,EAAS,IAAI,CAAC4B,wBACZC,GAAA,EAAoB,UAAU,MAAMpB,EAAamB,CAAC,GAChD,UAAAA,EAAA,GADeA,CAElB,GACD,CACH,EAAA,CACF;AAAA,EAAA,GACF;AAEJ,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("../../../vendor/clsx/dist/clsx.cjs"),n=require("react-aria-components");;/* empty css */const d=require("../../icons/IconChevronDown.cjs"),h=require("../../icons/IconCheck.cjs"),r=require("../Fieldset/Fieldset.cjs"),a=require("../ListBox/ListBox.cjs");function S({className:s,label:t,description:c,errorMessage:l,children:i,items:x,...j}){const m=o.clsx(s,"select-container");return e.jsx(u,{className:m,...j,children:e.jsxs(r.Field,{children:[t&&e.jsx(r.Label,{children:t}),e.jsxs(n.Button,{className:"select",children:[e.jsx(n.SelectValue,{className:"select-value"}),e.jsx(d.IconChevronDown,{"aria-hidden":"true"})]}),e.jsx(n.Popover,{children:e.jsx(a.ListBox,{items:x,children:i})}),c&&e.jsx(r.Description,{children:c}),e.jsx(r.FieldError,{children:l})]})})}function u({...s}){return e.jsx(n.Select,{...s})}function q({children:s,className:t,...c}){const l=o.clsx(t,"select-item"),i=typeof s=="string"?s:"";return e.jsx(a.ListBoxItem,{textValue:i,className:l,...c,children:e.jsxs(e.Fragment,{children:[e.jsx(h.IconCheck,{className:"select-item-check"}),s]})})}exports.Select=u;exports.SelectField=S;exports.SelectItem=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../../vendor/clsx/dist/clsx.cjs"),n=require("react-aria-components");;/* empty css */const h=require("../../icons/IconChevronDown.cjs"),S=require("../../icons/IconCheck.cjs"),q=require("../../hooks/useOverlayPortal.cjs"),r=require("../Fieldset/Fieldset.cjs"),a=require("../ListBox/ListBox.cjs");function C({className:t,label:s,description:c,errorMessage:l,children:o,items:x,...j}){const m=i.clsx(t,"select-container"),d=q.useOverlayPortalContainer();return e.jsx(u,{className:m,...j,children:e.jsxs(r.Field,{children:[s&&e.jsx(r.Label,{children:s}),e.jsxs(n.Button,{className:"select",children:[e.jsx(n.SelectValue,{className:"select-value"}),e.jsx(h.IconChevronDown,{"aria-hidden":"true"})]}),e.jsx(n.Popover,{UNSTABLE_portalContainer:d,children:e.jsx(a.ListBox,{items:x,children:o})}),c&&e.jsx(r.Description,{children:c}),e.jsx(r.FieldError,{children:l})]})})}function u({...t}){return e.jsx(n.Select,{...t})}function N({children:t,className:s,...c}){const l=i.clsx(s,"select-item"),o=typeof t=="string"?t:"";return e.jsx(a.ListBoxItem,{textValue:o,className:l,...c,children:e.jsxs(e.Fragment,{children:[e.jsx(S.IconCheck,{className:"select-item-check"}),t]})})}exports.Select=u;exports.SelectField=C;exports.SelectItem=N;
2
2
  //# sourceMappingURL=Select.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.cjs","sources":["../../../../../src/ui/primitives/Select/Select.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { IconCheck, IconChevronDown } from \"icons\";\nimport {\n Description,\n Field,\n FieldError,\n Label,\n ListBox,\n ListBoxItem,\n SharedFieldProps,\n type ListBoxItemProps,\n} from \"primitives\";\nimport {\n Button as RACButton,\n Popover as RACPopover,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n type SelectProps as RACSelectProps,\n} from \"react-aria-components\";\nimport \"./select.css\";\n\nexport interface SelectFieldProps<T extends object>\n extends Omit<SelectProps<T>, \"children\">,\n SharedFieldProps {\n items?: Iterable<T>;\n children: React.ReactNode | ((item: T) => React.ReactNode);\n}\nexport function SelectField<T extends object>({\n className,\n label,\n description,\n errorMessage,\n children,\n items,\n ...props\n}: SelectFieldProps<T>) {\n const classNames = clsx(className, \"select-container\");\n return (\n <Select className={classNames} {...props}>\n <Field>\n {label && <Label>{label}</Label>}\n <RACButton className=\"select\">\n <RACSelectValue className=\"select-value\" />\n <IconChevronDown aria-hidden=\"true\" />\n </RACButton>\n <RACPopover>\n <ListBox items={items}>{children}</ListBox>\n </RACPopover>\n {description && <Description>{description}</Description>}\n <FieldError>{errorMessage}</FieldError>\n </Field>\n </Select>\n );\n}\n\nexport type SelectProps<T extends object> = RACSelectProps<T>;\nexport function Select<T extends object>({ ...props }: SelectProps<T>) {\n return <RACSelect<T> {...props} />;\n}\n\nexport type SelectItemProps = ListBoxItemProps;\nexport function SelectItem({ children, className, ...props }: SelectItemProps) {\n const classNames = clsx(className, \"select-item\");\n const textValue = typeof children === \"string\" ? children : \"\";\n return (\n <ListBoxItem textValue={textValue} className={classNames} {...props}>\n <>\n <IconCheck className=\"select-item-check\" />\n {children}\n </>\n </ListBoxItem>\n );\n}\n"],"names":["SelectField","className","label","description","errorMessage","children","items","props","classNames","clsx","Select","Field","jsx","Label","jsxs","RACButton","RACSelectValue","IconChevronDown","RACPopover","ListBox","Description","FieldError","RACSelect","SelectItem","textValue","ListBoxItem","Fragment","IconCheck"],"mappings":"wYA2BO,SAASA,EAA8B,CAC5C,UAAAC,EACA,MAAAC,EACA,YAAAC,EACA,aAAAC,EACA,SAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EAAwB,CACtB,MAAMC,EAAaC,EAAAA,KAAKR,EAAW,kBAAkB,EACrD,aACGS,EAAA,CAAO,UAAWF,EAAa,GAAGD,EACjC,gBAACI,EAAAA,MAAA,CACE,SAAA,CAAAT,GAASU,EAAAA,IAACC,EAAAA,OAAO,SAAAX,CAAA,CAAM,EACxBY,EAAAA,KAACC,EAAAA,OAAA,CAAU,UAAU,SACnB,SAAA,CAAAH,EAAAA,IAACI,EAAAA,YAAA,CAAe,UAAU,cAAA,CAAe,EACzCJ,EAAAA,IAACK,EAAAA,gBAAA,CAAgB,cAAY,MAAA,CAAO,CAAA,EACtC,QACCC,EAAAA,QAAA,CACC,SAAAN,EAAAA,IAACO,EAAAA,QAAA,CAAQ,MAAAb,EAAe,SAAAD,EAAS,EACnC,EACCF,GAAeS,EAAAA,IAACQ,EAAAA,YAAA,CAAa,SAAAjB,CAAA,CAAY,EAC1CS,EAAAA,IAACS,EAAAA,YAAY,SAAAjB,CAAA,CAAa,CAAA,CAAA,CAC5B,CAAA,CACF,CAEJ,CAGO,SAASM,EAAyB,CAAE,GAAGH,GAAyB,CACrE,OAAOK,MAACU,EAAAA,OAAA,CAAc,GAAGf,CAAA,CAAO,CAClC,CAGO,SAASgB,EAAW,CAAE,SAAAlB,EAAU,UAAAJ,EAAW,GAAGM,GAA0B,CAC7E,MAAMC,EAAaC,EAAAA,KAAKR,EAAW,aAAa,EAC1CuB,EAAY,OAAOnB,GAAa,SAAWA,EAAW,GAC5D,aACGoB,EAAAA,YAAA,CAAY,UAAAD,EAAsB,UAAWhB,EAAa,GAAGD,EAC5D,SAAAO,EAAAA,KAAAY,EAAAA,SAAA,CACE,SAAA,CAAAd,EAAAA,IAACe,EAAAA,UAAA,CAAU,UAAU,mBAAA,CAAoB,EACxCtB,CAAA,CAAA,CACH,CAAA,CACF,CAEJ"}
1
+ {"version":3,"file":"Select.cjs","sources":["../../../../../src/ui/primitives/Select/Select.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { useOverlayPortalContainer } from \"hooks\";\nimport { IconCheck, IconChevronDown } from \"icons\";\nimport {\n Description,\n Field,\n FieldError,\n Label,\n ListBox,\n ListBoxItem,\n SharedFieldProps,\n type ListBoxItemProps,\n} from \"primitives\";\nimport {\n Button as RACButton,\n Popover as RACPopover,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n type SelectProps as RACSelectProps,\n} from \"react-aria-components\";\nimport \"./select.css\";\n\nexport interface SelectFieldProps<T extends object>\n extends Omit<SelectProps<T>, \"children\">,\n SharedFieldProps {\n items?: Iterable<T>;\n children: React.ReactNode | ((item: T) => React.ReactNode);\n}\nexport function SelectField<T extends object>({\n className,\n label,\n description,\n errorMessage,\n children,\n items,\n ...props\n}: SelectFieldProps<T>) {\n const classNames = clsx(className, \"select-container\");\n // Sem container explícito o dropdown faz portal no document.body — fora da\n // shadow root do MFE, sem CSS. Ver ui/hooks/useOverlayPortal.\n const portalContainer = useOverlayPortalContainer();\n return (\n <Select className={classNames} {...props}>\n <Field>\n {label && <Label>{label}</Label>}\n <RACButton className=\"select\">\n <RACSelectValue className=\"select-value\" />\n <IconChevronDown aria-hidden=\"true\" />\n </RACButton>\n <RACPopover UNSTABLE_portalContainer={portalContainer}>\n <ListBox items={items}>{children}</ListBox>\n </RACPopover>\n {description && <Description>{description}</Description>}\n <FieldError>{errorMessage}</FieldError>\n </Field>\n </Select>\n );\n}\n\nexport type SelectProps<T extends object> = RACSelectProps<T>;\nexport function Select<T extends object>({ ...props }: SelectProps<T>) {\n return <RACSelect<T> {...props} />;\n}\n\nexport type SelectItemProps = ListBoxItemProps;\nexport function SelectItem({ children, className, ...props }: SelectItemProps) {\n const classNames = clsx(className, \"select-item\");\n const textValue = typeof children === \"string\" ? children : \"\";\n return (\n <ListBoxItem textValue={textValue} className={classNames} {...props}>\n <>\n <IconCheck className=\"select-item-check\" />\n {children}\n </>\n </ListBoxItem>\n );\n}\n"],"names":["SelectField","className","label","description","errorMessage","children","items","props","classNames","clsx","portalContainer","useOverlayPortalContainer","Select","Field","jsx","Label","jsxs","RACButton","RACSelectValue","IconChevronDown","RACPopover","ListBox","Description","FieldError","RACSelect","SelectItem","textValue","ListBoxItem","Fragment","IconCheck"],"mappings":"sbA4BO,SAASA,EAA8B,CAC5C,UAAAC,EACA,MAAAC,EACA,YAAAC,EACA,aAAAC,EACA,SAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EAAwB,CACtB,MAAMC,EAAaC,EAAAA,KAAKR,EAAW,kBAAkB,EAG/CS,EAAkBC,EAAAA,0BAAA,EACxB,aACGC,EAAA,CAAO,UAAWJ,EAAa,GAAGD,EACjC,gBAACM,EAAAA,MAAA,CACE,SAAA,CAAAX,GAASY,EAAAA,IAACC,EAAAA,OAAO,SAAAb,CAAA,CAAM,EACxBc,EAAAA,KAACC,EAAAA,OAAA,CAAU,UAAU,SACnB,SAAA,CAAAH,EAAAA,IAACI,EAAAA,YAAA,CAAe,UAAU,cAAA,CAAe,EACzCJ,EAAAA,IAACK,EAAAA,gBAAA,CAAgB,cAAY,MAAA,CAAO,CAAA,EACtC,EACAL,EAAAA,IAACM,EAAAA,SAAW,yBAA0BV,EACpC,eAACW,EAAAA,QAAA,CAAQ,MAAAf,EAAe,SAAAD,EAAS,CAAA,CACnC,EACCF,GAAeW,EAAAA,IAACQ,EAAAA,YAAA,CAAa,SAAAnB,CAAA,CAAY,EAC1CW,EAAAA,IAACS,EAAAA,YAAY,SAAAnB,CAAA,CAAa,CAAA,CAAA,CAC5B,CAAA,CACF,CAEJ,CAGO,SAASQ,EAAyB,CAAE,GAAGL,GAAyB,CACrE,OAAOO,MAACU,EAAAA,OAAA,CAAc,GAAGjB,CAAA,CAAO,CAClC,CAGO,SAASkB,EAAW,CAAE,SAAApB,EAAU,UAAAJ,EAAW,GAAGM,GAA0B,CAC7E,MAAMC,EAAaC,EAAAA,KAAKR,EAAW,aAAa,EAC1CyB,EAAY,OAAOrB,GAAa,SAAWA,EAAW,GAC5D,aACGsB,EAAAA,YAAA,CAAY,UAAAD,EAAsB,UAAWlB,EAAa,GAAGD,EAC5D,SAAAS,EAAAA,KAAAY,EAAAA,SAAA,CACE,SAAA,CAAAd,EAAAA,IAACe,EAAAA,UAAA,CAAU,UAAU,mBAAA,CAAoB,EACxCxB,CAAA,CAAA,CACH,CAAA,CACF,CAEJ"}
@@ -1,45 +1,46 @@
1
1
  import { jsx as e, jsxs as l, Fragment as u } from "react/jsx-runtime";
2
- import { clsx as i } from "../../../vendor/clsx/dist/clsx.js";
3
- import { Button as d, SelectValue as f, Popover as h, Select as p } from "react-aria-components";
2
+ import { clsx as s } from "../../../vendor/clsx/dist/clsx.js";
3
+ import { Button as f, SelectValue as d, Popover as h, Select as x } from "react-aria-components";
4
4
  /* empty css */
5
- import { IconChevronDown as x } from "../../icons/IconChevronDown.js";
6
- import { IconCheck as N } from "../../icons/IconCheck.js";
7
- import { Field as S, Label as F, Description as I, FieldError as v } from "../Fieldset/Fieldset.js";
8
- import { ListBox as B, ListBoxItem as L } from "../ListBox/ListBox.js";
9
- function P({
5
+ import { IconChevronDown as N } from "../../icons/IconChevronDown.js";
6
+ import { IconCheck as S } from "../../icons/IconCheck.js";
7
+ import { useOverlayPortalContainer as C } from "../../hooks/useOverlayPortal.js";
8
+ import { Field as v, Label as B, Description as F, FieldError as I } from "../Fieldset/Fieldset.js";
9
+ import { ListBox as L, ListBoxItem as V } from "../ListBox/ListBox.js";
10
+ function T({
10
11
  className: t,
11
12
  label: r,
12
- description: c,
13
- errorMessage: o,
14
- children: s,
15
- items: n,
16
- ...m
13
+ description: o,
14
+ errorMessage: c,
15
+ children: n,
16
+ items: i,
17
+ ...a
17
18
  }) {
18
- const a = i(t, "select-container");
19
- return /* @__PURE__ */ e(V, { className: a, ...m, children: /* @__PURE__ */ l(S, { children: [
20
- r && /* @__PURE__ */ e(F, { children: r }),
21
- /* @__PURE__ */ l(d, { className: "select", children: [
22
- /* @__PURE__ */ e(f, { className: "select-value" }),
23
- /* @__PURE__ */ e(x, { "aria-hidden": "true" })
19
+ const m = s(t, "select-container"), p = C();
20
+ return /* @__PURE__ */ e(g, { className: m, ...a, children: /* @__PURE__ */ l(v, { children: [
21
+ r && /* @__PURE__ */ e(B, { children: r }),
22
+ /* @__PURE__ */ l(f, { className: "select", children: [
23
+ /* @__PURE__ */ e(d, { className: "select-value" }),
24
+ /* @__PURE__ */ e(N, { "aria-hidden": "true" })
24
25
  ] }),
25
- /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(B, { items: n, children: s }) }),
26
- c && /* @__PURE__ */ e(I, { children: c }),
27
- /* @__PURE__ */ e(v, { children: o })
26
+ /* @__PURE__ */ e(h, { UNSTABLE_portalContainer: p, children: /* @__PURE__ */ e(L, { items: i, children: n }) }),
27
+ o && /* @__PURE__ */ e(F, { children: o }),
28
+ /* @__PURE__ */ e(I, { children: c })
28
29
  ] }) });
29
30
  }
30
- function V({ ...t }) {
31
- return /* @__PURE__ */ e(p, { ...t });
31
+ function g({ ...t }) {
32
+ return /* @__PURE__ */ e(x, { ...t });
32
33
  }
33
- function $({ children: t, className: r, ...c }) {
34
- const o = i(r, "select-item");
35
- return /* @__PURE__ */ e(L, { textValue: typeof t == "string" ? t : "", className: o, ...c, children: /* @__PURE__ */ l(u, { children: [
36
- /* @__PURE__ */ e(N, { className: "select-item-check" }),
34
+ function U({ children: t, className: r, ...o }) {
35
+ const c = s(r, "select-item");
36
+ return /* @__PURE__ */ e(V, { textValue: typeof t == "string" ? t : "", className: c, ...o, children: /* @__PURE__ */ l(u, { children: [
37
+ /* @__PURE__ */ e(S, { className: "select-item-check" }),
37
38
  t
38
39
  ] }) });
39
40
  }
40
41
  export {
41
- V as Select,
42
- P as SelectField,
43
- $ as SelectItem
42
+ g as Select,
43
+ T as SelectField,
44
+ U as SelectItem
44
45
  };
45
46
  //# sourceMappingURL=Select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sources":["../../../../../src/ui/primitives/Select/Select.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { IconCheck, IconChevronDown } from \"icons\";\nimport {\n Description,\n Field,\n FieldError,\n Label,\n ListBox,\n ListBoxItem,\n SharedFieldProps,\n type ListBoxItemProps,\n} from \"primitives\";\nimport {\n Button as RACButton,\n Popover as RACPopover,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n type SelectProps as RACSelectProps,\n} from \"react-aria-components\";\nimport \"./select.css\";\n\nexport interface SelectFieldProps<T extends object>\n extends Omit<SelectProps<T>, \"children\">,\n SharedFieldProps {\n items?: Iterable<T>;\n children: React.ReactNode | ((item: T) => React.ReactNode);\n}\nexport function SelectField<T extends object>({\n className,\n label,\n description,\n errorMessage,\n children,\n items,\n ...props\n}: SelectFieldProps<T>) {\n const classNames = clsx(className, \"select-container\");\n return (\n <Select className={classNames} {...props}>\n <Field>\n {label && <Label>{label}</Label>}\n <RACButton className=\"select\">\n <RACSelectValue className=\"select-value\" />\n <IconChevronDown aria-hidden=\"true\" />\n </RACButton>\n <RACPopover>\n <ListBox items={items}>{children}</ListBox>\n </RACPopover>\n {description && <Description>{description}</Description>}\n <FieldError>{errorMessage}</FieldError>\n </Field>\n </Select>\n );\n}\n\nexport type SelectProps<T extends object> = RACSelectProps<T>;\nexport function Select<T extends object>({ ...props }: SelectProps<T>) {\n return <RACSelect<T> {...props} />;\n}\n\nexport type SelectItemProps = ListBoxItemProps;\nexport function SelectItem({ children, className, ...props }: SelectItemProps) {\n const classNames = clsx(className, \"select-item\");\n const textValue = typeof children === \"string\" ? children : \"\";\n return (\n <ListBoxItem textValue={textValue} className={classNames} {...props}>\n <>\n <IconCheck className=\"select-item-check\" />\n {children}\n </>\n </ListBoxItem>\n );\n}\n"],"names":["SelectField","className","label","description","errorMessage","children","items","props","classNames","clsx","Select","Field","jsx","Label","jsxs","RACButton","RACSelectValue","IconChevronDown","RACPopover","ListBox","Description","FieldError","RACSelect","SelectItem","ListBoxItem","Fragment","IconCheck"],"mappings":";;;;;;;;AA2BO,SAASA,EAA8B;AAAA,EAC5C,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GAAwB;AACtB,QAAMC,IAAaC,EAAKR,GAAW,kBAAkB;AACrD,2BACGS,GAAA,EAAO,WAAWF,GAAa,GAAGD,GACjC,4BAACI,GAAA,EACE,UAAA;AAAA,IAAAT,KAAS,gBAAAU,EAACC,KAAO,UAAAX,EAAA,CAAM;AAAA,IACxB,gBAAAY,EAACC,GAAA,EAAU,WAAU,UACnB,UAAA;AAAA,MAAA,gBAAAH,EAACI,GAAA,EAAe,WAAU,eAAA,CAAe;AAAA,MACzC,gBAAAJ,EAACK,GAAA,EAAgB,eAAY,OAAA,CAAO;AAAA,IAAA,GACtC;AAAA,sBACCC,GAAA,EACC,UAAA,gBAAAN,EAACO,GAAA,EAAQ,OAAAb,GAAe,UAAAD,GAAS,GACnC;AAAA,IACCF,KAAe,gBAAAS,EAACQ,GAAA,EAAa,UAAAjB,EAAA,CAAY;AAAA,IAC1C,gBAAAS,EAACS,KAAY,UAAAjB,EAAA,CAAa;AAAA,EAAA,EAAA,CAC5B,EAAA,CACF;AAEJ;AAGO,SAASM,EAAyB,EAAE,GAAGH,KAAyB;AACrE,SAAO,gBAAAK,EAACU,GAAA,EAAc,GAAGf,EAAA,CAAO;AAClC;AAGO,SAASgB,EAAW,EAAE,UAAAlB,GAAU,WAAAJ,GAAW,GAAGM,KAA0B;AAC7E,QAAMC,IAAaC,EAAKR,GAAW,aAAa;AAEhD,2BACGuB,GAAA,EAAY,WAFG,OAAOnB,KAAa,WAAWA,IAAW,IAEvB,WAAWG,GAAa,GAAGD,GAC5D,UAAA,gBAAAO,EAAAW,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAb,EAACc,GAAA,EAAU,WAAU,oBAAA,CAAoB;AAAA,IACxCrB;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"Select.js","sources":["../../../../../src/ui/primitives/Select/Select.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { useOverlayPortalContainer } from \"hooks\";\nimport { IconCheck, IconChevronDown } from \"icons\";\nimport {\n Description,\n Field,\n FieldError,\n Label,\n ListBox,\n ListBoxItem,\n SharedFieldProps,\n type ListBoxItemProps,\n} from \"primitives\";\nimport {\n Button as RACButton,\n Popover as RACPopover,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n type SelectProps as RACSelectProps,\n} from \"react-aria-components\";\nimport \"./select.css\";\n\nexport interface SelectFieldProps<T extends object>\n extends Omit<SelectProps<T>, \"children\">,\n SharedFieldProps {\n items?: Iterable<T>;\n children: React.ReactNode | ((item: T) => React.ReactNode);\n}\nexport function SelectField<T extends object>({\n className,\n label,\n description,\n errorMessage,\n children,\n items,\n ...props\n}: SelectFieldProps<T>) {\n const classNames = clsx(className, \"select-container\");\n // Sem container explícito o dropdown faz portal no document.body — fora da\n // shadow root do MFE, sem CSS. Ver ui/hooks/useOverlayPortal.\n const portalContainer = useOverlayPortalContainer();\n return (\n <Select className={classNames} {...props}>\n <Field>\n {label && <Label>{label}</Label>}\n <RACButton className=\"select\">\n <RACSelectValue className=\"select-value\" />\n <IconChevronDown aria-hidden=\"true\" />\n </RACButton>\n <RACPopover UNSTABLE_portalContainer={portalContainer}>\n <ListBox items={items}>{children}</ListBox>\n </RACPopover>\n {description && <Description>{description}</Description>}\n <FieldError>{errorMessage}</FieldError>\n </Field>\n </Select>\n );\n}\n\nexport type SelectProps<T extends object> = RACSelectProps<T>;\nexport function Select<T extends object>({ ...props }: SelectProps<T>) {\n return <RACSelect<T> {...props} />;\n}\n\nexport type SelectItemProps = ListBoxItemProps;\nexport function SelectItem({ children, className, ...props }: SelectItemProps) {\n const classNames = clsx(className, \"select-item\");\n const textValue = typeof children === \"string\" ? children : \"\";\n return (\n <ListBoxItem textValue={textValue} className={classNames} {...props}>\n <>\n <IconCheck className=\"select-item-check\" />\n {children}\n </>\n </ListBoxItem>\n );\n}\n"],"names":["SelectField","className","label","description","errorMessage","children","items","props","classNames","clsx","portalContainer","useOverlayPortalContainer","Select","Field","jsx","Label","jsxs","RACButton","RACSelectValue","IconChevronDown","RACPopover","ListBox","Description","FieldError","RACSelect","SelectItem","ListBoxItem","Fragment","IconCheck"],"mappings":";;;;;;;;;AA4BO,SAASA,EAA8B;AAAA,EAC5C,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GAAwB;AACtB,QAAMC,IAAaC,EAAKR,GAAW,kBAAkB,GAG/CS,IAAkBC,EAAA;AACxB,2BACGC,GAAA,EAAO,WAAWJ,GAAa,GAAGD,GACjC,4BAACM,GAAA,EACE,UAAA;AAAA,IAAAX,KAAS,gBAAAY,EAACC,KAAO,UAAAb,EAAA,CAAM;AAAA,IACxB,gBAAAc,EAACC,GAAA,EAAU,WAAU,UACnB,UAAA;AAAA,MAAA,gBAAAH,EAACI,GAAA,EAAe,WAAU,eAAA,CAAe;AAAA,MACzC,gBAAAJ,EAACK,GAAA,EAAgB,eAAY,OAAA,CAAO;AAAA,IAAA,GACtC;AAAA,IACA,gBAAAL,EAACM,KAAW,0BAA0BV,GACpC,4BAACW,GAAA,EAAQ,OAAAf,GAAe,UAAAD,GAAS,EAAA,CACnC;AAAA,IACCF,KAAe,gBAAAW,EAACQ,GAAA,EAAa,UAAAnB,EAAA,CAAY;AAAA,IAC1C,gBAAAW,EAACS,KAAY,UAAAnB,EAAA,CAAa;AAAA,EAAA,EAAA,CAC5B,EAAA,CACF;AAEJ;AAGO,SAASQ,EAAyB,EAAE,GAAGL,KAAyB;AACrE,SAAO,gBAAAO,EAACU,GAAA,EAAc,GAAGjB,EAAA,CAAO;AAClC;AAGO,SAASkB,EAAW,EAAE,UAAApB,GAAU,WAAAJ,GAAW,GAAGM,KAA0B;AAC7E,QAAMC,IAAaC,EAAKR,GAAW,aAAa;AAEhD,2BACGyB,GAAA,EAAY,WAFG,OAAOrB,KAAa,WAAWA,IAAW,IAEvB,WAAWG,GAAa,GAAGD,GAC5D,UAAA,gBAAAS,EAAAW,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAb,EAACc,GAAA,EAAU,WAAU,oBAAA,CAAoB;AAAA,IACxCvB;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),u=require("../../../vendor/clsx/dist/clsx.cjs"),j=require("react"),v=require("../../../vendor/@react-aria/tooltip/dist/useTooltipTrigger.cjs"),h=require("../../../vendor/@react-stately/tooltip/dist/useTooltipTriggerState.cjs"),i=require("react-aria-components");;/* empty css */function m({children:e,content:o,className:s,offset:a,delay:c,closeDelay:n,placement:g}){const l=h.useTooltipTriggerState({delay:c,closeDelay:n}),t=j.useRef(null),{triggerProps:p,tooltipProps:d}=v.useTooltipTrigger({},l,t),T=u.clsx(s,"tooltip");return r.jsxs(r.Fragment,{children:[r.jsx("span",{ref:t,className:"tooltip-trigger-wrapper",...p,children:e}),r.jsx(i.TooltipTriggerStateContext.Provider,{value:l,children:r.jsxs(i.Tooltip,{...d,triggerRef:t,className:T,offset:a,placement:g,children:[r.jsx(x,{}),r.jsx("div",{className:"dialog dialog-type-card",children:o})]})})]})}function y({children:e,content:o,className:s,offset:a=16,trigger:c="hover",delay:n=500,closeDelay:g=100,placement:l,...t}){const p=u.clsx(s,"tooltip");return c==="click"?r.jsxs(i.DialogTrigger,{children:[e,r.jsxs(i.Popover,{...t,className:p,offset:a,placement:l,children:[r.jsx(x,{}),r.jsx(i.Dialog,{className:"dialog dialog-type-card","aria-label":"Tooltip",children:o})]})]}):r.jsx(m,{content:o,className:s,offset:a,delay:n,closeDelay:g,placement:l,...t,children:e})}function x({className:e,...o}){const s=u.clsx(e,"tooltip-overlay-arrow");return r.jsxs(i.OverlayArrow,{...o,className:s,children:[r.jsx("svg",{viewBox:"0 0 10 5",children:r.jsx("path",{d:"M0 0 L5 5 L10 0"})}),r.jsx("svg",{viewBox:"0 0 10 5",children:r.jsx("path",{d:"M0 0 L5 5 L10 0"})})]})}exports.Tooltip=y;exports.TooltipOverlayArrow=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),x=require("../../../vendor/clsx/dist/clsx.cjs"),h=require("react"),m=require("../../../vendor/@react-aria/tooltip/dist/useTooltipTrigger.cjs"),y=require("../../../vendor/@react-stately/tooltip/dist/useTooltipTriggerState.cjs"),i=require("react-aria-components");;/* empty css */const d=require("../../hooks/useOverlayPortal.cjs");function N({children:o,content:t,className:s,offset:a,delay:n,closeDelay:c,placement:g}){const l=y.useTooltipTriggerState({delay:n,closeDelay:c}),e=h.useRef(null),{triggerProps:u,tooltipProps:p}=m.useTooltipTrigger({},l,e),j=x.clsx(s,"tooltip"),v=d.useOverlayPortalContainer();return r.jsxs(r.Fragment,{children:[r.jsx("span",{ref:e,className:"tooltip-trigger-wrapper",...u,children:o}),r.jsx(i.TooltipTriggerStateContext.Provider,{value:l,children:r.jsxs(i.Tooltip,{...p,triggerRef:e,className:j,offset:a,placement:g,UNSTABLE_portalContainer:v,children:[r.jsx(T,{}),r.jsx("div",{className:"dialog dialog-type-card",children:t})]})})]})}function C({children:o,content:t,className:s,offset:a=16,trigger:n="hover",delay:c=500,closeDelay:g=100,placement:l,...e}){const u=x.clsx(s,"tooltip"),p=d.useOverlayPortalContainer();return n==="click"?r.jsxs(i.DialogTrigger,{children:[o,r.jsxs(i.Popover,{...e,className:u,offset:a,placement:l,UNSTABLE_portalContainer:e.UNSTABLE_portalContainer??p,children:[r.jsx(T,{}),r.jsx(i.Dialog,{className:"dialog dialog-type-card","aria-label":"Tooltip",children:t})]})]}):r.jsx(N,{content:t,className:s,offset:a,delay:c,closeDelay:g,placement:l,...e,children:o})}function T({className:o,...t}){const s=x.clsx(o,"tooltip-overlay-arrow");return r.jsxs(i.OverlayArrow,{...t,className:s,children:[r.jsx("svg",{viewBox:"0 0 10 5",children:r.jsx("path",{d:"M0 0 L5 5 L10 0"})}),r.jsx("svg",{viewBox:"0 0 10 5",children:r.jsx("path",{d:"M0 0 L5 5 L10 0"})})]})}exports.Tooltip=C;exports.TooltipOverlayArrow=T;
2
2
  //# sourceMappingURL=Tooltip.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.cjs","sources":["../../../../../src/ui/primitives/Tooltip/Tooltip.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useRef } from \"react\";\nimport { useTooltipTrigger } from \"@react-aria/tooltip\";\nimport { useTooltipTriggerState } from \"@react-stately/tooltip\";\nimport {\n DialogTrigger as RACDialogTrigger,\n Dialog as RACDialog,\n OverlayArrow as RACOverlayArrow,\n Popover as RACPopover,\n Tooltip as RACTooltip,\n TooltipTriggerStateContext,\n type OverlayArrowProps as RACOverlayArrowProps,\n type PopoverProps as RACPopoverProps,\n} from \"react-aria-components\";\nimport \"./tooltip.css\";\n\nexport type TooltipTrigger = \"hover\" | \"click\";\n\nexport interface TooltipProps\n extends Omit<\n RACPopoverProps,\n \"children\" | \"isOpen\" | \"defaultOpen\" | \"onOpenChange\" | \"triggerRef\"\n > {\n children: React.ReactNode;\n content: React.ReactNode;\n trigger?: TooltipTrigger;\n delay?: number;\n closeDelay?: number;\n}\n\nfunction HoverTooltip({\n children,\n content,\n className,\n offset,\n delay,\n closeDelay,\n placement,\n}: Omit<TooltipProps, \"trigger\">) {\n const state = useTooltipTriggerState({ delay, closeDelay });\n const triggerRef = useRef<HTMLSpanElement>(null);\n const { triggerProps, tooltipProps } = useTooltipTrigger(\n { delay, closeDelay },\n state,\n triggerRef,\n );\n const classNames = clsx(className, \"tooltip\");\n\n return (\n <>\n <span ref={triggerRef} className=\"tooltip-trigger-wrapper\" {...triggerProps}>\n {children}\n </span>\n <TooltipTriggerStateContext.Provider value={state}>\n <RACTooltip\n {...tooltipProps}\n triggerRef={triggerRef}\n className={classNames}\n offset={offset}\n placement={placement}\n >\n <TooltipOverlayArrow />\n <div className=\"dialog dialog-type-card\">{content}</div>\n </RACTooltip>\n </TooltipTriggerStateContext.Provider>\n </>\n );\n}\n\nexport function Tooltip({\n children,\n content,\n className,\n offset = 16,\n trigger = \"hover\",\n delay = 500,\n closeDelay = 100,\n placement,\n ...popoverProps\n}: TooltipProps) {\n const classNames = clsx(className, \"tooltip\");\n\n if (trigger === \"click\") {\n return (\n <RACDialogTrigger>\n {children}\n <RACPopover\n {...popoverProps}\n className={classNames}\n offset={offset}\n placement={placement}\n >\n <TooltipOverlayArrow />\n <RACDialog className=\"dialog dialog-type-card\" aria-label=\"Tooltip\">\n {content}\n </RACDialog>\n </RACPopover>\n </RACDialogTrigger>\n );\n }\n\n return (\n <HoverTooltip\n content={content}\n className={className}\n offset={offset}\n delay={delay}\n closeDelay={closeDelay}\n placement={placement}\n {...popoverProps}\n >\n {children}\n </HoverTooltip>\n );\n}\n\nexport type TooltipOverlayArrowProps = RACOverlayArrowProps;\nexport function TooltipOverlayArrow({\n className,\n ...props\n}: TooltipOverlayArrowProps) {\n const classNames = clsx(className, \"tooltip-overlay-arrow\");\n return (\n <RACOverlayArrow {...props} className={classNames}>\n <svg viewBox=\"0 0 10 5\">\n <path d=\"M0 0 L5 5 L10 0\" />\n </svg>\n <svg viewBox=\"0 0 10 5\">\n <path d=\"M0 0 L5 5 L10 0\" />\n </svg>\n </RACOverlayArrow>\n );\n}\n"],"names":["HoverTooltip","children","content","className","offset","delay","closeDelay","placement","state","useTooltipTriggerState","triggerRef","useRef","triggerProps","tooltipProps","useTooltipTrigger","classNames","clsx","jsxs","Fragment","jsx","TooltipTriggerStateContext","RACTooltip","TooltipOverlayArrow","Tooltip","trigger","popoverProps","RACDialogTrigger","RACPopover","RACDialog","props","RACOverlayArrow"],"mappings":"wZA8BA,SAASA,EAAa,CACpB,SAAAC,EACA,QAAAC,EACA,UAAAC,EACA,OAAAC,EACA,MAAAC,EACA,WAAAC,EACA,UAAAC,CACF,EAAkC,CAChC,MAAMC,EAAQC,EAAAA,uBAAuB,CAAE,MAAAJ,EAAO,WAAAC,EAAY,EACpDI,EAAaC,EAAAA,OAAwB,IAAI,EACzC,CAAE,aAAAC,EAAc,aAAAC,CAAA,EAAiBC,EAAAA,kBACrC,CAAoB,EACpBN,EACAE,CAAA,EAEIK,EAAaC,EAAAA,KAAKb,EAAW,SAAS,EAE5C,OACEc,EAAAA,KAAAC,WAAA,CACE,SAAA,CAAAC,MAAC,QAAK,IAAKT,EAAY,UAAU,0BAA2B,GAAGE,EAC5D,SAAAX,EACH,EACAkB,EAAAA,IAACC,EAAAA,2BAA2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AAI,QAAQ,WACX,eAAC,OAAA,CAAK,EAAE,kBAAkB,CAAA,CAC5B,CAAA,EACF,CAEJ"}
1
+ {"version":3,"file":"Tooltip.cjs","sources":["../../../../../src/ui/primitives/Tooltip/Tooltip.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useOverlayPortalContainer } from \"hooks\";\nimport { useRef } from \"react\";\nimport { useTooltipTrigger } from \"@react-aria/tooltip\";\nimport { useTooltipTriggerState } from \"@react-stately/tooltip\";\nimport {\n DialogTrigger as RACDialogTrigger,\n Dialog as RACDialog,\n OverlayArrow as RACOverlayArrow,\n Popover as RACPopover,\n Tooltip as RACTooltip,\n TooltipTriggerStateContext,\n type OverlayArrowProps as RACOverlayArrowProps,\n type PopoverProps as RACPopoverProps,\n} from \"react-aria-components\";\nimport \"./tooltip.css\";\n\nexport type TooltipTrigger = \"hover\" | \"click\";\n\nexport interface TooltipProps\n extends Omit<\n RACPopoverProps,\n \"children\" | \"isOpen\" | \"defaultOpen\" | \"onOpenChange\" | \"triggerRef\"\n > {\n children: React.ReactNode;\n content: React.ReactNode;\n trigger?: TooltipTrigger;\n delay?: number;\n closeDelay?: number;\n}\n\nfunction HoverTooltip({\n children,\n content,\n className,\n offset,\n delay,\n closeDelay,\n placement,\n}: Omit<TooltipProps, \"trigger\">) {\n const state = useTooltipTriggerState({ delay, closeDelay });\n const triggerRef = useRef<HTMLSpanElement>(null);\n const { triggerProps, tooltipProps } = useTooltipTrigger(\n { delay, closeDelay },\n state,\n triggerRef,\n );\n const classNames = clsx(className, \"tooltip\");\n // Sem container explícito o tooltip faz portal no document.body — fora da\n // shadow root do MFE, sem CSS. Ver ui/hooks/useOverlayPortal.\n const portalContainer = useOverlayPortalContainer();\n\n return (\n <>\n <span ref={triggerRef} className=\"tooltip-trigger-wrapper\" {...triggerProps}>\n {children}\n </span>\n <TooltipTriggerStateContext.Provider value={state}>\n <RACTooltip\n {...tooltipProps}\n triggerRef={triggerRef}\n className={classNames}\n offset={offset}\n placement={placement}\n UNSTABLE_portalContainer={portalContainer}\n >\n <TooltipOverlayArrow />\n <div className=\"dialog dialog-type-card\">{content}</div>\n </RACTooltip>\n </TooltipTriggerStateContext.Provider>\n </>\n );\n}\n\nexport function Tooltip({\n children,\n content,\n className,\n offset = 16,\n trigger = \"hover\",\n delay = 500,\n closeDelay = 100,\n placement,\n ...popoverProps\n}: TooltipProps) {\n const classNames = clsx(className, \"tooltip\");\n // Sem container explícito o popover faz portal no document.body — fora da\n // shadow root do MFE, sem CSS. Ver ui/hooks/useOverlayPortal.\n const portalContainer = useOverlayPortalContainer();\n\n if (trigger === \"click\") {\n return (\n <RACDialogTrigger>\n {children}\n <RACPopover\n {...popoverProps}\n className={classNames}\n offset={offset}\n placement={placement}\n UNSTABLE_portalContainer={\n popoverProps.UNSTABLE_portalContainer ?? portalContainer\n }\n >\n <TooltipOverlayArrow />\n <RACDialog className=\"dialog dialog-type-card\" aria-label=\"Tooltip\">\n {content}\n </RACDialog>\n </RACPopover>\n </RACDialogTrigger>\n );\n }\n\n return (\n <HoverTooltip\n content={content}\n className={className}\n offset={offset}\n delay={delay}\n closeDelay={closeDelay}\n placement={placement}\n {...popoverProps}\n >\n {children}\n </HoverTooltip>\n );\n}\n\nexport type TooltipOverlayArrowProps = RACOverlayArrowProps;\nexport function TooltipOverlayArrow({\n className,\n ...props\n}: TooltipOverlayArrowProps) {\n const classNames = clsx(className, \"tooltip-overlay-arrow\");\n return (\n <RACOverlayArrow {...props} className={classNames}>\n <svg viewBox=\"0 0 10 5\">\n <path d=\"M0 0 L5 5 L10 0\" />\n </svg>\n <svg viewBox=\"0 0 10 5\">\n <path d=\"M0 0 L5 5 L10 0\" />\n </svg>\n </RACOverlayArrow>\n );\n}\n"],"names":["HoverTooltip","children","content","className","offset","delay","closeDelay","placement","state","useTooltipTriggerState","triggerRef","useRef","triggerProps","tooltipProps","useTooltipTrigger","classNames","clsx","portalContainer","useOverlayPortalContainer","jsxs","Fragment","jsx","TooltipTriggerStateContext","RACTooltip","TooltipOverlayArrow","Tooltip","trigger","popoverProps","RACDialogTrigger","RACPopover","RACDialog","props","RACOverlayArrow"],"mappings":"4cA+BA,SAASA,EAAa,CACpB,SAAAC,EACA,QAAAC,EACA,UAAAC,EACA,OAAAC,EACA,MAAAC,EACA,WAAAC,EACA,UAAAC,CACF,EAAkC,CAChC,MAAMC,EAAQC,EAAAA,uBAAuB,CAAE,MAAAJ,EAAO,WAAAC,EAAY,EACpDI,EAAaC,EAAAA,OAAwB,IAAI,EACzC,CAAE,aAAAC,EAAc,aAAAC,CAAA,EAAiBC,EAAAA,kBACrC,CAAoB,EACpBN,EACAE,CAAA,EAEIK,EAAaC,EAAAA,KAAKb,EAAW,SAAS,EAGtCc,EAAkBC,EAAAA,0BAAA,EAExB,OACEC,EAAAA,KAAAC,WAAA,CACE,SAAA,CAAAC,MAAC,QAAK,IAAKX,EAAY,UAAU,0BAA2B,GAAGE,EAC5D,SAAAX,EACH,EACAoB,EAAAA,IAACC,EAAAA,2BAA2B,SAA3B,CAAoC,MAAOd,EAC1C,SAAAW,EAAAA,KAACI,EAAAA,QAAA,CACE,GAAGV,EACJ,WAAAH,EACA,UAAWK,EACX,OAAAX,EACA,UAAAG,EACA,yBAA0BU,EAE1B,SAAA,CAAAI,EAAAA,IAACG,EAAA,EAAoB,EACrBH,EAAAA,IAAC,MAAA,CAAI,UAAU,0BAA2B,SAAAnB,CAAA,CAAQ,CAAA,CAAA,CAAA,CACpD,CACF,CAAA,EACF,CAEJ,CAEO,SAASuB,EAAQ,CACtB,SAAAxB,EACA,QAAAC,EACA,UAAAC,EACA,OAAAC,EAAS,GACT,QAAAsB,EAAU,QACV,MAAArB,EAAQ,IACR,WAAAC,EAAa,IACb,UAAAC,EACA,GAAGoB,CACL,EAAiB,CACf,MAAMZ,EAAaC,EAAAA,KAAKb,EAAW,SAAS,EAGtCc,EAAkBC,EAAAA,0BAAA,EAExB,OAAIQ,IAAY,eAEXE,gBAAA,CACE,SAAA,CAAA3B,E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