@coolms/ui-react 0.1.0-alpha.5 → 0.1.0-alpha.6

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
@@ -10,6 +10,7 @@
10
10
  "toast": { "implementedBy": "Toast", "states": ["success", "error", "info", "with-action"] },
11
11
  "loading": { "implementedBy": "Loading", "states": ["inline", "block"] },
12
12
  "empty-state": { "implementedBy": "EmptyState", "states": ["default", "with-action"] },
13
+ "state": { "implementedBy": "State", "states": ["loading", "empty", "error", "denied", "page", "block", "inline", "with-action", "delayed"] },
13
14
  "error-banner": { "implementedBy": "ErrorBanner", "states": ["default", "with-retry"] },
14
15
  "page-header": { "implementedBy": "PageHeader", "states": ["default", "with-actions", "with-back-link"] },
15
16
  "tab-strip": { "implementedBy": "TabStrip", "states": ["default", "active", "with-count"] },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolms/ui-react",
3
- "version": "0.1.0-alpha.5",
3
+ "version": "0.1.0-alpha.6",
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",
@@ -62,7 +62,7 @@
62
62
  "react": "19.2.3",
63
63
  "react-dom": "19.2.3",
64
64
  "typescript": "6.0.3",
65
- "vite": "6.4.4",
66
- "vitest": "3.2.7"
65
+ "vite": "6.4.5",
66
+ "vitest": "5.1.0"
67
67
  }
68
68
  }
package/src/kit.css CHANGED
@@ -172,6 +172,27 @@
172
172
  .cms-empty__title { margin: 0 0 4px; color: var(--cms-text); font-weight: 600; }
173
173
  .cms-empty__hint { margin: 0; }
174
174
  .cms-empty__action { margin-top: 12px; }
