@linxin666/dsh-liangshen 0.4.10 → 0.4.11

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.
@@ -53,8 +53,8 @@
53
53
  appearance: none;
54
54
  width: 100%;
55
55
  /* The suite does not force a global border-box, so width:100% + padding
56
- would stretch the row 32px past the card and push the trailing pending
57
- badge (last flex item) outside the card border. */
56
+ would stretch the row 32px past the card and push the trailing chevron
57
+ (last flex item) outside the card border. */
58
58
  box-sizing: border-box;
59
59
  font: inherit;
60
60
  color: inherit;
@@ -121,22 +121,11 @@
121
121
  .description {
122
122
  /* Secondary, not tertiary: skins whose tertiary token is tuned for large
123
123
  print leave 12-13px hint text below readable contrast (orca-link #778399
124
- on cream measures ~3.4:1). */
124
+ on cream measures ~3.4:1). The 18px leading matches the reference
125
+ settings-page description rhythm. */
125
126
  color: var(--dsw-alias-label-secondary);
126
- font-size: var(--settings-card-description-size);
127
- line-height: 1.5;
128
- }
129
-
130
- .pending {
131
- white-space: nowrap;
132
- background: var(--dsw-alias-bg-module-platform);
133
- color: var(--dsw-alias-label-secondary);
134
- border-radius: 999px;
135
- flex: none;
136
- padding: 1px 8px;
137
- font-size: 11px;
138
- font-weight: 500;
139
- line-height: 17px;
127
+ font-size: 12px;
128
+ line-height: 18px;
140
129
  }
141
130
 
142
131
  /* Header trailing control (an immediate toggle): a flex item that keeps its
@@ -190,7 +179,10 @@
190
179
  min-height: 0;
191
180
  }
192
181
 
182
+ /* The body is the query container its rows answer to: the card's own width,
183
+ not the viewport's, decides whether a control still fits beside its text. */
193
184
  .body {
185
+ container: settings-card / inline-size;
194
186
  border-top: 1px solid var(--dsw-alias-border-l2);
195
187
  margin: 0 var(--settings-card-body-inset);
196
188
  padding-bottom: 8px;
@@ -210,75 +202,51 @@
210
202
  line-height: 1.5;
211
203
  }
212
204
 
