c3-components 0.0.43 → 0.0.45

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.
Files changed (42) hide show
  1. package/esm2022/lib/c3-auto-animate/c3-auto-animate.directive.mjs +23 -0
  2. package/esm2022/lib/c3-dialog/c3-dialog.module.mjs +4 -4
  3. package/esm2022/lib/c3-dialog/components/c3-dialog-confirm.component.mjs +3 -3
  4. package/esm2022/lib/c3-dialog/components/c3-dialog-embed-child.component.mjs +12 -8
  5. package/esm2022/lib/c3-dialog/components/c3-dialog-prompt.component.mjs +3 -3
  6. package/esm2022/lib/c3-dialog/services/c3-dialog.service.mjs +4 -4
  7. package/esm2022/lib/c3-dropdown/c3-dropdown.module.mjs +4 -4
  8. package/esm2022/lib/c3-dropdown/components/c3-dropdown.component.mjs +3 -3
  9. package/esm2022/lib/c3-dropdown/directives/c3-dropdown.trigger.mjs +3 -3
  10. package/esm2022/lib/c3-expansion/c3-expansion.module.mjs +6 -6
  11. package/esm2022/lib/c3-expansion/components/c3-expansion/c3-expansion.component.mjs +6 -6
  12. package/esm2022/lib/c3-expansion/components/c3-expansion-header/c3-expansion-header.component.mjs +3 -3
  13. package/esm2022/lib/c3-file-viewer/c3-file-viewer.module.mjs +12 -8
  14. package/esm2022/lib/c3-file-viewer/components/c3-file-viewer-actions/c3-file-viewer-actions.component.mjs +3 -3
  15. package/esm2022/lib/c3-file-viewer/components/c3-file-viewer-image/c3-file-viewer-image.component.mjs +3 -3
  16. package/esm2022/lib/c3-file-viewer/components/c3-file-viewer-pdf/c3-file-viewer-pdf.component.mjs +3 -3
  17. package/esm2022/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.mjs +3 -3
  18. package/esm2022/lib/c3-file-viewer/components/public/c3-file-viewer/c3-file-viewer.component.mjs +3 -3
  19. package/esm2022/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component.mjs +3 -3
  20. package/esm2022/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.mjs +3 -3
  21. package/esm2022/lib/c3-file-viewer/directives/full-screen.directive.mjs +3 -3
  22. package/esm2022/lib/c3-safe-url/pipes/c3-safe-url.pipe.mjs +3 -3
  23. package/esm2022/lib/c3-select-on-focus/c3-select-on-focus.directive.mjs +3 -3
  24. package/esm2022/public-api.mjs +2 -2
  25. package/fesm2022/c3-components.mjs +107 -97
  26. package/fesm2022/c3-components.mjs.map +1 -1
  27. package/lib/c3-dropdown/styles/_c3-dropdown.scss +24 -0
  28. package/lib/c3-expansion/c3-expansion.module.d.ts +1 -1
  29. package/lib/c3-expansion/components/c3-expansion/c3-expansion.component.d.ts +1 -1
  30. package/lib/c3-file-viewer/styles/_c3-file-viewer.scss +112 -0
  31. package/lib/c3-styles/_c3-core.scss +11 -0
  32. package/lib/c3-styles/_c3-root-variables.scss +124 -0
  33. package/lib/c3-styles/_utils.scss +33 -0
  34. package/package.json +1 -1
  35. package/public-api.d.ts +1 -1
  36. package/esm2022/lib/c3-auto-animate/C3AutoAnimate.directive.mjs +0 -23
  37. package/lib/c3-dropdown/styles/_c3-dropdown.sass +0 -22
  38. package/lib/c3-file-viewer/styles/_c3-file-viewer.sass +0 -103
  39. package/lib/c3-styles/_c3-core.sass +0 -10
  40. package/lib/c3-styles/_c3-root-variables.sass +0 -106
  41. package/lib/c3-styles/_utils.sass +0 -26
  42. /package/lib/c3-auto-animate/{C3AutoAnimate.directive.d.ts → c3-auto-animate.directive.d.ts} +0 -0
