@postenbring/hedwig-react 0.0.0-dropdown-20231207124052 → 0.0.0-export-input-react-20231221220025

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 (90) hide show
  1. package/dist/accordion/index.js +1 -1
  2. package/dist/accordion/index.mjs +1 -1
  3. package/dist/badge/badge.d.mts +3 -3
  4. package/dist/badge/badge.d.ts +3 -3
  5. package/dist/badge/index.js +1 -1
  6. package/dist/badge/index.mjs +1 -1
  7. package/dist/box/box.d.mts +2 -2
  8. package/dist/box/box.d.ts +2 -2
  9. package/dist/box/index.js +1 -1
  10. package/dist/box/index.mjs +1 -1
  11. package/dist/breadcrumb/index.js +1 -1
  12. package/dist/breadcrumb/index.mjs +1 -1
  13. package/dist/button/index.js +1 -1
  14. package/dist/button/index.mjs +1 -1
  15. package/dist/chunk-4RBJ5GJR.mjs +37 -0
  16. package/dist/chunk-4ZM45P62.mjs +13 -0
  17. package/dist/{chunk-QOVAYDPH.mjs → chunk-5OAMKZDX.mjs} +1 -1
  18. package/dist/{chunk-5NDZ66M6.mjs → chunk-7SCOBRDZ.mjs} +1 -1
  19. package/dist/{chunk-BJANCH4F.mjs → chunk-AJBQ2EJU.mjs} +1 -1
  20. package/dist/chunk-BKXVC23Y.mjs +5 -0
  21. package/dist/{chunk-XJ44O3HY.mjs → chunk-EW2DCMLN.mjs} +30 -15
  22. package/dist/chunk-FSBY3NKV.mjs +47 -0
  23. package/dist/{chunk-6AW5BEDP.mjs → chunk-HMESGVY5.mjs} +1 -1
  24. package/dist/{chunk-R55SMUE7.mjs → chunk-IEY4EQ4E.mjs} +1 -1
  25. package/dist/{chunk-Z36ETKOZ.mjs → chunk-LNPO2XQW.mjs} +1 -1
  26. package/dist/{chunk-JNIAIH63.mjs → chunk-LZSDIT5D.mjs} +1 -1
  27. package/dist/chunk-NVMNXQ5Q.mjs +79 -0
  28. package/dist/chunk-NXFD7TFE.mjs +5 -0
  29. package/dist/{chunk-FFQBRM3W.mjs → chunk-QV33ZHNO.mjs} +3 -21
  30. package/dist/{chunk-N3EFZW7T.mjs → chunk-VX6MSLLO.mjs} +1 -1
  31. package/dist/{chunk-ROSXRHEW.mjs → chunk-YFBW5ZRC.mjs} +2 -2
  32. package/dist/{chunk-EMX6J4XG.mjs → chunk-YRAMCYSB.mjs} +1 -1
  33. package/dist/chunk-ZLCNSHLT.mjs +31 -0
  34. package/dist/dropdown/dropdown.d.mts +3 -3
  35. package/dist/dropdown/dropdown.d.ts +3 -3
  36. package/dist/dropdown/index.js +1 -1
  37. package/dist/dropdown/index.mjs +1 -1
  38. package/dist/index.d.mts +4 -0
  39. package/dist/index.d.ts +4 -0
  40. package/dist/index.js +244 -14
  41. package/dist/index.mjs +35 -11
  42. package/dist/input/index.d.mts +0 -1
  43. package/dist/input/index.d.ts +0 -1
  44. package/dist/input/index.js +31 -26
  45. package/dist/input/index.mjs +2 -7
  46. package/dist/input/input.d.mts +8 -8
  47. package/dist/input/input.d.ts +8 -8
  48. package/dist/input/input.js +30 -25
  49. package/dist/input/input.mjs +1 -1
  50. package/dist/link/index.js +1 -1
  51. package/dist/link/index.mjs +1 -1
  52. package/dist/link/link.d.mts +4 -4
  53. package/dist/link/link.d.ts +4 -4
  54. package/dist/list/index.js +1 -1
  55. package/dist/list/index.mjs +1 -1
  56. package/dist/list/link-list.d.mts +2 -2
  57. package/dist/list/link-list.d.ts +2 -2
  58. package/dist/list/list.d.mts +2 -2
  59. package/dist/list/list.d.ts +2 -2
  60. package/dist/message/index.d.mts +5 -5
  61. package/dist/message/index.d.ts +5 -5
  62. package/dist/message/index.js +1 -1
  63. package/dist/message/index.mjs +1 -1
  64. package/dist/message/message.d.mts +2 -2
  65. package/dist/message/message.d.ts +2 -2
  66. package/dist/modal/index.d.mts +2 -2
  67. package/dist/modal/index.d.ts +2 -2
  68. package/dist/modal/index.js +6 -5
  69. package/dist/modal/index.mjs +3 -2
  70. package/dist/modal/modal.d.mts +2 -2
  71. package/dist/modal/modal.d.ts +2 -2
  72. package/dist/modal/modal.js +5 -4
  73. package/dist/modal/modal.mjs +2 -1
  74. package/dist/tabs/index.d.mts +6 -0
  75. package/dist/tabs/index.d.ts +6 -0
  76. package/dist/tabs/index.js +227 -0
  77. package/dist/tabs/index.mjs +22 -0
  78. package/dist/tabs/tabs-content.d.mts +21 -0
  79. package/dist/tabs/tabs-content.d.ts +21 -0
  80. package/dist/tabs/tabs-content.js +94 -0
  81. package/dist/tabs/tabs-content.mjs +10 -0
  82. package/dist/tabs/tabs-list.d.mts +26 -0
  83. package/dist/tabs/tabs-list.d.ts +26 -0
  84. package/dist/tabs/tabs-list.js +170 -0
  85. package/dist/tabs/tabs-list.mjs +11 -0
  86. package/dist/tabs/tabs.d.mts +16 -0
  87. package/dist/tabs/tabs.d.ts +16 -0
  88. package/dist/tabs/tabs.js +87 -0
  89. package/dist/tabs/tabs.mjs +8 -0
  90. package/package.json +5 -5
