@postenbring/hedwig-react 1.2.1 → 1.3.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 (175) hide show
  1. package/dist/accordion/accordion-content.d.ts.map +1 -1
  2. package/dist/accordion/accordion-content.js +0 -1
  3. package/dist/accordion/accordion-content.js.map +1 -1
  4. package/dist/accordion/accordion-content.mjs +1 -1
  5. package/dist/accordion/accordion.js +0 -1
  6. package/dist/accordion/accordion.js.map +1 -1
  7. package/dist/accordion/accordion.mjs +2 -2
  8. package/dist/accordion/index.js +0 -1
  9. package/dist/accordion/index.js.map +1 -1
  10. package/dist/accordion/index.mjs +2 -2
  11. package/dist/{chunk-JZXZYEPG.mjs → chunk-5FWY7FIX.mjs} +1 -2
  12. package/dist/chunk-5FWY7FIX.mjs.map +1 -0
  13. package/dist/{chunk-ROQH67YP.mjs → chunk-6DWIJEHQ.mjs} +2 -2
  14. package/dist/{chunk-6BXKRPR3.mjs → chunk-AXEAIXG7.mjs} +2 -2
  15. package/dist/{chunk-QRGGURVO.mjs → chunk-BO3EWZGA.mjs} +6 -4
  16. package/dist/chunk-BO3EWZGA.mjs.map +1 -0
  17. package/dist/{chunk-TWUAXAMR.mjs → chunk-BYFBK3J7.mjs} +1 -1
  18. package/dist/chunk-BYFBK3J7.mjs.map +1 -0
  19. package/dist/chunk-CKAL5ZJZ.mjs +45 -0
  20. package/dist/chunk-CKAL5ZJZ.mjs.map +1 -0
  21. package/dist/{chunk-CXX4SXJG.mjs → chunk-CKG2XRMX.mjs} +2 -2
  22. package/dist/{chunk-YS7HBWOI.mjs → chunk-E6OOFTRQ.mjs} +2 -2
  23. package/dist/{chunk-6SVLMQUW.mjs → chunk-FUIKSOJF.mjs} +4 -4
  24. package/dist/{chunk-WUPLEZEY.mjs → chunk-GVO57ZWU.mjs} +2 -2
  25. package/dist/{chunk-UL2V2Z5B.mjs → chunk-HEDGKRGC.mjs} +3 -3
  26. package/dist/chunk-IJSEJZ3W.mjs +1 -0
  27. package/dist/{chunk-S3QSGJX2.mjs → chunk-ITLZQ47H.mjs} +2 -2
  28. package/dist/{chunk-NIYDN3Y3.mjs → chunk-JEAGKB4V.mjs} +2 -2
  29. package/dist/chunk-KPPLVGZ3.mjs +1 -0
  30. package/dist/chunk-KPPLVGZ3.mjs.map +1 -0
  31. package/dist/{chunk-CC5QWW52.mjs → chunk-LHIG6RW7.mjs} +2 -2
  32. package/dist/chunk-LHIG6RW7.mjs.map +1 -0
  33. package/dist/{chunk-YQMTDQSQ.mjs → chunk-TC5PD4TA.mjs} +4 -4
  34. package/dist/chunk-VU2GCAM4.mjs +81 -0
  35. package/dist/chunk-VU2GCAM4.mjs.map +1 -0
  36. package/dist/{chunk-5UGT7L7R.mjs → chunk-XZ43OSZ5.mjs} +5 -3
  37. package/dist/chunk-XZ43OSZ5.mjs.map +1 -0
  38. package/dist/{chunk-JQGB77SS.mjs → chunk-Z2ZPTZ6F.mjs} +5 -3
  39. package/dist/chunk-Z2ZPTZ6F.mjs.map +1 -0
  40. package/dist/footer/footer.js +0 -1
  41. package/dist/footer/footer.js.map +1 -1
  42. package/dist/footer/footer.mjs +3 -3
  43. package/dist/footer/index.js +0 -1
  44. package/dist/footer/index.js.map +1 -1
  45. package/dist/footer/index.mjs +3 -3
  46. package/dist/form/checkbox/checkbox.d.ts +2 -0
  47. package/dist/form/checkbox/checkbox.d.ts.map +1 -1
  48. package/dist/form/checkbox/checkbox.js +7 -3
  49. package/dist/form/checkbox/checkbox.js.map +1 -1
  50. package/dist/form/checkbox/checkbox.mjs +3 -3
  51. package/dist/form/checkbox/index.js +7 -3
  52. package/dist/form/checkbox/index.js.map +1 -1
  53. package/dist/form/checkbox/index.mjs +3 -3
  54. package/dist/form/date-picker/date-picker.js +4 -2
  55. package/dist/form/date-picker/date-picker.js.map +1 -1
  56. package/dist/form/date-picker/date-picker.mjs +3 -3
  57. package/dist/form/date-picker/index.js +4 -2
  58. package/dist/form/date-picker/index.js.map +1 -1
  59. package/dist/form/date-picker/index.mjs +3 -3
  60. package/dist/form/error-message/error-message.js +1 -1
  61. package/dist/form/error-message/error-message.js.map +1 -1
  62. package/dist/form/error-message/error-message.mjs +1 -1
  63. package/dist/form/error-message/index.js +1 -1
  64. package/dist/form/error-message/index.js.map +1 -1
  65. package/dist/form/error-message/index.mjs +1 -1
  66. package/dist/form/error-summary/error-summary.d.ts +65 -0
  67. package/dist/form/error-summary/error-summary.d.ts.map +1 -0
  68. package/dist/form/error-summary/error-summary.js +379 -0
  69. package/dist/form/error-summary/error-summary.js.map +1 -0
  70. package/dist/form/error-summary/error-summary.mjs +26 -0
  71. package/dist/form/error-summary/error-summary.mjs.map +1 -0
  72. package/dist/form/error-summary/focus.d.ts +9 -0
  73. package/dist/form/error-summary/focus.d.ts.map +1 -0
  74. package/dist/form/error-summary/focus.js +69 -0
  75. package/dist/form/error-summary/focus.js.map +1 -0
  76. package/dist/form/error-summary/focus.mjs +8 -0
  77. package/dist/form/error-summary/focus.mjs.map +1 -0
  78. package/dist/form/error-summary/index.d.ts +3 -0
  79. package/dist/form/error-summary/index.d.ts.map +1 -0
  80. package/dist/form/error-summary/index.js +375 -0
  81. package/dist/form/error-summary/index.js.map +1 -0
  82. package/dist/form/error-summary/index.mjs +21 -0
  83. package/dist/form/error-summary/index.mjs.map +1 -0
  84. package/dist/form/fieldset/fieldset.d.ts +2 -0
  85. package/dist/form/fieldset/fieldset.d.ts.map +1 -1
  86. package/dist/form/fieldset/fieldset.js +4 -2
  87. package/dist/form/fieldset/fieldset.js.map +1 -1
  88. package/dist/form/fieldset/fieldset.mjs +2 -2
  89. package/dist/form/fieldset/index.js +4 -2
  90. package/dist/form/fieldset/index.js.map +1 -1
  91. package/dist/form/fieldset/index.mjs +2 -2
  92. package/dist/form/index.d.ts +1 -0
  93. package/dist/form/index.d.ts.map +1 -1
  94. package/dist/form/index.js +333 -39
  95. package/dist/form/index.js.map +1 -1
  96. package/dist/form/index.mjs +30 -14
  97. package/dist/form/input/index.js +4 -2
  98. package/dist/form/input/index.js.map +1 -1
  99. package/dist/form/input/index.mjs +3 -3
  100. package/dist/form/input/input.js +4 -2
  101. package/dist/form/input/input.js.map +1 -1
  102. package/dist/form/input/input.mjs +3 -3
  103. package/dist/form/input-group/index.js +4 -2
  104. package/dist/form/input-group/index.js.map +1 -1
  105. package/dist/form/input-group/index.mjs +2 -2
  106. package/dist/form/input-group/input-group.d.ts +2 -0
  107. package/dist/form/input-group/input-group.d.ts.map +1 -1
  108. package/dist/form/input-group/input-group.js +4 -2
  109. package/dist/form/input-group/input-group.js.map +1 -1
  110. package/dist/form/input-group/input-group.mjs +2 -2
  111. package/dist/form/radio-button/index.js +4 -2
  112. package/dist/form/radio-button/index.js.map +1 -1
  113. package/dist/form/radio-button/index.mjs +4 -4
  114. package/dist/form/radio-button/radio-button.js +4 -2
  115. package/dist/form/radio-button/radio-button.js.map +1 -1
  116. package/dist/form/radio-button/radio-button.mjs +4 -4
  117. package/dist/form/radio-button/radio-group.js +4 -2
  118. package/dist/form/radio-button/radio-group.js.map +1 -1
  119. package/dist/form/radio-button/radio-group.mjs +3 -3
  120. package/dist/form/select/index.js +4 -2
  121. package/dist/form/select/index.js.map +1 -1
  122. package/dist/form/select/index.mjs +3 -3
  123. package/dist/form/select/select.js +4 -2
  124. package/dist/form/select/select.js.map +1 -1
  125. package/dist/form/select/select.mjs +3 -3
  126. package/dist/form/textarea/index.js +4 -2
  127. package/dist/form/textarea/index.js.map +1 -1
  128. package/dist/form/textarea/index.mjs +3 -3
  129. package/dist/form/textarea/textarea.js +4 -2
  130. package/dist/form/textarea/textarea.js.map +1 -1
  131. package/dist/form/textarea/textarea.mjs +3 -3
  132. package/dist/index.js +573 -474
  133. package/dist/index.js.map +1 -1
  134. package/dist/index.mjs +54 -48
  135. package/dist/layout/grid/grid.mjs +2 -2
  136. package/dist/layout/grid/index.mjs +2 -2
  137. package/dist/layout/index.mjs +6 -6
  138. package/dist/layout/stack/index.mjs +2 -2
  139. package/dist/layout/stack/stack.mjs +2 -2
  140. package/dist/message/index.js.map +1 -1
  141. package/dist/message/index.mjs +1 -1
  142. package/dist/message/message.d.ts +2 -2
  143. package/dist/message/message.d.ts.map +1 -1
  144. package/dist/message/message.js.map +1 -1
  145. package/dist/message/message.mjs +1 -1
  146. package/package.json +5 -5
  147. package/src/accordion/accordion-content.tsx +0 -1
  148. package/src/form/checkbox/checkbox.tsx +6 -2
  149. package/src/form/error-message/error-message.tsx +1 -1
  150. package/src/form/error-summary/error-summary.stories.tsx +29 -0
  151. package/src/form/error-summary/error-summary.tsx +151 -0
  152. package/src/form/error-summary/focus.ts +66 -0
  153. package/src/form/error-summary/index.tsx +2 -0
  154. package/src/form/fieldset/fieldset.tsx +6 -2
  155. package/src/form/index.tsx +1 -0
  156. package/src/form/input-group/input-group.tsx +6 -2
  157. package/src/message/message.tsx +2 -2
  158. package/dist/chunk-5UGT7L7R.mjs.map +0 -1
  159. package/dist/chunk-CC5QWW52.mjs.map +0 -1
  160. package/dist/chunk-JQGB77SS.mjs.map +0 -1
  161. package/dist/chunk-JZXZYEPG.mjs.map +0 -1
  162. package/dist/chunk-QRGGURVO.mjs.map +0 -1
  163. package/dist/chunk-TWUAXAMR.mjs.map +0 -1
  164. package/dist/chunk-XFKD6EEJ.mjs +0 -1
  165. /package/dist/{chunk-ROQH67YP.mjs.map → chunk-6DWIJEHQ.mjs.map} +0 -0
  166. /package/dist/{chunk-6BXKRPR3.mjs.map → chunk-AXEAIXG7.mjs.map} +0 -0
  167. /package/dist/{chunk-CXX4SXJG.mjs.map → chunk-CKG2XRMX.mjs.map} +0 -0
  168. /package/dist/{chunk-YS7HBWOI.mjs.map → chunk-E6OOFTRQ.mjs.map} +0 -0
  169. /package/dist/{chunk-6SVLMQUW.mjs.map → chunk-FUIKSOJF.mjs.map} +0 -0
  170. /package/dist/{chunk-WUPLEZEY.mjs.map → chunk-GVO57ZWU.mjs.map} +0 -0
  171. /package/dist/{chunk-UL2V2Z5B.mjs.map → chunk-HEDGKRGC.mjs.map} +0 -0
  172. /package/dist/{chunk-XFKD6EEJ.mjs.map → chunk-IJSEJZ3W.mjs.map} +0 -0
  173. /package/dist/{chunk-S3QSGJX2.mjs.map → chunk-ITLZQ47H.mjs.map} +0 -0
  174. /package/dist/{chunk-NIYDN3Y3.mjs.map → chunk-JEAGKB4V.mjs.map} +0 -0
  175. /package/dist/{chunk-YQMTDQSQ.mjs.map → chunk-TC5PD4TA.mjs.map} +0 -0
