@cosxai/ui 0.24.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.
- package/CHANGELOG.md +577 -0
- package/NOTICE +11 -0
- package/README.md +52 -0
- package/package.json +33 -7
- package/src/fonts.css +20 -0
- package/src/index.ts +8 -25
- package/src/lib/cn.ts +23 -6
- package/src/styles.css +17 -0
- package/src/theme.css +132 -0
- package/src/tokens/colors.css +112 -0
- package/src/tokens/compat.css +36 -0
- package/src/tokens/elevation.css +14 -0
- package/src/tokens/motion.css +42 -0
- package/src/tokens/spacing.css +55 -0
- package/src/tokens/typography-cjk.css +42 -0
- package/src/tokens/typography.css +81 -0
- package/src/actionbar/ActionBar.tsx +0 -837
- package/src/actionbar/ActionBarButton.tsx +0 -111
- package/src/actionbar/ActionBarMenuGroup.tsx +0 -116
- package/src/actionbar/ActionBarModeHandle.tsx +0 -171
- package/src/actionbar/ActionBarProvider.tsx +0 -91
- package/src/actionbar/actionbar-context.ts +0 -45
- package/src/actionbar/index.ts +0 -28
- package/src/actionbar/types.ts +0 -147
- package/src/actionbar/useActionBarItems.ts +0 -60
- package/src/actionbar/useActionBarMode.ts +0 -144
- package/src/actionbar/useActionBarPanel.ts +0 -56
- package/src/actionbar/useActionBarStatusDot.ts +0 -49
- package/src/actionbar/useActionBarToast.ts +0 -33
- package/src/ambient/AmbientBackdrop.tsx +0 -74
- package/src/ambient/CommandInput.tsx +0 -107
- package/src/ambient/SuperbarStrip.tsx +0 -36
- package/src/ambient/index.ts +0 -6
- package/src/bento/BentoCell.tsx +0 -66
- package/src/bento/BentoGrid.tsx +0 -42
- package/src/bento/index.ts +0 -2
- package/src/command/CommandPalette.tsx +0 -329
- package/src/command/CommandProvider.tsx +0 -57
- package/src/command/command-context.ts +0 -12
- package/src/command/index.ts +0 -6
- package/src/command/rank.ts +0 -50
- package/src/command/types.ts +0 -37
- package/src/command/useCommandSource.ts +0 -37
- package/src/dialogs/DialogsProvider.tsx +0 -216
- package/src/dialogs/Modal.tsx +0 -260
- package/src/dialogs/Toast.tsx +0 -85
- package/src/dialogs/dialogs-context.ts +0 -6
- package/src/dialogs/index.ts +0 -10
- package/src/dialogs/types.ts +0 -37
- package/src/dialogs/useDialogs.ts +0 -8
- package/src/editorial/EditorialSpotlight.tsx +0 -63
- package/src/editorial/Folio.tsx +0 -52
- package/src/editorial/PlateMarker.tsx +0 -33
- package/src/editorial/RomanSection.tsx +0 -65
- package/src/editorial/RunningMarginalia.tsx +0 -65
- package/src/editorial/index.ts +0 -10
- package/src/hooks/index.ts +0 -5
- package/src/hooks/useKeyboardHotkey.ts +0 -93
- package/src/hooks/useReducedMotion.ts +0 -20
- package/src/hooks/useViewport.ts +0 -61
- package/src/layout/Breadcrumb.tsx +0 -74
- package/src/layout/LeftNavRail.tsx +0 -139
- package/src/layout/MobileTabBar.tsx +0 -101
- package/src/layout/NavItem.tsx +0 -128
- package/src/layout/NavSearchTrigger.tsx +0 -88
- package/src/layout/NavSection.tsx +0 -40
- package/src/layout/RightSidebarPanel.tsx +0 -111
- package/src/layout/Shell.tsx +0 -91
- package/src/layout/SidePanel.tsx +0 -316
- package/src/layout/StickyBanner.tsx +0 -83
- package/src/layout/Topbar.tsx +0 -68
- package/src/layout/index.ts +0 -24
- package/src/layout/useNavRailState.ts +0 -69
- package/src/lib/time-utils.ts +0 -44
- package/src/neobrutalism/Marquee.tsx +0 -81
- package/src/neobrutalism/Sticker.tsx +0 -71
- package/src/neobrutalism/index.ts +0 -4
- package/src/primitives/Avatar.tsx +0 -53
- package/src/primitives/Button.tsx +0 -67
- package/src/primitives/Card.tsx +0 -41
- package/src/primitives/Checkbox.tsx +0 -87
- package/src/primitives/Chip.tsx +0 -177
- package/src/primitives/Combobox.tsx +0 -475
- package/src/primitives/CopyField.tsx +0 -139
- package/src/primitives/CountBadge.tsx +0 -50
- package/src/primitives/Input.tsx +0 -161
- package/src/primitives/Kbd.tsx +0 -45
- package/src/primitives/MentionCombobox.tsx +0 -612
- package/src/primitives/MultiCombobox.tsx +0 -179
- package/src/primitives/PageHeader.tsx +0 -77
- package/src/primitives/Radio.tsx +0 -131
- package/src/primitives/SegmentedControl.tsx +0 -135
- package/src/primitives/Select.tsx +0 -779
- package/src/primitives/SignaturePad.tsx +0 -461
- package/src/primitives/Tag.tsx +0 -56
- package/src/primitives/Textarea.tsx +0 -62
- package/src/primitives/ToggleSwitch.tsx +0 -79
- package/src/primitives/Tooltip.tsx +0 -213
- package/src/primitives/index.ts +0 -48
- package/src/pwa/InstallPromptBanner.tsx +0 -132
- package/src/pwa/index.ts +0 -4
- package/src/pwa/manifest.template.json +0 -20
- package/src/pwa/registerSW.ts +0 -55
- package/src/riso/Halftone.tsx +0 -85
- package/src/riso/Misregister.tsx +0 -63
- package/src/riso/RisoStamp.tsx +0 -76
- package/src/riso/index.ts +0 -3
- package/src/sketch/HandUnderline.tsx +0 -53
- package/src/sketch/RoughArrow.tsx +0 -91
- package/src/sketch/RoughBox.tsx +0 -73
- package/src/sketch/StickyNote.tsx +0 -56
- package/src/sketch/index.ts +0 -4
- package/src/styles/base.css +0 -186
- package/src/styles/chrome-ambient.css +0 -235
- package/src/styles/chrome-bento.css +0 -192
- package/src/styles/chrome-editorial.css +0 -168
- package/src/styles/chrome-neobrutalism.css +0 -326
- package/src/styles/chrome-riso.css +0 -339
- package/src/styles/chrome-sketch.css +0 -362
- package/src/styles/chrome-swiss.css +0 -265
- package/src/styles/chrome-terminal.css +0 -272
- package/src/styles/fonts.css +0 -1034
- package/src/styles/index.css +0 -306
- package/src/styles/tokens.css +0 -941
- package/src/terminal/AsciiBox.tsx +0 -65
- package/src/terminal/BrailleSpinner.tsx +0 -46
- package/src/terminal/index.ts +0 -4
- package/src/theme/ThemeProvider.tsx +0 -99
- package/src/theme/index.ts +0 -6
- package/src/theme/inline-script.ts +0 -40
- package/src/theme/theme-context.ts +0 -7
- package/src/theme/types.ts +0 -39
- package/src/theme/useTheme.ts +0 -8
package/src/styles/index.css
DELETED
|
@@ -1,306 +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
|
-
}
|