@hkdigital/lib-core 0.3.14 → 0.4.3

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 (324) hide show
  1. package/README.md +18 -9
  2. package/dist/auth/errors.d.ts +1 -0
  3. package/dist/auth/errors.js +1 -0
  4. package/dist/{states → browser/navigation}/navigation.svelte.js +1 -1
  5. package/dist/browser/navigation.d.ts +1 -0
  6. package/dist/browser/navigation.js +1 -0
  7. package/dist/config/README.md +5 -5
  8. package/dist/config/generators/imagetools.d.ts +2 -0
  9. package/dist/config/generators/imagetools.js +23 -10
  10. package/dist/config/generators/vite.js +1 -1
  11. package/dist/config/imagetools.d.ts +5 -5
  12. package/dist/config/typedef.d.ts +11 -0
  13. package/dist/config/typedef.js +17 -0
  14. package/dist/design/README.md +211 -66
  15. package/dist/design/config/{design-config.d.ts → design-tokens.d.ts} +23 -10
  16. package/dist/design/config/design-tokens.js +107 -0
  17. package/dist/design/generators/index.d.ts +51 -0
  18. package/dist/design/generators/index.js +124 -0
  19. package/dist/design/index.d.ts +3 -4
  20. package/dist/design/index.js +24 -41
  21. package/dist/design/plugins/skeleton.d.ts +4 -2
  22. package/dist/design/plugins/skeleton.js +3 -2
  23. package/dist/design/themes/hkdev/components/buttons/button-text.css +38 -25
  24. package/dist/design/themes/hkdev/theme-ext.js +1 -1
  25. package/dist/design/utils/clamp.js +1 -1
  26. package/dist/design/utils/root-vars.d.ts +50 -39
  27. package/dist/design/utils/root-vars.js +127 -29
  28. package/dist/{classes/data → generic/data/classes}/IterableTree.js +2 -2
  29. package/dist/{classes/data → generic/data/classes}/Selector.js +1 -1
  30. package/dist/generic/data/classes/typedef.d.ts +24 -0
  31. package/dist/generic/data/classes/typedef.js +14 -0
  32. package/dist/generic/data.d.ts +2 -0
  33. package/dist/generic/data.js +2 -0
  34. package/dist/generic/errors.d.ts +2 -0
  35. package/dist/generic/errors.js +2 -0
  36. package/dist/generic/events.d.ts +1 -0
  37. package/dist/generic/events.js +1 -0
  38. package/dist/{classes/promise → generic/promises/classes}/HkPromise.d.ts +17 -7
  39. package/dist/{classes/promise → generic/promises/classes}/HkPromise.js +20 -10
  40. package/dist/generic/promises.d.ts +1 -0
  41. package/dist/generic/promises.js +1 -0
  42. package/dist/{classes/streams → generic/streaming/classes}/ServerEventsStore.d.ts +1 -1
  43. package/dist/{classes/streams → generic/streaming/classes}/ServerEventsStore.js +2 -2
  44. package/dist/generic/streaming.d.ts +3 -0
  45. package/dist/generic/streaming.js +3 -0
  46. package/dist/generic/typedef.d.ts +1 -0
  47. package/dist/generic/typedef.js +1 -0
  48. package/dist/index.js +1 -0
  49. package/dist/logging/errors.d.ts +7 -0
  50. package/dist/logging/errors.js +11 -0
  51. package/dist/logging/index.d.ts +2 -3
  52. package/dist/logging/index.js +3 -4
  53. package/dist/logging/internal/adapters/console.d.ts +1 -16
  54. package/dist/logging/internal/adapters/console.js +322 -14
  55. package/dist/logging/internal/adapters/formatting.d.ts +69 -0
  56. package/dist/logging/internal/adapters/formatting.js +395 -0
  57. package/dist/logging/internal/adapters/pino.js +128 -27
  58. package/dist/logging/internal/adapters/typedef.d.ts +30 -0
  59. package/dist/logging/internal/adapters/typedef.js +11 -0
  60. package/dist/logging/internal/factories/client.js +1 -1
  61. package/dist/logging/internal/factories/server.js +12 -2
  62. package/dist/logging/internal/logger/Logger.d.ts +9 -7
  63. package/dist/logging/internal/logger/Logger.js +44 -9
  64. package/dist/logging/internal/test-errors.d.ts +35 -0
  65. package/dist/logging/internal/test-errors.js +137 -0
  66. package/dist/network/cache/IndexedDbCache.d.ts +1 -1
  67. package/dist/network/cache/MemoryResponseCache.d.ts +5 -0
  68. package/dist/network/cache/MemoryResponseCache.js +5 -2
  69. package/dist/network/errors.d.ts +2 -0
  70. package/dist/network/errors.js +2 -0
  71. package/dist/network/http/caching.js +1 -1
  72. package/dist/network/http/errors.d.ts +2 -2
  73. package/dist/network/http/errors.js +5 -13
  74. package/dist/network/http/http-request.js +1 -1
  75. package/dist/network/http/json-request.js +1 -1
  76. package/dist/network/http/response.js +1 -1
  77. package/dist/network/http/url.js +1 -1
  78. package/dist/network/loaders/README.md +14 -7
  79. package/dist/network/loaders/audio/AudioScene.svelte.js +3 -2
  80. package/dist/network/loaders/image/ImageLoader.svelte.d.ts +2 -2
  81. package/dist/network/loaders/image/ImageLoader.svelte.js +1 -1
  82. package/dist/network/loaders/image/ImageScene.svelte.d.ts +2 -2
  83. package/dist/network/loaders/image/ImageScene.svelte.js +9 -8
  84. package/dist/network/loaders/image/ImageVariantsLoader.svelte.d.ts +5 -5
  85. package/dist/network/loaders/image/ImageVariantsLoader.svelte.js +14 -13
  86. package/dist/network/loaders/image/utils/index.d.ts +2 -2
  87. package/dist/network/loaders/image/utils/index.js +9 -12
  88. package/dist/network/loaders/typedef.d.ts +0 -9
  89. package/dist/network/loaders/typedef.js +0 -12
  90. package/dist/network/states/NetworkLoader.svelte.d.ts +1 -1
  91. package/dist/network/states/NetworkLoader.svelte.js +3 -2
  92. package/dist/services/index.d.ts +0 -2
  93. package/dist/services/index.js +0 -3
  94. package/dist/services/service-base/ServiceBase.d.ts +2 -2
  95. package/dist/services/service-base/ServiceBase.js +15 -11
  96. package/dist/services/service-base/typedef.d.ts +2 -31
  97. package/dist/services/service-base/typedef.js +3 -2
  98. package/dist/services/service-manager/ServiceManager.d.ts +3 -3
  99. package/dist/services/service-manager/ServiceManager.js +2 -2
  100. package/dist/services/service-manager/typedef.d.ts +3 -3
  101. package/dist/services/service-manager/typedef.js +3 -3
  102. package/dist/services/typedef.d.ts +2 -0
  103. package/dist/services/typedef.js +2 -0
  104. package/dist/{classes/svelte → state/classes}/loading-state-machine/LoadingStateMachine.svelte.d.ts +1 -1
  105. package/dist/{classes/svelte → state/classes}/loading-state-machine/LoadingStateMachine.svelte.js +1 -1
  106. package/dist/state/classes/subscribers-count/index.d.ts +1 -0
  107. package/dist/state/classes/subscribers-count/index.js +1 -0
  108. package/dist/state/classes.d.ts +3 -0
  109. package/dist/state/classes.js +3 -0
  110. package/dist/{util/svelte/state-context/index.d.ts → state/context/state-context.d.ts} +1 -1
  111. package/dist/{util/svelte/state-context/index.js → state/context/state-context.js} +4 -4
  112. package/dist/state/context.d.ts +1 -0
  113. package/dist/state/context.js +1 -0
  114. package/dist/state/stores.d.ts +1 -0
  115. package/dist/state/stores.js +1 -0
  116. package/dist/ui/README.md +49 -0
  117. package/dist/ui/components/button-group/index.d.ts +1 -0
  118. package/dist/ui/components/button-group/index.js +1 -0
  119. package/dist/ui/{primitives → components}/drag-drop/DragDropContext.svelte +1 -1
  120. package/dist/ui/{primitives → components}/drag-drop/DragDropContext.svelte.d.ts +1 -1
  121. package/dist/ui/{primitives → components}/drag-drop/Draggable.svelte +2 -2
  122. package/dist/ui/{primitives → components}/drag-drop/Draggable.svelte.d.ts +1 -1
  123. package/dist/ui/{primitives → components}/drag-drop/DropZone.svelte +4 -4
  124. package/dist/ui/{primitives → components}/drag-drop/DropZone.svelte.d.ts +3 -3
  125. package/dist/ui/{primitives → components}/drag-drop/DropZoneArea.svelte +3 -3
  126. package/dist/ui/{primitives → components}/drag-drop/DropZoneArea.svelte.d.ts +4 -4
  127. package/dist/ui/{primitives → components}/drag-drop/DropZoneList.svelte +3 -3
  128. package/dist/ui/{primitives → components}/drag-drop/DropZoneList.svelte.d.ts +3 -3
  129. package/dist/ui/{primitives → components}/drag-drop/drag-state.svelte.d.ts +11 -11
  130. package/dist/ui/{primitives → components}/drag-drop/drag-state.svelte.js +5 -5
  131. package/dist/ui/components/drag-drop/typedef.d.ts +2 -0
  132. package/dist/ui/components/drag-drop/typedef.js +2 -0
  133. package/dist/ui/components/game-box/GameBox.svelte +1 -1
  134. package/dist/ui/components/game-box/index.d.ts +1 -0
  135. package/dist/ui/components/game-box/index.js +1 -0
  136. package/dist/ui/components/grid-layers/index.d.ts +1 -0
  137. package/dist/ui/components/grid-layers/index.js +1 -0
  138. package/dist/ui/{primitives/layout → components}/grid-layers/util.js +1 -1
  139. package/dist/ui/components/hk-app-layout/HkAppLayout.state.svelte.d.ts +3 -3
  140. package/dist/ui/components/hk-app-layout/HkAppLayout.state.svelte.js +3 -4
  141. package/dist/ui/components/hk-app-layout/index.d.ts +1 -0
  142. package/dist/ui/components/hk-app-layout/index.js +1 -0
  143. package/dist/ui/components/image-box/ImageBox.svelte +2 -2
  144. package/dist/ui/components/image-box/ImageBox.svelte.d.ts +3 -3
  145. package/dist/ui/components/image-box/index.d.ts +1 -1
  146. package/dist/ui/components/presenter/ImageSlide.svelte +1 -1
  147. package/dist/ui/components/presenter/ImageSlide.svelte.d.ts +2 -2
  148. package/dist/ui/components/presenter/Presenter.state.svelte.d.ts +3 -3
  149. package/dist/ui/components/presenter/Presenter.state.svelte.js +1 -1
  150. package/dist/ui/components/presenter/Presenter.svelte +1 -1
  151. package/dist/ui/components/presenter/Presenter.svelte.d.ts +1 -1
  152. package/dist/ui/{primitives → components}/rows/panel-grid-row/PanelGridRow.svelte.d.ts +1 -1
  153. package/dist/ui/{primitives → components}/rows/panel-row-2/PanelRow2.svelte.d.ts +1 -1
  154. package/dist/ui/{primitives → components}/tab-bar/HkTabBar.state.svelte.d.ts +3 -3
  155. package/dist/ui/{primitives → components}/tab-bar/HkTabBar.state.svelte.js +4 -2
  156. package/dist/ui/{primitives → components}/tab-bar/HkTabBar.svelte +2 -2
  157. package/dist/ui/{primitives → components}/tab-bar/HkTabBar.svelte.d.ts +2 -2
  158. package/dist/ui/components/tab-bar/HkTabBarSelector.state.svelte.d.ts +19 -0
  159. package/dist/ui/{primitives → components}/tab-bar/HkTabBarSelector.state.svelte.js +2 -2
  160. package/dist/ui/{primitives → components}/tab-bar/HkTabBarSelector.svelte +1 -1
  161. package/dist/ui/{primitives → components}/tab-bar/HkTabBarSelector.svelte.d.ts +2 -2
  162. package/dist/ui/{primitives → components}/tab-bar/typedef.d.ts +1 -1
  163. package/dist/ui/{primitives → components}/tab-bar/typedef.js +1 -1
  164. package/dist/ui/components/typedef.d.ts +5 -0
  165. package/dist/ui/components/typedef.js +5 -0
  166. package/dist/ui/components/virtual-viewport/index.d.ts +1 -0
  167. package/dist/ui/components/virtual-viewport/index.js +1 -0
  168. package/dist/ui/components.d.ts +11 -0
  169. package/dist/ui/components.js +11 -0
  170. package/dist/ui/{primitives/hkdev → dev}/blocks/TextBlock.svelte +1 -1
  171. package/dist/ui/{primitives/debug → dev}/debug-panel-design-scaling/DebugPanelDesignScaling.svelte +8 -8
  172. package/dist/ui/dev.d.ts +3 -0
  173. package/dist/ui/dev.js +3 -0
  174. package/dist/ui/primitives/buttons/button/Button.svelte.d.ts +1 -1
  175. package/dist/ui/primitives/buttons/button-text/TextButton.svelte +1 -1
  176. package/dist/ui/primitives/typedef.d.ts +1 -0
  177. package/dist/ui/primitives/typedef.js +1 -0
  178. package/dist/ui/primitives.d.ts +5 -0
  179. package/dist/ui/primitives.js +5 -0
  180. package/dist/ui/typedef.d.ts +2 -0
  181. package/dist/ui/typedef.js +2 -0
  182. package/dist/util/array/index.js +1 -1
  183. package/dist/util/bases/base58.d.ts +3 -3
  184. package/dist/util/bases/base58.js +3 -3
  185. package/dist/util/compare/index.d.ts +4 -5
  186. package/dist/util/compare/index.js +3 -4
  187. package/dist/util/exceptions/index.js +1 -1
  188. package/dist/util/expect/arrays.d.ts +11 -11
  189. package/dist/util/expect/arrays.js +14 -6
  190. package/dist/util/expect/index.js +2 -2
  191. package/dist/util/expect/primitives.d.ts +6 -5
  192. package/dist/util/expect/primitives.js +15 -5
  193. package/dist/util/expect/url.d.ts +6 -5
  194. package/dist/util/expect/url.js +15 -5
  195. package/dist/util/function/index.d.ts +1 -14
  196. package/dist/util/index.d.ts +5 -0
  197. package/dist/util/index.js +13 -0
  198. package/dist/util/is/index.d.ts +3 -2
  199. package/dist/util/is/index.js +2 -1
  200. package/dist/util/iterate/index.d.ts +6 -8
  201. package/dist/util/iterate/index.js +5 -5
  202. package/dist/util/object/index.d.ts +1 -2
  203. package/dist/util/object/index.js +2 -3
  204. package/dist/util/ssr/index.d.ts +16 -0
  205. package/dist/util/ssr/index.js +44 -0
  206. package/dist/util/svelte/index.d.ts +1 -1
  207. package/dist/util/svelte/index.js +1 -1
  208. package/dist/util/time/index.d.ts +2 -2
  209. package/dist/util/time/index.js +1 -1
  210. package/dist/valibot/index.d.ts +1 -1
  211. package/dist/valibot/index.js +27 -1
  212. package/package.json +4 -4
  213. package/dist/assets/autospuiten/car-paint-picker/army-green.jpg +0 -0
  214. package/dist/assets/autospuiten/car-paint-picker/electric-blue.jpg +0 -0
  215. package/dist/assets/autospuiten/car-paint-picker/lemon-yellow.jpg +0 -0
  216. package/dist/assets/autospuiten/car-paint-picker/opaque-purple.jpg +0 -0
  217. package/dist/assets/autospuiten/car-paint-picker/rusty.jpg +0 -0
  218. package/dist/assets/autospuiten/car-paint-picker/sunset-orange.jpg +0 -0
  219. package/dist/assets/autospuiten/car-paint-picker/tomato-red.jpg +0 -0
  220. package/dist/assets/autospuiten/car-paint-picker.d.ts +0 -17
  221. package/dist/assets/autospuiten/car-paint-picker.js +0 -41
  222. package/dist/assets/autospuiten/labels.d.ts +0 -7
  223. package/dist/assets/autospuiten/labels.js +0 -7
  224. package/dist/classes/data/index.d.ts +0 -2
  225. package/dist/classes/data/index.js +0 -2
  226. package/dist/classes/event-emitter/index.d.ts +0 -1
  227. package/dist/classes/event-emitter/index.js +0 -2
  228. package/dist/classes/index.d.ts +0 -4
  229. package/dist/classes/index.js +0 -4
  230. package/dist/classes/promise/index.d.ts +0 -1
  231. package/dist/classes/promise/index.js +0 -1
  232. package/dist/classes/stores/index.d.ts +0 -1
  233. package/dist/classes/stores/index.js +0 -1
  234. package/dist/classes/streams/index.d.ts +0 -3
  235. package/dist/classes/streams/index.js +0 -3
  236. package/dist/classes/svelte/index.d.ts +0 -1
  237. package/dist/classes/svelte/index.js +0 -1
  238. package/dist/design/config/design-config.js +0 -73
  239. package/dist/design/tailwind-theme-extend.d.ts +0 -23
  240. package/dist/design/tailwind-theme-extend.js +0 -158
  241. package/dist/errors/index.d.ts +0 -5
  242. package/dist/errors/index.js +0 -5
  243. package/dist/logging/internal/factories/universal.d.ts +0 -9
  244. package/dist/logging/internal/factories/universal.js +0 -22
  245. package/dist/services/service-base/index.d.ts +0 -3
  246. package/dist/services/service-base/index.js +0 -3
  247. package/dist/states/index.d.ts +0 -1
  248. package/dist/states/index.js +0 -1
  249. package/dist/stores/index.d.ts +0 -1
  250. package/dist/stores/index.js +0 -1
  251. package/dist/typedef/index.d.ts +0 -4
  252. package/dist/typedef/index.js +0 -4
  253. package/dist/ui/primitives/debug/index.d.ts +0 -1
  254. package/dist/ui/primitives/debug/index.js +0 -1
  255. package/dist/ui/primitives/index.d.ts +0 -0
  256. package/dist/ui/primitives/index.js +0 -2
  257. package/dist/ui/primitives/layout/grid-layers/GridLayers.svelte__heightFrom__ +0 -372
  258. package/dist/ui/primitives/layout/index.d.ts +0 -1
  259. package/dist/ui/primitives/layout/index.js +0 -1
  260. package/dist/ui/primitives/tab-bar/HkTabBarSelector.state.svelte.d.ts +0 -19
  261. /package/dist/{errors → auth/errors}/jwt.d.ts +0 -0
  262. /package/dist/{errors → auth/errors}/jwt.js +0 -0
  263. /package/dist/{states → browser/navigation}/navigation.svelte.d.ts +0 -0
  264. /package/dist/{classes/data → generic/data/classes}/IterableTree.d.ts +0 -0
  265. /package/dist/{classes/data → generic/data/classes}/Selector.d.ts +0 -0
  266. /package/dist/{classes → generic}/data/typedef.d.ts +0 -0
  267. /package/dist/{classes → generic}/data/typedef.js +0 -0
  268. /package/dist/{errors → generic/errors}/generic.d.ts +0 -0
  269. /package/dist/{errors → generic/errors}/generic.js +0 -0
  270. /package/dist/{errors → generic/errors}/promise.d.ts +0 -0
  271. /package/dist/{errors → generic/errors}/promise.js +0 -0
  272. /package/dist/{classes/event-emitter → generic/events/classes}/EventEmitter.d.ts +0 -0
  273. /package/dist/{classes/event-emitter → generic/events/classes}/EventEmitter.js +0 -0
  274. /package/dist/{classes/streams → generic/streaming/classes}/LogTransformStream.d.ts +0 -0
  275. /package/dist/{classes/streams → generic/streaming/classes}/LogTransformStream.js +0 -0
  276. /package/dist/{classes/streams → generic/streaming/classes}/TimeStampSource.d.ts +0 -0
  277. /package/dist/{classes/streams → generic/streaming/classes}/TimeStampSource.js +0 -0
  278. /package/dist/logging/{internal/constants.d.ts → constants.d.ts} +0 -0
  279. /package/dist/logging/{internal/constants.js → constants.js} +0 -0
  280. /package/dist/logging/{internal/typedef.d.ts → typedef.d.ts} +0 -0
  281. /package/dist/logging/{internal/typedef.js → typedef.js} +0 -0
  282. /package/dist/{errors → network/errors}/api.d.ts +0 -0
  283. /package/dist/{errors → network/errors}/api.js +0 -0
  284. /package/dist/{errors → network/errors}/http.d.ts +0 -0
  285. /package/dist/{errors → network/errors}/http.js +0 -0
  286. /package/dist/{classes/svelte → state/classes}/finite-state-machine/FiniteStateMachine.svelte.d.ts +0 -0
  287. /package/dist/{classes/svelte → state/classes}/finite-state-machine/FiniteStateMachine.svelte.js +0 -0
  288. /package/dist/{classes/svelte → state/classes}/finite-state-machine/index.d.ts +0 -0
  289. /package/dist/{classes/svelte → state/classes}/finite-state-machine/index.js +0 -0
  290. /package/dist/{classes/svelte → state/classes}/loading-state-machine/constants.d.ts +0 -0
  291. /package/dist/{classes/svelte → state/classes}/loading-state-machine/constants.js +0 -0
  292. /package/dist/{classes/svelte → state/classes}/loading-state-machine/index.d.ts +0 -0
  293. /package/dist/{classes/svelte → state/classes}/loading-state-machine/index.js +0 -0
  294. /package/dist/{classes/stores → state/classes/subscribers-count}/SubscribersCount.d.ts +0 -0
  295. /package/dist/{classes/stores → state/classes/subscribers-count}/SubscribersCount.js +0 -0
  296. /package/dist/{typedef/context.d.ts → state/context/typedef.d.ts} +0 -0
  297. /package/dist/{typedef/context.js → state/context/typedef.js} +0 -0
  298. /package/dist/{stores → state/stores}/theme.d.ts +0 -0
  299. /package/dist/{stores → state/stores}/theme.js +0 -0
  300. /package/dist/ui/{primitives → components}/drag-drop/DragController.d.ts +0 -0
  301. /package/dist/ui/{primitives → components}/drag-drop/DragController.js +0 -0
  302. /package/dist/ui/{primitives → components}/drag-drop/actions.d.ts +0 -0
  303. /package/dist/ui/{primitives → components}/drag-drop/actions.js +0 -0
  304. /package/dist/ui/{primitives → components}/drag-drop/index.d.ts +0 -0
  305. /package/dist/ui/{primitives → components}/drag-drop/index.js +0 -0
  306. /package/dist/{typedef → ui/components/drag-drop/typedef}/drag.d.ts +0 -0
  307. /package/dist/{typedef → ui/components/drag-drop/typedef}/drag.js +0 -0
  308. /package/dist/{typedef → ui/components/drag-drop/typedef}/drop.d.ts +0 -0
  309. /package/dist/{typedef → ui/components/drag-drop/typedef}/drop.js +0 -0
  310. /package/dist/ui/{primitives → components}/drag-drop/util.d.ts +0 -0
  311. /package/dist/ui/{primitives → components}/drag-drop/util.js +0 -0
  312. /package/dist/ui/{primitives/layout → components}/grid-layers/GridLayers.svelte +0 -0
  313. /package/dist/ui/{primitives/layout → components}/grid-layers/GridLayers.svelte.d.ts +0 -0
  314. /package/dist/ui/{primitives/layout → components}/grid-layers/util.d.ts +0 -0
  315. /package/dist/ui/{primitives → components}/rows/index.d.ts +0 -0
  316. /package/dist/ui/{primitives → components}/rows/index.js +0 -0
  317. /package/dist/ui/{primitives → components}/rows/panel-grid-row/PanelGridRow.svelte +0 -0
  318. /package/dist/ui/{primitives → components}/rows/panel-row-2/PanelRow2.svelte +0 -0
  319. /package/dist/ui/{primitives → components}/tab-bar/index.d.ts +0 -0
  320. /package/dist/ui/{primitives → components}/tab-bar/index.js +0 -0
  321. /package/dist/ui/{primitives/hkdev → dev}/blocks/TextBlock.svelte.d.ts +0 -0
  322. /package/dist/ui/{primitives/hkdev → dev}/buttons/CheckButton.svelte +0 -0
  323. /package/dist/ui/{primitives/hkdev → dev}/buttons/CheckButton.svelte.d.ts +0 -0
  324. /package/dist/ui/{primitives/debug → dev}/debug-panel-design-scaling/DebugPanelDesignScaling.svelte.d.ts +0 -0
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Core library that we use to power up our SvelteKit projects
4
4
 
