@cboxdk/cbox-ui 0.11.0 → 0.11.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cboxdk/cbox-ui",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "private": false,
5
5
  "description": "Cbox shared UI — layout primitives, design tokens, and brand assets used across every Cbox-family app (id, cortex, atlas, track, …).",
6
6
  "repository": {
package/tokens/shell.css CHANGED
@@ -276,7 +276,7 @@ textarea.cbx-input { height: auto; padding: 10px 12px; resize: vertical; min-hei
276
276
 
277
277
  /* ── Palette (§6) ───────────────────────────────────────────────────────────── */
278
278
  .cbx-overlay { position: fixed; inset: 0; z-index: 70; font-family: var(--cbx-font-sans); font-size: 14px; line-height: 1.45; color: var(--foreground); }
279
- .cbx-palette-backdrop { display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: oklch(0.18 0.01 80 / 0.32); animation: cbx-fade 150ms var(--cbx-ease); }
279
+ .cbx-palette-backdrop { display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: oklch(0.18 0.01 80 / calc(0.32 * var(--cbx-scrim, 1))); animation: cbx-fade 150ms var(--cbx-ease); }
280
280
  @keyframes cbx-fade { from { opacity: 0; } }
281
281
  .cbx-palette { display: flex; flex-direction: column; width: min(640px, 100%); max-height: min(560px, 76vh); overflow: hidden; background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--cbx-shadow); outline: none; animation: cbx-pop 200ms var(--cbx-ease); }
282
282
  .cbx-palette-search { display: flex; align-items: center; gap: 12px; height: 56px; flex: none; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--muted-foreground); }
@@ -343,7 +343,10 @@ textarea.cbx-input { height: auto; padding: 10px 12px; resize: vertical; min-hei
343
343
  .cbx-help-foot .cbx-row-action:disabled { opacity: 0.55; cursor: default; }
344
344
 
345
345
  /* ── Sheets (phone) ─────────────────────────────────────────────────────────── */
346
- .cbx-sheet-backdrop { background: oklch(0.18 0.01 80 / 0.45); animation: cbx-fade 150ms var(--cbx-ease); }
346
+ /* A dragged sheet fades its scrim through --cbx-scrim (0–1); the sheet sits inside the scrim, so
347
+ * the scrim's own opacity cannot be used. Registered so it can transition. */
348
+ @property --cbx-scrim { syntax: '<number>'; inherits: false; initial-value: 1; }
349
+ .cbx-sheet-backdrop { background: oklch(0.18 0.01 80 / calc(0.45 * var(--cbx-scrim, 1))); animation: cbx-fade 150ms var(--cbx-ease); }
347
350
  .cbx-sheet { position: absolute; display: flex; flex-direction: column; background: var(--popover); color: var(--popover-foreground); outline: none; box-shadow: var(--cbx-shadow); }
348
351
  .cbx-sheet-left { inset: 0 auto 0 0; width: min(340px, 88vw); border-right: 1px solid var(--border); animation: cbx-slide-left 200ms var(--cbx-ease); }
349
352
  .cbx-sheet-bottom { left: 0; right: 0; bottom: 0; max-height: 88svh; border-top: 1px solid var(--border); border-radius: 16px 16px 0 0; animation: cbx-slide-up 200ms var(--cbx-ease); }
@@ -352,7 +355,11 @@ textarea.cbx-input { height: auto; padding: 10px 12px; resize: vertical; min-hei
352
355
  .cbx-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; flex: none; padding: 0 8px 0 20px; border-bottom: 1px solid var(--border); }
353
356
  .cbx-sheet-head .cbx-back { margin: 0 0 0 -12px; }
354
357
  .cbx-sheet-title { font-size: 15px; }
355
- .cbx-sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px 24px; overscroll-behavior: contain; }
358
+ .cbx-sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px 24px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
359
+ /* One scroller per sheet: its body. A list or menu inside it that is a scroll container of its own
360
+ * (the app grid, a context list) traps an iOS gesture at its edge, so the sheet stops scrolling
361
+ * back the other way. Inside a sheet they grow with their content instead. */
362
+ .cbx-sheet-body :is(.cbx-menu, .cbx-list) { overflow: visible; max-height: none; }
356
363
  .cbx-sheet-body > .cbx-list { margin: 0; }
357
364
  .cbx-sheet-body .cbx-menu-apps { width: auto; padding: 4px 0; }
358
365
  .cbx-sheet-pages { display: flex; flex-direction: column; gap: 4px; padding-left: 28px; }
