@acontplus/ng-components 2.1.29 → 2.1.31

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 (54) hide show
  1. package/fesm2022/acontplus-ng-components.mjs +5713 -3552
  2. package/fesm2022/acontplus-ng-components.mjs.map +1 -1
  3. package/package.json +21 -20
  4. package/src/_index.scss +22 -0
  5. package/src/core/color/_all-color.scss +16 -0
  6. package/src/core/density/_all-density.scss +38 -0
  7. package/src/core/style/_elevation.scss +207 -0
  8. package/src/core/theming/_all-theme.scss +50 -0
  9. package/src/core/theming/_config-validation.scss +171 -0
  10. package/src/core/theming/_definition.scss +158 -0
  11. package/src/core/theming/_palettes.scss +1060 -0
  12. package/src/core/tokens/_m3-tokens.scss +141 -0
  13. package/src/core/tokens/_m3-utils.scss +36 -0
  14. package/src/core/tokens/_system.scss +395 -0
  15. package/src/core/tokens/_token-utils.scss +117 -0
  16. package/src/core/tokens/m3/_index.scss +7 -0
  17. package/src/core/tokens/m3/_md-sys-color.scss +150 -0
  18. package/src/core/tokens/m3/_md-sys-elevation.scss +8 -0
  19. package/src/core/tokens/m3/_md-sys-motion.scss +35 -0
  20. package/src/core/tokens/m3/_md-sys-shape.scss +31 -0
  21. package/src/core/tokens/m3/_md-sys-state.scss +13 -0
  22. package/src/core/tokens/m3/_md-sys-typescale.scss +131 -0
  23. package/src/core/tokens/m3/_theme.scss +41 -0
  24. package/src/core/typography/_all-typography.scss +34 -0
  25. package/src/lib/components/alert/_alert-theme.scss +57 -0
  26. package/src/lib/components/alert/_m3-alert.scss +72 -0
  27. package/src/lib/components/alert/alert.scss +60 -0
  28. package/src/lib/components/autocomplete-wrapper/autocomplete-wrapper.scss +667 -0
  29. package/src/lib/components/button/button.scss +297 -0
  30. package/src/lib/components/cards/dynamic-card/dynamic-card.scss +131 -0
  31. package/src/lib/components/data-grid/_grid-theme.scss +53 -0
  32. package/src/lib/components/data-grid/_m3-grid.scss +34 -0
  33. package/src/lib/components/data-grid/cell/cell.scss +38 -0
  34. package/src/lib/components/data-grid/column-menu/column-menu.scss +117 -0
  35. package/src/lib/components/data-grid/column-resize/_column-resize.scss +126 -0
  36. package/src/lib/components/data-grid/grid.scss +245 -0
  37. package/src/lib/components/date-range-input/calendar/date-range-calendar.scss +29 -0
  38. package/src/lib/components/date-range-input/date-range-input.scss +194 -0
  39. package/src/lib/components/dialog-wrapper/dialog-wrapper.scss +36 -0
  40. package/src/lib/components/drawer/_drawer-theme.scss +57 -0
  41. package/src/lib/components/drawer/_m3-drawer.scss +24 -0
  42. package/src/lib/components/drawer/drawer-container.scss +97 -0
  43. package/src/lib/components/icons/svg-icon/svg-icon.scss +16 -0
  44. package/src/lib/components/icons/user-icon/user-icon.scss +0 -0
  45. package/src/lib/components/input-chip/input-chip.scss +0 -0
  46. package/src/lib/components/popover/_m3-popover.scss +24 -0
  47. package/src/lib/components/popover/_popover-theme.scss +57 -0
  48. package/src/lib/components/popover/popover.scss +239 -0
  49. package/src/lib/components/spinner/spinner.scss +6 -0
  50. package/src/lib/components/tables/tabulator-table/tabulator-table.scss +68 -0
  51. package/src/lib/components/theme-toggle/theme-toggle.scss +3 -0
  52. package/src/lib/styles/_elevation.scss +168 -0
  53. package/src/lib/styles/_token-utils.scss +115 -0
  54. package/types/acontplus-ng-components.d.ts +920 -536