@@ -0,0 +1,112 @@
1
+ @mixin c3-file-viewer($theme) {
2
+ .container {
3
+ position: relative;
4
+ width: 100%;
5
+ display: flex;
6
+ justify-content: center;
7
+ align-items: center;
8
+ overflow: hidden;
9
+
10
+ .btn-container {
11
+ position: absolute;
12
+ z-index: 98;
13
+ text-align: right;
14
+ bottom: 0;
15
+ right: 0;
16
+ width: 100%;
17
+ }
18
+
19
+ & img {
20
+ max-width: 100%;
21
+ max-height: 100%;
22
+ }
23
+
24
+ & a,
25
+ button {
26
+ z-index: 99;
27
+ position: relative;
28
+
29
+ &:not(:disabled) {
30
+ cursor: pointer;
31
+ }
32
+ }
33
+ }
34
+
35
+ button.default,
36
+ a.default {
37
+ height: 40px;
38
+ width: 40px;
39
+ opacity: 0.7;
40
+ transition: opacity 200ms;
41
+
42
+ &:hover {
43
+ opacity: 1;
44
+ }
45
+
46
+ &:disabled {
47
+ opacity: 0.25;
48
+ }
49
+ }
50
+
51
+ .nav-button-container > button,
52
+ .nav-button-container > a {
53
+ position: relative;
54
+ right: 0;
55
+ margin: 0 10px;
56
+ }
57
+
58
+ .nav-button-container {
59
+ text-align: center;
60
+ position: absolute;
61
+ z-index: 98;
62
+ bottom: 50px;
63
+ left: 0;
64
+ right: 0;
65
+ }
66
+
67
+ .spinner-container {
68
+ position: absolute;
69
+ left: 0;
70
+ right: 0;
71
+ top: 0;
72
+ bottom: 0;
73
+ width: 60px;
74
+ height: 60px;
75
+ margin: auto;
76
+ padding: 10px;
77
+ background-color: rgba(0, 0, 0, 0.4);
78
+ border-radius: 25%;
79
+
80
+ .spinner {
81
+ border-width: 7px;
82
+ border-style: solid;
83
+ border-color: #ccc;
84
+ border-bottom-color: #222;
85
+ border-radius: 50%;
86
+ height: 100%;
87
+ width: 100%;
88
+ box-sizing: border-box;
89
+ animation: rotation 2s linear infinite;
90
+ }
91
+ }
92
+
93
+ @keyframes rotation {
94
+ 0% {
95
+ transform: rotate(0deg);
96
+ }
97
+ 100% {
98
+ transform: rotate(359deg);
99
+ }
100
+ }
101
+
102
+ .c3-file-viewer-pdf {
103
+ height: 100%;
104
+ width: 100%;
105
+ }
106
+
107
+ .c3-file-viewer {
108
+ display: block;
109
+ height: 100%;
110
+ width: 100%;
111
+ }
112
+ }
@@ -0,0 +1,11 @@
1
+ @use "./c3-root-variables" as *;
2
+ @use "../c3-dropdown/styles/_c3-dropdown" as *;
3
+ @use "../c3-file-viewer/styles/_c3-file-viewer" as *;
4
+ @use "../c3-expansion/styles/_c3-expansion" as *;
5
+
6
+ @mixin c3-core($theme) {
7
+ @include c3-root-variables($theme);
8
+ @include c3-material-dropdown($theme);
9
+ @include c3-file-viewer($theme);
10
+ @include c3-expansion($theme);
11
+ }
@@ -0,0 +1,124 @@
1
+ @use "sass:map";
2
+ @use "sass:meta";
3
+ @use "./utils" as utils;
4
+
5
+ @mixin c3-root-variables($theme) {
6
+ :root {
7
+ $primary-palette: map.get($theme, primary);
8
+ $accent-palette: map.get($theme, accent);
9
+ $warn-palette: map.get($theme, warn);
10
+ $background-palette: map.get($theme, background);
11
+ $foreground-palette: map.get($theme, foreground);
12
+
13
+ $is-dark-theme: map.get($theme, is-dark);
14
+
15
+ $primary-color: map.get($primary-palette, 500);
16
+ $primary-color-light: map.get($primary-palette, 300);
17
+ $primary-color-dark: map.get($primary-palette, 700);
18
+
19
+ $accent-color: map.get($accent-palette, 500);
20
+ $accent-color-light: map.get($accent-palette, 300);
21
+ $accent-color-dark: map.get($accent-palette, 700);
22
+
23
+ $warn-color: map.get($warn-palette, 500);
24
+ $warn-color-light: map.get($warn-palette, 300);
25
+ $warn-color-dark: map.get($warn-palette, 700);
26
+
27
+ $background-status-bar: map.get($background-palette, status-bar);
28
+ $background-app-bar: map.get($background-palette, app-bar);
29
+ $background-background: map.get($background-palette, background);
30
+ $background-hover: map.get($background-palette, hover);
31
+ $background-card: map.get($background-palette, card);
32
+ $background-dialog: map.get($background-palette, dialog);
33
+ $background-disabled-button: map.get($background-palette, disabled-button);
34
+ $background-raised-button: map.get($background-palette, raised-button);
35
+ $background-focused-button: map.get($background-palette, focused-button);
36
+ $background-selected-button: map.get($background-palette, selected-button);
37
+ $background-selected-disabled-button: map.get(
38
+ $background-palette,
39
+ selected-disabled-button
40
+ );
41
+ $background-disabled-button-toggle: map.get(
42
+ $background-palette,
43
+ disabled-button-toggle
44
+ );
45
+ $background-unselected-chip: map.get($background-palette, unselected-chip);
46
+ $background-disabled-list-option: map.get(
47
+ $background-palette,
48
+ disabled-list-option
49
+ );
50
+ $background-tooltip: map.get($background-palette, tooltip);
51
+
52
+ $foreground-base: map.get($foreground-palette, base);
53
+ $foreground-divider: map.get($foreground-palette, divider);
54
+ $foreground-dividers: map.get($foreground-palette, dividers);
55
+ $foreground-disabled: map.get($foreground-palette, disabled);
56
+ $foreground-disabled-button: map.get($foreground-palette, disabled-button);
57
+ $foreground-disabled-text: map.get($foreground-palette, disabled-text);
58
+ $foreground-elevation: map.get($foreground-palette, elevation);
59
+ $foreground-hint-text: map.get($foreground-palette, hint-text);
60
+ $foreground-secondary-text: map.get($foreground-palette, secondary-text);
61
+ $foreground-icon: map.get($foreground-palette, icon);
62
+ $foreground-icons: map.get($foreground-palette, icons);
63
+ $foreground-text: map.get($foreground-palette, text);
64
+ $foreground-slider-min: map.get($foreground-palette, slider-min);
65
+ $foreground-slider-off: map.get($foreground-palette, slider-off);
66
+ $foreground-slider-off-active: map.get(
67
+ $foreground-palette,
68
+ slider-off-active
69
+ );
70
+
71
+ --primary-color: #{$primary-color};
72
+ --primary-color-light: #{$primary-color-light};
73
+ --primary-color-dark: #{$primary-color-dark};
74
+
75
+ --accent-color: #{$accent-color};
76
+ --accent-color-light: #{$accent-color-light};
77
+ --accent-color-dark: #{$accent-color-dark};
78
+
79
+ --warn-color: #{$warn-color};
80
+ --warn-color-light: #{$warn-color-light};
81
+ --warn-color-dark: #{$warn-color-dark};
82
+
83
+ --background-status-bar: #{$background-status-bar};
84
+ --background-app-bar: #{$background-app-bar};
85
+ --background-background: #{$background-background};
86
+ --background-hover: #{$background-hover};
87
+ --background-card: #{$background-card};
88
+ --background-dialog: #{$background-dialog};
89
+ --background-disabled-button: #{$background-disabled-button};
90
+ --background-raised-button: #{$background-raised-button};
91
+ --background-focused-button: #{$background-focused-button};
92
+ --background-selected-button: #{$background-selected-button};
93
+ --background-selected-disabled-button: #{$background-selected-disabled-button};
94
+ --background-disabled-button-toggle: #{$background-disabled-button-toggle};
95
+ --background-unselected-chip: #{$background-unselected-chip};
96
+ --background-disabled-list-option: #{$background-disabled-list-option};
97
+ --background-tooltip: #{$background-tooltip};
98
+
99
+ @if $is-dark-theme {
100
+ --background-card-table: #{utils.get-color-from-palette($accent-palette)};
101
+ } @else {
102
+ --background-card-table: #{utils.get-color-from-palette(
103
+ $accent-palette,
104
+ 100
105
+ )};
106
+ }
107
+
108
+ --foreground-base: #{$foreground-base};
109
+ --foreground-divider: #{$foreground-divider};
110
+ --foreground-dividers: #{$foreground-dividers};
111
+ --foreground-disabled: #{$foreground-disabled};
112
+ --foreground-disabled-button: #{$foreground-disabled-button};
113
+ --foreground-disabled-text: #{$foreground-disabled-text};
114
+ --foreground-elevation: #{$foreground-elevation};
115
+ --foreground-hint-text: #{$foreground-hint-text};
116
+ --foreground-secondary-text: #{$foreground-secondary-text};
117
+ --foreground-icon: #{$foreground-icon};
118
+ --foreground-icons: #{$foreground-icons};
119
+ --foreground-text: #{$foreground-text};
120
+ --foreground-slider-min: #{$foreground-slider-min};
121
+ --foreground-slider-off: #{$foreground-slider-off};
122
+ --foreground-slider-off-active: #{$foreground-slider-off-active};
123
+ }
124
+ }
@@ -0,0 +1,33 @@
1
+ @use "sass:map";
2
+ @use "sass:meta";
3
+
4
+ @function get-contrast-color-from-palette($palette, $hue) {
5
+ @return map.get(map.get($palette, contrast), $hue);
6
+ }
7
+
8
+ @function get-color-from-palette($palette, $hue: default, $opacity: null) {
9
+ // If hueKey is a number between zero and one, then it actually contains an
10
+ // opacity value, so recall this function with the default hue and that given opacity.
11
+ @if meta.type-of($hue) == number and $hue >= 0 and $hue <= 1 {
12
+ @return get-color-from-palette($palette, default, $hue);
13
+ }
14
+
15
+ $color: map.get($palette, $hue);
16
+
17
+ @if (meta.type-of($color) != color) {
18
+ // If the $color resolved to something different from a color (e.g. a CSS variable),
19
+ // we can't apply the opacity anyway so we return the value as is, otherwise Sass can
20
+ // throw an error or output something invalid.
21
+ @return $color;
22
+ }
23
+
24
+ @return rgba($color, if($opacity == null, opacity($color), $opacity));
25
+ }
26
+
27
+ @function get-color-config($theme, $default: null) {
28
+ @if map.has-key($theme, color) {
29
+ @return map.get($theme, color);
30
+ }
31
+
32
+ @return $default;
33
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c3-components",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "description": "C3 Components Library",
5
5
  "author": "Kroenen62",
6
6
  "license": "MIT",
package/public-api.d.ts CHANGED
@@ -38,7 +38,7 @@ export * from './lib/c3-expansion/components/c3-expansion-header/c3-expansion-he
38
38
  /**
39
39
  * Auto Animate
40
40
  */
41
- export * from './lib/c3-auto-animate/C3AutoAnimate.directive';
41
+ export * from './lib/c3-auto-animate/c3-auto-animate.directive';
42
42
  /**
43
43
  * Select on Focus
44
44
  */
@@ -1,23 +0,0 @@
1
- import { Directive, Input } from '@angular/core';
2
- import autoAnimate from '@formkit/auto-animate';
3
- import * as i0 from "@angular/core";
4
- export class C3AutoAnimateDirective {
5
- constructor(el) {
6
- this.el = el;
7
- }
8
- ngAfterViewInit() {
9
- autoAnimate(this.el.nativeElement, this.options);
10
- }
11
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: C3AutoAnimateDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
12
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: C3AutoAnimateDirective, isStandalone: true, selector: "[c3AutoAnimate]", inputs: { options: "options" }, ngImport: i0 }); }
13
- }
14
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: C3AutoAnimateDirective, decorators: [{
15
- type: Directive,
16
- args: [{
17
- selector: '[c3AutoAnimate]',
18
- standalone: true,
19
- }]
20
- }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { options: [{
21
- type: Input
22
- }] } });
23
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQzNBdXRvQW5pbWF0ZS5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jMy1jb21wb25lbnRzL3NyYy9saWIvYzMtYXV0by1hbmltYXRlL0MzQXV0b0FuaW1hdGUuZGlyZWN0aXZlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBaUIsU0FBUyxFQUFjLEtBQUssRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUM1RSxPQUFPLFdBR04sTUFBTSx1QkFBdUIsQ0FBQzs7QUFNL0IsTUFBTSxPQUFPLHNCQUFzQjtJQUVqQyxZQUFvQixFQUFjO1FBQWQsT0FBRSxHQUFGLEVBQUUsQ0FBWTtJQUFHLENBQUM7SUFFdEMsZUFBZTtRQUNiLFdBQVcsQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLGFBQWEsRUFBRSxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDbkQsQ0FBQzs4R0FOVSxzQkFBc0I7a0dBQXRCLHNCQUFzQjs7MkZBQXRCLHNCQUFzQjtrQkFKbEMsU0FBUzttQkFBQztvQkFDVCxRQUFRLEVBQUUsaUJBQWlCO29CQUMzQixVQUFVLEVBQUUsSUFBSTtpQkFDakI7K0VBRVUsT0FBTztzQkFBZixLQUFLIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQWZ0ZXJWaWV3SW5pdCwgRGlyZWN0aXZlLCBFbGVtZW50UmVmLCBJbnB1dCB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IGF1dG9BbmltYXRlLCB7XG4gIEF1dG9BbmltYXRlT3B0aW9ucyxcbiAgQXV0b0FuaW1hdGlvblBsdWdpbixcbn0gZnJvbSAnQGZvcm1raXQvYXV0by1hbmltYXRlJztcblxuQERpcmVjdGl2ZSh7XG4gIHNlbGVjdG9yOiAnW2MzQXV0b0FuaW1hdGVdJyxcbiAgc3RhbmRhbG9uZTogdHJ1ZSxcbn0pXG5leHBvcnQgY2xhc3MgQzNBdXRvQW5pbWF0ZURpcmVjdGl2ZSBpbXBsZW1lbnRzIEFmdGVyVmlld0luaXQge1xuICBASW5wdXQoKSBvcHRpb25zPzogUGFydGlhbDxBdXRvQW5pbWF0ZU9wdGlvbnM+IHwgQXV0b0FuaW1hdGlvblBsdWdpbjtcbiAgY29uc3RydWN0b3IocHJpdmF0ZSBlbDogRWxlbWVudFJlZikge31cblxuICBuZ0FmdGVyVmlld0luaXQoKTogdm9pZCB7XG4gICAgYXV0b0FuaW1hdGUodGhpcy5lbC5uYXRpdmVFbGVtZW50LCB0aGlzLm9wdGlvbnMpO1xuICB9XG59XG4iXX0=
@@ -1,22 +0,0 @@
1
- @use '@angular/material' as mat
2
-
3
- =c3-material-dropdown($theme)
4
- $is-dark-theme: mat.get-theme-type($theme) == dark
5
- $primary: mat.get-theme-color($theme, primary)
6
- $accent: mat.get-theme-color($theme, accent)
7
- $warn: mat.get-theme-color($theme, warn)
8
- $bg-card: mat.get-theme-color($theme, background, card)
9
- $color-text: mat.get-theme-color($theme, foreground, text)
10
-
11
- .c3-dropdown-panel
12
- background: $bg-card
13
- color: $color-text
14
- border-radius: 4px
15
- min-width: 112px
16
- overflow: auto
17
- max-height: calc(100vh - 48px)
18
- border-radius: 4px
19
- outline: 0
20
- padding: 4px
21
- @include mat.elevation-transition()
22
- @include mat.elevation(8)
@@ -1,103 +0,0 @@
1
- =c3-file-viewer($theme)
2
- .container
3
- position: relative
4
- width: 100%
5
- display: flex
6
- justify-content: center
7
- align-items: center
8
- overflow: hidden
9
-
10
- .btn-container
11
- position: absolute
12
- z-index: 98
13
- text-align: right
14
- bottom: 0
15
- right: 0
16
- width: 100%
17
-
18
- & img
19
- max-width: 100%
20
- max-height: 100%
21
-
22
- & a,
23
- button
24
- z-index: 99
25
- position: relative
26
-
27
- &:not(:disabled)
28
- cursor: pointer
29
-
30
- button.default,
31
- a.default
32
- height: 40px
33
- width: 40px
34
- opacity: 0.7
35
- transition: opacity 200ms
36
-
37
- button.default:hover,
38
- a.default:hover
39
- opacity: 1
40
-
41
- button.default:disabled,
42
- a.default:disabled
43
- opacity: 0.25
44
-
45
- .nav-button-container > button,
46
- .nav-button-container > a
47
- position: relative
48
- right: 0
49
- margin: 0 10px
50
-
51
- .nav-button-container
52
- text-align: center
53
- position: absolute
54
- z-index: 98
55
- bottom: 50px
56
- left: 0
57
- right: 0
58
-
59
- .spinner-container
60
- position: absolute
61
- left: 0
62
- right: 0
63
- top: 0
64
- bottom: 0
65
- width: 60px
66
- height: 60px
67
- margin: auto
68
- padding: 10px
69
- background-color: rgba(0, 0, 0, 0.4)
70
- border-radius: 25%
71
-
72
- .spinner
73
- border-width: 7px
74
- border-style: solid
75
- border-color: #ccc
76
- border-bottom-color: #222
77
- border-radius: 50%
78
- height: 100%
79
- width: 100%
80
- box-sizing: border-box
81
- -webkit-animation: rotation 2s linear infinite
82
- /* Safari 4+ */
83
- -moz-animation: rotation 2s linear infinite
84
- /* Fx 5+ */
85
- -o-animation: rotation 2s linear infinite
86
- /* Opera 12+ */
87
- animation: rotation 2s linear infinite
88
- /* IE 10+, Fx 29+ */
89
-
90
- @keyframes rotation
91
- 0%
92
- -transform: rotate(0deg)
93
- 100%
94
- -transform: rotate(359deg)
95
-
96
- .c3-file-viewer-pdf
97
- height: 100%
98
- width: 100%
99
-
100
- .c3-file-viewer
101
- display: block
102
- height: 100%
103
- width: 100%
@@ -1,10 +0,0 @@
1
- @use "./c3-root-variables" as *
2
- @use "../c3-dropdown/styles/_c3-dropdown" as *
3
- @use "../c3-file-viewer/styles/_c3-file-viewer" as *
4
- @use "../c3-expansion/styles/_c3-expansion" as *
5
-
6
- =c3-core($theme)
7
- @include c3-root-variables($theme)
8
- @include c3-material-dropdown($theme)
9
- @include c3-file-viewer($theme)
10
- @include c3-expansion($theme)
@@ -1,106 +0,0 @@
1
- @use "sass:map"
2
- @use "sass:meta"
3
- @use "./utils" as utils
4
-
5
- =c3-root-variables($theme)
6
- :root
7
- $primary-palette: map.get($theme, primary)
8
- $accent-palette: map.get($theme, accent)
9
- $warn-palette: map.get($theme, warn)
10
- $background-palette: map.get($theme, background)
11
- $foreground-palette: map.get($theme, foreground)
12
-
13
- $is-dark-theme: map.get($theme, is-dark)
14
-
15
- $primary-color: map.get($primary-palette, 500)
16
- $primary-color-light: map.get($primary-palette, 300)
17
- $primary-color-dark: map.get($primary-palette, 700)
18
-
19
- $accent-color: map.get($accent-palette, 500)
20
- $accent-color-light: map.get($accent-palette, 300)
21
- $accent-color-dark: map.get($accent-palette, 700)
22
-
23
- $warn-color: map.get($warn-palette, 500)
24
- $warn-color-light: map.get($warn-palette, 300)
25
- $warn-color-dark: map.get($warn-palette, 700)
26
-
27
- $background-status-bar: map.get($background-palette, status-bar)
28
- $background-app-bar: map.get($background-palette, app-bar)
29
- $background-background: map.get($background-palette, background)
30
- $background-hover: map.get($background-palette, hover)
31
- $background-card: map.get($background-palette, card)
32
- $background-dialog: map.get($background-palette, dialog)
33
- $background-disabled-button: map.get($background-palette, disabled-button)
34
- $background-raised-button: map.get($background-palette, raised-button)
35
- $background-focused-button: map.get($background-palette, focused-button)
36
- $background-selected-button: map.get($background-palette, selected-button)
37
- $background-selected-disabled-button: map.get($background-palette, selected-disabled-button)
38
- $background-disabled-button-toggle: map.get($background-palette, disabled-button-toggle)
39
- $background-unselected-chip: map.get($background-palette, unselected-chip)
40
- $background-disabled-list-option: map.get($background-palette, disabled-list-option)
41
- $background-tooltip: map.get($background-palette, tooltip)
42
-
43
- $foreground-base: map.get($foreground-palette, base)
44
- $foreground-divider: map.get($foreground-palette, divider)
45
- $foreground-dividers: map.get($foreground-palette, dividers)
46
- $foreground-disabled: map.get($foreground-palette, disabled)
47
- $foreground-disabled-button: map.get($foreground-palette, disabled-button)
48
- $foreground-disabled-text: map.get($foreground-palette, disabled-text)
49
- $foreground-elevation: map.get($foreground-palette, elevation)
50
- $foreground-hint-text: map.get($foreground-palette, hint-text)
51
- $foreground-secondary-text: map.get($foreground-palette, secondary-text)
52
- $foreground-icon: map.get($foreground-palette, icon)
53
- $foreground-icons: map.get($foreground-palette, icons)
54
- $foreground-text: map.get($foreground-palette, text)
55
- $foreground-slider-min: map.get($foreground-palette, slider-min)
56
- $foreground-slider-off: map.get($foreground-palette, slider-off)
57
- $foreground-slider-off-active: map.get($foreground-palette, slider-off-active)
58
-
59
- --primary-color: #{$primary-color}
60
- --primary-color-light: #{$primary-color-light}
61
- --primary-color-dark: #{$primary-color-dark}
62
-
63
- --accent-color: #{$accent-color}
64
- --accent-color-light: #{$accent-color-light}
65
- --accent-color-dark: #{$accent-color-dark}
66
-
67
- --warn-color: #{$warn-color}
68
- --warn-color-light: #{$warn-color-light}
69
- --warn-color-dark: #{$warn-color-dark}
70
-
71
- --background-status-bar: #{$background-status-bar}
72
- --background-app-bar: #{$background-app-bar}
73
- --background-background: #{$background-background}
74
- --background-hover: #{$background-hover}
75
- --background-card: #{$background-card}
76
- --background-dialog: #{$background-dialog}
77
- --background-disabled-button: #{$background-disabled-button}
78
- --background-raised-button: #{$background-raised-button}
79
- --background-focused-button: #{$background-focused-button}
80
- --background-selected-button: #{$background-selected-button}
81
- --background-selected-disabled-button: #{$background-selected-disabled-button}
82
- --background-disabled-button-toggle: #{$background-disabled-button-toggle}
83
- --background-unselected-chip: #{$background-unselected-chip}
84
- --background-disabled-list-option: #{$background-disabled-list-option}
85
- --background-tooltip: #{$background-tooltip}
86
-
87
- @if $is-dark-theme
88
- --background-card-table: #{utils.get-color-from-palette($accent-palette)}
89
- @else
90
- --background-card-table: #{utils.get-color-from-palette($accent-palette, 100)}
91
-
92
- --foreground-base: #{$foreground-base}
93
- --foreground-divider: #{$foreground-divider}
94
- --foreground-dividers: #{$foreground-dividers}
95
- --foreground-disabled: #{$foreground-disabled}
96
- --foreground-disabled-button: #{$foreground-disabled-button}
97
- --foreground-disabled-text: #{$foreground-disabled-text}
98
- --foreground-elevation: #{$foreground-elevation}
99
- --foreground-hint-text: #{$foreground-hint-text}
100
- --foreground-secondary-text: #{$foreground-secondary-text}
101
- --foreground-icon: #{$foreground-icon}
102
- --foreground-icons: #{$foreground-icons}
103
- --foreground-text: #{$foreground-text}
104
- --foreground-slider-min: #{$foreground-slider-min}
105
- --foreground-slider-off: #{$foreground-slider-off}
106
- --foreground-slider-off-active: #{$foreground-slider-off-active}
@@ -1,26 +0,0 @@
1
- @use "sass:map"
2
- @use "sass:meta"
3
- @function get-contrast-color-from-palette($palette, $hue)
4
- @return map.get(map.get($palette, contrast), $hue)
5
-
6
- @function get-color-from-palette($palette, $hue: default, $opacity: null)
7
- // If hueKey is a number between zero and one, then it actually contains an
8
- // opacity value, so recall this function with the default hue and that given opacity.
9
- @if meta.type-of($hue) ==number and $hue>=0 and $hue <=1
10
- @return get-color-from-palette($palette, default, $hue)
11
-
12
- $color: map.get($palette, $hue)
13
-
14
- @if (meta.type-of($color) !=color)
15
- // If the $color resolved to something different from a color (e.g. a CSS variable),
16
- // we can't apply the opacity anyway so we return the value as is, otherwise Sass can
17
- // throw an error or output something invalid.
18
- @return $color
19
-
20
- @return rgba($color, if($opacity==null, opacity($color), $opacity))
21
-
22
- @function get-color-config($theme, $default: null)
23
- @if map.has-key($theme, color)
24
- @return map.get($theme, color)
25
-
26
- @return $default