@castlabs/ui 7.16.0 → 7.18.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 (52) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/select-disabled.svg +1 -1
  3. package/dist/castlabs-ui-editor.common.js +56 -56
  4. package/dist/castlabs-ui-editor.common.js.map +1 -1
  5. package/dist/castlabs-ui-editor.css +1 -1
  6. package/dist/castlabs-ui-editor.umd.js +57 -57
  7. package/dist/castlabs-ui-editor.umd.js.map +1 -1
  8. package/dist/castlabs-ui.common.js +4 -4
  9. package/dist/castlabs-ui.common.js.map +1 -1
  10. package/dist/castlabs-ui.core.js +49 -1
  11. package/dist/castlabs-ui.css +1 -1
  12. package/dist/castlabs-ui.module.d.ts +4 -0
  13. package/dist/castlabs-ui.module.js +49 -1
  14. package/dist/castlabs-ui.umd.js +5 -5
  15. package/dist/castlabs-ui.umd.js.map +1 -1
  16. package/dist/{select-disabled.c5e07724.svg → select-disabled.1065ea4c.svg} +1 -1
  17. package/dist/select-disabled.dark.1065ea4c.svg +1 -0
  18. package/dist/select.dark.efd5244b.svg +1 -0
  19. package/package.json +15 -15
  20. package/src/components/ClBadge/style.variables.scss +1 -1
  21. package/src/components/ClButton/style.scss +18 -0
  22. package/src/components/ClDropdown/style.scss +1 -1
  23. package/src/components/ClDropzone/style.scss +1 -1
  24. package/src/components/ClHighlight/style.scss +2 -4
  25. package/src/components/ClList/style.variables.scss +5 -0
  26. package/src/components/ClPagination/style.scss +2 -3
  27. package/src/components/ClToggle/style.scss +1 -1
  28. package/src/components/ClWizard/style.scss +4 -4
  29. package/src/components/form/ClField/style.scss +1 -1
  30. package/src/components/form/ClFieldCheck/style.scss +23 -8
  31. package/src/components/form/ClFieldGroup/style.scss +1 -1
  32. package/src/components/form/ClFieldInput/style.scss +3 -2
  33. package/src/components/modal/ClModal/style.scss +3 -1
  34. package/src/components/navigation/ClNavSide/ClNavDrawer/style.scss +3 -5
  35. package/src/components/navigation/ClNavSide/ClNavItemDarkMode/style.scss +44 -0
  36. package/src/components/navigation/ClNavTop/style.scss +5 -1
  37. package/src/components/widget/ClPage/style.scss +1 -1
  38. package/src/styles/_global.scss +1 -0
  39. package/src/styles/abstracts/button.scss +10 -1
  40. package/src/styles/abstracts/color.scss +50 -13
  41. package/src/styles/abstracts/typography.scss +3 -1
  42. package/src/styles/layout/color.scss +0 -38
  43. package/src/styles/layout/grid.scss +4 -3
  44. package/src/styles/layout/meta.scss +1 -1
  45. package/src/styles/layout/typography.scss +1 -1
  46. package/src/styles/themes/dark.scss +160 -0
  47. package/src/styles/themes/dark.variables.scss +33 -0
  48. package/src/styles/ui.scss +6 -0
  49. package/types/castlabs-ui.module.d.ts +4 -0
  50. package/types/index.d.ts +135 -12
  51. /package/dist/fonts/{DM_Mono_500.03f95844.woff2 → DM_Mono_500.3f958442.woff2} +0 -0
  52. /package/dist/fonts/{fa-brands-400.05faf876.woff2 → fa-brands-400.5faf8763.woff2} +0 -0
@@ -1,4 +1,4 @@
1
- /* @castlabs/ui v7.16.0 */
1
+ /* @castlabs/ui v7.18.0 */
2
2
 
3
3
  /*!
4
4
  * Bootstrap v5.3.8 (https://getbootstrap.com/)
@@ -324,6 +324,7 @@ const CONST = {
324
324
  CLAY: '#cfc8c8',
325
325
  EGGSHELL: '#fbf9f2',
326
326
  HAZE: '#eeece6',
327
+ HAZEDARK: '#333947',
327
328
  HONEY: '#dc9404',
328
329
  LEAF: '#53965d',
329
330
  NIGHT: '#262a35',
@@ -1710,6 +1711,53 @@ function clSleep (ms) {
1710
1711
  return new Promise(resolve => setTimeout(resolve, ms))
1711
1712
  }
1712
1713
 
1714
+ // -----------------------------------------------------------------------------
1715
+ // --- themes ------------------------------------------------------------------
1716
+ // -----------------------------------------------------------------------------
1717
+
1718
+ function clThemeSetup () {
1719
+ let dark = null
1720
+
1721
+ // try to load settings
1722
+ try {
1723
+ switch (localStorage.getItem('themeDark')) {
1724
+ case 'true':
1725
+ dark = true
1726
+ break
1727
+ case 'false':
1728
+ dark = false
1729
+ break
1730
+ default:
1731
+ dark = null
1732
+ }
1733
+ } catch (e) {
1734
+ e.ignore?.()
1735
+ } // catch & ignore private mode
1736
+
1737
+ // use OS default if unknown
1738
+ if (dark === null) {
1739
+ const darkModeMql = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)')
1740
+ if (darkModeMql?.matches) {
1741
+ dark = true
1742
+ } else {
1743
+ dark = false
1744
+ }
1745
+ }
1746
+
1747
+ // persist value
1748
+ clThemeSetDark(dark)
1749
+
1750
+ return dark
1751
+ }
1752
+
1753
+ function clThemeSetDark (dark) {
1754
+ try {
1755
+ localStorage.setItem('themeDark', dark)
1756
+ } catch (e) {
1757
+ e.ignore?.()
1758
+ } // catch & ignore private mode
1759
+ }
1760
+
1713
1761
  const NBSP = '✺' // non-breakable space for searching substrings
1714
1762
 
1715
1763
  let cache = {}