@korsolutions/ui 0.0.86 → 0.0.88

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/module/components/alert/variants/default.js +2 -1
  2. package/dist/module/components/alert/variants/default.js.map +1 -1
  3. package/dist/module/components/alert/variants/destructive.js +2 -1
  4. package/dist/module/components/alert/variants/destructive.js.map +1 -1
  5. package/dist/module/components/alert-dialog/variants/default.js +4 -1
  6. package/dist/module/components/alert-dialog/variants/default.js.map +1 -1
  7. package/dist/module/components/avatar/variants/default.js +1 -0
  8. package/dist/module/components/avatar/variants/default.js.map +1 -1
  9. package/dist/module/components/badge/variants/default.js +1 -0
  10. package/dist/module/components/badge/variants/default.js.map +1 -1
  11. package/dist/module/components/badge/variants/secondary.js +1 -0
  12. package/dist/module/components/badge/variants/secondary.js.map +1 -1
  13. package/dist/module/components/button/button.js +3 -2
  14. package/dist/module/components/button/button.js.map +1 -1
  15. package/dist/module/components/button/variants/default.js +1 -0
  16. package/dist/module/components/button/variants/default.js.map +1 -1
  17. package/dist/module/components/button/variants/ghost.js +1 -0
  18. package/dist/module/components/button/variants/ghost.js.map +1 -1
  19. package/dist/module/components/button/variants/secondary.js +1 -0
  20. package/dist/module/components/button/variants/secondary.js.map +1 -1
  21. package/dist/module/components/calendar/calendar/variants/default.js +3 -0
  22. package/dist/module/components/calendar/calendar/variants/default.js.map +1 -1
  23. package/dist/module/components/calendar/timeline/variants/default.js +1 -0
  24. package/dist/module/components/calendar/timeline/variants/default.js.map +1 -1
  25. package/dist/module/components/calendar/week-calendar/variants/default.js +3 -0
  26. package/dist/module/components/calendar/week-calendar/variants/default.js.map +1 -1
  27. package/dist/module/components/card/variants/default.js +1 -0
  28. package/dist/module/components/card/variants/default.js.map +1 -1
  29. package/dist/module/components/checkbox/variants/default.js +2 -0
  30. package/dist/module/components/checkbox/variants/default.js.map +1 -1
  31. package/dist/module/components/checkbox/variants/outlined.js +2 -0
  32. package/dist/module/components/checkbox/variants/outlined.js.map +1 -1
  33. package/dist/module/components/combobox/variants/default.js +3 -0
  34. package/dist/module/components/combobox/variants/default.js.map +1 -1
  35. package/dist/module/components/empty/variants/default.js +2 -0
  36. package/dist/module/components/empty/variants/default.js.map +1 -1
  37. package/dist/module/components/field/variants/default.js +3 -0
  38. package/dist/module/components/field/variants/default.js.map +1 -1
  39. package/dist/module/components/index.js +1 -0
  40. package/dist/module/components/index.js.map +1 -1
  41. package/dist/module/components/input/variants/default.js +1 -0
  42. package/dist/module/components/input/variants/default.js.map +1 -1
  43. package/dist/module/components/input/variants/secondary.js +1 -0
  44. package/dist/module/components/input/variants/secondary.js.map +1 -1
  45. package/dist/module/components/link/variants/default.js +1 -0
  46. package/dist/module/components/link/variants/default.js.map +1 -1
  47. package/dist/module/components/menu/variants/default.js +3 -0
  48. package/dist/module/components/menu/variants/default.js.map +1 -1
  49. package/dist/module/components/phone-input/variants/default.js +4 -0
  50. package/dist/module/components/phone-input/variants/default.js.map +1 -1
  51. package/dist/module/components/portal/portal.web.js +15 -0
  52. package/dist/module/components/portal/portal.web.js.map +1 -1
  53. package/dist/module/components/radio-group/variants/default.js +2 -0
  54. package/dist/module/components/radio-group/variants/default.js.map +1 -1
  55. package/dist/module/components/radio-group/variants/outlined.js +2 -0
  56. package/dist/module/components/radio-group/variants/outlined.js.map +1 -1
  57. package/dist/module/components/select/variants/default.js +3 -0
  58. package/dist/module/components/select/variants/default.js.map +1 -1
  59. package/dist/module/components/sidebar/components/sidebar-content.js +19 -0
  60. package/dist/module/components/sidebar/components/sidebar-content.js.map +1 -0
  61. package/dist/module/components/sidebar/components/sidebar-footer.js +18 -0
  62. package/dist/module/components/sidebar/components/sidebar-footer.js.map +1 -0
  63. package/dist/module/components/sidebar/components/sidebar-group-label.js +18 -0
  64. package/dist/module/components/sidebar/components/sidebar-group-label.js.map +1 -0
  65. package/dist/module/components/sidebar/components/sidebar-group.js +18 -0
  66. package/dist/module/components/sidebar/components/sidebar-group.js.map +1 -0
  67. package/dist/module/components/sidebar/components/sidebar-header.js +18 -0
  68. package/dist/module/components/sidebar/components/sidebar-header.js.map +1 -0
  69. package/dist/module/components/sidebar/components/sidebar-menu-item.js +36 -0
  70. package/dist/module/components/sidebar/components/sidebar-menu-item.js.map +1 -0
  71. package/dist/module/components/sidebar/components/sidebar-menu-sub.js +22 -0
  72. package/dist/module/components/sidebar/components/sidebar-menu-sub.js.map +1 -0
  73. package/dist/module/components/sidebar/components/sidebar-menu.js +18 -0
  74. package/dist/module/components/sidebar/components/sidebar-menu.js.map +1 -0
  75. package/dist/module/components/sidebar/components/sidebar-provider.js +47 -0
  76. package/dist/module/components/sidebar/components/sidebar-provider.js.map +1 -0
  77. package/dist/module/components/sidebar/components/sidebar-root.js +27 -0
  78. package/dist/module/components/sidebar/components/sidebar-root.js.map +1 -0
  79. package/dist/module/components/sidebar/context.js +12 -0
  80. package/dist/module/components/sidebar/context.js.map +1 -0
  81. package/dist/module/components/sidebar/index.js +26 -0
  82. package/dist/module/components/sidebar/index.js.map +1 -0
  83. package/dist/module/components/sidebar/types.js +4 -0
  84. package/dist/module/components/sidebar/types.js.map +1 -0
  85. package/dist/module/components/sidebar/variants/default.js +102 -0
  86. package/dist/module/components/sidebar/variants/default.js.map +1 -0
  87. package/dist/module/components/sidebar/variants/index.js +7 -0
  88. package/dist/module/components/sidebar/variants/index.js.map +1 -0
  89. package/dist/module/components/tabs/variants/default.js +1 -0
  90. package/dist/module/components/tabs/variants/default.js.map +1 -1
  91. package/dist/module/components/tabs/variants/line.js +1 -0
  92. package/dist/module/components/tabs/variants/line.js.map +1 -1
  93. package/dist/module/components/textarea/variants/default.js +1 -0
  94. package/dist/module/components/textarea/variants/default.js.map +1 -1
  95. package/dist/module/components/toast/variants/danger.js +2 -0
  96. package/dist/module/components/toast/variants/danger.js.map +1 -1
  97. package/dist/module/components/toast/variants/default.js +2 -0
  98. package/dist/module/components/toast/variants/default.js.map +1 -1
  99. package/dist/module/components/toast/variants/success.js +2 -0
  100. package/dist/module/components/toast/variants/success.js.map +1 -1
  101. package/dist/module/components/typography/typography.js +7 -2
  102. package/dist/module/components/typography/typography.js.map +1 -1
  103. package/dist/module/components/typography/variants/body.js +28 -0
  104. package/dist/module/components/typography/variants/body.js.map +1 -0
  105. package/dist/module/components/typography/variants/heading.js +29 -0
  106. package/dist/module/components/typography/variants/heading.js.map +1 -0
  107. package/dist/module/components/typography/variants/index.js +4 -12
  108. package/dist/module/components/typography/variants/index.js.map +1 -1
  109. package/dist/module/utils/size-scale.js +3 -1
  110. package/dist/module/utils/size-scale.js.map +1 -1
  111. package/dist/typescript/src/components/alert/variants/default.d.ts.map +1 -1
  112. package/dist/typescript/src/components/alert/variants/destructive.d.ts.map +1 -1
  113. package/dist/typescript/src/components/alert-dialog/variants/default.d.ts.map +1 -1
  114. package/dist/typescript/src/components/avatar/variants/default.d.ts.map +1 -1
  115. package/dist/typescript/src/components/badge/variants/default.d.ts.map +1 -1
  116. package/dist/typescript/src/components/badge/variants/secondary.d.ts.map +1 -1
  117. package/dist/typescript/src/components/button/button.d.ts.map +1 -1
  118. package/dist/typescript/src/components/button/types.d.ts +3 -2
  119. package/dist/typescript/src/components/button/types.d.ts.map +1 -1
  120. package/dist/typescript/src/components/button/variants/default.d.ts.map +1 -1
  121. package/dist/typescript/src/components/button/variants/ghost.d.ts.map +1 -1
  122. package/dist/typescript/src/components/button/variants/secondary.d.ts.map +1 -1
  123. package/dist/typescript/src/components/calendar/calendar/variants/default.d.ts.map +1 -1
  124. package/dist/typescript/src/components/calendar/timeline/variants/default.d.ts.map +1 -1
  125. package/dist/typescript/src/components/calendar/week-calendar/variants/default.d.ts.map +1 -1
  126. package/dist/typescript/src/components/card/variants/default.d.ts.map +1 -1
  127. package/dist/typescript/src/components/checkbox/variants/default.d.ts.map +1 -1
  128. package/dist/typescript/src/components/checkbox/variants/outlined.d.ts.map +1 -1
  129. package/dist/typescript/src/components/combobox/variants/default.d.ts.map +1 -1
  130. package/dist/typescript/src/components/empty/variants/default.d.ts.map +1 -1
  131. package/dist/typescript/src/components/field/variants/default.d.ts.map +1 -1
  132. package/dist/typescript/src/components/index.d.ts +1 -0
  133. package/dist/typescript/src/components/index.d.ts.map +1 -1
  134. package/dist/typescript/src/components/input/variants/default.d.ts.map +1 -1
  135. package/dist/typescript/src/components/input/variants/secondary.d.ts.map +1 -1
  136. package/dist/typescript/src/components/link/variants/default.d.ts.map +1 -1
  137. package/dist/typescript/src/components/menu/variants/default.d.ts.map +1 -1
  138. package/dist/typescript/src/components/phone-input/variants/default.d.ts.map +1 -1
  139. package/dist/typescript/src/components/portal/portal.web.d.ts.map +1 -1
  140. package/dist/typescript/src/components/radio-group/variants/default.d.ts.map +1 -1
  141. package/dist/typescript/src/components/radio-group/variants/outlined.d.ts.map +1 -1
  142. package/dist/typescript/src/components/select/variants/default.d.ts.map +1 -1
  143. package/dist/typescript/src/components/sidebar/components/sidebar-content.d.ts +8 -0
  144. package/dist/typescript/src/components/sidebar/components/sidebar-content.d.ts.map +1 -0
  145. package/dist/typescript/src/components/sidebar/components/sidebar-footer.d.ts +8 -0
  146. package/dist/typescript/src/components/sidebar/components/sidebar-footer.d.ts.map +1 -0
  147. package/dist/typescript/src/components/sidebar/components/sidebar-group-label.d.ts +8 -0
  148. package/dist/typescript/src/components/sidebar/components/sidebar-group-label.d.ts.map +1 -0
  149. package/dist/typescript/src/components/sidebar/components/sidebar-group.d.ts +8 -0
  150. package/dist/typescript/src/components/sidebar/components/sidebar-group.d.ts.map +1 -0
  151. package/dist/typescript/src/components/sidebar/components/sidebar-header.d.ts +8 -0
  152. package/dist/typescript/src/components/sidebar/components/sidebar-header.d.ts.map +1 -0
  153. package/dist/typescript/src/components/sidebar/components/sidebar-menu-item.d.ts +12 -0
  154. package/dist/typescript/src/components/sidebar/components/sidebar-menu-item.d.ts.map +1 -0
  155. package/dist/typescript/src/components/sidebar/components/sidebar-menu-sub.d.ts +10 -0
  156. package/dist/typescript/src/components/sidebar/components/sidebar-menu-sub.d.ts.map +1 -0
  157. package/dist/typescript/src/components/sidebar/components/sidebar-menu.d.ts +8 -0
  158. package/dist/typescript/src/components/sidebar/components/sidebar-menu.d.ts.map +1 -0
  159. package/dist/typescript/src/components/sidebar/components/sidebar-provider.d.ts +17 -0
  160. package/dist/typescript/src/components/sidebar/components/sidebar-provider.d.ts.map +1 -0
  161. package/dist/typescript/src/components/sidebar/components/sidebar-root.d.ts +8 -0
  162. package/dist/typescript/src/components/sidebar/components/sidebar-root.d.ts.map +1 -0
  163. package/dist/typescript/src/components/sidebar/context.d.ts +12 -0
  164. package/dist/typescript/src/components/sidebar/context.d.ts.map +1 -0
  165. package/dist/typescript/src/components/sidebar/index.d.ts +35 -0
  166. package/dist/typescript/src/components/sidebar/index.d.ts.map +1 -0
  167. package/dist/typescript/src/components/sidebar/types.d.ts +29 -0
  168. package/dist/typescript/src/components/sidebar/types.d.ts.map +1 -0
  169. package/dist/typescript/src/components/sidebar/variants/default.d.ts +3 -0
  170. package/dist/typescript/src/components/sidebar/variants/default.d.ts.map +1 -0
  171. package/dist/typescript/src/components/sidebar/variants/index.d.ts +5 -0
  172. package/dist/typescript/src/components/sidebar/variants/index.d.ts.map +1 -0
  173. package/dist/typescript/src/components/tabs/variants/default.d.ts.map +1 -1
  174. package/dist/typescript/src/components/tabs/variants/line.d.ts.map +1 -1
  175. package/dist/typescript/src/components/textarea/variants/default.d.ts.map +1 -1
  176. package/dist/typescript/src/components/toast/variants/danger.d.ts.map +1 -1
  177. package/dist/typescript/src/components/toast/variants/default.d.ts.map +1 -1
  178. package/dist/typescript/src/components/toast/variants/success.d.ts.map +1 -1
  179. package/dist/typescript/src/components/typography/typography.d.ts +2 -0
  180. package/dist/typescript/src/components/typography/typography.d.ts.map +1 -1
  181. package/dist/typescript/src/components/typography/variants/body.d.ts +4 -0
  182. package/dist/typescript/src/components/typography/variants/body.d.ts.map +1 -0
  183. package/dist/typescript/src/components/typography/variants/heading.d.ts +4 -0
  184. package/dist/typescript/src/components/typography/variants/heading.d.ts.map +1 -0
  185. package/dist/typescript/src/components/typography/variants/index.d.ts +4 -12
  186. package/dist/typescript/src/components/typography/variants/index.d.ts.map +1 -1
  187. package/dist/typescript/src/themes/types.d.ts +4 -0
  188. package/dist/typescript/src/themes/types.d.ts.map +1 -1
  189. package/dist/typescript/src/utils/size-scale.d.ts +3 -1
  190. package/dist/typescript/src/utils/size-scale.d.ts.map +1 -1
  191. package/package.json +4 -5
  192. package/src/components/alert/variants/default.tsx +2 -1
  193. package/src/components/alert/variants/destructive.tsx +2 -1
  194. package/src/components/alert-dialog/variants/default.tsx +4 -1
  195. package/src/components/avatar/variants/default.tsx +1 -0
  196. package/src/components/badge/variants/default.tsx +1 -0
  197. package/src/components/badge/variants/secondary.tsx +1 -0
  198. package/src/components/button/button.tsx +2 -2
  199. package/src/components/button/types.ts +3 -2
  200. package/src/components/button/variants/default.tsx +1 -0
  201. package/src/components/button/variants/ghost.tsx +1 -0
  202. package/src/components/button/variants/secondary.tsx +1 -0
  203. package/src/components/calendar/calendar/variants/default.tsx +3 -0
  204. package/src/components/calendar/timeline/variants/default.tsx +1 -0
  205. package/src/components/calendar/week-calendar/variants/default.tsx +3 -0
  206. package/src/components/card/variants/default.tsx +1 -0
  207. package/src/components/checkbox/variants/default.tsx +2 -0
  208. package/src/components/checkbox/variants/outlined.tsx +2 -0
  209. package/src/components/combobox/variants/default.tsx +3 -0
  210. package/src/components/empty/variants/default.tsx +2 -0
  211. package/src/components/field/variants/default.tsx +3 -0
  212. package/src/components/index.ts +1 -0
  213. package/src/components/input/variants/default.tsx +1 -0
  214. package/src/components/input/variants/secondary.tsx +1 -0
  215. package/src/components/link/variants/default.tsx +1 -0
  216. package/src/components/menu/variants/default.tsx +3 -0
  217. package/src/components/phone-input/variants/default.tsx +4 -0
  218. package/src/components/portal/portal.web.tsx +15 -0
  219. package/src/components/radio-group/variants/default.tsx +2 -0
  220. package/src/components/radio-group/variants/outlined.tsx +2 -0
  221. package/src/components/select/variants/default.tsx +3 -0
  222. package/src/components/sidebar/components/sidebar-content.tsx +19 -0
  223. package/src/components/sidebar/components/sidebar-footer.tsx +15 -0
  224. package/src/components/sidebar/components/sidebar-group-label.tsx +15 -0
  225. package/src/components/sidebar/components/sidebar-group.tsx +15 -0
  226. package/src/components/sidebar/components/sidebar-header.tsx +15 -0
  227. package/src/components/sidebar/components/sidebar-menu-item.tsx +61 -0
  228. package/src/components/sidebar/components/sidebar-menu-sub.tsx +23 -0
  229. package/src/components/sidebar/components/sidebar-menu.tsx +15 -0
  230. package/src/components/sidebar/components/sidebar-provider.tsx +73 -0
  231. package/src/components/sidebar/components/sidebar-root.tsx +19 -0
  232. package/src/components/sidebar/context.ts +21 -0
  233. package/src/components/sidebar/index.ts +37 -0
  234. package/src/components/sidebar/types.ts +31 -0
  235. package/src/components/sidebar/variants/default.tsx +97 -0
  236. package/src/components/sidebar/variants/index.ts +5 -0
  237. package/src/components/tabs/variants/default.tsx +1 -0
  238. package/src/components/tabs/variants/line.tsx +1 -0
  239. package/src/components/textarea/variants/default.tsx +1 -0
  240. package/src/components/toast/variants/danger.tsx +2 -0
  241. package/src/components/toast/variants/default.tsx +2 -0
  242. package/src/components/toast/variants/success.tsx +2 -0
  243. package/src/components/typography/typography.tsx +5 -2
  244. package/src/components/typography/variants/body.tsx +26 -0
  245. package/src/components/typography/variants/heading.tsx +27 -0
  246. package/src/components/typography/variants/index.ts +4 -12
  247. package/src/themes/types.ts +4 -0
  248. package/src/utils/size-scale.ts +6 -2
  249. package/README.md +0 -4
  250. package/dist/module/components/typography/variants/body-lg.js +0 -18
  251. package/dist/module/components/typography/variants/body-lg.js.map +0 -1
  252. package/dist/module/components/typography/variants/body-md.js +0 -18
  253. package/dist/module/components/typography/variants/body-md.js.map +0 -1
  254. package/dist/module/components/typography/variants/body-sm.js +0 -18
  255. package/dist/module/components/typography/variants/body-sm.js.map +0 -1
  256. package/dist/module/components/typography/variants/heading-lg.js +0 -19
  257. package/dist/module/components/typography/variants/heading-lg.js.map +0 -1
  258. package/dist/module/components/typography/variants/heading-md.js +0 -19
  259. package/dist/module/components/typography/variants/heading-md.js.map +0 -1
  260. package/dist/module/components/typography/variants/heading-sm.js +0 -19
  261. package/dist/module/components/typography/variants/heading-sm.js.map +0 -1
  262. package/dist/typescript/src/components/typography/variants/body-lg.d.ts +0 -3
  263. package/dist/typescript/src/components/typography/variants/body-lg.d.ts.map +0 -1
  264. package/dist/typescript/src/components/typography/variants/body-md.d.ts +0 -3
  265. package/dist/typescript/src/components/typography/variants/body-md.d.ts.map +0 -1
  266. package/dist/typescript/src/components/typography/variants/body-sm.d.ts +0 -3
  267. package/dist/typescript/src/components/typography/variants/body-sm.d.ts.map +0 -1
  268. package/dist/typescript/src/components/typography/variants/heading-lg.d.ts +0 -3
  269. package/dist/typescript/src/components/typography/variants/heading-lg.d.ts.map +0 -1
  270. package/dist/typescript/src/components/typography/variants/heading-md.d.ts +0 -3
  271. package/dist/typescript/src/components/typography/variants/heading-md.d.ts.map +0 -1
  272. package/dist/typescript/src/components/typography/variants/heading-sm.d.ts +0 -3
  273. package/dist/typescript/src/components/typography/variants/heading-sm.d.ts.map +0 -1
  274. package/src/components/typography/variants/body-lg.tsx +0 -14
  275. package/src/components/typography/variants/body-md.tsx +0 -14
  276. package/src/components/typography/variants/body-sm.tsx +0 -14
  277. package/src/components/typography/variants/heading-lg.tsx +0 -15
  278. package/src/components/typography/variants/heading-md.tsx +0 -15
  279. package/src/components/typography/variants/heading-sm.tsx +0 -15
