@bonprix-ds/react-feature-hint 1.0.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.
@@ -0,0 +1,59 @@
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
+ }
package/dist/index.js ADDED
@@ -0,0 +1,25 @@
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
@@ -0,0 +1 @@
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"}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@bonprix-ds/react-feature-hint",
3
+ "version": "1.0.0",
4
+ "description": "FeatureHint component, implemented in React, for the Bonprix Design System.",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public",
8
+ "provenance": true
9
+ },
10
+ "module": "./dist/index.js",
11
+ "sideEffects": false,
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.js"
17
+ }
18
+ },
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"
30
+ },
31
+ "dependencies": {
32
+ "@bonprix-ds/bpds-feature-hint": "1.0.0"
33
+ },
34
+ "peerDependencies": {
35
+ "react": "^19.0.0",
36
+ "react-dom": "^19.0.0"
37
+ },
38
+ "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"
45
+ },
46
+ "scripts": {
47
+ "build": "vite build"
48
+ }
49
+ }