stepper-item.css 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. /* mixins & extensions */
  2. @keyframes in {
  3. 0% {
  4. opacity: 0;
  5. }
  6. 100% {
  7. opacity: 1;
  8. }
  9. }
  10. @keyframes in-down {
  11. 0% {
  12. opacity: 0;
  13. transform: translate3D(0, -5px, 0);
  14. }
  15. 100% {
  16. opacity: 1;
  17. transform: translate3D(0, 0, 0);
  18. }
  19. }
  20. @keyframes in-up {
  21. 0% {
  22. opacity: 0;
  23. transform: translate3D(0, 5px, 0);
  24. }
  25. 100% {
  26. opacity: 1;
  27. transform: translate3D(0, 0, 0);
  28. }
  29. }
  30. @keyframes in-scale {
  31. 0% {
  32. opacity: 0;
  33. transform: scale3D(0.95, 0.95, 1);
  34. }
  35. 100% {
  36. opacity: 1;
  37. transform: scale3D(1, 1, 1);
  38. }
  39. }
  40. :root {
  41. --calcite-animation-timing: calc(150ms * var(--calcite-internal-duration-factor));
  42. --calcite-internal-duration-factor: var(--calcite-duration-factor, 1);
  43. --calcite-internal-animation-timing-fast: calc(100ms * var(--calcite-internal-duration-factor));
  44. --calcite-internal-animation-timing-medium: calc(200ms * var(--calcite-internal-duration-factor));
  45. --calcite-internal-animation-timing-slow: calc(300ms * var(--calcite-internal-duration-factor));
  46. }
  47. .calcite-animate {
  48. opacity: 0;
  49. animation-fill-mode: both;
  50. animation-duration: var(--calcite-animation-timing);
  51. }
  52. .calcite-animate__in {
  53. animation-name: in;
  54. }
  55. .calcite-animate__in-down {
  56. animation-name: in-down;
  57. }
  58. .calcite-animate__in-up {
  59. animation-name: in-up;
  60. }
  61. .calcite-animate__in-scale {
  62. animation-name: in-scale;
  63. }
  64. @media (prefers-reduced-motion: reduce) {
  65. :root {
  66. --calcite-internal-duration-factor: 0.01;
  67. }
  68. }
  69. /**
  70. * Currently only used in Checkbox.
  71. */
  72. :root {
  73. --calcite-floating-ui-transition: var(--calcite-animation-timing);
  74. }
  75. :host([hidden]) {
  76. display: none;
  77. }
  78. :host([layout=horizontal][disabled]) .stepper-item-header, :host([disabled]) {
  79. pointer-events: none;
  80. cursor: default;
  81. -webkit-user-select: none;
  82. user-select: none;
  83. opacity: var(--calcite-ui-opacity-disabled);
  84. }
  85. :host([scale=s]) {
  86. --calcite-stepper-item-spacing-unit-s: 0.25rem;
  87. --calcite-stepper-item-spacing-unit-m: 0.75rem;
  88. --calcite-stepper-item-spacing-unit-l: 1rem;
  89. font-size: var(--calcite-font-size--1);
  90. line-height: 1rem;
  91. margin-inline-end: 0.25rem;
  92. }
  93. :host([scale=s]) .stepper-item-description {
  94. font-size: var(--calcite-font-size--2);
  95. line-height: 1rem;
  96. }
  97. :host([scale=m]) {
  98. --calcite-stepper-item-spacing-unit-s: 0.5rem;
  99. --calcite-stepper-item-spacing-unit-m: 1rem;
  100. --calcite-stepper-item-spacing-unit-l: 1.25rem;
  101. font-size: var(--calcite-font-size-0);
  102. line-height: 1.25rem;
  103. margin-inline-end: 0.5rem;
  104. }
  105. :host([scale=m]) .stepper-item-description {
  106. font-size: var(--calcite-font-size--1);
  107. line-height: 1rem;
  108. }
  109. :host([scale=l]) {
  110. --calcite-stepper-item-spacing-unit-s: 0.75rem;
  111. --calcite-stepper-item-spacing-unit-m: 1.25rem;
  112. --calcite-stepper-item-spacing-unit-l: 1.5rem;
  113. font-size: var(--calcite-font-size-1);
  114. line-height: 1.5rem;
  115. margin-inline-end: 0.75rem;
  116. }
  117. :host([scale=l]) .stepper-item-description {
  118. font-size: var(--calcite-font-size-0);
  119. line-height: 1.25rem;
  120. }
  121. :host {
  122. position: relative;
  123. display: flex;
  124. flex-grow: 1;
  125. flex-direction: column;
  126. align-self: flex-start;
  127. margin-block-end: var(--calcite-stepper-item-spacing-unit-s);
  128. }
  129. :host .container {
  130. position: relative;
  131. display: flex;
  132. flex-grow: 1;
  133. cursor: pointer;
  134. flex-direction: column;
  135. border-width: 0px;
  136. border-block-start-width: 2px;
  137. border-style: solid;
  138. border-color: var(--calcite-ui-border-3);
  139. color: var(--calcite-ui-text-3);
  140. text-decoration-line: none;
  141. outline: 2px solid transparent;
  142. outline-offset: 2px;
  143. transition-duration: 150ms;
  144. transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  145. }
  146. :host {
  147. outline-color: transparent;
  148. }
  149. :host(:focus) {
  150. outline: 2px solid var(--calcite-ui-brand);
  151. outline-offset: 2px;
  152. }
  153. :host .stepper-item-header {
  154. display: flex;
  155. cursor: pointer;
  156. align-items: flex-start;
  157. }
  158. :host .stepper-item-content,
  159. :host .stepper-item-header {
  160. transition-duration: 150ms;
  161. transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  162. padding-block: var(--calcite-stepper-item-spacing-unit-l);
  163. padding-inline-end: var(--calcite-stepper-item-spacing-unit-m);
  164. text-align: start;
  165. }
  166. :host .stepper-item-header * {
  167. display: inline-flex;
  168. align-items: center;
  169. transition-duration: 150ms;
  170. transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  171. }
  172. :host .stepper-item-content {
  173. display: none;
  174. inline-size: 100%;
  175. flex-direction: column;
  176. font-size: var(--calcite-font-size--2);
  177. line-height: 1.375;
  178. }
  179. :host .stepper-item-icon {
  180. margin-inline-end: var(--calcite-stepper-item-spacing-unit-m);
  181. margin-block-start: 1px;
  182. display: inline-flex;
  183. block-size: 0.75rem;
  184. flex-shrink: 0;
  185. align-self: flex-start;
  186. color: var(--calcite-ui-text-3);
  187. opacity: var(--calcite-ui-opacity-disabled);
  188. transition-duration: 150ms;
  189. transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  190. }
  191. :host .stepper-item-header-text {
  192. flex-direction: column;
  193. text-align: initial;
  194. margin-inline-end: auto;
  195. }
  196. :host .stepper-item-heading,
  197. :host .stepper-item-description {
  198. display: flex;
  199. inline-size: 100%;
  200. }
  201. :host .stepper-item-heading {
  202. margin-block-end: 0.25rem;
  203. font-weight: var(--calcite-font-weight-medium);
  204. color: var(--calcite-ui-text-2);
  205. }
  206. :host .stepper-item-description {
  207. color: var(--calcite-ui-text-3);
  208. }
  209. :host .stepper-item-number {
  210. font-weight: var(--calcite-font-weight-medium);
  211. color: var(--calcite-ui-text-3);
  212. transition-duration: 150ms;
  213. transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  214. margin-inline-end: var(--calcite-stepper-item-spacing-unit-m);
  215. }
  216. :host([disabled]) ::slotted([calcite-hydrated][disabled]),
  217. :host([disabled]) [calcite-hydrated][disabled] {
  218. /* prevent opacity stacking */
  219. opacity: 1;
  220. }
  221. :host([complete]) .container {
  222. border-color: rgba(0, 122, 194, 0.5);
  223. }
  224. :host([complete]) .container .stepper-item-icon {
  225. color: var(--calcite-ui-brand);
  226. }
  227. :host([error]) .container {
  228. border-block-start-color: var(--calcite-ui-danger);
  229. }
  230. :host([error]) .container .stepper-item-number {
  231. color: var(--calcite-ui-danger);
  232. }
  233. :host([error]) .container .stepper-item-icon {
  234. opacity: 1;
  235. color: var(--calcite-ui-danger);
  236. }
  237. :host(:hover:not([disabled]):not([selected])) .container,
  238. :host(:focus:not([disabled]):not([selected])) .container {
  239. border-block-start-color: var(--calcite-ui-brand);
  240. }
  241. :host(:hover:not([disabled]):not([selected])) .container .stepper-item-heading,
  242. :host(:focus:not([disabled]):not([selected])) .container .stepper-item-heading {
  243. color: var(--calcite-ui-text-1);
  244. }
  245. :host(:hover:not([disabled]):not([selected])) .container .stepper-item-description,
  246. :host(:focus:not([disabled]):not([selected])) .container .stepper-item-description {
  247. color: var(--calcite-ui-text-2);
  248. }
  249. :host([error]:hover:not([disabled]):not([selected])) .container,
  250. :host([error]:focus:not([disabled]):not([selected])) .container {
  251. border-block-start-color: var(--calcite-ui-danger-hover);
  252. }
  253. :host([selected]) .container {
  254. border-block-start-color: var(--calcite-ui-brand);
  255. }
  256. :host([selected]) .container .stepper-item-heading {
  257. color: var(--calcite-ui-text-1);
  258. }
  259. :host([selected]) .container .stepper-item-description {
  260. color: var(--calcite-ui-text-2);
  261. }
  262. :host([selected]) .container .stepper-item-number {
  263. color: var(--calcite-ui-brand);
  264. }
  265. :host([selected]) .container .stepper-item-icon {
  266. color: var(--calcite-ui-brand);
  267. opacity: 1;
  268. }
  269. :host([selected]) .container .stepper-item-content {
  270. display: flex;
  271. }
  272. :host([layout=vertical]) .container {
  273. margin-inline: 0px;
  274. margin-block-start: 0px;
  275. flex: 1 1 auto;
  276. border-block-start-width: 0px;
  277. border-style: solid;
  278. border-color: var(--calcite-ui-border-3);
  279. padding-block: 0px;
  280. border-inline-start-width: 2px;
  281. padding-inline-start: var(--calcite-stepper-item-spacing-unit-l);
  282. }
  283. :host([layout=vertical]) .container .stepper-item-icon {
  284. order: 3;
  285. margin-block: 1px 0px;
  286. padding-inline-start: var(--calcite-stepper-item-spacing-unit-s);
  287. margin-inline-start: auto;
  288. }
  289. :host([layout=vertical]) .container .stepper-item-header {
  290. padding-inline-end: 0px;
  291. }
  292. :host([layout=vertical]) .container .stepper-item-content {
  293. padding: 0px;
  294. }
  295. :host([layout=vertical][complete]) .container {
  296. border-color: rgba(0, 122, 194, 0.5);
  297. }
  298. :host([layout=vertical][complete]:hover:not([disabled]):not([selected])) .container,
  299. :host([layout=vertical][complete]:focus:not([disabled]):not([selected])) .container {
  300. border-color: var(--calcite-ui-brand);
  301. }
  302. :host([layout=vertical][error]) .container {
  303. border-color: var(--calcite-ui-danger);
  304. }
  305. :host([layout=vertical][selected]) .container {
  306. border-color: var(--calcite-ui-brand);
  307. }
  308. :host([layout=vertical][selected]) .container .stepper-item-content ::slotted(:last-child) {
  309. margin-block-end: var(--calcite-stepper-item-spacing-unit-l);
  310. }
  311. :host([layout=vertical]:hover:not([disabled]):not([selected])) .container,
  312. :host([layout=vertical]:focus:not([disabled]):not([selected])) .container {
  313. border-color: rgba(0, 122, 194, 0.5);
  314. }
  315. :host([layout=vertical][error]:hover:not([disabled]):not([selected])) .container,
  316. :host([layout=vertical][error]:focus:not([disabled]):not([selected])) .container {
  317. border-color: var(--calcite-ui-danger-hover);
  318. }
  319. :host([layout=horizontal]) {
  320. display: contents;
  321. }
  322. :host([layout=horizontal]) .container {
  323. display: contents;
  324. }
  325. :host([layout=horizontal]) .stepper-item-header {
  326. border-width: 0px;
  327. border-block-start-width: 2px;
  328. border-style: solid;
  329. border-color: var(--calcite-ui-border-3);
  330. outline-color: transparent;
  331. grid-row: items;
  332. margin-inline-end: 0.5rem;
  333. margin-block-end: var(--calcite-stepper-item-spacing-unit-s);
  334. }
  335. :host([layout=horizontal]) .stepper-item-header:focus {
  336. outline: 2px solid var(--calcite-ui-brand);
  337. outline-offset: 2px;
  338. }
  339. :host([layout=horizontal]) .stepper-item-content {
  340. cursor: auto;
  341. transition-duration: 150ms;
  342. transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  343. padding-block: 0;
  344. padding-inline-end: var(--calcite-stepper-item-spacing-unit-m);
  345. text-align: start;
  346. }
  347. :host([layout=horizontal][selected]) .stepper-item-content {
  348. grid-area: 2/1/2/-1;
  349. }
  350. :host([layout=horizontal][scale=s]) .stepper-item-header {
  351. margin-inline-end: 0.25rem;
  352. margin-block-end: var(--calcite-stepper-item-spacing-unit-s);
  353. }
  354. :host([layout=horizontal][scale=l]) .stepper-item-header {
  355. margin-inline-end: 0.75rem;
  356. margin-block-end: var(--calcite-stepper-item-spacing-unit-s);
  357. }
  358. :host([layout=horizontal][complete]) .stepper-item-header {
  359. border-color: rgba(0, 122, 194, 0.5);
  360. }
  361. :host([layout=horizontal][complete]:hover:not([disabled]):not([selected])) .stepper-item-header,
  362. :host([layout=horizontal][complete]:focus:not([disabled]):not([selected])) .stepper-item-header {
  363. border-color: var(--calcite-ui-brand);
  364. }
  365. :host([layout=horizontal][error]) .stepper-item-header {
  366. border-color: var(--calcite-ui-danger);
  367. }
  368. :host([layout=horizontal][selected]) .stepper-item-header {
  369. border-color: var(--calcite-ui-brand);
  370. }
  371. :host([layout=horizontal]:hover:not([disabled]):not([selected])) .stepper-item-header,
  372. :host([layout=horizontal]:focus:not([disabled]):not([selected])) .stepper-item-header {
  373. border-color: rgba(0, 122, 194, 0.5);
  374. }
  375. :host([layout=horizontal][error]:hover:not([disabled]):not([selected])) .stepper-item-header,
  376. :host([layout=horizontal][error]:focus:not([disabled]):not([selected])) .stepper-item-header {
  377. border-color: var(--calcite-ui-danger-hover);
  378. }
  379. @media (forced-colors: active) {
  380. :host .container {
  381. outline-width: 0;
  382. outline-offset: 0;
  383. }
  384. :host(:focus),
  385. :host(:focus-visible) {
  386. outline-color: canvasText;
  387. }
  388. :host([selected]) .container {
  389. border-block-start-color: highlight;
  390. }
  391. :host([selected]) .container .stepper-item-number {
  392. color: highlight;
  393. }
  394. :host([selected]) .container .stepper-item-icon {
  395. color: highlight;
  396. }
  397. :host([layout=vertical][selected]) .container {
  398. border-color: highlight;
  399. }
  400. }