Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/silver-dots-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cube-dev/ui-kit": patch
---

Fix minimum dialog size.
2 changes: 1 addition & 1 deletion src/components/GlobalStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const GlobalStylesElement = createGlobalStyle<GlobalStylesElementProps>`
}

.cube-notification-container {
min-width: 288px;
min-width: var(--min-dialog-size);
max-width: 340px;
width: calc(100vw - 32px);
position: fixed;
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export function Modal(allProps: CubeModalProps) {
shadow={true}
border={false}
radius="1x"
width={`288px (100% - 32px) ${
width={`@min-dialog-size (100% - 32px) ${
typeof width === 'number' ? `${width}px` : width || '360px'
}`}
style={{ textAlign: 'left' }}
Expand Down
4 changes: 2 additions & 2 deletions src/components/overlays/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const DialogElement = tasty({
placeItems: 'stretch',
placeContent: 'stretch',
width: {
'': '288px @dialog-size 90vw',
'': '@min-dialog-size @dialog-size 90vw',
'[data-type="fullscreen"]': '90vw 90vw',
'[data-type="fullscreenTakeover"]': '100vw 100vw',
'[data-type="panel"]': 'auto',
Expand Down Expand Up @@ -287,7 +287,7 @@ const DialogContent = forwardRef(function DialogContent(
{...dialogProps}
tabIndex={undefined}
mods={{ dismissable: isDismissable }}
style={{ '--dialog-size': `${sizePxMap[size] || 288}px` }}
style={{ '--dialog-size': `${sizePxMap[size] || sizePxMap.small}px` }}
data-type={type}
data-size={size}
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/overlays/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const ModalElement = tasty({
'[data-type="panel"]': 'auto',
},
width: {
'': '288px 90vw',
'': '@min-dialog-size 90vw',
'[data-type="panel"]': 'auto',
},
pointerEvents: 'none',
Expand Down
2 changes: 1 addition & 1 deletion src/components/overlays/Modal/Tray.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const TrayElement = tasty({
},
zIndex: 10,
height: 'max 90dvh',
width: '288px 90vw',
width: '@min-dialog-size 90vw',
pointerEvents: 'auto',
transition:
'transform .25s ease-in-out, opacity .25s linear, visibility 0ms linear',
Expand Down
1 change: 1 addition & 0 deletions src/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const TOKENS = {
'leaf-sharp-radius': '0px',
'fade-width': '32px',
transition: '80ms',
'min-dialog-size': 'min(288px, calc(100vw - (2 * var(--gap))))',
'clear-color': 'transparent',
'border-color': color('dark', 0.1),
'border-opaque-color': 'rgb(227 227 233)',
Expand Down
Loading