@seanyeh77/ui 0.28.0 → 0.30.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/dist/bundle.js +10 -8
- package/dist/bundle.js.map +1 -1
- package/dist/{format-entry-BXwnh9f-.js → format-entry-ePskyytj.js} +21 -1
- package/dist/format-entry-ePskyytj.js.map +1 -0
- package/dist/format.js +1 -1
- package/dist/index.d.ts +103 -2
- package/dist/index.js +1114 -10
- package/dist/index.js.map +1 -1
- package/dist/styles.css +695 -0
- package/docs/IconButton.md +11 -0
- package/docs/TreeList.md +18 -0
- package/docs/Workbench.md +163 -0
- package/docs/guidelines.md +11 -0
- package/package.json +2 -2
- package/dist/format-entry-BXwnh9f-.js.map +0 -1
package/dist/styles.css
CHANGED
|
@@ -116,6 +116,23 @@ body {
|
|
|
116
116
|
.ui-iconbtn:hover {
|
|
117
117
|
background: var(--surface-sub);
|
|
118
118
|
}
|
|
119
|
+
/* Quiet: 32 px, no border; a background only on hover, pressed or focus. */
|
|
120
|
+
.ui-iconbtn.is-quiet {
|
|
121
|
+
width: 32px;
|
|
122
|
+
height: 32px;
|
|
123
|
+
border: 0;
|
|
124
|
+
border-radius: var(--radius-sm);
|
|
125
|
+
color: var(--ink-muted);
|
|
126
|
+
}
|
|
127
|
+
.ui-iconbtn.is-quiet:hover {
|
|
128
|
+
color: var(--ink);
|
|
129
|
+
}
|
|
130
|
+
.ui-iconbtn.is-quiet[aria-pressed='true'] {
|
|
131
|
+
color: var(--ink);
|
|
132
|
+
}
|
|
133
|
+
.ui-iconbtn.is-quiet:focus-visible {
|
|
134
|
+
box-shadow: 0 0 0 3px var(--focus-ring);
|
|
135
|
+
}
|
|
119
136
|
/* First-use hint: an accent dot on the button (ringed in the background it sits on) and a dark bubble below it,
|
|
120
137
|
right-aligned, its arrow pointing at the button. Stays until 開始 or ×. */
|
|
121
138
|
.ui-iconbtn-hintbox {
|
|
@@ -4435,6 +4452,70 @@ html.ui-theme-fade * {
|
|
|
4435
4452
|
color: var(--ink);
|
|
4436
4453
|
}
|
|
4437
4454
|
|
|
4455
|
+
/* TreeList density="compact": 28 px rows on one line, for an explorer. Touch screens keep 48 px. */
|
|
4456
|
+
.ui-tree.is-compact {
|
|
4457
|
+
--tl-base: 4px;
|
|
4458
|
+
--tl-step: 14px;
|
|
4459
|
+
}
|
|
4460
|
+
.ui-tree.is-plain.is-compact .ui-tree-row {
|
|
4461
|
+
min-height: 28px;
|
|
4462
|
+
gap: 4px;
|
|
4463
|
+
padding-top: 0;
|
|
4464
|
+
padding-bottom: 0;
|
|
4465
|
+
padding-right: 8px;
|
|
4466
|
+
font-size: 13px;
|
|
4467
|
+
border-radius: var(--radius-sm);
|
|
4468
|
+
}
|
|
4469
|
+
.ui-tree.is-plain.is-compact .ui-tree-guide {
|
|
4470
|
+
left: calc(var(--tl-base) + var(--g, 0) * var(--tl-step) + 9px);
|
|
4471
|
+
}
|
|
4472
|
+
.ui-tree.is-plain.is-compact .ui-tree-caretbtn {
|
|
4473
|
+
flex-basis: 18px;
|
|
4474
|
+
width: 18px;
|
|
4475
|
+
height: 18px;
|
|
4476
|
+
}
|
|
4477
|
+
.ui-tree.is-plain.is-compact .ui-tree-picon {
|
|
4478
|
+
flex-basis: 16px;
|
|
4479
|
+
}
|
|
4480
|
+
.ui-tree.is-plain.is-compact .ui-tree-main {
|
|
4481
|
+
display: flex;
|
|
4482
|
+
align-items: baseline;
|
|
4483
|
+
gap: 8px;
|
|
4484
|
+
min-width: 0;
|
|
4485
|
+
}
|
|
4486
|
+
.ui-tree.is-plain.is-compact .ui-tree-row:not(.is-muted) .ui-tree-label {
|
|
4487
|
+
font-weight: 400;
|
|
4488
|
+
}
|
|
4489
|
+
.ui-tree.is-plain.is-compact .ui-tree-row.is-current .ui-tree-label {
|
|
4490
|
+
font-weight: 600;
|
|
4491
|
+
}
|
|
4492
|
+
.ui-tree.is-plain.is-compact .ui-tree-pmeta {
|
|
4493
|
+
font-size: 12px;
|
|
4494
|
+
}
|
|
4495
|
+
@media (pointer: coarse) {
|
|
4496
|
+
.ui-tree.is-plain.is-compact .ui-tree-row {
|
|
4497
|
+
min-height: 48px;
|
|
4498
|
+
}
|
|
4499
|
+
}
|
|
4500
|
+
/* A mark: a 6 px dot at the row's right end, lined up down the list. */
|
|
4501
|
+
.ui-tree-mark {
|
|
4502
|
+
flex: none;
|
|
4503
|
+
width: 6px;
|
|
4504
|
+
height: 6px;
|
|
4505
|
+
margin-left: auto;
|
|
4506
|
+
border-radius: var(--radius-full);
|
|
4507
|
+
background: var(--warning);
|
|
4508
|
+
}
|
|
4509
|
+
.ui-tree-mark.is-danger {
|
|
4510
|
+
background: var(--danger);
|
|
4511
|
+
}
|
|
4512
|
+
.ui-tree-mark.is-accent {
|
|
4513
|
+
background: var(--accent);
|
|
4514
|
+
}
|
|
4515
|
+
.ui-tree-mark + .ui-tree-act {
|
|
4516
|
+
margin-left: 4px;
|
|
4517
|
+
}
|
|
4518
|
+
|
|
4438
4519
|
/* TreeList: general trees (kind="plain") and the phone indent */
|
|
4439
4520
|
.ui-tree.is-plain .ui-tree-row {
|
|
4440
4521
|
gap: 6px;
|
|
@@ -5335,6 +5416,7 @@ html.ui-theme-fade * {
|
|
|
5335
5416
|
.ui-crumb a,
|
|
5336
5417
|
a.ui-crumb,
|
|
5337
5418
|
a.ui-nav-brand-link,
|
|
5419
|
+
a.ui-wb-brand,
|
|
5338
5420
|
.ui-code.is-link:not(.is-inline),
|
|
5339
5421
|
.ui-term:not(.is-inline)
|
|
5340
5422
|
) {
|
|
@@ -5350,6 +5432,7 @@ html.ui-theme-fade * {
|
|
|
5350
5432
|
.ui-crumb a,
|
|
5351
5433
|
a.ui-crumb,
|
|
5352
5434
|
a.ui-nav-brand-link,
|
|
5435
|
+
a.ui-wb-brand,
|
|
5353
5436
|
.ui-code.is-link:not(.is-inline),
|
|
5354
5437
|
.ui-term:not(.is-inline)
|
|
5355
5438
|
)::after {
|
|
@@ -7257,3 +7340,615 @@ html.ui-theme-fade * {
|
|
|
7257
7340
|
line-height: 20px;
|
|
7258
7341
|
}
|
|
7259
7342
|
}
|
|
7343
|
+
|
|
7344
|
+
/* Workbench: an editor layout (top bar, explorer, main view, side bar, bottom panel) */
|
|
7345
|
+
.ui-wb {
|
|
7346
|
+
position: relative;
|
|
7347
|
+
display: flex;
|
|
7348
|
+
flex-direction: column;
|
|
7349
|
+
height: 100%;
|
|
7350
|
+
min-height: 0;
|
|
7351
|
+
overflow: hidden;
|
|
7352
|
+
background: var(--bg);
|
|
7353
|
+
color: var(--ink);
|
|
7354
|
+
}
|
|
7355
|
+
.ui-wb-top {
|
|
7356
|
+
flex: 0 0 48px;
|
|
7357
|
+
display: flex;
|
|
7358
|
+
align-items: center;
|
|
7359
|
+
gap: var(--space-2);
|
|
7360
|
+
padding: 0 var(--space-2);
|
|
7361
|
+
background: var(--surface-chrome);
|
|
7362
|
+
border-bottom: 1px solid var(--line);
|
|
7363
|
+
position: relative;
|
|
7364
|
+
z-index: 6;
|
|
7365
|
+
--hint-ring: var(--surface-chrome);
|
|
7366
|
+
}
|
|
7367
|
+
.ui-wb-top-l {
|
|
7368
|
+
flex: 1 1 auto;
|
|
7369
|
+
min-width: 0;
|
|
7370
|
+
display: flex;
|
|
7371
|
+
align-items: center;
|
|
7372
|
+
gap: var(--space-2);
|
|
7373
|
+
}
|
|
7374
|
+
.ui-wb-top-r {
|
|
7375
|
+
flex: none;
|
|
7376
|
+
display: flex;
|
|
7377
|
+
align-items: center;
|
|
7378
|
+
gap: 2px;
|
|
7379
|
+
}
|
|
7380
|
+
.ui-wb-sep {
|
|
7381
|
+
width: 1px;
|
|
7382
|
+
height: 20px;
|
|
7383
|
+
margin: 0 var(--space-1);
|
|
7384
|
+
background: var(--line);
|
|
7385
|
+
}
|
|
7386
|
+
.ui-wb-toggle {
|
|
7387
|
+
position: relative;
|
|
7388
|
+
display: inline-flex;
|
|
7389
|
+
}
|
|
7390
|
+
.ui-wb-brand {
|
|
7391
|
+
flex: none;
|
|
7392
|
+
display: inline-flex;
|
|
7393
|
+
align-items: center;
|
|
7394
|
+
gap: var(--space-2);
|
|
7395
|
+
height: 32px;
|
|
7396
|
+
padding: 0 6px;
|
|
7397
|
+
border-radius: var(--radius-sm);
|
|
7398
|
+
color: inherit;
|
|
7399
|
+
font-weight: 700;
|
|
7400
|
+
font-size: 15px;
|
|
7401
|
+
text-decoration: none;
|
|
7402
|
+
white-space: nowrap;
|
|
7403
|
+
}
|
|
7404
|
+
a.ui-wb-brand:focus-visible {
|
|
7405
|
+
outline: none;
|
|
7406
|
+
box-shadow: 0 0 0 3px var(--focus-ring);
|
|
7407
|
+
}
|
|
7408
|
+
.ui-wb-mark {
|
|
7409
|
+
display: inline-flex;
|
|
7410
|
+
align-items: center;
|
|
7411
|
+
justify-content: center;
|
|
7412
|
+
width: 20px;
|
|
7413
|
+
height: 20px;
|
|
7414
|
+
}
|
|
7415
|
+
.ui-wb.is-phone .ui-wb-name {
|
|
7416
|
+
display: none;
|
|
7417
|
+
}
|
|
7418
|
+
.ui-wb-crumbs {
|
|
7419
|
+
min-width: 0;
|
|
7420
|
+
overflow: hidden;
|
|
7421
|
+
font-size: 13px;
|
|
7422
|
+
}
|
|
7423
|
+
.ui-wb-crumbs ol {
|
|
7424
|
+
flex-wrap: nowrap;
|
|
7425
|
+
white-space: nowrap;
|
|
7426
|
+
font-size: 13px;
|
|
7427
|
+
min-width: 0;
|
|
7428
|
+
}
|
|
7429
|
+
/* Too long for the bar: the levels give way, then the current one ends in an ellipsis. */
|
|
7430
|
+
.ui-wb-crumbs li {
|
|
7431
|
+
min-width: 0;
|
|
7432
|
+
flex: 0 5 auto;
|
|
7433
|
+
}
|
|
7434
|
+
.ui-wb-crumbs li:last-child {
|
|
7435
|
+
flex-shrink: 1;
|
|
7436
|
+
}
|
|
7437
|
+
.ui-wb-crumbs li > :is(a, span):not(.ui-crumb-sep) {
|
|
7438
|
+
min-width: 0;
|
|
7439
|
+
overflow: hidden;
|
|
7440
|
+
text-overflow: ellipsis;
|
|
7441
|
+
}
|
|
7442
|
+
.ui-wb-body {
|
|
7443
|
+
position: relative;
|
|
7444
|
+
flex: 1 1 auto;
|
|
7445
|
+
min-height: 0;
|
|
7446
|
+
}
|
|
7447
|
+
.ui-wb-main {
|
|
7448
|
+
position: absolute;
|
|
7449
|
+
top: 0;
|
|
7450
|
+
overflow: auto;
|
|
7451
|
+
background: var(--bg);
|
|
7452
|
+
transition:
|
|
7453
|
+
left 300ms cubic-bezier(0.3, 0.7, 0.3, 1),
|
|
7454
|
+
right 300ms cubic-bezier(0.3, 0.7, 0.3, 1),
|
|
7455
|
+
bottom 300ms cubic-bezier(0.3, 0.7, 0.3, 1);
|
|
7456
|
+
}
|
|
7457
|
+
/* Docked regions slide out and in with the main view (300 ms, as the sidebar); overlays are drawers. */
|
|
7458
|
+
.ui-wb-ex,
|
|
7459
|
+
.ui-wb-side,
|
|
7460
|
+
.ui-wb-panel,
|
|
7461
|
+
.ui-wb-sheet {
|
|
7462
|
+
box-sizing: border-box;
|
|
7463
|
+
position: absolute;
|
|
7464
|
+
display: flex;
|
|
7465
|
+
flex-direction: column;
|
|
7466
|
+
min-width: 0;
|
|
7467
|
+
min-height: 0;
|
|
7468
|
+
background: var(--surface);
|
|
7469
|
+
}
|
|
7470
|
+
.ui-wb-ex {
|
|
7471
|
+
top: 0;
|
|
7472
|
+
bottom: 0;
|
|
7473
|
+
left: 0;
|
|
7474
|
+
background: var(--surface-chrome);
|
|
7475
|
+
border-right: 1px solid var(--line);
|
|
7476
|
+
}
|
|
7477
|
+
.ui-wb-side {
|
|
7478
|
+
top: 0;
|
|
7479
|
+
bottom: 0;
|
|
7480
|
+
right: 0;
|
|
7481
|
+
border-left: 1px solid var(--line);
|
|
7482
|
+
}
|
|
7483
|
+
.ui-wb-panel {
|
|
7484
|
+
bottom: 0;
|
|
7485
|
+
border-top: 1px solid var(--line);
|
|
7486
|
+
}
|
|
7487
|
+
.ui-wb-ex.is-docked,
|
|
7488
|
+
.ui-wb-side.is-docked,
|
|
7489
|
+
.ui-wb-panel {
|
|
7490
|
+
transition:
|
|
7491
|
+
transform 300ms cubic-bezier(0.3, 0.7, 0.3, 1),
|
|
7492
|
+
left 300ms cubic-bezier(0.3, 0.7, 0.3, 1),
|
|
7493
|
+
right 300ms cubic-bezier(0.3, 0.7, 0.3, 1),
|
|
7494
|
+
visibility 0s;
|
|
7495
|
+
}
|
|
7496
|
+
.ui-wb-ex.is-docked.is-shut,
|
|
7497
|
+
.ui-wb-side.is-docked.is-shut,
|
|
7498
|
+
.ui-wb-panel.is-shut {
|
|
7499
|
+
visibility: hidden;
|
|
7500
|
+
transition:
|
|
7501
|
+
transform 300ms cubic-bezier(0.3, 0.7, 0.3, 1),
|
|
7502
|
+
left 300ms cubic-bezier(0.3, 0.7, 0.3, 1),
|
|
7503
|
+
right 300ms cubic-bezier(0.3, 0.7, 0.3, 1),
|
|
7504
|
+
visibility 0s linear 300ms;
|
|
7505
|
+
}
|
|
7506
|
+
.ui-wb-ex.is-shut {
|
|
7507
|
+
transform: translateX(-100%);
|
|
7508
|
+
}
|
|
7509
|
+
.ui-wb-side.is-shut {
|
|
7510
|
+
transform: translateX(100%);
|
|
7511
|
+
}
|
|
7512
|
+
.ui-wb-panel.is-shut {
|
|
7513
|
+
transform: translateY(100%);
|
|
7514
|
+
}
|
|
7515
|
+
/* motion.md 側邊抽屜: elastic in 450 ms, out 300 ms; scrim 300 ms. */
|
|
7516
|
+
.ui-wb-ex.is-drawer,
|
|
7517
|
+
.ui-wb-side.is-drawer {
|
|
7518
|
+
z-index: 8;
|
|
7519
|
+
box-shadow: var(--shadow-overlay);
|
|
7520
|
+
border: 0;
|
|
7521
|
+
transition:
|
|
7522
|
+
transform 450ms cubic-bezier(0.34, 1.4, 0.64, 1),
|
|
7523
|
+
visibility 0s;
|
|
7524
|
+
}
|
|
7525
|
+
.ui-wb-ex.is-drawer.is-shut,
|
|
7526
|
+
.ui-wb-side.is-drawer.is-shut {
|
|
7527
|
+
visibility: hidden;
|
|
7528
|
+
transition:
|
|
7529
|
+
transform 300ms cubic-bezier(0.4, 0, 1, 1),
|
|
7530
|
+
visibility 0s linear 300ms;
|
|
7531
|
+
}
|
|
7532
|
+
.ui-wb-ex.is-drawer::before,
|
|
7533
|
+
.ui-wb-side.is-drawer::after {
|
|
7534
|
+
content: '';
|
|
7535
|
+
position: absolute;
|
|
7536
|
+
top: 0;
|
|
7537
|
+
bottom: 0;
|
|
7538
|
+
width: 40px;
|
|
7539
|
+
background: inherit;
|
|
7540
|
+
}
|
|
7541
|
+
.ui-wb-ex.is-drawer::before {
|
|
7542
|
+
right: 100%;
|
|
7543
|
+
}
|
|
7544
|
+
.ui-wb-side.is-drawer::after {
|
|
7545
|
+
left: 100%;
|
|
7546
|
+
}
|
|
7547
|
+
.ui-wb-scrim {
|
|
7548
|
+
position: absolute;
|
|
7549
|
+
inset: 0;
|
|
7550
|
+
z-index: 7;
|
|
7551
|
+
border: 0;
|
|
7552
|
+
padding: 0;
|
|
7553
|
+
background: var(--scrim);
|
|
7554
|
+
backdrop-filter: blur(4px);
|
|
7555
|
+
-webkit-backdrop-filter: blur(4px);
|
|
7556
|
+
opacity: 0;
|
|
7557
|
+
pointer-events: none;
|
|
7558
|
+
transition: opacity 300ms ease;
|
|
7559
|
+
}
|
|
7560
|
+
.ui-wb-scrim.is-open {
|
|
7561
|
+
opacity: 1;
|
|
7562
|
+
pointer-events: auto;
|
|
7563
|
+
}
|
|
7564
|
+
.ui-wb.is-sizing .ui-wb-main,
|
|
7565
|
+
.ui-wb.is-sizing .ui-wb-panel,
|
|
7566
|
+
.ui-wb.is-sizing .ui-wb-ex,
|
|
7567
|
+
.ui-wb.is-sizing .ui-wb-side {
|
|
7568
|
+
transition: none;
|
|
7569
|
+
}
|
|
7570
|
+
.ui-wb.is-sizing {
|
|
7571
|
+
user-select: none;
|
|
7572
|
+
}
|
|
7573
|
+
/* Explorer */
|
|
7574
|
+
.ui-wb-exhead {
|
|
7575
|
+
flex: none;
|
|
7576
|
+
padding: var(--space-2);
|
|
7577
|
+
}
|
|
7578
|
+
.ui-wb-exbody {
|
|
7579
|
+
flex: 1 1 auto;
|
|
7580
|
+
min-height: 0;
|
|
7581
|
+
overflow: auto;
|
|
7582
|
+
padding: 0 4px var(--space-2);
|
|
7583
|
+
}
|
|
7584
|
+
.ui-wb-exfoot {
|
|
7585
|
+
flex: none;
|
|
7586
|
+
padding: 4px;
|
|
7587
|
+
border-top: 1px solid var(--line);
|
|
7588
|
+
}
|
|
7589
|
+
/* Splitters: 8 px to grab, a 1 px line; a 2 px accent line on hover (after 150 ms), while dragging and on focus. */
|
|
7590
|
+
.ui-wb-split {
|
|
7591
|
+
position: absolute;
|
|
7592
|
+
z-index: 5;
|
|
7593
|
+
outline: none;
|
|
7594
|
+
touch-action: none;
|
|
7595
|
+
}
|
|
7596
|
+
.ui-wb-split.is-v {
|
|
7597
|
+
top: 0;
|
|
7598
|
+
bottom: 0;
|
|
7599
|
+
width: 8px;
|
|
7600
|
+
margin-left: -4px;
|
|
7601
|
+
cursor: col-resize;
|
|
7602
|
+
}
|
|
7603
|
+
.ui-wb-split.is-v[style*='right'] {
|
|
7604
|
+
margin-left: 0;
|
|
7605
|
+
margin-right: -4px;
|
|
7606
|
+
}
|
|
7607
|
+
.ui-wb-split.is-h {
|
|
7608
|
+
height: 8px;
|
|
7609
|
+
margin-bottom: -4px;
|
|
7610
|
+
cursor: row-resize;
|
|
7611
|
+
}
|
|
7612
|
+
.ui-wb-split-line {
|
|
7613
|
+
position: absolute;
|
|
7614
|
+
background: transparent;
|
|
7615
|
+
transition: background-color 0.15s ease 0.15s;
|
|
7616
|
+
}
|
|
7617
|
+
.ui-wb-split.is-v .ui-wb-split-line {
|
|
7618
|
+
top: 0;
|
|
7619
|
+
bottom: 0;
|
|
7620
|
+
left: 3px;
|
|
7621
|
+
width: 2px;
|
|
7622
|
+
}
|
|
7623
|
+
.ui-wb-split.is-h .ui-wb-split-line {
|
|
7624
|
+
left: 0;
|
|
7625
|
+
right: 0;
|
|
7626
|
+
top: 3px;
|
|
7627
|
+
height: 2px;
|
|
7628
|
+
}
|
|
7629
|
+
.ui-wb-split:hover .ui-wb-split-line,
|
|
7630
|
+
.ui-wb-split.is-on .ui-wb-split-line {
|
|
7631
|
+
background: var(--accent);
|
|
7632
|
+
}
|
|
7633
|
+
.ui-wb-split:focus-visible .ui-wb-split-line {
|
|
7634
|
+
background: var(--accent);
|
|
7635
|
+
transition: none;
|
|
7636
|
+
}
|
|
7637
|
+
/* Tab rows */
|
|
7638
|
+
.ui-wb-tabbar {
|
|
7639
|
+
flex: none;
|
|
7640
|
+
display: flex;
|
|
7641
|
+
align-items: center;
|
|
7642
|
+
height: 36px;
|
|
7643
|
+
border-bottom: 1px solid var(--line);
|
|
7644
|
+
padding-right: 2px;
|
|
7645
|
+
}
|
|
7646
|
+
.ui-wb-tabs {
|
|
7647
|
+
position: relative;
|
|
7648
|
+
flex: 1 1 auto;
|
|
7649
|
+
min-width: 0;
|
|
7650
|
+
height: 100%;
|
|
7651
|
+
display: flex;
|
|
7652
|
+
align-items: stretch;
|
|
7653
|
+
padding: 0 4px;
|
|
7654
|
+
overflow: hidden;
|
|
7655
|
+
}
|
|
7656
|
+
.ui-wb-tabs.is-scroll {
|
|
7657
|
+
overflow-x: auto;
|
|
7658
|
+
scrollbar-width: none;
|
|
7659
|
+
overscroll-behavior-x: contain;
|
|
7660
|
+
}
|
|
7661
|
+
.ui-wb-tabs.is-scroll::-webkit-scrollbar {
|
|
7662
|
+
display: none;
|
|
7663
|
+
}
|
|
7664
|
+
.ui-wb-tabs.is-touch {
|
|
7665
|
+
touch-action: none;
|
|
7666
|
+
user-select: none;
|
|
7667
|
+
-webkit-user-select: none;
|
|
7668
|
+
}
|
|
7669
|
+
/* As Tabs: the side with more tabs fades out over 40 px. */
|
|
7670
|
+
.ui-wb-tabs.has-more-right {
|
|
7671
|
+
mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
|
|
7672
|
+
}
|
|
7673
|
+
.ui-wb-tabs.has-more-left {
|
|
7674
|
+
mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent);
|
|
7675
|
+
}
|
|
7676
|
+
.ui-wb-tabs.has-more-left.has-more-right {
|
|
7677
|
+
mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
|
|
7678
|
+
}
|
|
7679
|
+
.ui-wb-ind {
|
|
7680
|
+
position: absolute;
|
|
7681
|
+
bottom: 0;
|
|
7682
|
+
height: 2px;
|
|
7683
|
+
border-radius: 2px;
|
|
7684
|
+
background: var(--accent);
|
|
7685
|
+
pointer-events: none;
|
|
7686
|
+
}
|
|
7687
|
+
.ui-wb-tab {
|
|
7688
|
+
position: relative;
|
|
7689
|
+
flex: none;
|
|
7690
|
+
display: inline-flex;
|
|
7691
|
+
align-items: center;
|
|
7692
|
+
gap: 6px;
|
|
7693
|
+
padding: 0 10px;
|
|
7694
|
+
border: 0;
|
|
7695
|
+
background: none;
|
|
7696
|
+
color: var(--ink-muted);
|
|
7697
|
+
font: inherit;
|
|
7698
|
+
font-size: 13px;
|
|
7699
|
+
font-weight: 500;
|
|
7700
|
+
white-space: nowrap;
|
|
7701
|
+
cursor: pointer;
|
|
7702
|
+
}
|
|
7703
|
+
.ui-wb-tab:hover {
|
|
7704
|
+
color: var(--ink);
|
|
7705
|
+
}
|
|
7706
|
+
.ui-wb-tab.is-on {
|
|
7707
|
+
color: var(--ink);
|
|
7708
|
+
font-weight: 700;
|
|
7709
|
+
}
|
|
7710
|
+
.ui-wb-tab:focus-visible {
|
|
7711
|
+
outline: none;
|
|
7712
|
+
box-shadow: inset 0 0 0 2px var(--focus-ring);
|
|
7713
|
+
border-radius: var(--radius-sm);
|
|
7714
|
+
}
|
|
7715
|
+
.ui-wb-tab.is-ghost {
|
|
7716
|
+
opacity: 0.4;
|
|
7717
|
+
}
|
|
7718
|
+
.ui-wb-tab.is-held {
|
|
7719
|
+
z-index: 2;
|
|
7720
|
+
border-radius: var(--radius-sm);
|
|
7721
|
+
background: var(--accent-soft);
|
|
7722
|
+
color: var(--accent-text);
|
|
7723
|
+
box-shadow: var(--shadow-overlay);
|
|
7724
|
+
transform: scale(1.06);
|
|
7725
|
+
transition:
|
|
7726
|
+
transform 0.15s ease,
|
|
7727
|
+
box-shadow 0.15s ease;
|
|
7728
|
+
}
|
|
7729
|
+
/* Where a dragged tab lands: a 2 px accent line before (or after the last) tab. */
|
|
7730
|
+
.ui-wb-tab.has-line::before,
|
|
7731
|
+
.ui-wb-tab.has-line-after::after {
|
|
7732
|
+
content: '';
|
|
7733
|
+
position: absolute;
|
|
7734
|
+
top: 6px;
|
|
7735
|
+
bottom: 6px;
|
|
7736
|
+
width: 2px;
|
|
7737
|
+
border-radius: 2px;
|
|
7738
|
+
background: var(--accent);
|
|
7739
|
+
}
|
|
7740
|
+
.ui-wb-tab.has-line::before {
|
|
7741
|
+
left: -3px;
|
|
7742
|
+
}
|
|
7743
|
+
.ui-wb-tab.has-line-after::after {
|
|
7744
|
+
right: -3px;
|
|
7745
|
+
}
|
|
7746
|
+
.ui-wb-dot {
|
|
7747
|
+
flex: none;
|
|
7748
|
+
width: 6px;
|
|
7749
|
+
height: 6px;
|
|
7750
|
+
border-radius: var(--radius-full);
|
|
7751
|
+
background: var(--warning);
|
|
7752
|
+
}
|
|
7753
|
+
.ui-wb-dot.is-on-button {
|
|
7754
|
+
position: absolute;
|
|
7755
|
+
top: 3px;
|
|
7756
|
+
right: 3px;
|
|
7757
|
+
width: 8px;
|
|
7758
|
+
height: 8px;
|
|
7759
|
+
box-shadow: 0 0 0 2px var(--surface-chrome);
|
|
7760
|
+
pointer-events: none;
|
|
7761
|
+
}
|
|
7762
|
+
.ui-wb-more {
|
|
7763
|
+
flex: none;
|
|
7764
|
+
display: inline-flex;
|
|
7765
|
+
align-items: center;
|
|
7766
|
+
gap: 2px;
|
|
7767
|
+
height: 28px;
|
|
7768
|
+
padding: 0 6px 0 8px;
|
|
7769
|
+
border: 0;
|
|
7770
|
+
border-radius: var(--radius-sm);
|
|
7771
|
+
background: none;
|
|
7772
|
+
color: var(--ink-muted);
|
|
7773
|
+
font: inherit;
|
|
7774
|
+
font-size: 13px;
|
|
7775
|
+
font-weight: 600;
|
|
7776
|
+
white-space: nowrap;
|
|
7777
|
+
cursor: pointer;
|
|
7778
|
+
}
|
|
7779
|
+
.ui-wb-more:hover,
|
|
7780
|
+
.ui-wb-more[data-popup-open] {
|
|
7781
|
+
background: var(--surface-sub);
|
|
7782
|
+
color: var(--ink);
|
|
7783
|
+
}
|
|
7784
|
+
.ui-wb-more:focus-visible {
|
|
7785
|
+
outline: none;
|
|
7786
|
+
box-shadow: 0 0 0 3px var(--focus-ring);
|
|
7787
|
+
}
|
|
7788
|
+
.ui-wb-tabbtns {
|
|
7789
|
+
flex: none;
|
|
7790
|
+
display: flex;
|
|
7791
|
+
align-items: center;
|
|
7792
|
+
}
|
|
7793
|
+
.ui-wb-panebox {
|
|
7794
|
+
position: relative;
|
|
7795
|
+
flex: 1 1 auto;
|
|
7796
|
+
min-height: 0;
|
|
7797
|
+
overflow: auto;
|
|
7798
|
+
}
|
|
7799
|
+
/* motion.md 內容切換: the new view's blocks rise one after another, 40 ms apart. */
|
|
7800
|
+
.ui-wb-pane > * {
|
|
7801
|
+
animation: ui-wb-rise 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
|
|
7802
|
+
}
|
|
7803
|
+
.ui-wb-pane > :nth-child(2) {
|
|
7804
|
+
animation-delay: 40ms;
|
|
7805
|
+
}
|
|
7806
|
+
.ui-wb-pane > :nth-child(3) {
|
|
7807
|
+
animation-delay: 80ms;
|
|
7808
|
+
}
|
|
7809
|
+
.ui-wb-pane > :nth-child(4) {
|
|
7810
|
+
animation-delay: 120ms;
|
|
7811
|
+
}
|
|
7812
|
+
.ui-wb-pane > :nth-child(n + 5) {
|
|
7813
|
+
animation-delay: 160ms;
|
|
7814
|
+
}
|
|
7815
|
+
@keyframes ui-wb-rise {
|
|
7816
|
+
from {
|
|
7817
|
+
opacity: 0;
|
|
7818
|
+
transform: translateY(8px);
|
|
7819
|
+
}
|
|
7820
|
+
}
|
|
7821
|
+
/* Drag and drop */
|
|
7822
|
+
.ui-wb-side.is-dropping,
|
|
7823
|
+
.ui-wb-panel.is-dropping {
|
|
7824
|
+
background: var(--accent-soft);
|
|
7825
|
+
}
|
|
7826
|
+
.ui-wb-dropframe {
|
|
7827
|
+
position: absolute;
|
|
7828
|
+
inset: 4px;
|
|
7829
|
+
z-index: 4;
|
|
7830
|
+
display: flex;
|
|
7831
|
+
align-items: center;
|
|
7832
|
+
justify-content: center;
|
|
7833
|
+
border: 2px dashed var(--accent);
|
|
7834
|
+
border-radius: var(--radius-md);
|
|
7835
|
+
pointer-events: none;
|
|
7836
|
+
}
|
|
7837
|
+
.ui-wb-dropframe span,
|
|
7838
|
+
.ui-wb-dropzone {
|
|
7839
|
+
font-size: 13px;
|
|
7840
|
+
font-weight: 700;
|
|
7841
|
+
}
|
|
7842
|
+
.ui-wb-dropframe span {
|
|
7843
|
+
padding: 4px 10px;
|
|
7844
|
+
border-radius: var(--radius-sm);
|
|
7845
|
+
background: var(--surface);
|
|
7846
|
+
color: var(--accent-text);
|
|
7847
|
+
box-shadow: var(--shadow-sm);
|
|
7848
|
+
}
|
|
7849
|
+
.ui-wb-dropzone {
|
|
7850
|
+
position: absolute;
|
|
7851
|
+
z-index: 9;
|
|
7852
|
+
display: flex;
|
|
7853
|
+
align-items: center;
|
|
7854
|
+
justify-content: center;
|
|
7855
|
+
padding: 4px;
|
|
7856
|
+
text-align: center;
|
|
7857
|
+
border: 2px dashed var(--line-strong);
|
|
7858
|
+
border-radius: var(--radius-md);
|
|
7859
|
+
background: var(--surface-sub);
|
|
7860
|
+
color: var(--ink-muted);
|
|
7861
|
+
}
|
|
7862
|
+
.ui-wb-dropzone.is-side {
|
|
7863
|
+
top: 8px;
|
|
7864
|
+
right: 8px;
|
|
7865
|
+
width: 96px;
|
|
7866
|
+
}
|
|
7867
|
+
.ui-wb-dropzone.is-panel {
|
|
7868
|
+
bottom: 8px;
|
|
7869
|
+
height: 64px;
|
|
7870
|
+
}
|
|
7871
|
+
.ui-wb-dropzone.is-over {
|
|
7872
|
+
border-color: var(--accent);
|
|
7873
|
+
background: var(--accent-soft);
|
|
7874
|
+
color: var(--accent-text);
|
|
7875
|
+
}
|
|
7876
|
+
/* Phone: one panel docked under the main view, resized by its grip. */
|
|
7877
|
+
.ui-wb-sheet {
|
|
7878
|
+
left: 0;
|
|
7879
|
+
right: 0;
|
|
7880
|
+
bottom: 0;
|
|
7881
|
+
z-index: 5;
|
|
7882
|
+
border-top: 1px solid var(--line);
|
|
7883
|
+
transition:
|
|
7884
|
+
transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
|
|
7885
|
+
visibility 0s;
|
|
7886
|
+
}
|
|
7887
|
+
.ui-wb-sheet.is-shut {
|
|
7888
|
+
visibility: hidden;
|
|
7889
|
+
transform: translateY(100%);
|
|
7890
|
+
transition:
|
|
7891
|
+
transform 300ms cubic-bezier(0.4, 0, 1, 1),
|
|
7892
|
+
visibility 0s linear 300ms;
|
|
7893
|
+
}
|
|
7894
|
+
.ui-wb-sheet > .ui-wb-split.is-h {
|
|
7895
|
+
height: 20px;
|
|
7896
|
+
margin: 0;
|
|
7897
|
+
}
|
|
7898
|
+
.ui-wb-sheet > .ui-wb-split .ui-wb-split-line {
|
|
7899
|
+
display: none;
|
|
7900
|
+
}
|
|
7901
|
+
.ui-wb-grab {
|
|
7902
|
+
flex: 0 0 20px;
|
|
7903
|
+
display: flex;
|
|
7904
|
+
align-items: center;
|
|
7905
|
+
justify-content: center;
|
|
7906
|
+
pointer-events: none;
|
|
7907
|
+
}
|
|
7908
|
+
.ui-wb-grab::before {
|
|
7909
|
+
content: '';
|
|
7910
|
+
width: 36px;
|
|
7911
|
+
height: 4px;
|
|
7912
|
+
border-radius: 4px;
|
|
7913
|
+
background: var(--line-strong);
|
|
7914
|
+
opacity: 0.6;
|
|
7915
|
+
}
|
|
7916
|
+
.ui-wb-sheet:has(> .ui-wb-split:is(:hover, :focus-visible, .is-on)) .ui-wb-grab::before {
|
|
7917
|
+
background: var(--accent);
|
|
7918
|
+
opacity: 1;
|
|
7919
|
+
}
|
|
7920
|
+
.ui-wb-dots {
|
|
7921
|
+
flex: none;
|
|
7922
|
+
display: flex;
|
|
7923
|
+
justify-content: center;
|
|
7924
|
+
gap: 6px;
|
|
7925
|
+
padding: 6px 0 8px;
|
|
7926
|
+
}
|
|
7927
|
+
.ui-wb-pagedot {
|
|
7928
|
+
width: 6px;
|
|
7929
|
+
height: 6px;
|
|
7930
|
+
border-radius: var(--radius-full);
|
|
7931
|
+
background: var(--line);
|
|
7932
|
+
}
|
|
7933
|
+
.ui-wb-pagedot.is-on {
|
|
7934
|
+
background: var(--accent);
|
|
7935
|
+
}
|
|
7936
|
+
@media (prefers-reduced-motion: reduce) {
|
|
7937
|
+
.ui-wb-main,
|
|
7938
|
+
.ui-wb-ex,
|
|
7939
|
+
.ui-wb-side,
|
|
7940
|
+
.ui-wb-panel,
|
|
7941
|
+
.ui-wb-sheet,
|
|
7942
|
+
.ui-wb-ind {
|
|
7943
|
+
transition: none !important;
|
|
7944
|
+
}
|
|
7945
|
+
.ui-wb-pane > * {
|
|
7946
|
+
animation: none;
|
|
7947
|
+
}
|
|
7948
|
+
.ui-wb-ex.is-drawer.is-shut,
|
|
7949
|
+
.ui-wb-side.is-drawer.is-shut,
|
|
7950
|
+
.ui-wb-sheet.is-shut {
|
|
7951
|
+
transform: none;
|
|
7952
|
+
opacity: 0;
|
|
7953
|
+
}
|
|
7954
|
+
}
|
package/docs/IconButton.md
CHANGED
|
@@ -29,3 +29,14 @@ const tour = useTour('codemap-flow');
|
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
`hint` 也可以自己給:`{ text, action, onAction, onDismiss }`,`action` 預設「開始」。
|
|
32
|
+
|
|
33
|
+
## 安靜樣式(variant="quiet")
|
|
34
|
+
|
|
35
|
+
頂列、分頁列這類一排好幾個按鈕的地方用 `variant="quiet"`:32 px、沒有外框,滑過、按下或鍵盤焦點時才有底色,圖示是次要文字色。觸控螢幕上點擊範圍仍是 48 px。
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
<IconButton variant="quiet" icon="magnifying-glass" label="搜尋" />
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
切換類的按鈕(例如收合面板)加 `aria-pressed`,按下時圖示變成主要文字色。
|
|
42
|
+
|