@decidables/prospectable-elements 0.5.2 → 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.
@@ -10522,18 +10522,6 @@
10522
10522
  getComputedStyleValue(property) {
10523
10523
  return getComputedStyle(this).getPropertyValue(property).trim();
10524
10524
  }
10525
- firstUpdated(changedProperties) {
10526
- super.firstUpdated(changedProperties);
10527
-
10528
- // Use focus highlighting if keyboard is used at all
10529
- select(this.renderRoot.host).classed('keyboard', true).on('mousemove.keyboard touchstart.keyboard', event => {
10530
- const element = event.currentTarget;
10531
- select(element.renderRoot.host).classed('keyboard', false).on('mousemove.keyboard touchstart.keyboard', null);
10532
- }).on('keydown.keyboard', event => {
10533
- const element = event.currentTarget;
10534
- select(element.renderRoot.host).classed('keyboard', true).on('keydown.keyboard mousemove.keyboard touchstart.keyboard', null);
10535
- });
10536
- }
10537
10525
  static get greys() {
10538
10526
  const grey = '#999999';
10539
10527
  const greys = {};
@@ -10669,7 +10657,7 @@
10669
10657
  };
10670
10658
  /* eslint-enable key-spacing, object-curly-newline */
10671
10659
  }
10672
- static cssBoxShadow(elevation, rotate = false, inverse = false) {
10660
+ static cssBoxShadow(elevation, inverse = false) {
10673
10661
  const umbraO = this.shadows.opacityUmbra + this.shadows.opacityBoost;
10674
10662
  const penumbraO = this.shadows.opacityPenumbra + this.shadows.opacityBoost;
10675
10663
  const ambientO = this.shadows.opacityAmbient + this.shadows.opacityBoost;
@@ -10679,9 +10667,9 @@
10679
10667
  const umbraM = this.shadows.mapUmbra[elevation];
10680
10668
  const penumbraM = this.shadows.mapPenumbra[elevation];
10681
10669
  const ambientM = this.shadows.mapAmbient[elevation];
10682
- const umbraS = rotate ? `${-umbraM.y}px ${umbraM.y / 2}px ${umbraM.b}px ${umbraM.s}px` : `${umbraM.y / 2}px ${umbraM.y}px ${umbraM.b}px ${umbraM.s}px`;
10683
- const penumbraS = rotate ? `${-penumbraM.y}px ${penumbraM.y / 2}px ${penumbraM.b}px ${penumbraM.s}px` : `${penumbraM.y / 2}px ${penumbraM.y}px ${penumbraM.b}px ${penumbraM.s}px`;
10684
- const ambientS = rotate ? `${-ambientM.y}px ${ambientM.y / 2}px ${ambientM.b}px ${ambientM.s}px` : `${ambientM.y / 2}px ${ambientM.y}px ${ambientM.b}px ${ambientM.s}px`;
10670
+ const umbraS = `${umbraM.y / 2}px ${umbraM.y}px ${umbraM.b}px ${umbraM.s}px`;
10671
+ const penumbraS = `${penumbraM.y / 2}px ${penumbraM.y}px ${penumbraM.b}px ${penumbraM.s}px`;
10672
+ const ambientS = `${ambientM.y / 2}px ${ambientM.y}px ${ambientM.b}px ${ambientM.s}px`;
10685
10673
  return `${umbraS} ${umbraC}, ${penumbraS} ${penumbraC}, ${ambientS} ${ambientC}`;
10686
10674
  }
10687
10675
  static get svgFilters() {
@@ -10817,49 +10805,58 @@
10817
10805
  button {
10818
10806
  width: 100%;
10819
10807
  height: 100%;
10808
+
10820
10809
  padding: 0.375rem 0.75rem;
10821
10810
 
10822
10811
  font-family: var(---font-family-base);
10823
10812
  font-size: 1.125rem;
10813
+
10824
10814
  line-height: 1.5;
10815
+
10825
10816
  color: var(---color-text-inverse);
10826
10817
 
10818
+ outline: none;
10819
+
10827
10820
  border: 0;
10828
10821
  border-radius: var(---border-radius);
10829
- outline: none;
10830
10822
  }
10831
10823
 
10832
10824
  button:disabled {
10833
- background-color: var(---decidables-button-background-color-disabled);
10834
10825
  outline: none;
10826
+
10827
+ background-color: var(---decidables-button-background-color-disabled);
10835
10828
  box-shadow: none;
10836
10829
  }
10837
10830
 
10838
10831
  button:enabled {
10839
10832
  cursor: pointer;
10833
+ outline: none;
10840
10834
 
10841
10835
  background-color: var(---decidables-button-background-color-enabled);
10842
- outline: none;
10843
10836
  box-shadow: var(---shadow-2);
10844
10837
  }
10845
10838
 
10846
10839
  button:enabled:hover {
10847
10840
  outline: none;
10841
+
10848
10842
  box-shadow: var(---shadow-4);
10849
10843
  }
10850
10844
 
10851
10845
  button:enabled:active {
10852
10846
  outline: none;
10847
+
10853
10848
  box-shadow: var(---shadow-8);
10854
10849
  }
10855
10850
 
10856
- :host(.keyboard) button:enabled:focus {
10851
+ button:enabled:focus-visible {
10857
10852
  outline: none;
10853
+
10858
10854
  box-shadow: var(---shadow-4);
10859
10855
  }
10860
10856
 
10861
- :host(.keyboard) button:enabled:focus:active {
10857
+ button:enabled:focus-visible:active {
10862
10858
  outline: none;
10859
+
10863
10860
  box-shadow: var(---shadow-8);
10864
10861
  }
10865
10862
  `];
@@ -10976,10 +10973,6 @@
10976
10973
  ---decidables-slider-color: var(--decidables-slider-color, var(---color-element-enabled));
10977
10974
  ---decidables-spinner-background-color: var(--decidables-slider-background-color, none);
10978
10975
 
10979
- ---shadow-2-rotate: var(--shadow-2-rotate, ${r$4(this.cssBoxShadow(2, true, false))});
10980
- ---shadow-4-rotate: var(--shadow-4-rotate, ${r$4(this.cssBoxShadow(4, true, false))});
10981
- ---shadow-8-rotate: var(--shadow-8-rotate, ${r$4(this.cssBoxShadow(8, true, false))});
10982
-
10983
10976
  display: flex;
10984
10977
 
10985
10978
  flex-direction: column;
@@ -10994,12 +10987,14 @@
10994
10987
 
10995
10988
  .range {
10996
10989
  position: relative;
10990
+
10997
10991
  display: flex;
10998
10992
 
10999
10993
  flex-direction: row;
11000
10994
 
11001
10995
  width: 3.5rem;
11002
10996
  height: 4.75rem;
10997
+
11003
10998
  margin: 0 0.25rem 0.25rem;
11004
10999
  }
11005
11000
 
@@ -11011,21 +11006,20 @@
11011
11006
  background: var(---decidables-spinner-background-color);
11012
11007
  }
11013
11008
 
11014
- /* Adapted from http://danielstern.ca/range.css/#/ */
11015
11009
  /* Overall */
11016
11010
  input[type=range] {
11017
- width: 4.75rem;
11018
- height: 3.5rem;
11011
+ width: 3.5rem;
11012
+ height: 4.75rem;
11013
+
11019
11014
  padding: 0;
11020
11015
  margin: 0;
11016
+
11017
+ appearance: none;
11021
11018
 
11022
11019
  background-color: unset;
11023
11020
 
11024
- transform: rotate(-90deg);
11025
- transform-origin: 2.375rem 2.375rem;
11026
-
11027
- /* stylelint-disable-next-line property-no-vendor-prefix */
11028
- -webkit-appearance: none;
11021
+ direction: rtl;
11022
+ writing-mode: vertical-lr;
11029
11023
  }
11030
11024
 
11031
11025
  input[type=range]:enabled {
@@ -11036,16 +11030,10 @@
11036
11030
  outline: none;
11037
11031
  }
11038
11032
 
11039
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11040
- input[type=range]::-ms-tooltip {
11041
- display: none;
11042
- }
11043
-
11044
11033
  /* Track */
11045
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11046
11034
  input[type=range]::-webkit-slider-runnable-track {
11047
- width: 100%;
11048
- height: 4px;
11035
+ width: 4px;
11036
+ height: 100%;
11049
11037
 
11050
11038
  background: var(---decidables-slider-background-color);
11051
11039
  border: 0;
@@ -11057,10 +11045,9 @@
11057
11045
  background: var(---decidables-slider-background-color);
11058
11046
  }
11059
11047
 
11060
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11061
11048
  input[type=range]::-moz-range-track {
11062
- width: 100%;
11063
- height: 4px;
11049
+ width: 4px;
11050
+ height: 100%;
11064
11051
 
11065
11052
  background: var(---decidables-slider-background-color);
11066
11053
  border: 0;
@@ -11068,57 +11055,17 @@
11068
11055
  box-shadow: none;
11069
11056
  }
11070
11057
 
11071
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11072
- input[type=range]::-ms-track {
11073
- width: 100%;
11074
- height: 4px;
11075
-
11076
- color: transparent;
11077
-
11078
- background: transparent;
11079
- border-color: transparent;
11080
- }
11081
-
11082
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11083
- input[type=range]::-ms-fill-lower {
11084
- background: #cccccc;
11085
- /* background: var(---decidables-slider-background-color); */
11086
- border: 0;
11087
- border-radius: 2px;
11088
- box-shadow: none;
11089
- }
11090
-
11091
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11092
- input[type=range]::-ms-fill-upper {
11093
- background: #cccccc;
11094
- /* background: var(---decidables-slider-background-color); */
11095
- border: 0;
11096
- border-radius: 2px;
11097
- box-shadow: none;
11098
- }
11099
-
11100
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11101
- input[type=range]:focus::-ms-fill-lower {
11102
- background: var(---decidables-slider-background-color);
11103
- }
11104
-
11105
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11106
- input[type=range]:focus::-ms-fill-upper {
11107
- background: var(---decidables-slider-background-color);
11108
- }
11109
-
11110
11058
  /* Thumb */
11111
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11112
11059
  input[type=range]::-webkit-slider-thumb {
11113
- width: 10px;
11114
- height: 20px;
11115
- margin-top: -8px;
11060
+ width: 20px;
11061
+ height: 10px;
11062
+
11063
+ margin-left: -8px;
11064
+
11065
+ appearance: none;
11116
11066
 
11117
11067
  border: 0;
11118
11068
  border-radius: 4px;
11119
-
11120
- /* stylelint-disable-next-line property-no-vendor-prefix */
11121
- -webkit-appearance: none;
11122
11069
  }
11123
11070
 
11124
11071
  input[type=range]:disabled::-webkit-slider-thumb {
@@ -11128,112 +11075,65 @@
11128
11075
 
11129
11076
  input[type=range]:enabled::-webkit-slider-thumb {
11130
11077
  background: var(---decidables-slider-color);
11131
- box-shadow: var(---shadow-2-rotate);
11078
+ box-shadow: var(---shadow-2);
11132
11079
  }
11133
11080
 
11134
11081
  input[type=range]:enabled:hover::-webkit-slider-thumb {
11135
- box-shadow: var(---shadow-4-rotate);
11082
+ box-shadow: var(---shadow-4);
11136
11083
  }
11137
11084
 
11138
11085
  input[type=range]:enabled:active::-webkit-slider-thumb {
11139
- box-shadow: var(---shadow-8-rotate);
11086
+ box-shadow: var(---shadow-8);
11140
11087
  }
11141
11088
 
11142
- :host(.keyboard) input[type=range]:enabled:focus::-webkit-slider-thumb {
11143
- box-shadow: var(---shadow-4-rotate);
11089
+ input[type=range]:enabled:focus-visible::-webkit-slider-thumb {
11090
+ box-shadow: var(---shadow-4);
11144
11091
  }
11145
11092
 
11146
- :host(.keyboard) input[type=range]:focus:active::-webkit-slider-thumb {
11147
- box-shadow: var(---shadow-8-rotate);
11093
+ input[type=range]:enabled:focus-visible:active::-webkit-slider-thumb {
11094
+ box-shadow: var(---shadow-8);
11148
11095
  }
11149
11096
 
11150
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11151
11097
  input[type=range]::-moz-range-thumb {
11152
- width: 10px;
11153
- height: 20px;
11098
+ width: 20px;
11099
+ height: 10px;
11154
11100
 
11155
11101
  border: 0;
11156
11102
  border-radius: 4px;
11157
11103
  }
11158
11104
 
11159
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11160
11105
  input[type=range]:disabled::-moz-range-thumb {
11161
11106
  background: var(---decidables-slider-background-color);
11162
11107
  box-shadow: none;
11163
11108
  }
11164
11109
 
11165
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11166
11110
  input[type=range]:enabled::-moz-range-thumb {
11167
11111
  background: var(---decidables-slider-color);
11168
- box-shadow: var(---shadow-2-rotate);
11112
+ box-shadow: var(---shadow-2);
11169
11113
  }
11170
11114
 
11171
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11172
11115
  input[type=range]:enabled:hover::-moz-range-thumb {
11173
- box-shadow: var(---shadow-4-rotate);
11116
+ box-shadow: var(---shadow-4);
11174
11117
  }
11175
11118
 
11176
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11177
11119
  input[type=range]:enabled:active::-moz-range-thumb {
11178
- box-shadow: var(---shadow-8-rotate);
11179
- }
11180
-
11181
- :host(.keyboard) input[type=range]:enabled:focus::-moz-range-thumb {
11182
- box-shadow: var(---shadow-4-rotate);
11183
- }
11184
-
11185
- :host(.keyboard) input[type=range]:enabled:focus:active::-moz-range-thumb {
11186
- box-shadow: var(---shadow-8-rotate);
11187
- }
11188
-
11189
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11190
- input[type=range]::-ms-thumb {
11191
- width: 10px;
11192
- height: 20px;
11193
- margin-top: 0;
11194
-
11195
- background: #999999;
11196
- /* background: var(---color-element-enabled); */
11197
- border: 0;
11198
- border-radius: 4px;
11199
- box-shadow: var(---shadow-2-rotate);
11200
- }
11201
-
11202
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11203
- input[type=range]:disabled::-ms-thumb {
11204
- background: var(---decidables-slider-background-color);
11205
- box-shadow: none;
11206
- }
11207
-
11208
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11209
- input[type=range]:enabled::-ms-thumb {
11210
- background: var(---decidables-slider-color);
11211
- box-shadow: var(---shadow-2-rotate);
11212
- }
11213
-
11214
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11215
- input[type=range]:enabled:hover::-ms-thumb {
11216
- box-shadow: var(---shadow-4-rotate);
11217
- }
11218
-
11219
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11220
- input[type=range]:enabled:active::-ms-thumb {
11221
- box-shadow: var(---shadow-8-rotate);
11120
+ box-shadow: var(---shadow-8);
11222
11121
  }
11223
11122
 
11224
- /* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
11225
- :host(.keyboard) input[type=range]:enabled:focus::-ms-thumb {
11226
- box-shadow: var(---shadow-4-rotate);
11123
+ input[type=range]:enabled:focus-visible::-moz-range-thumb {
11124
+ box-shadow: var(---shadow-4);
11227
11125
  }
11228
11126
 
11229
- :host(.keyboard) input[type=range]:enabled:focus:active::-ms-thumb {
11230
- box-shadow: var(---shadow-8-rotate);
11127
+ input[type=range]:enabled:focus-visible:active::-moz-range-thumb {
11128
+ box-shadow: var(---shadow-8);
11231
11129
  }
11232
11130
 
11233
- datalist {
11131
+ /* Tick marks */
11132
+ .datalist {
11234
11133
  position: absolute;
11235
11134
  left: 2rem;
11236
11135
  z-index: -1;
11136
+
11237
11137
  display: flex;
11238
11138
 
11239
11139
  flex-direction: column;
@@ -11246,14 +11146,13 @@
11246
11146
  font-size: 0.75rem;
11247
11147
  }
11248
11148
 
11249
- option {
11250
- padding: 0;
11251
-
11149
+ .option {
11252
11150
  line-height: 0.8;
11253
- min-block-size: 0;
11151
+
11152
+ white-space: nowrap;
11254
11153
  }
11255
11154
 
11256
- option::before {
11155
+ .option::before {
11257
11156
  content: "– ";
11258
11157
  }
11259
11158
  `];
@@ -11266,10 +11165,10 @@
11266
11165
  <div class="range">
11267
11166
  <input ?disabled=${this.disabled} type="range" id="slider" min=${o$2(this.rangeMin)} max=${o$2(this.rangeMax)} step=${o$2(this.rangeStep)} .value=${this.rangeValue} @change=${this.rangeChanged.bind(this)} @input=${this.rangeInputted.bind(this)}>
11268
11167
  ${this.scale ? x$2`
11269
- <datalist id="ticks">
11270
- <option value=${o$2(this.rangeMax)} label=${o$2(this.max)}></option>
11271
- <option value=${o$2(this.rangeMin)} label=${o$2(this.min)}></option>
11272
- </datalist>
11168
+ <div class="datalist">
11169
+ <div class="option">${o$2(this.max)}</div>
11170
+ <div class="option">${o$2(this.min)}</div>
11171
+ </div>
11273
11172
  ` : x$2``}
11274
11173
  </div>
11275
11174
  <decidables-spinner ?disabled=${this.disabled} min=${o$2(this.min)} max=${o$2(this.max)} step=${o$2(this.step)} .value=${this.value} @input=${this.spinnerInputted.bind(this)}></decidables-spinner>
@@ -11329,13 +11228,14 @@
11329
11228
  ---decidables-spinner-prefix: var(--decidables-spinner-prefix, "");
11330
11229
 
11331
11230
  ---decidables-spinner-postfix: var(--decidables-spinner-postfix, "");
11332
- ---decidables-spinner-postfix-padding: var(--decidables-spinner-postfix-padding, 0);
11231
+ ---decidables-spinner-postfix-padding: var(--decidables-spinner-postfix-padding, 0rem);
11333
11232
 
11334
11233
  display: block;
11335
11234
  }
11336
11235
 
11337
11236
  label {
11338
11237
  position: relative;
11238
+
11339
11239
  display: flex;
11340
11240
 
11341
11241
  flex-direction: column;
@@ -11353,6 +11253,7 @@
11353
11253
  left: calc(50% - var(---decidables-spinner-input-width) / 2 + 0.25rem);
11354
11254
 
11355
11255
  font-size: var(---decidables-spinner-font-size);
11256
+
11356
11257
  line-height: normal;
11357
11258
 
11358
11259
  content: var(---decidables-spinner-prefix);
@@ -11364,6 +11265,7 @@
11364
11265
  bottom: 1px;
11365
11266
 
11366
11267
  font-size: var(---decidables-spinner-font-size);
11268
+
11367
11269
  line-height: normal;
11368
11270
 
11369
11271
  content: var(---decidables-spinner-postfix);
@@ -11371,20 +11273,24 @@
11371
11273
 
11372
11274
  input[type=number] {
11373
11275
  width: var(---decidables-spinner-input-width);
11374
- padding-right: var(---decidables-spinner-postfix-padding);
11276
+
11277
+ padding: 1px var(---decidables-spinner-postfix-padding) 1px 2px;
11278
+ margin: 0;
11375
11279
 
11376
11280
  font-family: var(---font-family-base);
11377
11281
  font-size: var(---decidables-spinner-font-size);
11282
+
11378
11283
  color: inherit;
11284
+
11379
11285
  text-align: right;
11380
11286
 
11287
+ appearance: none;
11288
+ outline: none;
11289
+
11381
11290
  background: none;
11382
11291
  border: 0;
11383
11292
  border-radius: 0;
11384
- outline: none;
11385
11293
  box-shadow: var(---shadow-2);
11386
-
11387
- -webkit-appearance: none; /* stylelint-disable-line property-no-vendor-prefix */
11388
11294
  }
11389
11295
 
11390
11296
  input[type=number]:hover {
@@ -11401,20 +11307,54 @@
11401
11307
 
11402
11308
  border: 0;
11403
11309
  box-shadow: none;
11310
+ }
11311
+
11312
+ /* HACK: Manage spinners in Firefox */
11313
+ @supports (-moz-appearance: textfield) {
11314
+ input[type=number] {
11315
+ padding-right: calc(18px + var(---decidables-spinner-postfix-padding));
11316
+
11317
+ appearance: textfield;
11318
+ }
11319
+
11320
+ input[type=number]:hover,
11321
+ input[type=number]:focus,
11322
+ input[type=number]:active {
11323
+ padding-right: var(---decidables-spinner-postfix-padding);
11324
+
11325
+ appearance: none;
11326
+ }
11327
+
11328
+ input[type=number]:disabled {
11329
+ padding-right: calc(18px + var(---decidables-spinner-postfix-padding));
11404
11330
 
11405
- /* HACK: Use correct text color in Safari */
11406
- -webkit-opacity: 1;
11407
- /* HACK: Hide spinners in disabled input for Firefox and Safari */
11408
- -moz-appearance: textfield; /* stylelint-disable-line property-no-vendor-prefix */
11409
- /* HACK: Use correct text color in Safari */
11410
- -webkit-text-fill-color: var(---color-text);
11331
+ appearance: textfield;
11332
+ }
11333
+ }
11334
+
11335
+ /* HACK: Manage spinners in Chrome/Edge/Safari */
11336
+ input[type=number]::-webkit-inner-spin-button {
11337
+ /* Avoid oversized spinners in Safari */
11338
+ font-size: 1.125rem;
11339
+
11340
+ opacity: 0;
11341
+ }
11342
+
11343
+ input[type=number]:hover::-webkit-inner-spin-button,
11344
+ input[type=number]:focus::-webkit-inner-spin-button,
11345
+ input[type=number]:active::-webkit-inner-spin-button {
11346
+ opacity: 1;
11411
11347
  }
11412
11348
 
11413
- /* HACK: Hide spinners in disabled input for Firefox and Safari */
11414
- input[type=number]:disabled::-webkit-outer-spin-button,
11415
11349
  input[type=number]:disabled::-webkit-inner-spin-button {
11416
- margin: 0;
11417
- -webkit-appearance: none; /* stylelint-disable-line property-no-vendor-prefix */
11350
+ opacity: 0;
11351
+ }
11352
+
11353
+ /* HACK: Adjust padding on mobile w/o spinners */
11354
+ @media only screen and (hover: none) and (pointer: coarse) {
11355
+ input[type=number] {
11356
+ padding-right: calc(1.125rem + var(---decidables-spinner-postfix-padding));
11357
+ }
11418
11358
  }
11419
11359
  `];
11420
11360
  }
@@ -11478,13 +11418,16 @@
11478
11418
 
11479
11419
  width: 1px;
11480
11420
  height: 1px;
11421
+
11481
11422
  padding: 0;
11482
11423
  margin: -1px;
11424
+
11483
11425
  overflow: hidden;
11484
11426
 
11485
11427
  white-space: nowrap;
11486
11428
 
11487
11429
  border: 0;
11430
+
11488
11431
  clip-path: inset(100%); /* May cause a performance issue: https://github.com/h5bp/html5-boilerplate/issues/2021 */
11489
11432
  }
11490
11433
 
@@ -11500,6 +11443,7 @@
11500
11443
  position: relative;
11501
11444
 
11502
11445
  min-width: 24px;
11446
+
11503
11447
  padding: 0 0 36px;
11504
11448
  margin: 0.25rem 0.25rem 0;
11505
11449
 
@@ -11511,17 +11455,17 @@
11511
11455
  input[type=checkbox] + label + label::before,
11512
11456
  input[type=checkbox] + label + label::after {
11513
11457
  position: absolute;
11514
-
11515
11458
  left: 50%;
11516
11459
 
11517
11460
  margin: 0;
11518
11461
 
11519
- content: "";
11520
-
11521
11462
  outline: 0;
11522
11463
 
11523
- transition: all var(---transition-duration) ease;
11464
+ content: "";
11465
+
11524
11466
  transform: translate(-50%, 0);
11467
+
11468
+ transition: all var(---transition-duration) ease;
11525
11469
  }
11526
11470
 
11527
11471
  input[type=checkbox] + label + label::before {
@@ -11569,17 +11513,14 @@
11569
11513
  box-shadow: var(---shadow-8);
11570
11514
  }
11571
11515
 
11572
- /* stylelint-disable-next-line selector-max-compound-selectors */
11573
- :host(.keyboard) input[type=checkbox]:enabled:focus + label + label::after {
11516
+ input[type=checkbox]:enabled:focus-visible + label + label::after {
11574
11517
  box-shadow: var(---shadow-4);
11575
11518
  }
11576
11519
 
11577
- /* stylelint-disable selector-max-compound-selectors */
11578
- :host(.keyboard) input[type=checkbox]:enabled:focus + label + label:active::after,
11579
- :host(.keyboard) input[type=checkbox]:enabled:focus:active + label + label::after {
11520
+ input[type=checkbox]:enabled:focus-visible + label + label:active::after,
11521
+ input[type=checkbox]:enabled:focus-visible:active + label + label::after {
11580
11522
  box-shadow: var(---shadow-8);
11581
11523
  }
11582
- /* stylelint-enable selector-max-compound-selectors */
11583
11524
  `];
11584
11525
  }
11585
11526
  render() {
@@ -11699,39 +11640,46 @@
11699
11640
 
11700
11641
  width: 1px;
11701
11642
  height: 1px;
11643
+
11702
11644
  padding: 0;
11703
11645
  margin: -1px;
11646
+
11704
11647
  overflow: hidden;
11705
11648
 
11706
11649
  white-space: nowrap;
11707
11650
 
11708
11651
  border: 0;
11652
+
11709
11653
  clip-path: inset(100%); /* May cause a performance issue: https://github.com/h5bp/html5-boilerplate/issues/2021 */
11710
11654
  }
11711
11655
 
11712
11656
  input[type=radio] + label {
11713
11657
  width: 100%;
11658
+
11714
11659
  padding: 0.375rem 0.75rem;
11715
11660
 
11716
11661
  font-family: var(---font-family-base);
11717
11662
  font-size: 1.125rem;
11663
+
11718
11664
  line-height: 1.5;
11665
+
11719
11666
  color: var(---color-text-inverse);
11667
+
11720
11668
  text-align: center;
11721
11669
 
11722
11670
  cursor: pointer;
11671
+ outline: none;
11723
11672
 
11724
11673
  background-color: var(---color-element-enabled);
11725
11674
  border: 0;
11726
11675
  border-radius: 0;
11727
- outline: none;
11728
-
11729
11676
  box-shadow: var(---shadow-2);
11730
11677
  }
11731
11678
 
11732
11679
  input[type=radio]:checked + label {
11733
- background-color: var(---color-element-selected);
11734
11680
  outline: none;
11681
+
11682
+ background-color: var(---color-element-selected);
11735
11683
  box-shadow: var(---shadow-2);
11736
11684
  }
11737
11685
 
@@ -11739,6 +11687,7 @@
11739
11687
  z-index: 1;
11740
11688
 
11741
11689
  outline: none;
11690
+
11742
11691
  box-shadow: var(---shadow-4);
11743
11692
  }
