cdslibrary 1.2.37 → 1.2.39
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.
|
@@ -3,7 +3,7 @@ import { StyleSheet, Text, TouchableOpacity } from "react-native";
|
|
|
3
3
|
import Animated, { SlideInDown, SlideOutDown } from "react-native-reanimated";
|
|
4
4
|
import { useTheme } from "../context/CDSThemeContext";
|
|
5
5
|
|
|
6
|
-
export const
|
|
6
|
+
export const CDSSnackBar = ({ message, visible, onDismiss, hasClose }) => {
|
|
7
7
|
const { theme } = useTheme();
|
|
8
8
|
|
|
9
9
|
useEffect(() => {
|
package/index.js
CHANGED
|
@@ -19,7 +19,9 @@ export {CDSSelect} from './components/CDSSelect';
|
|
|
19
19
|
export {CDSLoader} from './components/CDSLoader';
|
|
20
20
|
export {CDSOffer} from './components/CDSOffer';
|
|
21
21
|
export {CDSTable} from './components/CDSTable';
|
|
22
|
-
export {CDSAccordion} from './components/CDSAccordion'
|
|
23
|
-
export {
|
|
22
|
+
export {CDSAccordion} from './components/CDSAccordion';
|
|
23
|
+
export {CDSSnackBar} from './components/CDSSnackBar';
|
|
24
|
+
export {CDSImageButton} from './components/CDSImageButton'
|
|
25
|
+
export {CDSImageButtonGroup} from './components/CDSImageButtonGroup'
|
|
24
26
|
|
|
25
27
|
export {CDSThemeProvider, useTheme} from './context/CDSThemeContext';
|
package/package.json
CHANGED
|
@@ -90,35 +90,35 @@ export const CDSprimitiveFontValues = {
|
|
|
90
90
|
size: {
|
|
91
91
|
typography: {
|
|
92
92
|
mobile: {
|
|
93
|
-
xs: 12,
|
|
94
|
-
sm: 14,
|
|
95
|
-
md:
|
|
96
|
-
lg:
|
|
97
|
-
xl: 25,
|
|
98
|
-
"2xl":
|
|
99
|
-
"3xl":
|
|
93
|
+
xs: 12, // Captions
|
|
94
|
+
sm: 14, // Etiquetas secundarias
|
|
95
|
+
md: 16, // BASE: Inputs y Párrafos
|
|
96
|
+
lg: 20, // H3 / Títulos pequeños
|
|
97
|
+
xl: 25, // H2 / Títulos medianos
|
|
98
|
+
"2xl": 31, // H1 / Títulos grandes
|
|
99
|
+
"3xl": 39, // Hero
|
|
100
100
|
},
|
|
101
101
|
desktop: {
|
|
102
102
|
xs: 14,
|
|
103
103
|
sm: 16,
|
|
104
|
-
md:
|
|
105
|
-
lg:
|
|
106
|
-
xl:
|
|
107
|
-
"2xl":
|
|
108
|
-
"3xl":
|
|
104
|
+
md: 18, // Base desktop más cómoda
|
|
105
|
+
lg: 24,
|
|
106
|
+
xl: 32,
|
|
107
|
+
"2xl": 48,
|
|
108
|
+
"3xl": 64,
|
|
109
109
|
},
|
|
110
110
|
},
|
|
111
111
|
iconography: {
|
|
112
112
|
mobile: {
|
|
113
|
-
xs: 14,
|
|
114
|
-
sm:
|
|
115
|
-
md:
|
|
116
|
-
lg:
|
|
113
|
+
xs: 14, // Para acompañar texto xs/sm
|
|
114
|
+
sm: 20, // Estándar para botones pequeños
|
|
115
|
+
md: 24, // Estándar de la industria para botones y menú
|
|
116
|
+
lg: 32, // Iconos destacados
|
|
117
117
|
},
|
|
118
118
|
desktop: {
|
|
119
119
|
xs: 16,
|
|
120
|
-
sm:
|
|
121
|
-
md:
|
|
120
|
+
sm: 24,
|
|
121
|
+
md: 32,
|
|
122
122
|
lg: 48,
|
|
123
123
|
},
|
|
124
124
|
},
|
|
@@ -126,40 +126,45 @@ export const CDSprimitiveFontValues = {
|
|
|
126
126
|
|
|
127
127
|
lineHeight: {
|
|
128
128
|
mobile: {
|
|
129
|
-
|
|
129
|
+
xs: 16,
|
|
130
|
+
sm: 20,
|
|
130
131
|
md: 24,
|
|
131
132
|
lg: 28,
|
|
132
|
-
xl:
|
|
133
|
-
"2xl":
|
|
134
|
-
"3xl":
|
|
133
|
+
xl: 32,
|
|
134
|
+
"2xl": 40,
|
|
135
|
+
"3xl": 48,
|
|
135
136
|
},
|
|
136
137
|
desktop: {
|
|
137
|
-
|
|
138
|
+
xs: 18,
|
|
139
|
+
sm: 24,
|
|
138
140
|
md: 28,
|
|
139
|
-
lg:
|
|
140
|
-
xl:
|
|
141
|
+
lg: 32,
|
|
142
|
+
xl: 40,
|
|
141
143
|
"2xl": 56,
|
|
142
|
-
"3xl":
|
|
144
|
+
"3xl": 72,
|
|
143
145
|
},
|
|
144
146
|
},
|
|
145
147
|
};
|
|
146
148
|
|
|
147
149
|
export const CDSPrimiviteRadius = {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
none: 0,
|
|
151
|
+
xs: 4, // Detalles mínimos
|
|
152
|
+
sm: 12, // Botones e Inputs (más suave que 8px)
|
|
153
|
+
md: 20, // Tarjetas y modales (se ve muy premium en móvil)
|
|
154
|
+
lg: 32, // BottomSheets (el estándar de Apple para hojas que suben)
|
|
155
|
+
xl: 40, // Contenedores muy grandes o secciones decorativas
|
|
152
156
|
full: 9999,
|
|
153
157
|
};
|
|
154
158
|
|
|
155
159
|
export const CDSPrimitiveSpacing =
|
|
156
160
|
{
|
|
157
161
|
none: { mobile: 0, desktop: 0 },
|
|
158
|
-
xs: { mobile:
|
|
159
|
-
sm: { mobile:
|
|
160
|
-
md: { mobile:
|
|
161
|
-
lg: { mobile:
|
|
162
|
-
xl: { mobile:
|
|
162
|
+
xs: { mobile: 4, desktop: 8 }, // Micro-ajustes (icon+text)
|
|
163
|
+
sm: { mobile: 8, desktop: 12 }, // Entre elementos pequeños
|
|
164
|
+
md: { mobile: 16, desktop: 24 }, // Padding interno de tarjetas
|
|
165
|
+
lg: { mobile: 24, desktop: 32 }, // Espacio entre secciones
|
|
166
|
+
xl: { mobile: 32, desktop: 48 }, // Márgenes de página
|
|
167
|
+
"2xl": { mobile: 48, desktop: 64 }, // Espacios hero
|
|
163
168
|
};
|
|
164
169
|
|
|
165
170
|
export const CDSPrimitiveShadows = (mode) => ({
|
|
@@ -168,7 +173,7 @@ export const CDSPrimitiveShadows = (mode) => ({
|
|
|
168
173
|
boxShadow: `0px 2px 4px ${mode === 'dark' ? 'rgba(0,0,0,0.4)' : 'rgba(0,0,0,0.08)'}`,
|
|
169
174
|
elevation: 3, // Indispensable para Android nativo
|
|
170
175
|
},
|
|
171
|
-
|
|
176
|
+
|
|
172
177
|
lg: {
|
|
173
178
|
// Sombra más elegante con más blur (8px) y desplazamiento (4px)
|
|
174
179
|
boxShadow: `0px 4px 12px ${mode === 'dark' ? 'rgba(0,0,0,0.6)' : 'rgba(0,0,0,0.15)'}`,
|
|
@@ -178,7 +183,7 @@ export const CDSPrimitiveShadows = (mode) => ({
|
|
|
178
183
|
|
|
179
184
|
export const resolveTokens = (primitives, isMobile) => {
|
|
180
185
|
const resolved = {};
|
|
181
|
-
|
|
186
|
+
|
|
182
187
|
for (const key in primitives) {
|
|
183
188
|
const value = primitives[key];
|
|
184
189
|
// Si el valor tiene la estructura { mobile, desktop }, elegimos uno
|