labsense-ui-kit 1.1.22 → 1.1.23

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.
package/dist/index.d.ts CHANGED
@@ -34,3 +34,4 @@ export { TableCell, Table, TableRow, TableProps };
34
34
  export { InternalTabs, Tabs, TabContentProps };
35
35
  export { colorVariables, darkColorVariables, themes };
36
36
  export { convertToEpoch, formatDate, formatTimestamp, formatCalendarDateTime, timeAgo, formatEpochToIST, convertEpochToDateString, convertEpochToOnlyDate, getSystemTimezoneAbbreviation, timeStringToSeconds };
37
+ export { injectCSSVariables } from './Themes/injectColors';
package/dist/index.js CHANGED
@@ -6465,6 +6465,36 @@ var InternalTabs = function InternalTabs(_ref) {
6465
6465
  }));
6466
6466
  };
6467
6467
 
6468
+ var injectCSSVariables = function injectCSSVariables(theme) {
6469
+ var themeVars = theme === 'dark' ? darkColorVariables : colorVariables;
6470
+ var flatVars = _flattenVariables(themeVars);
6471
+ var root = document.body;
6472
+ for (var _i = 0, _Object$entries = Object.entries(flatVars); _i < _Object$entries.length; _i++) {
6473
+ var _Object$entries$_i = _Object$entries[_i],
6474
+ key = _Object$entries$_i[0],
6475
+ value = _Object$entries$_i[1];
6476
+ root.style.setProperty("--" + key, value);
6477
+ }
6478
+ };
6479
+ var _flattenVariables = function flattenVariables(obj, prefix) {
6480
+ if (prefix === void 0) {
6481
+ prefix = '';
6482
+ }
6483
+ var result = {};
6484
+ for (var key in obj) {
6485
+ if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
6486
+ var value = obj[key];
6487
+ var fullKey = prefix ? prefix + "-" + key : key;
6488
+ if (typeof value === 'object') {
6489
+ var nested = _flattenVariables(value, fullKey);
6490
+ Object.assign(result, nested);
6491
+ } else {
6492
+ result[fullKey] = value;
6493
+ }
6494
+ }
6495
+ return result;
6496
+ };
6497
+
6468
6498
  exports.Badge = Badge;
6469
6499
  exports.Breadcrumbs = Breadcrumbs;
6470
6500
  exports.Button = ButtonComponent;
@@ -6504,6 +6534,7 @@ exports.formatDate = formatDate;
6504
6534
  exports.formatEpochToIST = formatEpochToIST;
6505
6535
  exports.formatTimestamp = formatTimestamp;
6506
6536
  exports.getSystemTimezoneAbbreviation = getSystemTimezoneAbbreviation;
6537
+ exports.injectCSSVariables = injectCSSVariables;
6507
6538
  exports.themes = themes;
6508
6539
  exports.timeAgo = timeAgo;
6509
6540
  exports.timeStringToSeconds = timeStringToSeconds;