@spectrum-web-components/theme 1.1.0 → 1.1.2

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.
Files changed (448) hide show
  1. package/core-tokens.d.ts +1 -0
  2. package/core-tokens.dev.js +5 -0
  3. package/core-tokens.dev.js.map +7 -0
  4. package/core-tokens.js +2 -0
  5. package/core-tokens.js.map +7 -0
  6. package/core.d.ts +1 -0
  7. package/core.dev.js +5 -0
  8. package/core.dev.js.map +7 -0
  9. package/core.js +2 -0
  10. package/core.js.map +7 -0
  11. package/express/scale-large-core-tokens.d.ts +1 -0
  12. package/express/scale-large-core-tokens.dev.js +6 -0
  13. package/express/scale-large-core-tokens.dev.js.map +7 -0
  14. package/express/scale-large-core-tokens.js +2 -0
  15. package/express/scale-large-core-tokens.js.map +7 -0
  16. package/express/scale-large.d.ts +1 -0
  17. package/express/scale-large.dev.js +6 -0
  18. package/express/scale-large.dev.js.map +7 -0
  19. package/express/scale-large.js +2 -0
  20. package/express/scale-large.js.map +7 -0
  21. package/express/scale-medium-core-tokens.d.ts +1 -0
  22. package/express/scale-medium-core-tokens.dev.js +6 -0
  23. package/express/scale-medium-core-tokens.dev.js.map +7 -0
  24. package/express/scale-medium-core-tokens.js +2 -0
  25. package/express/scale-medium-core-tokens.js.map +7 -0
  26. package/express/scale-medium.d.ts +1 -0
  27. package/express/scale-medium.dev.js +6 -0
  28. package/express/scale-medium.dev.js.map +7 -0
  29. package/express/scale-medium.js +2 -0
  30. package/express/scale-medium.js.map +7 -0
  31. package/express/theme-dark-core-tokens.d.ts +1 -0
  32. package/express/theme-dark-core-tokens.dev.js +6 -0
  33. package/express/theme-dark-core-tokens.dev.js.map +7 -0
  34. package/express/theme-dark-core-tokens.js +2 -0
  35. package/express/theme-dark-core-tokens.js.map +7 -0
  36. package/express/theme-dark.d.ts +1 -0
  37. package/express/theme-dark.dev.js +6 -0
  38. package/express/theme-dark.dev.js.map +7 -0
  39. package/express/theme-dark.js +2 -0
  40. package/express/theme-dark.js.map +7 -0
  41. package/express/theme-darkest-core-tokens.d.ts +1 -0
  42. package/express/theme-darkest-core-tokens.dev.js +6 -0
  43. package/express/theme-darkest-core-tokens.dev.js.map +7 -0
  44. package/express/theme-darkest-core-tokens.js +2 -0
  45. package/express/theme-darkest-core-tokens.js.map +7 -0
  46. package/express/theme-darkest.d.ts +1 -0
  47. package/express/theme-darkest.dev.js +6 -0
  48. package/express/theme-darkest.dev.js.map +7 -0
  49. package/express/theme-darkest.js +2 -0
  50. package/express/theme-darkest.js.map +7 -0
  51. package/express/theme-light-core-tokens.d.ts +1 -0
  52. package/express/theme-light-core-tokens.dev.js +6 -0
  53. package/express/theme-light-core-tokens.dev.js.map +7 -0
  54. package/express/theme-light-core-tokens.js +2 -0
  55. package/express/theme-light-core-tokens.js.map +7 -0
  56. package/express/theme-light.d.ts +1 -0
  57. package/express/theme-light.dev.js +6 -0
  58. package/express/theme-light.dev.js.map +7 -0
  59. package/express/theme-light.js +2 -0
  60. package/express/theme-light.js.map +7 -0
  61. package/express/theme-lightest-core-tokens.d.ts +1 -0
  62. package/express/theme-lightest-core-tokens.dev.js +6 -0
  63. package/express/theme-lightest-core-tokens.dev.js.map +7 -0
  64. package/express/theme-lightest-core-tokens.js +2 -0
  65. package/express/theme-lightest-core-tokens.js.map +7 -0
  66. package/express/theme-lightest.d.ts +1 -0
  67. package/express/theme-lightest.dev.js +6 -0
  68. package/express/theme-lightest.dev.js.map +7 -0
  69. package/express/theme-lightest.js +2 -0
  70. package/express/theme-lightest.js.map +7 -0
  71. package/package.json +4 -4
  72. package/scale-large-core-tokens.d.ts +1 -0
  73. package/scale-large-core-tokens.dev.js +6 -0
  74. package/scale-large-core-tokens.dev.js.map +7 -0
  75. package/scale-large-core-tokens.js +2 -0
  76. package/scale-large-core-tokens.js.map +7 -0
  77. package/scale-large.d.ts +1 -0
  78. package/scale-large.dev.js +6 -0
  79. package/scale-large.dev.js.map +7 -0
  80. package/scale-large.js +2 -0
  81. package/scale-large.js.map +7 -0
  82. package/scale-medium-core-tokens.d.ts +1 -0
  83. package/scale-medium-core-tokens.dev.js +6 -0
  84. package/scale-medium-core-tokens.dev.js.map +7 -0
  85. package/scale-medium-core-tokens.js +2 -0
  86. package/scale-medium-core-tokens.js.map +7 -0
  87. package/scale-medium.d.ts +1 -0
  88. package/scale-medium.dev.js +6 -0
  89. package/scale-medium.dev.js.map +7 -0
  90. package/scale-medium.js +2 -0
  91. package/scale-medium.js.map +7 -0
  92. package/sp-theme.d.ts +6 -0
  93. package/sp-theme.dev.js +4 -0
  94. package/sp-theme.dev.js.map +7 -0
  95. package/sp-theme.js +2 -0
  96. package/sp-theme.js.map +7 -0
  97. package/spectrum-two/scale-large-core-tokens.d.ts +1 -0
  98. package/spectrum-two/scale-large-core-tokens.dev.js +6 -0
  99. package/spectrum-two/scale-large-core-tokens.dev.js.map +7 -0
  100. package/spectrum-two/scale-large-core-tokens.js +2 -0
  101. package/spectrum-two/scale-large-core-tokens.js.map +7 -0
  102. package/spectrum-two/scale-large.d.ts +1 -0
  103. package/spectrum-two/scale-large.dev.js +6 -0
  104. package/spectrum-two/scale-large.dev.js.map +7 -0
  105. package/spectrum-two/scale-large.js +2 -0
  106. package/spectrum-two/scale-large.js.map +7 -0
  107. package/spectrum-two/scale-medium-core-tokens.d.ts +1 -0
  108. package/spectrum-two/scale-medium-core-tokens.dev.js +6 -0
  109. package/spectrum-two/scale-medium-core-tokens.dev.js.map +7 -0
  110. package/spectrum-two/scale-medium-core-tokens.js +2 -0
  111. package/spectrum-two/scale-medium-core-tokens.js.map +7 -0
  112. package/spectrum-two/scale-medium.d.ts +1 -0
  113. package/spectrum-two/scale-medium.dev.js +6 -0
  114. package/spectrum-two/scale-medium.dev.js.map +7 -0
  115. package/spectrum-two/scale-medium.js +2 -0
  116. package/spectrum-two/scale-medium.js.map +7 -0
  117. package/spectrum-two/theme-dark-core-tokens.d.ts +1 -0
  118. package/spectrum-two/theme-dark-core-tokens.dev.js +6 -0
  119. package/spectrum-two/theme-dark-core-tokens.dev.js.map +7 -0
  120. package/spectrum-two/theme-dark-core-tokens.js +2 -0
  121. package/spectrum-two/theme-dark-core-tokens.js.map +7 -0
  122. package/spectrum-two/theme-dark.d.ts +1 -0
  123. package/spectrum-two/theme-dark.dev.js +6 -0
  124. package/spectrum-two/theme-dark.dev.js.map +7 -0
  125. package/spectrum-two/theme-dark.js +2 -0
  126. package/spectrum-two/theme-dark.js.map +7 -0
  127. package/spectrum-two/theme-darkest-core-tokens.d.ts +1 -0
  128. package/spectrum-two/theme-darkest-core-tokens.dev.js +6 -0
  129. package/spectrum-two/theme-darkest-core-tokens.dev.js.map +7 -0
  130. package/spectrum-two/theme-darkest-core-tokens.js +2 -0
  131. package/spectrum-two/theme-darkest-core-tokens.js.map +7 -0
  132. package/spectrum-two/theme-darkest.d.ts +1 -0
  133. package/spectrum-two/theme-darkest.dev.js +6 -0
  134. package/spectrum-two/theme-darkest.dev.js.map +7 -0
  135. package/spectrum-two/theme-darkest.js +2 -0
  136. package/spectrum-two/theme-darkest.js.map +7 -0
  137. package/spectrum-two/theme-light-core-tokens.d.ts +1 -0
  138. package/spectrum-two/theme-light-core-tokens.dev.js +6 -0
  139. package/spectrum-two/theme-light-core-tokens.dev.js.map +7 -0
  140. package/spectrum-two/theme-light-core-tokens.js +2 -0
  141. package/spectrum-two/theme-light-core-tokens.js.map +7 -0
  142. package/spectrum-two/theme-light.d.ts +1 -0
  143. package/spectrum-two/theme-light.dev.js +6 -0
  144. package/spectrum-two/theme-light.dev.js.map +7 -0
  145. package/spectrum-two/theme-light.js +2 -0
  146. package/spectrum-two/theme-light.js.map +7 -0
  147. package/spectrum-two/theme-lightest-core-tokens.d.ts +1 -0
  148. package/spectrum-two/theme-lightest-core-tokens.dev.js +6 -0
  149. package/spectrum-two/theme-lightest-core-tokens.dev.js.map +7 -0
  150. package/spectrum-two/theme-lightest-core-tokens.js +2 -0
  151. package/spectrum-two/theme-lightest-core-tokens.js.map +7 -0
  152. package/spectrum-two/theme-lightest.d.ts +1 -0
  153. package/spectrum-two/theme-lightest.dev.js +6 -0
  154. package/spectrum-two/theme-lightest.dev.js.map +7 -0
  155. package/spectrum-two/theme-lightest.js +2 -0
  156. package/spectrum-two/theme-lightest.js.map +7 -0
  157. package/src/Theme.d.ts +79 -0
  158. package/src/Theme.dev.js +339 -0
  159. package/src/Theme.dev.js.map +7 -0
  160. package/src/Theme.js +2 -0
  161. package/src/Theme.js.map +7 -0
  162. package/src/express/core-tokens.d.ts +1 -0
  163. package/src/express/core-tokens.dev.js +5 -0
  164. package/src/express/core-tokens.dev.js.map +7 -0
  165. package/src/express/core-tokens.js +2 -0
  166. package/src/express/core-tokens.js.map +7 -0
  167. package/src/express/core.d.ts +1 -0
  168. package/src/express/core.dev.js +5 -0
  169. package/src/express/core.dev.js.map +7 -0
  170. package/src/express/core.js +2 -0
  171. package/src/express/core.js.map +7 -0
  172. package/src/express/scale-large-core-tokens.css.d.ts +2 -0
  173. package/src/express/scale-large-core-tokens.css.dev.js +7 -0
  174. package/src/express/scale-large-core-tokens.css.dev.js.map +7 -0
  175. package/src/express/scale-large-core-tokens.css.js +4 -0
  176. package/src/express/scale-large-core-tokens.css.js.map +7 -0
  177. package/src/express/scale-large.css.d.ts +2 -0
  178. package/src/express/scale-large.css.dev.js +7 -0
  179. package/src/express/scale-large.css.dev.js.map +7 -0
  180. package/src/express/scale-large.css.js +4 -0
  181. package/src/express/scale-large.css.js.map +7 -0
  182. package/src/express/scale-medium-core-tokens.css.d.ts +2 -0
  183. package/src/express/scale-medium-core-tokens.css.dev.js +7 -0
  184. package/src/express/scale-medium-core-tokens.css.dev.js.map +7 -0
  185. package/src/express/scale-medium-core-tokens.css.js +4 -0
  186. package/src/express/scale-medium-core-tokens.css.js.map +7 -0
  187. package/src/express/scale-medium.css.d.ts +2 -0
  188. package/src/express/scale-medium.css.dev.js +7 -0
  189. package/src/express/scale-medium.css.dev.js.map +7 -0
  190. package/src/express/scale-medium.css.js +4 -0
  191. package/src/express/scale-medium.css.js.map +7 -0
  192. package/src/express/theme-core-tokens.css.d.ts +2 -0
  193. package/src/express/theme-core-tokens.css.dev.js +7 -0
  194. package/src/express/theme-core-tokens.css.dev.js.map +7 -0
  195. package/src/express/theme-core-tokens.css.js +4 -0
  196. package/src/express/theme-core-tokens.css.js.map +7 -0
  197. package/src/express/theme-dark-core-tokens.css.d.ts +2 -0
  198. package/src/express/theme-dark-core-tokens.css.dev.js +7 -0
  199. package/src/express/theme-dark-core-tokens.css.dev.js.map +7 -0
  200. package/src/express/theme-dark-core-tokens.css.js +4 -0
  201. package/src/express/theme-dark-core-tokens.css.js.map +7 -0
  202. package/src/express/theme-dark.css.d.ts +2 -0
  203. package/src/express/theme-dark.css.dev.js +7 -0
  204. package/src/express/theme-dark.css.dev.js.map +7 -0
  205. package/src/express/theme-dark.css.js +4 -0
  206. package/src/express/theme-dark.css.js.map +7 -0
  207. package/src/express/theme-light-core-tokens.css.d.ts +2 -0
  208. package/src/express/theme-light-core-tokens.css.dev.js +7 -0
  209. package/src/express/theme-light-core-tokens.css.dev.js.map +7 -0
  210. package/src/express/theme-light-core-tokens.css.js +4 -0
  211. package/src/express/theme-light-core-tokens.css.js.map +7 -0
  212. package/src/express/theme-light.css.d.ts +2 -0
  213. package/src/express/theme-light.css.dev.js +7 -0
  214. package/src/express/theme-light.css.dev.js.map +7 -0
  215. package/src/express/theme-light.css.js +4 -0
  216. package/src/express/theme-light.css.js.map +7 -0
  217. package/src/express/theme.css.d.ts +2 -0
  218. package/src/express/theme.css.dev.js +7 -0
  219. package/src/express/theme.css.dev.js.map +7 -0
  220. package/src/express/theme.css.js +4 -0
  221. package/src/express/theme.css.js.map +7 -0
  222. package/src/express/themes-core-tokens.d.ts +6 -0
  223. package/src/express/themes-core-tokens.dev.js +8 -0
  224. package/src/express/themes-core-tokens.dev.js.map +7 -0
  225. package/src/express/themes-core-tokens.js +2 -0
  226. package/src/express/themes-core-tokens.js.map +7 -0
  227. package/src/express/themes.d.ts +6 -0
  228. package/src/express/themes.dev.js +8 -0
  229. package/src/express/themes.dev.js.map +7 -0
  230. package/src/express/themes.js +2 -0
  231. package/src/express/themes.js.map +7 -0
  232. package/src/index.d.ts +1 -0
  233. package/src/index.dev.js +3 -0
  234. package/src/index.dev.js.map +7 -0
  235. package/src/index.js +2 -0
  236. package/src/index.js.map +7 -0
  237. package/src/scale-large-core-tokens.css.d.ts +2 -0
  238. package/src/scale-large-core-tokens.css.dev.js +7 -0
  239. package/src/scale-large-core-tokens.css.dev.js.map +7 -0
  240. package/src/scale-large-core-tokens.css.js +4 -0
  241. package/src/scale-large-core-tokens.css.js.map +7 -0
  242. package/src/scale-large.css.d.ts +2 -0
  243. package/src/scale-large.css.dev.js +7 -0
  244. package/src/scale-large.css.dev.js.map +7 -0
  245. package/src/scale-large.css.js +4 -0
  246. package/src/scale-large.css.js.map +7 -0
  247. package/src/scale-medium-core-tokens.css.d.ts +2 -0
  248. package/src/scale-medium-core-tokens.css.dev.js +7 -0
  249. package/src/scale-medium-core-tokens.css.dev.js.map +7 -0
  250. package/src/scale-medium-core-tokens.css.js +4 -0
  251. package/src/scale-medium-core-tokens.css.js.map +7 -0
  252. package/src/scale-medium.css.d.ts +2 -0
  253. package/src/scale-medium.css.dev.js +7 -0
  254. package/src/scale-medium.css.dev.js.map +7 -0
  255. package/src/scale-medium.css.js +4 -0
  256. package/src/scale-medium.css.js.map +7 -0
  257. package/src/spectrum-two/core-tokens.d.ts +1 -0
  258. package/src/spectrum-two/core-tokens.dev.js +5 -0
  259. package/src/spectrum-two/core-tokens.dev.js.map +7 -0
  260. package/src/spectrum-two/core-tokens.js +2 -0
  261. package/src/spectrum-two/core-tokens.js.map +7 -0
  262. package/src/spectrum-two/core.d.ts +1 -0
  263. package/src/spectrum-two/core.dev.js +5 -0
  264. package/src/spectrum-two/core.dev.js.map +7 -0
  265. package/src/spectrum-two/core.js +2 -0
  266. package/src/spectrum-two/core.js.map +7 -0
  267. package/src/spectrum-two/scale-large-core-tokens.css.d.ts +2 -0
  268. package/src/spectrum-two/scale-large-core-tokens.css.dev.js +7 -0
  269. package/src/spectrum-two/scale-large-core-tokens.css.dev.js.map +7 -0
  270. package/src/spectrum-two/scale-large-core-tokens.css.js +4 -0
  271. package/src/spectrum-two/scale-large-core-tokens.css.js.map +7 -0
  272. package/src/spectrum-two/scale-large.css.d.ts +2 -0
  273. package/src/spectrum-two/scale-large.css.dev.js +7 -0
  274. package/src/spectrum-two/scale-large.css.dev.js.map +7 -0
  275. package/src/spectrum-two/scale-large.css.js +4 -0
  276. package/src/spectrum-two/scale-large.css.js.map +7 -0
  277. package/src/spectrum-two/scale-medium-core-tokens.css.d.ts +2 -0
  278. package/src/spectrum-two/scale-medium-core-tokens.css.dev.js +7 -0
  279. package/src/spectrum-two/scale-medium-core-tokens.css.dev.js.map +7 -0
  280. package/src/spectrum-two/scale-medium-core-tokens.css.js +4 -0
  281. package/src/spectrum-two/scale-medium-core-tokens.css.js.map +7 -0
  282. package/src/spectrum-two/scale-medium.css.d.ts +2 -0
  283. package/src/spectrum-two/scale-medium.css.dev.js +7 -0
  284. package/src/spectrum-two/scale-medium.css.dev.js.map +7 -0
  285. package/src/spectrum-two/scale-medium.css.js +4 -0
  286. package/src/spectrum-two/scale-medium.css.js.map +7 -0
  287. package/src/spectrum-two/theme-core-tokens.css.d.ts +2 -0
  288. package/src/spectrum-two/theme-core-tokens.css.dev.js +7 -0
  289. package/src/spectrum-two/theme-core-tokens.css.dev.js.map +7 -0
  290. package/src/spectrum-two/theme-core-tokens.css.js +4 -0
  291. package/src/spectrum-two/theme-core-tokens.css.js.map +7 -0
  292. package/src/spectrum-two/theme-dark-core-tokens.css.d.ts +2 -0
  293. package/src/spectrum-two/theme-dark-core-tokens.css.dev.js +7 -0
  294. package/src/spectrum-two/theme-dark-core-tokens.css.dev.js.map +7 -0
  295. package/src/spectrum-two/theme-dark-core-tokens.css.js +4 -0
  296. package/src/spectrum-two/theme-dark-core-tokens.css.js.map +7 -0
  297. package/src/spectrum-two/theme-dark.css.d.ts +2 -0
  298. package/src/spectrum-two/theme-dark.css.dev.js +7 -0
  299. package/src/spectrum-two/theme-dark.css.dev.js.map +7 -0
  300. package/src/spectrum-two/theme-dark.css.js +4 -0
  301. package/src/spectrum-two/theme-dark.css.js.map +7 -0
  302. package/src/spectrum-two/theme-light-core-tokens.css.d.ts +2 -0
  303. package/src/spectrum-two/theme-light-core-tokens.css.dev.js +7 -0
  304. package/src/spectrum-two/theme-light-core-tokens.css.dev.js.map +7 -0
  305. package/src/spectrum-two/theme-light-core-tokens.css.js +4 -0
  306. package/src/spectrum-two/theme-light-core-tokens.css.js.map +7 -0
  307. package/src/spectrum-two/theme-light.css.d.ts +2 -0
  308. package/src/spectrum-two/theme-light.css.dev.js +7 -0
  309. package/src/spectrum-two/theme-light.css.dev.js.map +7 -0
  310. package/src/spectrum-two/theme-light.css.js +4 -0
  311. package/src/spectrum-two/theme-light.css.js.map +7 -0
  312. package/src/spectrum-two/theme.css.d.ts +2 -0
  313. package/src/spectrum-two/theme.css.dev.js +7 -0
  314. package/src/spectrum-two/theme.css.dev.js.map +7 -0
  315. package/src/spectrum-two/theme.css.js +4 -0
  316. package/src/spectrum-two/theme.css.js.map +7 -0
  317. package/src/spectrum-two/themes-core-tokens.d.ts +6 -0
  318. package/src/spectrum-two/themes-core-tokens.dev.js +8 -0
  319. package/src/spectrum-two/themes-core-tokens.dev.js.map +7 -0
  320. package/src/spectrum-two/themes-core-tokens.js +2 -0
  321. package/src/spectrum-two/themes-core-tokens.js.map +7 -0
  322. package/src/spectrum-two/themes.d.ts +6 -0
  323. package/src/spectrum-two/themes.dev.js +8 -0
  324. package/src/spectrum-two/themes.dev.js.map +7 -0
  325. package/src/spectrum-two/themes.js +2 -0
  326. package/src/spectrum-two/themes.js.map +7 -0
  327. package/src/theme-core-tokens.css.d.ts +2 -0
  328. package/src/theme-core-tokens.css.dev.js +7 -0
  329. package/src/theme-core-tokens.css.dev.js.map +7 -0
  330. package/src/theme-core-tokens.css.js +4 -0
  331. package/src/theme-core-tokens.css.js.map +7 -0
  332. package/src/theme-dark-core-tokens.css.d.ts +2 -0
  333. package/src/theme-dark-core-tokens.css.dev.js +7 -0
  334. package/src/theme-dark-core-tokens.css.dev.js.map +7 -0
  335. package/src/theme-dark-core-tokens.css.js +4 -0
  336. package/src/theme-dark-core-tokens.css.js.map +7 -0
  337. package/src/theme-dark.css.d.ts +2 -0
  338. package/src/theme-dark.css.dev.js +7 -0
  339. package/src/theme-dark.css.dev.js.map +7 -0
  340. package/src/theme-dark.css.js +4 -0
  341. package/src/theme-dark.css.js.map +7 -0
  342. package/src/theme-darkest-core-tokens.css.d.ts +2 -0
  343. package/src/theme-darkest-core-tokens.css.dev.js +7 -0
  344. package/src/theme-darkest-core-tokens.css.dev.js.map +7 -0
  345. package/src/theme-darkest-core-tokens.css.js +4 -0
  346. package/src/theme-darkest-core-tokens.css.js.map +7 -0
  347. package/src/theme-darkest.css.d.ts +2 -0
  348. package/src/theme-darkest.css.dev.js +7 -0
  349. package/src/theme-darkest.css.dev.js.map +7 -0
  350. package/src/theme-darkest.css.js +4 -0
  351. package/src/theme-darkest.css.js.map +7 -0
  352. package/src/theme-interfaces.d.ts +32 -0
  353. package/src/theme-interfaces.dev.js +29 -0
  354. package/src/theme-interfaces.dev.js.map +7 -0
  355. package/src/theme-interfaces.js +2 -0
  356. package/src/theme-interfaces.js.map +7 -0
  357. package/src/theme-light-core-tokens.css.d.ts +2 -0
  358. package/src/theme-light-core-tokens.css.dev.js +7 -0
  359. package/src/theme-light-core-tokens.css.dev.js.map +7 -0
  360. package/src/theme-light-core-tokens.css.js +4 -0
  361. package/src/theme-light-core-tokens.css.js.map +7 -0
  362. package/src/theme-light.css.d.ts +2 -0
  363. package/src/theme-light.css.dev.js +7 -0
  364. package/src/theme-light.css.dev.js.map +7 -0
  365. package/src/theme-light.css.js +4 -0
  366. package/src/theme-light.css.js.map +7 -0
  367. package/src/theme-lightest-core-tokens.css.d.ts +2 -0
  368. package/src/theme-lightest-core-tokens.css.dev.js +7 -0
  369. package/src/theme-lightest-core-tokens.css.dev.js.map +7 -0
  370. package/src/theme-lightest-core-tokens.css.js +4 -0
  371. package/src/theme-lightest-core-tokens.css.js.map +7 -0
  372. package/src/theme-lightest.css.d.ts +2 -0
  373. package/src/theme-lightest.css.dev.js +7 -0
  374. package/src/theme-lightest.css.dev.js.map +7 -0
  375. package/src/theme-lightest.css.js +4 -0
  376. package/src/theme-lightest.css.js.map +7 -0
  377. package/src/theme.css.d.ts +2 -0
  378. package/src/theme.css.dev.js +7 -0
  379. package/src/theme.css.dev.js.map +7 -0
  380. package/src/theme.css.js +4 -0
  381. package/src/theme.css.js.map +7 -0
  382. package/src/themes-core-tokens.d.ts +6 -0
  383. package/src/themes-core-tokens.dev.js +8 -0
  384. package/src/themes-core-tokens.dev.js.map +7 -0
  385. package/src/themes-core-tokens.js +2 -0
  386. package/src/themes-core-tokens.js.map +7 -0
  387. package/src/themes.d.ts +6 -0
  388. package/src/themes.dev.js +8 -0
  389. package/src/themes.dev.js.map +7 -0
  390. package/src/themes.js +2 -0
  391. package/src/themes.js.map +7 -0
  392. package/src/typography.css.d.ts +2 -0
  393. package/src/typography.css.dev.js +7 -0
  394. package/src/typography.css.dev.js.map +7 -0
  395. package/src/typography.css.js +4 -0
  396. package/src/typography.css.js.map +7 -0
  397. package/stories/theme.stories.js +258 -0
  398. package/stories/theme.stories.js.map +7 -0
  399. package/test/theme-devmode.test.js +46 -0
  400. package/test/theme-devmode.test.js.map +7 -0
  401. package/test/theme-lazy.test.js +114 -0
  402. package/test/theme-lazy.test.js.map +7 -0
  403. package/test/theme.test-vrt.js +5 -0
  404. package/test/theme.test-vrt.js.map +7 -0
  405. package/test/theme.test.js +13 -0
  406. package/test/theme.test.js.map +7 -0
  407. package/test/themes.test.js +169 -0
  408. package/test/themes.test.js.map +7 -0
  409. package/theme-dark-core-tokens.d.ts +1 -0
  410. package/theme-dark-core-tokens.dev.js +6 -0
  411. package/theme-dark-core-tokens.dev.js.map +7 -0
  412. package/theme-dark-core-tokens.js +2 -0
  413. package/theme-dark-core-tokens.js.map +7 -0
  414. package/theme-dark.d.ts +1 -0
  415. package/theme-dark.dev.js +6 -0
  416. package/theme-dark.dev.js.map +7 -0
  417. package/theme-dark.js +2 -0
  418. package/theme-dark.js.map +7 -0
  419. package/theme-darkest-core-tokens.d.ts +1 -0
  420. package/theme-darkest-core-tokens.dev.js +6 -0
  421. package/theme-darkest-core-tokens.dev.js.map +7 -0
  422. package/theme-darkest-core-tokens.js +2 -0
  423. package/theme-darkest-core-tokens.js.map +7 -0
  424. package/theme-darkest.d.ts +1 -0
  425. package/theme-darkest.dev.js +6 -0
  426. package/theme-darkest.dev.js.map +7 -0
  427. package/theme-darkest.js +2 -0
  428. package/theme-darkest.js.map +7 -0
  429. package/theme-light-core-tokens.d.ts +1 -0
  430. package/theme-light-core-tokens.dev.js +6 -0
  431. package/theme-light-core-tokens.dev.js.map +7 -0
  432. package/theme-light-core-tokens.js +2 -0
  433. package/theme-light-core-tokens.js.map +7 -0
  434. package/theme-light.d.ts +1 -0
  435. package/theme-light.dev.js +6 -0
  436. package/theme-light.dev.js.map +7 -0
  437. package/theme-light.js +2 -0
  438. package/theme-light.js.map +7 -0
  439. package/theme-lightest-core-tokens.d.ts +1 -0
  440. package/theme-lightest-core-tokens.dev.js +6 -0
  441. package/theme-lightest-core-tokens.dev.js.map +7 -0
  442. package/theme-lightest-core-tokens.js +2 -0
  443. package/theme-lightest-core-tokens.js.map +7 -0
  444. package/theme-lightest.d.ts +1 -0
  445. package/theme-lightest.dev.js +6 -0
  446. package/theme-lightest.dev.js.map +7 -0
  447. package/theme-lightest.js +2 -0
  448. package/theme-lightest.js.map +7 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["theme-lightest.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport lightStyles from '../src/spectrum-two/theme-light.css.js';\nimport { Theme } from '../src/Theme.js';\nimport '../src/spectrum-two/core.js';\n\nTheme.registerThemeFragment('lightest-spectrum-two', 'color', lightStyles);\n"],
