@milaboratories/uikit 2.2.37 → 2.2.38

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,44 @@
1
+ import { type CategoricalColor } from './palette';
2
+ /**
3
+ * Represents a color with red, green, blue, and alpha channels.
4
+ * Provides methods to convert to HEX and RGBA formats.
5
+ *
6
+ * @param {number} r - Red channel (0-255).
7
+ * @param {number} g - Green channel (0-255).
8
+ * @param {number} b - Blue channel (0-255).
9
+ * @param {number} [a=1] - Alpha channel (0-1).
10
+ */
11
+ export declare function Color(r: number, g: number, b: number, a?: number): {
12
+ readonly r: number;
13
+ readonly g: number;
14
+ readonly b: number;
15
+ readonly a: number;
16
+ readonly hex: string;
17
+ readonly rgba: string;
18
+ toString(): string;
19
+ toJSON(): string;
20
+ };
21
+ export declare namespace Color {
22
+ var fromHex: (hex: string) => Color;
23
+ var fromString: (str: string) => {
24
+ readonly r: number;
25
+ readonly g: number;
26
+ readonly b: number;
27
+ readonly a: number;
28
+ readonly hex: string;
29
+ readonly rgba: string;
30
+ toString(): string;
31
+ toJSON(): string;
32
+ };
33
+ var categorical: (name: CategoricalColor) => {
34
+ readonly r: number;
35
+ readonly g: number;
36
+ readonly b: number;
37
+ readonly a: number;
38
+ readonly hex: string;
39
+ readonly rgba: string;
40
+ toString(): string;
41
+ toJSON(): string;
42
+ };
43
+ }
44
+ export type Color = ReturnType<typeof Color>;
@@ -0,0 +1,69 @@
1
+ import type { Palette } from './palette';
2
+ import { Color } from './color';
3
+ export type GradientSource = (string | Color)[] | Palette;
4
+ /**
5
+ * Interpolates between two colors.
6
+ *
7
+ * @param {Color} color1 - Start color.
8
+ * @param {Color} color2 - End color.
9
+ * @param {number} t - Interpolation factor [0, 1].
10
+ * @returns {Color} Interpolated color.
11
+ */
12
+ export declare function interpolateColor(color1: Color, color2: Color, t: number): Color;
13
+ /**
14
+ * Normalizes a gradient definition into an array of Color objects.
15
+ *
16
+ * @param {GradientSource} raw - A gradient defined as an array of strings, Colors, or a Palette.
17
+ * @returns {Color[]} Array of normalized Color objects.
18
+ */
19
+ export declare function normalizeGradient(raw: GradientSource): Color[];
20
+ /**
21
+ * Creates a gradient with utilities to sample or split colors.
22
+ */
23
+ export declare function Gradient(gradient: GradientSource): {
24
+ readonly colors: Color[];
25
+ /**
26
+ * Samples a color at a specific point in the gradient.
27
+ *
28
+ * @param {number} t - A value in [0, 1] representing the position in the gradient.
29
+ */
30
+ fromInterval(t: number): {
31
+ readonly r: number;
32
+ readonly g: number;
33
+ readonly b: number;
34
+ readonly a: number;
35
+ readonly hex: string;
36
+ readonly rgba: string;
37
+ toString(): string;
38
+ toJSON(): string;
39
+ };
40
+ /**
41
+ * Gets the nth color in a gradient divided into segments.
42
+ *
43
+ * @param {number} n - Index of the color (1-based).
44
+ * @param {number} segments - Total number of segments.
45
+ */
46
+ getNthOf(n: number, segments: number): {
47
+ readonly r: number;
48
+ readonly g: number;
49
+ readonly b: number;
50
+ readonly a: number;
51
+ readonly hex: string;
52
+ readonly rgba: string;
53
+ toString(): string;
54
+ toJSON(): string;
55
+ };
56
+ /**
57
+ * Splits the gradient into n evenly spaced colors.
58
+ */
59
+ split(n: number): {
60
+ readonly r: number;
61
+ readonly g: number;
62
+ readonly b: number;
63
+ readonly a: number;
64
+ readonly hex: string;
65
+ readonly rgba: string;
66
+ toString(): string;
67
+ toJSON(): string;
68
+ }[];
69
+ };
@@ -0,0 +1,3 @@
1
+ export * from './palette';
2
+ export * from './color';
3
+ export * from './gradient';
@@ -0,0 +1,55 @@
1
+ /**
2
+ * good for age range // from newborn → to old
3
+ */
4
+ export declare const viridis: string[];
5
+ /**
6
+ * from light → to hard (errors)
7
+ */
8
+ export declare const magma: string[];
9
+ export declare const palettes: {
10
+ viridis: string[];
11
+ magma: string[];
12
+ density: string[];
13
+ salinity: string[];
14
+ sunset: string[];
15
+ rainbow: string[];
16
+ spectrum: string[];
17
+ teal_red: string[];
18
+ blue_red: string[];
19
+ lime_rose: string[];
20
+ viridis_magma: string[];
21
+ };
22
+ export type Palette = keyof typeof palettes;
23
+ /**
24
+ * Just named colors
25
+ */
26
+ export declare const categoricalColors: {
27
+ green_light: string;
28
+ green_bright: string;
29
+ green_dark: string;
30
+ violet_light: string;
31
+ violet_bright: string;
32
+ violet_dark: string;
33
+ orange_light: string;
34
+ orange_bright: string;
35
+ orange_dark: string;
36
+ teal_light: string;
37
+ teal_bright: string;
38
+ teal_dark: string;
39
+ rose_light: string;
40
+ rose_bright: string;
41
+ rose_dark: string;
42
+ lime_light: string;
43
+ lime_bright: string;
44
+ lime_dark: string;
45
+ blue_light: string;
46
+ blue_bright: string;
47
+ blue_dark: string;
48
+ red_light: string;
49
+ red_bright: string;
50
+ red_dark: string;
51
+ grey_light: string;
52
+ grey_bright: string;
53
+ grey_dark: string;
54
+ };
55
+ export type CategoricalColor = keyof typeof categoricalColors;
@@ -0,0 +1,10 @@
1
+ import type { Color } from '../../colors';
2
+ type __VLS_Props = {
3
+ maxInColumn?: number;
4
+ legends: {
5
+ color: string | Color;
6
+ text: string;
7
+ }[];
8
+ };
9
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
10
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import type { PlChartStackedBarSettings } from './types';
2
+ type __VLS_Props = {
3
+ settings: PlChartStackedBarSettings;
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
6
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import type { PlChartStackedBarSegment } from './types';
2
+ type __VLS_Props = {
3
+ value: PlChartStackedBarSegment[];
4
+ height?: number;
5
+ showFractionInLabel?: boolean;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
8
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default as PlChartStackedBar } from './PlChartStackedBar.vue';
2
+ export * from './types';
@@ -0,0 +1,29 @@
1
+ import type { Color } from '../../colors';
2
+ export type PlChartStackedBarSegment = {
3
+ value: number;
4
+ label: string;
5
+ description?: string;
6
+ color: string | Color;
7
+ };
8
+ export type PlChartStackedBarSettings = {
9
+ /**
10
+ * The title of the chart.
11
+ * This will be displayed at the top of the chart, if provided.
12
+ */
13
+ title?: string;
14
+ /**
15
+ * The data to be displayed in the chart.
16
+ * Each entry represents a segment of a stacked bar.
17
+ */
18
+ data: PlChartStackedBarSegment[];
19
+ /**
20
+ * The maximum number of legends displayed in a single column.
21
+ * Defaults to 5 if not specified.
22
+ */
23
+ maxLegendsInColumn?: number;
24
+ /**
25
+ * Whether to show legends for the chart.
26
+ * Defaults to `true` if not specified.
27
+ */
28
+ showLegends?: boolean;
29
+ };
@@ -52,6 +52,8 @@ export * from './components/PlMaskIcon16';
52
52
  export * from './components/PlMaskIcon24';
53
53
  export * from './components/PlIcon16';
54
54
  export * from './components/PlIcon24';
55
+ export * from './components/PlChartStackedBar';
56
+ export * from './colors';
55
57
  import DropdownListItem from './components/DropdownListItem.vue';
56
58
  import ContextProvider from './components/ContextProvider.vue';
57
59
  import Slider from './components/Slider.vue';