@postenbring/hedwig-react 4.5.2 → 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 (71) 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 +10 -9
  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 +53 -53
  43. package/dist/layout/index.mjs +3 -3
  44. package/dist/message/index.js +83 -34
  45. package/dist/message/index.js.map +1 -1
  46. package/dist/message/index.mjs +3 -2
  47. package/dist/message/message.js +83 -34
  48. package/dist/message/message.js.map +1 -1
  49. package/dist/message/message.mjs +3 -2
  50. package/dist/modal/index.js +95 -45
  51. package/dist/modal/index.js.map +1 -1
  52. package/dist/modal/index.mjs +3 -2
  53. package/dist/modal/modal.d.ts +5 -0
  54. package/dist/modal/modal.d.ts.map +1 -1
  55. package/dist/modal/modal.js +95 -45
  56. package/dist/modal/modal.js.map +1 -1
  57. package/dist/modal/modal.mjs +3 -2
  58. package/dist/navbar/icons.d.ts +2 -2
  59. package/dist/navbar/icons.d.ts.map +1 -1
  60. package/dist/navbar/navbar-expandable-menu.d.ts +1 -1
  61. package/dist/navbar/navbar-expandable-menu.d.ts.map +1 -1
  62. package/package.json +2 -2
  63. package/src/box/box.tsx +8 -8
  64. package/src/modal/modal.tsx +12 -1
  65. package/dist/chunk-DEABU7DB.mjs.map +0 -1
  66. package/dist/chunk-YQT2TN3U.mjs.map +0 -1
  67. /package/dist/{chunk-ILN2L5NX.mjs.map → chunk-B2DZ6JJ4.mjs.map} +0 -0
  68. /package/dist/{chunk-INDTHGWZ.mjs.map → chunk-KAVKFO2R.mjs.map} +0 -0
  69. /package/dist/{chunk-NAXSP4VU.mjs.map → chunk-PKEPSKTZ.mjs.map} +0 -0
  70. /package/dist/{chunk-QDG2QLFV.mjs.map → chunk-UXZKGAZ2.mjs.map} +0 -0
  71. /package/dist/{chunk-PZUJLRG4.mjs.map → chunk-WFIS2ZYQ.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -31,35 +31,10 @@ import {
31
31
  TabsTab
32
32
  } from "./chunk-WVCJV74B.mjs";
33
33
  import "./chunk-KQITCS3U.mjs";
34
- import "./chunk-SRLM3K2X.mjs";
35
- import {
36
- ShowMoreButton
37
- } from "./chunk-JUHJZLH2.mjs";
38
- import "./chunk-JTZPQHKD.mjs";
39
- import {
40
- Skeleton
41
- } from "./chunk-QTC4ATZD.mjs";
42
34
  import "./chunk-AJFQHFQT.mjs";
43
35
  import {
44
36
  Spinner
45
37
  } from "./chunk-ZTZAPNZB.mjs";
46
- import "./chunk-TJH5QJMS.mjs";
47
- import {
48
- StepIndicator
49
- } from "./chunk-XQBJ75VD.mjs";
50
- import "./chunk-RC76SXBP.mjs";
51
- import {
52
- Message,
53
- MessageDescription,
54
- MessageTitle
55
- } from "./chunk-ILN2L5NX.mjs";
56
- import "./chunk-FYFJ75NX.mjs";
57
- import {
58
- Modal,
59
- ModalContent,
60
- ModalFooter,
61
- ModalHeader
62
- } from "./chunk-YQT2TN3U.mjs";
63
38
  import "./chunk-H3E546OT.mjs";
64
39
  import {
65
40
  Navbar,
@@ -78,15 +53,34 @@ import {
78
53
  useNavbarExpendableMenuContext
79
54
  } from "./chunk-HOLFVKXQ.mjs";
80
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";
67
+ import "./chunk-SRLM3K2X.mjs";
68
+ import {
69
+ ShowMoreButton
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";
76
+ import {
77
+ Container
78
+ } from "./chunk-4QZR2H72.mjs";
82
79
  import "./chunk-G65EYZFQ.mjs";
83
80
  import {
84
81
  Grid,
85
82
  GridItem
86
83
  } from "./chunk-TC5PD4TA.mjs";
87
- import {
88
- Container
89
- } from "./chunk-4QZR2H72.mjs";
90
84
  import "./chunk-ZQHLYAJU.mjs";
91
85
  import {
92
86
  HStack,
@@ -95,7 +89,17 @@ 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
+ import "./chunk-2YL2MVWN.mjs";
98
99
  import "./chunk-K2CB2NLY.mjs";
100
+ import {
101
+ Figure
102
+ } from "./chunk-OE6RISJS.mjs";
99
103
  import "./chunk-HQVL3ZJ2.mjs";
100
104
  import {
101
105
  Footer,
@@ -103,7 +107,7 @@ import {
103
107
  FooterLinkSection,
104
108
  FooterLinkSections,
105
109
  FooterLogo
106
- } from "./chunk-QDG2QLFV.mjs";
110
+ } from "./chunk-UXZKGAZ2.mjs";
107
111
  import "./chunk-5J5LYE6Z.mjs";
108
112
  import "./chunk-BYEJZSG5.mjs";
109
113
  import {
@@ -137,14 +141,6 @@ import {
137
141
  SearchWrapper
138
142
  } from "./chunk-RJ763KDH.mjs";
139
143
  import "./chunk-KPPLVGZ3.mjs";
140
- import {
141
- ErrorSummary
142
- } from "./chunk-NAXSP4VU.mjs";
143
- import "./chunk-CKAL5ZJZ.mjs";
144
- import "./chunk-7LPYJC6S.mjs";
145
- import {
146
- Input
147
- } from "./chunk-62VLFCXX.mjs";
148
144
  import "./chunk-YJOOSTJC.mjs";
149
145
  import {
150
146
  Checkbox
@@ -160,6 +156,10 @@ import {
160
156
  import {
161
157
  FieldsetLegend
162
158
  } from "./chunk-CD4LCDK3.mjs";
159
+ import "./chunk-7LPYJC6S.mjs";
160
+ import {
161
+ Input
162
+ } from "./chunk-62VLFCXX.mjs";
163
163
  import "./chunk-TDLSHJ4Z.mjs";
164
164
  import {
165
165
  DatePicker
@@ -174,6 +174,10 @@ import "./chunk-5M6MEYM7.mjs";
174
174
  import {
175
175
  ValidationMessage
176
176
  } from "./chunk-F23MNQCK.mjs";
177
+ import {
178
+ ErrorSummary
179
+ } from "./chunk-PKEPSKTZ.mjs";
180
+ import "./chunk-CKAL5ZJZ.mjs";
177
181
  import "./chunk-XLLYMQLW.mjs";
178
182
  import {
179
183
  Link
@@ -189,7 +193,13 @@ import {
189
193
  import "./chunk-CFAH2LID.mjs";
190
194
  import {
191
195
  HelpText
192
- } from "./chunk-INDTHGWZ.mjs";
196
+ } from "./chunk-KAVKFO2R.mjs";
197
+ import "./chunk-ISAHCU7C.mjs";
198
+ import "./chunk-HT2EIJAD.mjs";
199
+ import "./chunk-Y6NOEN7R.mjs";
200
+ import {
201
+ ButtonList
202
+ } from "./chunk-ME746XCZ.mjs";
193
203
  import "./chunk-ARHJZUZG.mjs";
194
204
  import {
195
205
  Card,
@@ -203,22 +213,9 @@ import {
203
213
  CardMedia,
204
214
  CardMediaImg
205
215
  } from "./chunk-EWZYDO7Z.mjs";
206
- import "./chunk-ISAHCU7C.mjs";
207
- import "./chunk-HT2EIJAD.mjs";
208
- import {
209
- Button
210
- } from "./chunk-45Q2TCH6.mjs";
211
- import "./chunk-Y6NOEN7R.mjs";
212
- import {
213
- ButtonList
214
- } from "./chunk-ME746XCZ.mjs";
215
- import "./chunk-2YL2MVWN.mjs";
216
216
  import {
217
217
  DescriptionList
218
218
  } from "./chunk-C7ZTOZP3.mjs";
219
- import {
220
- Figure
221
- } from "./chunk-OE6RISJS.mjs";
222
219
  import "./chunk-OVKUPO5U.mjs";
223
220
  import "./chunk-K6PP3ACJ.mjs";
224
221
  import {
@@ -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,
@@ -1,12 +1,12 @@
1
1
  import "../chunk-BVG5VSZK.mjs";
2
+ import {
3
+ Container
4
+ } from "../chunk-4QZR2H72.mjs";
2
5
  import "../chunk-G65EYZFQ.mjs";
3
6
  import {
4
7
  Grid,
5
8
  GridItem
6
9
  } from "../chunk-TC5PD4TA.mjs";
7
- import {
8
- Container
9
- } from "../chunk-4QZR2H72.mjs";
10
10
  import "../chunk-ZQHLYAJU.mjs";
11
11
  import {
12
12
  HStack,
@@ -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;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sB;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,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ADlE;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,