Skip to content

Commit

Permalink
feat: color module (#801)
Browse files Browse the repository at this point in the history
Co-authored-by: Shinigami <chrissi92@hotmail.de>
  • Loading branch information
harsohailB and Shinigami92 committed May 22, 2022
1 parent bd4d3db commit bee6054
Show file tree
Hide file tree
Showing 84 changed files with 1,500 additions and 58 deletions.
1 change: 1 addition & 0 deletions docs/.vitepress/api-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
export const apiPages = [
{ text: 'Address', link: '/api/address.html' },
{ text: 'Animal', link: '/api/animal.html' },
{ text: 'Color', link: '/api/color.html' },
{ text: 'Commerce', link: '/api/commerce.html' },
{ text: 'Company', link: '/api/company.html' },
{ text: 'Database', link: '/api/database.html' },
Expand Down
1 change: 1 addition & 0 deletions scripts/generateLocales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type DefinitionsType = {
const definitionsTypes: DefinitionsType = {
address: 'AddressDefinitions',
animal: 'AnimalDefinitions',
color: 'ColorDefinitions',
commerce: 'CommerceDefinitions',
company: 'CompanyDefinitions',
database: 'DatabaseDefinitions',
Expand Down
15 changes: 15 additions & 0 deletions src/definitions/color.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { LocaleEntry } from './definitions';

/**
* The possible definitions related to color.
*/
export type ColorDefinitions = LocaleEntry<{
/**
* Human readable color names
*/
human: string[];
/**
* Color space names.
*/
space: string[];
}>;
4 changes: 0 additions & 4 deletions src/definitions/commerce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import type { LocaleEntry } from './definitions';
* The possible definitions related to commerce.
*/
export type CommerceDefinitions = LocaleEntry<{
/**
* Human readable color names
*/
color: string[];
/**
* Department names inside a shop.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/definitions/definitions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { AddressDefinitions } from './address';
import type { AnimalDefinitions } from './animal';
import type { ColorDefinitions } from './color';
import type { CommerceDefinitions } from './commerce';
import type { CompanyDefinitions } from './company';
import type { DatabaseDefinitions } from './database';
Expand All @@ -26,6 +27,7 @@ export type LocaleEntry<T> = Partial<T> &
export interface Definitions {
address: AddressDefinitions;
animal: AnimalDefinitions;
color: ColorDefinitions;
commerce: CommerceDefinitions;
company: CompanyDefinitions;
database: DatabaseDefinitions;
Expand Down
1 change: 1 addition & 0 deletions src/definitions/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export type { AddressDefinitions } from './address';
export type { AnimalDefinitions } from './animal';
export type { ColorDefinitions } from './color';
export type {
CommerceDefinitions,
CommerceProductNameDefinitions,
Expand Down
2 changes: 2 additions & 0 deletions src/faker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { FakerError } from './errors/faker-error';
import type { KnownLocale } from './locales';
import { Address } from './modules/address';
import { Animal } from './modules/animal';
import { Color } from './modules/color';
import { Commerce } from './modules/commerce';
import { Company } from './modules/company';
import { Database } from './modules/database';
Expand Down Expand Up @@ -60,6 +61,7 @@ export class Faker {

readonly address: Address = new Address(this);
readonly animal: Animal = new Animal(this);
readonly color: Color = new Color(this);
readonly commerce: Commerce = new Commerce(this);
readonly company: Company = new Company(this);
readonly database: Database = new Database(this);
Expand Down
9 changes: 9 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import allLocales from './locales';
export type {
AddressDefinitions,
AnimalDefinitions,
ColorDefinitions,
CommerceDefinitions,
CommerceProductNameDefinitions,
CompanyDefinitions,
Expand All @@ -27,6 +28,14 @@ export type {
} from './definitions';
export { FakerError } from './errors/faker-error';
export type { FakerOptions, UsableLocale, UsedLocales } from './faker';
export type {
Casing,
ColorFormat,
CSSFunction,
CSSSpace,
NumberColorFormat,
StringColorFormat,
} from './modules/color';
export { Gender } from './modules/name';
export type { GenderType } from './modules/name';
export { Faker };
Expand Down
File renamed without changes.
12 changes: 12 additions & 0 deletions src/locales/ar/color/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate:locales' to update.
*/
import type { ColorDefinitions } from '../../..';
import human from './human';

const color: ColorDefinitions = {
human,
};

export default color;
2 changes: 0 additions & 2 deletions src/locales/ar/commerce/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CommerceDefinitions } from '../../..';
import color from './color';
import department from './department';
import product_name from './product_name';

const commerce: CommerceDefinitions = {
color,
department,
product_name,
};
Expand Down
2 changes: 2 additions & 0 deletions src/locales/ar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import type { LocaleDefinition } from '../..';
import address from './address';
import cell_phone from './cell_phone';
import color from './color';
import commerce from './commerce';
import date from './date';
import name_ from './name';
Expand All @@ -17,6 +18,7 @@ const ar: LocaleDefinition = {
separator: ' & ',
address,
cell_phone,
color,
commerce,
date,
name: name_,
Expand Down
File renamed without changes.
12 changes: 12 additions & 0 deletions src/locales/az/color/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate:locales' to update.
*/
import type { ColorDefinitions } from '../../..';
import human from './human';

const color: ColorDefinitions = {
human,
};

export default color;
2 changes: 0 additions & 2 deletions src/locales/az/commerce/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CommerceDefinitions } from '../../..';
import color from './color';
import department from './department';
import product_name from './product_name';

const commerce: CommerceDefinitions = {
color,
department,
product_name,
};
Expand Down
2 changes: 2 additions & 0 deletions src/locales/az/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
import type { LocaleDefinition } from '../..';
import address from './address';
import color from './color';
import commerce from './commerce';
import company from './company';
import date from './date';
Expand All @@ -15,6 +16,7 @@ const az: LocaleDefinition = {
title: 'Azerbaijani',
separator: ' və ',
address,
color,
commerce,
company,
date,
Expand Down
File renamed without changes.
12 changes: 12 additions & 0 deletions src/locales/el/color/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate:locales' to update.
*/
import type { ColorDefinitions } from '../../..';
import human from './human';

const color: ColorDefinitions = {
human,
};

export default color;
2 changes: 0 additions & 2 deletions src/locales/el/commerce/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CommerceDefinitions } from '../../..';
import color from './color';
import department from './department';
import product_name from './product_name';

const commerce: CommerceDefinitions = {
color,
department,
product_name,
};
Expand Down
2 changes: 2 additions & 0 deletions src/locales/el/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import address from './address';
import app from './app';
import business from './business';
import cell_phone from './cell_phone';
import color from './color';
import commerce from './commerce';
import company from './company';
import finance from './finance';
Expand All @@ -24,6 +25,7 @@ const el: LocaleDefinition = {
app,
business,
cell_phone,
color,
commerce,
company,
finance,
Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions src/locales/en/color/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate:locales' to update.
*/
import type { ColorDefinitions } from '../../..';
import human from './human';
import space from './space';

const color: ColorDefinitions = {
human,
space,
};

export default color;
43 changes: 43 additions & 0 deletions src/locales/en/color/space.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
export default [
'CIE 1931 XYZ',
'CIEUVW',
'Uniform Color Spaces (UCSs)',
'CIELUV',
'CIELAB',
'HSLuv',
'sRGB',
'Adobe RGB',
'Adobe Wide Gamut RGB',
'Rec. 2100',
'ProPhoto RGB Color Space',
'scRGB',
'DCI-P3',
'Display-P3',
'Rec. 601',
'Rec. 709',
'Academy Color Encoding System (ACES)',
'Rec. 2020',
'YPbPr',
'YDbDr',
'YIQ',
'xvYCC',
'sYCC',
'HSV',
'HSL',
'HWB',
'RGBA',
'HSLA',
'LCh',
'CMY',
'CMYK',
'Munsell Color System',
'Natural Color System (NSC)',
'Pantone Matching System (PMS)',
'RAL',
'Federal Standard 595C',
'British Standard Colour (BS)',
'HKS',
'LMS',
'RG',
'RGK',
];
2 changes: 0 additions & 2 deletions src/locales/en/commerce/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CommerceDefinitions } from '../../..';
import color from './color';
import department from './department';
import product_description from './product_description';
import product_name from './product_name';

const commerce: CommerceDefinitions = {
color,
department,
product_description,
product_name,
Expand Down
2 changes: 2 additions & 0 deletions src/locales/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import animal from './animal';
import app from './app';
import business from './business';
import cell_phone from './cell_phone';
import color from './color';
import commerce from './commerce';
import company from './company';
import database from './database';
Expand All @@ -32,6 +33,7 @@ const en: LocaleDefinition = {
app,
business,
cell_phone,
color,
commerce,
company,
database,
Expand Down
File renamed without changes.
12 changes: 12 additions & 0 deletions src/locales/es/color/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate:locales' to update.
*/
import type { ColorDefinitions } from '../../..';
import human from './human';

const color: ColorDefinitions = {
human,
};

export default color;
2 changes: 0 additions & 2 deletions src/locales/es/commerce/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CommerceDefinitions } from '../../..';
import color from './color';
import department from './department';
import product_name from './product_name';

const commerce: CommerceDefinitions = {
color,
department,
product_name,
};
Expand Down
2 changes: 2 additions & 0 deletions src/locales/es/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import type { LocaleDefinition } from '../..';
import address from './address';
import cell_phone from './cell_phone';
import color from './color';
import commerce from './commerce';
import company from './company';
import internet from './internet';
Expand All @@ -15,6 +16,7 @@ const es: LocaleDefinition = {
title: 'Spanish',
address,
cell_phone,
color,
commerce,
company,
internet,
Expand Down
File renamed without changes.
12 changes: 12 additions & 0 deletions src/locales/es_MX/color/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate:locales' to update.
*/
import type { ColorDefinitions } from '../../..';
import human from './human';

const color: ColorDefinitions = {
human,
};

export default color;
2 changes: 0 additions & 2 deletions src/locales/es_MX/commerce/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CommerceDefinitions } from '../../..';
import color from './color';
import department from './department';
import product_name from './product_name';

const commerce: CommerceDefinitions = {
color,
department,
product_name,
};
Expand Down

0 comments on commit bee6054

Please sign in to comment.