@fungi.computer/caps 0.4.0 → 0.6.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/src/styles.css CHANGED
@@ -2980,34 +2980,23 @@
2980
2980
  }
2981
2981
  .caps-resize-handle {
2982
2982
  display: grid;
2983
- width: 64px;
2984
- height: 22px;
2983
+ width: 44px;
2984
+ height: 24px;
2985
+ grid-template-columns: minmax(0, 1fr);
2985
2986
  place-items: center;
2986
- border: var(--border) solid var(--stipe-linework);
2987
+ border: 0;
2987
2988
  border-radius: var(--radius-field);
2988
- background: var(--color-base-200);
2989
+ background: transparent;
2989
2990
  cursor: row-resize;
2990
2991
  touch-action: none;
2991
2992
  user-select: none;
2992
2993
  }
2993
2994
  .caps-resize-handle[aria-orientation="vertical"] {
2994
- width: 22px;
2995
- height: 64px;
2995
+ width: 24px;
2996
+ height: 44px;
2996
2997
  cursor: col-resize;
2997
2998
  }
2998
- .caps-resize-handle[data-resize-variant="notch"] {
2999
- border-radius: var(--radius-box) var(--radius-box) var(--radius-field)
3000
- var(--radius-field);
3001
- box-shadow:
3002
- inset 0 1px 0 oklch(100% 0 0 / calc(var(--depth) * 0.55)),
3003
- 0 calc(var(--depth) * 1px) calc(var(--depth) * 2px)
3004
- color-mix(
3005
- in oklab,
3006
- var(--color-base-content) calc(var(--depth) * 12%),
3007
- transparent
3008
- );
3009
- }
3010
- .caps-resize-handle:is(:hover, :focus-visible) {
2999
+ .caps-resize-handle:focus-visible {
3011
3000
  outline: 2px solid var(--color-info);
3012
3001
  outline-offset: 2px;
3013
3002
  }
@@ -3016,49 +3005,46 @@
3016
3005
  }
3017
3006
  .caps-resize-grip {
3018
3007
  position: relative;
3019
- width: 38px;
3020
- height: 8px;
3008
+ width: 28px;
3009
+ height: 6px;
3021
3010
  border-radius: var(--radius-button);
3022
- background-color: var(--color-neutral);
3023
- background-image: linear-gradient(
3024
- to bottom,
3025
- oklch(100% 0 0 / calc(var(--depth) * 0.08)),
3026
- transparent 50%,
3027
- oklch(0% 0 0 / calc(var(--depth) * 0.015))
3028
- );
3029
- box-shadow: var(
3030
- --stipe-shadow-raised,
3031
- inset 0 1px 0 oklch(100% 0 0 / calc(var(--depth) * 0.6)),
3032
- inset 0 -2px 0 color-mix(in oklab, var(--color-neutral) 75%, black),
3033
- inset 0 0 0 1px
3011
+ background-color: var(--color-base-200);
3012
+ box-shadow:
3013
+ 0 0 0 1px
3014
+ color-mix(in oklab, var(--stipe-linework) 80%, var(--color-base-200)),
3015
+ inset 0 1px 0 oklch(100% 0 0 / calc(var(--depth) * 0.18)),
3016
+ 0 1px 0
3034
3017
  color-mix(
3035
3018
  in oklab,
3036
- var(--color-neutral),
3037
- black calc(var(--depth) * 14%)
3038
- )
3039
- );
3019
+ var(--color-base-200),
3020
+ var(--color-base-content) 14%
3021
+ );
3022
+ }
3023
+ .caps-resize-handle:hover .caps-resize-grip {
3024
+ background-color: var(--color-base-300);
3040
3025
  }
