@postenbring/hedwig-react 0.0.0-FPfHEZ66-tabs-component-20231214140156
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.
- package/dist/accordion/accordion-item-content.d.mts +9 -0
- package/dist/accordion/accordion-item-content.d.ts +9 -0
- package/dist/accordion/accordion-item-content.js +97 -0
- package/dist/accordion/accordion-item-content.mjs +8 -0
- package/dist/accordion/accordion-item-trigger.d.mts +9 -0
- package/dist/accordion/accordion-item-trigger.d.ts +9 -0
- package/dist/accordion/accordion-item-trigger.js +121 -0
- package/dist/accordion/accordion-item-trigger.mjs +8 -0
- package/dist/accordion/accordion-item.d.mts +15 -0
- package/dist/accordion/accordion-item.d.ts +15 -0
- package/dist/accordion/accordion-item.js +115 -0
- package/dist/accordion/accordion-item.mjs +8 -0
- package/dist/accordion/accordion.d.mts +28 -0
- package/dist/accordion/accordion.d.ts +28 -0
- package/dist/accordion/accordion.js +92 -0
- package/dist/accordion/accordion.mjs +8 -0
- package/dist/accordion/index.d.mts +6 -0
- package/dist/accordion/index.d.ts +6 -0
- package/dist/accordion/index.js +227 -0
- package/dist/accordion/index.mjs +21 -0
- package/dist/badge/badge.d.mts +28 -0
- package/dist/badge/badge.d.ts +28 -0
- package/dist/badge/badge.js +109 -0
- package/dist/badge/badge.mjs +13 -0
- package/dist/badge/index.d.mts +3 -0
- package/dist/badge/index.d.ts +3 -0
- package/dist/badge/index.js +115 -0
- package/dist/badge/index.mjs +14 -0
- package/dist/box/box.d.mts +36 -0
- package/dist/box/box.d.ts +36 -0
- package/dist/box/box.js +130 -0
- package/dist/box/box.mjs +9 -0
- package/dist/box/index.d.mts +3 -0
- package/dist/box/index.d.ts +3 -0
- package/dist/box/index.js +136 -0
- package/dist/box/index.mjs +10 -0
- package/dist/breadcrumb/breadcrumb.d.mts +43 -0
- package/dist/breadcrumb/breadcrumb.d.ts +43 -0
- package/dist/breadcrumb/breadcrumb.js +52 -0
- package/dist/breadcrumb/breadcrumb.mjs +7 -0
- package/dist/breadcrumb/index.d.mts +3 -0
- package/dist/breadcrumb/index.d.ts +3 -0
- package/dist/breadcrumb/index.js +58 -0
- package/dist/breadcrumb/index.mjs +8 -0
- package/dist/button/button.d.mts +37 -0
- package/dist/button/button.d.ts +37 -0
- package/dist/button/button.js +124 -0
- package/dist/button/button.mjs +11 -0
- package/dist/button/index.d.mts +3 -0
- package/dist/button/index.d.ts +3 -0
- package/dist/button/index.js +130 -0
- package/dist/button/index.mjs +12 -0
- package/dist/chunk-2QSL2PSS.mjs +63 -0
- package/dist/chunk-2V6SWZ5G.mjs +16 -0
- package/dist/chunk-3VUAKZB2.mjs +48 -0
- package/dist/chunk-5OAMKZDX.mjs +6 -0
- package/dist/chunk-6XSKLHN6.mjs +49 -0
- package/dist/chunk-74UG2OYZ.mjs +111 -0
- package/dist/chunk-7SCOBRDZ.mjs +5 -0
- package/dist/chunk-AJBQ2EJU.mjs +5 -0
- package/dist/chunk-BRBGRJ2I.mjs +18 -0
- package/dist/chunk-ENRMC5K7.mjs +75 -0
- package/dist/chunk-FSBY3NKV.mjs +47 -0
- package/dist/chunk-FUJQIYOF.mjs +37 -0
- package/dist/chunk-GMGUONH5.mjs +34 -0
- package/dist/chunk-HMESGVY5.mjs +21 -0
- package/dist/chunk-IEY4EQ4E.mjs +5 -0
- package/dist/chunk-J7U4Z726.mjs +39 -0
- package/dist/chunk-L7DYK6OS.mjs +58 -0
- package/dist/chunk-LNPO2XQW.mjs +5 -0
- package/dist/chunk-LZSDIT5D.mjs +5 -0
- package/dist/chunk-MNSMCSAR.mjs +59 -0
- package/dist/chunk-Q2HYT3Z7.mjs +16 -0
- package/dist/chunk-QV33ZHNO.mjs +60 -0
- package/dist/chunk-RXUPE4MM.mjs +82 -0
- package/dist/chunk-RY53CJI7.mjs +53 -0
- package/dist/chunk-TES7CVGU.mjs +34 -0
- package/dist/chunk-TFY7NZMU.mjs +5 -0
- package/dist/chunk-VX6MSLLO.mjs +5 -0
- package/dist/chunk-X4D24ZRP.mjs +63 -0
- package/dist/chunk-XJ44O3HY.mjs +58 -0
- package/dist/chunk-YFBW5ZRC.mjs +18 -0
- package/dist/chunk-YRAMCYSB.mjs +5 -0
- package/dist/dropdown/dropdown.d.mts +15 -0
- package/dist/dropdown/dropdown.d.ts +15 -0
- package/dist/dropdown/dropdown.js +95 -0
- package/dist/dropdown/dropdown.mjs +7 -0
- package/dist/dropdown/index.d.mts +3 -0
- package/dist/dropdown/index.d.ts +3 -0
- package/dist/dropdown/index.js +101 -0
- package/dist/dropdown/index.mjs +8 -0
- package/dist/index.d.mts +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +944 -0
- package/dist/index.mjs +114 -0
- package/dist/input/index.d.mts +3 -0
- package/dist/input/index.d.ts +3 -0
- package/dist/input/index.js +121 -0
- package/dist/input/index.mjs +13 -0
- package/dist/input/input.d.mts +13 -0
- package/dist/input/input.d.ts +13 -0
- package/dist/input/input.js +115 -0
- package/dist/input/input.mjs +7 -0
- package/dist/link/index.d.mts +3 -0
- package/dist/link/index.d.ts +3 -0
- package/dist/link/index.js +87 -0
- package/dist/link/index.mjs +8 -0
- package/dist/link/link.d.mts +18 -0
- package/dist/link/link.d.ts +18 -0
- package/dist/link/link.js +81 -0
- package/dist/link/link.mjs +7 -0
- package/dist/list/description-list.d.mts +32 -0
- package/dist/list/description-list.d.ts +32 -0
- package/dist/list/description-list.js +98 -0
- package/dist/list/description-list.mjs +13 -0
- package/dist/list/index.d.mts +5 -0
- package/dist/list/index.d.ts +5 -0
- package/dist/list/index.js +159 -0
- package/dist/list/index.mjs +22 -0
- package/dist/list/link-list.d.mts +13 -0
- package/dist/list/link-list.d.ts +13 -0
- package/dist/list/link-list.js +108 -0
- package/dist/list/link-list.mjs +8 -0
- package/dist/list/list.d.mts +25 -0
- package/dist/list/list.d.ts +25 -0
- package/dist/list/list.js +101 -0
- package/dist/list/list.mjs +9 -0
- package/dist/message/index.d.mts +16 -0
- package/dist/message/index.d.ts +16 -0
- package/dist/message/index.js +197 -0
- package/dist/message/index.mjs +14 -0
- package/dist/message/message.d.mts +18 -0
- package/dist/message/message.d.ts +18 -0
- package/dist/message/message.js +183 -0
- package/dist/message/message.mjs +12 -0
- package/dist/modal/index.d.mts +9 -0
- package/dist/modal/index.d.ts +9 -0
- package/dist/modal/index.js +218 -0
- package/dist/modal/index.mjs +13 -0
- package/dist/modal/modal.d.mts +13 -0
- package/dist/modal/modal.d.ts +13 -0
- package/dist/modal/modal.js +206 -0
- package/dist/modal/modal.mjs +11 -0
- package/dist/tabs/index.d.mts +4 -0
- package/dist/tabs/index.d.ts +4 -0
- package/dist/tabs/index.js +202 -0
- package/dist/tabs/index.mjs +17 -0
- package/dist/tabs/tabs.d.mts +49 -0
- package/dist/tabs/tabs.d.ts +49 -0
- package/dist/tabs/tabs.js +196 -0
- package/dist/tabs/tabs.mjs +16 -0
- package/dist/utils-BfZsjuFH.d.mts +17 -0
- package/dist/utils-BfZsjuFH.d.ts +17 -0
- package/package.json +34 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
+
};
|
|
41
|
+
var __copyProps = (to, from, except, desc) => {
|
|
42
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
+
for (let key of __getOwnPropNames(from))
|
|
44
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
|
+
}
|
|
47
|
+
return to;
|
|
48
|
+
};
|
|
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
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
|
|
59
|
+
// src/modal/index.tsx
|
|
60
|
+
var modal_exports = {};
|
|
61
|
+
__export(modal_exports, {
|
|
62
|
+
Modal: () => ModalComponent,
|
|
63
|
+
ModalHeader: () => ModalHeader
|
|
64
|
+
});
|
|
65
|
+
module.exports = __toCommonJS(modal_exports);
|
|
66
|
+
var import_fonts = require("@postenbring/hedwig-css/dist/fonts.css");
|
|
67
|
+
var import_tokens = require("@postenbring/hedwig-css/dist/tokens.css");
|
|
68
|
+
var import_body = require("@postenbring/hedwig-css/dist/body.css");
|
|
69
|
+
var import_box2 = require("@postenbring/hedwig-css/dist/box.css");
|
|
70
|
+
var import_modal = require("@postenbring/hedwig-css/dist/modal.css");
|
|
71
|
+
|
|
72
|
+
// src/modal/modal.tsx
|
|
73
|
+
var import_react3 = require("react");
|
|
74
|
+
var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
|
|
75
|
+
|
|
76
|
+
// src/box/box.tsx
|
|
77
|
+
var import_react = require("react");
|
|
78
|
+
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
|
|
79
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
80
|
+
var Box = (0, import_react.forwardRef)(
|
|
81
|
+
(_a, ref) => {
|
|
82
|
+
var _b = _a, {
|
|
83
|
+
as: Component = "div",
|
|
84
|
+
variant = "light-grey",
|
|
85
|
+
closeable = false,
|
|
86
|
+
onClose: onCloseProp,
|
|
87
|
+
closed: closedProp,
|
|
88
|
+
closeButtonProps,
|
|
89
|
+
children,
|
|
90
|
+
className
|
|
91
|
+
} = _b, rest = __objRest(_b, [
|
|
92
|
+
"as",
|
|
93
|
+
"variant",
|
|
94
|
+
"closeable",
|
|
95
|
+
"onClose",
|
|
96
|
+
"closed",
|
|
97
|
+
"closeButtonProps",
|
|
98
|
+
"children",
|
|
99
|
+
"className"
|
|
100
|
+
]);
|
|
101
|
+
const [closedState, setClosedState] = (0, import_react.useState)(false);
|
|
102
|
+
const onClose = (0, import_react.useCallback)(() => {
|
|
103
|
+
if (onCloseProp) {
|
|
104
|
+
const result = onCloseProp();
|
|
105
|
+
if (result === true) {
|
|
106
|
+
setClosedState(true);
|
|
107
|
+
}
|
|
108
|
+
} else {
|
|
109
|
+
setClosedState(true);
|
|
110
|
+
}
|
|
111
|
+
}, []);
|
|
112
|
+
const closed = closedProp != null ? closedProp : closedState;
|
|
113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
114
|
+
Component,
|
|
115
|
+
__spreadProps(__spreadValues({
|
|
116
|
+
className: (0, import_typed_classname.clsx)(
|
|
117
|
+
"hds-box",
|
|
118
|
+
`hds-box--${variant}`,
|
|
119
|
+
{ "hds-box--closed": closed },
|
|
120
|
+
className
|
|
121
|
+
),
|
|
122
|
+
ref
|
|
123
|
+
}, rest), {
|
|
124
|
+
children: [
|
|
125
|
+
closeable ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)) : null,
|
|
126
|
+
children
|
|
127
|
+
]
|
|
128
|
+
})
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
Box.displayName = "Box";
|
|
133
|
+
var BoxCloseButton = (0, import_react.forwardRef)(
|
|
134
|
+
(_a, ref) => {
|
|
135
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
137
|
+
"button",
|
|
138
|
+
__spreadValues({
|
|
139
|
+
className: (0, import_typed_classname.clsx)("hds-box__close-button", className),
|
|
140
|
+
ref,
|
|
141
|
+
type: "button"
|
|
142
|
+
}, rest)
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
BoxCloseButton.displayName = "BoxCloseButton";
|
|
147
|
+
|
|
148
|
+
// src/utils.ts
|
|
149
|
+
var React = __toESM(require("react"));
|
|
150
|
+
var import_react2 = require("react");
|
|
151
|
+
function useMergeRefs(refs) {
|
|
152
|
+
return React.useMemo(() => {
|
|
153
|
+
if (refs.every((ref) => ref === null)) {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
return (value) => {
|
|
157
|
+
refs.forEach((ref) => {
|
|
158
|
+
if (typeof ref === "function") {
|
|
159
|
+
ref(value);
|
|
160
|
+
} else if (ref !== null) {
|
|
161
|
+
ref.current = value;
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
}, refs);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// src/modal/modal.tsx
|
|
169
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
170
|
+
var Modal = (0, import_react3.forwardRef)(
|
|
171
|
+
(_a, ref) => {
|
|
172
|
+
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
|
173
|
+
const modalRef = (0, import_react3.useRef)(null);
|
|
174
|
+
const mergedRef = useMergeRefs([modalRef, ref]);
|
|
175
|
+
function onClose() {
|
|
176
|
+
var _a2;
|
|
177
|
+
(_a2 = modalRef.current) == null ? void 0 : _a2.close();
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
181
|
+
Box,
|
|
182
|
+
__spreadProps(__spreadValues({
|
|
183
|
+
as: "dialog",
|
|
184
|
+
className: (0, import_typed_classname2.clsx)("hds-modal", className),
|
|
185
|
+
closeable: true,
|
|
186
|
+
onClose,
|
|
187
|
+
ref: mergedRef,
|
|
188
|
+
variant: "white"
|
|
189
|
+
}, rest), {
|
|
190
|
+
children
|
|
191
|
+
})
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
Modal.displayName = "Modal";
|
|
196
|
+
var ModalHeader = (0, import_react3.forwardRef)(
|
|
197
|
+
(_a, ref) => {
|
|
198
|
+
var _b = _a, { as: Component = "h1", className } = _b, rest = __objRest(_b, ["as", "className"]);
|
|
199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
200
|
+
Component,
|
|
201
|
+
__spreadValues({
|
|
202
|
+
className: (0, import_typed_classname2.clsx)("hds-modal__header", className),
|
|
203
|
+
ref
|
|
204
|
+
}, rest)
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
ModalHeader.displayName = "ModalHeader";
|
|
209
|
+
|
|
210
|
+
// src/modal/index.tsx
|
|
211
|
+
var ModalComponent = Modal;
|
|
212
|
+
ModalComponent.Header = ModalHeader;
|
|
213
|
+
ModalComponent.Header.displayName = "Modal";
|
|
214
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
215
|
+
0 && (module.exports = {
|
|
216
|
+
Modal,
|
|
217
|
+
ModalHeader
|
|
218
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ModalComponent
|
|
3
|
+
} from "../chunk-YFBW5ZRC.mjs";
|
|
4
|
+
import {
|
|
5
|
+
ModalHeader
|
|
6
|
+
} from "../chunk-QV33ZHNO.mjs";
|
|
7
|
+
import "../chunk-FSBY3NKV.mjs";
|
|
8
|
+
import "../chunk-RXUPE4MM.mjs";
|
|
9
|
+
import "../chunk-FUJQIYOF.mjs";
|
|
10
|
+
export {
|
|
11
|
+
ModalComponent as Modal,
|
|
12
|
+
ModalHeader
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import { O as OverridableComponent } from '../utils-BfZsjuFH.mjs';
|
|
3
|
+
|
|
4
|
+
interface ModalProps extends React.HTMLAttributes<HTMLDialogElement> {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* # 🚨 WORK IN PROGRESS 🚨
|
|
9
|
+
*/
|
|
10
|
+
declare const Modal: React$1.ForwardRefExoticComponent<ModalProps & React$1.RefAttributes<HTMLDialogElement>>;
|
|
11
|
+
declare const ModalHeader: OverridableComponent<object, HTMLParagraphElement>;
|
|
12
|
+
|
|
13
|
+
export { Modal, ModalHeader, type ModalProps };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import { O as OverridableComponent } from '../utils-BfZsjuFH.js';
|
|
3
|
+
|
|
4
|
+
interface ModalProps extends React.HTMLAttributes<HTMLDialogElement> {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* # 🚨 WORK IN PROGRESS 🚨
|
|
9
|
+
*/
|
|
10
|
+
declare const Modal: React$1.ForwardRefExoticComponent<ModalProps & React$1.RefAttributes<HTMLDialogElement>>;
|
|
11
|
+
declare const ModalHeader: OverridableComponent<object, HTMLParagraphElement>;
|
|
12
|
+
|
|
13
|
+
export { Modal, ModalHeader, type ModalProps };
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
+
};
|
|
41
|
+
var __copyProps = (to, from, except, desc) => {
|
|
42
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
+
for (let key of __getOwnPropNames(from))
|
|
44
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
|
+
}
|
|
47
|
+
return to;
|
|
48
|
+
};
|
|
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
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
|
|
59
|
+
// src/modal/modal.tsx
|
|
60
|
+
var modal_exports = {};
|
|
61
|
+
__export(modal_exports, {
|
|
62
|
+
Modal: () => Modal,
|
|
63
|
+
ModalHeader: () => ModalHeader
|
|
64
|
+
});
|
|
65
|
+
module.exports = __toCommonJS(modal_exports);
|
|
66
|
+
var import_react3 = require("react");
|
|
67
|
+
var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
|
|
68
|
+
|
|
69
|
+
// src/box/box.tsx
|
|
70
|
+
var import_react = require("react");
|
|
71
|
+
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
|
|
72
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
73
|
+
var Box = (0, import_react.forwardRef)(
|
|
74
|
+
(_a, ref) => {
|
|
75
|
+
var _b = _a, {
|
|
76
|
+
as: Component = "div",
|
|
77
|
+
variant = "light-grey",
|
|
78
|
+
closeable = false,
|
|
79
|
+
onClose: onCloseProp,
|
|
80
|
+
closed: closedProp,
|
|
81
|
+
closeButtonProps,
|
|
82
|
+
children,
|
|
83
|
+
className
|
|
84
|
+
} = _b, rest = __objRest(_b, [
|
|
85
|
+
"as",
|
|
86
|
+
"variant",
|
|
87
|
+
"closeable",
|
|
88
|
+
"onClose",
|
|
89
|
+
"closed",
|
|
90
|
+
"closeButtonProps",
|
|
91
|
+
"children",
|
|
92
|
+
"className"
|
|
93
|
+
]);
|
|
94
|
+
const [closedState, setClosedState] = (0, import_react.useState)(false);
|
|
95
|
+
const onClose = (0, import_react.useCallback)(() => {
|
|
96
|
+
if (onCloseProp) {
|
|
97
|
+
const result = onCloseProp();
|
|
98
|
+
if (result === true) {
|
|
99
|
+
setClosedState(true);
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
setClosedState(true);
|
|
103
|
+
}
|
|
104
|
+
}, []);
|
|
105
|
+
const closed = closedProp != null ? closedProp : closedState;
|
|
106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
107
|
+
Component,
|
|
108
|
+
__spreadProps(__spreadValues({
|
|
109
|
+
className: (0, import_typed_classname.clsx)(
|
|
110
|
+
"hds-box",
|
|
111
|
+
`hds-box--${variant}`,
|
|
112
|
+
{ "hds-box--closed": closed },
|
|
113
|
+
className
|
|
114
|
+
),
|
|
115
|
+
ref
|
|
116
|
+
}, rest), {
|
|
117
|
+
children: [
|
|
118
|
+
closeable ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)) : null,
|
|
119
|
+
children
|
|
120
|
+
]
|
|
121
|
+
})
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
Box.displayName = "Box";
|
|
126
|
+
var BoxCloseButton = (0, import_react.forwardRef)(
|
|
127
|
+
(_a, ref) => {
|
|
128
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
130
|
+
"button",
|
|
131
|
+
__spreadValues({
|
|
132
|
+
className: (0, import_typed_classname.clsx)("hds-box__close-button", className),
|
|
133
|
+
ref,
|
|
134
|
+
type: "button"
|
|
135
|
+
}, rest)
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
BoxCloseButton.displayName = "BoxCloseButton";
|
|
140
|
+
|
|
141
|
+
// src/utils.ts
|
|
142
|
+
var React = __toESM(require("react"));
|
|
143
|
+
var import_react2 = require("react");
|
|
144
|
+
function useMergeRefs(refs) {
|
|
145
|
+
return React.useMemo(() => {
|
|
146
|
+
if (refs.every((ref) => ref === null)) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
return (value) => {
|
|
150
|
+
refs.forEach((ref) => {
|
|
151
|
+
if (typeof ref === "function") {
|
|
152
|
+
ref(value);
|
|
153
|
+
} else if (ref !== null) {
|
|
154
|
+
ref.current = value;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
}, refs);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// src/modal/modal.tsx
|
|
162
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
163
|
+
var Modal = (0, import_react3.forwardRef)(
|
|
164
|
+
(_a, ref) => {
|
|
165
|
+
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
|
166
|
+
const modalRef = (0, import_react3.useRef)(null);
|
|
167
|
+
const mergedRef = useMergeRefs([modalRef, ref]);
|
|
168
|
+
function onClose() {
|
|
169
|
+
var _a2;
|
|
170
|
+
(_a2 = modalRef.current) == null ? void 0 : _a2.close();
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
174
|
+
Box,
|
|
175
|
+
__spreadProps(__spreadValues({
|
|
176
|
+
as: "dialog",
|
|
177
|
+
className: (0, import_typed_classname2.clsx)("hds-modal", className),
|
|
178
|
+
closeable: true,
|
|
179
|
+
onClose,
|
|
180
|
+
ref: mergedRef,
|
|
181
|
+
variant: "white"
|
|
182
|
+
}, rest), {
|
|
183
|
+
children
|
|
184
|
+
})
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
Modal.displayName = "Modal";
|
|
189
|
+
var ModalHeader = (0, import_react3.forwardRef)(
|
|
190
|
+
(_a, ref) => {
|
|
191
|
+
var _b = _a, { as: Component = "h1", className } = _b, rest = __objRest(_b, ["as", "className"]);
|
|
192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
193
|
+
Component,
|
|
194
|
+
__spreadValues({
|
|
195
|
+
className: (0, import_typed_classname2.clsx)("hds-modal__header", className),
|
|
196
|
+
ref
|
|
197
|
+
}, rest)
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
ModalHeader.displayName = "ModalHeader";
|
|
202
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
203
|
+
0 && (module.exports = {
|
|
204
|
+
Modal,
|
|
205
|
+
ModalHeader
|
|
206
|
+
});
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
+
};
|
|
41
|
+
var __copyProps = (to, from, except, desc) => {
|
|
42
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
+
for (let key of __getOwnPropNames(from))
|
|
44
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
|
+
}
|
|
47
|
+
return to;
|
|
48
|
+
};
|
|
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
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
|
|
59
|
+
// src/tabs/index.tsx
|
|
60
|
+
var tabs_exports = {};
|
|
61
|
+
__export(tabs_exports, {
|
|
62
|
+
Tab: () => Tab,
|
|
63
|
+
TabContent: () => TabContent,
|
|
64
|
+
TabContents: () => TabContents,
|
|
65
|
+
TabList: () => TabList,
|
|
66
|
+
Tabs: () => Tabs
|
|
67
|
+
});
|
|
68
|
+
module.exports = __toCommonJS(tabs_exports);
|
|
69
|
+
var import_fonts = require("@postenbring/hedwig-css/dist/fonts.css");
|
|
70
|
+
var import_tokens = require("@postenbring/hedwig-css/dist/tokens.css");
|
|
71
|
+
var import_body = require("@postenbring/hedwig-css/dist/body.css");
|
|
72
|
+
var import_tabs = require("@postenbring/hedwig-css/dist/tabs.css");
|
|
73
|
+
|
|
74
|
+
// src/tabs/tabs.tsx
|
|
75
|
+
var import_react3 = require("react");
|
|
76
|
+
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
|
|
77
|
+
|
|
78
|
+
// src/utils.ts
|
|
79
|
+
var React = __toESM(require("react"));
|
|
80
|
+
var import_react = require("react");
|
|
81
|
+
function useResize(ref) {
|
|
82
|
+
const [width, setWidth] = (0, import_react.useState)(0);
|
|
83
|
+
const [height, setHeight] = (0, import_react.useState)(0);
|
|
84
|
+
const handleResize = (0, import_react.useCallback)(() => {
|
|
85
|
+
var _a, _b, _c, _d;
|
|
86
|
+
if ((ref == null ? void 0 : ref.current) !== null) {
|
|
87
|
+
setWidth((_b = (_a = ref == null ? void 0 : ref.current) == null ? void 0 : _a.offsetWidth) != null ? _b : 0);
|
|
88
|
+
setHeight((_d = (_c = ref == null ? void 0 : ref.current) == null ? void 0 : _c.offsetHeight) != null ? _d : 0);
|
|
89
|
+
}
|
|
90
|
+
}, [ref]);
|
|
91
|
+
(0, import_react.useEffect)(() => {
|
|
92
|
+
window.addEventListener("load", handleResize);
|
|
93
|
+
window.addEventListener("resize", handleResize);
|
|
94
|
+
return () => {
|
|
95
|
+
window.removeEventListener("load", handleResize);
|
|
96
|
+
window.removeEventListener("resize", handleResize);
|
|
97
|
+
};
|
|
98
|
+
}, [ref, handleResize]);
|
|
99
|
+
(0, import_react.useEffect)(() => {
|
|
100
|
+
handleResize();
|
|
101
|
+
}, []);
|
|
102
|
+
return { width, height };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// src/tabs/context.ts
|
|
106
|
+
var import_react2 = require("react");
|
|
107
|
+
var TabsContext = (0, import_react2.createContext)({
|
|
108
|
+
activeTabId: void 0,
|
|
109
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Added default section, without handling
|
|
110
|
+
toggleActiveTabId: (tabId) => {
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// src/tabs/tabs.tsx
|
|
115
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
116
|
+
var Tabs = (0, import_react3.forwardRef)(
|
|
117
|
+
(_a, ref) => {
|
|
118
|
+
var _b = _a, { as: Component = "div", defaultTab, children } = _b, rest = __objRest(_b, ["as", "defaultTab", "children"]);
|
|
119
|
+
const [activeTabId, toggleActiveTabId] = (0, import_react3.useState)(defaultTab);
|
|
120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, __spreadProps(__spreadValues({ className: (0, import_typed_classname.clsx)("hds-tabs"), ref }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsContext.Provider, { value: { activeTabId, toggleActiveTabId }, children }) }));
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
Tabs.displayName = "Tabs";
|
|
124
|
+
function TabList(_a) {
|
|
125
|
+
var _b = _a, { children, direction = "horizontal", className } = _b, rest = __objRest(_b, ["children", "direction", "className"]);
|
|
126
|
+
const tabsListRef = (0, import_react3.useRef)(null);
|
|
127
|
+
const { width: tabsWidth } = useResize(tabsListRef);
|
|
128
|
+
const { innerWidth } = window;
|
|
129
|
+
const wideEnough = innerWidth >= tabsWidth;
|
|
130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
131
|
+
"div",
|
|
132
|
+
__spreadProps(__spreadValues({
|
|
133
|
+
className: (0, import_typed_classname.clsx)(
|
|
134
|
+
"hds-tabs--list",
|
|
135
|
+
direction === "horizontal" ? {
|
|
136
|
+
[`hds-tabs--list-horizontal`]: wideEnough,
|
|
137
|
+
"hds-tabs--list-vertical": !wideEnough
|
|
138
|
+
} : {
|
|
139
|
+
"hds-tabs--list-vertical": true
|
|
140
|
+
},
|
|
141
|
+
className
|
|
142
|
+
),
|
|
143
|
+
ref: tabsListRef,
|
|
144
|
+
role: "tablist"
|
|
145
|
+
}, rest), {
|
|
146
|
+
children
|
|
147
|
+
})
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
TabList.displayName = "TabList";
|
|
151
|
+
var Tab = (0, import_react3.forwardRef)(
|
|
152
|
+
(_a, ref) => {
|
|
153
|
+
var _b = _a, { as: Component = "button", children, tabId, className, onClick } = _b, rest = __objRest(_b, ["as", "children", "tabId", "className", "onClick"]);
|
|
154
|
+
const context = (0, import_react3.useContext)(TabsContext);
|
|
155
|
+
const toggleTab = (e) => {
|
|
156
|
+
e.preventDefault();
|
|
157
|
+
context.toggleActiveTabId(tabId);
|
|
158
|
+
onClick && onClick(e);
|
|
159
|
+
};
|
|
160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
161
|
+
Component,
|
|
162
|
+
__spreadProps(__spreadValues({
|
|
163
|
+
className: (0, import_typed_classname.clsx)(
|
|
164
|
+
"hds-tabs--tab",
|
|
165
|
+
{ "hds-tabs--tab-active": context.activeTabId === tabId },
|
|
166
|
+
className
|
|
167
|
+
),
|
|
168
|
+
"data-tabid": tabId,
|
|
169
|
+
onClick: toggleTab,
|
|
170
|
+
ref,
|
|
171
|
+
role: "tab"
|
|
172
|
+
}, rest), {
|
|
173
|
+
children
|
|
174
|
+
})
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
Tab.displayName = "Tab";
|
|
179
|
+
function TabContents(_a) {
|
|
180
|
+
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", __spreadProps(__spreadValues({ className: (0, import_typed_classname.clsx)("hds-tabs--contents") }, rest), { children }));
|
|
182
|
+
}
|
|
183
|
+
TabContents.displayName = "TabContents";
|
|
184
|
+
var TabContent = (0, import_react3.forwardRef)(
|
|
185
|
+
(_a, ref) => {
|
|
186
|
+
var _b = _a, { as: Component = "div", forTabId, children } = _b, rest = __objRest(_b, ["as", "forTabId", "children"]);
|
|
187
|
+
const context = (0, import_react3.useContext)(TabsContext);
|
|
188
|
+
if (context.activeTabId === forTabId) {
|
|
189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, __spreadProps(__spreadValues({}, rest), { ref, children }));
|
|
190
|
+
}
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
);
|
|
194
|
+
TabContent.displayName = "TabContent";
|
|
195
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
196
|
+
0 && (module.exports = {
|
|
197
|
+
Tab,
|
|
198
|
+
TabContent,
|
|
199
|
+
TabContents,
|
|
200
|
+
TabList,
|
|
201
|
+
Tabs
|
|
202
|
+
});
|