labsense-ui-kit 1.1.77 → 1.1.79

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
  });
@@ -6775,42 +6777,51 @@ var SidebarContainer = styled__default.div(_templateObject$m || (_templateObject
6775
6777
  var $isExpanded = _ref.$isExpanded;
6776
6778
  return $isExpanded ? '225px' : '68px';
6777
6779
  }, function (_ref2) {
6778
- var $background = _ref2.$background;
6779
- return $background || colorVariables.accent.softBlue;
6780
+ var $background = _ref2.$background,
6781
+ theme = _ref2.theme;
6782
+ return $background || theme.accent.softBlue;
6780
6783
  });
6781
- var SidebarLink = styled__default(reactRouterDom.NavLink)(_templateObject2$i || (_templateObject2$i = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n height: 28px;\n width: 100%;\n gap: 10px;\n cursor: pointer;\n border-radius: 4px;\n color: ", ";\n text-decoration: none;\n transition: background 0.3s;\n\n &:hover {\n background: ", ";\n }\n"])), colorVariables.text.medium, colorVariables["default"].primary);
6782
- var IconWrapper$2 = styled__default.div(_templateObject3$c || (_templateObject3$c = _taggedTemplateLiteralLoose(["\n background: ", ";\n padding: 4px;\n border-radius: 4px;\n width: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), function (_ref3) {
6783
- var $selected = _ref3.$selected;
6784
- return $selected ? colorVariables["default"].primary : colorVariables["default"].tertiary;
6784
+ var SidebarLink = styled__default(reactRouterDom.NavLink)(_templateObject2$i || (_templateObject2$i = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n height: 28px;\n width: 100%;\n gap: 10px;\n cursor: pointer;\n border-radius: 4px;\n color: ", ";\n text-decoration: none;\n transition: background 0.3s;\n\n &:hover {\n background: ", ";\n }\n"])), function (_ref3) {
6785
+ var theme = _ref3.theme;
6786
+ return theme.text.medium;
6787
+ }, function (_ref4) {
6788
+ var theme = _ref4.theme;
6789
+ return theme["default"].primary;
6790
+ });
6791
+ var IconWrapper$2 = styled__default.div(_templateObject3$c || (_templateObject3$c = _taggedTemplateLiteralLoose(["\n background: ", ";\n padding: 4px;\n border-radius: 4px;\n width: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), function (_ref5) {
6792
+ var $selected = _ref5.$selected,
6793
+ theme = _ref5.theme;
6794
+ return $selected ? theme["default"].primary : theme["default"].tertiary;
6785
6795
  });
6786
6796
  var Logo = styled__default.div(_templateObject4$9 || (_templateObject4$9 = _taggedTemplateLiteralLoose(["\n display: flex;\n width: 100%;\n min-width: max-content;\n height: 32px;\n align-items: center;\n justify-content: start;\n gap: 10px;\n"])));
6787
- var TextContainer = styled__default.span(_templateObject5$8 || (_templateObject5$8 = _taggedTemplateLiteralLoose(["\n white-space: nowrap;\n padding: ", ";\n font-size: ", ";\n font-weight: ", ";\n color: ", ";\n opacity: ", ";\n visibility: ", ";\n transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;\n"])), function (_ref4) {
6788
- var $padding = _ref4.$padding;
6797
+ var TextContainer = styled__default.span(_templateObject5$8 || (_templateObject5$8 = _taggedTemplateLiteralLoose(["\n white-space: nowrap;\n padding: ", ";\n font-size: ", ";\n font-weight: ", ";\n color: ", ";\n opacity: ", ";\n visibility: ", ";\n transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;\n"])), function (_ref6) {
6798
+ var $padding = _ref6.$padding;
6789
6799
  return $padding;
6790
- }, function (_ref5) {
6791
- var $fontSize = _ref5.$fontSize;
6792
- return $fontSize || '20px';
6793
- }, function (_ref6) {
6794
- var $fontWeight = _ref6.$fontWeight;
6795
- return $fontWeight || '500';
6796
6800
  }, function (_ref7) {
6797
- var $color = _ref7.$color;
6798
- return $color || colorVariables["default"].primary;
6801
+ var $fontSize = _ref7.$fontSize;
6802
+ return $fontSize || '20px';
6799
6803
  }, function (_ref8) {
6800
- var $isExpanded = _ref8.$isExpanded;
6801
- return $isExpanded ? 1 : 0;
6804
+ var $fontWeight = _ref8.$fontWeight;
6805
+ return $fontWeight || '500';
6802
6806
  }, function (_ref9) {
6803
- var $isExpanded = _ref9.$isExpanded;
6807
+ var $color = _ref9.$color,
6808
+ theme = _ref9.theme;
6809
+ return $color || theme["default"].primary;
6810
+ }, function (_ref10) {
6811
+ var $isExpanded = _ref10.$isExpanded;
6812
+ return $isExpanded ? 1 : 0;
6813
+ }, function (_ref11) {
6814
+ var $isExpanded = _ref11.$isExpanded;
6804
6815
  return $isExpanded ? 'visible' : 'hidden';
6805
6816
  });
6806
- var Sidebar = function Sidebar(_ref10) {
6807
- var logo = _ref10.logo,
6808
- content = _ref10.content,
6809
- background = _ref10.background,
6810
- ProfileContent = _ref10.ProfileContent,
6811
- _ref10$isExpanded = _ref10.isExpanded,
6812
- isExpanded = _ref10$isExpanded === void 0 ? false : _ref10$isExpanded,
6813
- setIsExpanded = _ref10.setIsExpanded;
6817
+ var Sidebar = function Sidebar(_ref12) {
6818
+ var logo = _ref12.logo,
6819
+ content = _ref12.content,
6820
+ background = _ref12.background,
6821
+ ProfileContent = _ref12.ProfileContent,
6822
+ _ref12$isExpanded = _ref12.isExpanded,
6823
+ isExpanded = _ref12$isExpanded === void 0 ? false : _ref12$isExpanded,
6824
+ setIsExpanded = _ref12.setIsExpanded;
6814
6825
  var location = reactRouterDom.useLocation();
6815
6826
  var _useState = React.useState({}),
6816
6827
  openMenus = _useState[0],