@cocoar/vue-ui 3.4.0-beta.21 → 3.4.0-beta.22
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/dist/components/_internal/keyboardInset.d.ts +9 -0
- package/dist/components/_internal/keyboardInset.d.ts.map +1 -0
- package/dist/components/_internal/useVisualViewport.d.ts +3 -3
- package/dist/components/_internal/useVisualViewport.d.ts.map +1 -1
- package/dist/components/dialog/CoarSheetShell.vue.d.ts.map +1 -1
- package/dist/components/scrollbar/vScrollbar.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +685 -646
- package/package.json +3 -3
- package/skills/cocoar-vue-ui/references/components/dialog.md +30 -3
- package/skills/cocoar-vue-ui/references/guide/mobile.md +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocoar/vue-ui",
|
|
3
|
-
"version": "3.4.0-beta.
|
|
3
|
+
"version": "3.4.0-beta.22",
|
|
4
4
|
"description": "Cocoar Design System — a tablet-first Vue 3 component library with 30+ accessible, themeable components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"skills"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@cocoar/vue-localization": "3.4.0-beta.
|
|
51
|
+
"@cocoar/vue-localization": "3.4.0-beta.22",
|
|
52
52
|
"@fontsource/cascadia-code": "^5.2.3",
|
|
53
53
|
"@fontsource/inter": "^5.2.8",
|
|
54
54
|
"@fontsource/poppins": "^5.2.7",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"vue": "^3.5.32",
|
|
74
74
|
"vue-router": "^5.0.4"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "cf85a8c3795712915384fcd39d03a78d0264e860",
|
|
77
77
|
"scripts": {
|
|
78
78
|
"build": "vite build",
|
|
79
79
|
"test": "vitest run",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Dialog
|
|
4
4
|
|
|
5
|
-
**Devices:** desktop ready · tablet ready · phone partial — Phone: use the bottom sheet (Preview);
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Phone: use the bottom sheet (Preview); overlay-keyboard hosts need a native inset adapter. Android's back button does not close it.
|
|
6
6
|
|
|
7
7
|
Modal dialogs demand attention. They block interaction with the rest of the page until the user makes a decision, making them the right choice for destructive actions, important confirmations, and messages that must be acknowledged before proceeding. Use them sparingly -- when the stakes are high enough to justify interrupting the user's flow.
|
|
8
8
|
|
|
@@ -186,11 +186,14 @@ What the sheet does:
|
|
|
186
186
|
height minus the top safe-area inset (`env(safe-area-inset-top)`) and a 24 px gap, keeping
|
|
187
187
|
the handle and close button below the system bar. From a 640 px wide window on it keeps
|
|
188
188
|
the width of its `size`, centered. A drag handle and the header (title, close button) on top;
|
|
189
|
-
the content scrolls inside; the footer stays put.
|
|
189
|
+
the content scrolls inside; the footer stays put. If a landscape keyboard leaves too little
|
|
190
|
+
height for the header, footer and a field, the whole sheet scrolls instead: fields and
|
|
191
|
+
buttons remain reachable rather than being clipped. The fixed footer returns when space allows.
|
|
190
192
|
- **Buttons**: the footer buttons span the full width, stacked with the confirming one on top,
|
|
191
193
|
clear of the home indicator (`env(safe-area-inset-bottom)`).
|
|
192
194
|
- **On-screen keyboard**: the sheet follows `window.visualViewport`. It sits above the keyboard,
|
|
193
|
-
shrinks with it, and the focused field is scrolled into the visible part.
|
|
195
|
+
shrinks with it, and the focused field is scrolled into the visible part. Native hosts whose
|
|
196
|
+
overlay keyboard leaves the viewport unchanged report its occlusion as described below.
|
|
194
197
|
- **Page behind**: does not scroll while a sheet is open. The centered dialog does not lock the
|
|
195
198
|
page.
|
|
196
199
|
- **Closing**: the close button, a tap on the backdrop, Escape, and dragging down — the same
|
|
@@ -202,6 +205,30 @@ What the sheet does:
|
|
|
202
205
|
- **Focus**: trapped inside and returned on close, `role="dialog"` with `aria-modal`, as in the
|
|
203
206
|
dialog. It slides in from below, without animation under `prefers-reduced-motion`.
|
|
204
207
|
|
|
208
|
+
### Native overlay keyboards (Preview)
|
|
209
|
+
|
|
210
|
+
For a browser or a WebView that resizes above the keyboard, no adapter is needed. A native
|
|
211
|
+
host that draws its keyboard **over** an unchanged page calls `setCoarKeyboardInset()` from
|
|
212
|
+
its own keyboard listener:
|
|
213
|
+
|
|
214
|
+
```ts
|
|
215
|
+
import { setCoarKeyboardInset } from '@cocoar/vue-ui';
|
|
216
|
+
|
|
217
|
+
// The part of the current layout viewport covered at its bottom, in CSS pixels.
|
|
218
|
+
setCoarKeyboardInset(328);
|
|
219
|
+
// On dismissal, when the WebView resizes clear of the keyboard, or on adapter cleanup:
|
|
220
|
+
setCoarKeyboardInset(0);
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
The value is not a device-pixel height or an extra padding token. Convert the native
|
|
224
|
+
keyboard rectangle to the WebView's CSS coordinates and report only its overlap with the
|
|
225
|
+
bottom of the **current** layout viewport. A resized WebView has no overlap: report 0.
|
|
226
|
+
Update it on keyboard and orientation changes, including when no sheet is open. The
|
|
227
|
+
current value also applies to sheets opened later. Insets must be finite and non-negative;
|
|
228
|
+
invalid values throw `RangeError`. Browser and native occlusion are combined, not added,
|
|
229
|
+
so a shrinking visual viewport is not counted twice. Pinch zoom keeps the CSS-only layout.
|
|
230
|
+
The library has no dependency on a particular host or native bridge.
|
|
231
|
+
|
|
205
232
|
### `CoarDialogFooter` (Preview)
|
|
206
233
|
|
|
207
234
|
The buttons of a body component opened with `dialog.open()` go into `<CoarDialogFooter>`. It
|
|
@@ -369,7 +369,7 @@ are only being added, and testing on real devices remains the job of the app.
|
|
|
369
369
|
|
|
370
370
|
| Page | Desktop | Tablet | Phone | Note |
|
|
371
371
|
|---|---|---|---|---|
|
|
372
|
-
| [Dialog](../components/dialog.md) | ready | ready | partial | Phone: use the bottom sheet (Preview);
|
|
372
|
+
| [Dialog](../components/dialog.md) | ready | ready | partial | Phone: use the bottom sheet (Preview); overlay-keyboard hosts need a native inset adapter. Android's back button does not close it. |
|
|
373
373
|
| [Popover](../components/popover.md) | ready | partial | planned | The default hover mode relies on emulated mouse events on touch; use mode 'click' or 'both'. |
|
|
374
374
|
| [Popconfirm](../components/popconfirm.md) | ready | ready | planned | Opens on tap; touch-sized popovers for phones are planned. |
|
|
375
375
|
| [Toast](../components/toast.md) | ready | ready | partial | Toasts are a fixed 380 px wide and overflow 360 px phone screens. |
|