@postenbring/hedwig-react 4.5.1 → 4.6.0

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 (70) hide show
  1. package/dist/alert/alert.js +82 -33
  2. package/dist/alert/alert.js.map +1 -1
  3. package/dist/alert/alert.mjs +3 -2
  4. package/dist/alert/index.js +82 -33
  5. package/dist/alert/index.js.map +1 -1
  6. package/dist/alert/index.mjs +3 -2
  7. package/dist/box/box.d.ts.map +1 -1
  8. package/dist/box/box.js +69 -20
  9. package/dist/box/box.js.map +1 -1
  10. package/dist/box/box.mjs +2 -1
  11. package/dist/box/index.js +69 -20
  12. package/dist/box/index.js.map +1 -1
  13. package/dist/box/index.mjs +2 -1
  14. package/dist/{chunk-ILN2L5NX.mjs → chunk-B2DZ6JJ4.mjs} +2 -2
  15. package/dist/{chunk-INDTHGWZ.mjs → chunk-KAVKFO2R.mjs} +2 -2
  16. package/dist/{chunk-DEABU7DB.mjs → chunk-P4AKOVM7.mjs} +9 -9
  17. package/dist/chunk-P4AKOVM7.mjs.map +1 -0
  18. package/dist/{chunk-NAXSP4VU.mjs → chunk-PKEPSKTZ.mjs} +2 -2
  19. package/dist/{chunk-YQT2TN3U.mjs → chunk-QQKPLLCE.mjs} +4 -3
  20. package/dist/chunk-QQKPLLCE.mjs.map +1 -0
  21. package/dist/{chunk-QDG2QLFV.mjs → chunk-UXZKGAZ2.mjs} +4 -4
  22. package/dist/{chunk-PZUJLRG4.mjs → chunk-WFIS2ZYQ.mjs} +2 -2
  23. package/dist/footer/footer.mjs +2 -2
  24. package/dist/footer/index.mjs +2 -2
  25. package/dist/form/error-summary/error-summary.js +104 -55
  26. package/dist/form/error-summary/error-summary.js.map +1 -1
  27. package/dist/form/error-summary/error-summary.mjs +3 -2
  28. package/dist/form/error-summary/index.js +104 -55
  29. package/dist/form/error-summary/index.js.map +1 -1
  30. package/dist/form/error-summary/index.mjs +3 -2
  31. package/dist/form/index.js +166 -117
  32. package/dist/form/index.js.map +1 -1
  33. package/dist/form/index.mjs +16 -15
  34. package/dist/help-text/help-text.js +79 -30
  35. package/dist/help-text/help-text.js.map +1 -1
  36. package/dist/help-text/help-text.mjs +3 -2
  37. package/dist/help-text/index.js +79 -30
  38. package/dist/help-text/index.js.map +1 -1
  39. package/dist/help-text/index.mjs +3 -2
  40. package/dist/index.js +104 -104
  41. package/dist/index.js.map +1 -1
  42. package/dist/index.mjs +42 -42
  43. package/dist/message/index.js +83 -34
  44. package/dist/message/index.js.map +1 -1
  45. package/dist/message/index.mjs +3 -2
  46. package/dist/message/message.js +83 -34
  47. package/dist/message/message.js.map +1 -1
  48. package/dist/message/message.mjs +3 -2
  49. package/dist/modal/index.js +95 -45
  50. package/dist/modal/index.js.map +1 -1
  51. package/dist/modal/index.mjs +3 -2
  52. package/dist/modal/modal.d.ts +5 -0
  53. package/dist/modal/modal.d.ts.map +1 -1
  54. package/dist/modal/modal.js +95 -45
  55. package/dist/modal/modal.js.map +1 -1
  56. package/dist/modal/modal.mjs +3 -2
  57. package/dist/navbar/icons.d.ts +2 -2
  58. package/dist/navbar/icons.d.ts.map +1 -1
  59. package/dist/navbar/navbar-expandable-menu.d.ts +1 -1
  60. package/dist/navbar/navbar-expandable-menu.d.ts.map +1 -1
  61. package/package.json +2 -2
  62. package/src/box/box.tsx +8 -8
  63. package/src/modal/modal.tsx +12 -1
  64. package/dist/chunk-DEABU7DB.mjs.map +0 -1
  65. package/dist/chunk-YQT2TN3U.mjs.map +0 -1
  66. /package/dist/{chunk-ILN2L5NX.mjs.map → chunk-B2DZ6JJ4.mjs.map} +0 -0
  67. /package/dist/{chunk-INDTHGWZ.mjs.map → chunk-KAVKFO2R.mjs.map} +0 -0
  68. /package/dist/{chunk-NAXSP4VU.mjs.map → chunk-PKEPSKTZ.mjs.map} +0 -0
  69. /package/dist/{chunk-QDG2QLFV.mjs.map → chunk-UXZKGAZ2.mjs.map} +0 -0
  70. /package/dist/{chunk-PZUJLRG4.mjs.map → chunk-WFIS2ZYQ.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -31,31 +31,10 @@ import {
31
31
  TabsTab
32
32
  } from "./chunk-WVCJV74B.mjs";
33
33
  import "./chunk-KQITCS3U.mjs";
34
- import "./chunk-JTZPQHKD.mjs";
35
- import {
36
- Skeleton
37
- } from "./chunk-QTC4ATZD.mjs";
38
- import "./chunk-RC76SXBP.mjs";
39
- import {
40
- Message,
41
- MessageDescription,
42
- MessageTitle
43
- } from "./chunk-ILN2L5NX.mjs";
44
34
  import "./chunk-AJFQHFQT.mjs";
45
35
  import {
46
36
  Spinner
47
37
  } from "./chunk-ZTZAPNZB.mjs";
48
- import "./chunk-TJH5QJMS.mjs";
49
- import {
50
- StepIndicator
51
- } from "./chunk-XQBJ75VD.mjs";
52
- import "./chunk-FYFJ75NX.mjs";
53
- import {
54
- Modal,
55
- ModalContent,
56
- ModalFooter,
57
- ModalHeader
58
- } from "./chunk-YQT2TN3U.mjs";
59
38
  import "./chunk-H3E546OT.mjs";
60
39
  import {
61
40
  Navbar,
@@ -74,10 +53,25 @@ import {
74
53
  useNavbarExpendableMenuContext
75
54
  } from "./chunk-HOLFVKXQ.mjs";
76
55
  import "./chunk-XMDDGSCF.mjs";
56
+ import "./chunk-TJH5QJMS.mjs";
57
+ import {
58
+ StepIndicator
59
+ } from "./chunk-XQBJ75VD.mjs";
60
+ import "./chunk-FYFJ75NX.mjs";
61
+ import {
62
+ Modal,
63
+ ModalContent,
64
+ ModalFooter,
65
+ ModalHeader
66
+ } from "./chunk-QQKPLLCE.mjs";
77
67
  import "./chunk-SRLM3K2X.mjs";
78
68
  import {
79
69
  ShowMoreButton
80
70
  } from "./chunk-JUHJZLH2.mjs";
71
+ import "./chunk-JTZPQHKD.mjs";
72
+ import {
73
+ Skeleton
74
+ } from "./chunk-QTC4ATZD.mjs";
81
75
  import "./chunk-BVG5VSZK.mjs";
82
76
  import {
83
77
  Container
@@ -95,6 +89,12 @@ import {
95
89
  } from "./chunk-FUIKSOJF.mjs";
96
90
  import "./chunk-7ROE6ADK.mjs";
97
91
  import "./chunk-NE6W2PCD.mjs";
92
+ import "./chunk-RC76SXBP.mjs";
93
+ import {
94
+ Message,
95
+ MessageDescription,
96
+ MessageTitle
97
+ } from "./chunk-B2DZ6JJ4.mjs";
98
98
  import "./chunk-2YL2MVWN.mjs";
99
99
  import "./chunk-K2CB2NLY.mjs";
100
100
  import {
@@ -107,7 +107,7 @@ import {
107
107
  FooterLinkSection,
108
108
  FooterLinkSections,
109
109
  FooterLogo
110
- } from "./chunk-QDG2QLFV.mjs";
110
+ } from "./chunk-UXZKGAZ2.mjs";
111
111
  import "./chunk-5J5LYE6Z.mjs";
112
112
  import "./chunk-BYEJZSG5.mjs";
113
113
  import {
@@ -141,20 +141,6 @@ import {
141
141
  SearchWrapper
142
142
  } from "./chunk-RJ763KDH.mjs";
143
143
  import "./chunk-KPPLVGZ3.mjs";
144
- import {
145
- ErrorSummary
146
- } from "./chunk-NAXSP4VU.mjs";
147
- import "./chunk-CKAL5ZJZ.mjs";
148
- import "./chunk-7LPYJC6S.mjs";
149
- import {
150
- Input
151
- } from "./chunk-62VLFCXX.mjs";
152
- import "./chunk-TDLSHJ4Z.mjs";
153
- import {
154
- DatePicker
155
- } from "./chunk-RGZSYJFL.mjs";
156
- import "./chunk-Y5SUMFYJ.mjs";
157
- import "./chunk-DMRQEQQK.mjs";
158
144
  import "./chunk-YJOOSTJC.mjs";
159
145
  import {
160
146
  Checkbox
@@ -170,6 +156,16 @@ import {
170
156
  import {
171
157
  FieldsetLegend
172
158
  } from "./chunk-CD4LCDK3.mjs";
159
+ import "./chunk-7LPYJC6S.mjs";
160
+ import {
161
+ Input
162
+ } from "./chunk-62VLFCXX.mjs";
163
+ import "./chunk-TDLSHJ4Z.mjs";
164
+ import {
165
+ DatePicker
166
+ } from "./chunk-RGZSYJFL.mjs";
167
+ import "./chunk-Y5SUMFYJ.mjs";
168
+ import "./chunk-DMRQEQQK.mjs";
173
169
  import "./chunk-NSLSA7F7.mjs";
174
170
  import {
175
171
  ErrorMessage
@@ -178,6 +174,10 @@ import "./chunk-5M6MEYM7.mjs";
178
174
  import {
179
175
  ValidationMessage
180
176
  } from "./chunk-F23MNQCK.mjs";
177
+ import {
178
+ ErrorSummary
179
+ } from "./chunk-PKEPSKTZ.mjs";
180
+ import "./chunk-CKAL5ZJZ.mjs";
181
181
  import "./chunk-XLLYMQLW.mjs";
182
182
  import {
183
183
  Link
@@ -193,12 +193,9 @@ import {
193
193
  import "./chunk-CFAH2LID.mjs";
194
194
  import {
195
195
  HelpText
196
- } from "./chunk-INDTHGWZ.mjs";
196
+ } from "./chunk-KAVKFO2R.mjs";
197
197
  import "./chunk-ISAHCU7C.mjs";
198
198
  import "./chunk-HT2EIJAD.mjs";
199
- import {
200
- Button
201
- } from "./chunk-45Q2TCH6.mjs";
202
199
  import "./chunk-Y6NOEN7R.mjs";
203
200
  import {
204
201
  ButtonList
@@ -262,11 +259,14 @@ import {
262
259
  Alert,
263
260
  AlertDescription,
264
261
  AlertTitle
265
- } from "./chunk-PZUJLRG4.mjs";
262
+ } from "./chunk-WFIS2ZYQ.mjs";
266
263
  import {
267
264
  Box,
268
265
  BoxCloseButton
269
- } from "./chunk-DEABU7DB.mjs";
266
+ } from "./chunk-P4AKOVM7.mjs";
267
+ import {
268
+ Button
269
+ } from "./chunk-45Q2TCH6.mjs";
270
270
  import "./chunk-YOSPWY5K.mjs";
271
271
  export {
272
272
  Accordion,
@@ -56,35 +56,84 @@ __export(message_exports, {
56
56
  module.exports = __toCommonJS(message_exports);
57
57
 
58
58
  // src/message/message.tsx
59
+ var import_react3 = require("react");
60
+ var import_typed_classname3 = require("@postenbring/hedwig-css/typed-classname");
61
+ var import_react_slot3 = require("@radix-ui/react-slot");
62
+
63
+ // src/box/box.tsx
59
64
  var import_react2 = require("react");
60
65
  var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname");
61
66
  var import_react_slot2 = require("@radix-ui/react-slot");
62
67
 
63
- // src/box/box.tsx
68
+ // src/button/button.tsx
64
69
  var import_react = require("react");
65
70
  var import_typed_classname = require("@postenbring/hedwig-css/typed-classname");
66
71
  var import_react_slot = require("@radix-ui/react-slot");
67
72
  var import_jsx_runtime = require("react/jsx-runtime");
73
+ var Button = (0, import_react.forwardRef)(
74
+ (_a, ref) => {
75
+ var _b = _a, {
76
+ asChild,
77
+ children,
78
+ variant = "primary",
79
+ size = "large",
80
+ fullWidth = false,
81
+ icon = false,
82
+ className
83
+ } = _b, rest = __objRest(_b, [
84
+ "asChild",
85
+ "children",
86
+ "variant",
87
+ "size",
88
+ "fullWidth",
89
+ "icon",
90
+ "className"
91
+ ]);
92
+ const Component = asChild ? import_react_slot.Slot : "button";
93
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
94
+ Component,
95
+ __spreadProps(__spreadValues({
96
+ className: (0, import_typed_classname.clsx)(
97
+ "hds-button",
98
+ `hds-button--${size}`,
99
+ `hds-button--${variant}`,
100
+ {
101
+ "hds-button--full": fullWidth === true,
102
+ "hds-button--mobile-full": fullWidth === "mobile",
103
+ "hds-button--only-icon": icon === true,
104
+ "hds-button--leading-icon": icon === "leading",
105
+ "hds-button--trailing-icon": icon === "trailing"
106
+ },
107
+ className
108
+ ),
109
+ ref
110
+ }, rest), {
111
+ children
112
+ })
113
+ );
114
+ }
115
+ );
116
+ Button.displayName = "Button";
117
+
118
+ // src/box/box.tsx
119
+ var import_jsx_runtime2 = require("react/jsx-runtime");
68
120
  function CloseIcon() {
69
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { "aria-hidden": true, xmlns: "http://www.w3.org/2000/svg", width: 32, height: 32, viewBox: "0 0 32 32", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
70
- "path",
71
- {
72
- d: "M17.5469 16.3333L22.375 11.5521L23.3594 10.5677C23.5 10.4271 23.5 10.1927 23.3594 10.0052L22.3281 8.97394C22.1406 8.83331 21.9062 8.83331 21.7656 8.97394L16 14.7864L10.1875 8.97394C10.0469 8.83331 9.8125 8.83331 9.625 8.97394L8.59375 10.0052C8.45312 10.1927 8.45312 10.4271 8.59375 10.5677L14.4062 16.3333L8.59375 22.1458C8.45312 22.2864 8.45312 22.5208 8.59375 22.7083L9.625 23.7396C9.8125 23.8802 10.0469 23.8802 10.1875 23.7396L16 17.9271L20.7812 22.7552L21.7656 23.7396C21.9062 23.8802 22.1406 23.8802 22.3281 23.7396L23.3594 22.7083C23.5 22.5208 23.5 22.2864 23.3594 22.1458L17.5469 16.3333Z",
73
- fill: "currentColor"
74
- }
75
- ) });
121
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 640 640", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M183.1 137.4C170.6 124.9 150.3 124.9 137.8 137.4C125.3 149.9 125.3 170.2 137.8 182.7L275.2 320L137.9 457.4C125.4 469.9 125.4 490.2 137.9 502.7C150.4 515.2 170.7 515.2 183.2 502.7L320.5 365.3L457.9 502.6C470.4 515.1 490.7 515.1 503.2 502.6C515.7 490.1 515.7 469.8 503.2 457.3L365.8 320L503.1 182.6C515.6 170.1 515.6 149.8 503.1 137.3C490.6 124.8 470.3 124.8 457.8 137.3L320.5 274.7L183.1 137.4z" }) });
76
122
  }
77
- var BoxCloseButton = (0, import_react.forwardRef)(
123
+ var BoxCloseButton = (0, import_react2.forwardRef)(
78
124
  (_a, ref) => {
79
125
  var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
80
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
81
- "button",
126
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
127
+ Button,
82
128
  __spreadProps(__spreadValues({
83
- className: (0, import_typed_classname.clsx)("hds-box__close-button", className),
129
+ className: (0, import_typed_classname2.clsx)("hds-box__close-button", className),
130
+ variant: "tertiary",
131
+ size: "small",
132
+ icon: true,
84
133
  ref,
85
134
  type: "button"
86
135
  }, rest), {
87
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CloseIcon, {})
136
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CloseIcon, {})
88
137
  })
89
138
  );
90
139
  }
@@ -102,7 +151,7 @@ var convertVariantToColor = (variant) => {
102
151
  return "neutral";
103
152
  }
104
153
  };
105
- var Box = (0, import_react.forwardRef)(
154
+ var Box = (0, import_react2.forwardRef)(
106
155
  (_a, ref) => {
107
156
  var _b = _a, {
108
157
  "data-color": color = "",
@@ -125,8 +174,8 @@ var Box = (0, import_react.forwardRef)(
125
174
  "children",
126
175
  "className"
127
176
  ]);
128
- const [closedState, setClosedState] = (0, import_react.useState)(false);
129
- const onClose = (0, import_react.useCallback)(() => {
177
+ const [closedState, setClosedState] = (0, import_react2.useState)(false);
178
+ const onClose = (0, import_react2.useCallback)(() => {
130
179
  if (onCloseProp) {
131
180
  const result = onCloseProp();
132
181
  if (result === true) {
@@ -137,13 +186,13 @@ var Box = (0, import_react.forwardRef)(
137
186
  }
138
187
  }, []);
139
188
  const closed = closedProp != null ? closedProp : closedState;
140
- const Component = asChild ? import_react_slot.Slot : "div";
189
+ const Component = asChild ? import_react_slot2.Slot : "div";
141
190
  const resolvedColor = color && color !== "" ? color : convertVariantToColor(variant);
142
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
191
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
143
192
  Component,
144
193
  __spreadProps(__spreadValues({
145
194
  "data-color": resolvedColor,
146
- className: (0, import_typed_classname.clsx)(
195
+ className: (0, import_typed_classname2.clsx)(
147
196
  "hds-box",
148
197
  { "hds-box--lighter": variant === "lighter" },
149
198
  { "hds-box--white": variant === "white" },
@@ -153,8 +202,8 @@ var Box = (0, import_react.forwardRef)(
153
202
  ref
154
203
  }, rest), {
155
204
  children: [
156
- closeable ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)) : null,
157
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_slot.Slottable, { children })
205
+ closeable ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)) : null,
206
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_slot2.Slottable, { children })
158
207
  ]
159
208
  })
160
209
  );
@@ -164,46 +213,46 @@ Box.displayName = "Box";
164
213
  Box.CloseButton = BoxCloseButton;
165
214
 
166
215
  // src/message/message.tsx
167
- var import_jsx_runtime2 = require("react/jsx-runtime");
168
- var MessageTitle = (0, import_react2.forwardRef)(
216
+ var import_jsx_runtime3 = require("react/jsx-runtime");
217
+ var MessageTitle = (0, import_react3.forwardRef)(
169
218
  (_a, ref) => {
170
219
  var _b = _a, { asChild, className } = _b, rest = __objRest(_b, ["asChild", "className"]);
171
- const Component = asChild ? import_react_slot2.Slot : "div";
172
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
220
+ const Component = asChild ? import_react_slot3.Slot : "div";
221
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
173
222
  Component,
174
223
  __spreadValues({
175
- className: (0, import_typed_classname2.clsx)("hds-message__title", className),
224
+ className: (0, import_typed_classname3.clsx)("hds-message__title", className),
176
225
  ref
177
226
  }, rest)
178
227
  );
179
228
  }
180
229
  );
181
230
  MessageTitle.displayName = "Message.Title";
182
- var MessageDescription = (0, import_react2.forwardRef)(
231
+ var MessageDescription = (0, import_react3.forwardRef)(
183
232
  (_a, ref) => {
184
233
  var _b = _a, { asChild, className } = _b, rest = __objRest(_b, ["asChild", "className"]);
185
- const Component = asChild ? import_react_slot2.Slot : "div";
186
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
234
+ const Component = asChild ? import_react_slot3.Slot : "div";
235
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
187
236
  Component,
188
237
  __spreadValues({
189
- className: (0, import_typed_classname2.clsx)("hds-message__description", className),
238
+ className: (0, import_typed_classname3.clsx)("hds-message__description", className),
190
239
  ref
191
240
  }, rest)
192
241
  );
193
242
  }
194
243
  );
195
244
  MessageDescription.displayName = "Message.Description";
196
- var Message = (0, import_react2.forwardRef)(
245
+ var Message = (0, import_react3.forwardRef)(
197
246
  (_a, ref) => {
198
247
  var _b = _a, { children, className, variant = "success", icon, iconClassName } = _b, rest = __objRest(_b, ["children", "className", "variant", "icon", "iconClassName"]);
199
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
248
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
200
249
  Box,
201
250
  __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, variant === "warning" ? { "data-color-scheme": "light" } : {}), {
202
- className: (0, import_typed_classname2.clsx)(`hds-message`, `hds-message--${variant}`, className),
251
+ className: (0, import_typed_classname3.clsx)(`hds-message`, `hds-message--${variant}`, className),
203
252
  ref
204
253
  }), rest), {
205
254
  children: [
206
- variant === "neutral" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: (0, import_typed_classname2.clsx)("hds-message--neutral__icon", iconClassName), children: icon }),
255
+ variant === "neutral" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: (0, import_typed_classname3.clsx)("hds-message--neutral__icon", iconClassName), children: icon }),
207
256
  children
208
257
  ]
209
258
  })
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/message/index.tsx","../../src/message/message.tsx","../../src/box/box.tsx"],"sourcesContent":["export { Message, MessageTitle, MessageDescription } from \"./message\";\nexport type * from \"./message\";\n","import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Box, type BoxProps } from \"../box/box\";\n\nexport interface MessageTitleProps extends React.HTMLAttributes<HTMLParagraphElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\nexport const MessageTitle = forwardRef<HTMLParagraphElement, MessageTitleProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component\n className={clsx(\"hds-message__title\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nMessageTitle.displayName = \"Message.Title\";\n\nexport interface MessageDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\nexport const MessageDescription = forwardRef<HTMLParagraphElement, MessageDescriptionProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component\n className={clsx(\"hds-message__description\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nMessageDescription.displayName = \"Message.Description\";\n\nexport type MessageProps = (\n | {\n variant?: \"success\" | \"attention\" | \"warning\" | \"info\";\n icon?: never;\n iconClassName?: never;\n }\n | {\n variant: \"neutral\";\n icon?: React.ReactNode;\n iconClassName?: string;\n }\n) &\n Omit<BoxProps, \"variant\" | \"asChild\">;\n\n/** @deprecated Use Alert component instead */\nexport const Message = forwardRef<HTMLDivElement, MessageProps>(\n ({ children, className, variant = \"success\", icon, iconClassName, ...rest }, ref) => {\n return (\n <Box\n {...(variant === \"warning\" ? { \"data-color-scheme\": \"light\" } : {})}\n className={clsx(`hds-message`, `hds-message--${variant}`, className as undefined)}\n ref={ref}\n {...rest}\n >\n {variant === \"neutral\" && (\n <div className={clsx(\"hds-message--neutral__icon\", iconClassName as undefined)}>\n {icon}\n </div>\n )}\n {children}\n </Box>\n );\n },\n) as MessageType;\nMessage.displayName = \"Message\";\n\ntype MessageType = ReturnType<typeof forwardRef<HTMLDivElement, MessageProps>> & {\n Title: typeof MessageTitle;\n Description: typeof MessageDescription;\n};\nMessage.Title = MessageTitle;\nMessage.Description = MessageDescription;\n","import { forwardRef, useCallback, useState } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\n\nfunction CloseIcon() {\n return (\n <svg aria-hidden xmlns=\"http://www.w3.org/2000/svg\" width={32} height={32} viewBox=\"0 0 32 32\">\n <path\n d=\"M17.5469 16.3333L22.375 11.5521L23.3594 10.5677C23.5 10.4271 23.5 10.1927 23.3594 10.0052L22.3281 8.97394C22.1406 8.83331 21.9062 8.83331 21.7656 8.97394L16 14.7864L10.1875 8.97394C10.0469 8.83331 9.8125 8.83331 9.625 8.97394L8.59375 10.0052C8.45312 10.1927 8.45312 10.4271 8.59375 10.5677L14.4062 16.3333L8.59375 22.1458C8.45312 22.2864 8.45312 22.5208 8.59375 22.7083L9.625 23.7396C9.8125 23.8802 10.0469 23.8802 10.1875 23.7396L16 17.9271L20.7812 22.7552L21.7656 23.7396C21.9062 23.8802 22.1406 23.8802 22.3281 23.7396L23.3594 22.7083C23.5 22.5208 23.5 22.2864 23.3594 22.1458L17.5469 16.3333Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n\nexport type BoxCloseButtonProps = Omit<React.HTMLAttributes<HTMLButtonElement>, \"children\">;\nexport const BoxCloseButton = forwardRef<HTMLButtonElement, BoxCloseButtonProps>(\n ({ className, ...rest }, ref) => {\n return (\n <button\n className={clsx(\"hds-box__close-button\", className as undefined)}\n ref={ref}\n type=\"button\"\n {...rest}\n >\n <CloseIcon />\n </button>\n );\n },\n);\nBoxCloseButton.displayName = \"Box.CloseButton\";\n\nexport interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n\n /**\n * Posten/Bring-spesific variant of the box. NB: warning variant is deprecated, use data-color=\"warning\" instead.\n *\n * @default \"light-grey\"\n */\n variant?:\n | \"light-grey\"\n | \"lighter\"\n | \"white\"\n /** @deprecated use data-color=\"warning\" instead */\n | \"warning\";\n\n /**\n * Color variant of the box\n *\n */\n\n \"data-color\"?: \"neutral\" | \"info\" | \"success\" | \"warning\" | \"error\";\n\n /**\n * If `true`, a close button will be shown.\n * Use when you want to control the close button using the BoxCloseButton component.\n *\n * @default false\n */\n closeable?: boolean;\n\n /**\n * Callback fired when the component requests to be closed.\n * If not set, the component will be closed without any user interaction.\n *\n * If set, and the handler returns non-true value, the component will not be closed.\n * Use this if you want to control the closing of the component, using the `closed` prop\n *\n * If set, and the handler returns the true, the component will be closed.\n * Use this with `window.confirm()` to ask the user to confirm closing the component.\n */\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents -- It's fine, I want to have the boolean in the type\n onClose?: () => boolean | unknown;\n\n /**\n * If `true`, the box will be closed and hidden from view\n */\n closed?: boolean;\n\n /**\n * Props applied to the close button element.\n */\n closeButtonProps?: BoxCloseButtonProps;\n\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\n\nconst convertVariantToColor = (variant: BoxProps[\"variant\"] | \"\") => {\n switch (variant) {\n case \"lighter\":\n return \"\";\n case \"white\":\n return \"\";\n case \"warning\":\n return \"warning\";\n default:\n return \"neutral\";\n }\n};\n\nexport const Box = forwardRef<HTMLDivElement, BoxProps>(\n (\n {\n \"data-color\": color = \"\",\n asChild,\n variant,\n closeable = false,\n onClose: onCloseProp,\n closed: closedProp,\n closeButtonProps,\n children,\n className,\n ...rest\n },\n ref,\n ) => {\n const [closedState, setClosedState] = useState(false);\n const onClose = useCallback(() => {\n if (onCloseProp) {\n const result = onCloseProp();\n if (result === true) {\n setClosedState(true);\n }\n } else {\n setClosedState(true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- I know better\n }, []);\n const closed = closedProp ?? closedState;\n const Component = asChild ? Slot : \"div\";\n\n const resolvedColor = color && color !== \"\" ? color : convertVariantToColor(variant);\n\n return (\n <Component\n data-color={resolvedColor}\n className={clsx(\n \"hds-box\",\n { \"hds-box--lighter\": variant === \"lighter\" },\n { \"hds-box--white\": variant === \"white\" },\n { \"hds-box--closed\": closed },\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {closeable ? <BoxCloseButton onClick={onClose} {...closeButtonProps} /> : null}\n <Slottable>{children}</Slottable>\n </Component>\n );\n },\n) as BoxType;\nBox.displayName = \"Box\";\n\nBox.CloseButton = BoxCloseButton;\n\ntype BoxType = ReturnType<typeof forwardRef<HTMLDivElement, BoxProps>> & {\n CloseButton: typeof BoxCloseButton;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA2B;AAC3B,IAAAC,0BAAqB;AACrB,IAAAC,qBAAqB;;;ACFrB,mBAAkD;AAClD,6BAAqB;AACrB,wBAAgC;AAK1B;AAHN,SAAS,YAAY;AACnB,SACE,4CAAC,SAAI,eAAW,MAAC,OAAM,8BAA6B,OAAO,IAAI,QAAQ,IAAI,SAAQ,aACjF;AAAA,IAAC;AAAA;AAAA,MACC,GAAE;AAAA,MACF,MAAK;AAAA;AAAA,EACP,GACF;AAEJ;AAGO,IAAM,qBAAiB;AAAA,EAC5B,CAAC,IAAwB,QAAQ;AAAhC,iBAAE,YAjBL,IAiBG,IAAgB,iBAAhB,IAAgB,CAAd;AACD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW,6BAAK,yBAAyB,SAAsB;AAAA,QAC/D;AAAA,QACA,MAAK;AAAA,SACD,OAJL;AAAA,QAMC,sDAAC,aAAU;AAAA;AAAA,IACb;AAAA,EAEJ;AACF;AACA,eAAe,cAAc;AA+D7B,IAAM,wBAAwB,CAAC,YAAsC;AACnE,UAAQ,SAAS;AAAA,IACf,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AAEO,IAAM,UAAM;AAAA,EACjB,CACE,IAYA,QACG;AAbH,iBACE;AAAA,oBAAc,QAAQ;AAAA,MACtB;AAAA,MACA;AAAA,MACA,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K,sBAAsB,SAAsB;AAAA,QAC5D;AAAA,SACI;AAAA,IACN;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;AAUpB,IAAM,yBAAqB;AAAA,EAChC,CAAC,IAAiC,QAAQ;AAAzC,iBAAE,WAAS,UApCd,IAoCG,IAAyB,iBAAzB,IAAyB,CAAvB,WAAS;AACV,UAAM,YAAY,UAAU,0BAAO;AACnC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW,8BAAK,4BAA4B,SAAsB;AAAA,QAClE;AAAA,SACI;AAAA,IACN;AAAA,EAEJ;AACF;AACA,mBAAmB,cAAc;AAiB1B,IAAM,cAAU;AAAA,EACrB,CAAC,IAA4E,QAAQ;AAApF,iBAAE,YAAU,WAAW,UAAU,WAAW,MAAM,cAjErD,IAiEG,IAAoE,iBAApE,IAAoE,CAAlE,YAAU,aAAW,WAAqB,QAAM;AACjD,WACE;AAAA,MAAC;AAAA,oEACM,YAAY,YAAY,EAAE,qBAAqB,QAAQ,IAAI,CAAC,IADlE;AAAA,QAEC,eAAW,8BAAK,eAAe,gBAAgB,OAAO,IAAI,SAAsB;AAAA,QAChF;AAAA,UACI,OAJL;AAAA,QAME;AAAA,sBAAY,aACX,6CAAC,SAAI,eAAW,8BAAK,8BAA8B,aAA0B,GAC1E,gBACH;AAAA,UAED;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,QAAQ,cAAc;AAMtB,QAAQ,QAAQ;AAChB,QAAQ,cAAc;","names":["import_react","import_typed_classname","import_react_slot","import_jsx_runtime"]}
1
+ {"version":3,"sources":["../../src/message/index.tsx","../../src/message/message.tsx","../../src/box/box.tsx","../../src/button/button.tsx"],"sourcesContent":["export { Message, MessageTitle, MessageDescription } from \"./message\";\nexport type * from \"./message\";\n","import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Box, type BoxProps } from \"../box/box\";\n\nexport interface MessageTitleProps extends React.HTMLAttributes<HTMLParagraphElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\nexport const MessageTitle = forwardRef<HTMLParagraphElement, MessageTitleProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component\n className={clsx(\"hds-message__title\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nMessageTitle.displayName = \"Message.Title\";\n\nexport interface MessageDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\nexport const MessageDescription = forwardRef<HTMLParagraphElement, MessageDescriptionProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"div\";\n return (\n <Component\n className={clsx(\"hds-message__description\", className as undefined)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\nMessageDescription.displayName = \"Message.Description\";\n\nexport type MessageProps = (\n | {\n variant?: \"success\" | \"attention\" | \"warning\" | \"info\";\n icon?: never;\n iconClassName?: never;\n }\n | {\n variant: \"neutral\";\n icon?: React.ReactNode;\n iconClassName?: string;\n }\n) &\n Omit<BoxProps, \"variant\" | \"asChild\">;\n\n/** @deprecated Use Alert component instead */\nexport const Message = forwardRef<HTMLDivElement, MessageProps>(\n ({ children, className, variant = \"success\", icon, iconClassName, ...rest }, ref) => {\n return (\n <Box\n {...(variant === \"warning\" ? { \"data-color-scheme\": \"light\" } : {})}\n className={clsx(`hds-message`, `hds-message--${variant}`, className as undefined)}\n ref={ref}\n {...rest}\n >\n {variant === \"neutral\" && (\n <div className={clsx(\"hds-message--neutral__icon\", iconClassName as undefined)}>\n {icon}\n </div>\n )}\n {children}\n </Box>\n );\n },\n) as MessageType;\nMessage.displayName = \"Message\";\n\ntype MessageType = ReturnType<typeof forwardRef<HTMLDivElement, MessageProps>> & {\n Title: typeof MessageTitle;\n Description: typeof MessageDescription;\n};\nMessage.Title = MessageTitle;\nMessage.Description = MessageDescription;\n","import { forwardRef, useCallback, useState } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport { Button } from \"../button/button\";\n\nfunction CloseIcon() {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 640\">\n <path d=\"M183.1 137.4C170.6 124.9 150.3 124.9 137.8 137.4C125.3 149.9 125.3 170.2 137.8 182.7L275.2 320L137.9 457.4C125.4 469.9 125.4 490.2 137.9 502.7C150.4 515.2 170.7 515.2 183.2 502.7L320.5 365.3L457.9 502.6C470.4 515.1 490.7 515.1 503.2 502.6C515.7 490.1 515.7 469.8 503.2 457.3L365.8 320L503.1 182.6C515.6 170.1 515.6 149.8 503.1 137.3C490.6 124.8 470.3 124.8 457.8 137.3L320.5 274.7L183.1 137.4z\" />\n </svg>\n );\n}\nexport type BoxCloseButtonProps = Omit<React.HTMLAttributes<HTMLButtonElement>, \"children\">;\nexport const BoxCloseButton = forwardRef<HTMLButtonElement, BoxCloseButtonProps>(\n ({ className, ...rest }, ref) => {\n return (\n <Button\n className={clsx(\"hds-box__close-button\", className as undefined)}\n variant=\"tertiary\"\n size=\"small\"\n icon\n ref={ref}\n type=\"button\"\n {...rest}\n >\n <CloseIcon />\n </Button>\n );\n },\n);\nBoxCloseButton.displayName = \"Box.CloseButton\";\n\nexport interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n\n /**\n * Posten/Bring-spesific variant of the box. NB: warning variant is deprecated, use data-color=\"warning\" instead.\n *\n * @default \"light-grey\"\n */\n variant?:\n | \"light-grey\"\n | \"lighter\"\n | \"white\"\n /** @deprecated use data-color=\"warning\" instead */\n | \"warning\";\n\n /**\n * Color variant of the box\n *\n */\n\n \"data-color\"?: \"neutral\" | \"info\" | \"success\" | \"warning\" | \"error\";\n\n /**\n * If `true`, a close button will be shown.\n * Use when you want to control the close button using the BoxCloseButton component.\n *\n * @default false\n */\n closeable?: boolean;\n\n /**\n * Callback fired when the component requests to be closed.\n * If not set, the component will be closed without any user interaction.\n *\n * If set, and the handler returns non-true value, the component will not be closed.\n * Use this if you want to control the closing of the component, using the `closed` prop\n *\n * If set, and the handler returns the true, the component will be closed.\n * Use this with `window.confirm()` to ask the user to confirm closing the component.\n */\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents -- It's fine, I want to have the boolean in the type\n onClose?: () => boolean | unknown;\n\n /**\n * If `true`, the box will be closed and hidden from view\n */\n closed?: boolean;\n\n /**\n * Props applied to the close button element.\n */\n closeButtonProps?: BoxCloseButtonProps;\n\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\n\nconst convertVariantToColor = (variant: BoxProps[\"variant\"] | \"\") => {\n switch (variant) {\n case \"lighter\":\n return \"\";\n case \"white\":\n return \"\";\n case \"warning\":\n return \"warning\";\n default:\n return \"neutral\";\n }\n};\n\nexport const Box = forwardRef<HTMLDivElement, BoxProps>(\n (\n {\n \"data-color\": color = \"\",\n asChild,\n variant,\n closeable = false,\n onClose: onCloseProp,\n closed: closedProp,\n closeButtonProps,\n children,\n className,\n ...rest\n },\n ref,\n ) => {\n const [closedState, setClosedState] = useState(false);\n const onClose = useCallback(() => {\n if (onCloseProp) {\n const result = onCloseProp();\n if (result === true) {\n setClosedState(true);\n }\n } else {\n setClosedState(true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- I know better\n }, []);\n const closed = closedProp ?? closedState;\n const Component = asChild ? Slot : \"div\";\n\n const resolvedColor = color && color !== \"\" ? color : convertVariantToColor(variant);\n\n return (\n <Component\n data-color={resolvedColor}\n className={clsx(\n \"hds-box\",\n { \"hds-box--lighter\": variant === \"lighter\" },\n { \"hds-box--white\": variant === \"white\" },\n { \"hds-box--closed\": closed },\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {closeable ? <BoxCloseButton onClick={onClose} {...closeButtonProps} /> : null}\n <Slottable>{children}</Slottable>\n </Component>\n );\n },\n) as BoxType;\nBox.displayName = \"Box\";\n\nBox.CloseButton = BoxCloseButton;\n\ntype BoxType = ReturnType<typeof forwardRef<HTMLDivElement, BoxProps>> & {\n CloseButton: typeof BoxCloseButton;\n};\n","import { forwardRef } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\n/**\n * @deprecated The \"inverted\" variant is deprecated. Use \"primary\", \"secondary\", or \"tertiary\" instead.\n */\nexport type DeprecatedVariant = \"inverted\";\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The height, font size and padding of the button\n *\n * @default \"large\"\n */\n size?: \"small\" | \"large\";\n\n /**\n * The background and fill of the button\n *\n * @default \"primary\"\n */\n variant?: \"primary\" | \"secondary\" | \"tertiary\" | DeprecatedVariant;\n\n /**\n * Make the button use 100% width available.\n * Using the \"mobile\" it only stretch to full width on smaller screens\n */\n fullWidth?: boolean | \"mobile\";\n\n /**\n * Specify that there is an icon in the button.\n * `icon`: There is only an icon in the button.\n * `icon=\"leading\"`: There is an icon before the text.\n * `icon=\"trailing\"`: There is an icon after the text.\n *\n * @default false\n */\n icon?: boolean | \"leading\" | \"trailing\";\n\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\n\n/**\n * Button component\n *\n * @example\n * <Button variant=\"primary\">Primary</Button>\n * <Button variant=\"secondary\" size=\"large\">Secondary</Button>\n * <Button variant=\"tertiary\" fullWidth=\"mobile\">Tertiary</Button>\n * <Button icon=\"leading\"><LeadingIcon />Leading icon</Button>\n *\n * @example\n * // If used for navigation use the `asChild` prop with a anchor element as a child.\n * <Button asChild><a href=\"/home\">Home</a></Button>\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n asChild,\n children,\n variant = \"primary\",\n size = \"large\",\n fullWidth = false,\n icon = false,\n className,\n ...rest\n },\n ref,\n ) => {\n const Component = asChild ? Slot : \"button\";\n\n return (\n <Component\n className={clsx(\n \"hds-button\",\n `hds-button--${size}`,\n `hds-button--${variant}`,\n {\n \"hds-button--full\": fullWidth === true,\n \"hds-button--mobile-full\": fullWidth === \"mobile\",\n \"hds-button--only-icon\": icon === true,\n \"hds-button--leading-icon\": icon === \"leading\",\n \"hds-button--trailing-icon\": icon === \"trailing\",\n },\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\nButton.displayName = \"Button\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA2B;AAC3B,IAAAC,0BAAqB;AACrB,IAAAC,qBAAqB;;;ACFrB,IAAAC,gBAAkD;AAClD,IAAAC,0BAAqB;AACrB,IAAAC,qBAAgC;;;ACFhC,mBAA2B;AAC3B,6BAAqB;AACrB,wBAAqB;AA4Ef;AAjBC,IAAM,aAAS;AAAA,EACpB,CACE,IAUA,QACG;AAXH,iBACE;AAAA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,OAAO;AAAA,MACP;AAAA,IAtEN,IA+DI,IAQK,iBARL,IAQK;AAAA,MAPH;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAKF,UAAM,YAAY,UAAU,yBAAO;AAEnC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW;AAAA,UACT;AAAA,UACA,eAAe,IAAI;AAAA,UACnB,eAAe,OAAO;AAAA,UACtB;AAAA,YACE,oBAAoB,cAAc;AAAA,YAClC,2BAA2B,cAAc;AAAA,YACzC,yBAAyB,SAAS;AAAA,YAClC,4BAA4B,SAAS;AAAA,YACrC,6BAA6B,S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;AAAA,SACI;AAAA,IACN;AAAA,EAEJ;AACF;AACA,mBAAmB,cAAc;AAiB1B,IAAM,cAAU;AAAA,EACrB,CAAC,IAA4E,QAAQ;AAApF,iBAAE,YAAU,WAAW,UAAU,WAAW,MAAM,cAjErD,IAiEG,IAAoE,iBAApE,IAAoE,CAAlE,YAAU,aAAW,WAAqB,QAAM;AACjD,WACE;AAAA,MAAC;AAAA,oEACM,YAAY,YAAY,EAAE,qBAAqB,QAAQ,IAAI,CAAC,IADlE;AAAA,QAEC,eAAW,8BAAK,eAAe,gBAAgB,OAAO,IAAI,SAAsB;AAAA,QAChF;AAAA,UACI,OAJL;AAAA,QAME;AAAA,sBAAY,aACX,6CAAC,SAAI,eAAW,8BAAK,8BAA8B,aAA0B,GAC1E,gBACH;AAAA,UAED;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,QAAQ,cAAc;AAMtB,QAAQ,QAAQ;AAChB,QAAQ,cAAc;","names":["import_react","import_typed_classname","import_react_slot","import_react","import_typed_classname","import_react_slot","import_jsx_runtime","import_jsx_runtime"]}
@@ -3,8 +3,9 @@ import {
3
3
  Message,
4
4
  MessageDescription,
5
5
  MessageTitle
6
- } from "../chunk-ILN2L5NX.mjs";
7
- import "../chunk-DEABU7DB.mjs";
6
+ } from "../chunk-B2DZ6JJ4.mjs";
7
+ import "../chunk-P4AKOVM7.mjs";
8
+ import "../chunk-45Q2TCH6.mjs";
8
9
  import "../chunk-YOSPWY5K.mjs";