5
+ "mappings": "aAYA,OAAOA,MAAiB,yCACxB,OAAS,SAAAC,MAAa,kBACtB,MAAO,8BAEPA,EAAM,sBAAsB,wBAAyB,QAASD,CAAW",
6
+ "names": ["lightStyles", "Theme"]
7
+ }
package/src/Theme.d.ts ADDED
@@ -0,0 +1,79 @@
1
+ import { CSSResultGroup } from '@spectrum-web-components/base';
2
+ import { Color, FragmentName, FragmentType, ProvideLang, Scale, SettableFragmentTypes, ShadowRootWithAdoptedStyleSheets, SystemVariant, ThemeFragmentMap, ThemeKindProvider } from './theme-interfaces.js';
3
+ export type { ProvideLang, ThemeFragmentMap, Color, Scale, SystemVariant };
4
+ /**
5
+ * @element sp-theme
6
+ * @attr {string} [lang=""] - The language of the content scoped to this `sp-theme` element, see: <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang" target="_blank">MDN reference</a>.
7
+ *
8
+ * @slot - Content on which to apply the CSS Custom Properties defined by the current theme configuration
9
+ */
10
+ export declare class Theme extends HTMLElement implements ThemeKindProvider {
11
+ private static themeFragmentsByKind;
12
+ private static defaultFragments;
13
+ private static templateElement?;
14
+ private static instances;
15
+ static VERSION: string;
16
+ static get observedAttributes(): string[];
17
+ _dir: 'ltr' | 'rtl' | '';
18
+ set dir(dir: 'ltr' | 'rtl' | '');
19
+ /**
20
+ * Reading direction of the content scoped to this `sp-theme` element.
21
+ * @type {"ltr" | "rtl" | ""}
22
+ * @attr
23
+ */
24
+ get dir(): 'ltr' | 'rtl' | '';
25
+ protected attributeChangedCallback(attrName: SettableFragmentTypes | 'lang' | 'dir', old: string | null, value: string | null): void;
26
+ private requestUpdate;
27
+ shadowRoot: ShadowRootWithAdoptedStyleSheets;
28
+ private _system;
29
+ /**
30
+ * The Spectrum system that is applied to the content scoped to this `sp-theme` element.
31
+ *
32
+ * A value is requried.
33
+ * @type {"spectrum" | "express" }
34
+ * @attr
35
+ */
36
+ get system(): SystemVariant | '';
37
+ set system(newValue: SystemVariant | '');
38
+ private _color;
39
+ /**
40
+ * The Spectrum color stops to apply to content scoped by this `sp-theme` element.
41
+ *
42
+ * A value is requried.
43
+ * @type {"lightest" | "light" | "dark" | "darkest" | ""}
44
+ * @attr
45
+ */
46
+ get color(): Color | '';
47
+ set color(newValue: Color | '');
48
+ private _scale;
49
+ /**
50
+ * The Spectrum platform scale to apply to content scoped by this `sp-theme` element.
51
+ *
52
+ * A value is requried.
53
+ * @type {"medium" | "large" | ""}
54
+ * @attr
55
+ */
56
+ get scale(): Scale | '';
57
+ set scale(newValue: Scale | '');
58
+ private get styles();
59
+ private static get template();
60
+ constructor();
61
+ private _systemContextConsumers;
62
+ private _handleSystemContext;
63
+ updateComplete: Promise<boolean>;
64
+ private __resolve;
65
+ private __createDeferredPromise;
66
+ protected connectedCallback(): void;
67
+ protected disconnectedCallback(): void;
68
+ startManagingContentDirection(el: HTMLElement): void;
69
+ stopManagingContentDirection(el: HTMLElement): void;
70
+ private trackedChildren;
71
+ private _updateRequested;
72
+ private shouldAdoptStyles;
73
+ protected adoptStyles(): void;
74
+ static registerThemeFragment(name: FragmentName, kind: FragmentType, styles: CSSResultGroup): void;
75
+ private _contextConsumers;
76
+ private _provideContext;
77
+ private _provideSystemContext;
78
+ private _handleContextPresence;
79
+ }
@@ -0,0 +1,339 @@
1
+ "use strict";
2
+ import { version } from "@spectrum-web-components/base/src/version.js";
3
+ import {
4
+ COLOR_VALUES,
5
+ SCALE_VALUES,
6
+ SYSTEM_VARIANT_VALUES
7
+ } from "./theme-interfaces.dev.js";
8
+ const _Theme = class _Theme extends HTMLElement {
9
+ constructor() {
10
+ super();
11
+ this._dir = "";
12
+ this._system = "spectrum";
13
+ this._color = "";
14
+ this._scale = "";
15
+ this._systemContextConsumers = /* @__PURE__ */ new Map();
16
+ this.trackedChildren = /* @__PURE__ */ new Set();
17
+ this._updateRequested = false;
18
+ this._contextConsumers = /* @__PURE__ */ new Map();
19
+ this.attachShadow({ mode: "open" });
20
+ const node = document.importNode(_Theme.template.content, true);
21
+ this.shadowRoot.appendChild(node);
22
+ this.shouldAdoptStyles();
23
+ this.addEventListener(
24
+ "sp-language-context",
25
+ this._handleContextPresence
26
+ );
27
+ this.addEventListener(
28
+ "sp-system-context",
29
+ this._handleSystemContext
30
+ );
31
+ this.updateComplete = this.__createDeferredPromise();
32
+ }
33
+ static get observedAttributes() {
34
+ return ["color", "scale", "lang", "dir", "system"];
35
+ }
36
+ set dir(dir) {
37
+ if (dir === this.dir) return;
38
+ this.setAttribute("dir", dir);
39
+ this._dir = dir;
40
+ const targetDir = dir === "rtl" ? dir : "ltr";
41
+ this.trackedChildren.forEach((el) => {
42
+ el.setAttribute("dir", targetDir);
43
+ });
44
+ }
45
+ /**
46
+ * Reading direction of the content scoped to this `sp-theme` element.
47
+ * @type {"ltr" | "rtl" | ""}
48
+ * @attr
49
+ */
50
+ get dir() {
51
+ return this._dir;
52
+ }
53
+ attributeChangedCallback(attrName, old, value) {
54
+ if (old === value) {
55
+ return;
56
+ }
57
+ if (attrName === "color") {
58
+ this.color = value;
59
+ } else if (attrName === "scale") {
60
+ this.scale = value;
61
+ } else if (attrName === "lang" && !!value) {
62
+ this.lang = value;
63
+ this._provideContext();
64
+ } else if (attrName === "system") {
65
+ this.system = value;
66
+ this._provideSystemContext();
67
+ } else if (attrName === "dir") {
68
+ this.dir = value;
69
+ }
70
+ }
71
+ requestUpdate() {
72
+ this.shouldAdoptStyles();
73
+ }
74
+ /**
75
+ * The Spectrum system that is applied to the content scoped to this `sp-theme` element.
76
+ *
77
+ * A value is requried.
78
+ * @type {"spectrum" | "express" }
79
+ * @attr
80
+ */
81
+ get system() {
82
+ const systemFragments = _Theme.themeFragmentsByKind.get("system");
83
+ const { name } = systemFragments && systemFragments.get("default") || {};
84
+ return this._system || name || "";
85
+ }
86
+ set system(newValue) {
87
+ if (newValue === this._system) return;
88
+ const system = !!newValue && SYSTEM_VARIANT_VALUES.includes(newValue) ? newValue : this.system;
89
+ if (system !== this._system) {
90
+ this._system = system;
91
+ this.requestUpdate();
92
+ }
93
+ if (system) {
94
+ this.setAttribute("system", system);
95
+ } else {
96
+ this.removeAttribute("system");
97
+ }
98
+ }
99
+ /**
100
+ * The Spectrum color stops to apply to content scoped by this `sp-theme` element.
101
+ *
102
+ * A value is requried.
103
+ * @type {"lightest" | "light" | "dark" | "darkest" | ""}
104
+ * @attr
105
+ */
106
+ get color() {
107
+ const themeFragments = _Theme.themeFragmentsByKind.get("color");
108
+ const { name } = themeFragments && themeFragments.get("default") || {};
109
+ return this._color || name || "";
110
+ }
111
+ set color(newValue) {
112
+ if (newValue === this._color) return;
113
+ const color = !!newValue && COLOR_VALUES.includes(newValue) ? newValue : this.color;
114
+ if (color !== this._color) {
115
+ this._color = color;
116
+ this.requestUpdate();
117
+ }
118
+ if (color) {
119
+ this.setAttribute("color", color);
120
+ } else {
121
+ this.removeAttribute("color");
122
+ }
123
+ }
124
+ /**
125
+ * The Spectrum platform scale to apply to content scoped by this `sp-theme` element.
126
+ *
127
+ * A value is requried.
128
+ * @type {"medium" | "large" | ""}
129
+ * @attr
130
+ */
131
+ get scale() {
132
+ const themeFragments = _Theme.themeFragmentsByKind.get("scale");
133
+ const { name } = themeFragments && themeFragments.get("default") || {};
134
+ return this._scale || name || "";
135
+ }
136
+ set scale(newValue) {
137
+ if (newValue === this._scale) return;
138
+ const scale = !!newValue && SCALE_VALUES.includes(newValue) ? newValue : this.scale;
139
+ if (scale !== this._scale) {
140
+ this._scale = scale;
141
+ this.requestUpdate();
142
+ }
143
+ if (scale) {
144
+ this.setAttribute("scale", scale);
145
+ } else {
146
+ this.removeAttribute("scale");
147
+ }
148
+ }
149
+ get styles() {
150
+ const themeKinds = [
151
+ ..._Theme.themeFragmentsByKind.keys()
152
+ ];
153
+ const getStyle = (fragments, name, kind) => {
154
+ const currentStyles = kind && kind !== "system" && this.system !== "spectrum" ? fragments.get(`${name}-${this.system}`) : fragments.get(name);
155
+ const isAppliedFragment = name === "spectrum" || !kind || this.hasAttribute(kind);
156
+ if (currentStyles && isAppliedFragment) {
157
+ return currentStyles.styles;
158
+ }
159
+ return;
160
+ };
161
+ const styles = themeKinds.reduce((acc, kind) => {
162
+ const kindFragments = _Theme.themeFragmentsByKind.get(
163
+ kind
164
+ );
165
+ let style;
166
+ if (kind === "app" || kind === "core") {
167
+ style = getStyle(kindFragments, kind);
168
+ } else {
169
+ const { [kind]: name } = this;
170
+ style = getStyle(kindFragments, name, kind);
171
+ }
172
+ if (style) {
173
+ acc.push(style);
174
+ }
175
+ return acc;
176
+ }, []);
177
+ const themeFragmentsByKind = _Theme.themeFragmentsByKind;
178
+ checkForIssues(
179
+ this,
180
+ this.system,
181
+ this.color,
182
+ this.scale,
183
+ themeFragmentsByKind
184
+ );
185
+ return [...styles];
186
+ }
187
+ static get template() {
188
+ if (!this.templateElement) {
189
+ this.templateElement = document.createElement("template");
190
+ this.templateElement.innerHTML = "<slot></slot>";
191
+ }
192
+ return this.templateElement;
193
+ }
194
+ _handleSystemContext(event) {
195
+ event.stopPropagation();
196
+ const target = event.composedPath()[0];
197
+ if (this._systemContextConsumers.has(target)) {
198
+ return;
199
+ }
200
+ const unsubscribe = () => this._systemContextConsumers.delete(target);
201
+ this._systemContextConsumers.set(target, [
202
+ event.detail.callback,
203
+ unsubscribe
204
+ ]);
205
+ const [callback] = this._systemContextConsumers.get(target) || [];
206
+ if (callback) {
207
+ callback(this.system, unsubscribe);
208
+ }
209
+ }
210
+ __createDeferredPromise() {
211
+ return new Promise((resolve) => {
212
+ this.__resolve = resolve;
213
+ });
214
+ }
215
+ connectedCallback() {
216
+ this.shouldAdoptStyles();
217
+ _Theme.instances.add(this);
218
+ if (!this.hasAttribute("dir")) {
219
+ let dirParent = this.assignedSlot || this.parentNode;
220
+ while (dirParent !== document.documentElement && !(dirParent instanceof _Theme)) {
221
+ dirParent = dirParent.assignedSlot || // step into the shadow DOM of the parent of a slotted node
222
+ dirParent.parentNode || // DOM Element detected
223
+ dirParent.host;
224
+ }
225
+ this.dir = dirParent.dir === "rtl" ? dirParent.dir : "ltr";
226
+ }
227
+ }
228
+ disconnectedCallback() {
229
+ _Theme.instances.delete(this);
230
+ }
231
+ startManagingContentDirection(el) {
232
+ this.trackedChildren.add(el);
233
+ }
234
+ stopManagingContentDirection(el) {
235
+ this.trackedChildren.delete(el);
236
+ }
237
+ async shouldAdoptStyles() {
238
+ if (!this._updateRequested) {
239
+ this.updateComplete = this.__createDeferredPromise();
240
+ this._updateRequested = true;
241
+ this._updateRequested = await false;
242
+ this.adoptStyles();
243
+ this.__resolve(true);
244
+ }
245
+ }
246
+ adoptStyles() {
247
+ const styles = this.styles;
248
+ const styleSheets = [];
249
+ for (const style of styles) {
250
+ styleSheets.push(style.styleSheet);
251
+ }
252
+ this.shadowRoot.adoptedStyleSheets = styleSheets;
253
+ }
254
+ static registerThemeFragment(name, kind, styles) {
255
+ const fragmentMap = _Theme.themeFragmentsByKind.get(kind) || /* @__PURE__ */ new Map();
256
+ if (fragmentMap.size === 0) {
257
+ _Theme.themeFragmentsByKind.set(kind, fragmentMap);
258
+ fragmentMap.set("default", { name, styles });
259
+ _Theme.defaultFragments.add(name);
260
+ }
261
+ fragmentMap.set(name, { name, styles });
262
+ _Theme.instances.forEach((instance) => instance.shouldAdoptStyles());
263
+ }
264
+ /* c8 ignore next 5 */
265
+ _provideContext() {
266
+ this._contextConsumers.forEach(
267
+ ([callback, unsubscribe]) => callback(this.lang, unsubscribe)
268
+ );
269
+ }
270
+ _provideSystemContext() {
271
+ this._systemContextConsumers.forEach(
272
+ ([callback, unsubscribe]) => callback(this.system, unsubscribe)
273
+ );
274
+ }
275
+ _handleContextPresence(event) {
276
+ event.stopPropagation();
277
+ const target = event.composedPath()[0];
278
+ if (this._contextConsumers.has(target)) {
279
+ return;
280
+ }
281
+ this._contextConsumers.set(target, [
282
+ event.detail.callback,
283
+ () => this._contextConsumers.delete(target)
284
+ ]);
285
+ const [callback, unsubscribe] = this._contextConsumers.get(target) || [];
286
+ if (callback && unsubscribe) {
287
+ callback(
288
+ this.lang || document.documentElement.lang || navigator.language,
289
+ unsubscribe
290
+ );
291
+ }
292
+ }
293
+ };
294
+ _Theme.themeFragmentsByKind = /* @__PURE__ */ new Map();
295
+ _Theme.defaultFragments = /* @__PURE__ */ new Set(["spectrum"]);
296
+ _Theme.instances = /* @__PURE__ */ new Set();
297
+ _Theme.VERSION = version;
298
+ export let Theme = _Theme;
299
+ function checkForIssues(instance, system, color, scale, themeFragmentsByKind) {
300
+ if (true) {
301
+ const issues = [];
302
+ const checkForAttribute = (name, resolvedValue, actualValue) => {
303
+ var _a;
304
+ const systemModifier = system && system !== "spectrum" ? `-${system}` : "";
305
+ if (!resolvedValue) {
306
+ issues.push(
307
+ `You have not explicitly set the "${name}" attribute and there is no default value on which to fallback.`
308
+ );
309
+ } else if (!actualValue) {
310
+ issues.push(
311
+ `You have not explicitly set the "${name}" attribute, the default value ("${resolvedValue}") is being used as a fallback.`
312
+ );
313
+ } else if (!((_a = themeFragmentsByKind.get(name)) == null ? void 0 : _a.get(
314
+ resolvedValue + (name === "system" ? "" : systemModifier)
315
+ ))) {
316
+ issues.push(
317
+ `You have set "${name}='${resolvedValue}'" but the associated system fragment has not been loaded.`
318
+ );
319
+ }
320
+ };
321
+ if (["lightest", "darkest"].includes(color || "")) {
322
+ issues.push(
323
+ `DEPRECATION NOTICE: Color "lightest" and "darkest" are deprecated. For more information, see: https://opensource.adobe.com/spectrum-web-components/tools/theme/`
324
+ );
325
+ }
326
+ checkForAttribute("system", system, instance.getAttribute("system"));
327
+ checkForAttribute("color", color, instance.getAttribute("color"));
328
+ checkForAttribute("scale", scale, instance.getAttribute("scale"));
329
+ if (issues.length) {
330
+ window.__swc.warn(
331
+ instance,
332
+ "You are leveraging an <sp-theme> element and the following issues may disrupt your theme delivery:",
333
+ "https://opensource.adobe.com/spectrum-web-components/components/theme/#example",
334
+ { issues }
335
+ );
336
+ }
337
+ }
338
+ }
339
+ //# sourceMappingURL=Theme.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["Theme.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { CSSResult, CSSResultGroup } from '@spectrum-web-components/base';\nimport { version } from '@spectrum-web-components/base/src/version.js';\nimport {\n Color,\n COLOR_VALUES,\n FragmentMap,\n FragmentName,\n FragmentType,\n ProvideLang,\n Scale,\n SCALE_VALUES,\n SettableFragmentTypes,\n ShadowRootWithAdoptedStyleSheets,\n SYSTEM_VARIANT_VALUES,\n SystemContextCallback,\n SystemVariant,\n ThemeFragmentMap,\n ThemeKindProvider,\n} from './theme-interfaces.dev.js'\nexport type { ProvideLang, ThemeFragmentMap, Color, Scale, SystemVariant };\n/**\n * @element sp-theme\n * @attr {string} [lang=\"\"] - The language of the content scoped to this `sp-theme` element, see: <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang\" target=\"_blank\">MDN reference</a>.\n *\n * @slot - Content on which to apply the CSS Custom Properties defined by the current theme configuration\n */\nexport class Theme extends HTMLElement implements ThemeKindProvider {\n private static themeFragmentsByKind: ThemeFragmentMap = new Map();\n private static defaultFragments: Set<FragmentName> = new Set(['spectrum']);\n private static templateElement?: HTMLTemplateElement;\n private static instances: Set<Theme> = new Set();\n static VERSION = version;\n\n static get observedAttributes(): string[] {\n return ['color', 'scale', 'lang', 'dir', 'system'];\n }\n\n _dir: 'ltr' | 'rtl' | '' = '';\n\n override set dir(dir: 'ltr' | 'rtl' | '') {\n if (dir === this.dir) return;\n this.setAttribute('dir', dir);\n this._dir = dir;\n const targetDir = dir === 'rtl' ? dir : 'ltr';\n /* c8 ignore next 3 */\n this.trackedChildren.forEach((el) => {\n el.setAttribute('dir', targetDir);\n });\n }\n\n /**\n * Reading direction of the content scoped to this `sp-theme` element.\n * @type {\"ltr\" | \"rtl\" | \"\"}\n * @attr\n */\n override get dir(): 'ltr' | 'rtl' | '' {\n return this._dir;\n }\n\n protected attributeChangedCallback(\n attrName: SettableFragmentTypes | 'lang' | 'dir',\n old: string | null,\n value: string | null\n ): void {\n if (old === value) {\n return;\n }\n if (attrName === 'color') {\n this.color = value as Color;\n } else if (attrName === 'scale') {\n this.scale = value as Scale;\n } else if (attrName === 'lang' && !!value) {\n this.lang = value;\n this._provideContext();\n } else if (attrName === 'system') {\n this.system = value as SystemVariant;\n this._provideSystemContext();\n } else if (attrName === 'dir') {\n this.dir = value as 'ltr' | 'rtl' | '';\n }\n }\n private requestUpdate(): void {\n this.shouldAdoptStyles();\n }\n\n public override shadowRoot!: ShadowRootWithAdoptedStyleSheets;\n\n private _system: SystemVariant | '' = 'spectrum';\n /**\n * The Spectrum system that is applied to the content scoped to this `sp-theme` element.\n *\n * A value is requried.\n * @type {\"spectrum\" | \"express\" }\n * @attr\n */\n get system(): SystemVariant | '' {\n const systemFragments = Theme.themeFragmentsByKind.get('system');\n const { name } =\n (systemFragments && systemFragments.get('default')) || {};\n return this._system || (name as SystemVariant) || '';\n }\n\n set system(newValue: SystemVariant | '') {\n if (newValue === this._system) return;\n const system =\n !!newValue && SYSTEM_VARIANT_VALUES.includes(newValue)\n ? newValue\n : this.system;\n if (system !== this._system) {\n this._system = system;\n this.requestUpdate();\n }\n if (system) {\n this.setAttribute('system', system);\n /* c8 ignore next 3 */\n } else {\n this.removeAttribute('system');\n }\n }\n\n private _color: Color | '' = '';\n\n /**\n * The Spectrum color stops to apply to content scoped by this `sp-theme` element.\n *\n * A value is requried.\n * @type {\"lightest\" | \"light\" | \"dark\" | \"darkest\" | \"\"}\n * @attr\n */\n get color(): Color | '' {\n const themeFragments = Theme.themeFragmentsByKind.get('color');\n const { name } =\n (themeFragments && themeFragments.get('default')) || {};\n return this._color || (name as Color) || '';\n }\n\n set color(newValue: Color | '') {\n if (newValue === this._color) return;\n const color =\n !!newValue && COLOR_VALUES.includes(newValue)\n ? newValue\n : this.color;\n if (color !== this._color) {\n this._color = color;\n this.requestUpdate();\n }\n if (color) {\n this.setAttribute('color', color);\n } else {\n this.removeAttribute('color');\n }\n }\n\n private _scale: Scale | '' = '';\n\n /**\n * The Spectrum platform scale to apply to content scoped by this `sp-theme` element.\n *\n * A value is requried.\n * @type {\"medium\" | \"large\" | \"\"}\n * @attr\n */\n get scale(): Scale | '' {\n const themeFragments = Theme.themeFragmentsByKind.get('scale');\n const { name } =\n (themeFragments && themeFragments.get('default')) || {};\n return this._scale || (name as Scale) || '';\n }\n\n set scale(newValue: Scale | '') {\n if (newValue === this._scale) return;\n const scale =\n !!newValue && SCALE_VALUES.includes(newValue)\n ? newValue\n : this.scale;\n if (scale !== this._scale) {\n this._scale = scale;\n this.requestUpdate();\n }\n if (scale) {\n this.setAttribute('scale', scale);\n /* c8 ignore next 3 */\n } else {\n this.removeAttribute('scale');\n }\n }\n\n private get styles(): CSSResultGroup[] {\n const themeKinds: FragmentType[] = [\n ...Theme.themeFragmentsByKind.keys(),\n ];\n const getStyle = (\n fragments: FragmentMap,\n name: FragmentName,\n kind?: FragmentType\n ): CSSResultGroup | undefined => {\n const currentStyles =\n kind && kind !== 'system' && this.system !== 'spectrum'\n ? fragments.get(`${name}-${this.system}`)\n : fragments.get(name);\n // system=\"spectrum\" is available by default and doesn't need to be applied.\n const isAppliedFragment =\n name === 'spectrum' || !kind || this.hasAttribute(kind);\n if (currentStyles && isAppliedFragment) {\n return currentStyles.styles;\n }\n return;\n };\n const styles = themeKinds.reduce((acc, kind) => {\n const kindFragments = Theme.themeFragmentsByKind.get(\n kind\n ) as FragmentMap;\n let style: CSSResultGroup | undefined;\n if (kind === 'app' || kind === 'core') {\n style = getStyle(kindFragments, kind);\n } else {\n const { [kind]: name } = this;\n style = getStyle(kindFragments, <FragmentName>name, kind);\n }\n if (style) {\n acc.push(style);\n }\n return acc;\n }, [] as CSSResultGroup[]);\n const themeFragmentsByKind = Theme.themeFragmentsByKind;\n\n checkForIssues(\n this,\n this.system,\n this.color,\n this.scale,\n themeFragmentsByKind\n );\n\n return [...styles];\n }\n\n private static get template(): HTMLTemplateElement {\n if (!this.templateElement) {\n this.templateElement = document.createElement('template');\n this.templateElement.innerHTML = '<slot></slot>';\n }\n return this.templateElement;\n }\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const node = document.importNode(Theme.template.content, true);\n this.shadowRoot.appendChild(node);\n this.shouldAdoptStyles();\n this.addEventListener(\n 'sp-language-context',\n this._handleContextPresence as EventListener\n );\n this.addEventListener(\n 'sp-system-context',\n this._handleSystemContext as EventListener\n );\n\n this.updateComplete = this.__createDeferredPromise();\n }\n\n private _systemContextConsumers = new Map<\n HTMLElement,\n [SystemContextCallback, () => void]\n >();\n\n private _handleSystemContext(\n event: CustomEvent<{ callback: SystemContextCallback }>\n ): void {\n event.stopPropagation();\n\n const target = event.composedPath()[0] as HTMLElement;\n\n // Avoid duplicate registrations\n if (this._systemContextConsumers.has(target)) {\n return;\n }\n\n // Create an unsubscribe function\n const unsubscribe: () => void = () =>\n this._systemContextConsumers.delete(target);\n\n // Store the callback and unsubscribe function\n this._systemContextConsumers.set(target, [\n event.detail.callback,\n unsubscribe,\n ]);\n\n // Provide the context data\n const [callback] = this._systemContextConsumers.get(target) || [];\n if (callback) {\n callback(this.system, unsubscribe);\n }\n }\n\n public updateComplete!: Promise<boolean>;\n private __resolve!: (compelted: boolean) => void;\n\n private __createDeferredPromise(): Promise<boolean> {\n return new Promise((resolve) => {\n this.__resolve = resolve;\n });\n }\n\n protected connectedCallback(): void {\n // Note, first update/render handles styleElement so we only call this if\n // connected after first update.\n this.shouldAdoptStyles();\n\n // Add `this` to the instances array.\n Theme.instances.add(this);\n if (!this.hasAttribute('dir')) {\n let dirParent = ((this as HTMLElement).assignedSlot ||\n this.parentNode) as HTMLElement | DocumentFragment | ShadowRoot;\n while (\n dirParent !== document.documentElement &&\n !(dirParent instanceof Theme)\n ) {\n dirParent = ((dirParent as HTMLElement).assignedSlot || // step into the shadow DOM of the parent of a slotted node\n dirParent.parentNode || // DOM Element detected\n (dirParent as ShadowRoot).host) as\n | HTMLElement\n | DocumentFragment\n | ShadowRoot;\n }\n this.dir = dirParent.dir === 'rtl' ? dirParent.dir : 'ltr';\n }\n }\n\n protected disconnectedCallback(): void {\n // Remove `this` to the instances array.\n Theme.instances.delete(this);\n }\n\n public startManagingContentDirection(el: HTMLElement): void {\n this.trackedChildren.add(el);\n }\n\n public stopManagingContentDirection(el: HTMLElement): void {\n this.trackedChildren.delete(el);\n }\n\n private trackedChildren: Set<HTMLElement> = new Set();\n\n private _updateRequested = false;\n\n private async shouldAdoptStyles(): Promise<void> {\n if (!this._updateRequested) {\n this.updateComplete = this.__createDeferredPromise();\n this._updateRequested = true;\n this._updateRequested = await false;\n this.adoptStyles();\n this.__resolve(true);\n }\n }\n\n protected adoptStyles(): void {\n const styles = this.styles;\n const styleSheets: CSSStyleSheet[] = [];\n for (const style of styles) {\n styleSheets.push((style as CSSResult).styleSheet!);\n }\n this.shadowRoot.adoptedStyleSheets = styleSheets;\n }\n\n static registerThemeFragment(\n name: FragmentName,\n kind: FragmentType,\n styles: CSSResultGroup\n ): void {\n const fragmentMap = Theme.themeFragmentsByKind.get(kind) || new Map();\n if (fragmentMap.size === 0) {\n Theme.themeFragmentsByKind.set(kind, fragmentMap);\n // we're adding our first fragment for this kind, set as default\n fragmentMap.set('default', { name, styles });\n Theme.defaultFragments.add(name);\n }\n fragmentMap.set(name, { name, styles });\n Theme.instances.forEach((instance) => instance.shouldAdoptStyles());\n }\n\n private _contextConsumers = new Map<\n HTMLElement,\n [ProvideLang['callback'], () => void]\n >();\n\n /* c8 ignore next 5 */\n private _provideContext(): void {\n this._contextConsumers.forEach(([callback, unsubscribe]) =>\n callback(this.lang, unsubscribe)\n );\n }\n\n private _provideSystemContext(): void {\n this._systemContextConsumers.forEach(([callback, unsubscribe]) =>\n callback(this.system, unsubscribe)\n );\n }\n\n private _handleContextPresence(event: CustomEvent<ProvideLang>): void {\n event.stopPropagation();\n const target = event.composedPath()[0] as HTMLElement;\n /* c8 ignore next 3 */\n if (this._contextConsumers.has(target)) {\n return;\n }\n this._contextConsumers.set(target, [\n event.detail.callback,\n () => this._contextConsumers.delete(target),\n ]);\n const [callback, unsubscribe] =\n this._contextConsumers.get(target) || [];\n if (callback && unsubscribe) {\n callback(\n this.lang ||\n document.documentElement.lang ||\n navigator.language,\n unsubscribe\n );\n }\n }\n}\n\nfunction checkForIssues(\n instance: Theme,\n system: SystemVariant | '',\n color: Color | '',\n scale: Scale | '',\n themeFragmentsByKind: ThemeFragmentMap\n): void {\n if (window.__swc.DEBUG) {\n const issues: string[] = [];\n const checkForAttribute = (\n name: 'system' | 'color' | 'scale',\n resolvedValue: string,\n actualValue: string | null\n ): void => {\n const systemModifier =\n system && system !== 'spectrum' ? `-${system}` : '';\n if (!resolvedValue) {\n issues.push(\n `You have not explicitly set the \"${name}\" attribute and there is no default value on which to fallback.`\n );\n } else if (!actualValue) {\n issues.push(\n `You have not explicitly set the \"${name}\" attribute, the default value (\"${resolvedValue}\") is being used as a fallback.`\n );\n } else if (\n !themeFragmentsByKind\n .get(name)\n ?.get(\n resolvedValue +\n (name === 'system' ? '' : systemModifier)\n )\n ) {\n issues.push(\n `You have set \"${name}='${resolvedValue}'\" but the associated system fragment has not been loaded.`\n );\n }\n };\n\n if (['lightest', 'darkest'].includes(color || '')) {\n issues.push(\n `DEPRECATION NOTICE: Color \"lightest\" and \"darkest\" are deprecated. For more information, see: https://opensource.adobe.com/spectrum-web-components/tools/theme/`\n );\n }\n checkForAttribute('system', system, instance.getAttribute('system'));\n checkForAttribute('color', color, instance.getAttribute('color'));\n checkForAttribute('scale', scale, instance.getAttribute('scale'));\n\n if (issues.length) {\n window.__swc.warn(\n instance,\n 'You are leveraging an <sp-theme> element and the following issues may disrupt your theme delivery:',\n 'https://opensource.adobe.com/spectrum-web-components/components/theme/#example',\n { issues }\n );\n }\n }\n}\n"],
5
+ "mappings": ";AAaA,SAAS,eAAe;AACxB;AAAA,EAEI;AAAA,EAMA;AAAA,EAGA;AAAA,OAKG;AAQA,MAAM,SAAN,MAAM,eAAc,YAAyC;AAAA,EA2NhE,cAAc;AACV,UAAM;AAjNV,gBAA2B;AAkD3B,SAAQ,UAA8B;AAiCtC,SAAQ,SAAqB;AAiC7B,SAAQ,SAAqB;AA8G7B,SAAQ,0BAA0B,oBAAI,IAGpC;AA8EF,SAAQ,kBAAoC,oBAAI,IAAI;AAEpD,SAAQ,mBAAmB;AAqC3B,SAAQ,oBAAoB,oBAAI,IAG9B;AA3IE,SAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAClC,UAAM,OAAO,SAAS,WAAW,OAAM,SAAS,SAAS,IAAI;AAC7D,SAAK,WAAW,YAAY,IAAI;AAChC,SAAK,kBAAkB;AACvB,SAAK;AAAA,MACD;AAAA,MACA,KAAK;AAAA,IACT;AACA,SAAK;AAAA,MACD;AAAA,MACA,KAAK;AAAA,IACT;AAEA,SAAK,iBAAiB,KAAK,wBAAwB;AAAA,EACvD;AAAA,EApOA,WAAW,qBAA+B;AACtC,WAAO,CAAC,SAAS,SAAS,QAAQ,OAAO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1,2 @@
1
+ "use strict";import{version as d}from"@spectrum-web-components/base/src/version.js";import{COLOR_VALUES as h,SCALE_VALUES as u,SYSTEM_VARIANT_VALUES as p}from"./theme-interfaces.js";const o=class o extends HTMLElement{constructor(){super();this._dir="";this._system="spectrum";this._color="";this._scale="";this._systemContextConsumers=new Map;this.trackedChildren=new Set;this._updateRequested=!1;this._contextConsumers=new Map;this.attachShadow({mode:"open"});const e=document.importNode(o.template.content,!0);this.shadowRoot.appendChild(e),this.shouldAdoptStyles(),this.addEventListener("sp-language-context",this._handleContextPresence),this.addEventListener("sp-system-context",this._handleSystemContext),this.updateComplete=this.__createDeferredPromise()}static get observedAttributes(){return["color","scale","lang","dir","system"]}set dir(e){if(e===this.dir)return;this.setAttribute("dir",e),this._dir=e;const t=e==="rtl"?e:"ltr";this.trackedChildren.forEach(s=>{s.setAttribute("dir",t)})}get dir(){return this._dir}attributeChangedCallback(e,t,s){t!==s&&(e==="color"?this.color=s:e==="scale"?this.scale=s:e==="lang"&&s?(this.lang=s,this._provideContext()):e==="system"?(this.system=s,this._provideSystemContext()):e==="dir"&&(this.dir=s))}requestUpdate(){this.shouldAdoptStyles()}get system(){const e=o.themeFragmentsByKind.get("system"),{name:t}=e&&e.get("default")||{};return this._system||t||""}set system(e){if(e===this._system)return;const t=e&&p.includes(e)?e:this.system;t!==this._system&&(this._system=t,this.requestUpdate()),t?this.setAttribute("system",t):this.removeAttribute("system")}get color(){const e=o.themeFragmentsByKind.get("color"),{name:t}=e&&e.get("default")||{};return this._color||t||""}set color(e){if(e===this._color)return;const t=e&&h.includes(e)?e:this.color;t!==this._color&&(this._color=t,this.requestUpdate()),t?this.setAttribute("color",t):this.removeAttribute("color")}get scale(){const e=o.themeFragmentsByKind.get("scale"),{name:t}=e&&e.get("default")||{};return this._scale||t||""}set scale(e){if(e===this._scale)return;const t=e&&u.includes(e)?e:this.scale;t!==this._scale&&(this._scale=t,this.requestUpdate()),t?this.setAttribute("scale",t):this.removeAttribute("scale")}get styles(){const e=[...o.themeFragmentsByKind.keys()],t=(a,i,n)=>{const l=n&&n!=="system"&&this.system!=="spectrum"?a.get(`${i}-${this.system}`):a.get(i),m=i==="spectrum"||!n||this.hasAttribute(n);if(l&&m)return l.styles},s=e.reduce((a,i)=>{const n=o.themeFragmentsByKind.get(i);let l;if(i==="app"||i==="core")l=t(n,i);else{const{[i]:m}=this;l=t(n,m,i)}return l&&a.push(l),a},[]),r=o.themeFragmentsByKind;return this.system,this.color,this.scale,[...s]}static get template(){return this.templateElement||(this.templateElement=document.createElement("template"),this.templateElement.innerHTML="<slot></slot>"),this.templateElement}_handleSystemContext(e){e.stopPropagation();const t=e.composedPath()[0];if(this._systemContextConsumers.has(t))return;const s=()=>this._systemContextConsumers.delete(t);this._systemContextConsumers.set(t,[e.detail.callback,s]);const[r]=this._systemContextConsumers.get(t)||[];r&&r(this.system,s)}__createDeferredPromise(){return new Promise(e=>{this.__resolve=e})}connectedCallback(){if(this.shouldAdoptStyles(),o.instances.add(this),!this.hasAttribute("dir")){let e=this.assignedSlot||this.parentNode;for(;e!==document.documentElement&&!(e instanceof o);)e=e.assignedSlot||e.parentNode||e.host;this.dir=e.dir==="rtl"?e.dir:"ltr"}}disconnectedCallback(){o.instances.delete(this)}startManagingContentDirection(e){this.trackedChildren.add(e)}stopManagingContentDirection(e){this.trackedChildren.delete(e)}async shouldAdoptStyles(){this._updateRequested||(this.updateComplete=this.__createDeferredPromise(),this._updateRequested=!0,this._updateRequested=await!1,this.adoptStyles(),this.__resolve(!0))}adoptStyles(){const e=this.styles,t=[];for(const s of e)t.push(s.styleSheet);this.shadowRoot.adoptedStyleSheets=t}static registerThemeFragment(e,t,s){const r=o.themeFragmentsByKind.get(t)||new Map;r.size===0&&(o.themeFragmentsByKind.set(t,r),r.set("default",{name:e,styles:s}),o.defaultFragments.add(e)),r.set(e,{name:e,styles:s}),o.instances.forEach(a=>a.shouldAdoptStyles())}_provideContext(){this._contextConsumers.forEach(([e,t])=>e(this.lang,t))}_provideSystemContext(){this._systemContextConsumers.forEach(([e,t])=>e(this.system,t))}_handleContextPresence(e){e.stopPropagation();const t=e.composedPath()[0];if(this._contextConsumers.has(t))return;this._contextConsumers.set(t,[e.detail.callback,()=>this._contextConsumers.delete(t)]);const[s,r]=this._contextConsumers.get(t)||[];s&&r&&s(this.lang||document.documentElement.lang||navigator.language,r)}};o.themeFragmentsByKind=new Map,o.defaultFragments=new Set(["spectrum"]),o.instances=new Set,o.VERSION=d;export let Theme=o;function k(g,c,e,t,s){}
2
+ //# sourceMappingURL=Theme.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["Theme.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { CSSResult, CSSResultGroup } from '@spectrum-web-components/base';\nimport { version } from '@spectrum-web-components/base/src/version.js';\nimport {\n Color,\n COLOR_VALUES,\n FragmentMap,\n FragmentName,\n FragmentType,\n ProvideLang,\n Scale,\n SCALE_VALUES,\n SettableFragmentTypes,\n ShadowRootWithAdoptedStyleSheets,\n SYSTEM_VARIANT_VALUES,\n SystemContextCallback,\n SystemVariant,\n ThemeFragmentMap,\n ThemeKindProvider,\n} from './theme-interfaces.js';\nexport type { ProvideLang, ThemeFragmentMap, Color, Scale, SystemVariant };\n/**\n * @element sp-theme\n * @attr {string} [lang=\"\"] - The language of the content scoped to this `sp-theme` element, see: <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang\" target=\"_blank\">MDN reference</a>.\n *\n * @slot - Content on which to apply the CSS Custom Properties defined by the current theme configuration\n */\nexport class Theme extends HTMLElement implements ThemeKindProvider {\n private static themeFragmentsByKind: ThemeFragmentMap = new Map();\n private static defaultFragments: Set<FragmentName> = new Set(['spectrum']);\n private static templateElement?: HTMLTemplateElement;\n private static instances: Set<Theme> = new Set();\n static VERSION = version;\n\n static get observedAttributes(): string[] {\n return ['color', 'scale', 'lang', 'dir', 'system'];\n }\n\n _dir: 'ltr' | 'rtl' | '' = '';\n\n override set dir(dir: 'ltr' | 'rtl' | '') {\n if (dir === this.dir) return;\n this.setAttribute('dir', dir);\n this._dir = dir;\n const targetDir = dir === 'rtl' ? dir : 'ltr';\n /* c8 ignore next 3 */\n this.trackedChildren.forEach((el) => {\n el.setAttribute('dir', targetDir);\n });\n }\n\n /**\n * Reading direction of the content scoped to this `sp-theme` element.\n * @type {\"ltr\" | \"rtl\" | \"\"}\n * @attr\n */\n override get dir(): 'ltr' | 'rtl' | '' {\n return this._dir;\n }\n\n protected attributeChangedCallback(\n attrName: SettableFragmentTypes | 'lang' | 'dir',\n old: string | null,\n value: string | null\n ): void {\n if (old === value) {\n return;\n }\n if (attrName === 'color') {\n this.color = value as Color;\n } else if (attrName === 'scale') {\n this.scale = value as Scale;\n } else if (attrName === 'lang' && !!value) {\n this.lang = value;\n this._provideContext();\n } else if (attrName === 'system') {\n this.system = value as SystemVariant;\n this._provideSystemContext();\n } else if (attrName === 'dir') {\n this.dir = value as 'ltr' | 'rtl' | '';\n }\n }\n private requestUpdate(): void {\n this.shouldAdoptStyles();\n }\n\n public override shadowRoot!: ShadowRootWithAdoptedStyleSheets;\n\n private _system: SystemVariant | '' = 'spectrum';\n /**\n * The Spectrum system that is applied to the content scoped to this `sp-theme` element.\n *\n * A value is requried.\n * @type {\"spectrum\" | \"express\" }\n * @attr\n */\n get system(): SystemVariant | '' {\n const systemFragments = Theme.themeFragmentsByKind.get('system');\n const { name } =\n (systemFragments && systemFragments.get('default')) || {};\n return this._system || (name as SystemVariant) || '';\n }\n\n set system(newValue: SystemVariant | '') {\n if (newValue === this._system) return;\n const system =\n !!newValue && SYSTEM_VARIANT_VALUES.includes(newValue)\n ? newValue\n : this.system;\n if (system !== this._system) {\n this._system = system;\n this.requestUpdate();\n }\n if (system) {\n this.setAttribute('system', system);\n /* c8 ignore next 3 */\n } else {\n this.removeAttribute('system');\n }\n }\n\n private _color: Color | '' = '';\n\n /**\n * The Spectrum color stops to apply to content scoped by this `sp-theme` element.\n *\n * A value is requried.\n * @type {\"lightest\" | \"light\" | \"dark\" | \"darkest\" | \"\"}\n * @attr\n */\n get color(): Color | '' {\n const themeFragments = Theme.themeFragmentsByKind.get('color');\n const { name } =\n (themeFragments && themeFragments.get('default')) || {};\n return this._color || (name as Color) || '';\n }\n\n set color(newValue: Color | '') {\n if (newValue === this._color) return;\n const color =\n !!newValue && COLOR_VALUES.includes(newValue)\n ? newValue\n : this.color;\n if (color !== this._color) {\n this._color = color;\n this.requestUpdate();\n }\n if (color) {\n this.setAttribute('color', color);\n } else {\n this.removeAttribute('color');\n }\n }\n\n private _scale: Scale | '' = '';\n\n /**\n * The Spectrum platform scale to apply to content scoped by this `sp-theme` element.\n *\n * A value is requried.\n * @type {\"medium\" | \"large\" | \"\"}\n * @attr\n */\n get scale(): Scale | '' {\n const themeFragments = Theme.themeFragmentsByKind.get('scale');\n const { name } =\n (themeFragments && themeFragments.get('default')) || {};\n return this._scale || (name as Scale) || '';\n }\n\n set scale(newValue: Scale | '') {\n if (newValue === this._scale) return;\n const scale =\n !!newValue && SCALE_VALUES.includes(newValue)\n ? newValue\n : this.scale;\n if (scale !== this._scale) {\n this._scale = scale;\n this.requestUpdate();\n }\n if (scale) {\n this.setAttribute('scale', scale);\n /* c8 ignore next 3 */\n } else {\n this.removeAttribute('scale');\n }\n }\n\n private get styles(): CSSResultGroup[] {\n const themeKinds: FragmentType[] = [\n ...Theme.themeFragmentsByKind.keys(),\n ];\n const getStyle = (\n fragments: FragmentMap,\n name: FragmentName,\n kind?: FragmentType\n ): CSSResultGroup | undefined => {\n const currentStyles =\n kind && kind !== 'system' && this.system !== 'spectrum'\n ? fragments.get(`${name}-${this.system}`)\n : fragments.get(name);\n // system=\"spectrum\" is available by default and doesn't need to be applied.\n const isAppliedFragment =\n name === 'spectrum' || !kind || this.hasAttribute(kind);\n if (currentStyles && isAppliedFragment) {\n return currentStyles.styles;\n }\n return;\n };\n const styles = themeKinds.reduce((acc, kind) => {\n const kindFragments = Theme.themeFragmentsByKind.get(\n kind\n ) as FragmentMap;\n let style: CSSResultGroup | undefined;\n if (kind === 'app' || kind === 'core') {\n style = getStyle(kindFragments, kind);\n } else {\n const { [kind]: name } = this;\n style = getStyle(kindFragments, <FragmentName>name, kind);\n }\n if (style) {\n acc.push(style);\n }\n return acc;\n }, [] as CSSResultGroup[]);\n const themeFragmentsByKind = Theme.themeFragmentsByKind;\n\n checkForIssues(\n this,\n this.system,\n this.color,\n this.scale,\n themeFragmentsByKind\n );\n\n return [...styles];\n }\n\n private static get template(): HTMLTemplateElement {\n if (!this.templateElement) {\n this.templateElement = document.createElement('template');\n this.templateElement.innerHTML = '<slot></slot>';\n }\n return this.templateElement;\n }\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const node = document.importNode(Theme.template.content, true);\n this.shadowRoot.appendChild(node);\n this.shouldAdoptStyles();\n this.addEventListener(\n 'sp-language-context',\n this._handleContextPresence as EventListener\n );\n this.addEventListener(\n 'sp-system-context',\n this._handleSystemContext as EventListener\n );\n\n this.updateComplete = this.__createDeferredPromise();\n }\n\n private _systemContextConsumers = new Map<\n HTMLElement,\n [SystemContextCallback, () => void]\n >();\n\n private _handleSystemContext(\n event: CustomEvent<{ callback: SystemContextCallback }>\n ): void {\n event.stopPropagation();\n\n const target = event.composedPath()[0] as HTMLElement;\n\n // Avoid duplicate registrations\n if (this._systemContextConsumers.has(target)) {\n return;\n }\n\n // Create an unsubscribe function\n const unsubscribe: () => void = () =>\n this._systemContextConsumers.delete(target);\n\n // Store the callback and unsubscribe function\n this._systemContextConsumers.set(target, [\n event.detail.callback,\n unsubscribe,\n ]);\n\n // Provide the context data\n const [callback] = this._systemContextConsumers.get(target) || [];\n if (callback) {\n callback(this.system, unsubscribe);\n }\n }\n\n public updateComplete!: Promise<boolean>;\n private __resolve!: (compelted: boolean) => void;\n\n private __createDeferredPromise(): Promise<boolean> {\n return new Promise((resolve) => {\n this.__resolve = resolve;\n });\n }\n\n protected connectedCallback(): void {\n // Note, first update/render handles styleElement so we only call this if\n // connected after first update.\n this.shouldAdoptStyles();\n\n // Add `this` to the instances array.\n Theme.instances.add(this);\n if (!this.hasAttribute('dir')) {\n let dirParent = ((this as HTMLElement).assignedSlot ||\n this.parentNode) as HTMLElement | DocumentFragment | ShadowRoot;\n while (\n dirParent !== document.documentElement &&\n !(dirParent instanceof Theme)\n ) {\n dirParent = ((dirParent as HTMLElement).assignedSlot || // step into the shadow DOM of the parent of a slotted node\n dirParent.parentNode || // DOM Element detected\n (dirParent as ShadowRoot).host) as\n | HTMLElement\n | DocumentFragment\n | ShadowRoot;\n }\n this.dir = dirParent.dir === 'rtl' ? dirParent.dir : 'ltr';\n }\n }\n\n protected disconnectedCallback(): void {\n // Remove `this` to the instances array.\n Theme.instances.delete(this);\n }\n\n public startManagingContentDirection(el: HTMLElement): void {\n this.trackedChildren.add(el);\n }\n\n public stopManagingContentDirection(el: HTMLElement): void {\n this.trackedChildren.delete(el);\n }\n\n private trackedChildren: Set<HTMLElement> = new Set();\n\n private _updateRequested = false;\n\n private async shouldAdoptStyles(): Promise<void> {\n if (!this._updateRequested) {\n this.updateComplete = this.__createDeferredPromise();\n this._updateRequested = true;\n this._updateRequested = await false;\n this.adoptStyles();\n this.__resolve(true);\n }\n }\n\n protected adoptStyles(): void {\n const styles = this.styles;\n const styleSheets: CSSStyleSheet[] = [];\n for (const style of styles) {\n styleSheets.push((style as CSSResult).styleSheet!);\n }\n this.shadowRoot.adoptedStyleSheets = styleSheets;\n }\n\n static registerThemeFragment(\n name: FragmentName,\n kind: FragmentType,\n styles: CSSResultGroup\n ): void {\n const fragmentMap = Theme.themeFragmentsByKind.get(kind) || new Map();\n if (fragmentMap.size === 0) {\n Theme.themeFragmentsByKind.set(kind, fragmentMap);\n // we're adding our first fragment for this kind, set as default\n fragmentMap.set('default', { name, styles });\n Theme.defaultFragments.add(name);\n }\n fragmentMap.set(name, { name, styles });\n Theme.instances.forEach((instance) => instance.shouldAdoptStyles());\n }\n\n private _contextConsumers = new Map<\n HTMLElement,\n [ProvideLang['callback'], () => void]\n >();\n\n /* c8 ignore next 5 */\n private _provideContext(): void {\n this._contextConsumers.forEach(([callback, unsubscribe]) =>\n callback(this.lang, unsubscribe)\n );\n }\n\n private _provideSystemContext(): void {\n this._systemContextConsumers.forEach(([callback, unsubscribe]) =>\n callback(this.system, unsubscribe)\n );\n }\n\n private _handleContextPresence(event: CustomEvent<ProvideLang>): void {\n event.stopPropagation();\n const target = event.composedPath()[0] as HTMLElement;\n /* c8 ignore next 3 */\n if (this._contextConsumers.has(target)) {\n return;\n }\n this._contextConsumers.set(target, [\n event.detail.callback,\n () => this._contextConsumers.delete(target),\n ]);\n const [callback, unsubscribe] =\n this._contextConsumers.get(target) || [];\n if (callback && unsubscribe) {\n callback(\n this.lang ||\n document.documentElement.lang ||\n navigator.language,\n unsubscribe\n );\n }\n }\n}\n\nfunction checkForIssues(\n instance: Theme,\n system: SystemVariant | '',\n color: Color | '',\n scale: Scale | '',\n themeFragmentsByKind: ThemeFragmentMap\n): void {\n if (window.__swc.DEBUG) {\n const issues: string[] = [];\n const checkForAttribute = (\n name: 'system' | 'color' | 'scale',\n resolvedValue: string,\n actualValue: string | null\n ): void => {\n const systemModifier =\n system && system !== 'spectrum' ? `-${system}` : '';\n if (!resolvedValue) {\n issues.push(\n `You have not explicitly set the \"${name}\" attribute and there is no default value on which to fallback.`\n );\n } else if (!actualValue) {\n issues.push(\n `You have not explicitly set the \"${name}\" attribute, the default value (\"${resolvedValue}\") is being used as a fallback.`\n );\n } else if (\n !themeFragmentsByKind\n .get(name)\n ?.get(\n resolvedValue +\n (name === 'system' ? '' : systemModifier)\n )\n ) {\n issues.push(\n `You have set \"${name}='${resolvedValue}'\" but the associated system fragment has not been loaded.`\n );\n }\n };\n\n if (['lightest', 'darkest'].includes(color || '')) {\n issues.push(\n `DEPRECATION NOTICE: Color \"lightest\" and \"darkest\" are deprecated. For more information, see: https://opensource.adobe.com/spectrum-web-components/tools/theme/`\n );\n }\n checkForAttribute('system', system, instance.getAttribute('system'));\n checkForAttribute('color', color, instance.getAttribute('color'));\n checkForAttribute('scale', scale, instance.getAttribute('scale'));\n\n if (issues.length) {\n window.__swc.warn(\n instance,\n 'You are leveraging an <sp-theme> element and the following issues may disrupt your theme delivery:',\n 'https://opensource.adobe.com/spectrum-web-components/components/theme/#example',\n { issues }\n );\n }\n }\n}\n"],
5
+ "mappings": "aAaA,OAAS,WAAAA,MAAe,+CACxB,OAEI,gBAAAC,EAMA,gBAAAC,EAGA,yBAAAC,MAKG,wBAQA,MAAMC,EAAN,MAAMA,UAAc,WAAyC,CA2NhE,aAAc,CACV,MAAM,EAjNV,UAA2B,GAkD3B,KAAQ,QAA8B,WAiCtC,KAAQ,OAAqB,GAiC7B,KAAQ,OAAqB,GA8G7B,KAAQ,wBAA0B,IAAI,IAiFtC,KAAQ,gBAAoC,IAAI,IAEhD,KAAQ,iBAAmB,GAqC3B,KAAQ,kBAAoB,IAAI,IAxI5B,KAAK,aAAa,CAAE,KAAM,MAAO,CAAC,EAClC,MAAMC,EAAO,SAAS,WAAWD,EAAM,SAAS,QAAS,EAAI,EAC7D,KAAK,WAAW,YAAYC,CAAI,EAChC,KAAK,kBAAkB,EACvB,KAAK,iBACD,sBACA,KAAK,sBACT,EACA,KAAK,iBACD,oBACA,KAAK,oBACT,EAEA,KAAK,eAAiB,KAAK,wBAAwB,CACvD,CApOA,WAAW,oBAA+B,CACtC,MAAO,CAAC,QAAS,QAAS,OAAQ,MAAO,QAAQ,CACrD,CAIA,IAAa,IAAIC,EAAyB,CACtC,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,CAAW,EACxB,KAAK,kBAAkB,IAAID,CAAM,GAAK,CAAC,EACvCE,GAAYD,GACZC,EACI,KAAK,MACD,SAAS,gBAAgB,MACzB,UAAU,SACdD,CACJ,CAER,CACJ,EA7Ya5B,EACM,qBAAyC,IAAI,IADnDA,EAEM,iBAAsC,IAAI,IAAI,CAAC,UAAU,CAAC,EAFhEA,EAIM,UAAwB,IAAI,IAJlCA,EAKF,QAAUJ,EALd,WAAM,MAANI,EA+YP,SAASmC,EACLD,EACAvB,EACAE,EACAC,EACAW,EACI,CAkDR",
6
+ "names": ["version", "COLOR_VALUES", "SCALE_VALUES", "SYSTEM_VARIANT_VALUES", "_Theme", "node", "dir", "targetDir", "el", "attrName", "old", "value", "systemFragments", "name", "newValue", "system", "themeFragments", "color", "scale", "themeKinds", "getStyle", "fragments", "kind", "currentStyles", "isAppliedFragment", "styles", "acc", "kindFragments", "style", "themeFragmentsByKind", "event", "target", "unsubscribe", "callback", "resolve", "dirParent", "styleSheets", "fragmentMap", "instance", "checkForIssues"]
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ import { Theme } from "../Theme.dev.js";
3
+ import coreStyles from "./theme-core-tokens.css.js";
4
+ Theme.registerThemeFragment("express", "system", coreStyles);
5
+ //# sourceMappingURL=core-tokens.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["core-tokens.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { Theme } from '../Theme.dev.js'\n\nimport coreStyles from './theme-core-tokens.css.js';\n\nTheme.registerThemeFragment('express', 'system', coreStyles);\n"],
5
+ "mappings": ";AAYA,SAAS,aAAa;AAEtB,OAAO,gBAAgB;AAEvB,MAAM,sBAAsB,WAAW,UAAU,UAAU;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";import{Theme as e}from"../Theme.js";import r from"./theme-core-tokens.css.js";e.registerThemeFragment("express","system",r);
2
+ //# sourceMappingURL=core-tokens.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["core-tokens.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { Theme } from '../Theme.js';\n\nimport coreStyles from './theme-core-tokens.css.js';\n\nTheme.registerThemeFragment('express', 'system', coreStyles);\n"],
5
+ "mappings": "aAYA,OAAS,SAAAA,MAAa,cAEtB,OAAOC,MAAgB,6BAEvBD,EAAM,sBAAsB,UAAW,SAAUC,CAAU",
6
+ "names": ["Theme", "coreStyles"]
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ import { Theme } from "../Theme.dev.js";
3
+ import coreStyles from "./theme.css.js";
4
+ Theme.registerThemeFragment("express", "system", coreStyles);
5
+ //# sourceMappingURL=core.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["core.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { Theme } from '../Theme.dev.js'\n\nimport coreStyles from './theme.css.js';\n\nTheme.registerThemeFragment('express', 'system', coreStyles);\n"],
5
+ "mappings": ";AAYA,SAAS,aAAa;AAEtB,OAAO,gBAAgB;AAEvB,MAAM,sBAAsB,WAAW,UAAU,UAAU;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";import{Theme as e}from"../Theme.js";import r from"./theme.css.js";e.registerThemeFragment("express","system",r);
2
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["core.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { Theme } from '../Theme.js';\n\nimport coreStyles from './theme.css.js';\n\nTheme.registerThemeFragment('express', 'system', coreStyles);\n"],
5
+ "mappings": "aAYA,OAAS,SAAAA,MAAa,cAEtB,OAAOC,MAAgB,iBAEvBD,EAAM,sBAAsB,UAAW,SAAUC,CAAU",
6
+ "names": ["Theme", "coreStyles"]
7
+ }
@@ -0,0 +1,2 @@
1
+ declare const styles: import("@spectrum-web-components/base").CSSResult;
2
+ export default styles;