@korsolutions/ui 0.0.85 → 0.0.87

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 (209) hide show
  1. package/AGENTS.md +3 -3
  2. package/dist/module/components/alert-dialog/components/alert-dialog-root.js +1 -1
  3. package/dist/module/components/alert-dialog/components/alert-dialog-root.js.map +1 -1
  4. package/dist/module/components/alert-dialog/variants/default.js +93 -85
  5. package/dist/module/components/alert-dialog/variants/default.js.map +1 -1
  6. package/dist/module/components/button/button.js +1 -1
  7. package/dist/module/components/button/button.js.map +1 -1
  8. package/dist/module/components/button/variants/default.js +48 -44
  9. package/dist/module/components/button/variants/default.js.map +1 -1
  10. package/dist/module/components/button/variants/ghost.js +64 -60
  11. package/dist/module/components/button/variants/ghost.js.map +1 -1
  12. package/dist/module/components/button/variants/secondary.js +66 -62
  13. package/dist/module/components/button/variants/secondary.js.map +1 -1
  14. package/dist/module/components/combobox/components/combobox-root.js +1 -1
  15. package/dist/module/components/combobox/components/combobox-root.js.map +1 -1
  16. package/dist/module/components/combobox/variants/default.js +91 -88
  17. package/dist/module/components/combobox/variants/default.js.map +1 -1
  18. package/dist/module/components/icon-button/icon-button.js +4 -5
  19. package/dist/module/components/icon-button/icon-button.js.map +1 -1
  20. package/dist/module/components/icon-button/variants/default.js +31 -24
  21. package/dist/module/components/icon-button/variants/default.js.map +1 -1
  22. package/dist/module/components/icon-button/variants/ghost.js +32 -25
  23. package/dist/module/components/icon-button/variants/ghost.js.map +1 -1
  24. package/dist/module/components/icon-button/variants/secondary.js +34 -27
  25. package/dist/module/components/icon-button/variants/secondary.js.map +1 -1
  26. package/dist/module/components/index.js +1 -0
  27. package/dist/module/components/index.js.map +1 -1
  28. package/dist/module/components/input/input.js +1 -1
  29. package/dist/module/components/input/input.js.map +1 -1
  30. package/dist/module/components/input/variants/default.js +39 -37
  31. package/dist/module/components/input/variants/default.js.map +1 -1
  32. package/dist/module/components/input/variants/secondary.js +39 -37
  33. package/dist/module/components/input/variants/secondary.js.map +1 -1
  34. package/dist/module/components/phone-input/components/phone-input-root.js +2 -1
  35. package/dist/module/components/phone-input/components/phone-input-root.js.map +1 -1
  36. package/dist/module/components/phone-input/variants/default.js +115 -112
  37. package/dist/module/components/phone-input/variants/default.js.map +1 -1
  38. package/dist/module/components/select/components/select-root.js +1 -1
  39. package/dist/module/components/select/components/select-root.js.map +1 -1
  40. package/dist/module/components/select/variants/default.js +75 -73
  41. package/dist/module/components/select/variants/default.js.map +1 -1
  42. package/dist/module/components/sidebar/components/sidebar-content.js +19 -0
  43. package/dist/module/components/sidebar/components/sidebar-content.js.map +1 -0
  44. package/dist/module/components/sidebar/components/sidebar-footer.js +18 -0
  45. package/dist/module/components/sidebar/components/sidebar-footer.js.map +1 -0
  46. package/dist/module/components/sidebar/components/sidebar-group-label.js +18 -0
  47. package/dist/module/components/sidebar/components/sidebar-group-label.js.map +1 -0
  48. package/dist/module/components/sidebar/components/sidebar-group.js +18 -0
  49. package/dist/module/components/sidebar/components/sidebar-group.js.map +1 -0
  50. package/dist/module/components/sidebar/components/sidebar-header.js +18 -0
  51. package/dist/module/components/sidebar/components/sidebar-header.js.map +1 -0
  52. package/dist/module/components/sidebar/components/sidebar-menu-item.js +36 -0
  53. package/dist/module/components/sidebar/components/sidebar-menu-item.js.map +1 -0
  54. package/dist/module/components/sidebar/components/sidebar-menu-sub.js +22 -0
  55. package/dist/module/components/sidebar/components/sidebar-menu-sub.js.map +1 -0
  56. package/dist/module/components/sidebar/components/sidebar-menu.js +18 -0
  57. package/dist/module/components/sidebar/components/sidebar-menu.js.map +1 -0
  58. package/dist/module/components/sidebar/components/sidebar-provider.js +47 -0
  59. package/dist/module/components/sidebar/components/sidebar-provider.js.map +1 -0
  60. package/dist/module/components/sidebar/components/sidebar-root.js +27 -0
  61. package/dist/module/components/sidebar/components/sidebar-root.js.map +1 -0
  62. package/dist/module/components/sidebar/context.js +12 -0
  63. package/dist/module/components/sidebar/context.js.map +1 -0
  64. package/dist/module/components/sidebar/index.js +26 -0
  65. package/dist/module/components/sidebar/index.js.map +1 -0
  66. package/dist/module/components/sidebar/types.js +4 -0
  67. package/dist/module/components/sidebar/types.js.map +1 -0
  68. package/dist/module/components/sidebar/variants/default.js +101 -0
  69. package/dist/module/components/sidebar/variants/default.js.map +1 -0
  70. package/dist/module/components/sidebar/variants/index.js +7 -0
  71. package/dist/module/components/sidebar/variants/index.js.map +1 -0
  72. package/dist/module/themes/default/index.js +1 -0
  73. package/dist/module/themes/default/index.js.map +1 -1
  74. package/dist/module/themes/provider.js +1 -0
  75. package/dist/module/themes/provider.js.map +1 -1
  76. package/dist/module/themes/utils.js +2 -1
  77. package/dist/module/themes/utils.js.map +1 -1
  78. package/dist/module/utils/size-scale.js +42 -0
  79. package/dist/module/utils/size-scale.js.map +1 -0
  80. package/dist/module/utils/use-themed-styles.js +4 -1
  81. package/dist/module/utils/use-themed-styles.js.map +1 -1
  82. package/dist/typescript/src/components/alert-dialog/components/alert-dialog-root.d.ts +2 -0
  83. package/dist/typescript/src/components/alert-dialog/components/alert-dialog-root.d.ts.map +1 -1
  84. package/dist/typescript/src/components/alert-dialog/variants/default.d.ts +3 -2
  85. package/dist/typescript/src/components/alert-dialog/variants/default.d.ts.map +1 -1
  86. package/dist/typescript/src/components/alert-dialog/variants/index.d.ts +1 -1
  87. package/dist/typescript/src/components/button/button.d.ts +2 -0
  88. package/dist/typescript/src/components/button/button.d.ts.map +1 -1
  89. package/dist/typescript/src/components/button/variants/default.d.ts +2 -1
  90. package/dist/typescript/src/components/button/variants/default.d.ts.map +1 -1
  91. package/dist/typescript/src/components/button/variants/ghost.d.ts +2 -1
  92. package/dist/typescript/src/components/button/variants/ghost.d.ts.map +1 -1
  93. package/dist/typescript/src/components/button/variants/index.d.ts +3 -3
  94. package/dist/typescript/src/components/button/variants/secondary.d.ts +2 -1
  95. package/dist/typescript/src/components/button/variants/secondary.d.ts.map +1 -1
  96. package/dist/typescript/src/components/combobox/components/combobox-root.d.ts +2 -0
  97. package/dist/typescript/src/components/combobox/components/combobox-root.d.ts.map +1 -1
  98. package/dist/typescript/src/components/combobox/variants/default.d.ts +2 -1
  99. package/dist/typescript/src/components/combobox/variants/default.d.ts.map +1 -1
  100. package/dist/typescript/src/components/icon-button/icon-button.d.ts +2 -1
  101. package/dist/typescript/src/components/icon-button/icon-button.d.ts.map +1 -1
  102. package/dist/typescript/src/components/icon-button/variants/default.d.ts +2 -1
  103. package/dist/typescript/src/components/icon-button/variants/default.d.ts.map +1 -1
  104. package/dist/typescript/src/components/icon-button/variants/ghost.d.ts +2 -1
  105. package/dist/typescript/src/components/icon-button/variants/ghost.d.ts.map +1 -1
  106. package/dist/typescript/src/components/icon-button/variants/index.d.ts +3 -3
  107. package/dist/typescript/src/components/icon-button/variants/secondary.d.ts +2 -1
  108. package/dist/typescript/src/components/icon-button/variants/secondary.d.ts.map +1 -1
  109. package/dist/typescript/src/components/index.d.ts +1 -0
  110. package/dist/typescript/src/components/index.d.ts.map +1 -1
  111. package/dist/typescript/src/components/input/input.d.ts +2 -0
  112. package/dist/typescript/src/components/input/input.d.ts.map +1 -1
  113. package/dist/typescript/src/components/input/variants/default.d.ts +2 -1
  114. package/dist/typescript/src/components/input/variants/default.d.ts.map +1 -1
  115. package/dist/typescript/src/components/input/variants/secondary.d.ts +3 -2
  116. package/dist/typescript/src/components/input/variants/secondary.d.ts.map +1 -1
  117. package/dist/typescript/src/components/phone-input/components/phone-input-root.d.ts +3 -1
  118. package/dist/typescript/src/components/phone-input/components/phone-input-root.d.ts.map +1 -1
  119. package/dist/typescript/src/components/phone-input/variants/default.d.ts +2 -1
  120. package/dist/typescript/src/components/phone-input/variants/default.d.ts.map +1 -1
  121. package/dist/typescript/src/components/select/components/select-root.d.ts +2 -0
  122. package/dist/typescript/src/components/select/components/select-root.d.ts.map +1 -1
  123. package/dist/typescript/src/components/select/variants/default.d.ts +3 -2
  124. package/dist/typescript/src/components/select/variants/default.d.ts.map +1 -1
  125. package/dist/typescript/src/components/sidebar/components/sidebar-content.d.ts +8 -0
  126. package/dist/typescript/src/components/sidebar/components/sidebar-content.d.ts.map +1 -0
  127. package/dist/typescript/src/components/sidebar/components/sidebar-footer.d.ts +8 -0
  128. package/dist/typescript/src/components/sidebar/components/sidebar-footer.d.ts.map +1 -0
  129. package/dist/typescript/src/components/sidebar/components/sidebar-group-label.d.ts +8 -0
  130. package/dist/typescript/src/components/sidebar/components/sidebar-group-label.d.ts.map +1 -0
  131. package/dist/typescript/src/components/sidebar/components/sidebar-group.d.ts +8 -0
  132. package/dist/typescript/src/components/sidebar/components/sidebar-group.d.ts.map +1 -0
  133. package/dist/typescript/src/components/sidebar/components/sidebar-header.d.ts +8 -0
  134. package/dist/typescript/src/components/sidebar/components/sidebar-header.d.ts.map +1 -0
  135. package/dist/typescript/src/components/sidebar/components/sidebar-menu-item.d.ts +12 -0
  136. package/dist/typescript/src/components/sidebar/components/sidebar-menu-item.d.ts.map +1 -0
  137. package/dist/typescript/src/components/sidebar/components/sidebar-menu-sub.d.ts +10 -0
  138. package/dist/typescript/src/components/sidebar/components/sidebar-menu-sub.d.ts.map +1 -0
  139. package/dist/typescript/src/components/sidebar/components/sidebar-menu.d.ts +8 -0
  140. package/dist/typescript/src/components/sidebar/components/sidebar-menu.d.ts.map +1 -0
  141. package/dist/typescript/src/components/sidebar/components/sidebar-provider.d.ts +17 -0
  142. package/dist/typescript/src/components/sidebar/components/sidebar-provider.d.ts.map +1 -0
  143. package/dist/typescript/src/components/sidebar/components/sidebar-root.d.ts +8 -0
  144. package/dist/typescript/src/components/sidebar/components/sidebar-root.d.ts.map +1 -0
  145. package/dist/typescript/src/components/sidebar/context.d.ts +12 -0
  146. package/dist/typescript/src/components/sidebar/context.d.ts.map +1 -0
  147. package/dist/typescript/src/components/sidebar/index.d.ts +35 -0
  148. package/dist/typescript/src/components/sidebar/index.d.ts.map +1 -0
  149. package/dist/typescript/src/components/sidebar/types.d.ts +29 -0
  150. package/dist/typescript/src/components/sidebar/types.d.ts.map +1 -0
  151. package/dist/typescript/src/components/sidebar/variants/default.d.ts +3 -0
  152. package/dist/typescript/src/components/sidebar/variants/default.d.ts.map +1 -0
  153. package/dist/typescript/src/components/sidebar/variants/index.d.ts +5 -0
  154. package/dist/typescript/src/components/sidebar/variants/index.d.ts.map +1 -0
  155. package/dist/typescript/src/index.d.ts +2 -0
  156. package/dist/typescript/src/index.d.ts.map +1 -1
  157. package/dist/typescript/src/themes/default/index.d.ts.map +1 -1
  158. package/dist/typescript/src/themes/provider.d.ts +1 -0
  159. package/dist/typescript/src/themes/provider.d.ts.map +1 -1
  160. package/dist/typescript/src/themes/types.d.ts +5 -0
  161. package/dist/typescript/src/themes/types.d.ts.map +1 -1
  162. package/dist/typescript/src/themes/utils.d.ts.map +1 -1
  163. package/dist/typescript/src/utils/size-scale.d.ts +20 -0
  164. package/dist/typescript/src/utils/size-scale.d.ts.map +1 -0
  165. package/dist/typescript/src/utils/use-themed-styles.d.ts +5 -0
  166. package/dist/typescript/src/utils/use-themed-styles.d.ts.map +1 -1
  167. package/package.json +2 -2
  168. package/src/components/alert-dialog/components/alert-dialog-root.tsx +3 -1
  169. package/src/components/alert-dialog/variants/default.tsx +88 -79
  170. package/src/components/button/button.tsx +3 -1
  171. package/src/components/button/variants/default.tsx +14 -10
  172. package/src/components/button/variants/ghost.tsx +14 -10
  173. package/src/components/button/variants/secondary.tsx +14 -10
  174. package/src/components/combobox/components/combobox-root.tsx +3 -1
  175. package/src/components/combobox/variants/default.tsx +17 -14
  176. package/src/components/icon-button/icon-button.tsx +6 -6
  177. package/src/components/icon-button/variants/default.tsx +12 -6
  178. package/src/components/icon-button/variants/ghost.tsx +12 -6
  179. package/src/components/icon-button/variants/secondary.tsx +12 -6
  180. package/src/components/index.ts +1 -0
  181. package/src/components/input/input.tsx +3 -1
  182. package/src/components/input/variants/default.tsx +11 -9
  183. package/src/components/input/variants/secondary.tsx +12 -10
  184. package/src/components/phone-input/components/phone-input-root.tsx +4 -1
  185. package/src/components/phone-input/variants/default.tsx +21 -18
  186. package/src/components/select/components/select-root.tsx +3 -1
  187. package/src/components/select/variants/default.tsx +16 -14
  188. package/src/components/sidebar/components/sidebar-content.tsx +19 -0
  189. package/src/components/sidebar/components/sidebar-footer.tsx +15 -0
  190. package/src/components/sidebar/components/sidebar-group-label.tsx +15 -0
  191. package/src/components/sidebar/components/sidebar-group.tsx +15 -0
  192. package/src/components/sidebar/components/sidebar-header.tsx +15 -0
  193. package/src/components/sidebar/components/sidebar-menu-item.tsx +61 -0
  194. package/src/components/sidebar/components/sidebar-menu-sub.tsx +23 -0
  195. package/src/components/sidebar/components/sidebar-menu.tsx +15 -0
  196. package/src/components/sidebar/components/sidebar-provider.tsx +73 -0
  197. package/src/components/sidebar/components/sidebar-root.tsx +19 -0
  198. package/src/components/sidebar/context.ts +21 -0
  199. package/src/components/sidebar/index.ts +37 -0
  200. package/src/components/sidebar/types.ts +31 -0
  201. package/src/components/sidebar/variants/default.tsx +96 -0
  202. package/src/components/sidebar/variants/index.ts +5 -0
  203. package/src/index.tsx +2 -0
  204. package/src/themes/default/index.ts +1 -0
  205. package/src/themes/provider.tsx +2 -0
  206. package/src/themes/types.ts +5 -0
  207. package/src/themes/utils.ts +1 -0
  208. package/src/utils/size-scale.ts +45 -0
  209. package/src/utils/use-themed-styles.ts +8 -0
