@rehagro/ui 1.0.36 → 1.0.38
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.
- package/dist/{colors.types-7nLOoy6r.d.mts → colors.types-Dd3I7svd.d.mts} +1 -1
- package/dist/{colors.types-7nLOoy6r.d.ts → colors.types-Dd3I7svd.d.ts} +1 -1
- package/dist/index.d.mts +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +43 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -17
- package/dist/index.mjs.map +1 -1
- package/dist/native.d.mts +5 -3
- package/dist/native.d.ts +5 -3
- package/dist/native.js +16 -4
- package/dist/native.js.map +1 -1
- package/dist/native.mjs +16 -4
- package/dist/native.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/native.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import { PressableProps, StyleProp, ViewStyle, TextStyle, View, TextInputProps as TextInputProps$1, TextInput as TextInput$1, ViewProps, TextProps as TextProps$1, Text as Text$1 } from 'react-native';
|
|
5
|
-
import { B as ButtonColor, P as PresetColor } from './colors.types-
|
|
5
|
+
import { B as ButtonColor, P as PresetColor } from './colors.types-Dd3I7svd.mjs';
|
|
6
6
|
|
|
7
7
|
/** React Native theme — reuses the same token names as the web theme.
|
|
8
8
|
* Color values are plain CSS hex strings (e.g. "#16a34a").
|
|
@@ -36,6 +36,8 @@ type RehagroNativeTheme = {
|
|
|
36
36
|
inputHeightSm?: number;
|
|
37
37
|
inputHeightMd?: number;
|
|
38
38
|
inputHeightLg?: number;
|
|
39
|
+
buttonHeightXxs?: number;
|
|
40
|
+
buttonHeightXs?: number;
|
|
39
41
|
buttonHeightSm?: number;
|
|
40
42
|
buttonHeightMd?: number;
|
|
41
43
|
buttonHeightLg?: number;
|
|
@@ -68,7 +70,7 @@ declare function RehagroNativeProvider({ theme, children }: RehagroNativeProvide
|
|
|
68
70
|
declare function useRehagroTheme(): RehagroNativeTheme;
|
|
69
71
|
|
|
70
72
|
type ButtonVariant = "solid" | "outline" | "ghost";
|
|
71
|
-
type ButtonSize = "sm" | "md" | "lg" | "xl";
|
|
73
|
+
type ButtonSize = "xxs" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
72
74
|
type ButtonRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
73
75
|
type ButtonProps = Omit<PressableProps, "style"> & {
|
|
74
76
|
/** Visual style variant */
|
|
@@ -120,7 +122,7 @@ declare const Button: React__default.ForwardRefExoticComponent<Omit<PressablePro
|
|
|
120
122
|
} & React__default.RefAttributes<View>>;
|
|
121
123
|
|
|
122
124
|
type IconButtonVariant = "solid" | "outline" | "ghost";
|
|
123
|
-
type IconButtonSize = "sm" | "md" | "lg";
|
|
125
|
+
type IconButtonSize = "xxs" | "xs" | "sm" | "md" | "lg";
|
|
124
126
|
type IconButtonRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
125
127
|
type IconButtonColor = ButtonColor;
|
|
126
128
|
type IconButtonProps = Omit<PressableProps, "style"> & {
|
package/dist/native.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import { PressableProps, StyleProp, ViewStyle, TextStyle, View, TextInputProps as TextInputProps$1, TextInput as TextInput$1, ViewProps, TextProps as TextProps$1, Text as Text$1 } from 'react-native';
|
|
5
|
-
import { B as ButtonColor, P as PresetColor } from './colors.types-
|
|
5
|
+
import { B as ButtonColor, P as PresetColor } from './colors.types-Dd3I7svd.js';
|
|
6
6
|
|
|
7
7
|
/** React Native theme — reuses the same token names as the web theme.
|
|
8
8
|
* Color values are plain CSS hex strings (e.g. "#16a34a").
|
|
@@ -36,6 +36,8 @@ type RehagroNativeTheme = {
|
|
|
36
36
|
inputHeightSm?: number;
|
|
37
37
|
inputHeightMd?: number;
|
|
38
38
|
inputHeightLg?: number;
|
|
39
|
+
buttonHeightXxs?: number;
|
|
40
|
+
buttonHeightXs?: number;
|
|
39
41
|
buttonHeightSm?: number;
|
|
40
42
|
buttonHeightMd?: number;
|
|
41
43
|
buttonHeightLg?: number;
|
|
@@ -68,7 +70,7 @@ declare function RehagroNativeProvider({ theme, children }: RehagroNativeProvide
|
|
|
68
70
|
declare function useRehagroTheme(): RehagroNativeTheme;
|
|
69
71
|
|
|
70
72
|
type ButtonVariant = "solid" | "outline" | "ghost";
|
|
71
|
-
type ButtonSize = "sm" | "md" | "lg" | "xl";
|
|
73
|
+
type ButtonSize = "xxs" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
72
74
|
type ButtonRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
73
75
|
type ButtonProps = Omit<PressableProps, "style"> & {
|
|
74
76
|
/** Visual style variant */
|
|
@@ -120,7 +122,7 @@ declare const Button: React__default.ForwardRefExoticComponent<Omit<PressablePro
|
|
|
120
122
|
} & React__default.RefAttributes<View>>;
|
|
121
123
|
|
|
122
124
|
type IconButtonVariant = "solid" | "outline" | "ghost";
|
|
123
|
-
type IconButtonSize = "sm" | "md" | "lg";
|
|
125
|
+
type IconButtonSize = "xxs" | "xs" | "sm" | "md" | "lg";
|
|
124
126
|
type IconButtonRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
125
127
|
type IconButtonColor = ButtonColor;
|
|
126
128
|
type IconButtonProps = Omit<PressableProps, "style"> & {
|
package/dist/native.js
CHANGED
|
@@ -32,6 +32,8 @@ var DEFAULT_NATIVE_THEME = {
|
|
|
32
32
|
inputHeightSm: 36,
|
|
33
33
|
inputHeightMd: 44,
|
|
34
34
|
inputHeightLg: 52,
|
|
35
|
+
buttonHeightXxs: 16,
|
|
36
|
+
buttonHeightXs: 24,
|
|
35
37
|
buttonHeightSm: 36,
|
|
36
38
|
buttonHeightMd: 44,
|
|
37
39
|
buttonHeightLg: 52,
|
|
@@ -110,7 +112,8 @@ var Button = react.forwardRef(function Button2({
|
|
|
110
112
|
danger: theme.danger ?? "#dc2626",
|
|
111
113
|
warning: theme.warning ?? "#d97706",
|
|
112
114
|
success: theme.success ?? "#16a34a",
|
|
113
|
-
info: theme.info ?? "#0284c7"
|
|
115
|
+
info: theme.info ?? "#0284c7",
|
|
116
|
+
neutral: theme.textMuted ?? "#6b7280"
|
|
114
117
|
};
|
|
115
118
|
const presetHover = {
|
|
116
119
|
primary: theme.primaryHover ?? darkenColor(presetBase.primary),
|
|
@@ -118,17 +121,22 @@ var Button = react.forwardRef(function Button2({
|
|
|
118
121
|
danger: theme.dangerHover ?? darkenColor(presetBase.danger),
|
|
119
122
|
warning: theme.warning ?? darkenColor(presetBase.warning),
|
|
120
123
|
success: theme.success ?? darkenColor(presetBase.success),
|
|
121
|
-
info: theme.infoHover ?? darkenColor(presetBase.info)
|
|
124
|
+
info: theme.infoHover ?? darkenColor(presetBase.info),
|
|
125
|
+
neutral: theme.text ?? darkenColor(presetBase.neutral)
|
|
122
126
|
};
|
|
123
127
|
const colorBase = preset ? presetBase[color] : color;
|
|
124
128
|
const colorHover = preset ? presetHover[color] : darkenColor(color);
|
|
125
129
|
const sizeStyleMap = {
|
|
130
|
+
xxs: { paddingHorizontal: 6, height: theme.buttonHeightXxs ?? 16, gap: 4 },
|
|
131
|
+
xs: { paddingHorizontal: 8, height: theme.buttonHeightXs ?? 24, gap: 4 },
|
|
126
132
|
sm: { paddingHorizontal: 12, height: theme.buttonHeightSm ?? 36 },
|
|
127
133
|
md: { paddingHorizontal: 16, height: theme.buttonHeightMd ?? 44 },
|
|
128
134
|
lg: { paddingHorizontal: 20, height: theme.buttonHeightLg ?? 52 },
|
|
129
135
|
xl: { paddingHorizontal: 24, height: theme.buttonHeightXl ?? 60 }
|
|
130
136
|
};
|
|
131
137
|
const fontSizeMap = {
|
|
138
|
+
xxs: 10,
|
|
139
|
+
xs: 12,
|
|
132
140
|
sm: 14,
|
|
133
141
|
md: 14,
|
|
134
142
|
lg: 16,
|
|
@@ -239,6 +247,8 @@ var IconButton = react.forwardRef(function IconButton2({
|
|
|
239
247
|
const theme = useRehagroTheme();
|
|
240
248
|
const isDisabled = disabled || loading;
|
|
241
249
|
const sizePxMap = {
|
|
250
|
+
xxs: 16,
|
|
251
|
+
xs: 24,
|
|
242
252
|
sm: 32,
|
|
243
253
|
md: 40,
|
|
244
254
|
lg: 48
|
|
@@ -259,7 +269,8 @@ var IconButton = react.forwardRef(function IconButton2({
|
|
|
259
269
|
danger: { main: theme.danger ?? "#dc2626", hover: theme.dangerHover ?? darkenColor2(theme.danger ?? "#dc2626") },
|
|
260
270
|
warning: { main: theme.warning ?? "#d97706", hover: darkenColor2(theme.warning ?? "#d97706") },
|
|
261
271
|
success: { main: theme.success ?? "#16a34a", hover: darkenColor2(theme.success ?? "#16a34a") },
|
|
262
|
-
info: { main: theme.info ?? "#0284c7", hover: theme.infoHover ?? darkenColor2(theme.info ?? "#0284c7") }
|
|
272
|
+
info: { main: theme.info ?? "#0284c7", hover: theme.infoHover ?? darkenColor2(theme.info ?? "#0284c7") },
|
|
273
|
+
neutral: { main: theme.textMuted ?? "#6b7280", hover: theme.text ?? darkenColor2(theme.textMuted ?? "#6b7280") }
|
|
263
274
|
};
|
|
264
275
|
const preset = isPresetColor2(color);
|
|
265
276
|
const main = preset ? presetTokens[color].main : color;
|
|
@@ -726,7 +737,8 @@ var Tag = react.forwardRef(function Tag2({
|
|
|
726
737
|
danger: { main: theme.danger ?? "#dc2626", hover: theme.dangerHover ?? "#b91c1c" },
|
|
727
738
|
warning: { main: theme.warning ?? "#d97706", hover: theme.warning ?? "#d97706" },
|
|
728
739
|
success: { main: theme.success ?? "#16a34a", hover: theme.success ?? "#16a34a" },
|
|
729
|
-
info: { main: theme.info ?? "#0284c7", hover: theme.infoHover ?? "#0369a1" }
|
|
740
|
+
info: { main: theme.info ?? "#0284c7", hover: theme.infoHover ?? "#0369a1" },
|
|
741
|
+
neutral: { main: theme.textMuted ?? "#6b7280", hover: theme.text ?? "#374151" }
|
|
730
742
|
};
|
|
731
743
|
const preset = isPresetColor3(color);
|
|
732
744
|
const mainColor = preset ? presetTokens[color].main : color;
|