@@ -0,0 +1,375 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __getProtoOf = Object.getPrototypeOf;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
+ var __objRest = (source, exclude) => {
26
+ var target = {};
27
+ for (var prop in source)
28
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
+ target[prop] = source[prop];
30
+ if (source != null && __getOwnPropSymbols)
31
+ for (var prop of __getOwnPropSymbols(source)) {
32
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
+ target[prop] = source[prop];
34
+ }
35
+ return target;
36
+ };
37
+ var __export = (target, all) => {
38
+ for (var name in all)
39
+ __defProp(target, name, { get: all[name], enumerable: true });
40
+ };
41
+ var __copyProps = (to, from, except, desc) => {
42
+ if (from && typeof from === "object" || typeof from === "function") {
43
+ for (let key of __getOwnPropNames(from))
44
+ if (!__hasOwnProp.call(to, key) && key !== except)
45
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
46
+ }
47
+ return to;
48
+ };
49
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
50
+ // If the importer is in node compatibility mode or this is not an ESM
51
+ // file that has been converted to a CommonJS file using a Babel-
52
+ // compatible transform (i.e. "__esModule" has not been set), then set
53
+ // "default" to the CommonJS "module.exports" for node compatibility.
54
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
55
+ mod
56
+ ));
57
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
58
+
59
+ // src/form/error-summary/index.tsx
60
+ var error_summary_exports = {};
61
+ __export(error_summary_exports, {
62
+ ErrorSummary: () => ErrorSummary
63
+ });
64
+ module.exports = __toCommonJS(error_summary_exports);
65
+
66
+ // src/form/error-summary/error-summary.tsx
67
+ var import_react6 = require("react");
68
+
69
+ // src/message/message.tsx
70
+ var import_react2 = require("react");
71
+ var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname");
72
+ var import_react_slot2 = require("@radix-ui/react-slot");
73
+
74
+ // src/box/box.tsx
75
+ var import_react = require("react");
76
+ var import_typed_classname = require("@postenbring/hedwig-css/typed-classname");
77
+ var import_react_slot = require("@radix-ui/react-slot");
78
+ var import_jsx_runtime = require("react/jsx-runtime");
79
+ var BoxCloseButton = (0, import_react.forwardRef)(
80
+ (_a, ref) => {
81
+ var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
82
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
83
+ "button",
84
+ __spreadValues({
85
+ className: (0, import_typed_classname.clsx)("hds-box__close-button", className),
86
+ ref,
87
+ type: "button"
88
+ }, rest)
89
+ );
90
+ }
91
+ );
92
+ BoxCloseButton.displayName = "Box.CloseButton";
93
+ var Box = (0, import_react.forwardRef)(
94
+ (_a, ref) => {
95
+ var _b = _a, {
96
+ asChild,
97
+ variant,
98
+ closeable = false,
99
+ onClose: onCloseProp,
100
+ closed: closedProp,
101
+ closeButtonProps,
102
+ children,
103
+ className
104
+ } = _b, rest = __objRest(_b, [
105
+ "asChild",
106
+ "variant",
107
+ "closeable",
108
+ "onClose",
109
+ "closed",
110
+ "closeButtonProps",
111
+ "children",
112
+ "className"
113
+ ]);
114
+ const [closedState, setClosedState] = (0, import_react.useState)(false);
115
+ const onClose = (0, import_react.useCallback)(() => {
116
+ if (onCloseProp) {
117
+ const result = onCloseProp();
118
+ if (result === true) {
119
+ setClosedState(true);
120
+ }
121
+ } else {
122
+ setClosedState(true);
123
+ }
124
+ }, []);
125
+ const closed = closedProp != null ? closedProp : closedState;
126
+ const Component = asChild ? import_react_slot.Slot : "div";
127
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
128
+ Component,
129
+ __spreadProps(__spreadValues({
130
+ className: (0, import_typed_classname.clsx)(
131
+ "hds-box",
132
+ variant && `hds-box--${variant}`,
133
+ { "hds-box--closed": closed },
134
+ className
135
+ ),
136
+ ref
137
+ }, rest), {
138
+ children: [
139
+ closeable ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)) : null,
140
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_slot.Slottable, { children })
141
+ ]
142
+ })
143
+ );
144
+ }
145
+ );
146
+ Box.displayName = "Box";
147
+ Box.CloseButton = BoxCloseButton;
148
+
149
+ // src/message/message.tsx
150
+ var import_jsx_runtime2 = require("react/jsx-runtime");
151
+ var MessageTitle = (0, import_react2.forwardRef)(
152
+ (_a, ref) => {
153
+ var _b = _a, { asChild, className } = _b, rest = __objRest(_b, ["asChild", "className"]);
154
+ const Component = asChild ? import_react_slot2.Slot : "div";
155
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
156
+ Component,
157
+ __spreadValues({
158
+ className: (0, import_typed_classname2.clsx)("hds-message__title", className),
159
+ ref
160
+ }, rest)
161
+ );
162
+ }
163
+ );
164
+ MessageTitle.displayName = "Message.Title";
165
+ var MessageDescription = (0, import_react2.forwardRef)(
166
+ (_a, ref) => {
167
+ var _b = _a, { asChild, className } = _b, rest = __objRest(_b, ["asChild", "className"]);
168
+ const Component = asChild ? import_react_slot2.Slot : "div";
169
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
170
+ Component,
171
+ __spreadValues({
172
+ className: (0, import_typed_classname2.clsx)("hds-message__description", className),
173
+ ref
174
+ }, rest)
175
+ );
176
+ }
177
+ );
178
+ MessageDescription.displayName = "Message.Description";
179
+ var Message = (0, import_react2.forwardRef)(
180
+ (_a, ref) => {
181
+ var _b = _a, { children, className, variant = "success", icon, iconClassName } = _b, rest = __objRest(_b, ["children", "className", "variant", "icon", "iconClassName"]);
182
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
183
+ Box,
184
+ __spreadProps(__spreadValues({
185
+ className: (0, import_typed_classname2.clsx)(`hds-message`, `hds-message--${variant}`, className),
186
+ ref
187
+ }, rest), {
188
+ children: [
189
+ variant === "neutral" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: (0, import_typed_classname2.clsx)("hds-message--neutral__icon", iconClassName), children: icon }),
190
+ children
191
+ ]
192
+ })
193
+ );
194
+ }
195
+ );
196
+ Message.displayName = "Message";
197
+ Message.Title = MessageTitle;
198
+ Message.Description = MessageDescription;
199
+
200
+ // src/list/list.tsx
201
+ var import_react3 = require("react");
202
+ var import_typed_classname3 = require("@postenbring/hedwig-css/typed-classname");
203
+ var import_jsx_runtime3 = require("react/jsx-runtime");
204
+ var UnorderedList = (0, import_react3.forwardRef)(
205
+ (_a, ref) => {
206
+ var _b = _a, { size = "medium", className } = _b, rest = __objRest(_b, ["size", "className"]);
207
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
208
+ "ul",
209
+ __spreadValues({
210
+ ref,
211
+ className: (0, import_typed_classname3.clsx)("hds-list", `hds-list--${size}`, className)
212
+ }, rest)
213
+ );
214
+ }
215
+ );
216
+ UnorderedList.displayName = "UnorderedList";
217
+ var OrderedList = (0, import_react3.forwardRef)(
218
+ (_a, ref) => {
219
+ var _b = _a, { size = "medium", className } = _b, rest = __objRest(_b, ["size", "className"]);
220
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
221
+ "ol",
222
+ __spreadValues({
223
+ ref,
224
+ className: (0, import_typed_classname3.clsx)("hds-list", `hds-list--${size}`, className)
225
+ }, rest)
226
+ );
227
+ }
228
+ );
229
+ OrderedList.displayName = "OrderedList";
230
+
231
+ // src/link/link.tsx
232
+ var React = require("react");
233
+ var import_typed_classname4 = require("@postenbring/hedwig-css/typed-classname");
234
+ var import_react4 = require("react");
235
+ var import_react_slot3 = require("@radix-ui/react-slot");
236
+ var import_jsx_runtime4 = require("react/jsx-runtime");
237
+ var Link = (0, import_react4.forwardRef)(
238
+ (_a, ref) => {
239
+ var _b = _a, { asChild, children, variant = "underline", size = "medium", className } = _b, rest = __objRest(_b, ["asChild", "children", "variant", "size", "className"]);
240
+ const Component = asChild ? import_react_slot3.Slot : "a";
241
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
242
+ Component,
243
+ __spreadProps(__spreadValues({
244
+ className: (0, import_typed_classname4.clsx)(
245
+ "hds-link",
246
+ variant !== "underline" && `hds-link--${variant}`,
247
+ size !== "medium" && `hds-link--${size}`,
248
+ className
249
+ ),
250
+ ref
251
+ }, rest), {
252
+ children
253
+ })
254
+ );
255
+ }
256
+ );
257
+ Link.displayName = "Link";
258
+
259
+ // src/utils/utils.ts
260
+ var React2 = __toESM(require("react"));
261
+ var import_react5 = require("react");
262
+ function useMergeRefs(refs) {
263
+ return React2.useMemo(() => {
264
+ if (refs.every((ref) => ref === null)) {
265
+ return null;
266
+ }
267
+ return (value) => {
268
+ refs.forEach((ref) => {
269
+ if (typeof ref === "function") {
270
+ ref(value);
271
+ } else if (ref !== null) {
272
+ ref.current = value;
273
+ }
274
+ });
275
+ };
276
+ }, refs);
277
+ }
278
+
279
+ // src/form/error-summary/focus.ts
280
+ function focusWithLegendOrLabelInViewport(id) {
281
+ var _a;
282
+ const input = document.getElementById(id);
283
+ if (!input) {
284
+ return false;
285
+ }
286
+ const legendOrLabel = (_a = maybeLegendForInput(input)) != null ? _a : labelForInput(input);
287
+ if (!legendOrLabel) {
288
+ return false;
289
+ }
290
+ legendOrLabel.scrollIntoView();
291
+ input.focus({ preventScroll: true });
292
+ return true;
293
+ }
294
+ function maybeLegendForInput(input) {
295
+ const fieldset = input.closest("fieldset");
296
+ if (!fieldset) {
297
+ return null;
298
+ }
299
+ const legend = fieldset.querySelector("legend");
300
+ if (!legend) {
301
+ return null;
302
+ }
303
+ if (input instanceof HTMLInputElement && (input.type === "checkbox" || input.type === "radio")) {
304
+ return legend;
305
+ }
306
+ const legendTop = legend.getBoundingClientRect().top;
307
+ const inputRect = input.getBoundingClientRect();
308
+ if (inputRect.height && window.innerHeight) {
309
+ const inputBottom = inputRect.top + inputRect.height;
310
+ if (inputBottom - legendTop < window.innerHeight / 2) {
311
+ return legend;
312
+ }
313
+ }
314
+ }
315
+ function labelForInput(input) {
316
+ var _a;
317
+ return (_a = document.querySelector(`label[for='${input.getAttribute("id")}']`)) != null ? _a : input.closest("label");
318
+ }
319
+
320
+ // src/form/error-summary/error-summary.tsx
321
+ var import_jsx_runtime5 = require("react/jsx-runtime");
322
+ var ErrorSummaryHeading = (0, import_react6.forwardRef)((_a, ref) => {
323
+ var _b = _a, { children, as: Tag, autoFocus = true } = _b, rest = __objRest(_b, ["children", "as", "autoFocus"]);
324
+ const focusRef = (0, import_react6.useRef)(null);
325
+ const mergedRef = useMergeRefs([focusRef, ref]);
326
+ (0, import_react6.useEffect)(() => {
327
+ setTimeout(() => {
328
+ if (focusRef.current && autoFocus) {
329
+ focusRef.current.focus();
330
+ }
331
+ });
332
+ }, []);
333
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Message.Title, __spreadProps(__spreadValues({ ref: mergedRef, tabIndex: -1, asChild: true }, rest), { children: Tag ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Tag, { children }) : children }));
334
+ });
335
+ ErrorSummaryHeading.displayName = "ErrorSummary.Heading";
336
+ var ErrorSummaryList = (0, import_react6.forwardRef)(
337
+ (_a, ref) => {
338
+ var _b = _a, { children, style: _style, size = "small" } = _b, rest = __objRest(_b, ["children", "style", "size"]);
339
+ const style = __spreadValues({
340
+ // Match the link `solid` style, which black underline
341
+ "--_hds-list-marker-color": "var(--hds-ui-colors-black)"
342
+ }, _style);
343
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Message.Description, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(UnorderedList, __spreadProps(__spreadValues({ size, ref, style }, rest), { children })) });
344
+ }
345
+ );
346
+ ErrorSummaryList.displayName = "ErrorSummary.List";
347
+ var ErrorSummaryItem = (0, import_react6.forwardRef)(
348
+ (_a, ref) => {
349
+ var _b = _a, { children, href, linkProps } = _b, rest = __objRest(_b, ["children", "href", "linkProps"]);
350
+ function onClick(e) {
351
+ var _a2;
352
+ (_a2 = linkProps == null ? void 0 : linkProps.onClick) == null ? void 0 : _a2.call(linkProps, e);
353
+ if (focusWithLegendOrLabelInViewport(href.replace("#", ""))) {
354
+ e.preventDefault();
355
+ }
356
+ }
357
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", __spreadProps(__spreadValues({ ref }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Link, __spreadProps(__spreadValues({ size: "small", href, variant: "solid" }, linkProps), { onClick, children })) }));
358
+ }
359
+ );
360
+ ErrorSummaryItem.displayName = "ErrorSummary.Item";
361
+ var ErrorSummary = (0, import_react6.forwardRef)(
362
+ (_a, ref) => {
363
+ var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
364
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Message, __spreadProps(__spreadValues({ variant: "warning", ref }, rest), { children }));
365
+ }
366
+ );
367
+ ErrorSummary.displayName = "ErrorSummary";
368
+ ErrorSummary.Heading = ErrorSummaryHeading;
369
+ ErrorSummary.List = ErrorSummaryList;
370
+ ErrorSummary.Item = ErrorSummaryItem;
371
+ // Annotate the CommonJS export names for ESM import in node:
372
+ 0 && (module.exports = {
373
+ ErrorSummary
374
+ });
375
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/error-summary/index.tsx","../../../src/form/error-summary/error-summary.tsx","../../../src/message/message.tsx","../../../src/box/box.tsx","../../../src/list/list.tsx","../../../src/link/link.tsx","../../../src/utils/utils.ts","../../../src/form/error-summary/focus.ts"],"sourcesContent":["export { ErrorSummary } from \"./error-summary\";\nexport type * from \"./error-summary\";\n","import { forwardRef, useEffect, useRef } from \"react\";\nimport { Message, type MessageProps, type MessageTitleProps } from \"../../message\";\nimport { UnorderedList, type ListProps } from \"../../list\";\nimport { Link } from \"../../link\";\nimport { useMergeRefs } from \"../../utils\";\nimport { focusWithLegendOrLabelInViewport } from \"./focus\";\n\ninterface ErrorSummaryHeadingPropsAutoFocus {\n /**\n * The heading will be focused when the component mounts\n *\n * On following errornous form submissions you should manually focus the heading\n * e.g. by passing a ref and calling `ref.current.focus()`\n *\n * @default true\n */\n autoFocus?: boolean;\n}\n\ninterface ErrorSummaryHeadingPropsAs {\n /**\n * A heading level must be selected, or optionally opting out for a different element\n *\n * Use {@link ErrorSummaryHeadingPropsAsChild.asChild} if you need more control of the rendered element.\n */\n as: \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"span\" | \"div\" | \"label\" | \"p\";\n asChild?: never;\n}\n\ninterface ErrorSummaryHeadingPropsAsChild {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild: true;\n as?: never;\n}\n\nexport type ErrorSummaryHeadingProps = MessageTitleProps &\n ErrorSummaryHeadingPropsAutoFocus &\n (ErrorSummaryHeadingPropsAs | ErrorSummaryHeadingPropsAsChild);\n\nexport const ErrorSummaryHeading = forwardRef<\n HTMLParagraphElement,\n ErrorSummaryHeadingProps & (ErrorSummaryHeadingPropsAs | ErrorSummaryHeadingPropsAsChild)\n>(({ children, as: Tag, autoFocus = true, ...rest }, ref) => {\n const focusRef = useRef<HTMLElement>(null);\n const mergedRef = useMergeRefs([focusRef, ref]);\n\n useEffect(() => {\n /**\n * Hack: Safari 18 on mac at the time of writing\n * does not correctly focus it with VoiceOver without the timeout\n */\n setTimeout(() => {\n if (focusRef.current && autoFocus) {\n focusRef.current.focus();\n }\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps -- Only on initial render\n }, []);\n\n return (\n <Message.Title ref={mergedRef} tabIndex={-1} asChild {...rest}>\n {Tag ? <Tag>{children}</Tag> : children}\n </Message.Title>\n );\n});\nErrorSummaryHeading.displayName = \"ErrorSummary.Heading\";\n\nexport interface ErrorSummaryListProps extends ListProps {\n /**\n * Sets the size of the items (font)\n *\n * @default \"small\"\n */\n size?: ListProps[\"size\"];\n}\nexport const ErrorSummaryList = forwardRef<HTMLUListElement, ErrorSummaryListProps>(\n ({ children, style: _style, size = \"small\", ...rest }, ref) => {\n const style = {\n // Match the link `solid` style, which black underline\n \"--_hds-list-marker-color\": \"var(--hds-ui-colors-black)\",\n ..._style,\n };\n return (\n <Message.Description asChild>\n <UnorderedList size={size} ref={ref} style={style} {...rest}>\n {children}\n </UnorderedList>\n </Message.Description>\n );\n },\n);\nErrorSummaryList.displayName = \"ErrorSummary.List\";\n\nexport interface ErrorSummaryItemProps extends React.HTMLAttributes<HTMLLIElement> {\n /**\n * A hash link to the element that the error message refers to\n *\n * Must start with \"#\" as it's passed to the `href` attribute of an anchor element\n *\n * @example \"#email\"\n */\n href: `#${string}`;\n\n /**\n * Extra props to pass to the link element\n */\n linkProps?: React.AnchorHTMLAttributes<HTMLAnchorElement>;\n}\nexport const ErrorSummaryItem = forwardRef<HTMLLIElement, ErrorSummaryItemProps>(\n ({ children, href, linkProps, ...rest }, ref) => {\n function onClick(e: React.MouseEvent<HTMLAnchorElement>) {\n linkProps?.onClick?.(e);\n if (focusWithLegendOrLabelInViewport(href.replace(\"#\", \"\"))) {\n e.preventDefault();\n }\n }\n\n return (\n <li ref={ref} {...rest}>\n <Link size=\"small\" href={href} variant=\"solid\" {...linkProps} onClick={onClick}>\n {children}\n </Link>\n </li>\n );\n },\n);\nErrorSummaryItem.displayName = \"ErrorSummary.Item\";\n\nexport type ErrorSummaryProps = Omit<MessageProps, \"variant\" | \"icon\" | \"iconClassName\">;\n\nexport const ErrorSummary = forwardRef<HTMLDivElement, ErrorSummaryProps>(\n ({ children, ...rest }, ref) => {\n return (\n <Message variant=\"warning\" ref={ref} {...rest}>\n {children}\n </Message>\n );\n },\n) as ErrorSummaryType;\nErrorSummary.displayName = \"ErrorSummary\";\n\ntype ErrorSummaryType = ReturnType<typeof forwardRef<HTMLDivElement, ErrorSummaryProps>> & {\n Heading: typeof ErrorSummaryHeading;\n List: typeof ErrorSummaryList;\n Item: typeof ErrorSummaryItem;\n};\nErrorSummary.Heading = ErrorSummaryHeading;\nErrorSummary.List = ErrorSummaryList;\nErrorSummary.Item = ErrorSummaryItem;\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\nexport const Message = forwardRef<HTMLDivElement, MessageProps>(\n ({ children, className, variant = \"success\", icon, iconClassName, ...rest }, ref) => {\n return (\n <Box\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\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 );\n },\n);\nBoxCloseButton.displayName = \"Box.CloseButton\";\n\nexport interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n\n /**\n * Color variant of the box\n *\n * @default \"light-grey\"\n */\n variant?: \"light-grey\" | \"lighter\" | \"white\" | \"warning\";\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\nexport const Box = forwardRef<HTMLDivElement, BoxProps>(\n (\n {\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 return (\n <Component\n className={clsx(\n \"hds-box\",\n variant && `hds-box--${variant}`,\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, type HTMLAttributes } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\n\nexport interface ListProps extends HTMLAttributes<HTMLOListElement | HTMLUListElement> {\n /**\n * Sets the size of the items (font)\n *\n * @default \"medium\"\n */\n size?: \"small\" | \"medium\" | \"large\";\n}\n\n/**\n * An unordered list of simple items, often text. You can nest other lists inside this component.\n *\n * If you have other list needs, you can build your own using the semantic `ul` and `ol` tags.\n *\n * @example\n * ```tsx\n * <UnorderedList>\n * <li>Item 1</li>\n * <li>Item 2</li>\n * <li>Item 3</li>\n * </UnorderedList>\n * ```\n */\nexport const UnorderedList = forwardRef<HTMLUListElement, ListProps>(\n ({ size = \"medium\", className, ...rest }, ref) => {\n return (\n <ul\n ref={ref}\n className={clsx(\"hds-list\", `hds-list--${size}`, className as undefined)}\n {...rest}\n />\n );\n },\n);\nUnorderedList.displayName = \"UnorderedList\";\n\n/**\n * An ordered list of simple items\n *\n * If you have other list needs, you can build your own using the semantic `ul` and `ol` tags.\n *\n * @example\n * ```tsx\n * <OrderedList>\n * <li>Item 1</li>\n * <li>Item 2</li>\n * <li>Item 3</li>\n * </OrderedList>\n * ```\n */\nexport const OrderedList = forwardRef<HTMLOListElement, ListProps>(\n ({ size = \"medium\", className, ...rest }, ref) => {\n return (\n <ol\n ref={ref}\n className={clsx(\"hds-list\", `hds-list--${size}`, className as undefined)}\n {...rest}\n />\n );\n },\n);\nOrderedList.displayName = \"OrderedList\";\n","import * as React from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { forwardRef } from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\nexport interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /**\n * The visual style of the link\n */\n variant?: \"underline\" | \"solid\" | \"inverted\" | \"no-underline\";\n\n /**\n * Font size of the link\n */\n size?: \"small\" | \"medium\" | \"large\";\n\n children: React.ReactNode;\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\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(\n ({ asChild, children, variant = \"underline\", size = \"medium\", className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"a\";\n return (\n <Component\n className={clsx(\n \"hds-link\",\n variant !== \"underline\" && `hds-link--${variant}`,\n size !== \"medium\" && `hds-link--${size}`,\n className as undefined,\n )}\n ref={ref}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\nLink.displayName = \"Link\";\n","import * as React from \"react\";\nimport { useCallback, useEffect, useState } from \"react\";\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n * @see https://floating-ui.com/docs/useMergeRefs\n */\nexport function useMergeRefs<Instance>(\n refs: (React.Ref<Instance> | undefined)[],\n): React.RefCallback<Instance> | null {\n return React.useMemo(() => {\n if (refs.every((ref) => ref === null)) {\n return null;\n }\n\n return (value) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref !== null) {\n (ref as React.MutableRefObject<Instance | null>).current = value;\n }\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- It's ok\n }, refs);\n}\n\nexport function useResize<Instance extends HTMLElement>(\n ref: React.RefObject<Instance> | undefined | null,\n): { width: number; height: number } {\n const [width, setWidth] = useState<number>(0);\n const [height, setHeight] = useState<number>(0);\n const handleResize = useCallback(() => {\n if (ref?.current !== null) {\n setWidth(ref?.current?.offsetWidth ?? 0);\n setHeight(ref?.current?.offsetHeight ?? 0);\n }\n }, [ref]);\n useEffect(() => {\n window.addEventListener(\"load\", handleResize);\n window.addEventListener(\"resize\", handleResize);\n return () => {\n window.removeEventListener(\"load\", handleResize);\n window.removeEventListener(\"resize\", handleResize);\n };\n }, [ref, handleResize]);\n useEffect(() => {\n handleResize();\n // eslint-disable-next-line react-hooks/exhaustive-deps -- It's ok\n }, []);\n return { width, height };\n}\n\nfunction subscribe() {\n // eslint-disable-next-line @typescript-eslint/no-empty-function -- It's ok\n return () => {};\n}\n\nexport function useHydrated() {\n return React.useSyncExternalStore(\n subscribe,\n () => true,\n () => false,\n );\n}\n\n/**\n * Trap focus inside an element using the `inert` attribute.\n *\n * Adds `inert` to all siblings of the given element, and all their ancestors up to the body.\n * Returns a cleanup function which removes the `inert` property from the elements, effectively giving focus back to rest of the document.\n *\n * NOTE: Does not support portals, i.e. elements outside the DOM hierarchy of the given element.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\n * @see https://web.dev/articles/inert\n */\nexport function focusTrap(element: HTMLElement) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function -- NOP on focus trapping the body element\n if (element === document.body) return () => {};\n\n let inertElements: HTMLElement[] = [];\n for (let el: HTMLElement | null = element; el; el = el.parentElement) {\n if (el === document.body) break;\n\n for (const sibling of el.parentElement?.children ?? []) {\n if (sibling === el) continue;\n if (!(sibling instanceof HTMLElement)) continue;\n if (sibling.hasAttribute(\"inert\")) continue;\n\n sibling.setAttribute(\"inert\", \"true\");\n inertElements.push(sibling);\n }\n }\n\n return () => {\n releaseFocusTrap(inertElements);\n inertElements = [];\n };\n}\n\n/**\n * Unset the `inert` attribute on all elements given\n */\nfunction releaseFocusTrap(inertElements: Iterable<HTMLElement>) {\n for (const el of inertElements) {\n el.removeAttribute(\"inert\");\n }\n}\n","/**\n * Focus a form field while showing the associated legend or label in the viewport.\n *\n * Gives the user a better context of what field they are focusing on.\n *\n * Copied from https://github.com/alphagov/govuk-frontend/blob/cbf4ef1e329711be5b78a92bda6ba84a7db9ca40/packages/govuk-frontend/src/govuk/components/error-summary/error-summary.mjs#L60-L108\n */\nexport function focusWithLegendOrLabelInViewport(id: string) {\n const input = document.getElementById(id);\n if (!input) {\n return false;\n }\n\n const legendOrLabel = maybeLegendForInput(input) ?? labelForInput(input);\n if (!legendOrLabel) {\n return false;\n }\n\n legendOrLabel.scrollIntoView();\n input.focus({ preventScroll: true });\n\n return true;\n}\n\nfunction maybeLegendForInput(input: HTMLElement) {\n const fieldset = input.closest(\"fieldset\");\n if (!fieldset) {\n return null;\n }\n\n const legend = fieldset.querySelector(\"legend\");\n if (!legend) {\n return null;\n }\n\n // If the input type is radio or checkbox, always use the legend if\n // there is one.\n if (input instanceof HTMLInputElement && (input.type === \"checkbox\" || input.type === \"radio\")) {\n return legend;\n }\n\n // For other input types, only scroll to the fieldset’s legend (instead\n // of the label associated with the input) if the input would end up in\n // the top half of the screen.\n //\n // This should avoid situations where the input either ends up off the\n // screen, or obscured by a software keyboard.\n const legendTop = legend.getBoundingClientRect().top;\n const inputRect = input.getBoundingClientRect();\n\n // If the browser doesn't support Element.getBoundingClientRect().height\n // or window.innerHeight (like IE8), bail and just link to the label.\n if (inputRect.height && window.innerHeight) {\n const inputBottom = inputRect.top + inputRect.height;\n\n if (inputBottom - legendTop < window.innerHeight / 2) {\n return legend;\n }\n }\n}\n\nfunction labelForInput(input: HTMLElement) {\n return (\n document.querySelector(`label[for='${input.getAttribute(\"id\")}']`) ?? input.closest(\"label\")\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA8C;;;ACA9C,IAAAC,gBAA2B;AAC3B,IAAAC,0BAAqB;AACrB,IAAAC,qBAAqB;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AAA,IACF;AAEA,WACE,6CAAC,qCAAG,OAAc,OAAjB,EACC,uDAAC,qCAAK,MAAK,SAAQ,MAAY,SAAQ,WAAY,YAAlD,EAA6D,SAC3D,WACH,IACF;AAAA,EAEJ;AACF;AACA,iBAAiB,cAAc;AAIxB,IAAM,mBAAe;AAAA,EAC1B,CAAC,IAAuB,QAAQ;AAA/B,iBAAE,WArIL,IAqIG,IAAe,iBAAf,IAAe,CAAb;AACD,WACE,6CAAC,wCAAQ,SAAQ,WAAU,OAAc,OAAxC,EACE,WACH;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;AAO3B,aAAa,UAAU;AACvB,aAAa,OAAO;AACpB,aAAa,OAAO;","names":["import_react","import_react","import_typed_classname","import_react_slot","import_jsx_runtime","import_react","import_typed_classname","import_jsx_runtime","import_typed_classname","import_react","import_react_slot","import_jsx_runtime","React","import_react","import_jsx_runtime","_a"]}
@@ -0,0 +1,21 @@
1
+ import "../../chunk-KPPLVGZ3.mjs";
2
+ import {
3
+ ErrorSummary
4
+ } from "../../chunk-VU2GCAM4.mjs";
5
+ import "../../chunk-CKAL5ZJZ.mjs";
6
+ import "../../chunk-CYDWEPFL.mjs";
7
+ import "../../chunk-KCEWKQ4W.mjs";
8
+ import "../../chunk-6QV3OV66.mjs";
9
+ import "../../chunk-RC76SXBP.mjs";
10
+ import "../../chunk-BYFBK3J7.mjs";
11
+ import "../../chunk-ILFK3VKS.mjs";
12
+ import "../../chunk-XLLYMQLW.mjs";
13
+ import "../../chunk-VYS2QNTL.mjs";
14
+ import "../../chunk-Z2ZCM4BE.mjs";
15
+ import "../../chunk-LGEGXOPU.mjs";
16
+ import "../../chunk-3OGHJOJF.mjs";
17
+ import "../../chunk-YOSPWY5K.mjs";
18
+ export {
19
+ ErrorSummary
20
+ };
21
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,5 @@
1
1
  import type { FieldsetHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties } from "react";