11744
11693
 
@@ -11746,6 +11695,7 @@
11746
11695
  z-index: 2;
11747
11696
 
11748
11697
  outline: none;
11698
+
11749
11699
  box-shadow: var(---shadow-8);
11750
11700
  }
11751
11701
 
@@ -11759,25 +11709,28 @@
11759
11709
  border-bottom-left-radius: 0.25rem;
11760
11710
  }
11761
11711
 
11762
- :host(.keyboard) input[type=radio]:focus + label {
11712
+ input[type=radio]:focus-visible + label {
11763
11713
  z-index: 1;
11764
11714
 
11765
11715
  outline: none;
11716
+
11766
11717
  box-shadow: var(---shadow-4);
11767
11718
  }
11768
11719
 
11769
- :host(.keyboard) input[type=radio]:focus:checked + label {
11720
+ input[type=radio]:focus-visible:checked + label {
11770
11721
  z-index: 1;
11771
11722
 
11772
- background-color: var(---color-element-selected);
11773
11723
  outline: none;
11724
+
11725
+ background-color: var(---color-element-selected);
11774
11726
  box-shadow: var(---shadow-4);
11775
11727
  }
11776
11728
 
11777
- :host(.keyboard) input[type=radio]:focus + label:active {
11729
+ input[type=radio]:focus-visible + label:active {
11778
11730
  z-index: 2;
11779
11731
 
11780
11732
  outline: none;
11733
+
11781
11734
  box-shadow: var(---shadow-8);
11782
11735
  }
11783
11736
  `];
@@ -12485,11 +12438,13 @@
12485
12438
 
12486
12439
  .addend {
12487
12440
  position: relative;
12441
+
12488
12442
  display: inline-block;
12489
12443
  }
12490
12444
 
12491
12445
  .comparison {
12492
12446
  position: relative;
12447
+
12493
12448
  display: inline-block;
12494
12449
 
12495
12450
  font-size: 125%;
@@ -22305,6 +22260,7 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
22305
22260
 
22306
22261
  decidables-slider {
22307
22262
  line-height: 1;
22263
+
22308
22264
  text-align: center;
22309
22265
  }
22310
22266
 
@@ -22598,9 +22554,9 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
22598
22554
 
22599
22555
  .curve.interactive {
22600
22556
  cursor: nwse-resize;
22557
+ outline: none;
22601
22558
 
22602
22559
  filter: url("#shadow-2");
22603
- outline: none;
22604
22560
  }
22605
22561
 
22606
22562
  .curve.interactive:hover {
@@ -22618,7 +22574,7 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
22618
22574
  transform: translateY(0);
22619
22575
  }
22620
22576
 
22621
- :host(.keyboard) .curve.interactive:focus {
22577
+ .curve.interactive:focus-visible {
22622
22578
  filter: url("#shadow-8");
22623
22579
 
22624
22580
  /* HACK: This gets Safari to correctly apply the filter! */
@@ -22627,9 +22583,9 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
22627
22583
 
22628
22584
  .point.interactive {
22629
22585
  cursor: nesw-resize;
22586
+ outline: none;
22630
22587
 
22631
22588
  filter: url("#shadow-2");
22632
- outline: none;
22633
22589
 
22634
22590
  /* HACK: This gets Safari to correctly apply the filter! */
22635
22591
  stroke: #000000;
@@ -22651,7 +22607,7 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
22651
22607
  stroke: #00ff00;
22652
22608
  }
22653
22609
 
22654
- :host(.keyboard) .point.interactive:focus {
22610
+ .point.interactive:focus-visible {
22655
22611
  filter: url("#shadow-8");
22656
22612
 
22657
22613
  /* HACK: This gets Safari to correctly apply the filter! */
@@ -22685,8 +22641,8 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
22685
22641
 
22686
22642
  .diagonal {
22687
22643
  stroke: var(---color-element-border);
22688
- stroke-dasharray: 4;
22689
22644
  stroke-width: 1;
22645
+ stroke-dasharray: 4;
22690
22646
  }
22691
22647
 
22692
22648
  .curve {
@@ -22719,8 +22675,8 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
22719
22675
  font-size: 0.75rem;
22720
22676
 
22721
22677
  dominant-baseline: middle;
22722
- text-anchor: middle;
22723
22678
 
22679
+ text-anchor: middle;
22724
22680
  fill: var(---color-text-inverse);
22725
22681
  }
22726
22682
 
@@ -22732,8 +22688,8 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
22732
22688
 
22733
22689
  @media (pointer: coarse) {
22734
22690
  .interactive .touch {
22735
- stroke-linecap: round;
22736
22691
  stroke-width: 12;
22692
+ stroke-linecap: round;
22737
22693
  }
22738
22694
  }
22739
22695
  `];
@@ -25741,6 +25697,7 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
25741
25697
  font-weight: 600;
25742
25698
 
25743
25699
  alignment-baseline: middle;
25700
+
25744
25701
  text-anchor: middle;
25745
25702
  }
25746
25703
 
@@ -25764,6 +25721,7 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
25764
25721
  font-size: 0.75rem;
25765
25722
 
25766
25723
  alignment-baseline: middle;
25724
+
25767
25725
  text-anchor: end;
25768
25726
  }