213
- .footer {
214
- border-top: 1px solid var(--dsw-alias-border-l2);
215
- justify-content: flex-end;
216
- align-items: center;
217
- gap: 8px;
218
- padding: 12px 0 4px;
219
- display: flex;
220
- }
221
-
205
+ /* The refused write, under the rows it belongs to; the control itself has
206
+ already gone back to the stored value. */
222
207
  .failed {
223
- min-width: 0;
224
208
  /* The suite's error alias is state-error-primary; a label-error token does
225
209
  not exist, so the var() would resolve to nothing and the message would
226
210
  inherit the ink color, losing the failure signal. */
227
211
  color: var(--dsw-alias-state-error-primary, #b42318);
228
- flex: 1;
229
- margin: 0;
212
+ margin: 8px 0 4px;
230
213
  font-size: 12px;
231
- line-height: 1.5;
232
- text-overflow: ellipsis;
233
- overflow: hidden;
234
- white-space: nowrap;
235
- }
236
-
237
- .discard,
238
- .save {
239
- appearance: none;
240
- font: inherit;
241
- cursor: pointer;
242
- border: 1px solid transparent;
243
- border-radius: 8px;
244
- padding: 5px 14px;
245
- font-size: 13px;
246
- line-height: 1.5;
247
- }
248
-
249
- .discard {
250
- border-color: var(--dsw-alias-border-l2);
251
- color: var(--dsw-alias-label-secondary);
252
- background: transparent;
214
+ line-height: 18px;
215
+ overflow-wrap: anywhere;
253
216
  }
254
217
 
255
- .discard:hover:not(:disabled) {
256
- color: var(--dsw-alias-label-primary);
257
- border-color: var(--dsw-alias-label-dimmed);
218
+ /* One settings row: the label and its hint on the left, the control on the
219
+ right across both lines, 16px above and below, a hairline between two rows.
220
+ The markup keeps label, control, hint in reading order and the grid places
221
+ the control, so a field built outside this file (a plugin's own preset
222
+ picker) lands in the same row by using the same classes. */
223
+ .field {
224
+ display: grid;
225
+ /* The control track is capped at half the row: an auto track sizes to its
226
+ widest content, and a three-option segment carrying a long label (a
227
+ localized "inherit from the deployment") then leaves the text column a few
228
+ characters wide. Capped, the segment wraps its options instead. */
229
+ grid-template-columns: minmax(0, 1fr) fit-content(50%);
230
+ grid-template-areas:
231
+ "head control"
232
+ "hint control";
233
+ align-items: center;
234
+ gap: 4px 24px;
235
+ padding: 16px 0;
258
236
  }
259
237
 
260
- .save {
261
- background: var(--dsw-alias-label-primary);
262
- color: var(--dsw-alias-bg-layer-3);
238
+ .field > .head {
239
+ grid-area: head;
263
240
  }
264
241
 
265
- .discard:disabled,
266
- .save:disabled {
267
- opacity: 0.4;
268
- cursor: default;
242
+ .field > :is(.hint, .invalid) {
243
+ grid-area: hint;
269
244
  }
270
245
 
271
- .discard:focus-visible,
272
- .save:focus-visible {
273
- outline: 2px solid var(--dsw-alias-brand-primary);
274
- outline-offset: 1px;
275
- }
276
-
277
- .field {
278
- flex-direction: column;
279
- gap: 6px;
280
- padding: 12px 0;
281
- display: flex;
246
+ .field > :not(.head, .hint, .invalid) {
247
+ grid-area: control;
248
+ justify-self: end;
249
+ max-width: 100%;
282
250
  }
283
251
 
284
252
  .field + .field {
@@ -295,9 +263,9 @@
295
263
  min-width: 0;
296
264
  color: var(--dsw-alias-label-primary);
297
265
  flex: 1;
298
- font-size: 13px;
299
- font-weight: 500;
300
- line-height: 1.5;
266
+ font-size: 14px;
267
+ font-weight: 400;
268
+ line-height: 22px;
301
269
  }
302
270
 
303
271
  .badges {
@@ -341,9 +309,99 @@
341
309
  outline-offset: 2px;
342
310
  }
343
311
 
344
- .reset:focus-visible {
312
+ /* Segmented controls (SegmentGroup.tsx): a 2px-inset track the options sit in,
313
+ and one raised box that marks the pressed option. The track is the ink at low
314
+ alpha over whatever panel holds it: a layer token resolves to the panel's own
315
+ fill under the dark theme and under skins, which hides the groove. The track
316
+ wraps instead of clipping, so localized labels stay complete in a narrow card. */
317
+ .segmentGroup {
318
+ position: relative;
319
+ display: inline-flex;
320
+ flex-wrap: wrap;
321
+ align-items: center;
322
+ gap: 2px;
323
+ padding: 2px;
324
+ border-radius: 8px;
325
+ background: color-mix(in srgb, var(--dsw-alias-label-primary) 7%, transparent);
326
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dsw-alias-label-primary) 5%, transparent);
327
+ }
328
+
329
+ .segment {
330
+ appearance: none;
331
+ margin: 0;
332
+ padding: 3px 12px;
333
+ border: 0;
334
+ border-radius: 7px;
335
+ background: transparent;
336
+ color: var(--dsw-alias-label-secondary);
337
+ font: inherit;
338
+ font-size: 13px;
339
+ font-weight: 500;
340
+ line-height: 18px;
341
+ white-space: nowrap;
342
+ cursor: pointer;
343
+ transition: background-color 120ms ease, color 120ms ease;
344
+ }
345
+
346
+ .segment:hover:not(:disabled):not([data-active]) {
347
+ color: var(--dsw-alias-label-primary);
348
+ }
349
+
350
+ /* The raised box marking the pressed option: the highlight once the group has
351
+ measured it, the option's own background for the frame before. Dark lifts
352
+ by white alpha: a layer fill there resolves to the track's own grey. */
353
+ .segmentGroup:not([data-pill]) > .segment[data-active],
354
+ .segmentGroup[data-pill]::before {
355
+ background: var(--dsw-alias-bg-overlay, var(--dsw-alias-bg-layer-3));
356
+ box-shadow: 0 1px 2px rgb(20 20 19 / 8%);
357
+ }
358
+
359
+ :global(body[data-ds-dark-theme]) .segmentGroup:not([data-pill]) > .segment[data-active],
360
+ :global(body[data-ds-dark-theme]) .segmentGroup[data-pill]::before {
361
+ background: rgb(255 255 255 / 14%);
362
+ box-shadow: none;
363
+ }
364
+
365
+ .segment[data-active] {
366
+ color: var(--dsw-alias-label-primary);
367
+ }
368
+
369
+ /* The sliding highlight: one box at the pressed option's measured place that
370
+ glides to the next one. The glide keeps playing under reduced motion: a
371
+ quarter-second move of one small box is how the control reads. */
372
+ .segmentGroup[data-pill]::before {
373
+ content: "";
374
+ position: absolute;
375
+ left: 0;
376
+ top: 0;
377
+ width: var(--segment-pill-w, 0px);
378
+ height: var(--segment-pill-h, 0px);
379
+ border-radius: 7px;
380
+ transform: translate(var(--segment-pill-x, 0px), var(--segment-pill-y, 0px));
381
+ pointer-events: none;
382
+ transition: transform 240ms cubic-bezier(0.22, 0.61, 0.36, 1),
383
+ width 240ms cubic-bezier(0.22, 0.61, 0.36, 1),
384
+ height 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
385
+ }
386
+
387
+ /* The options paint above the highlight, the group's first painted box. */
388
+ .segmentGroup > * {
389
+ position: relative;
390
+ z-index: 1;
391
+ }
392
+
393
+ .segment:focus-visible {
345
394
  outline: 2px solid var(--dsw-alias-brand-primary);
346
- outline-offset: 2px;
395
+ outline-offset: 1px;
396
+ }
397
+
398
+ .segment:disabled {
399
+ cursor: not-allowed;
400
+ opacity: 0.45;
401
+ }
402
+
403
+ .segmentGroup[data-pill]:has(> .segment:disabled)::before {
404
+ opacity: 0.45;
347
405
  }
348
406
 
349
407
  .input,
@@ -389,6 +447,43 @@
389
447
  border-color: var(--dsw-alias-state-error-primary, #b42318);
390
448
  }
391
449
 
450
+ /* Beside its text a field keeps a width that reads a value at a glance and
451
+ leaves the hint its room; text fields and pickers share it, so a column of
452
+ rows lines their left edges up. */
453
+ .field > :is(.input, .inputInvalid, .select, .selectWrap, .rangeAnchor) {
454
+ box-sizing: border-box;
455
+ width: 220px;
456
+ }
457
+
458
+ .rangeAnchor > :is(.input, .inputInvalid) {
459
+ box-sizing: border-box;
460
+ width: 100%;
461
+ }
462
+
463
+ /* A narrow card hands the control the line under the text, where it starts at
464
+ the row's left edge, rather than crushing the hint into a few characters a
465
+ line; a text field or a picker then takes the row's whole width. This block
466
+ follows the widths above so it outranks them. */
467
+ @container settings-card (max-width: 440px) {
468
+ .field {
469
+ grid-template-columns: minmax(0, 1fr);
470
+ grid-template-areas:
471
+ "head"
472
+ "hint"
473
+ "control";
474
+ row-gap: 8px;
475
+ }
476
+
477
+ .field > :not(.head, .hint, .invalid) {
478
+ justify-self: start;
479
+ }
480
+
481
+ .field > :is(.input, .inputInvalid, .select, .selectWrap, .rangeAnchor) {
482
+ justify-self: stretch;
483
+ width: auto;
484
+ }
485
+ }
486
+
392
487
  .selectWrap {
393
488
  position: relative;
394
489
  }
@@ -452,6 +547,127 @@
452
547
  pointer-events: none;
453
548
  }
454
549
 
550
+ /* Coarse adjustment (RangeBubble.tsx): a popover with one slider over the
551
+ field's whole range, hung off the precise control. Hidden through
552
+ visibility, so a closed bubble takes no pointer and no tab stop; the delay on
553
+ visibility lets the fade finish before it goes. */
554
+ .rangeAnchor {
555
+ position: relative;
556
+ display: inline-flex;
557
+ }
558
+
559
+ .rangeBubble {
560
+ position: absolute;
561
+ right: 0;
562
+ z-index: 40;
563
+ box-sizing: border-box;
564
+ width: 220px;
565
+ padding: 10px 12px 6px;
566
+ border: 1px solid var(--dsw-alias-border-l2);
567
+ border-radius: 10px;
568
+ background: var(--dsw-alias-bg-layer-3);
569
+ box-shadow: 0 8px 24px var(--dsw-alias-bg-mask-2);
570
+ opacity: 0;
571
+ visibility: hidden;
572
+ transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0.12s;
573
+ }
574
+
575
+ .rangeBubble[data-side="above"] {
576
+ bottom: calc(100% + 6px);
577
+ transform: translateY(4px);
578
+ }
579
+
580
+ .rangeBubble[data-side="below"] {
581
+ top: calc(100% + 6px);
582
+ transform: translateY(-4px);
583
+ }
584
+
585
+ .rangeBubble[data-open] {
586
+ opacity: 1;
587
+ visibility: visible;
588
+ transform: none;
589
+ transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s;
590
+ }
591
+
592
+ /* The slider: a thin groove filled up to the thumb in the brand color, and a
593
+ round thumb that grows a little while it is held. */
594
+ .rangeSlider {
595
+ appearance: none;
596
+ display: block;
597
+ width: 100%;
598
+ height: 18px;
599
+ margin: 0;
600
+ background: transparent;
601
+ cursor: pointer;
602
+ }
603
+
604
+ .rangeSlider::-webkit-slider-runnable-track {
605
+ height: 4px;
606
+ border-radius: 999px;
607
+ background: linear-gradient(to right,
608
+ var(--dsw-alias-brand-primary) var(--range-fill, 0%),
609
+ color-mix(in srgb, var(--dsw-alias-label-primary) 12%, transparent) var(--range-fill, 0%));
610
+ }
611
+
612
+ .rangeSlider::-moz-range-track {
613
+ height: 4px;
614
+ border-radius: 999px;
615
+ background: color-mix(in srgb, var(--dsw-alias-label-primary) 12%, transparent);
616
+ }
617
+
618
+ .rangeSlider::-moz-range-progress {
619
+ height: 4px;
620
+ border-radius: 999px;
621
+ background: var(--dsw-alias-brand-primary);
622
+ }
623
+
624
+ .rangeSlider::-webkit-slider-thumb {
625
+ appearance: none;
626
+ width: 14px;
627
+ height: 14px;
628
+ margin-top: -5px;
629
+ border: 0;
630
+ border-radius: 50%;
631
+ background: #fff;
632
+ box-shadow: 0 0 0 1px rgb(0 0 0 / 12%), 0 1px 3px rgb(0 0 0 / 25%);
633
+ transition: transform 0.12s ease;
634
+ }
635
+
636
+ .rangeSlider::-moz-range-thumb {
637
+ width: 14px;
638
+ height: 14px;
639
+ border: 0;
640
+ border-radius: 50%;
641
+ background: #fff;
642
+ box-shadow: 0 0 0 1px rgb(0 0 0 / 12%), 0 1px 3px rgb(0 0 0 / 25%);
643
+ }
644
+
645
+ .rangeSlider:active::-webkit-slider-thumb {
646
+ transform: scale(1.15);
647
+ }
648
+
649
+ .rangeSlider:focus-visible {
650
+ outline: none;
651
+ }
652
+
653
+ .rangeSlider:focus-visible::-webkit-slider-thumb {
654
+ box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary);
655
+ }
656
+
657
+ .rangeSlider:disabled {
658
+ cursor: not-allowed;
659
+ }
660
+
661
+ .rangeEnds {
662
+ display: flex;
663
+ justify-content: space-between;
664
+ margin-top: 2px;
665
+ color: var(--dsw-alias-label-secondary);
666
+ font-size: 11px;
667
+ line-height: 16px;
668
+ font-variant-numeric: tabular-nums;
669
+ }
670
+
455
671
  .selectOption {
456
672
  /* 弹层是 max-height 受限的 flex 列:选项必须保持自然行高,超出交给弹层滚动 */
457
673
  flex-shrink: 0;
@@ -474,27 +690,27 @@
474
690
  .selectOptionSelected {
475
691
  color: var(--dsw-alias-brand-primary);
476
692
  font-weight: 500;
477
- background: color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 10%, transparent);
693
+ background: color-mix(in srgb, var(--dsw-alias-brand-primary) 10%, transparent);
478
694
  }
479
695
 
480
696
  .invalid {
481
697
  color: var(--dsw-alias-state-error-primary, #b42318);
482
698
  margin: 0;
483
699
  font-size: 12px;
484
- line-height: 1.5;
700
+ line-height: 18px;
485
701
  }
486
702
 
487
703
  .hint {
488
704
  color: var(--dsw-alias-label-secondary);
489
705
  margin: 0;
490
706
  font-size: 12px;
491
- line-height: 1.5;
707
+ line-height: 18px;
492
708
  }
493
709
 
494
- /* Immediate boolean toggle: the official switch shape (30x16 track, 12px
495
- thumb). The on state fills with the primary-action pair rather than a fixed
496
- state color, so it stays legible in every theme; disabled dims through
497
- opacity instead of a second palette. */
710
+ /* Immediate boolean toggle: a 36x20 capsule with a 16px thumb. The on state
711
+ fills with the primary-action pair rather than a fixed state color, so it
712
+ stays legible in every theme; disabled dims through opacity instead of a
713
+ second palette. */
498
714
  .toggle {
499
715
  appearance: none;
500
716
  display: inline-flex;
@@ -511,24 +727,28 @@
511
727
  .toggleTrack {
512
728
  position: relative;
513
729
  flex: none;
514
- width: 30px;
515
- height: 16px;
730
+ width: 36px;
731
+ height: 20px;
516
732
  border-radius: 999px;
517
733
  /* Off must still read as a rail: border-l2 is an alpha hairline color and
518
734
  leaves the track nearly invisible on a card surface. */
519
735
  background: var(--dsw-alias-label-dimmed);
520
- transition: background 0.18s ease;
736
+ transition: background-color 0.18s ease;
521
737
  }
522
738
 
523
739
  .toggleThumb {
740
+ --toggle-travel: 16px;
741
+ --toggle-overshoot: 1px;
524
742
  position: absolute;
525
743
  top: 2px;
526
744
  left: 2px;
527
- width: 12px;
528
- height: 12px;
745
+ width: 16px;
746
+ height: 16px;
529
747
  border-radius: 50%;
530
748
  background: var(--dsw-alias-bg-layer-3);
531
- transition: left 0.18s ease;
749
+ box-shadow: 0 1px 2px rgb(20 20 19 / 18%);
750
+ translate: 0 0;
751
+ transition: translate 0.18s ease;
532
752
  }
533
753
 
534
754
  .toggle[aria-checked='true'] .toggleTrack {
@@ -536,10 +756,34 @@
536
756
  }
537
757
 
538
758
  .toggle[aria-checked='true'] .toggleThumb {
539
- left: 16px;
759
+ translate: var(--toggle-travel) 0;
540
760
  background: var(--dsw-alias-label-primary-foreground, var(--dsw-alias-bg-layer-3));
541
761
  }
542
762
 
763
+ /* Pressed, the thumb travels across with a double bounce — past its end, back,
764
+ settled — while the track's colour changes on its own clock. Only a switch
765
+ the reader has pressed is armed (data-moved): a thumb drawn by a page
766
+ opening stands where it is. */
767
+ .toggle[data-moved][aria-checked='true'] .toggleThumb {
768
+ animation: toggle-on 0.35s cubic-bezier(0.34, 1.45, 0.64, 1) both;
769
+ }
770
+
771
+ .toggle[data-moved][aria-checked='false'] .toggleThumb {
772
+ animation: toggle-off 0.35s cubic-bezier(0.34, 1.45, 0.64, 1) both;
773
+ }
774
+
775
+ @keyframes toggle-on {
776
+ 0% { translate: 0 0; }
777
+ 55% { translate: calc(var(--toggle-travel) + var(--toggle-overshoot)) 0; }
778
+ 80%, 100% { translate: var(--toggle-travel) 0; }
779
+ }
780
+
781
+ @keyframes toggle-off {
782
+ 0% { translate: var(--toggle-travel) 0; }
783
+ 55% { translate: calc(0px - var(--toggle-overshoot)) 0; }
784
+ 80%, 100% { translate: 0 0; }
785
+ }
786
+
543
787
  .toggle:focus-visible {
544
788
  outline: 2px solid var(--dsw-alias-brand-primary);
545
789
  outline-offset: 2px;
@@ -547,7 +791,7 @@
547
791
 
548
792
  .toggle:disabled {
549
793
  opacity: 0.45;
550
- cursor: default;
794
+ cursor: not-allowed;
551
795
  }
552
796
 
553
797
  @media (prefers-reduced-motion: reduce) {
@@ -556,8 +800,7 @@
556
800
  .mark,
557
801
  .chevron,
558
802
  .chevronOpen,
559
- .discard,
560
- .save,
803
+ .rangeBubble,
561
804
  .selectChevron,
562
805
  .selectChevronOpen,
563
806
  .selectPopup,
@@ -566,6 +809,10 @@
566
809
  transition: none;
567
810
  }
568
811
 
812
+ .toggle[data-moved] .toggleThumb {
813
+ animation: none;
814
+ }
815
+
569
816
  /* Reduced motion drops the height travel but keeps the fade, so a closing
570
817
  body still leaves through the leg its own state started. */
571
818
  .disclosure {