twico-ui 1.37.0 → 1.37.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to Twico UI are documented here (newest first). This file is generated automatically on each release by [semantic-release](https://semantic-release.gitbook.io/) from [Conventional Commits](https://www.conventionalcommits.org/) — do not edit it by hand. The same notes appear on each [GitHub Release](https://github.com/EncryptionL/twico-ui/releases).
4
4
 
5
+ ## [1.37.1](https://github.com/EncryptionL/twico-ui/compare/v1.37.0...v1.37.1) (2026-09-14)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **image:** let explicit width/height win over fit's container fill ([#378](https://github.com/EncryptionL/twico-ui/issues/378)) ([770823d](https://github.com/EncryptionL/twico-ui/commit/770823ddced42288e623bb00e8f92886bd01d373))
11
+
5
12
  # [1.37.0](https://github.com/EncryptionL/twico-ui/compare/v1.36.1...v1.37.0) (2026-09-11)
6
13
 
7
14
 
package/dist/index.cjs CHANGED
@@ -325,6 +325,8 @@ var Image = React51__namespace.default.forwardRef(function Image2({
325
325
  className = "",
326
326
  style,
327
327
  onError,
328
+ width,
329
+ height,
328
330
  ...rest
329
331
  }, ref) {
330
332
  const __twcStyles = useScopedStyles("twc-image-styles", IMAGE_CSS);
@@ -334,6 +336,14 @@ var Image = React51__namespace.default.forwardRef(function Image2({
334
336
  objectFit: fit,
335
337
  borderRadius: radius ? `var(--radius-${radius})` : void 0,
336
338
  aspectRatio,
339
+ // #378: only when `fit` is set, also emit explicit width/height as inline style — that's the sole case
340
+ // where the `[data-fit] { width/height: 100% }` rule overrides the width/height ATTRIBUTES (a
341
+ // presentational attr loses to a real CSS rule), silently sizing `<Image width height fit>` to the
342
+ // container/intrinsic size. Inline style beats that rule so the props mean what they say (object-fit
343
+ // still crops within the box), placed before `...style` so a caller's own `style` still wins. Gated on
344
+ // `fit` so the no-fit path stays attribute-only — a consumer's own CSS/className can still override it.
345
+ ...fit && width != null ? { width } : null,
346
+ ...fit && height != null ? { height } : null,
337
347
  ...style
338
348
  };
339
349
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -347,6 +357,8 @@ var Image = React51__namespace.default.forwardRef(function Image2({
347
357
  loading,
348
358
  className: `twc-image ${className}`.trim(),
349
359
  "data-fit": fit || void 0,
360
+ width,
361
+ height,
350
362
  style: s,
351
363
  onError: (e) => {
352
364
  onError?.(e);