@economic/taco 8.1.4-hanger-base-ui-migration.2 → 8.1.4-test-docs.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 (42) hide show
  1. package/dist/charts/components/Legend.cjs +16 -9
  2. package/dist/charts/components/Legend.cjs.map +1 -1
  3. package/dist/charts/components/Legend.js +16 -9
  4. package/dist/charts/components/Legend.js.map +1 -1
  5. package/dist/components/Hanger/Arrow.cjs +3 -2
  6. package/dist/components/Hanger/Arrow.cjs.map +1 -1
  7. package/dist/components/Hanger/Arrow.js +2 -2
  8. package/dist/components/Hanger/Arrow.js.map +1 -1
  9. package/dist/components/Hanger/Hanger.cjs +39 -39
  10. package/dist/components/Hanger/Hanger.cjs.map +1 -1
  11. package/dist/components/Hanger/Hanger.d.ts +1 -1
  12. package/dist/components/Hanger/Hanger.js +38 -39
  13. package/dist/components/Hanger/Hanger.js.map +1 -1
  14. package/dist/components/Layout/components/Sidebar.cjs +1 -1
  15. package/dist/components/Layout/components/Sidebar.cjs.map +1 -1
  16. package/dist/components/Layout/components/Sidebar.js +1 -1
  17. package/dist/components/Layout/components/Sidebar.js.map +1 -1
  18. package/dist/components/Navigation2/components/Content.cjs +1 -1
  19. package/dist/components/Navigation2/components/Content.cjs.map +1 -1
  20. package/dist/components/Navigation2/components/Content.js +1 -1
  21. package/dist/components/Navigation2/components/Content.js.map +1 -1
  22. package/dist/components/Navigation2/components/Link.cjs +1 -1
  23. package/dist/components/Navigation2/components/Link.cjs.map +1 -1
  24. package/dist/components/Navigation2/components/Link.js +1 -1
  25. package/dist/components/Navigation2/components/Link.js.map +1 -1
  26. package/dist/components/Navigation2/components/Section.cjs +1 -1
  27. package/dist/components/Navigation2/components/Section.cjs.map +1 -1
  28. package/dist/components/Navigation2/components/Section.js +1 -1
  29. package/dist/components/Navigation2/components/Section.js.map +1 -1
  30. package/dist/components/Navigation2/components/util.cjs +3 -3
  31. package/dist/components/Navigation2/components/util.cjs.map +1 -1
  32. package/dist/components/Navigation2/components/util.js +3 -3
  33. package/dist/components/Navigation2/components/util.js.map +1 -1
  34. package/dist/components/Select/useSelect.cjs.map +1 -1
  35. package/dist/components/Select/useSelect.d.ts +2 -2
  36. package/dist/components/Select/useSelect.js.map +1 -1
  37. package/dist/taco.css +5 -0
  38. package/dist/utils/tailwind.cjs +1 -1
  39. package/dist/utils/tailwind.cjs.map +1 -1
  40. package/dist/utils/tailwind.js +1 -1
  41. package/dist/utils/tailwind.js.map +1 -1
  42. package/package.json +4 -3
@@ -1,12 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
- const cn = require("clsx");
5
4
  const Button = require("../../components/Button/Button.cjs");
6
5
  const Icon = require("../../components/Icon/Icon.cjs");
7
6
  const OverflowGroup = require("../../components/OverflowGroup/OverflowGroup.cjs");
