@easemate/web-kit 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/README.md +824 -0
  2. package/build/components/code/index.cjs +152 -0
  3. package/build/components/code/index.d.cts +11 -0
  4. package/build/components/code/index.d.ts +11 -0
  5. package/build/components/code/index.js +148 -0
  6. package/build/components/code/utils/highlight-api.cjs +18 -0
  7. package/build/components/code/utils/highlight-api.d.cts +7 -0
  8. package/build/components/code/utils/highlight-api.d.ts +7 -0
  9. package/build/components/code/utils/highlight-api.js +14 -0
  10. package/build/components/code/utils/syntax-grammars.cjs +62 -0
  11. package/build/components/code/utils/syntax-grammars.d.cts +7 -0
  12. package/build/components/code/utils/syntax-grammars.d.ts +7 -0
  13. package/build/components/code/utils/syntax-grammars.js +59 -0
  14. package/build/components/code/utils/syntax-highlighter-theme.cjs +27 -0
  15. package/build/components/code/utils/syntax-highlighter-theme.d.cts +3 -0
  16. package/build/components/code/utils/syntax-highlighter-theme.d.ts +3 -0
  17. package/build/components/code/utils/syntax-highlighter-theme.js +23 -0
  18. package/build/components/code/utils/syntax-highlighter-types.cjs +2 -0
  19. package/build/components/code/utils/syntax-highlighter-types.d.cts +12 -0
  20. package/build/components/code/utils/syntax-highlighter-types.d.ts +12 -0
  21. package/build/components/code/utils/syntax-highlighter-types.js +1 -0
  22. package/build/components/code/utils/syntax-tokenizer.cjs +63 -0
  23. package/build/components/code/utils/syntax-tokenizer.d.cts +3 -0
  24. package/build/components/code/utils/syntax-tokenizer.d.ts +3 -0
  25. package/build/components/code/utils/syntax-tokenizer.js +58 -0
  26. package/build/components/curve/bezier-conversion.cjs +23 -0
  27. package/build/components/curve/bezier-conversion.d.cts +2 -0
  28. package/build/components/curve/bezier-conversion.d.ts +2 -0
  29. package/build/components/curve/bezier-conversion.js +19 -0
  30. package/build/components/curve/canvas-controls.cjs +300 -0
  31. package/build/components/curve/canvas-controls.d.cts +12 -0
  32. package/build/components/curve/canvas-controls.d.ts +12 -0
  33. package/build/components/curve/canvas-controls.js +296 -0
  34. package/build/components/curve/canvas.cjs +1208 -0
  35. package/build/components/curve/canvas.d.cts +24 -0
  36. package/build/components/curve/canvas.d.ts +24 -0
  37. package/build/components/curve/canvas.js +1204 -0
  38. package/build/components/curve/constants.cjs +203 -0
  39. package/build/components/curve/constants.d.cts +23 -0
  40. package/build/components/curve/constants.d.ts +23 -0
  41. package/build/components/curve/constants.js +200 -0
  42. package/build/components/curve/controls.cjs +942 -0
  43. package/build/components/curve/controls.d.cts +37 -0
  44. package/build/components/curve/controls.d.ts +37 -0
  45. package/build/components/curve/controls.js +938 -0
  46. package/build/components/curve/index.cjs +335 -0
  47. package/build/components/curve/index.d.cts +31 -0
  48. package/build/components/curve/index.d.ts +31 -0
  49. package/build/components/curve/index.js +330 -0
  50. package/build/components/curve/output.cjs +141 -0
  51. package/build/components/curve/output.d.cts +19 -0
  52. package/build/components/curve/output.d.ts +19 -0
  53. package/build/components/curve/output.js +137 -0
  54. package/build/components/curve/styles.cjs +493 -0
  55. package/build/components/curve/styles.d.cts +6 -0
  56. package/build/components/curve/styles.d.ts +6 -0
  57. package/build/components/curve/styles.js +490 -0
  58. package/build/components/curve/svg-renderer.cjs +185 -0
  59. package/build/components/curve/svg-renderer.d.cts +9 -0
  60. package/build/components/curve/svg-renderer.d.ts +9 -0
  61. package/build/components/curve/svg-renderer.js +175 -0
  62. package/build/components/curve/toolbar.cjs +368 -0
  63. package/build/components/curve/toolbar.d.cts +26 -0
  64. package/build/components/curve/toolbar.d.ts +26 -0
  65. package/build/components/curve/toolbar.js +364 -0
  66. package/build/components/curve/types.cjs +10 -0
  67. package/build/components/curve/types.d.cts +33 -0
  68. package/build/components/curve/types.d.ts +33 -0
  69. package/build/components/curve/types.js +7 -0
  70. package/build/components/curve/utils.cjs +541 -0
  71. package/build/components/curve/utils.d.cts +33 -0
  72. package/build/components/curve/utils.d.ts +33 -0
  73. package/build/components/curve/utils.js +521 -0
  74. package/build/components/index.cjs +18 -0
  75. package/build/components/index.d.cts +2 -0
  76. package/build/components/index.d.ts +2 -0
  77. package/build/components/index.js +2 -0
  78. package/build/decorators/Component.cjs +127 -0
  79. package/build/decorators/Component.d.cts +28 -0
  80. package/build/decorators/Component.d.ts +28 -0
  81. package/build/decorators/Component.js +123 -0
  82. package/build/decorators/Listen.cjs +154 -0
  83. package/build/decorators/Listen.d.cts +18 -0
  84. package/build/decorators/Listen.d.ts +18 -0
  85. package/build/decorators/Listen.js +151 -0
  86. package/build/decorators/OutsideClick.cjs +64 -0
  87. package/build/decorators/OutsideClick.d.cts +16 -0
  88. package/build/decorators/OutsideClick.d.ts +16 -0
  89. package/build/decorators/OutsideClick.js +59 -0
  90. package/build/decorators/Prop.cjs +273 -0
  91. package/build/decorators/Prop.d.cts +22 -0
  92. package/build/decorators/Prop.d.ts +22 -0
  93. package/build/decorators/Prop.js +270 -0
  94. package/build/decorators/Query.cjs +79 -0
  95. package/build/decorators/Query.d.cts +27 -0
  96. package/build/decorators/Query.d.ts +27 -0
  97. package/build/decorators/Query.js +76 -0
  98. package/build/decorators/Watch.cjs +52 -0
  99. package/build/decorators/Watch.d.cts +11 -0
  100. package/build/decorators/Watch.d.ts +11 -0
  101. package/build/decorators/Watch.js +49 -0
  102. package/build/decorators/index.cjs +15 -0
  103. package/build/decorators/index.d.cts +6 -0
  104. package/build/decorators/index.d.ts +6 -0
  105. package/build/decorators/index.js +6 -0
  106. package/build/elements/button/index.cjs +214 -0
  107. package/build/elements/button/index.d.cts +11 -0
  108. package/build/elements/button/index.d.ts +11 -0
  109. package/build/elements/button/index.js +210 -0
  110. package/build/elements/checkbox/index.cjs +316 -0
  111. package/build/elements/checkbox/index.d.cts +14 -0
  112. package/build/elements/checkbox/index.d.ts +14 -0
  113. package/build/elements/checkbox/index.js +312 -0
  114. package/build/elements/color/index.cjs +154 -0
  115. package/build/elements/color/index.d.cts +18 -0
  116. package/build/elements/color/index.d.ts +18 -0
  117. package/build/elements/color/index.js +150 -0
  118. package/build/elements/color/picker.cjs +544 -0
  119. package/build/elements/color/picker.d.cts +37 -0
  120. package/build/elements/color/picker.d.ts +37 -0
  121. package/build/elements/color/picker.js +540 -0
  122. package/build/elements/color/utils.cjs +235 -0
  123. package/build/elements/color/utils.d.cts +37 -0
  124. package/build/elements/color/utils.d.ts +37 -0
  125. package/build/elements/color/utils.js +218 -0
  126. package/build/elements/dropdown/index.cjs +875 -0
  127. package/build/elements/dropdown/index.d.cts +30 -0
  128. package/build/elements/dropdown/index.d.ts +30 -0
  129. package/build/elements/dropdown/index.js +871 -0
  130. package/build/elements/field/index.cjs +82 -0
  131. package/build/elements/field/index.d.cts +4 -0
  132. package/build/elements/field/index.d.ts +4 -0
  133. package/build/elements/field/index.js +78 -0
  134. package/build/elements/icons/animation/chevron.cjs +57 -0
  135. package/build/elements/icons/animation/chevron.d.cts +10 -0
  136. package/build/elements/icons/animation/chevron.d.ts +10 -0
  137. package/build/elements/icons/animation/chevron.js +53 -0
  138. package/build/elements/icons/animation/clear.cjs +74 -0
  139. package/build/elements/icons/animation/clear.d.cts +3 -0
  140. package/build/elements/icons/animation/clear.d.ts +3 -0
  141. package/build/elements/icons/animation/clear.js +70 -0
  142. package/build/elements/icons/animation/grid.cjs +77 -0
  143. package/build/elements/icons/animation/grid.d.cts +8 -0
  144. package/build/elements/icons/animation/grid.d.ts +8 -0
  145. package/build/elements/icons/animation/grid.js +73 -0
  146. package/build/elements/icons/animation/loading.cjs +68 -0
  147. package/build/elements/icons/animation/loading.d.cts +3 -0
  148. package/build/elements/icons/animation/loading.d.ts +3 -0
  149. package/build/elements/icons/animation/loading.js +64 -0
  150. package/build/elements/icons/animation/snap.cjs +133 -0
  151. package/build/elements/icons/animation/snap.d.cts +8 -0
  152. package/build/elements/icons/animation/snap.d.ts +8 -0
  153. package/build/elements/icons/animation/snap.js +129 -0
  154. package/build/elements/icons/index.cjs +40 -0
  155. package/build/elements/icons/index.d.cts +24 -0
  156. package/build/elements/icons/index.d.ts +24 -0
  157. package/build/elements/icons/index.js +24 -0
  158. package/build/elements/icons/interface/anchor-add.cjs +35 -0
  159. package/build/elements/icons/interface/anchor-add.d.cts +3 -0
  160. package/build/elements/icons/interface/anchor-add.d.ts +3 -0
  161. package/build/elements/icons/interface/anchor-add.js +31 -0
  162. package/build/elements/icons/interface/anchor-remove.cjs +34 -0
  163. package/build/elements/icons/interface/anchor-remove.d.cts +3 -0
  164. package/build/elements/icons/interface/anchor-remove.d.ts +3 -0
  165. package/build/elements/icons/interface/anchor-remove.js +30 -0
  166. package/build/elements/icons/interface/arrow-up.cjs +30 -0
  167. package/build/elements/icons/interface/arrow-up.d.cts +3 -0
  168. package/build/elements/icons/interface/arrow-up.d.ts +3 -0
  169. package/build/elements/icons/interface/arrow-up.js +26 -0
  170. package/build/elements/icons/interface/arrows-vertical.cjs +30 -0
  171. package/build/elements/icons/interface/arrows-vertical.d.cts +3 -0
  172. package/build/elements/icons/interface/arrows-vertical.d.ts +3 -0
  173. package/build/elements/icons/interface/arrows-vertical.js +26 -0
  174. package/build/elements/icons/interface/bezier-angle.cjs +33 -0
  175. package/build/elements/icons/interface/bezier-angle.d.cts +3 -0
  176. package/build/elements/icons/interface/bezier-angle.d.ts +3 -0
  177. package/build/elements/icons/interface/bezier-angle.js +29 -0
  178. package/build/elements/icons/interface/bezier-distribute.cjs +34 -0
  179. package/build/elements/icons/interface/bezier-distribute.d.cts +3 -0
  180. package/build/elements/icons/interface/bezier-distribute.d.ts +3 -0
  181. package/build/elements/icons/interface/bezier-distribute.js +30 -0
  182. package/build/elements/icons/interface/bezier-length.cjs +31 -0
  183. package/build/elements/icons/interface/bezier-length.d.cts +3 -0
  184. package/build/elements/icons/interface/bezier-length.d.ts +3 -0
  185. package/build/elements/icons/interface/bezier-length.js +27 -0
  186. package/build/elements/icons/interface/bezier-mirror.cjs +31 -0
  187. package/build/elements/icons/interface/bezier-mirror.d.cts +3 -0
  188. package/build/elements/icons/interface/bezier-mirror.d.ts +3 -0
  189. package/build/elements/icons/interface/bezier-mirror.js +27 -0
  190. package/build/elements/icons/interface/bezier.cjs +26 -0
  191. package/build/elements/icons/interface/bezier.d.cts +3 -0
  192. package/build/elements/icons/interface/bezier.d.ts +3 -0
  193. package/build/elements/icons/interface/bezier.js +22 -0
  194. package/build/elements/icons/interface/check.cjs +30 -0
  195. package/build/elements/icons/interface/check.d.cts +3 -0
  196. package/build/elements/icons/interface/check.d.ts +3 -0
  197. package/build/elements/icons/interface/check.js +26 -0
  198. package/build/elements/icons/interface/circle-arrow-left.cjs +30 -0
  199. package/build/elements/icons/interface/circle-arrow-left.d.cts +3 -0
  200. package/build/elements/icons/interface/circle-arrow-left.d.ts +3 -0
  201. package/build/elements/icons/interface/circle-arrow-left.js +26 -0
  202. package/build/elements/icons/interface/circle-arrow-right.cjs +30 -0
  203. package/build/elements/icons/interface/circle-arrow-right.d.cts +3 -0
  204. package/build/elements/icons/interface/circle-arrow-right.d.ts +3 -0
  205. package/build/elements/icons/interface/circle-arrow-right.js +26 -0
  206. package/build/elements/icons/interface/code.cjs +30 -0
  207. package/build/elements/icons/interface/code.d.cts +3 -0
  208. package/build/elements/icons/interface/code.d.ts +3 -0
  209. package/build/elements/icons/interface/code.js +26 -0
  210. package/build/elements/icons/interface/dots.cjs +32 -0
  211. package/build/elements/icons/interface/dots.d.cts +3 -0
  212. package/build/elements/icons/interface/dots.d.ts +3 -0
  213. package/build/elements/icons/interface/dots.js +28 -0
  214. package/build/elements/icons/interface/mention.cjs +30 -0
  215. package/build/elements/icons/interface/mention.d.cts +3 -0
  216. package/build/elements/icons/interface/mention.d.ts +3 -0
  217. package/build/elements/icons/interface/mention.js +26 -0
  218. package/build/elements/icons/interface/minus.cjs +30 -0
  219. package/build/elements/icons/interface/minus.d.cts +3 -0
  220. package/build/elements/icons/interface/minus.d.ts +3 -0
  221. package/build/elements/icons/interface/minus.js +26 -0
  222. package/build/elements/icons/interface/picker.cjs +34 -0
  223. package/build/elements/icons/interface/picker.d.cts +3 -0
  224. package/build/elements/icons/interface/picker.d.ts +3 -0
  225. package/build/elements/icons/interface/picker.js +30 -0
  226. package/build/elements/icons/interface/plus.cjs +30 -0
  227. package/build/elements/icons/interface/plus.d.cts +3 -0
  228. package/build/elements/icons/interface/plus.d.ts +3 -0
  229. package/build/elements/icons/interface/plus.js +26 -0
  230. package/build/elements/icons/interface/settings.cjs +30 -0
  231. package/build/elements/icons/interface/settings.d.cts +3 -0
  232. package/build/elements/icons/interface/settings.d.ts +3 -0
  233. package/build/elements/icons/interface/settings.js +26 -0
  234. package/build/elements/index.cjs +62 -0
  235. package/build/elements/index.d.cts +22 -0
  236. package/build/elements/index.d.ts +22 -0
  237. package/build/elements/index.js +22 -0
  238. package/build/elements/input/index.cjs +273 -0
  239. package/build/elements/input/index.d.cts +17 -0
  240. package/build/elements/input/index.d.ts +17 -0
  241. package/build/elements/input/index.js +269 -0
  242. package/build/elements/logo/index.cjs +732 -0
  243. package/build/elements/logo/index.d.cts +17 -0
  244. package/build/elements/logo/index.d.ts +17 -0
  245. package/build/elements/logo/index.js +728 -0
  246. package/build/elements/monitor/fps.cjs +432 -0
  247. package/build/elements/monitor/fps.d.cts +21 -0
  248. package/build/elements/monitor/fps.d.ts +21 -0
  249. package/build/elements/monitor/fps.js +428 -0
  250. package/build/elements/monitor/index.cjs +670 -0
  251. package/build/elements/monitor/index.d.cts +112 -0
  252. package/build/elements/monitor/index.d.ts +112 -0
  253. package/build/elements/monitor/index.js +666 -0
  254. package/build/elements/number/index.cjs +173 -0
  255. package/build/elements/number/index.d.cts +19 -0
  256. package/build/elements/number/index.d.ts +19 -0
  257. package/build/elements/number/index.js +169 -0
  258. package/build/elements/origin/index.cjs +169 -0
  259. package/build/elements/origin/index.d.cts +12 -0
  260. package/build/elements/origin/index.d.ts +12 -0
  261. package/build/elements/origin/index.js +165 -0
  262. package/build/elements/popover/index.cjs +209 -0
  263. package/build/elements/popover/index.d.cts +19 -0
  264. package/build/elements/popover/index.d.ts +19 -0
  265. package/build/elements/popover/index.js +205 -0
  266. package/build/elements/radio/index.cjs +301 -0
  267. package/build/elements/radio/index.d.cts +13 -0
  268. package/build/elements/radio/index.d.ts +13 -0
  269. package/build/elements/radio/index.js +283 -0
  270. package/build/elements/radio/input.cjs +329 -0
  271. package/build/elements/radio/input.d.cts +15 -0
  272. package/build/elements/radio/input.d.ts +15 -0
  273. package/build/elements/radio/input.js +325 -0
  274. package/build/elements/radio/option.cjs +15 -0
  275. package/build/elements/radio/option.d.cts +3 -0
  276. package/build/elements/radio/option.d.ts +3 -0
  277. package/build/elements/radio/option.js +11 -0
  278. package/build/elements/shared.cjs +66 -0
  279. package/build/elements/shared.d.cts +40 -0
  280. package/build/elements/shared.d.ts +40 -0
  281. package/build/elements/shared.js +59 -0
  282. package/build/elements/slider/index.cjs +232 -0
  283. package/build/elements/slider/index.d.cts +20 -0
  284. package/build/elements/slider/index.d.ts +20 -0
  285. package/build/elements/slider/index.js +228 -0
  286. package/build/elements/state/index.cjs +681 -0
  287. package/build/elements/state/index.d.cts +86 -0
  288. package/build/elements/state/index.d.ts +86 -0
  289. package/build/elements/state/index.js +677 -0
  290. package/build/elements/toggle/index.cjs +151 -0
  291. package/build/elements/toggle/index.d.cts +9 -0
  292. package/build/elements/toggle/index.d.ts +9 -0
  293. package/build/elements/toggle/index.js +147 -0
  294. package/build/elements/tooltip/index.cjs +187 -0
  295. package/build/elements/tooltip/index.d.cts +17 -0
  296. package/build/elements/tooltip/index.d.ts +17 -0
  297. package/build/elements/tooltip/index.js +183 -0
  298. package/build/index.cjs +40 -0
  299. package/build/index.d.cts +6 -0
  300. package/build/index.d.ts +6 -0
  301. package/build/index.js +12 -0
  302. package/build/init.cjs +325 -0
  303. package/build/init.d.cts +157 -0
  304. package/build/init.d.ts +157 -0
  305. package/build/init.js +289 -0
  306. package/build/internal/component-loaders.cjs +206 -0
  307. package/build/internal/component-loaders.d.cts +52 -0
  308. package/build/internal/component-loaders.d.ts +52 -0
  309. package/build/internal/component-loaders.js +167 -0
  310. package/build/internal/fonts.cjs +128 -0
  311. package/build/internal/fonts.d.cts +32 -0
  312. package/build/internal/fonts.d.ts +32 -0
  313. package/build/internal/fonts.js +123 -0
  314. package/build/internal/lazy-load.cjs +89 -0
  315. package/build/internal/lazy-load.d.cts +32 -0
  316. package/build/internal/lazy-load.d.ts +32 -0
  317. package/build/internal/lazy-load.js +86 -0
  318. package/build/internal/style-inject.cjs +236 -0
  319. package/build/internal/style-inject.d.cts +44 -0
  320. package/build/internal/style-inject.d.ts +44 -0
  321. package/build/internal/style-inject.js +226 -0
  322. package/build/register.cjs +36 -0
  323. package/build/register.d.cts +32 -0
  324. package/build/register.d.ts +32 -0
  325. package/build/register.js +34 -0
  326. package/build/theme/index.cjs +452 -0
  327. package/build/theme/index.d.cts +146 -0
  328. package/build/theme/index.d.ts +146 -0
  329. package/build/theme/index.js +423 -0
  330. package/build/theme/presets.cjs +54 -0
  331. package/build/theme/presets.d.cts +19 -0
  332. package/build/theme/presets.d.ts +19 -0
  333. package/build/theme/presets.js +51 -0
  334. package/build/theme/registry.cjs +204 -0
  335. package/build/theme/registry.d.cts +99 -0
  336. package/build/theme/registry.d.ts +99 -0
  337. package/build/theme/registry.js +194 -0
  338. package/build/theme/tokens.cjs +148 -0
  339. package/build/theme/tokens.d.cts +163 -0
  340. package/build/theme/tokens.d.ts +163 -0
  341. package/build/theme/tokens.js +145 -0
  342. package/build/utils/dismiss-controller.cjs +77 -0
  343. package/build/utils/dismiss-controller.d.cts +14 -0
  344. package/build/utils/dismiss-controller.d.ts +14 -0
  345. package/build/utils/dismiss-controller.js +73 -0
  346. package/build/utils/index.cjs +18 -0
  347. package/build/utils/index.d.cts +3 -0
  348. package/build/utils/index.d.ts +3 -0
  349. package/build/utils/index.js +3 -0
  350. package/build/utils/outside-click.cjs +82 -0
  351. package/build/utils/outside-click.d.cts +18 -0
  352. package/build/utils/outside-click.d.ts +18 -0
  353. package/build/utils/outside-click.js +74 -0
  354. package/build/utils/template-helpers.cjs +39 -0
  355. package/build/utils/template-helpers.d.cts +13 -0
  356. package/build/utils/template-helpers.d.ts +13 -0
  357. package/build/utils/template-helpers.js +28 -0
  358. package/package.json +96 -0
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Font loading utilities.
3
+ */
4
+ /**
5
+ * Font source configuration.
6
+ */
7
+ export interface FontSource {
8
+ /** Source type */
9
+ source: 'google' | 'css';
10
+ /** For Google fonts: the family name */
11
+ family?: string;
12
+ /** For Google fonts: the css2 query params (e.g., 'wght@400..700') */
13
+ css2?: string;
14
+ /** For CSS source: the URL to the CSS file */
15
+ url?: string;
16
+ }
17
+ /**
18
+ * Font configuration map.
19
+ */
20
+ export type FontConfig = Record<string, FontSource>;
21
+ /**
22
+ * Default fonts used by the kit.
23
+ */
24
+ export declare const DEFAULT_FONTS: FontConfig;
25
+ /**
26
+ * Inject fonts based on configuration.
27
+ */
28
+ export declare function injectFonts(config: FontConfig | 'default' | false, preconnect?: boolean): void;
29
+ /**
30
+ * Remove all injected fonts.
31
+ */
32
+ export declare function removeFonts(config: FontConfig | 'default'): void;
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Font loading utilities.
3
+ */
4
+ import { isBrowser } from "./style-inject.js";
5
+ const FONT_LINK_ID_PREFIX = 'ease-webkit-font-';
6
+ const PRECONNECT_ID = 'ease-webkit-preconnect-google';
7
+ /**
8
+ * Default fonts used by the kit.
9
+ */
10
+ export const DEFAULT_FONTS = {
11
+ 'Instrument Sans': {
12
+ source: 'google',
13
+ family: 'Instrument Sans',
14
+ css2: 'opsz,wght@14..32,400..700'
15
+ },
16
+ 'Geist Mono': {
17
+ source: 'google',
18
+ family: 'Geist Mono',
19
+ css2: 'wght@100..900'
20
+ }
21
+ };
22
+ /**
23
+ * Generate a Google Fonts URL.
24
+ */
25
+ function buildGoogleFontUrl(family, css2) {
26
+ const encodedFamily = encodeURIComponent(family).replace(/%20/g, '+');
27
+ const params = css2 ? `:${css2}` : '';
28
+ return `https://fonts.googleapis.com/css2?family=${encodedFamily}${params}&display=swap`;
29
+ }
30
+ /**
31
+ * Inject preconnect links for Google Fonts.
32
+ */
33
+ function injectPreconnect() {
34
+ if (!isBrowser()) {
35
+ return;
36
+ }
37
+ // Check if already added
38
+ if (document.getElementById(PRECONNECT_ID)) {
39
+ return;
40
+ }
41
+ const head = document.head;
42
+ // preconnect to fonts.googleapis.com
43
+ const preconnect1 = document.createElement('link');
44
+ preconnect1.id = PRECONNECT_ID;
45
+ preconnect1.rel = 'preconnect';
46
+ preconnect1.href = 'https://fonts.googleapis.com';
47
+ head.appendChild(preconnect1);
48
+ // preconnect to fonts.gstatic.com
49
+ const preconnect2 = document.createElement('link');
50
+ preconnect2.rel = 'preconnect';
51
+ preconnect2.href = 'https://fonts.gstatic.com';
52
+ preconnect2.crossOrigin = 'anonymous';
53
+ head.appendChild(preconnect2);
54
+ }
55
+ /**
56
+ * Inject a font link.
57
+ */
58
+ function injectFontLink(id, url) {
59
+ if (!isBrowser()) {
60
+ return null;
61
+ }
62
+ const fullId = FONT_LINK_ID_PREFIX + id;
63
+ // Check if already injected
64
+ let link = document.getElementById(fullId);
65
+ if (link) {
66
+ return link;
67
+ }
68
+ link = document.createElement('link');
69
+ link.id = fullId;
70
+ link.rel = 'stylesheet';
71
+ link.href = url;
72
+ document.head.appendChild(link);
73
+ return link;
74
+ }
75
+ /**
76
+ * Remove a font link.
77
+ */
78
+ function removeFontLink(id) {
79
+ if (!isBrowser()) {
80
+ return;
81
+ }
82
+ const fullId = FONT_LINK_ID_PREFIX + id;
83
+ const link = document.getElementById(fullId);
84
+ if (link) {
85
+ link.remove();
86
+ }
87
+ }
88
+ /**
89
+ * Inject fonts based on configuration.
90
+ */
91
+ export function injectFonts(config, preconnect = true) {
92
+ if (config === false) {
93
+ return;
94
+ }
95
+ const fonts = config === 'default' ? DEFAULT_FONTS : config;
96
+ if (preconnect) {
97
+ // Check if any Google fonts are being loaded
98
+ const hasGoogleFonts = Object.values(fonts).some((f) => f.source === 'google');
99
+ if (hasGoogleFonts) {
100
+ injectPreconnect();
101
+ }
102
+ }
103
+ for (const [name, source] of Object.entries(fonts)) {
104
+ const id = name.toLowerCase().replace(/\s+/g, '-');
105
+ if (source.source === 'google' && source.family) {
106
+ const url = buildGoogleFontUrl(source.family, source.css2);
107
+ injectFontLink(id, url);
108
+ }
109
+ else if (source.source === 'css' && source.url) {
110
+ injectFontLink(id, source.url);
111
+ }
112
+ }
113
+ }
114
+ /**
115
+ * Remove all injected fonts.
116
+ */
117
+ export function removeFonts(config) {
118
+ const fonts = config === 'default' ? DEFAULT_FONTS : config;
119
+ for (const name of Object.keys(fonts)) {
120
+ const id = name.toLowerCase().replace(/\s+/g, '-');
121
+ removeFontLink(id);
122
+ }
123
+ }
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ /**
3
+ * Lazy loading utilities using MutationObserver.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createLazyLoader = createLazyLoader;
7
+ const component_loaders_1 = require("./component-loaders.cjs");
8
+ const style_inject_1 = require("./style-inject.cjs");
9
+ /**
10
+ * Create a lazy loader that auto-registers components when they appear in DOM.
11
+ */
12
+ function createLazyLoader(config = {}) {
13
+ if (!(0, style_inject_1.isBrowser)()) {
14
+ return {
15
+ dispose: () => { },
16
+ load: async () => { }
17
+ };
18
+ }
19
+ const { root = document, include, exclude, preload } = config;
20
+ // Determine which tags to watch
21
+ let watchTags = new Set([...component_loaders_1.WEB_KIT_ALL_TAGS]);
22
+ if (include && include.length > 0) {
23
+ watchTags = new Set(include.filter((tag) => component_loaders_1.WEB_KIT_ALL_TAGS.includes(tag)));
24
+ }
25
+ if (exclude && exclude.length > 0) {
26
+ for (const tag of exclude) {
27
+ watchTags.delete(tag);
28
+ }
29
+ }
30
+ // Track loaded components
31
+ const loaded = new Set();
32
+ // Load a component
33
+ const load = async (tag) => {
34
+ if (loaded.has(tag)) {
35
+ return;
36
+ }
37
+ const loader = component_loaders_1.COMPONENT_LOADERS[tag];
38
+ if (loader) {
39
+ loaded.add(tag);
40
+ await loader();
41
+ }
42
+ };
43
+ // Check if an element or its descendants need loading
44
+ const checkElement = (element) => {
45
+ const tagName = element.tagName.toLowerCase();
46
+ if (watchTags.has(tagName) && !loaded.has(tagName)) {
47
+ void load(tagName);
48
+ }
49
+ // Check children
50
+ for (const child of element.querySelectorAll('*')) {
51
+ const childTag = child.tagName.toLowerCase();
52
+ if (watchTags.has(childTag) && !loaded.has(childTag)) {
53
+ void load(childTag);
54
+ }
55
+ }
56
+ };
57
+ // Create observer
58
+ const observer = new MutationObserver((mutations) => {
59
+ for (const mutation of mutations) {
60
+ for (const node of mutation.addedNodes) {
61
+ if (node instanceof Element) {
62
+ checkElement(node);
63
+ }
64
+ }
65
+ }
66
+ });
67
+ // Start observing
68
+ const target = root instanceof Document ? root.documentElement : root;
69
+ observer.observe(target, {
70
+ childList: true,
71
+ subtree: true
72
+ });
73
+ // Check existing elements
74
+ checkElement(target);
75
+ // Preload specified tags
76
+ if (preload && preload.length > 0) {
77
+ for (const tag of preload) {
78
+ if (component_loaders_1.WEB_KIT_ALL_TAGS.includes(tag)) {
79
+ void load(tag);
80
+ }
81
+ }
82
+ }
83
+ return {
84
+ dispose: () => {
85
+ observer.disconnect();
86
+ },
87
+ load
88
+ };
89
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Lazy loading utilities using MutationObserver.
3
+ */
4
+ import { type WebKitTag } from "./component-loaders.cjs";
5
+ /**
6
+ * Lazy load configuration.
7
+ */
8
+ export interface LazyLoadConfig {
9
+ /** MutationObserver strategy */
10
+ strategy?: 'mutation';
11
+ /** Root element to observe (default: document) */
12
+ root?: Document | Element;
13
+ /** Tags to include in lazy loading */
14
+ include?: readonly string[];
15
+ /** Tags to exclude from lazy loading */
16
+ exclude?: readonly string[];
17
+ /** Tags to preload immediately */
18
+ preload?: readonly string[];
19
+ }
20
+ /**
21
+ * Lazy loader instance.
22
+ */
23
+ export interface LazyLoader {
24
+ /** Stop observing and cleanup */
25
+ dispose: () => void;
26
+ /** Manually load a component */
27
+ load: (tag: WebKitTag) => Promise<void>;
28
+ }
29
+ /**
30
+ * Create a lazy loader that auto-registers components when they appear in DOM.
31
+ */
32
+ export declare function createLazyLoader(config?: LazyLoadConfig): LazyLoader;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Lazy loading utilities using MutationObserver.
3
+ */
4
+ import { type WebKitTag } from "./component-loaders.js";
5
+ /**
6
+ * Lazy load configuration.
7
+ */
8
+ export interface LazyLoadConfig {
9
+ /** MutationObserver strategy */
10
+ strategy?: 'mutation';
11
+ /** Root element to observe (default: document) */
12
+ root?: Document | Element;
13
+ /** Tags to include in lazy loading */
14
+ include?: readonly string[];
15
+ /** Tags to exclude from lazy loading */
16
+ exclude?: readonly string[];
17
+ /** Tags to preload immediately */
18
+ preload?: readonly string[];
19
+ }
20
+ /**
21
+ * Lazy loader instance.
22
+ */
23
+ export interface LazyLoader {
24
+ /** Stop observing and cleanup */
25
+ dispose: () => void;
26
+ /** Manually load a component */
27
+ load: (tag: WebKitTag) => Promise<void>;
28
+ }
29
+ /**
30
+ * Create a lazy loader that auto-registers components when they appear in DOM.
31
+ */
32
+ export declare function createLazyLoader(config?: LazyLoadConfig): LazyLoader;
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Lazy loading utilities using MutationObserver.
3
+ */
4
+ import { COMPONENT_LOADERS, WEB_KIT_ALL_TAGS } from "./component-loaders.js";
5
+ import { isBrowser } from "./style-inject.js";
6
+ /**
7
+ * Create a lazy loader that auto-registers components when they appear in DOM.
8
+ */
9
+ export function createLazyLoader(config = {}) {
10
+ if (!isBrowser()) {
11
+ return {
12
+ dispose: () => { },
13
+ load: async () => { }
14
+ };
15
+ }
16
+ const { root = document, include, exclude, preload } = config;
17
+ // Determine which tags to watch
18
+ let watchTags = new Set([...WEB_KIT_ALL_TAGS]);
19
+ if (include && include.length > 0) {
20
+ watchTags = new Set(include.filter((tag) => WEB_KIT_ALL_TAGS.includes(tag)));
21
+ }
22
+ if (exclude && exclude.length > 0) {
23
+ for (const tag of exclude) {
24
+ watchTags.delete(tag);
25
+ }
26
+ }
27
+ // Track loaded components
28
+ const loaded = new Set();
29
+ // Load a component
30
+ const load = async (tag) => {
31
+ if (loaded.has(tag)) {
32
+ return;
33
+ }
34
+ const loader = COMPONENT_LOADERS[tag];
35
+ if (loader) {
36
+ loaded.add(tag);
37
+ await loader();
38
+ }
39
+ };
40
+ // Check if an element or its descendants need loading
41
+ const checkElement = (element) => {
42
+ const tagName = element.tagName.toLowerCase();
43
+ if (watchTags.has(tagName) && !loaded.has(tagName)) {
44
+ void load(tagName);
45
+ }
46
+ // Check children
47
+ for (const child of element.querySelectorAll('*')) {
48
+ const childTag = child.tagName.toLowerCase();
49
+ if (watchTags.has(childTag) && !loaded.has(childTag)) {
50
+ void load(childTag);
51
+ }
52
+ }
53
+ };
54
+ // Create observer
55
+ const observer = new MutationObserver((mutations) => {
56
+ for (const mutation of mutations) {
57
+ for (const node of mutation.addedNodes) {
58
+ if (node instanceof Element) {
59
+ checkElement(node);
60
+ }
61
+ }
62
+ }
63
+ });
64
+ // Start observing
65
+ const target = root instanceof Document ? root.documentElement : root;
66
+ observer.observe(target, {
67
+ childList: true,
68
+ subtree: true
69
+ });
70
+ // Check existing elements
71
+ checkElement(target);
72
+ // Preload specified tags
73
+ if (preload && preload.length > 0) {
74
+ for (const tag of preload) {
75
+ if (WEB_KIT_ALL_TAGS.includes(tag)) {
76
+ void load(tag);
77
+ }
78
+ }
79
+ }
80
+ return {
81
+ dispose: () => {
82
+ observer.disconnect();
83
+ },
84
+ load
85
+ };
86
+ }
@@ -0,0 +1,236 @@
1
+ "use strict";
2
+ /**
3
+ * Style injection utilities for runtime CSS application.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MAIN_CSS = exports.BASE_CSS = exports.RESET_CSS = exports.isBrowser = void 0;
7
+ exports.injectStyle = injectStyle;
8
+ exports.removeStyle = removeStyle;
9
+ exports.hasStyle = hasStyle;
10
+ exports.getPresetCSS = getPresetCSS;
11
+ exports.injectPreset = injectPreset;
12
+ exports.removePreset = removePreset;
13
+ const STYLE_ID_PREFIX = 'ease-webkit-';
14
+ /**
15
+ * Check if we're in a browser environment.
16
+ */
17
+ const isBrowser = () => typeof document !== 'undefined' && typeof window !== 'undefined';
18
+ exports.isBrowser = isBrowser;
19
+ /**
20
+ * Inject a style tag with the given CSS content.
21
+ */
22
+ function injectStyle(id, css, nonce) {
23
+ if (!(0, exports.isBrowser)()) {
24
+ return null;
25
+ }
26
+ const fullId = STYLE_ID_PREFIX + id;
27
+ // Check if already injected
28
+ let style = document.getElementById(fullId);
29
+ if (style) {
30
+ // Update content if different
31
+ if (style.textContent !== css) {
32
+ style.textContent = css;
33
+ }
34
+ return style;
35
+ }
36
+ // Create new style element
37
+ style = document.createElement('style');
38
+ style.id = fullId;
39
+ style.textContent = css;
40
+ if (nonce) {
41
+ style.nonce = nonce;
42
+ }
43
+ document.head.appendChild(style);
44
+ return style;
45
+ }
46
+ /**
47
+ * Remove an injected style tag.
48
+ */
49
+ function removeStyle(id) {
50
+ if (!(0, exports.isBrowser)()) {
51
+ return;
52
+ }
53
+ const fullId = STYLE_ID_PREFIX + id;
54
+ const style = document.getElementById(fullId);
55
+ if (style) {
56
+ style.remove();
57
+ }
58
+ }
59
+ /**
60
+ * Check if a style is already injected.
61
+ */
62
+ function hasStyle(id) {
63
+ if (!(0, exports.isBrowser)()) {
64
+ return false;
65
+ }
66
+ const fullId = STYLE_ID_PREFIX + id;
67
+ return document.getElementById(fullId) !== null;
68
+ }
69
+ // --------------------------
70
+ // Preset styles
71
+ // --------------------------
72
+ /**
73
+ * Minimal reset styles (box-sizing, etc.)
74
+ */
75
+ exports.RESET_CSS = `
76
+ @layer ease-reset {
77
+ *,
78
+ *::after,
79
+ *::before {
80
+ box-sizing: border-box;
81
+ transition-timing-function: cubic-bezier(0.25, 0, 0.5, 1);
82
+ }
83
+
84
+ :where(html) {
85
+ color-scheme: light dark;
86
+ hanging-punctuation: first allow-end last;
87
+ interpolate-size: allow-keywords;
88
+ scroll-behavior: smooth;
89
+ scrollbar-gutter: stable;
90
+ text-size-adjust: none;
91
+ -webkit-text-size-adjust: none;
92
+ -webkit-tap-highlight-color: transparent;
93
+ -webkit-font-smoothing: antialiased;
94
+ }
95
+
96
+ :where(html.translated-rtl) {
97
+ direction: rtl;
98
+ }
99
+
100
+ @media (prefers-reduced-motion: reduce) {
101
+ :where(html) {
102
+ scroll-behavior: auto;
103
+ }
104
+ }
105
+
106
+ :where(body) {
107
+ min-block-size: 100svb;
108
+ min-inline-size: 300px;
109
+ }
110
+
111
+ :where(canvas, img, picture, svg, video) {
112
+ block-size: auto;
113
+ border: none;
114
+ display: block;
115
+ max-inline-size: 100%;
116
+ }
117
+
118
+ :where(button) {
119
+ cursor: pointer;
120
+ user-select: none;
121
+ }
122
+
123
+ :where(textarea) {
124
+ resize: vertical;
125
+ }
126
+
127
+ :where(textarea:not([rows])) {
128
+ field-sizing: content;
129
+ }
130
+
131
+ :where(fieldset, iframe) {
132
+ border: none;
133
+ }
134
+
135
+ :where(p, li, h1, h2, h3, h4, h5, h6) {
136
+ overflow-wrap: break-word;
137
+ text-wrap: pretty;
138
+ margin: 0;
139
+ }
140
+
141
+ :where(abbr[title]) {
142
+ border: none;
143
+ text-decoration: none;
144
+ }
145
+
146
+ :where(cite) {
147
+ font-style: inherit;
148
+ }
149
+
150
+ :where(small) {
151
+ font-size: inherit;
152
+ }
153
+
154
+ :where(li, ol, ul) {
155
+ list-style: none;
156
+ }
157
+
158
+ :where(nav:not([role='list'])):is(ul, li, ol, ul) {
159
+ margin: 0;
160
+ padding: 0;
161
+ }
162
+
163
+ :where(dialog, [popover]) {
164
+ background: transparent;
165
+ border: none;
166
+ color: inherit;
167
+ margin: auto;
168
+ max-block-size: none;
169
+ max-inline-size: none;
170
+ position: fixed;
171
+ }
172
+
173
+ :where([popover]) {
174
+ inset: auto;
175
+ }
176
+
177
+ :where(dialog:not([open], [popover]), [popover]:not(:popover-open)) {
178
+ display: none;
179
+ }
180
+
181
+ :where([hidden]:not([hidden='until-found'])) {
182
+ display: none;
183
+ }
184
+ }
185
+ `.trim();
186
+ /**
187
+ * Base body/html styles for dark theme.
188
+ */
189
+ exports.BASE_CSS = `
190
+ html,
191
+ body {
192
+ background-color: var(--color-gray-900);
193
+ }
194
+
195
+ body {
196
+ font-family: var(--ease-font-family, 'Instrument Sans', sans-serif);
197
+ font-optical-sizing: auto;
198
+ font-weight: 400;
199
+ font-style: normal;
200
+ font-variation-settings: 'wdth' 100;
201
+ min-height: 100dvh;
202
+ color: var(--color-gray-600);
203
+ }
204
+ `.trim();
205
+ /**
206
+ * Combined main styles (reset + base).
207
+ */
208
+ exports.MAIN_CSS = `${exports.RESET_CSS}\n\n${exports.BASE_CSS}`;
209
+ /**
210
+ * Get CSS content for a preset.
211
+ */
212
+ function getPresetCSS(preset) {
213
+ switch (preset) {
214
+ case 'reset':
215
+ return exports.RESET_CSS;
216
+ case 'base':
217
+ return exports.BASE_CSS;
218
+ case 'main':
219
+ return exports.MAIN_CSS;
220
+ default:
221
+ return '';
222
+ }
223
+ }
224
+ /**
225
+ * Inject preset styles.
226
+ */
227
+ function injectPreset(preset, nonce) {
228
+ const css = getPresetCSS(preset);
229
+ return injectStyle(preset, css, nonce);
230
+ }
231
+ /**
232
+ * Remove preset styles.
233
+ */
234
+ function removePreset(preset) {
235
+ removeStyle(preset);
236
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Style injection utilities for runtime CSS application.
3
+ */
4
+ /**
5
+ * Check if we're in a browser environment.
6
+ */
7
+ export declare const isBrowser: () => boolean;
8
+ /**
9
+ * Inject a style tag with the given CSS content.
10
+ */
11
+ export declare function injectStyle(id: string, css: string, nonce?: string): HTMLStyleElement | null;
12
+ /**
13
+ * Remove an injected style tag.
14
+ */
15
+ export declare function removeStyle(id: string): void;
16
+ /**
17
+ * Check if a style is already injected.
18
+ */
19
+ export declare function hasStyle(id: string): boolean;
20
+ /**
21
+ * Minimal reset styles (box-sizing, etc.)
22
+ */
23
+ export declare const RESET_CSS: string;
24
+ /**
25
+ * Base body/html styles for dark theme.
26
+ */
27
+ export declare const BASE_CSS: string;
28
+ /**
29
+ * Combined main styles (reset + base).
30
+ */
31
+ export declare const MAIN_CSS: string;
32
+ export type StylePreset = 'reset' | 'base' | 'main';
33
+ /**
34
+ * Get CSS content for a preset.
35
+ */
36
+ export declare function getPresetCSS(preset: StylePreset): string;
37
+ /**
38
+ * Inject preset styles.
39
+ */
40
+ export declare function injectPreset(preset: StylePreset, nonce?: string): HTMLStyleElement | null;
41
+ /**
42
+ * Remove preset styles.
43
+ */
44
+ export declare function removePreset(preset: StylePreset): void;