@postenbring/hedwig-react 0.0.24 → 0.0.25

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.
@@ -0,0 +1,5 @@
1
+ // src/input/index.tsx
2
+ import "@postenbring/hedwig-css/dist/fonts.css";
3
+ import "@postenbring/hedwig-css/dist/tokens.css";
4
+ import "@postenbring/hedwig-css/dist/body.css";
5
+ import "@postenbring/hedwig-css/dist/input.css";
package/dist/index.d.mts CHANGED
@@ -16,6 +16,7 @@ export { Breadcrumbs, BreadcrumbsProps } from './breadcrumb/breadcrumb.mjs';
16
16
  export { Tabs, TabsProps } from './tabs/tabs.mjs';
17
17
  export { Tab, TabList, TabListProps, TabProps } from './tabs/tabs-list.mjs';
18
18
  export { TabContent, TabContentProps, TabContents, TabContentsProps } from './tabs/tabs-content.mjs';
19
+ export { Input, InputProps } from './input/input.mjs';
19
20
  export { MessageDescription, MessageTitle } from './message/message.mjs';
20
21
  export { ModalHeader } from './modal/modal.mjs';
21
22
  import './utils-BfZsjuFH.mjs';
package/dist/index.d.ts CHANGED
@@ -16,6 +16,7 @@ export { Breadcrumbs, BreadcrumbsProps } from './breadcrumb/breadcrumb.js';
16
16
  export { Tabs, TabsProps } from './tabs/tabs.js';
17
17
  export { Tab, TabList, TabListProps, TabProps } from './tabs/tabs-list.js';
18
18
  export { TabContent, TabContentProps, TabContents, TabContentsProps } from './tabs/tabs-content.js';
19
+ export { Input, InputProps } from './input/input.js';
19
20
  export { MessageDescription, MessageTitle } from './message/message.js';
20
21
  export { ModalHeader } from './modal/modal.js';
21
22
  import './utils-BfZsjuFH.js';
package/dist/index.js CHANGED
@@ -73,6 +73,7 @@ __export(src_exports, {
73
73
  DescriptionList: () => DescriptionList,
74
74
  DescriptionTerm: () => DescriptionTerm,
75
75
  Dropdown: () => Dropdown,
76
+ Input: () => Input,
76
77
  Link: () => Link,
77
78
  LinkList: () => LinkList,
78
79
  Message: () => MessageComponent,
@@ -930,6 +931,76 @@ var TabContent = (0, import_react15.forwardRef)(
930
931
  }
931
932
  );
932
933
  TabContent.displayName = "TabContent";
934
+
935
+ // src/input/index.tsx
936
+ var import_fonts12 = require("@postenbring/hedwig-css/dist/fonts.css");
937
+ var import_tokens12 = require("@postenbring/hedwig-css/dist/tokens.css");
938
+ var import_body12 = require("@postenbring/hedwig-css/dist/body.css");
939
+ var import_input = require("@postenbring/hedwig-css/dist/input.css");
940
+
941
+ // src/input/input.tsx
942
+ var import_react16 = require("react");
943
+ var import_typed_classname18 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
944
+ var import_jsx_runtime19 = require("react/jsx-runtime");
945
+ var Input = (0, import_react16.forwardRef)(function Input2(_a, ref) {
946
+ var _b = _a, {
947
+ variant = "default",
948
+ errorMessage,
949
+ labelProps,
950
+ label,
951
+ id,
952
+ className,
953
+ disabled,
954
+ readOnly
955
+ } = _b, rest = __objRest(_b, [
956
+ "variant",
957
+ "errorMessage",
958
+ "labelProps",
959
+ "label",
960
+ "id",
961
+ "className",
962
+ "disabled",
963
+ "readOnly"
964
+ ]);
965
+ const errorMessageId = (0, import_react16.useId)();
966
+ const inputId = (0, import_react16.useId)();
967
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
968
+ "div",
969
+ {
970
+ className: (0, import_typed_classname18.clsx)(
971
+ "hds-input",
972
+ {
973
+ [`hds-input--${variant}`]: variant,
974
+ "hds-input--error": errorMessage
975
+ },
976
+ className
977
+ ),
978
+ children: [
979
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", __spreadProps(__spreadValues({ className: "hds-input__label" }, labelProps), { htmlFor: id || inputId, children: label })),
980
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
981
+ "div",
982
+ {
983
+ className: (0, import_typed_classname18.clsx)("hds-input__input-wrapper"),
984
+ "data-disabled": disabled,
985
+ "data-readonly": readOnly,
986
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
987
+ "input",
988
+ __spreadProps(__spreadValues({}, rest), {
989
+ "aria-describedby": errorMessage ? errorMessageId : void 0,
990
+ className: "hds-input__input",
991
+ disabled,
992
+ id: id || inputId,
993
+ readOnly,
994
+ ref
995
+ })
996
+ )
997
+ }
998
+ ),
999
+ !!errorMessage && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "hds-input__error-message", id: errorMessageId, children: errorMessage })
1000
+ ]
1001
+ }
1002
+ );
1003
+ });
933
1004
  // Annotate the CommonJS export names for ESM import in node:
934
1005
  0 && (module.exports = {
935
1006
  Accordion,
@@ -946,6 +1017,7 @@ TabContent.displayName = "TabContent";
946
1017
  DescriptionList,
947
1018
  DescriptionTerm,
948
1019
  Dropdown,
1020
+ Input,
949
1021
  Link,
950
1022
  LinkList,
951
1023
  Message,
package/dist/index.mjs CHANGED
@@ -25,6 +25,10 @@ import {
25
25
  Tabs
26
26
  } from "./chunk-ZLCNSHLT.mjs";
27
27
  import "./chunk-4ZM45P62.mjs";
28
+ import "./chunk-NXFD7TFE.mjs";
29
+ import {
30
+ Input
31
+ } from "./chunk-EW2DCMLN.mjs";
28
32
  import "./chunk-7SCOBRDZ.mjs";
29
33
  import {
30
34
  Link
@@ -98,6 +102,7 @@ export {
98
102
  DescriptionList,
99
103
  DescriptionTerm,
100
104
  Dropdown,
105
+ Input,
101
106
  Link,
102
107
  LinkList,
103
108
  MessageComponent as Message,
@@ -1,13 +1,8 @@
1
+ import "../chunk-NXFD7TFE.mjs";
1
2
  import {
2
3
  Input
3
4
  } from "../chunk-EW2DCMLN.mjs";
4
5
  import "../chunk-FUJQIYOF.mjs";
5
-
6
- // src/input/index.tsx
7
- import "@postenbring/hedwig-css/dist/fonts.css";
8
- import "@postenbring/hedwig-css/dist/tokens.css";
9
- import "@postenbring/hedwig-css/dist/body.css";
10
- import "@postenbring/hedwig-css/dist/input.css";
11
6
  export {
12
7
  Input
13
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postenbring/hedwig-react",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",