package/dist/index.d.ts CHANGED
@@ -13,6 +13,10 @@ export { AccordionContent, AccordionContentProps } from './accordion/accordion-i
13
13
  export { Dropdown, DropdownProps } from './dropdown/dropdown.js';
14
14
  export { Modal } from './modal/index.js';
15
15
  export { Breadcrumbs, BreadcrumbsProps } from './breadcrumb/breadcrumb.js';
16
+ export { Tabs, TabsProps } from './tabs/tabs.js';
17
+ export { Tab, TabList, TabListProps, TabProps } from './tabs/tabs-list.js';
18
+ export { TabContent, TabContentProps, TabContents, TabContentsProps } from './tabs/tabs-content.js';
19
+ export { Input, InputProps } from './input/input.js';
16
20
  export { MessageDescription, MessageTitle } from './message/message.js';
17
21
  export { ModalHeader } from './modal/modal.js';
18
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,
@@ -83,6 +84,11 @@ __export(src_exports, {
83
84
  OrderedList: () => OrderedList,
84
85
  PrimaryButton: () => PrimaryButton,
85
86
  SecondaryButton: () => SecondaryButton,
87
+ Tab: () => Tab,
88
+ TabContent: () => TabContent,
89
+ TabContents: () => TabContents,
90
+ TabList: () => TabList,
91
+ Tabs: () => Tabs,
86
92
  UnorderedList: () => UnorderedList,
87
93
  WarningBadge: () => WarningBadge,
88
94
  WhiteBadge: () => WhiteBadge
@@ -92,7 +98,7 @@ module.exports = __toCommonJS(src_exports);
92
98
  // src/button/index.tsx
93
99
  var import_fonts = require("@postenbring/hedwig-css/dist/fonts.css");
94
100
  var import_tokens = require("@postenbring/hedwig-css/dist/tokens.css");
95
- var import_base = require("@postenbring/hedwig-css/dist/base.css");
101
+ var import_body = require("@postenbring/hedwig-css/dist/body.css");
96
102
  var import_button = require("@postenbring/hedwig-css/dist/button.css");
97
103
 
98
104
  // src/button/button.tsx
@@ -162,7 +168,7 @@ SecondaryButton.displayName = "SecondaryButton";
162
168
  // src/link/index.tsx
163
169
  var import_fonts2 = require("@postenbring/hedwig-css/dist/fonts.css");
164
170
  var import_tokens2 = require("@postenbring/hedwig-css/dist/tokens.css");
165
- var import_base2 = require("@postenbring/hedwig-css/dist/base.css");
171
+ var import_body2 = require("@postenbring/hedwig-css/dist/body.css");
166
172
  var import_link = require("@postenbring/hedwig-css/dist/link.css");
167
173
 
168
174
  // src/link/link.tsx
@@ -193,7 +199,7 @@ Link.displayName = "Link";
193
199
  // src/badge/index.tsx
194
200
  var import_fonts3 = require("@postenbring/hedwig-css/dist/fonts.css");
195
201
  var import_tokens3 = require("@postenbring/hedwig-css/dist/tokens.css");
196
- var import_base3 = require("@postenbring/hedwig-css/dist/base.css");
202
+ var import_body3 = require("@postenbring/hedwig-css/dist/body.css");
197
203
  var import_badge = require("@postenbring/hedwig-css/dist/badge.css");
198
204
 
199
205
  // src/badge/badge.tsx
@@ -246,7 +252,7 @@ WarningBadge.displayName = "WarningBadge";
246
252
  // src/list/index.tsx
247
253
  var import_fonts4 = require("@postenbring/hedwig-css/dist/fonts.css");
248
254
  var import_tokens4 = require("@postenbring/hedwig-css/dist/tokens.css");
249
- var import_base4 = require("@postenbring/hedwig-css/dist/base.css");
255
+ var import_body4 = require("@postenbring/hedwig-css/dist/body.css");
250
256
  var import_description_list = require("@postenbring/hedwig-css/dist/description-list.css");
251
257
  var import_list2 = require("@postenbring/hedwig-css/dist/list.css");
252
258
 
@@ -339,7 +345,7 @@ LinkList.displayName = "LinkList";
339
345
  // src/box/index.tsx
340
346
  var import_fonts5 = require("@postenbring/hedwig-css/dist/fonts.css");
341
347
  var import_tokens5 = require("@postenbring/hedwig-css/dist/tokens.css");
342
- var import_base5 = require("@postenbring/hedwig-css/dist/base.css");
348
+ var import_body5 = require("@postenbring/hedwig-css/dist/body.css");
343
349
  var import_box = require("@postenbring/hedwig-css/dist/box.css");
344
350
 
345
351
  // src/box/box.tsx
@@ -417,7 +423,7 @@ BoxCloseButton.displayName = "BoxCloseButton";
417
423
  // src/message/index.tsx
418
424
  var import_fonts6 = require("@postenbring/hedwig-css/dist/fonts.css");
419
425
  var import_tokens6 = require("@postenbring/hedwig-css/dist/tokens.css");
420
- var import_base6 = require("@postenbring/hedwig-css/dist/base.css");
426
+ var import_body6 = require("@postenbring/hedwig-css/dist/body.css");
421
427
  var import_box3 = require("@postenbring/hedwig-css/dist/box.css");
422
428
  var import_message = require("@postenbring/hedwig-css/dist/message.css");
423
429
 
@@ -480,7 +486,7 @@ MessageComponent.Description.displayName = "Message";
480
486
  // src/accordion/index.tsx
481
487
  var import_fonts7 = require("@postenbring/hedwig-css/dist/fonts.css");
482
488
  var import_tokens7 = require("@postenbring/hedwig-css/dist/tokens.css");
483
- var import_base7 = require("@postenbring/hedwig-css/dist/base.css");
489
+ var import_body7 = require("@postenbring/hedwig-css/dist/body.css");
484
490
  var import_accordion = require("@postenbring/hedwig-css/dist/accordion.css");
485
491
 
486
492
  // src/accordion/accordion.tsx
@@ -645,7 +651,7 @@ AccordionContent.displayName = "AccordionContent";
645
651
  // src/dropdown/index.tsx
646
652
  var import_fonts8 = require("@postenbring/hedwig-css/dist/fonts.css");
647
653
  var import_tokens8 = require("@postenbring/hedwig-css/dist/tokens.css");
648
- var import_base8 = require("@postenbring/hedwig-css/dist/base.css");
654
+ var import_body8 = require("@postenbring/hedwig-css/dist/body.css");
649
655
  var import_dropdown = require("@postenbring/hedwig-css/dist/dropdown.css");
650
656
 
651
657
  // src/dropdown/dropdown.tsx
@@ -690,16 +696,17 @@ Dropdown.displayName = "Dropdown";
690
696
  // src/modal/index.tsx
691
697
  var import_fonts9 = require("@postenbring/hedwig-css/dist/fonts.css");
692
698
  var import_tokens9 = require("@postenbring/hedwig-css/dist/tokens.css");
693
- var import_base9 = require("@postenbring/hedwig-css/dist/base.css");
699
+ var import_body9 = require("@postenbring/hedwig-css/dist/body.css");
694
700
  var import_box5 = require("@postenbring/hedwig-css/dist/box.css");
695
701
  var import_modal = require("@postenbring/hedwig-css/dist/modal.css");
696
702
 
697
703
  // src/modal/modal.tsx
698
- var import_react10 = require("react");
704
+ var import_react11 = require("react");
699
705
  var import_typed_classname13 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
700
706
 
701
707
  // src/utils.ts
702
708
  var React2 = __toESM(require("react"));
709
+ var import_react10 = require("react");
703
710
  function useMergeRefs(refs) {
704
711
  return React2.useMemo(() => {
705
712
  if (refs.every((ref) => ref === null)) {
@@ -716,13 +723,36 @@ function useMergeRefs(refs) {
716
723
  };
717
724
  }, refs);
718
725
  }
726
+ function useResize(ref) {
727
+ const [width, setWidth] = (0, import_react10.useState)(0);
728
+ const [height, setHeight] = (0, import_react10.useState)(0);
729
+ const handleResize = (0, import_react10.useCallback)(() => {
730
+ var _a, _b, _c, _d;
731
+ if ((ref == null ? void 0 : ref.current) !== null) {
732
+ setWidth((_b = (_a = ref == null ? void 0 : ref.current) == null ? void 0 : _a.offsetWidth) != null ? _b : 0);
733
+ setHeight((_d = (_c = ref == null ? void 0 : ref.current) == null ? void 0 : _c.offsetHeight) != null ? _d : 0);
734
+ }
735
+ }, [ref]);
736
+ (0, import_react10.useEffect)(() => {
737
+ window.addEventListener("load", handleResize);
738
+ window.addEventListener("resize", handleResize);
739
+ return () => {
740
+ window.removeEventListener("load", handleResize);
741
+ window.removeEventListener("resize", handleResize);
742
+ };
743
+ }, [ref, handleResize]);
744
+ (0, import_react10.useEffect)(() => {
745
+ handleResize();
746
+ }, []);
747
+ return { width, height };
748
+ }
719
749
 
720
750
  // src/modal/modal.tsx
721
751
  var import_jsx_runtime14 = require("react/jsx-runtime");
722
- var Modal = (0, import_react10.forwardRef)(
752
+ var Modal = (0, import_react11.forwardRef)(
723
753
  (_a, ref) => {
724
754
  var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
725
- const modalRef = (0, import_react10.useRef)(null);
755
+ const modalRef = (0, import_react11.useRef)(null);
726
756
  const mergedRef = useMergeRefs([modalRef, ref]);
727
757
  function onClose() {
728
758
  var _a2;
@@ -745,7 +775,7 @@ var Modal = (0, import_react10.forwardRef)(
745
775
  }
746
776
  );
747
777
  Modal.displayName = "Modal";
748
- var ModalHeader = (0, import_react10.forwardRef)(
778
+ var ModalHeader = (0, import_react11.forwardRef)(
749
779
  (_a, ref) => {
750
780
  var _b = _a, { as: Component = "h1", className } = _b, rest = __objRest(_b, ["as", "className"]);
751
781
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
@@ -767,7 +797,7 @@ ModalComponent.Header.displayName = "Modal";
767
797
  // src/breadcrumb/index.tsx
768
798
  var import_fonts10 = require("@postenbring/hedwig-css/dist/fonts.css");
769
799
  var import_tokens10 = require("@postenbring/hedwig-css/dist/tokens.css");
770
- var import_base10 = require("@postenbring/hedwig-css/dist/base.css");
800
+ var import_body10 = require("@postenbring/hedwig-css/dist/body.css");
771
801
  var import_breadcrumb = require("@postenbring/hedwig-css/dist/breadcrumb.css");
772
802
 
773
803
  // src/breadcrumb/breadcrumb.tsx
@@ -777,6 +807,200 @@ function Breadcrumbs({ navProps, olProps, children }) {
777
807
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("nav", __spreadProps(__spreadValues({}, navProps), { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ol", __spreadProps(__spreadValues({}, olProps), { className: (0, import_typed_classname14.clsx)("hds-breadcrumbs", olProps == null ? void 0 : olProps.className), children })) }));
778
808
  }
779
809
  Breadcrumbs.displayName = "Breadcrumbs";
810
+
811
+ // src/tabs/index.tsx
812
+ var import_fonts11 = require("@postenbring/hedwig-css/dist/fonts.css");
813
+ var import_tokens11 = require("@postenbring/hedwig-css/dist/tokens.css");
814
+ var import_body11 = require("@postenbring/hedwig-css/dist/body.css");
815
+ var import_tabs = require("@postenbring/hedwig-css/dist/tabs.css");
816
+
817
+ // src/tabs/tabs.tsx
818
+ var import_react13 = require("react");
819
+ var import_typed_classname15 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
820
+
821
+ // src/tabs/context.ts
822
+ var import_react12 = require("react");
823
+ var TabsContext = (0, import_react12.createContext)({
824
+ mounted: false,
825
+ activeTabId: void 0,
826
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Added default section, without handling
827
+ toggleActiveTabId: (tabId) => {
828
+ }
829
+ });
830
+
831
+ // src/tabs/tabs.tsx
832
+ var import_jsx_runtime16 = require("react/jsx-runtime");
833
+ var Tabs = (0, import_react13.forwardRef)(
834
+ (_a, ref) => {
835
+ var _b = _a, { as: Component = "div", defaultTab, children } = _b, rest = __objRest(_b, ["as", "defaultTab", "children"]);
836
+ const [activeTabId, setActiveTabId] = (0, import_react13.useState)(defaultTab);
837
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Component, __spreadProps(__spreadValues({ className: (0, import_typed_classname15.clsx)("hds-tabs"), ref }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
838
+ TabsContext.Provider,
839
+ {
840
+ value: { activeTabId, toggleActiveTabId: setActiveTabId, mounted: true },
841
+ children
842
+ }
843
+ ) }));
844
+ }
845
+ );
846
+ Tabs.displayName = "Tabs";
847
+
848
+ // src/tabs/tabs-list.tsx
849
+ var import_react14 = require("react");
850
+ var import_typed_classname16 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
851
+ var import_jsx_runtime17 = require("react/jsx-runtime");
852
+ function TabList(_a) {
853
+ var _b = _a, { children, direction = "horizontal", className } = _b, rest = __objRest(_b, ["children", "direction", "className"]);
854
+ const tabsListRef = (0, import_react14.useRef)(null);
855
+ const { width: tabsWidth } = useResize(tabsListRef);
856
+ const { innerWidth } = window;
857
+ const wideEnough = innerWidth >= tabsWidth;
858
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
859
+ "div",
860
+ __spreadProps(__spreadValues({
861
+ className: (0, import_typed_classname16.clsx)(
862
+ "hds-tabs--list",
863
+ direction === "horizontal" ? {
864
+ [`hds-tabs--list-horizontal`]: wideEnough,
865
+ "hds-tabs--list-vertical": !wideEnough
866
+ } : {
867
+ "hds-tabs--list-vertical": true
868
+ },
869
+ className
870
+ ),
871
+ ref: tabsListRef,
872
+ role: "tablist"
873
+ }, rest), {
874
+ children
875
+ })
876
+ );
877
+ }
878
+ TabList.displayName = "TabList";
879
+ var Tab = (0, import_react14.forwardRef)(
880
+ (_a, ref) => {
881
+ var _b = _a, { as: Component = "button", children, tabId, className, onClick } = _b, rest = __objRest(_b, ["as", "children", "tabId", "className", "onClick"]);
882
+ const context = (0, import_react14.useContext)(TabsContext);
883
+ if (!context.mounted) {
884
+ throw new Error("Context required. Did you use <TabContent/> outside of <Tabs/>?");
885
+ }
886
+ const toggleTab = (e) => {
887
+ e.preventDefault();
888
+ context.toggleActiveTabId(tabId);
889
+ onClick && onClick(e);
890
+ };
891
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
892
+ Component,
893
+ __spreadProps(__spreadValues({
894
+ className: (0, import_typed_classname16.clsx)(
895
+ "hds-tabs--tab",
896
+ { "hds-tabs--tab-active": context.activeTabId === tabId },
897
+ className
898
+ ),
899
+ "data-tabid": tabId,
900
+ onClick: toggleTab,
901
+ ref,
902
+ role: "tab"
903
+ }, rest), {
904
+ children
905
+ })
906
+ );
907
+ }
908
+ );
909
+ Tab.displayName = "Tab";
910
+
911
+ // src/tabs/tabs-content.tsx
912
+ var import_react15 = require("react");
913
+ var import_typed_classname17 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
914
+ var import_jsx_runtime18 = require("react/jsx-runtime");
915
+ function TabContents(_a) {
916
+ var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
917
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", __spreadProps(__spreadValues({ className: (0, import_typed_classname17.clsx)("hds-tabs--contents") }, rest), { children }));
918
+ }
919
+ TabContents.displayName = "TabContents";
920
+ var TabContent = (0, import_react15.forwardRef)(
921
+ (_a, ref) => {
922
+ var _b = _a, { as: Component = "div", forTabId, children } = _b, rest = __objRest(_b, ["as", "forTabId", "children"]);
923
+ const context = (0, import_react15.useContext)(TabsContext);
924
+ if (!context.mounted) {
925
+ throw new Error("Context required. Did you use <TabContent/> outside of <Tabs/>?");
926
+ }
927
+ if (context.activeTabId === forTabId) {
928
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Component, __spreadProps(__spreadValues({}, rest), { ref, children }));
929
+ }
930
+ return null;
931
+ }
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
+ });
780
1004
  // Annotate the CommonJS export names for ESM import in node:
781
1005
  0 && (module.exports = {
782
1006
  Accordion,
@@ -793,6 +1017,7 @@ Breadcrumbs.displayName = "Breadcrumbs";
793
1017
  DescriptionList,
794
1018
  DescriptionTerm,
795
1019
  Dropdown,
1020
+ Input,
796
1021
  Link,
797
1022
  LinkList,
798
1023
  Message,
@@ -803,6 +1028,11 @@ Breadcrumbs.displayName = "Breadcrumbs";
803
1028
  OrderedList,
804
1029
  PrimaryButton,
805
1030
  SecondaryButton,
1031
+ Tab,
1032
+ TabContent,
1033
+ TabContents,
1034
+ TabList,
1035
+ Tabs,
806
1036
  UnorderedList,
807
1037
  WarningBadge,
808
1038
  WhiteBadge
package/dist/index.mjs CHANGED
@@ -1,21 +1,39 @@
1
1
  import {
2
2
  MessageComponent
3
- } from "./chunk-6AW5BEDP.mjs";
3
+ } from "./chunk-HMESGVY5.mjs";
4
4
  import {
5
5
  MessageDescription,
6
6
  MessageTitle
7
7
  } from "./chunk-X4D24ZRP.mjs";
8
8
  import {
9
9
  ModalComponent
10
- } from "./chunk-ROSXRHEW.mjs";
10
+ } from "./chunk-YFBW5ZRC.mjs";
11
11
  import {
12
12
  ModalHeader
13
- } from "./chunk-FFQBRM3W.mjs";
14
- import "./chunk-5NDZ66M6.mjs";
13
+ } from "./chunk-QV33ZHNO.mjs";
14
+ import "./chunk-BKXVC23Y.mjs";
15
+ import {
16
+ TabContent,
17
+ TabContents
18
+ } from "./chunk-4RBJ5GJR.mjs";
19
+ import {
20
+ Tab,
21
+ TabList
22
+ } from "./chunk-NVMNXQ5Q.mjs";
23
+ import "./chunk-FSBY3NKV.mjs";
24
+ import {
25
+ Tabs
26
+ } from "./chunk-ZLCNSHLT.mjs";
27
+ import "./chunk-4ZM45P62.mjs";
28
+ import "./chunk-NXFD7TFE.mjs";
29
+ import {
30
+ Input
31
+ } from "./chunk-EW2DCMLN.mjs";
32
+ import "./chunk-7SCOBRDZ.mjs";
15
33
  import {
16
34
  Link
17
35
  } from "./chunk-TES7CVGU.mjs";
18
- import "./chunk-QOVAYDPH.mjs";
36
+ import "./chunk-5OAMKZDX.mjs";
19
37
  import {
20
38
  DescriptionDetails,
21
39
  DescriptionList,
@@ -28,26 +46,26 @@ import {
28
46
  OrderedList,
29
47
  UnorderedList
30
48
  } from "./chunk-RY53CJI7.mjs";
31
- import "./chunk-BJANCH4F.mjs";
49
+ import "./chunk-AJBQ2EJU.mjs";
32
50
  import {
33
51
  Box,
34
52
  BoxCloseButton
35
53
  } from "./chunk-RXUPE4MM.mjs";
36
- import "./chunk-EMX6J4XG.mjs";
54
+ import "./chunk-YRAMCYSB.mjs";
37
55
  import {
38
56
  Breadcrumbs
39
57
  } from "./chunk-Q2HYT3Z7.mjs";
40
- import "./chunk-N3EFZW7T.mjs";
58
+ import "./chunk-VX6MSLLO.mjs";
41
59
  import {
42
60
  BaseButton,
43
61
  PrimaryButton,
44
62
  SecondaryButton
45
63
  } from "./chunk-ENRMC5K7.mjs";
46
- import "./chunk-JNIAIH63.mjs";
64
+ import "./chunk-LZSDIT5D.mjs";
47
65
  import {
48
66
  Dropdown
49
67
  } from "./chunk-3VUAKZB2.mjs";
50
- import "./chunk-Z36ETKOZ.mjs";
68
+ import "./chunk-LNPO2XQW.mjs";
51
69
  import {
52
70
  AccordionContent
53
71
  } from "./chunk-J7U4Z726.mjs";
@@ -61,7 +79,7 @@ import {
61
79
  Accordion
62
80
  } from "./chunk-GMGUONH5.mjs";
63
81
  import "./chunk-2V6SWZ5G.mjs";
64
- import "./chunk-R55SMUE7.mjs";
82
+ import "./chunk-IEY4EQ4E.mjs";
65
83
  import {
66
84
  Badge,
67
85
  DarkBadge,
@@ -84,6 +102,7 @@ export {
84
102
  DescriptionList,
85
103
  DescriptionTerm,
86
104
  Dropdown,
105
+ Input,
87
106
  Link,
88
107
  LinkList,
89
108
  MessageComponent as Message,
@@ -94,6 +113,11 @@ export {
94
113
  OrderedList,
95
114
  PrimaryButton,
96
115
  SecondaryButton,
116
+ Tab,
117
+ TabContent,
118
+ TabContents,
119
+ TabList,
120
+ Tabs,
97
121
  UnorderedList,
98
122
  WarningBadge,
99
123
  WhiteBadge
@@ -1,3 +1,2 @@
1
1
  export { Input, InputProps } from './input.mjs';
2
- import 'react/jsx-runtime';
3
2
  import 'react';
@@ -1,3 +1,2 @@
1
1
  export { Input, InputProps } from './input.js';
2
- import 'react/jsx-runtime';
3
2
  import 'react';
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
5
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
7
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
- var __getProtoOf = Object.getPrototypeOf;
10
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
9
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
10
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -46,14 +44,6 @@ var __copyProps = (to, from, except, desc) => {
46
44
  }
47
45
  return to;
48
46
  };
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
47
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
58
48
 
59
49
  // src/input/index.tsx
@@ -64,31 +54,35 @@ __export(input_exports, {
64
54
  module.exports = __toCommonJS(input_exports);
65
55
  var import_fonts = require("@postenbring/hedwig-css/dist/fonts.css");
66
56
  var import_tokens = require("@postenbring/hedwig-css/dist/tokens.css");
67
- var import_base = require("@postenbring/hedwig-css/dist/base.css");
57
+ var import_body = require("@postenbring/hedwig-css/dist/body.css");
68
58
  var import_input = require("@postenbring/hedwig-css/dist/input.css");
69
59
 
70
60
  // src/input/input.tsx
71
- var React = __toESM(require("react"));
61
+ var import_react = require("react");
72
62
  var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
73
63
  var import_jsx_runtime = require("react/jsx-runtime");
74
- function Input(_a) {
64
+ var Input = (0, import_react.forwardRef)(function Input2(_a, ref) {
75
65
  var _b = _a, {
76
66
  variant = "default",
77
67
  errorMessage,
78
68
  labelProps,
79
69
  label,
80
70
  id,
81
- className
71
+ className,
72
+ disabled,
73
+ readOnly
82
74
  } = _b, rest = __objRest(_b, [
83
75
  "variant",
84
76
  "errorMessage",
85
77
  "labelProps",
86
78
  "label",
87
79
  "id",
88
- "className"
80
+ "className",
81
+ "disabled",
82
+ "readOnly"
89
83
  ]);
90
- const errorMessageId = React.useId();
91
- const inputId = React.useId();
84
+ const errorMessageId = (0, import_react.useId)();
85
+ const inputId = (0, import_react.useId)();
92
86
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
93
87
  "div",
94
88
  {
@@ -102,19 +96,30 @@ function Input(_a) {
102
96
  ),
103
97
  children: [
104
98
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", __spreadProps(__spreadValues({ className: "hds-input__label" }, labelProps), { htmlFor: id || inputId, children: label })),
105
- !!errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "hds-input__error-message", id: errorMessageId, children: errorMessage }),
106
99
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
107
- "input",
108
- __spreadProps(__spreadValues({}, rest), {
109
- "aria-describedby": errorMessageId,
110
- className: "hds-input__input",
111
- id: id || inputId
112
- })
113
- )
100
+ "div",
101
+ {
102
+ className: (0, import_typed_classname.clsx)("hds-input__input-wrapper"),
103
+ "data-disabled": disabled,
104
+ "data-readonly": readOnly,
105
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
106
+ "input",
107
+ __spreadProps(__spreadValues({}, rest), {
108
+ "aria-describedby": errorMessage ? errorMessageId : void 0,
109
+ className: "hds-input__input",
110
+ disabled,
111
+ id: id || inputId,
112
+ readOnly,
113
+ ref
114
+ })
115
+ )
116
+ }
117
+ ),
118
+ !!errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "hds-input__error-message", id: errorMessageId, children: errorMessage })
114
119
  ]
115
120
  }
116
121
  );
117
- }
122
+ });
118
123
  // Annotate the CommonJS export names for ESM import in node:
119
124
  0 && (module.exports = {
120
125
  Input
@@ -1,13 +1,8 @@
1
+ import "../chunk-NXFD7TFE.mjs";
1
2
  import {
2
3
  Input
3
- } from "../chunk-XJ44O3HY.mjs";
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/base.css";
10
- import "@postenbring/hedwig-css/dist/input.css";
11
6
  export {
12
7
  Input
13
8
  };
@@ -1,13 +1,13 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
1
+ import * as react from 'react';
2
+ import { InputHTMLAttributes, ReactNode, LabelHTMLAttributes } from 'react';
3
3
 
4
- interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "children"> {
4
+ interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "children"> {
5
5
  id?: string;
6
- variant?: "default" | "white" | "lined";
7
- errorMessage?: React.ReactNode;
8
- labelProps?: React.LabelHTMLAttributes<HTMLLabelElement>;
9
- label: React.ReactNode;
6
+ variant?: "default" | "white";
7
+ errorMessage?: ReactNode;
8
+ labelProps?: LabelHTMLAttributes<HTMLLabelElement>;
9
+ label: ReactNode;
10
10
  }
11
- declare function Input({ variant, errorMessage, labelProps, label, id, className, ...rest }: InputProps): react_jsx_runtime.JSX.Element;
11
+ declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
12
12
 
13
13
  export { Input, type InputProps };