labsense-ui-kit 1.1.22 → 1.1.24

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
@@ -14,7 +14,7 @@ import { ProgressBar } from './ProgressBar';
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 { colorVariables, darkColorVariables, themes } from './Themes/Colors';
17
+ import { darkColorVariables, themes } from './Themes/Colors';
18
18
  import { convertToEpoch, formatDate, formatTimestamp, formatCalendarDateTime, timeAgo, formatEpochToIST, convertEpochToDateString, convertEpochToOnlyDate, getSystemTimezoneAbbreviation, timeStringToSeconds } from './Utils/Date&Time';
19
19
  export { Badge };
20
20
  export { Breadcrumbs, BreadcrumbDetail };
@@ -32,5 +32,7 @@ export { ProgressBar };
32
32
  export { Sidebar, logoDetails, SidebarItems };
33
33
  export { TableCell, Table, TableRow, TableProps };
34
34
  export { InternalTabs, Tabs, TabContentProps };
35
- export { colorVariables, darkColorVariables, themes };
35
+ export { darkColorVariables, themes };
36
36
  export { convertToEpoch, formatDate, formatTimestamp, formatCalendarDateTime, timeAgo, formatEpochToIST, convertEpochToDateString, convertEpochToOnlyDate, getSystemTimezoneAbbreviation, timeStringToSeconds };
37
+ export { injectCSSVariables } from './Themes/injectColors';
38
+ export { colorVariables } from './Themes/rawColor';
package/dist/index.js CHANGED
@@ -6465,6 +6465,104 @@ 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
+
6498
+ var colorVariables$1 = {
6499
+ brand: {
6500
+ primary: 'var(--brand-primary)',
6501
+ secondary: 'var(--brand-secondary)',
6502
+ light: 'var(--brand-light)'
6503
+ },
6504
+ accent: {
6505
+ light: 'var(--accent-light)',
6506
+ extraLight: 'var(--accent-extraLight)',
6507
+ softBlue: 'var(--accent-softBlue)',
6508
+ extraSoftBlue: 'var(--accent-extraSoftBlue)',
6509
+ boldTransparent: 'var(--accent-boldTransparent)',
6510
+ transparent: 'var(--accent-transparent)',
6511
+ lightTransparent: 'var(--accent-lightTransparent)'
6512
+ },
6513
+ "default": {
6514
+ primary: 'var(--default-primary)',
6515
+ secondary: 'var(--default-secondary)',
6516
+ tertiary: 'var(--default-tertiary)',
6517
+ error: 'var(--default-error)',
6518
+ success: 'var(--default-success)',
6519
+ warning: 'var(--default-warning)',
6520
+ info: 'var(--default-info)'
6521
+ },
6522
+ disabled: {
6523
+ primary: 'var(--disabled-primary)',
6524
+ secondary: 'var(--disabled-secondary)',
6525
+ error: 'var(--disabled-error)',
6526
+ success: 'var(--disabled-success)',
6527
+ warning: 'var(--disabled-warning)',
6528
+ info: 'var(--disabled-info)'
6529
+ },
6530
+ hover: {
6531
+ primary: 'var(--hover-primary)',
6532
+ secondary: 'var(--hover-secondary)',
6533
+ tertiary: 'var(--hover-tertiary)',
6534
+ error: 'var(--hover-error)',
6535
+ success: 'var(--hover-success)',
6536
+ warning: 'var(--hover-warning)',
6537
+ info: 'var(--hover-info)'
6538
+ },
6539
+ border: {
6540
+ extraBold: 'var(--border-extraBold)',
6541
+ bold: 'var(--border-bold)',
6542
+ medium: 'var(--border-medium)',
6543
+ light: 'var(--border-light)',
6544
+ extraLight: 'var(--border-extraLight)'
6545
+ },
6546
+ text: {
6547
+ dark: 'var(--text-dark)',
6548
+ medium: 'var(--text-medium)',
6549
+ light: 'var(--text-light)',
6550
+ white: 'var(--text-white)',
6551
+ success: 'var(--text-success)',
6552
+ error: 'var(--text-error)',
6553
+ info: 'var(--text-info)',
6554
+ warning: 'var(--text-warning)'
6555
+ },
6556
+ badge: {
6557
+ lavender: 'var(--badge-lavender)',
6558
+ papayaWhip: 'var(--badge-papayaWhip)',
6559
+ water: 'var(--badge-water)',
6560
+ paleBlue: 'var(--badge-paleBlue)',
6561
+ teaGreen: 'var(--badge-teaGreen)',
6562
+ lightBlue: 'var(--badge-lightBlue)'
6563
+ }
6564
+ };
6565
+
6468
6566
  exports.Badge = Badge;
6469
6567
  exports.Breadcrumbs = Breadcrumbs;
6470
6568
  exports.Button = ButtonComponent;
@@ -6494,7 +6592,7 @@ exports.Tabs = Tabs;
6494
6592
  exports.TextArea = TextArea;
6495
6593
  exports.TextField = TextField;
6496
6594
  exports.TextFieldWithDropdown = TextFieldWithDropdown;
6497
- exports.colorVariables = colorVariables;
6595
+ exports.colorVariables = colorVariables$1;
6498
6596
  exports.convertEpochToDateString = convertEpochToDateString;
6499
6597
  exports.convertEpochToOnlyDate = convertEpochToOnlyDate;
6500
6598
  exports.convertToEpoch = convertToEpoch;
@@ -6504,6 +6602,7 @@ exports.formatDate = formatDate;
6504
6602
  exports.formatEpochToIST = formatEpochToIST;
6505
6603
  exports.formatTimestamp = formatTimestamp;
6506
6604
  exports.getSystemTimezoneAbbreviation = getSystemTimezoneAbbreviation;
6605
+ exports.injectCSSVariables = injectCSSVariables;
6507
6606
  exports.themes = themes;
6508
6607
  exports.timeAgo = timeAgo;
6509
6608
  exports.timeStringToSeconds = timeStringToSeconds;