@postenbring/hedwig-react 0.0.3 → 0.0.5

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.
Files changed (109) hide show
  1. package/dist/accordion/accordion-item-content.d.mts +9 -0
  2. package/dist/accordion/accordion-item-content.d.ts +9 -0
  3. package/dist/accordion/accordion-item-content.js +98 -0
  4. package/dist/accordion/accordion-item-content.mjs +8 -0
  5. package/dist/accordion/accordion-item-trigger.d.mts +9 -0
  6. package/dist/accordion/accordion-item-trigger.d.ts +9 -0
  7. package/dist/accordion/accordion-item-trigger.js +108 -0
  8. package/dist/accordion/accordion-item-trigger.mjs +8 -0
  9. package/dist/accordion/accordion-item.d.mts +15 -0
  10. package/dist/accordion/accordion-item.d.ts +15 -0
  11. package/dist/accordion/accordion-item.js +116 -0
  12. package/dist/accordion/accordion-item.mjs +8 -0
  13. package/dist/accordion/accordion.d.mts +28 -0
  14. package/dist/accordion/accordion.d.ts +28 -0
  15. package/dist/accordion/accordion.js +93 -0
  16. package/dist/accordion/accordion.mjs +8 -0
  17. package/dist/accordion/index.d.mts +6 -0
  18. package/dist/accordion/index.d.ts +6 -0
  19. package/dist/accordion/index.js +217 -0
  20. package/dist/accordion/index.mjs +21 -0
  21. package/dist/badge/badge.d.mts +28 -0
  22. package/dist/badge/badge.d.ts +28 -0
  23. package/dist/badge/badge.js +103 -0
  24. package/dist/badge/badge.mjs +13 -0
  25. package/dist/badge/index.d.mts +3 -0
  26. package/dist/badge/index.d.ts +3 -0
  27. package/dist/badge/index.js +109 -0
  28. package/dist/badge/index.mjs +14 -0
  29. package/dist/box/box.d.mts +36 -0
  30. package/dist/box/box.d.ts +36 -0
  31. package/dist/box/box.js +131 -0
  32. package/dist/box/box.mjs +9 -0
  33. package/dist/box/index.d.mts +3 -0
  34. package/dist/box/index.d.ts +3 -0
  35. package/dist/box/index.js +137 -0
  36. package/dist/box/index.mjs +10 -0
  37. package/dist/button/button.d.mts +37 -0
  38. package/dist/button/button.d.ts +37 -0
  39. package/dist/button/button.js +103 -0
  40. package/dist/button/button.mjs +9 -0
  41. package/dist/button/index.d.mts +3 -37
  42. package/dist/button/index.d.ts +3 -37
  43. package/dist/button/index.js +9 -21
  44. package/dist/button/index.mjs +3 -1
  45. package/dist/chunk-2V6SWZ5G.mjs +16 -0
  46. package/dist/chunk-4XWB4ZSR.mjs +6 -0
  47. package/dist/chunk-7F7QB4D5.mjs +50 -0
  48. package/dist/chunk-AYGPUYPZ.mjs +5 -0
  49. package/dist/chunk-B3PZUFG2.mjs +40 -0
  50. package/dist/chunk-CYW3DUD2.mjs +5 -0
  51. package/dist/chunk-EKFYWUBE.mjs +36 -0
  52. package/dist/chunk-EX4U7YZF.mjs +83 -0
  53. package/dist/chunk-FUJQIYOF.mjs +37 -0
  54. package/dist/chunk-GSPFHK2Z.mjs +55 -0
  55. package/dist/chunk-ID5KKZMK.mjs +5 -0
  56. package/dist/chunk-IOOSUX5O.mjs +6 -0
  57. package/dist/chunk-IWDN3WGQ.mjs +47 -0
  58. package/dist/chunk-IWV4FFE3.mjs +35 -0
  59. package/dist/chunk-KBVDBI2L.mjs +59 -0
  60. package/dist/chunk-LNYNZ4EG.mjs +40 -0
  61. package/dist/chunk-NMSLCM2K.mjs +18 -0
  62. package/dist/chunk-O3NMR6GE.mjs +53 -0
  63. package/dist/chunk-PCKWBORI.mjs +5 -0
  64. package/dist/chunk-VZNNGRKM.mjs +5 -0
  65. package/dist/chunk-X3OAJSS2.mjs +41 -0
  66. package/dist/index.d.mts +15 -27
  67. package/dist/index.d.ts +15 -27
  68. package/dist/index.js +443 -29
  69. package/dist/index.mjs +69 -43
  70. package/dist/input/input.d.mts +13 -0
  71. package/dist/input/input.d.ts +13 -0
  72. package/dist/input/input.js +109 -0
  73. package/dist/input/input.mjs +51 -0
  74. package/dist/link/index.d.mts +3 -0
  75. package/dist/link/index.d.ts +3 -0
  76. package/dist/link/index.js +94 -0
  77. package/dist/link/index.mjs +8 -0
  78. package/dist/link/link.d.mts +26 -0
  79. package/dist/link/link.d.ts +26 -0
  80. package/dist/link/link.js +88 -0
  81. package/dist/link/link.mjs +7 -0
  82. package/dist/list/description-list.d.mts +32 -0
  83. package/dist/list/description-list.d.ts +32 -0
  84. package/dist/list/description-list.js +89 -0
  85. package/dist/list/description-list.mjs +13 -0
  86. package/dist/list/index.d.mts +5 -0
  87. package/dist/list/index.d.ts +5 -0
  88. package/dist/list/index.js +144 -0
  89. package/dist/list/index.mjs +22 -0
  90. package/dist/list/link-list.d.mts +13 -0
  91. package/dist/list/link-list.d.ts +13 -0
  92. package/dist/list/link-list.js +102 -0
  93. package/dist/list/link-list.mjs +8 -0
  94. package/dist/list/list.d.mts +25 -0
  95. package/dist/list/list.d.ts +25 -0
  96. package/dist/list/list.js +95 -0
  97. package/dist/list/list.mjs +9 -0
  98. package/dist/message/index.d.mts +4 -0
  99. package/dist/message/index.d.ts +4 -0
  100. package/dist/message/index.js +162 -0
  101. package/dist/message/index.mjs +9 -0
  102. package/dist/message/message.d.mts +16 -0
  103. package/dist/message/message.d.ts +16 -0
  104. package/dist/message/message.js +155 -0
  105. package/dist/message/message.mjs +8 -0
  106. package/dist/utils-BfZsjuFH.d.mts +17 -0
  107. package/dist/utils-BfZsjuFH.d.ts +17 -0
  108. package/package.json +17 -17
  109. package/dist/chunk-ZPSTPWVB.mjs +0 -103
