uikit-react-public 0.47.0 → 0.47.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.
@@ -20,6 +20,7 @@ export const LARGE_WIDTH = 740;
20
20
  export interface BaseDialogProps extends HTMLAttributes<HTMLDialogElement> {
21
21
  open?: boolean;
22
22
  size?: 'small' | 'medium' | 'large';
23
+ fullScreenOnMobile?: boolean;
23
24
  modal?: boolean;
24
25
  closeOnClickOutside?: boolean;
25
26
  closeOnClickOutsideStopPropagation?: boolean;
@@ -39,6 +40,7 @@ const BaseDialog = forwardRef<HTMLDialogElement, BaseDialogProps>(
39
40
  {
40
41
  open = false,
41
42
  size = 'medium',
43
+ fullScreenOnMobile = true,
42
44
  modal = true,
43
45
  closeOnClickOutside = true,
44
46
  closeOnClickOutsideStopPropagation = true,
@@ -185,32 +187,40 @@ const BaseDialog = forwardRef<HTMLDialogElement, BaseDialogProps>(
185
187
  font-size: ${md.fontSize}px;
186
188
  font-weight: ${md.fontWeight};
187
189
  line-height: ${md.lineHeight}%;
188
- width: 100vw;
189
- height: 100vh;
190
+ width: ${width}px;
191
+ max-width: calc(100vw - ${theme.margin.m16});
192
+ height: fit-content;
190
193
  margin: auto;
191
194
 
192
195
  &:modal {
193
- max-width: none;
194
- max-height: none;
196
+ max-width: min(${width}px, calc(100vw - ${theme.margin.m16}));
197
+ max-height: calc(100vh - 32px);
198
+ }
199
+
200
+ &::backdrop {
201
+ background-color: ${theme.colour.surface.backdrop};
195
202
  }
203
+ `;
196
204
 
197
- @media (min-width: ${theme.breakpoints.tablet}px) {
198
- width: ${width}px;
199
- max-width: calc(100vw - ${theme.margin.m16});
200
- height: fit-content;
205
+ const fullScreenOnMobileStyle = css`
206
+ @media (width < ${theme.breakpoints.tablet}px) {
207
+ width: 100vw;
208
+ max-width: none;
209
+ height: 100vh;
201
210
 
202
211
  &:modal {
203
- max-width: min(${width}px, calc(100vw - ${theme.margin.m16}));
204
- max-height: calc(100vh - 32px);
212
+ max-width: none;
213
+ max-height: none;
205
214
  }
206
215
  }
207
-
208
- &::backdrop {
209
- background-color: ${theme.colour.surface.backdrop};
210
- }
211
216
  `;
212
217
 
213
- const style = cx(NAME, baseStyle, className);
218
+ const style = cx(
219
+ NAME,
220
+ baseStyle,
221
+ fullScreenOnMobile && fullScreenOnMobileStyle,
222
+ className
223
+ );
214
224
 
215
225
  if (open) {
216
226
  return (
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "uikit-react-public",
3
3
  "private": false,
4
4
  "license": "UNLICENSED",
5
- "version": "0.47.0",
5
+ "version": "0.47.1",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",