@bonprix-ds/react-feature-hint 1.0.0 → 1.0.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.d.ts CHANGED
@@ -1,59 +1,3 @@
1
- import { default as default_2 } from 'react';
2
- import { FeatureHintProps as FeatureHintProps_2 } from '@bonprix-ds/bpds-feature-hint';
3
- import { ReactNode } from 'react';
4
-
5
- declare const FeatureHint: {
6
- ({ children, verticalPosition, horizontalPosition, onClose }: FeatureHintProps): default_2.JSX.Element;
7
- displayName: string;
8
- Trigger: {
9
- ({ children }: TriggerProps): default_2.JSX.Element;
10
- displayName: string;
11
- };
12
- Headline: {
13
- ({ children }: HeadlineProps): default_2.JSX.Element;
14
- displayName: string;
15
- };
16
- Subline: {
17
- ({ children }: SublineProps): default_2.JSX.Element;
18
- displayName: string;
19
- };
20
- };
21
- export default FeatureHint;
22
-
23
- export declare interface FeatureHintProps {
24
- /** Preferred horizontal position of the popup. */
25
- horizontalPosition?: FeatureHintProps_2["horizontal-position"];
26
- /** Preferred vertical position of the popup. */
27
- verticalPosition?: FeatureHintProps_2["vertical-position"];
28
- /** Needs to include FeatureHint.Trigger, FeatureHint.Headline and FeatureHint.Subline. */
29
- children: ReactNode;
30
- /** Callback that gets called right before the popup is closed. */
31
- onClose?: () => void;
32
- }
33
-
34
- declare interface HeadlineProps {
35
- /** The headline to display in the popup. */
36
- children: ReactNode;
37
- }
38
-
39
- declare interface SublineProps {
40
- /** The text to display below the headline of the popup. */
41
- children: ReactNode;
42
- }
43
-
44
- declare interface TriggerProps {
45
- /** The element the popup is anchored to. */
46
- children: ReactNode;
47
- }
48
-
49
- export { }
50
-
51
-
52
-
53
- declare module "react" {
54
- namespace JSX {
55
- interface IntrinsicElements {
56
- "bpds-feature-hint": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & FeatureHintProps, HTMLElement>;
57
- }
58
- }
59
- }
1
+ import "./src/jsx";
2
+ export { default } from "./src/FeatureHint";
3
+ export type { Props as FeatureHintProps, TriggerProps, HeadlineProps, SublineProps } from "./src/FeatureHint";
package/dist/index.js CHANGED
@@ -1,25 +1,2 @@
1
- import "react";
2
- import { jsx as e } from "react/jsx-runtime";
3
- //#region src/FeatureHint.tsx
4
- var t = ({ children: t, verticalPosition: n, horizontalPosition: r, onClose: i }) => /* @__PURE__ */ e("bpds-feature-hint", {
5
- "horizontal-position": r,
6
- "vertical-position": n,
7
- "onbpds-feature-hint-close": i,
8
- className: "preflight",
9
- children: t
10
- }), n = ({ children: t }) => /* @__PURE__ */ e("div", {
11
- className: "w-fit",
12
- "data-bpds-feature-hint-trigger": !0,
13
- children: t
14
- }), r = ({ children: t }) => /* @__PURE__ */ e("div", {
15
- "data-bpds-feature-hint-headline": !0,
16
- children: t
17
- }), i = ({ children: t }) => /* @__PURE__ */ e("div", {
18
- "data-bpds-feature-hint-subline": !0,
19
- children: t
20
- });
21
- t.displayName = "FeatureHint", t.Trigger = n, n.displayName = "FeatureHint.Trigger", t.Headline = r, r.displayName = "FeatureHint.Headline", t.Subline = i, i.displayName = "FeatureHint.Subline";
22
- //#endregion
23
- export { t as default };
24
-
25
- //# sourceMappingURL=index.js.map
1
+ import e from "./src/FeatureHint.js";
2
+ export { e as default };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,32 @@
1
+ import React, { type ReactNode } from "react";
2
+ import { type Props } from "./FeatureHintRoot";
3
+ export type { Props };
4
+ export interface TriggerProps {
5
+ /** The element the popup is anchored to. */
6
+ children: ReactNode;
7
+ }
8
+ export interface HeadlineProps {
9
+ /** The headline to display in the popup. */
10
+ children: ReactNode;
11
+ }
12
+ export interface SublineProps {
13
+ /** The text to display below the headline of the popup. */
14
+ children: ReactNode;
15
+ }
16
+ declare const FeatureHint: {
17
+ (props: Props): React.JSX.Element;
18
+ displayName: string;
19
+ Trigger: {
20
+ ({ children }: TriggerProps): React.JSX.Element;
21
+ displayName: string;
22
+ };
23
+ Headline: {
24
+ ({ children }: HeadlineProps): React.JSX.Element;
25
+ displayName: string;
26
+ };
27
+ Subline: {
28
+ ({ children }: SublineProps): React.JSX.Element;
29
+ displayName: string;
30
+ };
31
+ };
32
+ export default FeatureHint;
@@ -0,0 +1,20 @@
1
+ import e from "./FeatureHintRoot.js";
2
+ import "react";
3
+ import { jsx as t } from "react/jsx-runtime";
4
+ //#region src/FeatureHint.tsx
5
+ var n = ({ children: e }) => /* @__PURE__ */ t("div", {
6
+ className: "w-fit",
7
+ "data-bpds-feature-hint-trigger": !0,
8
+ children: e
9
+ }), r = ({ children: e }) => /* @__PURE__ */ t("div", {
10
+ "data-bpds-feature-hint-headline": !0,
11
+ children: e
12
+ }), i = ({ children: e }) => /* @__PURE__ */ t("div", {
13
+ "data-bpds-feature-hint-subline": !0,
14
+ children: e
15
+ }), a = (n) => /* @__PURE__ */ t(e, { ...n });
16
+ a.displayName = "FeatureHint", a.Trigger = n, n.displayName = "FeatureHint.Trigger", a.Headline = r, r.displayName = "FeatureHint.Headline", a.Subline = i, i.displayName = "FeatureHint.Subline";
17
+ //#endregion
18
+ export { a as default };
19
+
20
+ //# sourceMappingURL=FeatureHint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeatureHint.js","names":["FeatureHintRoot","Trigger","Headline","Subline","FeatureHint","props"],"sources":["../../src/FeatureHint.tsx"],"sourcesContent":["import React, { type ReactNode } from \"react\";\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 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 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.Headline = Headline;\nHeadline.displayName = \"FeatureHint.Headline\";\n\nFeatureHint.Subline = Subline;\nSubline.displayName = \"FeatureHint.Subline\";\n\nexport default FeatureHint;\n"],"mappings":";;;;AAqBA,IAAMC,KAAW,EAAE,kBACjB,kBAAC,OAAD;CAAK,WAAU;CAAQ,kCAAA;CACpB;AACE,CAAA,GAGDC,KAAY,EAAE,kBAA8B,kBAAC,OAAD;CAAK,mCAAA;CAAiC;AAAc,CAAA,GAEhGC,KAAW,EAAE,kBAA6B,kBAAC,OAAD;CAAK,kCAAA;CAAgC;AAAc,CAAA,GAI7FC,KAAe,MAAiB,kBAACJ,GAAD,EAAiB,GAAIK,EAAQ,CAAA;AAEnE,EAAY,cAAc,eAE1B,EAAY,UAAUJ,GACtB,EAAQ,cAAc,uBAEtB,EAAY,WAAWC,GACvB,EAAS,cAAc,wBAEvB,EAAY,UAAUC,GACtB,EAAQ,cAAc"}
@@ -0,0 +1,15 @@
1
+ import React, { type ReactNode } from "react";
2
+ import type { FeatureHintProps } from "@bonprix-ds/bpds-feature-hint";
3
+ import "@bonprix-ds/bpds-feature-hint/feature-hint.css";
4
+ export interface Props {
5
+ /** Preferred horizontal position of the popup. */
6
+ horizontalPosition?: FeatureHintProps["horizontal-position"];
7
+ /** Preferred vertical position of the popup. */
8
+ verticalPosition?: FeatureHintProps["vertical-position"];
9
+ /** Needs to include FeatureHint.Trigger, FeatureHint.Headline and FeatureHint.Subline. */
10
+ children: ReactNode;
11
+ /** Callback that gets called right before the popup is closed. */
12
+ onClose?: () => void;
13
+ }
14
+ declare const FeatureHintRoot: ({ children, verticalPosition, horizontalPosition, onClose }: Props) => React.JSX.Element;
15
+ export default FeatureHintRoot;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import "react";
3
+ import "#styles";
4
+ import { jsx as e } from "react/jsx-runtime";
5
+ //#region src/FeatureHintRoot.tsx
6
+ typeof window < "u" && import("@bonprix-ds/bpds-feature-hint").then(({ FeatureHint: e }) => {
7
+ customElements.get("bpds-feature-hint") || customElements.define("bpds-feature-hint", e);
8
+ });
9
+ var t = ({ children: t, verticalPosition: n, horizontalPosition: r, onClose: i }) => /* @__PURE__ */ e("bpds-feature-hint", {
10
+ "horizontal-position": r,
11
+ "vertical-position": n,
12
+ "onbpds-feature-hint-close": i,
13
+ className: "preflight",
14
+ children: t
15
+ });
16
+ //#endregion
17
+ export { t as default };
18
+
19
+ //# sourceMappingURL=FeatureHintRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeatureHintRoot.js","names":["FeatureHintElement","FeatureHintRoot","horizontalPosition","verticalPosition","onClose"],"sources":["../../src/FeatureHintRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { type ReactNode } from \"react\";\n\nimport type { FeatureHintProps } from \"@bonprix-ds/bpds-feature-hint\";\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 `lit` and `@floating-ui/dom` out of\n// the server bundle, and defers the popup markup the element injects until after hydration, which\n// is what keeps that injection from becoming a hydration mismatch.\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 /** Needs to include FeatureHint.Trigger, 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 return (\n <bpds-feature-hint\n horizontal-position={horizontalPosition}\n vertical-position={verticalPosition}\n onbpds-feature-hint-close={onClose}\n className=\"preflight\"\n >\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,iBAEvE,kBAAC,qBAAD;CACE,uBAAqBC;CACrB,qBAAmBC;CACnB,6BAA2BC;CAC3B,WAAU;CAET;AACgB,CAAA"}
@@ -0,0 +1,10 @@
1
+ export {};
2
+ declare module "react" {
3
+ namespace JSX {
4
+ interface IntrinsicElements {
5
+ "bpds-feature-hint": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & import("@bonprix-ds/bpds-feature-hint").FeatureHintProps & {
6
+ "onbpds-feature-hint-close"?: (event: import("@bonprix-ds/bpds-feature-hint").FeatureHintCustomEvents["bpds-feature-hint-close"]) => void;
7
+ }, HTMLElement>;
8
+ }
9
+ }
10
+ }
package/dist/styles.js ADDED
@@ -0,0 +1 @@
1
+ import "@bonprix-ds/bpds-feature-hint/feature-hint.css";
package/package.json CHANGED
@@ -1,14 +1,34 @@
1
1
  {
2
2
  "name": "@bonprix-ds/react-feature-hint",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "FeatureHint component, implemented in React, for the Bonprix Design System.",
5
- "type": "module",
6
- "publishConfig": {
7
- "access": "public",
8
- "provenance": true
5
+ "keywords": [],
6
+ "license": "UNLICENSED",
7
+ "author": "",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/bonprix/design-system.git",
11
+ "directory": "packages/react-wrappers/feature-hint"
9
12
  },
13
+ "files": [
14
+ "dist",
15
+ "!dist/tsconfig.tsbuildinfo",
16
+ "!dist/vite.config.d.ts",
17
+ "!dist/**/*.test.d.ts"
18
+ ],
19
+ "type": "module",
20
+ "sideEffects": [
21
+ "**/*.css",
22
+ "./dist/styles.js"
23
+ ],
10
24
  "module": "./dist/index.js",
11
- "sideEffects": false,
25
+ "types": "./dist/index.d.ts",
26
+ "imports": {
27
+ "#styles": {
28
+ "browser": "./dist/styles.js",
29
+ "default": "./dist/no-styles.js"
30
+ }
31
+ },
12
32
  "exports": {
13
33
  ".": {
14
34
  "import": "./dist/index.js",
@@ -16,32 +36,21 @@
16
36
  "default": "./dist/index.js"
17
37
  }
18
38
  },
19
- "types": "./dist/index.d.ts",
20
- "files": [
21
- "dist"
22
- ],
23
- "keywords": [],
24
- "author": "",
25
- "license": "UNLICENSED",
26
- "repository": {
27
- "type": "git",
28
- "url": "git+https://github.com/bonprix/design-system.git",
29
- "directory": "packages/react/feature-hint"
39
+ "publishConfig": {
40
+ "access": "public",
41
+ "provenance": true
30
42
  },
31
43
  "dependencies": {
32
- "@bonprix-ds/bpds-feature-hint": "1.0.0"
33
- },
34
- "peerDependencies": {
35
- "react": "^19.0.0",
36
- "react-dom": "^19.0.0"
44
+ "@bonprix-ds/bpds-feature-hint": "1.0.1"
37
45
  },
38
46
  "devDependencies": {
39
- "vite": "8.2.2",
40
- "@types/react": "19.2.18",
41
- "@vitejs/plugin-react": "6.1.1",
42
- "rollup-preserve-directives": "1.1.3",
43
- "unplugin-dts": "1.0.3",
44
- "@microsoft/api-extractor": "7.59.0"
47
+ "@types/react": "19.3.0",
48
+ "vite": "8.3.2",
49
+ "@bonprix-ds/vite-config": "0.0.0"
50
+ },
51
+ "peerDependencies": {
52
+ "react": "^19",
53
+ "react-dom": "^19"
45
54
  },
46
55
  "scripts": {
47
56
  "build": "vite build"
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/FeatureHint.tsx"],"sourcesContent":["import type { FeatureHintProps } from \"@bonprix-ds/bpds-feature-hint\";\nimport React, { ReactNode } from \"react\";\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 /** Needs to include FeatureHint.Trigger, 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 FeatureHint = ({ children, verticalPosition, horizontalPosition, onClose }: Props) => {\n return (\n <bpds-feature-hint\n horizontal-position={horizontalPosition}\n vertical-position={verticalPosition}\n onbpds-feature-hint-close={onClose}\n className=\"preflight\"\n >\n {children}\n </bpds-feature-hint>\n );\n};\n\ninterface TriggerProps {\n /** The element the popup is anchored to. */\n children: ReactNode;\n}\n\ninterface HeadlineProps {\n /** The headline to display in the popup. */\n children: ReactNode;\n}\n\ninterface 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 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\nFeatureHint.displayName = \"FeatureHint\";\n\nFeatureHint.Trigger = Trigger;\nTrigger.displayName = \"FeatureHint.Trigger\";\n\nFeatureHint.Headline = Headline;\nHeadline.displayName = \"FeatureHint.Headline\";\n\nFeatureHint.Subline = Subline;\nSubline.displayName = \"FeatureHint.Subline\";\n\nexport default FeatureHint;\n"],"mappings":";;;AAcA,IAAM,KAAe,EAAE,aAAU,qBAAkB,uBAAoB,iBAEnE,kBAAC,qBAAD;CACE,uBAAqB;CACrB,qBAAmB;CACnB,6BAA2B;CAC3B,WAAU;CAET;AACgB,CAAA,GAmBjB,KAAW,EAAE,kBACjB,kBAAC,OAAD;CAAK,WAAU;CAAQ,kCAAA;CACpB;AACE,CAAA,GAGD,KAAY,EAAE,kBAA8B,kBAAC,OAAD;CAAK,mCAAA;CAAiC;AAAc,CAAA,GAEhG,KAAW,EAAE,kBAA6B,kBAAC,OAAD;CAAK,kCAAA;CAAgC;AAAc,CAAA;AAEnG,EAAY,cAAc,eAE1B,EAAY,UAAU,GACtB,EAAQ,cAAc,uBAEtB,EAAY,WAAW,GACvB,EAAS,cAAc,wBAEvB,EAAY,UAAU,GACtB,EAAQ,cAAc"}