3041
3026
  .caps-resize-grip::after {
3042
3027
  content: "";
3043
3028
  position: absolute;
3044
- inset-inline: 7px;
3029
+ left: 50%;
3045
3030
  top: 50%;
3031
+ width: 2px;
3046
3032
  height: 2px;
3047
- transform: translateY(-50%);
3048
- border-radius: var(--radius-button);
3049
- background: linear-gradient(
3050
- to bottom,
3051
- oklch(100% 0 0 / calc(var(--depth) * 0.45)) 50%,
3052
- oklch(0% 0 0 / calc(var(--depth) * 0.28)) 50%
3053
- );
3033
+ transform: translate(-50%, -50%);
3034
+ border-radius: var(--radius-selector);
3035
+ background: color-mix(in oklab, var(--color-base-content) 45%, transparent);
3054
3036
  box-shadow:
3055
- 0 -3px 0 -0.5px oklch(100% 0 0 / calc(var(--depth) * 0.45)),
3056
- 0 -2px 0 -0.5px oklch(0% 0 0 / calc(var(--depth) * 0.28)),
3057
- 0 3px 0 -0.5px oklch(100% 0 0 / calc(var(--depth) * 0.45)),
3058
- 0 4px 0 -0.5px oklch(0% 0 0 / calc(var(--depth) * 0.28));
3037
+ -5px 0 0 color-mix(in oklab, var(--color-base-content) 45%, transparent),
3038
+ 5px 0 0 color-mix(in oklab, var(--color-base-content) 45%, transparent);
3059
3039
  }
3060
3040
  .caps-resize-handle[aria-orientation="vertical"] .caps-resize-grip {
3061
- transform: rotate(90deg);
3041
+ width: 6px;
3042
+ height: 28px;
3043
+ }
3044
+ .caps-resize-handle[aria-orientation="vertical"] .caps-resize-grip::after {
3045
+ box-shadow:
3046
+ 0 -5px 0 color-mix(in oklab, var(--color-base-content) 45%, transparent),
3047
+ 0 5px 0 color-mix(in oklab, var(--color-base-content) 45%, transparent);
3062
3048
  }
3063
3049
  @media (prefers-reduced-motion: reduce) {
3064
3050
  .caps-scroll-thumb-surface {
@@ -3066,6 +3052,10 @@
3066
3052
  }
3067
3053
  }
