@odx/websites-react 1.6.0 → 1.6.1

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.
@@ -0,0 +1,27 @@
1
+ import * as React from 'react';
2
+ import { type ImageProps } from '../../images-icons/image';
3
+ import { type VideoProps } from '../../images-icons/video';
4
+ import { type HeadlineProps } from '../../typography/headline';
5
+ export type SingleMediaElementRatio = '3/2' | '4/3' | '16/6' | '16/9';
6
+ export type SingleMediaElementImage = Omit<ImageProps, 'ratio'>;
7
+ export type SingleMediaElementVideo = Omit<VideoProps, 'previewImage'> & {
8
+ previewImage?: Omit<ImageProps, 'ratio'>;
9
+ };
10
+ export type SingleMediaElementMediaProps = {
11
+ image: SingleMediaElementImage;
12
+ video?: never;
13
+ } | {
14
+ video: SingleMediaElementVideo;
15
+ image?: never;
16
+ };
17
+ interface SingleMediaElementBaseProps extends React.HTMLAttributes<HTMLElement> {
18
+ ratio?: SingleMediaElementRatio;
19
+ headline?: string;
20
+ text?: string;
21
+ headlineActAs?: HeadlineProps['actAs'];
22
+ ref?: React.Ref<HTMLElement>;
23
+ }
24
+ export type SingleMediaElementProps = SingleMediaElementBaseProps & SingleMediaElementMediaProps;
25
+ declare const SingleMediaElement: React.FC<SingleMediaElementProps>;
26
+ export { SingleMediaElement };
27
+ //# sourceMappingURL=SingleMediaElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SingleMediaElement.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/singleMediaElement/SingleMediaElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAQ,KAAK,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAQ,KAAK,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAW,KAAK,aAAa,EAAC,MAAM,2BAA2B,CAAC;AAGvE,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtE,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAEhE,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,GAAG;IACvE,YAAY,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,4BAA4B,GACpC;IAAC,KAAK,EAAE,uBAAuB,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAC,GAC/C;IAAC,KAAK,EAAE,uBAAuB,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAC,CAAC;AAEpD,UAAU,2BAA4B,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IAC7E,KAAK,CAAC,EAAE,uBAAuB,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CAC9B;AAED,MAAM,MAAM,uBAAuB,GAAG,2BAA2B,GAC/D,4BAA4B,CAAC;AAE/B,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA6DzD,CAAC;AAEF,OAAO,EAAC,kBAAkB,EAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../../../utils';
3
+ import { Image } from '../../images-icons/image';
4
+ import { Video } from '../../images-icons/video';
5
+ import { Headline } from '../../typography/headline';
6
+ import { SlimRichText } from '../text';
7
+ const SingleMediaElement = ({ className, image, video, ratio = '16/9', headline, text, ref, headlineActAs, ...props }) => {
8
+ if (!image && !video)
9
+ return null;
10
+ const hasCaption = Boolean(headline || text);
11
+ return (_jsxs("figure", { className: cn('flex flex-col gap-4 w-full', className), ref: ref, ...props, children: [_jsx("div", { className: "overflow-hidden w-full rounded-content", children: image ? (_jsx(Image, { fit: "cover", ...image, ratio: ratio })) : (video && (_jsx(Video, { ...video, previewImage: video.previewImage && {
12
+ fit: 'cover',
13
+ ...video.previewImage,
14
+ ratio,
15
+ } }))) }), hasCaption && (_jsx("div", { className: "grid grid-cols-12 gap-x-6", children: _jsxs("figcaption", { className: "col-span-full 2xl:col-start-3 2xl:col-span-8 flex flex-col gap-2", children: [headline && (_jsx(Headline, { headingLevel: "h6", spacingBottom: false, actAs: headlineActAs, children: headline })), _jsx(SlimRichText, { text: text, variant: "extraSmall", textColor: "secondary" })] }) }))] }));
16
+ };
17
+ export { SingleMediaElement };
18
+ //# sourceMappingURL=SingleMediaElement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SingleMediaElement.js","sourceRoot":"","sources":["../../../../src/components/layout/singleMediaElement/SingleMediaElement.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAC,KAAK,EAAkB,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAC,KAAK,EAAkB,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAC,QAAQ,EAAqB,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAyBrC,MAAM,kBAAkB,GAAsC,CAAC,EAC7D,SAAS,EACT,KAAK,EACL,KAAK,EACL,KAAK,GAAG,MAAM,EACd,QAAQ,EACR,IAAI,EACJ,GAAG,EACH,aAAa,EACb,GAAG,KAAK,EACT,EAAE,EAAE;IACH,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAElC,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC;IAE7C,OAAO,CACL,kBACE,SAAS,EAAE,EAAE,CAAC,4BAA4B,EAAE,SAAS,CAAC,EACtD,GAAG,EAAE,GAAG,KACJ,KAAK,aAET,cAAK,SAAS,EAAC,wCAAwC,YACpD,KAAK,CAAC,CAAC,CAAC,CACP,KAAC,KAAK,IAAC,GAAG,EAAC,OAAO,KAAK,KAAK,EAAE,KAAK,EAAE,KAAK,GAAI,CAC/C,CAAC,CAAC,CAAC,CACF,KAAK,IAAI,CACP,KAAC,KAAK,OACA,KAAK,EACT,YAAY,EACV,KAAK,CAAC,YAAY,IAAI;wBACpB,GAAG,EAAE,OAAO;wBACZ,GAAG,KAAK,CAAC,YAAY;wBACrB,KAAK;qBACN,GAEH,CACH,CACF,GACG,EACL,UAAU,IAAI,CACb,cAAK,SAAS,EAAC,2BAA2B,YACxC,sBAAY,SAAS,EAAC,kEAAkE,aACrF,QAAQ,IAAI,CACX,KAAC,QAAQ,IACP,YAAY,EAAC,IAAI,EACjB,aAAa,EAAE,KAAK,EACpB,KAAK,EAAE,aAAa,YAEnB,QAAQ,GACA,CACZ,EACD,KAAC,YAAY,IACX,IAAI,EAAE,IAAI,EACV,OAAO,EAAC,YAAY,EACpB,SAAS,EAAC,WAAW,GACrB,IACS,GACT,CACP,IACM,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAC,kBAAkB,EAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './SingleMediaElement';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/singleMediaElement/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './SingleMediaElement';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/layout/singleMediaElement/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,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.6.0",
4
+ "version": "1.6.1",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "description": "ODX React component library for websites",
7
7
  "type": "module",
@@ -133,7 +133,8 @@
133
133
  "./web/genAI/source": "./dist/web/genAI/source/index.js",
134
134
  "./components/navigation/searchButton": "./dist/components/navigation/searchButton/index.js",
135
135
  "./web/contact": "./dist/web/contact/index.js",
136
- "./hooks/useResizeObserver": "./dist/hooks/useResizeObserver/index.js"
136
+ "./hooks/useResizeObserver": "./dist/hooks/useResizeObserver/index.js",
137
+ "./components/layout/singleMediaElement": "./dist/components/layout/singleMediaElement/index.js"
137
138
  },
138
139
  "typesVersions": {
139
140
  "*": {
@@ -514,6 +515,9 @@
514
515
  ],
515
516
  "hooks/useResizeObserver": [
516
517
  "./dist/hooks/useResizeObserver/index.d.ts"
518
+ ],
519
+ "components/layout/singleMediaElement": [
520
+ "./dist/components/layout/singleMediaElement/index.d.ts"
517
521
  ]
518
522
  }
519
523
  },