@@ -1,84 +1,93 @@
1
- import { type AlertDialogStyles } from "../..";
1
+ import type { Size } from "../../../utils/size-scale";
2
2
  import { useThemedStyles } from "../../../utils/use-themed-styles";
3
+ import { type AlertDialogStyles } from "../types";
3
4
 
4
- export const useAlertDialogVariantDefault = (): AlertDialogStyles => {
5
+ export const useAlertDialogVariantDefault = (size: Size): AlertDialogStyles => {
5
6
  return useThemedStyles(
6
- ({ colors, radius, fontFamily, fontSize }): AlertDialogStyles => ({
7
- overlay: {
8
- position: "absolute",
9
- top: 0,
10
- left: 0,
11
- right: 0,
12
- bottom: 0,
13
- backgroundColor: "rgba(0, 0, 0, 0.5)",
14
- justifyContent: "center",
15
- alignItems: "center",
16
- zIndex: 999,
17
- },
18
- content: {
19
- backgroundColor: colors.background,
20
- borderRadius: radius,
21
- padding: 24,
22
- maxWidth: 400,
23
- width: "90%",
24
- shadowColor: "#000",
25
- shadowOffset: { width: 0, height: 2 },
26
- shadowOpacity: 0.25,
27
- shadowRadius: 8,
28
- elevation: 5,
29
- position: "absolute",
30
- top: "50%",
31
- left: "50%",
32
- transform: [{ translateX: "-50%" }, { translateY: "-50%" }],
33
- borderWidth: 1,
34
- borderColor: colors.border,
35
- zIndex: 1000,
36
- },
37
- title: {
38
- fontSize: fontSize * 1.25,
39
- fontWeight: "600",
40
- color: colors.foreground,
41
- fontFamily,
42
- marginBottom: 8,
43
- },
44
- description: {
45
- fontSize,
46
- color: colors.mutedForeground,
47
- fontFamily,
48
- lineHeight: fontSize * 1.5,
49
- },
50
- footer: {
51
- flexDirection: "row",
52
- justifyContent: "flex-end",
53
- gap: 12,
54
- marginTop: 24,
55
- },
56
- cancel: {
57
- paddingVertical: 10,
58
- paddingHorizontal: 16,
59
- borderRadius: radius,
60
- borderWidth: 1,
61
- borderColor: colors.border,
62
- backgroundColor: colors.background,
63
- },
64
- cancelText: {
65
- color: colors.foreground,
66
- fontSize,
67
- fontWeight: "500",
68
- fontFamily,
69
- },
70
- action: {
71
- paddingVertical: 10,
72
- paddingHorizontal: 16,
73
- borderRadius: radius,
74
- backgroundColor: colors.primary,
75
- },
76
- actionText: {
77
- color: colors.primaryForeground,
78
- fontSize,
79
- fontWeight: "500",
80
- fontFamily,
81
- },
82
- }),
7
+ ({ colors, radius, fontFamily, fontSize, sizeScale }): AlertDialogStyles => {
8
+ const s = sizeScale(size);
9
+
10
+ return {
11
+ overlay: {
12
+ position: "absolute",
13
+ top: 0,
14
+ left: 0,
15
+ right: 0,
16
+ bottom: 0,
17
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
18
+ justifyContent: "center",
19
+ alignItems: "center",
20
+ zIndex: 999,
21
+ },
22
+ content: {
23
+ backgroundColor: colors.background,
24
+ borderRadius: radius,
25
+ padding: 24,
26
+ maxWidth: 400,
27
+ width: "90%",
28
+ shadowColor: "#000",
29
+ shadowOffset: { width: 0, height: 2 },
30
+ shadowOpacity: 0.25,
31
+ shadowRadius: 8,
32
+ elevation: 5,
33
+ position: "absolute",
34
+ top: "50%",
35
+ left: "50%",
36
+ transform: [{ translateX: "-50%" }, { translateY: "-50%" }],
37
+ borderWidth: 1,
38
+ borderColor: colors.border,
39
+ zIndex: 1000,
40
+ },
41
+ title: {
42
+ fontSize: fontSize * 1.25,
43
+ fontWeight: "600",
44
+ color: colors.foreground,
45
+ fontFamily,
46
+ marginBottom: 8,
47
+ },
48
+ description: {
49
+ fontSize,
50
+ color: colors.mutedForeground,
51
+ fontFamily,
52
+ lineHeight: fontSize * 1.5,
53
+ },
54
+ footer: {
55
+ flexDirection: "row",
56
+ justifyContent: "flex-end",
57
+ gap: s.gap,
58
+ marginTop: 24,
59
+ },
60
+ cancel: {
61
+ height: s.height,
62
+ paddingHorizontal: s.paddingHorizontal,
63
+ borderRadius: radius,
64
+ borderWidth: 1,
65
+ borderColor: colors.border,
66
+ backgroundColor: colors.background,
67
+ justifyContent: "center",
68
+ alignItems: "center",
69
+ },
70
+ cancelText: {
71
+ color: colors.foreground,
72
+ fontSize: s.fontSize,
73
+ fontWeight: "500",
74
+ fontFamily,
75
+ },
76
+ action: {
77
+ height: s.height,
78
+ paddingHorizontal: s.paddingHorizontal,
79
+ borderRadius: radius,
80
+ backgroundColor: colors.primary,
81
+ justifyContent: "center",
82
+ alignItems: "center",
83
+ },
84
+ actionText: {
85
+ color: colors.primaryForeground,
86
+ fontSize: s.fontSize,
87
+ fontWeight: "500",
88
+ fontFamily,
89
+ },
90
+ };
91
+ },
83
92
  );
84
93
  };
@@ -10,11 +10,13 @@ import {
10
10
  import { useOrganizedChildren } from "../../hooks/use-organized-children";
11
11
  import { useComponentConfig } from "../../themes/provider";
12
12
  import { mergeStyles } from "../../utils/calculate-styles";
13
+ import type { Size } from "../../utils/size-scale";
13
14
  import type { ButtonState } from "./types";
14
15
  import { ButtonVariants } from "./variants";
15
16
 
16
17
  export interface ButtonProps extends Omit<PressableProps, "disabled"> {
17
18
  variant?: keyof typeof ButtonVariants;
19
+ size?: Size;
18
20
  children?: React.ReactNode;
19
21
 
20
22
  isDisabled?: boolean;
@@ -31,7 +33,7 @@ const calculateState = (props: ButtonProps, isHovered: boolean): ButtonState =>
31
33
  };
32
34
 
33
35
  export function Button(props: ButtonProps) {
34
- const variantStyles = ButtonVariants[props.variant ?? "default"]();
36
+ const variantStyles = ButtonVariants[props.variant ?? "default"](props.size ?? "md");
35
37
  const componentConfig = useComponentConfig("button");
36
38
  const [isHovered, setIsHovered] = useState(false);
37
39
 
@@ -1,18 +1,21 @@
1
1
  import type { CursorValue } from "react-native";
2
2
  import { hslaSetRelativeLightness } from "../../../utils/hsla-utils";
3
+ import type { Size } from "../../../utils/size-scale";
3
4
  import { useThemedStyles } from "../../../utils/use-themed-styles";
4
5
  import type { ButtonStyles } from "../types";
5
6
 
6
- export const useButtonVariantDefault = (): ButtonStyles => {
7
- return useThemedStyles(
8
- ({ colors, radius, fontFamily, fontSize }): ButtonStyles => ({
7
+ export const useButtonVariantDefault = (size: Size): ButtonStyles => {
8
+ return useThemedStyles(({ colors, radius, fontFamily, sizeScale }): ButtonStyles => {
9
+ const sizeStyles = sizeScale(size);
10
+
11
+ return {
9
12
  root: {
10
13
  default: {
11
14
  flexDirection: "row",
12
- paddingVertical: 12,
13
- paddingHorizontal: 16,
15
+ height: sizeStyles.height,
16
+ paddingHorizontal: sizeStyles.paddingHorizontal,
14
17
  borderRadius: radius,
15
- gap: 8,
18
+ gap: sizeStyles.gap,
16
19
  alignItems: "center",
17
20
  justifyContent: "center",
18
21
  backgroundColor: colors.primary,
@@ -35,14 +38,15 @@ export const useButtonVariantDefault = (): ButtonStyles => {
35
38
  text: {
36
39
  default: {
37
40
  color: colors.primaryForeground,
38
- fontSize,
41
+ fontSize: sizeStyles.fontSize,
39
42
  fontFamily,
40
43
  },
41
44
  },
42
45
  icon: {
43
46
  default: {
44
47
  color: colors.primaryForeground,
45
- size: fontSize,
48
+ size: sizeStyles.iconSize,
49
+ strokeWidth: sizeStyles.strokeWidth,
46
50
  },
47
51
  },
48
52
  spinner: {
@@ -50,6 +54,6 @@ export const useButtonVariantDefault = (): ButtonStyles => {
50
54
  color: colors.primaryForeground,
51
55
  },
52
56
  },
53
- }),
54
- );
57
+ };
58
+ });
55
59
  };
@@ -1,18 +1,21 @@
1
1
  import type { CursorValue } from "react-native";
2
2
  import { hslaSetRelativeLightness } from "../../../utils/hsla-utils";
3
+ import type { Size } from "../../../utils/size-scale";
3
4
  import { useThemedStyles } from "../../../utils/use-themed-styles";
4
5
  import type { ButtonStyles } from "../types";
5
6
 
6
- export const useButtonVariantGhost = (): ButtonStyles => {
7
- return useThemedStyles(
8
- ({ colors, radius, fontFamily, fontSize }): ButtonStyles => ({
7
+ export const useButtonVariantGhost = (size: Size): ButtonStyles => {
8
+ return useThemedStyles(({ colors, radius, fontFamily, sizeScale }): ButtonStyles => {
9
+ const sizeStyles = sizeScale(size);
10
+
11
+ return {
9
12
  root: {
10
13
  default: {
11
14
  flexDirection: "row",
12
- paddingVertical: 12,
13
- paddingHorizontal: 16,
15
+ height: sizeStyles.height,
16
+ paddingHorizontal: sizeStyles.paddingHorizontal,
14
17
  borderRadius: radius,
15
- gap: 8,
18
+ gap: sizeStyles.gap,
16
19
  alignItems: "center",
17
20
  justifyContent: "center",
18
21
  backgroundColor: "transparent",
@@ -33,7 +36,7 @@ export const useButtonVariantGhost = (): ButtonStyles => {
33
36
  text: {
34
37
  default: {
35
38
  color: colors.foreground,
36
- fontSize,
39
+ fontSize: sizeStyles.fontSize,
37
40
  fontFamily,
38
41
  },
39
42
  disabled: {
@@ -46,7 +49,8 @@ export const useButtonVariantGhost = (): ButtonStyles => {
46
49
  icon: {
47
50
  default: {
48
51
  color: colors.foreground,
49
- size: fontSize,
52
+ size: sizeStyles.iconSize,
53
+ strokeWidth: sizeStyles.strokeWidth,
50
54
  },
51
55
  disabled: {
52
56
  color: colors.mutedForeground,
@@ -66,6 +70,6 @@ export const useButtonVariantGhost = (): ButtonStyles => {
66
70
  color: colors.mutedForeground,
67
71
  },
68
72
  },
69
- }),
70
- );
73
+ };
74
+ });
71
75
  };
@@ -1,18 +1,21 @@
1
1
  import type { CursorValue } from "react-native";
2
2
  import { hslaSetRelativeLightness } from "../../../utils/hsla-utils";
3
+ import type { Size } from "../../../utils/size-scale";
3
4
  import { useThemedStyles } from "../../../utils/use-themed-styles";
4
5
  import type { ButtonStyles } from "../types";
5
6
 
6
- export const useButtonVariantSecondary = (): ButtonStyles => {
7
- return useThemedStyles(
8
- ({ colors, radius, fontFamily, fontSize }): ButtonStyles => ({
7
+ export const useButtonVariantSecondary = (size: Size): ButtonStyles => {
8
+ return useThemedStyles(({ colors, radius, fontFamily, sizeScale }): ButtonStyles => {
9
+ const sizeStyles = sizeScale(size);
10
+
11
+ return {
9
12
  root: {
10
13
  default: {
11
14
  flexDirection: "row",
12
- paddingVertical: 12,
13
- paddingHorizontal: 16,
15
+ height: sizeStyles.height,
16
+ paddingHorizontal: sizeStyles.paddingHorizontal,
14
17
  borderRadius: radius,
15
- gap: 8,
18
+ gap: sizeStyles.gap,
16
19
  alignItems: "center",
17
20
  justifyContent: "center",
18
21
  borderWidth: 1,
@@ -35,7 +38,7 @@ export const useButtonVariantSecondary = (): ButtonStyles => {
35
38
  text: {
36
39
  default: {
37
40
  color: colors.secondaryForeground,
38
- fontSize,
41
+ fontSize: sizeStyles.fontSize,
39
42
  fontFamily,
40
43
  },
41
44
  disabled: {
@@ -48,7 +51,8 @@ export const useButtonVariantSecondary = (): ButtonStyles => {
48
51
  icon: {
49
52
  default: {
50
53
  color: colors.secondaryForeground,
51
- size: fontSize,
54
+ size: sizeStyles.iconSize,
55
+ strokeWidth: sizeStyles.strokeWidth,
52
56
  },
53
57
  disabled: {
54
58
  color: colors.mutedForeground,
@@ -68,6 +72,6 @@ export const useButtonVariantSecondary = (): ButtonStyles => {
68
72
  color: colors.mutedForeground,
69
73
  },
70
74
  },
71
- }),
72
- );
75
+ };
76
+ });
73
77
  };
@@ -9,12 +9,14 @@ import {
9
9
  import { DEFAULT_LAYOUT, DEFAULT_POSITION, type LayoutPosition } from "../../../hooks";
10
10
  import { useComponentConfig } from "../../../themes/provider";
11
11
  import { mergeStyles } from "../../../utils/calculate-styles";
12
+ import type { Size } from "../../../utils/size-scale";
12
13
  import { ComboboxContext } from "../context";
13
14
  import type { ComboboxState } from "../types";
14
15
  import { ComboboxVariants } from "../variants";
15
16
 
16
17
  export interface ComboboxRootProps {
17
18
  variant?: keyof typeof ComboboxVariants;
19
+ size?: Size;
18
20
 
19
21
  value?: string;
20
22
  onChange?: (value: string) => void;
@@ -36,7 +38,7 @@ const calculateState = (props: ComboboxRootProps): ComboboxState => {
36
38
  };
37
39
 
38
40
  export function ComboboxRoot(props: ComboboxRootProps) {
39
- const variantStyles = ComboboxVariants[props.variant ?? "default"]();
41
+ const variantStyles = ComboboxVariants[props.variant ?? "default"](props.size ?? "md");
40
42
  const globalStyles = useComponentConfig("combobox");
41
43
  const mergedStyles = mergeStyles(variantStyles, globalStyles?.styles);
42
44
 
@@ -1,10 +1,13 @@
1
1
  import { Platform } from "react-native";
2
+ import type { Size } from "../../../utils/size-scale";
2
3
  import { useThemedStyles } from "../../../utils/use-themed-styles";
3
4
  import { type ComboboxStyles } from "../types";
4
5
 
5
- export function useComboboxVariantDefault(): ComboboxStyles {
6
- return useThemedStyles(
7
- ({ colors, radius, fontFamily, fontSize }): ComboboxStyles => ({
6
+ export function useComboboxVariantDefault(size: Size): ComboboxStyles {
7
+ return useThemedStyles(({ colors, radius, fontFamily, sizeScale }): ComboboxStyles => {
8
+ const s = sizeScale(size);
9
+
10
+ return {
8
11
  root: {
9
12
  default: {},
10
13
  disabled: {},
@@ -20,10 +23,10 @@ export function useComboboxVariantDefault(): ComboboxStyles {
20
23
  backgroundColor: colors.surface,
21
24
  justifyContent: "center",
22
25
  paddingVertical: 4,
23
- paddingHorizontal: 16,
24
- minHeight: 48,
26
+ paddingHorizontal: s.paddingHorizontal,
27
+ minHeight: s.height,
25
28
  fontFamily,
26
- fontSize,
29
+ fontSize: s.fontSize,
27
30
  color: colors.foreground,
28
31
  outlineWidth: 0,
29
32
  pointerEvents: "auto",
@@ -69,10 +72,10 @@ export function useComboboxVariantDefault(): ComboboxStyles {
69
72
  },
70
73
  option: {
71
74
  default: {
72
- paddingVertical: 12,
73
- paddingHorizontal: 16,
75
+ paddingVertical: s.paddingVertical,
76
+ paddingHorizontal: s.paddingHorizontal,
74
77
  fontFamily,
75
- fontSize,
78
+ fontSize: s.fontSize,
76
79
  color: colors.foreground,
77
80
  borderRadius: radius / 2,
78
81
  },
@@ -88,15 +91,15 @@ export function useComboboxVariantDefault(): ComboboxStyles {
88
91
  },
89
92
  empty: {
90
93
  default: {
91
- paddingVertical: 12,
92
- paddingHorizontal: 16,
94
+ paddingVertical: s.paddingVertical,
95
+ paddingHorizontal: s.paddingHorizontal,
93
96
  fontFamily,
94
- fontSize,
97
+ fontSize: s.fontSize,
95
98
  color: colors.mutedForeground,
96
99
  textAlign: "center",
97
100
  },
98
101
  disabled: {},
99
102
  },
100
- }),
101
- );
103
+ };
104
+ });
102
105
  }
@@ -9,14 +9,15 @@ import {
9
9
  import { useComponentConfig } from "../../themes/provider";
10
10
  import type { SvgProps } from "../../types/props.types";
11
11
  import { mergeStyles } from "../../utils/calculate-styles";
12
+ import type { Size } from "../../utils/size-scale";
12
13
  import type { IconButtonState } from "./types";
13
14
  import { IconButtonVariants } from "./variants";
14
15
 
15
16
  export interface IconButtonProps extends Omit<PressableProps, "disabled" | "children"> {
16
17
  render: (props: SvgProps) => React.ReactNode;
17
18
  variant?: keyof typeof IconButtonVariants;
19
+ size?: Size;
18
20
  isDisabled?: boolean;
19
- size?: number;
20
21
  color?: SvgProps["color"];
21
22
  strokeWidth?: number;
22
23
  style?: StyleProp<ViewStyle>;
@@ -37,15 +38,15 @@ export function IconButton(props: IconButtonProps) {
37
38
  const {
38
39
  render: IconComponent,
39
40
  variant = "default",
41
+ size = "md",
40
42
  isDisabled,
41
- size,
42
43
  color,
43
44
  strokeWidth,
44
45
  style,
45
46
  ...rest
46
47
  } = props;
47
48
 
48
- const variantStyles = IconButtonVariants[variant]();
49
+ const variantStyles = IconButtonVariants[variant](size);
49
50
  const componentConfig = useComponentConfig("iconButton");
50
51
  const mergedStyles = mergeStyles(variantStyles, componentConfig?.styles);
51
52
 
@@ -61,10 +62,9 @@ export function IconButton(props: IconButtonProps) {
61
62
  };
62
63
 
63
64
  const iconProps: SvgProps = {
64
- size: size ?? mergedStyles.icon?.default?.size,
65
+ size: mergedStyles.icon?.default?.size,
65
66
  color: color ?? mergedStyles.icon?.[state]?.color ?? mergedStyles.icon?.default?.color,
66
- strokeWidth,
67
- absoluteStrokeWidth: true,
67
+ strokeWidth: strokeWidth ?? mergedStyles.icon?.default?.strokeWidth,
68
68
  };
69
69
 
70
70
  return (
@@ -1,15 +1,19 @@
1
1
  import { hslaSetRelativeLightness } from "../../../utils/hsla-utils";
2
+ import type { Size } from "../../../utils/size-scale";
2
3
  import { useThemedStyles } from "../../../utils/use-themed-styles";
3
4
  import type { IconButtonStyles } from "../types";
4
5
 
5
- export const useIconButtonVariantDefault = (): IconButtonStyles => {
6
- return useThemedStyles(
7
- ({ colors, radius }): IconButtonStyles => ({
6
+ export const useIconButtonVariantDefault = (size: Size): IconButtonStyles => {
7
+ return useThemedStyles(({ colors, radius, sizeScale }): IconButtonStyles => {
8
+ const s = sizeScale(size);
9
+
10
+ return {
8
11
  root: {
9
12
  default: {
10
13
  alignItems: "center",
11
14
  justifyContent: "center",
12
- padding: 8,
15
+ height: s.height,
16
+ width: s.height,
13
17
  borderRadius: radius,
14
18
  backgroundColor: colors.primary,
15
19
  borderWidth: 1,
@@ -25,8 +29,10 @@ export const useIconButtonVariantDefault = (): IconButtonStyles => {
25
29
  icon: {
26
30
  default: {
27
31
  color: colors.primaryForeground,
32
+ size: s.iconSize,
33
+ strokeWidth: s.strokeWidth,
28
34
  },
29
35
  },
30
- }),
31
- );
36
+ };
37
+ });
32
38
  };
@@ -1,15 +1,19 @@
1
1
  import { hslaSetRelativeLightness } from "../../../utils/hsla-utils";
2
+ import type { Size } from "../../../utils/size-scale";
2
3
  import { useThemedStyles } from "../../../utils/use-themed-styles";
3
4
  import type { IconButtonStyles } from "../types";
4
5
 
5
- export const useIconButtonVariantGhost = (): IconButtonStyles => {
6
- return useThemedStyles(
7
- ({ colors, radius }): IconButtonStyles => ({
6
+ export const useIconButtonVariantGhost = (size: Size): IconButtonStyles => {
7
+ return useThemedStyles(({ colors, radius, sizeScale }): IconButtonStyles => {
8
+ const s = sizeScale(size);
9
+
10
+ return {
8
11
  root: {
9
12
  default: {
10
13
  alignItems: "center",
11
14
  justifyContent: "center",
12
- padding: 8,
15
+ height: s.height,
16
+ width: s.height,
13
17
  borderRadius: radius,
14
18
  backgroundColor: "transparent",
15
19
  },
@@ -23,11 +27,13 @@ export const useIconButtonVariantGhost = (): IconButtonStyles => {
23
27
  icon: {
24
28
  default: {
25
29
  color: colors.foreground,
30
+ size: s.iconSize,
31
+ strokeWidth: s.strokeWidth,
26
32
  },
27
33
  disabled: {
28
34
  color: colors.mutedForeground,
29
35
  },
30
36
  },
31
- }),
32
- );
37
+ };
38
+ });
33
39
  };
@@ -1,15 +1,19 @@
1
1
  import { hslaSetRelativeLightness } from "../../../utils/hsla-utils";
2
+ import type { Size } from "../../../utils/size-scale";
2
3
  import { useThemedStyles } from "../../../utils/use-themed-styles";
3
4
  import type { IconButtonStyles } from "../types";
4
5
 
5
- export const useIconButtonVariantSecondary = (): IconButtonStyles => {
6
- return useThemedStyles(
7
- ({ colors, radius }): IconButtonStyles => ({
6
+ export const useIconButtonVariantSecondary = (size: Size): IconButtonStyles => {
7
+ return useThemedStyles(({ colors, radius, sizeScale }): IconButtonStyles => {
8
+ const s = sizeScale(size);
9
+
10
+ return {
8
11
  root: {
9
12
  default: {
10
13
  alignItems: "center",
11
14
  justifyContent: "center",
12
- padding: 8,
15
+ height: s.height,
16
+ width: s.height,
13
17
  borderRadius: radius,
14
18
  borderWidth: 1,
15
19
  borderColor: colors.border,
@@ -25,11 +29,13 @@ export const useIconButtonVariantSecondary = (): IconButtonStyles => {
25
29
  icon: {
26
30
  default: {
27
31
  color: colors.secondaryForeground,
32
+ size: s.iconSize,
33
+ strokeWidth: s.strokeWidth,
28
34
  },
29
35
  disabled: {
30
36
  color: colors.mutedForeground,
31
37
  },
32
38
  },
33
- }),
34
- );
39
+ };
40
+ });
35
41
  };
@@ -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";
@@ -3,12 +3,14 @@ import { StyleSheet, TextInput, type TextInputProps } from "react-native";
3
3
  import { useComponentConfig } from "../../themes/provider";
4
4
  import type { TextInputRef } from "../../types/element.types";
5
5
  import { mergeStyles } from "../../utils/calculate-styles";
6
+ import type { Size } from "../../utils/size-scale";
6
7
  import { useFieldOptional } from "../field/context";
7
8
  import type { InputState } from "./types";
8
9
  import { InputVariants } from "./variants";
9
10
 
10
11
  export type InputProps = Omit<TextInputProps, "onChange" | "onChangeText"> & {
11
12
  variant?: keyof typeof InputVariants;
13
+ size?: Size;
12
14
 
13
15
  ref?: React.Ref<TextInputRef>;
14
16
  onChange?: TextInputProps["onChangeText"];
@@ -26,7 +28,7 @@ const calculateState = (props: InputProps, isFocused: boolean): InputState => {
26
28
  };
27
29
 
28
30
  export const Input = forwardRef<TextInputRef, InputProps>((props, ref) => {
29
- const variantStyles = InputVariants[props.variant || "default"]();
31
+ const variantStyles = InputVariants[props.variant || "default"](props.size ?? "md");
30
32
  const componentConfig = useComponentConfig("input");
31
33
  const mergedStyles = mergeStyles(variantStyles, componentConfig?.styles);
32
34
  const [isFocused, setIsFocused] = useState(false);