@cosxai/ui 0.25.0 → 1.0.0-alpha.0

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.
Files changed (133) hide show
  1. package/CHANGELOG.md +577 -0
  2. package/NOTICE +11 -0
  3. package/README.md +52 -0
  4. package/package.json +33 -7
  5. package/src/fonts.css +20 -0
  6. package/src/index.ts +8 -25
  7. package/src/lib/cn.ts +23 -6
  8. package/src/styles.css +17 -0
  9. package/src/theme.css +132 -0
  10. package/src/tokens/colors.css +112 -0
  11. package/src/tokens/compat.css +36 -0
  12. package/src/tokens/elevation.css +14 -0
  13. package/src/tokens/motion.css +42 -0
  14. package/src/tokens/spacing.css +55 -0
  15. package/src/tokens/typography-cjk.css +42 -0
  16. package/src/tokens/typography.css +81 -0
  17. package/src/actionbar/ActionBar.tsx +0 -837
  18. package/src/actionbar/ActionBarButton.tsx +0 -111
  19. package/src/actionbar/ActionBarMenuGroup.tsx +0 -116
  20. package/src/actionbar/ActionBarModeHandle.tsx +0 -171
  21. package/src/actionbar/ActionBarProvider.tsx +0 -91
  22. package/src/actionbar/actionbar-context.ts +0 -45
  23. package/src/actionbar/index.ts +0 -28
  24. package/src/actionbar/types.ts +0 -147
  25. package/src/actionbar/useActionBarItems.ts +0 -60
  26. package/src/actionbar/useActionBarMode.ts +0 -144
  27. package/src/actionbar/useActionBarPanel.ts +0 -56
  28. package/src/actionbar/useActionBarStatusDot.ts +0 -49
  29. package/src/actionbar/useActionBarToast.ts +0 -33
  30. package/src/ambient/AmbientBackdrop.tsx +0 -74
  31. package/src/ambient/CommandInput.tsx +0 -107
  32. package/src/ambient/SuperbarStrip.tsx +0 -36
  33. package/src/ambient/index.ts +0 -6
  34. package/src/bento/BentoCell.tsx +0 -66
  35. package/src/bento/BentoGrid.tsx +0 -42
  36. package/src/bento/index.ts +0 -2
  37. package/src/command/CommandPalette.tsx +0 -329
  38. package/src/command/CommandProvider.tsx +0 -57
  39. package/src/command/command-context.ts +0 -12
  40. package/src/command/index.ts +0 -6
  41. package/src/command/rank.ts +0 -50
  42. package/src/command/types.ts +0 -37
  43. package/src/command/useCommandSource.ts +0 -37
  44. package/src/dialogs/DialogsProvider.tsx +0 -216
  45. package/src/dialogs/Modal.tsx +0 -260
  46. package/src/dialogs/Toast.tsx +0 -85
  47. package/src/dialogs/dialogs-context.ts +0 -6
  48. package/src/dialogs/index.ts +0 -10
  49. package/src/dialogs/types.ts +0 -37
  50. package/src/dialogs/useDialogs.ts +0 -8
  51. package/src/editorial/EditorialSpotlight.tsx +0 -63
  52. package/src/editorial/Folio.tsx +0 -52
  53. package/src/editorial/PlateMarker.tsx +0 -33
  54. package/src/editorial/RomanSection.tsx +0 -65
  55. package/src/editorial/RunningMarginalia.tsx +0 -65
  56. package/src/editorial/index.ts +0 -10
  57. package/src/hooks/index.ts +0 -5
  58. package/src/hooks/useKeyboardHotkey.ts +0 -93
  59. package/src/hooks/useReducedMotion.ts +0 -20
  60. package/src/hooks/useViewport.ts +0 -61
  61. package/src/layout/Breadcrumb.tsx +0 -74
  62. package/src/layout/LeftNavRail.tsx +0 -139
  63. package/src/layout/MobileTabBar.tsx +0 -101
  64. package/src/layout/NavItem.tsx +0 -128
  65. package/src/layout/NavSearchTrigger.tsx +0 -88
  66. package/src/layout/NavSection.tsx +0 -40
  67. package/src/layout/RightSidebarPanel.tsx +0 -111
  68. package/src/layout/Shell.tsx +0 -91
  69. package/src/layout/SidePanel.tsx +0 -316
  70. package/src/layout/StickyBanner.tsx +0 -83
  71. package/src/layout/Topbar.tsx +0 -68
  72. package/src/layout/index.ts +0 -24
  73. package/src/layout/useNavRailState.ts +0 -69
  74. package/src/lib/time-utils.ts +0 -44
  75. package/src/neobrutalism/Marquee.tsx +0 -81
  76. package/src/neobrutalism/Sticker.tsx +0 -71
  77. package/src/neobrutalism/index.ts +0 -4
  78. package/src/primitives/Avatar.tsx +0 -53
  79. package/src/primitives/Button.tsx +0 -67
  80. package/src/primitives/Card.tsx +0 -41
  81. package/src/primitives/Checkbox.tsx +0 -87
  82. package/src/primitives/Chip.tsx +0 -191
  83. package/src/primitives/Combobox.tsx +0 -507
  84. package/src/primitives/CopyField.tsx +0 -139
  85. package/src/primitives/CountBadge.tsx +0 -50
  86. package/src/primitives/Input.tsx +0 -204
  87. package/src/primitives/Kbd.tsx +0 -45
  88. package/src/primitives/MentionCombobox.tsx +0 -612
  89. package/src/primitives/MultiCombobox.tsx +0 -327
  90. package/src/primitives/PageHeader.tsx +0 -77
  91. package/src/primitives/Radio.tsx +0 -131
  92. package/src/primitives/SegmentedControl.tsx +0 -135
  93. package/src/primitives/Select.tsx +0 -779
  94. package/src/primitives/SignaturePad.tsx +0 -461
  95. package/src/primitives/Tag.tsx +0 -56
  96. package/src/primitives/Textarea.tsx +0 -62
  97. package/src/primitives/ToggleSwitch.tsx +0 -79
  98. package/src/primitives/Tooltip.tsx +0 -213
  99. package/src/primitives/index.ts +0 -53
  100. package/src/pwa/InstallPromptBanner.tsx +0 -132
  101. package/src/pwa/index.ts +0 -4
  102. package/src/pwa/manifest.template.json +0 -20
  103. package/src/pwa/registerSW.ts +0 -55
  104. package/src/riso/Halftone.tsx +0 -85
  105. package/src/riso/Misregister.tsx +0 -63
  106. package/src/riso/RisoStamp.tsx +0 -76
  107. package/src/riso/index.ts +0 -3
  108. package/src/sketch/HandUnderline.tsx +0 -53
  109. package/src/sketch/RoughArrow.tsx +0 -91
  110. package/src/sketch/RoughBox.tsx +0 -73
  111. package/src/sketch/StickyNote.tsx +0 -56
  112. package/src/sketch/index.ts +0 -4
  113. package/src/styles/base.css +0 -186
  114. package/src/styles/chrome-ambient.css +0 -235
  115. package/src/styles/chrome-bento.css +0 -192
  116. package/src/styles/chrome-editorial.css +0 -168
  117. package/src/styles/chrome-neobrutalism.css +0 -326
  118. package/src/styles/chrome-riso.css +0 -339
  119. package/src/styles/chrome-sketch.css +0 -362
  120. package/src/styles/chrome-swiss.css +0 -265
  121. package/src/styles/chrome-terminal.css +0 -272
  122. package/src/styles/fonts.css +0 -1034
  123. package/src/styles/index.css +0 -343
  124. package/src/styles/tokens.css +0 -941
  125. package/src/terminal/AsciiBox.tsx +0 -65
  126. package/src/terminal/BrailleSpinner.tsx +0 -46
  127. package/src/terminal/index.ts +0 -4
  128. package/src/theme/ThemeProvider.tsx +0 -99
  129. package/src/theme/index.ts +0 -6
  130. package/src/theme/inline-script.ts +0 -40
  131. package/src/theme/theme-context.ts +0 -7
  132. package/src/theme/types.ts +0 -39
  133. package/src/theme/useTheme.ts +0 -8
