@bonprix-ds/react-button 1.1.0 → 1.1.2
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 +2 -32
- package/dist/index.js +2 -17
- package/dist/src/Button.d.ts +25 -0
- package/dist/src/Button.js +17 -0
- package/dist/src/Button.js.map +1 -0
- package/package.json +30 -30
- package/dist/index.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,32 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { default as default_2 } from 'react';
|
|
4
|
-
import { ElementType } from 'react';
|
|
5
|
-
import { IconOrElement } from '@bonprix-ds/react-icon';
|
|
6
|
-
|
|
7
|
-
declare interface BaseProps {
|
|
8
|
-
/** The visible content of the component. */
|
|
9
|
-
children: string;
|
|
10
|
-
/** If used, an icon will be additionally shown. The value is either a name of one icon from our icon set or an inline `<svg>` element. */
|
|
11
|
-
icon?: IconOrElement;
|
|
12
|
-
/** The position of the icon relative to the content. */
|
|
13
|
-
iconPosition?: "start" | "end";
|
|
14
|
-
/** If true, the width of the component will shrink to the width of the content. */
|
|
15
|
-
contentWidth?: boolean;
|
|
16
|
-
/** The variant of the button. Choose one depending on the type and desired prominence. */
|
|
17
|
-
variant?: "primary" | "secondary" | "tertiary";
|
|
18
|
-
/** Size of the button. */
|
|
19
|
-
size?: Exclude<ButtonSize, "small">;
|
|
20
|
-
/** If `true`, a loading spinner will be shown instead of the content. Only usable when the property `component` is set to `button`. */
|
|
21
|
-
loading?: boolean;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
declare const Button: <C extends ElementType>({ component, children, ...props }: ButtonProps<C>) => default_2.JSX.Element;
|
|
25
|
-
export default Button;
|
|
26
|
-
|
|
27
|
-
export declare type ButtonProps<C extends ElementType = "button"> = BaseProps & {
|
|
28
|
-
/** The semantic component to render the Button. Preferrably `"button"`, `"a"` or something like `Link` from NextJS. Native props will be passed to this component. */
|
|
29
|
-
component?: C;
|
|
30
|
-
} & Omit<ComponentProps<C>, keyof BaseProps | "component">;
|
|
31
|
-
|
|
32
|
-
export { }
|
|
1
|
+
export { default } from "./src/Button";
|
|
2
|
+
export type { Props as ButtonProps } from "./src/Button";
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
-
//#region src/Button.tsx
|
|
5
|
-
var n = ({ component: n = "button", children: r, ...i }) => {
|
|
6
|
-
let a = n;
|
|
7
|
-
return /* @__PURE__ */ t(e, {
|
|
8
|
-
...i,
|
|
9
|
-
component: a,
|
|
10
|
-
componentName: "button",
|
|
11
|
-
children: r
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
//#endregion
|
|
15
|
-
export { n as default };
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import e from "./src/Button.js";
|
|
2
|
+
export { e as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { ComponentProps, ElementType } from "react";
|
|
2
|
+
import type { IconOrElement } from "@bonprix-ds/react-icon";
|
|
3
|
+
import type { ButtonSize } from "@bonprix-ds/utils";
|
|
4
|
+
interface BaseProps {
|
|
5
|
+
/** The visible content of the component. */
|
|
6
|
+
children: string;
|
|
7
|
+
/** If used, an icon will be additionally shown. The value is either a name of one icon from our icon set or an inline `<svg>` element. */
|
|
8
|
+
icon?: IconOrElement;
|
|
9
|
+
/** The position of the icon relative to the content. */
|
|
10
|
+
iconPosition?: "start" | "end";
|
|
11
|
+
/** If true, the width of the component will shrink to the width of the content. */
|
|
12
|
+
contentWidth?: boolean;
|
|
13
|
+
/** The variant of the button. Choose one depending on the type and desired prominence. */
|
|
14
|
+
variant?: "primary" | "secondary" | "tertiary";
|
|
15
|
+
/** Size of the button. */
|
|
16
|
+
size?: Exclude<ButtonSize, "small">;
|
|
17
|
+
/** If `true`, a loading spinner will be shown instead of the content. Only usable when the property `component` is set to `button`. */
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export type Props<C extends ElementType = "button"> = BaseProps & {
|
|
21
|
+
/** The semantic component to render the Button. Preferrably `"button"`, `"a"` or something like `Link` from NextJS. Native props will be passed to this component. */
|
|
22
|
+
component?: C;
|
|
23
|
+
} & Omit<ComponentProps<C>, keyof BaseProps | "component">;
|
|
24
|
+
declare const Button: <C extends ElementType>({ component, children, ...props }: Props<C>) => React.JSX.Element;
|
|
25
|
+
export default Button;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { BaseButton as e } from "@bonprix-ds/internal-components";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/Button.tsx
|
|
5
|
+
var n = ({ component: n = "button", children: r, ...i }) => {
|
|
6
|
+
let a = n;
|
|
7
|
+
return /* @__PURE__ */ t(e, {
|
|
8
|
+
...i,
|
|
9
|
+
component: a,
|
|
10
|
+
componentName: "button",
|
|
11
|
+
children: r
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { n as default };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","names":["Button","props","Component","component","BaseButton"],"sources":["../../src/Button.tsx"],"sourcesContent":["import React, { ComponentProps, ElementType } from \"react\";\n\nimport { BaseButton } from \"@bonprix-ds/internal-components\";\nimport type { IconOrElement } from \"@bonprix-ds/react-icon\";\nimport type { ButtonSize } from \"@bonprix-ds/utils\";\n\ninterface BaseProps {\n /** The visible content of the component. */\n children: string;\n /** If used, an icon will be additionally shown. The value is either a name of one icon from our icon set or an inline `<svg>` element. */\n icon?: IconOrElement;\n /** The position of the icon relative to the content. */\n iconPosition?: \"start\" | \"end\";\n /** If true, the width of the component will shrink to the width of the content. */\n contentWidth?: boolean;\n /** The variant of the button. Choose one depending on the type and desired prominence. */\n variant?: \"primary\" | \"secondary\" | \"tertiary\";\n /** Size of the button. */\n size?: Exclude<ButtonSize, \"small\">;\n /** If `true`, a loading spinner will be shown instead of the content. Only usable when the property `component` is set to `button`. */\n loading?: boolean;\n}\n\nexport type Props<C extends ElementType = \"button\"> = BaseProps & {\n /** The semantic component to render the Button. Preferrably `\"button\"`, `\"a\"` or something like `Link` from NextJS. Native props will be passed to this component. */\n component?: C;\n} & Omit<ComponentProps<C>, keyof BaseProps | \"component\">;\n\nconst Button = <C extends ElementType>({ component = \"button\" as C, children, ...props }: Props<C>) => {\n const Component: ElementType = component;\n return (\n <BaseButton {...props} component={Component} componentName=\"button\">\n {children}\n </BaseButton>\n );\n};\n\nexport default Button;\n"],"mappings":";;;;AA4BA,IAAMA,KAAiC,EAAE,eAAY,UAAe,aAAU,GAAGC,QAAsB;CACrG,IAAMC,IAAyBC;CAC/B,OACE,kBAACC,GAAD;EAAY,GAAIH;EAAO,WAAWC;EAAW,eAAc;EACxD;CACS,CAAA;AAEhB"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonprix-ds/react-button",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Button component, implemented in React, for the Bonprix Design System.",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
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/button"
|
|
9
12
|
},
|
|
10
|
-
"
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"!dist/tsconfig.tsbuildinfo",
|
|
16
|
+
"!dist/vite.config.d.ts",
|
|
17
|
+
"!dist/**/*.test.d.ts"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
11
20
|
"sideEffects": false,
|
|
21
|
+
"module": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
12
23
|
"exports": {
|
|
13
24
|
".": {
|
|
14
25
|
"import": "./dist/index.js",
|
|
@@ -16,34 +27,23 @@
|
|
|
16
27
|
"default": "./dist/index.js"
|
|
17
28
|
}
|
|
18
29
|
},
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"
|
|
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/button"
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public",
|
|
32
|
+
"provenance": true
|
|
30
33
|
},
|
|
31
34
|
"dependencies": {
|
|
32
|
-
"@bonprix-ds/internal-components": "0.2.
|
|
33
|
-
"@bonprix-ds/react-icon": "1.2.
|
|
34
|
-
"@bonprix-ds/utils": "0.
|
|
35
|
-
},
|
|
36
|
-
"peerDependencies": {
|
|
37
|
-
"react": "^19.0.0",
|
|
38
|
-
"react-dom": "^19.0.0"
|
|
35
|
+
"@bonprix-ds/internal-components": "0.2.2",
|
|
36
|
+
"@bonprix-ds/react-icon": "1.2.2",
|
|
37
|
+
"@bonprix-ds/utils": "0.3.0"
|
|
39
38
|
},
|
|
40
39
|
"devDependencies": {
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"@
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
40
|
+
"@types/react": "19.3.0",
|
|
41
|
+
"vite": "8.3.2",
|
|
42
|
+
"@bonprix-ds/vite-config": "0.0.0"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"react": "^19",
|
|
46
|
+
"react-dom": "^19"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "vite build"
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/Button.tsx"],"sourcesContent":["import { BaseButton } from \"@bonprix-ds/internal-components\";\nimport type { IconOrElement } from \"@bonprix-ds/react-icon\";\nimport type { ButtonSize } from \"@bonprix-ds/utils\";\nimport React, { ComponentProps, ElementType } from \"react\";\n\ninterface BaseProps {\n /** The visible content of the component. */\n children: string;\n /** If used, an icon will be additionally shown. The value is either a name of one icon from our icon set or an inline `<svg>` element. */\n icon?: IconOrElement;\n /** The position of the icon relative to the content. */\n iconPosition?: \"start\" | \"end\";\n /** If true, the width of the component will shrink to the width of the content. */\n contentWidth?: boolean;\n /** The variant of the button. Choose one depending on the type and desired prominence. */\n variant?: \"primary\" | \"secondary\" | \"tertiary\";\n /** Size of the button. */\n size?: Exclude<ButtonSize, \"small\">;\n /** If `true`, a loading spinner will be shown instead of the content. Only usable when the property `component` is set to `button`. */\n loading?: boolean;\n}\n\nexport type Props<C extends ElementType = \"button\"> = BaseProps & {\n /** The semantic component to render the Button. Preferrably `\"button\"`, `\"a\"` or something like `Link` from NextJS. Native props will be passed to this component. */\n component?: C;\n} & Omit<ComponentProps<C>, keyof BaseProps | \"component\">;\n\nconst Button = <C extends ElementType>({ component = \"button\" as C, children, ...props }: Props<C>) => {\n const Component: ElementType = component;\n return (\n <BaseButton {...props} component={Component} componentName=\"button\">\n {children}\n </BaseButton>\n );\n};\n\nexport default Button;\n"],"mappings":";;;;AA2BA,IAAM,KAAiC,EAAE,eAAY,UAAe,aAAU,GAAG,QAAsB;CACrG,IAAM,IAAyB;CAC/B,OACE,kBAAC,GAAD;EAAY,GAAI;EAAO,WAAW;EAAW,eAAc;EACxD;CACS,CAAA;AAEhB"}
|