@postenbring/hedwig-react 0.0.41 → 0.0.43

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 (81) hide show
  1. package/dist/accordion/accordion-content.js +4 -10
  2. package/dist/accordion/accordion-content.mjs +2 -2
  3. package/dist/accordion/accordion-header.d.mts +9 -0
  4. package/dist/accordion/accordion-header.d.ts +9 -0
  5. package/dist/accordion/{accordion-trigger.js → accordion-header.js} +12 -36
  6. package/dist/accordion/accordion-header.mjs +8 -0
  7. package/dist/accordion/accordion-item.d.mts +15 -3
  8. package/dist/accordion/accordion-item.d.ts +15 -3
  9. package/dist/accordion/accordion-item.js +21 -26
  10. package/dist/accordion/accordion-item.mjs +2 -2
  11. package/dist/accordion/accordion.d.mts +4 -12
  12. package/dist/accordion/accordion.d.ts +4 -12
  13. package/dist/accordion/accordion.js +15 -28
  14. package/dist/accordion/accordion.mjs +1 -2
  15. package/dist/accordion/index.d.mts +4 -4
  16. package/dist/accordion/index.d.ts +4 -4
  17. package/dist/accordion/index.js +53 -71
  18. package/dist/accordion/index.mjs +6 -6
  19. package/dist/chunk-45BJGKVZ.mjs +5 -0
  20. package/dist/chunk-6KVF3ELJ.mjs +59 -0
  21. package/dist/chunk-6XTXM4YQ.mjs +47 -0
  22. package/dist/{chunk-PWHALENY.mjs → chunk-DOJ2ZKNV.mjs} +1 -0
  23. package/dist/chunk-K3BGDNWO.mjs +35 -0
  24. package/dist/{chunk-GSYDQFIT.mjs → chunk-KYCCTJI6.mjs} +7 -7
  25. package/dist/{chunk-NXFD7TFE.mjs → chunk-PF6PZIZS.mjs} +1 -0
  26. package/dist/chunk-PHTGLF6Y.mjs +7 -0
  27. package/dist/{chunk-JKZ3OR7W.mjs → chunk-Q3SWHAU3.mjs} +5 -3
  28. package/dist/chunk-QAYPCD5Z.mjs +95 -0
  29. package/dist/{chunk-XAIX3HTW.mjs → chunk-QC72RAQS.mjs} +23 -21
  30. package/dist/chunk-SDJXW6U7.mjs +32 -0
  31. package/dist/{chunk-R5ISWMI6.mjs → chunk-SX37JSDS.mjs} +1 -0
  32. package/dist/chunk-Y2KP4RF2.mjs +36 -0
  33. package/dist/index.d.mts +2 -1
  34. package/dist/index.d.ts +2 -1
  35. package/dist/index.js +319 -322
  36. package/dist/index.mjs +25 -23
  37. package/dist/input/index.d.mts +1 -0
  38. package/dist/input/index.d.ts +1 -0
  39. package/dist/input/index.js +105 -30
  40. package/dist/input/index.mjs +4 -2
  41. package/dist/input/input.d.mts +3 -8
  42. package/dist/input/input.d.ts +3 -8
  43. package/dist/input/input.js +102 -28
  44. package/dist/input/input.mjs +3 -1
  45. package/dist/input-group/index.d.mts +2 -0
  46. package/dist/input-group/index.d.ts +2 -0
  47. package/dist/input-group/index.js +148 -0
  48. package/dist/input-group/index.mjs +8 -0
  49. package/dist/input-group/input-group.d.mts +25 -0
  50. package/dist/input-group/input-group.d.ts +25 -0
  51. package/dist/input-group/input-group.js +142 -0
  52. package/dist/input-group/input-group.mjs +7 -0
  53. package/dist/list/index.mjs +3 -3
  54. package/dist/select/index.d.mts +2 -1
  55. package/dist/select/index.d.ts +2 -1
  56. package/dist/select/index.js +92 -19
  57. package/dist/select/index.mjs +4 -2
  58. package/dist/select/select.d.mts +5 -11
  59. package/dist/select/select.d.ts +5 -11
  60. package/dist/select/select.js +89 -17
  61. package/dist/select/select.mjs +3 -1
  62. package/dist/tabs/index.mjs +2 -2
  63. package/dist/textarea/index.d.mts +1 -0
  64. package/dist/textarea/index.d.ts +1 -0
  65. package/dist/textarea/index.js +82 -27
  66. package/dist/textarea/index.mjs +4 -2
  67. package/dist/textarea/textarea.d.mts +3 -8
  68. package/dist/textarea/textarea.d.ts +3 -8
  69. package/dist/textarea/textarea.js +79 -25
  70. package/dist/textarea/textarea.mjs +3 -1
  71. package/package.json +2 -2
  72. package/dist/accordion/accordion-trigger.d.mts +0 -9
  73. package/dist/accordion/accordion-trigger.d.ts +0 -9
  74. package/dist/accordion/accordion-trigger.mjs +0 -8
  75. package/dist/chunk-2V6SWZ5G.mjs +0 -16
  76. package/dist/chunk-4WI2BHHB.mjs +0 -63
  77. package/dist/chunk-5YF6SR4S.mjs +0 -73
  78. package/dist/chunk-GMGUONH5.mjs +0 -34
  79. package/dist/chunk-IT4L33S6.mjs +0 -54
  80. package/dist/chunk-MRJYCUBY.mjs +0 -76
  81. package/dist/{chunk-BSX4IA3X.mjs → chunk-WUMZCEIJ.mjs} +3 -3