@@ -1,343 +0,0 @@
1
- /* @cosxai/ui — single stylesheet consumers import.
2
- Order matters: fonts → tokens → base → component CSS →
3
- chrome variants. Each chrome-* file is scoped to a
4
- `html[data-ck-chrome="<name>"]` selector so it's a no-op
5
- until that chrome is selected. */
6
-
7
- @import "./fonts.css";
8
- @import "./tokens.css";
9
- @import "./base.css";
10
- @import "./chrome-editorial.css";
11
- @import "./chrome-neobrutalism.css";
12
- @import "./chrome-ambient.css";
13
- @import "./chrome-swiss.css";
14
- @import "./chrome-terminal.css";
15
- @import "./chrome-bento.css";
16
- @import "./chrome-riso.css";
17
- @import "./chrome-sketch.css";
18
-
19
- /* ---------- Button (Phase 0 bootstrap — Phase 3 will replace
20
- this with full variant + size + loading-state styles
21
- keyed off the tokens block). ---------- */
22
-
23
- .ck-btn {
24
- display: inline-flex;
25
- align-items: center;
26
- gap: 8px;
27
- height: 32px;
28
- padding: 0 12px;
29
- border-radius: var(--ck-radius-sm);
30
- font: 500 13px/1 var(--ck-font-sans);
31
- border: 1px solid transparent;
32
- background: transparent;
33
- color: var(--ck-text-primary);
34
- cursor: pointer;
35
- white-space: nowrap;
36
- text-decoration: none;
37
- transition: background var(--ck-dur-fast) var(--ck-ease), border-color var(--ck-dur-fast) var(--ck-ease);
38
- }
39
-
40
- .ck-btn:disabled { opacity: 0.5; cursor: not-allowed; }
41
-
42
- /* Loading spinner — rendered inside a Button when its `loading`
43
- prop is true. CSS-only ring (1.5px stroke, 720ms linear spin).
44
- `currentColor` inherits the variant's foreground so the spinner
45
- reads on primary / secondary / ghost / icon without per-variant
46
- overrides. Reduced-motion users get a slower spin instead of a
47
- frozen ring (which would read as broken). */
48
- .ck-btn-spinner {
49
- width: 0.85em;
50
- height: 0.85em;
51
- border: 1.5px solid currentColor;
52
- border-right-color: transparent;
53
- border-radius: 50%;
54
- display: inline-block;
55
- vertical-align: -0.1em;
56
- flex-shrink: 0;
57
- animation: ck-btn-spin 720ms linear infinite;
58
- }
59
- @keyframes ck-btn-spin {
60
- to { transform: rotate(360deg); }
61
- }
62
- @media (prefers-reduced-motion: reduce) {
63
- .ck-btn-spinner { animation-duration: 2400ms; }
64
- }
65
-
66
- .ck-btn--primary {
67
- background: var(--ck-accent);
68
- color: var(--ck-text-inverse);
69
- }
70
- .ck-btn--primary:hover { background: var(--ck-accent-hover); }
71
-
72
- .ck-btn--secondary {
73
- background: var(--ck-bg-surface);
74
- color: var(--ck-text-primary);
75
- border-color: var(--ck-border-strong);
76
- }
77
- .ck-btn--secondary:hover { background: var(--ck-bg-muted); }
78
-
79
- .ck-btn--ghost {
80
- background: transparent;
81
- color: var(--ck-text-primary);
82
- }
83
- .ck-btn--ghost:hover { background: var(--ck-bg-muted); }
84
-
85
- .ck-btn--icon {
86
- background: transparent;
87
- color: var(--ck-text-secondary);
88
- width: 32px;
89
- padding: 0;
90
- justify-content: center;
91
- }
92
- .ck-btn--icon:hover {
93
- background: var(--ck-bg-muted);
94
- color: var(--ck-text-primary);
95
- }
96
-
97
- /* ---------- Card ---------- */
98
- .ck-card {
99
- background: var(--ck-bg-surface);
100
- border: 1px solid var(--ck-border-subtle);
101
- border-radius: var(--ck-radius-md);
102
- overflow: hidden;
103
- }
104
- html[data-ck-chrome="seamless"] .ck-card {
105
- border-color: transparent;
106
- border-radius: 14px;
107
- box-shadow: var(--ck-shadow-1);
108
- }
109
- .ck-card__head {
110
- padding: 14px 20px;
111
- display: flex;
112
- align-items: center;
113
- gap: 12px;
114
- border-bottom: 1px solid var(--ck-border-subtle);
115
- }
116
- html[data-ck-chrome="seamless"] .ck-card__head {
117
- border-bottom-color: transparent;
118
- padding-bottom: 8px;
119
- }
120
- .ck-card__body {
121
- padding: 20px;
122
- }
123
- .ck-card__foot {
124
- padding: 12px 20px;
125
- border-top: 1px solid var(--ck-border-subtle);
126
- background: var(--ck-bg-surface-2);
127
- }
128
- html[data-ck-chrome="seamless"] .ck-card__foot {
129
- border-top-color: transparent;
130
- background: transparent;
131
- }
132
-
133
- /* ---------- Input + Textarea focus state ---------- */
134
- .ck-input:focus-visible,
135
- .ck-textarea:focus-visible {
136
- border-color: var(--ck-accent) !important;
137
- box-shadow: 0 0 0 3px var(--ck-accent-muted);
138
- }
139
- .ck-input::placeholder,
140
- .ck-textarea::placeholder {
141
- color: var(--ck-text-tertiary);
142
- }
143
-
144
- /* ---------- Input + Textarea disabled state ----------
145
- Native :disabled styling is barely perceptible on a cream / dark
146
- surface, which made disabled fields read as editable in
147
- product-meta's settings (the email field in particular). Match
148
- the .ck-btn:disabled treatment so consumers don't have to
149
- reapply the same opacity / cursor pattern at every call site.
150
-
151
- The addon-wrap variant uses :has(:disabled) so a wrapping
152
- .ck-input-addon-wrap also dims when its inner <input> is disabled
153
- — otherwise the slug input dims but its ".meta.test.cosx.dev"
154
- suffix stays at full opacity, which looks broken. :has() is
155
- supported across all evergreen browsers since 2023; pre-1.0 we
156
- don't need a polyfill. */
157
- .ck-input:disabled,
158
- .ck-textarea:disabled,
159
- .ck-input-addon-wrap:has(:disabled) {
160
- opacity: 0.55;
161
- cursor: not-allowed;
162
- }
163
- .ck-input:disabled,
164
- .ck-textarea:disabled {
165
- background: var(--ck-bg-muted, var(--ck-bg-surface));
166
- }
167
-
168
- /* ---------- Select (custom listbox — never native <select>) ----------
169
- The trigger LOOKS like .ck-input so chrome restyles cascade
170
- uniformly. Chromes that want a different vibe (terminal squared,
171
- sketch hand-drawn, swiss underline-only) override at their own
172
- scope. */
173
- .ck-select-trigger:focus-visible {
174
- border-color: var(--ck-accent) !important;
175
- box-shadow: 0 0 0 3px var(--ck-accent-muted);
176
- }
177
- .ck-select-trigger--disabled {
178
- cursor: not-allowed !important;
179
- }
180
- .ck-select-popover {
181
- animation: ck-popover-enter 140ms var(--ck-ease) both;
182
- transform-origin: top center;
183
- }
184
- .ck-select-option--active {
185
- /* Inline style already paints --ck-bg-muted; this class hook is
186
- left for chrome overrides that want to draw a left-border or
187
- other indicator on the active row. */
188
- }
189
- .ck-select-option--selected {
190
- font-weight: 500;
191
- }
192
-
193
- /* ---------- ActionBar — button row inside <ActionBar> ---------- */
194
- .ck-actionbar-btn {
195
- display: inline-flex;
196
- align-items: center;
197
- gap: 6px;
198
- height: 36px;
199
- padding: 0 12px;
200
- border: 1px solid transparent;
201
- background: transparent;
202
- color: var(--ck-text-primary);
203
- font: 500 13px/1 var(--ck-font-sans);
204
- border-radius: 999px;
205
- cursor: pointer;
206
- white-space: nowrap;
207
- transition: background var(--ck-dur-fast) var(--ck-ease), color var(--ck-dur-fast) var(--ck-ease);
208
- }
209
- .ck-actionbar-btn:hover:not(:disabled):not(.ck-actionbar-btn--primary) {
210
- background: var(--ck-bg-muted);
211
- }
212
- /* Children inside an open disclosure group sit on top of the wrapper's
213
- --ck-accent-muted pill. The default gray hover above reads as a hue
214
- collision against the coral/indigo wrapper — swap in an accent-blended
215
- overlay so the hover signal stays in the accent family.
216
-
217
- 30% blend (was 18% in 0.4.5): 18% layered onto an --ck-accent-muted
218
- wrapper (already 8–14% accent depending on chrome) composites to
219
- ~30% effective saturation. At that low saturation translucent
220
- orange / coral / blue all read as washed-out salmon — the hover
221
- loses its hue identity against the solid --ck-accent text right
222
- beside it. 30% pushes the overlay past the "dilution reads as
223
- pink" inflection so the workspace's actual brand colour is
224
- recognisable. */
225
- .ck-actionbar-group--open .ck-actionbar-btn:hover:not(:disabled):not(.ck-actionbar-btn--primary) {
226
- background: color-mix(in oklab, var(--ck-accent) 30%, transparent);
227
- }
228
- .ck-actionbar-btn--primary {
229
- background: var(--ck-accent);
230
- color: var(--ck-text-inverse);
231
- }
232
- .ck-actionbar-btn--primary:hover:not(:disabled) {
233
- background: var(--ck-accent-hover);
234
- }
235
- .ck-actionbar-btn:disabled {
236
- opacity: 0.5;
237
- cursor: not-allowed;
238
- }
239
-
240
- /* Icon glyph wrapper — sized larger than the button's 13 px label
241
- text so unicode symbols (◐ ☀ ☾ ◇) and small SVGs read clearly.
242
- ActionBarButton wraps the icon prop in this span automatically;
243
- callers don't need to opt in. The 1 px upward translate
244
- compensates for geometric glyphs sitting about 1 px below their
245
- em-box centre — flex centring otherwise leaves them looking
246
- slightly low next to the heavier label text. */
247
- .ck-actionbar-icon {
248
- display: inline-flex;
249
- align-items: center;
250
- justify-content: center;
251
- font-size: 16px;
252
- line-height: 1;
253
- transform: translateY(-1px);
254
- }
255
-
256
- /* Hide labels + keyboard-shortcut hints below 768 px (the standard
257
- md breakpoint). Icons + tooltips remain — the bar's still
258
- informative on phones, and there's no physical keyboard so the
259
- shortcut badge has nothing to advertise. */
260
- @media (max-width: 767px) {
261
- .ck-actionbar-label,
262
- .ck-actionbar-hint {
263
- display: none;
264
- }
265
- }
266
-
267
- /* Spring entry from the left edge — only applied when the bar
268
- sits at its default centred position. A dragged custom position
269
- doesn't replay this on mount. Back-out easing overshoots ~10%
270
- so the bar reads as "stuck to the edge". */
271
- @keyframes ck-actionbar-enter {
272
- from {
273
- opacity: 0;
274
- transform: translateX(calc(-50% - 240px));
275
- }
276
- to {
277
- opacity: 1;
278
- transform: translateX(-50%);
279
- }
280
- }
281
- .ck-actionbar-enter {
282
- animation: ck-actionbar-enter 360ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
283
- }
284
-
285
- /* Phone collapsed-to-handle peek-in animation. Pairs with the
286
- half-pill render path in ActionBar.tsx. */
287
- @keyframes ck-action-handle-enter {
288
- from {
289
- opacity: 0;
290
- transform: translateX(-110%);
291
- }
292
- to {
293
- opacity: 1;
294
- transform: translateX(0);
295
- }
296
- }
297
- .ck-action-handle-enter {
298
- animation: ck-action-handle-enter 320ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
299
- }
300
-
301
- @media (prefers-reduced-motion: reduce) {
302
- .ck-actionbar-enter,
303
- .ck-action-handle-enter {
304
- animation: none;
305
- }
306
- }
307
-
308
- /* ---------- Input bare mode + MultiCombobox inline field ----------
309
- `.ck-input--bare` is an <input> whose FIELD is drawn by its host
310
- (MultiCombobox inline layout: chips + input in one frame). Chrome
311
- presets restyle `.ck-input` with !important at up to (0,5,1)
312
- specificity, so this rule uses `:not(#\#)` to out-rank them and
313
- strip every trace of field chrome back off. */
314
- .ck-input.ck-input--bare:not(#\#) {
315
- background: transparent !important;
316
- border: none !important;
317
- border-radius: 0 !important;
318
- box-shadow: none !important;
319
- outline: none !important;
320
- height: 28px !important;
321
- padding: 0 4px !important;
322
- }
323
-
324
- /* The host-drawn field: looks like .ck-input, carries the focus ring
325
- via :focus-within, the invalid border via :has([aria-invalid]) and
326
- the disabled dim via :has(:disabled). */
327
- .ck-multi-combobox-field:focus-within {
328
- border-color: var(--ck-accent) !important;
329
- box-shadow: 0 0 0 3px var(--ck-accent-muted);
330
- }
331
- .ck-multi-combobox-field:has(.ck-input[aria-invalid="true"]) {
332
- border-color: var(--ck-critical) !important;
333
- }
334
- .ck-multi-combobox-field:has(.ck-input:disabled) {
335
- opacity: 0.55;
336
- cursor: not-allowed;
337
- }
338
- .ck-multi-combobox-invalid-hint {
339
- display: none;
340
- }
341
- .ck-multi-combobox-field:has(.ck-input[aria-invalid="true"]) + .ck-multi-combobox-invalid-hint {
342
- display: block;
343
- }