5
5
  This is a library for [SvelteKit](https://svelte.dev/) projects.
6
- It contains common code and components that we use to create our projects.
6
+ It contains common code, base components and documentation that help you with setting up a new project.
7
7
 
8
8
  ## Using the library
9
9
 
@@ -88,10 +88,19 @@ For detailed configuration options, see the [config documentation](./src/lib/con
88
88
 
89
89
  ### Import JS, Svelte files and Typedefs
90
90
 
91
- Most subfolders have an index.js that export all functionality and typedefs.
91
+ Main folders in lib have an index.js, but may also have a more specific export file e.g. http.js or cache.js (@see $lib/network).
92
92
 
93
- ```svelte
94
- import { CHAR } from '@hkdigital/lib-core/constants/regexp/index.js';
93
+ Main folders (should) have a typedef.js that can be used in JSdoc comments.
94
+
95
+ ```js
96
+ // Import Latin char constant for use in regular expressions
97
+ import { LCHAR } from '@hkdigital/lib-core/constants/regexp/index.js';
98
+ ```
99
+
100
+ ```js
101
+ /**
102
+ * @param {import('@hkdigital/lib-core/network/typedef.js').JsonGetOptions} JsonGetOptions
103
+ */
95
104
  ```
96
105
 
97
106
  ### Import CSS
@@ -122,18 +131,18 @@ export default {
122
131
  To build your library:
123
132
 
124
133
  ```bash
125
- npm run package
134
+ pnpm run package
126
135
  ```
127
136
 
128
- ## Building the showcase app
137
+ ## Running the showcase app
129
138
 
130
- To create a production version of your showcase app:
139
+ To use the showcase app that illustrates the code in this lib
131
140
 
132
141
  ```bash
133
- npm run build
142
+ pnpm run dev
134
143
  ```
135
144
 
136
- You can preview the production build with `npm run preview`.
145
+ You can preview the production build with `pnpm run preview`.
137
146
 
138
147
  > To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
139
148
 
@@ -0,0 +1 @@
1
+ export * from "./errors/jwt.js";
@@ -0,0 +1 @@
1
+ export * from './errors/jwt.js';
@@ -1,6 +1,6 @@
1
1
  import { onMount } from 'svelte';
2
2
 
3
- import { lazySingleton } from '../util/singleton/index.js';
3
+ import { lazySingleton } from '../../util/singleton/index.js';
4
4
 
5
5
  import { beforeNavigate, onNavigate, afterNavigate } from '$app/navigation';
6
6
 
@@ -0,0 +1 @@
1
+ export { nav } from "./navigation/navigation.svelte.js";
@@ -0,0 +1 @@
1
+ export { nav } from './navigation/navigation.svelte.js';
@@ -12,7 +12,7 @@ The `vite.js` provides generators for common Vite setups used across HKdigital p
12
12
  // vite.config.js
13
13
  import { defineConfig } from 'vitest/config';
14
14
  import { sveltekit } from '@sveltejs/kit/vite';
15
- import { generateViteConfig } from '@hkdigital/lib-sveltekit/config/vite.js';
15
+ import { generateViteConfig } from '@hkdigital/lib-core/config/vite.js';
16
16
 
17
17
  export default defineConfig(
18
18
  await generateViteConfig({
@@ -50,7 +50,7 @@ export default defineConfig(
50
50
  'import.meta.env.VITE_API_URL': JSON.stringify('https://api.example.com')
51
51
  },
52
52
  imagetoolsOptions: {
53
- widths: [640, 1024, 1536, 1920]
53
+ widths: [1920, 1536, 1024, 640]
54
54
  }
55
55
  })
56
56
  );
@@ -106,7 +106,7 @@ pnpm add -D vite-imagetools
106
106
  For TypeScript and JavaScript projects using VS Code or other TypeScript-aware editors, add to your `app.d.ts`:
107
107
 
108
108
  ```typescript
109
- import '@hkdigital/lib-sveltekit/config/imagetools.d.ts';
109
+ import '@hkdigital/lib-core/config/imagetools.d.ts';
110
110
  ```
111
111
 
112
112
  **Why this is needed:**
@@ -157,7 +157,7 @@ import { resolve } from 'path';
157
157
  import {
158
158
  generateDefaultDirectives,
159
159
  generateResponseConfigs
160
- } from '@hkdigital/lib-sveltekit/config/imagetools-config.js';
160
+ } from '@hkdigital/lib-core/config/imagetools-config.js';
161
161
 
162
162
  const packageJson = JSON.parse(
163
163
  readFileSync(resolve('./package.json'), 'utf-8')
@@ -189,7 +189,7 @@ export default defineConfig({
189
189
  // vite.config.js
190
190
  import { defineConfig } from 'vitest/config';
191
191
  import { sveltekit } from '@sveltejs/kit/vite';
192
- import { generateViteConfig } from '@hkdigital/lib-sveltekit/config/vite.js';
192
+ import { generateViteConfig } from '@hkdigital/lib-core/config/vite.js';
193
193
 
194
194
  export default defineConfig(
195
195
  await generateViteConfig()
@@ -4,6 +4,7 @@
4
4
  *
5
5
  * @param {object} [options]
6
6
  * @param {number[]} [options.widths=DEFAULT_WIDTHS]
7
+ * @param {number[]} [options.thumbnailWidth=DEFAULT_THUMBNAIL_WIDTH]
7
8
  *
8
9
  * @returns {(
9
10
  * entries: [string, string[]][]
@@ -11,6 +12,7 @@
11
12
  */
12
13
  export function generateResponseConfigs(options?: {
13
14
  widths?: number[];
15
+ thumbnailWidth?: number[];
14
16
  }): (entries: [string, string[]][]) => (Record<string, string | string[]>[]);
15
17
  /**
16
18
  * Configures and returns a function that can be used as
@@ -1,9 +1,12 @@
1
- const DEFAULT_WIDTHS = [640, 1024, 1536, 1920];
1
+ const DEFAULT_WIDTHS = [1920, 1536, 1024, 640];
2
+
3
+ const DEFAULT_THUMBNAIL_WIDTH = 150;
2
4
 
3
5
  const DEFAULT_PRESETS = {
4
6
  default: {
5
7
  format: 'avif',
6
- quality: '90'
8
+ quality: '90',
9
+ as: 'metadata'
7
10
  },
8
11
  render: {
9
12
  format: 'jpg',
@@ -44,6 +47,7 @@ const DEFAULT_PRESETS = {
44
47
  *
45
48
  * @param {object} [options]
46
49
  * @param {number[]} [options.widths=DEFAULT_WIDTHS]
50
+ * @param {number[]} [options.thumbnailWidth=DEFAULT_THUMBNAIL_WIDTH]
47
51
  *
48
52
  * @returns {(
49
53
  * entries: [string, string[]][]
@@ -70,21 +74,30 @@ export function generateResponseConfigs(options) {
70
74
 
71
75
  // @ts-ignore
72
76
  const responsiveConfig = entries.find(([key]) => key === 'responsive');
77
+ // console.log('responsiveConfig found:', !!responsiveConfig);
73
78
 
74
- if (!responsiveConfig) {
75
- // Directive 'responsive' was not set => return original config
79
+ const widths = options?.widths ?? DEFAULT_WIDTHS;
76
80
 
77
- return [configPairs];
81
+ // Always include the main image(s) and a thumbnail version
82
+ const thumbnailConfig = {
83
+ ...configPairs,
84
+ w: String(options?.thumbnailWidth ?? DEFAULT_THUMBNAIL_WIDTH)
85
+ };
78
86
 
79
- // Alternative: by returning undefined, the default resolveConfig is used
80
- // return undefined;
87
+ if (!responsiveConfig) {
88
+ // Directive 'responsive' was not set => return original + thumbnail
89
+ const originalConfig = configPairs; // No 'w' means original dimensions
90
+ // console.log('Returning original + thumbnail configs:', [originalConfig, thumbnailConfig]);
91
+ return [originalConfig, thumbnailConfig];
81
92
  }
82
93
 
83
- const widths = options?.widths ?? DEFAULT_WIDTHS;
84
-
85
- return widths.map((w) => {
94
+ // Directive 'responsive' was set => return responsive widths + thumbnail
95
+ const responsiveConfigs = widths.map((w) => {
86
96
  return { ...configPairs, w: String(w) };
87
97
  });
98
+ const result = [...responsiveConfigs, thumbnailConfig];
99
+ // console.log('Returning responsive + thumbnail configs:', result);
100
+ return result;
88
101
  };
89
102
  }
90
103
 
@@ -83,7 +83,7 @@ export async function generateViteConfig(options = {}) {
83
83
  new Date().toISOString()
84
84
  ),
85
85
  ...customDefines
86
- }
86
+ },
87
87
  };
88
88
 
89
89
  if (enableVitest) {
@@ -1,13 +1,13 @@
1
- type ImageMeta = import('../network/typedef.js').ImageMeta;
2
- type ImageSource = import('../network/typedef.js').ImageSource;
1
+ type ImageMeta = import('./typedef.js').ImageMeta;
2
+ type ImageSource = import('./typedef.js').ImageSource;
3
3
 
4
4
  declare module '*?responsive' {
5
- const out: ImageMeta[];
5
+ const out: ImageSource;
6
6
  export default out;
7
7
  }
8
8
 
9
9
  declare module '*&responsive' {
10
- const out: ImageMeta[];
10
+ const out: ImageSource;
11
11
  export default out;
12
12
  }
13
13
 
@@ -57,7 +57,7 @@ declare module '*?preset=savedata' {
57
57
  }
58
58
 
59
59
  declare module '*&preset=savedata' {
60
- const out: IImageSource;
60
+ const out: ImageSource;
61
61
  export default out;
62
62
  }
63
63
 
@@ -0,0 +1,11 @@
1
+ declare const _default: {};
2
+ export default _default;
3
+ export type ImageMeta = {
4
+ src: string;
5
+ width: number;
6
+ height: number;
7
+ };
8
+ /**
9
+ * Array of ImageMeta objects (always array format)
10
+ */
11
+ export type ImageSource = ImageMeta[];
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Configuration type definitions for imagetools and build-time image processing
3
+ */
4
+
5
+ /**
6
+ * @typedef {object} ImageMeta
7
+ * @property {string} src
8
+ * @property {number} width
9
+ * @property {number} height
10
+ */
11
+
12
+ /**
13
+ * @typedef {ImageMeta[]} ImageSource
14
+ * Array of ImageMeta objects (always array format)
15
+ */
16
+
17
+ export default {};
@@ -9,39 +9,109 @@ A comprehensive, responsive design system built for SvelteKit applications. This
9
9
  ```javascript
10
10
  // tailwind.config.js
11
11
  import {
12
- spacing,
13
- fontSize,
14
- borderRadius,
12
+ generateTailwindThemeExtensions,
13
+ designTokens,
15
14
  customUtilitiesPlugin
16
15
  } from '@hkdigital/lib-core/design/index.js';
17
16
 
17
+ const themeExtensions = generateTailwindThemeExtensions(designTokens);
18
+
19
+ /** @type {import('tailwindcss').Config} \*/
18
20
  export default {
21
+ // Include @hkdigital libraries in content so Tailwind processes
22
+ // their design system classes and components for proper styling
23
+ content: [
24
+ './node_modules/@hkdigital/**/*.{html,js,svelte}',
25
+ './src/**/*.{html,js,svelte}'
26
+ ],
19
27
  theme: {
20
- extend: {
21
- spacing,
22
- fontSize,
23
- borderRadius
24
- }
28
+ // Extend Tailwind's default theme using the design system tokens
29
+ extend: themeExtensions
25
30
  },
26
31
  plugins: [
32
+ // Generate custom utility classes like 'type-heading-h2'
27
33
  customUtilitiesPlugin
28
34
  ]
29
35
  };
30
36
  ```
31
37
 
32
- ```svelte
38
+ ```html
33
39
  <!-- +layout.svelte -->
34
40
  <script>
35
- import { DESIGN, CLAMPING, rootDesignVarsHTML } from '@hkdigital/lib-core/design';
41
+ import { designTokens, designTokensToRootCssVars } from '@hkdigital/lib-core/design/index.js';
36
42
  </script>
37
43
 
38
44
  <svelte:head>
39
- {@html rootDesignVarsHTML(DESIGN, CLAMPING)}
45
+ {@html designTokensToRootCssVars(designTokens)}
40
46
  </svelte:head>
41
47
 
42
48
  {@render children()}
43
49
  ```
44
50
 
51
+ ## Using Design System Classes in External CSS
52
+
53
+ When using design system utilities like `p-16up`, `bg-surface-300`, or `border-primary-500` in external CSS files (loaded via `<style src="./style.css"></style>`), you **must** include the `@reference` directive at the top of your CSS file.
54
+
55
+ **SVELTE preprocess**
56
+ You need svelte preprocess to process external CSS files in your svelte files!
57
+
58
+ ```html
59
+ <div data-page>
60
+ <p>Hello there!</p>
61
+ </div>
62
+
63
+ <style src="./style.css"></style>
64
+ ```
65
+
66
+ ### ✅ Correct Usage
67
+
68
+ ```css
69
+ /* style.css */
70
+ @reference '../../app.css';
71
+
72
+ [data-page] {
73
+ & .my-component {
74
+ @apply p-16up bg-surface-300 border border-primary-500;
75
+ }
76
+ }
77
+ ```
78
+
79
+ ### ❌ Common Mistake
80
+
81
+ ```css
82
+ /* style.css - MISSING @reference directive */
83
+ [data-page] {
84
+ & .my-component {
85
+ @apply p-16up bg-surface-300; /* ERROR: Cannot apply unknown utility class */
86
+ }
87
+ }
88
+ ```
89
+
90
+ ### Path Resolution
91
+
92
+ The `@reference` path must be relative to your CSS file's location:
93
+
94
+ E.g. `/src/routes/examples/style.css` → `@reference '../../app.css'`
95
+
96
+ ```svelte
97
+ <style>
98
+ [data-page] {
99
+ & .my-component {
100
+ @apply p-16up bg-surface-300 border border-primary-500;
101
+ }
102
+ }
103
+ </style>
104
+ ```
105
+
106
+ ### Troubleshooting
107
+
108
+ If you see errors like:
109
+ - `Cannot apply unknown utility class 'p-16up'`
110
+ - `Cannot apply unknown utility class 'bg-surface-300'`
111
+ - `Are you using CSS modules or similar and missing @reference?`
112
+
113
+ **Solution**: Add `@reference` directive with the correct relative path to your `app.css` file.
114
+
45
115
  ## Core Concepts
46
116
 
47
117
  ### Responsive Scaling System
@@ -162,6 +232,9 @@ Available for all text point sizes: `1ut/bt/ht`, `2ut/bt/ht`, `4ut/bt/ht`, `6ut/
162
232
 
163
233
  **Auto Contrast**: Each color includes automatic contrast colors for accessibility. Use `text-{color}-contrast-{shade}` for optimal readability.
164
234
 
235
+ **Skeleton**
236
+ This library is based on both Tailwind and Skeleton. See [Skeleton Design Colors](https://www.skeleton.dev/docs/design/colors).
237
+
165
238
  ## Component Styling
166
239
 
167
240
  Components use `data-` attributes with CSS custom properties:
@@ -185,7 +258,7 @@ import {
185
258
  getRootCssDesignWidth,
186
259
  getRootCssDesignHeight,
187
260
  getAllRootScalingVars
188
- } from '@hkdigital/lib-core/design';
261
+ } from '@hkdigital/lib-core/design/index.js';
189
262
 
190
263
  // Get current design dimensions
191
264
  const designWidth = getRootCssDesignWidth(); // 1024
@@ -199,7 +272,7 @@ const scales = getAllRootScalingVars();
199
272
  ### Clamp Utilities
200
273
 
201
274
  ```javascript
202
- import { clamp, getClampParams } from '@hkdigital/lib-core/design';
275
+ import { clamp, getClampParams } from '@hkdigital/lib-core/design/index.js';
203
276
 
204
277
  // Mathematical clamp function
205
278
  const value = clamp(0.5, 0.3, 2.0); // Returns 0.5 (clamped between 0.5 and 2.0)
@@ -212,7 +285,7 @@ const params = getClampParams('scale-ui');
212
285
  ### Component State Classes
213
286
 
214
287
  ```javascript
215
- import { toStateClasses } from '@hkdigital/lib-core/design';
288
+ import { toStateClasses } from '@hkdigital/lib-core/design/index.js';
216
289
 
217
290
  // Generate state classes from object
218
291
  const classes = toStateClasses({
@@ -236,10 +309,10 @@ const classes = toStateClasses({
236
309
  #### Viewport-Based Scaling
237
310
 
238
311
  ```javascript
239
- import { enableScalingUI } from '@hkdigital/lib-core/design';
312
+ import { enableScalingUI, designTokens } from '@hkdigital/lib-core/design/index.js';
240
313
 
241
314
  // Enable automatic viewport scaling
242
- const cleanup = enableScalingUI(DESIGN, CLAMPING);
315
+ const cleanup = enableScalingUI(designTokens.DESIGN, designTokens.CLAMPING);
243
316
 
244
317
  // Call cleanup when component is destroyed
245
318
  onDestroy(cleanup);
@@ -248,23 +321,23 @@ onDestroy(cleanup);
248
321
  #### Container-Based Scaling
249
322
 
250
323
  ```javascript
251
- import { enableContainerScaling } from '@hkdigital/lib-core/design';
324
+ import { enableContainerScaling, designTokens } from '@hkdigital/lib-core/design/index.js';
252
325
 
253
326
  let containerElement;
254
327
 
255
328
  // Enable scaling for specific container
256
329
  const cleanup = enableContainerScaling({
257
330
  container: containerElement,
258
- design: DESIGN,
259
- clamping: CLAMPING,
331
+ design: designTokens.DESIGN,
332
+ clamping: designTokens.CLAMPING,
260
333
  useResizeObserver: true
261
334
  });
262
335
 
263
336
  // Optional custom dimension getter
264
337
  const cleanupCustom = enableContainerScaling({
265
338
  container: containerElement,
266
- design: DESIGN,
267
- clamping: CLAMPING,
339
+ design: designTokens.DESIGN,
340
+ clamping: designTokens.CLAMPING,
268
341
  getDimensions: () => ({ width: 800, height: 600 })
269
342
  });
270
343
  ```
@@ -273,7 +346,7 @@ const cleanupCustom = enableContainerScaling({
273
346
  <!-- Svelte component example -->
274
347
  <script>
275
348
  import { onMount, onDestroy } from 'svelte';
276
- import { enableContainerScaling, DESIGN, CLAMPING } from '@hkdigital/lib-core/design';
349
+ import { enableContainerScaling, designTokens } from '@hkdigital/lib-core/design/index.js';
277
350
 
278
351
  let containerElement;
279
352
  let cleanup;
@@ -281,8 +354,8 @@ const cleanupCustom = enableContainerScaling({
281
354
  onMount(() => {
282
355
  cleanup = enableContainerScaling({
283
356
  container: containerElement,
284
- design: DESIGN,
285
- clamping: CLAMPING
357
+ design: designTokens.DESIGN,
358
+ clamping: designTokens.CLAMPING
286
359
  });
287
360
  });
288
361
 
@@ -302,59 +375,107 @@ const cleanupCustom = enableContainerScaling({
302
375
  ### Custom Design Configuration
303
376
 
304
377
  ```javascript
305
- // your-project/src/lib/design/design-config.js
306
- import {
307
- generateTextBasedSpacing,
308
- generateTextStyles
309
- } from '@hkdigital/lib-core/design';
310
-
311
- // Custom design dimensions
312
- export const CUSTOM_DESIGN = {
313
- width: 1440,
314
- height: 900
315
- };
378
+ // your-project/src/lib/design/design-tokens.js
379
+ export const designTokens = {
380
+ DESIGN: {
381
+ width: 1440,
382
+ height: 900
383
+ },
384
+
385
+ CLAMPING: {
386
+ ui: { min: 0.4, max: 1.8 },
387
+ textBase: { min: 0.8, max: 1.4 },
388
+ textHeading: { min: 0.8, max: 2.0 },
389
+ textUi: { min: 0.6, max: 1.2 }
390
+ },
316
391
 
317
- // Custom text sizes
318
- export const CUSTOM_TEXT_SIZES = {
319
- sm: { size: 12, lineHeight: 1.4 },
320
- md: { size: 16, lineHeight: 1.4 },
321
- lg: { size: 20, lineHeight: 1.4 }
392
+ TEXT_POINT_SIZES: [4, 8, 12, 16, 20, 24, 32],
393
+ VIEWPORT_POINT_SIZES: [10, 20, 30, 40, 50, 100, 200],
394
+
395
+ TEXT_BASE_SIZES: {
396
+ sm: { size: 12, lineHeight: 1.4 },
397
+ md: { size: 16, lineHeight: 1.4 },
398
+ lg: { size: 20, lineHeight: 1.4 }
399
+ },
400
+
401
+ TEXT_HEADING_SIZES: {
402
+ h1: { size: 36, lineHeight: 1.2 },
403
+ h2: { size: 30, lineHeight: 1.2 },
404
+ h3: { size: 26, lineHeight: 1.2 }
405
+ },
406
+
407
+ TEXT_UI_SIZES: {
408
+ sm: { size: 12, lineHeight: 1.2 },
409
+ md: { size: 14, lineHeight: 1.2 },
410
+ lg: { size: 16, lineHeight: 1.2 }
411
+ },
412
+
413
+ RADIUS_SIZES: {
414
+ none: '0px',
415
+ sm: { size: 8 },
416
+ md: { size: 16 },
417
+ lg: { size: 24 },
418
+ full: '9999px'
419
+ },
420
+
421
+ BORDER_WIDTH_SIZES: {
422
+ thin: { size: 1 },
423
+ normal: { size: 2 },
424
+ thick: { size: 3 }
425
+ },
426
+
427
+ STROKE_WIDTH_SIZES: {
428
+ thin: { size: 1 },
429
+ normal: { size: 2 },
430
+ thick: { size: 3 }
431
+ }
322
432
  };
323
433
 
324
- // Generate custom extensions
325
- export const customSpacing = generateTextBasedSpacing([8, 12, 16, 24, 32]);
326
- export const customFontSize = generateTextStyles(CUSTOM_TEXT_SIZES, 'base');
434
+ // your-project/tailwind.config.js
435
+ import { generateTailwindThemeExtensions, customUtilitiesPlugin } from '@hkdigital/lib-core/design/index.js';
436
+ import { designTokens } from './src/lib/design/design-tokens.js';
437
+
438
+ const themeExtensions = generateTailwindThemeExtensions(designTokens);
439
+
440
+ export default {
441
+ theme: {
442
+ extend: themeExtensions
443
+ },
444
+ plugins: [customUtilitiesPlugin]
445
+ };
327
446
  ```
328
447
 
329
448
  ### Available Generator Functions
330
449
 
450
+ Individual generator functions are available for advanced customization:
451
+
331
452
  ```javascript
332
453
  import {
333
- generateTextBasedSpacing, // ut/bt/ht spacing units
334
- generateViewportBasedSpacing, // up/wp/hp spacing units
335
- generateTextStyles, // Complete typography styles
336
- generateBorderRadiusStyles, // Border radius with scaling
337
- generateWidthStyles // Border/stroke width with scaling
338
- } from '@hkdigital/lib-core/design';
454
+ generateTailwindThemeExtensions, // Complete theme extension generator
455
+ generateTextBasedSpacing, // ut/bt/ht spacing units
456
+ generateViewportBasedSpacing, // up/wp/hp spacing units
457
+ generateTextStyles, // Complete typography styles
458
+ generateBorderRadiusStyles, // Border radius with scaling
459
+ generateWidthStyles // Border/stroke width with scaling
460
+ } from '@hkdigital/lib-core/design/index.js';
461
+
462
+ // Example: Generate only spacing for a custom configuration
463
+ const customSpacing = generateTextBasedSpacing([4, 8, 12, 16, 24]);
339
464
  ```
340
465
 
341
- ### Configuration Objects
466
+ ### Default Design Tokens
342
467
 
343
- All configuration objects are exported for customization:
468
+ The default design tokens are available for reference or as a starting point:
344
469
 
345
470
  ```javascript
346
- import {
347
- DESIGN, // { width: 1024, height: 768 }
348
- CLAMPING, // Min/max scale bounds
349
- TEXT_POINT_SIZES, // [1, 2, 4, 6, 8, 10, ...]
350
- VIEWPORT_POINT_SIZES, // [1, 2, 4, 5, 6, 10, ...]
351
- TEXT_BASE_SIZES, // { sm: {...}, md: {...}, lg: {...} }
352
- TEXT_HEADING_SIZES, // { h1: {...}, h2: {...}, ... }
353
- TEXT_UI_SIZES, // { sm: {...}, md: {...}, lg: {...} }
354
- RADIUS_SIZES, // Border radius configurations
355
- BORDER_WIDTH_SIZES, // Border width configurations
356
- STROKE_WIDTH_SIZES // Stroke width configurations
357
- } from '@hkdigital/lib-core/design';
471
+ import { designTokens } from '@hkdigital/lib-core/design/index.js';
472
+
473
+ console.log(designTokens.DESIGN); // { width: 1024, height: 768 }
474
+ console.log(designTokens.CLAMPING); // Min/max scale bounds
475
+ console.log(designTokens.TEXT_POINT_SIZES); // [1, 2, 4, 6, 8, 10, ...]
476
+ console.log(designTokens.VIEWPORT_POINT_SIZES); // [1, 2, 4, 5, 6, 10, ...]
477
+ console.log(designTokens.TEXT_BASE_SIZES); // { sm: {...}, md: {...}, lg: {...} }
478
+ // ... and all other token configurations
358
479
  ```
359
480
 
360
481
  ## Best practices
@@ -393,11 +514,35 @@ If migrating from the old structure:
393
514
 
394
515
  ```javascript
395
516
  // OLD
396
- import { DESIGN } from '$lib/design/design-config.js';
397
- import { customUtilitiesPlugin } from '$lib/design/skeleton.js';
517
+ import {
518
+ spacing,
519
+ fontSize,
520
+ borderRadius,
521
+ customUtilitiesPlugin
522
+ } from '@hkdigital/lib-core/design/index.js';
523
+
524
+ export default {
525
+ theme: {
526
+ extend: { spacing, fontSize, borderRadius }
527
+ },
528
+ plugins: [customUtilitiesPlugin]
529
+ };
398
530
 
399
531
  // NEW
400
- import { DESIGN, customUtilitiesPlugin } from '@hkdigital/lib-core/design';
532
+ import {
533
+ generateTailwindThemeExtensions,
534
+ designTokens,
535
+ customUtilitiesPlugin
536
+ } from '@hkdigital/lib-core/design/index.js';
537
+
538
+ const themeExtensions = generateTailwindThemeExtensions(designTokens);
539
+
540
+ export default {
541
+ theme: {
542
+ extend: themeExtensions
543
+ },
544
+ plugins: [customUtilitiesPlugin]
545
+ };
401
546
  ```
402
547
 
403
548
  ---