squarex-ui-component-lib 1.0.4 → 1.0.5

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 (279) hide show
  1. package/dist/charts/components/ui/Avatar/Avatar.types.d.ts +1 -1
  2. package/dist/charts/components/ui/Avatar/Avatar.types.d.ts.map +1 -1
  3. package/dist/charts/components/ui/Avatar/AvatarBlock.d.ts +13 -0
  4. package/dist/charts/components/ui/Avatar/AvatarBlock.d.ts.map +1 -0
  5. package/dist/charts/components/ui/Avatar/AvatarGroup.d.ts +14 -0
  6. package/dist/charts/components/ui/Avatar/AvatarGroup.d.ts.map +1 -0
  7. package/dist/charts/components/ui/Avatar/index.d.ts +3 -1
  8. package/dist/charts/components/ui/Avatar/index.d.ts.map +1 -1
  9. package/dist/charts/components/ui/Breadcrumb/Breadcrumb.d.ts +1 -1
  10. package/dist/charts/components/ui/Breadcrumb/Breadcrumb.d.ts.map +1 -1
  11. package/dist/charts/components/ui/Button/Button.d.ts.map +1 -1
  12. package/dist/charts/components/ui/ButtonDanger/ButtonDanger.d.ts.map +1 -1
  13. package/dist/charts/components/ui/Cell/Cell.d.ts.map +1 -1
  14. package/dist/charts/components/ui/Checkbox/Checkbox.d.ts.map +1 -1
  15. package/dist/charts/components/ui/IconButton/IconButton.d.ts.map +1 -1
  16. package/dist/charts/components/ui/InputField/InputField.d.ts +5 -0
  17. package/dist/charts/components/ui/InputField/InputField.d.ts.map +1 -0
  18. package/dist/charts/components/ui/InputField/InputField.types.d.ts +27 -0
  19. package/dist/charts/components/ui/InputField/InputField.types.d.ts.map +1 -0
  20. package/dist/charts/components/ui/InputField/index.d.ts +3 -0
  21. package/dist/charts/components/ui/InputField/index.d.ts.map +1 -0
  22. package/dist/charts/components/ui/ListSearch/ListSearch.d.ts +5 -0
  23. package/dist/charts/components/ui/ListSearch/ListSearch.d.ts.map +1 -0
  24. package/dist/charts/components/ui/ListSearch/ListSearch.types.d.ts +2 -0
  25. package/dist/charts/components/ui/ListSearch/ListSearch.types.d.ts.map +1 -0
  26. package/dist/charts/components/ui/ListSearch/index.d.ts +3 -0
  27. package/dist/charts/components/ui/ListSearch/index.d.ts.map +1 -0
  28. package/dist/charts/components/ui/StatusIndicator/StatusIndicator.d.ts.map +1 -1
  29. package/dist/charts/components/ui/StatusIndicator/StatusIndicator.types.d.ts +1 -1
  30. package/dist/charts/components/ui/StatusIndicator/StatusIndicator.types.d.ts.map +1 -1
  31. package/dist/charts/components/ui/TextArea/TextArea.d.ts +0 -9
  32. package/dist/charts/components/ui/TextArea/TextArea.d.ts.map +1 -1
  33. package/dist/charts/components/ui/Toast/Toast.d.ts +11 -0
  34. package/dist/charts/components/ui/Toast/Toast.d.ts.map +1 -0
  35. package/dist/charts/components/ui/Toast/Toast.types.d.ts +2 -0
  36. package/dist/charts/components/ui/Toast/Toast.types.d.ts.map +1 -0
  37. package/dist/charts/components/ui/Toast/index.d.ts +3 -0
  38. package/dist/charts/components/ui/Toast/index.d.ts.map +1 -0
  39. package/dist/charts/components/ui/index.d.ts +8 -2
  40. package/dist/charts/components/ui/index.d.ts.map +1 -1
  41. package/dist/charts/index.d.ts +3 -0
  42. package/dist/charts/index.d.ts.map +1 -1
  43. package/dist/charts/tokens/core/breakpoints.d.ts +23 -0
  44. package/dist/charts/tokens/core/breakpoints.d.ts.map +1 -0
  45. package/dist/charts/tokens/core/colors.d.ts +186 -0
  46. package/dist/charts/tokens/core/colors.d.ts.map +1 -0
  47. package/dist/charts/tokens/core/index.d.ts +20 -0
  48. package/dist/charts/tokens/core/index.d.ts.map +1 -0
  49. package/dist/charts/tokens/core/spacing.d.ts +105 -0
  50. package/dist/charts/tokens/core/spacing.d.ts.map +1 -0
  51. package/dist/charts/tokens/core/typography.d.ts +52 -0
  52. package/dist/charts/tokens/core/typography.d.ts.map +1 -0
  53. package/dist/charts/tokens/index.d.ts +1646 -0
  54. package/dist/charts/tokens/index.d.ts.map +1 -0
  55. package/dist/charts/tokens/js/tokens.d.ts +482 -0
  56. package/dist/charts/tokens/js/tokens.d.ts.map +1 -0
  57. package/dist/charts/tokens/semantic/colors.d.ts +320 -0
  58. package/dist/charts/tokens/semantic/colors.d.ts.map +1 -0
  59. package/dist/charts/tokens/semantic/effects.d.ts +62 -0
  60. package/dist/charts/tokens/semantic/effects.d.ts.map +1 -0
  61. package/dist/charts/tokens/semantic/index.d.ts +18 -0
  62. package/dist/charts/tokens/semantic/index.d.ts.map +1 -0
  63. package/dist/charts/tokens/semantic/typography.d.ts +266 -0
  64. package/dist/charts/tokens/semantic/typography.d.ts.map +1 -0
  65. package/dist/charts/tokens/tailwind/config.d.ts +151 -0
  66. package/dist/charts/tokens/tailwind/config.d.ts.map +1 -0
  67. package/dist/charts/tokens/tailwind/index.d.ts +7 -0
  68. package/dist/charts/tokens/tailwind/index.d.ts.map +1 -0
  69. package/dist/charts/tokens/themes/dark.d.ts +308 -0
  70. package/dist/charts/tokens/themes/dark.d.ts.map +1 -0
  71. package/dist/charts/tokens/themes/index.d.ts +9 -0
  72. package/dist/charts/tokens/themes/index.d.ts.map +1 -0
  73. package/dist/charts/tokens/themes/light.d.ts +308 -0
  74. package/dist/charts/tokens/themes/light.d.ts.map +1 -0
  75. package/dist/charts/tokens/utils/cssVariables.d.ts +26 -0
  76. package/dist/charts/tokens/utils/cssVariables.d.ts.map +1 -0
  77. package/dist/charts/tokens/utils/hooks.d.ts +773 -0
  78. package/dist/charts/tokens/utils/hooks.d.ts.map +1 -0
  79. package/dist/charts/tokens/utils/index.d.ts +7 -0
  80. package/dist/charts/tokens/utils/index.d.ts.map +1 -0
  81. package/dist/charts/types/ui.d.ts +42 -1
  82. package/dist/charts/types/ui.d.ts.map +1 -1
  83. package/dist/components/ui/Avatar/Avatar.types.d.ts +1 -1
  84. package/dist/components/ui/Avatar/Avatar.types.d.ts.map +1 -1
  85. package/dist/components/ui/Avatar/AvatarBlock.d.ts +13 -0
  86. package/dist/components/ui/Avatar/AvatarBlock.d.ts.map +1 -0
  87. package/dist/components/ui/Avatar/AvatarGroup.d.ts +14 -0
  88. package/dist/components/ui/Avatar/AvatarGroup.d.ts.map +1 -0
  89. package/dist/components/ui/Avatar/index.d.ts +3 -1
  90. package/dist/components/ui/Avatar/index.d.ts.map +1 -1
  91. package/dist/components/ui/Breadcrumb/Breadcrumb.d.ts +1 -1
  92. package/dist/components/ui/Breadcrumb/Breadcrumb.d.ts.map +1 -1
  93. package/dist/components/ui/Button/Button.d.ts.map +1 -1
  94. package/dist/components/ui/ButtonDanger/ButtonDanger.d.ts.map +1 -1
  95. package/dist/components/ui/Cell/Cell.d.ts.map +1 -1
  96. package/dist/components/ui/Checkbox/Checkbox.d.ts.map +1 -1
  97. package/dist/components/ui/IconButton/IconButton.d.ts.map +1 -1
  98. package/dist/components/ui/InputField/InputField.d.ts +5 -0
  99. package/dist/components/ui/InputField/InputField.d.ts.map +1 -0
  100. package/dist/components/ui/InputField/InputField.types.d.ts +27 -0
  101. package/dist/components/ui/InputField/InputField.types.d.ts.map +1 -0
  102. package/dist/components/ui/InputField/index.d.ts +3 -0
  103. package/dist/components/ui/InputField/index.d.ts.map +1 -0
  104. package/dist/components/ui/ListSearch/ListSearch.d.ts +5 -0
  105. package/dist/components/ui/ListSearch/ListSearch.d.ts.map +1 -0
  106. package/dist/components/ui/ListSearch/ListSearch.types.d.ts +2 -0
  107. package/dist/components/ui/ListSearch/ListSearch.types.d.ts.map +1 -0
  108. package/dist/components/ui/ListSearch/index.d.ts +3 -0
  109. package/dist/components/ui/ListSearch/index.d.ts.map +1 -0
  110. package/dist/components/ui/StatusIndicator/StatusIndicator.d.ts.map +1 -1
  111. package/dist/components/ui/StatusIndicator/StatusIndicator.types.d.ts +1 -1
  112. package/dist/components/ui/StatusIndicator/StatusIndicator.types.d.ts.map +1 -1
  113. package/dist/components/ui/TextArea/TextArea.d.ts +0 -9
  114. package/dist/components/ui/TextArea/TextArea.d.ts.map +1 -1
  115. package/dist/components/ui/Toast/Toast.d.ts +11 -0
  116. package/dist/components/ui/Toast/Toast.d.ts.map +1 -0
  117. package/dist/components/ui/Toast/Toast.types.d.ts +2 -0
  118. package/dist/components/ui/Toast/Toast.types.d.ts.map +1 -0
  119. package/dist/components/ui/Toast/index.d.ts +3 -0
  120. package/dist/components/ui/Toast/index.d.ts.map +1 -0
  121. package/dist/components/ui/index.d.ts +8 -2
  122. package/dist/components/ui/index.d.ts.map +1 -1
  123. package/dist/index.css +1 -1
  124. package/dist/index.d.ts +3 -0
  125. package/dist/index.d.ts.map +1 -1
  126. package/dist/index.esm.css +1 -1
  127. package/dist/index.esm.js +1 -1
  128. package/dist/index.esm.js.map +1 -1
  129. package/dist/index.js +1 -1
  130. package/dist/index.js.map +1 -1
  131. package/dist/tokens/core/breakpoints.d.ts +23 -0
  132. package/dist/tokens/core/breakpoints.d.ts.map +1 -0
  133. package/dist/tokens/core/colors.d.ts +186 -0
  134. package/dist/tokens/core/colors.d.ts.map +1 -0
  135. package/dist/tokens/core/index.d.ts +20 -0
  136. package/dist/tokens/core/index.d.ts.map +1 -0
  137. package/dist/tokens/core/spacing.d.ts +105 -0
  138. package/dist/tokens/core/spacing.d.ts.map +1 -0
  139. package/dist/tokens/core/typography.d.ts +52 -0
  140. package/dist/tokens/core/typography.d.ts.map +1 -0
  141. package/dist/tokens/index.d.ts +1646 -0
  142. package/dist/tokens/index.d.ts.map +1 -0
  143. package/dist/tokens/js/tokens.d.ts +482 -0
  144. package/dist/tokens/js/tokens.d.ts.map +1 -0
  145. package/dist/tokens/semantic/colors.d.ts +320 -0
  146. package/dist/tokens/semantic/colors.d.ts.map +1 -0
  147. package/dist/tokens/semantic/effects.d.ts +62 -0
  148. package/dist/tokens/semantic/effects.d.ts.map +1 -0
  149. package/dist/tokens/semantic/index.d.ts +18 -0
  150. package/dist/tokens/semantic/index.d.ts.map +1 -0
  151. package/dist/tokens/semantic/typography.d.ts +266 -0
  152. package/dist/tokens/semantic/typography.d.ts.map +1 -0
  153. package/dist/tokens/tailwind/config.d.ts +151 -0
  154. package/dist/tokens/tailwind/config.d.ts.map +1 -0
  155. package/dist/tokens/tailwind/index.d.ts +7 -0
  156. package/dist/tokens/tailwind/index.d.ts.map +1 -0
  157. package/dist/tokens/themes/dark.d.ts +308 -0
  158. package/dist/tokens/themes/dark.d.ts.map +1 -0
  159. package/dist/tokens/themes/index.d.ts +9 -0
  160. package/dist/tokens/themes/index.d.ts.map +1 -0
  161. package/dist/tokens/themes/light.d.ts +308 -0
  162. package/dist/tokens/themes/light.d.ts.map +1 -0
  163. package/dist/tokens/utils/cssVariables.d.ts +26 -0
  164. package/dist/tokens/utils/cssVariables.d.ts.map +1 -0
  165. package/dist/tokens/utils/hooks.d.ts +773 -0
  166. package/dist/tokens/utils/hooks.d.ts.map +1 -0
  167. package/dist/tokens/utils/index.d.ts +7 -0
  168. package/dist/tokens/utils/index.d.ts.map +1 -0
  169. package/dist/types/ui.d.ts +42 -1
  170. package/dist/types/ui.d.ts.map +1 -1
  171. package/dist/ui/components/ui/Avatar/Avatar.types.d.ts +1 -1
  172. package/dist/ui/components/ui/Avatar/Avatar.types.d.ts.map +1 -1
  173. package/dist/ui/components/ui/Avatar/AvatarBlock.d.ts +13 -0
  174. package/dist/ui/components/ui/Avatar/AvatarBlock.d.ts.map +1 -0
  175. package/dist/ui/components/ui/Avatar/AvatarGroup.d.ts +14 -0
  176. package/dist/ui/components/ui/Avatar/AvatarGroup.d.ts.map +1 -0
  177. package/dist/ui/components/ui/Avatar/index.d.ts +3 -1
  178. package/dist/ui/components/ui/Avatar/index.d.ts.map +1 -1
  179. package/dist/ui/components/ui/Breadcrumb/Breadcrumb.d.ts +1 -1
  180. package/dist/ui/components/ui/Breadcrumb/Breadcrumb.d.ts.map +1 -1
  181. package/dist/ui/components/ui/Button/Button.d.ts.map +1 -1
  182. package/dist/ui/components/ui/ButtonDanger/ButtonDanger.d.ts.map +1 -1
  183. package/dist/ui/components/ui/Cell/Cell.d.ts.map +1 -1
  184. package/dist/ui/components/ui/Checkbox/Checkbox.d.ts.map +1 -1
  185. package/dist/ui/components/ui/IconButton/IconButton.d.ts.map +1 -1
  186. package/dist/ui/components/ui/InputField/InputField.d.ts +5 -0
  187. package/dist/ui/components/ui/InputField/InputField.d.ts.map +1 -0
  188. package/dist/ui/components/ui/InputField/InputField.types.d.ts +27 -0
  189. package/dist/ui/components/ui/InputField/InputField.types.d.ts.map +1 -0
  190. package/dist/ui/components/ui/InputField/index.d.ts +3 -0
  191. package/dist/ui/components/ui/InputField/index.d.ts.map +1 -0
  192. package/dist/ui/components/ui/ListSearch/ListSearch.d.ts +5 -0
  193. package/dist/ui/components/ui/ListSearch/ListSearch.d.ts.map +1 -0
  194. package/dist/ui/components/ui/ListSearch/ListSearch.types.d.ts +2 -0
  195. package/dist/ui/components/ui/ListSearch/ListSearch.types.d.ts.map +1 -0
  196. package/dist/ui/components/ui/ListSearch/index.d.ts +3 -0
  197. package/dist/ui/components/ui/ListSearch/index.d.ts.map +1 -0
  198. package/dist/ui/components/ui/StatusIndicator/StatusIndicator.d.ts.map +1 -1
  199. package/dist/ui/components/ui/StatusIndicator/StatusIndicator.types.d.ts +1 -1
  200. package/dist/ui/components/ui/StatusIndicator/StatusIndicator.types.d.ts.map +1 -1
  201. package/dist/ui/components/ui/TextArea/TextArea.d.ts +0 -9
  202. package/dist/ui/components/ui/TextArea/TextArea.d.ts.map +1 -1
  203. package/dist/ui/components/ui/Toast/Toast.d.ts +11 -0
  204. package/dist/ui/components/ui/Toast/Toast.d.ts.map +1 -0
  205. package/dist/ui/components/ui/Toast/Toast.types.d.ts +2 -0
  206. package/dist/ui/components/ui/Toast/Toast.types.d.ts.map +1 -0
  207. package/dist/ui/components/ui/Toast/index.d.ts +3 -0
  208. package/dist/ui/components/ui/Toast/index.d.ts.map +1 -0
  209. package/dist/ui/components/ui/index.d.ts +8 -2
  210. package/dist/ui/components/ui/index.d.ts.map +1 -1
  211. package/dist/ui/index.d.ts +3 -0
  212. package/dist/ui/index.d.ts.map +1 -1
  213. package/dist/ui/index.esm.css +1 -1
  214. package/dist/ui/index.esm.js +1 -1
  215. package/dist/ui/index.esm.js.map +1 -1
  216. package/dist/ui/tokens/core/breakpoints.d.ts +23 -0
  217. package/dist/ui/tokens/core/breakpoints.d.ts.map +1 -0
  218. package/dist/ui/tokens/core/colors.d.ts +186 -0
  219. package/dist/ui/tokens/core/colors.d.ts.map +1 -0
  220. package/dist/ui/tokens/core/index.d.ts +20 -0
  221. package/dist/ui/tokens/core/index.d.ts.map +1 -0
  222. package/dist/ui/tokens/core/spacing.d.ts +105 -0
  223. package/dist/ui/tokens/core/spacing.d.ts.map +1 -0
  224. package/dist/ui/tokens/core/typography.d.ts +52 -0
  225. package/dist/ui/tokens/core/typography.d.ts.map +1 -0
  226. package/dist/ui/tokens/index.d.ts +1646 -0
  227. package/dist/ui/tokens/index.d.ts.map +1 -0
  228. package/dist/ui/tokens/js/tokens.d.ts +482 -0
  229. package/dist/ui/tokens/js/tokens.d.ts.map +1 -0
  230. package/dist/ui/tokens/semantic/colors.d.ts +320 -0
  231. package/dist/ui/tokens/semantic/colors.d.ts.map +1 -0
  232. package/dist/ui/tokens/semantic/effects.d.ts +62 -0
  233. package/dist/ui/tokens/semantic/effects.d.ts.map +1 -0
  234. package/dist/ui/tokens/semantic/index.d.ts +18 -0
  235. package/dist/ui/tokens/semantic/index.d.ts.map +1 -0
  236. package/dist/ui/tokens/semantic/typography.d.ts +266 -0
  237. package/dist/ui/tokens/semantic/typography.d.ts.map +1 -0
  238. package/dist/ui/tokens/tailwind/config.d.ts +151 -0
  239. package/dist/ui/tokens/tailwind/config.d.ts.map +1 -0
  240. package/dist/ui/tokens/tailwind/index.d.ts +7 -0
  241. package/dist/ui/tokens/tailwind/index.d.ts.map +1 -0
  242. package/dist/ui/tokens/themes/dark.d.ts +308 -0
  243. package/dist/ui/tokens/themes/dark.d.ts.map +1 -0
  244. package/dist/ui/tokens/themes/index.d.ts +9 -0
  245. package/dist/ui/tokens/themes/index.d.ts.map +1 -0
  246. package/dist/ui/tokens/themes/light.d.ts +308 -0
  247. package/dist/ui/tokens/themes/light.d.ts.map +1 -0
  248. package/dist/ui/tokens/utils/cssVariables.d.ts +26 -0
  249. package/dist/ui/tokens/utils/cssVariables.d.ts.map +1 -0
  250. package/dist/ui/tokens/utils/hooks.d.ts +773 -0
  251. package/dist/ui/tokens/utils/hooks.d.ts.map +1 -0
  252. package/dist/ui/tokens/utils/index.d.ts +7 -0
  253. package/dist/ui/tokens/utils/index.d.ts.map +1 -0
  254. package/dist/ui/types/ui.d.ts +42 -1
  255. package/dist/ui/types/ui.d.ts.map +1 -1
  256. package/package.json +20 -7
  257. package/public/logo/Logo.svg +9 -0
  258. package/src/tokens/README.md +199 -0
  259. package/src/tokens/core/breakpoints.ts +25 -0
  260. package/src/tokens/core/colors.ts +200 -0
  261. package/src/tokens/core/index.ts +20 -0
  262. package/src/tokens/core/spacing.ts +114 -0
  263. package/src/tokens/core/typography.ts +58 -0
  264. package/src/tokens/css/variables-dark.css +480 -0
  265. package/src/tokens/css/variables-light.css +480 -0
  266. package/src/tokens/index.ts +163 -0
  267. package/src/tokens/js/tokens.ts +486 -0
  268. package/src/tokens/semantic/colors.ts +383 -0
  269. package/src/tokens/semantic/effects.ts +69 -0
  270. package/src/tokens/semantic/index.ts +18 -0
  271. package/src/tokens/semantic/typography.ts +284 -0
  272. package/src/tokens/tailwind/config.ts +188 -0
  273. package/src/tokens/tailwind/index.ts +7 -0
  274. package/src/tokens/themes/dark.ts +311 -0
  275. package/src/tokens/themes/index.ts +10 -0
  276. package/src/tokens/themes/light.ts +17 -0
  277. package/src/tokens/utils/cssVariables.ts +88 -0
  278. package/src/tokens/utils/hooks.ts +192 -0
  279. package/src/tokens/utils/index.ts +7 -0