2
+ import { type ErrorMessageProps } from "../error-message";
2
3
  export interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {
3
4
  className?: string;
4
5
  style?: CSSProperties;
@@ -14,6 +15,7 @@ export interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElemen
14
15
  };
15
16
  legend: ReactNode;
16
17
  children: ReactNode;
18
+ errorMessageProps?: Partial<ErrorMessageProps>;
17
19
  }
18
20
  export declare const useFieldsetContext: () => {
19
21
  hasError: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"fieldset.d.ts","sourceRoot":"","sources":["../../../src/form/fieldset/fieldset.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI9F,MAAM,WAAW,aAAc,SAAQ,sBAAsB,CAAC,mBAAmB,CAAC;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG;QAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAA;KAAE,CAAC;IAC1E,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAID,eAAO,MAAM,kBAAkB;cAFmB,OAAO;CAEU,CAAC;AAEpE,eAAO,MAAM,QAAQ,+GAuCnB,CAAC"}
1
+ {"version":3,"file":"fieldset.d.ts","sourceRoot":"","sources":["../../../src/form/fieldset/fieldset.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE9F,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAExE,MAAM,WAAW,aAAc,SAAQ,sBAAsB,CAAC,mBAAmB,CAAC;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG;QAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAA;KAAE,CAAC;IAC1E,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAChD;AAID,eAAO,MAAM,kBAAkB;cAFmB,OAAO;CAEU,CAAC;AAEpE,eAAO,MAAM,QAAQ,+GA0CnB,CAAC"}
@@ -66,7 +66,7 @@ var ErrorMessage = (0, import_react.forwardRef)(
66
66
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
67
67
  "div",
68
68
  __spreadProps(__spreadValues({
69
- "aria-live": "assertive",
69
+ "aria-live": "polite",
70
70
  className: (0, import_typed_classname.clsx)("hds-error-message", className),
71
71
  id,
72
72
  ref
@@ -87,6 +87,7 @@ var Fieldset = (0, import_react2.forwardRef)(function Fieldset2(_a, ref) {
87
87
  className,
88
88
  style,
89
89
  errorMessage,
90
+ errorMessageProps,
90
91
  legendProps: _c = {}
91
92
  } = _b, _d = _c, { size: legendSize = "default", className: legendClassName } = _d, legendProps = __objRest(_d, ["size", "className"]), _e = _b, {
92
93
  legend,
@@ -95,6 +96,7 @@ var Fieldset = (0, import_react2.forwardRef)(function Fieldset2(_a, ref) {
95
96
  "className",
96
97
  "style",
97
98
  "errorMessage",
99
+ "errorMessageProps",
98
100
  "legendProps",
99
101
  "legend",
100
102
  "children"
@@ -123,7 +125,7 @@ var Fieldset = (0, import_react2.forwardRef)(function Fieldset2(_a, ref) {
123
125
  })
124
126
  ),
125
127
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FieldsetContext.Provider, { value: { hasError: Boolean(errorMessage) }, children }),
126
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ErrorMessage, { id: errorMessageId, children: errorMessage })
128
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ErrorMessage, __spreadProps(__spreadValues({ id: errorMessageId }, errorMessageProps), { children: errorMessage }))
127
129
  ]
128
130
  })
129
131
  );
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/form/fieldset/fieldset.tsx","../../../src/form/error-message/error-message.tsx"],"sourcesContent":["import { useId, forwardRef, createContext, useContext } from \"react\";\nimport type { FieldsetHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\n\nexport interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {\n className?: string;\n style?: CSSProperties;\n /**\n * Providing an errorMessage will also give contained Checkboxes or Radio buttons\n * error styling and aria to indicate invalid state.\n *\n * For Radio buttons you are even better off using RadioGroup.\n */\n errorMessage?: ReactNode;\n legendProps?: HTMLAttributes<HTMLElement> & { size: \"default\" | \"large\" };\n legend: ReactNode;\n children: ReactNode;\n}\n\nconst FieldsetContext = createContext<{ hasError: boolean }>({ hasError: false });\n\nexport const useFieldsetContext = () => useContext(FieldsetContext);\n\nexport const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(function Fieldset(\n {\n className,\n style,\n errorMessage,\n legendProps: { size: legendSize = \"default\", className: legendClassName, ...legendProps } = {},\n legend,\n children,\n ...rest\n },\n ref,\n) {\n const errorMessageId = useId();\n\n return (\n <fieldset\n aria-describedby={errorMessage ? errorMessageId : undefined}\n aria-invalid={errorMessage ? true : undefined}\n className={clsx(\"hds-fieldset\", className as undefined)}\n ref={ref}\n style={style}\n {...rest}\n >\n <legend\n className={clsx(\n \"hds-fieldset__legend\",\n { [`hds-fieldset__legend--${legendSize}`]: legendSize },\n legendClassName as undefined,\n )}\n {...legendProps}\n >\n {legend}\n </legend>\n <FieldsetContext.Provider value={{ hasError: Boolean(errorMessage) }}>\n {children}\n </FieldsetContext.Provider>\n <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage>\n </fieldset>\n );\n});\n","import { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { forwardRef, type ReactNode } from \"react\";\n\nexport interface ErrorMessageProps extends React.HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n id: string;\n className?: string;\n}\n\nexport const ErrorMessage = forwardRef<HTMLDivElement, ErrorMessageProps>(\n ({ children, id, className, ...rest }, ref) => {\n return (\n <div\n aria-live=\"assertive\"\n className={clsx(\"hds-error-message\", className as undefined)}\n id={id}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\nErrorMessage.displayName = \"ErrorMessage\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,gBAA6D;AAE7D,IAAAC,0BAAqB;;;ACFrB,6BAAqB;AACrB,mBAA2C;AAWrC;AAHC,IAAM,mBAAe;AAAA,EAC1B,CAAC,IAAsC,QAAQ;AAA9C,iBAAE,YAAU,IAAI,UAVnB,IAUG,IAA8B,iBAA9B,IAA8B,CAA5B,YAAU,MAAI;AACf,WACE;AAAA,MAAC;AAAA;AAAA,QACC,aAAU;AAAA,QACV,eAAW,6BAAK,qBAAqB,SAAsB;AAAA,QAC3D;AAAA,QACA;AAAA,SACI,OALL;AAAA,QAOE;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;;;ADevB,IAAAC,sBAAA;AAnBJ,IAAM,sBAAkB,6BAAqC,EAAE,UAAU,MAAM,CAAC;AAEzE,IAAM,qBAAqB,UAAM,0BAAW,eAAe;AAE3D,IAAM,eAAW,0BAA+C,SAASC,UAC9E,IASA,KACA;AAVA,eAIe;AAAA,IAHb;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa,KAA+E,CAAC;AAAA,EA7BjG,IAyBE,IAIe,SAAE,QAAM,aAAa,WAAW,WAAW,gBA7B5D,IA6BiB,IAA+D,wBAA/D,IAA+D,CAA7D,QAA8B,eAJ/C,SAKE;AAAA;AAAA,IACA;AAAA,EA/BJ,IAyBE,IAOK,iBAPL,IAOK;AAAA,IANH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAKF,QAAM,qBAAiB,qBAAM;AAE7B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,oBAAkB,eAAe,iBAAiB;AAAA,MAClD,gBAAc,eAAe,OAAO;AAAA,MACpC,eAAW,8BAAK,gBAAgB,SAAsB;AAAA,MACtD;AAAA,MACA;AAAA,OACI,OANL;AAAA,MAQC;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,eAAW;AAAA,cACT;AAAA,cACA,EAAE,CAAC,yBAAyB,UAAU,EAAE,GAAG,WAAW;AAAA,cACtD;AAAA,YACF;AAAA,aACI,cANL;AAAA,YAQE;AAAA;AAAA,QACH;AAAA,QACA,6CAAC,gBAAgB,UAAhB,EAAyB,OAAO,EAAE,UAAU,QAAQ,YAAY,EAAE,GAChE,UACH;AAAA,QACA,6CAAC,gBAAa,IAAI,gBAAiB,wBAAa;AAAA;AAAA;AAAA,EAClD;AAEJ,CAAC;","names":["import_react","import_typed_classname","import_jsx_runtime","Fieldset"]}
1
+ {"version":3,"sources":["../../../src/form/fieldset/fieldset.tsx","../../../src/form/error-message/error-message.tsx"],"sourcesContent":["import { useId, forwardRef, createContext, useContext } from \"react\";\nimport type { FieldsetHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage, type ErrorMessageProps } from \"../error-message\";\n\nexport interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {\n className?: string;\n style?: CSSProperties;\n /**\n * Providing an errorMessage will also give contained Checkboxes or Radio buttons\n * error styling and aria to indicate invalid state.\n *\n * For Radio buttons you are even better off using RadioGroup.\n */\n errorMessage?: ReactNode;\n legendProps?: HTMLAttributes<HTMLElement> & { size: \"default\" | \"large\" };\n legend: ReactNode;\n children: ReactNode;\n errorMessageProps?: Partial<ErrorMessageProps>;\n}\n\nconst FieldsetContext = createContext<{ hasError: boolean }>({ hasError: false });\n\nexport const useFieldsetContext = () => useContext(FieldsetContext);\n\nexport const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(function Fieldset(\n {\n className,\n style,\n errorMessage,\n errorMessageProps,\n legendProps: { size: legendSize = \"default\", className: legendClassName, ...legendProps } = {},\n legend,\n children,\n ...rest\n },\n ref,\n) {\n const errorMessageId = useId();\n\n return (\n <fieldset\n aria-describedby={errorMessage ? errorMessageId : undefined}\n aria-invalid={errorMessage ? true : undefined}\n className={clsx(\"hds-fieldset\", className as undefined)}\n ref={ref}\n style={style}\n {...rest}\n >\n <legend\n className={clsx(\n \"hds-fieldset__legend\",\n { [`hds-fieldset__legend--${legendSize}`]: legendSize },\n legendClassName as undefined,\n )}\n {...legendProps}\n >\n {legend}\n </legend>\n <FieldsetContext.Provider value={{ hasError: Boolean(errorMessage) }}>\n {children}\n </FieldsetContext.Provider>\n <ErrorMessage id={errorMessageId} {...errorMessageProps}>\n {errorMessage}\n </ErrorMessage>\n </fieldset>\n );\n});\n","import { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { forwardRef, type ReactNode } from \"react\";\n\nexport interface ErrorMessageProps extends React.HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n id: string;\n className?: string;\n}\n\nexport const ErrorMessage = forwardRef<HTMLDivElement, ErrorMessageProps>(\n ({ children, id, className, ...rest }, ref) => {\n return (\n <div\n aria-live=\"polite\"\n className={clsx(\"hds-error-message\", className as undefined)}\n id={id}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n },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AAAA,MACtD;AAAA,MACA;AAAA,OACI,OANL;AAAA,MAQC;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,eAAW;AAAA,cACT;AAAA,cACA,EAAE,CAAC,yBAAyB,UAAU,EAAE,GAAG,WAAW;AAAA,cACtD;AAAA,YACF;AAAA,aACI,cANL;AAAA,YAQE;AAAA;AAAA,QACH;AAAA,QACA,6CAAC,gBAAgB,UAAhB,EAAyB,OAAO,EAAE,UAAU,QAAQ,YAAY,EAAE,GAChE,UACH;AAAA,QACA,6CAAC,6CAAa,IAAI,kBAAoB,oBAArC,EACE,yBACH;AAAA;AAAA;AAAA,EACF;AAEJ,CAAC;","names":["import_react","import_typed_classname","import_jsx_runtime","Fieldset"]}
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Fieldset,
3
3
  useFieldsetContext
4
- } from "../../chunk-JQGB77SS.mjs";
4
+ } from "../../chunk-Z2ZPTZ6F.mjs";
5
5
  import "../../chunk-NSLSA7F7.mjs";
