@scalewing/react 1.46.0 → 1.47.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 +7 -0
- package/README.md +59 -2
- package/dist/app-shell.test-support.d.ts +5 -0
- package/dist/app-shell.test-support.js +45 -0
- package/dist/components/AppShell.d.ts +12 -0
- package/dist/components/AppShell.js +48 -0
- package/dist/components/NavCount.d.ts +12 -5
- package/dist/components/NavCount.js +9 -4
- package/dist/components/SectionNav.d.ts +2 -1
- package/dist/components/SectionNav.js +3 -19
- package/dist/components/app-shell/AppShellDrawer.d.ts +24 -0
- package/dist/components/app-shell/AppShellDrawer.js +17 -0
- package/dist/components/app-shell/AppShellLink.d.ts +14 -0
- package/dist/components/app-shell/AppShellLink.js +27 -0
- package/dist/components/app-shell/AppShellNav.d.ts +15 -0
- package/dist/components/app-shell/AppShellNav.js +29 -0
- package/dist/components/app-shell/AppShellSidebar.d.ts +18 -0
- package/dist/components/app-shell/AppShellSidebar.js +18 -0
- package/dist/components/app-shell/types.d.ts +87 -0
- package/dist/components/app-shell/types.js +1 -0
- package/dist/components/app-shell/validate.d.ts +6 -0
- package/dist/components/app-shell/validate.js +52 -0
- package/dist/components/nav-items.d.ts +21 -0
- package/dist/components/nav-items.js +26 -0
- package/dist/css/css-app-shell-drawer.d.ts +2 -0
- package/dist/css/css-app-shell-drawer.js +91 -0
- package/dist/css/css-app-shell-nav.d.ts +3 -0
- package/dist/css/css-app-shell-nav.js +167 -0
- package/dist/css/css-app-shell.d.ts +4 -0
- package/dist/css/css-app-shell.js +150 -0
- package/dist/css/css-components.js +3 -0
- package/dist/css/css-count-pill.d.ts +7 -0
- package/dist/css/css-count-pill.js +42 -12
- package/dist/css/stylesheet.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/styles.css +328 -7
- package/package.json +1 -1
package/dist/styles.css
CHANGED
|
@@ -3582,7 +3582,8 @@ body {
|
|
|
3582
3582
|
}
|
|
3583
3583
|
|
|
3584
3584
|
[data-theme] .sw-section-nav-count,
|
|
3585
|
-
[data-theme] .sw-nav-count
|
|
3585
|
+
[data-theme] .sw-nav-count,
|
|
3586
|
+
[data-theme] .sw-app-shell-count {
|
|
3586
3587
|
align-items: center;
|
|
3587
3588
|
background: var(--sw-color-danger);
|
|
3588
3589
|
border-radius: var(--sw-radius-pill);
|
|
@@ -3601,16 +3602,28 @@ body {
|
|
|
3601
3602
|
}
|
|
3602
3603
|
|
|
3603
3604
|
/*
|
|
3604
|
-
*
|
|
3605
|
-
* was added since the person last looked),
|
|
3606
|
-
* on-colour figures (4.5:1 in every palette, as
|
|
3607
|
-
*
|
|
3605
|
+
* `tone="accent"` (NavCount, an AppShell item's `countTone`): a count that
|
|
3606
|
+
* is news, not work waiting (what was added since the person last looked),
|
|
3607
|
+
* is the accent fill with its on-colour figures (4.5:1 in every palette, as
|
|
3608
|
+
* a primary Button's label). `tone="warning"`: work that needs the person
|
|
3609
|
+
* but is not urgent is amber, the warning tint with the warning ink (a
|
|
3610
|
+
* warning Notice's, 4.5:1 on the tint in every palette) inside the warning
|
|
3611
|
+
* edge a warning Badge draws. One class more specific than the pill, so
|
|
3612
|
+
* each wins in any order.
|
|
3608
3613
|
*/
|
|
3609
|
-
[data-theme] .sw-nav-count.sw-nav-count-accent
|
|
3614
|
+
[data-theme] .sw-nav-count.sw-nav-count-accent,
|
|
3615
|
+
[data-theme] .sw-app-shell-count.sw-app-shell-count-accent {
|
|
3610
3616
|
background: var(--sw-color-accent);
|
|
3611
3617
|
color: var(--sw-color-onAccent);
|
|
3612
3618
|
}
|
|
3613
3619
|
|
|
3620
|
+
[data-theme] .sw-nav-count.sw-nav-count-warning,
|
|
3621
|
+
[data-theme] .sw-app-shell-count.sw-app-shell-count-warning {
|
|
3622
|
+
background: color-mix(in srgb, var(--sw-color-warning) 10%, var(--sw-color-surface));
|
|
3623
|
+
border: 1px solid var(--sw-color-warning);
|
|
3624
|
+
color: color-mix(in srgb, var(--sw-color-warning) 70%, var(--sw-color-text));
|
|
3625
|
+
}
|
|
3626
|
+
|
|
3614
3627
|
/*
|
|
3615
3628
|
* A Nav link holding a count lays out as SectionNav's link does: the words
|
|
3616
3629
|
* and the pill centred on one line a space-2 apart (the space text node
|
|
@@ -3628,7 +3641,8 @@ body {
|
|
|
3628
3641
|
|
|
3629
3642
|
@media (forced-colors: active) {
|
|
3630
3643
|
[data-theme] .sw-section-nav-count,
|
|
3631
|
-
[data-theme] .sw-nav-count
|
|
3644
|
+
[data-theme] .sw-nav-count,
|
|
3645
|
+
[data-theme] .sw-app-shell-count { border: 1px solid CanvasText; }
|
|
3632
3646
|
}
|
|
3633
3647
|
|
|
3634
3648
|
.sw-bar-chart {
|
|
@@ -4292,6 +4306,313 @@ body {
|
|
|
4292
4306
|
[data-theme] .sw-section-nav-link[aria-current] { border-color: Highlight; color: CanvasText; }
|
|
4293
4307
|
}
|
|
4294
4308
|
|
|
4309
|
+
.sw-app-shell {
|
|
4310
|
+
min-height: 100vh;
|
|
4311
|
+
min-height: 100dvh;
|
|
4312
|
+
}
|
|
4313
|
+
|
|
4314
|
+
.sw-app-shell-bar {
|
|
4315
|
+
align-items: center;
|
|
4316
|
+
display: flex;
|
|
4317
|
+
gap: var(--sw-space-2);
|
|
4318
|
+
}
|
|
4319
|
+
|
|
4320
|
+
.sw-app-shell-bar-title {
|
|
4321
|
+
flex: 1 1 auto;
|
|
4322
|
+
min-width: 0;
|
|
4323
|
+
}
|
|
4324
|
+
|
|
4325
|
+
.sw-app-shell-bar-end {
|
|
4326
|
+
align-items: center;
|
|
4327
|
+
display: flex;
|
|
4328
|
+
flex: none;
|
|
4329
|
+
gap: var(--sw-space-2);
|
|
4330
|
+
}
|
|
4331
|
+
|
|
4332
|
+
.sw-button.sw-app-shell-menu {
|
|
4333
|
+
flex: none;
|
|
4334
|
+
padding-inline: 0;
|
|
4335
|
+
}
|
|
4336
|
+
|
|
4337
|
+
.sw-button-xs.sw-app-shell-menu { min-width: var(--sw-control-xs-min-height); }
|
|
4338
|
+
.sw-button-sm.sw-app-shell-menu { min-width: var(--sw-control-sm-min-height); }
|
|
4339
|
+
.sw-button-md.sw-app-shell-menu { min-width: var(--sw-control-md-min-height); }
|
|
4340
|
+
|
|
4341
|
+
@media (pointer: coarse) {
|
|
4342
|
+
.sw-button.sw-app-shell-menu {
|
|
4343
|
+
min-height: var(--sw-control-md-min-height);
|
|
4344
|
+
min-width: var(--sw-control-md-min-height);
|
|
4345
|
+
}
|
|
4346
|
+
}
|
|
4347
|
+
|
|
4348
|
+
.sw-app-shell-main {
|
|
4349
|
+
display: block;
|
|
4350
|
+
min-width: 0;
|
|
4351
|
+
}
|
|
4352
|
+
|
|
4353
|
+
.sw-app-shell-sidebar,
|
|
4354
|
+
.sw-app-shell-sidebar .sw-app-shell-rail-slot {
|
|
4355
|
+
display: none;
|
|
4356
|
+
}
|
|
4357
|
+
|
|
4358
|
+
.sw-app-shell-header,
|
|
4359
|
+
.sw-app-shell-footer {
|
|
4360
|
+
flex: none;
|
|
4361
|
+
padding: var(--sw-space-3);
|
|
4362
|
+
}
|
|
4363
|
+
|
|
4364
|
+
.sw-app-shell-footer {
|
|
4365
|
+
border-top: 1px solid var(--sw-color-border);
|
|
4366
|
+
}
|
|
4367
|
+
|
|
4368
|
+
.sw-app-shell-nav {
|
|
4369
|
+
box-sizing: border-box;
|
|
4370
|
+
display: flex;
|
|
4371
|
+
flex: 1 1 auto;
|
|
4372
|
+
flex-direction: column;
|
|
4373
|
+
gap: var(--sw-space-4);
|
|
4374
|
+
min-height: 0;
|
|
4375
|
+
overflow-y: auto;
|
|
4376
|
+
overscroll-behavior: contain;
|
|
4377
|
+
padding: var(--sw-space-2) var(--sw-space-3);
|
|
4378
|
+
}
|
|
4379
|
+
|
|
4380
|
+
.sw-app-shell-group {
|
|
4381
|
+
display: flex;
|
|
4382
|
+
flex-direction: column;
|
|
4383
|
+
gap: var(--sw-space-1);
|
|
4384
|
+
}
|
|
4385
|
+
|
|
4386
|
+
.sw-app-shell-group-label {
|
|
4387
|
+
color: var(--sw-color-muted);
|
|
4388
|
+
font-family: var(--sw-font-sans);
|
|
4389
|
+
font-size: 13px;
|
|
4390
|
+
font-weight: 600;
|
|
4391
|
+
letter-spacing: -0.08px;
|
|
4392
|
+
line-height: 18px;
|
|
4393
|
+
margin: 0;
|
|
4394
|
+
padding-inline: var(--sw-space-2);
|
|
4395
|
+
}
|
|
4396
|
+
|
|
4397
|
+
.sw-app-shell-list {
|
|
4398
|
+
display: flex;
|
|
4399
|
+
flex-direction: column;
|
|
4400
|
+
gap: var(--sw-space-1);
|
|
4401
|
+
list-style: none;
|
|
4402
|
+
margin: 0;
|
|
4403
|
+
padding: 0;
|
|
4404
|
+
}
|
|
4405
|
+
|
|
4406
|
+
.sw-app-shell-item > .sw-tooltip-anchor {
|
|
4407
|
+
display: flex;
|
|
4408
|
+
}
|
|
4409
|
+
|
|
4410
|
+
[data-theme] .sw-app-shell-link {
|
|
4411
|
+
align-items: center;
|
|
4412
|
+
border: 2px solid transparent;
|
|
4413
|
+
border-radius: var(--sw-radius-sm);
|
|
4414
|
+
box-sizing: border-box;
|
|
4415
|
+
color: var(--sw-color-text);
|
|
4416
|
+
display: flex;
|
|
4417
|
+
flex: 1 1 auto;
|
|
4418
|
+
font-family: var(--sw-font-sans);
|
|
4419
|
+
font-size: 15px;
|
|
4420
|
+
font-weight: 500;
|
|
4421
|
+
gap: var(--sw-space-3);
|
|
4422
|
+
letter-spacing: -0.2px;
|
|
4423
|
+
line-height: 20px;
|
|
4424
|
+
min-height: var(--sw-control-sm-min-height);
|
|
4425
|
+
padding: var(--sw-space-1) var(--sw-space-2);
|
|
4426
|
+
text-decoration: none;
|
|
4427
|
+
}
|
|
4428
|
+
|
|
4429
|
+
[data-theme] .sw-app-shell-link:hover {
|
|
4430
|
+
background: color-mix(in srgb, var(--sw-color-muted) 12%, transparent);
|
|
4431
|
+
}
|
|
4432
|
+
|
|
4433
|
+
[data-theme] .sw-app-shell-link:focus-visible {
|
|
4434
|
+
outline: var(--sw-focus-ring-width) solid var(--sw-color-accent);
|
|
4435
|
+
outline-offset: calc(-1 * var(--sw-focus-ring-width));
|
|
4436
|
+
}
|
|
4437
|
+
|
|
4438
|
+
[data-theme] .sw-app-shell-link[aria-current] {
|
|
4439
|
+
background: color-mix(in srgb, var(--sw-color-muted) 18%, transparent);
|
|
4440
|
+
font-weight: 600;
|
|
4441
|
+
}
|
|
4442
|
+
|
|
4443
|
+
.sw-app-shell-icon {
|
|
4444
|
+
display: inline-flex;
|
|
4445
|
+
flex: none;
|
|
4446
|
+
}
|
|
4447
|
+
|
|
4448
|
+
.sw-app-shell-label {
|
|
4449
|
+
flex: 1 1 auto;
|
|
4450
|
+
min-width: 0;
|
|
4451
|
+
overflow-wrap: anywhere;
|
|
4452
|
+
}
|
|
4453
|
+
|
|
4454
|
+
.sw-app-shell-count {
|
|
4455
|
+
flex: none;
|
|
4456
|
+
}
|
|
4457
|
+
|
|
4458
|
+
@media (pointer: coarse) {
|
|
4459
|
+
[data-theme] .sw-app-shell-link { min-height: var(--sw-control-md-min-height); }
|
|
4460
|
+
}
|
|
4461
|
+
|
|
4462
|
+
@media (forced-colors: active) {
|
|
4463
|
+
[data-theme] .sw-app-shell-link { color: LinkText; }
|
|
4464
|
+
[data-theme] .sw-app-shell-link[aria-current] { border-color: Highlight; color: CanvasText; }
|
|
4465
|
+
}
|
|
4466
|
+
|
|
4467
|
+
@media (min-width: 64rem) {
|
|
4468
|
+
.sw-app-shell {
|
|
4469
|
+
align-items: start;
|
|
4470
|
+
display: grid;
|
|
4471
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
4472
|
+
}
|
|
4473
|
+
|
|
4474
|
+
.sw-app-shell-bar {
|
|
4475
|
+
display: none;
|
|
4476
|
+
}
|
|
4477
|
+
|
|
4478
|
+
.sw-app-shell-sidebar {
|
|
4479
|
+
background: var(--sw-color-surface);
|
|
4480
|
+
border-inline-end: 1px solid var(--sw-color-border);
|
|
4481
|
+
box-sizing: border-box;
|
|
4482
|
+
display: flex;
|
|
4483
|
+
flex-direction: column;
|
|
4484
|
+
height: 100vh;
|
|
4485
|
+
height: 100dvh;
|
|
4486
|
+
position: sticky;
|
|
4487
|
+
top: 0;
|
|
4488
|
+
width: calc(var(--sw-control-md-min-height) + 2 * var(--sw-space-3) + 1px);
|
|
4489
|
+
}
|
|
4490
|
+
|
|
4491
|
+
@media not all and (min-width: 75rem) {
|
|
4492
|
+
.sw-app-shell-sidebar .sw-app-shell-slot {
|
|
4493
|
+
display: none;
|
|
4494
|
+
}
|
|
4495
|
+
|
|
4496
|
+
.sw-app-shell-sidebar .sw-app-shell-rail-slot {
|
|
4497
|
+
display: block;
|
|
4498
|
+
}
|
|
4499
|
+
|
|
4500
|
+
.sw-app-shell-sidebar .sw-app-shell-label,
|
|
4501
|
+
.sw-app-shell-sidebar .sw-app-shell-group-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
|
|
4502
|
+
|
|
4503
|
+
.sw-app-shell-sidebar .sw-app-shell-nav {
|
|
4504
|
+
gap: var(--sw-space-2);
|
|
4505
|
+
}
|
|
4506
|
+
|
|
4507
|
+
.sw-app-shell-sidebar .sw-app-shell-group + .sw-app-shell-group {
|
|
4508
|
+
border-top: 1px solid var(--sw-color-border);
|
|
4509
|
+
padding-top: var(--sw-space-2);
|
|
4510
|
+
}
|
|
4511
|
+
|
|
4512
|
+
[data-theme] .sw-app-shell-sidebar .sw-app-shell-link {
|
|
4513
|
+
justify-content: center;
|
|
4514
|
+
min-height: var(--sw-control-md-min-height);
|
|
4515
|
+
padding: 0;
|
|
4516
|
+
position: relative;
|
|
4517
|
+
}
|
|
4518
|
+
|
|
4519
|
+
.sw-app-shell-sidebar .sw-app-shell-count {
|
|
4520
|
+
inset-block-start: 0;
|
|
4521
|
+
inset-inline-end: 0;
|
|
4522
|
+
position: absolute;
|
|
4523
|
+
}
|
|
4524
|
+
}
|
|
4525
|
+
}
|
|
4526
|
+
|
|
4527
|
+
@media (min-width: 75rem) {
|
|
4528
|
+
.sw-app-shell-sidebar {
|
|
4529
|
+
width: 15rem;
|
|
4530
|
+
}
|
|
4531
|
+
}
|
|
4532
|
+
|
|
4533
|
+
.sw-app-shell-drawer {
|
|
4534
|
+
background: var(--sw-color-surface);
|
|
4535
|
+
border: 0;
|
|
4536
|
+
border-inline-end: 1px solid var(--sw-color-border);
|
|
4537
|
+
box-sizing: border-box;
|
|
4538
|
+
color: var(--sw-color-text);
|
|
4539
|
+
height: 100%;
|
|
4540
|
+
inset-block: 0;
|
|
4541
|
+
inset-inline: 0 auto;
|
|
4542
|
+
margin: 0;
|
|
4543
|
+
max-height: none;
|
|
4544
|
+
max-width: calc(100% - var(--sw-space-8));
|
|
4545
|
+
overflow: hidden;
|
|
4546
|
+
padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
|
|
4547
|
+
padding-inline-start: env(safe-area-inset-left, 0px);
|
|
4548
|
+
width: 20rem;
|
|
4549
|
+
}
|
|
4550
|
+
|
|
4551
|
+
.sw-app-shell-drawer:dir(rtl) {
|
|
4552
|
+
padding-inline-start: env(safe-area-inset-right, 0px);
|
|
4553
|
+
}
|
|
4554
|
+
|
|
4555
|
+
.sw-app-shell-drawer[open] {
|
|
4556
|
+
animation: sw-app-shell-drawer-in var(--sw-motion-default) var(--sw-motion-easing);
|
|
4557
|
+
display: flex;
|
|
4558
|
+
flex-direction: column;
|
|
4559
|
+
}
|
|
4560
|
+
|
|
4561
|
+
.sw-app-shell-drawer[open]:dir(rtl) {
|
|
4562
|
+
animation-name: sw-app-shell-drawer-in-rtl;
|
|
4563
|
+
}
|
|
4564
|
+
|
|
4565
|
+
@keyframes sw-app-shell-drawer-in {
|
|
4566
|
+
from { translate: -100% 0; }
|
|
4567
|
+
}
|
|
4568
|
+
|
|
4569
|
+
@keyframes sw-app-shell-drawer-in-rtl {
|
|
4570
|
+
from { translate: 100% 0; }
|
|
4571
|
+
}
|
|
4572
|
+
|
|
4573
|
+
.sw-app-shell-drawer::backdrop {
|
|
4574
|
+
background: color-mix(in srgb, var(--sw-color-text) 28%, transparent);
|
|
4575
|
+
}
|
|
4576
|
+
|
|
4577
|
+
.sw-app-shell-drawer-top {
|
|
4578
|
+
align-items: center;
|
|
4579
|
+
display: flex;
|
|
4580
|
+
flex: none;
|
|
4581
|
+
gap: var(--sw-space-2);
|
|
4582
|
+
padding: var(--sw-space-3) var(--sw-space-3) 0;
|
|
4583
|
+
}
|
|
4584
|
+
|
|
4585
|
+
.sw-app-shell-drawer-top .sw-app-shell-header {
|
|
4586
|
+
flex: 1 1 auto;
|
|
4587
|
+
min-width: 0;
|
|
4588
|
+
padding: 0;
|
|
4589
|
+
}
|
|
4590
|
+
|
|
4591
|
+
.sw-button.sw-app-shell-close {
|
|
4592
|
+
flex: none;
|
|
4593
|
+
padding-inline: 0;
|
|
4594
|
+
}
|
|
4595
|
+
|
|
4596
|
+
.sw-button-xs.sw-app-shell-close { min-width: var(--sw-control-xs-min-height); }
|
|
4597
|
+
.sw-button-sm.sw-app-shell-close { min-width: var(--sw-control-sm-min-height); }
|
|
4598
|
+
.sw-button-md.sw-app-shell-close { min-width: var(--sw-control-md-min-height); }
|
|
4599
|
+
|
|
4600
|
+
@media (pointer: coarse) {
|
|
4601
|
+
.sw-button.sw-app-shell-close {
|
|
4602
|
+
min-height: var(--sw-control-md-min-height);
|
|
4603
|
+
min-width: var(--sw-control-md-min-height);
|
|
4604
|
+
}
|
|
4605
|
+
}
|
|
4606
|
+
|
|
4607
|
+
@media (prefers-reduced-motion: reduce) {
|
|
4608
|
+
.sw-app-shell-drawer[open],
|
|
4609
|
+
.sw-app-shell-drawer[open]:dir(rtl) { animation: none; }
|
|
4610
|
+
}
|
|
4611
|
+
|
|
4612
|
+
@media (forced-colors: active) {
|
|
4613
|
+
.sw-app-shell-drawer { border-inline-end-color: CanvasText; }
|
|
4614
|
+
}
|
|
4615
|
+
|
|
4295
4616
|
.sw-dialog {
|
|
4296
4617
|
background: var(--sw-glass-fill);
|
|
4297
4618
|
border: 1px solid var(--sw-glass-border);
|