@postenbring/hedwig-react 0.0.4 → 0.0.6

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 (102) hide show
  1. package/dist/accordion/accordion-item-content.d.mts +9 -0
  2. package/dist/accordion/accordion-item-content.d.ts +9 -0
  3. package/dist/accordion/accordion-item-content.js +98 -0
  4. package/dist/accordion/accordion-item-content.mjs +8 -0
  5. package/dist/accordion/accordion-item-trigger.d.mts +9 -0
  6. package/dist/accordion/accordion-item-trigger.d.ts +9 -0
  7. package/dist/accordion/accordion-item-trigger.js +108 -0
  8. package/dist/accordion/accordion-item-trigger.mjs +8 -0
  9. package/dist/accordion/accordion-item.d.mts +15 -0
  10. package/dist/accordion/accordion-item.d.ts +15 -0
  11. package/dist/accordion/accordion-item.js +116 -0
  12. package/dist/accordion/accordion-item.mjs +8 -0
  13. package/dist/accordion/accordion.d.mts +28 -0
  14. package/dist/accordion/accordion.d.ts +28 -0
  15. package/dist/accordion/accordion.js +93 -0
  16. package/dist/accordion/accordion.mjs +8 -0
  17. package/dist/accordion/index.d.mts +6 -0
  18. package/dist/accordion/index.d.ts +6 -0
  19. package/dist/accordion/index.js +217 -0
  20. package/dist/accordion/index.mjs +21 -0
  21. package/dist/badge/badge.d.mts +2 -2
  22. package/dist/badge/badge.d.ts +2 -2
  23. package/dist/badge/badge.js +8 -14
  24. package/dist/badge/badge.mjs +2 -2
  25. package/dist/badge/index.js +10 -15
  26. package/dist/badge/index.mjs +3 -3
  27. package/dist/box/box.d.mts +36 -0
  28. package/dist/box/box.d.ts +36 -0
  29. package/dist/box/box.js +131 -0
  30. package/dist/box/box.mjs +9 -0
  31. package/dist/box/index.d.mts +3 -0
  32. package/dist/box/index.d.ts +3 -0
  33. package/dist/box/index.js +137 -0
  34. package/dist/box/index.mjs +10 -0
  35. package/dist/button/button.d.mts +2 -2
  36. package/dist/button/button.d.ts +2 -2
  37. package/dist/button/button.js +0 -13
  38. package/dist/button/button.mjs +2 -2
  39. package/dist/button/index.js +2 -14
  40. package/dist/button/index.mjs +3 -3
  41. package/dist/chunk-2V6SWZ5G.mjs +16 -0
  42. package/dist/chunk-4XWB4ZSR.mjs +6 -0
  43. package/dist/chunk-7F7QB4D5.mjs +50 -0
  44. package/dist/{chunk-NSNVKFU3.mjs → chunk-AYGPUYPZ.mjs} +2 -1
  45. package/dist/chunk-B3PZUFG2.mjs +40 -0
  46. package/dist/{chunk-H5SSXV32.mjs → chunk-CYW3DUD2.mjs} +2 -1
  47. package/dist/chunk-EKFYWUBE.mjs +36 -0
  48. package/dist/chunk-EX4U7YZF.mjs +83 -0
  49. package/dist/{chunk-BTCTQCPO.mjs → chunk-FUJQIYOF.mjs} +1 -12
  50. package/dist/{chunk-SF42ETS4.mjs → chunk-GSPFHK2Z.mjs} +2 -4
  51. package/dist/chunk-ID5KKZMK.mjs +5 -0
  52. package/dist/chunk-IOOSUX5O.mjs +6 -0
  53. package/dist/chunk-IWDN3WGQ.mjs +47 -0
  54. package/dist/chunk-IWV4FFE3.mjs +35 -0
  55. package/dist/chunk-KBVDBI2L.mjs +59 -0
  56. package/dist/chunk-LNYNZ4EG.mjs +40 -0
  57. package/dist/chunk-NMSLCM2K.mjs +18 -0
  58. package/dist/{chunk-YH2NWXPK.mjs → chunk-O3NMR6GE.mjs} +10 -5
  59. package/dist/chunk-PCKWBORI.mjs +5 -0
  60. package/dist/{chunk-AHYBSRCR.mjs → chunk-VZNNGRKM.mjs} +2 -1
  61. package/dist/{chunk-7FQ4XFS7.mjs → chunk-X3OAJSS2.mjs} +2 -4
  62. package/dist/index.d.mts +10 -0
  63. package/dist/index.d.ts +10 -0
  64. package/dist/index.js +395 -16
  65. package/dist/index.mjs +58 -9
  66. package/dist/input/input.d.mts +13 -0
  67. package/dist/input/input.d.ts +13 -0
  68. package/dist/input/input.js +109 -0
  69. package/dist/input/input.mjs +51 -0
  70. package/dist/link/index.js +2 -14
  71. package/dist/link/index.mjs +3 -3
  72. package/dist/link/link.d.mts +2 -2
  73. package/dist/link/link.d.ts +2 -2
  74. package/dist/link/link.js +0 -13
  75. package/dist/link/link.mjs +2 -2
  76. package/dist/list/description-list.d.mts +32 -0
  77. package/dist/list/description-list.d.ts +32 -0
  78. package/dist/list/description-list.js +89 -0
  79. package/dist/list/description-list.mjs +13 -0
  80. package/dist/list/index.d.mts +5 -0
  81. package/dist/list/index.d.ts +5 -0
  82. package/dist/list/index.js +144 -0
  83. package/dist/list/index.mjs +22 -0
  84. package/dist/list/link-list.d.mts +13 -0
  85. package/dist/list/link-list.d.ts +13 -0
  86. package/dist/list/link-list.js +102 -0
  87. package/dist/list/link-list.mjs +8 -0
  88. package/dist/list/list.d.mts +25 -0
  89. package/dist/list/list.d.ts +25 -0
  90. package/dist/list/list.js +95 -0
  91. package/dist/list/list.mjs +9 -0
  92. package/dist/message/index.d.mts +4 -0
  93. package/dist/message/index.d.ts +4 -0
  94. package/dist/message/index.js +162 -0
  95. package/dist/message/index.mjs +9 -0
  96. package/dist/message/message.d.mts +16 -0
  97. package/dist/message/message.d.ts +16 -0
  98. package/dist/message/message.js +155 -0
  99. package/dist/message/message.mjs +8 -0
  100. package/dist/utils-BfZsjuFH.d.mts +17 -0
  101. package/dist/utils-BfZsjuFH.d.ts +17 -0
  102. package/package.json +17 -17
