@dialpad/dialtone 6.36.0 → 6.37.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.
@@ -0,0 +1,101 @@
1
+ #!/usr/bin/env node
2
+
3
+ /* Will search the files in the provided directory for any properties that are not set to dialtone values.
4
+ It does this by simply checking whether the property is set to a less @variable or CSS var such as var(--val).
5
+ It does not compare to an actual list of dialtone token values so it is not perfect, and sometimes gives false
6
+ positives. This will however give a pretty good idea of where dialtone values aren't being used that should.
7
+
8
+ Searches some key properties by default as shown in the defaultSearch array below. You are however not limited to
9
+ this, you can make this application search any css property you wish. See the below options or run this application
10
+ with the -h switch for more details. */
11
+
12
+ const path = require('path');
13
+ const fs = require('fs');
14
+ const { docopt } = require('docopt');
15
+ const { exit } = require('process');
16
+
17
+ const doc = `
18
+ Usage:
19
+ ./dialtone_health_check <path> [options]
20
+
21
+ Options:
22
+ <path> The directory to recursively search all files in.
23
+ -h --help Show this screen.
24
+ -p --property=<property> CSS Property to search. Default properties if this is not set:
25
+ color,background-color,border-color,font-family
26
+ --ext=<ext> Filter by file extension. comma separate to filter multiple. ex: js,vue
27
+ --no-line-numbers Only output files and their total count, do not output individual instances and their line
28
+ number.
29
+ `;
30
+
31
+ const options = docopt(doc);
32
+
33
+ const defaultSearch = [
34
+ 'color',
35
+ 'background-color',
36
+ 'border-color',
37
+ 'font-family',
38
+ ];
39
+
40
+ const extensionFilters = options['--ext']?.split(',') ?? [''];
41
+ let properties = options['--property']?.split(',');
42
+ if (!properties) properties = defaultSearch;
43
+
44
+ function fromDir (startPath, fileExtension) {
45
+ if (!fs.existsSync(startPath)) {
46
+ console.error('Directory not found');
47
+ exit(1);
48
+ }
49
+
50
+ const results = [];
51
+ const files = fs.readdirSync(startPath);
52
+ for (let i = 0; i < files.length; i++) {
53
+ const filename = path.join(startPath, files[i]);
54
+ const stat = fs.lstatSync(filename);
55
+ if (stat.isDirectory()) {
56
+ results.push(...fromDir(filename, fileExtension)); // recurse
57
+ } else if (filename.endsWith(fileExtension)) {
58
+ results.push(filename);
59
+ }
60
+ }
61
+ return results;
62
+ }
63
+ const files = [];
64
+ extensionFilters.forEach(extension => {
65
+ files.push(...fromDir(options['<path>'], extension));
66
+ });
67
+ if (files.length <= 0) { console.error('No files found in directory'); exit(1); }
68
+
69
+ const regex = properties.map(property => {
70
+ return new RegExp(`^\\s*${property}:\\s(?:(?!var\\(--))(?:(?!@)).*`, 'gm');
71
+ });
72
+
73
+ let totalCount = 0;
74
+
75
+ try {
76
+ for (const file of files) {
77
+ const data = fs.readFileSync(file, 'utf8');
78
+ const lines = data.split('\n');
79
+ let match;
80
+ let matchCount = 0;
81
+ for (const [lineNumber, line] of lines.entries()) {
82
+ regex.forEach(re => {
83
+ // eslint-disable-next-line no-cond-assign
84
+ while (match = re.exec(line)) {
85
+ if (!options['--no-line-numbers']) {
86
+ console.log(`\tnon-dialtone property found on line ${lineNumber}: ${match}`);
87
+ }
88
+ matchCount++;
89
+ totalCount++;
90
+ }
91
+ });
92
+ }
93
+ if (matchCount > 0) {
94
+ console.log(`${file}: ${matchCount}`);
95
+ }
96
+ }
97
+ console.log(`Found ${totalCount} total ${properties.join(', ')} \
98
+ CSS properties that are not dialtone in this directory.`);
99
+ } catch (err) {
100
+ console.error(err);
101
+ }
@@ -22,13 +22,7 @@
22
22
  .d-card {
23
23
  display: flex;
24
24
  flex-direction: column;
25
- align-items: flex-start;
26
- justify-content: flex-start;
27
- // Component CSS Vars
28
- // ------------------------------------------------------------------------
29
- width: 100%;
30
- max-width: var(--size264);
31
- max-height: 100%;
25
+ justify-content: center;
32
26
  background: var(--white);
33
27
  border-radius: var(--su4);
34
28
  box-shadow: var(--bs-card);
@@ -45,17 +39,12 @@
45
39
  flex-direction: row;
46
40
  align-items: center;
47
41
  justify-content: space-between;
48
- width: 100%;
49
42
  padding: var(--su8) var(--su8) 0 var(--su16);
50
- color: var(--black-400);
51
- font-weight: var(--fw-semibold);
52
- font-size: var(--fs16);
53
43
  }
