@bonprix-ds/react-feature-hint 1.1.0 → 1.1.1

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.
package/dist/index.js CHANGED
@@ -1,2 +1 @@
1
- import e from "./src/FeatureHint.js";
2
- export { e as default };
1
+ export { default } from "./src/FeatureHint.js";
@@ -2,7 +2,7 @@ import e from "./FeatureHintRoot.js";
2
2
  import "react";
3
3
  import { CloserIcon as t } from "@bonprix-ds/react-icon/icons";
4
4
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
- //#region src/FeatureHint.tsx
5
+ // src/FeatureHint.tsx
6
6
  var i = ({ children: e }) => /* @__PURE__ */ n("div", {
7
7
  className: "w-fit",
8
8
  "data-bpds-feature-hint-trigger": !0,
@@ -30,7 +30,6 @@ var i = ({ children: e }) => /* @__PURE__ */ n("div", {
30
30
  children: e
31
31
  }), c = (t) => /* @__PURE__ */ n(e, { ...t });
32
32
  c.displayName = "FeatureHint", c.Trigger = i, i.displayName = "FeatureHint.Trigger", c.Content = a, a.displayName = "FeatureHint.Content", c.Headline = o, o.displayName = "FeatureHint.Headline", c.Subline = s, s.displayName = "FeatureHint.Subline";
33
- //#endregion
34
33
  export { c as default };
35
34
 
36
35
  //# sourceMappingURL=FeatureHint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureHint.js","names":["FeatureHintRoot","Trigger","Content","CloserIcon","Headline","Subline","FeatureHint","props"],"sources":["../../src/FeatureHint.tsx"],"sourcesContent":["import React, { type ReactNode } from \"react\";\n\nimport { CloserIcon } from \"@bonprix-ds/react-icon/icons\";\n\nimport FeatureHintRoot, { type Props } from \"./FeatureHintRoot\";\n\nexport type { Props };\n\nexport interface TriggerProps {\n /** The element the popup is anchored to. */\n children: ReactNode;\n}\n\nexport interface ContentProps {\n /** FeatureHint.Headline and FeatureHint.Subline. */\n children: ReactNode;\n}\n\nexport interface HeadlineProps {\n /** The headline to display in the popup. */\n children: ReactNode;\n}\n\nexport interface SublineProps {\n /** The text to display below the headline of the popup. */\n children: ReactNode;\n}\n\nconst Trigger = ({ children }: TriggerProps) => (\n <div className=\"w-fit\" data-bpds-feature-hint-trigger>\n {children}\n </div>\n);\n\nconst Content = ({ children }: ContentProps) => (\n <div data-bpds-feature-hint-popup>\n <div data-bpds-feature-hint-content>{children}</div>\n <button type=\"button\" data-bpds-feature-hint-close-button aria-label=\"Schließen\">\n <CloserIcon className=\"h-4 w-4 fill-current\" />\n </button>\n <div data-bpds-feature-hint-arrow />\n </div>\n);\n\nconst Headline = ({ children }: HeadlineProps) => <div data-bpds-feature-hint-headline>{children}</div>;\n\nconst Subline = ({ children }: SublineProps) => <div data-bpds-feature-hint-subline>{children}</div>;\n\n// No \"use client\" here on purpose: a Server Component cannot read `FeatureHint.Trigger` off a client\n// module, so the properties have to be attached in a module the server itself evaluates.\nconst FeatureHint = (props: Props) => <FeatureHintRoot {...props} />;\n\nFeatureHint.displayName = \"FeatureHint\";\n\nFeatureHint.Trigger = Trigger;\nTrigger.displayName = \"FeatureHint.Trigger\";\n\nFeatureHint.Content = Content;\nContent.displayName = \"FeatureHint.Content\";\n\nFeatureHint.Headline = Headline;\nHeadline.displayName = \"FeatureHint.Headline\";\n\nFeatureHint.Subline = Subline;\nSubline.displayName = \"FeatureHint.Subline\";\n\nexport default FeatureHint;\n"],"mappings":";;;;;AA4BA,IAAMC,KAAW,EAAE,kBACjB,kBAAC,OAAD;CAAK,WAAU;CAAQ,kCAAA;CACpB;AACE,CAAA,GAGDC,KAAW,EAAE,kBACjB,kBAAC,OAAD;CAAK,gCAAA;CAAL,UAAA;EACE,kBAAC,OAAD;GAAK,kCAAA;GAAgC;EAAc,CAAA;EACnD,kBAAC,UAAD;GAAQ,MAAK;GAAS,uCAAA;GAAoC,cAAW;GACnE,UAAA,kBAACC,GAAD,EAAY,WAAU,uBAAwB,CAAA;EACxC,CAAA;EACR,kBAAC,OAAD,EAAK,gCAAA,GAA8B,CAAA;CAChC;IAGDC,KAAY,EAAE,kBAA8B,kBAAC,OAAD;CAAK,mCAAA;CAAiC;AAAc,CAAA,GAEhGC,KAAW,EAAE,kBAA6B,kBAAC,OAAD;CAAK,kCAAA;CAAgC;AAAc,CAAA,GAI7FC,KAAe,MAAiB,kBAACN,GAAD,EAAiB,GAAIO,EAAQ,CAAA;AAEnE,EAAY,cAAc,eAE1B,EAAY,UAAUN,GACtB,EAAQ,cAAc,uBAEtB,EAAY,UAAUC,GACtB,EAAQ,cAAc,uBAEtB,EAAY,WAAWE,GACvB,EAAS,cAAc,wBAEvB,EAAY,UAAUC,GACtB,EAAQ,cAAc"}
1
+ {"version":3,"file":"FeatureHint.js","names":["FeatureHintRoot","Trigger","Content","CloserIcon","Headline","Subline","FeatureHint","props"],"sources":["../../src/FeatureHint.tsx"],"sourcesContent":["import React, { type ReactNode } from \"react\";\n\nimport { CloserIcon } from \"@bonprix-ds/react-icon/icons\";\n\nimport FeatureHintRoot, { type Props } from \"./FeatureHintRoot\";\n\nexport type { Props };\n\nexport interface TriggerProps {\n /** The element the popup is anchored to. */\n children: ReactNode;\n}\n\nexport interface ContentProps {\n /** FeatureHint.Headline and FeatureHint.Subline. */\n children: ReactNode;\n}\n\nexport interface HeadlineProps {\n /** The headline to display in the popup. */\n children: ReactNode;\n}\n\nexport interface SublineProps {\n /** The text to display below the headline of the popup. */\n children: ReactNode;\n}\n\nconst Trigger = ({ children }: TriggerProps) => (\n <div className=\"w-fit\" data-bpds-feature-hint-trigger>\n {children}\n </div>\n);\n\nconst Content = ({ children }: ContentProps) => (\n <div data-bpds-feature-hint-popup>\n <div data-bpds-feature-hint-content>{children}</div>\n <button type=\"button\" data-bpds-feature-hint-close-button aria-label=\"Schließen\">\n <CloserIcon className=\"h-4 w-4 fill-current\" />\n </button>\n <div data-bpds-feature-hint-arrow />\n </div>\n);\n\nconst Headline = ({ children }: HeadlineProps) => <div data-bpds-feature-hint-headline>{children}</div>;\n\nconst Subline = ({ children }: SublineProps) => <div data-bpds-feature-hint-subline>{children}</div>;\n\n// No \"use client\" here on purpose: a Server Component cannot read `FeatureHint.Trigger` off a client\n// module, so the properties have to be attached in a module the server itself evaluates.\nconst FeatureHint = (props: Props) => <FeatureHintRoot {...props} />;\n\nFeatureHint.displayName = \"FeatureHint\";\n\nFeatureHint.Trigger = Trigger;\nTrigger.displayName = \"FeatureHint.Trigger\";\n\nFeatureHint.Content = Content;\nContent.displayName = \"FeatureHint.Content\";\n\nFeatureHint.Headline = Headline;\nHeadline.displayName = \"FeatureHint.Headline\";\n\nFeatureHint.Subline = Subline;\nSubline.displayName = \"FeatureHint.Subline\";\n\nexport default FeatureHint;\n"],"mappings":";;;;;AA4BA,IAAMC,KAAW,EAAE,kBACjB,kBAAC,OAAD;CAAK,WAAU;CAAQ,kCAAA;CACpB;AACE,CAAA,GAGDC,KAAW,EAAE,kBACjB,kBAAC,OAAD;CAAK,gCAAA;CAAL,UAAA;EACE,kBAAC,OAAD;GAAK,kCAAA;GAAgC;EAAc,CAAA;EACnD,kBAAC,UAAD;GAAQ,MAAK;GAAS,uCAAA;GAAoC,cAAW;GACnE,UAAA,kBAACC,GAAD,EAAY,WAAU,uBAAwB,CAAA;EACxC,CAAA;EACR,kBAAC,OAAD,EAAK,gCAAA,GAA8B,CAAA;CAChC;A,IAGDC,KAAY,EAAE,kBAA8B,kBAAC,OAAD;CAAK,mCAAA;CAAiC;AAAc,CAAA,GAEhGC,KAAW,EAAE,kBAA6B,kBAAC,OAAD;CAAK,kCAAA;CAAgC;AAAc,CAAA,GAI7FC,KAAe,MAAiB,kBAACN,GAAD,EAAiB,GAAIO,EAAQ,CAAA;AAEnE,EAAY,cAAc,eAE1B,EAAY,UAAUN,GACtB,EAAQ,cAAc,uBAEtB,EAAY,UAAUC,GACtB,EAAQ,cAAc,uBAEtB,EAAY,WAAWE,GACvB,EAAS,cAAc,wBAEvB,EAAY,UAAUC,GACtB,EAAQ,cAAc"}
@@ -3,7 +3,7 @@ import { useRef as e } from "react";
3
3
  import { useEventListener as t } from "@bonprix-ds/utils";
4
4
  import "#styles";
5
5
  import { jsx as n } from "react/jsx-runtime";
6
- //#region src/FeatureHintRoot.tsx
6
+ // src/FeatureHintRoot.tsx
7
7
  typeof window < "u" && import("@bonprix-ds/bpds-feature-hint").then(({ FeatureHint: e }) => {
8
8
  customElements.get("bpds-feature-hint") || customElements.define("bpds-feature-hint", e);
9
9
  });
@@ -17,7 +17,6 @@ var r = ({ children: r, verticalPosition: i, horizontalPosition: a, onClose: o }
17
17
  children: r
18
18
  });
19
19
  };
