zmp-cli 3.2.1 → 3.2.2

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.
@@ -19,9 +19,19 @@ module.exports = (options) => {
19
19
  /* Custom color theme properties */
20
20
  :root {
21
21
  ${Object.keys(customProps)
22
+ .filter(
23
+ (prop) =>
24
+ prop !== '--zmp-tabbar-fill-link-active-color' &&
25
+ prop !== '--zmp-tabbar-fill-link-active-border-color'
26
+ )
22
27
  .map((prop) => `${prop}: ${customProps[prop]};`)
23
28
  .join('\n ')}
24
29
  }
30
+ :root.theme-dark,:root .theme-dark {
31
+ ${Object.keys(customProps)
32
+ .map((prop) => `${prop}: ${customProps[prop]};`)
33
+ .join('\n ')}
34
+ }
25
35
  `
26
36
  );
27
37
  }
@@ -30,51 +40,6 @@ module.exports = (options) => {
30
40
  0,
31
41
  `
32
42
  /* Invert navigation bars to fill style */
33
- :root,
34
- :root.theme-dark,
35
- :root .theme-dark {
36
- --zmp-bars-bg-color: var(--zmp-theme-color);
37
- --zmp-bars-bg-color-rgb: var(--zmp-theme-color-rgb);
38
- --zmp-bars-translucent-opacity: 0.9;
39
- --zmp-bars-text-color: #fff;
40
- --zmp-bars-link-color: #fff;
41
- --zmp-navbar-subtitle-text-color: rgba(255,255,255,0.85);
42
- --zmp-bars-border-color: transparent;
43
- --zmp-tabbar-link-active-color: #fff;
44
- --zmp-tabbar-link-inactive-color: rgba(255,255,255,0.54);
45
- --zmp-sheet-border-color: transparent;
46
- --zmp-tabbar-link-active-border-color: #fff;
47
- }
48
- .appbar,
49
- .navbar,
50
- .toolbar,
51
- .subnavbar,
52
- .calendar-header,
53
- .calendar-footer {
54
- --zmp-touch-ripple-color: var(--zmp-touch-ripple-white);
55
- --zmp-link-highlight-color: var(--zmp-link-highlight-white);
56
- --zmp-link-touch-ripple-color: var(--zmp-touch-ripple-white);
57
- --zmp-button-text-color: #fff;
58
- --zmp-button-pressed-bg-color: rgba(255,255,255,0.1);
59
- }
60
- .navbar-large-transparent,
61
- .navbar-large.navbar-transparent {
62
- --zmp-navbar-large-title-text-color: #000;
63
-
64
- --r: ${themeRgb[0]};
65
- --g: ${themeRgb[1]};
66
- --b: ${themeRgb[2]};
67
- --progress: var(--zmp-navbar-large-collapse-progress);
68
- --zmp-bars-link-color: rgb(
69
- calc(var(--r) + (255 - var(--r)) * var(--progress)),
70
- calc(var(--g) + (255 - var(--g)) * var(--progress)),
71
- calc(var(--b) + (255 - var(--b)) * var(--progress))
72
- );
73
- }
74
- .theme-dark .navbar-large-transparent,
75
- .theme-dark .navbar-large.navbar-transparent {
76
- --zmp-navbar-large-title-text-color: #fff;
77
- }
78
43
  `
79
44
  );
80
45
  }
@@ -1,7 +1,8 @@
1
1
  const indent = require('../../utils/indent');
2
2
 
3
3
  module.exports = (options) => {
4
- const { name, template } = options;
4
+ const { name, template, theming } = options;
5
+ const { fillBars } = theming;
5
6
 
6
7
  let description = '';
7
8
  if (template === 'single-view' || template === 'blank') {
@@ -60,7 +61,7 @@ module.exports = (options) => {
60
61
  return (
61
62
  <Page name="home" navbarLarge>
62
63
  {/* Top Navbar */}
63
- <Navbar transparent>
64
+ <Navbar ${fillBars ? 'fill' : ''}>
64
65
  <NavTitleLarge>${name}</NavTitleLarge>
65
66
  </Navbar>
66
67
  {/* Page content */}
@@ -1,15 +1,18 @@
1
1
  function colorHexToRgb(hex) {
2
- const h = hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (m, r, g, b) => r + r + g + g + b + b);
2
+ const h = hex.replace(
3
+ /^#?([a-f\d])([a-f\d])([a-f\d])$/i,
4
+ (m, r, g, b) => r + r + g + g + b + b
5
+ );
3
6
  const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(h);
4
- return result
5
- ? result.slice(1).map((n) => parseInt(n, 16))
6
- : null;
7
+ return result ? result.slice(1).map((n) => parseInt(n, 16)) : null;
7
8
  }
8
9
  function colorRgbToHex(r, g, b) {
9
- const result = [r, g, b].map((n) => {
10
- const hex = n.toString(16);
11
- return hex.length === 1 ? `0${hex}` : hex;
12
- }).join('');
10
+ const result = [r, g, b]
11
+ .map((n) => {
12
+ const hex = n.toString(16);
13
+ return hex.length === 1 ? `0${hex}` : hex;
14
+ })
15
+ .join('');
13
16
  return `#${result}`;
14
17
  }
