@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
@@ -0,0 +1,25 @@
1
+ import * as react from 'react';
2
+ import { CSSProperties, ReactNode, LabelHTMLAttributes } from 'react';
3
+
4
+ interface InputProps {
5
+ "aria-describedby"?: string;
6
+ "aria-invalid"?: boolean;
7
+ id?: string;
8
+ className?: string;
9
+ }
10
+ interface InputGroupProps {
11
+ id?: string;
12
+ className?: string;
13
+ style?: CSSProperties;
14
+ variant?: "default" | "white";
15
+ errorMessage?: ReactNode;
16
+ labelProps?: LabelHTMLAttributes<HTMLLabelElement>;
17
+ label: ReactNode;
18
+ disabled?: boolean;
19
+ readOnly?: boolean;
20
+ children: ReactNode;
21
+ _unstableAriaLiveOnErrorMessage?: boolean;
22
+ }
23
+ declare const InputGroup: react.ForwardRefExoticComponent<InputGroupProps & react.RefAttributes<HTMLDivElement>>;
24
+
25
+ export { InputGroup, type InputGroupProps, type InputProps };
@@ -0,0 +1,25 @@
1
+ import * as react from 'react';
2
+ import { CSSProperties, ReactNode, LabelHTMLAttributes } from 'react';
3
+
4
+ interface InputProps {
5
+ "aria-describedby"?: string;
6
+ "aria-invalid"?: boolean;
7
+ id?: string;
8
+ className?: string;
9
+ }
10
+ interface InputGroupProps {
11
+ id?: string;
12
+ className?: string;
13
+ style?: CSSProperties;
14
+ variant?: "default" | "white";
15
+ errorMessage?: ReactNode;
16
+ labelProps?: LabelHTMLAttributes<HTMLLabelElement>;
17
+ label: ReactNode;
18
+ disabled?: boolean;
19
+ readOnly?: boolean;
20
+ children: ReactNode;
21
+ _unstableAriaLiveOnErrorMessage?: boolean;
22
+ }
23
+ declare const InputGroup: react.ForwardRefExoticComponent<InputGroupProps & react.RefAttributes<HTMLDivElement>>;
24
+
25
+ export { InputGroup, type InputGroupProps, type InputProps };
@@ -0,0 +1,142 @@
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/input-group.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_react = require("react");
56
+ var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
57
+ var import_jsx_runtime = require("react/jsx-runtime");
58
+ var InputGroup = (0, import_react.forwardRef)(function InputGroup2(_a, ref) {
59
+ var _b = _a, {
60
+ id,
61
+ className,
62
+ style,
63
+ variant = "default",
64
+ errorMessage,
65
+ labelProps,
66
+ label,
67
+ disabled,
68
+ readOnly,
69
+ children,
70
+ _unstableAriaLiveOnErrorMessage = false
71
+ } = _b, rest = __objRest(_b, [
72
+ "id",
73
+ "className",
74
+ "style",
75
+ "variant",
76
+ "errorMessage",
77
+ "labelProps",
78
+ "label",
79
+ "disabled",
80
+ "readOnly",
81
+ "children",
82
+ "_unstableAriaLiveOnErrorMessage"
83
+ ]);
84
+ const errorMessageId = (0, import_react.useId)();
85
+ const inputId = (0, import_react.useId)();
86
+ const renderInput = () => {
87
+ const input = import_react.Children.toArray(children)[0];
88
+ if (!(0, import_react.isValidElement)(input)) {
89
+ return;
90
+ }
91
+ return (0, import_react.cloneElement)(input, __spreadProps(__spreadValues({
92
+ "aria-describedby": errorMessage ? errorMessageId : void 0,
93
+ "aria-invalid": errorMessage ? true : void 0,
94
+ id: id || inputId
95
+ }, input.props), {
96
+ className: (0, import_typed_classname.clsx)("hds-input-group__input", input.props.className)
97
+ }));
98
+ };
99
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
100
+ "div",
101
+ __spreadProps(__spreadValues({
102
+ className: (0, import_typed_classname.clsx)(
103
+ "hds-input-group",
104
+ {
105
+ [`hds-input-group--${variant}`]: variant,
106
+ "hds-input-group--error": errorMessage
107
+ },
108
+ className
109
+ ),
110
+ ref,
111
+ style
112
+ }, rest), {
113
+ children: [
114
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", __spreadProps(__spreadValues({ className: "hds-input-group__label" }, labelProps), { htmlFor: id || inputId, children: label })),
115
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
116
+ "div",
117
+ {
118
+ className: (0, import_typed_classname.clsx)("hds-input-group__input-wrapper"),
119
+ "data-disabled": disabled,
120
+ "data-readonly": readOnly,
121
+ children: renderInput()
122
+ }
123
+ ),
124
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
125
+ "div",
126
+ __spreadProps(__spreadValues({}, _unstableAriaLiveOnErrorMessage && {
127
+ "aria-live": "polite",
128
+ "aria-relevant": "additions removals"
129
+ }), {
130
+ className: "hds-input-group__error-message",
131
+ id: errorMessageId,
132
+ children: !!errorMessage && errorMessage
133
+ })
134
+ )
135
+ ]
136
+ })
137
+ );
138
+ });
139
+ // Annotate the CommonJS export names for ESM import in node:
140
+ 0 && (module.exports = {
141
+ InputGroup
142
+ });
@@ -0,0 +1,7 @@
1
+ import {
2
+ InputGroup
3
+ } from "../chunk-QAYPCD5Z.mjs";
4
+ import "../chunk-FUJQIYOF.mjs";
5
+ export {
6
+ InputGroup
7
+ };
@@ -1,7 +1,4 @@
1
1
  import "../chunk-5OAMKZDX.mjs";
