@trii/components 2.0.104 → 3.1.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 (43) hide show
  1. package/dist/cjs/index.js +88 -88
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/esm/index.js +91 -91
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/index.d.ts +71 -55
  6. package/dist/types/components/ContactSidebar/ChatDetailsSidebar.d.ts +17 -3
  7. package/dist/types/components/ContactSidebar/SidebarContent.d.ts +9 -4
  8. package/dist/types/components/ContactSidebar/components/PanelView/PanelView.d.ts +1 -4
  9. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactMedia/ContactMedia.d.ts +0 -1
  10. package/dist/types/components/ContactSidebar/components/PanelView/components/GroupData/GroupData.d.ts +0 -1
  11. package/dist/types/components/ContactSidebar/components/PanelView/components/index.d.ts +0 -3
  12. package/dist/types/components/ContactSidebar/components/PanelView/layout/SectionCard/SectionCard.d.ts +1 -1
  13. package/dist/types/components/ContactSidebar/components/PanelView/types/ContactProps.d.ts +0 -1
  14. package/dist/types/components/ContactSidebar/components/TabsMenu/TabsMenu.d.ts +0 -3
  15. package/dist/types/components/ContactSidebar/components/index.d.ts +0 -3
  16. package/dist/types/components/EditContactModal/context/LanguageContext.d.ts +9 -0
  17. package/dist/types/components/EventsDialog/theme/index.d.ts +1 -0
  18. package/dist/types/components/EventsDialog/theme/themeProvider.d.ts +1 -0
  19. package/dist/types/index.d.ts +1 -1
  20. package/dist/types/theme/MuiComponentsConfig.d.ts +3 -0
  21. package/dist/types/theme/index.d.ts +4 -0
  22. package/dist/types/theme/themeProvider.d.ts +74 -0
  23. package/dist/types/theme/themeSlice.d.ts +52 -0
  24. package/package.json +1 -1
  25. package/readme +71 -71
  26. package/dist/types/components/ContactSidebar/components/AddButton/AddButton.d.ts +0 -5
  27. package/dist/types/components/ContactSidebar/components/AssistantView/AssistantView.d.ts +0 -29
  28. package/dist/types/components/ContactSidebar/components/InteractionView/AssignmentsView.d.ts +0 -12
  29. package/dist/types/components/ContactSidebar/components/InteractionView/InteractionSummary.d.ts +0 -16
  30. package/dist/types/components/ContactSidebar/components/InteractionView/InteractionView.d.ts +0 -3
  31. package/dist/types/components/ContactSidebar/components/InteractionView/OperationalActivityView.d.ts +0 -13
  32. package/dist/types/components/ContactSidebar/components/InteractionView/ParticipantsView.d.ts +0 -15
  33. package/dist/types/components/ContactSidebar/components/InteractionView/ServiceLevelView.d.ts +0 -33
  34. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactHighlights/ContactHighlights.d.ts +0 -2
  35. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactHighlights/index.d.ts +0 -1
  36. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactRepairs/ContactRepairs.d.ts +0 -4
  37. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactRepairs/components/RepairSection/RepairSection.d.ts +0 -7
  38. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactRepairs/index.d.ts +0 -1
  39. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactTicket/ContactTicket.d.ts +0 -4
  40. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactTicket/components/TicketSection/TicketSection.d.ts +0 -7
  41. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactTicket/index.d.ts +0 -1
  42. package/dist/types/components/ContactSidebar/components/SidebarViewNavigation/SidebarViewNavigation.d.ts +0 -15
  43. package/dist/types/components/ContactSidebar/hooks/useSectionRefs.d.ts +0 -19
package/dist/index.d.ts CHANGED
@@ -620,6 +620,12 @@ interface ChatDetailsSidebarBaseProps {
620
620
  * propia instancia de i18n, así que no sigue solo los cambios del host.
621
621
  */
622
622
  language?: string;
623
+ /**
624
+ * Gate de visibilidad (CSS display) del panel. Para hosts que renderizan
625
+ * vistas hermanas alternadas por CSS: el panel queda montado (conserva su
626
+ * estado y sus datos) pero oculto mientras `active` es false. Default: true.
627
+ */
628
+ active?: boolean;
623
629
  }