25769
25727
 
@@ -25804,6 +25762,7 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
25804
25762
  font-weight: 600;
25805
25763
 
25806
25764
  alignment-baseline: middle;
25765
+
25807
25766
  text-anchor: middle;
25808
25767
  }
25809
25768
 
@@ -26677,9 +26636,9 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
26677
26636
  .curve-p.interactive,
26678
26637
  .curve-n.interactive {
26679
26638
  cursor: nwse-resize;
26639
+ outline: none;
26680
26640
 
26681
26641
  filter: url("#shadow-2");
26682
- outline: none;
26683
26642
  }
26684
26643
 
26685
26644
  .curve-p.interactive:hover,
@@ -26699,8 +26658,8 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
26699
26658
  transform: translateY(0);
26700
26659
  }
26701
26660
 
26702
- :host(.keyboard) .curve-p.interactive:focus,
26703
- :host(.keyboard) .curve-n.interactive:focus {
26661
+ .curve-p.interactive:focus-visible,
26662
+ .curve-n.interactive:focus-visible {
26704
26663
  filter: url("#shadow-8");
26705
26664
 
26706
26665
  /* HACK: This gets Safari to correctly apply the filter! */
@@ -26709,9 +26668,9 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
26709
26668
 
26710
26669
  .point.interactive {
26711
26670
  cursor: nesw-resize;
26671
+ outline: none;
26712
26672
 
26713
26673
  filter: url("#shadow-2");
26714
- outline: none;
26715
26674
 
26716
26675
  /* HACK: This gets Safari to correctly apply the filter! */
26717
26676
  stroke: #000000;
@@ -26733,7 +26692,7 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
26733
26692
  stroke: #00ff00;
26734
26693
  }
26735
26694
 
26736
- :host(.keyboard) .point.interactive:focus {
26695
+ .point.interactive:focus-visible {
26737
26696
  filter: url("#shadow-8");
26738
26697
 
26739
26698
  /* HACK: This gets Safari to correctly apply the filter! */
@@ -26773,8 +26732,8 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
26773
26732
 
26774
26733
  .diagonal {
26775
26734
  stroke: var(---color-element-border);
26776
- stroke-dasharray: 4;
26777
26735
  stroke-width: 1;
26736
+ stroke-dasharray: 4;
26778
26737
  }
26779
26738
 
26780
26739
  .curve-p,
@@ -26808,8 +26767,8 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
26808
26767
  font-size: 0.75rem;
26809
26768
 
26810
26769
  dominant-baseline: middle;
26811
- text-anchor: middle;
26812
26770
 
26771
+ text-anchor: middle;
26813
26772
  fill: var(---color-text-inverse);
26814
26773
  }
26815
26774
 
@@ -26821,8 +26780,8 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
26821
26780
 
26822
26781
  @media (pointer: coarse) {
26823
26782
  .interactive .touch {
26824
- stroke-linecap: round;
26825
26783
  stroke-width: 12;
26784
+ stroke-linecap: round;
26826
26785
  }
26827
26786
  }
26828
26787
  `];
@@ -27838,6 +27797,7 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
27838
27797
  font-weight: 600;
27839
27798
 
27840
27799
  alignment-baseline: middle;
27800
+
27841
27801
  text-anchor: middle;
27842
27802
  }
27843
27803
 
@@ -27861,6 +27821,7 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
27861
27821
  font-size: 0.75rem;
27862
27822
 
27863
27823
  alignment-baseline: middle;
27824
+
27864
27825
  text-anchor: end;
27865
27826
  }
27866
27827
 
@@ -27901,6 +27862,7 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
27901
27862
  font-weight: 600;
27902
27863
 
27903
27864
  alignment-baseline: middle;
27865
+
27904
27866
  text-anchor: middle;
27905
27867
  }
27906
27868
 
@@ -28900,6 +28862,7 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
28900
28862
 
28901
28863
  width: 5.25rem;
28902
28864
  height: 3.5rem;
28865
+
28903
28866
  padding: 0.375rem 0.75rem;
28904
28867
  margin: 0.25rem;
28905
28868
 
@@ -28927,6 +28890,7 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
28927
28890
 
28928
28891
  .feedback .outcome {
28929
28892
  font-weight: 600;
28893
+
28930
28894
  line-height: 1.15;
28931
28895
  }
28932
28896
 
@@ -28991,6 +28955,8 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
28991
28955
  --decidables-spinner-input-width: 4rem;
28992
28956
  --decidables-spinner-prefix: "$";
28993
28957
 
28958
+ position: relative;
28959
+
28994
28960
  display: inline-block;
28995
28961
 
28996
28962
  width: 10rem;
@@ -29000,6 +28966,7 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
29000
28966
  .main {
29001
28967
  width: 100%;
29002
28968
  height: 100%;
28969
+
29003
28970
  overflow: visible;
29004
28971
  }
29005
28972
 
@@ -29016,9 +28983,9 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
29016
28983
 
29017
28984
  .arc.interactive {
29018
28985
  cursor: ns-resize;
28986
+ outline: none;
29019
28987
 
29020
28988
  filter: url("#shadow-2");
29021
- outline: none;
29022
28989
  }
29023
28990
 
29024
28991
  .arc.interactive:hover {
@@ -29029,7 +28996,7 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
29029
28996
  filter: url("#shadow-8");
29030
28997
  }
29031
28998
 
29032
- :host(.keyboard) .arc.interactive:focus {
28999
+ .arc.interactive:focus-visible {
29033
29000
  filter: url("#shadow-8");
29034
29001
  }
29035
29002
 
@@ -29048,23 +29015,20 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
29048
29015
  .label.static {
29049
29016
  font-size: 1.75rem;
29050
29017
 
29018
+ dominant-baseline: middle;
29019
+
29051
29020
  user-select: none;
29052
29021
 
29053
- dominant-baseline: middle;
29054
29022
  text-anchor: middle;
29055
29023
  }
29056
29024
 
29057
29025
  .label.interactive {
29026
+ position: absolute;
29027
+
29058
29028
  width: var(--decidables-spinner-input-width);
29059
29029
  height: calc(var(--decidables-spinner-font-size) * 1.5);
29060
- overflow: visible;
29061
- }
29062
29030
 
29063
- /* HACK: Get Safari to work with SVG foreignObject */
29064
- /* https://stackoverflow.com/questions/51313873/svg-foreignobject-not-working-properly-on-safari */
29065
- /* https://bugs.webkit.org/show_bug.cgi?id=23113 */
29066
- .label.interactive decidables-spinner {
29067
- position: fixed;
29031
+ overflow: visible;
29068
29032
  }
29069
29033
 
29070
29034
  .label.interactive.win decidables-spinner {
@@ -29263,11 +29227,11 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
29263
29227
  // Labels
29264
29228
  // DATA-JOIN
29265
29229
  const labelStaticUpdate = pieMerge.selectAll('.label.static').data(arcsStatic);
29266
- const labelInteractiveUpdate = pieMerge.selectAll('.label.interactive').data(arcsInteractive);
29230
+ const labelInteractiveUpdate = select(this.renderRoot).selectAll('.label.interactive').data(arcsInteractive);
29267
29231
  // ENTER
29268
29232
  const labelStaticEnter = labelStaticUpdate.enter().append('text');
29269
- const labelInteractiveEnter = labelInteractiveUpdate.enter().append('foreignObject');
29270
- labelInteractiveEnter.append('xhtml:decidables-spinner').on('input', (event, datum) => {
29233
+ const labelInteractiveEnter = labelInteractiveUpdate.enter().append('xhtml:div');
29234
+ labelInteractiveEnter.append('decidables-spinner').on('input', (event, datum) => {
29271
29235
  datum.data.x = parseFloat(event.target.value);
29272
29236
  this.dispatchEvent(new CustomEvent('risky-outcome-change', {
29273
29237
  detail: {
@@ -29293,21 +29257,18 @@ ${extraStyle}`)).style("margin-left", marginLeft ? `${+marginLeft}px` : null).st
29293
29257
  });
