@postenbring/hedwig-react 0.0.6 → 0.0.9
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.js +3 -4
- package/dist/accordion/accordion-item-content.mjs +1 -1
- package/dist/accordion/accordion-item-trigger.js +26 -13
- package/dist/accordion/accordion-item-trigger.mjs +1 -1
- package/dist/accordion/accordion-item.js +3 -4
- package/dist/accordion/accordion-item.mjs +1 -1
- package/dist/accordion/accordion.js +1 -2
- package/dist/accordion/accordion.mjs +1 -1
- package/dist/accordion/index.js +35 -25
- package/dist/accordion/index.mjs +5 -5
- package/dist/badge/badge.js +10 -4
- package/dist/badge/badge.mjs +1 -1
- package/dist/badge/index.js +12 -6
- package/dist/badge/index.mjs +2 -2
- package/dist/box/box.d.mts +2 -2
- package/dist/box/box.d.ts +2 -2
- package/dist/box/box.js +8 -9
- package/dist/box/box.mjs +1 -1
- package/dist/box/index.js +10 -11
- package/dist/box/index.mjs +2 -2
- package/dist/button/button.d.mts +14 -14
- package/dist/button/button.d.ts +14 -14
- package/dist/button/button.js +59 -38
- package/dist/button/button.mjs +3 -1
- package/dist/button/index.d.mts +2 -2
- package/dist/button/index.d.ts +2 -2
- package/dist/button/index.js +61 -40
- package/dist/button/index.mjs +4 -2
- package/dist/chunk-2QSL2PSS.mjs +63 -0
- package/dist/chunk-5NDZ66M6.mjs +5 -0
- package/dist/chunk-6AW5BEDP.mjs +21 -0
- package/dist/{chunk-B3PZUFG2.mjs → chunk-6XSKLHN6.mjs} +15 -6
- package/dist/chunk-BJANCH4F.mjs +5 -0
- package/dist/{chunk-NMSLCM2K.mjs → chunk-DQ2OO6EW.mjs} +1 -1
- package/dist/chunk-ENRMC5K7.mjs +75 -0
- package/dist/{chunk-IWV4FFE3.mjs → chunk-GMGUONH5.mjs} +2 -3
- package/dist/{chunk-LNYNZ4EG.mjs → chunk-J7U4Z726.mjs} +3 -4
- package/dist/{chunk-KBVDBI2L.mjs → chunk-L7DYK6OS.mjs} +3 -4
- package/dist/{chunk-O3NMR6GE.mjs → chunk-MNSMCSAR.mjs} +11 -5
- package/dist/chunk-N3EFZW7T.mjs +5 -0
- package/dist/{chunk-IOOSUX5O.mjs → chunk-QOVAYDPH.mjs} +2 -2
- package/dist/chunk-R55SMUE7.mjs +5 -0
- package/dist/{chunk-EX4U7YZF.mjs → chunk-RXUPE4MM.mjs} +8 -9
- package/dist/{chunk-IWDN3WGQ.mjs → chunk-STKOYB5H.mjs} +13 -7
- package/dist/chunk-TES7CVGU.mjs +34 -0
- package/dist/chunk-X4D24ZRP.mjs +63 -0
- package/dist/chunk-XJ44O3HY.mjs +58 -0
- package/dist/chunk-Z36ETKOZ.mjs +5 -0
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +235 -155
- package/dist/index.mjs +32 -25
- 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 +1 -1
- package/dist/input/input.d.ts +1 -1
- package/dist/input/input.js +13 -7
- package/dist/input/input.mjs +3 -47
- package/dist/link/index.d.mts +1 -1
- package/dist/link/index.d.ts +1 -1
- package/dist/link/index.js +22 -29
- package/dist/link/index.mjs +2 -2
- package/dist/link/link.d.mts +2 -10
- package/dist/link/link.d.ts +2 -10
- package/dist/link/link.js +20 -27
- package/dist/link/link.mjs +1 -1
- package/dist/list/description-list.d.mts +1 -1
- package/dist/list/description-list.d.ts +1 -1
- package/dist/list/description-list.js +14 -5
- package/dist/list/description-list.mjs +1 -1
- package/dist/list/index.js +28 -13
- package/dist/list/index.mjs +8 -8
- package/dist/list/link-list.js +12 -6
- package/dist/list/link-list.mjs +2 -2
- package/dist/list/list.js +12 -6
- package/dist/list/list.mjs +1 -1
- package/dist/message/index.d.mts +14 -2
- package/dist/message/index.d.ts +14 -2
- package/dist/message/index.js +51 -16
- package/dist/message/index.mjs +10 -5
- package/dist/message/message.d.mts +3 -1
- package/dist/message/message.d.ts +3 -1
- package/dist/message/message.js +42 -14
- package/dist/message/message.mjs +8 -4
- package/package.json +3 -5
- package/dist/chunk-4XWB4ZSR.mjs +0 -6
- package/dist/chunk-7F7QB4D5.mjs +0 -50
- package/dist/chunk-AYGPUYPZ.mjs +0 -5
- package/dist/chunk-CYW3DUD2.mjs +0 -5
- package/dist/chunk-EKFYWUBE.mjs +0 -36
- package/dist/chunk-GSPFHK2Z.mjs +0 -55
- package/dist/chunk-ID5KKZMK.mjs +0 -5
- package/dist/chunk-PCKWBORI.mjs +0 -5
- package/dist/chunk-VZNNGRKM.mjs +0 -5
- package/dist/chunk-X3OAJSS2.mjs +0 -41
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/list/index.tsx
|
|
2
|
-
import "@postenbring/hedwig-
|
|
3
|
-
import "@postenbring/hedwig-
|
|
2
|
+
import "@postenbring/hedwig-css/dist/fonts.css";
|
|
3
|
+
import "@postenbring/hedwig-css/dist/tokens.css";
|
|
4
4
|
import "@postenbring/hedwig-css/dist/base.css";
|
|
5
5
|
import "@postenbring/hedwig-css/dist/description-list.css";
|
|
6
6
|
import "@postenbring/hedwig-css/dist/list.css";
|
|
@@ -6,15 +6,14 @@ import {
|
|
|
6
6
|
|
|
7
7
|
// src/box/box.tsx
|
|
8
8
|
import { forwardRef, useCallback, useState } from "react";
|
|
9
|
-
import { clsx } from "
|
|
10
|
-
import { t } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
9
|
+
import { clsx } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
11
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
11
|
var Box = forwardRef(
|
|
13
12
|
(_a, ref) => {
|
|
14
13
|
var _b = _a, {
|
|
15
14
|
as: Component = "div",
|
|
16
15
|
variant = "light-grey",
|
|
17
|
-
|
|
16
|
+
closeable = false,
|
|
18
17
|
onClose: onCloseProp,
|
|
19
18
|
closed: closedProp,
|
|
20
19
|
closeButtonProps,
|
|
@@ -23,7 +22,7 @@ var Box = forwardRef(
|
|
|
23
22
|
} = _b, rest = __objRest(_b, [
|
|
24
23
|
"as",
|
|
25
24
|
"variant",
|
|
26
|
-
"
|
|
25
|
+
"closeable",
|
|
27
26
|
"onClose",
|
|
28
27
|
"closed",
|
|
29
28
|
"closeButtonProps",
|
|
@@ -46,15 +45,15 @@ var Box = forwardRef(
|
|
|
46
45
|
Component,
|
|
47
46
|
__spreadProps(__spreadValues({
|
|
48
47
|
className: clsx(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{
|
|
48
|
+
"hds-box",
|
|
49
|
+
`hds-box--${variant}`,
|
|
50
|
+
{ "hds-box--closed": closed },
|
|
52
51
|
className
|
|
53
52
|
),
|
|
54
53
|
ref
|
|
55
54
|
}, rest), {
|
|
56
55
|
children: [
|
|
57
|
-
|
|
56
|
+
closeable ? /* @__PURE__ */ jsx(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)) : null,
|
|
58
57
|
children
|
|
59
58
|
]
|
|
60
59
|
})
|
|
@@ -68,7 +67,7 @@ var BoxCloseButton = forwardRef(
|
|
|
68
67
|
return /* @__PURE__ */ jsx(
|
|
69
68
|
"button",
|
|
70
69
|
__spreadValues({
|
|
71
|
-
className: clsx(
|
|
70
|
+
className: clsx("hds-box__close-button", className),
|
|
72
71
|
ref,
|
|
73
72
|
type: "button"
|
|
74
73
|
}, rest)
|
|
@@ -5,27 +5,33 @@ import {
|
|
|
5
5
|
} from "./chunk-FUJQIYOF.mjs";
|
|
6
6
|
|
|
7
7
|
// src/list/list.tsx
|
|
8
|
-
import { clsx } from "
|
|
9
|
-
import { t } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
8
|
+
import { clsx } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
10
9
|
import { jsx } from "react/jsx-runtime";
|
|
11
10
|
function BaseList(_a) {
|
|
12
11
|
var _b = _a, {
|
|
13
12
|
as: ListTag = "ul",
|
|
14
13
|
children,
|
|
15
14
|
listStyle = "inherit",
|
|
16
|
-
size = "medium"
|
|
15
|
+
size = "medium",
|
|
16
|
+
className
|
|
17
17
|
} = _b, rest = __objRest(_b, [
|
|
18
18
|
"as",
|
|
19
19
|
"children",
|
|
20
20
|
"listStyle",
|
|
21
|
-
"size"
|
|
21
|
+
"size",
|
|
22
|
+
"className"
|
|
22
23
|
]);
|
|
23
24
|
return /* @__PURE__ */ jsx(
|
|
24
25
|
ListTag,
|
|
25
26
|
__spreadProps(__spreadValues({
|
|
26
|
-
className: clsx(
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
className: clsx(
|
|
28
|
+
"hds-list",
|
|
29
|
+
`hds-list--${size}`,
|
|
30
|
+
{
|
|
31
|
+
"hds-list--style-hidden": listStyle === "no-bullets"
|
|
32
|
+
},
|
|
33
|
+
className
|
|
34
|
+
)
|
|
29
35
|
}, rest), {
|
|
30
36
|
children
|
|
31
37
|
})
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "./chunk-FUJQIYOF.mjs";
|
|
6
|
+
|
|
7
|
+
// src/link/link.tsx
|
|
8
|
+
import { clsx } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
9
|
+
import { forwardRef } from "react";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var Link = forwardRef(
|
|
12
|
+
(_a, ref) => {
|
|
13
|
+
var _b = _a, { as: Component = "a", children, variant = "underline", size = "medium", className } = _b, rest = __objRest(_b, ["as", "children", "variant", "size", "className"]);
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
Component,
|
|
16
|
+
__spreadProps(__spreadValues({
|
|
17
|
+
className: clsx(
|
|
18
|
+
"hds-link",
|
|
19
|
+
variant !== "underline" && `hds-link--${variant}`,
|
|
20
|
+
size !== "medium" && `hds-link--${size}`,
|
|
21
|
+
className
|
|
22
|
+
),
|
|
23
|
+
ref
|
|
24
|
+
}, rest), {
|
|
25
|
+
children
|
|
26
|
+
})
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
Link.displayName = "Link";
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
Link
|
|
34
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box
|
|
3
|
+
} from "./chunk-RXUPE4MM.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 "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
var Message = forwardRef(
|
|
15
|
+
(_a, ref) => {
|
|
16
|
+
var _b = _a, { children, className, variant = "success", icon, iconClassName } = _b, rest = __objRest(_b, ["children", "className", "variant", "icon", "iconClassName"]);
|
|
17
|
+
return /* @__PURE__ */ jsxs(
|
|
18
|
+
Box,
|
|
19
|
+
__spreadProps(__spreadValues({
|
|
20
|
+
className: clsx(`hds-message`, `hds-message--${variant}`, className),
|
|
21
|
+
ref
|
|
22
|
+
}, rest), {
|
|
23
|
+
children: [
|
|
24
|
+
variant === "neutral" && /* @__PURE__ */ jsx("div", { className: clsx("hds-message--neutral__icon", iconClassName), children: icon }),
|
|
25
|
+
children
|
|
26
|
+
]
|
|
27
|
+
})
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
Message.displayName = "Message";
|
|
32
|
+
var MessageTitle = forwardRef(
|
|
33
|
+
(_a, ref) => {
|
|
34
|
+
var _b = _a, { as: Component = "p", className } = _b, rest = __objRest(_b, ["as", "className"]);
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
Component,
|
|
37
|
+
__spreadValues({
|
|
38
|
+
className: clsx("hds-message__title", className),
|
|
39
|
+
ref
|
|
40
|
+
}, rest)
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
MessageTitle.displayName = "MessageTitle";
|
|
45
|
+
var MessageDescription = forwardRef(
|
|
46
|
+
(_a, ref) => {
|
|
47
|
+
var _b = _a, { as: Component = "p", className } = _b, rest = __objRest(_b, ["as", "className"]);
|
|
48
|
+
return /* @__PURE__ */ jsx(
|
|
49
|
+
Component,
|
|
50
|
+
__spreadValues({
|
|
51
|
+
className: clsx("hds-message__description", className),
|
|
52
|
+
ref
|
|
53
|
+
}, rest)
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
MessageDescription.displayName = "MessageDescription";
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
Message,
|
|
61
|
+
MessageTitle,
|
|
62
|
+
MessageDescription
|
|
63
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "./chunk-FUJQIYOF.mjs";
|
|
6
|
+
|
|
7
|
+
// src/input/input.tsx
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { clsx } from "@postenbring/hedwig-css/typed-classname/index.mjs";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
function Input(_a) {
|
|
12
|
+
var _b = _a, {
|
|
13
|
+
variant = "default",
|
|
14
|
+
errorMessage,
|
|
15
|
+
labelProps,
|
|
16
|
+
label,
|
|
17
|
+
id,
|
|
18
|
+
className
|
|
19
|
+
} = _b, rest = __objRest(_b, [
|
|
20
|
+
"variant",
|
|
21
|
+
"errorMessage",
|
|
22
|
+
"labelProps",
|
|
23
|
+
"label",
|
|
24
|
+
"id",
|
|
25
|
+
"className"
|
|
26
|
+
]);
|
|
27
|
+
const errorMessageId = React.useId();
|
|
28
|
+
const inputId = React.useId();
|
|
29
|
+
return /* @__PURE__ */ jsxs(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: clsx(
|
|
33
|
+
"hds-input",
|
|
34
|
+
{
|
|
35
|
+
[`hds-input--${variant}`]: variant,
|
|
36
|
+
"hds-input--error": errorMessage
|
|
37
|
+
},
|
|
38
|
+
className
|
|
39
|
+
),
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsx("label", __spreadProps(__spreadValues({ className: "hds-input__label" }, labelProps), { htmlFor: id || inputId, children: label })),
|
|
42
|
+
!!errorMessage && /* @__PURE__ */ jsx("span", { className: "hds-input__error-message", id: errorMessageId, children: errorMessage }),
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
"input",
|
|
45
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
46
|
+
"aria-describedby": errorMessageId,
|
|
47
|
+
className: "hds-input__input",
|
|
48
|
+
id: id || inputId
|
|
49
|
+
})
|
|
50
|
+
)
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export {
|
|
57
|
+
Input
|
|
58
|
+
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
export { ButtonProps, PrimaryButton, SecondaryButton } from './button/button.mjs';
|
|
1
|
+
export { BaseButton, 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
4
|
export { DescriptionDetails, DescriptionDetailsProps, default as DescriptionList, DescriptionListProps, DescriptionTerm, DescriptionTermProps } from './list/description-list.mjs';
|
|
5
5
|
export { ListProps, OrderedList, UnorderedList } from './list/list.mjs';
|
|
6
6
|
export { LinkList, LinkListProps } from './list/link-list.mjs';
|
|
7
7
|
export { Box, BoxCloseButton, BoxCloseButtonProps, BoxProps } from './box/box.mjs';
|
|
8
|
-
export { Message
|
|
8
|
+
export { Message } from './message/index.mjs';
|
|
9
9
|
export { Accordion, AccordionProps } from './accordion/accordion.mjs';
|
|
10
10
|
export { AccordionItem, AccordionItemChildrenType, AccordionItemProps } from './accordion/accordion-item.mjs';
|
|
11
11
|
export { AccordionTrigger, AccordionTriggerProps } from './accordion/accordion-item-trigger.mjs';
|
|
12
12
|
export { AccordionContent, AccordionContentProps } from './accordion/accordion-item-content.mjs';
|
|
13
|
-
|
|
14
|
-
import 'react';
|
|
13
|
+
export { MessageDescription, MessageTitle } from './message/message.mjs';
|
|
15
14
|
import './utils-BfZsjuFH.mjs';
|
|
15
|
+
import 'react';
|
|
16
|
+
import 'react/jsx-runtime';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
export { ButtonProps, PrimaryButton, SecondaryButton } from './button/button.js';
|
|
1
|
+
export { BaseButton, 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
4
|
export { DescriptionDetails, DescriptionDetailsProps, default as DescriptionList, DescriptionListProps, DescriptionTerm, DescriptionTermProps } from './list/description-list.js';
|
|
5
5
|
export { ListProps, OrderedList, UnorderedList } from './list/list.js';
|
|
6
6
|
export { LinkList, LinkListProps } from './list/link-list.js';
|
|
7
7
|
export { Box, BoxCloseButton, BoxCloseButtonProps, BoxProps } from './box/box.js';
|
|
8
|
-
export { Message
|
|
8
|
+
export { Message } from './message/index.js';
|
|
9
9
|
export { Accordion, AccordionProps } from './accordion/accordion.js';
|
|
10
10
|
export { AccordionItem, AccordionItemChildrenType, AccordionItemProps } from './accordion/accordion-item.js';
|
|
11
11
|
export { AccordionTrigger, AccordionTriggerProps } from './accordion/accordion-item-trigger.js';
|
|
12
12
|
export { AccordionContent, AccordionContentProps } from './accordion/accordion-item-content.js';
|
|
13
|
-
|
|
14
|
-
import 'react';
|
|
13
|
+
export { MessageDescription, MessageTitle } from './message/message.js';
|
|
15
14
|
import './utils-BfZsjuFH.js';
|
|
15
|
+
import 'react';
|
|
16
|
+
import 'react/jsx-runtime';
|