@coolms/ui-react 0.1.0-alpha.14 → 0.1.0-alpha.16

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/kit.contract.json CHANGED
@@ -16,7 +16,11 @@
16
16
  "tab-strip": { "implementedBy": "TabStrip", "states": ["default", "active", "with-count"] },
17
17
  "list": { "implementedBy": "List", "states": ["loading", "empty", "populated", "selected", "error"] },
18
18
  "avatar": { "implementedBy": "Avatar", "states": ["picture", "initials", "presence"] },
19
- "context-menu": { "implementedBy": "ContextMenu", "states": ["open", "item-danger", "item-locked", "item-refused"] }
19
+ "context-menu": { "implementedBy": "ContextMenu", "states": ["open", "item-danger", "item-locked", "item-refused", "item-disabled"] },
20
+ "file-viewer": { "implementedBy": "FileViewer", "states": ["loading", "error", "no-preview", "editing", "editing-closing", "editing-conflict", "with-edit", "with-siblings", "with-thumbnails", "with-attachment-strip", "phone"] },
21
+ "file-picker": { "implementedBy": "FilePicker", "states": ["loading", "empty", "error", "denied", "with-selection", "with-budget", "over-budget", "disabled-entry", "paging", "phone"] },
22
+ "notification": { "implementedBy": "Notification", "states": ["unread", "read", "collapsed", "expanded", "with-action", "row-action"] },
23
+ "pane-toolbar": { "implementedBy": "PaneToolbar", "states": ["default", "labels-partly-hidden", "labels-hidden", "overflowing", "menu-open", "with-status", "action-disabled", "action-busy", "phone"] }
20
24
  },
