@stenajs-webui/theme 25.13.0 → 25.15.0
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.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +7 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/ChartColor.d.ts +6 -0
- package/dist/util/ChartColor.d.ts +13 -0
- package/dist/util/CssColor.d.ts +2 -1
- package/package.json +2 -2
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{font-size:62.5%}:root{--swui-color-blue-100: #cbe1f6;--swui-color-blue-200: #abcdfd;--swui-color-blue-300: #034592;--swui-color-blue-400: #022f66;--swui-color-blue-500: #001b45;--swui-color-red-100: #fbd4cd;--swui-color-red-200: #fbb7ad;--swui-color-red-300: #e41f1f;--swui-color-red-400: #b71415;--swui-color-red-500: #8e1513;--swui-color-yellow-100: #fcefd2;--swui-color-yellow-200: #ffe3a1;--swui-color-yellow-300: #feca3a;--swui-color-yellow-400: #dead1c;--swui-color-yellow-500: #c09617;--swui-color-green-100: #e5f5e9;--swui-color-green-200: #b2d5bc;--swui-color-green-300: #1c5e38;--swui-color-green-400: #0a4325;--swui-color-green-500: #022c15;--swui-color-beige-100: #f6f4f0;--swui-color-beige-200: #f2eee5;--swui-color-beige-300: #eae3d2;--swui-color-beige-400: #ccc6b6;--swui-color-beige-500: #b2ac9f;--lhds-color-blue-50: var(--himmel-lighter);--lhds-color-blue-100: var(--himmel-light);--lhds-color-blue-200: var(--himmel);--lhds-color-blue-300: #6ca9e6;--lhds-color-blue-400: #3a8cdd;--lhds-color-blue-500: var(--modern-blue);--lhds-color-blue-600: var(--core-blue);--lhds-color-blue-700: #18518a;--lhds-color-blue-800: var(--mussla);--lhds-color-blue-900: #0f304d;--lhds-color-green-50: #f4fbf0;--lhds-color-green-100: #d1efc1;--lhds-color-green-200: #aee492;--lhds-color-green-300: #8ad861;--lhds-color-green-400: #6cce38;--lhds-color-green-500: #60bd2f;--lhds-color-green-600: #509e27;--lhds-color-green-700: #407e1f;--lhds-color-green-800: #305f18;--lhds-color-green-900: #284f14;--lhds-color-orange-50: #fff8eb;--lhds-color-orange-100: #fff1cc;--lhds-color-orange-200: #ffd656;--lhds-color-orange-300: #feca3a;--lhds-color-orange-400: #ffb633;--lhds-color-orange-500: #ffa400;--lhds-color-orange-600: #eb9700;--lhds-color-orange-700: #d88b00;--lhds-color-orange-800: #b17200;--lhds-color-orange-900: #895800;--lhds-color-red-50: #fff1f4;--lhds-color-red-100: var(--snackskal-light);--lhds-color-red-200: var(--snackskal);--lhds-color-red-300: #ff4e70;--lhds-color-red-400: #f1002e;--lhds-color-red-500: #d70029;--lhds-color-red-600: var(--sjobod);--lhds-color-red-700: var(--tang);--lhds-color-red-800: #710015;--lhds-color-red-900: #570010;--lhds-color-turquoise-50: #eafbf9;--lhds-color-turquoise-100: #daf8f4;--lhds-color-turquoise-200: #b9f2e9;--lhds-color-turquoise-300: #87e8da;--lhds-color-turquoise-400: #46dcc6;--lhds-color-turquoise-500: #28d2b9;--lhds-color-turquoise-600: #24bda6;--lhds-color-turquoise-700: #1c9280;--lhds-color-turquoise-800: #156f62;--lhds-color-turquoise-900: #125f53;--lhds-color-ui-50: #ffffff;--lhds-color-ui-100: #fafafb;--lhds-color-ui-200: var(--silver-lighter);--lhds-color-ui-300: var(--silver-ui);--lhds-color-ui-400: var(--silver-light);--lhds-color-ui-500: var(--silver);--lhds-color-ui-600: #5c6171;--lhds-color-ui-700: #424551;--lhds-color-ui-800: #282931;--lhds-color-ui-900: var(--black)}:root{--swui-white: #fff;--swui-hidden: rgba(0, 0, 0, 0);--swui-primary-action-color: var(--core-blue);--swui-primary-action-color-hover: var(--mussla);--swui-primary-action-color-hover-light: var(--lhds-color-blue-100);--swui-primary-action-color-focus: var(--modern-blue);--swui-primary-action-color-focus-light: var(--lhds-color-blue-100);--swui-primary-action-color-active: var(--lhds-color-blue-900);--swui-primary-action-color-disabled: var(--lhds-color-ui-300);--swui-separator-color: var(--lhds-color-ui-300);--swui-handle-bg-enabled-color: var(--swui-white);--swui-handle-bg-disabled-color: var(--lhds-color-ui-300);--swui-modal-border-color: var(--lhds-color-ui-400);--swui-overlay-bg-color: rgba(13, 14, 16, .5);--swui-overlay-bg-color-light: rgba(255, 255, 255, .7);--swui-state-error-color: var(--lhds-color-red-300);--swui-state-error-light-color: var(--lhds-color-red-100);--swui-state-alert-color: var(--lhds-color-orange-400);--swui-state-alert-light-color: var(--lhds-color-orange-100);--swui-state-success-color: var(--lhds-color-green-600);--swui-state-success-light-color: var(--lhds-color-green-100);--swui-state-modified-color: var(--lhds-color-blue-500);--swui-state-modified-light-color: var(--lhds-color-blue-100);--swui-state-loading-color: var(--lhds-color-ui-400);--swui-state-loading-light-color: var(--lhds-color-ui-100);--swui-font-primary: "Stena Sans", "Open Sans", Arial, sans-serif;--swui-font-weight-text: 400;--swui-font-weight-text-bold: 500;--swui-font-weight-link: 400;--swui-font-buttons: var(--swui-font-primary);--swui-font-input: var(--swui-font-primary);--swui-line-height: 1.5;--swui-font-size-inputs: 1.6rem;--swui-font-size-inputs-large: 2rem;--swui-font-size-large: 1.8rem;--swui-line-height-large: var(--swui-line-height);--swui-font-size-medium: 1.6rem;--swui-line-height-medium: var(--swui-line-height);--swui-font-size-small: 1.4rem;--swui-line-height-small: var(--swui-line-height);--swui-font-size-smaller: 1.2rem;--swui-line-height-smaller: var(--swui-line-height);--swui-font-weight-inputs: 400;--swui-text-primary-color: var(--lhds-color-ui-900);--swui-text-action-color: var(--lhds-color-blue-600);--swui-text-action-color-hover: var(--lhds-color-blue-500);--swui-text-action-color-focus: var(--lhds-color-blue-500);--swui-text-action-color-active: var(--lhds-color-blue-700);--swui-text-primary-color-light: var(--lhds-color-ui-400);--swui-text-disabled-color: var(--lhds-color-ui-600);--swui-text-disabled-color-light: var(--lhds-color-ui-300);--swui-text-darkmode-primary-color: var(--lhds-color-ui-400);--swui-text-darkmode-disabled-color: var(--lhds-color-ui-300);--swui-text-letter-spacing: 0;--swui-warning-strong-bg-color: #feca3a;--swui-warning-weak-bg-color: #fff1cc;--swui-info-strong-bg-color: var(--core-blue);--swui-info-weak-bg-color: var(--lhds-color-blue-100);--swui-error-strong-bg-color: var(--lhds-color-red-500);--swui-error-weak-bg-color: var(--lhds-color-red-100);--swui-success-strong-bg-color: var(--lhds-color-green-700);--swui-success-weak-bg-color: var(--lhds-color-green-100);--swui-animation-time-fast: .1s;--swui-animation-time-medium: .25s;--swui-animation-time-slow: .5s;--swui-field-text-color: #0c0e10;--swui-field-text-color-disabled: #0c0e10;--swui-field-letter-spacing: 0;--swui-field-text-line-height: var(--swui-line-height);--swui-field-height: 36px;--swui-field-bg-enabled: var(--swui-white);--swui-field-bg-disabled: var(--lhds-color-ui-300);--swui-field-border-color: var(--lhds-color-ui-500);--swui-field-border-color-hover: var(--lhds-color-blue-500);--swui-field-border-color-disabled: var(--lhds-color-ui-400);--swui-field-shadow-color: rgba(0, 0, 0, .15);--swui-field-box-size-large: 32px;--swui-field-box-size-medium: 24px;--swui-field-box-size-small: 16px;--swui-field-border-radius: var(--swui-border-radius-small);--swui-field-icon-color: var(--lhds-color-ui-900);--swui-field-icon-size: 20px;--swui-field-indicator-active-color: var(--swui-white);--swui-field-indicator-inactive-color: var(--swui-hidden);--swui-field-placeholder-color: var(--lhds-color-ui-500);--swui-field-placeholder-font-weight: var(--swui-font-weight-text-bold);--swui-border-radius-small: 4px;--swui-border-radius: 8px;--swui-border-radius-large: 16px;--swui-max-border-radius: 10000px;--swui-shadow-modal: rgba(0, 0, 0, .2) 0px 0px 10px 4px;--swui-shadow-popover: 0 2px 4px -1px rgba(20, 62, 98, .15), 0 1px 10px 0 rgba(0, 0, 0, .12);--swui-shadow-box: 0 3px 1px -2px rgba(0, 0, 0, .15), 0 0 4px 0 rgba(0, 0, 0, .15);--swui-shadow-bottom: rgba(0, 0, 0, .2) 0 5px 5px -4px;--swui-sticky-footer-shadow: 0px -2px 4px 0px rgba(0, 0, 0, .1), 0px 0px 1px 0px rgba(0, 0, 0, .2);--swui-metrics-indent: 8px;--swui-metrics-spacing: 8px;--swui-metrics-space: 8px;--swui-metrics-space-half: 4px;--swui-default-item-height: 40px;--swui-focus-outline-width: 2px;--swui-focus-outline: var(--swui-focus-outline-width) solid var(--modern-blue)}:root{--black: #000000;--core-blue: #004a93;--efp-economy: var(--sjobod);--efp-flexi: var(--hav);--efp-premium: #e7ae2f;--hav-30: rgba(26, 90, 154, .3);--hav: rgb(26, 90, 154);--himmel-light: #cae2fb;--himmel-lighter: #e1edfd;--himmel: #b4d4f9;--modern-blue: #1178df;--modern-green: rgb(116, 179, 70);--modern-red: rgb(234, 20, 61);--moln: rgb(255, 255, 255);--molnigare: rgb(250, 250, 248);--mussla: #122f66;--sand-dark-10: rgba(155, 147, 123, .1);--sand-dark-20: rgba(155, 147, 123, .2);--sand-dark: rgba(155, 147, 123);--sand: rgb(250, 246, 235);--silver-dark: #6b6b6b;--silver-light: #c9c9c9;--silver-lighter: #f4f4f4;--silver-ui: #ebebeb;--silver: #949494;--sjobod: rgb(176, 15, 46);--snackskal-light: #fce1db;--snackskal: #fbd4cd;--tang: #80091b;--tjara: rgb(51, 51, 51)}
|
|
1
|
+
:root{font-size:62.5%}:root{--swui-color-blue-100: #cbe1f6;--swui-color-blue-200: #abcdfd;--swui-color-blue-300: #034592;--swui-color-blue-400: #022f66;--swui-color-blue-500: #001b45;--swui-color-red-100: #fbd4cd;--swui-color-red-200: #fbb7ad;--swui-color-red-300: #e41f1f;--swui-color-red-400: #b71415;--swui-color-red-500: #8e1513;--swui-color-yellow-100: #fcefd2;--swui-color-yellow-200: #ffe3a1;--swui-color-yellow-300: #feca3a;--swui-color-yellow-400: #dead1c;--swui-color-yellow-500: #c09617;--swui-color-green-100: #e5f5e9;--swui-color-green-200: #b2d5bc;--swui-color-green-300: #1c5e38;--swui-color-green-400: #0a4325;--swui-color-green-500: #022c15;--swui-color-beige-100: #f6f4f0;--swui-color-beige-200: #f2eee5;--swui-color-beige-300: #eae3d2;--swui-color-beige-400: #ccc6b6;--swui-color-beige-500: #b2ac9f;--lhds-color-blue-50: var(--himmel-lighter);--lhds-color-blue-100: var(--himmel-light);--lhds-color-blue-200: var(--himmel);--lhds-color-blue-300: #6ca9e6;--lhds-color-blue-400: #3a8cdd;--lhds-color-blue-500: var(--modern-blue);--lhds-color-blue-600: var(--core-blue);--lhds-color-blue-700: #18518a;--lhds-color-blue-800: var(--mussla);--lhds-color-blue-900: #0f304d;--lhds-color-green-50: #f4fbf0;--lhds-color-green-100: #d1efc1;--lhds-color-green-200: #aee492;--lhds-color-green-300: #8ad861;--lhds-color-green-400: #6cce38;--lhds-color-green-500: #60bd2f;--lhds-color-green-600: #509e27;--lhds-color-green-700: #407e1f;--lhds-color-green-800: #305f18;--lhds-color-green-900: #284f14;--lhds-color-orange-50: #fff8eb;--lhds-color-orange-100: #fff1cc;--lhds-color-orange-200: #ffd656;--lhds-color-orange-300: #feca3a;--lhds-color-orange-400: #ffb633;--lhds-color-orange-500: #ffa400;--lhds-color-orange-600: #eb9700;--lhds-color-orange-700: #d88b00;--lhds-color-orange-800: #b17200;--lhds-color-orange-900: #895800;--lhds-color-red-50: #fff1f4;--lhds-color-red-100: var(--snackskal-light);--lhds-color-red-200: var(--snackskal);--lhds-color-red-300: #ff4e70;--lhds-color-red-400: #f1002e;--lhds-color-red-500: #d70029;--lhds-color-red-600: var(--sjobod);--lhds-color-red-700: var(--tang);--lhds-color-red-800: #710015;--lhds-color-red-900: #570010;--lhds-color-turquoise-50: #eafbf9;--lhds-color-turquoise-100: #daf8f4;--lhds-color-turquoise-200: #b9f2e9;--lhds-color-turquoise-300: #87e8da;--lhds-color-turquoise-400: #46dcc6;--lhds-color-turquoise-500: #28d2b9;--lhds-color-turquoise-600: #24bda6;--lhds-color-turquoise-700: #1c9280;--lhds-color-turquoise-800: #156f62;--lhds-color-turquoise-900: #125f53;--lhds-color-ui-50: #ffffff;--lhds-color-ui-100: #fafafb;--lhds-color-ui-200: var(--silver-lighter);--lhds-color-ui-300: var(--silver-ui);--lhds-color-ui-400: var(--silver-light);--lhds-color-ui-500: var(--silver);--lhds-color-ui-600: #5c6171;--lhds-color-ui-700: #424551;--lhds-color-ui-800: #282931;--lhds-color-ui-900: var(--black)}:root{--swui-white: #fff;--swui-hidden: rgba(0, 0, 0, 0);--swui-primary-action-color: var(--core-blue);--swui-primary-action-color-hover: var(--mussla);--swui-primary-action-color-hover-light: var(--lhds-color-blue-100);--swui-primary-action-color-focus: var(--modern-blue);--swui-primary-action-color-focus-light: var(--lhds-color-blue-100);--swui-primary-action-color-active: var(--lhds-color-blue-900);--swui-primary-action-color-disabled: var(--lhds-color-ui-300);--swui-separator-color: var(--lhds-color-ui-300);--swui-handle-bg-enabled-color: var(--swui-white);--swui-handle-bg-disabled-color: var(--lhds-color-ui-300);--swui-modal-border-color: var(--lhds-color-ui-400);--swui-overlay-bg-color: rgba(13, 14, 16, .5);--swui-overlay-bg-color-light: rgba(255, 255, 255, .7);--swui-state-error-color: var(--lhds-color-red-300);--swui-state-error-light-color: var(--lhds-color-red-100);--swui-state-alert-color: var(--lhds-color-orange-400);--swui-state-alert-light-color: var(--lhds-color-orange-100);--swui-state-success-color: var(--lhds-color-green-600);--swui-state-success-light-color: var(--lhds-color-green-100);--swui-state-modified-color: var(--lhds-color-blue-500);--swui-state-modified-light-color: var(--lhds-color-blue-100);--swui-state-loading-color: var(--lhds-color-ui-400);--swui-state-loading-light-color: var(--lhds-color-ui-100);--swui-font-primary: "Stena Sans", "Open Sans", Arial, sans-serif;--swui-font-weight-text: 400;--swui-font-weight-text-bold: 500;--swui-font-weight-link: 400;--swui-font-buttons: var(--swui-font-primary);--swui-font-input: var(--swui-font-primary);--swui-line-height: 1.5;--swui-font-size-inputs: 1.6rem;--swui-font-size-inputs-large: 2rem;--swui-font-size-large: 1.8rem;--swui-line-height-large: var(--swui-line-height);--swui-font-size-medium: 1.6rem;--swui-line-height-medium: var(--swui-line-height);--swui-font-size-small: 1.4rem;--swui-line-height-small: var(--swui-line-height);--swui-font-size-smaller: 1.2rem;--swui-line-height-smaller: var(--swui-line-height);--swui-font-weight-inputs: 400;--swui-text-primary-color: var(--lhds-color-ui-900);--swui-text-action-color: var(--lhds-color-blue-600);--swui-text-action-color-hover: var(--lhds-color-blue-500);--swui-text-action-color-focus: var(--lhds-color-blue-500);--swui-text-action-color-active: var(--lhds-color-blue-700);--swui-text-primary-color-light: var(--lhds-color-ui-400);--swui-text-disabled-color: var(--lhds-color-ui-600);--swui-text-disabled-color-light: var(--lhds-color-ui-300);--swui-text-darkmode-primary-color: var(--lhds-color-ui-400);--swui-text-darkmode-disabled-color: var(--lhds-color-ui-300);--swui-text-letter-spacing: 0;--swui-warning-strong-bg-color: #feca3a;--swui-warning-weak-bg-color: #fff1cc;--swui-info-strong-bg-color: var(--core-blue);--swui-info-weak-bg-color: var(--lhds-color-blue-100);--swui-error-strong-bg-color: var(--lhds-color-red-500);--swui-error-weak-bg-color: var(--lhds-color-red-100);--swui-success-strong-bg-color: var(--lhds-color-green-700);--swui-success-weak-bg-color: var(--lhds-color-green-100);--swui-animation-time-fast: .1s;--swui-animation-time-medium: .25s;--swui-animation-time-slow: .5s;--swui-field-text-color: #0c0e10;--swui-field-text-color-disabled: #0c0e10;--swui-field-letter-spacing: 0;--swui-field-text-line-height: var(--swui-line-height);--swui-field-height: 36px;--swui-field-bg-enabled: var(--swui-white);--swui-field-bg-disabled: var(--lhds-color-ui-300);--swui-field-border-color: var(--lhds-color-ui-500);--swui-field-border-color-hover: var(--lhds-color-blue-500);--swui-field-border-color-disabled: var(--lhds-color-ui-400);--swui-field-shadow-color: rgba(0, 0, 0, .15);--swui-field-box-size-large: 32px;--swui-field-box-size-medium: 24px;--swui-field-box-size-small: 16px;--swui-field-border-radius: var(--swui-border-radius-small);--swui-field-icon-color: var(--lhds-color-ui-900);--swui-field-icon-size: 20px;--swui-field-indicator-active-color: var(--swui-white);--swui-field-indicator-inactive-color: var(--swui-hidden);--swui-field-placeholder-color: var(--lhds-color-ui-500);--swui-field-placeholder-font-weight: var(--swui-font-weight-text-bold);--swui-border-radius-small: 4px;--swui-border-radius: 8px;--swui-border-radius-large: 16px;--swui-max-border-radius: 10000px;--swui-shadow-modal: rgba(0, 0, 0, .2) 0px 0px 10px 4px;--swui-shadow-popover: 0 2px 4px -1px rgba(20, 62, 98, .15), 0 1px 10px 0 rgba(0, 0, 0, .12);--swui-shadow-box: 0 3px 1px -2px rgba(0, 0, 0, .15), 0 0 4px 0 rgba(0, 0, 0, .15);--swui-shadow-bottom: rgba(0, 0, 0, .2) 0 5px 5px -4px;--swui-sticky-footer-shadow: 0px -2px 4px 0px rgba(0, 0, 0, .1), 0px 0px 1px 0px rgba(0, 0, 0, .2);--swui-metrics-indent: 8px;--swui-metrics-spacing: 8px;--swui-metrics-space: 8px;--swui-metrics-space-half: 4px;--swui-default-item-height: 40px;--swui-focus-outline-width: 2px;--swui-focus-outline: var(--swui-focus-outline-width) solid var(--modern-blue);--swui-chart-1: var(--swui-color-blue-300);--swui-chart-2: var(--swui-color-red-300);--swui-chart-3: #039e93;--swui-chart-4: #a752d4;--swui-chart-5: #d37e01;--swui-chart-6: #317e42;--swui-chart-7: #944777;--swui-chart-8: #922f0a;--swui-chart-sequential-1: #b7d3fb;--swui-chart-sequential-2: #88b3f0;--swui-chart-sequential-3: #5a93e3;--swui-chart-sequential-4: #3373ca;--swui-chart-sequential-5: #1155a9;--swui-chart-sequential-6: var(--swui-color-blue-300);--swui-chart-sequential-7: #002b63;--swui-chart-diverging-1: var(--swui-color-blue-300);--swui-chart-diverging-2: #497bc0;--swui-chart-diverging-3: #91b3e4;--swui-chart-diverging-4: #e6e6e6;--swui-chart-diverging-5: #f4b1a7;--swui-chart-diverging-6: #f0796b;--swui-chart-diverging-7: var(--swui-color-red-300)}:root{--black: #000000;--core-blue: #004a93;--efp-economy: var(--sjobod);--efp-flexi: var(--hav);--efp-premium: #e7ae2f;--hav-30: rgba(26, 90, 154, .3);--hav: rgb(26, 90, 154);--himmel-light: #cae2fb;--himmel-lighter: #e1edfd;--himmel: #b4d4f9;--modern-blue: #1178df;--modern-green: rgb(116, 179, 70);--modern-red: rgb(234, 20, 61);--moln: rgb(255, 255, 255);--molnigare: rgb(250, 250, 248);--mussla: #122f66;--sand-dark-10: rgba(155, 147, 123, .1);--sand-dark-20: rgba(155, 147, 123, .2);--sand-dark: rgba(155, 147, 123);--sand: rgb(250, 246, 235);--silver-dark: #6b6b6b;--silver-light: #c9c9c9;--silver-lighter: #f4f4f4;--silver-ui: #ebebeb;--silver: #949494;--sjobod: rgb(176, 15, 46);--snackskal-light: #fce1db;--snackskal: #fbd4cd;--tang: #80091b;--tjara: rgb(51, 51, 51)}
|
package/dist/index.d.ts
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import './index.css';const
|
|
1
|
+
import './index.css';const o = (t) => `var(${t})`, n = 8, s = 7, c = (t, a) => (Math.trunc(t) % a + a) % a, r = (t, a) => Math.min(a - 1, Math.max(0, Math.trunc(t))), h = (t) => `var(--swui-chart-${c(t, 8) + 1})`, u = (t) => `var(--swui-chart-sequential-${r(t, 7) + 1})`, e = (t) => `var(--swui-chart-diverging-${r(t, 7) + 1})`;
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
h as chartColor,
|
|
4
|
+
n as chartColorCount,
|
|
5
|
+
e as chartDivergingColor,
|
|
6
|
+
s as chartScaleStepCount,
|
|
7
|
+
u as chartSequentialColor,
|
|
8
|
+
o as cssColor
|
|
4
9
|
};
|
|
5
10
|
//# sourceMappingURL=index.es.js.map
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/util/CssColor.ts"],"sourcesContent":["import { LhdsColor } from \"../types/LhdsColor\";\nimport { ThemeColor } from \"../types/ThemeColor\";\nimport { BrandColor } from \"../types/BrandColor\";\nimport { ColorScaleColor } from \"../types/ColorScale\";\n\nexport type CssPropColor =\n | LhdsColor\n | ThemeColor\n | BrandColor\n | ColorScaleColor;\n\nexport const cssColor = (cssPropColor: CssPropColor) => `var(${cssPropColor})`;\n"],"names":["cssColor","cssPropColor"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../src/util/CssColor.ts","../src/util/ChartColor.ts"],"sourcesContent":["import { LhdsColor } from \"../types/LhdsColor\";\nimport { ThemeColor } from \"../types/ThemeColor\";\nimport { BrandColor } from \"../types/BrandColor\";\nimport { ColorScaleColor } from \"../types/ColorScale\";\nimport {\n ChartColor,\n ChartDivergingColor,\n ChartSequentialColor,\n} from \"../types/ChartColor\";\n\nexport type CssPropColor =\n | LhdsColor\n | ThemeColor\n | BrandColor\n | ColorScaleColor\n | ChartColor\n | ChartSequentialColor\n | ChartDivergingColor;\n\nexport const cssColor = (cssPropColor: CssPropColor) => `var(${cssPropColor})`;\n","/** The number of categorical chart colours. */\nexport const chartColorCount = 8;\n\n/** The number of steps in the sequential and diverging chart scales. */\nexport const chartScaleStepCount = 7;\n\nconst wrap = (index: number, length: number): number =>\n ((Math.trunc(index) % length) + length) % length;\n\nconst clamp = (index: number, length: number): number =>\n Math.min(length - 1, Math.max(0, Math.trunc(index)));\n\n/**\n * The colour of series `index` (0-based), as `var(--swui-chart-N)`. After eight\n * series the colours repeat, so keep to eight: fold the rest into \"Other\".\n */\nexport const chartColor = (index: number): string =>\n `var(--swui-chart-${wrap(index, chartColorCount) + 1})`;\n\n/** Step `index` (0-based, light to dark) of the sequential chart scale. */\nexport const chartSequentialColor = (index: number): string =>\n `var(--swui-chart-sequential-${clamp(index, chartScaleStepCount) + 1})`;\n\n/** Step `index` (0-based, blue to red) of the diverging chart scale. */\nexport const chartDivergingColor = (index: number): string =>\n `var(--swui-chart-diverging-${clamp(index, chartScaleStepCount) + 1})`;\n"],"names":["cssColor","cssPropColor","chartColorCount","chartScaleStepCount","wrap","index","length","clamp","chartColor","chartSequentialColor","chartDivergingColor"],"mappings":"AAmBO,MAAMA,IAAW,CAACC,MAA+B,OAAOA,CAAY,KClB9DC,IAAkB,GAGlBC,IAAsB,GAE7BC,IAAO,CAACC,GAAeC,OACzB,KAAK,MAAMD,CAAK,IAAIC,IAAUA,KAAUA,GAEtCC,IAAQ,CAACF,GAAeC,MAC5B,KAAK,IAAIA,IAAS,GAAG,KAAK,IAAI,GAAG,KAAK,MAAMD,CAAK,CAAC,CAAC,GAMxCG,IAAa,CAACH,MACzB,oBAAoBD,EAAKC,GAAO,CAAe,IAAI,CAAC,KAGzCI,IAAuB,CAACJ,MACnC,+BAA+BE,EAAMF,GAAO,CAAmB,IAAI,CAAC,KAGzDK,IAAsB,CAACL,MAClC,8BAA8BE,EAAMF,GAAO,CAAmB,IAAI,CAAC;"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=o=>`var(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const n=t=>`var(${t})`,a=8,o=7,e=(t,r)=>(Math.trunc(t)%r+r)%r,c=(t,r)=>Math.min(r-1,Math.max(0,Math.trunc(t))),s=t=>`var(--swui-chart-${e(t,a)+1})`,l=t=>`var(--swui-chart-sequential-${c(t,o)+1})`,i=t=>`var(--swui-chart-diverging-${c(t,o)+1})`;exports.chartColor=s;exports.chartColorCount=a;exports.chartDivergingColor=i;exports.chartScaleStepCount=o;exports.chartSequentialColor=l;exports.cssColor=n;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/util/CssColor.ts"],"sourcesContent":["import { LhdsColor } from \"../types/LhdsColor\";\nimport { ThemeColor } from \"../types/ThemeColor\";\nimport { BrandColor } from \"../types/BrandColor\";\nimport { ColorScaleColor } from \"../types/ColorScale\";\n\nexport type CssPropColor =\n | LhdsColor\n | ThemeColor\n | BrandColor\n | ColorScaleColor;\n\nexport const cssColor = (cssPropColor: CssPropColor) => `var(${cssPropColor})`;\n"],"names":["cssColor","cssPropColor"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/util/CssColor.ts","../src/util/ChartColor.ts"],"sourcesContent":["import { LhdsColor } from \"../types/LhdsColor\";\nimport { ThemeColor } from \"../types/ThemeColor\";\nimport { BrandColor } from \"../types/BrandColor\";\nimport { ColorScaleColor } from \"../types/ColorScale\";\nimport {\n ChartColor,\n ChartDivergingColor,\n ChartSequentialColor,\n} from \"../types/ChartColor\";\n\nexport type CssPropColor =\n | LhdsColor\n | ThemeColor\n | BrandColor\n | ColorScaleColor\n | ChartColor\n | ChartSequentialColor\n | ChartDivergingColor;\n\nexport const cssColor = (cssPropColor: CssPropColor) => `var(${cssPropColor})`;\n","/** The number of categorical chart colours. */\nexport const chartColorCount = 8;\n\n/** The number of steps in the sequential and diverging chart scales. */\nexport const chartScaleStepCount = 7;\n\nconst wrap = (index: number, length: number): number =>\n ((Math.trunc(index) % length) + length) % length;\n\nconst clamp = (index: number, length: number): number =>\n Math.min(length - 1, Math.max(0, Math.trunc(index)));\n\n/**\n * The colour of series `index` (0-based), as `var(--swui-chart-N)`. After eight\n * series the colours repeat, so keep to eight: fold the rest into \"Other\".\n */\nexport const chartColor = (index: number): string =>\n `var(--swui-chart-${wrap(index, chartColorCount) + 1})`;\n\n/** Step `index` (0-based, light to dark) of the sequential chart scale. */\nexport const chartSequentialColor = (index: number): string =>\n `var(--swui-chart-sequential-${clamp(index, chartScaleStepCount) + 1})`;\n\n/** Step `index` (0-based, blue to red) of the diverging chart scale. */\nexport const chartDivergingColor = (index: number): string =>\n `var(--swui-chart-diverging-${clamp(index, chartScaleStepCount) + 1})`;\n"],"names":["cssColor","cssPropColor","chartColorCount","chartScaleStepCount","wrap","index","length","clamp","chartColor","chartSequentialColor","chartDivergingColor"],"mappings":"gFAmBO,MAAMA,EAAYC,GAA+B,OAAOA,CAAY,IClB9DC,EAAkB,EAGlBC,EAAsB,EAE7BC,EAAO,CAACC,EAAeC,KACzB,KAAK,MAAMD,CAAK,EAAIC,EAAUA,GAAUA,EAEtCC,EAAQ,CAACF,EAAeC,IAC5B,KAAK,IAAIA,EAAS,EAAG,KAAK,IAAI,EAAG,KAAK,MAAMD,CAAK,CAAC,CAAC,EAMxCG,EAAcH,GACzB,oBAAoBD,EAAKC,EAAOH,CAAe,EAAI,CAAC,IAGzCO,EAAwBJ,GACnC,+BAA+BE,EAAMF,EAAOF,CAAmB,EAAI,CAAC,IAGzDO,EAAuBL,GAClC,8BAA8BE,EAAMF,EAAOF,CAAmB,EAAI,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** A categorical chart colour: one per series. */
|
|
2
|
+
export type ChartColor = `--swui-chart-${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8}`;
|
|
3
|
+
/** A step of the sequential chart scale, light (1) to dark (7). */
|
|
4
|
+
export type ChartSequentialColor = `--swui-chart-sequential-${1 | 2 | 3 | 4 | 5 | 6 | 7}`;
|
|
5
|
+
/** A step of the diverging chart scale, blue (1) to red (7). */
|
|
6
|
+
export type ChartDivergingColor = `--swui-chart-diverging-${1 | 2 | 3 | 4 | 5 | 6 | 7}`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** The number of categorical chart colours. */
|
|
2
|
+
export declare const chartColorCount = 8;
|
|
3
|
+
/** The number of steps in the sequential and diverging chart scales. */
|
|
4
|
+
export declare const chartScaleStepCount = 7;
|
|
5
|
+
/**
|
|
6
|
+
* The colour of series `index` (0-based), as `var(--swui-chart-N)`. After eight
|
|
7
|
+
* series the colours repeat, so keep to eight: fold the rest into "Other".
|
|
8
|
+
*/
|
|
9
|
+
export declare const chartColor: (index: number) => string;
|
|
10
|
+
/** Step `index` (0-based, light to dark) of the sequential chart scale. */
|
|
11
|
+
export declare const chartSequentialColor: (index: number) => string;
|
|
12
|
+
/** Step `index` (0-based, blue to red) of the diverging chart scale. */
|
|
13
|
+
export declare const chartDivergingColor: (index: number) => string;
|
package/dist/util/CssColor.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ import { LhdsColor } from "../types/LhdsColor";
|
|
|
2
2
|
import { ThemeColor } from "../types/ThemeColor";
|
|
3
3
|
import { BrandColor } from "../types/BrandColor";
|
|
4
4
|
import { ColorScaleColor } from "../types/ColorScale";
|
|
5
|
-
|
|
5
|
+
import { ChartColor, ChartDivergingColor, ChartSequentialColor } from "../types/ChartColor";
|
|
6
|
+
export type CssPropColor = LhdsColor | ThemeColor | BrandColor | ColorScaleColor | ChartColor | ChartSequentialColor | ChartDivergingColor;
|
|
6
7
|
export declare const cssColor: (cssPropColor: CssPropColor) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stenajs-webui/theme",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.15.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "mattias800",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"files": [
|
|
50
50
|
"dist"
|
|
51
51
|
],
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "8b37c4a8984f2c8710bb21f9ce6a464044e5ca41",
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
}
|