2
- import {
3
- DescriptionList
4
- } from "../chunk-3JNHAMRV.mjs";
5
2
  import {
6
3
  LinkList
7
4
  } from "../chunk-BRBGRJ2I.mjs";
@@ -9,6 +6,9 @@ import {
9
6
  OrderedList,
10
7
  UnorderedList
11
8
  } from "../chunk-RY53CJI7.mjs";
9
+ import {
10
+ DescriptionList
11
+ } from "../chunk-3JNHAMRV.mjs";
12
12
  import "../chunk-FUJQIYOF.mjs";
13
13
  export {
14
14
  DescriptionList,
@@ -1,2 +1,3 @@
1
1
  export { Select, SelectProps } from './select.mjs';
2
- import 'react/jsx-runtime';
2
+ import 'react';
3
+ import '../input-group/input-group.mjs';
@@ -1,2 +1,3 @@
1
1
  export { Select, SelectProps } from './select.js';
2
- import 'react/jsx-runtime';
2
+ import 'react';
3
+ import '../input-group/input-group.js';
@@ -52,54 +52,127 @@ __export(select_exports, {
52
52
  Select: () => Select
53
53
  });
54
54
  module.exports = __toCommonJS(select_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_select = require("@postenbring/hedwig-css/dist/select.css");
59
+ var import_input_group4 = require("@postenbring/hedwig-css/dist/input-group.css");
60
+
61
+ // src/select/select.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_select = require("@postenbring/hedwig-css/dist/select.css");
69
+ var import_input_group = require("@postenbring/hedwig-css/dist/input-group.css");
59
70
 
60
- // src/select/select.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
- function Select(_a) {
75
+ var InputGroup = (0, import_react.forwardRef)(function InputGroup2(_a, ref) {
65
76
  var _b = _a, {
66
77
  id,
67
- label,
68
- variant,
69
- errorMessage,
70
78
  className,
79
+ style,
80
+ variant = "default",
81
+ errorMessage,
82
+ labelProps,
83
+ label,
71
84
  disabled,
72
- children
85
+ readOnly,
86
+ children,
87
+ _unstableAriaLiveOnErrorMessage = false
73
88
  } = _b, rest = __objRest(_b, [
74
89
  "id",
75
- "label",
90
+ "className",
91
+ "style",
76
92
  "variant",
77
93
  "errorMessage",
78
- "className",
94
+ "labelProps",
95
+ "label",
79
96
  "disabled",
80
- "children"
97
+ "readOnly",
98
+ "children",
99
+ "_unstableAriaLiveOnErrorMessage"
81
100
  ]);
82
101
  const errorMessageId = (0, import_react.useId)();
83
- const selectId = (0, import_react.useId)();
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
+ };
84
116
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
85
117
  "div",
86
- {
118
+ __spreadProps(__spreadValues({
87
119
  className: (0, import_typed_classname.clsx)(
88
- "hds-select",
120
+ "hds-input-group",
89
121
  {
90
- [`hds-select--${variant}`]: variant,
91
- "hds-select--error": errorMessage
122
+ [`hds-input-group--${variant}`]: variant,
123
+ "hds-input-group--error": errorMessage
92
124
  },
93
125
  className
94
126
  ),
127
+ ref,
128
+ style
129
+ }, rest), {
95
130
  children: [
96
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "hds-select__label", htmlFor: selectId, children: label }),
97
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_typed_classname.clsx)("hds-select__select-wrapper"), "data-disabled": disabled, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("select", __spreadProps(__spreadValues({ className: "hds-select__select", disabled, id: id || selectId }, rest), { children })) }),
98
- !!errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "hds-select__error-message", id: errorMessageId, children: errorMessage })
131
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", __spreadProps(__spreadValues({ className: "hds-input-group__label" }, labelProps), { htmlFor: id || inputId, children: label })),
132
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
133
+ "div",
134
+ {
135
+ className: (0, import_typed_classname.clsx)("hds-input-group__input-wrapper"),
136
+ "data-disabled": disabled,
137
+ "data-readonly": readOnly,
138
+ children: renderInput()
139
+ }
140
+ ),
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
+ )
99
152
  ]
