@postenbring/hedwig-react 0.0.2 → 0.0.4

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,28 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ interface BadgeProps extends Omit<React.AnchorHTMLAttributes<HTMLSpanElement>, "className" | "style"> {
5
+ /**
6
+ * Font size of the badge
7
+ */
8
+ size?: "small" | "smaller";
9
+ children: React.ReactNode;
10
+ }
11
+ declare function Badge(props: BadgeProps): react_jsx_runtime.JSX.Element;
12
+ declare namespace Badge {
13
+ var displayName: string;
14
+ }
15
+ declare function DarkBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
16
+ declare namespace DarkBadge {
17
+ var displayName: string;
18
+ }
19
+ declare function WhiteBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
20
+ declare namespace WhiteBadge {
21
+ var displayName: string;
22
+ }
23
+ declare function WarningBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
24
+ declare namespace WarningBadge {
25
+ var displayName: string;
26
+ }
27
+
28
+ export { Badge, BadgeProps, DarkBadge, WarningBadge, WhiteBadge };
@@ -0,0 +1,28 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ interface BadgeProps extends Omit<React.AnchorHTMLAttributes<HTMLSpanElement>, "className" | "style"> {
5
+ /**
6
+ * Font size of the badge
7
+ */
8
+ size?: "small" | "smaller";
9
+ children: React.ReactNode;
10
+ }
11
+ declare function Badge(props: BadgeProps): react_jsx_runtime.JSX.Element;
12
+ declare namespace Badge {
13
+ var displayName: string;
14
+ }
15
+ declare function DarkBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
16
+ declare namespace DarkBadge {
17
+ var displayName: string;
18
+ }
19
+ declare function WhiteBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
20
+ declare namespace WhiteBadge {
21
+ var displayName: string;
22
+ }
23
+ declare function WarningBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
24
+ declare namespace WarningBadge {
25
+ var displayName: string;
26
+ }
27
+
28
+ export { Badge, BadgeProps, DarkBadge, WarningBadge, WhiteBadge };
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
+ var __objRest = (source, exclude) => {
24
+ var target = {};
25
+ for (var prop in source)
26
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
27
+ target[prop] = source[prop];
28
+ if (source != null && __getOwnPropSymbols)
29
+ for (var prop of __getOwnPropSymbols(source)) {
30
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
31
+ target[prop] = source[prop];
32
+ }
33
+ return target;
34
+ };
35
+ var __export = (target, all) => {
36
+ for (var name in all)
37
+ __defProp(target, name, { get: all[name], enumerable: true });
38
+ };
39
+ var __copyProps = (to, from, except, desc) => {
40
+ if (from && typeof from === "object" || typeof from === "function") {
41
+ for (let key of __getOwnPropNames(from))
42
+ if (!__hasOwnProp.call(to, key) && key !== except)
43
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
44
+ }
45
+ return to;
46
+ };
47
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
48
+
49
+ // src/badge/badge.tsx
50
+ var badge_exports = {};
51
+ __export(badge_exports, {
52
+ Badge: () => Badge,
53
+ DarkBadge: () => DarkBadge,
54
+ WarningBadge: () => WarningBadge,
55
+ WhiteBadge: () => WhiteBadge
56
+ });
57
+ module.exports = __toCommonJS(badge_exports);
58
+ var import_clsx = require("clsx");
59
+ var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
60
+
61
+ // src/utils.ts
62
+ function warnForStyleOverrides(props) {
63
+ if (props.className) {
64
+ console.warn("Overriding styles are not premited");
65
+ }
66
+ if (props.styles) {
67
+ console.warn("Overriding styles are not premited");
68
+ }
69
+ }
70
+
71
+ // src/badge/badge.tsx
72
+ var import_jsx_runtime = require("react/jsx-runtime");
73
+ function BaseBadge(_a) {
74
+ var _b = _a, {
75
+ children,
76
+ variant,
77
+ size = "small"
78
+ } = _b, rest = __objRest(_b, [
79
+ "children",
80
+ "variant",
81
+ "size"
82
+ ]);
83
+ warnForStyleOverrides(rest);
84
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_clsx.clsx)((0, import_typed_classname.t)("hds-badge"), (0, import_typed_classname.t)(`hds-badge--${size}`), (0, import_typed_classname.t)(`hds-badge--${variant}`)), children });
85
+ }
86
+ BaseBadge.displayName = "BaseBadge";
87
+ function Badge(props) {
88
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
89
+ }
90
+ Badge.displayName = "Badge";
91
+ function DarkBadge(props) {
92
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "dark" }));
93
+ }
94
+ DarkBadge.displayName = "DarkBadge";
95
+ function WhiteBadge(props) {
96
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "white" }));
97
+ }
98
+ WhiteBadge.displayName = "WhiteBadge";
99
+ function WarningBadge(props) {
100
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "warning" }));
101
+ }
102
+ WarningBadge.displayName = "WarningBadge";
103
+ // Annotate the CommonJS export names for ESM import in node:
104
+ 0 && (module.exports = {
105
+ Badge,
106
+ DarkBadge,
107
+ WarningBadge,
108
+ WhiteBadge
109
+ });
@@ -0,0 +1,13 @@
1
+ import {
2
+ Badge,
3
+ DarkBadge,
4
+ WarningBadge,
5
+ WhiteBadge
6
+ } from "../chunk-YH2NWXPK.mjs";
7
+ import "../chunk-BTCTQCPO.mjs";
8
+ export {
9
+ Badge,
10
+ DarkBadge,
11
+ WarningBadge,
12
+ WhiteBadge
13
+ };
@@ -0,0 +1,3 @@
1
+ export { Badge, BadgeProps, DarkBadge, WarningBadge, WhiteBadge } from './badge.mjs';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
@@ -0,0 +1,3 @@
1
+ export { Badge, BadgeProps, DarkBadge, WarningBadge, WhiteBadge } from './badge.js';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
+ var __objRest = (source, exclude) => {
24
+ var target = {};
25
+ for (var prop in source)
26
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
27
+ target[prop] = source[prop];
28
+ if (source != null && __getOwnPropSymbols)
29
+ for (var prop of __getOwnPropSymbols(source)) {
30
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
31
+ target[prop] = source[prop];
32
+ }
33
+ return target;
34
+ };
35
+ var __export = (target, all) => {
36
+ for (var name in all)
37
+ __defProp(target, name, { get: all[name], enumerable: true });
38
+ };
39
+ var __copyProps = (to, from, except, desc) => {
40
+ if (from && typeof from === "object" || typeof from === "function") {
41
+ for (let key of __getOwnPropNames(from))
42
+ if (!__hasOwnProp.call(to, key) && key !== except)
43
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
44
+ }
45
+ return to;
46
+ };
47
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
48
+
49
+ // src/badge/index.tsx
50
+ var badge_exports = {};
51
+ __export(badge_exports, {
52
+ Badge: () => Badge,
53
+ DarkBadge: () => DarkBadge,
54
+ WarningBadge: () => WarningBadge,
55
+ WhiteBadge: () => WhiteBadge
56
+ });
57
+ module.exports = __toCommonJS(badge_exports);
58
+ var import_tokens = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css");
59
+ var import_base = require("@postenbring/hedwig-css/dist/base.css");
60
+ var import_badge = require("@postenbring/hedwig-css/dist/badge/badge.css");
61
+
62
+ // src/badge/badge.tsx
63
+ var import_clsx = require("clsx");
64
+ var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
65
+
66
+ // src/utils.ts
67
+ function warnForStyleOverrides(props) {
68
+ if (props.className) {
69
+ console.warn("Overriding styles are not premited");
70
+ }
71
+ if (props.styles) {
72
+ console.warn("Overriding styles are not premited");
73
+ }
74
+ }
75
+
76
+ // src/badge/badge.tsx
77
+ var import_jsx_runtime = require("react/jsx-runtime");
78
+ function BaseBadge(_a) {
79
+ var _b = _a, {
80
+ children,
81
+ variant,
82
+ size = "small"
83
+ } = _b, rest = __objRest(_b, [
84
+ "children",
85
+ "variant",
86
+ "size"
87
+ ]);
88
+ warnForStyleOverrides(rest);
89
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_clsx.clsx)((0, import_typed_classname.t)("hds-badge"), (0, import_typed_classname.t)(`hds-badge--${size}`), (0, import_typed_classname.t)(`hds-badge--${variant}`)), children });
90
+ }
91
+ BaseBadge.displayName = "BaseBadge";
92
+ function Badge(props) {
93
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
94
+ }
95
+ Badge.displayName = "Badge";
96
+ function DarkBadge(props) {
97
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "dark" }));
98
+ }
99
+ DarkBadge.displayName = "DarkBadge";
100
+ function WhiteBadge(props) {
101
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "white" }));
102
+ }
103
+ WhiteBadge.displayName = "WhiteBadge";
104
+ function WarningBadge(props) {
105
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "warning" }));
106
+ }
107
+ WarningBadge.displayName = "WarningBadge";
108
+ // Annotate the CommonJS export names for ESM import in node:
109
+ 0 && (module.exports = {
110
+ Badge,
111
+ DarkBadge,
112
+ WarningBadge,
113
+ WhiteBadge
114
+ });
@@ -0,0 +1,14 @@
1
+ import "../chunk-H5SSXV32.mjs";
2
+ import {
3
+ Badge,
4
+ DarkBadge,
5
+ WarningBadge,
6
+ WhiteBadge
7
+ } from "../chunk-YH2NWXPK.mjs";
8
+ import "../chunk-BTCTQCPO.mjs";
9
+ export {
10
+ Badge,
11
+ DarkBadge,
12
+ WarningBadge,
13
+ WhiteBadge
14
+ };
@@ -0,0 +1,37 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "style"> {
5
+ /**
6
+ * The height, font size and padding of the button
7
+ */
8
+ size?: "small" | "medium" | "large";
9
+ /**
10
+ * Make the button use 100% width available.
11
+ * Using the "mobile" it only stretch to full width on smaller screens
12
+ */
13
+ fullWidth?: boolean | "mobile";
14
+ /**
15
+ * The background of the button.
16
+ */
17
+ fill?: "contained" | "outlined";
18
+ children: React.ReactNode;
19
+ buttonRef?: React.ForwardedRef<HTMLButtonElement>;
20
+ }
21
+ /**
22
+ * ## TODO
23
+ *
24
+ * - [ ] Handle links that looks like buttons
25
+ * - [ ] Revisit how to handle outline
26
+ * - [ ] Figure out outline-white
27
+ */
28
+ declare function PrimaryButton(props: ButtonProps): react_jsx_runtime.JSX.Element;
29
+ declare namespace PrimaryButton {
30
+ var displayName: string;
31
+ }
32
+ declare function SecondaryButton(props: ButtonProps): react_jsx_runtime.JSX.Element;
33
+ declare namespace SecondaryButton {
34
+ var displayName: string;
35
+ }
36
+
37
+ export { ButtonProps, PrimaryButton, SecondaryButton };
@@ -0,0 +1,37 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "style"> {
5
+ /**
6
+ * The height, font size and padding of the button
7
+ */
8
+ size?: "small" | "medium" | "large";
9
+ /**
10
+ * Make the button use 100% width available.
11
+ * Using the "mobile" it only stretch to full width on smaller screens
12
+ */
13
+ fullWidth?: boolean | "mobile";
14
+ /**
15
+ * The background of the button.
16
+ */
17
+ fill?: "contained" | "outlined";
18
+ children: React.ReactNode;
19
+ buttonRef?: React.ForwardedRef<HTMLButtonElement>;
20
+ }
21
+ /**
22
+ * ## TODO
23
+ *
24
+ * - [ ] Handle links that looks like buttons
25
+ * - [ ] Revisit how to handle outline
26
+ * - [ ] Figure out outline-white
27
+ */
28
+ declare function PrimaryButton(props: ButtonProps): react_jsx_runtime.JSX.Element;
29
+ declare namespace PrimaryButton {
30
+ var displayName: string;
31
+ }
32
+ declare function SecondaryButton(props: ButtonProps): react_jsx_runtime.JSX.Element;
33
+ declare namespace SecondaryButton {
34
+ var displayName: string;
35
+ }
36
+
37
+ export { ButtonProps, PrimaryButton, SecondaryButton };
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
+ var __objRest = (source, exclude) => {
24
+ var target = {};
25
+ for (var prop in source)
26
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
27
+ target[prop] = source[prop];
28
+ if (source != null && __getOwnPropSymbols)
29
+ for (var prop of __getOwnPropSymbols(source)) {
30
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
31
+ target[prop] = source[prop];
32
+ }
33
+ return target;
34
+ };
35
+ var __export = (target, all) => {
36
+ for (var name in all)
37
+ __defProp(target, name, { get: all[name], enumerable: true });
38
+ };
39
+ var __copyProps = (to, from, except, desc) => {
40
+ if (from && typeof from === "object" || typeof from === "function") {
41
+ for (let key of __getOwnPropNames(from))
42
+ if (!__hasOwnProp.call(to, key) && key !== except)
43
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
44
+ }
45
+ return to;
46
+ };
47
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
48
+
49
+ // src/button/button.tsx
50
+ var button_exports = {};
51
+ __export(button_exports, {
52
+ PrimaryButton: () => PrimaryButton,
53
+ SecondaryButton: () => SecondaryButton
54
+ });
55
+ module.exports = __toCommonJS(button_exports);
56
+ var import_clsx = require("clsx");
57
+ var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
58
+
59
+ // src/utils.ts
60
+ function warnForStyleOverrides(props) {
61
+ if (props.className) {
62
+ console.warn("Overriding styles are not premited");
63
+ }
64
+ if (props.styles) {
65
+ console.warn("Overriding styles are not premited");
66
+ }
67
+ }
68
+
69
+ // src/button/button.tsx
70
+ var import_jsx_runtime = require("react/jsx-runtime");
71
+ function BaseButton(_a) {
72
+ var _b = _a, {
73
+ children,
74
+ variant,
75
+ size = "medium",
76
+ fullWidth = false,
77
+ fill = "contained",
78
+ buttonRef
79
+ } = _b, rest = __objRest(_b, [
80
+ "children",
81
+ "variant",
82
+ "size",
83
+ "fullWidth",
84
+ "fill",
85
+ "buttonRef"
86
+ ]);
87
+ warnForStyleOverrides(rest);
88
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
89
+ "button",
90
+ __spreadProps(__spreadValues({
91
+ className: (0, import_clsx.clsx)((0, import_typed_classname.t)("hds-button"), (0, import_typed_classname.t)(`hds-button--${size}`), {
92
+ [(0, import_typed_classname.t)(`hds-button--${variant}`)]: fill === "contained",
93
+ [(0, import_typed_classname.t)(`hds-button--outline-${variant}`)]: fill === "outlined",
94
+ [(0, import_typed_classname.t)("hds-button--full")]: fullWidth === true,
95
+ [(0, import_typed_classname.t)("hds-button--mobile-full")]: fullWidth === "mobile"
96
+ }),
97
+ ref: buttonRef
98
+ }, rest), {
99
+ children
100
+ })
101
+ );
102
+ }
103
+ BaseButton.displayName = "BaseButton";
104
+ function PrimaryButton(props) {
105
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
106
+ }
107
+ PrimaryButton.displayName = "PrimaryButton";
108
+ function SecondaryButton(props) {
109
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "secondary" }));
110
+ }
111
+ SecondaryButton.displayName = "SecondaryButton";
112
+ // Annotate the CommonJS export names for ESM import in node:
113
+ 0 && (module.exports = {
114
+ PrimaryButton,
115
+ SecondaryButton
116
+ });
@@ -0,0 +1,9 @@
1
+ import {
2
+ PrimaryButton,
3
+ SecondaryButton
4
+ } from "../chunk-SF42ETS4.mjs";
5
+ import "../chunk-BTCTQCPO.mjs";
6
+ export {
7
+ PrimaryButton,
8
+ SecondaryButton
9
+ };
@@ -1,12 +1,3 @@
1
- import * as React from 'react';
2
-
3
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
4
- children: React.ReactNode;
5
- size?: "small" | "medium" | "large";
6
- }
7
- declare function Button({ children, style, className, size, ...rest }: ButtonProps): JSX.Element;
8
- declare namespace Button {
9
- var displayName: string;
10
- }
11
-
12
- export { Button, ButtonProps };
1
+ export { ButtonProps, PrimaryButton, SecondaryButton } from './button.mjs';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
@@ -1,12 +1,3 @@
1
- import * as React from 'react';
2
-
3
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
4
- children: React.ReactNode;
5
- size?: "small" | "medium" | "large";
6
- }
7
- declare function Button({ children, style, className, size, ...rest }: ButtonProps): JSX.Element;
8
- declare namespace Button {
9
- var displayName: string;
10
- }
11
-
12
- export { Button, ButtonProps };
1
+ export { ButtonProps, PrimaryButton, SecondaryButton } from './button.js';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
@@ -49,52 +49,73 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
49
49
  // src/button/index.tsx
