index
int64
0
0
repo_id
stringlengths
16
181
file_path
stringlengths
28
270
content
stringlengths
1
11.6M
__index_level_0__
int64
0
10k
0
petrpan-code/ProtonMail/WebClients/packages/atoms
petrpan-code/ProtonMail/WebClients/packages/atoms/VerticalSteps/index.ts
export { default as VerticalSteps } from './VerticalSteps'; export { default as VerticalStep } from './VerticalStep'; export * from './VerticalSteps'; export * from './VerticalStep';
5,100
0
petrpan-code/ProtonMail/WebClients/packages/atoms
petrpan-code/ProtonMail/WebClients/packages/atoms/Vr/Vr.mdx
import { ArgsTable, Canvas, PRIMARY_STORY, Primary, Story } from '@storybook/addon-docs'; # Vr ```js import { Vr } from '@proton/atoms'; ``` This component is simply a vertical separator styled using the class `vr`. ### Basic <Canvas withSource="open"> <Story id="components-vr--basic" /> </Canvas> <div class="hidden"> <Primary /> </div>
5,101
0
petrpan-code/ProtonMail/WebClients/packages/atoms
petrpan-code/ProtonMail/WebClients/packages/atoms/Vr/Vr.scss
.vr { inline-size: 0; block-size: auto; flex: 0 0 0; border-inline-end: 1px solid var(--border-norm); }
5,102
0
petrpan-code/ProtonMail/WebClients/packages/atoms
petrpan-code/ProtonMail/WebClients/packages/atoms/Vr/Vr.stories.tsx
import Vr from './Vr'; import mdx from './Vr.mdx'; export default { component: Vr, title: 'components/Vr', parameters: { docs: { page: mdx } }, }; export const Basic = () => ( <div style={{ display: 'flex', justifyContent: 'center', height: 50 }}> <Vr /> </div> );
5,103
0
petrpan-code/ProtonMail/WebClients/packages/atoms
petrpan-code/ProtonMail/WebClients/packages/atoms/Vr/Vr.test.tsx
import { render } from '@testing-library/react'; import Vr from './Vr'; describe('<Vr />', () => { it('should render with className vr', () => { const { container } = render(<Vr className="should-be-passed" />); expect(container.firstChild).toHaveClass('vr'); expect(container.firstChild).toHaveClass('should-be-passed'); }); });
5,104
0
petrpan-code/ProtonMail/WebClients/packages/atoms
petrpan-code/ProtonMail/WebClients/packages/atoms/Vr/Vr.tsx
import { ComponentPropsWithoutRef } from 'react'; import clsx from '@proton/utils/clsx'; import './Vr.scss'; export interface VrProps extends ComponentPropsWithoutRef<'span'> {} // Vr stands for Vertical Rule const Vr = ({ className, ...rest }: VrProps) => { return <span className={clsx('vr', className)} {...rest} />; }; export default Vr;
5,105
0
petrpan-code/ProtonMail/WebClients/packages/atoms
petrpan-code/ProtonMail/WebClients/packages/atoms/Vr/index.ts
export { default as Vr } from './Vr'; export * from './Vr';
5,106
0
petrpan-code/ProtonMail/WebClients/packages/atoms
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom/README.md
# Create atom A script to create the skeleton of an atom for `@proton/atoms`. Based on https://github.com/joshwcomeau/new-component ## Example The script takes 1 argument - the name of the component. For example, ``` yarn create-atom MyAtom ``` This will create a `MyAtom` directory in `@proton/atoms` and output the following skeleton fileS ``` index.ts // Exports all exports from component file MyAtom.mdx // Markdown docs for storybook MyAtom.scss // Contains the styles MyAtom.stories.tsx // Stories for storybook MyAtom.test.tsx // Tests for the component MyAtom.tsx // The actual component ``` ## Monorepo script You can run the script from the monorepo root using `yarn create-atom MyAtom`.
5,107
0
petrpan-code/ProtonMail/WebClients/packages/atoms
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom/index.ts
import { Command } from 'commander'; import fsSync from 'fs'; import fs from 'fs/promises'; import path from 'path'; import { logComponentCreationError, logConclusion, logIntro, logItemCompletion } from './utils/log'; import { appendAtomToIndex, getAtomTemplate, getIndexTemplate, getMdxTemplate, getStoriesTemplate, getStylesTemplate, getTestTemplate, getWriteTemplate, } from './utils/templates'; const program = new Command(); async function run(AtomName: string, options: { tag: string }) { const { tag: rootHtmlTag } = options; logIntro(AtomName); const atomsDir = '.'; const atomDir = `${atomsDir}/${AtomName}`; // Check to see if a directory at the given path exists if (fsSync.existsSync(path.resolve(atomDir))) { logComponentCreationError(AtomName); process.exit(0); } const [atomTemplate, indexTemplate, testTemplate, stylesTemplate, mdxTemplate, storiesTemplate] = await Promise.all( [ getAtomTemplate(AtomName, rootHtmlTag), getIndexTemplate(AtomName), getTestTemplate(AtomName), getStylesTemplate(AtomName), getMdxTemplate(AtomName), getStoriesTemplate(AtomName), ] ); await fs.mkdir(atomDir); logItemCompletion('Directory created.'); const writeTemplate = getWriteTemplate(atomDir); await Promise.all([ writeTemplate(`${AtomName}.tsx`, atomTemplate), writeTemplate('index.ts', indexTemplate), writeTemplate(`${AtomName}.test.tsx`, testTemplate), writeTemplate(`${AtomName}.scss`, stylesTemplate), writeTemplate(`${AtomName}.mdx`, mdxTemplate), writeTemplate(`${AtomName}.stories.tsx`, storiesTemplate), appendAtomToIndex(atomsDir, AtomName), ]); logConclusion(); } async function main() { program .argument('<AtomName>', 'name of the atom to create') .option('-t, --tag <type>', 'the root html tag of the component', 'div') .action(run); await program.parseAsync(process.argv); } void main();
5,108
0
petrpan-code/ProtonMail/WebClients/packages/atoms
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom/tsconfig.create-atom.json
{ "compilerOptions": { "types": ["node"], "esModuleInterop": true, "skipLibCheck": true } }
5,109
0
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom/templates/Atom.mdx.mustache
import { Canvas, Story, ArgsTable, Primary, PRIMARY_STORY } from '@storybook/addon-docs' import { {{atomName}} } from './{{atomName}}' # {{atomName}} ```js import { {{atomName}} } from '@proton/atoms'; ``` Optional disclaimer / description / explanation / extra info of usage. This should be of technical nature not of design philosophy nature. <Canvas withSource="open"> <Story id="components-{{atomNameLowercase}}--basic" /> </Canvas> ## Subtitle explaining certain usage case of the component Description of usage and quirks / use-cases for it. Any additional info that developers should be aware of when using this usage / props / use-case. <Story id="components-{{atomNameLowercase}}--story-without-canvas" /> ## Subtitle explaining another usage case of the component Description of usage and quirks / use-cases for it. Any additional info that developers should be aware of when using this usage / props / use-case. <Canvas> <Story id="components-{{atomNameLowercase}}--story-with-canvas" /> </Canvas> ## Props <ArgsTable story={PRIMARY_STORY} />
5,110
0
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom/templates/Atom.scss.mustache
.{{kebabCaseName}} {}
5,111
0
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom/templates/Atom.stories.tsx.mustache
import {{atomName}} from './{{atomName}}'; import mdx from './{{atomName}}.mdx'; export default { component: {{atomName}}, title: 'components/{{atomName}}', parameters: { docs: { page: mdx } }, }; export const Basic = () => ( <{{atomName}} /> ); export const StoryWithoutCanvas = () => ( <div>I am a story without a canvas</div> ); export const StoryWithCanvas = () => ( <div>I am a story with a canvas</div> );
5,112
0
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom/templates/Atom.test.tsx.mustache
import { render } from '@testing-library/react'; import {{atomName}} from './{{atomName}}'; describe('<{{atomName}} />', () => { it('should do something', () => { const { container } = render(<{{atomName}} />); }); });
5,113
0
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom/templates/Atom.tsx.mustache
import { ComponentPropsWithoutRef } from 'react'; import './{{atomName}}.scss'; export interface {{atomName}}Props extends ComponentPropsWithoutRef<'{{rootHtmlTag}}'> {} const {{atomName}} = (props: {{atomName}}Props) => { return <{{rootHtmlTag}} {...props} />; }; export default {{atomName}};
5,114
0
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom/templates/index.ts.mustache
export { default as {{atomName}} } from './{{atomName}}'; export * from './{{atomName}}';
5,115
0
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom/utils/log.ts
import chalk from 'chalk'; export const logIntro = (name: string) => { console.info('\n'); console.info(`${chalk.bold.yellowBright('⚛')} Creating ${chalk.bold.yellowBright(name)} atom`); console.info('\n'); }; export const logItemCompletion = (successText: string) => { const checkMark = chalk.green('✓'); console.info(`${checkMark} ${successText}`); }; export const logConclusion = () => { console.info('\n'); console.info(chalk.bold.green('Atom created! 🚀 ')); console.info('\n'); }; export const logError = (error: string) => { console.info(chalk.bold.redBright('Error creating atom.')); console.info(chalk.redBright(error)); }; export const logComponentCreationError = (componentName: string) => { logError(`Component ${chalk.bold.redBright(componentName)} already exists.`); };
5,116
0
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom/utils/prettify.ts
import fs from 'fs'; import path from 'path'; import prettier from 'prettier'; const currentPath = process.cwd(); const config = JSON.parse( fs.readFileSync(path.join(currentPath, '../../.prettierrc'), { encoding: 'utf-8', flag: 'r' }) ); const prettify = (text: string, parser = 'typescript') => prettier.format(text, { ...config, parser }); export default prettify;
5,117
0
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom/utils/string.ts
export const toKebabCase = (str: string) => str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? '-' : '') + $.toLowerCase());
5,118
0
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom
petrpan-code/ProtonMail/WebClients/packages/atoms/create-atom/utils/templates.ts
import fs from 'fs/promises'; import { render } from 'mustache'; import { logItemCompletion } from './log'; import prettify from './prettify'; import { toKebabCase } from './string'; const getTemplateFile = (templateName: string) => fs.readFile(`./create-atom/templates/${templateName}`, { encoding: 'utf-8' }); // Use as follows - const writeTemplate = getWriteTemplate(atomDir) export const getWriteTemplate = (atomDir: string) => async (fileName: string, template: string) => { await fs.writeFile(`${atomDir}/${fileName}`, template, { encoding: 'utf-8' }); logItemCompletion(`${fileName} created.`); }; export const getAtomTemplate = async (atomName: string, rootHtmlTag: string) => { const template = await getTemplateFile(`Atom.tsx.mustache`); return prettify(render(template, { atomName, rootHtmlTag })); }; export const getIndexTemplate = async (atomName: string) => { const template = await getTemplateFile(`index.ts.mustache`); return prettify(render(template, { atomName })); }; export const getTestTemplate = async (atomName: string) => { const template = await getTemplateFile(`Atom.test.tsx.mustache`); return prettify(render(template, { atomName })); }; export const getStylesTemplate = async (atomName: string) => { const template = await getTemplateFile(`Atom.scss.mustache`); return prettify(render(template, { kebabCaseName: toKebabCase(atomName) }), 'scss'); }; export const getMdxTemplate = async (atomName: string) => { const template = await getTemplateFile(`Atom.mdx.mustache`); return prettify(render(template, { atomName, atomNameLowercase: atomName.toLowerCase() }), 'mdx'); }; export const getStoriesTemplate = async (atomName: string) => { const template = await getTemplateFile(`Atom.stories.tsx.mustache`); return prettify(render(template, { atomName })); }; export const appendAtomToIndex = async (atomsDir: string, atomName: string) => { const indexFilePath = `${atomsDir}/index.ts`; const indexFile = await fs.readFile(indexFilePath, { encoding: 'utf-8' }); const lines = indexFile.split('\n'); lines.push(`export * from './${atomName}';`); lines.sort(); const output = await prettify(lines.join('\n')); await fs.writeFile(indexFilePath, output, { encoding: 'utf-8' }); };
5,119
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/.eslintrc.js
module.exports = { extends: ['@proton/eslint-config-proton'], parser: '@typescript-eslint/parser', parserOptions: { tsconfigRootDir: __dirname, project: './tsconfig.json', }, ignorePatterns: ['.eslintrc.js'], };
5,120
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/gen-accent-shades.test.ts
import tinycolor, { Instance as Color } from 'tinycolor2'; import genAccentShades from './gen-accent-shades'; const getOriginal = (c: Color) => c.getOriginalInput(); describe('genAccentShades', () => { it('generates the necessary shades for an accent color', () => { const output = genAccentShades(tinycolor({ h: 240, s: 1, l: 0.75 })); expect(output.map(getOriginal)).toEqual([ { h: 240, s: 1, l: 0.75 }, { h: 240, s: 0.95, l: 0.7 }, { h: 240, s: 0.9, l: 0.65 }, ]); }); it("doesn't allow values to drop below 0", () => { const output = genAccentShades(tinycolor({ h: 100, s: 0.01, l: 0.01 })); expect(output.map(getOriginal)).toEqual([ { h: 100, s: 0.01, l: 0.01 }, { h: 100, s: 0, l: 0 }, { h: 100, s: 0, l: 0 }, ]); }); });
5,121
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/gen-accent-shades.ts
import tinycolor, { Instance as Color } from 'tinycolor2'; function genAccentColorShades(base: Color) { const hsl = base.toHsl(); return [ base, tinycolor({ h: hsl.h, s: Math.max(0, hsl.s - 0.05), l: Math.max(0, hsl.l - 0.05), }), tinycolor({ h: hsl.h, s: Math.max(0, hsl.s - 0.1), l: Math.max(0, hsl.l - 0.1), }), ]; } export default genAccentColorShades;
5,122
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/gen-button-shades.test.ts
import tinycolor from 'tinycolor2'; import genButtonShades from './gen-button-shades'; describe('genButtonShades', () => { it('generates the necessary shades for a button', () => { const output = genButtonShades(tinycolor('#6d4aff'), true); expect(output.map((c) => c.toHexString())).toEqual([ '#f0edff', '#e2dbff', '#6d4aff', '#6243e6', '#573bcc', '#4c34b3', ]); }); it("generates the necessary button shades when the color's hue is between 30 & 60", () => { const output = genButtonShades(tinycolor('#ff9900'), true); expect(output.map((c) => c.toHexString())).toEqual([ '#fff5e6', '#ffebcc', '#ff9900', '#f27d00', '#e66300', '#d94c00', ]); }); it("generates the necessary button shades when the color's saturation is less than or equal to 30", () => { const output = genButtonShades(tinycolor('#eae7e4'), true); expect(output.map((c) => c.toHexString())).toEqual([ '#f9f8f7', '#f5f3f2', '#eae7e4', '#dedbd9', '#d3d0cd', '#c7c4c2', ]); }); });
5,123
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/gen-button-shades.ts
import tinycolor, { Instance as Color } from 'tinycolor2'; import isBetween from '@proton/utils/isBetween'; import shade from './shade'; import tint from './tint'; function genMutation(color: Color) { return function (mutation: number) { const clone = color.clone(); return mutation > 0 ? tint(clone, mutation) : shade(clone, Math.abs(mutation)); }; } function genButtonShades(base: Color, light: boolean) { const hsv = base.toHsv(); if (hsv.s <= 0.3) { if (light) { return [70, 50, 0, -5, -10, -15].map(genMutation(base)); } else { return [-70, -50, 0, 10, 20, 30].map(genMutation(base)); } } if (isBetween(hsv.h, 30, 60)) { if (light) { const tinted = [90, 80, 0].map(genMutation(base)); const shaded = [-5, -10, -15].map(genMutation(base)).map((c, i) => { const hsl = c.toHsl(); hsl.h = hsl.h - 5 * (i + 1); return tinycolor(hsl); }); return [...tinted, ...shaded]; } else { const shaded = [-80, -70].map(genMutation(base)).map((c) => { const hsl = c.toHsl(); hsl.h = hsl.h - 15; return tinycolor(hsl); }); const tinted = [0, 10, 20, 30].map(genMutation(base)); return [...shaded, ...tinted]; } } if (light) { return [90, 80, 0, -10, -20, -30].map(genMutation(base)); } else { return [-80, -70, 0, 10, 20, 30].map(genMutation(base)); } } export default genButtonShades;
5,124
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/gen-themes-cli.ts
import { main } from './gen-themes'; import config from './themes.config'; config.forEach((config) => { main(config); console.log('created', config.output); });
5,125
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/gen-themes.test.ts
import { describe, jest } from '@jest/globals'; import fs from 'fs'; import { main } from './gen-themes'; import config from './themes.config'; describe('genThemes', () => { it('generates the necessary shades for a button', async () => { jest.spyOn(fs, 'writeFileSync'); await main(config[0]); expect(fs.writeFileSync).toHaveBeenCalledTimes(1); expect(fs.writeFileSync).toHaveBeenCalledWith( './themes/dist/snow.theme.css', expect.stringContaining(':root,\n' + '.ui-standard {\n' + ' --primary: #6d4aff;') ); }); });
5,126
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/gen-themes.ts
import cssTree from 'css-tree'; import fs from 'fs'; import prettier from 'prettier'; import tiny from 'tinycolor2'; import genButtonShades from './gen-button-shades'; import { ThemeConfig, ThemeFileType } from './themes.config'; function generateTheme({ source, type }: { source: string; type: ThemeFileType }) { const buttonBases = [ 'signal-danger', 'signal-warning', 'signal-info', 'signal-success', 'interaction-norm', 'interaction-weak', ]; const buttonShadeNames = ['-minor-2', '-minor-1', '', '-major-1', '-major-2', '-major-3', '-contrast']; const ast = cssTree.parse(source); cssTree.walk(ast, (node, item, list) => { if (node.type !== 'Declaration') { return; } if (node.value.type !== 'Raw') { return; } const baseName = node.property.substring(2); if (!buttonBases.includes(baseName)) { return; } /* * make sure we don't visit the same base name again * by removing it from the array of button base names */ buttonBases.splice(buttonBases.indexOf(baseName), 1); const isLight = type === 'light'; const base = tiny(node.value.value); const buttonShades = genButtonShades(base, isLight); /* here we don't use tiny.mostReadable to prioritize white against black color. */ const buttonContrast = tiny(tiny.isReadable(base, 'white', { level: 'AA', size: 'large' }) ? 'white' : 'black'); // use original input when color contains alpha channel (opacity, eg. rgba) const declarations = [...buttonShades, buttonContrast].map((color, i) => list.createItem({ type: 'Declaration', important: false, property: '--' + baseName + buttonShadeNames[i], value: { type: 'Raw', value: color.getAlpha() == 1 ? color.toHexString() : color.toString() }, }) ); if (!item.next) { for (const declaration of declarations) { list.append(declaration); } } else { /* list.insert() inserts after the next element so we reverse insertion order */ for (let i = declarations.length - 1; i >= 0; i--) { list.insert(declarations[i], item.next); } } /* base is consumed, we don't need it any more and we don't want to re-visit */ list.remove(item); }); return cssTree.generate(ast); } export async function main({ output, files }: ThemeConfig) { const sources = files.map(({ path, type }) => ({ source: fs.readFileSync(path, { encoding: 'utf-8' }), type, })); const generatedCssFiles = sources.map(generateTheme); const autoGenerateDisclaimer = [ '/*', ' * This file is automatically generated.', ' * Manual changes will be lost.', ' */', ].join('\n'); const cssFile = [autoGenerateDisclaimer, ...generatedCssFiles].join('\n\n'); const prettierCssFile = await prettier.format(cssFile, { parser: 'css' }); fs.writeFileSync(output, prettierCssFile); return output; }
5,127
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/get-variable-from-theme-color.ts
import { ThemeColor } from './types'; const getVariableFromThemeColor = (name: ThemeColor) => name === 'norm' || name === 'weak' ? `--interaction-${name}` : `--signal-${name}`; export default getVariableFromThemeColor;
5,128
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/hue.ts
import tinycolor, { Instance as Color } from 'tinycolor2'; import percentOf from '@proton/utils/percentOf'; function hue(percent: number) { return function (color: Color) { const hsl = color.toHsl(); hsl.h = hsl.h + percentOf(percent, hsl.h); return tinycolor(hsl); }; } export default hue;
5,129
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/index.ts
export { default as genAccentShades } from './gen-accent-shades'; export { default as getVariableFromThemeColor } from './get-variable-from-theme-color'; export * from './types';
5,130
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/jest.config.js
module.exports = { preset: 'ts-jest', testEnvironment: 'node', collectCoverageFrom: ['*.ts', '!tool/*', '!index.ts', '!*.config.ts', '!types.ts'], coverageReporters: ['text', 'lcov', 'cobertura'], coverageThreshold: { global: { branches: 33, functions: 43, lines: 42, statements: 41, }, }, };
5,131
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/package.json
{ "name": "@proton/colors", "description": "Package containing the logic for Proton's design system color computations", "scripts": { "build": "webpack-cli", "check-types": "tsc", "generate": "ts-node --skipProject gen-themes-cli", "lint": "eslint . --ext ts --quiet --cache", "test": "NODE_OPTIONS=--experimental-vm-modules jest --coverage --runInBand --ci", "test:dev": "jest --watch" }, "dependencies": { "@proton/shared": "workspace:^", "@types/node": "^20.9.3", "css-tree": "^2.3.1", "prettier": "^3.1.0", "tinycolor2": "^1.6.0" }, "devDependencies": { "@proton/eslint-config-proton": "workspace:^", "@types/css-tree": "^2.3.4", "@types/jest": "^29.5.9", "@types/tinycolor2": "^1.4.6", "eslint": "^8.54.0", "jest": "^29.7.0", "ts-jest": "^29.1.1", "ts-loader": "^9.5.1", "ts-node": "^10.9.1", "typescript": "^5.3.2", "webpack": "^5.89.0", "webpack-cli": "^5.1.4" } }
5,132
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/shade.test.ts
import tinycolor from 'tinycolor2'; import shade from './shade'; describe('shade', () => { it('shades a color', () => { /* in steps of 10 from 0 to 100*/ const expectedByBase = { '#6d4aff': [ '#6d4aff', '#6243e6', '#573bcc', '#4c34b3', '#412c99', '#372580', '#2c1e66', '#21164d', '#160f33', '#0b071a', '#000000', ], '#DB3251': [ '#db3251', '#c52d49', '#af2841', '#992339', '#831e31', '#6e1929', '#581420', '#420f18', '#2c0a10', '#160508', '#000000', ], }; for (const [input, outputs] of Object.entries(expectedByBase)) { for (const [index, expected] of Object.entries(outputs)) { const output = shade(tinycolor(input), Number(index) * 10); expect(output.toHexString()).toBe(expected); } } }); });
5,133
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/shade.ts
import tiny, { Instance as Color } from 'tinycolor2'; import percentOf from '@proton/utils/percentOf'; function shade(color: Color, percent: number) { const rgb = color.toRgb(); rgb.r = percentOf(100 - percent, rgb.r); rgb.g = percentOf(100 - percent, rgb.g); rgb.b = percentOf(100 - percent, rgb.b); return tiny(rgb); } export default shade;
5,134
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/themes.config.ts
export type ThemeFileType = 'light' | 'dark'; export interface FileConfig { path: string; type: ThemeFileType; } export interface ThemeConfig { output: string; files: FileConfig[]; } const config: ThemeConfig[] = [ { output: './themes/dist/snow.theme.css', files: [ { path: './themes/src/snow/standard-base.css', type: 'light', }, ], }, { output: './themes/dist/classic.theme.css', files: [ { path: './themes/src/classic/standard-base.css', type: 'light', }, { path: './themes/src/classic/prominent-base.css', type: 'dark', }, ], }, { output: './themes/dist/carbon.theme.css', files: [ { path: './themes/src/carbon/standard-base.css', type: 'dark', }, ], }, { output: './themes/dist/contrast-light.theme.css', files: [ { path: './themes/src/contrast-light/standard-base.css', type: 'light', }, ], }, { output: './themes/dist/contrast-dark.theme.css', files: [ { path: './themes/src/contrast-dark/standard-base.css', type: 'dark', }, { path: './themes/src/contrast-dark/prominent-base.css', type: 'dark', }, ], }, { output: './themes/dist/duotone.theme.css', files: [ { path: './themes/src/duotone/standard-base.css', type: 'light', }, { path: './themes/src/duotone/prominent-base.css', type: 'dark', }, ], }, { output: './themes/dist/legacy.theme.css', files: [ { path: './themes/src/legacy/standard-base.css', type: 'light', }, { path: './themes/src/legacy/prominent-base.css', type: 'dark', }, ], }, { output: './themes/dist/monokai.theme.css', files: [ { path: './themes/src/monokai/standard-base.css', type: 'dark', }, ], }, { output: './themes/dist/pass.theme.css', files: [ { path: './themes/src/pass/standard-base.css', type: 'dark', }, { path: './themes/src/pass/violet-base.css', type: 'dark', }, { path: './themes/src/pass/teal-base.css', type: 'dark', }, { path: './themes/src/pass/orange-base.css', type: 'dark', }, { path: './themes/src/pass/red-base.css', type: 'dark', }, { path: './themes/src/pass/lime-base.css', type: 'dark', }, ], }, ]; export default config;
5,135
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/tint.test.ts
import tinycolor from 'tinycolor2'; import tint from './tint'; describe('tint', () => { it('tints a color', () => { /* in steps of 10 from 0 to 100*/ const expectedByBase = { '#6d4aff': [ '#6d4aff', '#7c5cff', '#8a6eff', '#9980ff', '#a792ff', '#b6a5ff', '#c5b7ff', '#d3c9ff', '#e2dbff', '#f0edff', '#ffffff', ], '#db3251': [ '#db3251', '#df4762', '#e25b74', '#e67085', '#e98497', '#ed99a8', '#f1adb9', '#f4c2cb', '#f8d6dc', '#fbebee', '#ffffff', ], }; for (const [input, outputs] of Object.entries(expectedByBase)) { for (const [index, expected] of Object.entries(outputs)) { const output = tint(tinycolor(input), Number(index) * 10); expect(output.toHexString()).toBe(expected); } } }); });
5,136
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/tint.ts
import tiny, { Instance as Color } from 'tinycolor2'; import percentOf from '@proton/utils/percentOf'; function tint(color: Color, percent: number) { const rgb = color.toRgb(); rgb.r = rgb.r + percentOf(percent, 255 - rgb.r); rgb.g = rgb.g + percentOf(percent, 255 - rgb.g); rgb.b = rgb.b + percentOf(percent, 255 - rgb.b); return tiny(rgb); } export default tint;
5,137
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/tsconfig.json
{ "extends": "../../tsconfig.base.json", "compilerOptions": { "types": ["jest", "node"] } }
5,138
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/tsconfig.tool.json
{ "compilerOptions": { "esModuleInterop": true, "skipLibCheck": true }, "include": ["./tool/tool.ts"] }
5,139
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/types.ts
export enum ThemeColor { Norm = 'norm', Weak = 'weak', Danger = 'danger', Warning = 'warning', Success = 'success', Info = 'info', } export type ThemeColorUnion = `${ThemeColor}`;
5,140
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/colors/webpack.config.js
const path = require('path'); module.exports = { entry: './tool/tool.ts', stats: 'minimal', mode: 'production', module: { rules: [ { test: /\.ts?$/, exclude: /node_modules/, use: { loader: 'ts-loader', options: { configFile: 'tsconfig.tool.json' }, }, }, ], }, resolve: { extensions: ['.ts'], }, output: { filename: 'bundle.js', path: path.resolve(__dirname, 'tool'), }, };
5,141
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes
petrpan-code/ProtonMail/WebClients/packages/colors/themes/dist/carbon.theme.css
/* * This file is automatically generated. * Manual changes will be lost. */ :root, .ui-standard { --primary: #8a6eff; --primary-contrast: white; --signal-danger-minor-2: #310b12; --signal-danger-minor-1: #4a111b; --signal-danger: #f5385a; --signal-danger-major-1: #f64c6b; --signal-danger-major-2: #f7607b; --signal-danger-major-3: #f8748c; --signal-danger-contrast: #ffffff; --signal-warning-minor-2: #331200; --signal-warning-minor-1: #4d1b00; --signal-warning: #ff9900; --signal-warning-major-1: #ffa31a; --signal-warning-major-2: #ffad33; --signal-warning-major-3: #ffb84d; --signal-warning-contrast: #000000; --signal-success-minor-2: #06221b; --signal-success-minor-1: #093228; --signal-success: #1ea885; --signal-success-major-1: #35b191; --signal-success-major-2: #4bb99d; --signal-success-major-3: #62c2aa; --signal-success-contrast: #ffffff; --signal-info-minor-2: #072029; --signal-info-minor-1: #0b2f3e; --signal-info: #239ece; --signal-info-major-1: #39a8d3; --signal-info-major-2: #4fb1d8; --signal-info-major-3: #65bbdd; --signal-info-contrast: #ffffff; --interaction-norm-minor-2: #160f33; --interaction-norm-minor-1: #21164d; --interaction-norm: #6d4aff; --interaction-norm-major-1: #7c5cff; --interaction-norm-major-2: #8a6eff; --interaction-norm-major-3: #9980ff; --interaction-norm-contrast: #ffffff; --interaction-weak-minor-2: #16151a; --interaction-weak-minor-1: #25232c; --interaction-weak: #4a4658; --interaction-weak-major-1: #5c5969; --interaction-weak-major-2: #6e6b79; --interaction-weak-major-3: #807e8a; --interaction-weak-contrast: #ffffff; --text-norm: white; --text-weak: #a7a4b5; --text-hint: #6d697d; --text-disabled: #5b576b; --text-invert: #1c1b24; --field-norm: #5b576b; --field-hover: #6d697d; --field-disabled: #3f3b4c; --focus-outline: #6d4aff; --focus-ring: rgb(109 74 255 / 0.3); --border-norm: #4a4658; --border-weak: #343140; --background-norm: #16141c; --background-weak: #292733; --background-strong: #3f3b4c; --background-invert: white; --interaction-default: transparent; --interaction-default-hover: rgb(91 87 107 / 0.2); --interaction-default-active: rgb(91 87 107 / 0.4); --shadow-norm-opacity: 0.5; --shadow-lifted-opacity: 0.75; --backdrop-norm: rgb(0 0 0 / 0.48); --optional-scrollbar-thumb-color: #4a4658; --optional-scrollbar-thumb-hover-color: #5b576b; --optional-link-norm: var(--interaction-norm-major-1); --optional-link-hover: var(--interaction-norm-major-2); --optional-link-active: var(--interaction-norm-major-3); --optional-background-elevated: #1e1c26; --optional-background-lowered: var(--background-norm); --optional-email-item-unread-background-color: var( --optional-background-elevated ); --optional-email-item-read-background-color: var( --optional-background-lowered ); --optional-email-item-read-text-color: var(--text-weak); --optional-mini-calendar-today-color: white; --optional-logo-text-proton-color: white; --optional-logo-text-product-color: white; --optional-promotion-text-color: white; --optional-promotion-text-weak: #c1b2ff; --optional-promotion-interaction-hover: rgb(138 110 255 / 0.2); --optional-promotion-background-start: rgb(138 110 255 / 0.3); --optional-promotion-background-end: rgb(99 61 255 / 0.1); }
5,142
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes
petrpan-code/ProtonMail/WebClients/packages/colors/themes/dist/classic.theme.css
/* * This file is automatically generated. * Manual changes will be lost. */ :root, .ui-standard { --primary: #657ee4; --primary-contrast: white; --signal-danger-minor-2: #fbeaeb; --signal-danger-minor-1: #f6d5d6; --signal-danger: #d42f34; --signal-danger-major-1: #bf2a2f; --signal-danger-major-2: #aa262a; --signal-danger-major-3: #942124; --signal-danger-contrast: #ffffff; --signal-warning-minor-2: #fef3e7; --signal-warning-minor-1: #fde6ce; --signal-warning: #f5830a; --signal-warning-major-1: #e96a0a; --signal-warning-major-2: #dc5309; --signal-warning-major-3: #d03d09; --signal-warning-contrast: #000000; --signal-success-minor-2: #e8f3ef; --signal-success-minor-1: #d1e7df; --signal-success: #1b8561; --signal-success-major-1: #187857; --signal-success-major-2: #166a4e; --signal-success-major-3: #135d44; --signal-success-contrast: #ffffff; --signal-info-minor-2: #e8f2fa; --signal-info-minor-1: #d0e4f5; --signal-info: #1578cf; --signal-info-major-1: #136cba; --signal-info-major-2: #1160a6; --signal-info-major-3: #0f5491; --signal-info-contrast: #ffffff; --interaction-norm-minor-2: #f0f2fc; --interaction-norm-minor-1: #e0e5fa; --interaction-norm: #657ee4; --interaction-norm-major-1: #5b71cd; --interaction-norm-major-2: #5165b6; --interaction-norm-major-3: #4758a0; --interaction-norm-contrast: #ffffff; --interaction-weak-minor-2: #f1f2f4; --interaction-weak-minor-1: #e8e9ed; --interaction-weak: #d0d3da; --interaction-weak-major-1: #c6c8cf; --interaction-weak-major-2: #bbbec4; --interaction-weak-major-3: #b1b3b9; --interaction-weak-contrast: #000000; --text-norm: #262a33; --text-weak: #585d69; --text-hint: #a4a9b5; --text-disabled: #babec7; --text-invert: white; --field-norm: #babec7; --field-hover: #a4a9b5; --field-disabled: #d0d3da; --focus-outline: #657ee4; --focus-ring: rgb(101 126 228 / 0.2); --border-norm: #d0d3da; --border-weak: #e7e9ec; --background-norm: white; --background-weak: #f3f4f6; --background-strong: #e7e9ec; --background-invert: #0c0c14; --interaction-default: transparent; --interaction-default-hover: rgb(186 190 199 / 0.2); --interaction-default-active: rgb(186 190 199 / 0.3); --shadow-norm-opacity: 0.1; --shadow-lifted-opacity: 0.16; --backdrop-norm: rgb(38 42 51 / 0.48); --optional-scrollbar-thumb-color: #d0d3da; --optional-scrollbar-thumb-hover-color: #babec7; --optional-font-family: system-ui, sans-serif; --optional-border-radius: 3; --optional-main-border-width: 0; --optional-email-item-read-background-color: #f7f8fa; --optional-logo-text-proton-color: initial; --optional-logo-text-product-color: initial; --optional-promotion-text-color: #15006f; --optional-promotion-text-weak: #50409b; --optional-promotion-interaction-hover: rgb(109 74 255 / 0.08); --optional-promotion-background-start: rgb(109 74 255 / 0.15); --optional-promotion-background-end: rgb(70 26 255 / 0.04); } .ui-prominent { --signal-danger-minor-2: #2f0f10; --signal-danger-minor-1: #471718; --signal-danger: #ed4c51; --signal-danger-major-1: #ef5e62; --signal-danger-major-2: #f17074; --signal-danger-major-3: #f28285; --signal-danger-contrast: #ffffff; --signal-warning-minor-2: #311202; --signal-warning-minor-1: #491a03; --signal-warning: #f5930a; --signal-warning-major-1: #f69e23; --signal-warning-major-2: #f7a93b; --signal-warning-major-3: #f8b354; --signal-warning-contrast: #000000; --signal-success-minor-2: #0a1d17; --signal-success-minor-1: #102c22; --signal-success: #349172; --signal-success-major-1: #489c80; --signal-success-major-2: #5da78e; --signal-success-major-3: #71b29c; --signal-success-contrast: #ffffff; --signal-info-minor-2: #091b2c; --signal-info-minor-1: #0d2942; --signal-info: #2c89db; --signal-info-major-1: #4195df; --signal-info-major-2: #56a1e2; --signal-info-major-3: #6bace6; --signal-info-contrast: #ffffff; --interaction-norm-minor-2: #14192e; --interaction-norm-minor-1: #1e2644; --interaction-norm: #657ee4; --interaction-norm-major-1: #748be7; --interaction-norm-major-2: #8498e9; --interaction-norm-major-3: #93a5ec; --interaction-norm-contrast: #ffffff; --interaction-weak-minor-2: #0b0c13; --interaction-weak-minor-1: #10131d; --interaction-weak: #353e60; --interaction-weak-major-1: #495170; --interaction-weak-major-2: #5d6580; --interaction-weak-major-3: #727890; --interaction-weak-contrast: #ffffff; --text-norm: white; --text-weak: #949bb9; --text-hint: #565f84; --text-disabled: #444e72; --text-invert: #1c223d; --field-norm: #565f84; --field-hover: #949bb9; --field-disabled: #353e60; --focus-outline: #657ee4; --focus-ring: rgb(101 126 228 / 0.2); --border-norm: #353e60; --border-weak: #2d3657; --background-norm: #1c223d; --background-weak: #272f4f; --background-strong: #2d3657; --interaction-default: transparent; --interaction-default-hover: rgb(68 78 114 / 0.3); --interaction-default-active: rgb(68 78 114 / 0.4); --shadow-norm-opacity: 0.32; --shadow-lifted-opacity: 0.4; --backdrop-norm: rgb(0 0 0 / 0.32); --optional-scrollbar-thumb-color: #353e60; --optional-scrollbar-thumb-hover-color: #444e72; --optional-logo-text-proton-color: white; --optional-logo-text-product-color: white; }
5,143
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes
petrpan-code/ProtonMail/WebClients/packages/colors/themes/dist/contrast-dark.theme.css
/* * This file is automatically generated. * Manual changes will be lost. */ :root, .ui-standard { --primary: #489aff; --primary-contrast: white; --signal-danger-minor-2: #2b0008; --signal-danger-minor-1: #40000c; --signal-danger: #d50027; --signal-danger-major-1: #d91a3d; --signal-danger-major-2: #dd3352; --signal-danger-major-3: #e24d68; --signal-danger-contrast: #ffffff; --signal-warning-minor-2: #2c1300; --signal-warning-minor-1: #421d00; --signal-warning: #db5f00; --signal-warning-major-1: #df6f1a; --signal-warning-major-2: #e27f33; --signal-warning-major-3: #e68f4d; --signal-warning-contrast: #ffffff; --signal-success-minor-2: #002219; --signal-success-minor-1: #003226; --signal-success: #00a87e; --signal-success-major-1: #1ab18b; --signal-success-major-2: #33b998; --signal-success-major-3: #4dc2a5; --signal-success-contrast: #ffffff; --signal-info-minor-2: #00202d; --signal-info-minor-1: #003144; --signal-info: #00a2e1; --signal-info-major-1: #1aabe4; --signal-info-major-2: #33b5e7; --signal-info-major-3: #4dbeea; --signal-info-contrast: #000000; --interaction-norm-minor-2: #001733; --interaction-norm-minor-1: #00234d; --interaction-norm: #0073ff; --interaction-norm-major-1: #1a81ff; --interaction-norm-major-2: #338fff; --interaction-norm-major-3: #4d9dff; --interaction-norm-contrast: #ffffff; --interaction-weak-minor-2: #191b20; --interaction-weak-minor-1: #292e36; --interaction-weak: #525b6c; --interaction-weak-major-1: #636b7b; --interaction-weak-major-2: #757c89; --interaction-weak-major-3: #868c98; --interaction-weak-contrast: #ffffff; --text-norm: white; --text-weak: #cccccc; --text-hint: #999999; --text-disabled: #666666; --text-invert: black; --field-norm: #dddddd; --field-hover: white; --field-disabled: #aaaaaa; --focus-outline: #0073ff; --focus-ring: rgb(0 115 255 / 0.75); --border-norm: #dddddd; --border-weak: #777777; --background-norm: #0e0d12; --background-weak: #1e1c24; --background-strong: #2c2934; --background-invert: white; --interaction-default: transparent; --interaction-default-hover: rgb(91 87 107 / 0.6); --interaction-default-active: rgb(91 87 107 / 0.9); --shadow-norm-opacity: 0.5; --shadow-lifted-opacity: 0.75; --backdrop-norm: rgb(0 0 0 / 0.75); --optional-scrollbar-thumb-color: #999999; --optional-scrollbar-thumb-hover-color: #ffffff; --optional-link-norm: var(--interaction-norm-major-1); --optional-link-hover: var(--interaction-norm-major-2); --optional-link-active: var(--interaction-norm-major-3); --optional-email-item-unread-background-color: black; --optional-email-item-read-background-color: var(--background-norm); --optional-email-item-read-text-color: var(--text-weak); --optional-mini-calendar-today-color: white; --optional-logo-text-proton-color: white; --optional-logo-text-product-color: white; --optional-promotion-text-color: white; --optional-promotion-text-weak: #b2d0ff; --optional-promotion-interaction-hover: rgba(110 166 255 / 0.2); --optional-promotion-background-start: rgba(110 156 255 / 0.3); --optional-promotion-background-end: rgba(61 122 255 / 0.1); } .ui-prominent { --background-norm: black; }
5,144
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes
petrpan-code/ProtonMail/WebClients/packages/colors/themes/dist/contrast-light.theme.css
/* * This file is automatically generated. * Manual changes will be lost. */ :root, .ui-standard { --primary: #4630a6; --primary-contrast: white; --signal-danger-minor-2: #fcebee; --signal-danger-minor-1: #f8d6dc; --signal-danger: #dc3251; --signal-danger-major-1: #c62d49; --signal-danger-major-2: #b02841; --signal-danger-major-3: #9a2339; --signal-danger-contrast: #ffffff; --signal-warning-minor-2: #fff5e6; --signal-warning-minor-1: #ffebcc; --signal-warning: #ff9900; --signal-warning-major-1: #f27d00; --signal-warning-major-2: #e66300; --signal-warning-major-3: #d94c00; --signal-warning-contrast: #000000; --signal-success-minor-2: #e8f3f0; --signal-success-minor-1: #d0e6e1; --signal-success: #168368; --signal-success-major-1: #14765e; --signal-success-major-2: #126953; --signal-success-major-3: #0f5c49; --signal-success-contrast: #ffffff; --signal-info-minor-2: #e8edfb; --signal-info-minor-1: #d2dcf7; --signal-info: #1d4ed8; --signal-info-major-1: #1a46c2; --signal-info-major-2: #173ead; --signal-info-major-3: #143797; --signal-info-contrast: #ffffff; --interaction-norm-minor-2: #edeaf6; --interaction-norm-minor-1: #dad6ed; --interaction-norm: #4630a6; --interaction-norm-major-1: #3f2b95; --interaction-norm-major-2: #382685; --interaction-norm-major-3: #312274; --interaction-norm-contrast: #ffffff; --interaction-weak-minor-2: #f1f1f1; --interaction-weak-minor-1: #e8e8e8; --interaction-weak: #d1d1d1; --interaction-weak-major-1: #c7c7c7; --interaction-weak-major-2: #bcbcbc; --interaction-weak-major-3: #b2b2b2; --interaction-weak-contrast: #000000; --text-norm: #000000; --text-weak: #4d4d4d; --text-hint: #666666; --text-disabled: #767676; --text-invert: white; --field-norm: #4d4d4d; --field-hover: #333333; --field-disabled: #b8b8b8; --focus-outline: #4630a6; --focus-ring: rgb(70 48 166 / 0.75); --border-norm: #888888; --border-weak: #aaaaaa; --background-norm: #ffffff; --background-weak: #f5f5f5; --background-strong: #e6e6e6; --background-invert: #0c0c14; --interaction-default: transparent; --interaction-default-hover: rgb(194 194 194 / 0.3); --interaction-default-active: rgb(194 194 194 / 0.6); --shadow-norm-opacity: 0.1; --shadow-lifted-opacity: 0.16; --backdrop-norm: rgb(0 0 0 / 0.32); --optional-scrollbar-thumb-color: #c2c2c2; --optional-scrollbar-thumb-hover-color: #a8a8a8; --optional-logo-text-proton-color: #1b1340; --optional-logo-text-product-color: #6d4aff; --optional-promotion-text-color: #15006f; --optional-promotion-text-weak: #50409b; --optional-promotion-interaction-hover: rgb(109 74 255 / 0.08); --optional-promotion-background-start: rgb(109 74 255 / 0.15); --optional-promotion-background-end: rgb(70 26 255 / 0.04); }
5,145
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes
petrpan-code/ProtonMail/WebClients/packages/colors/themes/dist/contrast.theme.css
/* * This file is automatically generated. * Manual changes will be lost. */ :root, .ui-standard { --primary: #4630a6; --primary-contrast: white; --signal-danger-minor-2: #fcebee; --signal-danger-minor-1: #f8d6dc; --signal-danger: #dc3251; --signal-danger-major-1: #c62d49; --signal-danger-major-2: #b02841; --signal-danger-major-3: #9a2339; --signal-danger-contrast: #ffffff; --signal-warning-minor-2: #fff5e6; --signal-warning-minor-1: #ffebcc; --signal-warning: #ff9900; --signal-warning-major-1: #f27d00; --signal-warning-major-2: #e66300; --signal-warning-major-3: #d94c00; --signal-warning-contrast: #000000; --signal-success-minor-2: #e8f3f0; --signal-success-minor-1: #d0e6e1; --signal-success: #168368; --signal-success-major-1: #14765e; --signal-success-major-2: #126953; --signal-success-major-3: #0f5c49; --signal-success-contrast: #ffffff; --signal-info-minor-2: #e8edfb; --signal-info-minor-1: #d2dcf7; --signal-info: #1d4ed8; --signal-info-major-1: #1a46c2; --signal-info-major-2: #173ead; --signal-info-major-3: #143797; --signal-info-contrast: #ffffff; --interaction-norm-minor-2: #edeaf6; --interaction-norm-minor-1: #dad6ed; --interaction-norm: #4630a6; --interaction-norm-major-1: #3f2b95; --interaction-norm-major-2: #382685; --interaction-norm-major-3: #312274; --interaction-norm-contrast: #ffffff; --interaction-weak-minor-2: #f1f1f1; --interaction-weak-minor-1: #e8e8e8; --interaction-weak: #d1d1d1; --interaction-weak-major-1: #c7c7c7; --interaction-weak-major-2: #bcbcbc; --interaction-weak-major-3: #b2b2b2; --interaction-weak-contrast: #000000; --text-norm: #000000; --text-weak: #4d4d4d; --text-hint: #666666; --text-disabled: #767676; --text-invert: white; --field-norm: #4d4d4d; --field-hover: #333333; --field-disabled: #b8b8b8; --focus-outline: #4630a6; --focus-ring: rgb(70 48 166 / 0.2); --border-norm: #a8a8a8; --border-weak: #c2c2c2; --background-norm: #ffffff; --background-weak: #f5f5f5; --background-strong: #e6e6e6; --background-invert: #0c0c14; --interaction-default: transparent; --interaction-default-hover: rgb(194 194 194 / 0.3); --interaction-default-active: rgb(194 194 194 / 0.6); --shadow-norm-opacity: 0.1; --shadow-lifted-opacity: 0.16; --backdrop-norm: rgb(0 0 0 / 0.32); --optional-scrollbar-thumb-color: #c2c2c2; --optional-scrollbar-thumb-hover-color: #a8a8a8; --optional-logo-text-proton-color: #1b1340; --optional-logo-text-product-color: #6d4aff; --optional-promotion-text-color: #15006f; --optional-promotion-text-weak: #50409b; --optional-promotion-interaction-hover: rgb(109 74 255 / 0.08); --optional-promotion-background-start: rgb(109 74 255 / 0.15); --optional-promotion-background-end: rgb(70 26 255 / 0.04); }
5,146
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes
petrpan-code/ProtonMail/WebClients/packages/colors/themes/dist/duotone.theme.css
/* * This file is automatically generated. * Manual changes will be lost. */ :root, .ui-standard { --primary: #6d4aff; --primary-contrast: white; --signal-danger-minor-2: #fcebee; --signal-danger-minor-1: #f8d6dc; --signal-danger: #dc3251; --signal-danger-major-1: #c62d49; --signal-danger-major-2: #b02841; --signal-danger-major-3: #9a2339; --signal-danger-contrast: #ffffff; --signal-warning-minor-2: #fff5e6; --signal-warning-minor-1: #ffebcc; --signal-warning: #ff9900; --signal-warning-major-1: #f27d00; --signal-warning-major-2: #e66300; --signal-warning-major-3: #d94c00; --signal-warning-contrast: #000000; --signal-success-minor-2: #e9f6f3; --signal-success-minor-1: #d2eee7; --signal-success: #1ea885; --signal-success-major-1: #1b9778; --signal-success-major-2: #18866a; --signal-success-major-3: #15765d; --signal-success-contrast: #ffffff; --signal-info-minor-2: #e9f5fa; --signal-info-minor-1: #d3ecf5; --signal-info: #239ece; --signal-info-major-1: #208eb9; --signal-info-major-2: #1c7ea5; --signal-info-major-3: #196f90; --signal-info-contrast: #ffffff; --interaction-norm-minor-2: #f0edff; --interaction-norm-minor-1: #e2dbff; --interaction-norm: #6d4aff; --interaction-norm-major-1: #6243e6; --interaction-norm-major-2: #573bcc; --interaction-norm-major-3: #4c34b3; --interaction-norm-contrast: #ffffff; --interaction-weak-minor-2: #f9f8f7; --interaction-weak-minor-1: #f5f3f2; --interaction-weak: #eae7e4; --interaction-weak-major-1: #dedbd9; --interaction-weak-major-2: #d3d0cd; --interaction-weak-major-3: #c7c4c2; --interaction-weak-contrast: #000000; --text-norm: #0c0c14; --text-weak: #5c5958; --text-hint: #8f8d8a; --text-disabled: #c2bfbc; --text-invert: white; --field-norm: #adaba8; --field-hover: #8f8d8a; --field-disabled: #d1cfcd; --focus-outline: #6d4aff; --focus-ring: rgb(109 74 255 / 0.2); --border-norm: #d1cfcd; --border-weak: #eae7e4; --background-norm: white; --background-weak: #f5f4f2; --background-strong: #e5e4e1; --background-invert: #0c0c14; --interaction-default: transparent; --interaction-default-hover: rgb(194 193 192 / 0.2); --interaction-default-active: rgb(194 192 190 / 0.35); --shadow-primary-color: 109 74 255; --shadow-norm-opacity: 0.1; --shadow-lifted-opacity: 0.16; --backdrop-norm: rgb(38 42 51 / 0.48); --optional-scrollbar-thumb-color: #d1cfcd; --optional-scrollbar-thumb-hover-color: #c2bfbc; --optional-main-border-width: 0; --optional-email-item-read-text-color: #3d3c3c; --optional-email-item-selected-background-color: var( --interaction-norm-major-1 ); --optional-email-item-selected-icon-background-color: var( --interaction-norm-major-3 ); --optional-link-norm: initial; --optional-link-hover: initial; --optional-link-active: initial; --optional-mini-calendar-today-color: initial; --optional-logo-text-proton-color: initial; --optional-logo-text-product-color: initial; --optional-promotion-text-color: #15006f; --optional-promotion-text-weak: #50409b; --optional-promotion-interaction-hover: rgb(109 74 255 / 0.08); --optional-promotion-background-start: rgb(109 74 255 / 0.15); --optional-promotion-background-end: rgb(70 26 255 / 0.04); } .ui-prominent { --primary: #8a6eff; --primary-contrast: white; --signal-danger-minor-2: #310b12; --signal-danger-minor-1: #4a111b; --signal-danger: #f5385a; --signal-danger-major-1: #f64c6b; --signal-danger-major-2: #f7607b; --signal-danger-major-3: #f8748c; --signal-danger-contrast: #ffffff; --signal-warning-minor-2: #331200; --signal-warning-minor-1: #4d1b00; --signal-warning: #ff9900; --signal-warning-major-1: #ffa31a; --signal-warning-major-2: #ffad33; --signal-warning-major-3: #ffb84d; --signal-warning-contrast: #000000; --signal-success-minor-2: #06221b; --signal-success-minor-1: #093228; --signal-success: #1ea885; --signal-success-major-1: #35b191; --signal-success-major-2: #4bb99d; --signal-success-major-3: #62c2aa; --signal-success-contrast: #ffffff; --signal-info-minor-2: #072029; --signal-info-minor-1: #0b2f3e; --signal-info: #239ece; --signal-info-major-1: #39a8d3; --signal-info-major-2: #4fb1d8; --signal-info-major-3: #65bbdd; --signal-info-contrast: #ffffff; --interaction-norm-minor-2: #160f33; --interaction-norm-minor-1: #21164d; --interaction-norm: #6d4aff; --interaction-norm-major-1: #7c5cff; --interaction-norm-major-2: #8a6eff; --interaction-norm-major-3: #9980ff; --interaction-norm-contrast: #ffffff; --interaction-weak-minor-2: #0f0a24; --interaction-weak-minor-1: #171035; --interaction-weak: #4c34b2; --interaction-weak-major-1: #5e48ba; --interaction-weak-major-2: #705dc1; --interaction-weak-major-3: #8271c9; --interaction-weak-contrast: #ffffff; --text-norm: white; --text-weak: #b3a3f5; --text-hint: #8067e4; --text-disabled: #5940bf; --text-invert: #1b1340; --field-norm: #9282d4; --field-hover: #7c5cff; --field-disabled: #38277a; --focus-outline: #6d4aff; --focus-ring: rgb(109 74 255 / 0.3); --border-norm: #413085; --border-weak: #3c2b80; --background-norm: #1b1340; --background-weak: #271c57; --background-strong: #38277a; --interaction-default: transparent; --interaction-default-hover: rgb(74 54 143 / 0.3); --interaction-default-active: rgb(74 57 143 / 0.5); --shadow-primary-color: 109 74 255; --shadow-norm-opacity: 0.32; --shadow-lifted-opacity: 0.4; --backdrop-norm: rgb(0 0 0 / 0.32); --optional-scrollbar-thumb-color: #413085; --optional-scrollbar-thumb-hover-color: #4a398f; --optional-link-norm: var(--interaction-norm-major-1); --optional-link-hover: var(--interaction-norm-major-2); --optional-link-active: var(--interaction-norm-major-3); --optional-mini-calendar-today-color: white; --optional-logo-text-proton-color: white; --optional-logo-text-product-color: white; }
5,147
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes
petrpan-code/ProtonMail/WebClients/packages/colors/themes/dist/legacy.theme.css
/* * This file is automatically generated. * Manual changes will be lost. */ :root, .ui-standard { --primary: #9397cd; --primary-contrast: white; --signal-danger-minor-2: #faf2f2; --signal-danger-minor-1: #f5e5e5; --signal-danger: #cb7c7c; --signal-danger-major-1: #b77070; --signal-danger-major-2: #a26363; --signal-danger-major-3: #8e5757; --signal-danger-contrast: #ffffff; --signal-danger-contrast: white; --signal-warning-minor-2: #fcf8e7; --signal-warning-minor-1: #f8f2ce; --signal-warning: #debc0b; --signal-warning-major-1: #d3a20a; --signal-warning-major-2: #c88a0a; --signal-warning-major-3: #bd7309; --signal-warning-contrast: #000000; --signal-warning-contrast: black; --signal-success-minor-2: #f4f8f2; --signal-success-minor-1: #e8f0e4; --signal-success: #8eb67a; --signal-success-major-1: #80a46e; --signal-success-major-2: #729262; --signal-success-major-3: #637f55; --signal-success-contrast: #000000; --signal-success-contrast: white; --signal-info-minor-2: #f2f6fb; --signal-info-minor-1: #e6ecf6; --signal-info: #80a1d2; --signal-info-major-1: #7391bd; --signal-info-major-2: #6681a8; --signal-info-major-3: #5a7193; --signal-info-contrast: #000000; --signal-info-contrast: white; --interaction-norm-minor-2: #dfe0f0; --interaction-norm-minor-1: #c9cbe6; --interaction-norm: #9397cd; --interaction-norm-major-1: #8c8fc3; --interaction-norm-major-2: #8488b9; --interaction-norm-major-3: #7d80ae; --interaction-norm-contrast: #000000; --interaction-norm-contrast: white; --interaction-weak-minor-2: #f0f2f5; --interaction-weak-minor-1: #e7e9ef; --interaction-weak: #ced2df; --interaction-weak-major-1: #c4c8d4; --interaction-weak-major-2: #b9bdc9; --interaction-weak-major-3: #afb3be; --interaction-weak-contrast: #000000; --text-norm: black; --text-weak: #737386; --text-hint: #aaaabd; --text-disabled: #bcbcd0; --text-invert: white; --field-norm: #bcbcd0; --field-hover: #aaaabd; --field-disabled: #ced2df; --focus-outline: #9397cd; --focus-ring: #9397cd33; --border-norm: #ced2df; --border-weak: #d9dfe8; --background-norm: white; --background-weak: #e6eaf0; --background-strong: #d9dfe8; --background-invert: #0c0c14; --interaction-default: transparent; --interaction-default-hover: rgb(188 188 208 / 0.2); --interaction-default-active: rgb(188 188 208 / 0.3); --shadow-norm-opacity: 0.1; --shadow-lifted-opacity: 0.16; --backdrop-norm: rgb(80 80 97 / 0.48); --optional-scrollbar-thumb-color: #ced2df; --optional-scrollbar-thumb-hover-color: #bcbcd0; --optional-font-family: system-ui, sans-serif; --optional-border-radius: 2; --optional-main-border-width: 0; --optional-email-item-read-background-color: #f5f7fa; --optional-mini-calendar-today-color: initial; --optional-logo-text-proton-color: initial; --optional-logo-text-product-color: initial; --optional-promotion-text-color: #15006f; --optional-promotion-text-weak: #50409b; --optional-promotion-interaction-hover: rgb(109 74 255 / 0.08); --optional-promotion-background-start: rgb(109 74 255 / 0.15); --optional-promotion-background-end: rgb(70 26 255 / 0.04); } .ui-prominent { --interaction-weak-minor-2: #2c2c34; --interaction-weak-minor-1: #4a4a57; --interaction-weak: #9393ae; --interaction-weak-major-1: #9e9eb6; --interaction-weak-major-2: #a9a9be; --interaction-weak-major-3: #b3b3c6; --interaction-weak-contrast: #000000; --text-norm: white; --text-weak: #c9c9de; --text-hint: #b5b5c9; --text-disabled: #a4a4bc; --text-invert: black; --field-norm: #b5b5c9; --field-hover: #c9c9de; --field-disabled: #9393ae; --border-norm: #9393ae; --border-weak: #83839f; --background-norm: #505061; --background-weak: #71718a; --background-strong: #83839f; --interaction-default: transparent; --interaction-default-hover: rgb(164 164 188 / 0.4); --interaction-default-active: rgb(164 164 188 / 0.6); --optional-scrollbar-thumb-color: #9393ae; --optional-scrollbar-thumb-hover-color: #a4a4bc; --optional-mini-calendar-today-color: white; --optional-logo-text-proton-color: white; --optional-logo-text-product-color: white; }
5,148
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes
petrpan-code/ProtonMail/WebClients/packages/colors/themes/dist/monokai.theme.css
/* * This file is automatically generated. * Manual changes will be lost. */ :root, .ui-standard { --primary: #e53265; --primary-contrast: white; --signal-danger-minor-2: #311502; --signal-danger-minor-1: #4a1f03; --signal-danger: #f5680a; --signal-danger-major-1: #f67723; --signal-danger-major-2: #f7863b; --signal-danger-major-3: #f89554; --signal-danger-contrast: #ffffff; --signal-warning-minor-2: #312107; --signal-warning-minor-1: #49310a; --signal-warning: #f5d922; --signal-warning-major-1: #f6dd38; --signal-warning-major-2: #f7e14e; --signal-warning-major-3: #f8e464; --signal-warning-contrast: #000000; --signal-success-minor-2: #092b24; --signal-success-minor-1: #0e4036; --signal-success: #2fd6b5; --signal-success-major-1: #44dabc; --signal-success-major-2: #59dec4; --signal-success-major-3: #6de2cb; --signal-success-contrast: #000000; --signal-info-minor-2: #082231; --signal-info-minor-1: #0c344a; --signal-info: #28acf6; --signal-info-major-1: #3eb4f7; --signal-info-major-2: #53bdf8; --signal-info-major-3: #69c5f9; --signal-info-contrast: #000000; --interaction-norm-minor-2: #2e0a14; --interaction-norm-minor-1: #450f1e; --interaction-norm: #e53265; --interaction-norm-major-1: #e84774; --interaction-norm-major-2: #ea5b84; --interaction-norm-major-3: #ed7093; --interaction-norm-contrast: #ffffff; --interaction-weak-minor-2: #0a0b10; --interaction-weak-minor-1: #101117; --interaction-weak: #34384e; --interaction-weak-major-1: #484c60; --interaction-weak-major-2: #5d6071; --interaction-weak-major-3: #717483; --interaction-weak-contrast: #ffffff; --text-norm: white; --text-weak: #979bb0; --text-hint: #575c75; --text-disabled: #454a61; --text-invert: #171926; --field-norm: #454a61; --field-hover: #575c75; --field-disabled: #34384e; --focus-outline: #e53265; --focus-ring: rgb(229 50 101 / 0.3); --border-norm: #34384e; --border-weak: #25283a; --background-norm: #16141c; --background-weak: #1e2130; --background-strong: #25283a; --background-invert: white; --interaction-default: transparent; --interaction-default-hover: rgb(52 56 78 / 0.5); --interaction-default-active: rgb(52 56 78 / 0.7); --shadow-norm-opacity: 0.5; --shadow-lifted-opacity: 0.75; --backdrop-norm: rgb(0 0 0 / 0.48); --optional-scrollbar-thumb-color: #34384e; --optional-scrollbar-thumb-hover-color: #454a61; --optional-link-norm: var(--interaction-norm-major-1); --optional-link-hover: var(--interaction-norm-major-2); --optional-link-active: var(--interaction-norm-major-3); --optional-navigation-current-item-text-color: var(--signal-success); --optional-navigation-item-count-background-color: #8838ff; --optional-background-elevated: #1a1926; --optional-background-lowered: var(--background-norm); --optional-email-item-unread-background-color: var( --optional-background-elevated ); --optional-email-item-read-background-color: var( --optional-background-lowered ); --optional-email-item-read-text-color: var(--text-weak); --optional-logo-text-proton-color: white; --optional-logo-text-product-color: white; --optional-promotion-text-color: white; --optional-promotion-text-weak: #c1b2ff; --optional-promotion-interaction-hover: rgb(138 110 255 / 0.2); --optional-promotion-background-start: rgb(138 110 255 / 0.3); --optional-promotion-background-end: rgb(99 61 255 / 0.1); }
5,149
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes
petrpan-code/ProtonMail/WebClients/packages/colors/themes/dist/pass.theme.css
/* * This file is automatically generated. * Manual changes will be lost. */ :root, .ui-standard { --primary: #7777f8; --primary-contrast: #191927; --signal-danger-minor-2: #301d21; --signal-danger-minor-1: #482b31; --signal-danger: #f08fa4; --signal-danger-major-1: #f29aad; --signal-danger-major-2: #f3a5b6; --signal-danger-major-3: #f5b1bf; --signal-danger-contrast: #000000; --signal-warning-minor-2: #331c0f; --signal-warning-minor-1: #4c2a17; --signal-warning: #ffb84d; --signal-warning-major-1: #ffbf5f; --signal-warning-major-2: #ffc671; --signal-warning-major-3: #ffcd82; --signal-warning-contrast: #000000; --signal-success-minor-2: #0f251f; --signal-success-minor-1: #16372e; --signal-success: #4ab89a; --signal-success-major-1: #5cbfa4; --signal-success-major-2: #6ec6ae; --signal-success-major-3: #80cdb8; --signal-success-contrast: #000000; --signal-info-minor-2: #0f2633; --signal-info-minor-1: #163a4d; --signal-info: #4ac0ff; --signal-info-major-1: #5cc6ff; --signal-info-major-2: #6ecdff; --signal-info-major-3: #80d3ff; --signal-info-contrast: #000000; --text-norm: #d1d1d4; --text-weak: #8c8c93; --text-hint: #50505b; --text-disabled: #50505b; --text-invert: #191927; --field-norm: rgb(255 255 255 / 0.04); --field-disabled: #4c4c65; --optional-field-placeholder-color: var(--text-weak); --border-norm: #2b2b38; --border-weak: rgb(255 255 255 / 0.4); --background-norm: #191927; --background-weak: #1f1f31; --background-strong: #13131d; --background-invert: white; --interaction-norm-minor-2: #1d1d32; --interaction-norm-minor-1: #2c2c4b; --interaction-norm: #9292f9; --interaction-norm-major-1: #9d9dfa; --interaction-norm-major-2: #a8a8fa; --interaction-norm-major-3: #b3b3fb; --interaction-norm-contrast: #000000; --interaction-norm-contrast: #191927; --interaction-norm-minor-1: #302d45; --interaction-weak-minor-2: #08080e; --interaction-weak-minor-1: #0c0c16; --interaction-weak: #282848; --interaction-weak-major-1: #3e3e5a; --interaction-weak-major-2: #53536d; --interaction-weak-major-3: #69697f; --interaction-weak-contrast: #ffffff; --interaction-weak-major-1: #32306c; --interaction-weak-major-2: #343187; --interaction-default: transparent; --interaction-default-hover: rgb(255 255 255 / 0.04); --interaction-default-active: rgb(255 255 255 / 0.08); --shadow-norm-opacity: 0.32; --shadow-lifted-opacity: 0.4; --backdrop-norm: rgb(0 0 0 / 0.5); --focus-outline: var(--interaction-norm-major-2); --focus-ring: var(--interaction-norm-minor-1); --search-field-focus-background: #0e0e0e; .button-solid-weak { --button-default-text-color: var(--interaction-norm); --button-hover-text-color: var(--interaction-norm); --button-active-text-color: var(--interaction-norm); } } .ui-violet { --interaction-norm-minor-2: #211833; --interaction-norm-minor-1: #32244d; --interaction-norm: #a779ff; --interaction-norm-major-1: #b086ff; --interaction-norm-major-2: #b994ff; --interaction-norm-major-3: #c1a1ff; --interaction-norm-contrast: #ffffff; --interaction-weak-minor-2: #0a080f; --interaction-weak-minor-1: #0e0c16; --interaction-weak: #30284a; --interaction-weak-major-1: #453e5c; --interaction-weak-major-2: #59536e; --interaction-weak-major-3: #6e6980; --interaction-weak-contrast: #ffffff; --focus-outline: var(--interaction-norm-major-2); --focus-ring: var(--interaction-norm-minor-1); --interaction-norm-hover: var(--interaction-norm-major-1); --interaction-norm-active: var(--interaction-norm-major-2); --interaction-weak-hover: var(--interaction-weak-major-1); --interaction-weak-active: var(--interaction-weak-major-2); --link-norm: var(--interaction-norm); --link-hover: var(--interaction-norm-hover); --link-active: var(--interaction-norm-active); .button-solid-norm { --button-default-text-color: var(--text-invert); --button-hover-text-color: var(--text-invert); --button-active-text-color: var(--text-invert); } } .ui-teal { --interaction-norm-minor-2: #152624; --interaction-norm-minor-1: #203936; --interaction-norm: #6abdb3; --interaction-norm-major-1: #79c4bb; --interaction-norm-major-2: #88cac2; --interaction-norm-major-3: #97d1ca; --interaction-norm-contrast: #000000; --interaction-weak-minor-2: #080a0c; --interaction-weak-minor-1: #0b0f12; --interaction-weak: #26333d; --interaction-weak-major-1: #3c4750; --interaction-weak-major-2: #515c64; --interaction-weak-major-3: #677077; --interaction-weak-contrast: #ffffff; --focus-outline: var(--interaction-norm-major-2); --focus-ring: var(--interaction-norm-minor-1); --interaction-norm-hover: var(--interaction-norm-major-1); --interaction-norm-active: var(--interaction-norm-major-2); --interaction-weak-hover: var(--interaction-weak-major-1); --interaction-weak-active: var(--interaction-weak-major-2); --link-norm: var(--interaction-norm); --link-hover: var(--interaction-norm-hover); --link-active: var(--interaction-norm-active); .button-solid-norm { --button-default-text-color: var(--text-invert); --button-hover-text-color: var(--text-invert); --button-active-text-color: var(--text-invert); } } .ui-orange { --interaction-norm-minor-2: #332620; --interaction-norm-minor-1: #4c3930; --interaction-norm: #ffd5a1; --interaction-norm-major-1: #ffd9aa; --interaction-norm-major-2: #ffddb4; --interaction-norm-major-3: #ffe2bd; --interaction-norm-contrast: #000000; --interaction-weak-minor-2: #131011; --interaction-weak-minor-1: #1f1b1c; --interaction-weak: #3e3537; --interaction-weak-major-1: #51494b; --interaction-weak-major-2: #655d5f; --interaction-weak-major-3: #787273; --interaction-weak-contrast: #ffffff; --interaction-norm-hover: var(--interaction-norm-major-1); --interaction-norm-active: var(--interaction-norm-major-2); --interaction-weak-hover: var(--interaction-weak-major-1); --interaction-weak-active: var(--interaction-weak-major-2); --focus-outline: var(--interaction-norm-major-2); --focus-ring: var(--interaction-norm-minor-1); } .ui-red { --interaction-norm-minor-2: #321f20; --interaction-norm-minor-1: #4c2f30; --interaction-norm: #fc9c9f; --interaction-norm-major-1: #fca6a9; --interaction-norm-major-2: #fdb0b2; --interaction-norm-major-3: #fdbabc; --interaction-norm-contrast: #000000; --interaction-weak-minor-2: #120e11; --interaction-weak-minor-1: #1f171d; --interaction-weak: #3d2e3a; --interaction-weak-major-1: #50434e; --interaction-weak-major-2: #645861; --interaction-weak-major-3: #776d75; --interaction-weak-contrast: #ffffff; --interaction-norm-hover: var(--interaction-norm-major-1); --interaction-norm-active: var(--interaction-norm-major-2); --interaction-weak-hover: var(--interaction-weak-major-1); --interaction-weak-active: var(--interaction-weak-major-2); --focus-outline: var(--interaction-norm-major-2); --focus-ring: var(--interaction-norm-minor-1); } .ui-lime { --interaction-norm-minor-2: #1d2c1f; --interaction-norm-minor-1: #2c422f; --interaction-norm: #91dc9c; --interaction-norm-major-1: #9ce0a6; --interaction-norm-major-2: #a7e3b0; --interaction-norm-major-3: #b2e7ba; --interaction-norm-contrast: #000000; --interaction-weak-minor-2: #0c0e10; --interaction-weak-minor-1: #14181b; --interaction-weak: #273035; --interaction-weak-major-1: #3d4549; --interaction-weak-major-2: #52595d; --interaction-weak-major-3: #686e72; --interaction-weak-contrast: #ffffff; --focus-outline: var(--interaction-norm-major-2); --focus-ring: var(--interaction-norm-minor-1); --interaction-norm-hover: var(--interaction-norm-major-1); --interaction-norm-active: var(--interaction-norm-major-2); --interaction-weak-hover: var(--interaction-weak-major-1); --interaction-weak-active: var(--interaction-weak-major-2); --link-norm: var(--interaction-norm); --link-hover: var(--interaction-norm-hover); --link-active: var(--interaction-norm-active); .button-solid-norm { --button-default-text-color: var(--text-invert); --button-hover-text-color: var(--text-invert); --button-active-text-color: var(--text-invert); } }
5,150
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes
petrpan-code/ProtonMail/WebClients/packages/colors/themes/dist/snow.theme.css
/* * This file is automatically generated. * Manual changes will be lost. */ :root, .ui-standard { --primary: #6d4aff; --primary-contrast: white; --signal-danger-minor-2: #fcebee; --signal-danger-minor-1: #f8d6dc; --signal-danger: #dc3251; --signal-danger-major-1: #c62d49; --signal-danger-major-2: #b02841; --signal-danger-major-3: #9a2339; --signal-danger-contrast: #ffffff; --signal-warning-minor-2: #fff5e6; --signal-warning-minor-1: #ffebcc; --signal-warning: #ff9900; --signal-warning-major-1: #f27d00; --signal-warning-major-2: #e66300; --signal-warning-major-3: #d94c00; --signal-warning-contrast: #000000; --signal-success-minor-2: #e9f6f3; --signal-success-minor-1: #d2eee7; --signal-success: #1ea885; --signal-success-major-1: #1b9778; --signal-success-major-2: #18866a; --signal-success-major-3: #15765d; --signal-success-contrast: #ffffff; --signal-info-minor-2: #e9f5fa; --signal-info-minor-1: #d3ecf5; --signal-info: #239ece; --signal-info-major-1: #208eb9; --signal-info-major-2: #1c7ea5; --signal-info-major-3: #196f90; --signal-info-contrast: #ffffff; --interaction-norm-minor-2: #f0edff; --interaction-norm-minor-1: #e2dbff; --interaction-norm: #6d4aff; --interaction-norm-major-1: #6243e6; --interaction-norm-major-2: #573bcc; --interaction-norm-major-3: #4c34b3; --interaction-norm-contrast: #ffffff; --interaction-weak-minor-2: #f9f8f7; --interaction-weak-minor-1: #f5f3f2; --interaction-weak: #eae7e4; --interaction-weak-major-1: #dedbd9; --interaction-weak-major-2: #d3d0cd; --interaction-weak-major-3: #c7c4c2; --interaction-weak-contrast: #000000; --text-norm: #0c0c14; --text-weak: #5c5958; --text-hint: #8f8d8a; --text-disabled: #c2bfbc; --text-invert: white; --field-norm: #adaba8; --field-hover: #8f8d8a; --field-disabled: #d1cfcd; --focus-outline: #6d4aff; --focus-ring: rgb(109 74 255 / 0.2); --border-norm: #d1cfcd; --border-weak: #eae7e4; --background-norm: white; --background-weak: #f5f4f2; --background-strong: #e5e4e1; --background-invert: #0c0c14; --interaction-default: transparent; --interaction-default-hover: rgb(194 193 192 / 0.2); --interaction-default-active: rgb(194 192 190 / 0.35); --shadow-norm-opacity: 0.1; --shadow-lifted-opacity: 0.16; --backdrop-norm: rgb(38 42 51 / 0.48); --optional-scrollbar-thumb-color: #d1cfcd; --optional-scrollbar-thumb-hover-color: #c2bfbc; --optional-email-item-read-background-color: #f8f8f6; --optional-email-item-read-text-color: #3d3c3c; --optional-logo-text-proton-color: #1b1340; --optional-promotion-text-color: #15006f; --optional-promotion-text-weak: #50409b; --optional-promotion-interaction-hover: rgb(109 74 255 / 0.08); --optional-promotion-background-start: rgb(109 74 255 / 0.15); --optional-promotion-background-end: rgb(70 26 255 / 0.04); }
5,151
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/carbon/standard-base.css
:root, .ui-standard { --primary: #8a6eff; --primary-contrast: white; --signal-danger: #f5385a; --signal-warning: #ff9900; --signal-success: #1ea885; --signal-info: #239ece; --interaction-norm: #6d4aff; --interaction-weak: #4a4658; --text-norm: white; --text-weak: #a7a4b5; --text-hint: #6d697d; --text-disabled: #5b576b; --text-invert: #1c1b24; --field-norm: #5b576b; --field-hover: #6d697d; --field-disabled: #3f3b4c; --focus-outline: #6d4aff; --focus-ring: rgb(109 74 255 / 0.3); --border-norm: #4a4658; --border-weak: #343140; --background-norm: #16141c; --background-weak: #292733; --background-strong: #3f3b4c; --background-invert: white; --interaction-default: transparent; --interaction-default-hover: rgb(91 87 107 / 0.2); --interaction-default-active: rgb(91 87 107 / 0.4); --shadow-norm-opacity: 0.5; --shadow-lifted-opacity: 0.75; --backdrop-norm: rgb(0 0 0 / 0.48); /* Optional colors */ --optional-scrollbar-thumb-color: #4a4658; --optional-scrollbar-thumb-hover-color: #5b576b; --optional-link-norm: var(--interaction-norm-major-1); --optional-link-hover: var(--interaction-norm-major-2); --optional-link-active: var(--interaction-norm-major-3); --optional-background-elevated : #1e1c26; --optional-background-lowered : var(--background-norm); --optional-email-item-unread-background-color: var(--optional-background-elevated); --optional-email-item-read-background-color: var(--optional-background-lowered); --optional-email-item-read-text-color: var(--text-weak); --optional-mini-calendar-today-color: white; --optional-logo-text-proton-color: white; --optional-logo-text-product-color: white; --optional-promotion-text-color: white; --optional-promotion-text-weak: #C1B2FF; --optional-promotion-interaction-hover: rgb(138 110 255 / 0.2); --optional-promotion-background-start: rgb(138 110 255 / 0.3); --optional-promotion-background-end: rgb(99 61 255 / 0.1); }
5,152
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/classic/prominent-base.css
.ui-prominent { --signal-danger: #ed4c51; --signal-warning: #f5930a; --signal-success: #349172; --signal-info: #2c89db; --interaction-norm: #657ee4; --interaction-weak: #353e60; --text-norm: white; --text-weak: #949bb9; --text-hint: #565f84; --text-disabled: #444e72; --text-invert: #1c223d; --field-norm: #565f84; --field-hover: #949bb9; --field-disabled: #353e60; --focus-outline: #657ee4; --focus-ring: rgb(101 126 228 / 0.2); --border-norm: #353e60; --border-weak: #2d3657; --background-norm: #1c223d; --background-weak: #272f4f; --background-strong: #2d3657; --interaction-default: transparent; --interaction-default-hover: rgb(68 78 114 / 0.3); --interaction-default-active: rgb(68 78 114 / 0.4); --shadow-norm-opacity: 0.32; --shadow-lifted-opacity: 0.4; --backdrop-norm: rgb(0 0 0 / 0.32); /* Optional colors */ --optional-scrollbar-thumb-color: #353e60; --optional-scrollbar-thumb-hover-color: #444e72; --optional-logo-text-proton-color: white; --optional-logo-text-product-color: white; }
5,153
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/classic/standard-base.css
:root, .ui-standard { --primary: #657ee4; --primary-contrast: white; --signal-danger: #d42f34; --signal-warning: #f5830a; --signal-success: #1b8561; --signal-info: #1578cf; --interaction-norm: #657ee4; --interaction-weak: #d0d3da; --text-norm: #262a33; --text-weak: #585D69; --text-hint: #a4a9b5; --text-disabled: #babec7; --text-invert: white; --field-norm: #babec7; --field-hover: #a4a9b5; --field-disabled: #d0d3da; --focus-outline: #657ee4; --focus-ring: rgb(101 126 228 / 0.2); --border-norm: #d0d3da; --border-weak: #e7e9ec; --background-norm: white; --background-weak: #f3f4f6; --background-strong: #e7e9ec; --background-invert: #0c0c14; --interaction-default: transparent; --interaction-default-hover: rgb(186 190 199 / 0.2); --interaction-default-active: rgb(186 190 199 / 0.3); --shadow-norm-opacity: 0.1; --shadow-lifted-opacity: 0.16; --backdrop-norm: rgb(38 42 51 / 0.48); /* Optional colors */ --optional-scrollbar-thumb-color: #d0d3da; --optional-scrollbar-thumb-hover-color: #babec7; --optional-font-family: system-ui, sans-serif; --optional-border-radius: 3; --optional-main-border-width: 0; --optional-email-item-read-background-color: #F7F8FA; /* Reset because prominent part overrides those colors */ --optional-logo-text-proton-color: initial; --optional-logo-text-product-color: initial; --optional-promotion-text-color: #15006F; --optional-promotion-text-weak: #50409b; --optional-promotion-interaction-hover: rgb(109 74 255 / 0.08); --optional-promotion-background-start: rgb(109 74 255 / 0.15); --optional-promotion-background-end: rgb(70 26 255 / 0.04); }
5,154
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/contrast-dark/prominent-base.css
.ui-prominent { --background-norm: black; }
5,155
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/contrast-dark/standard-base.css
:root, .ui-standard { --primary: #489aff; --primary-contrast: white; --signal-danger: #d50027; --signal-warning: #db5f00; --signal-success: #00a87e; --signal-info: #00a2e1; --interaction-norm: #0073ff; --interaction-weak: #525b6c; --text-norm: white; --text-weak: #cccccc; --text-hint: #999999; --text-disabled: #666666; --text-invert: black; --field-norm: #dddddd; --field-hover: white; --field-disabled: #aaaaaa; --focus-outline: #0073ff; --focus-ring: rgb(0 115 255 / 0.75); --border-norm: #dddddd; --border-weak: #777777; --background-norm: #0e0d12; --background-weak: #1e1c24; --background-strong: #2c2934; --background-invert: white; --interaction-default: transparent; --interaction-default-hover: rgb(91 87 107 / 0.6); --interaction-default-active: rgb(91 87 107 / 0.9); --shadow-norm-opacity: 0.5; --shadow-lifted-opacity: 0.75; --backdrop-norm: rgb(0 0 0 / 0.75); /* Optional colors */ --optional-scrollbar-thumb-color: #999999; --optional-scrollbar-thumb-hover-color: #ffffff; --optional-link-norm: var(--interaction-norm-major-1); --optional-link-hover: var(--interaction-norm-major-2); --optional-link-active: var(--interaction-norm-major-3); --optional-email-item-unread-background-color: black; --optional-email-item-read-background-color: var(--background-norm); --optional-email-item-read-text-color: var(--text-weak); --optional-mini-calendar-today-color: white; --optional-logo-text-proton-color: white; --optional-logo-text-product-color: white; --optional-promotion-text-color: white; --optional-promotion-text-weak: #b2d0ff; --optional-promotion-interaction-hover: rgba(110 166 255 / 0.2); --optional-promotion-background-start: rgba(110 156 255 / 0.3); --optional-promotion-background-end: rgba(61 122 255 / 0.1); }
5,156
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/contrast-light/standard-base.css
:root, .ui-standard { --primary: #4630a6; --primary-contrast: white; --signal-danger: #dc3251; --signal-warning: #ff9900; --signal-success: #168368; --signal-info: #1d4ed8; --interaction-norm: #4630a6; --interaction-weak: #d1d1d1; --text-norm: #000000; --text-weak: #4d4d4d; --text-hint: #666666; --text-disabled: #767676; --text-invert: white; --field-norm: #4d4d4d; --field-hover: #333333; --field-disabled: #b8b8b8; --focus-outline: #4630a6; --focus-ring: rgb(70 48 166 / 0.75); --border-norm: #888888; --border-weak: #aaaaaa; --background-norm: #ffffff; --background-weak: #f5f5f5; --background-strong: #e6e6e6; --background-invert: #0c0c14; --interaction-default: transparent; --interaction-default-hover: rgb(194 194 194 / 0.3); --interaction-default-active: rgb(194 194 194 / 0.6); --shadow-norm-opacity: 0.1; --shadow-lifted-opacity: 0.16; --backdrop-norm: rgb(0 0 0 / 0.32); /* Optional colors */ --optional-scrollbar-thumb-color: #c2c2c2; --optional-scrollbar-thumb-hover-color: #a8a8a8; --optional-logo-text-proton-color: #1b1340; --optional-logo-text-product-color: #6d4aff; --optional-promotion-text-color: #15006F; --optional-promotion-text-weak: #50409b; --optional-promotion-interaction-hover: rgb(109 74 255 / 0.08); --optional-promotion-background-start: rgb(109 74 255 / 0.15); --optional-promotion-background-end: rgb(70 26 255 / 0.04); }
5,157
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/duotone/prominent-base.css
.ui-prominent { --primary: #8a6eff; --primary-contrast: white; --signal-danger: #f5385a; --signal-warning: #ff9900; --signal-success: #1ea885; --signal-info: #239ece; --interaction-norm: #6d4aff; --interaction-weak: #4c34b2; --text-norm: white; --text-weak: #b3a3f5; --text-hint: #8067e4; --text-disabled: #5940bf; --text-invert: #1b1340; --field-norm: #9282d4; --field-hover: #7c5cff; --field-disabled: #38277a; --focus-outline: #6d4aff; --focus-ring: rgb(109 74 255 / 0.3); --border-norm: #413085; --border-weak: #3c2b80; --background-norm: #1b1340; --background-weak: #271c57; --background-strong: #38277a; --interaction-default: transparent; --interaction-default-hover: rgb(74 54 143 / 0.3); --interaction-default-active: rgb(74 57 143 / 0.5); --shadow-primary-color: 109 74 255; --shadow-norm-opacity: 0.32; --shadow-lifted-opacity: 0.4; --backdrop-norm: rgb(0 0 0 / 0.32); /* Optional colors */ --optional-scrollbar-thumb-color: #413085; --optional-scrollbar-thumb-hover-color: #4a398f; --optional-link-norm: var(--interaction-norm-major-1); --optional-link-hover: var(--interaction-norm-major-2); --optional-link-active: var(--interaction-norm-major-3); --optional-mini-calendar-today-color: white; --optional-logo-text-proton-color: white; --optional-logo-text-product-color: white; }
5,158
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/duotone/standard-base.css
:root, .ui-standard { --primary: #6d4aff; --primary-contrast: white; --signal-danger: #dc3251; --signal-warning: #ff9900; --signal-success: #1ea885; --signal-info: #239ece; --interaction-norm: #6d4aff; --interaction-weak: #eae7e4; --text-norm: #0c0c14; --text-weak: #5c5958; --text-hint: #8f8d8a; --text-disabled: #c2bfbc; --text-invert: white; --field-norm: #adaba8; --field-hover: #8f8d8a; --field-disabled: #d1cfcd; --focus-outline: #6d4aff; --focus-ring: rgb(109 74 255 / 0.2); --border-norm: #d1cfcd; --border-weak: #eae7e4; --background-norm: white; --background-weak: #f5f4f2; --background-strong: #e5e4e1; --background-invert: #0c0c14; --interaction-default: transparent; --interaction-default-hover: rgb(194 193 192 / 0.2); --interaction-default-active: rgb(194 192 190 / 0.35); --shadow-primary-color: 109 74 255; --shadow-norm-opacity: 0.1; --shadow-lifted-opacity: 0.16; --backdrop-norm: rgb(38 42 51 / 0.48); /* Optional colors */ --optional-scrollbar-thumb-color: #d1cfcd; --optional-scrollbar-thumb-hover-color: #c2bfbc; --optional-main-border-width: 0; --optional-email-item-read-text-color: #3d3c3c; --optional-email-item-selected-background-color: var(--interaction-norm-major-1); --optional-email-item-selected-icon-background-color: var(--interaction-norm-major-3); /* Reset because prominent part overrides those colors */ --optional-link-norm: initial; --optional-link-hover: initial; --optional-link-active: initial; --optional-mini-calendar-today-color: initial; --optional-logo-text-proton-color: initial; --optional-logo-text-product-color: initial; --optional-promotion-text-color: #15006F; --optional-promotion-text-weak: #50409b; --optional-promotion-interaction-hover: rgb(109 74 255 / 0.08); --optional-promotion-background-start: rgb(109 74 255 / 0.15); --optional-promotion-background-end: rgb(70 26 255 / 0.04); }
5,159
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/legacy/prominent-base.css
.ui-prominent { --interaction-weak: #9393ae; --text-norm: white; --text-weak: #c9c9de; --text-hint: #b5b5c9; --text-disabled: #a4a4bc; --text-invert: black; --field-norm: #b5b5c9; --field-hover: #c9c9de; --field-disabled: #9393ae; --border-norm: #9393ae; --border-weak: #83839f; --background-norm: #505061; --background-weak: #71718a; --background-strong: #83839f; --interaction-default: transparent; --interaction-default-hover: rgb(164 164 188 / 0.4); --interaction-default-active: rgb(164 164 188 / 0.6); /* Optional colors */ --optional-scrollbar-thumb-color: #9393ae; --optional-scrollbar-thumb-hover-color: #a4a4bc; --optional-mini-calendar-today-color: white; --optional-logo-text-proton-color: white; --optional-logo-text-product-color: white; }
5,160
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/legacy/standard-base.css
:root, .ui-standard { --primary: #9397cd; --primary-contrast: white; --signal-danger: #cb7c7c; --signal-danger-contrast: white; --signal-warning: #debc0b; --signal-warning-contrast: black; --signal-success: #8eb67a; --signal-success-contrast: white; --signal-info: #80a1d2; --signal-info-contrast: white; --interaction-norm: #9397cd; --interaction-norm-contrast: white; --interaction-weak: #ced2df; --text-norm: black; --text-weak: #737386; --text-hint: #aaaabd; --text-disabled: #bcbcd0; --text-invert: white; --field-norm: #bcbcd0; --field-hover: #aaaabd; --field-disabled: #ced2df; --focus-outline: #9397cd; --focus-ring: #9397cd33; --border-norm: #ced2df; --border-weak: #d9dfe8; --background-norm: white; --background-weak: #e6eaf0; --background-strong: #d9dfe8; --background-invert: #0c0c14; --interaction-default: transparent; --interaction-default-hover: rgb(188 188 208 / 0.2); --interaction-default-active: rgb(188 188 208 / 0.3); --shadow-norm-opacity: 0.1; --shadow-lifted-opacity: 0.16; --backdrop-norm: rgb(80 80 97 / 0.48); /* Optional colors */ --optional-scrollbar-thumb-color: #ced2df; --optional-scrollbar-thumb-hover-color: #bcbcd0; --optional-font-family: system-ui, sans-serif; --optional-border-radius: 2; --optional-main-border-width: 0; --optional-email-item-read-background-color: #F5F7FA; /* Reset because prominent part overrides those colors */ --optional-mini-calendar-today-color: initial; --optional-logo-text-proton-color: initial; --optional-logo-text-product-color: initial; --optional-promotion-text-color: #15006F; --optional-promotion-text-weak: #50409b; --optional-promotion-interaction-hover: rgb(109 74 255 / 0.08); --optional-promotion-background-start: rgb(109 74 255 / 0.15); --optional-promotion-background-end: rgb(70 26 255 / 0.04); }
5,161
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/monokai/standard-base.css
/* * Theme: Monokai */ :root, .ui-standard { --primary: #e53265; --primary-contrast: white; --signal-danger: #f5680a; --signal-warning: #f5d922; --signal-success: #2fd6b5; --signal-info: #28acf6; --interaction-norm: #e53265; --interaction-weak: #34384e; --text-norm: white; --text-weak: #979bb0; --text-hint: #575c75; --text-disabled: #454a61; --text-invert: #171926; --field-norm: #454a61; --field-hover: #575c75; --field-disabled: #34384e; --focus-outline: #e53265; --focus-ring: rgb(229 50 101 / 0.3); --border-norm: #34384e; --border-weak: #25283a; --background-norm: #16141c; --background-weak: #1e2130; --background-strong: #25283a; --background-invert: white; --interaction-default: transparent; --interaction-default-hover: rgb(52 56 78 / 0.5); --interaction-default-active: rgb(52 56 78 / 0.7); --shadow-norm-opacity: 0.5; --shadow-lifted-opacity: 0.75; --backdrop-norm: rgb(0 0 0 / 0.48); /* Optional colors */ --optional-scrollbar-thumb-color: #34384e; --optional-scrollbar-thumb-hover-color: #454a61; --optional-link-norm: var(--interaction-norm-major-1); --optional-link-hover: var(--interaction-norm-major-2); --optional-link-active: var(--interaction-norm-major-3); --optional-navigation-current-item-text-color: var(--signal-success); --optional-navigation-item-count-background-color: #8838ff; --optional-background-elevated : #1a1926; --optional-background-lowered : var(--background-norm); --optional-email-item-unread-background-color: var(--optional-background-elevated); --optional-email-item-read-background-color: var(--optional-background-lowered); --optional-email-item-read-text-color: var(--text-weak); --optional-logo-text-proton-color: white; --optional-logo-text-product-color: white; --optional-promotion-text-color: white; --optional-promotion-text-weak: #C1B2FF; --optional-promotion-interaction-hover: rgb(138 110 255 / 0.2); --optional-promotion-background-start: rgb(138 110 255 / 0.3); --optional-promotion-background-end: rgb(99 61 255 / 0.1); }
5,162
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/pass/lime-base.css
.ui-lime { --interaction-norm: #91DC9C; --interaction-weak: #273035; --focus-outline: var(--interaction-norm-major-2); --focus-ring: var(--interaction-norm-minor-1); --interaction-norm-hover: var(--interaction-norm-major-1); --interaction-norm-active: var(--interaction-norm-major-2); --interaction-weak-hover: var(--interaction-weak-major-1); --interaction-weak-active: var(--interaction-weak-major-2); --link-norm: var(--interaction-norm); --link-hover: var(--interaction-norm-hover); --link-active: var(--interaction-norm-active); .button-solid-norm { --button-default-text-color: var(--text-invert); --button-hover-text-color: var(--text-invert); --button-active-text-color: var(--text-invert); } }
5,163
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/pass/orange-base.css
.ui-orange { --interaction-norm: #FFD5A1; --interaction-weak: #3E3537; --interaction-norm-hover: var(--interaction-norm-major-1); --interaction-norm-active: var(--interaction-norm-major-2); --interaction-weak-hover: var(--interaction-weak-major-1); --interaction-weak-active: var(--interaction-weak-major-2); --focus-outline: var(--interaction-norm-major-2); --focus-ring: var(--interaction-norm-minor-1); }
5,164
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/pass/red-base.css
.ui-red { --interaction-norm: #FC9C9F; --interaction-weak: #3D2E3A; --interaction-norm-hover: var(--interaction-norm-major-1); --interaction-norm-active: var(--interaction-norm-major-2); --interaction-weak-hover: var(--interaction-weak-major-1); --interaction-weak-active: var(--interaction-weak-major-2); --focus-outline: var(--interaction-norm-major-2); --focus-ring: var(--interaction-norm-minor-1); }
5,165
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/pass/standard-base.css
:root, .ui-standard { --primary: #7777F8; --primary-contrast: #191927; --signal-danger: #F08FA4; --signal-warning: #FFB84D; --signal-success: #4AB89A; --signal-info: #4AC0FF; --text-norm: #D1D1D4; --text-weak: #8C8C93; --text-hint: #50505B; --text-disabled: #50505B; --text-invert: #191927; --field-norm: rgb(255 255 255 / 0.04); --field-disabled: #4C4C65; --optional-field-placeholder-color: var(--text-weak); --border-norm: #2B2B38; --border-weak: rgb(255 255 255 / 0.4); --background-norm: #191927; --background-weak: #1F1F31; --background-strong: #13131D; --background-invert: white; --interaction-norm: #9292F9; --interaction-norm-contrast: #191927; --interaction-norm-minor-1: #302D45; --interaction-weak: #282848; --interaction-weak-major-1: #32306c; --interaction-weak-major-2: #343187; --interaction-default: transparent; --interaction-default-hover: rgb(255 255 255 / 0.04); --interaction-default-active: rgb(255 255 255 / 0.08); --shadow-norm-opacity: 0.32; --shadow-lifted-opacity: 0.4; --backdrop-norm: rgb(0 0 0 / 0.5); --focus-outline: var(--interaction-norm-major-2); --focus-ring: var(--interaction-norm-minor-1); --search-field-focus-background: #0E0E0E; .button-solid-weak { --button-default-text-color: var(--interaction-norm); --button-hover-text-color: var(--interaction-norm); --button-active-text-color: var(--interaction-norm); } }
5,166
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/pass/teal-base.css
.ui-teal { --interaction-norm: #6ABDB3; --interaction-weak: #26333D; --focus-outline: var(--interaction-norm-major-2); --focus-ring: var(--interaction-norm-minor-1); --interaction-norm-hover: var(--interaction-norm-major-1); --interaction-norm-active: var(--interaction-norm-major-2); --interaction-weak-hover: var(--interaction-weak-major-1); --interaction-weak-active: var(--interaction-weak-major-2); --link-norm: var(--interaction-norm); --link-hover: var(--interaction-norm-hover); --link-active: var(--interaction-norm-active); .button-solid-norm { --button-default-text-color: var(--text-invert); --button-hover-text-color: var(--text-invert); --button-active-text-color: var(--text-invert); } }
5,167
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/pass/violet-base.css
.ui-violet { --interaction-norm: #A779FF; --interaction-weak: #30284A; --focus-outline: var(--interaction-norm-major-2); --focus-ring: var(--interaction-norm-minor-1); --interaction-norm-hover: var(--interaction-norm-major-1); --interaction-norm-active: var(--interaction-norm-major-2); --interaction-weak-hover: var(--interaction-weak-major-1); --interaction-weak-active: var(--interaction-weak-major-2); --link-norm: var(--interaction-norm); --link-hover: var(--interaction-norm-hover); --link-active: var(--interaction-norm-active); .button-solid-norm { --button-default-text-color: var(--text-invert); --button-hover-text-color: var(--text-invert); --button-active-text-color: var(--text-invert); } }
5,168
0
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src
petrpan-code/ProtonMail/WebClients/packages/colors/themes/src/snow/standard-base.css
:root, .ui-standard { --primary: #6d4aff; --primary-contrast: white; --signal-danger: #dc3251; --signal-warning: #ff9900; --signal-success: #1ea885; --signal-info: #239ece; --interaction-norm: #6d4aff; --interaction-weak: #eae7e4; --text-norm: #0c0c14; --text-weak: #5c5958; --text-hint: #8f8d8a; --text-disabled: #c2bfbc; --text-invert: white; --field-norm: #adaba8; --field-hover: #8f8d8a; --field-disabled: #d1cfcd; --focus-outline: #6d4aff; --focus-ring: rgb(109 74 255 / 0.2); --border-norm: #d1cfcd; --border-weak: #eae7e4; --background-norm: white; --background-weak: #f5f4f2; --background-strong: #e5e4e1; --background-invert: #0c0c14; --interaction-default: transparent; --interaction-default-hover: rgb(194 193 192 / 0.2); --interaction-default-active: rgb(194 192 190 / 0.35); --shadow-norm-opacity: 0.1; --shadow-lifted-opacity: 0.16; --backdrop-norm: rgb(38 42 51 / 0.48); /* Optional colors */ --optional-scrollbar-thumb-color: #d1cfcd; --optional-scrollbar-thumb-hover-color: #c2bfbc; --optional-email-item-read-background-color: #f8f8f6; --optional-email-item-read-text-color: #3d3c3c; --optional-logo-text-proton-color: #1b1340; --optional-promotion-text-color: #15006F; --optional-promotion-text-weak: #50409b; --optional-promotion-interaction-hover: rgb(109 74 255 / 0.08); --optional-promotion-background-start: rgb(109 74 255 / 0.15); --optional-promotion-background-end: rgb(70 26 255 / 0.04); }
5,169
0
petrpan-code/ProtonMail/WebClients/packages/colors
petrpan-code/ProtonMail/WebClients/packages/colors/tool/index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Color Tool</title> <style> body { font-family: Arial, Helvetica, sans-serif; padding: 48px; } .colors { display: flex; font-family: 'Courier New', Courier, monospace; gap: 8px; margin-bottom: 8px; } .color { border-radius: 8px; padding: 8px; user-select: all; } </style> </head> <body> <form id="form"> <input id="input" /> <button type="submit">generate</button> </form> <h2>Light</h2> <div class="colors" id="light"></div> <h2>Dark</h2> <div class="colors" id="dark"></div> <h2>Accent</h2> <div class="colors" id="accent"></div> <script src="bundle.js"></script> </body> </html>
5,170
0
petrpan-code/ProtonMail/WebClients/packages/colors
petrpan-code/ProtonMail/WebClients/packages/colors/tool/tool.ts
import tinycolor, { Instance } from 'tinycolor2'; import genAccentShades from '../gen-accent-shades'; import genButtonShades from '../gen-button-shades'; const form = document.getElementById('form') as HTMLFormElement; const input = document.getElementById('input') as HTMLInputElement; const light = document.getElementById('light') as HTMLDivElement; const dark = document.getElementById('dark') as HTMLDivElement; const accent = document.getElementById('accent') as HTMLDivElement; function Color(color: Instance) { const hex = color.toHexString(); const child = document.createElement('div'); child.classList.add('color'); const textColor = tinycolor.mostReadable(hex, ['white', 'black']); child.setAttribute('style', `background: ${hex}; color: ${textColor.toHexString()}`); child.innerText = hex; return child; } form.addEventListener('submit', (e) => { e.preventDefault(); const { value } = input; if (!value) { return; } const lightShades = genButtonShades(tinycolor(value), true); light.innerHTML = ''; lightShades.map(Color).forEach(light.appendChild.bind(light)); const darkShades = genButtonShades(tinycolor(value), false); dark.innerHTML = ''; darkShades.map(Color).forEach(dark.appendChild.bind(dark)); const accentShades = genAccentShades(tinycolor(value)); accent.innerHTML = ''; accentShades.map(Color).forEach(accent.appendChild.bind(accent)); });
5,171
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/components/.eslintrc.js
module.exports = { extends: ['@proton/eslint-config-proton'], parser: '@typescript-eslint/parser', parserOptions: { tsconfigRootDir: __dirname, project: './tsconfig.json', }, rules: { 'react/button-has-type': ['warn'], 'react/forbid-prop-types': ['warn'], 'react/no-array-index-key': ['warn'], }, ignorePatterns: ['.eslintrc.js'], overrides: [ { files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], extends: ['plugin:testing-library/react'], rules: { 'testing-library/no-node-access': 'warn', 'testing-library/no-unnecessary-act': 'warn', 'testing-library/prefer-screen-queries': 'warn', 'testing-library/prefer-find-by': 'warn', 'testing-library/prefer-presence-queries': 'warn', 'testing-library/render-result-naming-convention': 'warn', 'testing-library/no-container': 'warn', }, }, ], };
5,172
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/components/LICENSE
GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS
5,173
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/components/babel.config.js
module.exports = { presets: ['@babel/preset-env', ['@babel/preset-react', { runtime: 'automatic' }], '@babel/preset-typescript'], plugins: [ '@babel/plugin-proposal-object-rest-spread', '@babel/plugin-transform-runtime', 'transform-require-context', ], };
5,174
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/components/index.ts
import './typings/css.d'; import './typings/index.d'; export * from './hooks'; export * from './helpers'; export * from './components'; export * from './containers';
5,175
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/components/jest.config.js
module.exports = { setupFilesAfterEnv: ['./jest.setup.js'], moduleDirectories: ['<rootDir>/node_modules', 'node_modules'], collectCoverageFrom: [ 'components/**/*.{js,jsx,ts,tsx}', 'containers/**/*.{js,jsx,ts,tsx}', 'helpers/**/*.{js,jsx,ts,tsx}', 'hooks/**/*.{js,jsx,ts,tsx}', '!src/app/locales.ts', ], testEnvironment: './jest.env.js', transformIgnorePatterns: [ 'node_modules/(?!(@proton/shared|@proton/components|@protontech/mutex-browser|pmcrypto|@openpgp/web-stream-tools|@protontech/bip39|emoji-mart)/)', ], transform: { '^.+\\.(js|tsx?)$': '<rootDir>/jest.transform.js', }, moduleNameMapper: { '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm)$': '@proton/components/__mocks__/fileMock.js', '\\.(css|scss|less)$': '@proton/components/__mocks__/styleMock.js', '\\.(md)$': '<rootDir>/src/__mocks__/mdMock.ts', }, reporters: ['default', ['jest-junit', { outputName: 'test-report.xml' }]], coverageReporters: ['text', 'lcov', 'cobertura'], };
5,176
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/components/jest.env.js
// Stolen from: https://github.com/ipfs/jest-environment-aegir/blob/master/src/index.js // Overcomes error from jest internals.. this thing: https://github.com/facebook/jest/issues/6248 // Mostly needed for making OpenPGP.js works const JSDOMEnvironment = require('jest-environment-jsdom').default; class MyEnvironment extends JSDOMEnvironment { constructor({ globalConfig, projectConfig }, context) { super( { globalConfig, projectConfig: { ...projectConfig, globals: { ...projectConfig.globals, Uint32Array, Uint8Array, ArrayBuffer }, }, }, context ); } async setup() {} // eslint-disable-line async teardown() {} // eslint-disable-line } module.exports = MyEnvironment;
5,177
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/components/jest.mock.ts
global.AnimationEvent = class AnimationEvent extends Event implements AnimationEvent { private _animationName: string; private _elapsedTime: number; private _pseudoElement: string; constructor(type: string, animationEventInitDict: AnimationEventInit = {}) { const { animationName = '', elapsedTime = 0, pseudoElement = '', ...eventInitDict } = animationEventInitDict; super(type, eventInitDict); this._animationName = animationName; this._elapsedTime = elapsedTime; this._pseudoElement = pseudoElement; } get animationName() { return this._animationName; } get elapsedTime() { return this._elapsedTime; } get pseudoElement() { return this._pseudoElement; } };
5,178
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/components/jest.setup.js
import '@testing-library/jest-dom'; import fetch from 'cross-fetch'; import '@proton/testing/lib/mockMatchMedia'; import '@proton/testing/lib/mockUnleash'; import './jest.mock'; // Silence warnings on expect to throw https://github.com/testing-library/react-testing-library/issues/157 console.error = () => {}; console.warn = () => {}; window.ResizeObserver = jest.fn().mockImplementation(() => ({ observe: jest.fn(), unobserve: jest.fn(), disconnect: jest.fn(), })); /** * JSDOM does not support fetch API * so we need to fake it */ let prevFetch; beforeAll(() => { prevFetch = fetch; global.fetch = fetch; }); afterAll(() => { global.fetch = prevFetch; }); // Do not start crypto worker pool, let the single tests setup/mock the CryptoProxy as needed jest.mock('@proton/shared/lib/helpers/setupCryptoWorker', () => ({ __esModule: true, loadCryptoWorker: jest.fn(), })); jest.mock('@proton/shared/lib/i18n/dateFnLocales', () => ({ __esModule: true, })); jest.mock('@proton/shared/lib/pow/wasmWorkerWrapper.ts', () => ({ __esModule: true, })); jest.mock('@proton/shared/lib/pow/pbkdfWorkerWrapper.ts', () => ({ __esModule: true, })); /** * Due to a JSDom issue `dialog` tag is not understood correctly * Delete this test when the Jest will implement the fix * - Issue: https://github.com/jsdom/jsdom/issues/3294 * - Fix pull request: https://github.com/jsdom/jsdom/pull/3403 */ jest.mock('./components/dialog/Dialog.tsx', () => { const { forwardRef } = jest.requireActual('react'); return { __esModule: true, default: forwardRef(({ children, ...rest }, ref) => { return ( <div {...rest} ref={ref}> {children} </div> ); }), }; }); // Silence JDOM warnings triggered by emoji-mart HTMLCanvasElement.prototype.getContext = jest.fn(); // That's an unresolved issue of jsdom https://github.com/jsdom/jsdom/issues/918 // In particular, we need this fix to render all the components that have PaymentMethodDetails in their trees window.SVGElement.prototype.getBBox = jest.fn().mockReturnValue({ width: 0 }); // Some components use the metrics API. If we don't mock it, tests might fail in a seemingly random manner. // For instance, a test covering a component with metrics might finish successfully, but a subsequent test // could fail seconds later when the metrics batch is sent via fetch. // The metrics package has its own test coverage, so we don't need to test it here. jest.mock('@proton/metrics');
5,179
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/components/jest.transform.js
// Custom Jest transform implementation that injects test-specific babel presets. module.exports = require('babel-jest').default.createTransformer({ presets: ['@babel/preset-env', ['@babel/preset-react', { runtime: 'automatic' }], '@babel/preset-typescript'], plugins: [ '@babel/plugin-proposal-object-rest-spread', '@babel/plugin-transform-runtime', '@babel/plugin-proposal-optional-chaining', 'transform-class-properties', 'transform-require-context', ], });
5,180
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/components/package.json
{ "name": "@proton/components", "description": "", "license": "GPL-3.0", "sideEffects": false, "main": "index.ts", "scripts": { "check-types": "tsc", "export": "./makeExport", "i18n:validate": "proton-i18n validate lint-functions", "i18n:validate:context": "proton-i18n extract reactComponents && proton-i18n validate", "lint": "eslint index.ts containers components hooks typings --ext .js,.ts,.tsx --quiet --cache", "pretty": "prettier --write $(find . -path ./node_modules -prune -o -type f -name '*.js' -o -name '*.ts' -o -name '*.tsx')", "test": "jest --coverage --runInBand --ci --logHeapUsage", "test:dev": "jest --watch" }, "dependencies": { "@emoji-mart/data": "^1.0.3", "@floating-ui/dom": "^1.5.3", "@noble/ed25519": "1.7.3", "@proton/metrics": "workspace:packages/metrics", "@proton/sieve": "workspace:packages/sieve", "@proton/styles": "workspace:packages/styles", "@proton/testing": "workspace:packages/testing", "@protontech/proxy-client-react": "^4.0.4", "@types/codemirror": "5.60.14", "@types/credit-card-type": "^7.0.0", "@types/markdown-it": "^13.0.7", "@types/qrcode.react": "^1.0.5", "@types/react": "^17.0.71", "@types/react-dom": "^17.0.24", "@types/react-router": "^5.1.20", "@types/react-router-dom": "^5.3.3", "@types/react-virtualized": "^9.21.28", "card-validator": "^9.0.0", "codemirror": "^5.65.16", "date-fns": "^2.30.0", "docx-preview": "^0.1.20", "dompurify": "^3.0.6", "emoji-mart": "^5.1.0", "intersection-observer": "^0.12.2", "libphonenumber-js": "^1.10.49", "linkify-it": "^4.0.1", "markdown-it": "^13.0.2", "prop-types": "^15.8.1", "punycode.js": "^2.3.1", "push.js": "^1.0.12", "qrcode.react": "^3.1.0", "react": "^17.0.2", "react-codemirror2": "^7.3.0", "react-dom": "^17.0.2", "react-polymorphic-types": "^2.0.0", "react-router": "^5.3.4", "react-router-dom": "^5.3.4", "react-sortable-hoc": "^2.0.0", "react-virtualized": "^9.22.5", "resize-observer": "^1.0.4", "roosterjs": "8.47.0", "tabbable": "^6.2.0", "tinycolor2": "^1.6.0", "ttag": "^1.7.29", "unleash-proxy-client": "^3.1.0" }, "devDependencies": { "@babel/core": "^7.23.3", "@babel/plugin-proposal-object-rest-spread": "^7.20.7", "@babel/plugin-transform-runtime": "^7.23.4", "@babel/preset-env": "^7.23.3", "@babel/preset-react": "^7.23.3", "@babel/preset-typescript": "^7.23.3", "@proton/eslint-config-proton": "workspace:packages/eslint-config-proton", "@proton/i18n": "workspace:packages/i18n", "@proton/shared": "workspace:packages/shared", "@testing-library/jest-dom": "^6.1.4", "@testing-library/react": "^12.1.5", "@testing-library/react-hooks": "^8.0.1", "@testing-library/user-event": "^14.5.1", "@types/jest": "^29.5.9", "babel-jest": "^29.7.0", "babel-plugin-transform-require-context": "^0.1.1", "cross-fetch": "^4.0.0", "date-fns": "^2.30.0", "eslint": "^8.54.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "prettier": "^3.1.0", "typescript": "^5.3.2" }, "peerDependencies": { "@proton/cross-storage": "*", "@proton/crypto": "*", "@proton/key-transparency": "*", "@proton/shared": "*", "@proton/srp": "*", "date-fns": "^2.30.0" } }
5,181
0
petrpan-code/ProtonMail/WebClients/packages
petrpan-code/ProtonMail/WebClients/packages/components/tsconfig.json
{ "extends": "../../tsconfig.base.json" }
5,182
0
petrpan-code/ProtonMail/WebClients/packages/components
petrpan-code/ProtonMail/WebClients/packages/components/__mocks__/fileMock.js
// __mocks__/fileMock.js module.exports = 'test-file-stub';
5,183
0
petrpan-code/ProtonMail/WebClients/packages/components
petrpan-code/ProtonMail/WebClients/packages/components/__mocks__/styleMock.js
// __mocks__/styleMock.js module.exports = {};
5,184
0
petrpan-code/ProtonMail/WebClients/packages/components
petrpan-code/ProtonMail/WebClients/packages/components/__mocks__/tabbable.js
const lib = jest.requireActual('tabbable'); const tabbable = { ...lib, tabbable: (node, options) => lib.tabbable(node, { ...options, displayCheck: 'none' }), focusable: (node, options) => lib.focusable(node, { ...options, displayCheck: 'none' }), isFocusable: (node, options) => lib.isFocusable(node, { ...options, displayCheck: 'none' }), isTabbable: (node, options) => lib.isTabbable(node, { ...options, displayCheck: 'none' }), }; module.exports = tabbable;
5,185
0
petrpan-code/ProtonMail/WebClients/packages/components
petrpan-code/ProtonMail/WebClients/packages/components/components/index.ts
export * from './actionCard'; export * from './addressesAutocomplete'; export * from './addressesInput'; export * from './alert'; export * from './attachedFile'; export * from './autocomplete'; export * from './badge'; export * from './banner'; export * from './breadcrumb'; export * from './button'; export * from './calendarEventDateHeader'; export * from './checklist'; export * from './collapsible'; export * from './collapsingBreadcrumbs'; export * from './color'; export * from './commander'; export * from './confirmActionModal'; export * from './confirmSignOutModal'; export * from './container'; export * from './contextMenu'; export * from './downloadClientCard'; export * from './dragMoveContainer'; export * from './drawer'; export * from './drive/revisions'; export * from './dropdown'; export * from './dropzone'; export * from './editableText'; export * from './editor'; export * from './ellipsis'; export * from './fileIcon'; export * from './fileNameDisplay'; export * from './focus'; export * from './form'; export * from './globalLoader'; export * from './icon'; export * from './iconRow'; export * from './image'; export * from './input'; export * from './label'; export * from './labelStack'; export * from './link'; export * from './loader'; export * from './logo'; export * from './maintenanceLayout'; export * from './miniCalendar'; export * from './modal'; export * from './modalTwo'; export * from './newFeatureTag'; export * from './option'; export * from './orderable'; export * from './orderableTable'; export * from './pagination'; export * from './popper'; export * from './price'; export * from './progress'; export * from './prompt'; export * from './protonBadge'; export * from './select'; export * from './selectTwo'; export * from './shortcuts'; export * from './sidebar'; export * from './skeletonLoader'; export * from './spinner'; export * from './spotlight'; export * from './stepDot'; export * from './stepDots'; export * from './stripedList'; export * from './table'; export * from './tabs'; export * from './text'; export * from './time'; export * from './timezoneSelector'; export * from './title'; export * from './toggle'; export * from './toolbar'; export * from './tooltip'; export * from './topnavbar'; export * from './treeview'; export * from './upsell'; export * from './v2'; export * from './version'; export * from './videoInstructions';
5,186
0
petrpan-code/ProtonMail/WebClients/packages/components/components
petrpan-code/ProtonMail/WebClients/packages/components/components/actionCard/ActionCard.tsx
import { ComponentPropsWithoutRef } from 'react'; import { Icon, IconName } from '../icon'; import { Loader } from '../loader'; interface ActionCardProps extends ComponentPropsWithoutRef<'button'> { onClick: () => void; iconName: IconName; title: string; subtitle?: string; loading?: boolean; } const ActionCard = ({ iconName, title, subtitle, loading, disabled, ...rest }: ActionCardProps) => { return ( <button type="button" className="action-card text-left w-full flex flex-align-items-center flex-wrap-nowrap p-4 rounded" disabled={disabled || loading} {...rest} > <div className="bg-strong rounded button-for-icon"> <Icon name={iconName} /> </div> <div className="mr-auto flex-item-fluid"> <div className="h6 lh100 m-0 text-bold">{title}</div> {subtitle && <p className="color-weak m-0">{subtitle}</p>} </div> {loading ? <Loader className="inline flex-item-noshrink" /> : <Icon name="arrow-right" />} </button> ); }; export default ActionCard;
5,187
0
petrpan-code/ProtonMail/WebClients/packages/components/components
petrpan-code/ProtonMail/WebClients/packages/components/components/actionCard/index.ts
export { default as ActionCard } from './ActionCard';
5,188
0
petrpan-code/ProtonMail/WebClients/packages/components/components
petrpan-code/ProtonMail/WebClients/packages/components/components/addressesAutocomplete/AddressesAutocomplete.tsx
import { KeyboardEvent, RefObject, forwardRef, useCallback, useMemo, useRef, useState } from 'react'; import { useCombinedRefs } from '@proton/hooks'; import { canonicalizeEmail } from '@proton/shared/lib/helpers/email'; import { Recipient } from '@proton/shared/lib/interfaces'; import { ContactEmail, ContactGroup } from '@proton/shared/lib/interfaces/contacts'; import { SimpleMap } from '@proton/shared/lib/interfaces/utils'; import { handleRecipientInputChange, inputToRecipient } from '@proton/shared/lib/mail/recipient'; import { AutocompleteList, useAutocomplete, useAutocompleteFilter } from '../autocomplete'; import Icon from '../icon/Icon'; import Input, { Props as InputProps } from '../input/Input'; import { Option } from '../option'; import { Marks } from '../text'; import { AddressesAutocompleteItem, GroupsWithContactsMap, getContactGroupsAutocompleteItems, getContactsAutocompleteItems, getNumberOfMembersText, getRecipientFromAutocompleteItem, } from './helper'; interface Props extends Omit<InputProps, 'value'> { id: string; onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void; onAddRecipients: (recipients: Recipient[]) => void; recipients: Recipient[]; anchorRef: RefObject<HTMLElement>; contactEmails?: ContactEmail[]; contactGroups?: ContactGroup[]; contactEmailsMap?: SimpleMap<ContactEmail>; groupsWithContactsMap?: GroupsWithContactsMap; hasEmailPasting?: boolean; hasAddOnBlur?: boolean; limit?: number; } const AddressesAutocomplete = forwardRef<HTMLInputElement, Props>( ( { contactEmails, contactEmailsMap, contactGroups, groupsWithContactsMap, id, onKeyDown, recipients, onAddRecipients, anchorRef, hasEmailPasting = false, hasAddOnBlur = false, limit = 20, onChange, ...rest }: Props, ref ) => { const [input, setInput] = useState(''); const inputRef = useRef<HTMLInputElement>(null); const [recipientsByAddress, recipientsByGroup] = useMemo(() => { return recipients.reduce<[Set<string>, Set<string>]>( (acc, { Address, Group }) => { if (Address) { acc[0].add(canonicalizeEmail(Address)); } if (Group) { acc[1].add(Group); } return acc; }, [new Set(), new Set()] ); }, [recipients]); const isGroupEmpty = (groupID: string) => { return groupsWithContactsMap ? (groupsWithContactsMap[groupID]?.contacts.length || 0) <= 0 : false; }; const contactsAutocompleteItems = useMemo(() => { return [ ...getContactsAutocompleteItems( contactEmails, ({ Email }) => !recipientsByAddress.has(canonicalizeEmail(Email)) ), ...getContactGroupsAutocompleteItems( contactGroups, ({ Path, ID }) => !recipientsByGroup.has(Path) && !isGroupEmpty(ID) ), ]; }, [contactEmails, contactGroups, recipientsByAddress, recipientsByGroup]); const handleAddRecipient = (newRecipients: Recipient[]) => { setInput(''); onAddRecipients(newRecipients); }; const handleAddRecipientFromInput = (input: string) => { const trimmedInput = input.trim(); if (!trimmedInput.length) { setInput(''); return; } const newRecipient = inputToRecipient(trimmedInput); handleAddRecipient([newRecipient]); }; const handleSelect = (item: AddressesAutocompleteItem) => { handleAddRecipient(getRecipientFromAutocompleteItem(contactEmails, item)); }; const getData = useCallback((value) => { return value.label; }, []); const filteredOptions = useAutocompleteFilter(input, contactsAutocompleteItems, getData, limit, 1); // If a group name is equal to the search input, we want to display it as the first option const exactNameGroup = filteredOptions.find( ({ option: { label, type } }) => label === input && type === 'group' ); // Put the group at the first place if found const filteredAndSortedOptions = exactNameGroup ? [exactNameGroup, ...filteredOptions.filter(({ option: { label } }) => label !== input)] : filteredOptions; const { getOptionID, inputProps, suggestionProps } = useAutocomplete<AddressesAutocompleteItem>({ id, options: filteredOptions, onSelect: handleSelect, input, inputRef, }); const handleInputChange = (newValue: string) => { handleRecipientInputChange(newValue, hasEmailPasting, onAddRecipients, setInput); }; return ( <> <Input {...rest} {...inputProps} ref={useCombinedRefs(ref, inputRef)} value={input} onChange={(event) => { handleInputChange(event.currentTarget.value.trimStart()); onChange?.(event); }} onKeyDown={(event) => { // If the default key down handler did not take care of this, add another layer if (!inputProps.onKeyDown(event)) { if (event.key === 'Enter') { handleAddRecipientFromInput(input); event.preventDefault(); } } onKeyDown?.(event); }} onBlur={() => { inputProps.onBlur(); if (hasAddOnBlur) { handleAddRecipientFromInput(input); } }} /> <AutocompleteList anchorRef={anchorRef} {...suggestionProps}> {filteredAndSortedOptions.map(({ chunks, text, option }, index) => { return ( <Option key={option.key} id={getOptionID(index)} title={option.label} value={option} disableFocusOnActive onChange={handleSelect} > {option.type === 'group' ? ( <div className="flex flex-nowrap flex-flex-align-items-center"> <Icon name="circle-filled" color={option.value.Color} size={12} className="mr-2 flex-item-noshrink flex-item-centered-vert" /> <span className="mr-2 text-ellipsis"> <Marks chunks={chunks}>{text}</Marks> </span> {getNumberOfMembersText(option.value.ID, groupsWithContactsMap)} </div> ) : ( <Marks chunks={chunks}>{text}</Marks> )} </Option> ); })} </AutocompleteList> </> ); } ); AddressesAutocomplete.displayName = 'AddressesAutocomplete'; export default AddressesAutocomplete;
5,189
0
petrpan-code/ProtonMail/WebClients/packages/components/components
petrpan-code/ProtonMail/WebClients/packages/components/components/addressesAutocomplete/helper.tsx
import { c, msgid } from 'ttag'; import { SimpleMap } from '@proton/shared/lib/interfaces'; import { ContactEmail, ContactGroup } from '@proton/shared/lib/interfaces/contacts'; import { contactToInput, contactToRecipient, majorToRecipient } from '@proton/shared/lib/mail/recipient'; export type AddressesAutocompleteItem = | { type: 'major'; value: string; label: string; key: string; } | { type: 'contact'; value: ContactEmail; label: string; key: string; score: number; } | { type: 'group'; value: ContactGroup; label: string; key: string; }; export type GroupWithContacts = { group: ContactGroup; contacts: ContactEmail[] }; export type GroupsWithContactsMap = SimpleMap<GroupWithContacts>; const compare = (item1: AddressesAutocompleteItem, item2: AddressesAutocompleteItem) => { if (item1.type === 'contact' && item2.type === 'contact' && item1.score !== item2.score) { return (item2.score || 0) - (item1.score || 0); } if (item1.label > item2.label) { return 1; } if (item1.label < item2.label) { return -1; } return 0; }; export const getRecipientFromAutocompleteItem = ( contactEmails: ContactEmail[] | undefined, item: AddressesAutocompleteItem ) => { if (item.type === 'major') { return [majorToRecipient(item.value)]; } if (item.type === 'contact') { return [contactToRecipient(item.value)]; } if (item.type === 'group') { const group = item.value; return (contactEmails || []) .filter((contact) => contact.LabelIDs?.includes(group.ID || '')) .map((contact) => contactToRecipient(contact, group.Path)); } throw new Error('Unknown type'); }; export const getContactsAutocompleteItems = ( contactEmails: ContactEmail[] = [], filter: (contact: ContactEmail) => boolean ) => { return contactEmails .filter(filter) .map( (contact) => ({ label: contactToInput(contact), value: contact, type: 'contact', key: contact.ID, score: contact.LastUsedTime || 0, } as const) ) .sort(compare); }; export const getContactGroupsAutocompleteItems = ( contactGroups: ContactGroup[] = [], filter: (contactGroup: ContactGroup) => boolean ) => { return contactGroups .filter(filter) .map((group) => { return { label: group.Name, value: group, key: group.ID, type: 'group', } as const; }) .sort(compare); }; export const getNumberOfMembersText = (groupID: string, groupsWithContactsMap?: GroupsWithContactsMap) => { const memberCount = groupsWithContactsMap ? groupsWithContactsMap[groupID]?.contacts.length || 0 : 0; // translator: number of members of a contact group, the variable is a positive integer (written in digits) always greater or equal to 0 return c('Info').ngettext(msgid`(${memberCount} member)`, `(${memberCount} members)`, memberCount); }; export const getNumberOfMembersCount = (groupID: string, groupsWithContactsMap?: GroupsWithContactsMap) => { const memberCount = groupsWithContactsMap ? groupsWithContactsMap[groupID]?.contacts.length || 0 : 0; return `(${memberCount})`; };
5,190
0
petrpan-code/ProtonMail/WebClients/packages/components/components
petrpan-code/ProtonMail/WebClients/packages/components/components/addressesAutocomplete/index.ts
export { default as AddressesAutocomplete } from './AddressesAutocomplete'; export * from './helper';
5,191
0
petrpan-code/ProtonMail/WebClients/packages/components/components
petrpan-code/ProtonMail/WebClients/packages/components/components/addressesInput/AddressesInput.tsx
import { ComponentPropsWithoutRef, HTMLProps, MouseEvent, ReactElement, ReactNode, forwardRef } from 'react'; import { c } from 'ttag'; import clsx from '@proton/utils/clsx'; import { Icon } from '../icon'; import { Tooltip } from '../tooltip'; interface AddressesInputItemProps extends ComponentPropsWithoutRef<'div'> { iconTooltipTitle?: string; labelTooltipTitle?: string; onRemove: (event: MouseEvent<HTMLButtonElement>) => void; icon?: ReactElement; label?: string; labelProps?: HTMLProps<HTMLSpanElement> & { 'data-testid'?: string }; removeProps?: HTMLProps<HTMLButtonElement> & { 'data-testid'?: string }; } export const AddressesInputItem = forwardRef<HTMLDivElement, AddressesInputItemProps>(function AddressesInputItemProps( { className, children, icon, iconTooltipTitle, label, labelProps: { className: labelClassName, ...labelRest } = {}, labelTooltipTitle, removeProps, onRemove, ...rest }, ref ) { const wrappedLabel = ( <span className={clsx(['pill-label my-auto px-2 text-ellipsis', labelClassName])} {...labelRest}> {label} </span> ); return ( <> <div className={clsx([ 'pill my-1 mr-2 flex flex-nowrap flex-row max-w-full overflow-hidden stop-propagation cursor-grab rounded', className, ])} ref={ref} {...rest} > <span className="interactive flex flex-row flex-nowrap"> {iconTooltipTitle && icon ? <Tooltip title={iconTooltipTitle}>{icon}</Tooltip> : icon} {labelTooltipTitle ? <Tooltip title={labelTooltipTitle}>{wrappedLabel}</Tooltip> : wrappedLabel} </span> <Tooltip title={c('Action').t`Remove`}> <button {...removeProps} className="pill-remove inline-flex flex-item-noshrink p-2 no-pointer-events-children h-full interactive" onClick={onRemove} type="button" > <Icon name="cross" size={12} className="m-auto" /> <span className="sr-only">{c('Action').t`Remove`}</span> </button> </Tooltip> </div> {children} </> ); }); interface AddressesInputProps { className?: string; children?: ReactNode; items?: ReactNode; placeholder?: ReactNode; autocomplete: ReactNode; autocompleteContainerProps?: HTMLProps<HTMLDivElement>; inputContainerClassName?: string; onClick?: () => void; } const AddressesInput = forwardRef<HTMLDivElement, AddressesInputProps>(function AddressesInputComponent( { className, children, items, placeholder, autocomplete, autocompleteContainerProps: { className: autocompleteContainerClassName, ...autocompleteContainerRest } = {}, inputContainerClassName, onClick, }, ref ) { return ( <div className={clsx(['w-full flex-item-fluid relative', className])} ref={ref} onClick={onClick}> <div className={clsx(['flex-no-min-children flex-item-fluid', autocompleteContainerClassName])} {...autocompleteContainerRest} > <div className="flex-item-fluid flex max-w-full max-h-full relative"> {items} {placeholder} <div className="flex max-w-full max-h-full relative flex-item-grow-2"> <div className={clsx(['flex-item-fluid flex flex-align-items-center', inputContainerClassName])} > {autocomplete} </div> </div> </div> {children} </div> </div> ); }); export default AddressesInput;
5,192
0
petrpan-code/ProtonMail/WebClients/packages/components/components
petrpan-code/ProtonMail/WebClients/packages/components/components/addressesInput/index.ts
export { default as AddressesInput } from './AddressesInput'; export * from './AddressesInput';
5,193
0
petrpan-code/ProtonMail/WebClients/packages/components/components
petrpan-code/ProtonMail/WebClients/packages/components/components/alert/Alert.test.tsx
import { render } from '@testing-library/react'; import Alert from './Alert'; describe('Alert component', () => { const text = 'Panda'; const { container } = render(<Alert className="mb-4">{text}</Alert>); const { firstChild } = container; it('renders children', () => { expect(firstChild?.textContent).toBe(text); }); it('has default class', () => { expect(firstChild).toHaveClass('mb-4 alert-block'); }); it('should have error class for warning type', () => { const { container } = render( <Alert className="mb-4" type="warning"> {text} </Alert> ); expect(container.firstChild).toHaveClass('mb-4 alert-block--warning'); }); });
5,194
0
petrpan-code/ProtonMail/WebClients/packages/components/components
petrpan-code/ProtonMail/WebClients/packages/components/components/alert/Alert.tsx
import { ReactNode } from 'react'; import clsx from '@proton/utils/clsx'; export type AlertType = 'info' | 'error' | 'warning' | 'success'; type ClassesMap = { [key in AlertType]: string }; const classesMap: ClassesMap = { info: 'alert-block', warning: 'alert-block--warning', error: 'alert-block--danger', success: 'alert-block--success', }; interface AlertProps { type?: AlertType; children?: ReactNode; className?: string; 'data-testid'?: string; } const Alert = ({ type = 'info', children, className, 'data-testid': dataTestId }: AlertProps) => { return ( <div className={clsx(classesMap[type], className)} data-testid={dataTestId}> {children} </div> ); }; export default Alert;
5,195
0
petrpan-code/ProtonMail/WebClients/packages/components/components
petrpan-code/ProtonMail/WebClients/packages/components/components/alert/index.ts
export { default as Alert } from './Alert';
5,196
0
petrpan-code/ProtonMail/WebClients/packages/components/components
petrpan-code/ProtonMail/WebClients/packages/components/components/attachedFile/AttachedFile.tsx
import { Button } from '@proton/atoms/Button'; import { splitExtension } from '@proton/shared/lib/helpers/file'; import humanSize from '@proton/shared/lib/helpers/humanSize'; import Icon, { IconName } from '../icon/Icon'; interface Props { file: File; iconName: IconName; className?: string; clear?: string; onClear?: () => void; } const AttachedFile = ({ file, iconName, className, clear, onClear, ...rest }: Props) => { const [fileName, extension] = splitExtension(file.name); return ( <div className={`flex border w-full rounded ${className}`} {...rest}> <div className="p-1 flex flex-item-noshrink w-1/10"> <Icon name={iconName} className="m-auto" /> </div> <div className="message-attachmentInfo p-2 flex flex-nowrap w-9/10"> <div className="flex-item-fluid pr-4"> <div className="text-ellipsis" title={fileName}> {fileName} </div> <div>{`${extension.toUpperCase()} - ${humanSize(file.size)}`}</div> </div> {clear && onClear && ( <Button className="flex-item-noshrink" onClick={onClear}> {clear} </Button> )} </div> </div> ); }; export default AttachedFile;
5,197
0
petrpan-code/ProtonMail/WebClients/packages/components/components
petrpan-code/ProtonMail/WebClients/packages/components/components/attachedFile/index.ts
export { default as AttachedFile } from './AttachedFile';
5,198
0
petrpan-code/ProtonMail/WebClients/packages/components/components
petrpan-code/ProtonMail/WebClients/packages/components/components/autocomplete/Autocomplete.tsx
import { useRef } from 'react'; import Input, { Props as InputProps } from '../input/Input'; import { Option } from '../option'; import { Marks } from '../text'; import AutocompleteList from './AutocompleteList'; import { useAutocomplete, useAutocompleteFilter } from './useAutocomplete'; export interface Props<T> extends Omit<InputProps, 'value' | 'onChange' | 'onSelect'> { id: string; value: string; /** * Change handler for the underlying input element of the Autocomplete */ onChange: (value: string) => void; /** * Select handler for a selection from the Autocomplete's dropdown */ onSelect: (value: T) => void; options: T[]; /** * Limits the number of search results that the dropdown will display. */ limit?: number; /** * Maps a value from the "options" array prop to its human-readable * display value as well as the value used to determine source for * autocompletion filtering. */ getData: (value: T) => string; /** * Determines the minumum number of characters from which to consider * an input into the autocomplete input-field as a search. */ searchMinLength?: number; } const Autocomplete = <T,>({ id, value, onChange, onSelect, options, limit = 20, searchMinLength = 0, getData, ...rest }: Props<T>) => { const inputRef = useRef<HTMLInputElement>(null); const containerRef = useRef<HTMLDivElement>(null); const filteredOptions = useAutocompleteFilter(value, options, getData, limit, searchMinLength); const handleSelect = (optionValue: T) => { onSelect(optionValue); }; const { onClose, getOptionID, inputProps, suggestionProps } = useAutocomplete({ id, options: filteredOptions, onSelect: handleSelect, input: value, inputRef, }); const handleSelectOption = (optionValue: T) => { handleSelect(optionValue); onClose(); }; return ( <> <Input {...rest} {...inputProps} containerRef={containerRef} ref={inputRef} value={value} onChange={(event) => { onChange(event.currentTarget.value.trimStart()); }} onKeyDown={(event) => { if (!inputProps.onKeyDown(event)) { if (event.key === 'Enter') { handleSelectOption(value as any); event.preventDefault(); } } }} /> <AutocompleteList anchorRef={containerRef.current ? containerRef : inputRef} {...suggestionProps}> {filteredOptions.map(({ chunks, text, option }, index) => { return ( <Option key={getOptionID(index)} id={getOptionID(index)} title={text} value={option} disableFocusOnActive onChange={handleSelectOption} > <Marks chunks={chunks}>{text}</Marks> </Option> ); })} </AutocompleteList> </> ); }; export default Autocomplete;
5,199