@aggc/ui 0.8.0 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aggc/ui",
3
- "version": "0.8.0",
3
+ "version": "1.0.0",
4
4
  "description": "Shared Vue UI primitives, patterns, and tokens for AGGC desktop and web.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -0,0 +1,493 @@
1
+ import { css } from "@styled/css";
2
+
3
+ // ── Toolbar ──
4
+
5
+ export const toolbar = css({
6
+ display: { base: "none", md: "flex" },
7
+ alignItems: "center",
8
+ gap: "3",
9
+ pb: "3",
10
+ flexWrap: "wrap",
11
+ });
12
+
13
+ export const searchWrap = css({
14
+ position: "relative",
15
+ flex: "1",
16
+ maxW: { base: "100%", lg: "360px" },
17
+ minW: { base: "0", lg: "180px" },
18
+ });
19
+
20
+ export const searchIcon = css({
21
+ position: "absolute",
22
+ left: "3",
23
+ top: "50%",
24
+ transform: "translateY(-50%)",
25
+ w: "4",
26
+ h: "4",
27
+ color: "text.muted",
28
+ pointerEvents: "none",
29
+ });
30
+
31
+ export const searchInput = css({
32
+ w: "full",
33
+ pl: "9",
34
+ pr: "9",
35
+ py: { base: "2.5", md: "2" },
36
+ borderRadius: { base: "xl", md: "lg" },
37
+ border: "1px solid",
38
+ borderColor: "border.soft",
39
+ bg: { base: "bg.cardAlt", md: "bg.input" },
40
+ color: "text.primary",
41
+ fontSize: "sm",
42
+ transition: "border-color 160ms ease-out, box-shadow 160ms ease-out",
43
+ _placeholder: { color: "text.muted" },
44
+ _focusVisible: {
45
+ outline: "none",
46
+ borderColor: "border.accent",
47
+ boxShadow: "0 0 0 3px var(--colors-bg-accentSoft)",
48
+ },
49
+ });
50
+
51
+ export const searchClear = css({
52
+ position: "absolute",
53
+ right: "2",
54
+ top: "50%",
55
+ transform: "translateY(-50%)",
56
+ w: "6",
57
+ h: "6",
58
+ borderRadius: "full",
59
+ border: "none",
60
+ bg: "transparent",
61
+ color: "text.muted",
62
+ cursor: "pointer",
63
+ display: "flex",
64
+ alignItems: "center",
65
+ justifyContent: "center",
66
+ transition: "color 160ms ease-out, background-color 160ms ease-out",
67
+ _hover: { color: "text.primary", bg: "bg.hover" },
68
+ });
69
+
70
+ export const searchClearIcon = css({
71
+ w: "3.5",
72
+ h: "3.5",
73
+ });
74
+
75
+ // ── Bulk bar ──
76
+
77
+ export const bulkBar = css({
78
+ display: "flex",
79
+ alignItems: "center",
80
+ gap: "2",
81
+ marginLeft: "auto",
82
+ flexShrink: "0",
83
+ whiteSpace: "nowrap",
84
+ });
85
+
86
+ export const bulkCount = css({
87
+ fontSize: "xs",
88
+ fontWeight: "600",
89
+ color: "text.accent",
90
+ });
91
+
92
+ // ── Table ──
93
+
94
+ export const table = css({
95
+ display: { base: "none", md: "block" },
96
+ border: "1px solid",
97
+ borderColor: "border.soft",
98
+ borderRadius: "lg",
99
+ overflow: "hidden",
100
+ });
101
+
102
+ export const tableHead = css({
103
+ display: "grid",
104
+ alignItems: "center",
105
+ gap: "3",
106
+ px: "4",
107
+ py: "2.5",
108
+ position: "sticky",
109
+ top: "0",
110
+ zIndex: "2",
111
+ bg: "bg.card",
112
+ });
113
+
114
+ export const tableBody = css({
115
+ display: "flex",
116
+ flexDirection: "column",
117
+ maxH: "calc(100vh - 320px)",
118
+ overflowY: "auto",
119
+ });
120
+
121
+ export const tableRow = css({
122
+ display: "grid",
123
+ alignItems: "center",
124
+ gap: "3",
125
+ px: "4",
126
+ py: "2.5",
127
+ // Very subtle inter-row separator. Raw rgba (with _dark override) instead of
128
+ // the border.soft token so it never falls back to currentColor if the token
129
+ // var is unresolved in a consumer's dev context.
130
+ borderBottomWidth: "1px",
131
+ borderBottomStyle: "solid",
132
+ borderBottomColor: "rgba(15,23,42,0.05)",
133
+ _dark: { borderBottomColor: "rgba(255,255,255,0.06)" },
134
+ transition: "background-color 160ms ease-out",
135
+ _last: { borderBottom: "none" },
136
+ _hover: { bg: "bg.hover" },
137
+ userSelect: "none",
138
+ });
139
+
140
+ export const headerCell = css({
141
+ display: "flex",
142
+ alignItems: "center",
143
+ minWidth: "0",
144
+ });
145
+
146
+ export const headerLabel = css({
147
+ fontSize: "xs",
148
+ fontWeight: "600",
149
+ color: "text.muted",
150
+ textTransform: "uppercase",
151
+ letterSpacing: "0.05em",
152
+ userSelect: "none",
153
+ });
154
+
155
+ export const sortBtn = css({
156
+ display: "inline-flex",
157
+ alignItems: "center",
158
+ gap: "1",
159
+ bg: "transparent",
160
+ border: "none",
161
+ padding: "0",
162
+ cursor: "pointer",
163
+ color: "text.muted",
164
+ font: "inherit",
165
+ textTransform: "uppercase",
166
+ letterSpacing: "0.05em",
167
+ fontSize: "xs",
168
+ fontWeight: "600",
169
+ transition: "color 160ms ease-out",
170
+ _hover: { color: "text.secondary" },
171
+ });
172
+
173
+ export const sortIcon = css({
174
+ w: "3",
175
+ h: "3",
176
+ opacity: "0.5",
177
+ });
178
+
179
+ export const sortIconActive = css({
180
+ opacity: "1",
181
+ color: "text.accent",
182
+ });
183
+
184
+ export const dataCell = css({
185
+ display: "flex",
186
+ alignItems: "center",
187
+ minWidth: "0",
188
+ });
189
+
190
+ export const actionsCell = css({
191
+ display: "flex",
192
+ alignItems: "center",
193
+ justifyContent: "flex-end",
194
+ });
195
+
196
+ export const hideMobileCell = css({
197
+ display: { base: "none", lg: "flex" },
198
+ });
199
+
200
+ // ── Checkbox ──
201
+
202
+ export const checkCell = css({
203
+ display: "flex",
204
+ alignItems: "center",
205
+ justifyContent: "center",
206
+ });
207
+
208
+ export const nativeCheckbox = css({
209
+ display: "flex",
210
+ alignItems: "center",
211
+ justifyContent: "center",
212
+ w: "4",
213
+ h: "4",
214
+ borderRadius: "sm",
215
+ border: "1px solid",
216
+ borderColor: "border.default",
217
+ bg: "transparent",
218
+ cursor: "pointer",
219
+ flexShrink: "0",
220
+ transition: "background-color 160ms ease, border-color 160ms ease",
221
+ "&.checked": {
222
+ bg: "bg.accentStrong",
223
+ borderColor: "border.accent",
224
+ },
225
+ });
226
+
227
+ export const checkIcon = css({
228
+ w: "3",
229
+ h: "3",
230
+ color: "text.inverse",
231
+ });
232
+
233
+ // ── Menu button ──
234
+
235
+ export const menuBtn = css({
236
+ display: "flex",
237
+ alignItems: "center",
238
+ justifyContent: "center",
239
+ w: "8",
240
+ h: "8",
241
+ borderRadius: "md",
242
+ border: "none",
243
+ bg: "transparent",
244
+ color: "text.muted",
245
+ cursor: "pointer",
246
+ transition: "background-color 160ms ease-out, color 160ms ease-out",
247
+ _hover: { bg: "bg.hover", color: "text.secondary" },
248
+ });
249
+
250
+ export const menuBtnIcon = css({
251
+ w: "4",
252
+ h: "4",
253
+ });
254
+
255
+ // ── Dropdown menu ──
256
+
257
+ export const actionMenu = css({
258
+ bg: "bg.menu",
259
+ border: "1px solid",
260
+ borderColor: "border.soft",
261
+ borderRadius: "lg",
262
+ boxShadow:
263
+ "0 12px 40px -8px rgba(15,23,42,0.12), 0 4px 12px -4px rgba(15,23,42,0.06)",
264
+ minW: "180px",
265
+ py: "1",
266
+ zIndex: "60",
267
+ _dark: {
268
+ boxShadow:
269
+ "0 12px 40px -8px rgba(0,0,0,0.56), 0 4px 12px -4px rgba(0,0,0,0.32)",
270
+ },
271
+ });
272
+
273
+ export const menuItem = css({
274
+ px: "3",
275
+ py: "2.5",
276
+ fontSize: "sm",
277
+ color: "text.secondary",
278
+ cursor: "pointer",
279
+ bg: "transparent",
280
+ border: "none",
281
+ textAlign: "left",
282
+ w: "full",
283
+ transition: "background-color 160ms ease-out, color 160ms ease-out",
284
+ _hover: { bg: "bg.hover", color: "text.primary" },
285
+ });
286
+
287
+ export const menuItemDanger = css({
288
+ color: "text.error",
289
+ _hover: { bg: "bg.dangerSoft", color: "text.error" },
290
+ });
291
+
292
+ export const menuSeparator = css({
293
+ h: "1px",
294
+ bg: "border.soft",
295
+ mx: "2",
296
+ my: "1",
297
+ });
298
+
299
+ // ── Mobile ──
300
+
301
+ export const mobileList = css({
302
+ display: { base: "flex", md: "none" },
303
+ flexDirection: "column",
304
+ gap: "2",
305
+ });
306
+
307
+ export const mobileCard = css({
308
+ bg: "bg.card",
309
+ borderRadius: "lg",
310
+ border: "1px solid",
311
+ borderColor: "border.soft",
312
+ px: "4",
313
+ py: "3",
314
+ display: "flex",
315
+ flexDirection: "column",
316
+ gap: "3",
317
+ transition: "background-color 120ms ease-out, border-color 120ms ease-out",
318
+ });
319
+
320
+ export const mobileCardSelected = css({
321
+ borderColor: "border.accent",
322
+ bg: "bg.accentSoft",
323
+ });
324
+
325
+ // ── States ──
326
+
327
+ export const filteredEmpty = css({
328
+ display: "flex",
329
+ flexDirection: "column",
330
+ alignItems: "center",
331
+ justifyContent: "center",
332
+ py: "16",
333
+ px: "4",
334
+ color: "text.secondary",
335
+ textAlign: "center",
336
+ gap: "4",
337
+ });
338
+
339
+ export const filteredEmptyIcon = css({
340
+ w: "10",
341
+ h: "10",
342
+ color: "text.muted",
343
+ opacity: "0.4",
344
+ });
345
+
346
+ export const filteredEmptyTitle = css({
347
+ fontFamily: "heading",
348
+ fontSize: "md",
349
+ fontWeight: "600",
350
+ color: "text.primary",
351
+ });
352
+
353
+ export const filteredEmptyDesc = css({
354
+ color: "text.secondary",
355
+ fontSize: "sm",
356
+ maxWidth: "90",
357
+ lineHeight: "1.6",
358
+ });
359
+
360
+ export const clearSearchBtn = css({
361
+ display: "inline-flex",
362
+ alignItems: "center",
363
+ px: "4",
364
+ py: "1.5",
365
+ fontSize: "sm",
366
+ color: "text.secondary",
367
+ bg: "transparent",
368
+ border: "1px solid",
369
+ borderColor: "border.soft",
370
+ borderRadius: "md",
371
+ cursor: "pointer",
372
+ transition: "background-color 160ms ease, color 160ms ease",
373
+ _hover: { bg: "bg.hover", color: "text.primary" },
374
+ });
375
+
376
+ export const listFooter = css({
377
+ display: "flex",
378
+ alignItems: "center",
379
+ justifyContent: "center",
380
+ gap: "3",
381
+ pt: "3",
382
+ flexWrap: "wrap",
383
+ });
384
+
385
+ export const footerCount = css({
386
+ fontSize: "xs",
387
+ color: "text.muted",
388
+ fontWeight: "500",
389
+ });
390
+
391
+ export const pageBtn = css({
392
+ display: "inline-flex",
393
+ alignItems: "center",
394
+ justifyContent: "center",
395
+ w: "7",
396
+ h: "7",
397
+ borderRadius: "md",
398
+ border: "1px solid",
399
+ borderColor: "border.soft",
400
+ bg: "transparent",
401
+ color: "text.secondary",
402
+ cursor: "pointer",
403
+ transition: "background-color 160ms ease, color 160ms ease",
404
+ _hover: { bg: "bg.hover", color: "text.primary" },
405
+ _disabled: { opacity: "0.4", cursor: "not-allowed", _hover: { bg: "transparent", color: "text.secondary" } },
406
+ });
407
+
408
+ export const pageInfo = css({
409
+ fontSize: "xs",
410
+ color: "text.muted",
411
+ fontWeight: "500",
412
+ whiteSpace: "nowrap",
413
+ });
414
+
415
+ // ── Mobile toolbar ──
416
+
417
+ export const mobileToolbar = css({
418
+ display: { base: "flex", md: "none" },
419
+ flexDirection: "column",
420
+ position: "sticky",
421
+ top: "0",
422
+ zIndex: "10",
423
+ bg: "bg.canvas",
424
+ pb: "1",
425
+ mb: "2",
426
+ boxShadow: "0 6px 16px -2px rgba(15,23,42,0.10)",
427
+ _dark: {
428
+ boxShadow: "0 6px 16px -2px rgba(0,0,0,0.40)",
429
+ },
430
+ });
431
+
432
+ export const mobileSearchRow = css({
433
+ display: { base: "flex", md: "none" },
434
+ pt: "3",
435
+ pb: "2",
436
+ px: "4",
437
+ });
438
+
439
+ export const mobileActionsRow = css({
440
+ display: { base: "flex", md: "none" },
441
+ alignItems: "center",
442
+ gap: "2",
443
+ h: "10",
444
+ px: "4",
445
+ pb: "2",
446
+ flexWrap: "wrap",
447
+ overflow: "hidden",
448
+ });
449
+
450
+ export const mobileSelectAll = css({
451
+ display: "flex",
452
+ alignItems: "center",
453
+ gap: "2",
454
+ fontSize: "sm",
455
+ color: "text.secondary",
456
+ cursor: "pointer",
457
+ bg: "transparent",
458
+ border: "none",
459
+ padding: "0",
460
+ flexShrink: "0",
461
+ whiteSpace: "nowrap",
462
+ });
463
+
464
+ export const mobileBulkActions = css({
465
+ display: "flex",
466
+ alignItems: "center",
467
+ gap: "2",
468
+ marginLeft: "auto",
469
+ flexShrink: "0",
470
+ });
471
+
472
+ // ── Deselect button (in bulk bar) ──
473
+
474
+ export const deselectBtn = css({
475
+ display: "flex",
476
+ alignItems: "center",
477
+ justifyContent: "center",
478
+ w: "6",
479
+ h: "6",
480
+ borderRadius: "md",
481
+ border: "none",
482
+ bg: "transparent",
483
+ color: "text.muted",
484
+ cursor: "pointer",
485
+ transition: "background-color 160ms ease-out, color 160ms ease-out",
486
+ _hover: { bg: "bg.hover", color: "text.secondary" },
487
+ });
488
+
489
+ export const deselectIcon = css({
490
+ w: "3.5",
491
+ h: "3.5",
492
+ color: "text.muted",
493
+ });