@postenbring/hedwig-react 0.0.3 → 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 };
@@ -1,6 +1,9 @@
1
+ "use strict";
1
2
  var __defProp = Object.defineProperty;
2
3
  var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
5
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
7
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
9
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -29,14 +32,29 @@ var __objRest = (source, exclude) => {
29
32
  }
30
33
  return target;
31
34
  };
32
-
33
- // src/button/index.tsx
34
- import "@postenbring/hedwig-tokens/tokens-output/css/tokens.css";
35
- import "@postenbring/hedwig-css/dist/base.css";
36
- import "@postenbring/hedwig-css/dist/button/button.css";
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);
37
48
 
38
49
  // src/button/button.tsx
39
- import { clsx } from "clsx";
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");
40
58
 
41
59
  // src/utils.ts
42
60
  function warnForStyleOverrides(props) {
@@ -49,7 +67,7 @@ function warnForStyleOverrides(props) {
49
67
  }
50
68
 
51
69
  // src/button/button.tsx
52
- import { jsx } from "react/jsx-runtime";
70
+ var import_jsx_runtime = require("react/jsx-runtime");
53
71
  function BaseButton(_a) {
54
72
  var _b = _a, {
55
73
  children,
@@ -67,17 +85,16 @@ function BaseButton(_a) {
67
85
  "buttonRef"
68
86
  ]);
69
87
  warnForStyleOverrides(rest);
70
- return /* @__PURE__ */ jsx(
88
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
71
89
  "button",
72
90
  __spreadProps(__spreadValues({
73
- className: clsx("hds-button", `hds-button--${size}`, {
74
- [`hds-button--${variant}`]: fill === "contained",
75
- [`hds-button--outline-${variant}`]: fill === "outlined",
76
- "hds-button--full": fullWidth === true,
77
- "hds-button--mobile-full": fullWidth === "mobile"
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"
78
96
  }),
79
- ref: buttonRef,
80
- type: "button"
97
+ ref: buttonRef
81
98
  }, rest), {
82
99
  children
83
100
  })
@@ -85,19 +102,15 @@ function BaseButton(_a) {
85
102
  }
86
103
  BaseButton.displayName = "BaseButton";
87
104
  function PrimaryButton(props) {
88
- return /* @__PURE__ */ jsx(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
105
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
89
106
  }
90
107
  PrimaryButton.displayName = "PrimaryButton";
91
108
  function SecondaryButton(props) {
92
- return /* @__PURE__ */ jsx(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "secondary" }));
109
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "secondary" }));
93
110
  }
94
111
  SecondaryButton.displayName = "SecondaryButton";
95
-
96
- export {
97
- __spreadValues,
98
- __spreadProps,
99
- __objRest,
100
- warnForStyleOverrides,
112
+ // Annotate the CommonJS export names for ESM import in node:
113
+ 0 && (module.exports = {
101
114
  PrimaryButton,
102
115
  SecondaryButton
103
- };
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,37 +1,3 @@
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 { PrimaryButton, SecondaryButton };
1
+ export { ButtonProps, PrimaryButton, SecondaryButton } from './button.mjs';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
@@ -1,37 +1,3 @@
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 { PrimaryButton, SecondaryButton };
1
+ export { ButtonProps, PrimaryButton, SecondaryButton } from './button.js';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
@@ -59,6 +59,7 @@ var import_button = require("@postenbring/hedwig-css/dist/button/button.css");
59
59
 
60
60
  // src/button/button.tsx
61
61
  var import_clsx = require("clsx");
62
+ var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
62
63
 
63
64
  // src/utils.ts
64
65
  function warnForStyleOverrides(props) {
@@ -92,14 +93,13 @@ function BaseButton(_a) {
92
93
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
93
94
  "button",
94
95
  __spreadProps(__spreadValues({
95
- className: (0, import_clsx.clsx)("hds-button", `hds-button--${size}`, {
96
- [`hds-button--${variant}`]: fill === "contained",
97
- [`hds-button--outline-${variant}`]: fill === "outlined",
98
- "hds-button--full": fullWidth === true,
99
- "hds-button--mobile-full": fullWidth === "mobile"
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"
100
101
  }),
101
- ref: buttonRef,
102
- type: "button"
102
+ ref: buttonRef
103
103
  }, rest), {
104
104
  children
105
105
  })
@@ -1,7 +1,9 @@
1
+ import "../chunk-AHYBSRCR.mjs";
1
2
  import {
2
3
  PrimaryButton,
3
4
  SecondaryButton
4
- } from "../chunk-ZPSTPWVB.mjs";
5
+ } from "../chunk-SF42ETS4.mjs";
6
+ import "../chunk-BTCTQCPO.mjs";
5
7
  export {
6
8
  PrimaryButton,
7
9
  SecondaryButton