@postenbring/hedwig-react 0.0.0-badge-20231116111626

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,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 { 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 { PrimaryButton, SecondaryButton };
@@ -0,0 +1,122 @@
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/index.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_tokens = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css");
57
+ var import_base = require("@postenbring/hedwig-css/dist/base.css");
58
+ var import_button = require("@postenbring/hedwig-css/dist/button/button.css");
59
+
60
+ // src/button/button.tsx
61
+ var import_clsx = require("clsx");
62
+ var import_typed_classname = require("@postenbring/hedwig-css/typed-classname.mjs");
63
+
64
+ // src/utils.ts
65
+ function warnForStyleOverrides(props) {
66
+ if (props.className) {
67
+ console.warn("Overriding styles are not premited");
68
+ }
69
+ if (props.styles) {
70
+ console.warn("Overriding styles are not premited");
71
+ }
72
+ }
73
+
74
+ // src/button/button.tsx
75
+ var import_jsx_runtime = require("react/jsx-runtime");
76
+ function BaseButton(_a) {
77
+ var _b = _a, {
78
+ children,
79
+ variant,
80
+ size = "medium",
81
+ fullWidth = false,
82
+ fill = "contained",
83
+ buttonRef
84
+ } = _b, rest = __objRest(_b, [
85
+ "children",
86
+ "variant",
87
+ "size",
88
+ "fullWidth",
89
+ "fill",
90
+ "buttonRef"
91
+ ]);
92
+ warnForStyleOverrides(rest);
93
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
94
+ "button",
95
+ __spreadProps(__spreadValues({
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,
103
+ type: "button"
104
+ }, rest), {
105
+ children
106
+ })
107
+ );
108
+ }
109
+ BaseButton.displayName = "BaseButton";
110
+ function PrimaryButton(props) {
111
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
112
+ }
113
+ PrimaryButton.displayName = "PrimaryButton";
114
+ function SecondaryButton(props) {
115
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "secondary" }));
116
+ }
117
+ SecondaryButton.displayName = "SecondaryButton";
118
+ // Annotate the CommonJS export names for ESM import in node:
119
+ 0 && (module.exports = {
120
+ PrimaryButton,
121
+ SecondaryButton
122
+ });
@@ -0,0 +1,8 @@
1
+ import {
2
+ PrimaryButton,
3
+ SecondaryButton
4
+ } from "../chunk-WBIRSCID.mjs";
5
+ export {
6
+ PrimaryButton,
7
+ SecondaryButton
8
+ };
@@ -0,0 +1,104 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
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";
37
+
38
+ // src/button/button.tsx
39
+ import { clsx } from "clsx";
40
+ import { t } from "@postenbring/hedwig-css/typed-classname.mjs";
41
+
42
+ // src/utils.ts
43
+ function warnForStyleOverrides(props) {
44
+ if (props.className) {
45
+ console.warn("Overriding styles are not premited");
46
+ }
47
+ if (props.styles) {
48
+ console.warn("Overriding styles are not premited");
49
+ }
50
+ }
51
+
52
+ // src/button/button.tsx
53
+ import { jsx } from "react/jsx-runtime";
54
+ function BaseButton(_a) {
55
+ var _b = _a, {
56
+ children,
57
+ variant,
58
+ size = "medium",
59
+ fullWidth = false,
60
+ fill = "contained",
61
+ buttonRef
62
+ } = _b, rest = __objRest(_b, [
63
+ "children",
64
+ "variant",
65
+ "size",
66
+ "fullWidth",
67
+ "fill",
68
+ "buttonRef"
69
+ ]);
70
+ warnForStyleOverrides(rest);
71
+ return /* @__PURE__ */ jsx(
72
+ "button",
73
+ __spreadProps(__spreadValues({
74
+ className: clsx(t("hds-button"), t(`hds-button--${size}`), {
75
+ [t(`hds-button--${variant}`)]: fill === "contained",
76
+ [t(`hds-button--outline-${variant}`)]: fill === "outlined",
77
+ [t("hds-button--full")]: fullWidth === true,
78
+ [t("hds-button--mobile-full")]: fullWidth === "mobile"
79
+ }),
80
+ ref: buttonRef,
81
+ type: "button"
82
+ }, rest), {
83
+ children
84
+ })
85
+ );
86
+ }
87
+ BaseButton.displayName = "BaseButton";
88
+ function PrimaryButton(props) {
89
+ return /* @__PURE__ */ jsx(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
90
+ }
91
+ PrimaryButton.displayName = "PrimaryButton";
92
+ function SecondaryButton(props) {
93
+ return /* @__PURE__ */ jsx(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "secondary" }));
94
+ }
95
+ SecondaryButton.displayName = "SecondaryButton";
96
+
97
+ export {
98
+ __spreadValues,
99
+ __spreadProps,
100
+ __objRest,
101
+ warnForStyleOverrides,
102
+ PrimaryButton,
103
+ SecondaryButton
104
+ };
@@ -0,0 +1,51 @@
1
+ export { PrimaryButton, SecondaryButton } from './button/index.mjs';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import * as React from 'react';
4
+
5
+ interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "className" | "style"> {
6
+ /**
7
+ * The visual style of the link
8
+ */
9
+ variant?: "underline" | "solid" | "inverted" | "no-underline";
10
+ /**
11
+ * Font size of the link
12
+ */
13
+ size?: "small" | "medium" | "large";
14
+ children: React.ReactNode;
15
+ anchorRef?: React.ForwardedRef<HTMLAnchorElement>;
16
+ }
17
+ /**
18
+ * ## TODO
19
+ *
20
+ * - [ ] Handle button styling
21
+ */
22
+ declare function Link({ children, variant, size, anchorRef, ...rest }: LinkProps): react_jsx_runtime.JSX.Element;
23
+ declare namespace Link {
24
+ var displayName: string;
25
+ }
26
+
27
+ interface BadgeProps extends Omit<React.AnchorHTMLAttributes<HTMLSpanElement>, "className" | "style"> {
28
+ /**
29
+ * Font size of the badge
30
+ */
31
+ size?: "small" | "smaller";
32
+ children: React.ReactNode;
33
+ }
34
+ declare function Badge(props: BadgeProps): react_jsx_runtime.JSX.Element;
35
+ declare namespace Badge {
36
+ var displayName: string;
37
+ }
38
+ declare function DarkBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
39
+ declare namespace DarkBadge {
40
+ var displayName: string;
41
+ }
42
+ declare function WhiteBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
43
+ declare namespace WhiteBadge {
44
+ var displayName: string;
45
+ }
46
+ declare function WarningBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
47
+ declare namespace WarningBadge {
48
+ var displayName: string;
49
+ }
50
+
51
+ export { Badge, DarkBadge, Link, WarningBadge, WhiteBadge };
@@ -0,0 +1,51 @@
1
+ export { PrimaryButton, SecondaryButton } from './button/index.js';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import * as React from 'react';
4
+
5
+ interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "className" | "style"> {
6
+ /**
7
+ * The visual style of the link
8
+ */
9
+ variant?: "underline" | "solid" | "inverted" | "no-underline";
10
+ /**
11
+ * Font size of the link
12
+ */
13
+ size?: "small" | "medium" | "large";
14
+ children: React.ReactNode;
15
+ anchorRef?: React.ForwardedRef<HTMLAnchorElement>;
16
+ }
17
+ /**
18
+ * ## TODO
19
+ *
20
+ * - [ ] Handle button styling
21
+ */
22
+ declare function Link({ children, variant, size, anchorRef, ...rest }: LinkProps): react_jsx_runtime.JSX.Element;
23
+ declare namespace Link {
24
+ var displayName: string;
25
+ }
26
+
27
+ interface BadgeProps extends Omit<React.AnchorHTMLAttributes<HTMLSpanElement>, "className" | "style"> {
28
+ /**
29
+ * Font size of the badge
30
+ */
31
+ size?: "small" | "smaller";
32
+ children: React.ReactNode;
33
+ }
34
+ declare function Badge(props: BadgeProps): react_jsx_runtime.JSX.Element;
35
+ declare namespace Badge {
36
+ var displayName: string;
37
+ }
38
+ declare function DarkBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
39
+ declare namespace DarkBadge {
40
+ var displayName: string;
41
+ }
42
+ declare function WhiteBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
43
+ declare namespace WhiteBadge {
44
+ var displayName: string;
45
+ }
46
+ declare function WarningBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
47
+ declare namespace WarningBadge {
48
+ var displayName: string;
49
+ }
50
+
51
+ export { Badge, DarkBadge, Link, WarningBadge, WhiteBadge };
package/dist/index.js ADDED
@@ -0,0 +1,212 @@
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/index.tsx
50
+ var src_exports = {};
51
+ __export(src_exports, {
52
+ Badge: () => Badge,
53
+ DarkBadge: () => DarkBadge,
54
+ Link: () => Link,
55
+ PrimaryButton: () => PrimaryButton,
56
+ SecondaryButton: () => SecondaryButton,
57
+ WarningBadge: () => WarningBadge,
58
+ WhiteBadge: () => WhiteBadge
59
+ });
60
+ module.exports = __toCommonJS(src_exports);
61
+
62
+ // src/button/index.tsx
63
+ var import_tokens = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css");
64
+ var import_base = require("@postenbring/hedwig-css/dist/base.css");
65
+ var import_button = require("@postenbring/hedwig-css/dist/button/button.css");
66
+
67
+ // src/button/button.tsx
68
+ var import_clsx = require("clsx");
69
+ var import_typed_classname = require("@postenbring/hedwig-css/typed-classname.mjs");
70
+
71
+ // src/utils.ts
72
+ function warnForStyleOverrides(props) {
73
+ if (props.className) {
74
+ console.warn("Overriding styles are not premited");
75
+ }
76
+ if (props.styles) {
77
+ console.warn("Overriding styles are not premited");
78
+ }
79
+ }
80
+
81
+ // src/button/button.tsx
82
+ var import_jsx_runtime = require("react/jsx-runtime");
83
+ function BaseButton(_a) {
84
+ var _b = _a, {
85
+ children,
86
+ variant,
87
+ size = "medium",
88
+ fullWidth = false,
89
+ fill = "contained",
90
+ buttonRef
91
+ } = _b, rest = __objRest(_b, [
92
+ "children",
93
+ "variant",
94
+ "size",
95
+ "fullWidth",
96
+ "fill",
97
+ "buttonRef"
98
+ ]);
99
+ warnForStyleOverrides(rest);
100
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
101
+ "button",
102
+ __spreadProps(__spreadValues({
103
+ className: (0, import_clsx.clsx)((0, import_typed_classname.t)("hds-button"), (0, import_typed_classname.t)(`hds-button--${size}`), {
104
+ [(0, import_typed_classname.t)(`hds-button--${variant}`)]: fill === "contained",
105
+ [(0, import_typed_classname.t)(`hds-button--outline-${variant}`)]: fill === "outlined",
106
+ [(0, import_typed_classname.t)("hds-button--full")]: fullWidth === true,
107
+ [(0, import_typed_classname.t)("hds-button--mobile-full")]: fullWidth === "mobile"
108
+ }),
109
+ ref: buttonRef,
110
+ type: "button"
111
+ }, rest), {
112
+ children
113
+ })
114
+ );
115
+ }
116
+ BaseButton.displayName = "BaseButton";
117
+ function PrimaryButton(props) {
118
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
119
+ }
120
+ PrimaryButton.displayName = "PrimaryButton";
121
+ function SecondaryButton(props) {
122
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "secondary" }));
123
+ }
124
+ SecondaryButton.displayName = "SecondaryButton";
125
+
126
+ // src/link/index.tsx
127
+ var import_tokens2 = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css");
128
+ var import_base2 = require("@postenbring/hedwig-css/dist/base.css");
129
+ var import_link = require("@postenbring/hedwig-css/dist/link/link.css");
130
+
131
+ // src/link/link.tsx
132
+ var import_clsx2 = require("clsx");
133
+ var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname.mjs");
134
+ var import_jsx_runtime2 = require("react/jsx-runtime");
135
+ function Link(_a) {
136
+ var _b = _a, {
137
+ children,
138
+ variant = "underline",
139
+ size = "medium",
140
+ anchorRef
141
+ } = _b, rest = __objRest(_b, [
142
+ "children",
143
+ "variant",
144
+ "size",
145
+ "anchorRef"
146
+ ]);
147
+ warnForStyleOverrides(rest);
148
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
149
+ "a",
150
+ __spreadProps(__spreadValues({
151
+ className: (0, import_clsx2.clsx)(
152
+ (0, import_typed_classname2.t)("hds-link"),
153
+ variant !== "underline" && (0, import_typed_classname2.t)(`hds-link--${variant}`),
154
+ size !== "medium" && (0, import_typed_classname2.t)(`hds-link--${size}`)
155
+ ),
156
+ ref: anchorRef
157
+ }, rest), {
158
+ children
159
+ })
160
+ );
161
+ }
162
+ Link.displayName = "Link";
163
+
164
+ // src/badge/index.tsx
165
+ var import_tokens3 = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css");
166
+ var import_base3 = require("@postenbring/hedwig-css/dist/base.css");
167
+ var import_badge = require("@postenbring/hedwig-css/dist/badge/badge.css");
168
+
169
+ // src/badge/badge.tsx
170
+ var import_clsx3 = require("clsx");
171
+ var import_typed_classname3 = require("@postenbring/hedwig-css/typed-classname.mjs");
172
+ var import_jsx_runtime3 = require("react/jsx-runtime");
173
+ function BaseBadge(_a) {
174
+ var _b = _a, {
175
+ children,
176
+ variant,
177
+ size = "small"
178
+ } = _b, rest = __objRest(_b, [
179
+ "children",
180
+ "variant",
181
+ "size"
182
+ ]);
183
+ warnForStyleOverrides(rest);
184
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: (0, import_clsx3.clsx)((0, import_typed_classname3.t)("hds-badge"), (0, import_typed_classname3.t)(`hds-badge--${size}`), (0, import_typed_classname3.t)(`hds-badge--${variant}`)), children });
185
+ }
186
+ BaseBadge.displayName = "BaseBadge";
187
+ function Badge(props) {
188
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
189
+ }
190
+ Badge.displayName = "Badge";
191
+ function DarkBadge(props) {
192
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "dark" }));
193
+ }
194
+ DarkBadge.displayName = "DarkBadge";
195
+ function WhiteBadge(props) {
196
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "white" }));
197
+ }
198
+ WhiteBadge.displayName = "WhiteBadge";
199
+ function WarningBadge(props) {
200
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "warning" }));
201
+ }
202
+ WarningBadge.displayName = "Badge";
203
+ // Annotate the CommonJS export names for ESM import in node:
204
+ 0 && (module.exports = {
205
+ Badge,
206
+ DarkBadge,
207
+ Link,
208
+ PrimaryButton,
209
+ SecondaryButton,
210
+ WarningBadge,
211
+ WhiteBadge
212
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,95 @@
1
+ import {
2
+ PrimaryButton,
3
+ SecondaryButton,
4
+ __objRest,
5
+ __spreadProps,
6
+ __spreadValues,
7
+ warnForStyleOverrides
8
+ } from "./chunk-WBIRSCID.mjs";
9
+
10
+ // src/link/index.tsx
11
+ import "@postenbring/hedwig-tokens/tokens-output/css/tokens.css";
12
+ import "@postenbring/hedwig-css/dist/base.css";
13
+ import "@postenbring/hedwig-css/dist/link/link.css";
14
+
15
+ // src/link/link.tsx
16
+ import { clsx } from "clsx";
17
+ import { t } from "@postenbring/hedwig-css/typed-classname.mjs";
18
+ import { jsx } from "react/jsx-runtime";
19
+ function Link(_a) {
20
+ var _b = _a, {
21
+ children,
22
+ variant = "underline",
23
+ size = "medium",
24
+ anchorRef
25
+ } = _b, rest = __objRest(_b, [
26
+ "children",
27
+ "variant",
28
+ "size",
29
+ "anchorRef"
30
+ ]);
31
+ warnForStyleOverrides(rest);
32
+ return /* @__PURE__ */ jsx(
33
+ "a",
34
+ __spreadProps(__spreadValues({
35
+ className: clsx(
36
+ t("hds-link"),
37
+ variant !== "underline" && t(`hds-link--${variant}`),
38
+ size !== "medium" && t(`hds-link--${size}`)
39
+ ),
40
+ ref: anchorRef
41
+ }, rest), {
42
+ children
43
+ })
44
+ );
45
+ }
46
+ Link.displayName = "Link";
47
+
48
+ // src/badge/index.tsx
49
+ import "@postenbring/hedwig-tokens/tokens-output/css/tokens.css";
50
+ import "@postenbring/hedwig-css/dist/base.css";
51
+ import "@postenbring/hedwig-css/dist/badge/badge.css";
52
+
53
+ // src/badge/badge.tsx
54
+ import { clsx as clsx2 } from "clsx";
55
+ import { t as t2 } from "@postenbring/hedwig-css/typed-classname.mjs";
56
+ import { jsx as jsx2 } from "react/jsx-runtime";
57
+ function BaseBadge(_a) {
58
+ var _b = _a, {
59
+ children,
60
+ variant,
61
+ size = "small"
62
+ } = _b, rest = __objRest(_b, [
63
+ "children",
64
+ "variant",
65
+ "size"
66
+ ]);
67
+ warnForStyleOverrides(rest);
68
+ return /* @__PURE__ */ jsx2("span", { className: clsx2(t2("hds-badge"), t2(`hds-badge--${size}`), t2(`hds-badge--${variant}`)), children });
69
+ }
70
+ BaseBadge.displayName = "BaseBadge";
71
+ function Badge(props) {
72
+ return /* @__PURE__ */ jsx2(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
73
+ }
74
+ Badge.displayName = "Badge";
75
+ function DarkBadge(props) {
76
+ return /* @__PURE__ */ jsx2(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "dark" }));
77
+ }
78
+ DarkBadge.displayName = "DarkBadge";
79
+ function WhiteBadge(props) {
80
+ return /* @__PURE__ */ jsx2(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "white" }));
81
+ }
82
+ WhiteBadge.displayName = "WhiteBadge";
83
+ function WarningBadge(props) {
84
+ return /* @__PURE__ */ jsx2(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "warning" }));
85
+ }
86
+ WarningBadge.displayName = "Badge";
87
+ export {
88
+ Badge,
89
+ DarkBadge,
90
+ Link,
91
+ PrimaryButton,
92
+ SecondaryButton,
93
+ WarningBadge,
94
+ WhiteBadge
95
+ };
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@postenbring/hedwig-react",
3
+ "version": "0.0.0-badge-20231116111626",
4
+ "main": "./dist/index.js",
5
+ "module": "./dist/index.mjs",
6
+ "types": "./dist/index.d.ts",
7
+ "sideEffects": false,
8
+ "license": "MIT",
9
+ "files": [
10
+ "dist/**"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsup --format esm,cjs --dts --external react",
14
+ "dev": "tsup --format esm,cjs --watch --dts --external react",
15
+ "lint": "eslint src/",
16
+ "typecheck": "tsc --noEmit",
17
+ "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
18
+ },
19
+ "devDependencies": {
20
+ "@types/react": "^18.2.37",
21
+ "@types/react-dom": "^18.2.15",
22
+ "eslint-config-custom": "*",
23
+ "hedwig-tsconfig": "*",
24
+ "react": "^18.2.0",
25
+ "tsup": "^7.2.0",
26
+ "typescript": "^5.2.2"
27
+ },
28
+ "dependencies": {
29
+ "@postenbring/hedwig-css": "0.0.0-badge-20231116111626",
30
+ "@postenbring/hedwig-tokens": "*",
31
+ "clsx": "^2.0.0"
32
+ },
33
+ "publishConfig": {
34
+ "access": "public"
35
+ }
36
+ }