@@ -0,0 +1,115 @@
1
+ @use 'sass:list';
2
+ @use 'sass:map';
3
+ @use 'sass:string';
4
+ @use '@angular/material' as mat;
5
+
6
+ // Creates a CSS variable, including the fallback if provided.
7
+ @function _create-var($name, $fallback: null) {
8
+ @if ($fallback) {
9
+ @return var($name, $fallback);
10
+ } @else {
11
+ @return var($name);
12
+ }
13
+ }
14
+
15
+ // Returns a list of overrides for the given M3 get-tokens mixin and prefix. Each token has its
16
+ // prefix removed since the overrides API expects its absence. The returned map includes "all" for
17
+ // all override tokens, and also the subsets with keys base, color, typography, and density.
18
+ @function get-overrides($tokens, $prefix) {
19
+ $base: remove-token-prefixes(map.get($tokens, base), $prefix);
20
+ $color: remove-token-prefixes(map.get($tokens, color), $prefix);
21
+ $typography: remove-token-prefixes(map.get($tokens, typography), $prefix);
22
+ $density: remove-token-prefixes(map.get($tokens, density), $prefix);
23
+ $all: ();
24
+ @each $map in ($base, $color, $typography, $density) {
25
+ $all: map.merge($all, $map);
26
+ }
27
+
28
+ @return (all: $all, base: $base, color: $color, typography: $typography, density: $density);
29
+ }
30
+
31
+ // Removes a prefix from each component token in the provided map of prefixed tokens.
32
+ @function remove-token-prefixes($prefixed-tokens: (), $prefix) {
33
+ $tokens: ();
34
+ @each $prefixed-token, $value in $prefixed-tokens {
35
+ $token: string.slice($prefixed-token, string.length($prefix) + 2);
36
+ $tokens: map.set($tokens, $token, $value);
37
+ }
38
+ @return $tokens;
39
+ }
40
+
41
+ // Returns the token slot value.
42
+ // Accepts an optional fallback parameter to include in the CSS variable.
43
+ // If $fallback is `true`, then use the tokens map to get the fallback.
44
+ @function slot($token, $fallbacks, $fallback: null) {
45
+ // Fallbacks are a map of base, color, typography, and density tokens. To simplify
46
+ // lookup, flatten these token groups into a single map.
47
+ $fallbacks-flattened: ();
48
+ @each $tokens in map.values($fallbacks) {
49
+ @each $token, $value in $tokens {
50
+ $fallbacks-flattened: map.set($fallbacks-flattened, $token, $value);
51
+ }
52
+ }
53
+ @if not map.has-key($fallbacks-flattened, $token) {
54
+ @error 'Token #{$token} does not exist. Configured tokens are:' +
55
+ #{map.keys($fallbacks-flattened)};
56
+ }
57
+
58
+ $sys-fallback: map.get($fallbacks-flattened, $token);
59
+ @if (mat.private-is-css-var-name($sys-fallback)) {
60
+ $sys-fallback: _create-var($sys-fallback, $fallback);
61
+ }
62
+
63
+ @return _create-var(--acp-#{$token}, $sys-fallback);
64
+ }
65
+
66
+ // Outputs a map of token values as CSS variable definitions.
67
+ @mixin values($tokens) {
68
+ @include mat.private-current-selector-or-root() {
69
+ @each $key, $value in $tokens {
70
+ @if $value != null {
71
+ --acp-#{$key}: #{$value};
72
+ }
73
+ }
74
+ }
75
+ }
76
+
77
+ /// Emits new token values for the given token overrides.
78
+ /// Verifies that the overrides passed in are valid tokens.
79
+ /// New token values are emitted under the current selector or root.
80
+ @mixin batch-create-token-values($overrides: (), $namespace-configs) {
81
+ @include mat.private-current-selector-or-root() {
82
+ $prefixed-name-data: ();
83
+ $all-names: ();
84
+
85
+ @each $config in $namespace-configs {
86
+ $namespace: map.get($config, namespace);
87
+ $prefix: '';
88
+ @if map.has-key($config, prefix) {
89
+ $prefix: map.get($config, prefix);
90
+ }
91
+ $tokens: map.get(map.get($config, tokens), all);
92
+ @each $name, $value in $tokens {
93
+ $prefixed-name: $prefix + $name;
94
+ $all-names: list.append($all-names, $prefixed-name, $separator: comma);
95
+ $prefixed-name-data: map.set($prefixed-name-data, $prefixed-name, ($namespace, $name));
96
+ }
97
+ }
98
+
99
+ @each $name, $value in $overrides {
100
+ @if map.has-key($prefixed-name-data, $name) {
101
+ $data: map.get($prefixed-name-data, $name);
102
+ $namespace: list.nth($data, 1);
103
+ $name: list.nth($data, 2);
104
+ $prefixed-name: $namespace + '-' + $name;
105
+ @include values(
106
+ (
107
+ $prefixed-name: $value,
108
+ )
109
+ );
110
+ } @else {
111
+ @error #{'Invalid token name `'}#{$name}#{'`. '}#{'Valid tokens are: '}#{$all-names};
112
+ }
113
+ }
114
+ }
115
+ }