@@ -40,6 +40,7 @@ export const useAlertDialogVariantDefault = (size: Size): AlertDialogStyles => {
40
40
  },
41
41
  title: {
42
42
  fontSize: fontSize * 1.25,
43
+ lineHeight: Math.round(fontSize * 1.25 * 1.25),
43
44
  fontWeight: "600",
44
45
  color: colors.foreground,
45
46
  fontFamily,
@@ -49,7 +50,7 @@ export const useAlertDialogVariantDefault = (size: Size): AlertDialogStyles => {
49
50
  fontSize,
50
51
  color: colors.mutedForeground,
51
52
  fontFamily,
52
- lineHeight: fontSize * 1.5,
53
+ lineHeight: Math.round(fontSize * 1.25),
53
54
  },
54
55
  footer: {
55
56
  flexDirection: "row",
@@ -70,6 +71,7 @@ export const useAlertDialogVariantDefault = (size: Size): AlertDialogStyles => {
70
71
  cancelText: {
71
72
  color: colors.foreground,
72
73
  fontSize: s.fontSize,
74
+ lineHeight: s.lineHeight,
73
75
  fontWeight: "500",
74
76
  fontFamily,
75
77
  },
@@ -84,6 +86,7 @@ export const useAlertDialogVariantDefault = (size: Size): AlertDialogStyles => {
84
86
  actionText: {
85
87
  color: colors.primaryForeground,
86
88
  fontSize: s.fontSize,
89
+ lineHeight: s.lineHeight,
87
90
  fontWeight: "500",
88
91
  fontFamily,
89
92
  },
@@ -21,6 +21,7 @@ export function useAvatarVariantDefault(): AvatarStyles {
21
21
  fallback: {
22
22
  fontFamily,
23
23
  fontSize,
24
+ lineHeight: Math.round(fontSize * 1.25),
24
25
  color: colors.foreground,
25
26
  textAlign: "center",
26
27
  verticalAlign: "middle",
@@ -17,6 +17,7 @@ export const useBadgeVariantDefault = (): BadgeStyles => {
17
17
  text: {
18
18
  color: colors.primaryForeground,
19
19
  fontSize: fontSize * 0.75,
20
+ lineHeight: Math.round(fontSize * 0.75 * 1.25),
20
21
  fontWeight: "600",
21
22
  fontFamily,
22
23
  },
@@ -17,6 +17,7 @@ export const useBadgeVariantSecondary = (): BadgeStyles => {
17
17
  text: {
18
18
  color: colors.secondaryForeground,
19
19
  fontSize: fontSize * 0.75,
20
+ lineHeight: Math.round(fontSize * 0.75 * 1.25),
20
21
  fontWeight: "600",
21
22
  fontFamily,
22
23
  },
@@ -1,6 +1,5 @@
1
1
  import React, { useState } from "react";
2
2
  import {
3
- ActivityIndicator,
4
3
  Pressable,
5
4
  type PressableProps,
6
5
  type StyleProp,
@@ -11,6 +10,7 @@ import { useOrganizedChildren } from "../../hooks/use-organized-children";
11
10
  import { useComponentConfig } from "../../themes/provider";
12
11
  import { mergeStyles } from "../../utils/calculate-styles";
13
12
  import type { Size } from "../../utils/size-scale";
13
+ import { Spinner } from "../spinner";
14
14
  import type { ButtonState } from "./types";
15
15
  import { ButtonVariants } from "./variants";
16
16
 
@@ -69,7 +69,7 @@ export function Button(props: ButtonProps) {
69
69
  style={[variantStyles.root?.default, variantStyles.root?.[state], props.style]}
70
70
  >
71
71
  {organizedChildren}
72
- {props.isLoading && <ActivityIndicator {...spinnerProps} />}
72
+ {props.isLoading && <Spinner {...spinnerProps} />}
73
73
  </Pressable>
74
74
  );
75
75
  }
@@ -1,5 +1,6 @@
1
- import type { ActivityIndicatorProps, TextStyle, ViewStyle } from "react-native";
1
+ import type { TextStyle, ViewStyle } from "react-native";
2
2
  import type { IconProps } from "../icon";
3
+ import type { SpinnerProps } from "../spinner";
3
4
 
4
5
  export type ButtonState = "default" | "disabled" | "loading" | "hovered";
5
6
 
@@ -7,5 +8,5 @@ export interface ButtonStyles {
7
8
  root?: Partial<Record<ButtonState, ViewStyle>>;
8
9
  text?: Partial<Record<ButtonState, TextStyle>>;
9
10
  icon?: Partial<Record<ButtonState, IconProps>>;
10
- spinner?: Partial<Record<ButtonState, ActivityIndicatorProps>>;
11
+ spinner?: Partial<Record<ButtonState, SpinnerProps>>;
11
12
  }
@@ -39,6 +39,7 @@ export const useButtonVariantDefault = (size: Size): ButtonStyles => {
39
39
  default: {
40
40
  color: colors.primaryForeground,
41
41
  fontSize: sizeStyles.fontSize,
42
+ lineHeight: sizeStyles.lineHeight,
42
43
  fontFamily,
43
44
  },
44
45
  },
@@ -37,6 +37,7 @@ export const useButtonVariantGhost = (size: Size): ButtonStyles => {
37
37
  default: {
38
38
  color: colors.foreground,
39
39
  fontSize: sizeStyles.fontSize,
40
+ lineHeight: sizeStyles.lineHeight,
40
41
  fontFamily,
41
42
  },
42
43
  disabled: {
@@ -39,6 +39,7 @@ export const useButtonVariantSecondary = (size: Size): ButtonStyles => {
39
39
  default: {
40
40
  color: colors.secondaryForeground,
41
41
  fontSize: sizeStyles.fontSize,
42
+ lineHeight: sizeStyles.lineHeight,
42
43
  fontFamily,
43
44
  },
44
45
  disabled: {
@@ -22,6 +22,7 @@ export const useCalendarVariantDefault = (): CalendarStyles => {
22
22
  },
23
23
  headerTitle: {
24
24
  fontSize: fontSize * 1.125,
25
+ lineHeight: Math.round(fontSize * 1.125 * 1.25),
25
26
  fontWeight: "600",
26
27
  fontFamily,
27
28
  color: colors.foreground,
@@ -72,6 +73,7 @@ export const useCalendarVariantDefault = (): CalendarStyles => {
72
73
  },
73
74
  weekLabel: {
74
75
  fontSize: fontSize * 0.875,
76
+ lineHeight: Math.round(fontSize * 0.875 * 1.25),
75
77
  fontWeight: "500",
76
78
  fontFamily,
77
79
  color: colors.mutedForeground,
@@ -113,6 +115,7 @@ export const useCalendarVariantDefault = (): CalendarStyles => {
113
115
  dayText: {
114
116
  default: {
115
117
  fontSize,
118
+ lineHeight: Math.round(fontSize * 1.25),
116
119
  fontFamily,
117
120
  color: colors.foreground,
118
121
  fontWeight: "400",
@@ -29,6 +29,7 @@ export const useTimelineVariantDefault = (): TimelineStyles => {
29
29
  },
30
30
  timeText: {
31
31
  fontSize: fontSize * 0.75,
32
+ lineHeight: Math.round(fontSize * 0.75 * 1.25),
32
33
  fontWeight: "500",
33
34
  fontFamily,
34
35
  color: colors.mutedForeground,
@@ -21,6 +21,7 @@ export const useWeekCalendarVariantDefault = (): WeekCalendarStyles => {
21
21
  },
22
22
  headerTitle: {
23
23
  fontSize: fontSize * 1.125,
24
+ lineHeight: Math.round(fontSize * 1.125 * 1.25),
24
25
  fontWeight: "600",
25
26
  fontFamily,
26
27
  color: colors.foreground,
@@ -71,6 +72,7 @@ export const useWeekCalendarVariantDefault = (): WeekCalendarStyles => {
71
72
  },
72
73
  weekLabel: {
73
74
  fontSize: fontSize * 0.875,
75
+ lineHeight: Math.round(fontSize * 0.875 * 1.25),
74
76
  fontWeight: "500",
75
77
  fontFamily,
76
78
  color: colors.mutedForeground,
@@ -111,6 +113,7 @@ export const useWeekCalendarVariantDefault = (): WeekCalendarStyles => {
111
113
  dayText: {
112
114
  default: {
113
115
  fontSize,
116
+ lineHeight: Math.round(fontSize * 1.25),
114
117
  fontFamily,
115
118
  color: colors.foreground,
116
119
  fontWeight: "400",
@@ -22,6 +22,7 @@ export function useCardVariantDefault(): CardStyles {
22
22
  default: {
23
23
  fontFamily,
24
24
  fontSize: fontSize * 1.25,
25
+ lineHeight: Math.round(fontSize * 1.25 * 1.25),
25
26
  fontWeight: "600",
26
27
  color: colors.foreground,
27
28
  },
@@ -48,6 +48,7 @@ export const useCheckboxVariantDefault = (): CheckboxStyles => {
48
48
  default: {
49
49
  color: colors.foreground,
50
50
  fontSize,
51
+ lineHeight: Math.round(fontSize * 1.25),
51
52
  fontFamily,
52
53
  fontWeight: "500",
53
54
  },
@@ -59,6 +60,7 @@ export const useCheckboxVariantDefault = (): CheckboxStyles => {
59
60
  default: {
60
61
  color: colors.mutedForeground,
61
62
  fontSize: fontSize * 0.875,
63
+ lineHeight: Math.round(fontSize * 0.875 * 1.25),
62
64
  fontFamily,
63
65
  marginTop: 2,
64
66
  },
@@ -63,6 +63,7 @@ export const useCheckboxVariantOutlined = (): CheckboxStyles => {
63
63
  default: {
64
64
  color: colors.foreground,
65
65
  fontSize,
66
+ lineHeight: Math.round(fontSize * 1.25),
66
67
  fontFamily,
67
68
  fontWeight: "500",
68
69
  },
@@ -74,6 +75,7 @@ export const useCheckboxVariantOutlined = (): CheckboxStyles => {
74
75
  default: {
75
76
  color: colors.mutedForeground,
76
77
  fontSize: fontSize * 0.875,
78
+ lineHeight: Math.round(fontSize * 0.875 * 1.25),
77
79
  fontFamily,
78
80
  marginTop: 2,
79
81
  },
@@ -27,6 +27,7 @@ export function useComboboxVariantDefault(size: Size): ComboboxStyles {
27
27
  minHeight: s.height,
28
28
  fontFamily,
29
29
  fontSize: s.fontSize,
30
+ lineHeight: s.lineHeight,
30
31
  color: colors.foreground,
31
32
  outlineWidth: 0,
32
33
  pointerEvents: "auto",
@@ -76,6 +77,7 @@ export function useComboboxVariantDefault(size: Size): ComboboxStyles {
76
77
  paddingHorizontal: s.paddingHorizontal,
77
78
  fontFamily,
78
79
  fontSize: s.fontSize,
80
+ lineHeight: s.lineHeight,
79
81
  color: colors.foreground,
80
82
  borderRadius: radius / 2,
81
83
  },
@@ -95,6 +97,7 @@ export function useComboboxVariantDefault(size: Size): ComboboxStyles {
95
97
  paddingHorizontal: s.paddingHorizontal,
96
98
  fontFamily,
97
99
  fontSize: s.fontSize,
100
+ lineHeight: s.lineHeight,
98
101
  color: colors.mutedForeground,
99
102
  textAlign: "center",
100
103
  },
@@ -20,6 +20,7 @@ export function useEmptyVariantDefault(): EmptyStyles {
20
20
  title: {
21
21
  fontFamily: fontFamily,
22
22
  fontSize: fontSize,
23
+ lineHeight: Math.round(fontSize * 1.25),
23
24
  color: colors.foreground,
24
25
  textAlign: "center",
25
26
  fontWeight: "600",
@@ -27,6 +28,7 @@ export function useEmptyVariantDefault(): EmptyStyles {
27
28
  description: {
28
29
  fontFamily: fontFamily,
29
30
  fontSize: fontSize * 0.875,
31
+ lineHeight: Math.round(fontSize * 0.875 * 1.25),
30
32
  color: colors.mutedForeground,
31
33
  textAlign: "center",
32
34
  },
@@ -11,17 +11,20 @@ export const useFieldVariantDefault = (): FieldStyles => {
11
11
  label: {
12
12
  fontFamily,
13
13
  fontSize: fontSize * 0.875,
14
+ lineHeight: Math.round(fontSize * 0.875 * 1.25),
14
15
  fontWeight: "600",
15
16
  color: colors.foreground,
16
17
  },
17
18
  description: {
18
19
  fontFamily,
19
20
  fontSize: fontSize * 0.875,
21
+ lineHeight: Math.round(fontSize * 0.875 * 1.25),
20
22
  color: colors.mutedForeground,
21
23
  },
22
24
  error: {
23
25
  fontFamily,
24
26
  fontSize: fontSize * 0.875,
27
+ lineHeight: Math.round(fontSize * 0.875 * 1.25),
25
28
  color: colors.danger,
26
29
  },
27
30
  }),
@@ -23,6 +23,7 @@ export * from "./radio-group";
23
23
  export * from "./scroll-bar";
24
24
  export * from "./select";
25
25
  export * from "./separator";
26
+ export * from "./sidebar";
26
27
  export * from "./spinner";
27
28
  export * from "./table";
28
29
  export * from "./tabs";
@@ -19,6 +19,7 @@ export function useInputVariantDefault(size: Size): InputStyles {
19
19
  paddingHorizontal: s.paddingHorizontal,
20
20
  fontFamily,
21
21
  fontSize: s.fontSize,
22
+ lineHeight: s.lineHeight,
22
23
  height: s.height,
23
24
  color: colors.foreground,
24
25
  outlineWidth: 0,
@@ -19,6 +19,7 @@ export function useInputVariantSecondary(size: Size): InputStyles {
19
19
  paddingHorizontal: s.paddingHorizontal,
20
20
  fontFamily,
21
21
  fontSize: s.fontSize,
22
+ lineHeight: s.lineHeight,
22
23
  height: s.height,
23
24
  color: colors.foreground,
24
25
  outlineWidth: 0,
@@ -6,6 +6,7 @@ export function useLinkVariantDefault(): TextStyle {
6
6
  ({ colors, fontFamily, letterSpacing, fontSize }): TextStyle => ({
7
7
  color: colors.primary,
8
8
  fontSize,
9
+ lineHeight: Math.round(fontSize * 1.25),
9
10
  fontFamily,
10
11
  textDecorationLine: "underline",
11
12
  letterSpacing,
@@ -32,6 +32,7 @@ export const useMenuVariantDefault = (): MenuStyles => {
32
32
  itemText: {
33
33
  fontFamily: fontFamily,
34
34
  fontSize: fontSize,
35
+ lineHeight: Math.round(fontSize * 1.25),
35
36
  color: colors.foreground,
36
37
  },
37
38
  itemIcon: {
@@ -43,6 +44,7 @@ export const useMenuVariantDefault = (): MenuStyles => {
43
44
  paddingHorizontal: 16,
44
45
  fontFamily: fontFamily,
45
46
  fontSize: fontSize * 0.75,
47
+ lineHeight: Math.round(fontSize * 0.75 * 1.25),
46
48
  fontWeight: "600",
47
49
  color: colors.mutedForeground,
48
50
  },
@@ -89,6 +91,7 @@ export const useMenuVariantDefault = (): MenuStyles => {
89
91
  },
90
92
  shortcut: {
91
93
  fontSize: fontSize * 0.75,
94
+ lineHeight: Math.round(fontSize * 0.75 * 1.25),
92
95
  fontFamily: fontFamily,
93
96
  color: colors.mutedForeground,
94
97
  },
@@ -41,6 +41,7 @@ export function usePhoneInputVariantDefault(size: Size): PhoneInputStyles {
41
41
  default: {
42
42
  fontFamily,
43
43
  fontSize: s.fontSize,
44
+ lineHeight: s.lineHeight,
44
45
  color: colors.foreground,
45
46
  },
46
47
  disabled: {
@@ -61,6 +62,7 @@ export function usePhoneInputVariantDefault(size: Size): PhoneInputStyles {
61
62
  paddingHorizontal: s.paddingHorizontal,
62
63
  fontFamily,
63
64
  fontSize: s.fontSize,
65
+ lineHeight: s.lineHeight,
64
66
  color: colors.foreground,
65
67
  height: "100%",
66
68
  outlineWidth: 0,
@@ -105,6 +107,7 @@ export function usePhoneInputVariantDefault(size: Size): PhoneInputStyles {
105
107
  default: {
106
108
  fontFamily,
107
109
  fontSize: s.fontSize,
110
+ lineHeight: s.lineHeight,
108
111
  color: colors.foreground,
109
112
  },
110
113
  },
@@ -117,6 +120,7 @@ export function usePhoneInputVariantDefault(size: Size): PhoneInputStyles {
117
120
  paddingHorizontal: s.paddingHorizontal * 0.75,
118
121
  fontFamily,
119
122
  fontSize: s.fontSize * 0.875,
123
+ lineHeight: Math.round(s.fontSize * 0.875 * 1.25),
120
124
  color: colors.foreground,
121
125
  marginBottom: 4,
122
126
  outlineWidth: 0,
@@ -6,6 +6,20 @@ export function PortalHost() {
6
6
  return <></>;
7
7
  }
8
8
 
9
+ /**
10
+ * Prevent scroll-lock libraries (e.g. react-remove-scroll used by Radix/Vaul
11
+ * modals) from blocking scroll events inside the portal. These libraries
12
+ * register document-level wheel/touchmove listeners that call
13
+ * preventDefault() on events originating outside their managed "shards".
14
+ * Stopping propagation at the portal container keeps those handlers from
15
+ * firing while still allowing native scroll within the portal content.
16
+ */
17
+ function preventScrollLock(container: HTMLElement) {
18
+ const stop = (e: Event) => e.stopPropagation();
19
+ container.addEventListener("wheel", stop);
20
+ container.addEventListener("touchmove", stop);
21
+ }
22
+
9
23
  export function Portal({ name, hostName = DEFAULT_PORTAL_HOST, children }: PortalProps) {
10
24
  const [container] = useState(() => {
11
25
  let container = document.getElementById(hostName);
@@ -15,6 +29,7 @@ export function Portal({ name, hostName = DEFAULT_PORTAL_HOST, children }: Porta
15
29
  container.id = hostName;
16
30
  container.style.pointerEvents = "auto";
17
31
  document.body.appendChild(container);
32
+ preventScrollLock(container);
18
33
  }
19
34
  return container;
20
35
  });
@@ -55,6 +55,7 @@ export const useRadioGroupVariantDefault = (): RadioGroupStyles => {
55
55
  default: {
56
56
  color: colors.foreground,
57
57
  fontSize,
58
+ lineHeight: Math.round(fontSize * 1.25),
58
59
  fontFamily,
59
60
  fontWeight: "500",
60
61
  },
@@ -66,6 +67,7 @@ export const useRadioGroupVariantDefault = (): RadioGroupStyles => {
66
67
  default: {
67
68
  color: colors.mutedForeground,
68
69
  fontSize: fontSize * 0.875,
70
+ lineHeight: Math.round(fontSize * 0.875 * 1.25),
69
71
  fontFamily,
70
72
  marginTop: 2,
71
73
  },
@@ -67,6 +67,7 @@ export const useRadioGroupVariantOutlined = (): RadioGroupStyles => {
67
67
  default: {
68
68
  color: colors.foreground,
69
69
  fontSize,
70
+ lineHeight: Math.round(fontSize * 1.25),
70
71
  fontFamily,
71
72
  fontWeight: "500",
72
73
  },
@@ -78,6 +79,7 @@ export const useRadioGroupVariantOutlined = (): RadioGroupStyles => {
78
79
  default: {
79
80
  color: colors.mutedForeground,
80
81
  fontSize: fontSize * 0.875,
82
+ lineHeight: Math.round(fontSize * 0.875 * 1.25),
81
83
  fontFamily,
82
84
  marginTop: 2,
83
85
  },
@@ -29,6 +29,7 @@ export function useSelectVariantDefault(size: Size): SelectStyles {
29
29
  default: {
30
30
  fontFamily,
31
31
  fontSize: s.fontSize,
32
+ lineHeight: s.lineHeight,
32
33
  color: colors.foreground,
33
34
  },
34
35
  disabled: {
@@ -39,6 +40,7 @@ export function useSelectVariantDefault(size: Size): SelectStyles {
39
40
  default: {
40
41
  fontFamily,
41
42
  fontSize: s.fontSize,
43
+ lineHeight: s.lineHeight,
42
44
  color: colors.mutedForeground,
43
45
  },
44
46
  disabled: {
@@ -69,6 +71,7 @@ export function useSelectVariantDefault(size: Size): SelectStyles {
69
71
  paddingHorizontal: s.paddingHorizontal,
70
72
  fontFamily,
71
73
  fontSize: s.fontSize,
74
+ lineHeight: s.lineHeight,
72
75
  color: colors.foreground,
73
76
  borderRadius: radius / 2,
74
77
  },
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import { ScrollView, type StyleProp, type ViewStyle } from "react-native";
3
+ import { useSidebar } from "../context";
4
+
5
+ export interface SidebarContentProps {
6
+ children?: React.ReactNode;
7
+ style?: StyleProp<ViewStyle>;
8
+ }
9
+
10
+ export function SidebarContent(props: SidebarContentProps) {
11
+ const { children, style } = props;
12
+ const sidebar = useSidebar();
13
+
14
+ return (
15
+ <ScrollView style={[sidebar.styles?.content, style]} showsVerticalScrollIndicator={false}>
16
+ {children}
17
+ </ScrollView>
18
+ );
19
+ }
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { type StyleProp, View, type ViewStyle } from "react-native";
3
+ import { useSidebar } from "../context";
4
+
5
+ export interface SidebarFooterProps {
6
+ children?: React.ReactNode;
7
+ style?: StyleProp<ViewStyle>;
8
+ }
9
+
10
+ export function SidebarFooter(props: SidebarFooterProps) {
11
+ const { children, style } = props;
12
+ const sidebar = useSidebar();
13
+
14
+ return <View style={[sidebar.styles?.footer, style]}>{children}</View>;
15
+ }
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { type StyleProp, Text, type TextStyle } from "react-native";
3
+ import { useSidebar } from "../context";
4
+
5
+ export interface SidebarGroupLabelProps {
6
+ children?: React.ReactNode;
7
+ style?: StyleProp<TextStyle>;
8
+ }
9
+
10
+ export function SidebarGroupLabel(props: SidebarGroupLabelProps) {
11
+ const { children, style } = props;
12
+ const sidebar = useSidebar();
13
+
14
+ return <Text style={[sidebar.styles?.groupLabel, style]}>{children}</Text>;
15
+ }
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { type StyleProp, View, type ViewStyle } from "react-native";
3
+ import { useSidebar } from "../context";
4
+
5
+ export interface SidebarGroupProps {
6
+ children?: React.ReactNode;
7
+ style?: StyleProp<ViewStyle>;
8
+ }
9
+
10
+ export function SidebarGroup(props: SidebarGroupProps) {
11
+ const { children, style } = props;
12
+ const sidebar = useSidebar();
13
+
14
+ return <View style={[sidebar.styles?.group, style]}>{children}</View>;
15
+ }
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { type StyleProp, View, type ViewStyle } from "react-native";
3
+ import { useSidebar } from "../context";
4
+
5
+ export interface SidebarHeaderProps {
6
+ children?: React.ReactNode;
7
+ style?: StyleProp<ViewStyle>;
8
+ }
9
+
10
+ export function SidebarHeader(props: SidebarHeaderProps) {
11
+ const { children, style } = props;
12
+ const sidebar = useSidebar();
13
+
14
+ return <View style={[sidebar.styles?.header, style]}>{children}</View>;
15
+ }
@@ -0,0 +1,61 @@
1
+ import React, { useState } from "react";
2
+ import {
3
+ Pressable,
4
+ type PressableProps,
5
+ type StyleProp,
6
+ StyleSheet,
7
+ type ViewStyle,
8
+ } from "react-native";
9
+ import { useOrganizedChildren } from "../../../hooks/use-organized-children";
10
+ import { useSidebar } from "../context";
11
+ import type { SidebarMenuButtonState } from "../types";
12
+
13
+ export interface SidebarMenuItemProps extends Omit<PressableProps, "style"> {
14
+ children?: React.ReactNode;
15
+
16
+ /** Mark as active item */
17
+ isActive?: boolean;
18
+
19
+ /** Size variant */
20
+ size?: "default" | "lg";
21
+
22
+ style?: StyleProp<ViewStyle>;
23
+ }
24
+
25
+ export function SidebarMenuItem(props: SidebarMenuItemProps) {
26
+ const { children, isActive, size = "default", style, onPress, ...rest } = props;
27
+ const sidebar = useSidebar();
28
+ const [isHovered, setIsHovered] = useState(false);
29
+ const styles = sidebar.styles;
30
+
31
+ const state: SidebarMenuButtonState = isActive ? "active" : isHovered ? "hovered" : "default";
32
+
33
+ const textStyle = StyleSheet.flatten([
34
+ styles?.menuItemText?.default,
35
+ styles?.menuItemText?.[state],
36
+ ]);
37
+
38
+ const iconProps = StyleSheet.flatten([
39
+ styles?.menuItemIcon?.default,
40
+ styles?.menuItemIcon?.[state],
41
+ ]);
42
+
43
+ const organizedChildren = useOrganizedChildren(children, textStyle, iconProps);
44
+
45
+ return (
46
+ <Pressable
47
+ {...rest}
48
+ onPress={onPress}
49
+ onHoverIn={() => setIsHovered(true)}
50
+ onHoverOut={() => setIsHovered(false)}
51
+ style={[
52
+ styles?.menuItem?.default,
53
+ state !== "default" && styles?.menuItem?.[state],
54
+ size === "lg" && { minHeight: 48, paddingVertical: 8 },
55
+ style,
56
+ ]}
57
+ >
58
+ {organizedChildren}
59
+ </Pressable>
60
+ );
61
+ }
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { type StyleProp, View, type ViewStyle } from "react-native";
3
+ import { useSidebar } from "../context";
4
+
5
+ export interface SidebarMenuSubProps {
6
+ children?: React.ReactNode;
7
+
8
+ /** Whether the submenu is open (controlled) */
9
+ open?: boolean;
10
+
11
+ style?: StyleProp<ViewStyle>;
12
+ }
13
+
14
+ export function SidebarMenuSub(props: SidebarMenuSubProps) {
15
+ const { children, open = true, style } = props;
16
+ const sidebar = useSidebar();
17
+
18
+ if (!open) {
19
+ return null;
20
+ }
21
+
22
+ return <View style={[sidebar.styles?.menuSub, style]}>{children}</View>;
23
+ }
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { type StyleProp, View, type ViewStyle } from "react-native";
3
+ import { useSidebar } from "../context";
4
+
5
+ export interface SidebarMenuProps {
6
+ children?: React.ReactNode;
7
+ style?: StyleProp<ViewStyle>;
8
+ }
9
+
10
+ export function SidebarMenu(props: SidebarMenuProps) {
11
+ const { children, style } = props;
12
+ const sidebar = useSidebar();
13
+
14
+ return <View style={[sidebar.styles?.menu, style]}>{children}</View>;
15
+ }