@postenbring/hedwig-react 0.0.4 → 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 +2 -2
- package/dist/badge/badge.d.ts +2 -2
- package/dist/badge/badge.js +8 -14
- package/dist/badge/badge.mjs +2 -2
- package/dist/badge/index.js +10 -15
- package/dist/badge/index.mjs +3 -3
- 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 +2 -2
- package/dist/button/button.d.ts +2 -2
- package/dist/button/button.js +0 -13
- package/dist/button/button.mjs +2 -2
- package/dist/button/index.js +2 -14
- package/dist/button/index.mjs +3 -3
- package/dist/chunk-2V6SWZ5G.mjs +16 -0
- package/dist/chunk-4XWB4ZSR.mjs +6 -0
- package/dist/chunk-7F7QB4D5.mjs +50 -0
- package/dist/{chunk-NSNVKFU3.mjs → chunk-AYGPUYPZ.mjs} +2 -1
- package/dist/chunk-B3PZUFG2.mjs +40 -0
- package/dist/{chunk-H5SSXV32.mjs → chunk-CYW3DUD2.mjs} +2 -1
- package/dist/chunk-EKFYWUBE.mjs +36 -0
- package/dist/chunk-EX4U7YZF.mjs +83 -0
- package/dist/{chunk-BTCTQCPO.mjs → chunk-FUJQIYOF.mjs} +1 -12
- package/dist/{chunk-SF42ETS4.mjs → chunk-GSPFHK2Z.mjs} +2 -4
- 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-YH2NWXPK.mjs → chunk-O3NMR6GE.mjs} +10 -5
- package/dist/chunk-PCKWBORI.mjs +5 -0
- package/dist/{chunk-AHYBSRCR.mjs → chunk-VZNNGRKM.mjs} +2 -1
- package/dist/{chunk-7FQ4XFS7.mjs → chunk-X3OAJSS2.mjs} +2 -4
- package/dist/index.d.mts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +395 -16
- package/dist/index.mjs +58 -9
- 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.js +2 -14
- package/dist/link/index.mjs +3 -3
- package/dist/link/link.d.mts +2 -2
- package/dist/link/link.d.ts +2 -2
- package/dist/link/link.js +0 -13
- package/dist/link/link.mjs +2 -2
- 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
|
@@ -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
|
+
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__objRest,
|
|
3
3
|
__spreadProps,
|
|
4
|
-
__spreadValues
|
|
5
|
-
|
|
6
|
-
} from "./chunk-BTCTQCPO.mjs";
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "./chunk-FUJQIYOF.mjs";
|
|
7
6
|
|
|
8
7
|
// src/badge/badge.tsx
|
|
9
8
|
import { clsx } from "clsx";
|
|
@@ -19,8 +18,14 @@ function BaseBadge(_a) {
|
|
|
19
18
|
"variant",
|
|
20
19
|
"size"
|
|
21
20
|
]);
|
|
22
|
-
|
|
23
|
-
|
|
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
|
+
);
|
|
24
29
|
}
|
|
25
30
|
BaseBadge.displayName = "BaseBadge";
|
|
26
31
|
function Badge(props) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// src/button/index.tsx
|
|
2
|
+
import "@postenbring/hedwig-tokens/tokens-output/css/fonts.css";
|
|
2
3
|
import "@postenbring/hedwig-tokens/tokens-output/css/tokens.css";
|
|
3
4
|
import "@postenbring/hedwig-css/dist/base.css";
|
|
4
|
-
import "@postenbring/hedwig-css/dist/button
|
|
5
|
+
import "@postenbring/hedwig-css/dist/button.css";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__objRest,
|
|
3
3
|
__spreadProps,
|
|
4
|
-
__spreadValues
|
|
5
|
-
|
|
6
|
-
} from "./chunk-BTCTQCPO.mjs";
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "./chunk-FUJQIYOF.mjs";
|
|
7
6
|
|
|
8
7
|
// src/link/link.tsx
|
|
9
8
|
import { clsx } from "clsx";
|
|
@@ -21,7 +20,6 @@ function Link(_a) {
|
|
|
21
20
|
"size",
|
|
22
21
|
"anchorRef"
|
|
23
22
|
]);
|
|
24
|
-
warnForStyleOverrides(rest);
|
|
25
23
|
return /* @__PURE__ */ jsx(
|
|
26
24
|
"a",
|
|
27
25
|
__spreadProps(__spreadValues({
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
export { ButtonProps, PrimaryButton, SecondaryButton } from './button/button.mjs';
|
|
2
2
|
export { Link, LinkProps } from './link/link.mjs';
|
|
3
3
|
export { Badge, BadgeProps, DarkBadge, WarningBadge, WhiteBadge } from './badge/badge.mjs';
|
|
4
|
+
export { DescriptionDetails, DescriptionDetailsProps, default as DescriptionList, DescriptionListProps, DescriptionTerm, DescriptionTermProps } from './list/description-list.mjs';
|
|
5
|
+
export { ListProps, OrderedList, UnorderedList } from './list/list.mjs';
|
|
6
|
+
export { LinkList, LinkListProps } from './list/link-list.mjs';
|
|
7
|
+
export { Box, BoxCloseButton, BoxCloseButtonProps, BoxProps } from './box/box.mjs';
|
|
8
|
+
export { Message, MessageProps } from './message/message.mjs';
|
|
9
|
+
export { Accordion, AccordionProps } from './accordion/accordion.mjs';
|
|
10
|
+
export { AccordionItem, AccordionItemChildrenType, AccordionItemProps } from './accordion/accordion-item.mjs';
|
|
11
|
+
export { AccordionTrigger, AccordionTriggerProps } from './accordion/accordion-item-trigger.mjs';
|
|
12
|
+
export { AccordionContent, AccordionContentProps } from './accordion/accordion-item-content.mjs';
|
|
4
13
|
import 'react/jsx-runtime';
|
|
5
14
|
import 'react';
|
|
15
|
+
import './utils-BfZsjuFH.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
export { ButtonProps, PrimaryButton, SecondaryButton } from './button/button.js';
|
|
2
2
|
export { Link, LinkProps } from './link/link.js';
|
|
3
3
|
export { Badge, BadgeProps, DarkBadge, WarningBadge, WhiteBadge } from './badge/badge.js';
|
|
4
|
+
export { DescriptionDetails, DescriptionDetailsProps, default as DescriptionList, DescriptionListProps, DescriptionTerm, DescriptionTermProps } from './list/description-list.js';
|
|
5
|
+
export { ListProps, OrderedList, UnorderedList } from './list/list.js';
|
|
6
|
+
export { LinkList, LinkListProps } from './list/link-list.js';
|
|
7
|
+
export { Box, BoxCloseButton, BoxCloseButtonProps, BoxProps } from './box/box.js';
|
|
8
|
+
export { Message, MessageProps } from './message/message.js';
|
|
9
|
+
export { Accordion, AccordionProps } from './accordion/accordion.js';
|
|
10
|
+
export { AccordionItem, AccordionItemChildrenType, AccordionItemProps } from './accordion/accordion-item.js';
|
|
11
|
+
export { AccordionTrigger, AccordionTriggerProps } from './accordion/accordion-item-trigger.js';
|
|
12
|
+
export { AccordionContent, AccordionContentProps } from './accordion/accordion-item-content.js';
|
|
4
13
|
import 'react/jsx-runtime';
|
|
5
14
|
import 'react';
|
|
15
|
+
import './utils-BfZsjuFH.js';
|