624
630
  /**
625
631
  * Qué mostrar. Hay dos formas y son excluyentes; TypeScript falla si no se pasa
@@ -652,9 +658,17 @@ type ChatDetailsSidebarTarget = {
652
658
  };
653
659
  type ChatDetailsSidebarProps = ChatDetailsSidebarBaseProps & ChatDetailsSidebarTarget;
654
660
  /**
655
- * Shell del sidebar (en camino al paquete npm): recibe las props del
656
- * contrato (docs/CONTRATO_CHATDETAILSSIDEBAR.md) y monta los providers
657
- * internos. La orquestación de UI vive en SidebarContent.
661
+ * Panel de contacto reutilizable: la ficha completa de un contacto/empresa
662
+ * (datos, conversaciones, archivos, media, historial, eventos, tareas, shop,
663
+ * relaciones, grupos de WhatsApp) con su riel vertical de tabs, skeleton y
664
+ * overlay de carga. Recibe las props del contrato y monta los providers
665
+ * internos; la orquestación de tabs vive en SidebarContent.
666
+ *
667
+ * El shell de vistas (header Contacto/Interacción/Asistente) es del host: este
668
+ * componente renderiza SOLO la vista de contacto y expone `active` para que el
669
+ * host lo alterne por CSS con sus vistas hermanas sin desmontarlo. Debe
670
+ * colocarse dentro de un contenedor flex con `position: relative` (el overlay
671
+ * y el skeleton se posicionan contra ese contenedor). Ver README.md.
658
672
  */
659
673
  declare const ChatDetailsSidebar: (props: ChatDetailsSidebarProps) => react_jsx_runtime.JSX.Element;
660
674
 
@@ -662,6 +676,58 @@ declare const i18nInstance: i18next.i18n;
662
676
 
663
677
  declare const MuiComponentsConfig: (themeRedux: Theme) => Theme;
664
678
 