175
+ /* The state component: one look for every state instead of content. Each token carries its own value as a fallback
176
+ until the kit pins the design tokens that define it. */
177
+ .cms-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--cms-space-3, 12px); color: var(--cms-text-muted); text-align: center; transition: opacity 120ms; }
178
+ .cms-state--page { flex: 1; min-height: 50vh; padding: var(--cms-space-8, 32px) var(--cms-space-4, 16px); }
179
+ .cms-state--block { flex: 1; box-sizing: border-box; min-height: 100%; padding: var(--cms-space-8, 32px) var(--cms-space-4, 16px); }
180
+ .cms-state--inline { display: inline-flex; flex-direction: row; gap: var(--cms-space-2, 8px); text-align: start; }
181
+ .cms-state.is-waiting > :not(.cms-state__text) { visibility: hidden; }
182
+ .cms-state.is-waiting > .cms-state__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
183
+ .cms-state__text { display: flex; flex-direction: column; gap: var(--cms-space-1, 4px); }
184
+ .cms-state--inline .cms-state__text { flex-direction: row; gap: var(--cms-space-2, 8px); }
185
+ .cms-state__title { color: var(--cms-text); font-weight: 600; }
186
+ .cms-state--inline .cms-state__title { font-weight: inherit; }
187
+ .cms-state__description { max-width: 48ch; }
188
+ .cms-state--error > svg { color: var(--cms-danger-text); }
189
+ .cms-state__spinner { width: var(--cms-spinner-size-block, 24px); height: var(--cms-spinner-size-block, 24px); animation: cms-spin var(--cms-spinner-duration, 800ms) linear infinite; }
190
+ .cms-state--page .cms-state__spinner { width: var(--cms-spinner-size-page, 32px); height: var(--cms-spinner-size-page, 32px); }
191
+ .cms-state--inline .cms-state__spinner { width: var(--cms-spinner-size-inline, 16px); height: var(--cms-spinner-size-inline, 16px); }
192
+ .cms-state__track { stroke: var(--cms-spinner-track, var(--cms-border)); stroke-width: var(--cms-spinner-stroke, 2px); vector-effect: non-scaling-stroke; }
193
+ .cms-state__arc { stroke: var(--cms-spinner-color, var(--cms-accent-text)); stroke-width: var(--cms-spinner-stroke, 2px); stroke-linecap: round; vector-effect: non-scaling-stroke; }
194
+ @keyframes cms-state-pulse { 50% { opacity: 0.35; } }
195
+ @media (prefers-reduced-motion: reduce) { .cms-state__spinner { animation: cms-state-pulse calc(2 * var(--cms-spinner-duration, 800ms)) ease-in-out infinite; } }
175
196
  .cms-error-banner {
176
197
  display: flex;
177
198
  align-items: center;
@@ -478,6 +499,51 @@
478
499
  .cms-signin-form__or::before, .cms-signin-form__or::after { content: ''; flex: 1; height: 1px; background: var(--cms-border); }
479
500
  .cms-signin-form__create { justify-content: center; height: 48px; border-color: var(--cms-border-input); border-radius: var(--cms-radius-control); color: var(--cms-text); font-weight: var(--cms-font-weight-semibold); text-decoration: none; }
480
501
 
502
+ /* The file viewer: dark whatever the scheme, covering the page. It never scrolls as a document; its content does. */
503
+ .cms-viewer { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-rows: 56px minmax(0, 1fr) auto auto; background: #0e1116; color: #f4f5f7; }
504
+ .cms-viewer:focus { outline: none; }
505
+ .cms-viewer__top { display: flex; align-items: center; gap: var(--cms-space-2); min-width: 0; padding: 0 var(--cms-space-3); border-bottom: 1px solid #2a2f38; }
506
+ .cms-viewer__badge { flex: none; display: inline-flex; }
507
+ .cms-viewer__name { margin: 0; min-width: 0; font-size: inherit; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
508
+ .cms-viewer__position, .cms-viewer__status { flex: none; color: #a8afbb; white-space: nowrap; }
509
+ .cms-viewer__space { flex: 1 1 0; min-width: 0; }
510
+ .cms-viewer__actions { display: inline-flex; gap: var(--cms-space-1); flex: none; }
511
+ .cms-viewer__icon, .cms-viewer__button { display: inline-flex; align-items: center; justify-content: center; gap: var(--cms-space-2); height: 36px; border: 0; border-radius: var(--cms-radius-md); background: transparent; color: inherit; font: inherit; white-space: nowrap; cursor: pointer; }
512
+ .cms-viewer__icon { flex: none; width: 36px; }
513
+ .cms-viewer__button { flex: none; padding: 0 var(--cms-space-3); }
514
+ .cms-viewer__icon:hover, .cms-viewer__button:hover { background: #262b34; }
515
+ .cms-viewer :focus-visible { outline: 2px solid var(--cms-accent); outline-offset: 2px; }
516
+ .cms-viewer__button--edit, .cms-viewer__button--edit:hover { background: var(--cms-accent); color: #1a1a1a; font-weight: 600; }
517
+ .cms-viewer__more { display: none; position: relative; flex: none; }
518
+ .cms-viewer__menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 3; display: flex; flex-direction: column; align-items: stretch; min-width: 200px; padding: var(--cms-space-1); border: 1px solid #2a2f38; border-radius: var(--cms-radius-md); background: #1a1e25; }
519
+ .cms-viewer__menu .cms-viewer__button { justify-content: flex-start; min-height: var(--cms-touch-target-min); }
520
+ .cms-viewer__body { display: flex; min-height: 0; }
521
+ .cms-viewer__thumbnails { flex: none; width: 124px; padding: var(--cms-space-3); overflow: auto; border-right: 1px solid #2a2f38; }
522
+ .cms-viewer__content { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; overflow: hidden; }
523
+ .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; }
524
+ .cms-viewer__side--previous { left: var(--cms-space-3); }
525
+ .cms-viewer__side--next { right: var(--cms-space-3); }
526
+ .cms-viewer__side--next svg { transform: scaleX(-1); }
527
+ .cms-viewer__strip { display: flex; justify-content: center; gap: var(--cms-space-2); min-width: 0; padding: var(--cms-space-2) var(--cms-space-3); overflow-x: auto; border-top: 1px solid #2a2f38; }
528
+ .cms-viewer__dots { display: none; position: absolute; left: 0; right: 0; bottom: var(--cms-space-2); z-index: 2; justify-content: center; gap: 6px; }
529
+ .cms-viewer__dots i { width: 7px; height: 7px; border-radius: 50%; background: #6c7482; }
530
+ .cms-viewer__dots i.is-current { background: #f4f5f7; }
531
+ .cms-viewer__bar { display: flex; align-items: center; justify-content: center; gap: var(--cms-space-1); min-height: 48px; padding: 0 var(--cms-space-2); border-top: 1px solid #2a2f38; color: #d6dae1; white-space: nowrap; }
532
+ @media (max-width: 1199.98px) {
533
+ .cms-viewer__icon, .cms-viewer__button { min-height: var(--cms-touch-target-min); min-width: var(--cms-touch-target-min); }
534
+ }
535
+ @media (max-width: 599.98px) {
536
+ .cms-viewer__top { padding: 0 var(--cms-space-1); gap: var(--cms-space-1); }
537
+ .cms-viewer__icon { width: var(--cms-touch-target-min); height: var(--cms-touch-target-min); }
538
+ .cms-viewer__position, .cms-viewer__actions, .cms-viewer__wide, .cms-viewer__thumbnails, .cms-viewer__side, .cms-viewer__strip { display: none; }
539
+ .cms-viewer__more { display: inline-flex; }
540
+ .cms-viewer__dots { display: flex; }
541
+ .cms-viewer__button--edit { width: var(--cms-touch-target-min); height: var(--cms-touch-target-min); padding: 0; }
542
+ .cms-viewer.is-editing .cms-viewer__button--edit { width: auto; padding: 0 var(--cms-space-3); }
543
+ .cms-viewer__status { max-width: 92px; white-space: normal; font-size: var(--cms-font-size-label); line-height: 1.15; }
544
+ }
545
+ @media (prefers-reduced-motion: reduce) { .cms-viewer * { transition: none; animation: none; } }
546
+
481
547
  /*
482
548
  * The layout's widths, from design-tokens: phone below breakpoint-tablet (600px), tablet from it, desktop from
483
549
  * breakpoint-desktop (1200px). A custom property cannot be read in a media query, so the numbers are written here and
@@ -163,6 +163,14 @@
163
163
  --cms-tabbar-height: 56px;
164
164
  --cms-touch-target-min: 44px;
165
165
  --cms-topbar-height: 64px;
166
+ --cms-spinner-color: var(--cms-accent-text);
167
+ --cms-spinner-track: var(--cms-border);
168
+ --cms-spinner-size-inline: 16px;
169
+ --cms-spinner-size-block: 24px;
170
+ --cms-spinner-size-page: 32px;
171
+ --cms-spinner-stroke: 2px;
172
+ --cms-spinner-duration: 800ms;
173
+ --cms-state-delay: 300ms;
166
174
  }
167
175
 
168
176
  :root[data-theme='dark'] {