20
- //#endregion
21
20
  export { r as default };
22
21
 
23
22
  //# sourceMappingURL=FeatureHintRoot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureHintRoot.js","names":["FeatureHintElement","FeatureHintRoot","ref","useRef","useEventListener","onClose","horizontalPosition","verticalPosition"],"sources":["../../src/FeatureHintRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { useRef, type ReactNode } from \"react\";\n\nimport type { FeatureHintProps } from \"@bonprix-ds/bpds-feature-hint\";\nimport { useEventListener } from \"@bonprix-ds/utils\";\nimport \"@bonprix-ds/bpds-feature-hint/feature-hint.css\";\n\n// The element class is loaded lazily and only in the browser: `class X extends HTMLElement` is\n// evaluated at module scope, and `HTMLElement` does not exist in Node, so a static import would\n// throw while the server renders this component. It also keeps `@floating-ui/dom` out of the server\n// bundle. FeatureHint.Content renders the whole popup, so the upgrade only positions it and wires up\n// the close button.\n// The registry check has to sit inside the callback, not beside the window guard: the tag can be\n// registered during the await - `defineCustomElements` from the umbrella does exactly that - and\n// `define` throws `NotSupportedError` on a name that is already taken.\nif (typeof window !== \"undefined\") {\n void import(\"@bonprix-ds/bpds-feature-hint\").then(({ FeatureHint: FeatureHintElement }) => {\n if (!customElements.get(\"bpds-feature-hint\")) customElements.define(\"bpds-feature-hint\", FeatureHintElement);\n });\n}\n\nexport interface Props {\n /** Preferred horizontal position of the popup. */\n horizontalPosition?: FeatureHintProps[\"horizontal-position\"];\n /** Preferred vertical position of the popup. */\n verticalPosition?: FeatureHintProps[\"vertical-position\"];\n /** FeatureHint.Trigger and FeatureHint.Content, which holds FeatureHint.Headline and FeatureHint.Subline. */\n children: ReactNode;\n /** Callback that gets called right before the popup is closed. */\n onClose?: () => void;\n}\n\nconst FeatureHintRoot = ({ children, verticalPosition, horizontalPosition, onClose }: Props) => {\n const ref = useRef<HTMLElement>(null);\n\n useEventListener(ref, \"bpds-feature-hint-close\", onClose);\n\n return (\n <bpds-feature-hint ref={ref} horizontal-position={horizontalPosition} vertical-position={verticalPosition} className=\"preflight\">\n {children}\n </bpds-feature-hint>\n );\n};\n\nexport default FeatureHintRoot;\n"],"mappings":";;;;;;AAgBI,OAAO,SAAW,OACpB,OAAY,gCAAgC,CAAC,MAAM,EAAE,aAAaA,QAAyB;CACzF,AAAK,eAAe,IAAI,mBAAmB,KAAG,eAAe,OAAO,qBAAqBA,CAAkB;AAC7G,CAAC;AAcH,IAAMC,KAAmB,EAAE,aAAU,qBAAkB,uBAAoB,iBAAqB;CAC9F,IAAMC,IAAMC,EAAoB,IAAI;CAIpC,OAFAC,EAAiBF,GAAK,2BAA2BG,CAAO,GAGtD,kBAAC,qBAAD;EAAwB;EAAK,uBAAqBC;EAAoB,qBAAmBC;EAAkB,WAAU;EAClH;CACgB,CAAA;AAEvB"}