21
25
  "serverStates": {
22
26
  "node-rwx": { "where": "src/server/capability.ts" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolms/ui-react",
3
- "version": "0.1.0-alpha.14",
3
+ "version": "0.1.0-alpha.16",
4
4
  "description": "The CoolMS UI kit for React: the components of the CoolMS UI contract, styled by the CoolMS design tokens",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/kit.css CHANGED
@@ -28,7 +28,8 @@
28
28
  display: inline-flex;
29
29
  align-items: center;
30
30
  gap: 6px;
31
- min-height: var(--cms-row-height);
31
+ /* The contract's button height: 40px with a mouse, 44px on a touch screen (the token's coarse-pointer value). */
32
+ min-height: var(--cms-control-height-md);
32
33
  padding: 0 12px;
33
34
  border: 1px solid var(--cms-btn-border);
34
35
  border-radius: var(--cms-radius);
@@ -64,7 +65,8 @@
64
65
  .cms-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
65
66
  .cms-field__label { color: var(--cms-text); font-weight: 600; }
66
67
  .cms-input {
67
- min-height: var(--cms-row-height);
68
+ /* A text field's and a select's height, as a button's. */
69
+ min-height: var(--cms-control-height-md);
68
70
  padding: 0 10px;
69
71
  border: 1px solid var(--cms-border-control);
70
72
  border-radius: var(--cms-radius);
@@ -294,11 +296,33 @@
294
296
  }
295
297
  .cms-menu__item { display: flex; align-items: center; gap: 8px; min-height: var(--cms-row-height-sm); padding: 0 10px; border-radius: var(--cms-radius-sm); cursor: pointer; }
296
298
  .cms-menu__item:hover, .cms-menu__item:focus { background: var(--cms-hover-bg); outline: none; }
297
- .cms-menu__label { flex: 1; }
299
+ /* An item's icon and its words share one line, centred on each other. */
300
+ .cms-menu__label { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; }
301
+ .cms-menu__label > svg { flex: none; }
298
302
  .cms-menu__item.is-danger { color: var(--cms-danger-text); }
299
303
  .cms-menu__item.is-refused { color: var(--cms-text-muted); cursor: not-allowed; }
300
304
  .cms-menu__refusal { font-size: 0.8125em; }
301
305
 
306
+ /* One notification: its row (the title, the time, the body in one line until expanded), the chevron beside it, and a
307
+ button action under the text. Unread: the title in weight and a dot. */
308
+ .cms-notification { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: var(--cms-space-1); padding: var(--cms-space-1) var(--cms-space-2); border-radius: var(--cms-radius-md); }
309
+ .cms-notification__row { display: flex; align-items: flex-start; gap: var(--cms-space-3); min-width: 0; padding: var(--cms-space-2); border-radius: var(--cms-radius-md); color: var(--cms-text); cursor: pointer; }
310
+ .cms-notification__row:hover { background: var(--cms-hover-bg); }
311
+ .cms-notification__row:focus-visible { outline: 2px solid var(--cms-focus-ring); outline-offset: 1px; }
312
+ .cms-notification__leading { flex: none; display: inline-flex; }
313
+ .cms-notification__text { display: flex; flex: 1; flex-direction: column; gap: var(--cms-space-1); min-width: 0; }
314
+ .cms-notification__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--cms-space-2); }
315
+ .cms-notification__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
316
+ .cms-notification.is-unread .cms-notification__title { font-weight: var(--cms-font-weight-semibold); }
317
+ .cms-notification__time { flex: none; color: var(--cms-text-muted); font-size: var(--cms-font-size-meta); }
318
+ .cms-notification__body { overflow: hidden; color: var(--cms-text-muted); text-overflow: ellipsis; white-space: nowrap; }
319
+ .cms-notification.is-expanded .cms-notification__body { white-space: pre-wrap; overflow-wrap: break-word; }
320
+ .cms-notification__dot { flex: none; width: 8px; height: 8px; margin-top: var(--cms-space-2); border-radius: var(--cms-radius-pill); background: var(--cms-accent); }
321
+ .cms-notification__chevron { display: inline-flex; align-items: center; justify-content: center; width: var(--cms-control-height-md); height: var(--cms-control-height-md); border: 0; border-radius: var(--cms-radius-sm); background: transparent; color: var(--cms-text-muted); cursor: pointer; }
322
+ .cms-notification__chevron:hover { background: var(--cms-hover-bg); color: var(--cms-text); }
323
+ .cms-notification.is-expanded .cms-notification__chevron svg { transform: rotate(180deg); }
324
+ .cms-notification__action { grid-column: 1; justify-self: start; margin: 0 0 var(--cms-space-2) var(--cms-space-2); }
325
+
302
326
  /*
303
327
  * The Workspace: the shell, its lists, chat, the call and sign-in. Same rule as above: only --cms-* tokens. The chrome
304
328
  * (the rail, the incoming call, the sign-in brand side) stays navy in both themes.
@@ -388,6 +412,13 @@
388
412
  .cms-panes--two { grid-template-columns: 340px 1fr; }
389
413
  .cms-panes--three { grid-template-columns: 240px 380px 1fr; }
390
414
  .cms-panes__pane { min-width: 0; min-height: 0; overflow: auto; border-right: 1px solid var(--cms-border); background: var(--cms-surface); }
415
+ .cms-panes--sized { position: relative; }
416
+ .cms-panes--sized.cms-panes--two { grid-template-columns: var(--split-pane-0) minmax(0, 1fr); }
417
+ .cms-panes--sized.cms-panes--three { grid-template-columns: var(--split-pane-0) var(--split-pane-1) minmax(0, 1fr); }
418
+ .cms-panes__splitter { position: absolute; top: 0; bottom: 0; left: calc(var(--split-at) - 4px); z-index: 2; width: 8px; cursor: col-resize; touch-action: none; }
419
+ .cms-panes__splitter:hover, .cms-panes__splitter:focus-visible { background: linear-gradient(to right, transparent 3px, var(--cms-accent) 3px, var(--cms-accent) 5px, transparent 5px); }
420
+ .cms-panes__splitter:focus-visible { outline: 2px solid var(--cms-focus-ring); outline-offset: -2px; }
421
+ .cms-panes.is-resizing { cursor: col-resize; user-select: none; }
391
422
  .cms-panes__pane:first-child { background: var(--cms-bg); }
392
423
  .cms-panes__pane:last-child { border-right: 0; }
393
424
  .cms-panes__back { display: none; align-items: center; gap: var(--cms-space-1); padding: var(--cms-space-3) var(--cms-space-4); border-bottom: 1px solid var(--cms-border); color: var(--cms-text); font-weight: var(--cms-font-weight-semibold); text-decoration: none; }
@@ -524,6 +555,12 @@
524
555
  .cms-viewer__body { display: flex; min-height: 0; }
525
556
  .cms-viewer__thumbnails { flex: none; width: 124px; padding: var(--cms-space-3); overflow: auto; border-right: 1px solid #2a2f38; }
526
557
  .cms-viewer__content { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; overflow: hidden; }
558
+ /* A state instead of the file, in the viewer's own dark colours whatever the page's scheme. */
559
+ .cms-viewer .cms-state { min-height: 100%; color: #a8afbb; }
560
+ .cms-viewer .cms-state__title { color: #f4f5f7; }
561
+ /* The file changed elsewhere while being edited: the question across the top of the content, above the editor. */
562
+ .cms-viewer__conflict { position: relative; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: var(--cms-space-2); margin: 0; padding: var(--cms-space-2) var(--cms-space-3); border-bottom: 1px solid var(--cms-warning); background: #262b34; }
563
+ .cms-viewer__conflict-text { flex: 1 1 16rem; min-width: 0; margin: 0; }
527
564
  /* The next arrow stands clear of the content's own vertical scrollbar (at most 20px), down the content's right edge. */
528
565
  .cms-viewer__side { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px; border: 0; border-radius: 50%; background: #262b34; color: inherit; cursor: pointer; }
529
566
  .cms-viewer__side--previous { left: var(--cms-space-3); }
@@ -562,7 +599,7 @@
562
599
  .cms-shell__item { justify-content: center; min-height: var(--cms-touch-target-min); }
563
600
  .cms-shell__top { gap: var(--cms-space-3); padding: 0 var(--cms-space-4); }
564
601
  .cms-shell__search { min-width: 0; }
565
- .cms-button, .cms-chip, .cms-tab, .cms-menu__item, .cms-list__row, .cms-panes__back, .cms-server-switch { min-height: var(--cms-touch-target-min); }
602
+ .cms-chip, .cms-tab, .cms-menu__item, .cms-list__row, .cms-panes__back, .cms-server-switch { min-height: var(--cms-touch-target-min); }
566
603
  .cms-icon-button { min-width: var(--cms-touch-target-min); min-height: var(--cms-touch-target-min); }
567
604
  .cms-search { height: var(--cms-touch-target-min); }
568
605
  .cms-search__input { align-self: stretch; }
@@ -571,7 +608,8 @@
571
608
  .cms-call-bar { flex-wrap: wrap; }
572
609
  .cms-call-bar__icon { width: var(--cms-touch-target-min); height: var(--cms-touch-target-min); }
573
610
  .cms-chip { height: auto; }
574
- .cms-panes--two, .cms-panes--three { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
611
+ .cms-panes--two, .cms-panes--three, .cms-panes--sized.cms-panes--two, .cms-panes--sized.cms-panes--three { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
612
+ .cms-panes__splitter { display: none; }
575
613
  .cms-panes__pane { display: none; }
576
614
  .cms-panes__pane[data-offset='0'],
577
615
  .cms-panes__pane[data-offset='1'],
@@ -595,7 +633,7 @@
595
633
  .cms-shell__items > li { flex: 1; }
596
634
  .cms-shell__item { height: var(--cms-tabbar-height); }
597
635
  .cms-shell__label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
598
- .cms-panes--two, .cms-panes--three { grid-template-columns: minmax(0, 1fr); }
636
+ .cms-panes--two, .cms-panes--three, .cms-panes--sized.cms-panes--two, .cms-panes--sized.cms-panes--three { grid-template-columns: minmax(0, 1fr); }
599
637
  .cms-panes__pane[data-offset='1'],
600
638
  .cms-panes[data-active='0'] .cms-panes__pane[data-offset='-1'] { display: none; }
601
639
  .cms-panes:not([data-active='0']) .cms-panes__back { display: flex; }
@@ -162,7 +162,11 @@
162
162
  --cms-rail-width-compact: 64px;
163
163
  --cms-tabbar-height: 56px;
164
164
  --cms-touch-target-min: 44px;
165
+ --cms-control-height-sm: 32px;
166
+ --cms-control-height-md: 40px;
167
+ --cms-control-height-lg: 44px;
165
168
  --cms-topbar-height: 64px;
169
+ --cms-pane-toolbar-height: calc(var(--cms-row-height) + 2 * var(--cms-space-2));
166
170
  --cms-spinner-color: var(--cms-accent-text);
167
171
  --cms-spinner-track: var(--cms-border);
168
172
  --cms-spinner-size-inline: 16px;
@@ -244,3 +248,9 @@
244
248
  --cms-avatar-6-bg: #374151;
245
249
  --cms-avatar-6-fg: #e5e7eb;
246
250
  }
251
+
252
+ @media (pointer: coarse) {
253
+ :root {
254
+ --cms-control-height-md: 44px;
255
+ }
256
+ }