package/dist/index.mjs CHANGED
@@ -1,22 +1,30 @@
1
+ import "./chunk-DOJ2ZKNV.mjs";
2
+ import {
3
+ Textarea
4
+ } from "./chunk-Y2KP4RF2.mjs";
1
5
  import "./chunk-K2HIKZ7F.mjs";
2
6
  import {
3
7
  WarningBanner
4
8
  } from "./chunk-BHNQPMEB.mjs";
5
- import "./chunk-R5ISWMI6.mjs";
9
+ import "./chunk-SX37JSDS.mjs";
6
10
  import {
7
11
  Select
8
- } from "./chunk-IT4L33S6.mjs";
12
+ } from "./chunk-K3BGDNWO.mjs";
9
13
  import {
10
14
  TabsComponent
11
- } from "./chunk-BSX4IA3X.mjs";
15
+ } from "./chunk-WUMZCEIJ.mjs";
16
+ import "./chunk-ZLCNSHLT.mjs";
12
17
  import "./chunk-GRO36EUL.mjs";
13
18
  import "./chunk-G3JPULGO.mjs";
14
- import "./chunk-ZLCNSHLT.mjs";
15
19
  import "./chunk-4ZM45P62.mjs";
16
- import "./chunk-PWHALENY.mjs";
20
+ import "./chunk-5OAMKZDX.mjs";
17
21
  import {
18
- Textarea
19
- } from "./chunk-5YF6SR4S.mjs";
22
+ LinkList
23
+ } from "./chunk-BRBGRJ2I.mjs";
24
+ import {
25
+ OrderedList,
26
+ UnorderedList
27
+ } from "./chunk-RY53CJI7.mjs";
20
28
  import {
21
29
  MessageComponent
22
30
  } from "./chunk-MER2HJBC.mjs";
@@ -26,10 +34,12 @@ import {
26
34
  } from "./chunk-2QZF65FK.mjs";
27
35
  import "./chunk-OB6UNSKV.mjs";
28
36
  import "./chunk-FSBY3NKV.mjs";