9
10
  export {
10
11
  Message,
@@ -54,35 +54,84 @@ __export(message_exports, {
54
54
  MessageTitle: () => MessageTitle
55
55
  });
56
56
  module.exports = __toCommonJS(message_exports);
57
+ var import_react3 = require("react");
58
+ var import_typed_classname3 = require("@postenbring/hedwig-css/typed-classname");
59
+ var import_react_slot3 = require("@radix-ui/react-slot");
60
+
61
+ // src/box/box.tsx
57
62
  var import_react2 = require("react");
58
63
  var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname");
59
64
  var import_react_slot2 = require("@radix-ui/react-slot");
60
65
 
61
- // src/box/box.tsx
66
+ // src/button/button.tsx
62
67
  var import_react = require("react");
63
68
  var import_typed_classname = require("@postenbring/hedwig-css/typed-classname");
64
69
  var import_react_slot = require("@radix-ui/react-slot");
65
70
  var import_jsx_runtime = require("react/jsx-runtime");
71
+ var Button = (0, import_react.forwardRef)(
72
+ (_a, ref) => {
73
+ var _b = _a, {
74
+ asChild,
75
+ children,
76
+ variant = "primary",
77
+ size = "large",
78
+ fullWidth = false,
79
+ icon = false,
80
+ className
81
+ } = _b, rest = __objRest(_b, [
82
+ "asChild",
83
+ "children",
84
+ "variant",
85
+ "size",
86
+ "fullWidth",
87
+ "icon",
88
+ "className"
89
+ ]);
90
+ const Component = asChild ? import_react_slot.Slot : "button";
91
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
92
+ Component,
93
+ __spreadProps(__spreadValues({
94
+ className: (0, import_typed_classname.clsx)(
95
+ "hds-button",
96
+ `hds-button--${size}`,
97
+ `hds-button--${variant}`,
98
+ {
99
+ "hds-button--full": fullWidth === true,
100
+ "hds-button--mobile-full": fullWidth === "mobile",
101
+ "hds-button--only-icon": icon === true,
102
+ "hds-button--leading-icon": icon === "leading",
103
+ "hds-button--trailing-icon": icon === "trailing"
104
+ },
105
+ className
106
+ ),
107
+ ref
108
+ }, rest), {
109
+ children
110
+ })
111
+ );
112
+ }
113
+ );
114
+ Button.displayName = "Button";
115
+
116
+ // src/box/box.tsx
117
+ var import_jsx_runtime2 = require("react/jsx-runtime");
66
118
  function CloseIcon() {
67
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { "aria-hidden": true, xmlns: "http://www.w3.org/2000/svg", width: 32, height: 32, viewBox: "0 0 32 32", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
68
- "path",
69
- {
70
- d: "M17.5469 16.3333L22.375 11.5521L23.3594 10.5677C23.5 10.4271 23.5 10.1927 23.3594 10.0052L22.3281 8.97394C22.1406 8.83331 21.9062 8.83331 21.7656 8.97394L16 14.7864L10.1875 8.97394C10.0469 8.83331 9.8125 8.83331 9.625 8.97394L8.59375 10.0052C8.45312 10.1927 8.45312 10.4271 8.59375 10.5677L14.4062 16.3333L8.59375 22.1458C8.45312 22.2864 8.45312 22.5208 8.59375 22.7083L9.625 23.7396C9.8125 23.8802 10.0469 23.8802 10.1875 23.7396L16 17.9271L20.7812 22.7552L21.7656 23.7396C21.9062 23.8802 22.1406 23.8802 22.3281 23.7396L23.3594 22.7083C23.5 22.5208 23.5 22.2864 23.3594 22.1458L17.5469 16.3333Z",
71
- fill: "currentColor"
72
- }
73
- ) });
119
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 640 640", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M183.1 137.4C170.6 124.9 150.3 124.9 137.8 137.4C125.3 149.9 125.3 170.2 137.8 182.7L275.2 320L137.9 457.4C125.4 469.9 125.4 490.2 137.9 502.7C150.4 515.2 170.7 515.2 183.2 502.7L320.5 365.3L457.9 502.6C470.4 515.1 490.7 515.1 503.2 502.6C515.7 490.1 515.7 469.8 503.2 457.3L365.8 320L503.1 182.6C515.6 170.1 515.6 149.8 503.1 137.3C490.6 124.8 470.3 124.8 457.8 137.3L320.5 274.7L183.1 137.4z" }) });
74
120
  }
