_ShadowCast.scss 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. @mixin shadowCast() {
  2. $width: 200;
  3. $slider-thumb-size: 8px;
  4. $tooltip-arrow-size: 8px;
  5. .esri-shadow-cast {
  6. position: relative;
  7. overflow: hidden;
  8. display: flex;
  9. flex-direction: column;
  10. width: $width;
  11. padding: $cap-spacing $side-spacing;
  12. gap: $cap-spacing;
  13. &__time-range {
  14. display: flex;
  15. flex-direction: column;
  16. font-size: $font-size--tiny-daylight;
  17. .esri-slider {
  18. // Fit slider content since default API slider doesn't do it for us.
  19. padding-top: $slider-thumb-size;
  20. padding-bottom: 48px;
  21. padding-inline: $side-spacing;
  22. .esri-slider__label,
  23. .esri-slider__tick-label {
  24. font-size: $font-size--tiny-daylight;
  25. }
  26. .esri-slider__tick {
  27. width: 2px;
  28. }
  29. .esri-slider__segment--interactive {
  30. background: $button-color;
  31. }
  32. }
  33. .esri-slider .esri-slider__tick-label &__ampm {
  34. font-size: $font-size--tinier-daylight;
  35. }
  36. .esri-slider--horizontal &__primary-tick.esri-slider__tick {
  37. height: 8px;
  38. }
  39. .esri-slider--horizontal &__primary-tick-label {
  40. line-height: 1;
  41. margin-top: 14px;
  42. text-align: center;
  43. }
  44. &__indicator {
  45. display: flex;
  46. justify-content: center;
  47. align-items: center;
  48. gap: $side-spacing--half;
  49. margin-bottom: $cap-spacing--half;
  50. }
  51. }
  52. &__tz-picker {
  53. position: relative;
  54. display: flex;
  55. align-items: center;
  56. &__select {
  57. display: flex;
  58. align-items: center;
  59. flex-shrink: 0;
  60. z-index: 0;
  61. font-size: $font-size--tiny;
  62. font-weight: $font-weight--medium;
  63. gap: $side-spacing--eighth;
  64. padding: $cap-spacing--eighth $side-spacing--eighth;
  65. padding-inline-start: $cap-spacing--half; // More padding at the start because at the end we already have the chevron icon
  66. border: solid 1px var(--calcite-ui-border-1);
  67. calcite-icon {
  68. vertical-align: text-top;
  69. }
  70. }
  71. &__hidden-select:focus ~ &__select {
  72. outline: 2px solid var(--calcite-ui-brand);
  73. outline-offset: -2px;
  74. }
  75. // Hidden and focusable select above the one where we display the short
  76. // timezone name.
  77. // TBD: should be replaced once we can use the a calcite-dropdown
  78. &__hidden-select {
  79. position: absolute;
  80. opacity: 0;
  81. width: 100%;
  82. height: 100%;
  83. z-index: 1;
  84. cursor: pointer;
  85. }
  86. }
  87. &__date-picker-container:not(:first-of-type) {
  88. margin-top: $cap-spacing--half;
  89. }
  90. &__date-picker-container .esri-date-picker {
  91. display: block;
  92. flex-grow: 1;
  93. }
  94. &__visualization {
  95. display: flex;
  96. flex-direction: column;
  97. margin-top: $cap-spacing;
  98. &__select {
  99. margin-bottom: $cap-spacing;
  100. }
  101. &__config--hidden {
  102. display: none;
  103. }
  104. }
  105. &__threshold-config,
  106. &__duration-config,
  107. &__discrete-config {
  108. display: flex;
  109. flex-direction: column;
  110. gap: $cap-spacing;
  111. calcite-label {
  112. // Don't make the labels full width so that one can't click in white space to focus elements.
  113. width: max-content;
  114. max-width: 100%;
  115. display: block;
  116. // Labels shouldn't really be focusable, but we had to make the color
  117. // picker label focusable with tabindex=-1 (not tabbable). Without it,
  118. // Safari does not include the label in FocusEvent.relatedTarget which
  119. // we use to determine whether the color picker popover should be closed
  120. // right away or not.
  121. &:focus,
  122. &:focus-visible {
  123. outline: none;
  124. }
  125. }
  126. }
  127. &__threshold-config {
  128. .esri-slider {
  129. // Fit slider content since default API slider doesn't do it for us.
  130. padding-top: $slider-thumb-size;
  131. padding-inline: $slider-thumb-size;
  132. padding-bottom: 25px;
  133. .esri-slider__label,
  134. .esri-slider__tick-label {
  135. font-size: $font-size--tiny;
  136. }
  137. // Move labels and ticks up to make slider more compact.
  138. .esri-slider__tick-label {
  139. margin-top: 12px;
  140. }
  141. .esri-slider__tick {
  142. top: -4px;
  143. }
  144. // Mark slider area above the threshold
  145. .esri-slider__segment-1 {
  146. background: $button-color;
  147. }
  148. }
  149. }
  150. &__duration-config {
  151. &__radio-group {
  152. display: flex;
  153. flex-direction: row;
  154. align-items: center;
  155. calcite-button {
  156. height: 35px; // Match height of `<calcite-select>`
  157. }
  158. }
  159. }
  160. &__tooltip {
  161. font-size: $font-size--small;
  162. color: $font-color;
  163. &__content {
  164. position: absolute;
  165. width: max-content;
  166. padding: $cap-spacing--half $side-spacing--half;
  167. background: $background-color;
  168. // center horizontally and place it above the mouse pointer
  169. transform: translate(-50%, -100%);
  170. margin-top: -$tooltip-arrow-size - $cap-spacing--third;
  171. // Tooltip arrow
  172. &:after {
  173. position: absolute;
  174. content: "";
  175. display: block;
  176. width: 0;
  177. height: 0;
  178. border-top: $tooltip-arrow-size solid $background-color;
  179. border-bottom: $tooltip-arrow-size solid transparent;
  180. border-right: $tooltip-arrow-size solid transparent;
  181. border-left: $tooltip-arrow-size solid transparent;
  182. // Place arrow below the tooltip
  183. bottom: 1px; // make the arrow overlap so the "seam" isn't noticeable
  184. left: 50%;
  185. transform: translate(-50%, 100%);
  186. }
  187. }
  188. }
  189. }
  190. }
  191. @if $include_ShadowCast==true {
  192. @include shadowCast();
  193. }