@apia/theme 0.1.0 → 0.1.3

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/index.d.ts CHANGED
@@ -187,6 +187,16 @@ type TParsedPalette = Required<TPalette<Required<IColorDefinition>, TColorModifi
187
187
  getStatesFromDefinition: TStatesRetriever;
188
188
  getStatesFromPath: typeof getColorsAndStatesByPath;
189
189
  };
190
+ type TColorDefinitionPrimitive = Pick<ThemeUICSSObject, 'color' | 'backgroundColor' | 'borderColor'>;
191
+ type TColorDefinition = TColorDefinitionPrimitive & {
192
+ active?: TColorDefinitionPrimitive;
193
+ checked?: TColorDefinitionPrimitive;
194
+ disabled?: TColorDefinitionPrimitive;
195
+ focus?: TColorDefinitionPrimitive;
196
+ hover?: TColorDefinitionPrimitive;
197
+ preventParse?: boolean;
198
+ selected?: TColorDefinitionPrimitive;
199
+ };
190
200
  declare global {
191
201
  interface Window {
192
202
  currentPalette: TParsedPalette;
@@ -195,6 +205,34 @@ declare global {
195
205
  }
196
206
  }
197
207
 
208
+ /**
209
+ * Esta función está pensada para ser utilizada dentro del objeto colors del
210
+ * tema. Aplica recursivamente los distintos estados a todos los elementos
211
+ * contenidos dentro de los objetos pasados como parámetro en properties.
212
+ *
213
+ * Es posible elegir cuáles estados se aplican y cuáles no mediante el segundo
214
+ * parámetro, que es un objeto cuyas propiedades serán tomadas en cuenta
215
+ * únicamente cuando tienen valor false, en cuyo caso no se aplicará el estado
216
+ * correspondiente.
217
+ *
218
+ * @param properties
219
+ * @param states
220
+ */
221
+ declare function applyStates(properties: Record<string, TColorDefinition | string | Record<string, unknown>>[], states?: TStates): void;
222
+
223
+ declare function parsePalette(palette: TPalette): TParsedPalette;
224
+
225
+ /**
226
+ * Básicamente agrega la definición de borderLeftColor, borderRightColor, etc.
227
+ */
228
+ declare function buildColorsObject(definition: Partial<TGetColorStateDefinition>): TGetColorStateDefinition;
229
+
230
+ /**
231
+ * Esta función calcula los colores de los estados a partir de la definición
232
+ * pasada.
233
+ */
234
+ declare function getColorsAndStatesByDefinition(definition: Partial<TGetColorStateDefinition>, options?: TGetColorsAndStatesOptions): ThemeUICSSObject;
235
+
198
236
  declare function getPalette(arg?: TPalette | boolean): TParsedPalette;
199
237
 
200
238
  /**
@@ -224,12 +262,6 @@ declare const getColorState: TStateRetriever;
224
262
  */
225
263
  declare const getColorStates: TStatesRetriever;
226
264
 
227
- /**
228
- * Esta función calcula los colores de los estados a partir de la definición
229
- * pasada.
230
- */
231
- declare function getColorsAndStatesByDefinition(definition: Partial<TGetColorStateDefinition>, options?: TGetColorsAndStatesOptions): ThemeUICSSObject;
232
-
233
265
  /**
234
266
  * Esta función arma un objeto con los colores que se deben aplicar para
235
267
  * garantizar que el resultado sea el esperado, por ejemplo, al aplicar un
@@ -329,5 +361,4 @@ declare function injectStyles(path: string, styles: ThemeUICSSObject): void;
329
361
  */
330
362
  declare function injectStyles(styles: ThemeUICSSObject): void;
331
363
 
332
- export { ThemeProvider, ThemeProviderContext, applyStatesGetColor, focusOutline, getColorState, getColorStates, getColorsAndStatesByDefinition, getColorsAndStatesByPath, getColorsByDefinition, getColorsByPath, getOneColorState, getPalette, getVariant, injectStyles, makeStyledComponent, responsive, smallButton, spacing, useMainTheme };
333
- //# sourceMappingURL=index.d.ts.map
364
+ export { TColorDefinition, TPalette, TParsedPalette, ThemeProvider, ThemeProviderContext, applyStates, applyStatesGetColor, buildColorsObject, focusOutline, getColorState, getColorStates, getColorsAndStatesByDefinition, getColorsAndStatesByPath, getColorsByDefinition, getColorsByPath, getOneColorState, getPalette, getVariant, injectStyles, makeStyledComponent, parsePalette, responsive, smallButton, spacing, useMainTheme };