@postenbring/hedwig-react 0.0.3 → 0.0.5
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 +98 -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 +108 -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 +116 -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 +93 -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 +217 -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 +103 -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 +109 -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 +131 -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 +137 -0
- package/dist/box/index.mjs +10 -0
- package/dist/button/button.d.mts +37 -0
- package/dist/button/button.d.ts +37 -0
- package/dist/button/button.js +103 -0
- package/dist/button/button.mjs +9 -0
- package/dist/button/index.d.mts +3 -37
- package/dist/button/index.d.ts +3 -37
- package/dist/button/index.js +9 -21
- package/dist/button/index.mjs +3 -1
- package/dist/chunk-2V6SWZ5G.mjs +16 -0
- package/dist/chunk-4XWB4ZSR.mjs +6 -0
- package/dist/chunk-7F7QB4D5.mjs +50 -0
- package/dist/chunk-AYGPUYPZ.mjs +5 -0
- package/dist/chunk-B3PZUFG2.mjs +40 -0
- package/dist/chunk-CYW3DUD2.mjs +5 -0
- package/dist/chunk-EKFYWUBE.mjs +36 -0
- package/dist/chunk-EX4U7YZF.mjs +83 -0
- package/dist/chunk-FUJQIYOF.mjs +37 -0
- package/dist/chunk-GSPFHK2Z.mjs +55 -0
- package/dist/chunk-ID5KKZMK.mjs +5 -0
- package/dist/chunk-IOOSUX5O.mjs +6 -0
- package/dist/chunk-IWDN3WGQ.mjs +47 -0
- package/dist/chunk-IWV4FFE3.mjs +35 -0
- package/dist/chunk-KBVDBI2L.mjs +59 -0
- package/dist/chunk-LNYNZ4EG.mjs +40 -0
- package/dist/chunk-NMSLCM2K.mjs +18 -0
- package/dist/chunk-O3NMR6GE.mjs +53 -0
- package/dist/chunk-PCKWBORI.mjs +5 -0
- package/dist/chunk-VZNNGRKM.mjs +5 -0
- package/dist/chunk-X3OAJSS2.mjs +41 -0
- package/dist/index.d.mts +15 -27
- package/dist/index.d.ts +15 -27
- package/dist/index.js +443 -29
- package/dist/index.mjs +69 -43
- package/dist/input/input.d.mts +13 -0
- package/dist/input/input.d.ts +13 -0
- package/dist/input/input.js +109 -0
- package/dist/input/input.mjs +51 -0
- package/dist/link/index.d.mts +3 -0
- package/dist/link/index.d.ts +3 -0
- package/dist/link/index.js +94 -0
- package/dist/link/index.mjs +8 -0
- package/dist/link/link.d.mts +26 -0
- package/dist/link/link.d.ts +26 -0
- package/dist/link/link.js +88 -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 +89 -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 +144 -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 +102 -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 +95 -0
- package/dist/list/list.mjs +9 -0
- package/dist/message/index.d.mts +4 -0
- package/dist/message/index.d.ts +4 -0
- package/dist/message/index.js +162 -0
- package/dist/message/index.mjs +9 -0
- package/dist/message/message.d.mts +16 -0
- package/dist/message/message.d.ts +16 -0
- package/dist/message/message.js +155 -0
- package/dist/message/message.mjs +8 -0
- package/dist/utils-BfZsjuFH.d.mts +17 -0
- package/dist/utils-BfZsjuFH.d.ts +17 -0
- package/package.json +17 -17
- package/dist/chunk-ZPSTPWVB.mjs +0 -103
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AccordionItemContext
|
|
3
|
+
} from "./chunk-2V6SWZ5G.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__objRest,
|
|
6
|
+
__spreadProps,
|
|
7
|
+
__spreadValues
|
|
8
|
+
} from "./chunk-FUJQIYOF.mjs";
|
|
9
|
+
|
|
10
|
+
// src/accordion/accordion-item-trigger.tsx
|
|
11
|
+
import { forwardRef, useContext } from "react";
|
|
12
|
+
import { t } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
13
|
+
import { clsx } from "clsx";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
function FaArrowDownButNotReally() {
|
|
16
|
+
return /* @__PURE__ */ jsx("span", { children: "v " });
|
|
17
|
+
}
|
|
18
|
+
function FaArrowUpButNotReally() {
|
|
19
|
+
return /* @__PURE__ */ jsx("span", { children: "^ " });
|
|
20
|
+
}
|
|
21
|
+
var AccordionTrigger = forwardRef((_a, ref) => {
|
|
22
|
+
var _b = _a, { as: Component = "button", children, className, onClick } = _b, rest = __objRest(_b, ["as", "children", "className", "onClick"]);
|
|
23
|
+
const itemContext = useContext(AccordionItemContext);
|
|
24
|
+
if (itemContext === null) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const expandOrCollapse = (e) => {
|
|
28
|
+
itemContext.setOpen(!itemContext.open);
|
|
29
|
+
onClick && onClick(e);
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
Component,
|
|
33
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
34
|
+
"aria-expanded": itemContext.open,
|
|
35
|
+
className: clsx(t("hds-accordion-item-trigger"), className),
|
|
36
|
+
onClick: expandOrCollapse,
|
|
37
|
+
ref,
|
|
38
|
+
type: "button",
|
|
39
|
+
children: /* @__PURE__ */ jsxs("span", { children: [
|
|
40
|
+
/* @__PURE__ */ jsx("div", { className: clsx(t("hds-accordion-item-trigger--icon")), children: itemContext.open ? /* @__PURE__ */ jsx(FaArrowUpButNotReally, {}) : /* @__PURE__ */ jsx(FaArrowDownButNotReally, {}) }),
|
|
41
|
+
children
|
|
42
|
+
] })
|
|
43
|
+
})
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
AccordionTrigger.displayName = "AccordionTrigger";
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
AccordionTrigger
|
|
50
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "./chunk-FUJQIYOF.mjs";
|
|
6
|
+
|
|
7
|
+
// src/list/description-list.tsx
|
|
8
|
+
import { clsx } from "clsx";
|
|
9
|
+
import { t } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
function DescriptionDetails(_a) {
|
|
12
|
+
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
13
|
+
return /* @__PURE__ */ jsx("dd", __spreadProps(__spreadValues({}, rest), { children }));
|
|
14
|
+
}
|
|
15
|
+
function DescriptionTerm(_a) {
|
|
16
|
+
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
17
|
+
return /* @__PURE__ */ jsx("dt", __spreadProps(__spreadValues({}, rest), { children }));
|
|
18
|
+
}
|
|
19
|
+
function DescriptionList(_a) {
|
|
20
|
+
var _b = _a, { variant = "vertical" } = _b, rest = __objRest(_b, ["variant"]);
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
"dl",
|
|
23
|
+
__spreadValues({
|
|
24
|
+
className: clsx(t("hds-description-list"), {
|
|
25
|
+
[t("hds-description-list--horizontal")]: variant === "horizontal"
|
|
26
|
+
})
|
|
27
|
+
}, rest)
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
DescriptionList.displayName = "DescriptionList";
|
|
31
|
+
DescriptionTerm.displayName = "DescriptionTerm";
|
|
32
|
+
DescriptionDetails.displayName = "DescriptionDetails";
|
|
33
|
+
var description_list_default = DescriptionList;
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
DescriptionDetails,
|
|
37
|
+
DescriptionTerm,
|
|
38
|
+
DescriptionList,
|
|
39
|
+
description_list_default
|
|
40
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box
|
|
3
|
+
} from "./chunk-EX4U7YZF.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__objRest,
|
|
6
|
+
__spreadProps,
|
|
7
|
+
__spreadValues
|
|
8
|
+
} from "./chunk-FUJQIYOF.mjs";
|
|
9
|
+
|
|
10
|
+
// src/message/message.tsx
|
|
11
|
+
import { forwardRef } from "react";
|
|
12
|
+
import { clsx } from "clsx";
|
|
13
|
+
import { t } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var Message = forwardRef(
|
|
16
|
+
(_a, ref) => {
|
|
17
|
+
var _b = _a, { children, className, variant = "success", icon, iconClassName } = _b, rest = __objRest(_b, ["children", "className", "variant", "icon", "iconClassName"]);
|
|
18
|
+
return /* @__PURE__ */ jsxs(
|
|
19
|
+
Box,
|
|
20
|
+
__spreadProps(__spreadValues({
|
|
21
|
+
className: clsx(t(`hds-message`), t(`hds-message--${variant}`), className),
|
|
22
|
+
ref
|
|
23
|
+
}, rest), {
|
|
24
|
+
children: [
|
|
25
|
+
variant === "neutral" && /* @__PURE__ */ jsx("div", { className: clsx(t("hds-message--neutral__icon"), iconClassName), children: icon }),
|
|
26
|
+
children
|
|
27
|
+
]
|
|
28
|
+
})
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
Message.displayName = "Message";
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
Message
|
|
36
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "./chunk-FUJQIYOF.mjs";
|
|
6
|
+
|
|
7
|
+
// src/box/box.tsx
|
|
8
|
+
import { forwardRef, useCallback, useState } from "react";
|
|
9
|
+
import { clsx } from "clsx";
|
|
10
|
+
import { t } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
var Box = forwardRef(
|
|
13
|
+
(_a, ref) => {
|
|
14
|
+
var _b = _a, {
|
|
15
|
+
as: Component = "div",
|
|
16
|
+
variant = "light-grey",
|
|
17
|
+
hideCloseButton,
|
|
18
|
+
onClose: onCloseProp,
|
|
19
|
+
closed: closedProp,
|
|
20
|
+
closeButtonProps,
|
|
21
|
+
children,
|
|
22
|
+
className
|
|
23
|
+
} = _b, rest = __objRest(_b, [
|
|
24
|
+
"as",
|
|
25
|
+
"variant",
|
|
26
|
+
"hideCloseButton",
|
|
27
|
+
"onClose",
|
|
28
|
+
"closed",
|
|
29
|
+
"closeButtonProps",
|
|
30
|
+
"children",
|
|
31
|
+
"className"
|
|
32
|
+
]);
|
|
33
|
+
const [closedState, setClosedState] = useState(false);
|
|
34
|
+
const onClose = useCallback(() => {
|
|
35
|
+
if (onCloseProp) {
|
|
36
|
+
const result = onCloseProp();
|
|
37
|
+
if (result === true) {
|
|
38
|
+
setClosedState(true);
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
setClosedState(true);
|
|
42
|
+
}
|
|
43
|
+
}, []);
|
|
44
|
+
const closed = closedProp != null ? closedProp : closedState;
|
|
45
|
+
return /* @__PURE__ */ jsxs(
|
|
46
|
+
Component,
|
|
47
|
+
__spreadProps(__spreadValues({
|
|
48
|
+
className: clsx(
|
|
49
|
+
t("hds-box"),
|
|
50
|
+
t(`hds-box--${variant}`),
|
|
51
|
+
{ [t("hds-box--closed")]: closed },
|
|
52
|
+
className
|
|
53
|
+
),
|
|
54
|
+
ref
|
|
55
|
+
}, rest), {
|
|
56
|
+
children: [
|
|
57
|
+
!hideCloseButton && /* @__PURE__ */ jsx(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)),
|
|
58
|
+
children
|
|
59
|
+
]
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
Box.displayName = "Box";
|
|
65
|
+
var BoxCloseButton = forwardRef(
|
|
66
|
+
(_a, ref) => {
|
|
67
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
68
|
+
return /* @__PURE__ */ jsx(
|
|
69
|
+
"button",
|
|
70
|
+
__spreadValues({
|
|
71
|
+
className: clsx(t("hds-box__close-button"), className),
|
|
72
|
+
ref,
|
|
73
|
+
type: "button"
|
|
74
|
+
}, rest)
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
BoxCloseButton.displayName = "BoxCloseButton";
|
|
79
|
+
|
|
80
|
+
export {
|
|
81
|
+
Box,
|
|
82
|
+
BoxCloseButton
|
|
83
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
__spreadValues,
|
|
35
|
+
__spreadProps,
|
|
36
|
+
__objRest
|
|
37
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "./chunk-FUJQIYOF.mjs";
|
|
6
|
+
|
|
7
|
+
// src/button/button.tsx
|
|
8
|
+
import { clsx } from "clsx";
|
|
9
|
+
import { t } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
function BaseButton(_a) {
|
|
12
|
+
var _b = _a, {
|
|
13
|
+
children,
|
|
14
|
+
variant,
|
|
15
|
+
size = "medium",
|
|
16
|
+
fullWidth = false,
|
|
17
|
+
fill = "contained",
|
|
18
|
+
buttonRef
|
|
19
|
+
} = _b, rest = __objRest(_b, [
|
|
20
|
+
"children",
|
|
21
|
+
"variant",
|
|
22
|
+
"size",
|
|
23
|
+
"fullWidth",
|
|
24
|
+
"fill",
|
|
25
|
+
"buttonRef"
|
|
26
|
+
]);
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
|
+
"button",
|
|
29
|
+
__spreadProps(__spreadValues({
|
|
30
|
+
className: clsx(t("hds-button"), t(`hds-button--${size}`), {
|
|
31
|
+
[t(`hds-button--${variant}`)]: fill === "contained",
|
|
32
|
+
[t(`hds-button--outline-${variant}`)]: fill === "outlined",
|
|
33
|
+
[t("hds-button--full")]: fullWidth === true,
|
|
34
|
+
[t("hds-button--mobile-full")]: fullWidth === "mobile"
|
|
35
|
+
}),
|
|
36
|
+
ref: buttonRef
|
|
37
|
+
}, rest), {
|
|
38
|
+
children
|
|
39
|
+
})
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
BaseButton.displayName = "BaseButton";
|
|
43
|
+
function PrimaryButton(props) {
|
|
44
|
+
return /* @__PURE__ */ jsx(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
|
|
45
|
+
}
|
|
46
|
+
PrimaryButton.displayName = "PrimaryButton";
|
|
47
|
+
function SecondaryButton(props) {
|
|
48
|
+
return /* @__PURE__ */ jsx(BaseButton, __spreadProps(__spreadValues({}, props), { variant: "secondary" }));
|
|
49
|
+
}
|
|
50
|
+
SecondaryButton.displayName = "SecondaryButton";
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
PrimaryButton,
|
|
54
|
+
SecondaryButton
|
|
55
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// src/list/index.tsx
|
|
2
|
+
import "@postenbring/hedwig-tokens/tokens-output/css/fonts.css";
|
|
3
|
+
import "@postenbring/hedwig-tokens/tokens-output/css/tokens.css";
|
|
4
|
+
import "@postenbring/hedwig-css/dist/base.css";
|
|
5
|
+
import "@postenbring/hedwig-css/dist/description-list.css";
|
|
6
|
+
import "@postenbring/hedwig-css/dist/list.css";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "./chunk-FUJQIYOF.mjs";
|
|
6
|
+
|
|
7
|
+
// src/list/list.tsx
|
|
8
|
+
import { clsx } from "clsx";
|
|
9
|
+
import { t } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
function BaseList(_a) {
|
|
12
|
+
var _b = _a, {
|
|
13
|
+
as: ListTag = "ul",
|
|
14
|
+
children,
|
|
15
|
+
listStyle = "inherit",
|
|
16
|
+
size = "medium"
|
|
17
|
+
} = _b, rest = __objRest(_b, [
|
|
18
|
+
"as",
|
|
19
|
+
"children",
|
|
20
|
+
"listStyle",
|
|
21
|
+
"size"
|
|
22
|
+
]);
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
ListTag,
|
|
25
|
+
__spreadProps(__spreadValues({
|
|
26
|
+
className: clsx(t("hds-list"), t(`hds-list--${size}`), {
|
|
27
|
+
[t(`hds-list--style-hidden`)]: listStyle === "no-bullets"
|
|
28
|
+
})
|
|
29
|
+
}, rest), {
|
|
30
|
+
children
|
|
31
|
+
})
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function UnorderedList(props) {
|
|
35
|
+
return /* @__PURE__ */ jsx(BaseList, __spreadProps(__spreadValues({ as: "ul" }, props), { children: props.children }));
|
|
36
|
+
}
|
|
37
|
+
function OrderedList(props) {
|
|
38
|
+
return /* @__PURE__ */ jsx(BaseList, __spreadProps(__spreadValues({ as: "ol" }, props), { children: props.children }));
|
|
39
|
+
}
|
|
40
|
+
BaseList.displayName = "BaseList";
|
|
41
|
+
OrderedList.displayName = "UnorderedList";
|
|
42
|
+
UnorderedList.displayName = "UnorderedList";
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
UnorderedList,
|
|
46
|
+
OrderedList
|
|
47
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AccordionContext
|
|
3
|
+
} from "./chunk-2V6SWZ5G.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__objRest,
|
|
6
|
+
__spreadProps,
|
|
7
|
+
__spreadValues
|
|
8
|
+
} from "./chunk-FUJQIYOF.mjs";
|
|
9
|
+
|
|
10
|
+
// src/accordion/accordion.tsx
|
|
11
|
+
import { forwardRef, useState } from "react";
|
|
12
|
+
import { clsx } from "clsx";
|
|
13
|
+
import { t } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
14
|
+
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
var Accordion = forwardRef(
|
|
16
|
+
(_a, ref) => {
|
|
17
|
+
var _b = _a, { as: Component = "div", children, className, variant = "multiple" } = _b, rest = __objRest(_b, ["as", "children", "className", "variant"]);
|
|
18
|
+
const [openItems, setOpenItems] = useState([]);
|
|
19
|
+
const toggleOpenItem = (itemId) => {
|
|
20
|
+
if (variant === "single") {
|
|
21
|
+
setOpenItems([itemId]);
|
|
22
|
+
} else {
|
|
23
|
+
setOpenItems(
|
|
24
|
+
openItems.includes(itemId) ? openItems.filter((id) => id !== itemId) : [...openItems, itemId]
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ jsx(AccordionContext.Provider, { value: { variant, openItems, toggleOpenItem, mounted: true }, children: /* @__PURE__ */ jsx(Component, __spreadProps(__spreadValues({}, rest), { className: clsx(t("hds-accordion"), className), ref, children })) });
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
Accordion.displayName = "Accordion";
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
Accordion
|
|
35
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AccordionContext,
|
|
3
|
+
AccordionItemContext
|
|
4
|
+
} from "./chunk-2V6SWZ5G.mjs";
|
|
5
|
+
import {
|
|
6
|
+
__objRest,
|
|
7
|
+
__spreadProps,
|
|
8
|
+
__spreadValues
|
|
9
|
+
} from "./chunk-FUJQIYOF.mjs";
|
|
10
|
+
|
|
11
|
+
// src/accordion/accordion-item.tsx
|
|
12
|
+
import { forwardRef, useContext, useEffect, useId, useState } from "react";
|
|
13
|
+
import { clsx } from "clsx";
|
|
14
|
+
import { t } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
var AccordionItem = forwardRef(
|
|
17
|
+
(_a, ref) => {
|
|
18
|
+
var _b = _a, { as: Component = "div", children, className } = _b, rest = __objRest(_b, ["as", "children", "className"]);
|
|
19
|
+
const context = useContext(AccordionContext);
|
|
20
|
+
const [open, setOpen] = useState(false);
|
|
21
|
+
const accordionItemId = useId();
|
|
22
|
+
const handleOpen = () => {
|
|
23
|
+
setOpen(!open);
|
|
24
|
+
if (context.variant === "single") {
|
|
25
|
+
context.toggleOpenItem(accordionItemId);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
if (!context.mounted) {
|
|
29
|
+
throw new Error("Context required. Did you use <AccordionItem/> outside of <Accordion/>?");
|
|
30
|
+
}
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (context.variant === "multiple") {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (open && !context.openItems.includes(accordionItemId)) {
|
|
36
|
+
setOpen(false);
|
|
37
|
+
}
|
|
38
|
+
}, [context.openItems]);
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
Component,
|
|
41
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
42
|
+
className: clsx(
|
|
43
|
+
t("hds-accordion-item"),
|
|
44
|
+
{
|
|
45
|
+
[t(`hds-accordion-item__expanded`)]: open
|
|
46
|
+
},
|
|
47
|
+
className
|
|
48
|
+
),
|
|
49
|
+
ref,
|
|
50
|
+
children: /* @__PURE__ */ jsx(AccordionItemContext.Provider, { value: { open, setOpen: handleOpen }, children })
|
|
51
|
+
})
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
AccordionItem.displayName = "AccordionItem";
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
AccordionItem
|
|
59
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AccordionItemContext
|
|
3
|
+
} from "./chunk-2V6SWZ5G.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__objRest,
|
|
6
|
+
__spreadProps,
|
|
7
|
+
__spreadValues
|
|
8
|
+
} from "./chunk-FUJQIYOF.mjs";
|
|
9
|
+
|
|
10
|
+
// src/accordion/accordion-item-content.tsx
|
|
11
|
+
import { forwardRef, useContext } from "react";
|
|
12
|
+
import { clsx } from "clsx";
|
|
13
|
+
import { t } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
14
|
+
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
var AccordionContent = forwardRef((_a, ref) => {
|
|
16
|
+
var _b = _a, { as: Component = "div", children, className } = _b, rest = __objRest(_b, ["as", "children", "className"]);
|
|
17
|
+
const context = useContext(AccordionItemContext);
|
|
18
|
+
if (context === null) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
Component,
|
|
23
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
24
|
+
className: clsx(
|
|
25
|
+
t("hds-accordion-item-content"),
|
|
26
|
+
{
|
|
27
|
+
[t(`hds-accordion-item-content--closed`)]: !context.open
|
|
28
|
+
},
|
|
29
|
+
className
|
|
30
|
+
),
|
|
31
|
+
ref,
|
|
32
|
+
children
|
|
33
|
+
})
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
AccordionContent.displayName = "AccordionContent";
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
AccordionContent
|
|
40
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
UnorderedList
|
|
3
|
+
} from "./chunk-IWDN3WGQ.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__spreadProps,
|
|
6
|
+
__spreadValues
|
|
7
|
+
} from "./chunk-FUJQIYOF.mjs";
|
|
8
|
+
|
|
9
|
+
// src/list/link-list.tsx
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
function LinkList(props) {
|
|
12
|
+
return /* @__PURE__ */ jsx(UnorderedList, __spreadProps(__spreadValues({ listStyle: "no-bullets" }, props), { children: props.children }));
|
|
13
|
+
}
|
|
14
|
+
LinkList.displayName = "LinkList";
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
LinkList
|
|
18
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "./chunk-FUJQIYOF.mjs";
|
|
6
|
+
|
|
7
|
+
// src/badge/badge.tsx
|
|
8
|
+
import { clsx } from "clsx";
|
|
9
|
+
import { t } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
function BaseBadge(_a) {
|
|
12
|
+
var _b = _a, {
|
|
13
|
+
children,
|
|
14
|
+
variant,
|
|
15
|
+
size = "small"
|
|
16
|
+
} = _b, rest = __objRest(_b, [
|
|
17
|
+
"children",
|
|
18
|
+
"variant",
|
|
19
|
+
"size"
|
|
20
|
+
]);
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
"span",
|
|
23
|
+
__spreadProps(__spreadValues({
|
|
24
|
+
className: clsx(t("hds-badge"), t(`hds-badge--${size}`), t(`hds-badge--${variant}`))
|
|
25
|
+
}, rest), {
|
|
26
|
+
children
|
|
27
|
+
})
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
BaseBadge.displayName = "BaseBadge";
|
|
31
|
+
function Badge(props) {
|
|
32
|
+
return /* @__PURE__ */ jsx(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "primary" }));
|
|
33
|
+
}
|
|
34
|
+
Badge.displayName = "Badge";
|
|
35
|
+
function DarkBadge(props) {
|
|
36
|
+
return /* @__PURE__ */ jsx(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "dark" }));
|
|
37
|
+
}
|
|
38
|
+
DarkBadge.displayName = "DarkBadge";
|
|
39
|
+
function WhiteBadge(props) {
|
|
40
|
+
return /* @__PURE__ */ jsx(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "white" }));
|
|
41
|
+
}
|
|
42
|
+
WhiteBadge.displayName = "WhiteBadge";
|
|
43
|
+
function WarningBadge(props) {
|
|
44
|
+
return /* @__PURE__ */ jsx(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "warning" }));
|
|
45
|
+
}
|
|
46
|
+
WarningBadge.displayName = "WarningBadge";
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
Badge,
|
|
50
|
+
DarkBadge,
|
|
51
|
+
WhiteBadge,
|
|
52
|
+
WarningBadge
|
|
53
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "./chunk-FUJQIYOF.mjs";
|
|
6
|
+
|
|
7
|
+
// src/link/link.tsx
|
|
8
|
+
import { clsx } from "clsx";
|
|
9
|
+
import { t } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
function Link(_a) {
|
|
12
|
+
var _b = _a, {
|
|
13
|
+
children,
|
|
14
|
+
variant = "underline",
|
|
15
|
+
size = "medium",
|
|
16
|
+
anchorRef
|
|
17
|
+
} = _b, rest = __objRest(_b, [
|
|
18
|
+
"children",
|
|
19
|
+
"variant",
|
|
20
|
+
"size",
|
|
21
|
+
"anchorRef"
|
|
22
|
+
]);
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
"a",
|
|
25
|
+
__spreadProps(__spreadValues({
|
|
26
|
+
className: clsx(
|
|
27
|
+
t("hds-link"),
|
|
28
|
+
variant !== "underline" && t(`hds-link--${variant}`),
|
|
29
|
+
size !== "medium" && t(`hds-link--${size}`)
|
|
30
|
+
),
|
|
31
|
+
ref: anchorRef
|
|
32
|
+
}, rest), {
|
|
33
|
+
children
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
Link.displayName = "Link";
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
Link
|
|
41
|
+
};
|