679
+ /**
680
+ * Forma mínima del store que necesita este slice: la app que lo use tiene que
681
+ * tener `Theme` y `User.user.uid`.
682
+ */
683
+ interface ThemeRootState {
684
+ User: {
685
+ user: {
686
+ uid: string;
687
+ };
688
+ };
689
+ Theme: ThemeState;
690
+ }
691
+ /** Nombres de tema disponibles. */
692
+ type ThemeName = 'lightBlueIndigo' | 'darkBlack' | 'darkBlue' | 'lightAmber' | 'lightBlue' | 'lightBrown' | 'lightGray' | 'lightGreen' | 'lightLime' | 'lightOrange' | 'lightPink' | 'lightPurple' | 'lightRed' | 'lightTeal' | 'lightYellow';
693
+ /** Estado del slice. */
694
+ interface ThemeState {
695
+ themeSelected: Theme;
696
+ darkMode: boolean;
697
+ toggleStatus: 'idle' | 'toggled';
698
+ }
699
+ /** Guarda el tema elegido en el backend. */
700
+ declare const updateTheme: _reduxjs_toolkit.AsyncThunk<{
701
+ theme: ThemeName;
702
+ }, ThemeName, {
703
+ state: ThemeRootState;
704
+ dispatch?: redux_thunk.ThunkDispatch<unknown, unknown, redux.UnknownAction>;
705
+ extra?: unknown;
706
+ rejectValue?: unknown;
707
+ serializedErrorType?: unknown;
708
+ pendingMeta?: unknown;
709
+ fulfilledMeta?: unknown;
710
+ rejectedMeta?: unknown;
711
+ }>;
712
+ /** Valida que el string sea un `ThemeName`. */
713
+ declare const isValidThemeName: (theme: string) => theme is ThemeName;
714
+ declare const toggleTheme: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<ThemeName, "Theme/toggleTheme">;
715
+ declare const toggleModeTheme: _reduxjs_toolkit.ActionCreatorWithoutPayload<"Theme/toggleModeTheme">;
716
+ declare const selectThemeToggleStatus: (state: ThemeRootState) => "idle" | "toggled";
717
+ declare const selectTheme: (state: ThemeRootState) => Theme;
718
+ declare const selectDarkTheme: (state: ThemeRootState) => boolean;
719
+ /**
720
+ * @deprecated Usar `selectTheme`. El prefijo correcto para un selector es
721
+ * `select` (ver Guía de Arquitectura Frontend, sección 4 - Nomenclatura).
722
+ * Se mantiene hasta que los 6 micro-fronts terminen de migrar.
723
+ */
724
+ declare const selectedTheme: (state: ThemeRootState) => Theme;
725
+ /**
726
+ * @deprecated Usar `selectDarkTheme`. Mismo motivo que `selectedTheme`.
727
+ */
728
+ declare const selectedDarkTheme: (state: ThemeRootState) => boolean;
729
+ declare const _default: redux.Reducer<ThemeState>;
730
+
665
731
  declare module '@mui/material/styles' {
666
732
  interface TypeBackground {
667
733
  mainCenter: string;
@@ -674,6 +740,7 @@ declare module '@mui/material/styles' {
674
740
  panelHeader: string;
675
741
  panelCenter: string;
676
742
  panelGradient: string;
743
+ selectedItem: string;
677
744
  }
678
745
  interface TypeText {
679
746
  colorMain: string;
@@ -735,55 +802,4 @@ declare const lightGray: Theme;
735
802
  declare const darkBlue: Theme;
736
803
  declare const darkBlack: Theme;
737
804
 
738
- /**
739
- * Minimal root state shape required by this slice.
740
- * Consumer apps must include both Theme and User (with uid) in their store.
741
- */
742
- interface ThemeRootState {
743
- User: {
744
- user: {
745
- uid: string;
746
- };
747
- };
748
- Theme: ThemeState;
749
- }
750
- /**
751
- * Theme name type - defines all available theme options
752
- */
753
- type ThemeName = 'lightBlueIndigo' | 'darkBlack' | 'darkBlue' | 'lightAmber' | 'lightBlue' | 'lightBrown' | 'lightGray' | 'lightGreen' | 'lightLime' | 'lightOrange' | 'lightPink' | 'lightPurple' | 'lightRed' | 'lightTeal' | 'lightYellow';
754
- /**
755
- * Theme slice state interface
756
- */
757
- interface ThemeState {
758
- themeSelected: Theme;
759
- darkMode: boolean;
760
- toggleStatus: 'idle' | 'toggled';
761
- }
762
- /**
763
- * Async thunk to update theme on the server
764
- */
765
- declare const updateTheme: _reduxjs_toolkit.AsyncThunk<{
766
- theme: ThemeName;
767
- }, ThemeName, {
768
- state: ThemeRootState;
769
- dispatch?: redux_thunk.ThunkDispatch<unknown, unknown, redux.UnknownAction>;
770
- extra?: unknown;
771
- rejectValue?: unknown;
772
- serializedErrorType?: unknown;
773
- pendingMeta?: unknown;
774
- fulfilledMeta?: unknown;
775
- rejectedMeta?: unknown;
776
- }>;
777
- /**
778
- * Type guard to check if a string is a valid ThemeName
779
- * @param theme - String to validate
780
- * @returns true if theme is a valid ThemeName
781
- */
782
- declare const isValidThemeName: (theme: string) => theme is ThemeName;
783
- declare const toggleTheme: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<ThemeName, "Theme/toggleTheme">;
784
- declare const toggleModeTheme: _reduxjs_toolkit.ActionCreatorWithoutPayload<"Theme/toggleModeTheme">;
785
- declare const selectThemeToggleStatus: (state: ThemeRootState) => "idle" | "toggled";
786
- declare const selectedTheme: (state: ThemeRootState) => Theme;
787
- declare const selectedDarkTheme: (state: ThemeRootState) => boolean;
788
-
789
- export { AsyncContent, type AsyncContentProps, type AsyncData, type AsyncState, type AsyncStatus, type Calendar, type Contact, ContactInfoPopup, ChatDetailsSidebar as ContactSidebar, type ChatDetailsSidebarProps as ContactSidebarProps, EditContactModal, type EditContactModalProps, type EditContactMode, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, type EventData, EventsDialog, type EventsDialogProps, type IsEmptyFn, type ItemType, type ModalMode, MuiComponentsConfig, type Notification, PanelErrorBoundary, type PanelErrorBoundaryProps, type SidebarChatIntegration, type StartConversationTarget, type TaskData, type ThemeName, type ThemeRootState, type ThemeState, type UseAsyncDataResult, asyncIdle, asyncRequestFailed, asyncRequestStarted, asyncRequestSucceeded, darkBlack, darkBlue, defaultIsEmpty, deriveAsyncState, getErrorMessage, i18nInstance as i18n, isStale, isValidThemeName, lightAmber, lightBlue, lightBlueIndigo, lightBrown, lightGray, lightGreen, lightLime, lightOrange, lightPink, lightPurple, lightRed, lightTeal, lightYellow, selectThemeToggleStatus, selectedDarkTheme, selectedTheme, toggleModeTheme, toggleTheme, updateTheme, useAsyncData };
805
+ export { AsyncContent, type AsyncContentProps, type AsyncData, type AsyncState, type AsyncStatus, type Calendar, type Contact, ContactInfoPopup, ChatDetailsSidebar as ContactSidebar, type ChatDetailsSidebarProps as ContactSidebarProps, EditContactModal, type EditContactModalProps, type EditContactMode, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, type EventData, EventsDialog, type EventsDialogProps, type IsEmptyFn, type ItemType, type ModalMode, MuiComponentsConfig, type Notification, PanelErrorBoundary, type PanelErrorBoundaryProps, type SidebarChatIntegration, type StartConversationTarget, type TaskData, type ThemeName, type ThemeRootState, type ThemeState, type UseAsyncDataResult, asyncIdle, asyncRequestFailed, asyncRequestStarted, asyncRequestSucceeded, darkBlack, darkBlue, defaultIsEmpty, deriveAsyncState, getErrorMessage, i18nInstance as i18n, isStale, isValidThemeName, lightAmber, lightBlue, lightBlueIndigo, lightBrown, lightGray, lightGreen, lightLime, lightOrange, lightPink, lightPurple, lightRed, lightTeal, lightYellow, selectDarkTheme, selectTheme, selectThemeToggleStatus, selectedDarkTheme, selectedTheme, _default as themeReducer, toggleModeTheme, toggleTheme, updateTheme, useAsyncData };
@@ -23,6 +23,12 @@ interface ChatDetailsSidebarBaseProps {
23
23
  * propia instancia de i18n, así que no sigue solo los cambios del host.
24
24
  */
25
25
  language?: string;
26
+ /**
27
+ * Gate de visibilidad (CSS display) del panel. Para hosts que renderizan
28
+ * vistas hermanas alternadas por CSS: el panel queda montado (conserva su
29
+ * estado y sus datos) pero oculto mientras `active` es false. Default: true.
30
+ */
31
+ active?: boolean;
26
32
  }
27
33
  /**
28
34
  * Qué mostrar. Hay dos formas y son excluyentes; TypeScript falla si no se pasa
@@ -55,9 +61,17 @@ type ChatDetailsSidebarTarget = {
55
61
  };
56
62
  export type ChatDetailsSidebarProps = ChatDetailsSidebarBaseProps & ChatDetailsSidebarTarget;
57
63
  /**
58
- * Shell del sidebar (en camino al paquete npm): recibe las props del
59
- * contrato (docs/CONTRATO_CHATDETAILSSIDEBAR.md) y monta los providers
60
- * internos. La orquestación de UI vive en SidebarContent.
64
+ * Panel de contacto reutilizable: la ficha completa de un contacto/empresa
65
+ * (datos, conversaciones, archivos, media, historial, eventos, tareas, shop,
66
+ * relaciones, grupos de WhatsApp) con su riel vertical de tabs, skeleton y
67
+ * overlay de carga. Recibe las props del contrato y monta los providers
68
+ * internos; la orquestación de tabs vive en SidebarContent.
69
+ *
70
+ * El shell de vistas (header Contacto/Interacción/Asistente) es del host: este
71
+ * componente renderiza SOLO la vista de contacto y expone `active` para que el
72
+ * host lo alterne por CSS con sus vistas hermanas sin desmontarlo. Debe
73
+ * colocarse dentro de un contenedor flex con `position: relative` (el overlay
74
+ * y el skeleton se posicionan contra ese contenedor). Ver README.md.
61
75
  */
62
76
  declare const ChatDetailsSidebar: (props: ChatDetailsSidebarProps) => import("react/jsx-runtime").JSX.Element;
63
77
  export default ChatDetailsSidebar;
@@ -1,11 +1,16 @@
1
1
  import { IConversation } from '@trii/types/dist/Conversations';
2
2
  export interface SidebarContentProps {
3
3
  conversation: IConversation | null;
4
+ /** Gate CSS de visibilidad del panel (ver ChatDetailsSidebar.active). */
5
+ active: boolean;
4
6
  }
5
7
  /**
6
- * Orquestación de UI del sidebar (tabs, overlay, skeleton). Vive dentro de
7
- * los providers internos (SidebarProps + SidebarData) para poder disparar
8
- * los fetches del mini-store sin tocar el store del host.
8
+ * Orquestación de UI del panel de contacto (tabs, overlay, skeleton). Vive
9
+ * dentro de los providers internos (SidebarProps + SidebarData) para poder
10
+ * disparar los fetches del mini-store sin tocar el store del host.
11
+ *
12
+ * El root es un Fragment: skeleton/panel/overlay se posicionan contra el
13
+ * contenedor `position: relative` que provee el host.
9
14
  */
10
- declare const SidebarContent: ({ conversation }: SidebarContentProps) => import("react/jsx-runtime").JSX.Element;
15
+ declare const SidebarContent: ({ conversation, active }: SidebarContentProps) => import("react/jsx-runtime").JSX.Element;
11
16
  export default SidebarContent;
@@ -1,9 +1,6 @@
1
- import { SectionRefs } from '../../hooks/useSectionRefs';
2
1
  type PanelViewProps = {
3
- sectionRefs: SectionRefs;
4
- setValue: (value: number) => void;
2
+ /** Índice del tab activo (lo controla TabsMenu vía SidebarContent). */
5
3
  value: number;
6
- isClicked: boolean;
7
4
  };
8
5
  declare const PanelView: ({ value }: PanelViewProps) => import("react/jsx-runtime").JSX.Element;
9
6
  export default PanelView;
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  type ContactProps = {
3
3
  contactId: string;
4
- handleClick?: () => void;
5
4
  defaultExpanded?: boolean;
6
5
  };
7
6
  declare const ContactMedia: React.ForwardRefExoticComponent<ContactProps & React.RefAttributes<HTMLElement>>;
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  type Props = {
3
- handleClick: () => void;
4
3
  defaultExpanded?: boolean;
5
4
  };
6
5
  declare const GroupData: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLElement>>;
@@ -5,13 +5,10 @@ export { default as ContactFiles } from './ContactFiles';
5
5
  export { default as ContactMedia } from './ContactMedia';
6
6
  export { default as ContactHistory } from './ContactHistory';
7
7
  export { default as ContactNotes } from './ContactNotes';
8
- export { default as ContactRepairs } from './ContactRepairs';
9
8
  export { default as ContactEvent } from './ContactEvent';
10
9
  export { default as ContactTask } from './ContactTask';
11
- export { default as ContactTicket } from './ContactTicket';
12
10
  export { default as ContactButton } from './ContactButton';
13
11
  export { default as ContactPanelShop } from './ContactPanelShop';
14
12
  export { default as ContactRelations } from './ContactRelations';
15
13
  export { default as GroupData } from './GroupData';
16
14
  export { default as PremiumContactHeader } from './PremiumContactHeader';
17
- export { default as ContactHighlights } from './ContactHighlights';
@@ -5,7 +5,7 @@ type SectionCardProps = {
5
5
  children: ReactNode;
6
6
  title: string;
7
7
  defaultExpanded?: boolean;
8
- onClick: () => void;
8
+ onClick?: () => void;
9
9
  tabName: TabName;
10
10
  contactInfo?: IContact;
11
11
  onExpandChange?: (isExpanded: boolean) => void;
@@ -1,7 +1,6 @@
1
1
  import { IIntegrationButton } from '@trii/types/dist/Contacts';
2
2
  export interface ContactProps {
3
3
  contactId?: string;
4
- handleClick: () => void;
5
4
  defaultExpanded?: boolean;
6
5
  }
7
6
  export interface ContactButtonProps extends ContactProps {
@@ -1,9 +1,6 @@
1
- import { SectionRefs } from '../../hooks/useSectionRefs';
2
1
  type TabsMenuProps = {
3
2
  handleChange: (newValue: number) => void;
4
3
  value: number;
5
- sectionRefs: SectionRefs;
6
- setIsClicked: (isClicked: boolean) => void;
7
4
  };
8
5
  declare function TabsMenu({ handleChange, value }: TabsMenuProps): import("react/jsx-runtime").JSX.Element;
9
6
  export default TabsMenu;
@@ -1,6 +1,3 @@
1
1
  export { default as ContactInfoSkeleton } from './ContactInfoSkeleton';
2
- export { default as AssistantView } from './AssistantView/AssistantView';
3
- export { default as InteractionView } from './InteractionView/InteractionView';
4
2
  export { default as PanelView } from './PanelView';
5
- export { default as SidebarViewNavigation, type SidebarView, type SidebarViewDefinition, } from './SidebarViewNavigation/SidebarViewNavigation';
6
3
  export { default as TabsMenu } from './TabsMenu';
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ export type Language = 'en' | 'es';
3
+ interface LanguageProviderProps {
4
+ language: Language;
5
+ children: ReactNode;
6
+ }
7
+ export declare const LanguageProvider: ({ language, children }: LanguageProviderProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const useLanguageContext: () => Language;
9
+ export {};
@@ -1,3 +1,4 @@
1
1
  export { default as MuiComponentsConfig } from './MuiComponentsConfig';
2
+ export { default as themeReducer } from './themeSlice';
2
3
  export * from './themeProvider';
3
4
  export * from './themeSlice';
@@ -11,6 +11,7 @@ declare module '@mui/material/styles' {
11
11
  panelHeader: string;
12
12
  panelCenter: string;
13
13
  panelGradient: string;
14
+ selectedItem: string;
14
15
  }
15
16
  interface TypeText {
16
17
  colorMain: string;
@@ -1,4 +1,4 @@
1
1
  export * from './components';
2
2
  export * from './asyncState';
3
3
  export { i18n } from './i18n';
4
- export * from './components/EventsDialog/theme';
4
+ export * from './theme';
@@ -0,0 +1,3 @@
1
+ import { Theme } from '@mui/material';
2
+ declare const MuiComponentsConfig: (themeRedux: Theme) => Theme;
3
+ export default MuiComponentsConfig;
@@ -0,0 +1,4 @@
1
+ export { default as MuiComponentsConfig } from './MuiComponentsConfig';
2
+ export { default as themeReducer } from './themeSlice';
3
+ export * from './themeProvider';
4
+ export * from './themeSlice';
@@ -0,0 +1,74 @@
1
+ import { Theme } from '@mui/material';
2
+ declare module '@mui/material/styles' {
3
+ interface TypeBackground {
4
+ mainCenter: string;
5
+ mainGradient: string;
6
+ navMenu: string;
7
+ dropdownMenu: string;
8
+ panel: string;
9
+ tooltip: string;
10
+ accordionHeader: string;
11
+ panelHeader: string;
12
+ panelCenter: string;
13
+ panelGradient: string;
14
+ selectedItem: string;
15
+ }
16
+ interface TypeText {
17
+ colorMain: string;
18
+ }
19
+ interface Palette {
20
+ containerBox: {
21
+ default: string;
22
+ main: string;
23
+ };
24
+ dropdownBox: string;
25
+ color: {
26
+ icons: string;
27
+ };
28
+ cellHeader: string;
29
+ Skeleton: {
30
+ bg: string;
31
+ };
32
+ messageBox: string;
33
+ boxShadow: string;
34
+ disabled: string;
35
+ }
36
+ interface PaletteOptions {
37
+ containerBox?: {
38
+ default?: string;
39
+ main?: string;
40
+ };
41
+ dropdownBox?: string;
42
+ color?: {
43
+ icons?: string;
44
+ };
45
+ cellHeader?: string;
46
+ Skeleton?: {
47
+ bg?: string;
48
+ };
49
+ messageBox?: string;
50
+ boxShadow?: string;
51
+ disabled?: string;
52
+ }
53
+ interface Theme {
54
+ name?: string;
55
+ }
56
+ interface ThemeOptions {
57
+ name?: string;
58
+ }
59
+ }
60
+ export declare const lightBlueIndigo: Theme;
61
+ export declare const lightBlue: Theme;
62
+ export declare const lightRed: Theme;
63
+ export declare const lightGreen: Theme;
64
+ export declare const lightPink: Theme;
65
+ export declare const lightPurple: Theme;
66
+ export declare const lightTeal: Theme;
67
+ export declare const lightLime: Theme;
68
+ export declare const lightYellow: Theme;
69
+ export declare const lightAmber: Theme;
70
+ export declare const lightOrange: Theme;
71
+ export declare const lightBrown: Theme;
72
+ export declare const lightGray: Theme;
73
+ export declare const darkBlue: Theme;
74
+ export declare const darkBlack: Theme;
@@ -0,0 +1,52 @@
1
+ import { Theme } from '@mui/material';
2
+ /**
3
+ * Forma mínima del store que necesita este slice: la app que lo use tiene que
4
+ * tener `Theme` y `User.user.uid`.
5
+ */
6
+ export interface ThemeRootState {
7
+ User: {
8
+ user: {
9
+ uid: string;
10
+ };
11
+ };
12
+ Theme: ThemeState;
13
+ }
14
+ /** Nombres de tema disponibles. */
15
+ export type ThemeName = 'lightBlueIndigo' | 'darkBlack' | 'darkBlue' | 'lightAmber' | 'lightBlue' | 'lightBrown' | 'lightGray' | 'lightGreen' | 'lightLime' | 'lightOrange' | 'lightPink' | 'lightPurple' | 'lightRed' | 'lightTeal' | 'lightYellow';
16
+ /** Estado del slice. */
17
+ export interface ThemeState {
18
+ themeSelected: Theme;
19
+ darkMode: boolean;
20
+ toggleStatus: 'idle' | 'toggled';
21
+ }
22
+ /** Guarda el tema elegido en el backend. */
23
+ export declare const updateTheme: import("@reduxjs/toolkit").AsyncThunk<{
24
+ theme: ThemeName;
25
+ }, ThemeName, {
26
+ state: ThemeRootState;
27
+ dispatch?: import("redux-thunk").ThunkDispatch<unknown, unknown, import("redux").UnknownAction>;
28
+ extra?: unknown;
29
+ rejectValue?: unknown;
30
+ serializedErrorType?: unknown;
31
+ pendingMeta?: unknown;
32
+ fulfilledMeta?: unknown;
33
+ rejectedMeta?: unknown;
34
+ }>;
35
+ /** Valida que el string sea un `ThemeName`. */
36
+ export declare const isValidThemeName: (theme: string) => theme is ThemeName;
37
+ export declare const toggleTheme: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<ThemeName, "Theme/toggleTheme">, toggleModeTheme: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"Theme/toggleModeTheme">;
38
+ export declare const selectThemeToggleStatus: (state: ThemeRootState) => "idle" | "toggled";
39
+ export declare const selectTheme: (state: ThemeRootState) => Theme;
40
+ export declare const selectDarkTheme: (state: ThemeRootState) => boolean;
41
+ /**
42
+ * @deprecated Usar `selectTheme`. El prefijo correcto para un selector es
43
+ * `select` (ver Guía de Arquitectura Frontend, sección 4 - Nomenclatura).
44
+ * Se mantiene hasta que los 6 micro-fronts terminen de migrar.
45
+ */
46
+ export declare const selectedTheme: (state: ThemeRootState) => Theme;
47
+ /**
48
+ * @deprecated Usar `selectDarkTheme`. Mismo motivo que `selectedTheme`.
49
+ */
50
+ export declare const selectedDarkTheme: (state: ThemeRootState) => boolean;
51
+ declare const _default: import("redux").Reducer<ThemeState>;
52
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trii/components",
3
- "version": "2.0.104",
3
+ "version": "3.1.0",
4
4
  "description": "Trii components package",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/readme CHANGED
@@ -1,71 +1,71 @@
1
- # Trii Components
2
-
3
- ## Introduction
4
-
5
- This project contains reusable components for the Trii application.
6
-
7
- ## Prerequisites
8
-
9
- - Node.js (v14 or higher)
10
- - npm (v6 or higher) or yarn (v1.22 or higher)
11
-
12
- ## Installation
13
-
14
- 1. Clone the repository:
15
- ```sh
16
- git clone https://github.com/yourusername/trii-components.git
17
- ```
18
- 2. Navigate to the project directory:
19
- ```sh
20
- cd trii-components
21
- ```
22
- 3. Install dependencies:
23
- ```sh
24
- npm install
25
- ```
26
- or
27
- ```sh
28
- yarn install
29
- ```
30
-
31
- ## Running the Project
32
-
33
- To start the development server, run:
34
-
35
- ```sh
36
- npm run storybook
37
- ```
38
-
39
- or
40
-
41
- ```sh
42
- yarn storybook
43
- ```
44
-
45
- ## Building the Project
46
-
47
- To build the project, run:
48
-
49
- ```sh
50
- npm run build
51
- ```
52
-
53
- or
54
-
55
- ```sh
56
- yarn build
57
- ```
58
-
59
- ## Upload build to NPM
60
-
61
- To upload the build to NPM, run:
62
-
63
- ```sh
64
- npm publish
65
- ```
66
-
67
- or
68
-
69
- ```sh
70
- yarn publish
71
- ```
1
+ # Trii Components
2
+
3
+ ## Introduction
4
+
5
+ This project contains reusable components for the Trii application.
6
+
7
+ ## Prerequisites
8
+
9
+ - Node.js (v14 or higher)
10
+ - npm (v6 or higher) or yarn (v1.22 or higher)
11
+
12
+ ## Installation
13
+
14
+ 1. Clone the repository:
15
+ ```sh
16
+ git clone https://github.com/yourusername/trii-components.git
17
+ ```
18
+ 2. Navigate to the project directory:
19
+ ```sh
20
+ cd trii-components
21
+ ```
22
+ 3. Install dependencies:
23
+ ```sh
24
+ npm install
25
+ ```
26
+ or
27
+ ```sh
28
+ yarn install
29
+ ```
30
+
31
+ ## Running the Project
32
+
33
+ To start the development server, run:
34
+
35
+ ```sh
36
+ npm run storybook
37
+ ```
38
+
39
+ or
40
+
41
+ ```sh
42
+ yarn storybook
43
+ ```
44
+
45
+ ## Building the Project
46
+
47
+ To build the project, run:
48
+
49
+ ```sh
50
+ npm run build
51
+ ```
52
+
53
+ or
54
+
55
+ ```sh
56
+ yarn build
57
+ ```
58
+
59
+ ## Upload build to NPM
60
+
61
+ To upload the build to NPM, run:
62
+
63
+ ```sh
64
+ npm publish
65
+ ```
66
+
67
+ or
68
+
69
+ ```sh
70
+ yarn publish
71
+ ```
@@ -1,5 +0,0 @@
1
- interface AddButtonProps {
2
- label: string;
3
- }
4
- declare const AddButton: ({ label }: AddButtonProps) => import("react/jsx-runtime").JSX.Element;
5
- export default AddButton;
@@ -1,29 +0,0 @@
1
- export interface AssistantRecommendation {
2
- id: string;
3
- title: string;
4
- description: string;
5
- confidence: number;
6
- icon: 'validate' | 'update' | 'reminder';
7
- }
8
- export interface SuggestedKnowledge {
9
- id: string;
10
- title: string;
11
- description: string;
12
- }
13
- export interface AssistantData {
14
- conversationContext: string;
15
- operationalSummary: string;
16
- keyPoints: string[];
17
- recommendations: AssistantRecommendation[];
18
- suggestedKnowledge: SuggestedKnowledge[];
19
- preventiveQuality: {
20
- score: string;
21
- description: string;
22
- };
23
- }
24
- interface AssistantViewProps {
25
- data?: AssistantData;
26
- }
27
- /** Base visual del asistente, desacoplada de futuras acciones y respuestas IA. */
28
- declare const AssistantView: ({ data }: AssistantViewProps) => import("react/jsx-runtime").JSX.Element;
29
- export default AssistantView;