29294
29258
  const labelInteractiveMerge = labelInteractiveEnter.merge(labelInteractiveUpdate).attr('class', datum => {
29295
29259
  return `label interactive ${datum.data.name}`;
29296
- }).attr('transform', datum => {
29297
- // HACK: Center spinner here instead of CSS for Safari SVG foreignObject
29298
- // x: calc(var(--decidables-spinner-input-width) / -2);
29299
- // y: calc(var(--decidables-spinner-font-size) * 1.5 / -2);
29260
+ }).attr('style', datum => {
29300
29261
  const inputWidth = parseFloat(this.getComputedStyleValue('--decidables-spinner-input-width'));
29301
29262
  const fontSize = parseFloat(this.getComputedStyleValue('--decidables-spinner-font-size'));
29302
29263
  const rem = parseFloat(getComputedStyle(document.documentElement).getPropertyValue('font-size'), 10);
29303
- const x = inputWidth * rem / -2;
29304
- const y = fontSize * rem * 1.5 / -2;
29264
+ const x = width / 2 + inputWidth * rem / -2;
29265
+ const y = height / 2 + fontSize * rem * 1.5 / -2;
29305
29266
  if (arcs.length === 1) {
29306
- return `translate(${x}, ${y})`;
29267
+ return `left: ${x}px; top: ${y}px;`;
29307
29268
  }
29308
29269
  const radius = Math.min(width, height) / 2 * 0.6;
29309
29270
  const arcLabel = arc().innerRadius(radius).outerRadius(radius);
29310
- return `translate(${arcLabel.centroid(datum)[0] + x}, ${arcLabel.centroid(datum)[1] + y})`;
29271
+ return `left: ${arcLabel.centroid(datum)[0] + x}px; top: ${arcLabel.centroid(datum)[1] + y}px;`;
29311
29272
  });
29312
29273
  labelInteractiveMerge.select('decidables-spinner').attr('value', datum => {
29313
29274
  return `${datum.data.x.toFixed(0)}`;