@admin-layout/gluestack-ui-mobile 10.0.9-alpha.9 → 10.1.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/CHANGELOG.md +1 -9
  2. package/lib/components/ui/accordion/index.web.d.ts +209 -0
  3. package/lib/components/ui/accordion/index.web.js +156 -0
  4. package/lib/components/ui/accordion/index.web.js.map +1 -0
  5. package/lib/components/ui/actionsheet/index.web.d.ts +872 -0
  6. package/lib/components/ui/actionsheet/index.web.js +286 -0
  7. package/lib/components/ui/actionsheet/index.web.js.map +1 -0
  8. package/lib/components/ui/alert/index.web.d.ts +135 -0
  9. package/lib/components/ui/alert/index.web.js +38 -0
  10. package/lib/components/ui/alert/index.web.js.map +1 -0
  11. package/lib/components/ui/alert-dialog/index.web.d.ts +64 -0
  12. package/lib/components/ui/alert-dialog/index.web.js +139 -0
  13. package/lib/components/ui/alert-dialog/index.web.js.map +1 -0
  14. package/lib/components/ui/avatar/index.web.d.ts +21 -0
  15. package/lib/components/ui/avatar/index.web.js +92 -0
  16. package/lib/components/ui/avatar/index.web.js.map +1 -0
  17. package/lib/components/ui/badge/index.web.d.ts +382 -0
  18. package/lib/components/ui/badge/index.web.js +138 -0
  19. package/lib/components/ui/badge/index.web.js.map +1 -0
  20. package/lib/components/ui/button/index.web.d.ts +247 -0
  21. package/lib/components/ui/button/index.web.js +57 -0
  22. package/lib/components/ui/button/index.web.js.map +1 -0
  23. package/lib/components/ui/checkbox/index.web.d.ts +265 -0
  24. package/lib/components/ui/checkbox/index.web.js +77 -0
  25. package/lib/components/ui/checkbox/index.web.js.map +1 -0
  26. package/lib/components/ui/divider/index.web.d.ts +53 -0
  27. package/lib/components/ui/divider/index.web.js +21 -0
  28. package/lib/components/ui/divider/index.web.js.map +1 -0
  29. package/lib/components/ui/drawer/index.web.d.ts +174 -0
  30. package/lib/components/ui/drawer/index.web.js +65 -0
  31. package/lib/components/ui/drawer/index.web.js.map +1 -0
  32. package/lib/components/ui/fab/index.web.d.ts +520 -0
  33. package/lib/components/ui/fab/index.web.js +146 -0
  34. package/lib/components/ui/fab/index.web.js.map +1 -0
  35. package/lib/components/ui/flat-list/index.web.d.ts +21 -0
  36. package/lib/components/ui/flat-list/index.web.js +41 -0
  37. package/lib/components/ui/flat-list/index.web.js.map +1 -0
  38. package/lib/components/ui/form-control/index.web.d.ts +2071 -0
  39. package/lib/components/ui/form-control/index.web.js +290 -0
  40. package/lib/components/ui/form-control/index.web.js.map +1 -0
  41. package/lib/components/ui/image/index.web.d.ts +142 -0
  42. package/lib/components/ui/image/index.web.js +29 -0
  43. package/lib/components/ui/image/index.web.js.map +1 -0
  44. package/lib/components/ui/image-background/index.web.d.ts +8 -0
  45. package/lib/components/ui/image-background/index.web.js +23 -0
  46. package/lib/components/ui/image-background/index.web.js.map +1 -0
  47. package/lib/components/ui/input/index.web.d.ts +163 -0
  48. package/lib/components/ui/input/index.web.js +50 -0
  49. package/lib/components/ui/input/index.web.js.map +1 -0
  50. package/lib/components/ui/input-accessory-view/index.web.d.ts +9 -0
  51. package/lib/components/ui/input-accessory-view/index.web.js +16 -0
  52. package/lib/components/ui/input-accessory-view/index.web.js.map +1 -0
  53. package/lib/components/ui/keyboard-avoiding-view/index.web.d.ts +9 -0
  54. package/lib/components/ui/keyboard-avoiding-view/index.web.js +8 -0
  55. package/lib/components/ui/keyboard-avoiding-view/index.web.js.map +1 -0
  56. package/lib/components/ui/link/index.web.d.ts +365 -0
  57. package/lib/components/ui/link/index.web.js +70 -0
  58. package/lib/components/ui/link/index.web.js.map +1 -0
  59. package/lib/components/ui/menu/index.web.d.ts +142 -0
  60. package/lib/components/ui/menu/index.web.js +83 -0
  61. package/lib/components/ui/menu/index.web.js.map +1 -0
  62. package/lib/components/ui/modal/index.web.d.ts +111 -0
  63. package/lib/components/ui/modal/index.web.js +58 -0
  64. package/lib/components/ui/modal/index.web.js.map +1 -0
  65. package/lib/components/ui/popover/index.web.d.ts +309 -0
  66. package/lib/components/ui/popover/index.web.js +184 -0
  67. package/lib/components/ui/popover/index.web.js.map +1 -0
  68. package/lib/components/ui/portal/index.web.d.ts +9 -0
  69. package/lib/components/ui/portal/index.web.js +16 -0
  70. package/lib/components/ui/portal/index.web.js.map +1 -0
  71. package/lib/components/ui/pressable/index.web.d.ts +8 -0
  72. package/lib/components/ui/pressable/index.web.js +44 -0
  73. package/lib/components/ui/pressable/index.web.js.map +1 -0
  74. package/lib/components/ui/progress/index.web.d.ts +237 -0
  75. package/lib/components/ui/progress/index.web.js +73 -0
  76. package/lib/components/ui/progress/index.web.js.map +1 -0
  77. package/lib/components/ui/radio/index.web.d.ts +224 -0
  78. package/lib/components/ui/radio/index.web.js +69 -0
  79. package/lib/components/ui/radio/index.web.js.map +1 -0
  80. package/lib/components/ui/refresh-control/index.web.d.ts +14 -0
  81. package/lib/components/ui/refresh-control/index.web.js +69 -0
  82. package/lib/components/ui/refresh-control/index.web.js.map +1 -0
  83. package/lib/components/ui/safe-area-view/index.web.d.ts +6 -0
  84. package/lib/components/ui/safe-area-view/index.web.js +10 -0
  85. package/lib/components/ui/safe-area-view/index.web.js.map +1 -0
  86. package/lib/components/ui/scroll-view/index.web.d.ts +44 -0
  87. package/lib/components/ui/scroll-view/index.web.js +41 -0
  88. package/lib/components/ui/scroll-view/index.web.js.map +1 -0
  89. package/lib/components/ui/section-list/index.web.d.ts +26 -0
  90. package/lib/components/ui/section-list/index.web.js +35 -0
  91. package/lib/components/ui/section-list/index.web.js.map +1 -0
  92. package/lib/components/ui/select/index.web.d.ts +162 -0
  93. package/lib/components/ui/select/index.web.js +51 -0
  94. package/lib/components/ui/select/index.web.js.map +1 -0
  95. package/lib/components/ui/slider/index.web.d.ts +223 -0
  96. package/lib/components/ui/slider/index.web.js +189 -0
  97. package/lib/components/ui/slider/index.web.js.map +1 -0
  98. package/lib/components/ui/spinner/index.web.d.ts +176 -0
  99. package/lib/components/ui/spinner/index.web.js +55 -0
  100. package/lib/components/ui/spinner/index.web.js.map +1 -0
  101. package/lib/components/ui/status-bar/index.web.d.ts +14 -0
  102. package/lib/components/ui/status-bar/index.web.js +7 -0
  103. package/lib/components/ui/status-bar/index.web.js.map +1 -0
  104. package/lib/components/ui/switch/index.web.d.ts +71 -0
  105. package/lib/components/ui/switch/index.web.js +27 -0
  106. package/lib/components/ui/switch/index.web.js.map +1 -0
  107. package/lib/components/ui/tabs/index.web.d.ts +351 -0
  108. package/lib/components/ui/tabs/index.web.js +120 -0
  109. package/lib/components/ui/tabs/index.web.js.map +1 -0
  110. package/lib/components/ui/textarea/index.web.d.ts +162 -0
  111. package/lib/components/ui/textarea/index.web.js +50 -0
  112. package/lib/components/ui/textarea/index.web.js.map +1 -0
  113. package/lib/components/ui/toast/index.web.d.ts +225 -0
  114. package/lib/components/ui/toast/index.web.js +80 -0
  115. package/lib/components/ui/toast/index.web.js.map +1 -0
  116. package/lib/components/ui/tooltip/index.web.d.ts +86 -0
  117. package/lib/components/ui/tooltip/index.web.js +110 -0
  118. package/lib/components/ui/tooltip/index.web.js.map +1 -0
  119. package/lib/components/ui/view/index.web.d.ts +2 -0
  120. package/lib/components/ui/view/index.web.js +7 -0
  121. package/lib/components/ui/view/index.web.js.map +1 -0
  122. package/lib/components/ui/virtualized-list/index.web.d.ts +19 -0
  123. package/lib/components/ui/virtualized-list/index.web.js +30 -0
  124. package/lib/components/ui/virtualized-list/index.web.js.map +1 -0
  125. package/lib/components/usePermissionAutoFetch.d.ts +7 -19
  126. package/lib/containers/layout/DrawerBottomNavigationConfig.d.ts +47 -47
  127. package/lib/containers/layout/DrawerConfig.d.ts +31 -31
  128. package/lib/redux/settings.d.ts +3 -9
  129. package/package.json +9 -5
  130. package/src/components/ui/accordion/index.web.tsx +294 -0
  131. package/src/components/ui/actionsheet/index.web.tsx +555 -0
  132. package/src/components/ui/alert/index.web.tsx +71 -0
  133. package/src/components/ui/alert-dialog/index.web.tsx +241 -0
  134. package/src/components/ui/avatar/index.web.tsx +150 -0
  135. package/src/components/ui/badge/index.web.tsx +188 -0
  136. package/src/components/ui/button/index.web.tsx +86 -0
  137. package/src/components/ui/checkbox/index.web.tsx +151 -0
  138. package/src/components/ui/divider/index.web.tsx +37 -0
  139. package/src/components/ui/drawer/index.web.tsx +144 -0
  140. package/src/components/ui/fab/index.web.tsx +201 -0
  141. package/src/components/ui/flat-list/index.web.tsx +89 -0
  142. package/src/components/ui/form-control/index.web.tsx +451 -0
  143. package/src/components/ui/image/index.web.tsx +43 -0
  144. package/src/components/ui/image-background/index.web.tsx +43 -0
  145. package/src/components/ui/input/index.web.tsx +80 -0
  146. package/src/components/ui/input-accessory-view/index.web.tsx +31 -0
  147. package/src/components/ui/keyboard-avoiding-view/index.web.tsx +23 -0
  148. package/src/components/ui/link/index.web.tsx +103 -0
  149. package/src/components/ui/menu/index.web.tsx +159 -0
  150. package/src/components/ui/modal/index.web.tsx +135 -0
  151. package/src/components/ui/popover/index.web.tsx +326 -0
  152. package/src/components/ui/portal/index.web.tsx +34 -0
  153. package/src/components/ui/pressable/index.web.tsx +73 -0
  154. package/src/components/ui/progress/index.web.tsx +123 -0
  155. package/src/components/ui/radio/index.web.tsx +130 -0
  156. package/src/components/ui/refresh-control/index.web.tsx +104 -0
  157. package/src/components/ui/safe-area-view/index.web.tsx +24 -0
  158. package/src/components/ui/scroll-view/index.web.tsx +142 -0
  159. package/src/components/ui/section-list/index.web.tsx +93 -0
  160. package/src/components/ui/select/index.web.tsx +83 -0
  161. package/src/components/ui/slider/index.web.tsx +283 -0
  162. package/src/components/ui/spinner/index.web.tsx +81 -0
  163. package/src/components/ui/status-bar/index.web.tsx +20 -0
  164. package/src/components/ui/switch/index.web.tsx +44 -0
  165. package/src/components/ui/tabs/index.web.tsx +205 -0
  166. package/src/components/ui/textarea/index.web.tsx +86 -0
  167. package/src/components/ui/toast/index.web.tsx +132 -0
  168. package/src/components/ui/tooltip/index.web.tsx +155 -0
  169. package/src/components/ui/view/index.web.tsx +15 -0
  170. package/src/components/ui/virtualized-list/index.web.tsx +84 -0