7
+ const color = require("../utils/color.cjs");
8
+ function getDarkerThemeColor(color$1) {
9
+ const colorName = Object.keys(color.colors).find((name) => color.colors[name] === color$1);
10
+ if (!colorName) {
11
+ return void 0;
12
+ }
13
+ return color.getThemeColor(colorName.replace(/-\d+$/, "-300"));
14
+ }
8
15
  function Legend(props) {
9
- const { hoverIndex, items, onHover: handleHover, onToggle: handleToggle } = props;
16
+ const { items, onHover: handleHover, onToggle: handleToggle } = props;
10
17
  const handleMouseEnter = (item, index) => {
11
18
  if (item.isHidden) {
12
19
  return;
@@ -22,18 +29,18 @@ function Legend(props) {
22
29
  };
23
30
  const moreButton = (moreButtonText) => /* @__PURE__ */ React.createElement(Button.Button, { appearance: "transparent", className: "!h-5 !min-h-[1.25rem] !px-1.5 text-xs text-gray-700" }, moreButtonText);
24
31
  return /* @__PURE__ */ React.createElement(OverflowGroup.OverflowGroup, { className: "mt-3 w-full gap-x-1", moreButton }, items.map((item, index) => {
25
- const className = cn.clsx("mr-1 flex h-3 w-3 rounded-sm", {
26
- border: item.isHidden
27
- });
28
- let style;
32
+ const className = "mr-1 flex h-3.5 w-3.5 rounded-sm border";
33
+ const style = {};
34
+ const darkerThemeColor = getDarkerThemeColor(item.color);
29
35
  if (!item.isHidden) {
30
- style = { backgroundColor: item.color };
36
+ style.backgroundColor = item.color;
37
+ style.borderColor = darkerThemeColor;
31
38
  }
32
39
  return /* @__PURE__ */ React.createElement(
33
40
  "button",
34
41
  {
35
42
  key: `${item.label}_${index}`,
36
- className: "focus-visible:yt-focus flex items-center rounded px-1 !text-xs hover:bg-gray-200",
43
+ className: "focus-visible:yt-focus flex items-center rounded px-1 !text-xs hover:bg-gray-100",
37
44
  onClick: (event) => {
38
45
  event == null ? void 0 : event.preventDefault();
39
46
  handleClick(item);
@@ -41,7 +48,7 @@ function Legend(props) {
41
48
  onMouseEnter: () => handleMouseEnter(item, index),
42
49
  onMouseLeave: () => handleMouseLeave()
43
50
  },
44
- /* @__PURE__ */ React.createElement("span", { className, style }, hoverIndex === index ? /* @__PURE__ */ React.createElement(Icon.Icon, { name: "tick-bold", className: cn.clsx("!h-full !w-full", { "text-white": !item.isHidden }) }) : null),
51
+ /* @__PURE__ */ React.createElement("span", { className, style }, !item.isHidden ? /* @__PURE__ */ React.createElement(Icon.Icon, { name: "tick-bold", className: "!h-full !w-full text-white" }) : null),
45
52
  item.label
46
53
  );
47
54
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"Legend.cjs","sources":["../../../src/charts/components/Legend.tsx"],"sourcesContent":["import React from 'react';\nimport { clsx } from 'clsx';\nimport { Button } from '../../components/Button/Button';\nimport { Icon } from '../../components/Icon/Icon';\nimport { OverflowGroup } from '../../components/OverflowGroup/OverflowGroup';\nimport { ChartChildProps } from './types';\n\nexport interface LegendProps<TData extends object> {\n items: ChartChildProps<TData>[];\n hoverIndex: number | undefined;\n onHover: (index: number | undefined) => void;\n onToggle: (name: keyof TData) => void;\n}\n\nexport function Legend<TData extends object>(props: LegendProps<TData>) {\n const { hoverIndex, items, onHover: handleHover, onToggle: handleToggle } = props;\n\n const handleMouseEnter = (item: ChartChildProps<TData>, index: number) => {\n if (item.isHidden) {\n return;\n }\n\n handleHover(index);\n };\n const handleMouseLeave = () => handleHover(undefined);\n\n const handleClick = (item: ChartChildProps<TData>) => {\n // remove hover if hiding the item\n if (!item.isHidden) {\n handleHover(undefined);\n }\n\n handleToggle(item.dataKey);\n };\n\n const moreButton = (moreButtonText: string) => (\n <Button appearance=\"transparent\" className=\"!h-5 !min-h-[1.25rem] !px-1.5 text-xs text-gray-700\">\n {moreButtonText}\n </Button>\n );\n\n return (\n <OverflowGroup className=\"mt-3 w-full gap-x-1\" moreButton={moreButton}>\n {items.map((item, index) => {\n const className = clsx('mr-1 flex h-3 w-3 rounded-sm', {\n border: item.isHidden,\n });\n let style;\n\n if (!item.isHidden) {\n style = { backgroundColor: item.color };\n }\n\n return (\n <button\n key={`${item.label}_${index}`}\n className=\"focus-visible:yt-focus flex items-center rounded px-1 !text-xs hover:bg-gray-200\"\n onClick={event => {\n event?.preventDefault();\n handleClick(item);\n }}\n onMouseEnter={() => handleMouseEnter(item, index)}\n onMouseLeave={() => handleMouseLeave()}>\n <span className={className} style={style}>\n {hoverIndex === index ? (\n <Icon name=\"tick-bold\" className={clsx('!h-full !w-full', { 'text-white': !item.isHidden })} />\n ) : null}\n </span>\n {item.label}\n </button>\n );\n })}\n </OverflowGroup>\n );\n}\n"],"names":["Button","OverflowGroup","clsx","Icon"],"mappings":";;;;;;;AAcO,SAAS,OAA6B,OAA2B;AACpE,QAAM,EAAE,YAAY,OAAO,SAAS,aAAa,UAAU,iBAAiB;AAEtE,QAAA,mBAAmB,CAAC,MAA8B,UAAkB;AACtE,QAAI,KAAK,UAAU;AACf;AAAA,IAAA;AAGJ,gBAAY,KAAK;AAAA,EACrB;AACM,QAAA,mBAAmB,MAAM,YAAY,MAAS;AAE9C,QAAA,cAAc,CAAC,SAAiC;AAE9C,QAAA,CAAC,KAAK,UAAU;AAChB,kBAAY,MAAS;AAAA,IAAA;AAGzB,iBAAa,KAAK,OAAO;AAAA,EAC7B;AAEM,QAAA,aAAa,CAAC,mBAChB,sBAAA,cAACA,OAAAA,UAAO,YAAW,eAAc,WAAU,sDAAA,GACtC,cACL;AAIA,SAAA,sBAAA,cAACC,+BAAc,WAAU,uBAAsB,cAC1C,MAAM,IAAI,CAAC,MAAM,UAAU;AAClB,UAAA,YAAYC,QAAK,gCAAgC;AAAA,MACnD,QAAQ,KAAK;AAAA,IAAA,CAChB;AACG,QAAA;AAEA,QAAA,CAAC,KAAK,UAAU;AACR,cAAA,EAAE,iBAAiB,KAAK,MAAM;AAAA,IAAA;AAItC,WAAA,sBAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAK,GAAG,KAAK,KAAK,IAAI,KAAK;AAAA,QAC3B,WAAU;AAAA,QACV,SAAS,CAAS,UAAA;AACd,yCAAO;AACP,sBAAY,IAAI;AAAA,QACpB;AAAA,QACA,cAAc,MAAM,iBAAiB,MAAM,KAAK;AAAA,QAChD,cAAc,MAAM,iBAAiB;AAAA,MAAA;AAAA,MACrC,sBAAA,cAAC,UAAK,WAAsB,SACvB,eAAe,QACZ,sBAAA,cAACC,KAAAA,QAAK,MAAK,aAAY,WAAWD,QAAK,mBAAmB,EAAE,cAAc,CAAC,KAAK,SAAS,CAAC,EAAG,CAAA,IAC7F,IACR;AAAA,MACC,KAAK;AAAA,IACV;AAAA,EAAA,CAEP,CACL;AAER;;"}
1
+ {"version":3,"file":"Legend.cjs","sources":["../../../src/charts/components/Legend.tsx"],"sourcesContent":["import React from 'react';\nimport { Button } from '../../components/Button/Button';\nimport { Icon } from '../../components/Icon/Icon';\nimport { OverflowGroup } from '../../components/OverflowGroup/OverflowGroup';\nimport { ChartChildProps } from './types';\nimport { colors, getThemeColor } from '../utils/color';\n\nexport interface LegendProps<TData extends object> {\n items: ChartChildProps<TData>[];\n hoverIndex: number | undefined;\n onHover: (index: number | undefined) => void;\n onToggle: (name: keyof TData) => void;\n}\n\nfunction getDarkerThemeColor(color: string | undefined) {\n const colorName = Object.keys(colors).find(name => colors[name] === color);\n\n if (!colorName) {\n return undefined;\n }\n\n return getThemeColor(colorName.replace(/-\\d+$/, '-300'));\n}\n\nexport function Legend<TData extends object>(props: LegendProps<TData>) {\n const { items, onHover: handleHover, onToggle: handleToggle } = props;\n\n const handleMouseEnter = (item: ChartChildProps<TData>, index: number) => {\n if (item.isHidden) {\n return;\n }\n\n handleHover(index);\n };\n const handleMouseLeave = () => handleHover(undefined);\n\n const handleClick = (item: ChartChildProps<TData>) => {\n // remove hover if hiding the item\n if (!item.isHidden) {\n handleHover(undefined);\n }\n\n handleToggle(item.dataKey);\n };\n\n const moreButton = (moreButtonText: string) => (\n <Button appearance=\"transparent\" className=\"!h-5 !min-h-[1.25rem] !px-1.5 text-xs text-gray-700\">\n {moreButtonText}\n </Button>\n );\n\n return (\n <OverflowGroup className=\"mt-3 w-full gap-x-1\" moreButton={moreButton}>\n {items.map((item, index) => {\n const className = 'mr-1 flex h-3.5 w-3.5 rounded-sm border';\n const style: React.CSSProperties = {};\n const darkerThemeColor = getDarkerThemeColor(item.color);\n\n if (!item.isHidden) {\n style.backgroundColor = item.color;\n style.borderColor = darkerThemeColor;\n }\n\n return (\n <button\n key={`${item.label}_${index}`}\n className=\"focus-visible:yt-focus flex items-center rounded px-1 !text-xs hover:bg-gray-100\"\n onClick={event => {\n event?.preventDefault();\n handleClick(item);\n }}\n onMouseEnter={() => handleMouseEnter(item, index)}\n onMouseLeave={() => handleMouseLeave()}>\n <span className={className} style={style}>\n {!item.isHidden ? <Icon name=\"tick-bold\" className=\"!h-full !w-full text-white\" /> : null}\n </span>\n {item.label}\n </button>\n );\n })}\n </OverflowGroup>\n );\n}\n"],"names":["color","colors","getThemeColor","Button","OverflowGroup","Icon"],"mappings":";;;;;;;AAcA,SAAS,oBAAoBA,SAA2B;AAC9C,QAAA,YAAY,OAAO,KAAKC,YAAM,EAAE,KAAK,CAAQ,SAAAA,MAAAA,OAAO,IAAI,MAAMD,OAAK;AAEzE,MAAI,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IACzF;AAAA,MACC,KAAK;AAAA,IACV;AAAA,EAAA,CAEP,CACL;AAER;;"}
@@ -1,10 +1,17 @@
1
1
  import React__default from "react";
2
- import { clsx } from "clsx";
3
2
  import { Button } from "../../components/Button/Button.js";
4
3
  import { Icon } from "../../components/Icon/Icon.js";
5
4
  import { OverflowGroup } from "../../components/OverflowGroup/OverflowGroup.js";
5
+ import { colors, getThemeColor } from "../utils/color.js";
6
+ function getDarkerThemeColor(color) {
7
+ const colorName = Object.keys(colors).find((name) => colors[name] === color);
8
+ if (!colorName) {
9
+ return void 0;
10
+ }
11
+ return getThemeColor(colorName.replace(/-\d+$/, "-300"));
12
+ }
6
13
  function Legend(props) {
7
- const { hoverIndex, items, onHover: handleHover, onToggle: handleToggle } = props;
14
+ const { items, onHover: handleHover, onToggle: handleToggle } = props;
8
15
  const handleMouseEnter = (item, index) => {
9
16
  if (item.isHidden) {
10
17
  return;
@@ -20,18 +27,18 @@ function Legend(props) {
20
27
  };
21
28
  const moreButton = (moreButtonText) => /* @__PURE__ */ React__default.createElement(Button, { appearance: "transparent", className: "!h-5 !min-h-[1.25rem] !px-1.5 text-xs text-gray-700" }, moreButtonText);
22
29
  return /* @__PURE__ */ React__default.createElement(OverflowGroup, { className: "mt-3 w-full gap-x-1", moreButton }, items.map((item, index) => {
23
- const className = clsx("mr-1 flex h-3 w-3 rounded-sm", {
24
- border: item.isHidden
25
- });
26
- let style;
30
+ const className = "mr-1 flex h-3.5 w-3.5 rounded-sm border";
31
+ const style = {};
32
+ const darkerThemeColor = getDarkerThemeColor(item.color);
27
33
  if (!item.isHidden) {
28
- style = { backgroundColor: item.color };
34
+ style.backgroundColor = item.color;
35
+ style.borderColor = darkerThemeColor;
29
36
  }
30
37
  return /* @__PURE__ */ React__default.createElement(
31
38
  "button",
32
39
  {
33
40
  key: `${item.label}_${index}`,
34
- className: "focus-visible:yt-focus flex items-center rounded px-1 !text-xs hover:bg-gray-200",
41
+ className: "focus-visible:yt-focus flex items-center rounded px-1 !text-xs hover:bg-gray-100",
35
42
  onClick: (event) => {
36
43
  event == null ? void 0 : event.preventDefault();
37
44
  handleClick(item);
@@ -39,7 +46,7 @@ function Legend(props) {
39
46
  onMouseEnter: () => handleMouseEnter(item, index),
40
47
  onMouseLeave: () => handleMouseLeave()
41
48
  },
42
- /* @__PURE__ */ React__default.createElement("span", { className, style }, hoverIndex === index ? /* @__PURE__ */ React__default.createElement(Icon, { name: "tick-bold", className: clsx("!h-full !w-full", { "text-white": !item.isHidden }) }) : null),
49
+ /* @__PURE__ */ React__default.createElement("span", { className, style }, !item.isHidden ? /* @__PURE__ */ React__default.createElement(Icon, { name: "tick-bold", className: "!h-full !w-full text-white" }) : null),
43
50
  item.label
44
51
  );
45
52
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"Legend.js","sources":["../../../src/charts/components/Legend.tsx"],"sourcesContent":["import React from 'react';\nimport { clsx } from 'clsx';\nimport { Button } from '../../components/Button/Button';\nimport { Icon } from '../../components/Icon/Icon';\nimport { OverflowGroup } from '../../components/OverflowGroup/OverflowGroup';\nimport { ChartChildProps } from './types';\n\nexport interface LegendProps<TData extends object> {\n items: ChartChildProps<TData>[];\n hoverIndex: number | undefined;\n onHover: (index: number | undefined) => void;\n onToggle: (name: keyof TData) => void;\n}\n\nexport function Legend<TData extends object>(props: LegendProps<TData>) {\n const { hoverIndex, items, onHover: handleHover, onToggle: handleToggle } = props;\n\n const handleMouseEnter = (item: ChartChildProps<TData>, index: number) => {\n if (item.isHidden) {\n return;\n }\n\n handleHover(index);\n };\n const handleMouseLeave = () => handleHover(undefined);\n\n const handleClick = (item: ChartChildProps<TData>) => {\n // remove hover if hiding the item\n if (!item.isHidden) {\n handleHover(undefined);\n }\n\n handleToggle(item.dataKey);\n };\n\n const moreButton = (moreButtonText: string) => (\n <Button appearance=\"transparent\" className=\"!h-5 !min-h-[1.25rem] !px-1.5 text-xs text-gray-700\">\n {moreButtonText}\n </Button>\n );\n\n return (\n <OverflowGroup className=\"mt-3 w-full gap-x-1\" moreButton={moreButton}>\n {items.map((item, index) => {\n const className = clsx('mr-1 flex h-3 w-3 rounded-sm', {\n border: item.isHidden,\n });\n let style;\n\n if (!item.isHidden) {\n style = { backgroundColor: item.color };\n }\n\n return (\n <button\n key={`${item.label}_${index}`}\n className=\"focus-visible:yt-focus flex items-center rounded px-1 !text-xs hover:bg-gray-200\"\n onClick={event => {\n event?.preventDefault();\n handleClick(item);\n }}\n onMouseEnter={() => handleMouseEnter(item, index)}\n onMouseLeave={() => handleMouseLeave()}>\n <span className={className} style={style}>\n {hoverIndex === index ? (\n <Icon name=\"tick-bold\" className={clsx('!h-full !w-full', { 'text-white': !item.isHidden })} />\n ) : null}\n </span>\n {item.label}\n </button>\n );\n })}\n </OverflowGroup>\n );\n}\n"],"names":["React"],"mappings":";;;;;AAcO,SAAS,OAA6B,OAA2B;AACpE,QAAM,EAAE,YAAY,OAAO,SAAS,aAAa,UAAU,iBAAiB;AAEtE,QAAA,mBAAmB,CAAC,MAA8B,UAAkB;AACtE,QAAI,KAAK,UAAU;AACf;AAAA,IAAA;AAGJ,gBAAY,KAAK;AAAA,EACrB;AACM,QAAA,mBAAmB,MAAM,YAAY,MAAS;AAE9C,QAAA,cAAc,CAAC,SAAiC;AAE9C,QAAA,CAAC,KAAK,UAAU;AAChB,kBAAY,MAAS;AAAA,IAAA;AAGzB,iBAAa,KAAK,OAAO;AAAA,EAC7B;AAEM,QAAA,aAAa,CAAC,mBAChBA,+BAAA,cAAC,UAAO,YAAW,eAAc,WAAU,sDAAA,GACtC,cACL;AAIA,SAAAA,+BAAA,cAAC,iBAAc,WAAU,uBAAsB,cAC1C,MAAM,IAAI,CAAC,MAAM,UAAU;AAClB,UAAA,YAAY,KAAK,gCAAgC;AAAA,MACnD,QAAQ,KAAK;AAAA,IAAA,CAChB;AACG,QAAA;AAEA,QAAA,CAAC,KAAK,UAAU;AACR,cAAA,EAAE,iBAAiB,KAAK,MAAM;AAAA,IAAA;AAItC,WAAAA,+BAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAK,GAAG,KAAK,KAAK,IAAI,KAAK;AAAA,QAC3B,WAAU;AAAA,QACV,SAAS,CAAS,UAAA;AACd,yCAAO;AACP,sBAAY,IAAI;AAAA,QACpB;AAAA,QACA,cAAc,MAAM,iBAAiB,MAAM,KAAK;AAAA,QAChD,cAAc,MAAM,iBAAiB;AAAA,MAAA;AAAA,MACrCA,+BAAA,cAAC,UAAK,WAAsB,SACvB,eAAe,QACZA,+BAAA,cAAC,QAAK,MAAK,aAAY,WAAW,KAAK,mBAAmB,EAAE,cAAc,CAAC,KAAK,SAAS,CAAC,EAAG,CAAA,IAC7F,IACR;AAAA,MACC,KAAK;AAAA,IACV;AAAA,EAAA,CAEP,CACL;AAER;"}
1
+ {"version":3,"file":"Legend.js","sources":["../../../src/charts/components/Legend.tsx"],"sourcesContent":["import React from 'react';\nimport { Button } from '../../components/Button/Button';\nimport { Icon } from '../../components/Icon/Icon';\nimport { OverflowGroup } from '../../components/OverflowGroup/OverflowGroup';\nimport { ChartChildProps } from './types';\nimport { colors, getThemeColor } from '../utils/color';\n\nexport interface LegendProps<TData extends object> {\n items: ChartChildProps<TData>[];\n hoverIndex: number | undefined;\n onHover: (index: number | undefined) => void;\n onToggle: (name: keyof TData) => void;\n}\n\nfunction getDarkerThemeColor(color: string | undefined) {\n const colorName = Object.keys(colors).find(name => colors[name] === color);\n\n if (!colorName) {\n return undefined;\n }\n\n return getThemeColor(colorName.replace(/-\\d+$/, '-300'));\n}\n\nexport function Legend<TData extends object>(props: LegendProps<TData>) {\n const { items, onHover: handleHover, onToggle: handleToggle } = props;\n\n const handleMouseEnter = (item: ChartChildProps<TData>, index: number) => {\n if (item.isHidden) {\n return;\n }\n\n handleHover(index);\n };\n const handleMouseLeave = () => handleHover(undefined);\n\n const handleClick = (item: ChartChildProps<TData>) => {\n // remove hover if hiding the item\n if (!item.isHidden) {\n handleHover(undefined);\n }\n\n handleToggle(item.dataKey);\n };\n\n const moreButton = (moreButtonText: string) => (\n <Button appearance=\"transparent\" className=\"!h-5 !min-h-[1.25rem] !px-1.5 text-xs text-gray-700\">\n {moreButtonText}\n </Button>\n );\n\n return (\n <OverflowGroup className=\"mt-3 w-full gap-x-1\" moreButton={moreButton}>\n {items.map((item, index) => {\n const className = 'mr-1 flex h-3.5 w-3.5 rounded-sm border';\n const style: React.CSSProperties = {};\n const darkerThemeColor = getDarkerThemeColor(item.color);\n\n if (!item.isHidden) {\n style.backgroundColor = item.color;\n style.borderColor = darkerThemeColor;\n }\n\n return (\n <button\n key={`${item.label}_${index}`}\n className=\"focus-visible:yt-focus flex items-center rounded px-1 !text-xs hover:bg-gray-100\"\n onClick={event => {\n event?.preventDefault();\n handleClick(item);\n }}\n onMouseEnter={() => handleMouseEnter(item, index)}\n onMouseLeave={() => handleMouseLeave()}>\n <span className={className} style={style}>\n {!item.isHidden ? <Icon name=\"tick-bold\" className=\"!h-full !w-full text-white\" /> : null}\n </span>\n {item.label}\n </button>\n );\n })}\n </OverflowGroup>\n );\n}\n"],"names":["React"],"mappings":";;;;;AAcA,SAAS,oBAAoB,OAA2B;AAC9C,QAAA,YAAY,OAAO,KAAK,MAAM,EAAE,KAAK,CAAQ,SAAA,OAAO,IAAI,MAAM,KAAK;AAEzE,MAAI,CAAC,WAAW;AACL,WAAA;AAAA,EAAA;AAGX,SAAO,cAAc,UAAU,QAAQ,SAAS,MAAM,CAAC;AAC3D;AAEO,SAAS,OAA6B,OAA2B;AACpE,QAAM,EAAE,OAAO,SAAS,aAAa,UAAU,iBAAiB;AAE1D,QAAA,mBAAmB,CAAC,MAA8B,UAAkB;AACtE,QAAI,KAAK,UAAU;AACf;AAAA,IAAA;AAGJ,gBAAY,KAAK;AAAA,EACrB;AACM,QAAA,mBAAmB,MAAM,YAAY,MAAS;AAE9C,QAAA,cAAc,CAAC,SAAiC;AAE9C,QAAA,CAAC,KAAK,UAAU;AAChB,kBAAY,MAAS;AAAA,IAAA;AAGzB,iBAAa,KAAK,OAAO;AAAA,EAC7B;AAEM,QAAA,aAAa,CAAC,mBAChBA,+BAAA,cAAC,UAAO,YAAW,eAAc,WAAU,sDAAA,GACtC,cACL;AAIA,SAAAA,+BAAA,cAAC,iBAAc,WAAU,uBAAsB,cAC1C,MAAM,IAAI,CAAC,MAAM,UAAU;AACxB,UAAM,YAAY;AAClB,UAAM,QAA6B,CAAC;AAC9B,UAAA,mBAAmB,oBAAoB,KAAK,KAAK;AAEnD,QAAA,CAAC,KAAK,UAAU;AAChB,YAAM,kBAAkB,KAAK;AAC7B,YAAM,cAAc;AAAA,IAAA;AAIpB,WAAAA,+BAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAK,GAAG,KAAK,KAAK,IAAI,KAAK;AAAA,QAC3B,WAAU;AAAA,QACV,SAAS,CAAS,UAAA;AACd,yCAAO;AACP,sBAAY,IAAI;AAAA,QACpB;AAAA,QACA,cAAc,MAAM,iBAAiB,MAAM,KAAK;AAAA,QAChD,cAAc,MAAM,iBAAiB;AAAA,MAAA;AAAA,MACpCA,+BAAA,cAAA,QAAA,EAAK,WAAsB,MAAA,GACvB,CAAC,KAAK,WAAYA,+BAAA,cAAA,MAAA,EAAK,MAAK,aAAY,WAAU,6BAAA,CAA6B,IAAK,IACzF;AAAA,MACC,KAAK;AAAA,IACV;AAAA,EAAA,CAEP,CACL;AAER;"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
- const popover = require("@base-ui/react/popover");
4
+ const PopoverPrimitive = require("@radix-ui/react-popover");
5
5
  function _interopNamespaceDefault(e) {
6
6
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
7
7
  if (e) {
@@ -19,8 +19,9 @@ function _interopNamespaceDefault(e) {
19
19
  return Object.freeze(n);
20
20
  }
21
21
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
22
+ const PopoverPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(PopoverPrimitive);
22
23
  const UnstyledArrow = React__namespace.forwardRef(function PopoverArrow(props, ref) {
23
- return /* @__PURE__ */ React__namespace.createElement(popover.Popover.Arrow, { className: "pointer-events-none h-[11px] w-[30px] data-[side=bottom]:top-[-10px] data-[side=left]:right-[-20px] data-[side=right]:left-[-20px] data-[side=top]:bottom-[-10px] data-[side=left]:rotate-90 data-[side=right]:-rotate-90 data-[side=top]:rotate-180" }, /* @__PURE__ */ React__namespace.createElement("svg", { ...props, ref, viewBox: "0 19 30 11" }, /* @__PURE__ */ React__namespace.createElement(
24
+ return /* @__PURE__ */ React__namespace.createElement(PopoverPrimitive__namespace.Arrow, { className: "pointer-events-none -mt-px", asChild: true, offset: 2, width: 30, height: 11 }, /* @__PURE__ */ React__namespace.createElement("svg", { ...props, ref, viewBox: "0 19 30 11", style: { transform: "rotateZ(180deg)" } }, /* @__PURE__ */ React__namespace.createElement(
24
25
  "path",
25
26
  {
26
27
  className: "fill-current text-blue-500",
@@ -1 +1 @@
1
- {"version":3,"file":"Arrow.cjs","sources":["../../../src/components/Hanger/Arrow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Popover as PopoverPrimitive } from '@base-ui/react/popover';\n\nexport const UnstyledArrow = React.forwardRef<SVGSVGElement, React.SVGAttributes<SVGElement>>(function PopoverArrow(props, ref) {\n return (\n <PopoverPrimitive.Arrow className=\"pointer-events-none h-[11px] w-[30px] data-[side=bottom]:top-[-10px] data-[side=left]:right-[-20px] data-[side=right]:left-[-20px] data-[side=top]:bottom-[-10px] data-[side=left]:rotate-90 data-[side=right]:-rotate-90 data-[side=top]:rotate-180\">\n <svg {...props} ref={ref} viewBox=\"0 19 30 11\">\n <path\n className=\"fill-current text-blue-500\"\n d=\"M23.7,27.1L17,19.9C16.5,19.3,15.8,19,15,19s-1.6,0.3-2.1,0.9l-6.6,7.2C5.3,28.1,3.4,29,2,29h26 C26.7,29,24.6,28.1,23.7,27.1z\"></path>\n <path\n className=\"fill-current\"\n d=\"M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z\"></path>\n </svg>\n </PopoverPrimitive.Arrow>\n );\n});\n"],"names":["React","PopoverPrimitive"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,gBAAgBA,iBAAM,WAA2D,SAAS,aAAa,OAAO,KAAK;AAC5H,SACKA,iCAAA,cAAAC,QAAA,QAAiB,OAAjB,EAAuB,WAAU,uPAAA,GAC7BD,iCAAA,cAAA,OAAA,EAAK,GAAG,OAAO,KAAU,SAAQ,aAC9B,GAAAA,iCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAU;AAAA,MACV,GAAE;AAAA,IAAA;AAAA,EACN,GAAAA,iCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAU;AAAA,MACV,GAAE;AAAA,IAAA;AAAA,EAAA,CACV,CACJ;AAER,CAAC;;"}
1
+ {"version":3,"file":"Arrow.cjs","sources":["../../../src/components/Hanger/Arrow.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nexport const UnstyledArrow = React.forwardRef<SVGSVGElement, React.SVGAttributes<SVGElement>>(function PopoverArrow(props, ref) {\n return (\n <PopoverPrimitive.Arrow className=\"pointer-events-none -mt-px\" asChild offset={2} width={30} height={11}>\n <svg {...props} ref={ref} viewBox=\"0 19 30 11\" style={{ transform: 'rotateZ(180deg)' }}>\n <path\n className=\"fill-current text-blue-500\"\n d=\"M23.7,27.1L17,19.9C16.5,19.3,15.8,19,15,19s-1.6,0.3-2.1,0.9l-6.6,7.2C5.3,28.1,3.4,29,2,29h26 C26.7,29,24.6,28.1,23.7,27.1z\"></path>\n <path\n className=\"fill-current\"\n d=\"M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z\"></path>\n </svg>\n </PopoverPrimitive.Arrow>\n );\n});\n"],"names":["React","PopoverPrimitive"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,gBAAgBA,iBAAM,WAA2D,SAAS,aAAa,OAAO,KAAK;AAExH,SAAAA,iCAAA,cAACC,4BAAiB,OAAjB,EAAuB,WAAU,8BAA6B,SAAO,MAAC,QAAQ,GAAG,OAAO,IAAI,QAAQ,MACjGD,iCAAA,cAAC,OAAK,EAAA,GAAG,OAAO,KAAU,SAAQ,cAAa,OAAO,EAAE,WAAW,kBAAA,EAC/D,GAAAA,iCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAU;AAAA,MACV,GAAE;AAAA,IAAA;AAAA,EACN,GAAAA,iCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAU;AAAA,MACV,GAAE;AAAA,IAAA;AAAA,EAAA,CACV,CACJ;AAER,CAAC;;"}
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
- import { Popover } from "@base-ui/react/popover";
2
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
3
3
  const UnstyledArrow = React.forwardRef(function PopoverArrow(props, ref) {
4
- return /* @__PURE__ */ React.createElement(Popover.Arrow, { className: "pointer-events-none h-[11px] w-[30px] data-[side=bottom]:top-[-10px] data-[side=left]:right-[-20px] data-[side=right]:left-[-20px] data-[side=top]:bottom-[-10px] data-[side=left]:rotate-90 data-[side=right]:-rotate-90 data-[side=top]:rotate-180" }, /* @__PURE__ */ React.createElement("svg", { ...props, ref, viewBox: "0 19 30 11" }, /* @__PURE__ */ React.createElement(
4
+ return /* @__PURE__ */ React.createElement(PopoverPrimitive.Arrow, { className: "pointer-events-none -mt-px", asChild: true, offset: 2, width: 30, height: 11 }, /* @__PURE__ */ React.createElement("svg", { ...props, ref, viewBox: "0 19 30 11", style: { transform: "rotateZ(180deg)" } }, /* @__PURE__ */ React.createElement(
5
5
  "path",
6
6
  {
7
7
  className: "fill-current text-blue-500",
@@ -1 +1 @@
1
- {"version":3,"file":"Arrow.js","sources":["../../../src/components/Hanger/Arrow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Popover as PopoverPrimitive } from '@base-ui/react/popover';\n\nexport const UnstyledArrow = React.forwardRef<SVGSVGElement, React.SVGAttributes<SVGElement>>(function PopoverArrow(props, ref) {\n return (\n <PopoverPrimitive.Arrow className=\"pointer-events-none h-[11px] w-[30px] data-[side=bottom]:top-[-10px] data-[side=left]:right-[-20px] data-[side=right]:left-[-20px] data-[side=top]:bottom-[-10px] data-[side=left]:rotate-90 data-[side=right]:-rotate-90 data-[side=top]:rotate-180\">\n <svg {...props} ref={ref} viewBox=\"0 19 30 11\">\n <path\n className=\"fill-current text-blue-500\"\n d=\"M23.7,27.1L17,19.9C16.5,19.3,15.8,19,15,19s-1.6,0.3-2.1,0.9l-6.6,7.2C5.3,28.1,3.4,29,2,29h26 C26.7,29,24.6,28.1,23.7,27.1z\"></path>\n <path\n className=\"fill-current\"\n d=\"M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z\"></path>\n </svg>\n </PopoverPrimitive.Arrow>\n );\n});\n"],"names":["PopoverPrimitive"],"mappings":";;AAGO,MAAM,gBAAgB,MAAM,WAA2D,SAAS,aAAa,OAAO,KAAK;AAC5H,SACK,sBAAA,cAAAA,QAAiB,OAAjB,EAAuB,WAAU,uPAAA,GAC7B,sBAAA,cAAA,OAAA,EAAK,GAAG,OAAO,KAAU,SAAQ,aAC9B,GAAA,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAU;AAAA,MACV,GAAE;AAAA,IAAA;AAAA,EACN,GAAA,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAU;AAAA,MACV,GAAE;AAAA,IAAA;AAAA,EAAA,CACV,CACJ;AAER,CAAC;"}
1
+ {"version":3,"file":"Arrow.js","sources":["../../../src/components/Hanger/Arrow.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nexport const UnstyledArrow = React.forwardRef<SVGSVGElement, React.SVGAttributes<SVGElement>>(function PopoverArrow(props, ref) {\n return (\n <PopoverPrimitive.Arrow className=\"pointer-events-none -mt-px\" asChild offset={2} width={30} height={11}>\n <svg {...props} ref={ref} viewBox=\"0 19 30 11\" style={{ transform: 'rotateZ(180deg)' }}>\n <path\n className=\"fill-current text-blue-500\"\n d=\"M23.7,27.1L17,19.9C16.5,19.3,15.8,19,15,19s-1.6,0.3-2.1,0.9l-6.6,7.2C5.3,28.1,3.4,29,2,29h26 C26.7,29,24.6,28.1,23.7,27.1z\"></path>\n <path\n className=\"fill-current\"\n d=\"M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z\"></path>\n </svg>\n </PopoverPrimitive.Arrow>\n );\n});\n"],"names":[],"mappings":";;AAGO,MAAM,gBAAgB,MAAM,WAA2D,SAAS,aAAa,OAAO,KAAK;AAExH,SAAA,sBAAA,cAAC,iBAAiB,OAAjB,EAAuB,WAAU,8BAA6B,SAAO,MAAC,QAAQ,GAAG,OAAO,IAAI,QAAQ,MACjG,sBAAA,cAAC,OAAK,EAAA,GAAG,OAAO,KAAU,SAAQ,cAAa,OAAO,EAAE,WAAW,kBAAA,EAC/D,GAAA,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAU;AAAA,MACV,GAAE;AAAA,IAAA;AAAA,EACN,GAAA,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAU;AAAA,MACV,GAAE;AAAA,IAAA;AAAA,EAAA,CACV,CACJ;AAER,CAAC;"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
4
  const cn = require("clsx");
5
- const popover = require("@base-ui/react/popover");
5
+ const PopoverPrimitive = require("@radix-ui/react-popover");
6
6
  const IconButton = require("../IconButton/IconButton.cjs");
7
7
  const Arrow = require("./Arrow.cjs");
8
8
  const Localization = require("../Provider/Localization.cjs");
@@ -25,75 +25,75 @@ function _interopNamespaceDefault(e) {
25
25
  return Object.freeze(n);
26
26
  }
27
27
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
28
+ const PopoverPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(PopoverPrimitive);
28
29
  const HangerContext = React__namespace.createContext({
29
- anchorRef: { current: null },
30
- onClose: void 0
30
+ onClose: void 0,
31
+ props: {},
32
+ ref: null
31
33
  });
32
- const Anchor = React__namespace.forwardRef(function HangerAnchor(props, ref) {
33
- if (!React__namespace.isValidElement(props.children)) {
34
- return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, props.children);
34
+ const Anchor = React__namespace.forwardRef(function HangerAnchor(props, externalRef) {
35
+ var _a;
36
+ const { ref: parentRef, props: parentProps } = React__namespace.useContext(HangerContext);
37
+ const refCallback = mergeRefs.mergeRefs([parentRef, externalRef]);
38
+ let children = props.children;
39
+ if (React__namespace.isValidElement(props.children) && typeof ((_a = props.children) == null ? void 0 : _a.type) === "function") {
40
+ console.warn(
41
+ `Hanger.Anchor requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '${props.children.type.name}' in React.forwardRef()? Taco has wrapped '${props.children.type.name}' in a 'span' to maintain functionality, but this may cause unintended behaviour`
42
+ );
43
+ children = /* @__PURE__ */ React__namespace.createElement("span", null, props.children);
35
44
  }
36
- const child = props.children;
37
- return React__namespace.cloneElement(child, {
38
- ref: child.ref ? mergeRefs.mergeRefs([ref, child.ref]) : ref
39
- });
45
+ return /* @__PURE__ */ React__namespace.createElement(PopoverPrimitive__namespace.Anchor, { ...parentProps, ...props, ref: refCallback, asChild: true }, children);
40
46
  });
41
47
  const Title = React__namespace.forwardRef(function DialogTitle(props, ref) {
42
48
  const className = cn("mb-1 text-base font-bold flex w-full", props.className);
43
49
  return /* @__PURE__ */ React__namespace.createElement("span", { ...props, className, ref });
44
50
  });
45
51
  const Content = React__namespace.forwardRef(function HangerContent(props, ref) {
46
- const { placement: side, hideWhenDetached = false, container, ...popoverContentProps } = props;
52
+ const { placement: side, hideWhenDetached = false, container } = props;
47
53
  const context = React__namespace.useContext(HangerContext);
48
54
  const { texts } = Localization.useLocalization();
49
55
  const className = cn(
50
56
  "wcag-blue-500 border border-transparent rounded p-3 pr-12 yt-shadow focus:border-transparent max-w-sm print:hidden",
51
57
  props.className
52
58
  );
53
- return /* @__PURE__ */ React__namespace.createElement(popover.Popover.Portal, { container }, /* @__PURE__ */ React__namespace.createElement(
54
- popover.Popover.Positioner,
59
+ const handleInteractOutside = (event) => {
60
+ event.preventDefault();
61
+ };
62
+ return /* @__PURE__ */ React__namespace.createElement(PopoverPrimitive__namespace.Portal, { container }, /* @__PURE__ */ React__namespace.createElement(
63
+ PopoverPrimitive__namespace.Content,
55
64
  {
56
- anchor: context.anchorRef,
57
- className: hideWhenDetached ? "data-[anchor-hidden]:hidden" : void 0,
65
+ className,
66
+ "data-taco": "hanger",
67
+ onInteractOutside: handleInteractOutside,
58
68
  side,
59
- sideOffset: 11
69
+ sideOffset: 1,
70
+ ref,
71
+ hideWhenDetached
60
72
  },
61
- /* @__PURE__ */ React__namespace.createElement(popover.Popover.Popup, { ...popoverContentProps, className, "data-taco": "hanger", ref }, props.children, /* @__PURE__ */ React__namespace.createElement(Arrow.UnstyledArrow, { className: "text-blue-500" }), /* @__PURE__ */ React__namespace.createElement(
62
- popover.Popover.Close,
73
+ props.children,
74
+ /* @__PURE__ */ React__namespace.createElement(Arrow.UnstyledArrow, { className: "text-blue-500" }),
75
+ /* @__PURE__ */ React__namespace.createElement(PopoverPrimitive__namespace.Close, { asChild: true }, /* @__PURE__ */ React__namespace.createElement(
76
+ IconButton.IconButton,
63
77
  {
64
- render: /* @__PURE__ */ React__namespace.createElement(
65
- IconButton.IconButton,
66
- {
67
- appearance: "primary",
68
- "aria-label": texts.hanger.close,
69
- className: "absolute right-0 top-0 mx-2 mt-2 text-white",
70
- icon: "close",
71
- onClick: context.onClose
72
- }
73
- )
78
+ appearance: "primary",
79
+ "aria-label": texts.hanger.close,
80
+ className: "absolute right-0 top-0 ml-2 mr-2 mt-2 text-white",
81
+ icon: "close",
82
+ onClick: context.onClose
74
83
  }
75
84
  ))
76
85
  ));
77
86
  });
78
87
  const Hanger = React__namespace.forwardRef(function Hanger2(props, ref) {
79
88
  const { anchor, children, defaultOpen = true, onClose, ...otherProps } = props;
80
- const anchorRef = React__namespace.useRef(null);
81
- const combinedRef = mergeRefs.mergeRefs([anchorRef, ref]);
82
- const context = React__namespace.useMemo(() => ({ anchorRef, onClose }), [onClose]);
89
+ const context = React__namespace.useMemo(() => ({ onClose, props: otherProps, ref }), [onClose, otherProps]);
83
90
  const [open, setOpen] = React__namespace.useState(false);
84
91
  React__namespace.useEffect(() => {
85
92
  if (defaultOpen) {
86
93
  setOpen(defaultOpen);
87
94
  }
88
95
  }, []);
89
- const handleOpenChange = (nextOpen, eventDetails) => {
90
- if (!nextOpen && (eventDetails.reason === "outside-press" || eventDetails.reason === "focus-out")) {
91
- eventDetails.cancel();
92
- return;
93
- }
94
- setOpen(nextOpen);
95
- };
96
- return /* @__PURE__ */ React__namespace.createElement(HangerContext.Provider, { value: context }, /* @__PURE__ */ React__namespace.createElement("span", { ...otherProps, ref: combinedRef }, /* @__PURE__ */ React__namespace.createElement(popover.Popover.Root, { open, onOpenChange: handleOpenChange }, anchor, children)));
96
+ return /* @__PURE__ */ React__namespace.createElement(HangerContext.Provider, { value: context }, /* @__PURE__ */ React__namespace.createElement(PopoverPrimitive__namespace.Root, { key: String(open), defaultOpen: open }, anchor && /* @__PURE__ */ React__namespace.createElement(Anchor, null, anchor), children));
97
97
  });
98
98
  Hanger.Anchor = Anchor;
99
99
  Hanger.Content = Content;
@@ -1 +1 @@
1
- {"version":3,"file":"Hanger.cjs","sources":["../../../src/components/Hanger/Hanger.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport { Popover as PopoverPrimitive } from '@base-ui/react/popover';\n\nimport { IconButton } from '../IconButton/IconButton';\nimport { Placement } from '../..';\nimport { UnstyledArrow } from './Arrow';\nimport { useLocalization } from '../Provider/Localization';\nimport { mergeRefs } from '../../utils/mergeRefs';\nimport './Hanger.css';\n\ntype HangerContextValue = {\n /** Handler called when hanger closes by user interaction */\n onClose?: () => void;\n anchorRef: React.RefObject<HTMLElement>;\n};\nconst HangerContext = React.createContext<HangerContextValue>({\n anchorRef: { current: null },\n onClose: undefined,\n});\n\nexport type HangerTexts = {\n /** Aria-label for the close icon button of hanger */\n close: string;\n};\n\nexport type HangerAnchorProps = React.HTMLAttributes<HTMLElement>;\n// The surrounding Hanger root owns the single DOM wrapper that serves as the positioning anchor.\n// `Hanger.Anchor` is a passthrough that clones its child to forward the consumer's ref onto it,\n// preserving the legacy ref API without adding extra DOM (which would break OverflowGroup).\nconst Anchor = React.forwardRef<HTMLElement, HangerAnchorProps>(function HangerAnchor(props, ref) {\n if (!React.isValidElement(props.children)) {\n return <>{props.children}</>;\n }\n const child = props.children as React.ReactElement & { ref?: React.Ref<HTMLElement> };\n return React.cloneElement(child, {\n ref: child.ref ? mergeRefs([ref, child.ref]) : ref,\n });\n});\n\nexport type HangerTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function DialogTitle(props: HangerTitleProps, ref: React.Ref<HTMLHeadingElement>) {\n const className = cn('mb-1 text-base font-bold flex w-full', props.className);\n return <span {...props} className={className} ref={ref} />;\n});\n\nexport type HangerContentProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Set the position of the Hanger relative to its achor. Default value is `bottom` */\n placement?: Placement;\n hideWhenDetached?: boolean;\n container?: HTMLElement | null;\n};\n\nconst Content = React.forwardRef(function HangerContent(props: HangerContentProps, ref: React.Ref<HTMLDivElement>) {\n const { placement: side, hideWhenDetached = false, container, ...popoverContentProps } = props;\n const context = React.useContext(HangerContext);\n const { texts } = useLocalization();\n const className = cn(\n 'wcag-blue-500 border border-transparent rounded p-3 pr-12 yt-shadow focus:border-transparent max-w-sm print:hidden',\n props.className\n );\n\n return (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Positioner\n anchor={context.anchorRef}\n className={hideWhenDetached ? 'data-[anchor-hidden]:hidden' : undefined}\n side={side}\n sideOffset={11}>\n <PopoverPrimitive.Popup {...popoverContentProps} className={className} data-taco=\"hanger\" ref={ref}>\n {props.children}\n <UnstyledArrow className=\"text-blue-500\" />\n <PopoverPrimitive.Close\n render={\n <IconButton\n appearance=\"primary\"\n aria-label={texts.hanger.close}\n className=\"absolute right-0 top-0 mx-2 mt-2 text-white\"\n icon=\"close\"\n onClick={context.onClose}\n />\n }\n />\n </PopoverPrimitive.Popup>\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n );\n});\n\nexport type HangerProps = React.PropsWithChildren<{\n /** An anchor to be used for the hanger, should not be set if `children` already contains an anchor */\n anchor?: JSX.Element;\n /**\n * Shows or hides hanger depending on the value\n * @defaultValue true\n */\n defaultOpen?: boolean;\n /** Handler called when user closes the hanger */\n onClose?: () => void;\n}>;\n\nexport type ForwardedHangerWithStatics = React.ForwardRefExoticComponent<HangerProps & React.RefAttributes<HTMLElement>> & {\n Anchor: React.ForwardRefExoticComponent<HangerAnchorProps>;\n Content: React.ForwardRefExoticComponent<HangerContentProps>;\n Title: React.ForwardRefExoticComponent<HangerTitleProps>;\n};\n\nexport const Hanger = React.forwardRef<HTMLSpanElement, HangerProps>(function Hanger(props, ref) {\n const { anchor, children, defaultOpen = true, onClose, ...otherProps } = props;\n const anchorRef = React.useRef<HTMLElement>(null);\n const combinedRef = mergeRefs([anchorRef as React.MutableRefObject<HTMLElement | null>, ref]);\n const context = React.useMemo(() => ({ anchorRef, onClose }), [onClose]);\n\n // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal\n const [open, setOpen] = React.useState(false);\n React.useEffect(() => {\n if (defaultOpen) {\n setOpen(defaultOpen);\n }\n }, []);\n\n // Hanger should only close from its close button, matching the previous Radix onInteractOutside behavior.\n const handleOpenChange = (nextOpen: boolean, eventDetails: PopoverPrimitive.Root.ChangeEventDetails) => {\n if (!nextOpen && (eventDetails.reason === 'outside-press' || eventDetails.reason === 'focus-out')) {\n eventDetails.cancel();\n return;\n }\n\n setOpen(nextOpen);\n };\n\n // Single inline <span> wrapper: serves as the Floating UI anchor (its rect matches the\n // in-flow trigger child) and contains the FloatingFocusManager guard spans Base UI injects\n // when open, so they aren't siblings of the Hanger in parent IntersectionObservers\n // (e.g. OverflowGroup's) and don't get counted as overflowed children.\n return (\n <HangerContext.Provider value={context}>\n <span {...otherProps} ref={combinedRef as React.Ref<HTMLSpanElement>}>\n <PopoverPrimitive.Root open={open} onOpenChange={handleOpenChange}>\n {/* Anchor via the `anchor` prop. */}\n {anchor}\n {/* Composition (<Hanger.Anchor>) and the popup Content (portaled out) come through {children}. */}\n {children}\n </PopoverPrimitive.Root>\n </span>\n </HangerContext.Provider>\n );\n}) as ForwardedHangerWithStatics;\nHanger.Anchor = Anchor;\nHanger.Content = Content;\nHanger.Title = Title;\n"],"names":["React","mergeRefs","useLocalization","PopoverPrimitive","UnstyledArrow","IconButton","Hanger"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAM,gBAAgBA,iBAAM,cAAkC;AAAA,EAC1D,WAAW,EAAE,SAAS,KAAK;AAAA,EAC3B,SAAS;AACb,CAAC;AAWD,MAAM,SAASA,iBAAM,WAA2C,SAAS,aAAa,OAAO,KAAK;AAC9F,MAAI,CAACA,iBAAM,eAAe,MAAM,QAAQ,GAAG;AAChC,WAAAA,iCAAA,cAAAA,iBAAA,UAAA,MAAG,MAAM,QAAS;AAAA,EAAA;AAE7B,QAAM,QAAQ,MAAM;AACb,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;AAoBM,MAAM,SAASL,iBAAM,WAAyC,SAASM,QAAO,OAAO,KAAK;AACvF,QAAA,EAAE,QAAQ,UAAU,cAAc,MAAM,SAAS,GAAG,eAAe;AACnE,QAAA,YAAYN,iBAAM,OAAoB,IAAI;AAChD,QAAM,cAAcC,UAAA,UAAU,CAAC,WAAyD,GAAG,CAAC;AACtF,QAAA,UAAUD,iBAAM,QAAQ,OAAO,EAAE,WAAW,QAAQ,IAAI,CAAC,OAAO,CAAC;AAGvE,QAAM,CAAC,MAAM,OAAO,IAAIA,iBAAM,SAAS,KAAK;AAC5CA,mBAAM,UAAU,MAAM;AAClB,QAAI,aAAa;AACb,cAAQ,WAAW;AAAA,IAAA;AAAA,EAE3B,GAAG,EAAE;AAGC,QAAA,mBAAmB,CAAC,UAAmB,iBAA2D;AACpG,QAAI,CAAC,aAAa,aAAa,WAAW,mBAAmB,aAAa,WAAW,cAAc;AAC/F,mBAAa,OAAO;AACpB;AAAA,IAAA;AAGJ,YAAQ,QAAQ;AAAA,EACpB;AAOI,SAAAA,iCAAA,cAAC,cAAc,UAAd,EAAuB,OAAO,QAC3B,GAAAA,iCAAA,cAAC,QAAM,EAAA,GAAG,YAAY,KAAK,eACtBA,iCAAA,cAAAG,QAAAA,QAAiB,MAAjB,EAAsB,MAAY,cAAc,iBAE5C,GAAA,QAEA,QACL,CACJ,CACJ;AAER,CAAC;AACD,OAAO,SAAS;AAChB,OAAO,UAAU;AACjB,OAAO,QAAQ;;;"}
1
+ {"version":3,"file":"Hanger.cjs","sources":["../../../src/components/Hanger/Hanger.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nimport { IconButton } from '../IconButton/IconButton';\nimport { Placement } from '../..';\nimport { UnstyledArrow } from './Arrow';\nimport { useLocalization } from '../Provider/Localization';\nimport { mergeRefs } from '../../utils/mergeRefs';\nimport './Hanger.css';\n\ntype HangerContextValue = {\n /** Handler called when hanger closes by user interaction */\n onClose?: () => void;\n props: Record<string, any>;\n ref: React.Ref<HTMLElement>;\n};\nconst HangerContext = React.createContext<HangerContextValue>({\n onClose: undefined,\n props: {},\n ref: null,\n});\n\nexport type HangerTexts = {\n /** Aria-label for the close icon button of hanger */\n close: string;\n};\n\nexport type HangerAnchorProps = React.HTMLAttributes<HTMLDivElement>;\nconst Anchor = React.forwardRef(function HangerAnchor(props: HangerAnchorProps, externalRef: React.Ref<HTMLDivElement>) {\n const { ref: parentRef, props: parentProps } = React.useContext(HangerContext);\n const refCallback = mergeRefs([parentRef, externalRef]);\n\n let children = props.children;\n\n if (React.isValidElement(props.children) && typeof props.children?.type === 'function') {\n // oxlint-disable-next-line no-console\n console.warn(\n `Hanger.Anchor requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '${props.children.type.name}' in React.forwardRef()? Taco has wrapped '${props.children.type.name}' in a 'span' to maintain functionality, but this may cause unintended behaviour`\n );\n children = <span>{props.children}</span>;\n }\n\n return (\n <PopoverPrimitive.Anchor {...parentProps} {...props} ref={refCallback} asChild>\n {children}\n </PopoverPrimitive.Anchor>\n );\n});\n\nexport type HangerTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function DialogTitle(props: HangerTitleProps, ref: React.Ref<HTMLHeadingElement>) {\n const className = cn('mb-1 text-base font-bold flex w-full', props.className);\n return <span {...props} className={className} ref={ref} />;\n});\n\nexport type HangerContentProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Set the position of the Hanger relative to its achor. Default value is `bottom` */\n placement?: Placement;\n hideWhenDetached?: boolean;\n container?: HTMLElement | null;\n};\n\nconst Content = React.forwardRef(function HangerContent(props: HangerContentProps, ref: React.Ref<HTMLDivElement>) {\n const { placement: side, hideWhenDetached = false, container } = props;\n const context = React.useContext(HangerContext);\n const { texts } = useLocalization();\n const className = cn(\n 'wcag-blue-500 border border-transparent rounded p-3 pr-12 yt-shadow focus:border-transparent max-w-sm print:hidden',\n props.className\n );\n const handleInteractOutside = (event: CustomEvent): void => {\n event.preventDefault();\n };\n\n return (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Content\n className={className}\n data-taco=\"hanger\"\n onInteractOutside={handleInteractOutside}\n side={side}\n sideOffset={1}\n ref={ref}\n hideWhenDetached={hideWhenDetached}>\n {props.children}\n <UnstyledArrow className=\"text-blue-500\" />\n <PopoverPrimitive.Close asChild>\n <IconButton\n appearance=\"primary\"\n aria-label={texts.hanger.close}\n className=\"absolute right-0 top-0 ml-2 mr-2 mt-2 text-white\"\n icon=\"close\"\n onClick={context.onClose}\n />\n </PopoverPrimitive.Close>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n );\n});\n\nexport type HangerProps = React.PropsWithChildren<{\n /** An anchor to be used for the hanger, should not be set if `children` already contains an anchor */\n anchor?: JSX.Element;\n /**\n * Shows or hides hanger depending on the value\n * @defaultValue true\n */\n defaultOpen?: boolean;\n /** Handler called when user closes the hanger */\n onClose?: () => void;\n}>;\n\nexport type ForwardedHangerWithStatics = React.ForwardRefExoticComponent<HangerProps & React.RefAttributes<HTMLElement>> & {\n Anchor: React.ForwardRefExoticComponent<HangerAnchorProps>;\n Content: React.ForwardRefExoticComponent<HangerContentProps>;\n Title: React.ForwardRefExoticComponent<HangerTitleProps>;\n};\n\nexport const Hanger = React.forwardRef<HTMLElement, HangerProps>(function Hanger(props, ref) {\n const { anchor, children, defaultOpen = true, onClose, ...otherProps } = props;\n const context = React.useMemo(() => ({ onClose, props: otherProps, ref }), [onClose, otherProps]);\n\n // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal\n const [open, setOpen] = React.useState(false);\n React.useEffect(() => {\n if (defaultOpen) {\n setOpen(defaultOpen);\n }\n }, []);\n\n return (\n <HangerContext.Provider value={context}>\n <PopoverPrimitive.Root key={String(open)} defaultOpen={open}>\n {anchor && <Anchor>{anchor}</Anchor>}\n {children}\n </PopoverPrimitive.Root>\n </HangerContext.Provider>\n );\n}) as ForwardedHangerWithStatics;\nHanger.Anchor = Anchor;\nHanger.Content = Content;\nHanger.Title = Title;\n"],"names":["React","mergeRefs","PopoverPrimitive","useLocalization","UnstyledArrow","IconButton","Hanger"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAM,gBAAgBA,iBAAM,cAAkC;AAAA,EAC1D,SAAS;AAAA,EACT,OAAO,CAAC;AAAA,EACR,KAAK;AACT,CAAC;AAQD,MAAM,SAASA,iBAAM,WAAW,SAAS,aAAa,OAA0B,aAAwC;;AAC9G,QAAA,EAAE,KAAK,WAAW,OAAO,gBAAgBA,iBAAM,WAAW,aAAa;AAC7E,QAAM,cAAcC,UAAA,UAAU,CAAC,WAAW,WAAW,CAAC;AAEtD,MAAI,WAAW,MAAM;AAEjB,MAAAD,iBAAM,eAAe,MAAM,QAAQ,KAAK,SAAO,WAAM,aAAN,mBAAgB,UAAS,YAAY;AAE5E,YAAA;AAAA,MACJ,kHAAkH,MAAM,SAAS,KAAK,IAAI,8CAA8C,MAAM,SAAS,KAAK,IAAI;AAAA,IACpN;AACW,eAAAA,iCAAA,cAAC,QAAM,MAAA,MAAM,QAAS;AAAA,EAAA;AAGrC,SACKA,iCAAA,cAAAE,4BAAiB,QAAjB,EAAyB,GAAG,aAAc,GAAG,OAAO,KAAK,aAAa,SAAO,KAAA,GACzE,QACL;AAER,CAAC;AAGM,MAAM,QAAQF,iBAAM,WAAW,SAAS,YAAY,OAAyB,KAAoC;AACpH,QAAM,YAAY,GAAG,wCAAwC,MAAM,SAAS;AAC5E,SAAQA,iCAAA,cAAA,QAAA,EAAM,GAAG,OAAO,WAAsB,KAAU;AAC5D,CAAC;AASD,MAAM,UAAUA,iBAAM,WAAW,SAAS,cAAc,OAA2B,KAAgC;AAC/G,QAAM,EAAE,WAAW,MAAM,mBAAmB,OAAO,cAAc;AAC3D,QAAA,UAAUA,iBAAM,WAAW,aAAa;AACxC,QAAA,EAAE,MAAM,IAAIG,6BAAgB;AAClC,QAAM,YAAY;AAAA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AAER,CAAC;AACD,OAAO,SAAS;AAChB,OAAO,UAAU;AACjB,OAAO,QAAQ;;;"}
@@ -4,7 +4,7 @@ export type HangerTexts = {
4
4
  /** Aria-label for the close icon button of hanger */
5
5
  close: string;
6
6
  };
7
- export type HangerAnchorProps = React.HTMLAttributes<HTMLElement>;
7
+ export type HangerAnchorProps = React.HTMLAttributes<HTMLDivElement>;
8
8
  export type HangerTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
9
9
  export declare const Title: React.ForwardRefExoticComponent<HangerTitleProps & React.RefAttributes<HTMLHeadingElement>>;
10
10
  export type HangerContentProps = React.HTMLAttributes<HTMLDivElement> & {
@@ -1,80 +1,79 @@
1
1
  import * as React from "react";
2
2
  import cn from "clsx";
3
- import { Popover } from "@base-ui/react/popover";
3
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
4
4
  import { IconButton } from "../IconButton/IconButton.js";
5
5
  import { UnstyledArrow } from "./Arrow.js";
6
6
  import { useLocalization } from "../Provider/Localization.js";
7
7
  import { mergeRefs } from "../../utils/mergeRefs.js";
8
8
  /* empty css */
9
9
  const HangerContext = React.createContext({
10
- anchorRef: { current: null },
11
- onClose: void 0
10
+ onClose: void 0,
11
+ props: {},
12
+ ref: null
12
13
  });
13
- const Anchor = React.forwardRef(function HangerAnchor(props, ref) {
14
- if (!React.isValidElement(props.children)) {
15
- return /* @__PURE__ */ React.createElement(React.Fragment, null, props.children);
14
+ const Anchor = React.forwardRef(function HangerAnchor(props, externalRef) {
15
+ var _a;
16
+ const { ref: parentRef, props: parentProps } = React.useContext(HangerContext);
17
+ const refCallback = mergeRefs([parentRef, externalRef]);
18
+ let children = props.children;
19
+ if (React.isValidElement(props.children) && typeof ((_a = props.children) == null ? void 0 : _a.type) === "function") {
20
+ console.warn(
21
+ `Hanger.Anchor requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '${props.children.type.name}' in React.forwardRef()? Taco has wrapped '${props.children.type.name}' in a 'span' to maintain functionality, but this may cause unintended behaviour`
22
+ );
23
+ children = /* @__PURE__ */ React.createElement("span", null, props.children);
16
24
  }
17
- const child = props.children;
18
- return React.cloneElement(child, {
19
- ref: child.ref ? mergeRefs([ref, child.ref]) : ref
20
- });
25
+ return /* @__PURE__ */ React.createElement(PopoverPrimitive.Anchor, { ...parentProps, ...props, ref: refCallback, asChild: true }, children);
21
26
  });
22
27
  const Title = React.forwardRef(function DialogTitle(props, ref) {
23
28
  const className = cn("mb-1 text-base font-bold flex w-full", props.className);
24
29
  return /* @__PURE__ */ React.createElement("span", { ...props, className, ref });
25
30
  });
26
31
  const Content = React.forwardRef(function HangerContent(props, ref) {
27
- const { placement: side, hideWhenDetached = false, container, ...popoverContentProps } = props;
32
+ const { placement: side, hideWhenDetached = false, container } = props;
28
33
  const context = React.useContext(HangerContext);
29
34
  const { texts } = useLocalization();
30
35
  const className = cn(
31
36
  "wcag-blue-500 border border-transparent rounded p-3 pr-12 yt-shadow focus:border-transparent max-w-sm print:hidden",
32
37
  props.className
33
38
  );
34
- return /* @__PURE__ */ React.createElement(Popover.Portal, { container }, /* @__PURE__ */ React.createElement(
35
- Popover.Positioner,
39
+ const handleInteractOutside = (event) => {
40
+ event.preventDefault();
41
+ };
42
+ return /* @__PURE__ */ React.createElement(PopoverPrimitive.Portal, { container }, /* @__PURE__ */ React.createElement(
43
+ PopoverPrimitive.Content,
36
44
  {
37
- anchor: context.anchorRef,
38
- className: hideWhenDetached ? "data-[anchor-hidden]:hidden" : void 0,
45
+ className,
46
+ "data-taco": "hanger",
47
+ onInteractOutside: handleInteractOutside,
39
48
  side,
40
- sideOffset: 11
49
+ sideOffset: 1,
50
+ ref,
51
+ hideWhenDetached
41
52
  },
42
- /* @__PURE__ */ React.createElement(Popover.Popup, { ...popoverContentProps, className, "data-taco": "hanger", ref }, props.children, /* @__PURE__ */ React.createElement(UnstyledArrow, { className: "text-blue-500" }), /* @__PURE__ */ React.createElement(
43
- Popover.Close,
53
+ props.children,
54
+ /* @__PURE__ */ React.createElement(UnstyledArrow, { className: "text-blue-500" }),
55
+ /* @__PURE__ */ React.createElement(PopoverPrimitive.Close, { asChild: true }, /* @__PURE__ */ React.createElement(
56
+ IconButton,
44
57
  {
45
- render: /* @__PURE__ */ React.createElement(
46
- IconButton,
47
- {
48
- appearance: "primary",
49
- "aria-label": texts.hanger.close,
50
- className: "absolute right-0 top-0 mx-2 mt-2 text-white",
51
- icon: "close",
52
- onClick: context.onClose
53
- }
54
- )
58
+ appearance: "primary",
59
+ "aria-label": texts.hanger.close,
60
+ className: "absolute right-0 top-0 ml-2 mr-2 mt-2 text-white",
61
+ icon: "close",
62
+ onClick: context.onClose
55
63
  }
56
64
  ))
57
65
  ));
58
66
  });
59
67
  const Hanger = React.forwardRef(function Hanger2(props, ref) {
60
68
  const { anchor, children, defaultOpen = true, onClose, ...otherProps } = props;
61
- const anchorRef = React.useRef(null);
62
- const combinedRef = mergeRefs([anchorRef, ref]);
63
- const context = React.useMemo(() => ({ anchorRef, onClose }), [onClose]);
69
+ const context = React.useMemo(() => ({ onClose, props: otherProps, ref }), [onClose, otherProps]);
64
70
  const [open, setOpen] = React.useState(false);
65
71
  React.useEffect(() => {
66
72
  if (defaultOpen) {
67
73
  setOpen(defaultOpen);
68
74
  }
69
75
  }, []);
70
- const handleOpenChange = (nextOpen, eventDetails) => {
71
- if (!nextOpen && (eventDetails.reason === "outside-press" || eventDetails.reason === "focus-out")) {
72
- eventDetails.cancel();
73
- return;
74
- }
75
- setOpen(nextOpen);
76
- };
77
- return /* @__PURE__ */ React.createElement(HangerContext.Provider, { value: context }, /* @__PURE__ */ React.createElement("span", { ...otherProps, ref: combinedRef }, /* @__PURE__ */ React.createElement(Popover.Root, { open, onOpenChange: handleOpenChange }, anchor, children)));
76
+ return /* @__PURE__ */ React.createElement(HangerContext.Provider, { value: context }, /* @__PURE__ */ React.createElement(PopoverPrimitive.Root, { key: String(open), defaultOpen: open }, anchor && /* @__PURE__ */ React.createElement(Anchor, null, anchor), children));
78
77
  });
79
78
  Hanger.Anchor = Anchor;
80
79
  Hanger.Content = Content;
@@ -1 +1 @@
1
- {"version":3,"file":"Hanger.js","sources":["../../../src/components/Hanger/Hanger.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport { Popover as PopoverPrimitive } from '@base-ui/react/popover';\n\nimport { IconButton } from '../IconButton/IconButton';\nimport { Placement } from '../..';\nimport { UnstyledArrow } from './Arrow';\nimport { useLocalization } from '../Provider/Localization';\nimport { mergeRefs } from '../../utils/mergeRefs';\nimport './Hanger.css';\n\ntype HangerContextValue = {\n /** Handler called when hanger closes by user interaction */\n onClose?: () => void;\n anchorRef: React.RefObject<HTMLElement>;\n};\nconst HangerContext = React.createContext<HangerContextValue>({\n anchorRef: { current: null },\n onClose: undefined,\n});\n\nexport type HangerTexts = {\n /** Aria-label for the close icon button of hanger */\n close: string;\n};\n\nexport type HangerAnchorProps = React.HTMLAttributes<HTMLElement>;\n// The surrounding Hanger root owns the single DOM wrapper that serves as the positioning anchor.\n// `Hanger.Anchor` is a passthrough that clones its child to forward the consumer's ref onto it,\n// preserving the legacy ref API without adding extra DOM (which would break OverflowGroup).\nconst Anchor = React.forwardRef<HTMLElement, HangerAnchorProps>(function HangerAnchor(props, ref) {\n if (!React.isValidElement(props.children)) {\n return <>{props.children}</>;\n }\n const child = props.children as React.ReactElement & { ref?: React.Ref<HTMLElement> };\n return React.cloneElement(child, {\n ref: child.ref ? mergeRefs([ref, child.ref]) : ref,\n });\n});\n\nexport type HangerTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function DialogTitle(props: HangerTitleProps, ref: React.Ref<HTMLHeadingElement>) {\n const className = cn('mb-1 text-base font-bold flex w-full', props.className);\n return <span {...props} className={className} ref={ref} />;\n});\n\nexport type HangerContentProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Set the position of the Hanger relative to its achor. Default value is `bottom` */\n placement?: Placement;\n hideWhenDetached?: boolean;\n container?: HTMLElement | null;\n};\n\nconst Content = React.forwardRef(function HangerContent(props: HangerContentProps, ref: React.Ref<HTMLDivElement>) {\n const { placement: side, hideWhenDetached = false, container, ...popoverContentProps } = props;\n const context = React.useContext(HangerContext);\n const { texts } = useLocalization();\n const className = cn(\n 'wcag-blue-500 border border-transparent rounded p-3 pr-12 yt-shadow focus:border-transparent max-w-sm print:hidden',\n props.className\n );\n\n return (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Positioner\n anchor={context.anchorRef}\n className={hideWhenDetached ? 'data-[anchor-hidden]:hidden' : undefined}\n side={side}\n sideOffset={11}>\n <PopoverPrimitive.Popup {...popoverContentProps} className={className} data-taco=\"hanger\" ref={ref}>\n {props.children}\n <UnstyledArrow className=\"text-blue-500\" />\n <PopoverPrimitive.Close\n render={\n <IconButton\n appearance=\"primary\"\n aria-label={texts.hanger.close}\n className=\"absolute right-0 top-0 mx-2 mt-2 text-white\"\n icon=\"close\"\n onClick={context.onClose}\n />\n }\n />\n </PopoverPrimitive.Popup>\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n );\n});\n\nexport type HangerProps = React.PropsWithChildren<{\n /** An anchor to be used for the hanger, should not be set if `children` already contains an anchor */\n anchor?: JSX.Element;\n /**\n * Shows or hides hanger depending on the value\n * @defaultValue true\n */\n defaultOpen?: boolean;\n /** Handler called when user closes the hanger */\n onClose?: () => void;\n}>;\n\nexport type ForwardedHangerWithStatics = React.ForwardRefExoticComponent<HangerProps & React.RefAttributes<HTMLElement>> & {\n Anchor: React.ForwardRefExoticComponent<HangerAnchorProps>;\n Content: React.ForwardRefExoticComponent<HangerContentProps>;\n Title: React.ForwardRefExoticComponent<HangerTitleProps>;\n};\n\nexport const Hanger = React.forwardRef<HTMLSpanElement, HangerProps>(function Hanger(props, ref) {\n const { anchor, children, defaultOpen = true, onClose, ...otherProps } = props;\n const anchorRef = React.useRef<HTMLElement>(null);\n const combinedRef = mergeRefs([anchorRef as React.MutableRefObject<HTMLElement | null>, ref]);\n const context = React.useMemo(() => ({ anchorRef, onClose }), [onClose]);\n\n // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal\n const [open, setOpen] = React.useState(false);\n React.useEffect(() => {\n if (defaultOpen) {\n setOpen(defaultOpen);\n }\n }, []);\n\n // Hanger should only close from its close button, matching the previous Radix onInteractOutside behavior.\n const handleOpenChange = (nextOpen: boolean, eventDetails: PopoverPrimitive.Root.ChangeEventDetails) => {\n if (!nextOpen && (eventDetails.reason === 'outside-press' || eventDetails.reason === 'focus-out')) {\n eventDetails.cancel();\n return;\n }\n\n setOpen(nextOpen);\n };\n\n // Single inline <span> wrapper: serves as the Floating UI anchor (its rect matches the\n // in-flow trigger child) and contains the FloatingFocusManager guard spans Base UI injects\n // when open, so they aren't siblings of the Hanger in parent IntersectionObservers\n // (e.g. OverflowGroup's) and don't get counted as overflowed children.\n return (\n <HangerContext.Provider value={context}>\n <span {...otherProps} ref={combinedRef as React.Ref<HTMLSpanElement>}>\n <PopoverPrimitive.Root open={open} onOpenChange={handleOpenChange}>\n {/* Anchor via the `anchor` prop. */}\n {anchor}\n {/* Composition (<Hanger.Anchor>) and the popup Content (portaled out) come through {children}. */}\n {children}\n </PopoverPrimitive.Root>\n </span>\n </HangerContext.Provider>\n );\n}) as ForwardedHangerWithStatics;\nHanger.Anchor = Anchor;\nHanger.Content = Content;\nHanger.Title = Title;\n"],"names":["PopoverPrimitive","Hanger"],"mappings":";;;;;;;;AAgBA,MAAM,gBAAgB,MAAM,cAAkC;AAAA,EAC1D,WAAW,EAAE,SAAS,KAAK;AAAA,EAC3B,SAAS;AACb,CAAC;AAWD,MAAM,SAAS,MAAM,WAA2C,SAAS,aAAa,OAAO,KAAK;AAC9F,MAAI,CAAC,MAAM,eAAe,MAAM,QAAQ,GAAG;AAChC,WAAA,sBAAA,cAAA,MAAA,UAAA,MAAG,MAAM,QAAS;AAAA,EAAA;AAE7B,QAAM,QAAQ,MAAM;AACb,SAAA,MAAM,aAAa,OAAO;AAAA,IAC7B,KAAK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S,GAAG,eAAe;AACnE,QAAA,YAAY,MAAM,OAAoB,IAAI;AAChD,QAAM,cAAc,UAAU,CAAC,WAAyD,GAAG,CAAC;AACtF,QAAA,UAAU,MAAM,QAAQ,OAAO,EAAE,WAAW,QAAQ,IAAI,CAAC,OAAO,CAAC;AAGvE,QAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAS,KAAK;AAC5C,QAAM,UAAU,MAAM;AAClB,QAAI,aAAa;AACb,cAAQ,WAAW;AAAA,IAAA;AAAA,EAE3B,GAAG,EAAE;AAGC,QAAA,mBAAmB,CAAC,UAAmB,iBAA2D;AACpG,QAAI,CAAC,aAAa,aAAa,WAAW,mBAAmB,aAAa,WAAW,cAAc;AAC/F,mBAAa,OAAO;AACpB;AAAA,IAAA;AAGJ,YAAQ,QAAQ;AAAA,EACpB;AAOI,SAAA,sBAAA,cAAC,cAAc,UAAd,EAAuB,OAAO,QAC3B,GAAA,sBAAA,cAAC,QAAM,EAAA,GAAG,YAAY,KAAK,eACtB,sBAAA,cAAAD,QAAiB,MAAjB,EAAsB,MAAY,cAAc,iBAE5C,GAAA,QAEA,QACL,CACJ,CACJ;AAER,CAAC;AACD,OAAO,SAAS;AAChB,OAAO,UAAU;AACjB,OAAO,QAAQ;"}
1
+ {"version":3,"file":"Hanger.js","sources":["../../../src/components/Hanger/Hanger.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nimport { IconButton } from '../IconButton/IconButton';\nimport { Placement } from '../..';\nimport { UnstyledArrow } from './Arrow';\nimport { useLocalization } from '../Provider/Localization';\nimport { mergeRefs } from '../../utils/mergeRefs';\nimport './Hanger.css';\n\ntype HangerContextValue = {\n /** Handler called when hanger closes by user interaction */\n onClose?: () => void;\n props: Record<string, any>;\n ref: React.Ref<HTMLElement>;\n};\nconst HangerContext = React.createContext<HangerContextValue>({\n onClose: undefined,\n props: {},\n ref: null,\n});\n\nexport type HangerTexts = {\n /** Aria-label for the close icon button of hanger */\n close: string;\n};\n\nexport type HangerAnchorProps = React.HTMLAttributes<HTMLDivElement>;\nconst Anchor = React.forwardRef(function HangerAnchor(props: HangerAnchorProps, externalRef: React.Ref<HTMLDivElement>) {\n const { ref: parentRef, props: parentProps } = React.useContext(HangerContext);\n const refCallback = mergeRefs([parentRef, externalRef]);\n\n let children = props.children;\n\n if (React.isValidElement(props.children) && typeof props.children?.type === 'function') {\n // oxlint-disable-next-line no-console\n console.warn(\n `Hanger.Anchor requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '${props.children.type.name}' in React.forwardRef()? Taco has wrapped '${props.children.type.name}' in a 'span' to maintain functionality, but this may cause unintended behaviour`\n );\n children = <span>{props.children}</span>;\n }\n\n return (\n <PopoverPrimitive.Anchor {...parentProps} {...props} ref={refCallback} asChild>\n {children}\n </PopoverPrimitive.Anchor>\n );\n});\n\nexport type HangerTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function DialogTitle(props: HangerTitleProps, ref: React.Ref<HTMLHeadingElement>) {\n const className = cn('mb-1 text-base font-bold flex w-full', props.className);\n return <span {...props} className={className} ref={ref} />;\n});\n\nexport type HangerContentProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Set the position of the Hanger relative to its achor. Default value is `bottom` */\n placement?: Placement;\n hideWhenDetached?: boolean;\n container?: HTMLElement | null;\n};\n\nconst Content = React.forwardRef(function HangerContent(props: HangerContentProps, ref: React.Ref<HTMLDivElement>) {\n const { placement: side, hideWhenDetached = false, container } = props;\n const context = React.useContext(HangerContext);\n const { texts } = useLocalization();\n const className = cn(\n 'wcag-blue-500 border border-transparent rounded p-3 pr-12 yt-shadow focus:border-transparent max-w-sm print:hidden',\n props.className\n );\n const handleInteractOutside = (event: CustomEvent): void => {\n event.preventDefault();\n };\n\n return (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Content\n className={className}\n data-taco=\"hanger\"\n onInteractOutside={handleInteractOutside}\n side={side}\n sideOffset={1}\n ref={ref}\n hideWhenDetached={hideWhenDetached}>\n {props.children}\n <UnstyledArrow className=\"text-blue-500\" />\n <PopoverPrimitive.Close asChild>\n <IconButton\n appearance=\"primary\"\n aria-label={texts.hanger.close}\n className=\"absolute right-0 top-0 ml-2 mr-2 mt-2 text-white\"\n icon=\"close\"\n onClick={context.onClose}\n />\n </PopoverPrimitive.Close>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n );\n});\n\nexport type HangerProps = React.PropsWithChildren<{\n /** An anchor to be used for the hanger, should not be set if `children` already contains an anchor */\n anchor?: JSX.Element;\n /**\n * Shows or hides hanger depending on the value\n * @defaultValue true\n */\n defaultOpen?: boolean;\n /** Handler called when user closes the hanger */\n onClose?: () => void;\n}>;\n\nexport type ForwardedHangerWithStatics = React.ForwardRefExoticComponent<HangerProps & React.RefAttributes<HTMLElement>> & {\n Anchor: React.ForwardRefExoticComponent<HangerAnchorProps>;\n Content: React.ForwardRefExoticComponent<HangerContentProps>;\n Title: React.ForwardRefExoticComponent<HangerTitleProps>;\n};\n\nexport const Hanger = React.forwardRef<HTMLElement, HangerProps>(function Hanger(props, ref) {\n const { anchor, children, defaultOpen = true, onClose, ...otherProps } = props;\n const context = React.useMemo(() => ({ onClose, props: otherProps, ref }), [onClose, otherProps]);\n\n // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal\n const [open, setOpen] = React.useState(false);\n React.useEffect(() => {\n if (defaultOpen) {\n setOpen(defaultOpen);\n }\n }, []);\n\n return (\n <HangerContext.Provider value={context}>\n <PopoverPrimitive.Root key={String(open)} defaultOpen={open}>\n {anchor && <Anchor>{anchor}</Anchor>}\n {children}\n </PopoverPrimitive.Root>\n </HangerContext.Provider>\n );\n}) as ForwardedHangerWithStatics;\nHanger.Anchor = Anchor;\nHanger.Content = Content;\nHanger.Title = Title;\n"],"names":["Hanger"],"mappings":";;;;;;;;AAiBA,MAAM,gBAAgB,MAAM,cAAkC;AAAA,EAC1D,SAAS;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BAAmB;AAAA,MACnB;AAAA,MACA,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,IAAA;AAAA,IACC,MAAM;AAAA,IACP,sBAAA,cAAC,eAAc,EAAA,WAAU,gBAAgB,CAAA;AAAA,IACxC,sBAAA,cAAA,iBAAiB,OAAjB,EAAuB,SAAO,KAC3B,GAAA,sBAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,YAAW;AAAA,QACX,cAAY,MAAM,OAAO;AAAA,QACzB,WAAU;AAAA,QACV,MAAK;AAAA,QACL,SAAS,QAAQ;AAAA,MAAA;AAAA,IAEzB,CAAA;AAAA,EAAA,CAER;AAER,CAAC;AAoBM,MAAM,SAAS,MAAM,WAAqC,SAASA,QAAO,OAAO,KAAK;AACnF,QAAA,EAAE,QAAQ,UAAU,cAAc,MAAM,SAAS,GAAG,eAAe;AACzE,QAAM,UAAU,MAAM,QAAQ,OAAO,EAAE,SAAS,OAAO,YAAY,IAAI,IAAI,CAAC,SAAS,UAAU,CAAC;AAGhG,QAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAS,KAAK;AAC5C,QAAM,UAAU,MAAM;AAClB,QAAI,aAAa;AACb,cAAQ,WAAW;AAAA,IAAA;AAAA,EAE3B,GAAG,EAAE;AAGD,SAAA,sBAAA,cAAC,cAAc,UAAd,EAAuB,OAAO,QAC3B,GAAA,sBAAA,cAAC,iBAAiB,MAAjB,EAAsB,KAAK,OAAO,IAAI,GAAG,aAAa,KAClD,GAAA,8CAAW,QAAQ,MAAA,MAAO,GAC1B,QACL,CACJ;AAER,CAAC;AACD,OAAO,SAAS;AAChB,OAAO,UAAU;AACjB,OAAO,QAAQ;"}
@@ -39,7 +39,7 @@ const Sidebar = React.forwardRef(function LayoutSidebar(props, ref) {
39
39
  // this prevents awkward animation in the edge case (resizing the browser, instead of starting at a given size)
40
40
  invisible: isSmallScreen && !ready,
41
41
  "transition-[transform] duration-300 visible": isSmallScreen && ready,
42
- "border-r-2 border-black-subtle ": !showBackdrop
42
+ "border-r-2 border-gray-100 ": !showBackdrop
43
43
  },
44
44
  props.className
45
45
  );