@@ -0,0 +1,102 @@
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/list/link-list.tsx
50
+ var link_list_exports = {};
51
+ __export(link_list_exports, {
52
+ LinkList: () => LinkList
53
+ });
54
+ module.exports = __toCommonJS(link_list_exports);
55
+
56
+ // src/list/list.tsx
57
+ var import_clsx = require("clsx");
58
+ var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
59
+ var import_jsx_runtime = require("react/jsx-runtime");
60
+ function BaseList(_a) {
61
+ var _b = _a, {
62
+ as: ListTag = "ul",
63
+ children,
64
+ listStyle = "inherit",
65
+ size = "medium"
66
+ } = _b, rest = __objRest(_b, [
67
+ "as",
68
+ "children",
69
+ "listStyle",
70
+ "size"
71
+ ]);
72
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
73
+ ListTag,
74
+ __spreadProps(__spreadValues({
75
+ className: (0, import_clsx.clsx)((0, import_typed_classname.t)("hds-list"), (0, import_typed_classname.t)(`hds-list--${size}`), {
76
+ [(0, import_typed_classname.t)(`hds-list--style-hidden`)]: listStyle === "no-bullets"
77
+ })
78
+ }, rest), {
79
+ children
80
+ })
81
+ );
82
+ }
83
+ function UnorderedList(props) {
84
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseList, __spreadProps(__spreadValues({ as: "ul" }, props), { children: props.children }));
85
+ }
86
+ function OrderedList(props) {
87
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseList, __spreadProps(__spreadValues({ as: "ol" }, props), { children: props.children }));
88
+ }
89
+ BaseList.displayName = "BaseList";
90
+ OrderedList.displayName = "UnorderedList";
91
+ UnorderedList.displayName = "UnorderedList";
92
+
93
+ // src/list/link-list.tsx
94
+ var import_jsx_runtime2 = require("react/jsx-runtime");
95
+ function LinkList(props) {
96
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(UnorderedList, __spreadProps(__spreadValues({ listStyle: "no-bullets" }, props), { children: props.children }));
97
+ }
98
+ LinkList.displayName = "LinkList";
99
+ // Annotate the CommonJS export names for ESM import in node:
100
+ 0 && (module.exports = {
101
+ LinkList
102
+ });
@@ -0,0 +1,8 @@
1
+ import {
2
+ LinkList
3
+ } from "../chunk-NMSLCM2K.mjs";
4
+ import "../chunk-IWDN3WGQ.mjs";
5
+ import "../chunk-FUJQIYOF.mjs";
6
+ export {
7
+ LinkList
8
+ };
@@ -0,0 +1,25 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { HTMLAttributes } from 'react';
4
+
5
+ interface ListProps extends HTMLAttributes<HTMLOListElement | HTMLUListElement> {
6
+ children: React.ReactElement<HTMLLIElement> | React.ReactElement<HTMLLIElement>[];
7
+ /**
8
+ * Inherit list styles or do not show these
9
+ */
10
+ listStyle?: "inherit" | "no-bullets";
11
+ /**
12
+ * Sets the size of the items (font)
13
+ */
14
+ size?: "small" | "medium" | "large";
15
+ }
16
+ declare function UnorderedList(props: ListProps): react_jsx_runtime.JSX.Element;
17
+ declare namespace UnorderedList {
18
+ var displayName: string;
19
+ }
20
+ declare function OrderedList(props: ListProps): react_jsx_runtime.JSX.Element;
21
+ declare namespace OrderedList {
22
+ var displayName: string;
23
+ }
24
+
25
+ export { type ListProps, OrderedList, UnorderedList };
@@ -0,0 +1,25 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { HTMLAttributes } from 'react';
4
+
5
+ interface ListProps extends HTMLAttributes<HTMLOListElement | HTMLUListElement> {
6
+ children: React.ReactElement<HTMLLIElement> | React.ReactElement<HTMLLIElement>[];
7
+ /**
8
+ * Inherit list styles or do not show these
9
+ */
10
+ listStyle?: "inherit" | "no-bullets";
11
+ /**
12
+ * Sets the size of the items (font)
13
+ */
14
+ size?: "small" | "medium" | "large";
15
+ }
16
+ declare function UnorderedList(props: ListProps): react_jsx_runtime.JSX.Element;
17
+ declare namespace UnorderedList {
18
+ var displayName: string;
19
+ }
20
+ declare function OrderedList(props: ListProps): react_jsx_runtime.JSX.Element;
21
+ declare namespace OrderedList {
22
+ var displayName: string;
23
+ }
24
+
25
+ export { type ListProps, OrderedList, UnorderedList };
@@ -0,0 +1,95 @@
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/list/list.tsx
50
+ var list_exports = {};
51
+ __export(list_exports, {
52
+ OrderedList: () => OrderedList,
53
+ UnorderedList: () => UnorderedList
54
+ });
55
+ module.exports = __toCommonJS(list_exports);
56
+ var import_clsx = require("clsx");
57
+ var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
58
+ var import_jsx_runtime = require("react/jsx-runtime");
59
+ function BaseList(_a) {
60
+ var _b = _a, {
61
+ as: ListTag = "ul",
62
+ children,
63
+ listStyle = "inherit",
64
+ size = "medium"
65
+ } = _b, rest = __objRest(_b, [
66
+ "as",
67
+ "children",
68
+ "listStyle",
69
+ "size"
70
+ ]);
71
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
72
+ ListTag,
73
+ __spreadProps(__spreadValues({
74
+ className: (0, import_clsx.clsx)((0, import_typed_classname.t)("hds-list"), (0, import_typed_classname.t)(`hds-list--${size}`), {
75
+ [(0, import_typed_classname.t)(`hds-list--style-hidden`)]: listStyle === "no-bullets"
76
+ })
77
+ }, rest), {
78
+ children
79
+ })
80
+ );
81
+ }
82
+ function UnorderedList(props) {
83
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseList, __spreadProps(__spreadValues({ as: "ul" }, props), { children: props.children }));
84
+ }
85
+ function OrderedList(props) {
86
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseList, __spreadProps(__spreadValues({ as: "ol" }, props), { children: props.children }));
87
+ }
88
+ BaseList.displayName = "BaseList";
89
+ OrderedList.displayName = "UnorderedList";
90
+ UnorderedList.displayName = "UnorderedList";
91
+ // Annotate the CommonJS export names for ESM import in node:
92
+ 0 && (module.exports = {
93
+ OrderedList,
94
+ UnorderedList
95
+ });
@@ -0,0 +1,9 @@
1
+ import {
2
+ OrderedList,
3
+ UnorderedList
4
+ } from "../chunk-IWDN3WGQ.mjs";
5
+ import "../chunk-FUJQIYOF.mjs";
6
+ export {
7
+ OrderedList,
8
+ UnorderedList
9
+ };
@@ -0,0 +1,4 @@
1
+ export { Message, MessageProps } from './message.mjs';
2
+ import 'react';
3
+ import '../utils-BfZsjuFH.mjs';
4
+ import '../box/box.mjs';
@@ -0,0 +1,4 @@
1
+ export { Message, MessageProps } from './message.js';
2
+ import 'react';
3
+ import '../utils-BfZsjuFH.js';
4
+ import '../box/box.js';
@@ -0,0 +1,162 @@
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/message/index.tsx
50
+ var message_exports = {};
51
+ __export(message_exports, {
52
+ Message: () => Message
53
+ });
54
+ module.exports = __toCommonJS(message_exports);
55
+ var import_fonts = require("@postenbring/hedwig-tokens/tokens-output/css/fonts.css");
56
+ var import_tokens = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css");
57
+ var import_base = require("@postenbring/hedwig-css/dist/base.css");
58
+ var import_box2 = require("@postenbring/hedwig-css/dist/box.css");
59
+ var import_message = require("@postenbring/hedwig-css/dist/message.css");
60
+
61
+ // src/message/message.tsx
62
+ var import_react2 = require("react");
63
+ var import_clsx2 = require("clsx");
64
+ var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
65
+
66
+ // src/box/box.tsx
67
+ var import_react = require("react");
68
+ var import_clsx = require("clsx");
69
+ var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
70
+ var import_jsx_runtime = require("react/jsx-runtime");
71
+ var Box = (0, import_react.forwardRef)(
72
+ (_a, ref) => {
73
+ var _b = _a, {
74
+ as: Component = "div",
75
+ variant = "light-grey",
76
+ hideCloseButton,
77
+ onClose: onCloseProp,
78
+ closed: closedProp,
79
+ closeButtonProps,
80
+ children,
81
+ className
82
+ } = _b, rest = __objRest(_b, [
83
+ "as",
84
+ "variant",
85
+ "hideCloseButton",
86
+ "onClose",
87
+ "closed",
88
+ "closeButtonProps",
89
+ "children",
90
+ "className"
91
+ ]);
92
+ const [closedState, setClosedState] = (0, import_react.useState)(false);
93
+ const onClose = (0, import_react.useCallback)(() => {
94
+ if (onCloseProp) {
95
+ const result = onCloseProp();
96
+ if (result === true) {
97
+ setClosedState(true);
98
+ }
99
+ } else {
100
+ setClosedState(true);
101
+ }
102
+ }, []);
103
+ const closed = closedProp != null ? closedProp : closedState;
104
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
105
+ Component,
106
+ __spreadProps(__spreadValues({
107
+ className: (0, import_clsx.clsx)(
108
+ (0, import_typed_classname.t)("hds-box"),
109
+ (0, import_typed_classname.t)(`hds-box--${variant}`),
110
+ { [(0, import_typed_classname.t)("hds-box--closed")]: closed },
111
+ className
112
+ ),
113
+ ref
114
+ }, rest), {
115
+ children: [
116
+ !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)),
117
+ children
118
+ ]
119
+ })
120
+ );
121
+ }
122
+ );
123
+ Box.displayName = "Box";
124
+ var BoxCloseButton = (0, import_react.forwardRef)(
125
+ (_a, ref) => {
126
+ var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
127
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
128
+ "button",
129
+ __spreadValues({
130
+ className: (0, import_clsx.clsx)((0, import_typed_classname.t)("hds-box__close-button"), className),
131
+ ref,
132
+ type: "button"
133
+ }, rest)
134
+ );
135
+ }
136
+ );
137
+ BoxCloseButton.displayName = "BoxCloseButton";
138
+
139
+ // src/message/message.tsx
140
+ var import_jsx_runtime2 = require("react/jsx-runtime");
141
+ var Message = (0, import_react2.forwardRef)(
142
+ (_a, ref) => {
143
+ var _b = _a, { children, className, variant = "success", icon, iconClassName } = _b, rest = __objRest(_b, ["children", "className", "variant", "icon", "iconClassName"]);
144
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
145
+ Box,
146
+ __spreadProps(__spreadValues({
147
+ className: (0, import_clsx2.clsx)((0, import_typed_classname2.t)(`hds-message`), (0, import_typed_classname2.t)(`hds-message--${variant}`), className),
148
+ ref
149
+ }, rest), {
150
+ children: [
151
+ variant === "neutral" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: (0, import_clsx2.clsx)((0, import_typed_classname2.t)("hds-message--neutral__icon"), iconClassName), children: icon }),
152
+ children
153
+ ]
154
+ })
155
+ );
156
+ }
157
+ );
158
+ Message.displayName = "Message";
159
+ // Annotate the CommonJS export names for ESM import in node:
160
+ 0 && (module.exports = {
161
+ Message
162
+ });
@@ -0,0 +1,9 @@
1
+ import "../chunk-4XWB4ZSR.mjs";
2
+ import {
3
+ Message
4
+ } from "../chunk-EKFYWUBE.mjs";
5
+ import "../chunk-EX4U7YZF.mjs";
6
+ import "../chunk-FUJQIYOF.mjs";
7
+ export {
8
+ Message
9
+ };
@@ -0,0 +1,16 @@
1
+ import React__default from 'react';
2
+ import { O as OverridableComponent } from '../utils-BfZsjuFH.mjs';
3
+ import { BoxProps } from '../box/box.mjs';
4
+
5
+ type MessageProps = ({
6
+ variant?: "success" | "attention" | "warning";
7
+ icon?: never;
8
+ iconClassName?: never;
9
+ } | {
10
+ variant: "neutral";
11
+ icon?: React__default.ReactNode;
12
+ iconClassName?: string;
13
+ }) & Omit<BoxProps, "variant">;
14
+ declare const Message: OverridableComponent<MessageProps, HTMLDivElement>;
15
+
16
+ export { Message, type MessageProps };
@@ -0,0 +1,16 @@
1
+ import React__default from 'react';
2
+ import { O as OverridableComponent } from '../utils-BfZsjuFH.js';
3
+ import { BoxProps } from '../box/box.js';
4
+
5
+ type MessageProps = ({
6
+ variant?: "success" | "attention" | "warning";
7
+ icon?: never;
8
+ iconClassName?: never;
9
+ } | {
10
+ variant: "neutral";
11
+ icon?: React__default.ReactNode;
12
+ iconClassName?: string;
13
+ }) & Omit<BoxProps, "variant">;
14
+ declare const Message: OverridableComponent<MessageProps, HTMLDivElement>;
15
+
16
+ export { Message, type MessageProps };
@@ -0,0 +1,155 @@
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/message/message.tsx
50
+ var message_exports = {};
51
+ __export(message_exports, {
52
+ Message: () => Message
53
+ });
54
+ module.exports = __toCommonJS(message_exports);
55
+ var import_react2 = require("react");
56
+ var import_clsx2 = require("clsx");
57
+ var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
58
+
59
+ // src/box/box.tsx
60
+ var import_react = require("react");
61
+ var import_clsx = require("clsx");
62
+ var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
63
+ var import_jsx_runtime = require("react/jsx-runtime");
64
+ var Box = (0, import_react.forwardRef)(
65
+ (_a, ref) => {
66
+ var _b = _a, {
67
+ as: Component = "div",
68
+ variant = "light-grey",
69
+ hideCloseButton,
70
+ onClose: onCloseProp,
71
+ closed: closedProp,
72
+ closeButtonProps,
73
+ children,
74
+ className
75
+ } = _b, rest = __objRest(_b, [
76
+ "as",
77
+ "variant",
78
+ "hideCloseButton",
79
+ "onClose",
80
+ "closed",
81
+ "closeButtonProps",
82
+ "children",
83
+ "className"
84
+ ]);
85
+ const [closedState, setClosedState] = (0, import_react.useState)(false);
86
+ const onClose = (0, import_react.useCallback)(() => {
87
+ if (onCloseProp) {
88
+ const result = onCloseProp();
89
+ if (result === true) {
90
+ setClosedState(true);
91
+ }
92
+ } else {
93
+ setClosedState(true);
94
+ }
95
+ }, []);
96
+ const closed = closedProp != null ? closedProp : closedState;
97
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
98
+ Component,
99
+ __spreadProps(__spreadValues({
100
+ className: (0, import_clsx.clsx)(
101
+ (0, import_typed_classname.t)("hds-box"),
102
+ (0, import_typed_classname.t)(`hds-box--${variant}`),
103
+ { [(0, import_typed_classname.t)("hds-box--closed")]: closed },
104
+ className
105
+ ),
106
+ ref
107
+ }, rest), {
108
+ children: [
109
+ !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)),
110
+ children
111
+ ]
112
+ })
113
+ );
114
+ }
115
+ );
116
+ Box.displayName = "Box";
117
+ var BoxCloseButton = (0, import_react.forwardRef)(
118
+ (_a, ref) => {
119
+ var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
120
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
121
+ "button",
122
+ __spreadValues({
123
+ className: (0, import_clsx.clsx)((0, import_typed_classname.t)("hds-box__close-button"), className),
124
+ ref,
125
+ type: "button"
126
+ }, rest)
127
+ );
128
+ }
129
+ );
130
+ BoxCloseButton.displayName = "BoxCloseButton";
131
+
132
+ // src/message/message.tsx
133
+ var import_jsx_runtime2 = require("react/jsx-runtime");
134
+ var Message = (0, import_react2.forwardRef)(
135
+ (_a, ref) => {
136
+ var _b = _a, { children, className, variant = "success", icon, iconClassName } = _b, rest = __objRest(_b, ["children", "className", "variant", "icon", "iconClassName"]);
137
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
138
+ Box,
139
+ __spreadProps(__spreadValues({
140
+ className: (0, import_clsx2.clsx)((0, import_typed_classname2.t)(`hds-message`), (0, import_typed_classname2.t)(`hds-message--${variant}`), className),
141
+ ref
142
+ }, rest), {
143
+ children: [
144
+ variant === "neutral" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: (0, import_clsx2.clsx)((0, import_typed_classname2.t)("hds-message--neutral__icon"), iconClassName), children: icon }),
145
+ children
146
+ ]
147
+ })
148
+ );
149
+ }
150
+ );
151
+ Message.displayName = "Message";
152
+ // Annotate the CommonJS export names for ESM import in node:
153
+ 0 && (module.exports = {
154
+ Message
155
+ });
@@ -0,0 +1,8 @@
1
+ import {
2
+ Message
3
+ } from "../chunk-EKFYWUBE.mjs";
4
+ import "../chunk-EX4U7YZF.mjs";
5
+ import "../chunk-FUJQIYOF.mjs";
6
+ export {
7
+ Message
8
+ };
@@ -0,0 +1,17 @@
1
+ import { RefAttributes, FC, ElementType, ComponentPropsWithRef } from 'react';
2
+
3
+ /**
4
+ * OverridableComponent makes the `as` prop available,
5
+ * to be used to override the html element being used for a component
6
+ *
7
+ * Taken from digdir design system: https://github.com/digdir/designsystem/blob/main/packages/react/src/types/OverridableComponent.ts
8
+ */
9
+ type OverridableComponent<ComponentProps, Element extends HTMLElement> = {
10
+ (props: ComponentProps & RefAttributes<Element>): ReturnType<FC>;
11
+ <As extends ElementType>(props: {
12
+ /** Override html element */
13
+ as?: As;
14
+ } & ComponentProps & Omit<ComponentPropsWithRef<As>, keyof ComponentProps>): ReturnType<FC>;
15
+ } & Pick<FC, "displayName">;
16
+
17
+ export type { OverridableComponent as O };