@@ -484,7 +491,19 @@ textarea.cbx-input { height: auto; padding: 10px 12px; resize: vertical; min-hei
484
491
  .cbx-sheet-bottom { max-height: 88svh; }
485
492
  .cbx-sheet-bottom.is-tall { height: 90svh; max-height: 90svh; }
486
493
  .cbx-sheet-bottom.is-full { height: 94svh; max-height: 94svh; }
487
- .cbx-sheet-handle { flex: none; width: 40px; height: 4px; margin: 8px auto 2px; border-radius: 2px; background: var(--border); }
494
+ /* Detents (sheet-drag.ts): a sheet that fits its content opens at most about half way (60%), a tall
495
+ * one at 90% and the palette at 94%; dragging resizes it between half and 92% and closes it.
496
+ * Heights follow what is really visible (`--cbx-vvh`, the visual viewport) and the sheet sits
497
+ * above the on-screen keyboard (`--cbx-keyboard`), so no field ends up under it. */
498
+ .cbx-sheet-bottom { bottom: var(--cbx-keyboard, 0px); max-height: min(60dvh, calc(var(--cbx-vvh, 100dvh) - 8px)); }
499
+ .cbx-sheet-bottom.is-tall { height: 90dvh; max-height: calc(var(--cbx-vvh, 100dvh) - 8px); }
500
+ .cbx-sheet-bottom.is-full { height: 94dvh; max-height: calc(var(--cbx-vvh, 100dvh) - 8px); }
501
+ .cbx-sheet-bottom[data-cbx-dragging] { user-select: none; -webkit-user-select: none; }
502
+ /* The grab handle and the header drag the sheet; the browser must not pan or zoom from them. */
503
+ .cbx-sheet-grab { touch-action: none; }
504
+ .cbx-sheet-handle { position: relative; flex: none; width: 40px; height: 5px; margin: 8px auto 2px; border-radius: 3px; background: var(--border); cursor: grab; }
505
+ .cbx-sheet-handle::before { content: ''; position: absolute; inset: -8px -60px -6px; }
506
+ [data-cbx-dragging] .cbx-sheet-handle { cursor: grabbing; background: var(--muted-foreground); }
488
507
  .cbx-sheet-bottom .cbx-sheet-head { min-height: 50px; padding: 2px 6px 6px; border-bottom: 0; }
489
508
  .cbx-sheet-bottom .cbx-sheet-title { flex: 1; padding: 0 6px; font-size: 17px; font-weight: 650; }
490
509
  .cbx-sheet-bottom .cbx-sheet-head.has-back .cbx-sheet-title { padding: 0; }
@@ -519,7 +538,8 @@ textarea.cbx-input { height: auto; padding: 10px 12px; resize: vertical; min-hei
519
538
 
520
539
  /* The palette as the phone's sheet */
521
540
  .cbx-palette-backdrop.is-sheet { align-items: flex-end; padding: 0; }
522
- .cbx-palette.is-sheet { width: 100%; height: 94svh; max-height: 94svh; border: 0; border-top: 1px solid var(--border); border-radius: 16px 16px 0 0; animation: cbx-slide-up 200ms var(--cbx-ease); }
541
+ .cbx-palette-backdrop.is-sheet { padding-bottom: var(--cbx-keyboard, 0px); }
542
+ .cbx-palette.is-sheet { width: 100%; height: 94svh; max-height: 94svh; height: 94dvh; max-height: calc(var(--cbx-vvh, 100dvh) - 8px); border: 0; border-top: 1px solid var(--border); border-radius: 16px 16px 0 0; animation: cbx-slide-up 200ms var(--cbx-ease); }
523
543
  .cbx-palette.is-sheet .cbx-palette-search { height: auto; gap: 6px; padding: 6px 16px 0; border-bottom: 0; }
524
544
  .cbx-palette.is-sheet .cbx-palette-field { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: 10px; background: var(--secondary); color: var(--muted-foreground); }
525
545
  .cbx-palette.is-sheet .cbx-palette-field:focus-within { box-shadow: 0 0 0 2px var(--ring); }
@@ -552,3 +572,24 @@ textarea.cbx-input { height: auto; padding: 10px 12px; resize: vertical; min-hei
552
572
  .cbx-cinput::placeholder { color: var(--muted-foreground); }
553
573
  .cbx-cinput:focus { border-color: var(--ring); }
554
574
  .cbx-create-submit { width: 100%; height: 46px; margin-top: auto; border-radius: 12px; font-size: 15px; }
575
+
576
+ /* ── Phone feel (0.11.1) ─────────────────────────────────────────────────────── */
577
+ /* No double-tap zoom on the chrome and in overlays (pinch-zoom stays). */
578
+ .cbx-shell.is-mobile, .cbx-overlay, .cbx-popover { touch-action: manipulation; }
579
+ /* The page scrolls under a fixed top bar and tab bar without the whole document rubber-banding. */
580
+ :root:has(.cbx-shell.is-mobile) { overscroll-behavior-y: none; }
581
+ /* The on-screen keyboard is up: the tab bar steps aside instead of riding up over the fields. */
582
+ :root[data-cbx-keyboard] .cbx-tabbar { display: none; }
583
+ /* Every scroller in a sheet or a menu scrolls on its own, in both directions. */
584
+ .cbx-palette-list, .cbx-help-body, .cbx-list, .cbx-rail-nav, .cbx-subnav { -webkit-overflow-scrolling: touch; }
585
+ /* iOS zooms into any field under 16px when it takes focus. The shell's own fields are 16px on a
586
+ * phone or a touch screen; the page's fields are 16px in the phone layout (an app that styles its
587
+ * fields in a later cascade layer keeps its own size, and should keep it at 16px or more there). */
588
+ @media (max-width: 767px), (pointer: coarse) {
589
+ :is(.cbx-overlay, .cbx-popover, .cbx-m-chrome, .cbx-more, .cbx-help) :is(input:not([type='checkbox']):not([type='radio']):not([type='range']), select, textarea) { font-size: 16px; }
590
+ }
591
+ .cbx-shell.is-mobile .cbx-m-page :is(input:not([type='checkbox']):not([type='radio']):not([type='range']), select, textarea) { font-size: 16px; }
592
+ /* A page heading that repeats the top bar's large title (PageHeader's own, or one marked
593
+ * `data-cbx-page-title`) stays for screen readers only; a `?` beside it goes (the top bar has Help). */
594
+ .cbx-shell.is-mobile [data-cbx-same-title] { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }
595
+ .cbx-shell.is-mobile [data-cbx-same-title] button { display: none !important; }