29
- import "./chunk-NXFD7TFE.mjs";
37
+ import "./chunk-PF6PZIZS.mjs";
30
38
  import {
31
39
  Input
32
- } from "./chunk-MRJYCUBY.mjs";
40
+ } from "./chunk-6KVF3ELJ.mjs";
41
+ import "./chunk-45BJGKVZ.mjs";
42
+ import "./chunk-QAYPCD5Z.mjs";
33
43
  import "./chunk-FJQCHTJZ.mjs";
34
44
  import {
35
45
  Container
@@ -38,17 +48,9 @@ import "./chunk-7SCOBRDZ.mjs";
38
48
  import {
39
49
  Link
40
50
  } from "./chunk-TES7CVGU.mjs";
41
- import "./chunk-5OAMKZDX.mjs";
42
51
  import {
43
52
  DescriptionList
44
53
  } from "./chunk-3JNHAMRV.mjs";
45
- import {
46
- LinkList
47
- } from "./chunk-BRBGRJ2I.mjs";
48
- import {
49
- OrderedList,
50
- UnorderedList
51
- } from "./chunk-RY53CJI7.mjs";
52
54
  import {
53
55
  BoxComponent
54
56
  } from "./chunk-E2GAXTBX.mjs";
@@ -68,12 +70,12 @@ import {
68
70
  import "./chunk-4XHA3NGO.mjs";
69
71
  import {
70
72
  AccordionComponent
71
- } from "./chunk-GSYDQFIT.mjs";
72
- import "./chunk-JKZ3OR7W.mjs";
73
- import "./chunk-XAIX3HTW.mjs";
74
- import "./chunk-4WI2BHHB.mjs";
75
- import "./chunk-GMGUONH5.mjs";
76
- import "./chunk-2V6SWZ5G.mjs";
73
+ } from "./chunk-KYCCTJI6.mjs";
74
+ import "./chunk-Q3SWHAU3.mjs";
75
+ import "./chunk-6XTXM4YQ.mjs";
76
+ import "./chunk-QC72RAQS.mjs";
77
+ import "./chunk-PHTGLF6Y.mjs";
78
+ import "./chunk-SDJXW6U7.mjs";
77
79
  import "./chunk-IEY4EQ4E.mjs";
78
80
  import {
79
81
  Badge,
@@ -1,2 +1,3 @@
1
1
  export { Input, InputProps } from './input.mjs';
2
2
  import 'react';
3
+ import '../input-group/input-group.mjs';
@@ -1,2 +1,3 @@
1
1
  export { Input, InputProps } from './input.js';
2
2
  import 'react';
3
+ import '../input-group/input-group.js';
@@ -52,77 +52,152 @@ __export(input_exports, {
52
52
  Input: () => Input
53
53
  });
54
54
  module.exports = __toCommonJS(input_exports);
55
+ var import_fonts2 = require("@postenbring/hedwig-css/dist/fonts.css");
56
+ var import_tokens2 = require("@postenbring/hedwig-css/dist/tokens.css");
57
+ var import_body2 = require("@postenbring/hedwig-css/dist/body.css");
58
+ var import_input = require("@postenbring/hedwig-css/dist/input.css");
59
+ var import_input_group4 = require("@postenbring/hedwig-css/dist/input-group.css");
60
+
61
+ // src/input/input.tsx
62
+ var import_react2 = require("react");
63
+ var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
64
+
65
+ // src/input-group/index.tsx
55
66
  var import_fonts = require("@postenbring/hedwig-css/dist/fonts.css");
56
67
  var import_tokens = require("@postenbring/hedwig-css/dist/tokens.css");
57
68
  var import_body = require("@postenbring/hedwig-css/dist/body.css");
58
- var import_input = require("@postenbring/hedwig-css/dist/input.css");
69
+ var import_input_group = require("@postenbring/hedwig-css/dist/input-group.css");
59
70
 
60
- // src/input/input.tsx
71
+ // src/input-group/input-group.tsx
61
72
  var import_react = require("react");
62
73
  var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
63
74
  var import_jsx_runtime = require("react/jsx-runtime");
64
- var Input = (0, import_react.forwardRef)(function Input2(_a, ref) {
75
+ var InputGroup = (0, import_react.forwardRef)(function InputGroup2(_a, ref) {
65
76
  var _b = _a, {
77
+ id,
78
+ className,
79
+ style,
66
80
  variant = "default",
67
81
  errorMessage,
68
82
  labelProps,
69
83
  label,
70
- id,
71
- style,
72
- className,
73
84
  disabled,
74
- readOnly
85
+ readOnly,
86
+ children,
87
+ _unstableAriaLiveOnErrorMessage = false
75
88
  } = _b, rest = __objRest(_b, [
89
+ "id",
90
+ "className",
91
+ "style",
76
92
  "variant",
77
93
  "errorMessage",
78
94
  "labelProps",
79
95
  "label",
80
- "id",
81
- "style",
82
- "className",
83
96
  "disabled",
84
- "readOnly"
97
+ "readOnly",
98
+ "children",
99
+ "_unstableAriaLiveOnErrorMessage"
85
100
  ]);
86
101
  const errorMessageId = (0, import_react.useId)();
87
102
  const inputId = (0, import_react.useId)();
103
+ const renderInput = () => {
104
+ const input = import_react.Children.toArray(children)[0];
105
+ if (!(0, import_react.isValidElement)(input)) {
106
+ return;
107
+ }
108
+ return (0, import_react.cloneElement)(input, __spreadProps(__spreadValues({
109
+ "aria-describedby": errorMessage ? errorMessageId : void 0,
110
+ "aria-invalid": errorMessage ? true : void 0,
111
+ id: id || inputId
112
+ }, input.props), {
113
+ className: (0, import_typed_classname.clsx)("hds-input-group__input", input.props.className)
114
+ }));
115
+ };
88
116
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
89
117
  "div",
90
- {
118
+ __spreadProps(__spreadValues({
91
119
  className: (0, import_typed_classname.clsx)(
92
- "hds-input",
120
+ "hds-input-group",
93
121
  {
94
- [`hds-input--${variant}`]: variant,
95
- "hds-input--error": errorMessage
122
+ [`hds-input-group--${variant}`]: variant,
123
+ "hds-input-group--error": errorMessage
96
124
  },
97
125
  className
98
126
  ),
99
- style,
127
+ ref,
128
+ style
129
+ }, rest), {
100
130
  children: [
101
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", __spreadProps(__spreadValues({ className: "hds-input__label" }, labelProps), { htmlFor: id || inputId, children: label })),
131
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", __spreadProps(__spreadValues({ className: "hds-input-group__label" }, labelProps), { htmlFor: id || inputId, children: label })),
102
132
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
103
133
  "div",
104
134
  {
105
- className: (0, import_typed_classname.clsx)("hds-input__input-wrapper"),
135
+ className: (0, import_typed_classname.clsx)("hds-input-group__input-wrapper"),
106
136
  "data-disabled": disabled,
107
137
  "data-readonly": readOnly,
108
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
109
- "input",
110
- __spreadProps(__spreadValues({}, rest), {
111
- "aria-describedby": errorMessage ? errorMessageId : void 0,
112
- className: "hds-input__input",
113
- disabled,
114
- id: id || inputId,
115
- readOnly,
116
- ref
117
- })
118
- )
138
+ children: renderInput()
119
139
  }
120
140
  ),
121
- !!errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "hds-input__error-message", id: errorMessageId, children: errorMessage })
141
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
142
+ "div",
143
+ __spreadProps(__spreadValues({}, _unstableAriaLiveOnErrorMessage && {
144
+ "aria-live": "polite",
145
+ "aria-relevant": "additions removals"
146
+ }), {
147
+ className: "hds-input-group__error-message",
148
+ id: errorMessageId,
149
+ children: !!errorMessage && errorMessage
150
+ })
151
+ )
122
152
  ]
153
+ })
154
+ );
155
+ });
156
+
157
+ // src/input/input.tsx
158
+ var import_jsx_runtime2 = require("react/jsx-runtime");
159
+ var Input = (0, import_react2.forwardRef)(function Input2(_a, ref) {
160
+ var _b = _a, {
161
+ className,
162
+ variant,
163
+ errorMessage,
164
+ labelProps,
165
+ label,
166
+ id,
167
+ style,
168
+ disabled,
169
+ readOnly,
170
+ _unstableAriaLiveOnErrorMessage
171
+ } = _b, rest = __objRest(_b, [
172
+ "className",
173
+ "variant",
174
+ "errorMessage",
175
+ "labelProps",
176
+ "label",
177
+ "id",
178
+ "style",
179
+ "disabled",
180
+ "readOnly",
181
+ "_unstableAriaLiveOnErrorMessage"
182
+ ]);
183
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
184
+ InputGroup,
185
+ {
186
+ _unstableAriaLiveOnErrorMessage,
187
+ className: (0, import_typed_classname2.clsx)("hds-input", className),
188
+ disabled,
189
+ errorMessage,
190
+ id,
191
+ label,
192
+ labelProps,
193
+ readOnly,
194
+ style,
195
+ variant,
196
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("input", __spreadProps(__spreadValues({}, rest), { disabled, readOnly, ref }))
123
197
  }
124
198
  );
125
199
  });
