@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,227 @@
|
|
|
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/accordion/index.tsx
|
|
50
|
+
var accordion_exports = {};
|
|
51
|
+
__export(accordion_exports, {
|
|
52
|
+
Accordion: () => Accordion,
|
|
53
|
+
AccordionContent: () => AccordionContent,
|
|
54
|
+
AccordionItem: () => AccordionItem,
|
|
55
|
+
AccordionTrigger: () => AccordionTrigger
|
|
56
|
+
});
|
|
57
|
+
module.exports = __toCommonJS(accordion_exports);
|
|
58
|
+
var import_fonts = require("@postenbring/hedwig-css/dist/fonts.css");
|
|
59
|
+
var import_tokens = require("@postenbring/hedwig-css/dist/tokens.css");
|
|
60
|
+
var import_body = require("@postenbring/hedwig-css/dist/body.css");
|
|
61
|
+
var import_accordion = require("@postenbring/hedwig-css/dist/accordion.css");
|
|
62
|
+
|
|
63
|
+
// src/accordion/accordion.tsx
|
|
64
|
+
var import_react2 = require("react");
|
|
65
|
+
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
|
|
66
|
+
|
|
67
|
+
// src/accordion/context.ts
|
|
68
|
+
var import_react = require("react");
|
|
69
|
+
var AccordionContext = (0, import_react.createContext)({
|
|
70
|
+
variant: "multiple",
|
|
71
|
+
mounted: false,
|
|
72
|
+
openItems: [],
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Added default section, without handling
|
|
74
|
+
toggleOpenItem: (id) => {
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
var AccordionItemContext = (0, import_react.createContext)(null);
|
|
78
|
+
|
|
79
|
+
// src/accordion/accordion.tsx
|
|
80
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
81
|
+
var Accordion = (0, import_react2.forwardRef)(
|
|
82
|
+
(_a, ref) => {
|
|
83
|
+
var _b = _a, { as: Component = "div", children, className, variant = "multiple" } = _b, rest = __objRest(_b, ["as", "children", "className", "variant"]);
|
|
84
|
+
const [openItems, setOpenItems] = (0, import_react2.useState)([]);
|
|
85
|
+
const toggleOpenItem = (itemId) => {
|
|
86
|
+
if (variant === "single") {
|
|
87
|
+
setOpenItems([itemId]);
|
|
88
|
+
} else {
|
|
89
|
+
setOpenItems(
|
|
90
|
+
openItems.includes(itemId) ? openItems.filter((id) => id !== itemId) : [...openItems, itemId]
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionContext.Provider, { value: { variant, openItems, toggleOpenItem, mounted: true }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, __spreadProps(__spreadValues({}, rest), { className: (0, import_typed_classname.clsx)("hds-accordion", className), ref, children })) });
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
Accordion.displayName = "Accordion";
|
|
98
|
+
|
|
99
|
+
// src/accordion/accordion-item.tsx
|
|
100
|
+
var import_react3 = require("react");
|
|
101
|
+
var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
|
|
102
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
103
|
+
var AccordionItem = (0, import_react3.forwardRef)(
|
|
104
|
+
(_a, ref) => {
|
|
105
|
+
var _b = _a, { as: Component = "div", children, className } = _b, rest = __objRest(_b, ["as", "children", "className"]);
|
|
106
|
+
const context = (0, import_react3.useContext)(AccordionContext);
|
|
107
|
+
const [open, setOpen] = (0, import_react3.useState)(false);
|
|
108
|
+
const accordionItemId = (0, import_react3.useId)();
|
|
109
|
+
const handleOpen = () => {
|
|
110
|
+
setOpen(!open);
|
|
111
|
+
if (context.variant === "single") {
|
|
112
|
+
context.toggleOpenItem(accordionItemId);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
if (!context.mounted) {
|
|
116
|
+
throw new Error("Context required. Did you use <AccordionItem/> outside of <Accordion/>?");
|
|
117
|
+
}
|
|
118
|
+
(0, import_react3.useEffect)(() => {
|
|
119
|
+
if (context.variant === "multiple") {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (open && !context.openItems.includes(accordionItemId)) {
|
|
123
|
+
setOpen(false);
|
|
124
|
+
}
|
|
125
|
+
}, [context.openItems]);
|
|
126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
127
|
+
Component,
|
|
128
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
129
|
+
className: (0, import_typed_classname2.clsx)(
|
|
130
|
+
"hds-accordion-item",
|
|
131
|
+
{
|
|
132
|
+
"hds-accordion-item__expanded": open
|
|
133
|
+
},
|
|
134
|
+
className
|
|
135
|
+
),
|
|
136
|
+
ref,
|
|
137
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AccordionItemContext.Provider, { value: { open, setOpen: handleOpen }, children })
|
|
138
|
+
})
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
AccordionItem.displayName = "AccordionItem";
|
|
143
|
+
|
|
144
|
+
// src/accordion/accordion-item-trigger.tsx
|
|
145
|
+
var import_react4 = require("react");
|
|
146
|
+
var import_typed_classname3 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
|
|
147
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
148
|
+
var AccordionTrigger = (0, import_react4.forwardRef)((_a, ref) => {
|
|
149
|
+
var _b = _a, { as: Component = "button", children, className, onClick } = _b, rest = __objRest(_b, ["as", "children", "className", "onClick"]);
|
|
150
|
+
const itemContext = (0, import_react4.useContext)(AccordionItemContext);
|
|
151
|
+
if (itemContext === null) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
const expandOrCollapse = (e) => {
|
|
155
|
+
itemContext.setOpen(!itemContext.open);
|
|
156
|
+
onClick && onClick(e);
|
|
157
|
+
};
|
|
158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
159
|
+
Component,
|
|
160
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
161
|
+
"aria-expanded": itemContext.open,
|
|
162
|
+
className: (0, import_typed_classname3.clsx)(
|
|
163
|
+
"hds-accordion-item-trigger",
|
|
164
|
+
{ "hds-accordion-item-trigger--open": itemContext.open },
|
|
165
|
+
className
|
|
166
|
+
),
|
|
167
|
+
onClick: expandOrCollapse,
|
|
168
|
+
ref,
|
|
169
|
+
type: "button",
|
|
170
|
+
children: [
|
|
171
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: (0, import_typed_classname3.clsx)("hds-accordion-item-trigger--icon"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
172
|
+
"svg",
|
|
173
|
+
{
|
|
174
|
+
fill: "none",
|
|
175
|
+
height: "24",
|
|
176
|
+
viewBox: "0 0 24 24",
|
|
177
|
+
width: "24",
|
|
178
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
179
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("g", { className: "hds-accordion-item-trigger--icon-chevron", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
180
|
+
"path",
|
|
181
|
+
{
|
|
182
|
+
className: "hds-accordion-item-trigger--icon-chevron_down",
|
|
183
|
+
d: "M19.6289 9.15625L18.9609 8.45312C18.7852 8.27734 18.5039 8.27734 18.3633 8.45312L12 14.8164L5.60156 8.45312C5.46094 8.27734 5.17969 8.27734 5.00391 8.45312L4.33594 9.15625C4.16016 9.29688 4.16016 9.57812 4.33594 9.75391L11.6836 17.1016C11.8594 17.2773 12.1055 17.2773 12.2812 17.1016L19.6289 9.75391C19.8047 9.57812 19.8047 9.29688 19.6289 9.15625Z"
|
|
184
|
+
}
|
|
185
|
+
) })
|
|
186
|
+
}
|
|
187
|
+
) }),
|
|
188
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children })
|
|
189
|
+
]
|
|
190
|
+
})
|
|
191
|
+
);
|
|
192
|
+
});
|
|
193
|
+
AccordionTrigger.displayName = "AccordionTrigger";
|
|
194
|
+
|
|
195
|
+
// src/accordion/accordion-item-content.tsx
|
|
196
|
+
var import_react5 = require("react");
|
|
197
|
+
var import_typed_classname4 = require("@postenbring/hedwig-css/typed-classname/index.mjs");
|
|
198
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
199
|
+
var AccordionContent = (0, import_react5.forwardRef)((_a, ref) => {
|
|
200
|
+
var _b = _a, { as: Component = "div", children, className } = _b, rest = __objRest(_b, ["as", "children", "className"]);
|
|
201
|
+
const context = (0, import_react5.useContext)(AccordionItemContext);
|
|
202
|
+
if (context === null) {
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
206
|
+
Component,
|
|
207
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
208
|
+
className: (0, import_typed_classname4.clsx)(
|
|
209
|
+
"hds-accordion-item-content",
|
|
210
|
+
{
|
|
211
|
+
"hds-accordion-item-content--closed": !context.open
|
|
212
|
+
},
|
|
213
|
+
className
|
|
214
|
+
),
|
|
215
|
+
ref,
|
|
216
|
+
children
|
|
217
|
+
})
|
|
218
|
+
);
|
|
219
|
+
});
|
|
220
|
+
AccordionContent.displayName = "AccordionContent";
|
|
221
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
222
|
+
0 && (module.exports = {
|
|
223
|
+
Accordion,
|
|
224
|
+
AccordionContent,
|
|
225
|
+
AccordionItem,
|
|
226
|
+
AccordionTrigger
|
|
227
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "../chunk-LNPO2XQW.mjs";
|
|
2
|
+
import {
|
|
3
|
+
AccordionContent
|
|
4
|
+
} from "../chunk-J7U4Z726.mjs";
|
|
5
|
+
import {
|
|
6
|
+
AccordionTrigger
|
|
7
|
+
} from "../chunk-2QSL2PSS.mjs";
|
|
8
|
+
import {
|
|
9
|
+
AccordionItem
|
|
10
|
+
} from "../chunk-L7DYK6OS.mjs";
|
|
11
|
+
import {
|
|
12
|
+
Accordion
|
|
13
|
+
} from "../chunk-GMGUONH5.mjs";
|
|
14
|
+
import "../chunk-2V6SWZ5G.mjs";
|
|
15
|
+
import "../chunk-FUJQIYOF.mjs";
|
|
16
|
+
export {
|
|
17
|
+
Accordion,
|
|
18
|
+
AccordionContent,
|
|
19
|
+
AccordionItem,
|
|
20
|
+
AccordionTrigger
|
|
21
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
interface BadgeProps extends React.AnchorHTMLAttributes<HTMLSpanElement> {
|
|
5
|
+
/**
|
|
6
|
+
* Font size of the badge
|
|
7
|
+
*/
|
|
8
|
+
size?: "small" | "smaller";
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare function Badge(props: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare namespace Badge {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
declare function DarkBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
declare namespace DarkBadge {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
declare function WhiteBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
declare namespace WhiteBadge {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
23
|
+
declare function WarningBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
declare namespace WarningBadge {
|
|
25
|
+
var displayName: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { Badge, type BadgeProps, DarkBadge, WarningBadge, WhiteBadge };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
interface BadgeProps extends React.AnchorHTMLAttributes<HTMLSpanElement> {
|
|
5
|
+
/**
|
|
6
|
+
* Font size of the badge
|
|
7
|
+
*/
|
|
8
|
+
size?: "small" | "smaller";
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare function Badge(props: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare namespace Badge {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
declare function DarkBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
declare namespace DarkBadge {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
declare function WhiteBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
declare namespace WhiteBadge {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
23
|
+
declare function WarningBadge(props: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
declare namespace WarningBadge {
|
|
25
|
+
var displayName: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { Badge, type BadgeProps, DarkBadge, WarningBadge, WhiteBadge };
|
|
@@ -0,0 +1,109 @@
|
|
|
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/badge/badge.tsx
|
|
50
|
+
var badge_exports = {};
|
|
51
|
+
__export(badge_exports, {
|
|
52
|
+
Badge: () => Badge,
|
|
53
|
+
DarkBadge: () => DarkBadge,
|
|
54
|
+
WarningBadge: () => WarningBadge,
|
|
55
|
+
WhiteBadge: () => WhiteBadge
|
|
56
|
+
});
|
|
57
|
+
module.exports = __toCommonJS(badge_exports);
|
|
58
|
+
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
|
|
59
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
60
|
+
function BaseBadge(_a) {
|
|
61
|
+
var _b = _a, {
|
|
62
|
+
children,
|
|
63
|
+
variant,
|
|
64
|
+
size = "small",
|
|
65
|
+
className
|
|
66
|
+
} = _b, rest = __objRest(_b, [
|
|
67
|
+
"children",
|
|
68
|
+
"variant",
|
|
69
|
+
"size",
|
|
70
|
+
"className"
|
|
71
|
+
]);
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
|
+
"span",
|
|
74
|
+
__spreadProps(__spreadValues({
|
|
75
|
+
className: (0, import_typed_classname.clsx)(
|
|
76
|
+
"hds-badge",
|
|
77
|
+
`hds-badge--${size}`,
|
|
78
|
+
`hds-badge--${variant}`,
|
|
79
|
+
className
|
|
80
|
+
)
|
|
81
|
+
}, rest), {
|
|
82
|
+
children
|
|
83
|
+
})
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
BaseBadge.displayName = "BaseBadge";
|
|
87
|
+
function Badge(props) {
|
|
88
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
|
|
89
|
+
}
|
|
90
|
+
Badge.displayName = "Badge";
|
|
91
|
+
function DarkBadge(props) {
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "dark" }));
|
|
93
|
+
}
|
|
94
|
+
DarkBadge.displayName = "DarkBadge";
|
|
95
|
+
function WhiteBadge(props) {
|
|
96
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "white" }));
|
|
97
|
+
}
|
|
98
|
+
WhiteBadge.displayName = "WhiteBadge";
|
|
99
|
+
function WarningBadge(props) {
|
|
100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "warning" }));
|
|
101
|
+
}
|
|
102
|
+
WarningBadge.displayName = "WarningBadge";
|
|
103
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
104
|
+
0 && (module.exports = {
|
|
105
|
+
Badge,
|
|
106
|
+
DarkBadge,
|
|
107
|
+
WarningBadge,
|
|
108
|
+
WhiteBadge
|
|
109
|
+
});
|
|
@@ -0,0 +1,115 @@
|
|
|
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/badge/index.tsx
|
|
50
|
+
var badge_exports = {};
|
|
51
|
+
__export(badge_exports, {
|
|
52
|
+
Badge: () => Badge,
|
|
53
|
+
DarkBadge: () => DarkBadge,
|
|
54
|
+
WarningBadge: () => WarningBadge,
|
|
55
|
+
WhiteBadge: () => WhiteBadge
|
|
56
|
+
});
|
|
57
|
+
module.exports = __toCommonJS(badge_exports);
|
|
58
|
+
var import_fonts = require("@postenbring/hedwig-css/dist/fonts.css");
|
|
59
|
+
var import_tokens = require("@postenbring/hedwig-css/dist/tokens.css");
|
|
60
|
+
var import_body = require("@postenbring/hedwig-css/dist/body.css");
|
|
61
|
+
var import_badge = require("@postenbring/hedwig-css/dist/badge.css");
|
|
62
|
+
|
|
63
|
+
// src/badge/badge.tsx
|
|
64
|
+
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs");
|
|
65
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
66
|
+
function BaseBadge(_a) {
|
|
67
|
+
var _b = _a, {
|
|
68
|
+
children,
|
|
69
|
+
variant,
|
|
70
|
+
size = "small",
|
|
71
|
+
className
|
|
72
|
+
} = _b, rest = __objRest(_b, [
|
|
73
|
+
"children",
|
|
74
|
+
"variant",
|
|
75
|
+
"size",
|
|
76
|
+
"className"
|
|
77
|
+
]);
|
|
78
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
79
|
+
"span",
|
|
80
|
+
__spreadProps(__spreadValues({
|
|
81
|
+
className: (0, import_typed_classname.clsx)(
|
|
82
|
+
"hds-badge",
|
|
83
|
+
`hds-badge--${size}`,
|
|
84
|
+
`hds-badge--${variant}`,
|
|
85
|
+
className
|
|
86
|
+
)
|
|
87
|
+
}, rest), {
|
|
88
|
+
children
|
|
89
|
+
})
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
BaseBadge.displayName = "BaseBadge";
|
|
93
|
+
function Badge(props) {
|
|
94
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
|
|
95
|
+
}
|
|
96
|
+
Badge.displayName = "Badge";
|
|
97
|
+
function DarkBadge(props) {
|
|
98
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "dark" }));
|
|
99
|
+
}
|
|
100
|
+
DarkBadge.displayName = "DarkBadge";
|
|
101
|
+
function WhiteBadge(props) {
|
|
102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "white" }));
|
|
103
|
+
}
|
|
104
|
+
WhiteBadge.displayName = "WhiteBadge";
|
|
105
|
+
function WarningBadge(props) {
|
|
106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "warning" }));
|
|
107
|
+
}
|
|
108
|
+
WarningBadge.displayName = "WarningBadge";
|
|
109
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
110
|
+
0 && (module.exports = {
|
|
111
|
+
Badge,
|
|
112
|
+
DarkBadge,
|
|
113
|
+
WarningBadge,
|
|
114
|
+
WhiteBadge
|
|
115
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import { O as OverridableComponent } from '../utils-BfZsjuFH.mjs';
|
|
3
|
+
|
|
4
|
+
interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
variant?: "light-grey" | "lighter" | "white" | "warning";
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* If `true`, a close button will be shown.
|
|
9
|
+
* Use when you want to control the close button using the BoxCloseButton component.
|
|
10
|
+
*/
|
|
11
|
+
closeable?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Callback fired when the component requests to be closed.
|
|
14
|
+
* If not set, the component will be closed without any user interaction.
|
|
15
|
+
*
|
|
16
|
+
* If set, and the handler returns non-true value, the component will not be closed.
|
|
17
|
+
* Use this if you want to control the closing of the component, using the `closed` prop
|
|
18
|
+
*
|
|
19
|
+
* If set, and the handler returns the true, the component will be closed.
|
|
20
|
+
* Use this with `window.confirm()` to ask the user to confirm closing the component.
|
|
21
|
+
*/
|
|
22
|
+
onClose?: () => boolean | unknown;
|
|
23
|
+
/**
|
|
24
|
+
* If `true`, the box will be closed and hidden from view
|
|
25
|
+
*/
|
|
26
|
+
closed?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Props applied to the close button element.
|
|
29
|
+
*/
|
|
30
|
+
closeButtonProps?: BoxCloseButtonProps;
|
|
31
|
+
}
|
|
32
|
+
declare const Box: OverridableComponent<BoxProps, HTMLDivElement>;
|
|
33
|
+
type BoxCloseButtonProps = Omit<React.HTMLAttributes<HTMLButtonElement>, "children">;
|
|
34
|
+
declare const BoxCloseButton: React$1.ForwardRefExoticComponent<BoxCloseButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
35
|
+
|
|
36
|
+
export { Box, BoxCloseButton, type BoxCloseButtonProps, type BoxProps };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import { O as OverridableComponent } from '../utils-BfZsjuFH.js';
|
|
3
|
+
|
|
4
|
+
interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
variant?: "light-grey" | "lighter" | "white" | "warning";
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* If `true`, a close button will be shown.
|
|
9
|
+
* Use when you want to control the close button using the BoxCloseButton component.
|
|
10
|
+
*/
|
|
11
|
+
closeable?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Callback fired when the component requests to be closed.
|
|
14
|
+
* If not set, the component will be closed without any user interaction.
|
|
15
|
+
*
|
|
16
|
+
* If set, and the handler returns non-true value, the component will not be closed.
|
|
17
|
+
* Use this if you want to control the closing of the component, using the `closed` prop
|
|
18
|
+
*
|
|
19
|
+
* If set, and the handler returns the true, the component will be closed.
|
|
20
|
+
* Use this with `window.confirm()` to ask the user to confirm closing the component.
|
|
21
|
+
*/
|
|
22
|
+
onClose?: () => boolean | unknown;
|
|
23
|
+
/**
|
|
24
|
+
* If `true`, the box will be closed and hidden from view
|
|
25
|
+
*/
|
|
26
|
+
closed?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Props applied to the close button element.
|
|
29
|
+
*/
|
|
30
|
+
closeButtonProps?: BoxCloseButtonProps;
|
|
31
|
+
}
|
|
32
|
+
declare const Box: OverridableComponent<BoxProps, HTMLDivElement>;
|
|
33
|
+
type BoxCloseButtonProps = Omit<React.HTMLAttributes<HTMLButtonElement>, "children">;
|
|
34
|
+
declare const BoxCloseButton: React$1.ForwardRefExoticComponent<BoxCloseButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
35
|
+
|
|
36
|
+
export { Box, BoxCloseButton, type BoxCloseButtonProps, type BoxProps };
|