@se-studio/core-ui 1.4.2 → 1.4.3
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/CHANGELOG.md +8 -0
- package/dist/components/SvgIconComponent.d.ts +4 -7
- package/dist/components/SvgIconComponent.d.ts.map +1 -1
- package/dist/components/SvgIconComponent.js +2 -2
- package/dist/components/SvgIconComponent.js.map +1 -1
- package/dist/components/SvgImageComponent.d.ts +1 -1
- package/dist/components/SvgImageComponent.d.ts.map +1 -1
- package/dist/components/SvgImageComponent.js +2 -2
- package/dist/components/SvgImageComponent.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @se-studio/core-ui
|
|
2
2
|
|
|
3
|
+
## 1.4.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix(live-preview): forward `data-contentful-*` attrs through SVG icon and SVG image components (#58, #59)
|
|
8
|
+
|
|
9
|
+
`SvgIconComponent` and `SvgImageComponent` now spread rest props onto the root `<svg>` / `Image`, so `getPreviewFieldProps` on `<Visual />` reaches the DOM for sprite icons and non-sprite SVGs.
|
|
10
|
+
|
|
3
11
|
## 1.4.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import type { ISvgImage } from '@se-studio/core-data-types';
|
|
2
|
-
import type
|
|
3
|
-
interface SvgIconComponentProps {
|
|
4
|
-
image: ISvgImage;
|
|
5
|
-
className?: string;
|
|
6
|
-
style?: CSSProperties;
|
|
7
|
-
}
|
|
2
|
+
import { type IImageProps } from './Visual';
|
|
8
3
|
/**
|
|
9
4
|
* Renders an SVG icon using a sprite sheet reference.
|
|
10
5
|
* The icon is rendered as an SVG with a <use> element that references
|
|
@@ -18,6 +13,8 @@ interface SvgIconComponentProps {
|
|
|
18
13
|
* @param className - Additional CSS classes
|
|
19
14
|
* @param style - Additional inline styles
|
|
20
15
|
*/
|
|
21
|
-
declare function SvgIconComponent({ image, className, style }:
|
|
16
|
+
declare function SvgIconComponent({ image, className, style, ...rest }: {
|
|
17
|
+
image: ISvgImage;
|
|
18
|
+
} & Omit<IImageProps, 'analytics' | 'componentLabel'>): import("react/jsx-runtime").JSX.Element;
|
|
22
19
|
export default SvgIconComponent;
|
|
23
20
|
//# sourceMappingURL=SvgIconComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgIconComponent.d.ts","sourceRoot":"","sources":["../../src/components/SvgIconComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"SvgIconComponent.d.ts","sourceRoot":"","sources":["../../src/components/SvgIconComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,iBAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,GAAG,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,gBAAgB,CAAC,2CAmB1E;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -13,11 +13,11 @@ import { calculateCropDetails } from './Visual';
|
|
|
13
13
|
* @param className - Additional CSS classes
|
|
14
14
|
* @param style - Additional inline styles
|
|
15
15
|
*/
|
|
16
|
-
function SvgIconComponent({ image, className, style }) {
|
|
16
|
+
function SvgIconComponent({ image, className, style, ...rest }) {
|
|
17
17
|
const { id, width, height, description, name } = image;
|
|
18
18
|
const iconId = `icon-${id}`;
|
|
19
19
|
const cropProperties = calculateCropDetails(image);
|
|
20
|
-
return (_jsx("svg", { width: width || undefined, height: height || undefined, fill: "none", className: className, style: { ...style, ...cropProperties }, "aria-label": description ?? name ?? undefined, role: "img", children: _jsx("use", { href: `#${iconId}` }) }));
|
|
20
|
+
return (_jsx("svg", { width: width || undefined, height: height || undefined, fill: "none", className: className, style: { ...style, ...cropProperties }, "aria-label": description ?? name ?? undefined, role: "img", ...rest, children: _jsx("use", { href: `#${iconId}` }) }));
|
|
21
21
|
}
|
|
22
22
|
export default SvgIconComponent;
|
|
23
23
|
//# sourceMappingURL=SvgIconComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgIconComponent.js","sourceRoot":"","sources":["../../src/components/SvgIconComponent.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SvgIconComponent.js","sourceRoot":"","sources":["../../src/components/SvgIconComponent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAoB,MAAM,UAAU,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,SAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACkE;IACzE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACvD,MAAM,MAAM,GAAG,QAAQ,EAAE,EAAE,CAAC;IAC5B,MAAM,cAAc,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAEnD,OAAO,CACL,cACE,KAAK,EAAE,KAAK,IAAI,SAAS,EACzB,MAAM,EAAE,MAAM,IAAI,SAAS,EAC3B,IAAI,EAAC,MAAM,EACX,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,cAAc,EAAE,gBAC1B,WAAW,IAAI,IAAI,IAAI,SAAS,EAC5C,IAAI,EAAC,KAAK,KACN,IAAI,YAER,cAAK,IAAI,EAAE,IAAI,MAAM,EAAE,GAAI,GACvB,CACP,CAAC;AACJ,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ISvgImage } from '@se-studio/core-data-types';
|
|
2
2
|
import { type IImageProps } from './Visual';
|
|
3
|
-
declare function SvgImageComponent({ image, loading, fetchPriority, className, style, }: {
|
|
3
|
+
declare function SvgImageComponent({ image, loading, fetchPriority, className, style, ...rest }: {
|
|
4
4
|
image: ISvgImage;
|
|
5
5
|
} & Omit<IImageProps, 'analytics' | 'componentLabel'>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default SvgImageComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgImageComponent.d.ts","sourceRoot":"","sources":["../../src/components/SvgImageComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAElE,iBAAS,iBAAiB,CAAC,EACzB,KAAK,EACL,OAAO,EACP,aAAa,EACb,SAAS,EACT,KAAK,
|
|
1
|
+
{"version":3,"file":"SvgImageComponent.d.ts","sourceRoot":"","sources":["../../src/components/SvgImageComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAElE,iBAAS,iBAAiB,CAAC,EACzB,KAAK,EACL,OAAO,EACP,aAAa,EACb,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,GAAG,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,gBAAgB,CAAC,2CAkB1E;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Image from 'next/image';
|
|
3
3
|
import { calculateCropDetails } from './Visual';
|
|
4
|
-
function SvgImageComponent({ image, loading, fetchPriority, className, style, }) {
|
|
4
|
+
function SvgImageComponent({ image, loading, fetchPriority, className, style, ...rest }) {
|
|
5
5
|
const { svgSrc, name, width, height, description } = image;
|
|
6
6
|
const cropProperties = calculateCropDetails(image);
|
|
7
|
-
return (_jsx(Image, { src: svgSrc, alt: description ?? name, width: width, height: height, style: { ...style, ...cropProperties }, loading: loading, className: className, unoptimized: true, fetchPriority: fetchPriority }));
|
|
7
|
+
return (_jsx(Image, { src: svgSrc, alt: description ?? name, width: width, height: height, style: { ...style, ...cropProperties }, loading: loading, className: className, unoptimized: true, fetchPriority: fetchPriority, ...rest }));
|
|
8
8
|
}
|
|
9
9
|
export default SvgImageComponent;
|
|
10
10
|
//# sourceMappingURL=SvgImageComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgImageComponent.js","sourceRoot":"","sources":["../../src/components/SvgImageComponent.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAoB,MAAM,UAAU,CAAC;AAElE,SAAS,iBAAiB,CAAC,EACzB,KAAK,EACL,OAAO,EACP,aAAa,EACb,SAAS,EACT,KAAK,
|
|
1
|
+
{"version":3,"file":"SvgImageComponent.js","sourceRoot":"","sources":["../../src/components/SvgImageComponent.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAoB,MAAM,UAAU,CAAC;AAElE,SAAS,iBAAiB,CAAC,EACzB,KAAK,EACL,OAAO,EACP,aAAa,EACb,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACkE;IACzE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAC3D,MAAM,cAAc,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAEnD,OAAO,CACL,KAAC,KAAK,IACJ,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,WAAW,IAAI,IAAI,EACxB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,cAAc,EAAE,EACtC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,IAAI,EACjB,aAAa,EAAE,aAAa,KACxB,IAAI,GACR,CACH,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@se-studio/core-ui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "Shared React UI component library with Tailwind CSS v4 for SE Studio applications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"mustache": "4.2.0",
|
|
76
76
|
"server-only": "0.0.1",
|
|
77
77
|
"tailwind-merge": "^3.6.0",
|
|
78
|
-
"@se-studio/
|
|
79
|
-
"@se-studio/
|
|
78
|
+
"@se-studio/contentful-rest-api": "1.5.1",
|
|
79
|
+
"@se-studio/core-data-types": "1.4.1"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@biomejs/biome": "^2.4.16",
|