@bonprix-ds/react-button 1.1.1 → 1.1.3
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 +2 -17
- package/dist/src/Button.js +17 -0
- package/dist/src/Button.js.map +1 -0
- package/package.json +8 -9
- package/dist/index.js.map +0 -1
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,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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonprix-ds/react-button",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Button component, implemented in React, for the Bonprix Design System.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -32,19 +32,18 @@
|
|
|
32
32
|
"provenance": true
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@bonprix-ds/
|
|
36
|
-
"@bonprix-ds/
|
|
37
|
-
"@bonprix-ds/utils": "0.
|
|
35
|
+
"@bonprix-ds/react-icon": "1.3.0",
|
|
36
|
+
"@bonprix-ds/internal-components": "0.2.3",
|
|
37
|
+
"@bonprix-ds/utils": "0.4.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/react": "19.3.0",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"vite": "8.3.0"
|
|
41
|
+
"vite": "8.3.2",
|
|
42
|
+
"@bonprix-ds/vite-config": "0.0.0"
|
|
44
43
|
},
|
|
45
44
|
"peerDependencies": {
|
|
46
|
-
"react": "^19
|
|
47
|
-
"react-dom": "^19
|
|
45
|
+
"react": "^19",
|
|
46
|
+
"react-dom": "^19"
|
|
48
47
|
},
|
|
49
48
|
"scripts": {
|
|
50
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 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,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"}
|