75
- var BoxCloseButton = (0, import_react.forwardRef)(
121
+ var BoxCloseButton = (0, import_react2.forwardRef)(
76
122
  (_a, ref) => {
77
123
  var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
78
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
79
- "button",
124
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
125
+ Button,
80
126
  __spreadProps(__spreadValues({
81
- className: (0, import_typed_classname.clsx)("hds-box__close-button", className),
127
+ className: (0, import_typed_classname2.clsx)("hds-box__close-button", className),
128
+ variant: "tertiary",
129
+ size: "small",
130
+ icon: true,
82
131
  ref,
83
132
  type: "button"
84
133
  }, rest), {
85
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CloseIcon, {})
134
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CloseIcon, {})
86
135
  })
87
136
  );
88
137
  }
@@ -100,7 +149,7 @@ var convertVariantToColor = (variant) => {
100
149
  return "neutral";
101
150
  }
102
151
  };
103
- var Box = (0, import_react.forwardRef)(
152
+ var Box = (0, import_react2.forwardRef)(
104
153
  (_a, ref) => {
105
154
  var _b = _a, {
106
155
  "data-color": color = "",
@@ -123,8 +172,8 @@ var Box = (0, import_react.forwardRef)(
123
172
  "children",
124
173
  "className"
125
174
  ]);
126
- const [closedState, setClosedState] = (0, import_react.useState)(false);
127
- const onClose = (0, import_react.useCallback)(() => {
175
+ const [closedState, setClosedState] = (0, import_react2.useState)(false);
176
+ const onClose = (0, import_react2.useCallback)(() => {
128
177
  if (onCloseProp) {
129
178
  const result = onCloseProp();
130
179
  if (result === true) {
@@ -135,13 +184,13 @@ var Box = (0, import_react.forwardRef)(
135
184
  }
136
185
  }, []);
137
186
  const closed = closedProp != null ? closedProp : closedState;
138
- const Component = asChild ? import_react_slot.Slot : "div";
187
+ const Component = asChild ? import_react_slot2.Slot : "div";
139
188
  const resolvedColor = color && color !== "" ? color : convertVariantToColor(variant);
140
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
189
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
141
190
  Component,
142
191
  __spreadProps(__spreadValues({
143
192
  "data-color": resolvedColor,
144
- className: (0, import_typed_classname.clsx)(
193
+ className: (0, import_typed_classname2.clsx)(
145
194
  "hds-box",
146
195
  { "hds-box--lighter": variant === "lighter" },
147
196
  { "hds-box--white": variant === "white" },
@@ -151,8 +200,8 @@ var Box = (0, import_react.forwardRef)(
151
200
  ref
152
201
  }, rest), {
153
202
  children: [
154
- closeable ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)) : null,
155
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_slot.Slottable, { children })
203
+ closeable ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)) : null,
204
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_slot2.Slottable, { children })
156
205
  ]
157
206
  })
158
207
  );
@@ -162,46 +211,46 @@ Box.displayName = "Box";
162
211
  Box.CloseButton = BoxCloseButton;
163
212
 
164
213
  // src/message/message.tsx
165
- var import_jsx_runtime2 = require("react/jsx-runtime");
166
- var MessageTitle = (0, import_react2.forwardRef)(
214
+ var import_jsx_runtime3 = require("react/jsx-runtime");
215
+ var MessageTitle = (0, import_react3.forwardRef)(
167
216
  (_a, ref) => {
168
217
  var _b = _a, { asChild, className } = _b, rest = __objRest(_b, ["asChild", "className"]);
169
- const Component = asChild ? import_react_slot2.Slot : "div";
170
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
218
+ const Component = asChild ? import_react_slot3.Slot : "div";
219
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
171
220
  Component,
172
221
  __spreadValues({
173
- className: (0, import_typed_classname2.clsx)("hds-message__title", className),
222
+ className: (0, import_typed_classname3.clsx)("hds-message__title", className),
174
223
  ref
175
224
  }, rest)
176
225
  );
177
226
  }
178
227
  );
179
228
  MessageTitle.displayName = "Message.Title";
180
- var MessageDescription = (0, import_react2.forwardRef)(
229
+ var MessageDescription = (0, import_react3.forwardRef)(
181
230
  (_a, ref) => {
182
231
  var _b = _a, { asChild, className } = _b, rest = __objRest(_b, ["asChild", "className"]);
183
- const Component = asChild ? import_react_slot2.Slot : "div";
184
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
232
+ const Component = asChild ? import_react_slot3.Slot : "div";
233
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
185
234
  Component,
186
235
  __spreadValues({
187
- className: (0, import_typed_classname2.clsx)("hds-message__description", className),
236
+ className: (0, import_typed_classname3.clsx)("hds-message__description", className),
188
237
  ref
189
238
  }, rest)
190
239
  );
191
240
  }
192
241
  );
193
242
  MessageDescription.displayName = "Message.Description";
194
- var Message = (0, import_react2.forwardRef)(
243
+ var Message = (0, import_react3.forwardRef)(
195
244
  (_a, ref) => {
196
245
  var _b = _a, { children, className, variant = "success", icon, iconClassName } = _b, rest = __objRest(_b, ["children", "className", "variant", "icon", "iconClassName"]);
197
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
246
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
198
247
  Box,
199
248
  __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, variant === "warning" ? { "data-color-scheme": "light" } : {}), {
200
- className: (0, import_typed_classname2.clsx)(`hds-message`, `hds-message--${variant}`, className),
249
+ className: (0, import_typed_classname3.clsx)(`hds-message`, `hds-message--${variant}`, className),
201
250
  ref
202
251
  }), rest), {
203
252
  children: [
204
- variant === "neutral" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: (0, import_typed_classname2.clsx)("hds-message--neutral__icon", iconClassName), children: icon }),
253
+ variant === "neutral" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: (0, import_typed_classname3.clsx)("hds-message--neutral__icon", iconClassName), children: icon }),
205
254
  children
206
255
  ]
207
256
  })