@tabler/charts-bootstrap 0.0.0-stage → 0.0.1-alpha.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/LICENSE +21 -0
- package/README.md +106 -2
- package/dist/bootstrap.css +2 -0
- package/dist/index.cjs +188 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +24 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +183 -0
- package/dist/index.js.map +1 -0
- package/dist/tabler-charts-bootstrap.min.js +3 -0
- package/dist/tabler-charts-bootstrap.min.js.map +1 -0
- package/dist/tabler.css +2 -0
- package/package.json +76 -3
- package/scss/_charts.scss +88 -0
- package/scss/_tabler.scss +22 -0
package/dist/tabler.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @tabler/charts-bootstrap, Tabler preset | MIT */
|
|
2
|
+
:where(:root,[data-bs-theme],[data-bs-theme-primary],[data-bs-theme-base],[data-bs-theme-font],[data-bs-theme-radius]){--tc-color-1:var(--tblr-primary,#066fd1);--tc-focus-color:var(--tblr-primary,#066fd1);--tc-surface:var(--tblr-bg-surface,#fff);--tc-text-color:var(--tblr-body-color,#0b0b0b);--tc-tooltip-color:var(--tblr-body-color,#0b0b0b);--tc-text-muted:var(--tblr-secondary,#6f6e69);--tc-grid-color:var(--tblr-border-color-translucent,#e1e0d9);--tc-baseline-color:var(--tblr-border-color,#c3c2b7);--tc-hover-color:rgba(var(--tblr-emphasis-color-rgb,11, 11, 11), .05);--tc-tooltip-bg:var(--tblr-bg-surface,#fff);--tc-tooltip-border:var(--tblr-border-color-translucent,#0b0b0b1a);--tc-tooltip-shadow:var(--tblr-box-shadow,0 4px 16px #0b0b0b1f);--tc-tooltip-radius:var(--tblr-border-radius,6px);--tc-font-family:var(--tblr-body-font-family,inherit)}:where(:root,[data-bs-theme=light]){--tc-color-2:#eb6834;--tc-color-3:#1baf7a;--tc-color-4:#eda100;--tc-color-5:#e87ba4;--tc-color-6:#008300;--tc-color-7:#4a3aa7;--tc-color-8:#e34948}:where([data-bs-theme=dark]){--tc-color-2:#d95926;--tc-color-3:#199e70;--tc-color-4:#c98500;--tc-color-5:#d55181;--tc-color-6:#008300;--tc-color-7:#9085e9;--tc-color-8:#e66767}
|
package/package.json
CHANGED
|
@@ -1,6 +1,79 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tabler/charts-bootstrap",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.1-alpha.0",
|
|
4
|
+
"description": "Bootstrap 5.3 and Tabler theme mapping (CSS and SCSS) and a data API for @tabler/charts.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"charts",
|
|
7
|
+
"svg",
|
|
8
|
+
"bootstrap",
|
|
9
|
+
"scss",
|
|
10
|
+
"tabler"
|
|
11
|
+
],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "Paweł Kuna",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/tabler/tabler-charts.git",
|
|
17
|
+
"directory": "packages/bootstrap"
|
|
18
|
+
},
|
|
19
|
+
"type": "module",
|
|
20
|
+
"sideEffects": [
|
|
21
|
+
"**/*.css",
|
|
22
|
+
"**/*.scss"
|
|
23
|
+
],
|
|
24
|
+
"main": "./dist/index.cjs",
|
|
25
|
+
"module": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"unpkg": "./dist/tabler-charts-bootstrap.min.js",
|
|
28
|
+
"jsdelivr": "./dist/tabler-charts-bootstrap.min.js",
|
|
29
|
+
"style": "./dist/bootstrap.css",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"import": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"default": "./dist/index.js"
|
|
35
|
+
},
|
|
36
|
+
"require": {
|
|
37
|
+
"types": "./dist/index.d.cts",
|
|
38
|
+
"default": "./dist/index.cjs"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"./bootstrap.css": "./dist/bootstrap.css",
|
|
42
|
+
"./tabler.css": "./dist/tabler.css",
|
|
43
|
+
"./scss/charts": {
|
|
44
|
+
"sass": "./scss/_charts.scss",
|
|
45
|
+
"default": "./scss/_charts.scss"
|
|
46
|
+
},
|
|
47
|
+
"./scss/tabler": {
|
|
48
|
+
"sass": "./scss/_tabler.scss",
|
|
49
|
+
"default": "./scss/_tabler.scss"
|
|
50
|
+
},
|
|
51
|
+
"./package.json": "./package.json"
|
|
52
|
+
},
|
|
53
|
+
"files": [
|
|
54
|
+
"dist",
|
|
55
|
+
"scss"
|
|
56
|
+
],
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"@tabler/charts": "^0.0.1-alpha.0",
|
|
59
|
+
"bootstrap": ">=5.3"
|
|
60
|
+
},
|
|
61
|
+
"peerDependenciesMeta": {
|
|
62
|
+
"bootstrap": {
|
|
63
|
+
"optional": true
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@tabler/charts": "^0.0.1-alpha.0",
|
|
68
|
+
"sass": "^1.105.1"
|
|
69
|
+
},
|
|
70
|
+
"publishConfig": {
|
|
71
|
+
"access": "public"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"build": "tsdown && node scripts/build-css.mjs",
|
|
75
|
+
"dev": "tsdown --watch",
|
|
76
|
+
"typecheck": "tsc -p .",
|
|
77
|
+
"lint:pkg": "publint && attw --pack . --profile node16 --exclude-entrypoints ./bootstrap.css ./tabler.css ./scss/charts ./scss/tabler"
|
|
78
|
+
}
|
|
6
79
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// @tabler/charts-bootstrap: map the chart tokens to Bootstrap 5.3 CSS variables.
|
|
2
|
+
//
|
|
3
|
+
// Load it after `@tabler/charts/style.css` (the plain CSS build is
|
|
4
|
+
// `@tabler/charts-bootstrap/bootstrap.css`). Charts then use the body font and
|
|
5
|
+
// colors, borders, radius and shadow of your theme, the first series takes
|
|
6
|
+
// `primary`, and `data-bs-theme="dark"` switches them with the rest of the page.
|
|
7
|
+
//
|
|
8
|
+
// Override any variable before importing, e.g. in your Bootstrap build:
|
|
9
|
+
//
|
|
10
|
+
// $tc-series-1: var(--#{$prefix}success);
|
|
11
|
+
// @import "@tabler/charts-bootstrap/scss/charts";
|
|
12
|
+
|
|
13
|
+
// Bootstrap's CSS variable prefix (`$prefix` in Bootstrap's own variables).
|
|
14
|
+
$tc-prefix: "bs-" !default;
|
|
15
|
+
// The attribute that selects the color mode, and every element whose
|
|
16
|
+
// attributes can change the variables the mapping reads.
|
|
17
|
+
$tc-theme-attribute: "data-#{$tc-prefix}theme" !default;
|
|
18
|
+
$tc-theme-scopes: ":root, [#{$tc-theme-attribute}]" !default;
|
|
19
|
+
|
|
20
|
+
// Tokens read from the theme. The fallbacks are the chart defaults, so charts
|
|
21
|
+
// still render if a variable is missing (e.g. Bootstrap < 5.3).
|
|
22
|
+
$tc-series-1: var(--#{$tc-prefix}primary, #2a78d6) !default;
|
|
23
|
+
$tc-surface: var(--#{$tc-prefix}body-bg, #fff) !default;
|
|
24
|
+
$tc-text-color: var(--#{$tc-prefix}body-color, #0b0b0b) !default;
|
|
25
|
+
$tc-text-muted: var(--#{$tc-prefix}secondary-color, #6f6e69) !default;
|
|
26
|
+
$tc-grid-color: var(--#{$tc-prefix}border-color-translucent, #e1e0d9) !default;
|
|
27
|
+
$tc-baseline-color: var(--#{$tc-prefix}border-color, #c3c2b7) !default;
|
|
28
|
+
$tc-hover-color: rgba(var(--#{$tc-prefix}emphasis-color-rgb, 11, 11, 11), 0.05) !default;
|
|
29
|
+
$tc-tooltip-bg: var(--#{$tc-prefix}body-bg, #fff) !default;
|
|
30
|
+
$tc-tooltip-border: var(--#{$tc-prefix}border-color-translucent, rgb(11 11 11 / 10%)) !default;
|
|
31
|
+
$tc-tooltip-shadow: var(--#{$tc-prefix}box-shadow, 0 4px 16px rgb(11 11 11 / 12%)) !default;
|
|
32
|
+
$tc-tooltip-radius: var(--#{$tc-prefix}border-radius, 6px) !default;
|
|
33
|
+
$tc-font-family: var(--#{$tc-prefix}body-font-family, inherit) !default;
|
|
34
|
+
|
|
35
|
+
// Series 2–8 keep the chart palette, validated for color-vision deficiency
|
|
36
|
+
// next to any blue primary; Bootstrap's own orange / yellow / pink are not.
|
|
37
|
+
$tc-palette-light: (
|
|
38
|
+
2: #eb6834,
|
|
39
|
+
3: #1baf7a,
|
|
40
|
+
4: #eda100,
|
|
41
|
+
5: #e87ba4,
|
|
42
|
+
6: #008300,
|
|
43
|
+
7: #4a3aa7,
|
|
44
|
+
8: #e34948,
|
|
45
|
+
) !default;
|
|
46
|
+
$tc-palette-dark: (
|
|
47
|
+
2: #d95926,
|
|
48
|
+
3: #199e70,
|
|
49
|
+
4: #c98500,
|
|
50
|
+
5: #d55181,
|
|
51
|
+
6: #008300,
|
|
52
|
+
7: #9085e9,
|
|
53
|
+
8: #e66767,
|
|
54
|
+
) !default;
|
|
55
|
+
|
|
56
|
+
// Custom properties are resolved where they are declared, so the mapping is
|
|
57
|
+
// repeated on every element that sets a theme, not only on :root.
|
|
58
|
+
:where(#{$tc-theme-scopes}) {
|
|
59
|
+
--tc-color-1: #{$tc-series-1};
|
|
60
|
+
--tc-focus-color: #{$tc-series-1};
|
|
61
|
+
--tc-surface: #{$tc-surface};
|
|
62
|
+
--tc-text-color: #{$tc-text-color};
|
|
63
|
+
--tc-tooltip-color: #{$tc-text-color};
|
|
64
|
+
--tc-text-muted: #{$tc-text-muted};
|
|
65
|
+
--tc-grid-color: #{$tc-grid-color};
|
|
66
|
+
--tc-baseline-color: #{$tc-baseline-color};
|
|
67
|
+
--tc-hover-color: #{$tc-hover-color};
|
|
68
|
+
--tc-tooltip-bg: #{$tc-tooltip-bg};
|
|
69
|
+
--tc-tooltip-border: #{$tc-tooltip-border};
|
|
70
|
+
--tc-tooltip-shadow: #{$tc-tooltip-shadow};
|
|
71
|
+
--tc-tooltip-radius: #{$tc-tooltip-radius};
|
|
72
|
+
--tc-font-family: #{$tc-font-family};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Bootstrap picks the theme with data-bs-theme, not with the OS setting, so
|
|
76
|
+
// the palette follows the attribute (this also overrides the chart
|
|
77
|
+
// stylesheet's prefers-color-scheme defaults).
|
|
78
|
+
:where(:root, [#{$tc-theme-attribute}="light"]) {
|
|
79
|
+
@each $slot, $color in $tc-palette-light {
|
|
80
|
+
--tc-color-#{$slot}: #{$color};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:where([#{$tc-theme-attribute}="dark"]) {
|
|
85
|
+
@each $slot, $color in $tc-palette-dark {
|
|
86
|
+
--tc-color-#{$slot}: #{$color};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @tabler/charts-bootstrap Tabler preset: the Bootstrap mapping with Tabler's
|
|
2
|
+
// variables. Tabler keeps Bootstrap's color-mode attribute (data-bs-theme)
|
|
3
|
+
// but prefixes its variables with `tblr-`, and sets its theme options
|
|
4
|
+
// (data-bs-theme-primary, -base, -font, -radius) as attributes too.
|
|
5
|
+
//
|
|
6
|
+
// Charts then sit on the card surface (--tblr-bg-surface), use Tabler's
|
|
7
|
+
// muted gray, border colors, radius, shadow and font, and the first series
|
|
8
|
+
// follows the theme's primary color. Load it after `@tabler/charts/style.css`;
|
|
9
|
+
// the plain CSS build is `@tabler/charts-bootstrap/tabler.css`.
|
|
10
|
+
//
|
|
11
|
+
// @use "@tabler/charts-bootstrap/scss/tabler";
|
|
12
|
+
// @use "@tabler/charts-bootstrap/scss/tabler" with ($tc-series-1: var(--tblr-green));
|
|
13
|
+
|
|
14
|
+
@forward "charts" with (
|
|
15
|
+
$tc-prefix: "tblr-" !default,
|
|
16
|
+
$tc-theme-attribute: "data-bs-theme" !default,
|
|
17
|
+
$tc-theme-scopes: ":root, [data-bs-theme], [data-bs-theme-primary], [data-bs-theme-base], [data-bs-theme-font], [data-bs-theme-radius]" !default,
|
|
18
|
+
$tc-series-1: var(--tblr-primary, #066fd1) !default,
|
|
19
|
+
$tc-surface: var(--tblr-bg-surface, #fff) !default,
|
|
20
|
+
$tc-tooltip-bg: var(--tblr-bg-surface, #fff) !default,
|
|
21
|
+
$tc-text-muted: var(--tblr-secondary, #6f6e69) !default
|
|
22
|
+
);
|