@@ -0,0 +1,217 @@
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/accordion/index.tsx
50
+ var accordion_exports = {};
51
+ __export(accordion_exports, {
52
+ Accordion: () => Accordion,
53
+ AccordionContent: () => AccordionContent,
54
+ AccordionItem: () => AccordionItem,
55
+ AccordionTrigger: () => AccordionTrigger
56
+ });
57
+ module.exports = __toCommonJS(accordion_exports);
58
+ var import_fonts = require("@postenbring/hedwig-tokens/tokens-output/css/fonts.css");
59
+ var import_tokens = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css");
60
+ var import_base = require("@postenbring/hedwig-css/dist/base.css");
61
+ var import_accordion = require("@postenbring/hedwig-css/dist/accordion.css");
62
+
63
+ // src/accordion/accordion.tsx
64
+ var import_react2 = require("react");
65
+ var import_clsx = require("clsx");
66
+ var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
67
+
68
+ // src/accordion/context.ts
69
+ var import_react = require("react");
70
+ var AccordionContext = (0, import_react.createContext)({
71
+ variant: "multiple",
72
+ mounted: false,
73
+ openItems: [],
74
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Added default section, without handling
75
+ toggleOpenItem: (id) => {
76
+ }
77
+ });
78
+ var AccordionItemContext = (0, import_react.createContext)(null);
79
+
80
+ // src/accordion/accordion.tsx
81
+ var import_jsx_runtime = require("react/jsx-runtime");
82
+ var Accordion = (0, import_react2.forwardRef)(
83
+ (_a, ref) => {
84
+ var _b = _a, { as: Component = "div", children, className, variant = "multiple" } = _b, rest = __objRest(_b, ["as", "children", "className", "variant"]);
85
+ const [openItems, setOpenItems] = (0, import_react2.useState)([]);
86
+ const toggleOpenItem = (itemId) => {
87
+ if (variant === "single") {
88
+ setOpenItems([itemId]);
89
+ } else {
90
+ setOpenItems(
91
+ openItems.includes(itemId) ? openItems.filter((id) => id !== itemId) : [...openItems, itemId]
92
+ );
93
+ }
94
+ };
95
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionContext.Provider, { value: { variant, openItems, toggleOpenItem, mounted: true }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, __spreadProps(__spreadValues({}, rest), { className: (0, import_clsx.clsx)((0, import_typed_classname.t)("hds-accordion"), className), ref, children })) });
96
+ }
97
+ );
98
+ Accordion.displayName = "Accordion";
99
+
100
+ // src/accordion/accordion-item.tsx
101
+ var import_react3 = require("react");
102
+ var import_clsx2 = require("clsx");
103
+ var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
104
+ var import_jsx_runtime2 = require("react/jsx-runtime");
105
+ var AccordionItem = (0, import_react3.forwardRef)(
106
+ (_a, ref) => {
107
+ var _b = _a, { as: Component = "div", children, className } = _b, rest = __objRest(_b, ["as", "children", "className"]);
108
+ const context = (0, import_react3.useContext)(AccordionContext);
109
+ const [open, setOpen] = (0, import_react3.useState)(false);
110
+ const accordionItemId = (0, import_react3.useId)();
111
+ const handleOpen = () => {
112
+ setOpen(!open);
113
+ if (context.variant === "single") {
114
+ context.toggleOpenItem(accordionItemId);
115
+ }
116
+ };
117
+ if (!context.mounted) {
118
+ throw new Error("Context required. Did you use <AccordionItem/> outside of <Accordion/>?");
119
+ }
120
+ (0, import_react3.useEffect)(() => {
121
+ if (context.variant === "multiple") {
122
+ return;
123
+ }
124
+ if (open && !context.openItems.includes(accordionItemId)) {
125
+ setOpen(false);
126
+ }
127
+ }, [context.openItems]);
128
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
129
+ Component,
130
+ __spreadProps(__spreadValues({}, rest), {
131
+ className: (0, import_clsx2.clsx)(
132
+ (0, import_typed_classname2.t)("hds-accordion-item"),
133
+ {
134
+ [(0, import_typed_classname2.t)(`hds-accordion-item__expanded`)]: open
135
+ },
136
+ className
137
+ ),
138
+ ref,
139
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AccordionItemContext.Provider, { value: { open, setOpen: handleOpen }, children })
140
+ })
141
+ );
142
+ }
143
+ );
144
+ AccordionItem.displayName = "AccordionItem";
145
+
146
+ // src/accordion/accordion-item-trigger.tsx
147
+ var import_react4 = require("react");
148
+ var import_typed_classname3 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
149
+ var import_clsx3 = require("clsx");
150
+ var import_jsx_runtime3 = require("react/jsx-runtime");
151
+ function FaArrowDownButNotReally() {
152
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "v " });
153
+ }
154
+ function FaArrowUpButNotReally() {
155
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "^ " });
156
+ }
157
+ var AccordionTrigger = (0, import_react4.forwardRef)((_a, ref) => {
158
+ var _b = _a, { as: Component = "button", children, className, onClick } = _b, rest = __objRest(_b, ["as", "children", "className", "onClick"]);
159
+ const itemContext = (0, import_react4.useContext)(AccordionItemContext);
160
+ if (itemContext === null) {
161
+ return null;
162
+ }
163
+ const expandOrCollapse = (e) => {
164
+ itemContext.setOpen(!itemContext.open);
165
+ onClick && onClick(e);
166
+ };
167
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
168
+ Component,
169
+ __spreadProps(__spreadValues({}, rest), {
170
+ "aria-expanded": itemContext.open,
171
+ className: (0, import_clsx3.clsx)((0, import_typed_classname3.t)("hds-accordion-item-trigger"), className),
172
+ onClick: expandOrCollapse,
173
+ ref,
174
+ type: "button",
175
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
176
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: (0, import_clsx3.clsx)((0, import_typed_classname3.t)("hds-accordion-item-trigger--icon")), children: itemContext.open ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FaArrowUpButNotReally, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FaArrowDownButNotReally, {}) }),
177
+ children
178
+ ] })
179
+ })
180
+ );
181
+ });
182
+ AccordionTrigger.displayName = "AccordionTrigger";
183
+
184
+ // src/accordion/accordion-item-content.tsx
185
+ var import_react5 = require("react");
186
+ var import_clsx4 = require("clsx");
187
+ var import_typed_classname4 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
188
+ var import_jsx_runtime4 = require("react/jsx-runtime");
189
+ var AccordionContent = (0, import_react5.forwardRef)((_a, ref) => {
190
+ var _b = _a, { as: Component = "div", children, className } = _b, rest = __objRest(_b, ["as", "children", "className"]);
191
+ const context = (0, import_react5.useContext)(AccordionItemContext);
192
+ if (context === null) {
193
+ return null;
194
+ }
195
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
196
+ Component,
197
+ __spreadProps(__spreadValues({}, rest), {
198
+ className: (0, import_clsx4.clsx)(
199
+ (0, import_typed_classname4.t)("hds-accordion-item-content"),
200
+ {
201
+ [(0, import_typed_classname4.t)(`hds-accordion-item-content--closed`)]: !context.open
202
+ },
203
+ className
204
+ ),
205
+ ref,
206
+ children
207
+ })
208
+ );
209
+ });
210
+ AccordionContent.displayName = "AccordionContent";
211
+ // Annotate the CommonJS export names for ESM import in node:
212
+ 0 && (module.exports = {
213
+ Accordion,
214
+ AccordionContent,
215
+ AccordionItem,
216
+ AccordionTrigger
217
+ });
@@ -0,0 +1,21 @@
1
+ import "../chunk-PCKWBORI.mjs";
2
+ import {
3
+ AccordionContent
4
+ } from "../chunk-LNYNZ4EG.mjs";
5
+ import {
6
+ AccordionTrigger
7
+ } from "../chunk-7F7QB4D5.mjs";
8
+ import {
9
+ AccordionItem
10
+ } from "../chunk-KBVDBI2L.mjs";
11
+ import {
12
+ Accordion
13
+ } from "../chunk-IWV4FFE3.mjs";
14
+ import "../chunk-2V6SWZ5G.mjs";
15
+ import "../chunk-FUJQIYOF.mjs";
16
+ export {
17
+ Accordion,
18
+ AccordionContent,
19
+ AccordionItem,
20
+ AccordionTrigger
21
+ };
@@ -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 React.AnchorHTMLAttributes<HTMLSpanElement> {
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, type 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 React.AnchorHTMLAttributes<HTMLSpanElement> {
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, type BadgeProps, DarkBadge, WarningBadge, WhiteBadge };
@@ -0,0 +1,103 @@
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
+ var import_jsx_runtime = require("react/jsx-runtime");
61
+ function BaseBadge(_a) {
62
+ var _b = _a, {
63
+ children,
64
+ variant,
65
+ size = "small"
66
+ } = _b, rest = __objRest(_b, [
67
+ "children",
68
+ "variant",
69
+ "size"
70
+ ]);
71
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
72
+ "span",
73
+ __spreadProps(__spreadValues({
74
+ 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}`))
75
+ }, rest), {
76
+ children
77
+ })
78
+ );
79
+ }
80
+ BaseBadge.displayName = "BaseBadge";
81
+ function Badge(props) {
82
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
83
+ }
84
+ Badge.displayName = "Badge";
85
+ function DarkBadge(props) {
86
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "dark" }));
87
+ }
88
+ DarkBadge.displayName = "DarkBadge";
89
+ function WhiteBadge(props) {
90
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "white" }));
91
+ }
92
+ WhiteBadge.displayName = "WhiteBadge";
93
+ function WarningBadge(props) {
94
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "warning" }));
95
+ }
96
+ WarningBadge.displayName = "WarningBadge";
97
+ // Annotate the CommonJS export names for ESM import in node:
98
+ 0 && (module.exports = {
99
+ Badge,
100
+ DarkBadge,
101
+ WarningBadge,
102
+ WhiteBadge
103
+ });
@@ -0,0 +1,13 @@
1
+ import {
2
+ Badge,
3
+ DarkBadge,
4
+ WarningBadge,
5
+ WhiteBadge
6
+ } from "../chunk-O3NMR6GE.mjs";
7
+ import "../chunk-FUJQIYOF.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,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/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_fonts = require("@postenbring/hedwig-tokens/tokens-output/css/fonts.css");
59
+ var import_tokens = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css");
60
+ var import_base = require("@postenbring/hedwig-css/dist/base.css");
61
+ var import_badge = require("@postenbring/hedwig-css/dist/badge.css");
62
+
63
+ // src/badge/badge.tsx
64
+ var import_clsx = require("clsx");
65
+ var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
66
+ var import_jsx_runtime = require("react/jsx-runtime");
67
+ function BaseBadge(_a) {
68
+ var _b = _a, {
69
+ children,
70
+ variant,
71
+ size = "small"
72
+ } = _b, rest = __objRest(_b, [
73
+ "children",
74
+ "variant",
75
+ "size"
76
+ ]);
77
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
78
+ "span",
79
+ __spreadProps(__spreadValues({
80
+ 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}`))
81
+ }, rest), {
82
+ children
83
+ })
84
+ );
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,14 @@
1
+ import "../chunk-CYW3DUD2.mjs";
2
+ import {
3
+ Badge,
4
+ DarkBadge,
5
+ WarningBadge,
6
+ WhiteBadge
7
+ } from "../chunk-O3NMR6GE.mjs";
8
+ import "../chunk-FUJQIYOF.mjs";
9
+ export {
10
+ Badge,
11
+ DarkBadge,
12
+ WarningBadge,
13
+ WhiteBadge
14
+ };
@@ -0,0 +1,36 @@
1
+ import * as React$1 from 'react';
2
+ import { O as OverridableComponent } from '../utils-BfZsjuFH.mjs';
3
+
4
+ interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ variant?: "light-grey" | "lighter" | "white" | "warning";
6
+ children: React.ReactNode;
7
+ /**
8
+ * If `true`, the close button will be hidden.
9
+ * Use when you want to control the close button using the BoxCloseButton component.
10
+ */
11
+ hideCloseButton?: boolean;
12
+ /**
13
+ * Callback fired when the component requests to be closed.
14
+ * If not set, the component will be closed without any user interaction.
15
+ *
16
+ * If set, and the handler returns non-true value, the component will not be closed.
17
+ * Use this if you want to control the closing of the component, using the `closed` prop
18
+ *
19
+ * If set, and the handler returns the true, the component will be closed.
20
+ * Use this with `window.confirm()` to ask the user to confirm closing the component.
21
+ */
22
+ onClose?: () => boolean | unknown;
23
+ /**
24
+ * If `true`, the box will be closed and hidden from view
25
+ */
26
+ closed?: boolean;
27
+ /**
28
+ * Props applied to the close button element.
29
+ */
30
+ closeButtonProps?: BoxCloseButtonProps;
31
+ }
32
+ declare const Box: OverridableComponent<BoxProps, HTMLDivElement>;
33
+ type BoxCloseButtonProps = Omit<React.HTMLAttributes<HTMLButtonElement>, "children">;
34
+ declare const BoxCloseButton: React$1.ForwardRefExoticComponent<BoxCloseButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
35
+
36
+ export { Box, BoxCloseButton, type BoxCloseButtonProps, type BoxProps };
@@ -0,0 +1,36 @@
1
+ import * as React$1 from 'react';
2
+ import { O as OverridableComponent } from '../utils-BfZsjuFH.js';
3
+
4
+ interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ variant?: "light-grey" | "lighter" | "white" | "warning";
6
+ children: React.ReactNode;
7
+ /**
8
+ * If `true`, the close button will be hidden.
9
+ * Use when you want to control the close button using the BoxCloseButton component.
10
+ */
11
+ hideCloseButton?: boolean;
12
+ /**
13
+ * Callback fired when the component requests to be closed.
14
+ * If not set, the component will be closed without any user interaction.
15
+ *
16
+ * If set, and the handler returns non-true value, the component will not be closed.
17
+ * Use this if you want to control the closing of the component, using the `closed` prop
18
+ *
19
+ * If set, and the handler returns the true, the component will be closed.
20
+ * Use this with `window.confirm()` to ask the user to confirm closing the component.
21
+ */
22
+ onClose?: () => boolean | unknown;
23
+ /**
24
+ * If `true`, the box will be closed and hidden from view
25
+ */
26
+ closed?: boolean;
27
+ /**
28
+ * Props applied to the close button element.
29
+ */
30
+ closeButtonProps?: BoxCloseButtonProps;
31
+ }
32
+ declare const Box: OverridableComponent<BoxProps, HTMLDivElement>;
33
+ type BoxCloseButtonProps = Omit<React.HTMLAttributes<HTMLButtonElement>, "children">;
34
+ declare const BoxCloseButton: React$1.ForwardRefExoticComponent<BoxCloseButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
35
+
36
+ export { Box, BoxCloseButton, type BoxCloseButtonProps, type BoxProps };