200
+ Input.displayName = "Input";
126
201
  // Annotate the CommonJS export names for ESM import in node:
127
202
  0 && (module.exports = {
128
203
  Input
@@ -1,7 +1,9 @@
1
- import "../chunk-NXFD7TFE.mjs";
1
+ import "../chunk-PF6PZIZS.mjs";
2
2
  import {
3
3
  Input
4
- } from "../chunk-MRJYCUBY.mjs";
4
+ } from "../chunk-6KVF3ELJ.mjs";
5
+ import "../chunk-45BJGKVZ.mjs";
6
+ import "../chunk-QAYPCD5Z.mjs";
5
7
  import "../chunk-FUJQIYOF.mjs";
6
8
  export {
7
9
  Input
@@ -1,13 +1,8 @@
1
1
  import * as react from 'react';
2
- import { InputHTMLAttributes, ReactNode, LabelHTMLAttributes } from 'react';
2
+ import { InputHTMLAttributes } from 'react';
3
+ import { InputGroupProps } from '../input-group/input-group.mjs';
3
4
 
4
- interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "children"> {
5
- id?: string;
6
- variant?: "default" | "white";
7
- errorMessage?: ReactNode;
8
- labelProps?: LabelHTMLAttributes<HTMLLabelElement>;
9
- label: ReactNode;
10
- }
5
+ type InputProps = Omit<InputGroupProps & InputHTMLAttributes<HTMLInputElement>, "children">;
11
6
  declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
12
7
 
13
8
  export { Input, type InputProps };
@@ -1,13 +1,8 @@
1
1
  import * as react from 'react';
2
- import { InputHTMLAttributes, ReactNode, LabelHTMLAttributes } from 'react';
2
+ import { InputHTMLAttributes } from 'react';
3
+ import { InputGroupProps } from '../input-group/input-group.js';
3
4
 
4
- interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "children"> {
5
- id?: string;
6
- variant?: "default" | "white";
7
- errorMessage?: ReactNode;
8
- labelProps?: LabelHTMLAttributes<HTMLLabelElement>;
9
- label: ReactNode;
10
- }
5
+ type InputProps = Omit<InputGroupProps & InputHTMLAttributes<HTMLInputElement>, "children">;
11
6
  declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
12
7
 
13
8
  export { Input, type InputProps };
@@ -52,71 +52,145 @@ __export(input_exports, {
52
52
  Input: () => Input
53
53
  });
54
54
  module.exports = __toCommonJS(input_exports);
55
+ var import_react2 = require("react");
56
+ var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
57
+
58
+ // src/input-group/index.tsx
59
+ var import_fonts = require("@postenbring/hedwig-css/dist/fonts.css");
60
+ var import_tokens = require("@postenbring/hedwig-css/dist/tokens.css");
61
+ var import_body = require("@postenbring/hedwig-css/dist/body.css");
62
+ var import_input_group = require("@postenbring/hedwig-css/dist/input-group.css");
63
+
64
+ // src/input-group/input-group.tsx
55
65
  var import_react = require("react");
56
66
  var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
57
67
  var import_jsx_runtime = require("react/jsx-runtime");
58
- var Input = (0, import_react.forwardRef)(function Input2(_a, ref) {
68
+ var InputGroup = (0, import_react.forwardRef)(function InputGroup2(_a, ref) {
59
69
  var _b = _a, {
70
+ id,
71
+ className,
72
+ style,
60
73
  variant = "default",
61
74
  errorMessage,
62
75
  labelProps,
63
76
  label,
64
- id,
65
- style,
66
- className,
67
77
  disabled,
68
- readOnly
78
+ readOnly,
79
+ children,
80
+ _unstableAriaLiveOnErrorMessage = false
69
81
  } = _b, rest = __objRest(_b, [
82
+ "id",
83
+ "className",
84
+ "style",
70
85
  "variant",
71
86
  "errorMessage",
72
87
  "labelProps",
73
88
  "label",
74
- "id",
75
- "style",
76
- "className",
77
89
  "disabled",
78
- "readOnly"
90
+ "readOnly",
91
+ "children",
92
+ "_unstableAriaLiveOnErrorMessage"
79
93
  ]);
80
94
  const errorMessageId = (0, import_react.useId)();
81
95
  const inputId = (0, import_react.useId)();
96
+ const renderInput = () => {
97
+ const input = import_react.Children.toArray(children)[0];
98
+ if (!(0, import_react.isValidElement)(input)) {
99
+ return;
100
+ }
101
+ return (0, import_react.cloneElement)(input, __spreadProps(__spreadValues({
102
+ "aria-describedby": errorMessage ? errorMessageId : void 0,
103
+ "aria-invalid": errorMessage ? true : void 0,
104
+ id: id || inputId
105
+ }, input.props), {
106
+ className: (0, import_typed_classname.clsx)("hds-input-group__input", input.props.className)
107
+ }));
108
+ };
82
109
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
83
110
  "div",
84
- {
111
+ __spreadProps(__spreadValues({
85
112
  className: (0, import_typed_classname.clsx)(
86
- "hds-input",
113
+ "hds-input-group",
87
114
  {
88
- [`hds-input--${variant}`]: variant,
89
- "hds-input--error": errorMessage
115
+ [`hds-input-group--${variant}`]: variant,
116
+ "hds-input-group--error": errorMessage
90
117
  },
91
118
  className
92
119
  ),
93
- style,
120
+ ref,
121
+ style
122
+ }, rest), {
94
123
  children: [
95
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", __spreadProps(__spreadValues({ className: "hds-input__label" }, labelProps), { htmlFor: id || inputId, children: label })),
124
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", __spreadProps(__spreadValues({ className: "hds-input-group__label" }, labelProps), { htmlFor: id || inputId, children: label })),
96
125
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
97
126
  "div",
98
127
  {
99
- className: (0, import_typed_classname.clsx)("hds-input__input-wrapper"),
128
+ className: (0, import_typed_classname.clsx)("hds-input-group__input-wrapper"),
100
129
  "data-disabled": disabled,
101
130
  "data-readonly": readOnly,
102
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
103
- "input",
104
- __spreadProps(__spreadValues({}, rest), {
105
- "aria-describedby": errorMessage ? errorMessageId : void 0,
106
- className: "hds-input__input",
107
- disabled,
108
- id: id || inputId,
109
- readOnly,
110
- ref
111
- })
112
- )
131
+ children: renderInput()
113
132
  }
114
133
  ),
115
- !!errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "hds-input__error-message", id: errorMessageId, children: errorMessage })
134
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
135
+ "div",
136
+ __spreadProps(__spreadValues({}, _unstableAriaLiveOnErrorMessage && {
137
+ "aria-live": "polite",
138
+ "aria-relevant": "additions removals"
139
+ }), {
140
+ className: "hds-input-group__error-message",
141
+ id: errorMessageId,
142
+ children: !!errorMessage && errorMessage
143
+ })
144
+ )
116
145
  ]
146
+ })
147
+ );
148
+ });
149
+
150
+ // src/input/input.tsx
151
+ var import_jsx_runtime2 = require("react/jsx-runtime");
152
+ var Input = (0, import_react2.forwardRef)(function Input2(_a, ref) {
153
+ var _b = _a, {
154
+ className,
155
+ variant,
156
+ errorMessage,
157
+ labelProps,
158
+ label,
159
+ id,
160
+ style,
161
+ disabled,
162
+ readOnly,
163
+ _unstableAriaLiveOnErrorMessage
164
+ } = _b, rest = __objRest(_b, [
165
+ "className",
166
+ "variant",
167
+ "errorMessage",
168
+ "labelProps",
169
+ "label",
170
+ "id",
171
+ "style",
172
+ "disabled",
173
+ "readOnly",
174
+ "_unstableAriaLiveOnErrorMessage"
175
+ ]);
176
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
177
+ InputGroup,
178
+ {
179
+ _unstableAriaLiveOnErrorMessage,
180
+ className: (0, import_typed_classname2.clsx)("hds-input", className),
181
+ disabled,
182
+ errorMessage,
183
+ id,
184
+ label,
185
+ labelProps,
186
+ readOnly,
187
+ style,
188
+ variant,
189
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("input", __spreadProps(__spreadValues({}, rest), { disabled, readOnly, ref }))
117
190
  }
118
191
  );
119
192
  });