50
50
  var button_exports = {};
51
51
  __export(button_exports, {
52
- Button: () => Button
52
+ PrimaryButton: () => PrimaryButton,
53
+ SecondaryButton: () => SecondaryButton
53
54
  });
54
55
  module.exports = __toCommonJS(button_exports);
55
- var import_tokens = require("@postenbring/hedwig-tokens/dist/web/tokens.css");
56
+ var import_tokens = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css");
57
+ var import_base = require("@postenbring/hedwig-css/dist/base.css");
56
58
  var import_button = require("@postenbring/hedwig-css/dist/button/button.css");
57
59
 
58
60
  // src/button/button.tsx
59
61
  var import_clsx = require("clsx");
62
+ var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
60
63
 
61
64
  // src/utils.ts
62
- function warnForStyleOverrides(className, styles) {
63
- if (className) {
65
+ function warnForStyleOverrides(props) {
66
+ if (props.className) {
64
67
  console.warn("Overriding styles are not premited");
65
68
  }
66
- if (styles) {
69
+ if (props.styles) {
67
70
  console.warn("Overriding styles are not premited");
68
71
  }
69
72
  }
70
73
 
71
74
  // src/button/button.tsx
72
75
  var import_jsx_runtime = require("react/jsx-runtime");
73
- function Button(_a) {
76
+ function BaseButton(_a) {
74
77
  var _b = _a, {
75
78
  children,
76
- style,
77
- className,
78
- size = "medium"
79
+ variant,
80
+ size = "medium",
81
+ fullWidth = false,
82
+ fill = "contained",
83
+ buttonRef
79
84
  } = _b, rest = __objRest(_b, [
80
85
  "children",
81
- "style",
82
- "className",
83
- "size"
86
+ "variant",
87
+ "size",
88
+ "fullWidth",
89
+ "fill",
90
+ "buttonRef"
84
91
  ]);
85
- warnForStyleOverrides(style, className);
92
+ warnForStyleOverrides(rest);
86
93
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
87
94
  "button",
88
95
  __spreadProps(__spreadValues({
89
- className: (0, import_clsx.clsx)("hds-button", "hds-button--primary", `hds-button--${size}`),
90
- type: "button"
96
+ className: (0, import_clsx.clsx)((0, import_typed_classname.t)("hds-button"), (0, import_typed_classname.t)(`hds-button--${size}`), {
97
+ [(0, import_typed_classname.t)(`hds-button--${variant}`)]: fill === "contained",
98
+ [(0, import_typed_classname.t)(`hds-button--outline-${variant}`)]: fill === "outlined",
99
+ [(0, import_typed_classname.t)("hds-button--full")]: fullWidth === true,
100
+ [(0, import_typed_classname.t)("hds-button--mobile-full")]: fullWidth === "mobile"
101
+ }),
102
+ ref: buttonRef
91
103
  }, rest), {
92
104
  children
93
105
  })
94
106
  );
95
107
  }
96
- Button.displayName = "Button";
108
+ BaseButton.displayName = "BaseButton";
109
+ function PrimaryButton(props) {
110
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
111
+ }
112
+ PrimaryButton.displayName = "PrimaryButton";
113
+ function SecondaryButton(props) {
114
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "secondary" }));
115
+ }
116
+ SecondaryButton.displayName = "SecondaryButton";
97
117
  // Annotate the CommonJS export names for ESM import in node:
98
118
  0 && (module.exports = {
99
- Button
119
+ PrimaryButton,
120
+ SecondaryButton
100
121
  });
@@ -1,6 +1,10 @@
1
+ import "../chunk-AHYBSRCR.mjs";
1
2
  import {
2
- Button
3
- } from "../chunk-GT43SBJ6.mjs";
3
+ PrimaryButton,
4
+ SecondaryButton
5
+ } from "../chunk-SF42ETS4.mjs";
6
+ import "../chunk-BTCTQCPO.mjs";
4
7
  export {
5
- Button
8
+ PrimaryButton,
9
+ SecondaryButton
6
10
  };