@salemcobalt/ui 0.2.0-rc.4 → 0.2.0-rc.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/README.md +23 -19
- package/dist/index.d.ts +419 -12
- package/dist/index.js +293 -35
- package/dist/index.js.map +1 -1
- package/dist/styles.css +481 -3
- package/package.json +4 -4
package/dist/styles.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @salemcobalt/ui 0.2.0-rc.
|
|
1
|
+
/* @salemcobalt/ui 0.2.0-rc.6 — requires @salemcobalt/tokens/css. */
|
|
2
2
|
@layer sc {
|
|
3
3
|
/* ---- base.css ---- */
|
|
4
4
|
/* Shared: focus ring, reduced motion. Component files follow. */
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
.sc-input:focus-visible,
|
|
11
11
|
.sc-select:focus-visible,
|
|
12
12
|
.sc-select__item:focus-visible,
|
|
13
|
+
.sc-select__clear:focus-visible,
|
|
13
14
|
.sc-checkbox:focus-visible,
|
|
14
15
|
.sc-switch:focus-visible,
|
|
15
16
|
.sc-tabs__tab:focus-visible,
|
|
@@ -513,6 +514,9 @@
|
|
|
513
514
|
--_p: var(--sc-spacing-lg);
|
|
514
515
|
}
|
|
515
516
|
.sc-card[data-variant='elevated'] {
|
|
517
|
+
/* Hover and pressed washes inside a raised surface use the raised tokens, so they show against it (docs/adr/0003). */
|
|
518
|
+
--sc-color-surface-hover: var(--sc-color-surface-raised-hover);
|
|
519
|
+
--sc-color-surface-active: var(--sc-color-surface-raised-active);
|
|
516
520
|
box-shadow: var(--sc-elevation-1);
|
|
517
521
|
border-color: transparent;
|
|
518
522
|
}
|
|
@@ -749,6 +753,9 @@
|
|
|
749
753
|
padding: var(--sc-spacing-lg);
|
|
750
754
|
border-radius: var(--sc-radius-xl);
|
|
751
755
|
background: var(--sc-color-surface-raised);
|
|
756
|
+
/* Hover and pressed washes inside a raised surface use the raised tokens, so they show against it (docs/adr/0003). */
|
|
757
|
+
--sc-color-surface-hover: var(--sc-color-surface-raised-hover);
|
|
758
|
+
--sc-color-surface-active: var(--sc-color-surface-raised-active);
|
|
752
759
|
color: var(--sc-color-text-default);
|
|
753
760
|
border: var(--sc-border-width-hairline) solid var(--sc-color-border-default);
|
|
754
761
|
box-shadow: var(--sc-elevation-3);
|
|
@@ -1006,6 +1013,9 @@
|
|
|
1006
1013
|
padding: var(--sc-spacing-2xs);
|
|
1007
1014
|
border-radius: var(--sc-radius-lg);
|
|
1008
1015
|
background: var(--sc-color-surface-raised);
|
|
1016
|
+
/* Hover and pressed washes inside a raised surface use the raised tokens, so they show against it (docs/adr/0003). */
|
|
1017
|
+
--sc-color-surface-hover: var(--sc-color-surface-raised-hover);
|
|
1018
|
+
--sc-color-surface-active: var(--sc-color-surface-raised-active);
|
|
1009
1019
|
color: var(--sc-color-text-default);
|
|
1010
1020
|
border: var(--sc-border-width-hairline) solid var(--sc-color-border-default);
|
|
1011
1021
|
box-shadow: var(--sc-elevation-2);
|
|
@@ -1041,7 +1051,7 @@
|
|
|
1041
1051
|
border-radius: var(--sc-radius-sm);
|
|
1042
1052
|
color: var(--sc-color-text-default);
|
|
1043
1053
|
text-decoration: none;
|
|
1044
|
-
cursor:
|
|
1054
|
+
cursor: pointer;
|
|
1045
1055
|
user-select: none;
|
|
1046
1056
|
outline: 0;
|
|
1047
1057
|
}
|
|
@@ -1178,6 +1188,7 @@
|
|
|
1178
1188
|
min-inline-size: 0;
|
|
1179
1189
|
}
|
|
1180
1190
|
.sc-input {
|
|
1191
|
+
appearance: none;
|
|
1181
1192
|
box-sizing: border-box;
|
|
1182
1193
|
inline-size: 100%;
|
|
1183
1194
|
min-inline-size: 0;
|
|
@@ -1215,6 +1226,30 @@
|
|
|
1215
1226
|
color: var(--sc-color-text-subtle);
|
|
1216
1227
|
cursor: not-allowed;
|
|
1217
1228
|
}
|
|
1229
|
+
/* Native date, time and number fields: same box, tabular digits, the picker indicator at the end edge. */
|
|
1230
|
+
.sc-input:is(
|
|
1231
|
+
[type='date'],
|
|
1232
|
+
[type='time'],
|
|
1233
|
+
[type='datetime-local'],
|
|
1234
|
+
[type='month'],
|
|
1235
|
+
[type='week'],
|
|
1236
|
+
[type='number']
|
|
1237
|
+
) {
|
|
1238
|
+
font-variant-numeric: tabular-nums;
|
|
1239
|
+
}
|
|
1240
|
+
.sc-input::-webkit-date-and-time-value {
|
|
1241
|
+
min-block-size: 1lh;
|
|
1242
|
+
text-align: start;
|
|
1243
|
+
}
|
|
1244
|
+
.sc-input::-webkit-calendar-picker-indicator {
|
|
1245
|
+
margin-inline-start: var(--sc-spacing-xs);
|
|
1246
|
+
padding: 0;
|
|
1247
|
+
opacity: 0.7;
|
|
1248
|
+
cursor: pointer;
|
|
1249
|
+
}
|
|
1250
|
+
.sc-input::-webkit-calendar-picker-indicator:hover {
|
|
1251
|
+
opacity: 1;
|
|
1252
|
+
}
|
|
1218
1253
|
.sc-input-wrap[data-icon-start] > .sc-input {
|
|
1219
1254
|
padding-inline-start: calc(var(--_px) + var(--sc-size-icon-md) + var(--sc-spacing-xs));
|
|
1220
1255
|
}
|
|
@@ -1252,7 +1287,29 @@
|
|
|
1252
1287
|
.sc-textarea[data-resize='none'] {
|
|
1253
1288
|
resize: none;
|
|
1254
1289
|
}
|
|
1290
|
+
.sc-textarea[data-variant='code'] {
|
|
1291
|
+
font-family: var(--sc-font-family-mono);
|
|
1292
|
+
font-size: calc(var(--_fs) * 0.95);
|
|
1293
|
+
line-height: var(--sc-font-line-height-normal);
|
|
1294
|
+
tab-size: 2;
|
|
1295
|
+
hyphens: none;
|
|
1296
|
+
overflow-wrap: normal;
|
|
1297
|
+
}
|
|
1298
|
+
.sc-textarea[wrap='off'] {
|
|
1299
|
+
white-space: pre;
|
|
1300
|
+
overflow-x: auto;
|
|
1301
|
+
}
|
|
1255
1302
|
/* Select */
|
|
1303
|
+
.sc-select__wrap {
|
|
1304
|
+
position: relative;
|
|
1305
|
+
display: inline-flex;
|
|
1306
|
+
max-inline-size: 100%;
|
|
1307
|
+
align-self: flex-start;
|
|
1308
|
+
}
|
|
1309
|
+
.sc-select__wrap[data-full-width] {
|
|
1310
|
+
display: flex;
|
|
1311
|
+
align-self: stretch;
|
|
1312
|
+
}
|
|
1256
1313
|
.sc-select {
|
|
1257
1314
|
box-sizing: border-box;
|
|
1258
1315
|
display: inline-flex;
|
|
@@ -1284,6 +1341,30 @@
|
|
|
1284
1341
|
inline-size: 100%;
|
|
1285
1342
|
align-self: stretch;
|
|
1286
1343
|
}
|
|
1344
|
+
/* Room for the × between the value and the chevron. The clear button is a sibling, never nested in the trigger. */
|
|
1345
|
+
.sc-select[data-clearable] > .sc-select__icon {
|
|
1346
|
+
margin-inline-start: calc(var(--sc-size-icon-lg) + var(--sc-spacing-2xs));
|
|
1347
|
+
}
|
|
1348
|
+
.sc-select__clear {
|
|
1349
|
+
position: absolute;
|
|
1350
|
+
inset-block-start: 50%;
|
|
1351
|
+
inset-inline-end: calc(var(--sc-spacing-xs) + var(--sc-size-icon-md) + var(--sc-spacing-2xs));
|
|
1352
|
+
translate: 0 -50%;
|
|
1353
|
+
display: inline-grid;
|
|
1354
|
+
place-items: center;
|
|
1355
|
+
inline-size: var(--sc-size-icon-lg);
|
|
1356
|
+
block-size: var(--sc-size-icon-lg);
|
|
1357
|
+
padding: 0;
|
|
1358
|
+
border: 0;
|
|
1359
|
+
border-radius: var(--sc-radius-sm);
|
|
1360
|
+
background: transparent;
|
|
1361
|
+
color: var(--sc-color-text-muted);
|
|
1362
|
+
cursor: pointer;
|
|
1363
|
+
}
|
|
1364
|
+
.sc-select__clear:hover {
|
|
1365
|
+
background: var(--sc-color-surface-hover);
|
|
1366
|
+
color: var(--sc-color-text-default);
|
|
1367
|
+
}
|
|
1287
1368
|
.sc-select:hover:not([data-disabled]) {
|
|
1288
1369
|
border-color: var(--sc-color-text-muted);
|
|
1289
1370
|
}
|
|
@@ -1326,6 +1407,9 @@
|
|
|
1326
1407
|
padding: var(--sc-spacing-2xs);
|
|
1327
1408
|
border-radius: var(--sc-radius-lg);
|
|
1328
1409
|
background: var(--sc-color-surface-raised);
|
|
1410
|
+
/* Hover and pressed washes inside a raised surface use the raised tokens, so they show against it (docs/adr/0003). */
|
|
1411
|
+
--sc-color-surface-hover: var(--sc-color-surface-raised-hover);
|
|
1412
|
+
--sc-color-surface-active: var(--sc-color-surface-raised-active);
|
|
1329
1413
|
color: var(--sc-color-text-default);
|
|
1330
1414
|
border: var(--sc-border-width-hairline) solid var(--sc-color-border-default);
|
|
1331
1415
|
box-shadow: var(--sc-elevation-2);
|
|
@@ -1353,7 +1437,7 @@
|
|
|
1353
1437
|
padding-inline: var(--sc-spacing-xs);
|
|
1354
1438
|
padding-block: var(--sc-spacing-2xs);
|
|
1355
1439
|
border-radius: var(--sc-radius-sm);
|
|
1356
|
-
cursor:
|
|
1440
|
+
cursor: pointer;
|
|
1357
1441
|
user-select: none;
|
|
1358
1442
|
outline: 0;
|
|
1359
1443
|
}
|
|
@@ -2192,4 +2276,398 @@
|
|
|
2192
2276
|
font-size: var(--sc-font-size-xs);
|
|
2193
2277
|
}
|
|
2194
2278
|
|
|
2279
|
+
/* ---- chip.css ---- */
|
|
2280
|
+
/* ---- Chip ------------------------------------------------------------------ */
|
|
2281
|
+
.sc-chip {
|
|
2282
|
+
--_h: var(--sc-size-control-sm);
|
|
2283
|
+
--_px: var(--sc-spacing-sm);
|
|
2284
|
+
--_fs: var(--sc-font-size-sm);
|
|
2285
|
+
--_icon: var(--sc-size-icon-sm);
|
|
2286
|
+
--_bg: transparent;
|
|
2287
|
+
--_fg: var(--sc-color-text-default);
|
|
2288
|
+
--_bd: var(--sc-color-border-strong);
|
|
2289
|
+
--_bg-hover: var(--sc-color-surface-hover);
|
|
2290
|
+
--_bg-on: var(--sc-color-surface-active);
|
|
2291
|
+
--_fg-on: var(--sc-color-text-default);
|
|
2292
|
+
--_bd-on: var(--sc-color-text-muted);
|
|
2293
|
+
position: relative;
|
|
2294
|
+
display: inline-flex;
|
|
2295
|
+
align-items: center;
|
|
2296
|
+
box-sizing: border-box;
|
|
2297
|
+
max-inline-size: 100%;
|
|
2298
|
+
block-size: var(--_h);
|
|
2299
|
+
border-radius: var(--sc-radius-full);
|
|
2300
|
+
border: var(--sc-border-width-hairline) solid var(--_bd);
|
|
2301
|
+
background: var(--_bg);
|
|
2302
|
+
color: var(--_fg);
|
|
2303
|
+
font-family: var(--sc-font-family-sans);
|
|
2304
|
+
font-size: var(--_fs);
|
|
2305
|
+
font-weight: var(--sc-font-weight-medium);
|
|
2306
|
+
line-height: 1;
|
|
2307
|
+
white-space: nowrap;
|
|
2308
|
+
transition:
|
|
2309
|
+
background-color var(--sc-duration-fast) var(--sc-ease-standard),
|
|
2310
|
+
border-color var(--sc-duration-fast) var(--sc-ease-standard),
|
|
2311
|
+
color var(--sc-duration-fast) var(--sc-ease-standard);
|
|
2312
|
+
}
|
|
2313
|
+
.sc-chip[data-size='sm'] {
|
|
2314
|
+
--_h: var(--sc-size-badge-md);
|
|
2315
|
+
--_px: var(--sc-spacing-xs);
|
|
2316
|
+
--_fs: var(--sc-font-size-xs);
|
|
2317
|
+
--_icon: var(--sc-size-icon-xs);
|
|
2318
|
+
}
|
|
2319
|
+
.sc-chip[data-selected] {
|
|
2320
|
+
--_bg: var(--_bg-on);
|
|
2321
|
+
--_fg: var(--_fg-on);
|
|
2322
|
+
--_bd: var(--_bd-on);
|
|
2323
|
+
}
|
|
2324
|
+
.sc-chip[data-disabled] {
|
|
2325
|
+
opacity: 0.5;
|
|
2326
|
+
}
|
|
2327
|
+
/* The text, or the toggle button that holds it. */
|
|
2328
|
+
.sc-chip__action,
|
|
2329
|
+
.sc-chip > .sc-chip__icon,
|
|
2330
|
+
.sc-chip > .sc-chip__label {
|
|
2331
|
+
display: inline-flex;
|
|
2332
|
+
align-items: center;
|
|
2333
|
+
min-inline-size: 0;
|
|
2334
|
+
}
|
|
2335
|
+
.sc-chip > .sc-chip__icon {
|
|
2336
|
+
margin-inline-start: var(--_px);
|
|
2337
|
+
}
|
|
2338
|
+
.sc-chip > .sc-chip__label {
|
|
2339
|
+
padding-inline: var(--_px);
|
|
2340
|
+
}
|
|
2341
|
+
.sc-chip > .sc-chip__icon + .sc-chip__label {
|
|
2342
|
+
padding-inline-start: var(--sc-spacing-2xs);
|
|
2343
|
+
}
|
|
2344
|
+
.sc-chip__action {
|
|
2345
|
+
gap: var(--sc-spacing-2xs);
|
|
2346
|
+
box-sizing: border-box;
|
|
2347
|
+
block-size: 100%;
|
|
2348
|
+
margin: 0;
|
|
2349
|
+
padding-inline: var(--_px);
|
|
2350
|
+
border: 0;
|
|
2351
|
+
border-radius: inherit;
|
|
2352
|
+
background: transparent;
|
|
2353
|
+
color: inherit;
|
|
2354
|
+
font: inherit;
|
|
2355
|
+
line-height: 1;
|
|
2356
|
+
cursor: pointer;
|
|
2357
|
+
}
|
|
2358
|
+
.sc-chip__action:hover:not(:disabled) {
|
|
2359
|
+
background: var(--_bg-hover);
|
|
2360
|
+
}
|
|
2361
|
+
.sc-chip[data-selected] > .sc-chip__action:hover:not(:disabled) {
|
|
2362
|
+
background: transparent;
|
|
2363
|
+
filter: brightness(0.97);
|
|
2364
|
+
}
|
|
2365
|
+
.sc-chip__action:disabled {
|
|
2366
|
+
cursor: not-allowed;
|
|
2367
|
+
}
|
|
2368
|
+
.sc-chip__icon {
|
|
2369
|
+
flex: none;
|
|
2370
|
+
inline-size: var(--_icon);
|
|
2371
|
+
block-size: var(--_icon);
|
|
2372
|
+
}
|
|
2373
|
+
.sc-chip__icon > svg {
|
|
2374
|
+
inline-size: 100%;
|
|
2375
|
+
block-size: 100%;
|
|
2376
|
+
}
|
|
2377
|
+
.sc-chip__label {
|
|
2378
|
+
overflow: hidden;
|
|
2379
|
+
text-overflow: ellipsis;
|
|
2380
|
+
}
|
|
2381
|
+
.sc-chip[data-removable] > .sc-chip__action,
|
|
2382
|
+
.sc-chip[data-removable] > .sc-chip__label {
|
|
2383
|
+
padding-inline-end: var(--sc-spacing-2xs);
|
|
2384
|
+
}
|
|
2385
|
+
.sc-chip__remove {
|
|
2386
|
+
flex: none;
|
|
2387
|
+
display: inline-grid;
|
|
2388
|
+
place-items: center;
|
|
2389
|
+
box-sizing: border-box;
|
|
2390
|
+
inline-size: calc(var(--_h) - 2 * var(--sc-spacing-2xs) - 2px);
|
|
2391
|
+
block-size: calc(var(--_h) - 2 * var(--sc-spacing-2xs) - 2px);
|
|
2392
|
+
margin-inline-end: var(--sc-spacing-2xs);
|
|
2393
|
+
padding: 0;
|
|
2394
|
+
border: 0;
|
|
2395
|
+
border-radius: var(--sc-radius-full);
|
|
2396
|
+
background: transparent;
|
|
2397
|
+
color: inherit;
|
|
2398
|
+
opacity: 0.7;
|
|
2399
|
+
cursor: pointer;
|
|
2400
|
+
}
|
|
2401
|
+
.sc-chip__remove:hover:not(:disabled) {
|
|
2402
|
+
opacity: 1;
|
|
2403
|
+
background: var(--_bg-hover);
|
|
2404
|
+
}
|
|
2405
|
+
.sc-chip__remove:disabled {
|
|
2406
|
+
cursor: not-allowed;
|
|
2407
|
+
}
|
|
2408
|
+
.sc-chip__action:focus-visible,
|
|
2409
|
+
.sc-chip__remove:focus-visible {
|
|
2410
|
+
outline: var(--sc-border-width-focus) solid var(--sc-color-border-focus);
|
|
2411
|
+
outline-offset: 0;
|
|
2412
|
+
}
|
|
2413
|
+
/* 44px hit area on touch without changing layout. */
|
|
2414
|
+
@media (pointer: coarse) {
|
|
2415
|
+
.sc-chip__action::after,
|
|
2416
|
+
.sc-chip__remove::after {
|
|
2417
|
+
content: '';
|
|
2418
|
+
position: absolute;
|
|
2419
|
+
inset: 50% auto auto 50%;
|
|
2420
|
+
translate: -50% -50%;
|
|
2421
|
+
inline-size: max(100%, var(--sc-size-touch-target));
|
|
2422
|
+
block-size: max(100%, var(--sc-size-touch-target));
|
|
2423
|
+
}
|
|
2424
|
+
.sc-chip__action,
|
|
2425
|
+
.sc-chip__remove {
|
|
2426
|
+
position: relative;
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
/* Tones: soft fill when selected, tinted outline otherwise. */
|
|
2430
|
+
.sc-chip[data-tone='accent'] {
|
|
2431
|
+
--_fg: var(--sc-color-accent-text);
|
|
2432
|
+
--_bd: var(--sc-color-accent-text);
|
|
2433
|
+
--_bg-hover: var(--sc-color-accent-subtle);
|
|
2434
|
+
--_bg-on: var(--sc-color-accent-subtle);
|
|
2435
|
+
--_fg-on: var(--sc-color-accent-text);
|
|
2436
|
+
--_bd-on: var(--sc-color-accent-default);
|
|
2437
|
+
}
|
|
2438
|
+
.sc-chip[data-tone='success'] {
|
|
2439
|
+
--_fg: var(--sc-color-success-text);
|
|
2440
|
+
--_bd: var(--sc-color-success-text);
|
|
2441
|
+
--_bg-hover: var(--sc-color-success-subtle);
|
|
2442
|
+
--_bg-on: var(--sc-color-success-subtle);
|
|
2443
|
+
--_fg-on: var(--sc-color-success-text);
|
|
2444
|
+
--_bd-on: var(--sc-color-success-solid);
|
|
2445
|
+
}
|
|
2446
|
+
.sc-chip[data-tone='warning'] {
|
|
2447
|
+
--_fg: var(--sc-color-warning-text);
|
|
2448
|
+
--_bd: var(--sc-color-warning-text);
|
|
2449
|
+
--_bg-hover: var(--sc-color-warning-subtle);
|
|
2450
|
+
--_bg-on: var(--sc-color-warning-subtle);
|
|
2451
|
+
--_fg-on: var(--sc-color-warning-text);
|
|
2452
|
+
--_bd-on: var(--sc-color-warning-solid);
|
|
2453
|
+
}
|
|
2454
|
+
.sc-chip[data-tone='danger'] {
|
|
2455
|
+
--_fg: var(--sc-color-danger-text);
|
|
2456
|
+
--_bd: var(--sc-color-danger-text);
|
|
2457
|
+
--_bg-hover: var(--sc-color-danger-subtle);
|
|
2458
|
+
--_bg-on: var(--sc-color-danger-subtle);
|
|
2459
|
+
--_fg-on: var(--sc-color-danger-text);
|
|
2460
|
+
--_bd-on: var(--sc-color-danger-solid);
|
|
2461
|
+
}
|
|
2462
|
+
.sc-chip[data-tone='info'] {
|
|
2463
|
+
--_fg: var(--sc-color-info-text);
|
|
2464
|
+
--_bd: var(--sc-color-info-text);
|
|
2465
|
+
--_bg-hover: var(--sc-color-info-subtle);
|
|
2466
|
+
--_bg-on: var(--sc-color-info-subtle);
|
|
2467
|
+
--_fg-on: var(--sc-color-info-text);
|
|
2468
|
+
--_bd-on: var(--sc-color-info-solid);
|
|
2469
|
+
}
|
|
2470
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2471
|
+
.sc-chip {
|
|
2472
|
+
transition: none;
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2476
|
+
/* ---- disclosure.css ---- */
|
|
2477
|
+
/* ---- Disclosure ------------------------------------------------------------ */
|
|
2478
|
+
.sc-disclosure {
|
|
2479
|
+
display: flex;
|
|
2480
|
+
flex-direction: column;
|
|
2481
|
+
gap: var(--sc-spacing-xs);
|
|
2482
|
+
min-inline-size: 0;
|
|
2483
|
+
font-family: var(--sc-font-family-sans);
|
|
2484
|
+
font-size: var(--sc-font-size-sm);
|
|
2485
|
+
line-height: var(--sc-font-line-height-normal);
|
|
2486
|
+
color: var(--sc-color-text-default);
|
|
2487
|
+
}
|
|
2488
|
+
.sc-disclosure__summary {
|
|
2489
|
+
display: inline-flex;
|
|
2490
|
+
align-items: center;
|
|
2491
|
+
gap: var(--sc-spacing-2xs);
|
|
2492
|
+
inline-size: fit-content;
|
|
2493
|
+
margin-inline: calc(-1 * var(--sc-spacing-2xs));
|
|
2494
|
+
padding: var(--sc-spacing-2xs);
|
|
2495
|
+
border-radius: var(--sc-radius-sm);
|
|
2496
|
+
color: var(--sc-color-accent-text);
|
|
2497
|
+
font-weight: var(--sc-font-weight-medium);
|
|
2498
|
+
line-height: var(--sc-font-line-height-ui);
|
|
2499
|
+
list-style: none;
|
|
2500
|
+
cursor: pointer;
|
|
2501
|
+
user-select: none;
|
|
2502
|
+
}
|
|
2503
|
+
.sc-disclosure__summary::-webkit-details-marker,
|
|
2504
|
+
.sc-disclosure__summary::marker {
|
|
2505
|
+
display: none;
|
|
2506
|
+
content: '';
|
|
2507
|
+
}
|
|
2508
|
+
.sc-disclosure__summary:hover {
|
|
2509
|
+
background: var(--sc-color-surface-hover);
|
|
2510
|
+
}
|
|
2511
|
+
.sc-disclosure__summary:focus-visible {
|
|
2512
|
+
outline: var(--sc-border-width-focus) solid var(--sc-color-border-focus);
|
|
2513
|
+
outline-offset: 0;
|
|
2514
|
+
}
|
|
2515
|
+
.sc-disclosure__chevron {
|
|
2516
|
+
flex: none;
|
|
2517
|
+
inline-size: var(--sc-size-icon-md);
|
|
2518
|
+
block-size: var(--sc-size-icon-md);
|
|
2519
|
+
transition: rotate var(--sc-duration-fast) var(--sc-ease-standard);
|
|
2520
|
+
}
|
|
2521
|
+
.sc-disclosure[open] > .sc-disclosure__summary > .sc-disclosure__chevron {
|
|
2522
|
+
rotate: 180deg;
|
|
2523
|
+
}
|
|
2524
|
+
.sc-disclosure[data-summary-position='end'] > .sc-disclosure__summary {
|
|
2525
|
+
order: 1;
|
|
2526
|
+
}
|
|
2527
|
+
.sc-disclosure__content {
|
|
2528
|
+
min-inline-size: 0;
|
|
2529
|
+
}
|
|
2530
|
+
/* Preview: while closed, the content stays rendered, clipped to N lines and faded. Browsers without
|
|
2531
|
+
`::details-content` keep the native behaviour (content hidden until open). */
|
|
2532
|
+
.sc-disclosure[data-preview]:not([open])::details-content {
|
|
2533
|
+
content-visibility: visible;
|
|
2534
|
+
display: block;
|
|
2535
|
+
max-block-size: calc(var(--_lines, 3) * 1lh);
|
|
2536
|
+
overflow: clip;
|
|
2537
|
+
mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
|
|
2538
|
+
}
|
|
2539
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2540
|
+
.sc-disclosure__chevron {
|
|
2541
|
+
transition: none;
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
/* ---- empty-state.css ---- */
|
|
2546
|
+
/* ---- EmptyState ------------------------------------------------------------ */
|
|
2547
|
+
.sc-empty-state {
|
|
2548
|
+
--_icon: var(--sc-size-icon-xl);
|
|
2549
|
+
--_ring: 48px;
|
|
2550
|
+
--_py: var(--sc-spacing-2xl);
|
|
2551
|
+
--_title: var(--sc-font-size-lg);
|
|
2552
|
+
display: flex;
|
|
2553
|
+
flex-direction: column;
|
|
2554
|
+
align-items: center;
|
|
2555
|
+
gap: var(--sc-spacing-xs);
|
|
2556
|
+
box-sizing: border-box;
|
|
2557
|
+
inline-size: 100%;
|
|
2558
|
+
margin: 0;
|
|
2559
|
+
padding: var(--_py) var(--sc-spacing-lg);
|
|
2560
|
+
list-style: none;
|
|
2561
|
+
text-align: center;
|
|
2562
|
+
font-family: var(--sc-font-family-sans);
|
|
2563
|
+
color: var(--sc-color-text-default);
|
|
2564
|
+
}
|
|
2565
|
+
.sc-empty-state[data-size='sm'] {
|
|
2566
|
+
--_icon: var(--sc-size-icon-lg);
|
|
2567
|
+
--_ring: 40px;
|
|
2568
|
+
--_py: var(--sc-spacing-lg);
|
|
2569
|
+
--_title: var(--sc-font-size-md);
|
|
2570
|
+
gap: var(--sc-spacing-2xs);
|
|
2571
|
+
}
|
|
2572
|
+
.sc-empty-state__icon {
|
|
2573
|
+
display: inline-grid;
|
|
2574
|
+
place-items: center;
|
|
2575
|
+
inline-size: var(--_ring);
|
|
2576
|
+
block-size: var(--_ring);
|
|
2577
|
+
margin-block-end: var(--sc-spacing-xs);
|
|
2578
|
+
border-radius: var(--sc-radius-full);
|
|
2579
|
+
background: var(--sc-color-surface-sunken);
|
|
2580
|
+
color: var(--sc-color-text-muted);
|
|
2581
|
+
}
|
|
2582
|
+
.sc-empty-state__icon > svg {
|
|
2583
|
+
inline-size: var(--_icon);
|
|
2584
|
+
block-size: var(--_icon);
|
|
2585
|
+
}
|
|
2586
|
+
.sc-empty-state__title {
|
|
2587
|
+
margin: 0;
|
|
2588
|
+
max-inline-size: 36ch;
|
|
2589
|
+
font-size: var(--_title);
|
|
2590
|
+
font-weight: var(--sc-font-weight-semibold);
|
|
2591
|
+
line-height: var(--sc-font-line-height-snug);
|
|
2592
|
+
letter-spacing: var(--sc-font-tracking-snug);
|
|
2593
|
+
text-wrap: balance;
|
|
2594
|
+
}
|
|
2595
|
+
.sc-empty-state__description {
|
|
2596
|
+
margin: 0;
|
|
2597
|
+
max-inline-size: 48ch;
|
|
2598
|
+
font-size: var(--sc-font-size-sm);
|
|
2599
|
+
line-height: var(--sc-font-line-height-normal);
|
|
2600
|
+
color: var(--sc-color-text-muted);
|
|
2601
|
+
text-wrap: pretty;
|
|
2602
|
+
}
|
|
2603
|
+
.sc-empty-state__actions {
|
|
2604
|
+
display: flex;
|
|
2605
|
+
flex-wrap: wrap;
|
|
2606
|
+
justify-content: center;
|
|
2607
|
+
gap: var(--sc-spacing-xs);
|
|
2608
|
+
margin-block-start: var(--sc-spacing-sm);
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
/* ---- skeleton.css ---- */
|
|
2612
|
+
/* ---- Skeleton -------------------------------------------------------------- */
|
|
2613
|
+
.sc-skeleton {
|
|
2614
|
+
--_base: var(--sc-color-surface-active);
|
|
2615
|
+
--_sheen: var(--sc-color-surface-hover);
|
|
2616
|
+
display: block;
|
|
2617
|
+
box-sizing: border-box;
|
|
2618
|
+
inline-size: 100%;
|
|
2619
|
+
block-size: 1em;
|
|
2620
|
+
border-radius: var(--sc-radius-sm);
|
|
2621
|
+
background: var(--_base);
|
|
2622
|
+
background-image: linear-gradient(90deg, var(--_base) 0%, var(--_sheen) 50%, var(--_base) 100%);
|
|
2623
|
+
background-size: 200% 100%;
|
|
2624
|
+
animation: sc-shimmer 1.6s ease-in-out infinite;
|
|
2625
|
+
}
|
|
2626
|
+
.sc-skeleton[data-variant='text'] {
|
|
2627
|
+
display: inline-block;
|
|
2628
|
+
vertical-align: middle;
|
|
2629
|
+
block-size: 1em;
|
|
2630
|
+
border-radius: var(--sc-radius-sm);
|
|
2631
|
+
}
|
|
2632
|
+
.sc-skeleton[data-variant='rect'] {
|
|
2633
|
+
block-size: 80px;
|
|
2634
|
+
border-radius: var(--sc-radius-md);
|
|
2635
|
+
}
|
|
2636
|
+
.sc-skeleton[data-variant='circle'] {
|
|
2637
|
+
inline-size: 40px;
|
|
2638
|
+
aspect-ratio: 1;
|
|
2639
|
+
block-size: auto;
|
|
2640
|
+
border-radius: var(--sc-radius-full);
|
|
2641
|
+
}
|
|
2642
|
+
.sc-skeleton[data-still] {
|
|
2643
|
+
animation: none;
|
|
2644
|
+
background-image: none;
|
|
2645
|
+
}
|
|
2646
|
+
.sc-skeleton-lines {
|
|
2647
|
+
display: flex;
|
|
2648
|
+
flex-direction: column;
|
|
2649
|
+
gap: calc(1lh - 1em);
|
|
2650
|
+
inline-size: 100%;
|
|
2651
|
+
}
|
|
2652
|
+
.sc-skeleton-lines > .sc-skeleton {
|
|
2653
|
+
display: block;
|
|
2654
|
+
}
|
|
2655
|
+
.sc-skeleton-lines > .sc-skeleton[data-last] {
|
|
2656
|
+
inline-size: 60%;
|
|
2657
|
+
}
|
|
2658
|
+
@keyframes sc-shimmer {
|
|
2659
|
+
from {
|
|
2660
|
+
background-position: 200% 0;
|
|
2661
|
+
}
|
|
2662
|
+
to {
|
|
2663
|
+
background-position: -200% 0;
|
|
2664
|
+
}
|
|
2665
|
+
}
|
|
2666
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2667
|
+
.sc-skeleton {
|
|
2668
|
+
animation: none;
|
|
2669
|
+
background-image: none;
|
|
2670
|
+
}
|
|
2671
|
+
}
|
|
2672
|
+
|
|
2195
2673
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salemcobalt/ui",
|
|
3
|
-
"version": "0.2.0-rc.
|
|
4
|
-
"description": "React components for the Salem Cobalt design system: Button, IconButton, Icon set, Badge, Card, Stack, Inline, Kbd, Dialog, Tooltip, Menu, Toolbar, Banner, Spinner, Progress, Tabs, Input, Textarea, Select, Checkbox, Switch, Heading, Text, Table, Stat.",
|
|
3
|
+
"version": "0.2.0-rc.6",
|
|
4
|
+
"description": "React components for the Salem Cobalt design system: Button, IconButton, Icon set, Badge, Card, Stack, Inline, Kbd, Dialog, Tooltip, Menu, Toolbar, Banner, Spinner, Progress, Tabs, Input, Textarea, Select, Checkbox, Switch, Heading, Text, Table, Stat, Chip, Disclosure, EmptyState, Skeleton.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": "^19.0.0",
|
|
35
35
|
"react-dom": "^19.0.0",
|
|
36
|
-
"@salemcobalt/tokens": "^0.2.0-rc.
|
|
36
|
+
"@salemcobalt/tokens": "^0.2.0-rc.6"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@base-ui/react": "^1.9.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"tsup": "^9.0.0",
|
|
57
57
|
"typescript": "^5.9.3",
|
|
58
58
|
"vitest": "^5.0.5",
|
|
59
|
-
"@salemcobalt/tokens": "^0.2.0-rc.
|
|
59
|
+
"@salemcobalt/tokens": "^0.2.0-rc.6"
|
|
60
60
|
},
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public"
|