@odx/websites-react 1.1.76 → 1.1.77
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/components/layout/documentList/DocumentListItem.d.ts +7 -3
- package/dist/components/layout/documentList/DocumentListItem.d.ts.map +1 -1
- package/dist/components/layout/documentList/DocumentListItem.js +14 -6
- package/dist/components/layout/documentList/DocumentListItem.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { LinkComponent } from '../../../utils';
|
|
3
|
-
import { HeadlineProps } from '../../typography/headline';
|
|
4
3
|
import { LinkProps } from '../../actions/link';
|
|
4
|
+
import { HeadlineProps } from '../../typography/headline';
|
|
5
5
|
export interface DocumentListItemHeadlineProps extends Omit<HeadlineProps, 'headingLevel'> {
|
|
6
6
|
headline?: string;
|
|
7
7
|
tag?: React.ReactNode;
|
|
@@ -10,10 +10,13 @@ export interface DocumentListItemHeadlineProps extends Omit<HeadlineProps, 'head
|
|
|
10
10
|
export interface DocumentListItemActionElementProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
11
11
|
children: React.ReactNode;
|
|
12
12
|
}
|
|
13
|
-
declare const DocumentListItemActionElement: React.FC<DocumentListItemActionElementProps>;
|
|
14
13
|
export interface DocumentListItemImageContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
14
|
children: React.ReactNode;
|
|
16
15
|
}
|
|
16
|
+
export interface DocumentListItemActionAreaProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
17
|
+
actionElement?: React.ReactNode;
|
|
18
|
+
tags?: React.ReactNode[];
|
|
19
|
+
}
|
|
17
20
|
export interface DocumentListItemProps extends LinkComponent, LinkProps {
|
|
18
21
|
headline?: string;
|
|
19
22
|
description?: string;
|
|
@@ -22,7 +25,8 @@ export interface DocumentListItemProps extends LinkComponent, LinkProps {
|
|
|
22
25
|
showCheckbox?: boolean;
|
|
23
26
|
tag?: React.ReactNode;
|
|
24
27
|
details?: string[];
|
|
28
|
+
tags?: React.ReactNode[];
|
|
25
29
|
}
|
|
26
30
|
declare const DocumentListItem: React.FC<DocumentListItemProps>;
|
|
27
|
-
export { DocumentListItem
|
|
31
|
+
export { DocumentListItem };
|
|
28
32
|
//# sourceMappingURL=DocumentListItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentListItem.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/documentList/DocumentListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAK,aAAa,EAAC,MAAM,gBAAgB,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"DocumentListItem.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/documentList/DocumentListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAK,aAAa,EAAC,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAW,aAAa,EAAC,MAAM,2BAA2B,CAAC;AAGlE,MAAM,WAAW,6BACf,SAAQ,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAwBD,MAAM,WAAW,kCACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAiBD,MAAM,WAAW,mCACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,+BACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAsB,SAAQ,aAAa,EAAE,SAAS;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;CAC1B;AAuCD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAyDrD,CAAC;AAEF,OAAO,EAAC,gBAAgB,EAAC,CAAC"}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import { cn } from '../../../utils';
|
|
4
|
+
import { BodyText } from '../../typography/bodyText';
|
|
3
5
|
import { Headline } from '../../typography/headline';
|
|
4
6
|
import { SlimRichText } from '../text';
|
|
5
|
-
|
|
6
|
-
const DocumentListItemHeadline = ({ tag, headline, className, hasLink, }) => (headline || tag) && (_jsxs("div", { className: "flex flex-wrap items-center self-stretch justify-between gap-x-4", children: [_jsx(Headline, { className: cn(hasLink && 'group-focus:underline group-hover:underline', className), textColor: 'primary', headingLevel: 'h4', children: headline }), tag && _jsx("div", { className: "pt-1", children: tag })] }));
|
|
7
|
+
const DocumentListItemHeadline = ({ tag, headline, className, hasLink, }) => (headline || tag) && (_jsxs("div", { className: "flex flex-wrap items-center self-stretch justify-between gap-x-4", children: [_jsx(Headline, { className: cn(hasLink && 'group-focus:underline group-hover:underline', className), textColor: 'primary', headingLevel: 'h5', children: headline }), tag && _jsx("div", { className: "pt-1", children: tag })] }));
|
|
7
8
|
const DocumentListItemActionElement = ({ className, children, ...props }) => children && (_jsx("div", { className: cn('flex flex-col justify-start self-start md:self-start shrink-0', className), ...props, children: children }));
|
|
8
|
-
const
|
|
9
|
+
const DocumentListItemActionArea = ({ actionElement, tags = [], className, ...props }) => {
|
|
10
|
+
const hasActionElement = !!actionElement;
|
|
11
|
+
const hasTags = tags.length > 0;
|
|
12
|
+
if (!hasActionElement && !hasTags) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return (_jsxs("div", { className: cn('flex flex-row lg:flex-col justify-between items-center lg:items-end flex-shrink-0 min-h-full self-stretch', className), ...props, children: [actionElement && (_jsx("div", { className: "flex justify-start lg:justify-end whitespace-nowrap", children: actionElement })), hasTags && (_jsx("div", { className: "flex flex-wrap gap-2 flex-row justify-end lg:mt-auto", children: tags.map((tag, index) => (_jsx(React.Fragment, { children: tag }, index))) }))] }));
|
|
16
|
+
};
|
|
17
|
+
const DocumentListItem = ({ className, headline, description, actionElement, checkboxElement, details, showCheckbox, tags = [], ...props }) => {
|
|
9
18
|
const hasContent = Boolean(headline || description);
|
|
10
19
|
if (!hasContent)
|
|
11
20
|
return;
|
|
12
|
-
|
|
13
|
-
return (_jsx(Comp, { tabIndex: 0, className: cn('group outline-none border border-border-separator p-6', className), ...props, children: _jsxs("div", { className: "flex flex-col items-start gap-6 lg:flex-row", children: [showCheckbox && checkboxElement && (_jsx(DocumentListItemActionElement, { className: "self-start md:pt-[.5rem]", children: checkboxElement })), _jsx("div", { className: "flex flex-col items-start w-full min-w-0 gap-8", children: _jsxs("div", { className: "flex flex-col items-start gap-1 grow", children: [_jsx(DocumentListItemHeadline, { hasLink: Boolean(props.href), headline: headline, tag: tag }), description && description.length > 0 && (_jsx(SlimRichText, { text: description, bottomSpacing: false })), details && details?.length > 0 && (_jsx(BodyText, { variant: "small", textColor: "primary", asChild: true, children: _jsx("div", { className: "flex flex-wrap pt-2 gap-y-1 gap-x-6", children: (details || []).map(detail => (_jsx("span", { children: detail }, detail))) }) }))] }) }), actionElement && (_jsx(DocumentListItemActionElement, { className: "self-start md:pt-[0.125rem]", children: actionElement }))] }) }));
|
|
21
|
+
return (_jsx("div", { className: cn('outline-none border border-border-separator p-6', className), children: _jsxs("div", { className: "flex flex-col items-stretch gap-6 lg:flex-row lg:gap-6 lg:items-stretch", children: [showCheckbox && checkboxElement && (_jsx(DocumentListItemActionElement, { className: "self-start md:pt-[.3rem]", children: checkboxElement })), !showCheckbox && (_jsx("div", { className: "hidden lg:block w-[18px] md:pt-[.3rem] flex-shrink-0" })), _jsx("div", { className: "flex flex-col items-start w-full min-w-0 gap-8 h-full", children: _jsxs("div", { className: "flex flex-col items-start gap-1 grow", children: [_jsx(DocumentListItemHeadline, { hasLink: Boolean(props.href), headline: headline }), description && description.length > 0 && (_jsx(SlimRichText, { text: description, bottomSpacing: false })), details && details?.length > 0 && (_jsx(BodyText, { variant: "small", textColor: "primary", asChild: true, children: _jsx("div", { className: "flex flex-wrap pt-2 gap-y-1 gap-x-6", children: (details || []).map(detail => (_jsx("span", { children: detail }, detail))) }) }))] }) }), _jsx(DocumentListItemActionArea, { actionElement: actionElement, tags: tags })] }) }));
|
|
14
22
|
};
|
|
15
|
-
export { DocumentListItem
|
|
23
|
+
export { DocumentListItem };
|
|
16
24
|
//# sourceMappingURL=DocumentListItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentListItem.js","sourceRoot":"","sources":["../../../../src/components/layout/documentList/DocumentListItem.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"DocumentListItem.js","sourceRoot":"","sources":["../../../../src/components/layout/documentList/DocumentListItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,EA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,SAAS,EAAC,OAAO,kBACnD,cAAK,SAAS,EAAC,qCAAqC,YACjD,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAC7B,yBAAoB,MAAM,IAAf,MAAM,CAAiB,CACnC,CAAC,GACE,GACG,CACZ,IACG,GACF,EACN,KAAC,0BAA0B,IAAC,aAAa,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,GAAI,IACpE,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAC,gBAAgB,EAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odx/websites-react",
|
|
3
3
|
"author": "Drägerwerk AG & Co. KGaA",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.77",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"description": "ODX React component library for websites",
|
|
7
7
|
"type": "module",
|
|
@@ -529,8 +529,8 @@
|
|
|
529
529
|
"typescript": "^5.4.5",
|
|
530
530
|
"vitest": "^3.1.0-beta.1",
|
|
531
531
|
"@odx/eslint-config-websites": "0.0.1",
|
|
532
|
-
"@odx/websites-
|
|
533
|
-
"@odx/websites-
|
|
532
|
+
"@odx/websites-tsconfig": "0.0.0",
|
|
533
|
+
"@odx/websites-ui": "0.2.32"
|
|
534
534
|
},
|
|
535
535
|
"peerDependencies": {
|
|
536
536
|
"@odx/websites-ui": ">=0.2.1",
|