@steveencues/starter-react-ui 1.0.0 → 1.0.2

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 (129) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.js +66 -55
  5. package/dist/index.js.map +1 -1
  6. package/dist/libs/aplicacion/contexts/index.d.ts +2 -0
  7. package/dist/libs/aplicacion/contexts/theme.context.d.ts +7 -0
  8. package/dist/libs/aplicacion/contexts/translate.context.d.ts +7 -0
  9. package/dist/libs/aplicacion/hooks/index.d.ts +3 -0
  10. package/dist/libs/aplicacion/hooks/use-language.d.ts +8 -0
  11. package/dist/libs/aplicacion/hooks/use-theme-preference.hook.d.ts +7 -0
  12. package/dist/libs/aplicacion/hooks/use-theme.d.ts +8 -0
  13. package/dist/libs/aplicacion/index.d.ts +5 -0
  14. package/dist/libs/aplicacion/providers/index.d.ts +2 -0
  15. package/dist/libs/aplicacion/providers/theme-provider.d.ts +9 -0
  16. package/dist/libs/aplicacion/providers/translate.provider.d.ts +8 -0
  17. package/dist/libs/aplicacion/services/encryption.service.d.ts +18 -0
  18. package/dist/libs/aplicacion/services/index.d.ts +1 -0
  19. package/dist/libs/aplicacion/utils/base64.util.d.ts +16 -0
  20. package/dist/libs/aplicacion/utils/crypto-api.util.d.ts +7 -0
  21. package/dist/libs/aplicacion/utils/index.d.ts +6 -0
  22. package/dist/libs/aplicacion/utils/storage-api.util.d.ts +7 -0
  23. package/dist/libs/aplicacion/utils/text-encoding.util.d.ts +16 -0
  24. package/dist/libs/aplicacion/utils/theme.utils.d.ts +26 -0
  25. package/dist/libs/aplicacion/utils/translation.utils.d.ts +64 -0
  26. package/dist/libs/components/Button/Button.d.ts +1 -0
  27. package/dist/libs/components/Button/button.types.d.ts +1 -0
  28. package/dist/libs/components/Button/index.d.ts +1 -0
  29. package/dist/libs/components/Card/Card.d.ts +1 -0
  30. package/dist/libs/components/Card/card.types.d.ts +1 -0
  31. package/dist/libs/components/Card/index.d.ts +1 -0
  32. package/dist/libs/components/Input/Input.d.ts +1 -0
  33. package/dist/libs/components/Input/index.d.ts +1 -0
  34. package/dist/libs/components/Input/input.types.d.ts +1 -0
  35. package/dist/libs/components/index.d.ts +1 -0
  36. package/dist/libs/components/styles/index.d.ts +1 -0
  37. package/dist/libs/domain/constants/encrypted-preference.constanst.d.ts +7 -0
  38. package/dist/libs/domain/constants/index.d.ts +4 -0
  39. package/dist/libs/domain/constants/theme-css-variable.const.d.ts +69 -0
  40. package/dist/libs/domain/constants/theme-font-weight.const.d.ts +16 -0
  41. package/dist/libs/domain/constants/translation.constants.d.ts +1 -0
  42. package/dist/libs/domain/enums/index.d.ts +1 -0
  43. package/dist/libs/domain/enums/translation-regex.enum.d.ts +8 -0
  44. package/dist/libs/domain/index.d.ts +4 -0
  45. package/dist/libs/domain/interface/index.d.ts +4 -0
  46. package/dist/libs/domain/interface/manifest/index.d.ts +1 -0
  47. package/dist/libs/domain/interface/manifest/theme-manifest.interface.d.ts +23 -0
  48. package/dist/libs/domain/interface/theme/accessibility/index.d.ts +1 -0
  49. package/dist/libs/domain/interface/theme/accessibility/theme-accessibility.interface.d.ts +15 -0
  50. package/dist/libs/domain/interface/theme/colors/index.d.ts +8 -0
  51. package/dist/libs/domain/interface/theme/colors/theme-border-colors.interface.d.ts +17 -0
  52. package/dist/libs/domain/interface/theme/colors/theme-brand-colors.interface.d.ts +24 -0
  53. package/dist/libs/domain/interface/theme/colors/theme-color-palette.interface.d.ts +30 -0
  54. package/dist/libs/domain/interface/theme/colors/theme-data-colors.interface.d.ts +15 -0
  55. package/dist/libs/domain/interface/theme/colors/theme-overlay-colors.interface.d.ts +13 -0
  56. package/dist/libs/domain/interface/theme/colors/theme-state-colors.interface.d.ts +23 -0
  57. package/dist/libs/domain/interface/theme/colors/theme-surface-colors.interface.d.ts +19 -0
  58. package/dist/libs/domain/interface/theme/colors/theme-text-colors.interface.d.ts +19 -0
  59. package/dist/libs/domain/interface/theme/components/index.d.ts +6 -0
  60. package/dist/libs/domain/interface/theme/components/theme-button.interface.d.ts +18 -0
  61. package/dist/libs/domain/interface/theme/components/theme-card.interface.d.ts +15 -0
  62. package/dist/libs/domain/interface/theme/components/theme-components.interface.d.ts +12 -0
  63. package/dist/libs/domain/interface/theme/components/theme-input.interface.d.ts +18 -0
  64. package/dist/libs/domain/interface/theme/components/theme-interactive-colors.interface.d.ts +16 -0
  65. package/dist/libs/domain/interface/theme/components/theme-modal.interface.d.ts +14 -0
  66. package/dist/libs/domain/interface/theme/core/app-theme.interface.d.ts +11 -0
  67. package/dist/libs/domain/interface/theme/core/index.d.ts +2 -0
  68. package/dist/libs/domain/interface/theme/core/theme.interface.d.ts +26 -0
  69. package/dist/libs/domain/interface/theme/effects/index.d.ts +7 -0
  70. package/dist/libs/domain/interface/theme/effects/theme-animation.interface.d.ts +17 -0
  71. package/dist/libs/domain/interface/theme/effects/theme-animations.interface.d.ts +20 -0
  72. package/dist/libs/domain/interface/theme/effects/theme-effects.interface.d.ts +22 -0
  73. package/dist/libs/domain/interface/theme/effects/theme-gradient-stop.interface.d.ts +11 -0
  74. package/dist/libs/domain/interface/theme/effects/theme-gradient.interface.d.ts +16 -0
  75. package/dist/libs/domain/interface/theme/effects/theme-gradients.interface.d.ts +17 -0
  76. package/dist/libs/domain/interface/theme/effects/theme-transitions.interface.d.ts +18 -0
  77. package/dist/libs/domain/interface/theme/index.d.ts +8 -0
  78. package/dist/libs/domain/interface/theme/layout/index.d.ts +8 -0
  79. package/dist/libs/domain/interface/theme/layout/theme-breakpoints.interface.d.ts +13 -0
  80. package/dist/libs/domain/interface/theme/layout/theme-dimensions.interface.d.ts +15 -0
  81. package/dist/libs/domain/interface/theme/layout/theme-layout.interface.d.ts +14 -0
  82. package/dist/libs/domain/interface/theme/layout/theme-radii.interface.d.ts +16 -0
  83. package/dist/libs/domain/interface/theme/layout/theme-shadow-colors.interface.d.ts +13 -0
  84. package/dist/libs/domain/interface/theme/layout/theme-shadows.interface.d.ts +16 -0
  85. package/dist/libs/domain/interface/theme/layout/theme-spacing.interface.d.ts +20 -0
  86. package/dist/libs/domain/interface/theme/layout/theme-z-index.interface.d.ts +16 -0
  87. package/dist/libs/domain/interface/theme/preferences/index.d.ts +5 -0
  88. package/dist/libs/domain/interface/theme/preferences/theme-context.interface.d.ts +12 -0
  89. package/dist/libs/domain/interface/theme/preferences/theme-preference-configuration.interface.d.ts +11 -0
  90. package/dist/libs/domain/interface/theme/preferences/theme-preference-result.interface.d.ts +11 -0
  91. package/dist/libs/domain/interface/theme/preferences/theme-preference-state.interface.d.ts +10 -0
  92. package/dist/libs/domain/interface/theme/preferences/theme-provider.interface.d.ts +13 -0
  93. package/dist/libs/domain/interface/theme/typography/index.d.ts +5 -0
  94. package/dist/libs/domain/interface/theme/typography/theme-font-family.interface.d.ts +13 -0
  95. package/dist/libs/domain/interface/theme/typography/theme-font-sizes.interface.d.ts +20 -0
  96. package/dist/libs/domain/interface/theme/typography/theme-font-weights.interface.d.ts +17 -0
  97. package/dist/libs/domain/interface/theme/typography/theme-text-style.interface.d.ts +18 -0
  98. package/dist/libs/domain/interface/theme/typography/theme-typography.interface.d.ts +37 -0
  99. package/dist/libs/domain/interface/translation.interface.d.ts +56 -0
  100. package/dist/libs/domain/types/index.d.ts +2 -0
  101. package/dist/libs/domain/types/theme/index.d.ts +20 -0
  102. package/dist/libs/domain/types/theme/theme-animation.type.d.ts +18 -0
  103. package/dist/libs/domain/types/theme/theme-border.type.d.ts +7 -0
  104. package/dist/libs/domain/types/theme/theme-brand.type.d.ts +7 -0
  105. package/dist/libs/domain/types/theme/theme-category.type.d.ts +12 -0
  106. package/dist/libs/domain/types/theme/theme-color-scale.type.d.ts +6 -0
  107. package/dist/libs/domain/types/theme/theme-css.type.d.ts +15 -0
  108. package/dist/libs/domain/types/theme/theme-effect.type.d.ts +7 -0
  109. package/dist/libs/domain/types/theme/theme-font-weights.type.d.ts +7 -0
  110. package/dist/libs/domain/types/theme/theme-font.type.d.ts +19 -0
  111. package/dist/libs/domain/types/theme/theme-gradient.type.d.ts +12 -0
  112. package/dist/libs/domain/types/theme/theme-layout.type.d.ts +24 -0
  113. package/dist/libs/domain/types/theme/theme-name.types.d.ts +6 -0
  114. package/dist/libs/domain/types/theme/theme-preference.type.d.ts +8 -0
  115. package/dist/libs/domain/types/theme/theme-shadow.type.d.ts +7 -0
  116. package/dist/libs/domain/types/theme/theme-state.type.d.ts +7 -0
  117. package/dist/libs/domain/types/theme/theme-surface.type.d.ts +7 -0
  118. package/dist/libs/domain/types/theme/theme-text-style.type.d.ts +12 -0
  119. package/dist/libs/domain/types/theme/theme-text.type.d.ts +7 -0
  120. package/dist/libs/domain/types/theme/theme-typography.type.d.ts +7 -0
  121. package/dist/libs/domain/types/theme/theme-value.type.d.ts +12 -0
  122. package/dist/libs/domain/types/translation.types.d.ts +33 -0
  123. package/dist/libs/index.d.ts +4 -0
  124. package/dist/libs/infraestructura/index.d.ts +1 -0
  125. package/dist/libs/infraestructura/storage/encrypted-preference.storage.d.ts +19 -0
  126. package/dist/libs/infraestructura/storage/index.d.ts +3 -0
  127. package/dist/libs/infraestructura/storage/language-preference.storage.d.ts +18 -0
  128. package/dist/libs/infraestructura/storage/theme-preference.storage.d.ts +19 -0
  129. package/package.json +15 -3