153
+ })
154
+ );
155
+ });
156
+
157
+ // src/select/select.tsx
158
+ var import_jsx_runtime2 = require("react/jsx-runtime");
159
+ var Select = (0, import_react2.forwardRef)(function Select2(_a, ref) {
160
+ var _b = _a, { className, variant, errorMessage, labelProps, label, id, style, disabled, children } = _b, rest = __objRest(_b, ["className", "variant", "errorMessage", "labelProps", "label", "id", "style", "disabled", "children"]);
161
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
162
+ InputGroup,
163
+ {
164
+ className: (0, import_typed_classname2.clsx)("hds-select", className),
165
+ disabled,
166
+ errorMessage,
167
+ id,
168
+ label,
169
+ labelProps,
170
+ style,
171
+ variant,
172
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("select", __spreadProps(__spreadValues({}, rest), { disabled, ref, children }))
100
173
  }
101
174
  );
102
- }
175
+ });
103
176
  Select.displayName = "Select";
104
177
  // Annotate the CommonJS export names for ESM import in node:
105
178
  0 && (module.exports = {
@@ -1,7 +1,9 @@
1
- import "../chunk-R5ISWMI6.mjs";
1
+ import "../chunk-SX37JSDS.mjs";
2
2
  import {
3
3
  Select
4
- } from "../chunk-IT4L33S6.mjs";
4
+ } from "../chunk-K3BGDNWO.mjs";
5
+ import "../chunk-45BJGKVZ.mjs";
6
+ import "../chunk-QAYPCD5Z.mjs";
5
7
  import "../chunk-FUJQIYOF.mjs";
6
8
  export {
7
9
  Select
@@ -1,14 +1,8 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as react from 'react';
2
+ import { SelectHTMLAttributes } from 'react';
3
+ import { InputGroupProps } from '../input-group/input-group.mjs';
2
4
 
3
- interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, "children"> {
4
- label: string;
5
- variant?: "default" | "white";
6
- errorMessage?: string;
7
- children: React.ReactNode;
8
- }
9
- declare function Select({ id, label, variant, errorMessage, className, disabled, children, ...rest }: SelectProps): react_jsx_runtime.JSX.Element;
10
- declare namespace Select {
11
- var displayName: string;
12
- }
5
+ type SelectProps = Omit<InputGroupProps & SelectHTMLAttributes<HTMLSelectElement>, "readOnly">;
6
+ declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLSelectElement>>;
13
7
 
14
8
  export { Select, type SelectProps };
@@ -1,14 +1,8 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as react from 'react';
2
+ import { SelectHTMLAttributes } from 'react';
3
+ import { InputGroupProps } from '../input-group/input-group.js';
2
4
 
3
- interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, "children"> {
4
- label: string;
5
- variant?: "default" | "white";
6
- errorMessage?: string;
7
- children: React.ReactNode;
8
- }
9
- declare function Select({ id, label, variant, errorMessage, className, disabled, children, ...rest }: SelectProps): react_jsx_runtime.JSX.Element;
10
- declare namespace Select {
11
- var displayName: string;
12
- }
5
+ type SelectProps = Omit<InputGroupProps & SelectHTMLAttributes<HTMLSelectElement>, "readOnly">;
6
+ declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLSelectElement>>;
13
7
 
14
8
  export { Select, type SelectProps };
@@ -52,48 +52,120 @@ __export(select_exports, {
52
52
  Select: () => Select
53
53
  });
54
54
  module.exports = __toCommonJS(select_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
- function Select(_a) {
68
+ var InputGroup = (0, import_react.forwardRef)(function InputGroup2(_a, ref) {
59
69
  var _b = _a, {
60
70
  id,
61
- label,
62
- variant,
63
- errorMessage,
64
71
  className,
72
+ style,
73
+ variant = "default",
74
+ errorMessage,
75
+ labelProps,
76
+ label,
65
77
  disabled,
66
- children
78
+ readOnly,
79
+ children,
80
+ _unstableAriaLiveOnErrorMessage = false
67
81
  } = _b, rest = __objRest(_b, [
68
82
  "id",
69
- "label",
83
+ "className",
84
+ "style",
70
85
  "variant",
71
86
  "errorMessage",
72
- "className",
87
+ "labelProps",
88
+ "label",
73
89
  "disabled",
74
- "children"
90
+ "readOnly",
91
+ "children",
92
+ "_unstableAriaLiveOnErrorMessage"
75
93
  ]);
76
94
  const errorMessageId = (0, import_react.useId)();
77
- const selectId = (0, import_react.useId)();
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
+ };
78
109
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
79
110
  "div",
80
- {
111
+ __spreadProps(__spreadValues({
81
112
  className: (0, import_typed_classname.clsx)(
82
- "hds-select",
113
+ "hds-input-group",
83
114
  {
84
- [`hds-select--${variant}`]: variant,
85
- "hds-select--error": errorMessage
115
+ [`hds-input-group--${variant}`]: variant,
116
+ "hds-input-group--error": errorMessage
86
117
  },
87
118
  className
88
119
  ),
120
+ ref,
121
+ style
122
+ }, rest), {
89
123
  children: [
90
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "hds-select__label", htmlFor: selectId, children: label }),
91
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_typed_classname.clsx)("hds-select__select-wrapper"), "data-disabled": disabled, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("select", __spreadProps(__spreadValues({ className: "hds-select__select", disabled, id: id || selectId }, rest), { children })) }),
92
- !!errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "hds-select__error-message", id: errorMessageId, children: errorMessage })
124
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", __spreadProps(__spreadValues({ className: "hds-input-group__label" }, labelProps), { htmlFor: id || inputId, children: label })),
125
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
126
+ "div",
127
+ {
128
+ className: (0, import_typed_classname.clsx)("hds-input-group__input-wrapper"),
129
+ "data-disabled": disabled,
130
+ "data-readonly": readOnly,
131
+ children: renderInput()
132
+ }
133
+ ),
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
+ )
93
145
  ]