54
44
 
55
45
  // $$ CONTENT
56
46
  // ----------------------------------------------------------------------------
57
47
  .d-card__content {
58
- max-width: 100%;
59
48
  padding: var(--su16);
60
49
  overflow-y: auto;
61
50
  }
@@ -64,7 +53,6 @@
64
53
  // ----------------------------------------------------------------------------
65
54
  .d-card__footer {
66
55
  display: flex;
67
- flex-direction: row-reverse;
68
56
  align-items: center;
69
57
  padding: var(--su8);
70
58
  }
@@ -34,6 +34,7 @@
34
34
 
35
35
 
36
36
  @theme-vars: {
37
+
37
38
  primary-color-h: var(--purple-500-h);
38
39
  primary-color-s: var(--purple-500-s);
39
40
  primary-color-l: var(--purple-500-l);
@@ -41,6 +42,11 @@
41
42
  primary-color: hsl(var(--primary-color-h) var(--primary-color-s) var(--primary-color-l));
42
43
  primary-color-hover: hsl(var(--primary-color-h) var(--primary-color-s) calc(var(--primary-color-l) - 10%));
43
44
 
45
+ nav-background-color-h: var(--purple-800-h);
46
+ nav-background-color-s: var(--purple-800-s);
47
+ nav-background-color-l: var(--purple-800-l);
48
+ nav-background-color: hsl(var(--nav-background-color-h) var(--nav-background-color-s) var(--nav-background-color-l));
49
+
44
50
  topbar-height: var(--su64);
45
51
 
46
52
  base--font-size: var(--fs16);
@@ -94,6 +100,7 @@
94
100
  .d-theme-presence-busy { background-color: var(--theme-presence-color-background-busy) !important; }
95
101
  .d-theme-mention { background-color: var(--theme-mention-color-background) !important; }
96
102
 
103
+
97
104
  // ============================================================================
98
105
  // $ OUTPUT VARIABLES
99
106
  // ============================================================================
@@ -1060,11 +1060,7 @@ body {
1060
1060
  .d-card {
1061
1061
  display: flex;
1062
1062
  flex-direction: column;
1063
- align-items: flex-start;
1064
- justify-content: flex-start;
1065
- width: 100%;
1066
- max-width: var(--size264);
1067
- max-height: 100%;
1063
+ justify-content: center;
1068
1064
  background: var(--white);
1069
1065
  border-radius: var(--su4);
1070
1066
  box-shadow: var(--bs-card);
@@ -1074,20 +1070,14 @@ body {
1074
1070
  flex-direction: row;
1075
1071
  align-items: center;
1076
1072
  justify-content: space-between;
1077
- width: 100%;
1078
1073
  padding: var(--su8) var(--su8) 0 var(--su16);
1079
- color: var(--black-400);
1080
- font-weight: var(--fw-semibold);
1081
- font-size: var(--fs16);
1082
1074
  }
1083
1075
  .d-card__content {
1084
- max-width: 100%;
1085
1076
  padding: var(--su16);
1086
1077
  overflow-y: auto;
1087
1078
  }
1088
1079
  .d-card__footer {
1089
1080
  display: flex;
1090
- flex-direction: row-reverse;
1091
1081
  align-items: center;
1092
1082
  padding: var(--su8);
1093
1083
  }
@@ -20509,6 +20499,10 @@ body {
20509
20499
  --primary-color-hsl: var(--primary-color-h) var(--primary-color-s) var(--primary-color-l);
20510
20500
  --primary-color: hsl(var(--primary-color-h) var(--primary-color-s) var(--primary-color-l));
20511
20501
  --primary-color-hover: hsl(var(--primary-color-h) var(--primary-color-s) calc(var(--primary-color-l) - 10%));
20502
+ --nav-background-color-h: var(--purple-800-h);
20503
+ --nav-background-color-s: var(--purple-800-s);
20504
+ --nav-background-color-l: var(--purple-800-l);
20505
+ --nav-background-color: hsl(var(--nav-background-color-h) var(--nav-background-color-s) var(--nav-background-color-l));
20512
20506
  --topbar-height: var(--su64);
20513
20507
  --base--font-size: var(--fs16);
20514
20508
  --base--font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';