@trii/components 3.1.4 → 3.1.6

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 (84) hide show
  1. package/dist/cjs/index.js +38 -38
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/theme.js +1 -1
  4. package/dist/cjs/theme.js.map +1 -1
  5. package/dist/esm/index.js +37 -37
  6. package/dist/esm/index.js.map +1 -1
  7. package/dist/esm/theme.js +1 -1
  8. package/dist/esm/theme.js.map +1 -1
  9. package/dist/index.d.ts +51 -19
  10. package/dist/theme.d.ts +51 -19
  11. package/dist/types/components/ContactInfoPopup/components/BusinessSection/BusinessSection.d.ts +1 -1
  12. package/dist/types/components/ContactInfoPopup/components/ContactMethod/ContactMethod.d.ts +0 -1
  13. package/dist/types/components/ContactInfoPopup/components/LabelsSection/LabelsSection.d.ts +1 -1
  14. package/dist/types/components/ContactInfoPopup/components/MembersSection/MembersSection.d.ts +1 -1
  15. package/dist/types/components/ContactSidebar/components/CombineContactsModal/CombineContactsModal.d.ts +1 -1
  16. package/dist/types/components/ContactSidebar/components/MediaViewer/MediaViewer.d.ts +1 -1
  17. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactButton/ContactButton.d.ts +0 -1
  18. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactButton/components/ExternalLink/ExternalLink.d.ts +0 -1
  19. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactConversation/ContactConversation.d.ts +0 -1
  20. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactConversation/styles.d.ts +1 -2
  21. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactData/ContactData.d.ts +0 -1
  22. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactData/components/Properties/Properties.d.ts +1 -1
  23. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactData/styles.d.ts +1 -2
  24. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactDataDetails/ContactDataDetails.d.ts +0 -1
  25. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactEvent/ContactEvent.d.ts +0 -1
  26. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactEvent/components/AddEvent/styles.d.ts +1 -2
  27. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactEvent/components/DatePicker/styles.d.ts +3 -4
  28. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactEvent/components/LocationTextField/SendLocation/components/GoogleMap/components/LocationSearch/locationSearch.d.ts +0 -1
  29. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactEvent/layout/BasicInputContainer/styles.d.ts +2 -3
  30. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactFiles/ContactFiles.d.ts +0 -1
  31. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactHistory/ContactHistory.d.ts +0 -1
  32. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactNotes/ContactNotes.d.ts +0 -1
  33. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactNotes/components/AddNote/AddNote.d.ts +1 -1
  34. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactNotes/context/NotesCardContext.d.ts +0 -1
  35. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactPanelShop/ContactPanelShop.d.ts +0 -1
  36. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactRelations/ContactRelations.d.ts +0 -1
  37. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactTask/ContactTask.d.ts +0 -1
  38. package/dist/types/components/ContactSidebar/components/PanelView/components/ContactTask/components/AddTask/styles.d.ts +1 -2
  39. package/dist/types/components/ContactSidebar/components/PanelView/components/GroupData/GroupData.d.ts +0 -1
  40. package/dist/types/components/ContactSidebar/components/PanelView/components/GroupData/components/GroupDataContent/components/InformationBox/InformationBox.d.ts +0 -1
  41. package/dist/types/components/ContactSidebar/context/ActivitiesCardContext.d.ts +0 -1
  42. package/dist/types/components/ContactSidebar/context/SidebarPropsContext.d.ts +1 -2
  43. package/dist/types/components/ContactSidebar/hooks/useActivityDate.d.ts +2 -2
  44. package/dist/types/components/ContactSidebar/hooks/useCreateActivity.d.ts +8 -9
  45. package/dist/types/components/ContactSidebar/hooks/useLinkContacts.d.ts +2 -2
  46. package/dist/types/components/ContactSidebar/hooks/useMultipleSelect.d.ts +0 -1
  47. package/dist/types/components/ContactSidebar/hooks/useNotifications.d.ts +1 -1
  48. package/dist/types/components/ContactSidebar/hooks/useShareWithUsers.d.ts +2 -2
  49. package/dist/types/components/ContactSidebar/hooks/useSidebarAudioControl.d.ts +0 -1
  50. package/dist/types/components/ContactSidebar/utils/googleMapsUtils.d.ts +1 -1
  51. package/dist/types/components/ContactSidebar/utils/markdown/Markdown.d.ts +1 -1
  52. package/dist/types/components/EditContactModal/components/SearchLocation/googleMapsUtils.d.ts +1 -1
  53. package/dist/types/components/EditContactModal/components/Section/ContactInformation/components/EditModal/EditModal.d.ts +0 -1
  54. package/dist/types/components/EditContactModal/components/Section/ContactInformation/components/EditModal/layout/WarningsDisplay/components/Warning/hooks/useContactInfoPopup.d.ts +2 -2
  55. package/dist/types/components/EditContactModal/components/Section/ContactInformation/components/EditModal/shared/StatusAdornment/components/Adornment/Adornment.d.ts +1 -1
  56. package/dist/types/components/EditContactModal/components/Section/General/components/BusinessGeneral.d.ts +1 -1
  57. package/dist/types/components/EditContactModal/components/Section/General/components/ContactGeneral.d.ts +1 -1
  58. package/dist/types/components/EditContactModal/components/Section/utils/resolveUserLabel.d.ts +1 -1
  59. package/dist/types/components/EditContactModal/context/EditContactApiContext.d.ts +8 -9
  60. package/dist/types/components/EditContactModal/context/EditContactViewContext.d.ts +1 -2
  61. package/dist/types/components/EditContactModal/hooks/useEditContactModalController.d.ts +1 -1
  62. package/dist/types/components/EditContactModal/hooks/utils/editContactHelper.d.ts +1 -1
  63. package/dist/types/components/EventsDialog/components/ConfirmDeleteDialog/ConfirmDeleteDialog.d.ts +0 -1
  64. package/dist/types/components/EventsDialog/components/DatePicker/styles.d.ts +4 -3
  65. package/dist/types/components/EventsDialog/components/DeleteRecurringEventDialog/DeleteRecurringEventDialog.d.ts +0 -1
  66. package/dist/types/components/EventsDialog/components/EditRecurringEventDialog/EditRecurringEventDialog.d.ts +0 -1
  67. package/dist/types/components/EventsDialog/components/LocationTextField/SendLocation/components/GoogleMap/components/LocationSearch/locationSearch.d.ts +0 -1
  68. package/dist/types/components/EventsDialog/components/ReminderNotifications/components/ReminderItem/style.d.ts +7 -10
  69. package/dist/types/components/EventsDialog/components/ReminderNotifications/styles.d.ts +3 -2
  70. package/dist/types/components/EventsDialog/context/CalendarContextProvider.d.ts +0 -1
  71. package/dist/types/components/EventsDialog/context/EventsDialogApiContext.d.ts +3 -4
  72. package/dist/types/components/EventsDialog/hooks/useCalendarEvents.d.ts +0 -1
  73. package/dist/types/components/EventsDialog/hooks/useCalendarTasks.d.ts +0 -1
  74. package/dist/types/components/EventsDialog/hooks/useNotifications.d.ts +1 -1
  75. package/dist/types/components/EventsDialog/layout/BasicInputContainer/styles.d.ts +3 -2
  76. package/dist/types/components/EventsDialog/utils/googleMapsLoader.d.ts +1 -1
  77. package/dist/types/theme/index.d.ts +2 -0
  78. package/dist/types/theme/themeActionTypes.d.ts +5 -0
  79. package/dist/types/theme/themePersistence.d.ts +15 -0
  80. package/dist/types/theme/themePreference.d.ts +14 -0
  81. package/dist/types/theme/themePreference.test.d.ts +1 -0
  82. package/dist/types/theme/themeProvider.d.ts +17 -0
  83. package/dist/types/theme/themeSlice.d.ts +7 -18
  84. package/package.json +1 -1
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const EditContactApiProvider: import("react").Provider<{
3
2
  fetchLabels: ({ signal }?: {
4
3
  signal?: AbortSignal;
@@ -31,12 +30,12 @@ export declare const EditContactApiProvider: import("react").Provider<{
31
30
  fetchContactFields: ({ forType, signal }: {
32
31
  signal?: AbortSignal;
33
32
  } & {
34
- forType: "business" | "contact";
33
+ forType: "contact" | "business";
35
34
  }) => Promise<import("@trii/types/dist/Contacts").IContactField[]>;
36
35
  updateEntity: ({ entityType, entityId, body, signal }: {
37
36
  signal?: AbortSignal;
38
37
  } & {
39
- entityType: "business" | "contact";
38
+ entityType: "contact" | "business";
40
39
  entityId: string;
41
40
  body: Partial<import("@trii/types/dist/Contacts").IContact> | Partial<import("@trii/types/dist/Contacts").IBusiness> | {
42
41
  tags: import("@trii/types/dist/Contacts").IContactTag[];
@@ -70,7 +69,7 @@ export declare const EditContactApiProvider: import("react").Provider<{
70
69
  }) => Promise<{
71
70
  success: boolean;
72
71
  warnings: string[];
73
- contactId?: string;
72
+ contactId?: string | null;
74
73
  }>;
75
74
  setContactAddress: ({ data, signal }: {
76
75
  signal?: AbortSignal;
@@ -99,7 +98,7 @@ export declare const EditContactApiProvider: import("react").Provider<{
99
98
  contactId: string;
100
99
  file: File;
101
100
  }) => Promise<string>;
102
- }>;
101
+ } | null>;
103
102
  export declare const useEditContactApi: () => {
104
103
  fetchLabels: ({ signal }?: {
105
104
  signal?: AbortSignal;
@@ -132,12 +131,12 @@ export declare const useEditContactApi: () => {
132
131
  fetchContactFields: ({ forType, signal }: {
133
132
  signal?: AbortSignal;
134
133
  } & {
135
- forType: "business" | "contact";
134
+ forType: "contact" | "business";
136
135
  }) => Promise<import("@trii/types/dist/Contacts").IContactField[]>;
137
136
  updateEntity: ({ entityType, entityId, body, signal }: {
138
137
  signal?: AbortSignal;
139
138
  } & {
140
- entityType: "business" | "contact";
139
+ entityType: "contact" | "business";
141
140
  entityId: string;
142
141
  body: Partial<import("@trii/types/dist/Contacts").IContact> | Partial<import("@trii/types/dist/Contacts").IBusiness> | {
143
142
  tags: import("@trii/types/dist/Contacts").IContactTag[];
@@ -171,7 +170,7 @@ export declare const useEditContactApi: () => {
171
170
  }) => Promise<{
172
171
  success: boolean;
173
172
  warnings: string[];
174
- contactId?: string;
173
+ contactId?: string | null;
175
174
  }>;
176
175
  setContactAddress: ({ data, signal }: {
177
176
  signal?: AbortSignal;
@@ -200,4 +199,4 @@ export declare const useEditContactApi: () => {
200
199
  contactId: string;
201
200
  file: File;
202
201
  }) => Promise<string>;
203
- };
202
+ } | null;
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  export type EditContactView = 'main' | 'tags' | 'searchLocation' | 'businessSelect' | 'businessMembers';
3
2
  export type EditContactViewContextValue = {
4
3
  view: EditContactView;
5
4
  setView: (view: EditContactView) => void;
6
5
  };
7
- export declare const EditContactViewProvider: import("react").Provider<EditContactViewContextValue>;
6
+ export declare const EditContactViewProvider: import("react").Provider<EditContactViewContextValue | null>;
8
7
  export declare const useEditContactView: () => EditContactViewContextValue;
@@ -38,7 +38,7 @@ export declare function useEditContactModalController({ open, baseUrl, spaceId,
38
38
  tags: IContactTag[];
39
39
  labels: ILabel[];
40
40
  contactFields: IContactField[];
41
- userTrii: UserTrii;
41
+ userTrii: UserTrii | null;
42
42
  userLoading: boolean;
43
43
  userError: unknown;
44
44
  };
@@ -1,6 +1,6 @@
1
1
  import { IContactAddress } from '@trii/types/dist/Contacts';
2
2
  declare const _default: {
3
- getEditedField: (key: string, originalValue: string | number, editedValue: string | number) => Record<string, string | number>;
3
+ getEditedField: (key: string, originalValue: string | number | null, editedValue: string | number) => Record<string, string | number> | null;
4
4
  getAddressesWithUpdatedValues: (newValue: string, newValueAddressId: string, addresses: IContactAddress[]) => IContactAddress[];
5
5
  };
6
6
  export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface ConfirmDeleteDialogProps {
3
2
  open: boolean;
4
3
  onClose: () => void;
@@ -1,3 +1,4 @@
1
- export declare const StyledDatePickerContainer: import("@mui/types").OverridableComponent<import("@mui/system").BoxTypeMap<{}, "div", import("@mui/material").Theme>>;
2
- export declare const StyledPickersContainer: import("@mui/types").OverridableComponent<import("@mui/system").BoxTypeMap<{}, "div", import("@mui/material").Theme>>;
3
- export declare const StyledPickersDivider: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").TypographyTypeMap<{}, "span">>;
1
+ import { Box, Typography } from '@mui/material';
2
+ export declare const StyledDatePickerContainer: typeof Box;
3
+ export declare const StyledPickersContainer: typeof Box;
4
+ export declare const StyledPickersDivider: typeof Typography;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface DeleteRecurringEventDialogProps {
3
2
  open: boolean;
4
3
  onClose: () => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface EditRecurringEventDialogProps {
3
2
  open: boolean;
4
3
  onClose: () => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="@types/google.maps" />
2
1
  interface Props {
3
2
  onPlaceSelected: (location: google.maps.LatLngLiteral, address?: string) => void;
4
3
  }
@@ -1,11 +1,8 @@
1
- /// <reference types="react" />
2
- import { TextField } from '@mui/material';
3
- export declare const StyledReminderItemContainer: import("@mui/types").OverridableComponent<import("@mui/system").BoxTypeMap<{}, "div", import("@mui/material").Theme>>;
4
- export declare const StyledReminderItemViewContainer: import("@mui/types").OverridableComponent<import("@mui/system").BoxTypeMap<{}, "div", import("@mui/material").Theme>>;
5
- export declare const StyledReminderInputsContainer: import("@mui/types").OverridableComponent<import("@mui/system").BoxTypeMap<{}, "div", import("@mui/material").Theme>>;
1
+ import { Box, Select, TextField, IconButton } from '@mui/material';
2
+ export declare const StyledReminderItemContainer: typeof Box;
3
+ export declare const StyledReminderItemViewContainer: typeof Box;
4
+ export declare const StyledReminderInputsContainer: typeof Box;
6
5
  export declare const StyledReminderTextField: typeof TextField;
7
- export declare const StyledReminderSelect: (<Value = unknown>(props: import("@mui/material").SelectProps<Value>) => import("react").JSX.Element) & {
8
- muiName: string;
9
- };
10
- export declare const StyledReminderActionsContainer: import("@mui/types").OverridableComponent<import("@mui/system").BoxTypeMap<{}, "div", import("@mui/material").Theme>>;
11
- export declare const StyledReminderDeleteIconButton: import("@mui/material").ExtendButtonBase<import("@mui/material").IconButtonTypeMap<{}, "button">>;
6
+ export declare const StyledReminderSelect: typeof Select;
7
+ export declare const StyledReminderActionsContainer: typeof Box;
8
+ export declare const StyledReminderDeleteIconButton: typeof IconButton;
@@ -1,2 +1,3 @@
1
- export declare const ReminderNotificationsContainer: import("@mui/types").OverridableComponent<import("@mui/system").BoxTypeMap<{}, "div", import("@mui/material").Theme>>;
2
- export declare const HeaderContainer: import("@mui/types").OverridableComponent<import("@mui/system").BoxTypeMap<{}, "div", import("@mui/material").Theme>>;
1
+ import { Box } from '@mui/material';
2
+ export declare const ReminderNotificationsContainer: typeof Box;
3
+ export declare const HeaderContainer: typeof Box;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Mode } from './types/Mode';
3
2
  interface Props {
4
3
  children: React.ReactNode;
@@ -1,9 +1,8 @@
1
- /// <reference types="react" />
2
1
  export interface EventsDialogApi {
3
2
  baseUrl: string;
4
3
  spaceId: string;
5
4
  }
6
- declare const EventsDialogApiContext: import("react").Context<EventsDialogApi>;
7
- export declare const EventsDialogApiProvider: import("react").Provider<EventsDialogApi>;
8
- export declare const useEventsDialogApi: () => EventsDialogApi;
5
+ declare const EventsDialogApiContext: import("react").Context<EventsDialogApi | null>;
6
+ export declare const EventsDialogApiProvider: import("react").Provider<EventsDialogApi | null>;
7
+ export declare const useEventsDialogApi: () => EventsDialogApi | null;
9
8
  export default EventsDialogApiContext;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IEvent } from '@trii/types/dist/Calendar';
3
2
  export interface CalendarEvent {
4
3
  id: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface CalendarTask {
3
2
  id: string;
4
3
  title: string;
@@ -3,7 +3,7 @@ import { IEventNotification } from '@trii/types/dist/Calendar';
3
3
  import { SelectChangeEvent } from '@mui/material';
4
4
  import { EventNotificationFront } from '../types';
5
5
  export declare const useNotificationsInitialDef: {
6
- notifications: any[];
6
+ notifications: never[];
7
7
  action: {
8
8
  addNotification: () => void;
9
9
  deleteNotification: (_notificationId: string) => void;
@@ -1,2 +1,3 @@
1
- export declare const StyledBoxContainer: import("@mui/types").OverridableComponent<import("@mui/system").BoxTypeMap<{}, "div", import("@mui/material").Theme>>;
2
- export declare const StyledDialogContextText: import("@mui/types").OverridableComponent<import("@mui/system").BoxTypeMap<{}, "div", import("@mui/material").Theme>>;
1
+ import { Box } from '@mui/material';
2
+ export declare const StyledBoxContainer: typeof Box;
3
+ export declare const StyledDialogContextText: typeof Box;
@@ -19,7 +19,7 @@ export declare const GOOGLE_MAPS_SCRIPT_CONFIG: {
19
19
  */
20
20
  export declare const useGoogleMapsLoader: () => {
21
21
  isLoaded: boolean;
22
- error: Error;
22
+ error: Error | null;
23
23
  };
24
24
  /**
25
25
  * Carga la API de Google Maps de manera asincrónica
@@ -3,3 +3,5 @@ export type { MuiComponentsConfigOptions } from './MuiComponentsConfig';
3
3
  export { default as themeReducer } from './themeSlice';
4
4
  export * from './themeProvider';
5
5
  export * from './themeSlice';
6
+ export { THEME_PREFERENCES, normalizeThemePreference, resolveThemePreference, observeThemePreference } from './themePreference';
7
+ export type { ThemePreference, ResolvedTheme, LegacyThemeName } from './themePreference';
@@ -0,0 +1,5 @@
1
+ import type { ThemeName } from './themePreference';
2
+ export declare const UPDATE_THEME_TYPE = "Theme/updateTheme";
3
+ export declare const themeUpdateFulfilled: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
4
+ theme: ThemeName;
5
+ }, string>;
@@ -0,0 +1,15 @@
1
+ import type { ThemeRootState } from './themeSlice';
2
+ import { ThemeName } from './themePreference';
3
+ /** Guarda el tema elegido en el backend. */
4
+ export declare const updateTheme: import("@reduxjs/toolkit").AsyncThunk<{
5
+ theme: ThemeName;
6
+ }, ThemeName, {
7
+ state: ThemeRootState;
8
+ dispatch?: import("redux-thunk").ThunkDispatch<unknown, unknown, import("redux").UnknownAction> | undefined;
9
+ extra?: unknown;
10
+ rejectValue?: unknown;
11
+ serializedErrorType?: unknown;
12
+ pendingMeta?: unknown;
13
+ fulfilledMeta?: unknown;
14
+ rejectedMeta?: unknown;
15
+ }>;
@@ -0,0 +1,14 @@
1
+ export type ThemePreference = 'light' | 'dark' | 'system';
2
+ export type ResolvedTheme = 'light' | 'dark';
3
+ export declare const THEME_PREFERENCES: readonly ThemePreference[];
4
+ export declare const LEGACY_THEME_NAMES: readonly ["lightBlueIndigo", "lightBlue", "lightRed", "lightGreen", "lightPink", "lightPurple", "lightTeal", "lightLime", "lightYellow", "lightAmber", "lightOrange", "lightBrown", "lightGray", "darkBlue", "darkBlack"];
5
+ export type LegacyThemeName = typeof LEGACY_THEME_NAMES[number];
6
+ export type ThemeName = ThemePreference | LegacyThemeName;
7
+ export declare const isValidThemeName: (name: string) => name is ThemeName;
8
+ /** Missing/unknown preferences follow the OS. Existing choices keep their mode. */
9
+ export declare const normalizeThemePreference: (name?: string | null) => ThemePreference;
10
+ export declare const resolveThemePreference: (preference: ThemePreference, systemDark?: boolean) => ResolvedTheme;
11
+ /** Emits immediately; caller must unsubscribe on unmount/preference change.
12
+ * Does not persist or call an API when the OS appearance changes.
13
+ */
14
+ export declare const observeThemePreference: (preference: ThemePreference, listener: (mode: ResolvedTheme) => void) => (() => void);
@@ -0,0 +1 @@
1
+ export {};
@@ -57,18 +57,35 @@ declare module '@mui/material/styles' {
57
57
  name?: string;
58
58
  }
59
59
  }
60
+ export declare const lightTheme: Theme;
61
+ export declare const darkTheme: Theme;
62
+ /** @deprecated Use lightTheme. */
60
63
  export declare const lightBlueIndigo: Theme;
64
+ /** @deprecated Use lightTheme. */
61
65
  export declare const lightBlue: Theme;
66
+ /** @deprecated Use lightTheme. */
62
67
  export declare const lightRed: Theme;
68
+ /** @deprecated Use lightTheme. */
63
69
  export declare const lightGreen: Theme;
70
+ /** @deprecated Use lightTheme. */
64
71
  export declare const lightPink: Theme;
72
+ /** @deprecated Use lightTheme. */
65
73
  export declare const lightPurple: Theme;
74
+ /** @deprecated Use lightTheme. */
66
75
  export declare const lightTeal: Theme;
76
+ /** @deprecated Use lightTheme. */
67
77
  export declare const lightLime: Theme;
78
+ /** @deprecated Use lightTheme. */
68
79
  export declare const lightYellow: Theme;
80
+ /** @deprecated Use lightTheme. */
69
81
  export declare const lightAmber: Theme;
82
+ /** @deprecated Use lightTheme. */
70
83
  export declare const lightOrange: Theme;
84
+ /** @deprecated Use lightTheme. */
71
85
  export declare const lightBrown: Theme;
86
+ /** @deprecated Use lightTheme. */
72
87
  export declare const lightGray: Theme;
88
+ /** @deprecated Use darkTheme. */
73
89
  export declare const darkBlue: Theme;
90
+ /** @deprecated Use darkTheme. */
74
91
  export declare const darkBlack: Theme;
@@ -1,4 +1,8 @@
1
+ export { updateTheme } from './themePersistence';
1
2
  import { Theme } from '@mui/material';
3
+ import { ThemeName, ThemePreference, ResolvedTheme } from './themePreference';
4
+ export { isValidThemeName } from './themePreference';
5
+ export type { ThemeName } from './themePreference';
2
6
  /**
3
7
  * Forma mínima del store que necesita este slice: la app que lo use tiene que
4
8
  * tener `Theme` y `User.user.uid`.
@@ -13,30 +17,15 @@ export interface ThemeRootState {
13
17
  };
14
18
  Theme: ThemeState;
15
19
  }
16
- /** Nombres de tema disponibles. */
17
- export type ThemeName = 'lightBlueIndigo' | 'darkBlack' | 'darkBlue' | 'lightAmber' | 'lightBlue' | 'lightBrown' | 'lightGray' | 'lightGreen' | 'lightLime' | 'lightOrange' | 'lightPink' | 'lightPurple' | 'lightRed' | 'lightTeal' | 'lightYellow';
18
20
  /** Estado del slice. */
19
21
  export interface ThemeState {
20
22
  themeSelected: Theme;
23
+ preference: ThemePreference;
21
24
  darkMode: boolean;
22
25
  toggleStatus: 'idle' | 'toggled';
23
26
  }
24
- /** Guarda el tema elegido en el backend. */
25
- export declare const updateTheme: import("@reduxjs/toolkit").AsyncThunk<{
26
- theme: ThemeName;
27
- }, ThemeName, {
28
- state: ThemeRootState;
29
- dispatch?: import("redux-thunk").ThunkDispatch<unknown, unknown, import("redux").UnknownAction>;
30
- extra?: unknown;
31
- rejectValue?: unknown;
32
- serializedErrorType?: unknown;
33
- pendingMeta?: unknown;
34
- fulfilledMeta?: unknown;
35
- rejectedMeta?: unknown;
36
- }>;
37
- /** Valida que el string sea un `ThemeName`. */
38
- export declare const isValidThemeName: (theme: string) => theme is ThemeName;
39
- export declare const toggleTheme: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<ThemeName, "Theme/toggleTheme">, toggleModeTheme: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"Theme/toggleModeTheme">;
27
+ export declare const selectThemePreference: (state: ThemeRootState) => ThemePreference;
28
+ export declare const toggleTheme: import("@reduxjs/toolkit").ActionCreatorWithPayload<ThemeName, "Theme/toggleTheme">, toggleModeTheme: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"Theme/toggleModeTheme">, systemThemeChanged: import("@reduxjs/toolkit").ActionCreatorWithPayload<ResolvedTheme, "Theme/systemThemeChanged">;
40
29
  export declare const selectThemeToggleStatus: (state: ThemeRootState) => "idle" | "toggled";
41
30
  export declare const selectTheme: (state: ThemeRootState) => Theme;
42
31
  export declare const selectDarkTheme: (state: ThemeRootState) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trii/components",
3
- "version": "3.1.4",
3
+ "version": "3.1.6",
4
4
  "description": "Trii components package",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",