146
+ })
147
+ );
148
+ });
149
+
150
+ // src/select/select.tsx
151
+ var import_jsx_runtime2 = require("react/jsx-runtime");
152
+ var Select = (0, import_react2.forwardRef)(function Select2(_a, ref) {
153
+ var _b = _a, { className, variant, errorMessage, labelProps, label, id, style, disabled, children } = _b, rest = __objRest(_b, ["className", "variant", "errorMessage", "labelProps", "label", "id", "style", "disabled", "children"]);
154
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
155
+ InputGroup,
156
+ {
157
+ className: (0, import_typed_classname2.clsx)("hds-select", className),
158
+ disabled,
159
+ errorMessage,
160
+ id,
161
+ label,
162
+ labelProps,
163
+ style,
164
+ variant,
165
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("select", __spreadProps(__spreadValues({}, rest), { disabled, ref, children }))
94
166
  }
95
167
  );
96
- }
168
+ });
97
169
  Select.displayName = "Select";
98
170
  // Annotate the CommonJS export names for ESM import in node:
99
171
  0 && (module.exports = {
@@ -1,6 +1,8 @@
1
1
  import {
2
2
  Select
3
- } from "../chunk-IT4L33S6.mjs";
3
+ } from "../chunk-K3BGDNWO.mjs";
4
+ import "../chunk-45BJGKVZ.mjs";
5
+ import "../chunk-QAYPCD5Z.mjs";
4
6
  import "../chunk-FUJQIYOF.mjs";
5
7
  export {
6
8
  Select
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  TabsComponent
3
- } from "../chunk-BSX4IA3X.mjs";
3
+ } from "../chunk-WUMZCEIJ.mjs";
4
+ import "../chunk-ZLCNSHLT.mjs";
4
5
  import "../chunk-GRO36EUL.mjs";
5
6
  import "../chunk-G3JPULGO.mjs";
6
- import "../chunk-ZLCNSHLT.mjs";
7
7
  import "../chunk-4ZM45P62.mjs";
8
8
  import "../chunk-FSBY3NKV.mjs";
9
9
  import "../chunk-FUJQIYOF.mjs";
@@ -1,2 +1,3 @@
1
1
  export { Textarea, TextareaProps } from './textarea.mjs';
2
2
  import 'react';
3
+ import '../input-group/input-group.mjs';
@@ -1,2 +1,3 @@
1
1
  export { Textarea, TextareaProps } from './textarea.js';
2
2
  import 'react';
3
+ import '../input-group/input-group.js';