@@ -0,0 +1,138 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import { PrimitiveIcon, UIIcon } from '@gluestack-ui/icon';
4
+ import { tva } from '@gluestack-ui/nativewind-utils/tva';
5
+ import { withStyleContext, useStyleContext } from '@gluestack-ui/nativewind-utils/withStyleContext';
6
+ import { cssInterop } from 'nativewind';
7
+ const SCOPE = 'BADGE';
8
+ const badgeStyle = tva({
9
+ base: 'flex-row items-center rounded-sm data-[disabled=true]:opacity-50 px-2 py-1',
10
+ variants: {
11
+ action: {
12
+ error: 'bg-background-error border-error-300',
13
+ warning: 'bg-background-warning border-warning-300',
14
+ success: 'bg-background-success border-success-300',
15
+ info: 'bg-background-info border-info-300',
16
+ muted: 'bg-background-muted border-background-300',
17
+ },
18
+ variant: {
19
+ solid: '',
20
+ outline: 'border',
21
+ },
22
+ size: {
23
+ sm: '',
24
+ md: '',
25
+ lg: '',
26
+ },
27
+ },
28
+ });
29
+ const badgeTextStyle = tva({
30
+ base: 'text-typography-700 font-body font-normal tracking-normal uppercase',
31
+ parentVariants: {
32
+ action: {
33
+ error: 'text-error-600',
34
+ warning: 'text-warning-600',
35
+ success: 'text-success-600',
36
+ info: 'text-info-600',
37
+ muted: 'text-background-800',
38
+ },
39
+ size: {
40
+ sm: 'text-2xs',
41
+ md: 'text-xs',
42
+ lg: 'text-sm',
43
+ },
44
+ },
45
+ variants: {
46
+ isTruncated: {
47
+ true: 'web:truncate',
48
+ },
49
+ bold: {
50
+ true: 'font-bold',
51
+ },
52
+ underline: {
53
+ true: 'underline',
54
+ },
55
+ strikeThrough: {
56
+ true: 'line-through',
57
+ },
58
+ sub: {
59
+ true: 'text-xs',
60
+ },
61
+ italic: {
62
+ true: 'italic',
63
+ },
64
+ highlight: {
65
+ true: 'bg-yellow-500',
66
+ },
67
+ },
68
+ });
69
+ const badgeIconStyle = tva({
70
+ base: 'fill-none',
71
+ parentVariants: {
72
+ action: {
73
+ error: 'text-error-600',
74
+ warning: 'text-warning-600',
75
+ success: 'text-success-600',
76
+ info: 'text-info-600',
77
+ muted: 'text-background-800',
78
+ },
79
+ size: {
80
+ sm: 'h-3 w-3',
81
+ md: 'h-3.5 w-3.5',
82
+ lg: 'h-4 w-4',
83
+ },
84
+ },
85
+ });
86
+ const ContextView = withStyleContext(({ children, ...props }) => React.createElement("div", { ...props }, children), SCOPE);
87
+ cssInterop(PrimitiveIcon, {
88
+ className: {
89
+ target: 'style',
90
+ nativeStyleToProp: {
91
+ height: true,
92
+ width: true,
93
+ fill: true,
94
+ color: 'classNameColor',
95
+ stroke: true,
96
+ },
97
+ },
98
+ });
99
+ const Badge = ({ children, action = 'muted', variant = 'solid', size = 'md', className, ...props }) => {
100
+ return (React.createElement(ContextView, { className: badgeStyle({ action, variant, class: className }), ...props, context: {
101
+ action,
102
+ variant,
103
+ size,
104
+ } }, children));
105
+ };
106
+ const BadgeText = React.forwardRef(({ children, className, size, ...props }, ref) => {
107
+ const { size: parentSize, action: parentAction } = useStyleContext(SCOPE);
108
+ return (React.createElement("span", { ref: ref, className: badgeTextStyle({
109
+ parentVariants: {
110
+ size: parentSize,
111
+ action: parentAction,
112
+ },
113
+ size,
114
+ class: className,
115
+ }), ...props }, children));
116
+ });
117
+ const BadgeIcon = React.forwardRef(({ className, size, ...props }, ref) => {
118
+ const { size: parentSize, action: parentAction } = useStyleContext(SCOPE);
119
+ if (typeof size === 'number') {
120
+ return React.createElement(UIIcon, { ref: ref, ...props, className: badgeIconStyle({ class: className }), size: size });
121
+ }
122
+ else if ((props?.height !== undefined || props?.width !== undefined) && size === undefined) {
123
+ return React.createElement(UIIcon, { ref: ref, ...props, className: badgeIconStyle({ class: className }) });
124
+ }
125
+ return (React.createElement(UIIcon, { className: badgeIconStyle({
126
+ parentVariants: {
127
+ size: parentSize,
128
+ action: parentAction,
129
+ },
130
+ size,
131
+ class: className,
132
+ }), ...props, ref: ref }));
133
+ });
134
+ Badge.displayName = 'Badge';
135
+ BadgeText.displayName = 'BadgeText';
136
+ BadgeIcon.displayName = 'BadgeIcon';
137
+ export { Badge, BadgeIcon, BadgeText };
138
+ //# sourceMappingURL=index.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../../../src/components/ui/badge/index.web.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,KAAK,GAAG,OAAO,CAAC;AAEtB,MAAM,UAAU,GAAG,GAAG,CAAC;IACnB,IAAI,EAAE,4EAA4E;IAClF,QAAQ,EAAE;QACN,MAAM,EAAE;YACJ,KAAK,EAAE,sCAAsC;YAC7C,OAAO,EAAE,0CAA0C;YACnD,OAAO,EAAE,0CAA0C;YACnD,IAAI,EAAE,oCAAoC;YAC1C,KAAK,EAAE,2CAA2C;SACrD;QACD,OAAO,EAAE;YACL,KAAK,EAAE,EAAE;YACT,OAAO,EAAE,QAAQ;SACpB;QACD,IAAI,EAAE;YACF,EAAE,EAAE,EAAE;YACN,EAAE,EAAE,EAAE;YACN,EAAE,EAAE,EAAE;SACT;KACJ;CACJ,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,GAAG,CAAC;IACvB,IAAI,EAAE,qEAAqE;IAE3E,cAAc,EAAE;QACZ,MAAM,EAAE;YACJ,KAAK,EAAE,gBAAgB;YACvB,OAAO,EAAE,kBAAkB;YAC3B,OAAO,EAAE,kBAAkB;YAC3B,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,qBAAqB;SAC/B;QACD,IAAI,EAAE;YACF,EAAE,EAAE,UAAU;YAC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C,EAAE,IAAI,EAAE,IAAI,GAAI,CAAC;IACxG,CAAC;SAAM,IAAI,CAAC,KAAK,EAAE,MAAM,KAAK,SAAS,IAAI,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QAC3F,OAAO,oBAAC,MAAM,IAAC,GAAG,EAAE,GAAG,KAAM,KAAK,EAAE,SAAS,EAAE,cAAc,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,GAAI,CAAC;IAC5F,CAAC;IACD,OAAO,CACH,oBAAC,MAAM,IACH,SAAS,EAAE,cAAc,CAAC;YACtB,cAAc,EAAE;gBACZ,IAAI,EAAE,UAAU;gBAChB,MAAM,EAAE,YAAY;aACvB;YACD,IAAI;YACJ,KAAK,EAAE,SAAS;SACnB,CAAC,KACE,KAAK,EACT,GAAG,EAAE,GAAG,GACV,CACL,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAC5B,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AACpC,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,247 @@
1
+ import React from 'react';
2
+ import type { VariantProps } from '@gluestack-ui/nativewind-utils';
3
+ declare const StyledButton: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<HTMLButtonElement>>;
4
+ declare const buttonStyle: import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
5
+ size: {
6
+ xs: string;
7
+ sm: string;
8
+ md: string;
9
+ lg: string;
10
+ };
11
+ variant: {
12
+ solid: string;
13
+ outline: string;
14
+ ghost: string;
15
+ link: string;
16
+ };
17
+ action: {
18
+ primary: string;
19
+ secondary: string;
20
+ positive: string;
21
+ negative: string;
22
+ };
23
+ state: {
24
+ loading: string;
25
+ disabled: string;
26
+ };
27
+ } | ({
28
+ size: {
29
+ xs: string;
30
+ sm: string;
31
+ md: string;
32
+ lg: string;
33
+ };
34
+ variant: {
35
+ solid: string;
36
+ outline: string;
37
+ ghost: string;
38
+ link: string;
39
+ };
40
+ action: {
41
+ primary: string;
42
+ secondary: string;
43
+ positive: string;
44
+ negative: string;
45
+ };
46
+ state: {
47
+ loading: string;
48
+ disabled: string;
49
+ };
50
+ } & {
51
+ size: {
52
+ xs: import("tailwind-merge").ClassNameValue | {
53
+ base?: import("tailwind-merge").ClassNameValue;
54
+ };
55
+ sm: import("tailwind-merge").ClassNameValue | {
56
+ base?: import("tailwind-merge").ClassNameValue;
57
+ };
58
+ md: import("tailwind-merge").ClassNameValue | {
59
+ base?: import("tailwind-merge").ClassNameValue;
60
+ };
61
+ lg: import("tailwind-merge").ClassNameValue | {
62
+ base?: import("tailwind-merge").ClassNameValue;
63
+ };
64
+ };
65
+ variant: {
66
+ solid: import("tailwind-merge").ClassNameValue | {
67
+ base?: import("tailwind-merge").ClassNameValue;
68
+ };
69
+ outline: import("tailwind-merge").ClassNameValue | {
70
+ base?: import("tailwind-merge").ClassNameValue;
71
+ };
72
+ ghost: import("tailwind-merge").ClassNameValue | {
73
+ base?: import("tailwind-merge").ClassNameValue;
74
+ };
75
+ link: import("tailwind-merge").ClassNameValue | {
76
+ base?: import("tailwind-merge").ClassNameValue;
77
+ };
78
+ };
79
+ action: {
80
+ primary: import("tailwind-merge").ClassNameValue | {
81
+ base?: import("tailwind-merge").ClassNameValue;
82
+ };
83
+ secondary: import("tailwind-merge").ClassNameValue | {
84
+ base?: import("tailwind-merge").ClassNameValue;
85
+ };
86
+ positive: import("tailwind-merge").ClassNameValue | {
87
+ base?: import("tailwind-merge").ClassNameValue;
88
+ };
89
+ negative: import("tailwind-merge").ClassNameValue | {
90
+ base?: import("tailwind-merge").ClassNameValue;
91
+ };
92
+ };
93
+ state: {
94
+ loading: import("tailwind-merge").ClassNameValue | {
95
+ base?: import("tailwind-merge").ClassNameValue;
96
+ };
97
+ disabled: import("tailwind-merge").ClassNameValue | {
98
+ base?: import("tailwind-merge").ClassNameValue;
99
+ };
100
+ };
101
+ }), undefined, "px-4 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent", import("tailwind-variants/dist/config").TVConfig<{
102
+ size: {
103
+ xs: string;
104
+ sm: string;
105
+ md: string;
106
+ lg: string;
107
+ };
108
+ variant: {
109
+ solid: string;
110
+ outline: string;
111
+ ghost: string;
112
+ link: string;
113
+ };
114
+ action: {
115
+ primary: string;
116
+ secondary: string;
117
+ positive: string;
118
+ negative: string;
119
+ };
120
+ state: {
121
+ loading: string;
122
+ disabled: string;
123
+ };
124
+ }, {
125
+ size: {
126
+ xs: string;
127
+ sm: string;
128
+ md: string;
129
+ lg: string;
130
+ };
131
+ variant: {
132
+ solid: string;
133
+ outline: string;
134
+ ghost: string;
135
+ link: string;
136
+ };
137
+ action: {
138
+ primary: string;
139
+ secondary: string;
140
+ positive: string;
141
+ negative: string;
142
+ };
143
+ state: {
144
+ loading: string;
145
+ disabled: string;
146
+ };
147
+ }>, {
148
+ size: {
149
+ xs: string;
150
+ sm: string;
151
+ md: string;
152
+ lg: string;
153
+ };
154
+ variant: {
155
+ solid: string;
156
+ outline: string;
157
+ ghost: string;
158
+ link: string;
159
+ };
160
+ action: {
161
+ primary: string;
162
+ secondary: string;
163
+ positive: string;
164
+ negative: string;
165
+ };
166
+ state: {
167
+ loading: string;
168
+ disabled: string;
169
+ };
170
+ }, undefined, import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
171
+ size: {
172
+ xs: string;
173
+ sm: string;
174
+ md: string;
175
+ lg: string;
176
+ };
177
+ variant: {
178
+ solid: string;
179
+ outline: string;
180
+ ghost: string;
181
+ link: string;
182
+ };
183
+ action: {
184
+ primary: string;
185
+ secondary: string;
186
+ positive: string;
187
+ negative: string;
188
+ };
189
+ state: {
190
+ loading: string;
191
+ disabled: string;
192
+ };
193
+ }, undefined, "px-4 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent", import("tailwind-variants/dist/config").TVConfig<{
194
+ size: {
195
+ xs: string;
196
+ sm: string;
197
+ md: string;
198
+ lg: string;
199
+ };
200
+ variant: {
201
+ solid: string;
202
+ outline: string;
203
+ ghost: string;
204
+ link: string;
205
+ };
206
+ action: {
207
+ primary: string;
208
+ secondary: string;
209
+ positive: string;
210
+ negative: string;
211
+ };
212
+ state: {
213
+ loading: string;
214
+ disabled: string;
215
+ };
216
+ }, {
217
+ size: {
218
+ xs: string;
219
+ sm: string;
220
+ md: string;
221
+ lg: string;
222
+ };
223
+ variant: {
224
+ solid: string;
225
+ outline: string;
226
+ ghost: string;
227
+ link: string;
228
+ };
229
+ action: {
230
+ primary: string;
231
+ secondary: string;
232
+ positive: string;
233
+ negative: string;
234
+ };
235
+ state: {
236
+ loading: string;
237
+ disabled: string;
238
+ };
239
+ }>, unknown, unknown, undefined>>;
240
+ type IButtonProps = React.ComponentProps<typeof StyledButton> & VariantProps<typeof buttonStyle> & {
241
+ className?: string;
242
+ onPress?: (event: React.MouseEvent<HTMLButtonElement>) => void;
243
+ isDisabled?: boolean;
244
+ isLoading?: boolean;
245
+ };
246
+ declare const Button: React.ForwardRefExoticComponent<Omit<IButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
247
+ export { Button };
@@ -0,0 +1,57 @@
1
+ 'use client';
2
+ import React, { forwardRef } from 'react';
3
+ import { tva } from '@gluestack-ui/nativewind-utils/tva';
4
+ const SCOPE = 'BUTTON';
5
+ const StyledButton = forwardRef(({ onPress, onClick, disabled, ...props }, ref) => {
6
+ const handleClick = (e) => {
7
+ if (onClick) {
8
+ onClick(e);
9
+ }
10
+ if (onPress) {
11
+ onPress(e);
12
+ }
13
+ };
14
+ return React.createElement("button", { ref: ref, onClick: handleClick, disabled: disabled, ...props });
15
+ });
16
+ StyledButton.displayName = 'StyledButton';
17
+ const buttonStyle = tva({
18
+ base: 'px-4 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent',
19
+ variants: {
20
+ size: {
21
+ xs: 'px-2 py-1 text-xs',
22
+ sm: 'px-3 py-1.5 text-sm',
23
+ md: 'text-base',
24
+ lg: 'px-5 py-2.5 text-lg',
25
+ },
26
+ variant: {
27
+ solid: 'bg-blue-500 text-white hover:bg-blue-600',
28
+ outline: 'border border-blue-500 text-blue-500 hover:bg-blue-50',
29
+ ghost: 'text-blue-500 hover:bg-blue-50',
30
+ link: 'text-blue-500 hover:underline',
31
+ },
32
+ action: {
33
+ primary: 'bg-blue-500 text-white',
34
+ secondary: 'bg-gray-500 text-white',
35
+ positive: 'bg-green-500 text-white',
36
+ negative: 'bg-red-500 text-white',
37
+ },
38
+ state: {
39
+ loading: 'opacity-70 cursor-not-allowed',
40
+ disabled: 'opacity-50 cursor-not-allowed',
41
+ },
42
+ },
43
+ defaultVariants: {
44
+ size: 'md',
45
+ variant: 'solid',
46
+ action: 'primary',
47
+ },
48
+ });
49
+ const Button = React.forwardRef(({ className, size, variant, action, state, isDisabled, isLoading, ...props }, ref) => {
50
+ const buttonState = {
51
+ state: isLoading ? 'loading' : isDisabled ? 'disabled' : undefined,
52
+ };
53
+ return (React.createElement(StyledButton, { ref: ref, className: buttonStyle({ size, variant, action, ...buttonState, class: className }), disabled: isDisabled || isLoading, ...props }));
54
+ });
55
+ Button.displayName = 'Button';
56
+ export { Button };
57
+ //# sourceMappingURL=index.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../../../src/components/ui/button/index.web.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC;AAKzD,MAAM,KAAK,GAAG,QAAQ,CAAC;AAEvB,MAAM,YAAY,GAAG,UAAU,CAAyB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,E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