@dialpad/dialtone-css 1.0.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/CHANGELOG.json +1 -0
- package/LICENSE.md +21 -0
- package/README.md +64 -0
- package/lib/build/favicons/dialpad/favicon-beta-notification__512.png +0 -0
- package/lib/build/favicons/dialpad/favicon-beta__512.png +0 -0
- package/lib/build/favicons/dialpad/favicon-csr__512.png +0 -0
- package/lib/build/favicons/dialpad/favicon-notification__512.png +0 -0
- package/lib/build/favicons/dialpad/favicon-staging-notification__512.png +0 -0
- package/lib/build/favicons/dialpad/favicon-staging__512.png +0 -0
- package/lib/build/favicons/dialpad/favicon__512.png +0 -0
- package/lib/build/favicons/favicon-dialtone__512.png +0 -0
- package/lib/build/favicons/uberconference/favicon-uberconference__512.png +0 -0
- package/lib/build/fonts/Archivo-Bold.woff2 +0 -0
- package/lib/build/fonts/Archivo-Regular.woff2 +0 -0
- package/lib/build/fonts/Archivo-SemiBold.woff2 +0 -0
- package/lib/build/fonts/ArchivoExpanded-SemiBold.woff2 +0 -0
- package/lib/build/fonts/ArchivoSemiExpanded-Medium.woff2 +0 -0
- package/lib/build/fonts/ArchivoSemiExpanded-SemiBold.woff2 +0 -0
- package/lib/build/js/dialtone_health_check/deprecated_icons.cjs +105 -0
- package/lib/build/js/dialtone_health_check/index.cjs +82 -0
- package/lib/build/js/dialtone_health_check/non_dialtone_properties.cjs +44 -0
- package/lib/build/js/dialtone_migration_helper/configs/box-shadows.mjs +19 -0
- package/lib/build/js/dialtone_migration_helper/configs/colors.mjs +69 -0
- package/lib/build/js/dialtone_migration_helper/configs/fonts.mjs +49 -0
- package/lib/build/js/dialtone_migration_helper/configs/size-and-space.mjs +124 -0
- package/lib/build/js/dialtone_migration_helper/helpers.mjs +212 -0
- package/lib/build/js/dialtone_migration_helper/index.mjs +135 -0
- package/lib/build/less/components/avatar.less +169 -0
- package/lib/build/less/components/badge.less +139 -0
- package/lib/build/less/components/banner.less +77 -0
- package/lib/build/less/components/breadcrumbs.less +88 -0
- package/lib/build/less/components/button.less +554 -0
- package/lib/build/less/components/card.less +56 -0
- package/lib/build/less/components/chip.less +192 -0
- package/lib/build/less/components/codeblock.less +26 -0
- package/lib/build/less/components/collapsible.less +33 -0
- package/lib/build/less/components/combobox.less +28 -0
- package/lib/build/less/components/datepicker.less +146 -0
- package/lib/build/less/components/emoji-picker.less +223 -0
- package/lib/build/less/components/forms.less +153 -0
- package/lib/build/less/components/icon.less +63 -0
- package/lib/build/less/components/image-viewer.less +35 -0
- package/lib/build/less/components/input.less +321 -0
- package/lib/build/less/components/item-layout.less +53 -0
- package/lib/build/less/components/keyboard-shortcut.less +39 -0
- package/lib/build/less/components/link.less +130 -0
- package/lib/build/less/components/list-group.less +48 -0
- package/lib/build/less/components/list-item-group.less +17 -0
- package/lib/build/less/components/modal.less +340 -0
- package/lib/build/less/components/notice.less +171 -0
- package/lib/build/less/components/pagination.less +41 -0
- package/lib/build/less/components/popover.less +99 -0
- package/lib/build/less/components/presence.less +60 -0
- package/lib/build/less/components/radio-checkbox.less +278 -0
- package/lib/build/less/components/root-layout.less +125 -0
- package/lib/build/less/components/selects.less +152 -0
- package/lib/build/less/components/skeleton.less +101 -0
- package/lib/build/less/components/stack.less +129 -0
- package/lib/build/less/components/tab-panel.less +15 -0
- package/lib/build/less/components/table.less +118 -0
- package/lib/build/less/components/tabs.less +219 -0
- package/lib/build/less/components/toast.less +120 -0
- package/lib/build/less/components/toggle.less +173 -0
- package/lib/build/less/components/tooltip.less +267 -0
- package/lib/build/less/dialtone-globals.less +45 -0
- package/lib/build/less/dialtone-reset.less +362 -0
- package/lib/build/less/dialtone-variables.less +16 -0
- package/lib/build/less/dialtone.less +71 -0
- package/lib/build/less/themes/default.less +83 -0
- package/lib/build/less/themes/example.less +89 -0
- package/lib/build/less/utilities/backgrounds.less +139 -0
- package/lib/build/less/utilities/borders.less +196 -0
- package/lib/build/less/utilities/colors.less +122 -0
- package/lib/build/less/utilities/effects.less +210 -0
- package/lib/build/less/utilities/flex.less +227 -0
- package/lib/build/less/utilities/grid.less +244 -0
- package/lib/build/less/utilities/interactivity.less +69 -0
- package/lib/build/less/utilities/layout.less +146 -0
- package/lib/build/less/utilities/lint-staged.config.cjs +5 -0
- package/lib/build/less/utilities/sizing.less +152 -0
- package/lib/build/less/utilities/spacing.less +107 -0
- package/lib/build/less/utilities/typography.less +300 -0
- package/lib/build/less/variables/layout.less +19 -0
- package/lib/build/less/variables/sizes.less +64 -0
- package/lib/build/less/variables/typography.less +46 -0
- package/lib/build/less/variables/visual-styles.less +77 -0
- package/lib/build/svg/spot/blank-space.svg +35 -0
- package/lib/build/svg/spot/browser-list-callout.svg +27 -0
- package/lib/build/svg/spot/browser-table-graph.svg +37 -0
- package/lib/build/svg/spot/female-laptop-typing.svg +21 -0
- package/lib/build/svg/spot/file-upload.svg +50 -0
- package/lib/build/svg/spot/male-laptop-typing.svg +24 -0
- package/lib/build/svg/spot/mind.svg +58 -0
- package/lib/build/svg/spot/publish.svg +54 -0
- package/lib/build/svg/spot/vector-vortex.svg +53 -0
- package/lib/build/svg/spot/wireless-screenshare.svg +30 -0
- package/lib/dist/css/dialtone.css +18711 -0
- package/lib/dist/css/dialtone.min.css +1 -0
- package/lib/dist/fonts/Archivo-Bold.woff2 +0 -0
- package/lib/dist/fonts/Archivo-Regular.woff2 +0 -0
- package/lib/dist/fonts/Archivo-SemiBold.woff2 +0 -0
- package/lib/dist/fonts/ArchivoExpanded-SemiBold.woff2 +0 -0
- package/lib/dist/fonts/ArchivoSemiExpanded-Medium.woff2 +0 -0
- package/lib/dist/fonts/ArchivoSemiExpanded-SemiBold.woff2 +0 -0
- package/lib/dist/js/dialtone_health_check/deprecated_icons.cjs +105 -0
- package/lib/dist/js/dialtone_health_check/index.cjs +82 -0
- package/lib/dist/js/dialtone_health_check/non_dialtone_properties.cjs +44 -0
- package/lib/dist/js/dialtone_migration_helper/configs/box-shadows.mjs +19 -0
- package/lib/dist/js/dialtone_migration_helper/configs/colors.mjs +69 -0
- package/lib/dist/js/dialtone_migration_helper/configs/fonts.mjs +49 -0
- package/lib/dist/js/dialtone_migration_helper/configs/size-and-space.mjs +124 -0
- package/lib/dist/js/dialtone_migration_helper/helpers.mjs +212 -0
- package/lib/dist/js/dialtone_migration_helper/index.mjs +135 -0
- package/lib/dist/svg/spot/blank-space.svg +1 -0
- package/lib/dist/svg/spot/browser-list-callout.svg +1 -0
- package/lib/dist/svg/spot/browser-table-graph.svg +1 -0
- package/lib/dist/svg/spot/female-laptop-typing.svg +1 -0
- package/lib/dist/svg/spot/file-upload.svg +1 -0
- package/lib/dist/svg/spot/male-laptop-typing.svg +1 -0
- package/lib/dist/svg/spot/mind.svg +1 -0
- package/lib/dist/svg/spot/publish.svg +1 -0
- package/lib/dist/svg/spot/vector-vortex.svg +1 -0
- package/lib/dist/svg/spot/wireless-screenshare.svg +1 -0
- package/lib/dist/vue/spot/SpotBlankSpace.vue +3 -0
- package/lib/dist/vue/spot/SpotBrowserListCallout.vue +3 -0
- package/lib/dist/vue/spot/SpotBrowserTableGraph.vue +3 -0
- package/lib/dist/vue/spot/SpotFemaleLaptopTyping.vue +3 -0
- package/lib/dist/vue/spot/SpotFileUpload.vue +3 -0
- package/lib/dist/vue/spot/SpotMaleLaptopTyping.vue +3 -0
- package/lib/dist/vue/spot/SpotMind.vue +3 -0
- package/lib/dist/vue/spot/SpotPublish.vue +3 -0
- package/lib/dist/vue/spot/SpotVectorVortex.vue +3 -0
- package/lib/dist/vue/spot/SpotWirelessScreenshare.vue +3 -0
- package/package.json +115 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { globby } from 'globby';
|
|
3
|
+
import inquirer from 'inquirer';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
const { readdir, readFile, writeFile } = fs.promises;
|
|
7
|
+
|
|
8
|
+
// confirm prompt for starting operations, display warning and y/n dialog
|
|
9
|
+
export const confirmStart = () => {
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
|
+
inquirer
|
|
12
|
+
.prompt([
|
|
13
|
+
{
|
|
14
|
+
type: 'confirm',
|
|
15
|
+
name: 'yesno',
|
|
16
|
+
prefix: `
|
|
17
|
+
${chalk.bgRed(
|
|
18
|
+
'┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ !!! CAUTION !!! ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓',
|
|
19
|
+
)}
|
|
20
|
+
${chalk.bgRed(
|
|
21
|
+
'┃',
|
|
22
|
+
)} Please be sure you are running this in a code repository where changes can be rolled back. ${chalk.bgRed(
|
|
23
|
+
'┃',
|
|
24
|
+
)}
|
|
25
|
+
${chalk.bgRed(
|
|
26
|
+
'┃',
|
|
27
|
+
)} Modifications will occur to files listed above. Proceed at your own risk. ${chalk.bgRed(
|
|
28
|
+
'┃',
|
|
29
|
+
)}
|
|
30
|
+
${chalk.bgRed(
|
|
31
|
+
'┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛',
|
|
32
|
+
)}\n
|
|
33
|
+
`,
|
|
34
|
+
message: 'Start modification?',
|
|
35
|
+
default: true,
|
|
36
|
+
},
|
|
37
|
+
])
|
|
38
|
+
.then((choice) => {
|
|
39
|
+
resolve(choice.yesno);
|
|
40
|
+
})
|
|
41
|
+
.catch((err) => {
|
|
42
|
+
reject(err);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// return array of all globby pattern matches in one level
|
|
48
|
+
export const doPatternSearch = async (config) => {
|
|
49
|
+
const res = [];
|
|
50
|
+
for (const p of config.patterns) {
|
|
51
|
+
res.push(
|
|
52
|
+
...(await getGlob(p, config.globbyConfig).catch((err) => error('doPatternSearch: ' + err))),
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return res;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// error and quit
|
|
59
|
+
export const error = (message) => {
|
|
60
|
+
console.log(`\n${chalk.red('!!')} Error: ${message}\n`);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const findMatchedFiles = async (fileList, config) => {
|
|
65
|
+
return getAllFileContents(fileList, config.globbyConfig.cwd).then((globbed) => {
|
|
66
|
+
// filter out minified files
|
|
67
|
+
const filtered = globbed
|
|
68
|
+
.filter((f) => {
|
|
69
|
+
return (f.data.match(/[\n\r]/g) || []).length > 3;
|
|
70
|
+
})
|
|
71
|
+
.filter((f) => {
|
|
72
|
+
config.expressions.forEach((e) => {
|
|
73
|
+
if (e.from.test(f.data)) f.matches++;
|
|
74
|
+
});
|
|
75
|
+
return f.matches > 0;
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
return filtered.reduce((prev, current) => {
|
|
79
|
+
const fn = path.relative(config.globbyConfig.cwd, current.file);
|
|
80
|
+
return [...prev, fn];
|
|
81
|
+
}, []);
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
// read file contents of all matched files, return filename and data, default matches (0)
|
|
86
|
+
export const getAllFileContents = (fileList, cwd) => {
|
|
87
|
+
const readPromises = fileList.map(async (file) => {
|
|
88
|
+
file = cwd + path.sep + file;
|
|
89
|
+
return readFile(file, 'utf8')
|
|
90
|
+
.then((data) => {
|
|
91
|
+
return { file, data, matches: 0 };
|
|
92
|
+
})
|
|
93
|
+
.catch((err) => error('getAllFileContents: ' + err));
|
|
94
|
+
});
|
|
95
|
+
return Promise.all(readPromises);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// return list of files from path
|
|
99
|
+
export const getConfigFileList = (path) => {
|
|
100
|
+
return new Promise((resolve, reject) => {
|
|
101
|
+
readdir(path)
|
|
102
|
+
.then((files) => {
|
|
103
|
+
resolve(
|
|
104
|
+
files.map((file) => ({
|
|
105
|
+
name: file.replace(/-/g, ' ').split('.')[0],
|
|
106
|
+
value: file,
|
|
107
|
+
})),
|
|
108
|
+
);
|
|
109
|
+
})
|
|
110
|
+
.catch((err) => reject(err));
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// returns globby promise based on search pattern and configuration
|
|
115
|
+
// https://github.com/sindresorhus/globby
|
|
116
|
+
export const getGlob = (pattern, config) => {
|
|
117
|
+
return new Promise((resolve, reject) => {
|
|
118
|
+
globby(pattern, config)
|
|
119
|
+
.then((matches) => resolve(matches))
|
|
120
|
+
.catch((err) => reject(err));
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// display list of configuration files retreived by readConfigFile
|
|
125
|
+
export const inquireForFile = (folder, options) => {
|
|
126
|
+
return new Promise((resolve, reject) => {
|
|
127
|
+
inquirer
|
|
128
|
+
.prompt([
|
|
129
|
+
{
|
|
130
|
+
type: 'list',
|
|
131
|
+
name: 'file',
|
|
132
|
+
choices: options,
|
|
133
|
+
pageSize: 4,
|
|
134
|
+
prefix: `\n${chalk.green('?')} Choose a migration configuration to use:\n`,
|
|
135
|
+
},
|
|
136
|
+
])
|
|
137
|
+
.then((choice) => {
|
|
138
|
+
const configPath = `${folder}/${choice.file}`;
|
|
139
|
+
resolve(readConfigFile(configPath));
|
|
140
|
+
})
|
|
141
|
+
.catch((err) => {
|
|
142
|
+
reject(err);
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
// for each expression (string.replace(from, to)) iterate over each file and make
|
|
148
|
+
// changes where a match was found. Records number of matches per file.
|
|
149
|
+
// @TODO: could probably be sped up but it already seems pretty fast.
|
|
150
|
+
export const modifyFileContents = async (content, expr) => {
|
|
151
|
+
// filter out files with less than 3 newlines, likely compressed/minified files
|
|
152
|
+
content
|
|
153
|
+
.filter((f) => {
|
|
154
|
+
return (f.data.match(/[\n\r]/g) || []).length > 3;
|
|
155
|
+
})
|
|
156
|
+
.map((f) => {
|
|
157
|
+
expr.forEach((e) => {
|
|
158
|
+
f.data = f.data.replace(e.from, (match) => {
|
|
159
|
+
f.matches++;
|
|
160
|
+
return match.replace(e.from, e.to);
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
return f;
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// promise map for writing file to the FS
|
|
167
|
+
const writePromises = content.map(async (content) => {
|
|
168
|
+
if (content.matches > 0) {
|
|
169
|
+
return writeFile(content.file, content.data, 'utf8')
|
|
170
|
+
.then(() => {
|
|
171
|
+
return { file: content.file, matches: content.matches };
|
|
172
|
+
})
|
|
173
|
+
.catch((err) => error('writePromises: ' + err));
|
|
174
|
+
} else {
|
|
175
|
+
return { file: content.file, matches: 0 };
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// write out list of files that changed and how many changes were made
|
|
180
|
+
return await Promise.all(writePromises).then((results) => {
|
|
181
|
+
results.forEach((result) => {
|
|
182
|
+
if (result.matches > 0) {
|
|
183
|
+
// gives a shorter name
|
|
184
|
+
const shortname = path.relative(process.cwd(), result.file);
|
|
185
|
+
console.log(
|
|
186
|
+
`${chalk.yellow('>>')} ${shortname}${chalk.gray(',')} ${chalk.whiteBright(
|
|
187
|
+
result.matches,
|
|
188
|
+
)} changes`,
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
// read configuration file and return array with data and config filename
|
|
196
|
+
export const readConfigFile = async (file) => {
|
|
197
|
+
const config = await import(file);
|
|
198
|
+
return [config.default, path.basename(file)];
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export default {
|
|
202
|
+
confirmStart,
|
|
203
|
+
doPatternSearch,
|
|
204
|
+
error,
|
|
205
|
+
findMatchedFiles,
|
|
206
|
+
getAllFileContents,
|
|
207
|
+
getConfigFileList,
|
|
208
|
+
getGlob,
|
|
209
|
+
inquireForFile,
|
|
210
|
+
modifyFileContents,
|
|
211
|
+
readConfigFile,
|
|
212
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import {
|
|
5
|
+
confirmStart,
|
|
6
|
+
doPatternSearch,
|
|
7
|
+
error,
|
|
8
|
+
findMatchedFiles,
|
|
9
|
+
getConfigFileList,
|
|
10
|
+
getAllFileContents,
|
|
11
|
+
inquireForFile,
|
|
12
|
+
modifyFileContents,
|
|
13
|
+
readConfigFile,
|
|
14
|
+
} from './helpers.mjs';
|
|
15
|
+
import ora from 'ora';
|
|
16
|
+
import { dirname, normalize } from 'path';
|
|
17
|
+
import { fileURLToPath } from 'url';
|
|
18
|
+
import { hideBin } from 'yargs/helpers';
|
|
19
|
+
import yargs from 'yargs';
|
|
20
|
+
|
|
21
|
+
// eslint-disable-next-line complexity
|
|
22
|
+
(async () => {
|
|
23
|
+
// get command line args
|
|
24
|
+
const argv = yargs(hideBin(process.argv))
|
|
25
|
+
.scriptName('dialtone-migration-helper')
|
|
26
|
+
.usage(
|
|
27
|
+
'$0 --cwd "../root/directory" --include "file1.ext" "**/*.ext2" --ignore "**/ignored/**", "**/another_ignored/**"',
|
|
28
|
+
)
|
|
29
|
+
.options({
|
|
30
|
+
cwd: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'Root directory for scan. Defaults to CWD.',
|
|
33
|
+
default: process.cwd(),
|
|
34
|
+
},
|
|
35
|
+
include: {
|
|
36
|
+
type: 'array',
|
|
37
|
+
description: 'Glob patters to include during search, if omitted, will include all the files on the CWD.',
|
|
38
|
+
},
|
|
39
|
+
ignore: {
|
|
40
|
+
type: 'array',
|
|
41
|
+
description: 'Other glob patterns to ignore during search. .gitignore included by default.',
|
|
42
|
+
},
|
|
43
|
+
force: {
|
|
44
|
+
boolean: true,
|
|
45
|
+
description: 'Skip interactive prompts, use caution!',
|
|
46
|
+
default: false,
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
.help().argv;
|
|
50
|
+
|
|
51
|
+
// get list of configuration files
|
|
52
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
53
|
+
const __dirname = dirname(__filename);
|
|
54
|
+
const CONFIG_FOLDER = __dirname + '/configs';
|
|
55
|
+
const configList = await getConfigFileList(CONFIG_FOLDER).catch((err) =>
|
|
56
|
+
error('getConfigFileList: ' + err),
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
// load configuration from arg or list
|
|
60
|
+
const [configData, configFile] = await inquireForFile(CONFIG_FOLDER, configList)
|
|
61
|
+
.catch((err) =>
|
|
62
|
+
error('inquireForFile: ' + err),
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
// set up some globby defaults
|
|
66
|
+
configData.globbyConfig = configData.globbyConfig || {};
|
|
67
|
+
configData.globbyConfig.gitignore = configData.globbyConfig.gitignore || true;
|
|
68
|
+
|
|
69
|
+
console.log(
|
|
70
|
+
`\n${chalk.green('++')} Configuration Loaded! (${configFile}) ${chalk.green('++')}\n`,
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
// take CWD if specified from command line
|
|
74
|
+
const cwd = !argv.cwd ? process.cwd() : normalize(argv.cwd);
|
|
75
|
+
configData.globbyConfig.cwd = configData.globbyConfig.cwd || cwd;
|
|
76
|
+
// push include list to configuration array
|
|
77
|
+
if (argv.include) {
|
|
78
|
+
configData.patterns = argv.include;
|
|
79
|
+
}
|
|
80
|
+
// push ignore list to configuration array
|
|
81
|
+
if (argv.ignore) {
|
|
82
|
+
configData.globbyConfig.ignore = argv.ignore;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// run glob search with configData.patterns
|
|
86
|
+
const globSpinner = ora('Performing pattern search').start();
|
|
87
|
+
const files = await doPatternSearch(configData).then((f) => {
|
|
88
|
+
return findMatchedFiles(f, configData);
|
|
89
|
+
});
|
|
90
|
+
if (files.length <= 0) {
|
|
91
|
+
console.log(
|
|
92
|
+
'\n' +
|
|
93
|
+
chalk.cyan('??') +
|
|
94
|
+
' No matches found! Check your patterns and cwd settings if you think this is an error ' +
|
|
95
|
+
`patterns: [${configData.patterns}] | cwd: [${configData.globbyConfig.cwd}] `,
|
|
96
|
+
);
|
|
97
|
+
process.exit(0);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
globSpinner.stop();
|
|
101
|
+
console.log(`[ ${chalk.whiteBright(files.length)} ] files queued for modification:\n`);
|
|
102
|
+
console.log(files);
|
|
103
|
+
console.log(
|
|
104
|
+
`\n${chalk.yellow('Configuration Description')}${chalk.gray(':')}\n${configData.description}\n`,
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
// kick off file search and replace
|
|
108
|
+
const startModification = () => {
|
|
109
|
+
console.log(`\n${chalk.blue('__')} Starting ...`);
|
|
110
|
+
|
|
111
|
+
getAllFileContents(files, configData.globbyConfig.cwd)
|
|
112
|
+
.then((content) => {
|
|
113
|
+
modifyFileContents(content, configData.expressions).then(() => {
|
|
114
|
+
console.log(`${chalk.magenta('==')} Modification complete!\n`);
|
|
115
|
+
});
|
|
116
|
+
})
|
|
117
|
+
.catch((err) => error('getAllFileContents: ' + err));
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// begin file modification based on configuration rules
|
|
121
|
+
// start automatically if --force is specified
|
|
122
|
+
if (!argv.force) {
|
|
123
|
+
confirmStart()
|
|
124
|
+
.then((val) => {
|
|
125
|
+
if (val) {
|
|
126
|
+
startModification();
|
|
127
|
+
} else {
|
|
128
|
+
console.log(`\n${chalk.red('__')} Cancelling ...\n`);
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
.catch((err) => error('confirmStart ' + err));
|
|
132
|
+
} else {
|
|
133
|
+
startModification();
|
|
134
|
+
}
|
|
135
|
+
})();
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
//
|
|
2
|
+
// DIALTONE
|
|
3
|
+
// COMPONENTS: Avatars
|
|
4
|
+
//
|
|
5
|
+
// These are avatars classes for Dialpad's design system Dialtone.
|
|
6
|
+
// For further documentation of these and other classes,
|
|
7
|
+
// visit https://dialpad.design/components/avatars
|
|
8
|
+
//
|
|
9
|
+
// TABLE OF CONTENTS
|
|
10
|
+
// • BASE STYLE
|
|
11
|
+
// • COLOR VARIANTS
|
|
12
|
+
// • CHILDREN
|
|
13
|
+
// • SIZES
|
|
14
|
+
// • VARIANTS
|
|
15
|
+
//
|
|
16
|
+
// ============================================================================
|
|
17
|
+
// $ BASE STYLE
|
|
18
|
+
// ----------------------------------------------------------------------------
|
|
19
|
+
.d-avatar {
|
|
20
|
+
// Component CSS Vars
|
|
21
|
+
// ------------------------------------------------------------------------
|
|
22
|
+
--avatar-color-background: var(--dt-avatar-color-background-000);
|
|
23
|
+
--avatar-color-text: var(--dt-avatar-color-foreground);
|
|
24
|
+
--avatar-size-shape: var(--dt-size-600);
|
|
25
|
+
--avatar-size-image: 100%;
|
|
26
|
+
--avatar-size-text: var(--dt-font-size-200);
|
|
27
|
+
--avatar-presence-position-right: var(--dt-space-200-negative);
|
|
28
|
+
--avatar-presence-position-bottom: var(--dt-space-200-negative);
|
|
29
|
+
--avatar-count-color-shadow: var(--dt-theme-sidebar-color-background);
|
|
30
|
+
|
|
31
|
+
position: relative;
|
|
32
|
+
display: flex;
|
|
33
|
+
color: var(--avatar-color-text);
|
|
34
|
+
|
|
35
|
+
// -- COLOR VARIANTS
|
|
36
|
+
// ------------------------------------------------------------------------
|
|
37
|
+
&--color-100 { --avatar-color-background: var(--dt-avatar-color-background-100); }
|
|
38
|
+
&--color-200 { --avatar-color-background: var(--dt-avatar-color-background-200); }
|
|
39
|
+
&--color-300 { --avatar-color-background: var(--dt-avatar-color-background-300); }
|
|
40
|
+
&--color-400 { --avatar-color-background: var(--dt-avatar-color-background-400); }
|
|
41
|
+
&--color-500 { --avatar-color-background: var(--dt-avatar-color-background-500); }
|
|
42
|
+
&--color-600 { --avatar-color-background: var(--dt-avatar-color-background-600); }
|
|
43
|
+
&--color-700 { --avatar-color-background: var(--dt-avatar-color-background-700); }
|
|
44
|
+
&--color-800 { --avatar-color-background: var(--dt-avatar-color-background-800); }
|
|
45
|
+
&--color-900 { --avatar-color-background: var(--dt-avatar-color-background-900); }
|
|
46
|
+
&--color-1000 { --avatar-color-background: var(--dt-avatar-color-background-1000); }
|
|
47
|
+
&--color-1100 { --avatar-color-background: var(--dt-avatar-color-background-1100); }
|
|
48
|
+
&--color-1200 { --avatar-color-background: var(--dt-avatar-color-background-1200); }
|
|
49
|
+
&--color-1300 { --avatar-color-background: var(--dt-avatar-color-background-1300); }
|
|
50
|
+
&--color-1400 { --avatar-color-background: var(--dt-avatar-color-background-1400); }
|
|
51
|
+
&--color-1500 { --avatar-color-background: var(--dt-avatar-color-background-1500); }
|
|
52
|
+
&--color-1600 { --avatar-color-background: var(--dt-avatar-color-background-1600); }
|
|
53
|
+
&--color-1700 { --avatar-color-background: var(--dt-avatar-color-background-1700); }
|
|
54
|
+
&--color-1800 { --avatar-color-background: var(--dt-avatar-color-background-1800); }
|
|
55
|
+
|
|
56
|
+
// -- CHILDREN
|
|
57
|
+
// ------------------------------------------------------------------------
|
|
58
|
+
|
|
59
|
+
&__canvas {
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
width: var(--avatar-size-shape);
|
|
64
|
+
height: var(--avatar-size-shape);
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
background-color: var(--avatar-color-background);
|
|
67
|
+
border-radius: var(--dt-size-radius-pill);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&__image {
|
|
71
|
+
width: var(--avatar-size-image);
|
|
72
|
+
height: var(--avatar-size-image);
|
|
73
|
+
object-fit: cover;
|
|
74
|
+
border-radius: var(--dt-size-radius-pill);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&__initials {
|
|
78
|
+
position: absolute;
|
|
79
|
+
z-index: var(--zi-base);
|
|
80
|
+
font-weight: var(--dt-font-weight-bold);
|
|
81
|
+
font-size: var(--avatar-size-text);
|
|
82
|
+
line-height: var(--dt-font-line-height-100);
|
|
83
|
+
text-transform: uppercase;
|
|
84
|
+
user-select: none;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&__icon {
|
|
88
|
+
display: flex;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&__presence {
|
|
92
|
+
position: absolute;
|
|
93
|
+
right: var(--avatar-presence-position-right);
|
|
94
|
+
bottom: var(--avatar-presence-position-bottom);
|
|
95
|
+
display: flex;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&__count {
|
|
99
|
+
position: absolute;
|
|
100
|
+
right: 0;
|
|
101
|
+
bottom: 0;
|
|
102
|
+
display: inline-flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
box-sizing: border-box;
|
|
106
|
+
min-width: calc(var(--dt-size-300) * 3.5);
|
|
107
|
+
padding: var(--dt-space-200) calc(var(--dt-space-200) + var(--dt-space-100));
|
|
108
|
+
color: var(--dt-color-foreground-primary-inverted);
|
|
109
|
+
font-weight: var(--dt-font-weight-bold);
|
|
110
|
+
font-size: calc(var(--dt-font-size-100) - var(--dt-size-200));
|
|
111
|
+
line-height: var(--dt-font-line-height-100);
|
|
112
|
+
text-align: center;
|
|
113
|
+
background-color: var(--dt-color-surface-strong);
|
|
114
|
+
border-radius: var(--dt-size-radius-pill);
|
|
115
|
+
box-shadow: 0 0 0 var(--dt-size-200) var(--avatar-count-color-shadow);
|
|
116
|
+
|
|
117
|
+
.dt-leftbar-row--selected &,
|
|
118
|
+
.dt-leftbar-row__primary:hover & {
|
|
119
|
+
--avatar-count-color-shadow: var(--dt-theme-sidebar-row-color-background-hover);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// -- SIZES
|
|
124
|
+
// ------------------------------------------------------------------------
|
|
125
|
+
|
|
126
|
+
&--xs {
|
|
127
|
+
--avatar-size-shape: calc(var(--dt-size-500) + var(--dt-size-200));
|
|
128
|
+
--avatar-presence-position-right: var(--dt-space-300-negative);
|
|
129
|
+
--avatar-presence-position-bottom: var(--dt-space-300-negative);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&--sm {
|
|
133
|
+
--avatar-size-shape: var(--dt-size-550);
|
|
134
|
+
--avatar-size-text: var(--dt-font-size-100);
|
|
135
|
+
--avatar-presence-position-right: var(--dt-space-200-negative);
|
|
136
|
+
--avatar-presence-position-bottom: var(--dt-space-200-negative);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&--md {
|
|
140
|
+
--avatar-size-shape: var(--dt-size-600);
|
|
141
|
+
--avatar-size-text: var(--dt-font-size-200);
|
|
142
|
+
--avatar-presence-position-right: var(--dt-space-100-negative);
|
|
143
|
+
--avatar-presence-position-bottom: var(--dt-space-100-negative);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&--lg {
|
|
147
|
+
--avatar-size-shape: var(--dt-size-650);
|
|
148
|
+
--avatar-size-text: var(--dt-font-size-300);
|
|
149
|
+
--avatar-presence-position-right: var(--dt-space-100);
|
|
150
|
+
--avatar-presence-position-bottom: var(--dt-space-100);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&--xl {
|
|
154
|
+
--avatar-size-shape: var(--dt-size-700);
|
|
155
|
+
--avatar-size-text: var(--dt-font-size-400);
|
|
156
|
+
--avatar-presence-position-right: var(--dt-space-300);
|
|
157
|
+
--avatar-presence-position-bottom: var(--dt-space-300);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// -- GROUP
|
|
161
|
+
// ------------------------------------------------------------------------
|
|
162
|
+
|
|
163
|
+
&--group {
|
|
164
|
+
--avatar-size-shape: calc(var(--dt-size-300) * 4.5);
|
|
165
|
+
|
|
166
|
+
width: var(--dt-size-550);
|
|
167
|
+
height: var(--dt-size-550);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
//
|
|
2
|
+
// DIALTONE
|
|
3
|
+
// COMPONENTS: BADGES
|
|
4
|
+
//
|
|
5
|
+
// These are badge classes for Dialpad's design system Dialtone.
|
|
6
|
+
// For further documentation of these and other classes,
|
|
7
|
+
// visit https://dialpad.design/components/badges
|
|
8
|
+
//
|
|
9
|
+
// TABLE OF CONTENTS
|
|
10
|
+
// • COMPONENT CSS VARIABLES
|
|
11
|
+
// • BASE STYLE
|
|
12
|
+
// • KIND
|
|
13
|
+
// • TYPE
|
|
14
|
+
// • SLOTS
|
|
15
|
+
//
|
|
16
|
+
// ============================================================================
|
|
17
|
+
// $ BASE STYLE
|
|
18
|
+
// ----------------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
.d-badge {
|
|
21
|
+
// COMPONENT CSS VARIABLES
|
|
22
|
+
// --------------------------------------------------------------------------
|
|
23
|
+
--badge-color-text: var(--dt-badge-color-foreground-default);
|
|
24
|
+
--badge-color-background: var(--dt-badge-color-background-default);
|
|
25
|
+
--badge-radius: var(--dt-size-300);
|
|
26
|
+
--badge-line-height: calc(var(--dt-size-500) + var(--dt-size-200));
|
|
27
|
+
--badge-font-size: var(--dt-font-size-100);
|
|
28
|
+
--badge-font-weight: var(--dt-font-weight-semi-bold);
|
|
29
|
+
--badge-gap: var(--dt-space-300);
|
|
30
|
+
--badge-letter-spacing: var(--dt-size-50);
|
|
31
|
+
--badge-padding-y: var(--dt-space-100);
|
|
32
|
+
--badge-padding-x: var(--dt-space-400);
|
|
33
|
+
--badge-text-case: none;
|
|
34
|
+
--badge-decorative-color: var(--dt-color-black-900);
|
|
35
|
+
|
|
36
|
+
// BASE STYLE
|
|
37
|
+
// --------------------------------------------------------------------------
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
gap: var(--badge-gap);
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
min-width: var(--dt-size-550);
|
|
44
|
+
padding: var(--badge-padding-y) var(--badge-padding-x);
|
|
45
|
+
color: var(--badge-color-text);
|
|
46
|
+
font-weight: var(--badge-font-weight);
|
|
47
|
+
font-size: var(--badge-font-size);
|
|
48
|
+
line-height: var(--badge-line-height);
|
|
49
|
+
letter-spacing: var(--badge-letter-spacing);
|
|
50
|
+
text-align: center;
|
|
51
|
+
text-transform: var(--badge-text-case);
|
|
52
|
+
background-color: var(--badge-color-background);
|
|
53
|
+
border-radius: var(--badge-radius);
|
|
54
|
+
|
|
55
|
+
// Kind
|
|
56
|
+
// --------------------------------------------------------------------------
|
|
57
|
+
|
|
58
|
+
&--count {
|
|
59
|
+
--badge-radius: var(--dt-size-radius-pill);
|
|
60
|
+
--badge-padding-x: calc(var(--dt-space-400) - var(--dt-space-100));
|
|
61
|
+
--badge-padding-y: var(--dt-space-300);
|
|
62
|
+
--badge-line-height: var(--dt-size-500);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// TYPE
|
|
66
|
+
// --------------------------------------------------------------------------
|
|
67
|
+
|
|
68
|
+
&--info {
|
|
69
|
+
--badge-color-background: var(--dt-badge-color-background-info);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&--success {
|
|
73
|
+
--badge-color-background: var(--dt-badge-color-background-success);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&--warning {
|
|
77
|
+
--badge-color-background: var(--dt-badge-color-background-warning);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&--critical {
|
|
81
|
+
--badge-color-background: var(--dt-badge-color-background-critical);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&--bulletin {
|
|
85
|
+
--badge-color-text: var(--dt-badge-color-foreground-bulletin);
|
|
86
|
+
--badge-color-background: var(--dt-badge-color-background-bulletin);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&--ai {
|
|
90
|
+
--badge-color-text: var(--dt-badge-color-foreground-bulletin); // missing token or is ok to use this one?
|
|
91
|
+
--badge-color-background: var(--dt-color-magenta-300);
|
|
92
|
+
|
|
93
|
+
background-image: var(--dt-badge-color-background-ai);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&--decorate-black-400 { --badge-decorative-color: var(--dt-color-black-400); }
|
|
97
|
+
&--decorate-black-500 { --badge-decorative-color: var(--dt-color-black-500); }
|
|
98
|
+
&--decorate-black-900 { --badge-decorative-color: var(--dt-color-black-900); }
|
|
99
|
+
&--decorate-red-200 { --badge-decorative-color: var(--dt-color-red-200); }
|
|
100
|
+
&--decorate-red-300 { --badge-decorative-color: var(--dt-color-red-300); }
|
|
101
|
+
&--decorate-red-400 { --badge-decorative-color: var(--dt-color-red-400); }
|
|
102
|
+
&--decorate-purple-200 { --badge-decorative-color: var(--dt-color-purple-200); }
|
|
103
|
+
&--decorate-purple-300 { --badge-decorative-color: var(--dt-color-purple-300); }
|
|
104
|
+
&--decorate-purple-400 { --badge-decorative-color: var(--dt-color-purple-400); }
|
|
105
|
+
&--decorate-purple-500 { --badge-decorative-color: var(--dt-color-purple-500); }
|
|
106
|
+
&--decorate-blue-200 { --badge-decorative-color: var(--dt-color-blue-200); }
|
|
107
|
+
&--decorate-blue-300 { --badge-decorative-color: var(--dt-color-blue-300); }
|
|
108
|
+
&--decorate-blue-400 { --badge-decorative-color: var(--dt-color-blue-400); }
|
|
109
|
+
&--decorate-green-300 { --badge-decorative-color: var(--dt-color-green-300); }
|
|
110
|
+
&--decorate-green-400 { --badge-decorative-color: var(--dt-color-green-400); }
|
|
111
|
+
&--decorate-green-500 { --badge-decorative-color: var(--dt-color-green-500); }
|
|
112
|
+
&--decorate-gold-300 { --badge-decorative-color: var(--dt-color-gold-300); }
|
|
113
|
+
&--decorate-gold-400 { --badge-decorative-color: var(--dt-color-gold-400); }
|
|
114
|
+
&--decorate-gold-500 { --badge-decorative-color: var(--dt-color-gold-500); }
|
|
115
|
+
&--decorate-magenta-200 { --badge-decorative-color: var(--dt-color-magenta-200); }
|
|
116
|
+
&--decorate-magenta-300 { --badge-decorative-color: var(--dt-color-magenta-300); }
|
|
117
|
+
&--decorate-magenta-400 { --badge-decorative-color: var(--dt-color-magenta-400); }
|
|
118
|
+
|
|
119
|
+
// SLOTS
|
|
120
|
+
// --------------------------------------------------------------------------
|
|
121
|
+
|
|
122
|
+
&__decorative {
|
|
123
|
+
display: inline-flex;
|
|
124
|
+
width: var(--dt-size-400);
|
|
125
|
+
height: var(--dt-size-400);
|
|
126
|
+
background-color: var(--badge-decorative-color);
|
|
127
|
+
border-radius: var(--dt-size-200);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&__label {
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&__icon-left,
|
|
136
|
+
&__icon-right {
|
|
137
|
+
display: flex;
|
|
138
|
+
}
|
|
139
|
+
}
|