3068
3054
  @media (forced-colors: active) {
3055
+ .caps-resize-grip {
3056
+ border: 1px solid ButtonText;
3057
+ box-shadow: none;
3058
+ }
3069
3059
  .caps-scroll-track {
3070
3060
  background: Canvas;
3071
3061
  box-shadow: none;
@@ -4665,6 +4655,232 @@
4665
4655
  padding-bottom: var(--spacing-sm);
4666
4656
  }
4667
4657
 
4658
+ /* The label gutter belongs to an opted-in form. No default Field or Form
4659
+ changes geometry, including the signed-off permissions panel. */
4660
+ :is(.caps-form, .caps-form-section, .caps-fieldset)[data-layout="columns"] {
4661
+ --caps-form-label-col: 9rem;
4662
+ }
4663
+ .caps-form[data-layout="columns"]
4664
+ :is(.caps-form-body, .caps-form-section-fields) {
4665
+ gap: var(--spacing-sm);
4666
+ }
4667
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4668
+ :is(
4669
+ .caps-field[data-orientation="vertical"],
4670
+ .caps-field[data-orientation="horizontal"] > .caps-field-row
4671
+ ) {
4672
+ display: grid;
4673
+ grid-template-columns: var(--caps-form-label-col) minmax(0, 1fr);
4674
+ column-gap: var(--spacing-md);
4675
+ row-gap: var(--spacing-2xs);
4676
+ align-items: center;
4677
+ justify-content: stretch;
4678
+ --caps-field-control-width: 100%;
4679
+ }
4680
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4681
+ :is(
4682
+ .caps-field[data-orientation="vertical"],
4683
+ .caps-field[data-orientation="horizontal"] > .caps-field-row
4684
+ )
4685
+ > .caps-field-copy {
4686
+ display: contents;
4687
+ }
4688
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4689
+ :is(
4690
+ .caps-field[data-orientation="vertical"],
4691
+ .caps-field[data-orientation="horizontal"] > .caps-field-row
4692
+ )
4693
+ > .caps-field-copy
4694
+ > label {
4695
+ grid-column: 1;
4696
+ grid-row: 1;
4697
+ min-width: 0;
4698
+ overflow: hidden;
4699
+ text-overflow: ellipsis;
4700
+ white-space: nowrap;
4701
+ }
4702
+ .caps-fieldset[data-layout="columns"] > .caps-fieldset-legend {
4703
+ min-width: 0;
4704
+ overflow: hidden;
4705
+ text-overflow: ellipsis;
4706
+ white-space: nowrap;
4707
+ }
4708
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4709
+ :is(
4710
+ .caps-field[data-orientation="vertical"],
4711
+ .caps-field[data-orientation="horizontal"] > .caps-field-row
4712
+ )
4713
+ > .caps-field-copy
4714
+ > .caps-field-description {
4715
+ grid-column: 2;
4716
+ grid-row: 2;
4717
+ }
4718
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4719
+ :is(
4720
+ .caps-field[data-orientation="vertical"],
4721
+ .caps-field[data-orientation="horizontal"] > .caps-field-row
4722
+ )
4723
+ > :not(.caps-field-copy, .caps-field-lead, .caps-field-error-reveal) {
4724
+ grid-column: 2;
4725
+ grid-row: 1;
4726
+ width: 100%;
4727
+ max-width: 30rem;
4728
+ }
4729
+ /* Grid controls fill the value column; a switch or checkbox is a fixed-size
4730
+ key, never a stretched track spanning the next settings row. */
4731
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4732
+ :is(
4733
+ .caps-field[data-orientation="vertical"],
4734
+ .caps-field[data-orientation="horizontal"] > .caps-field-row
4735
+ )
4736
+ > .caps-switch {
4737
+ width: 40px;
4738
+ justify-self: start;
4739
+ }
4740
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4741
+ :is(
4742
+ .caps-field[data-orientation="vertical"],
4743
+ .caps-field[data-orientation="horizontal"] > .caps-field-row
4744
+ )
4745
+ > .caps-checkbox {
4746
+ width: 24px;
4747
+ justify-self: start;
4748
+ }
4749
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4750
+ .caps-field[data-orientation="vertical"]
4751
+ > .caps-field-lead {
4752
+ grid-column: 1;
4753
+ grid-row: 1;
4754
+ margin: 0;
4755
+ }
4756
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4757
+ .caps-field[data-orientation="vertical"]
4758
+ > .caps-field-error-reveal {
4759
+ grid-column: 2;
4760
+ grid-row: 2;
4761
+ }
4762
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4763
+ .caps-field[data-orientation="horizontal"]
4764
+ > .caps-field-row
4765
+ > .caps-field-lead {
4766
+ grid-column: 1;
4767
+ grid-row: 1;
4768
+ }
4769
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4770
+ .caps-field[data-orientation="horizontal"]
4771
+ > .caps-field-error-reveal {
4772
+ padding-inline-start: calc(var(--caps-form-label-col) + var(--spacing-md));
4773
+ }
4774
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4775
+ .caps-field:has(> .caps-field-error-reveal[data-open="true"])
4776
+ .caps-field-description,
4777
+ .caps-fieldset[data-layout="columns"]:has(
4778
+ > .caps-field-error-reveal[data-open="true"]
4779
+ )
4780
+ > .caps-fieldset-description {
4781
+ display: none;
4782
+ }
4783
+ .caps-fieldset[data-layout="columns"] {
4784
+ display: grid;
4785
+ grid-template-columns: var(--caps-form-label-col) minmax(0, 1fr);
4786
+ column-gap: var(--spacing-md);
4787
+ row-gap: var(--spacing-2xs);
4788
+ align-items: start;
4789
+ }
4790
+ .caps-fieldset[data-layout="columns"] > .caps-fieldset-legend {
4791
+ grid-column: 1;
4792
+ grid-row: 1;
4793
+ margin: 0;
4794
+ }
4795
+ .caps-fieldset[data-layout="columns"] > .caps-fieldset-fields {
4796
+ grid-column: 2;
4797
+ grid-row: 1;
4798
+ flex-direction: row;
4799
+ flex-wrap: wrap;
4800
+ margin: 0;
4801
+ }
4802
+ .caps-fieldset[data-layout="columns"]
4803
+ > :is(.caps-fieldset-description, .caps-field-error-reveal) {
4804
+ grid-column: 2;
4805
+ grid-row: 2;
4806
+ }
4807
+ .caps-form[data-layout="columns"] .caps-form-footer {
4808
+ padding-inline-start: calc(var(--caps-form-label-col) + var(--spacing-md));
4809
+ max-width: calc(var(--caps-form-label-col) + var(--spacing-md) + 30rem);
4810
+ }
4811
+ /* A short add form can share its one field row with the actions. */
4812
+ @container (min-width: 36rem) {
4813
+ .caps-form[data-layout="columns"]
4814
+ .caps-form-body:has(> .caps-field:first-child:nth-last-child(2)) {
4815
+ display: grid;
4816
+ grid-template-columns: minmax(0, 1fr) auto;
4817
+ align-items: start;
4818
+ }
4819
+ .caps-form[data-layout="columns"]
4820
+ .caps-form-body:has(> .caps-field:first-child:nth-last-child(2))
4821
+ > .caps-form-footer {
4822
+ padding-inline-start: 0;
4823
+ max-width: none;
4824
+ }
4825
+ }
4826
+ /* Decide once per form: the 30rem example still has space for a 9rem label
4827
+ and its control, while genuinely narrow phone forms stack every field. */
4828
+ @container (max-width: 20rem) {
4829
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4830
+ :is(
4831
+ .caps-field[data-orientation="vertical"],
4832
+ .caps-field[data-orientation="horizontal"] > .caps-field-row
4833
+ ),
4834
+ .caps-fieldset[data-layout="columns"] {
4835
+ grid-template-columns: minmax(0, 1fr);
4836
+ }
4837
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4838
+ :is(
4839
+ .caps-field[data-orientation="vertical"],
4840
+ .caps-field[data-orientation="horizontal"] > .caps-field-row
4841
+ )
4842
+ > :not(.caps-field-copy, .caps-field-lead, .caps-field-error-reveal),
4843
+ .caps-fieldset[data-layout="columns"] > .caps-fieldset-fields {
4844
+ grid-column: 1;
4845
+ grid-row: 2;
4846
+ max-width: none;
4847
+ }
4848
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4849
+ :is(
4850
+ .caps-field[data-orientation="vertical"],
4851
+ .caps-field[data-orientation="horizontal"] > .caps-field-row
4852
+ )
4853
+ > .caps-field-copy
4854
+ > .caps-field-description,
4855
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4856
+ .caps-field[data-orientation="vertical"]
4857
+ > .caps-field-error-reveal,
4858
+ .caps-fieldset[data-layout="columns"]
4859
+ > :is(.caps-fieldset-description, .caps-field-error-reveal) {
4860
+ grid-column: 1;
4861
+ grid-row: 3;
4862
+ }
4863
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4864
+ :is(
4865
+ .caps-field[data-orientation="vertical"],
4866
+ .caps-field[data-orientation="horizontal"] > .caps-field-row
4867
+ )
4868
+ > .caps-field-copy
4869
+ > label,
4870
+ .caps-fieldset[data-layout="columns"] > .caps-fieldset-legend {
4871
+ overflow: visible;
4872
+ text-overflow: clip;
4873
+ white-space: normal;
4874
+ }
4875
+ :is(.caps-form, .caps-form-section)[data-layout="columns"]
4876
+ .caps-field[data-orientation="horizontal"]
4877
+ > .caps-field-error-reveal,
4878
+ .caps-form[data-layout="columns"] .caps-form-footer {
4879
+ padding-inline-start: 0;
4880
+ max-width: none;
4881
+ }
4882
+ }
4883
+
4668
4884
  /* Choice cards: a RadioGroup option with room for a description and a
4669
4885
  trailing readout. Selection is ink, not accent. */
4670
4886
  .caps-choice-card {