@@ -0,0 +1,311 @@
1
+ /**
2
+ * Dark Theme
3
+ * Dark mode color scheme (inverted from light theme)
4
+ */
5
+
6
+ import { colors, alphas } from '../core/colors';
7
+
8
+ export const darkTheme = {
9
+ color: {
10
+ background: {
11
+ brand: {
12
+ default: colors.purple[400],
13
+ secondary: colors.purple[600],
14
+ tertiary: colors.purple[800],
15
+ hover: colors.purple[300],
16
+ secondaryHover: colors.purple[500],
17
+ tertiaryHover: colors.purple[700],
18
+ subtleLow: alphas.purple[100],
19
+ subtleMedium: alphas.purple[200],
20
+ },
21
+ action: {
22
+ default: colors.violet[400],
23
+ secondary: colors.violet[600],
24
+ tertiary: colors.violet[800],
25
+ hover: colors.violet[300],
26
+ secondaryHover: colors.violet[500],
27
+ tertiaryHover: colors.violet[700],
28
+ subtleLow: alphas.violet[100],
29
+ subtleMedium: alphas.violet[200],
30
+ },
31
+ success: {
32
+ default: colors.green[600],
33
+ secondary: colors.green[800],
34
+ tertiary: colors.green[950],
35
+ hover: colors.green[500],
36
+ secondaryHover: colors.green[700],
37
+ tertiaryHover: colors.green[800],
38
+ subtleLow: colors.green[900],
39
+ subtleMedium: colors.green[800],
40
+ },
41
+ warning: {
42
+ default: colors.yellow[600],
43
+ secondary: colors.yellow[800],
44
+ tertiary: colors.yellow[950],
45
+ hover: colors.yellow[500],
46
+ secondaryHover: colors.yellow[700],
47
+ tertiaryHover: colors.yellow[900],
48
+ subtleLow: colors.yellow[900],
49
+ subtleMedium: colors.yellow[800],
50
+ },
51
+ danger: {
52
+ default: colors.red[600],
53
+ secondary: colors.red[800],
54
+ tertiary: colors.red[950],
55
+ hover: colors.red[500],
56
+ secondaryHover: colors.red[700],
57
+ tertiaryHover: colors.red[900],
58
+ subtleLow: alphas.red[100],
59
+ subtleMedium: alphas.red[200],
60
+ },
61
+ info: {
62
+ default: colors.blue[600],
63
+ secondary: colors.blue[800],
64
+ tertiary: colors.blue[950],
65
+ hover: colors.blue[500],
66
+ secondaryHover: colors.blue[700],
67
+ tertiaryHover: colors.blue[900],
68
+ subtleLow: colors.blue[900],
69
+ subtleMedium: colors.blue[800],
70
+ },
71
+ neutral: {
72
+ default: colors.slate[600],
73
+ secondary: colors.slate[800],
74
+ tertiary: colors.slate[950],
75
+ hover: colors.slate[500],
76
+ secondaryHover: colors.slate[700],
77
+ tertiaryHover: colors.slate[900],
78
+ subtleLow: alphas.slate[100],
79
+ subtleMedium: alphas.slate[200],
80
+ },
81
+ default: {
82
+ default: colors.slate[950],
83
+ hover: colors.slate[900],
84
+ glass: alphas.black[300],
85
+ onGlass: alphas.black[600],
86
+ onGlassSecondary: alphas.black[700],
87
+ onGlassTertiary: alphas.black[800],
88
+ onGlassHover: alphas.black[800],
89
+ },
90
+ disabled: {
91
+ default: colors.gray[800],
92
+ secondary: colors.gray[900],
93
+ },
94
+ utilities: {
95
+ scrim: 'rgba(0, 0, 0, 0.7)',
96
+ overlay: 'rgba(255, 255, 255, 0.1)',
97
+ blanket: 'rgba(255, 255, 255, 0.15)',
98
+ bgOnGlass: 'rgba(0, 0, 0, 0.45)',
99
+ bgOnGlassOnGlass: 'rgba(0, 0, 0, 0.6)',
100
+ hoverOverlay: 'rgba(255, 255, 255, 0.1)',
101
+ },
102
+ },
103
+ text: {
104
+ default: {
105
+ default: colors.slate[50],
106
+ secondary: colors.slate[300],
107
+ tertiary: colors.slate[500],
108
+ },
109
+ brand: {
110
+ default: colors.purple[300],
111
+ secondary: colors.purple[400],
112
+ tertiary: colors.purple[600],
113
+ onBrand: colors.purple[950],
114
+ onBrandSecondary: colors.purple[200],
115
+ onBrandTertiary: colors.purple[300],
116
+ },
117
+ action: {
118
+ default: colors.violet[300],
119
+ secondary: colors.violet[400],
120
+ tertiary: colors.violet[600],
121
+ onAction: colors.violet[950],
122
+ onActionSecondary: colors.violet[200],
123
+ onActionTertiary: colors.violet[300],
124
+ },
125
+ success: {
126
+ default: colors.green[300],
127
+ secondary: colors.green[400],
128
+ tertiary: colors.green[500],
129
+ onSuccess: colors.green[950],
130
+ onSuccessSecondary: colors.green[200],
131
+ onSuccessTertiary: colors.green[300],
132
+ },
133
+ warning: {
134
+ default: colors.yellow[300],
135
+ secondary: colors.yellow[400],
136
+ tertiary: colors.yellow[500],
137
+ onWarning: colors.yellow[950],
138
+ onWarningSecondary: colors.yellow[200],
139
+ onWarningTertiary: colors.yellow[300],
140
+ },
141
+ danger: {
142
+ default: colors.red[400],
143
+ secondary: colors.red[500],
144
+ tertiary: colors.red[600],
145
+ onDanger: colors.red[950],
146
+ onDangerSecondary: colors.red[200],
147
+ onDangerTertiary: colors.red[300],
148
+ },
149
+ info: {
150
+ default: colors.blue[400],
151
+ secondary: colors.blue[500],
152
+ tertiary: colors.blue[600],
153
+ onInfo: colors.blue[950],
154
+ onInfoSecondary: colors.blue[200],
155
+ onInfoTertiary: colors.blue[300],
156
+ },
157
+ neutral: {
158
+ default: colors.slate[50],
159
+ secondary: colors.slate[300],
160
+ tertiary: colors.slate[500],
161
+ onNeutral: colors.slate[950],
162
+ onNeutralSecondary: colors.slate[200],
163
+ onNeutralTertiary: colors.slate[300],
164
+ },
165
+ disabled: {
166
+ default: colors.gray[600],
167
+ secondary: colors.gray[700],
168
+ onDisabled: colors.gray[400],
169
+ onDisabledSecondary: colors.gray[500],
170
+ },
171
+ utilities: {
172
+ onOverlay: alphas.white[800],
173
+ },
174
+ },
175
+ border: {
176
+ default: {
177
+ default: colors.slate[800],
178
+ secondary: colors.slate[700],
179
+ tertiary: colors.slate[500],
180
+ subtleLow: alphas.black[800],
181
+ subtleMedium: alphas.slate[200],
182
+ subtleHigh: alphas.black[400],
183
+ },
184
+ brand: {
185
+ default: colors.purple[700],
186
+ secondary: colors.purple[600],
187
+ tertiary: colors.purple[800],
188
+ onBrand: colors.purple[950],
189
+ onBrandSecondary: colors.purple[200],
190
+ onBrandTertiary: colors.purple[400],
191
+ },
192
+ action: {
193
+ default: colors.violet[600],
194
+ secondary: colors.violet[700],
195
+ tertiary: colors.violet[800],
196
+ onAction: colors.violet[950],
197
+ onActionSecondary: colors.violet[300],
198
+ onActionTertiary: colors.violet[200],
199
+ },
200
+ success: {
201
+ default: colors.green[300],
202
+ secondary: colors.green[400],
203
+ tertiary: colors.green[500],
204
+ },
205
+ warning: {
206
+ default: colors.yellow[300],
207
+ secondary: colors.yellow[400],
208
+ tertiary: colors.yellow[500],
209
+ },
210
+ danger: {
211
+ default: colors.red[500],
212
+ secondary: colors.red[600],
213
+ tertiary: colors.red[800],
214
+ onDanger: colors.red[400],
215
+ },
216
+ info: {
217
+ default: colors.blue[500],
218
+ secondary: colors.blue[600],
219
+ tertiary: colors.blue[800],
220
+ },
221
+ neutral: {
222
+ default: colors.slate[300],
223
+ secondary: colors.slate[500],
224
+ tertiary: colors.slate[700],
225
+ onNeutral: colors.slate[950],
226
+ onNeutralSecondary: colors.slate[200],
227
+ onNeutralTertiary: colors.slate[300],
228
+ },
229
+ disabled: {
230
+ default: colors.gray[700],
231
+ },
232
+ utilities: {
233
+ swatch: 'rgba(255, 255, 255, 0.24)',
234
+ },
235
+ },
236
+ icon: {
237
+ default: {
238
+ default: colors.slate[100],
239
+ secondary: colors.slate[400],
240
+ tertiary: colors.slate[600],
241
+ },
242
+ brand: {
243
+ default: colors.purple[300],
244
+ secondary: colors.purple[400],
245
+ tertiary: colors.purple[500],
246
+ onBrand: colors.purple[950],
247
+ onBrandSecondary: colors.purple[200],
248
+ onBrandTertiary: colors.purple[300],
249
+ },
250
+ action: {
251
+ default: colors.violet[400],
252
+ secondary: colors.violet[500],
253
+ tertiary: colors.violet[700],
254
+ onAction: colors.violet[950],
255
+ onActionSecondary: colors.violet[200],
256
+ onActionTertiary: colors.violet[300],
257
+ },
258
+ success: {
259
+ default: colors.green[400],
260
+ secondary: colors.green[600],
261
+ tertiary: colors.green[800],
262
+ onSuccess: colors.green[950],
263
+ onSuccessSecondary: colors.green[200],
264
+ onSuccessTertiary: colors.green[300],
265
+ },
266
+ warning: {
267
+ default: colors.yellow[400],
268
+ secondary: colors.yellow[600],
269
+ tertiary: colors.yellow[800],
270
+ onWarning: colors.yellow[950],
271
+ onWarningSecondary: colors.yellow[200],
272
+ onWarningTertiary: colors.yellow[300],
273
+ },
274
+ danger: {
275
+ default: colors.red[400],
276
+ secondary: colors.red[500],
277
+ tertiary: colors.red[600],
278
+ onDanger: colors.red[950],
279
+ onDangerSecondary: colors.red[200],
280
+ onDangerTertiary: colors.red[300],
281
+ },
282
+ info: {
283
+ default: colors.blue[400],
284
+ secondary: colors.blue[600],
285
+ tertiary: colors.blue[800],
286
+ onInfo: colors.blue[950],
287
+ onInfoSecondary: colors.blue[200],
288
+ onInfoTertiary: colors.blue[300],
289
+ },
290
+ neutral: {
291
+ default: colors.slate[100],
292
+ secondary: colors.slate[400],
293
+ tertiary: colors.slate[600],
294
+ onNeutral: colors.slate[950],
295
+ onNeutralSecondary: colors.slate[200],
296
+ onNeutralTertiary: colors.slate[300],
297
+ },
298
+ disabled: {
299
+ default: colors.gray[600],
300
+ secondary: colors.gray[700],
301
+ onDisabled: colors.gray[400],
302
+ onDisabledSecondary: colors.gray[500],
303
+ },
304
+ utilities: {
305
+ onOverlay: alphas.white[800],
306
+ },
307
+ },
308
+ },
309
+ } as const;
310
+
311
+ export type DarkTheme = typeof darkTheme;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Theme System
3
+ * Export all available themes
4
+ */
5
+
6
+ export { lightTheme } from './light';
7
+ export { darkTheme } from './dark';
8
+
9
+ export type { LightTheme } from './light';
10
+ export type { DarkTheme } from './dark';
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Light Theme
3
+ * Default light mode color scheme
4
+ */
5
+
6
+ import { background, text, border, icon } from '../semantic/colors';
7
+
8
+ export const lightTheme = {
9
+ color: {
10
+ background,
11
+ text,
12
+ border,
13
+ icon,
14
+ },
15
+ } as const;
16
+
17
+ export type LightTheme = typeof lightTheme;
@@ -0,0 +1,88 @@
1
+ /**
2
+ * CSS Custom Properties Generator
3
+ * Converts design tokens to CSS variables for runtime theming
4
+ */
5
+
6
+ import { Theme } from '../index';
7
+
8
+ /**
9
+ * Flattens nested object into CSS variable names
10
+ */
11
+ function flattenObject(
12
+ obj: any,
13
+ prefix = '',
14
+ result: Record<string, string> = {}
15
+ ): Record<string, string> {
16
+ for (const key in obj) {
17
+ const value = obj[key];
18
+ const newKey = prefix ? `${prefix}-${kebabCase(key)}` : kebabCase(key);
19
+
20
+ if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
21
+ flattenObject(value, newKey, result);
22
+ } else {
23
+ result[`--${newKey}`] = String(value);
24
+ }
25
+ }
26
+
27
+ return result;
28
+ }
29
+
30
+ /**
31
+ * Converts camelCase to kebab-case
32
+ */
33
+ function kebabCase(str: string): string {
34
+ return str
35
+ .replace(/([a-z])([A-Z])/g, '$1-$2')
36
+ .replace(/[\s_]+/g, '-')
37
+ .toLowerCase();
38
+ }
39
+
40
+ /**
41
+ * Generates CSS custom properties from theme object
42
+ */
43
+ export function generateCSSVariables(theme: Theme): Record<string, string> {
44
+ return flattenObject(theme);
45
+ }
46
+
47
+ /**
48
+ * Applies CSS variables to a DOM element (usually :root or a container)
49
+ */
50
+ export function applyCSSVariables(
51
+ element: HTMLElement,
52
+ variables: Record<string, string>
53
+ ): void {
54
+ for (const [key, value] of Object.entries(variables)) {
55
+ element.style.setProperty(key, value);
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Removes CSS variables from a DOM element
61
+ */
62
+ export function removeCSSVariables(
63
+ element: HTMLElement,
64
+ variables: Record<string, string>
65
+ ): void {
66
+ for (const key of Object.keys(variables)) {
67
+ element.style.removeProperty(key);
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Gets current value of a CSS variable
73
+ */
74
+ export function getCSSVariable(name: string, element: HTMLElement = document.documentElement): string {
75
+ return getComputedStyle(element).getPropertyValue(name).trim();
76
+ }
77
+
78
+ /**
79
+ * Generates a CSS string with all variables
80
+ */
81
+ export function generateCSSString(theme: Theme, selector = ':root'): string {
82
+ const variables = generateCSSVariables(theme);
83
+ const cssVars = Object.entries(variables)
84
+ .map(([key, value]) => ` ${key}: ${value};`)
85
+ .join('\n');
86
+
87
+ return `${selector} {\n${cssVars}\n}`;
88
+ }
@@ -0,0 +1,192 @@
1
+ /**
2
+ * React Hooks for Design Tokens
3
+ * Provides easy access to tokens and theming in React components
4
+ */
5
+
6
+ import { useState, useEffect, useCallback, useMemo } from 'react';
7
+ import { tokens, themes, type ThemeMode, type Theme } from '../index';
8
+ import { applyCSSVariables, generateCSSVariables } from './cssVariables';
9
+
10
+ const THEME_STORAGE_KEY = 'squarex-ui-theme';
11
+
12
+ /**
13
+ * Hook to access design tokens
14
+ * @returns The tokens object
15
+ *
16
+ * @example
17
+ * const MyComponent = () => {
18
+ * const tokens = useTokens();
19
+ * return <div style={{ color: tokens.color.text.brand.default }}>Hello</div>;
20
+ * };
21
+ */
22
+ export function useTokens() {
23
+ return tokens;
24
+ }
25
+
26
+ /**
27
+ * Hook for theme management
28
+ * @param defaultTheme - The default theme mode ('light' or 'dark')
29
+ * @param persist - Whether to persist theme preference to localStorage
30
+ *
31
+ * @example
32
+ * const MyApp = () => {
33
+ * const { theme, themeMode, setTheme, toggleTheme } = useTheme('light', true);
34
+ *
35
+ * return (
36
+ * <div>
37
+ * <p>Current theme: {themeMode}</p>
38
+ * <button onClick={toggleTheme}>Toggle Theme</button>
39
+ * </div>
40
+ * );
41
+ * };
42
+ */
43
+ export function useTheme(defaultTheme: ThemeMode = 'light', persist: boolean = true) {
44
+ // Initialize theme from localStorage or default
45
+ const [themeMode, setThemeMode] = useState<ThemeMode>(() => {
46
+ if (persist && typeof window !== 'undefined') {
47
+ const stored = localStorage.getItem(THEME_STORAGE_KEY) as ThemeMode | null;
48
+ return stored || defaultTheme;
49
+ }
50
+ return defaultTheme;
51
+ });
52
+
53
+ // Get current theme object
54
+ const theme = useMemo<Theme>(() => themes[themeMode], [themeMode]);
55
+
56
+ // Apply theme to document root
57
+ useEffect(() => {
58
+ if (typeof window === 'undefined') return;
59
+
60
+ const cssVariables = generateCSSVariables(theme);
61
+ applyCSSVariables(document.documentElement, cssVariables);
62
+
63
+ // Add data attribute for CSS selectors
64
+ document.documentElement.setAttribute('data-theme', themeMode);
65
+
66
+ // Persist to localStorage
67
+ if (persist) {
68
+ localStorage.setItem(THEME_STORAGE_KEY, themeMode);
69
+ }
70
+ }, [theme, themeMode, persist]);
71
+
72
+ // Set theme mode
73
+ const setTheme = useCallback((mode: ThemeMode) => {
74
+ setThemeMode(mode);
75
+ }, []);
76
+
77
+ // Toggle between light and dark
78
+ const toggleTheme = useCallback(() => {
79
+ setThemeMode((current) => (current === 'light' ? 'dark' : 'light'));
80
+ }, []);
81
+
82
+ return {
83
+ theme,
84
+ themeMode,
85
+ setTheme,
86
+ toggleTheme,
87
+ };
88
+ }
89
+
90
+ /**
91
+ * Hook to detect system color scheme preference
92
+ *
93
+ * @example
94
+ * const MyApp = () => {
95
+ * const prefersDark = usePrefersDarkMode();
96
+ * const { setTheme } = useTheme();
97
+ *
98
+ * useEffect(() => {
99
+ * setTheme(prefersDark ? 'dark' : 'light');
100
+ * }, [prefersDark, setTheme]);
101
+ * };
102
+ */
103
+ export function usePrefersDarkMode(): boolean {
104
+ const [prefersDark, setPrefersDark] = useState<boolean>(() => {
105
+ if (typeof window === 'undefined') return false;
106
+ return window.matchMedia('(prefers-color-scheme: dark)').matches;
107
+ });
108
+
109
+ useEffect(() => {
110
+ if (typeof window === 'undefined') return;
111
+
112
+ const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
113
+ const handler = (e: MediaQueryListEvent) => setPrefersDark(e.matches);
114
+
115
+ // Modern browsers
116
+ if (mediaQuery.addEventListener) {
117
+ mediaQuery.addEventListener('change', handler);
118
+ return () => mediaQuery.removeEventListener('change', handler);
119
+ }
120
+ // Legacy browsers
121
+ else if (mediaQuery.addListener) {
122
+ mediaQuery.addListener(handler);
123
+ return () => mediaQuery.removeListener(handler);
124
+ }
125
+ }, []);
126
+
127
+ return prefersDark;
128
+ }
129
+
130
+ /**
131
+ * Hook to get responsive breakpoint information
132
+ *
133
+ * @example
134
+ * const MyComponent = () => {
135
+ * const { isMobile, isTablet, isDesktop } = useBreakpoint();
136
+ *
137
+ * return (
138
+ * <div>
139
+ * {isMobile && <MobileNav />}
140
+ * {isDesktop && <DesktopNav />}
141
+ * </div>
142
+ * );
143
+ * };
144
+ */
145
+ export function useBreakpoint() {
146
+ const [breakpoint, setBreakpoint] = useState<{
147
+ isMobile: boolean;
148
+ isTablet: boolean;
149
+ isDesktop: boolean;
150
+ isWide: boolean;
151
+ width: number;
152
+ }>(() => {
153
+ if (typeof window === 'undefined') {
154
+ return {
155
+ isMobile: false,
156
+ isTablet: false,
157
+ isDesktop: false,
158
+ isWide: false,
159
+ width: 0,
160
+ };
161
+ }
162
+
163
+ const width = window.innerWidth;
164
+ return {
165
+ isMobile: width >= tokens.breakpoint.mobile && width < tokens.breakpoint.tablet,
166
+ isTablet: width >= tokens.breakpoint.tablet && width < tokens.breakpoint.desktop,
167
+ isDesktop: width >= tokens.breakpoint.desktop && width < tokens.breakpoint.wide,
168
+ isWide: width >= tokens.breakpoint.wide,
169
+ width,
170
+ };
171
+ });
172
+
173
+ useEffect(() => {
174
+ if (typeof window === 'undefined') return;
175
+
176
+ const handleResize = () => {
177
+ const width = window.innerWidth;
178
+ setBreakpoint({
179
+ isMobile: width >= tokens.breakpoint.mobile && width < tokens.breakpoint.tablet,
180
+ isTablet: width >= tokens.breakpoint.tablet && width < tokens.breakpoint.desktop,
181
+ isDesktop: width >= tokens.breakpoint.desktop && width < tokens.breakpoint.wide,
182
+ isWide: width >= tokens.breakpoint.wide,
183
+ width,
184
+ });
185
+ };
186
+
187
+ window.addEventListener('resize', handleResize);
188
+ return () => window.removeEventListener('resize', handleResize);
189
+ }, []);
190
+
191
+ return breakpoint;
192
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Token Utilities
3
+ * Helper functions and hooks for working with design tokens
4
+ */
5
+
6
+ export * from './cssVariables';
7
+ export * from './hooks';