1
+ {"version":3,"file":"FeatureHintRoot.js","names":["FeatureHintElement","FeatureHintRoot","ref","useRef","useEventListener","onClose","horizontalPosition","verticalPosition"],"sources":["../../src/FeatureHintRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { useRef, type ReactNode } from \"react\";\n\nimport type { FeatureHintProps } from \"@bonprix-ds/bpds-feature-hint\";\nimport { useEventListener } from \"@bonprix-ds/utils\";\nimport \"@bonprix-ds/bpds-feature-hint/feature-hint.css\";\n\n// The element class is loaded lazily and only in the browser: a static import would bundle it with\n// this module and register the tag before React hydrates the markup. It also keeps `@floating-ui/dom`\n// out of the server bundle. FeatureHint.Content renders the whole popup, so the upgrade only positions\n// it and wires up the close button.\n// The registry check has to sit inside the callback, not beside the window guard: the tag can be\n// registered during the await - `defineCustomElements` from the umbrella does exactly that - and\n// `define` throws `NotSupportedError` on a name that is already taken.\nif (typeof window !== \"undefined\") {\n void import(\"@bonprix-ds/bpds-feature-hint\").then(({ FeatureHint: FeatureHintElement }) => {\n if (!customElements.get(\"bpds-feature-hint\")) customElements.define(\"bpds-feature-hint\", FeatureHintElement);\n });\n}\n\nexport interface Props {\n /** Preferred horizontal position of the popup. */\n horizontalPosition?: FeatureHintProps[\"horizontal-position\"];\n /** Preferred vertical position of the popup. */\n verticalPosition?: FeatureHintProps[\"vertical-position\"];\n /** FeatureHint.Trigger and FeatureHint.Content, which holds FeatureHint.Headline and FeatureHint.Subline. */\n children: ReactNode;\n /** Callback that gets called right before the popup is closed. */\n onClose?: () => void;\n}\n\nconst FeatureHintRoot = ({ children, verticalPosition, horizontalPosition, onClose }: Props) => {\n const ref = useRef<HTMLElement>(null);\n\n useEventListener(ref, \"bpds-feature-hint-close\", onClose);\n\n return (\n <bpds-feature-hint ref={ref} horizontal-position={horizontalPosition} vertical-position={verticalPosition} className=\"preflight\">\n {children}\n </bpds-feature-hint>\n );\n};\n\nexport default FeatureHintRoot;\n"],"mappings":";;;;;;AAeI,OAAO,SAAW,OACpB,OAAY,gCAAgC,CAAC,MAAM,EAAE,aAAaA,QAAyB;CACzF,AAAK,eAAe,IAAI,mBAAmB,KAAG,eAAe,OAAO,qBAAqBA,CAAkB;AAC7G,CAAC;AAcH,IAAMC,KAAmB,EAAE,aAAU,qBAAkB,uBAAoB,iBAAqB;CAC9F,IAAMC,IAAMC,EAAoB,IAAI;CAIpC,OAFAC,EAAiBF,GAAK,2BAA2BG,CAAO,GAGtD,kBAAC,qBAAD;EAAwB;EAAK,uBAAqBC;EAAoB,qBAAmBC;EAAkB,WAAU;EAClH;CACgB,CAAA;AAEvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonprix-ds/react-feature-hint",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "FeatureHint component, implemented in React, for the Bonprix Design System.",
5
5
  "keywords": [],
6
6
  "license": "UNLICENSED",
@@ -41,17 +41,17 @@
41
41
  "provenance": true
42
42
  },
43
43
  "dependencies": {
44
- "@bonprix-ds/bpds-feature-hint": "1.1.0",
45
- "@bonprix-ds/react-icon": "1.3.2",
46
- "@bonprix-ds/utils": "0.5.0"
44
+ "@bonprix-ds/bpds-feature-hint": "1.1.1",
45
+ "@bonprix-ds/react-icon": "1.3.3",
46
+ "@bonprix-ds/utils": "0.6.0"
47
47
  },
48
48
  "devDependencies": {
49
+ "@bonprix-ds/vite-config": "0.0.0",
49
50
  "@testing-library/dom": "10.4.2",
50
51
  "@testing-library/react": "16.3.3",
51
52
  "@types/react": "19.3.0",
52
- "vite": "8.3.3",
53
- "vitest": "5.0.5",
54
- "@bonprix-ds/vite-config": "0.0.0"
53
+ "vite": "8.3.5",
54
+ "vitest": "5.0.5"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "react": "^19",