From e05a7d24318f4617726977a2128b83b9f3257d8d Mon Sep 17 00:00:00 2001 From: DasProffi <67233923+DasProffi@users.noreply.github.com> Date: Sun, 22 Mar 2026 23:40:45 +0100 Subject: [PATCH] fix: fix PropertyBase for small screens --- CHANGELOG.md | 5 + package.json | 2 +- .../properties/PropertyBase.tsx | 105 ++++++++++-------- src/style/theme/components/property.css | 43 ++++++- 4 files changed, 105 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3df87c5..e2efbdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.9.5] - 2026-03-23 + +### Fix +- fix `PropertyBase` for small screen sizes to wrap its content + ## [0.9.4] - 2026-03-22 ### Changed diff --git a/package.json b/package.json index 765a4e0..a0fb21c 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "access": "public" }, "license": "MPL-2.0", - "version": "0.9.4", + "version": "0.9.5", "files": [ "dist" ], diff --git a/src/components/user-interaction/properties/PropertyBase.tsx b/src/components/user-interaction/properties/PropertyBase.tsx index 93c136d..75fac89 100644 --- a/src/components/user-interaction/properties/PropertyBase.tsx +++ b/src/components/user-interaction/properties/PropertyBase.tsx @@ -56,58 +56,73 @@ export const PropertyBase = ({ const isRemoveEnabled = allowRemove && !readOnly const showActionsContainer = isClearEnabled || isRemoveEnabled + const renderActionButtons = () => ( + <> + {isClearEnabled && ( + + + + )} + {isRemoveEnabled && ( + + + + )} + + ) + return (
-
- -
-
{icon}
- {name} -
-
- {invalid && ( - - )} -
-
- {children({ required, hasValue, invalid })} - {showActionsContainer && ( -
- {isClearEnabled && ( - - - - )} - {isRemoveEnabled && ( - - - +
+
+
+ +
+
{icon}
+ {name} +
+
+ {invalid && ( + )}
- )} + {showActionsContainer && ( +
+ {renderActionButtons()} +
+ )} +
+
+ {children({ required, hasValue, invalid })} + {showActionsContainer && ( +
+ {renderActionButtons()} +
+ )} +
) diff --git a/src/style/theme/components/property.css b/src/style/theme/components/property.css index 17d037f..bfa27f5 100644 --- a/src/style/theme/components/property.css +++ b/src/style/theme/components/property.css @@ -1,13 +1,17 @@ @layer components { - [data-name="property-root"] { - @apply flex-row-0 rounded-xl; + [data-name="property-inner"] { + @apply flex-row-0 w-full min-w-0; } [data-name="property-root"] { + @apply rounded-xl; + container-type: inline-size; + container-name: property; transition: outline-offset var(--animation-duration-in, 250ms); outline-offset: 0; &:hover { + [data-name="property-title"]:not([data-invalid]), [data-name="property-content"]:not([data-invalid]) { @apply border-primary; @@ -33,7 +37,6 @@ } } - [data-name="property-title"] { @apply flex-row-2 max-w-48 min-w-48 px-3 py-2 items-center justify-between rounded-l-xl border-2 border-r-0; @@ -46,7 +49,6 @@ } } - [data-name="property-title-icon"] { @apply max-w-6 min-w-6; } @@ -67,10 +69,36 @@ } } + [data-name="property-title-actions"] { + @apply hidden flex-row-2 items-center gap-1 shrink-0; + } + [data-name="property-actions"] { @apply flex-row-2 items-center gap-1; } + @container property (max-width: 32rem) { + [data-name="property-inner"] { + @apply flex-col; + } + + [data-name="property-title"] { + @apply max-w-none min-w-0 w-full rounded-none rounded-t-xl border-r-2 border-b-0; + } + + [data-name="property-title-actions"] { + @apply flex; + } + + [data-name="property-actions"] { + @apply hidden; + } + + [data-name="property-content"] { + @apply rounded-none rounded-b-xl border-t-0 border-l-2 border-r-2 min-h-0; + } + } + [data-name="property-input-wrapper"] { @apply relative flex-row-2 w-full; @@ -87,6 +115,13 @@ [data-name="property-input"] { @apply rounded p-1; + &[type="date"]::-webkit-calendar-picker-indicator, + &[type="datetime-local"]::-webkit-calendar-picker-indicator, + &[type="time"]::-webkit-calendar-picker-indicator { + display: none; + -webkit-appearance: none; + } + &[data-invalid] { @apply bg-surface-warning placeholder-warning; }