@@ -0,0 +1,37 @@
1
+ import { ThemeFontFamily, ThemeFontSizes, ThemeFontWeights, ThemeTextStyle } from '../../..';
2
+ /**
3
+ * @description Define los estilos para encabezados, cuerpo, etiquetas y botones.
4
+ * @author Steveen Cues
5
+ * @version 2.0.0
6
+ */
7
+ export interface ThemeTypography {
8
+ readonly fontFamily: ThemeFontFamily;
9
+ readonly fontSize: ThemeFontSizes;
10
+ readonly fontWeight: ThemeFontWeights;
11
+ readonly lineHeight: Readonly<Record<string, string | number>>;
12
+ readonly letterSpacing: Readonly<Record<string, string>>;
13
+ readonly heading: {
14
+ readonly h1: ThemeTextStyle;
15
+ readonly h2: ThemeTextStyle;
16
+ readonly h3: ThemeTextStyle;
17
+ readonly h4: ThemeTextStyle;
18
+ readonly h5: ThemeTextStyle;
19
+ readonly h6: ThemeTextStyle;
20
+ };
21
+ readonly body: {
22
+ readonly primary: ThemeTextStyle;
23
+ readonly secondary: ThemeTextStyle;
24
+ readonly muted: ThemeTextStyle;
25
+ readonly small: ThemeTextStyle;
26
+ };
27
+ readonly label: {
28
+ readonly primary: ThemeTextStyle;
29
+ readonly secondary: ThemeTextStyle;
30
+ readonly muted: ThemeTextStyle;
31
+ };
32
+ readonly button: {
33
+ readonly primary: ThemeTextStyle;
34
+ readonly secondary: ThemeTextStyle;
35
+ };
36
+ readonly code: ThemeTextStyle;
37
+ }
@@ -0,0 +1,56 @@
1
+ import { TranslationCatalog, TranslationParams } from '../..';
2
+ import { ReactNode } from 'react';
3
+ /**
4
+ * @description Estado publico del contexto de traducciones.
5
+ * @author Steveen Cues
6
+ * @version 1.0.0
7
+ */
8
+ export interface ILanguageContextValue {
9
+ readonly language: string;
10
+ readonly languages: readonly string[];
11
+ readonly setLanguage: (language: string) => void;
12
+ readonly t: (key: string, params?: TranslationParams) => string;
13
+ }
14
+ /**
15
+ * @description Propiedades del proveedor de traducciones.
16
+ * @author Steveen Cues
17
+ * @version 1.0.0
18
+ */
19
+ export interface ITranslateProviderProps {
20
+ readonly translations: TranslationCatalog;
21
+ readonly initialLanguage: string;
22
+ readonly fallbackLanguage?: string;
23
+ readonly children: ReactNode;
24
+ readonly languageEncryptionKey: string;
25
+ }
26
+ /**
27
+ * @description Defines the configuration required to manage language preferences.
28
+ * @author Steveen Cues
29
+ * @version 1.0.0
30
+ */
31
+ export interface LanguagePreferenceConfiguration {
32
+ readonly translations: ITranslateProviderProps["translations"];
33
+ readonly initialLanguage: ITranslateProviderProps["initialLanguage"];
34
+ readonly fallbackLanguage: string;
35
+ readonly languageEncryptionKey: ITranslateProviderProps["languageEncryptionKey"];
36
+ readonly languages: readonly string[];
37
+ }
38
+ /**
39
+ * @description Represents the current language preference state and configuration.
40
+ * @author Steveen Cues
41
+ * @version 1.0.0
42
+ */
43
+ export interface LanguagePreferenceState extends LanguagePreferenceConfiguration {
44
+ readonly selectedLanguage: string;
45
+ readonly isLoaded: boolean;
46
+ }
47
+ /**
48
+ * @description Defines the result returned by the language preference hook.
49
+ * @author Steveen Cues
50
+ * @version 1.0.0
51
+ */
52
+ export interface LanguagePreferenceResult {
53
+ readonly language: string;
54
+ readonly isLoaded: boolean;
55
+ readonly setLanguage: (language: string) => void;
56
+ }
@@ -0,0 +1,2 @@
1
+ export * from './translation.types';
2
+ export * from './theme';
@@ -0,0 +1,20 @@
1
+ export * from './theme-animation.type';
2
+ export * from './theme-border.type';
3
+ export * from './theme-brand.type';
4
+ export * from './theme-category.type';
5
+ export * from './theme-css.type';
6
+ export * from './theme-effect.type';
7
+ export * from './theme-font.type';
8
+ export * from './theme-gradient.type';
9
+ export * from './theme-layout.type';
10
+ export * from './theme-preference.type';
11
+ export * from './theme-shadow.type';
12
+ export * from './theme-state.type';
13
+ export * from './theme-surface.type';
14
+ export * from './theme-text-style.type';
15
+ export * from './theme-text.type';
16
+ export * from './theme-typography.type';
17
+ export * from './theme-value.type';
18
+ export * from './theme-name.types';
19
+ export * from './theme-color-scale.type';
20
+ export * from './theme-font-weights.type';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @description Defines the supported animation styles.
3
+ * @author Steveen Cues
4
+ * @version 2.0.0
5
+ */
6
+ export type ThemeAnimationStyle = "fade" | "slide" | "scale" | "bounce" | "pulse" | "shimmer" | "gradient" | "glow" | "spin" | "float" | "none";
7
+ /**
8
+ * @description Defines the available easing curves.
9
+ * @author Steveen Cues
10
+ * @version 2.0.0
11
+ */
12
+ export type ThemeEasing = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "spring";
13
+ /**
14
+ * @description Defines the motion strategies supported by the system.
15
+ * @author Steveen Cues
16
+ * @version 2.0.0
17
+ */
18
+ export type ThemeMotionPreference = "full" | "reduced" | "system";
@@ -0,0 +1,7 @@
1
+ import { ThemeCssVariables } from '../..';
2
+ /**
3
+ * @description Defines CSS variables for border styles and colors.
4
+ * @author Steveen Cues
5
+ * @version 1.0.0
6
+ */
7
+ export type BorderVariables = Pick<ThemeCssVariables, "--rui-border-default" | "--rui-border-subtle" | "--rui-border-strong" | "--rui-border-focus" | "--rui-border-hover" | "--rui-border-active" | "--rui-border-disabled">;
@@ -0,0 +1,7 @@
1
+ import { ThemeCssVariables } from '../..';
2
+ /**
3
+ * @description Defines CSS variables for brand colors.
4
+ * @author Steveen Cues
5
+ * @version 1.0.0
6
+ */
7
+ export type BrandVariables = Pick<ThemeCssVariables, "--rui-brand-primary" | "--rui-brand-primary-hover" | "--rui-brand-primary-active" | "--rui-brand-primary-contrast" | "--rui-brand-secondary" | "--rui-brand-secondary-hover" | "--rui-brand-secondary-active" | "--rui-brand-secondary-contrast" | "--rui-brand-accent" | "--rui-brand-accent-hover" | "--rui-brand-accent-contrast">;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @description Defines the available categories for classifying a theme.
3
+ * @author Steveen Cues
4
+ * @version 2.0.0
5
+ */
6
+ export type ThemeCategory = "light" | "dark" | "colorful" | "brand" | "minimal" | "accessibility" | "custom";
7
+ /**
8
+ * @description Defines the luminosity scheme of a theme.
9
+ * @author Steveen Cues
10
+ * @version 2.0.0
11
+ */
12
+ export type ThemeColorScheme = "light" | "dark" | "auto";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @description Define una escala de colores con tonos progresivos.
3
+ * @author Steveen Cues
4
+ * @version 2.1.0
5
+ */
6
+ export type ThemeColorScale = Readonly<Record<"50" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | "950", string>>;
@@ -0,0 +1,15 @@
1
+ import { CSSProperties } from 'react';
2
+ /**
3
+ * @description Defines custom CSS variables supported by the library.
4
+ * @author Steveen Cues
5
+ * @version 1.0.0
6
+ */
7
+ export type ThemeCssVariables = CSSProperties & {
8
+ [property: `--rui-${string}`]: string;
9
+ };
10
+ /**
11
+ * @description Represents a CSS value compatible with the theme system.
12
+ * @author Steveen Cues
13
+ * @version 2.0.0
14
+ */
15
+ export type ThemeCssValue = string;
@@ -0,0 +1,7 @@
1
+ import { ThemeCssVariables } from '../..';
2
+ /**
3
+ * @description Defines CSS variables for visual effects.
4
+ * @author Steveen Cues
5
+ * @version 1.0.0
6
+ */
7
+ export type EffectVariables = Pick<ThemeCssVariables, "--rui-effects-overlay" | "--rui-effects-backdrop" | "--rui-effects-blur" | "--rui-effects-blur-strong" | "--rui-effects-glass-background" | "--rui-effects-glass-border">;
@@ -0,0 +1,7 @@
1
+ import { THEME_FONT_WEIGHT } from '../..';
2
+ /**
3
+ * @description Define los valores numericos permitidos para los pesos tipograficos.
4
+ * @author Steveen Cues
5
+ * @version 2.2.0
6
+ */
7
+ export type ThemeFontWeightValue = (typeof THEME_FONT_WEIGHT)[keyof typeof THEME_FONT_WEIGHT];
@@ -0,0 +1,19 @@
1
+ import { THEME_FONT_WEIGHT } from '../..';
2
+ /**
3
+ * @description Defines the available typography sizes.
4
+ * @author Steveen Cues
5
+ * @version 2.0.0
6
+ */
7
+ export type ThemeFontSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl";
8
+ /**
9
+ * @description Defines the available typography weights.
10
+ * @author Steveen Cues
11
+ * @version 2.0.0
12
+ */
13
+ export type ThemeFontWeight = (typeof THEME_FONT_WEIGHT)[keyof typeof THEME_FONT_WEIGHT];
14
+ /**
15
+ * @description Defines conventional typography styles.
16
+ * @author Steveen Cues
17
+ * @version 2.0.0
18
+ */
19
+ export type ThemeFontStyle = "normal" | "italic" | "oblique";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @description Defines the supported gradient types.
3
+ * @author Steveen Cues
4
+ * @version 2.0.0
5
+ */
6
+ export type ThemeGradientType = "linear" | "radial" | "conic";
7
+ /**
8
+ * @description Defines the permitted gradient directions.
9
+ * @author Steveen Cues
10
+ * @version 2.0.0
11
+ */
12
+ export type ThemeGradientDirection = "to-top" | "to-right" | "to-bottom" | "to-left" | "to-top-right" | "to-top-left" | "to-bottom-right" | "to-bottom-left";
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @description Defines the elevation levels of surfaces.
3
+ * @author Steveen Cues
4
+ * @version 2.0.0
5
+ */
6
+ export type ThemeElevation = "none" | "low" | "medium" | "high" | "highest";
7
+ /**
8
+ * @description Defines the available visual density variants.
9
+ * @author Steveen Cues
10
+ * @version 2.0.0
11
+ */
12
+ export type ThemeDensity = "compact" | "comfortable" | "spacious";
13
+ /**
14
+ * @description Defines the available border radius levels.
15
+ * @author Steveen Cues
16
+ * @version 2.0.0
17
+ */
18
+ export type ThemeRadius = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full";
19
+ /**
20
+ * @description Defines the supported device breakpoint sizes.
21
+ * @author Steveen Cues
22
+ * @version 2.0.0
23
+ */
24
+ export type ThemeBreakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @description Identificadores de los temas disponibles.
3
+ * @author Steveen Cues
4
+ * @version 1.0.0
5
+ */
6
+ export type ThemeName = "light" | "dark" | "semi-dark" | "system" | "auto" | "magenta" | "blue" | "indigo" | "purple" | "violet" | "pink" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "slate" | "gray" | "zinc" | "neutral" | "stone" | "rose" | "ocean" | "midnight" | "sunset" | "nord" | "dracula" | "monokai" | "github" | "solarized-light" | "solarized-dark" | "high-contrast" | "high-contrast-light" | "high-contrast-dark";
@@ -0,0 +1,8 @@
1
+ import { ThemePreferenceState } from '../..';
2
+ import { Dispatch, SetStateAction } from 'react';
3
+ /**
4
+ * @description Defines the React state dispatcher for theme preference updates.
5
+ * @author Steveen Cues
6
+ * @version 1.0.0
7
+ */
8
+ export type SetThemePreferenceState = Dispatch<SetStateAction<ThemePreferenceState>>;
@@ -0,0 +1,7 @@
1
+ import { ThemeCssVariables } from '../..';
2
+ /**
3
+ * @description Defines CSS variables for shadows.
4
+ * @author Steveen Cues
5
+ * @version 1.0.0
6
+ */
7
+ export type ShadowVariables = Pick<ThemeCssVariables, "--rui-shadow-color" | "--rui-shadow-subtle" | "--rui-shadow-small" | "--rui-shadow-medium" | "--rui-shadow-large" | "--rui-shadow-glow">;
@@ -0,0 +1,7 @@
1
+ import { ThemeCssVariables } from '../..';
2
+ /**
3
+ * @description Defines CSS variables for status colors.
4
+ * @author Steveen Cues
5
+ * @version 1.0.0
6
+ */
7
+ export type StateVariables = Pick<ThemeCssVariables, "--rui-state-success" | "--rui-state-success-background" | "--rui-state-warning" | "--rui-state-warning-background" | "--rui-state-error" | "--rui-state-error-background" | "--rui-state-info" | "--rui-state-info-background">;
@@ -0,0 +1,7 @@
1
+ import { ThemeCssVariables } from '../..';
2
+ /**
3
+ * @description Defines CSS variables for surface colors.
4
+ * @author Steveen Cues
5
+ * @version 1.0.0
6
+ */
7
+ export type SurfaceVariables = Pick<ThemeCssVariables, "--rui-surface-background" | "--rui-surface-surface" | "--rui-surface-surface-elevated" | "--rui-surface-surface-hover" | "--rui-surface-surface-active" | "--rui-surface-surface-disabled">;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @description Defines the available text alignment variants.
3
+ * @author Steveen Cues
4
+ * @version 2.0.0
5
+ */
6
+ export type ThemeTextAlignment = "left" | "center" | "right" | "justify" | "start" | "end";
7
+ /**
8
+ * @description Defines the supported text transformation options.
9
+ * @author Steveen Cues
10
+ * @version 2.0.0
11
+ */
12
+ export type ThemeTextTransform = "none" | "capitalize" | "uppercase" | "lowercase";
@@ -0,0 +1,7 @@
1
+ import { ThemeCssVariables } from '../..';
2
+ /**
3
+ * @description Defines CSS variables for text colors.
4
+ * @author Steveen Cues
5
+ * @version 1.0.0
6
+ */
7
+ export type TextVariables = Pick<ThemeCssVariables, "--rui-text-primary" | "--rui-text-secondary" | "--rui-text-muted" | "--rui-text-disabled" | "--rui-text-inverse" | "--rui-text-link" | "--rui-text-link-hover">;
@@ -0,0 +1,7 @@
1
+ import { ThemeCssVariables } from '../..';
2
+ /**
3
+ * @description Defines CSS variables for typography colors.
4
+ * @author Steveen Cues
5
+ * @version 1.0.0
6
+ */
7
+ export type TypographyVariables = Pick<ThemeCssVariables, "--rui-typography-heading-primary" | "--rui-typography-heading-secondary" | "--rui-typography-heading-muted" | "--rui-typography-body-primary" | "--rui-typography-body-secondary" | "--rui-typography-body-muted" | "--rui-typography-label-primary" | "--rui-typography-label-secondary" | "--rui-typography-label-muted" | "--rui-typography-button-primary" | "--rui-typography-button-secondary">;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @description Represents an opacity value between zero and one.
3
+ * @author Steveen Cues
4
+ * @version 2.0.0
5
+ */
6
+ export type ThemeOpacity = number;
7
+ /**
8
+ * @description Represents a numeric duration in milliseconds.
9
+ * @author Steveen Cues
10
+ * @version 2.0.0
11
+ */
12
+ export type ThemeDuration = number;
@@ -0,0 +1,33 @@
1
+ import { LanguagePreferenceState } from '..';
2
+ /**
3
+ * @description Valores admitidos en un catalogo de traducciones.
4
+ * @author Steveen Cues
5
+ * @version 1.0.0
6
+ */
7
+ export type TranslationValue = string | TranslationDictionary;
8
+ /**
9
+ * @description Diccionario de traducciones que admite claves anidadas.
10
+ * @author Steveen Cues
11
+ * @version 1.0.0
12
+ */
13
+ export interface TranslationDictionary {
14
+ readonly [key: string]: TranslationValue;
15
+ }
16
+ /**
17
+ * @description Catalogo de traducciones identificado por idioma.
18
+ * @author Steveen Cues
19
+ * @version 1.0.0
20
+ */
21
+ export type TranslationCatalog = Readonly<Record<string, TranslationDictionary>>;
22
+ /**
23
+ * @description Parametros para interpolar variables en una traduccion.
24
+ * @author Steveen Cues
25
+ * @version 1.0.0
26
+ */
27
+ export type TranslationParams = Readonly<Record<string, string | number>>;
28
+ /**
29
+ * @description Defines the React state dispatcher for language preference updates.
30
+ * @author Steveen Cues
31
+ * @version 1.0.0
32
+ */
33
+ export type SetLanguagePreferenceState = React.Dispatch<React.SetStateAction<LanguagePreferenceState>>;
@@ -0,0 +1,4 @@
1
+ export * from './aplicacion';
2
+ export * from './components';
3
+ export * from './domain';
4
+ export * from './infraestructura';
@@ -0,0 +1 @@
1
+ export * from './storage';
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @description Encrypts and saves a preference in localStorage.
3
+ * @param storageKey Storage key.
4
+ * @param value Value to store.
5
+ * @param encryptionKey Encryption secret.
6
+ * @returns Promise resolved after the save attempt.
7
+ * @author Steveen Cues
8
+ * @version 3.0.0
9
+ */
10
+ export declare function saveEncryptedPreference(storageKey: string, value: string, encryptionKey: string): Promise<void>;
11
+ /**
12
+ * @description Loads and decrypts a preference from localStorage.
13
+ * @param storageKey Storage key.
14
+ * @param encryptionKey Encryption secret.
15
+ * @returns Decrypted preference or undefined when unavailable.
16
+ * @author Steveen Cues
17
+ * @version 3.0.0
18
+ */
19
+ export declare function loadEncryptedPreference(storageKey: string, encryptionKey: string): Promise<string | undefined>;
@@ -0,0 +1,3 @@
1
+ export * from './encrypted-preference.storage';
2
+ export * from './language-preference.storage';
3
+ export * from './theme-preference.storage';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @description Guarda el idioma activo de forma cifrada.
3
+ * @param language Codigo del idioma activo.
4
+ * @param encryptionKey Clave de cifrado proporcionada por el consumidor.
5
+ * @returns Promesa completada al finalizar el intento de guardado.
6
+ * @author Steveen Cues
7
+ * @version 1.0.0
8
+ */
9
+ export declare function saveLanguagePreference(language: string, encryptionKey: string): Promise<void>;
10
+ /**
11
+ * @description Recupera el idioma guardado y verifica que siga disponible.
12
+ * @param availableLanguages Idiomas admitidos por el proyecto.
13
+ * @param encryptionKey Clave de cifrado proporcionada por el consumidor.
14
+ * @returns Idioma recuperado o undefined si no existe o no es valido.
15
+ * @author Steveen Cues
16
+ * @version 1.0.0
17
+ */
18
+ export declare function loadLanguagePreference(availableLanguages: readonly string[], encryptionKey: string): Promise<string | undefined>;
@@ -0,0 +1,19 @@
1
+ import { AppTheme, ThemeName } from '../../domain';
2
+ /**
3
+ * @description Guarda el nombre del tema activo de forma cifrada.
4
+ * @param themeName Nombre del tema.
5
+ * @param encryptionKey Clave de cifrado proporcionada por el consumidor.
6
+ * @returns Promesa completada al finalizar el intento de guardado.
7
+ * @author Steveen Cues
8
+ * @version 1.0.0
9
+ */
10
+ export declare function saveThemePreference(themeName: ThemeName, encryptionKey: string): Promise<void>;
11
+ /**
12
+ * @description Recupera el tema guardado si existe entre los temas admitidos.
13
+ * @param themes Temas definidos por el proyecto consumidor.
14
+ * @param encryptionKey Clave de cifrado proporcionada por el consumidor.
15
+ * @returns Nombre del tema recuperado o undefined.
16
+ * @author Steveen Cues
17
+ * @version 1.0.0
18
+ */
19
+ export declare function loadThemePreference(themes: readonly AppTheme[], encryptionKey: string): Promise<ThemeName | undefined>;
package/package.json CHANGED
@@ -1,10 +1,21 @@
1
1
  {
2
2
  "name": "@steveencues/starter-react-ui",
3
+ "version": "1.0.2",
3
4
  "private": false,
4
- "version": "1.0.0",
5
5
  "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ }
15
+ },
6
16
  "files": [
7
- "dist"
17
+ "dist",
18
+ "README.md"
8
19
  ],
9
20
  "scripts": {
10
21
  "lint": "eslint .",
@@ -42,6 +53,7 @@
42
53
  "vite": "^8.3.0"
43
54
  },
44
55
  "peerDependencies": {
45
- "react": "^18.2.0 || ^19.0.0"
56
+ "react": "^18.2.0 || ^19.0.0",
57
+ "react-dom": "^18.2.0 || ^19.0.0"
46
58
  }
47
59
  }