15
18
  function colorRgbToHsl(r, g, b) {
@@ -41,7 +44,7 @@ function colorHslToRgb(h, s, l) {
41
44
  else if (hp <= 4) rgb1 = [0, x, c];
42
45
  else if (hp <= 5) rgb1 = [x, 0, c];
43
46
  else if (hp <= 6) rgb1 = [c, 0, x];
44
- const m = l - (c / 2);
47
+ const m = l - c / 2;
45
48
  return rgb1.map((n) => Math.max(0, Math.min(255, Math.round(255 * (n + m)))));
46
49
  }
47
50
  function colorThemeCSSProperties(...args) {
@@ -56,15 +59,29 @@ function colorThemeCSSProperties(...args) {
56
59
  }
57
60
  if (!rgb) return {};
58
61
  const hsl = colorRgbToHsl(...rgb);
59
- const hslShade = [hsl[0], hsl[1], Math.max(0, (hsl[2] - 0.08))];
60
- const hslTint = [hsl[0], hsl[1], Math.max(0, (hsl[2] + 0.08))];
62
+ const hslShade = [hsl[0], hsl[1], Math.max(0, hsl[2] - 0.08)];
63
+ const hslTint = [hsl[0], hsl[1], Math.max(0, hsl[2] + 0.08)];
61
64
  const shade = colorRgbToHex(...colorHslToRgb(...hslShade));
62
65
  const tint = colorRgbToHex(...colorHslToRgb(...hslTint));
66
+ const hslSecondaryColor = [hsl[0], hsl[1], Math.max(0, hsl[2] + 0.6)];
67
+ const secondaryColor = colorRgbToHex(...colorHslToRgb(...hslSecondaryColor));
63
68
  return {
64
69
  '--zmp-theme-color': hex,
65
70
  '--zmp-theme-color-rgb': rgb.join(', '),
66
71
  '--zmp-theme-color-shade': shade,
67
72
  '--zmp-theme-color-tint': tint,
73
+ '--zmp-checkbox-active-color-disabled': 'var(--zmp-theme-color-shade)',
74
+ '--zmp-radio-active-color-disabled': 'var(--zmp-theme-color-shade)',
75
+ '--zmp-toggle-active-color-disabled': 'var(--zmp-theme-color-shade)',
76
+ '--zmp-picker-action-button-hover-bg-color': 'var(--zmp-theme-color-shade)',
77
+ '--zmp-button-pressed-bg-color-primary': 'var(--zmp-theme-color-shade)',
78
+ ' --zmp-button-bg-color-secondary': secondaryColor,
79
+ '--zmp-button-pressed-bg-color-secondary': secondaryColor,
80
+ '--zmp-button-pressed-color-secondary': 'var(--zmp-theme-color)',
81
+ '--zmp-button-border-color-secondary': 'var(--zmp-theme-color)',
82
+ '--zmp-tabbar-fill-link-active-color': 'var(--zmp-theme-color)',
83
+ '--zmp-tabbar-fill-link-active-border-color': 'var(--zmp-theme-color)',
84
+ '--zmp-fab-pressed-bg-color': 'var(--zmp-theme-color-shade)',
68
85
  };
69
86
  }
70
87
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmp-cli",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "ZMP command line utility (CLI)",
5
5
  "main": "index.js",
6
6
  "bin": {