@mszczygiel-projects/ui-core-shared 1.0.0-alpha.0 → 1.0.0-alpha.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.
@@ -9,7 +9,7 @@ export declare const dialog: {
9
9
  readonly design: {
10
10
  readonly flags: readonly ["hideCloseButton"];
11
11
  readonly booleans: readonly [];
12
- readonly codeOnly: readonly ["open", "alert", "label", "closeLabel", "dragToDismiss"];
12
+ readonly codeOnly: readonly ["open", "alert", "label", "closeLabel", "dragToDismiss", "presentation"];
13
13
  readonly previews: {
14
14
  readonly hasDescription: {
15
15
  readonly options: readonly ["true", "false"];
@@ -29,6 +29,10 @@ export declare const dialog: {
29
29
  readonly options: readonly ["small", "medium", "large", "fullscreen"];
30
30
  readonly default: "medium";
31
31
  };
32
+ readonly presentation: {
33
+ readonly options: readonly ["auto", "dialog", "sheet"];
34
+ readonly default: "auto";
35
+ };
32
36
  };
33
37
  readonly labels: readonly ["close"];
34
38
  readonly parts: readonly ["base", "grabber", "header", "heading", "description", "close", "body", "footer"];
@@ -51,6 +55,8 @@ export declare const dialog: {
51
55
  };
52
56
  /** The width of a dialog: three widths, or the whole window. */
53
57
  export type DialogSize = OptionOf<typeof dialog, 'size'>;
58
+ /** How the dialog is laid out relative to the window. */
59
+ export type DialogPresentation = OptionOf<typeof dialog, 'presentation'>;
54
60
  /**
55
61
  * Why a modal closed: Escape or another close request of the platform, a press on the backdrop,
56
62
  * its close button, a drag down, or a form with `method="dialog"` inside it.
@@ -100,11 +106,21 @@ export interface OverlayProps {
100
106
  /** The props both implementations of Dialog share. */
101
107
  export interface DialogProps extends OverlayProps {
102
108
  /**
103
- * The width of the window. Below the breakpoint, the dialog rises from the bottom of the window
104
- * as a sheet, at its full width.
109
+ * The width of a centered dialog, or the whole window with `fullscreen`.
105
110
  * @default 'medium'
106
111
  */
107
112
  size?: DialogSize;
113
+ /**
114
+ * Chooses a centered dialog or a full-width bottom sheet. With `auto`, it is a sheet below
115
+ * the library breakpoint. A fullscreen dialog fills the window in every presentation.
116
+ * @default 'auto'
117
+ */
118
+ presentation?: DialogPresentation;
119
+ /**
120
+ * Enables drag dismissal in the bottom sheet layout.
121
+ * @default false
122
+ */
123
+ dragToDismiss?: boolean;
108
124
  /**
109
125
  * Makes the dialog an alert dialog, which interrupts the user with an urgent question. A press
110
126
  * on the backdrop does not close it.
@@ -9,7 +9,7 @@ export const dialog = defineComponent({
9
9
  design: {
10
10
  flags: ['hideCloseButton'],
11
11
  booleans: [],
12
- codeOnly: ['open', 'alert', 'label', 'closeLabel', 'dragToDismiss'],
12
+ codeOnly: ['open', 'alert', 'label', 'closeLabel', 'dragToDismiss', 'presentation'],
13
13
  previews: {
14
14
  hasDescription: {
15
15
  options: ['true', 'false'],
@@ -26,6 +26,7 @@ export const dialog = defineComponent({
26
26
  summary: 'A modal window over the page that asks the user to read, decide or enter something before going on.',
27
27
  options: {
28
28
  size: { options: ['small', 'medium', 'large', 'fullscreen'], default: 'medium' },
29
+ presentation: { options: ['auto', 'dialog', 'sheet'], default: 'auto' },
29
30
  },
30
31
  labels: ['close'],
31
32
  parts: ['base', 'grabber', 'header', 'heading', 'description', 'close', 'body', 'footer'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mszczygiel-projects/ui-core-shared",
3
- "version": "1.0.0-alpha.0",
3
+ "version": "1.0.0-alpha.1",
4
4
  "description": "What the web components and the React components of UI Core Library share: the specifications of the components and pure functions, safe for server rendering.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",