6
- import "../../chunk-CC5QWW52.mjs";
6
+ import "../../chunk-LHIG6RW7.mjs";
7
7
  import "../../chunk-YOSPWY5K.mjs";
8
8
  export {
9
9
  Fieldset,
@@ -68,7 +68,7 @@ var ErrorMessage = (0, import_react.forwardRef)(
68
68
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
69
69
  "div",
70
70
  __spreadProps(__spreadValues({
71
- "aria-live": "assertive",
71
+ "aria-live": "polite",
72
72
  className: (0, import_typed_classname.clsx)("hds-error-message", className),
73
73
  id,
74
74
  ref
@@ -89,6 +89,7 @@ var Fieldset = (0, import_react2.forwardRef)(function Fieldset2(_a, ref) {
89
89
  className,
90
90
  style,
91
91
  errorMessage,
92
+ errorMessageProps,
92
93
  legendProps: _c = {}
93
94
  } = _b, _d = _c, { size: legendSize = "default", className: legendClassName } = _d, legendProps = __objRest(_d, ["size", "className"]), _e = _b, {
94
95
  legend,
@@ -97,6 +98,7 @@ var Fieldset = (0, import_react2.forwardRef)(function Fieldset2(_a, ref) {
97
98
  "className",
98
99
  "style",
99
100
  "errorMessage",
101
+ "errorMessageProps",
100
102
  "legendProps",
101
103
  "legend",
102
104
  "children"
@@ -125,7 +127,7 @@ var Fieldset = (0, import_react2.forwardRef)(function Fieldset2(_a, ref) {
125
127
  })
126
128
  ),
127
129
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FieldsetContext.Provider, { value: { hasError: Boolean(errorMessage) }, children }),
128
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ErrorMessage, { id: errorMessageId, children: errorMessage })
130
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ErrorMessage, __spreadProps(__spreadValues({ id: errorMessageId }, errorMessageProps), { children: errorMessage }))
129
131
  ]
130
132
  })
131
133
  );
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/form/fieldset/index.tsx","../../../src/form/fieldset/fieldset.tsx","../../../src/form/error-message/error-message.tsx"],"sourcesContent":["export { Fieldset, useFieldsetContext } from \"./fieldset\";\nexport type * from \"./fieldset\";\n","import { useId, forwardRef, createContext, useContext } from \"react\";\nimport type { FieldsetHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\n\nexport interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {\n className?: string;\n style?: CSSProperties;\n /**\n * Providing an errorMessage will also give contained Checkboxes or Radio buttons\n * error styling and aria to indicate invalid state.\n *\n * For Radio buttons you are even better off using RadioGroup.\n */\n errorMessage?: ReactNode;\n legendProps?: HTMLAttributes<HTMLElement> & { size: \"default\" | \"large\" };\n legend: ReactNode;\n children: ReactNode;\n}\n\nconst FieldsetContext = createContext<{ hasError: boolean }>({ hasError: false });\n\nexport const useFieldsetContext = () => useContext(FieldsetContext);\n\nexport const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(function Fieldset(\n {\n className,\n style,\n errorMessage,\n legendProps: { size: legendSize = \"default\", className: legendClassName, ...legendProps } = {},\n legend,\n children,\n ...rest\n },\n ref,\n) {\n const errorMessageId = useId();\n\n return (\n <fieldset\n aria-describedby={errorMessage ? errorMessageId : undefined}\n aria-invalid={errorMessage ? true : undefined}\n className={clsx(\"hds-fieldset\", className as undefined)}\n ref={ref}\n style={style}\n {...rest}\n >\n <legend\n className={clsx(\n \"hds-fieldset__legend\",\n { [`hds-fieldset__legend--${legendSize}`]: legendSize },\n legendClassName as undefined,\n )}\n {...legendProps}\n >\n {legend}\n </legend>\n <FieldsetContext.Provider value={{ hasError: Boolean(errorMessage) }}>\n {children}\n </FieldsetContext.Provider>\n <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage>\n </fieldset>\n );\n});\n","import { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { forwardRef, type ReactNode } from \"react\";\n\nexport interface ErrorMessageProps extends React.HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n id: string;\n className?: string;\n}\n\nexport const ErrorMessage = forwardRef<HTMLDivElement, ErrorMessageProps>(\n ({ children, id, className, ...rest }, ref) => {\n return (\n <div\n aria-live=\"assertive\"\n className={clsx(\"hds-error-message\", className as undefined)}\n id={id}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\nErrorMessage.displayName = \"ErrorMessage\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA6D;AAE7D,IAAAC,0BAAqB;;;ACFrB,6BAAqB;AACrB,mBAA2C;AAWrC;AAHC,IAAM,mBAAe;AAAA,EAC1B,CAAC,IAAsC,QAAQ;AAA9C,iBAAE,YAAU,IAAI,UAVnB,IAUG,IAA8B,iBAA9B,IAA8B,CAA5B,YAAU,MAAI;AACf,WACE;AAAA,MAAC;AAAA;AAAA,QACC,aAAU;AAAA,QACV,eAAW,6BAAK,qBAAqB,SAAsB;AAAA,QAC3D;AAAA,QACA;AAAA,SACI,OALL;AAAA,QAOE;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;;;ADevB,IAAAC,sBAAA;AAnBJ,IAAM,sBAAkB,6BAAqC,EAAE,UAAU,MAAM,CAAC;AAEzE,IAAM,qBAAqB,UAAM,0BAAW,eAAe;AAE3D,IAAM,eAAW,0BAA+C,SAASC,UAC9E,IASA,KACA;AAVA,eAIe;AAAA,IAHb;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa,KAA+E,CAAC;AAAA,EA7BjG,IAyBE,IAIe,SAAE,QAAM,aAAa,WAAW,WAAW,gBA7B5D,IA6BiB,IAA+D,wBAA/D,IAA+D,CAA7D,QAA8B,eAJ/C,SAKE;AAAA;AAAA,IACA;AAAA,EA/BJ,IAyBE,IAOK,iBAPL,IAOK;AAAA,IANH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAKF,QAAM,qBAAiB,qBAAM;AAE7B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,oBAAkB,eAAe,iBAAiB;AAAA,MAClD,gBAAc,eAAe,OAAO;AAAA,MACpC,eAAW,8BAAK,gBAAgB,SAAsB;AAAA,MACtD;AAAA,MACA;AAAA,OACI,OANL;AAAA,MAQC;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,eAAW;AAAA,cACT;AAAA,cACA,EAAE,CAAC,yBAAyB,UAAU,EAAE,GAAG,WAAW;AAAA,cACtD;AAAA,YACF;AAAA,aACI,cANL;AAAA,YAQE;AAAA;AAAA,QACH;AAAA,QACA,6CAAC,gBAAgB,UAAhB,EAAyB,OAAO,EAAE,UAAU,QAAQ,YAAY,EAAE,GAChE,UACH;AAAA,QACA,6CAAC,gBAAa,IAAI,gBAAiB,wBAAa;AAAA;AAAA;AAAA,EAClD;AAEJ,CAAC;","names":["import_react","import_typed_classname","import_jsx_runtime","Fieldset"]}
1
+ {"version":3,"sources":["../../../src/form/fieldset/index.tsx","../../../src/form/fieldset/fieldset.tsx","../../../src/form/error-message/error-message.tsx"],"sourcesContent":["export { Fieldset, useFieldsetContext } from \"./fieldset\";\nexport type * from \"./fieldset\";\n","import { useId, forwardRef, createContext, useContext } from \"react\";\nimport type { FieldsetHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage, type ErrorMessageProps } from \"../error-message\";\n\nexport interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {\n className?: string;\n style?: CSSProperties;\n /**\n * Providing an errorMessage will also give contained Checkboxes or Radio buttons\n * error styling and aria to indicate invalid state.\n *\n * For Radio buttons you are even better off using RadioGroup.\n */\n errorMessage?: ReactNode;\n legendProps?: HTMLAttributes<HTMLElement> & { size: \"default\" | \"large\" };\n legend: ReactNode;\n children: ReactNode;\n errorMessageProps?: Partial<ErrorMessageProps>;\n}\n\nconst FieldsetContext = createContext<{ hasError: boolean }>({ hasError: false });\n\nexport const useFieldsetContext = () => useContext(FieldsetContext);\n\nexport const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(function Fieldset(\n {\n className,\n style,\n errorMessage,\n errorMessageProps,\n legendProps: { size: legendSize = \"default\", className: legendClassName, ...legendProps } = {},\n legend,\n children,\n ...rest\n },\n ref,\n) {\n const errorMessageId = useId();\n\n return (\n <fieldset\n aria-describedby={errorMessage ? errorMessageId : undefined}\n aria-invalid={errorMessage ? true : undefined}\n className={clsx(\"hds-fieldset\", className as undefined)}\n ref={ref}\n style={style}\n {...rest}\n >\n <legend\n className={clsx(\n \"hds-fieldset__legend\",\n { [`hds-fieldset__legend--${legendSize}`]: legendSize },\n legendClassName as undefined,\n )}\n {...legendProps}\n >\n {legend}\n </legend>\n <FieldsetContext.Provider value={{ hasError: Boolean(errorMessage) }}>\n {children}\n </FieldsetContext.Provider>\n <ErrorMessage id={errorMessageId} {...errorMessageProps}>\n {errorMessage}\n </ErrorMessage>\n </fieldset>\n );\n});\n","import { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { forwardRef, type ReactNode } from \"react\";\n\nexport interface ErrorMessageProps extends React.HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n id: string;\n className?: string;\n}\n\nexport const ErrorMessage = forwardRef<HTMLDivElement, ErrorMessageProps>(\n ({ children, id, className, ...rest }, ref) => {\n return (\n <div\n aria-live=\"polite\"\n className={clsx(\"hds-error-message\", className as undefined)}\n id={id}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\nErrorMessage.displayName = \"ErrorMessage\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA6D;AAE7D,IAAAC,0BAAqB;;;ACFrB,6BAAqB;AACrB,mBAA2C;AAWrC;AAHC,IAAM,mBAAe;AAAA,EAC1B,CAAC,IAAsC,QAAQ;AAA9C,iBAAE,YAAU,IAAI,UAVnB,IAUG,IAA8B,iBAA9B,IAA8B,CAA5B,YAAU,MAAI;AACf,WACE;AAAA,MAAC;AAAA;AAAA,QACC,aAAU;AAAA,QACV,eAAW,6BAAK,qBAAqB,SAAsB;AAAA,QAC3D;AAAA,QACA;AAAA,SACI,OALL;AAAA,QAOE;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;;;ADiBvB,IAAAC,sBAAA;AApBJ,IAAM,sBAAkB,6BAAqC,EAAE,UAAU,MAAM,CAAC;AAEzE,IAAM,qBAAqB,UAAM,0BAAW,eAAe;AAE3D,IAAM,eAAW,0BAA+C,SAASC,UAC9E,IAUA,KACA;AAXA,eAKe;AAAA,IAJb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa,KAA+E,CAAC;AAAA,EA/BjG,IA0BE,IAKe,SAAE,QAAM,aAAa,WAAW,WAAW,gBA/B5D,IA+BiB,IAA+D,wBAA/D,IAA+D,CAA7D,QAA8B,eAL/C,SAME;AAAA;AAAA,IACA;AAAA,EAjCJ,IA0BE,IAQK,iBARL,IAQK;AAAA,IAPH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAKF,QAAM,qBAAiB,qBAAM;AAE7B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,oBAAkB,eAAe,iBAAiB;AAAA,MAClD,gBAAc,eAAe,OAAO;AAAA,MACpC,eAAW,8BAAK,gBAAgB,SAAsB;AAAA,MACtD;AAAA,MACA;AAAA,OACI,OANL;AAAA,MAQC;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,eAAW;AAAA,cACT;AAAA,cACA,EAAE,CAAC,yBAAyB,UAAU,EAAE,GAAG,WAAW;AAAA,cACtD;AAAA,YACF;AAAA,aACI,cANL;AAAA,YAQE;AAAA;AAAA,QACH;AAAA,QACA,6CAAC,gBAAgB,UAAhB,EAAyB,OAAO,EAAE,UAAU,QAAQ,YAAY,EAAE,GAChE,UACH;AAAA,QACA,6CAAC,6CAAa,IAAI,kBAAoB,oBAArC,EACE,yBACH;AAAA;AAAA;AAAA,EACF;AAEJ,CAAC;","names":["import_react","import_typed_classname","import_jsx_runtime","Fieldset"]}
@@ -2,9 +2,9 @@ import "../../chunk-LMF3QGSF.mjs";
2
2
  import {
3
3
  Fieldset,
4
4
  useFieldsetContext
5
- } from "../../chunk-JQGB77SS.mjs";
5
+ } from "../../chunk-Z2ZPTZ6F.mjs";
6
6
  import "../../chunk-NSLSA7F7.mjs";
7
- import "../../chunk-CC5QWW52.mjs";
7
+ import "../../chunk-LHIG6RW7.mjs";
8
8
  import "../../chunk-YOSPWY5K.mjs";
9
9
  export {
10
10
  Fieldset,
@@ -1,6 +1,7 @@
1
1
  export * from "./checkbox";
2
2
  export * from "./date-picker";
3
3
  export * from "./error-message";
4
+ export * from "./error-summary";
4
5
  export * from "./fieldset";
5
6
  export * from "./input";
6
7
  export * from "./radio-button";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/form/index.tsx"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/form/index.tsx"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}