labsense-ui-kit 1.1.77 → 1.1.78

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.
@@ -1,6 +1,7 @@
1
1
  import { ThemeColorsInterface } from '.';
2
2
  export declare const light: ThemeColorsInterface;
3
3
  export declare const dark: ThemeColorsInterface;
4
+ export declare const getCurrentTheme: () => "dark" | "light";
4
5
  export declare const colorVariables: ThemeColorsInterface;
5
6
  export declare const themes: {
6
7
  light: ThemeColorsInterface;
@@ -87,3 +87,5 @@ export interface ThemeColorsInterface {
87
87
  text: TextColors;
88
88
  badge: BadgeColors;
89
89
  }
90
+ export declare type ThemeMode = 'light' | 'dark' | 'device';
91
+ export declare type EffectiveTheme = 'light' | 'dark';
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ import { ProgressBar, ProgressBarProps, CircularProgress, CircularProgressProps
14
14
  import { Sidebar, logoDetails, SidebarItems } from './Sidebar';
15
15
  import { Table, TableCell, TableRow, TableProps } from './Table';
16
16
  import { InternalTabs, Tabs, TabContentProps } from './Tabs';
17
- import { ThemeColorsInterface } from './Themes';
17
+ import { ThemeColorsInterface, ThemeMode } from './Themes';
18
18
  import { colorVariables, themes } from './Themes/Colors';
19
19
  import { convertToEpoch, formatDate, formatTimestamp, formatCalendarDateTime, timeAgo, formatEpochToIST, convertEpochToDateString, convertEpochToOnlyDate, getSystemTimezoneAbbreviation, timeStringToSeconds } from './Utils/Date&Time';
20
20
  export { Badge, IconTooltip };
@@ -33,5 +33,5 @@ export { ProgressBar, ProgressBarProps, CircularProgress, CircularProgressProps
33
33
  export { Sidebar, logoDetails, SidebarItems };
34
34
  export { TableCell, Table, TableRow, TableProps };
35
35
  export { InternalTabs, Tabs, TabContentProps };
36
- export { ThemeColorsInterface, colorVariables, themes };
36
+ export { ThemeColorsInterface, ThemeMode, colorVariables, themes };
37
37
  export { convertToEpoch, formatDate, formatTimestamp, formatCalendarDateTime, timeAgo, formatEpochToIST, convertEpochToDateString, convertEpochToOnlyDate, getSystemTimezoneAbbreviation, timeStringToSeconds };
package/dist/index.js CHANGED
@@ -163,13 +163,15 @@ var dark = {
163
163
  };
164
164
  var getCurrentTheme = function getCurrentTheme() {
165
165
  if (typeof document !== 'undefined') {
166
- return document.documentElement.classList.contains('dark') ? dark : light;
166
+ var isDarkClass = document.documentElement.classList.contains('dark');
167
+ return isDarkClass ? 'dark' : 'light';
167
168
  }
168
- return light;
169
+ return 'light';
169
170
  };
170
171
  var colorVariables = new Proxy({}, {
171
172
  get: function get(_, prop) {
172
- var currentTheme = getCurrentTheme();
173
+ var currentThemeName = getCurrentTheme();
174
+ var currentTheme = themes[currentThemeName];
173
175
  return currentTheme[prop];
174
176
  }
175
177
  });