193
+ Input.displayName = "Input";
120
194
  // Annotate the CommonJS export names for ESM import in node:
121
195
  0 && (module.exports = {
122
196
  Input
@@ -1,6 +1,8 @@
1
1
  import {
2
2
  Input
3
- } from "../chunk-MRJYCUBY.mjs";
3
+ } from "../chunk-6KVF3ELJ.mjs";
4
+ import "../chunk-45BJGKVZ.mjs";
5
+ import "../chunk-QAYPCD5Z.mjs";
4
6
  import "../chunk-FUJQIYOF.mjs";
5
7
  export {
6
8
  Input
@@ -0,0 +1,2 @@
1
+ export { InputGroup, InputGroupProps, InputProps } from './input-group.mjs';
2
+ import 'react';
@@ -0,0 +1,2 @@
1
+ export { InputGroup, InputGroupProps, InputProps } from './input-group.js';
2
+ import 'react';
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
+ var __objRest = (source, exclude) => {
24
+ var target = {};
25
+ for (var prop in source)
26
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
27
+ target[prop] = source[prop];
28
+ if (source != null && __getOwnPropSymbols)
29
+ for (var prop of __getOwnPropSymbols(source)) {
30
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
31
+ target[prop] = source[prop];
32
+ }
33
+ return target;
34
+ };
35
+ var __export = (target, all) => {
36
+ for (var name in all)
37
+ __defProp(target, name, { get: all[name], enumerable: true });
38
+ };
39
+ var __copyProps = (to, from, except, desc) => {
40
+ if (from && typeof from === "object" || typeof from === "function") {
41
+ for (let key of __getOwnPropNames(from))
42
+ if (!__hasOwnProp.call(to, key) && key !== except)
43
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
44
+ }
45
+ return to;
46
+ };
47
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
48
+
49
+ // src/input-group/index.tsx
50
+ var input_group_exports = {};
51
+ __export(input_group_exports, {
52
+ InputGroup: () => InputGroup
53
+ });
54
+ module.exports = __toCommonJS(input_group_exports);
55
+ var import_fonts = require("@postenbring/hedwig-css/dist/fonts.css");
56
+ var import_tokens = require("@postenbring/hedwig-css/dist/tokens.css");
57
+ var import_body = require("@postenbring/hedwig-css/dist/body.css");
58
+ var import_input_group = require("@postenbring/hedwig-css/dist/input-group.css");
59
+
60
+ // src/input-group/input-group.tsx
61
+ var import_react = require("react");
62
+ var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
63
+ var import_jsx_runtime = require("react/jsx-runtime");
64
+ var InputGroup = (0, import_react.forwardRef)(function InputGroup2(_a, ref) {
65
+ var _b = _a, {
66
+ id,
67
+ className,
68
+ style,
69
+ variant = "default",
70
+ errorMessage,
71
+ labelProps,
72
+ label,
73
+ disabled,
74
+ readOnly,
75
+ children,
76
+ _unstableAriaLiveOnErrorMessage = false
77
+ } = _b, rest = __objRest(_b, [
78
+ "id",
79
+ "className",
80
+ "style",
81
+ "variant",
82
+ "errorMessage",
83
+ "labelProps",
84
+ "label",
85
+ "disabled",
86
+ "readOnly",
87
+ "children",
88
+ "_unstableAriaLiveOnErrorMessage"
89
+ ]);
90
+ const errorMessageId = (0, import_react.useId)();
91
+ const inputId = (0, import_react.useId)();
92
+ const renderInput = () => {
93
+ const input = import_react.Children.toArray(children)[0];
94
+ if (!(0, import_react.isValidElement)(input)) {
95
+ return;
96
+ }
97
+ return (0, import_react.cloneElement)(input, __spreadProps(__spreadValues({
98
+ "aria-describedby": errorMessage ? errorMessageId : void 0,
99
+ "aria-invalid": errorMessage ? true : void 0,
100
+ id: id || inputId
101
+ }, input.props), {
102
+ className: (0, import_typed_classname.clsx)("hds-input-group__input", input.props.className)
103
+ }));
104
+ };
105
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
106
+ "div",
107
+ __spreadProps(__spreadValues({
108
+ className: (0, import_typed_classname.clsx)(
109
+ "hds-input-group",
110
+ {
111
+ [`hds-input-group--${variant}`]: variant,
112
+ "hds-input-group--error": errorMessage
113
+ },
114
+ className
115
+ ),
116
+ ref,
117
+ style
118
+ }, rest), {
119
+ children: [
120
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", __spreadProps(__spreadValues({ className: "hds-input-group__label" }, labelProps), { htmlFor: id || inputId, children: label })),
121
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
122
+ "div",
123
+ {
124
+ className: (0, import_typed_classname.clsx)("hds-input-group__input-wrapper"),
125
+ "data-disabled": disabled,
126
+ "data-readonly": readOnly,
127
+ children: renderInput()
128
+ }
129
+ ),
130
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
131
+ "div",
132
+ __spreadProps(__spreadValues({}, _unstableAriaLiveOnErrorMessage && {
133
+ "aria-live": "polite",
134
+ "aria-relevant": "additions removals"
135
+ }), {
136
+ className: "hds-input-group__error-message",
137
+ id: errorMessageId,
138
+ children: !!errorMessage && errorMessage
139
+ })
140
+ )
141
+ ]
142
+ })
143
+ );
144
+ });
145
+ // Annotate the CommonJS export names for ESM import in node:
146
+ 0 && (module.exports = {
147
+ InputGroup
148
+ });
@@ -0,0 +1,8 @@
1
+ import "../chunk-45BJGKVZ.mjs";
2
+ import {
3
+ InputGroup
4
+ } from "../chunk-QAYPCD5Z.mjs";
5
+ import "../chunk-FUJQIYOF.mjs";
6
+ export {
7
+ InputGroup
8
+ };