jamespot-react-components 1.3.46 → 1.3.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jamespot-react-components.cjs +1182 -1080
- package/dist/jamespot-react-components.js +13504 -13042
- package/dist/scripts/generate.d.ts +1 -0
- package/dist/src/components/JRCAvatars/JRCAvatars.d.ts +2 -1
- package/dist/src/components/JRCButton/types.d.ts +1 -1
- package/dist/src/components/JRCButtonDropdown/JRCButtonDropdown.styles.d.ts +2 -1
- package/dist/src/components/JRCButtonDropdown/JRCButtonDropdown.types.d.ts +8 -6
- package/dist/src/components/JRCDate/JRCDateObject.d.ts +9 -0
- package/dist/src/components/JRCDate/JRCDateObject.stories.d.ts +8 -0
- package/dist/src/components/JRCDot/JRCDot.d.ts +2 -0
- package/dist/src/components/JRCDot/JRCDot.stories.d.ts +8 -0
- package/dist/src/components/JRCDragNDrop/Draggable.d.ts +4 -3
- package/dist/src/components/JRCDragNDrop/JRCDndOneLevel.d.ts +2 -0
- package/dist/src/components/JRCDragNDrop/JRCDndOneLevel.stories.d.ts +30 -0
- package/dist/src/components/JRCDragNDrop/JRCDndTwoLevelWithStack.stories.d.ts +1 -1
- package/dist/src/components/JRCDragNDrop/index.d.ts +5 -3
- package/dist/src/components/JRCDragNDrop/styles.d.ts +21 -0
- package/dist/src/components/JRCDragNDrop/types.d.ts +26 -83
- package/dist/src/components/JRCList/JRCList.styles.d.ts +1 -0
- package/dist/src/components/JRCMetas/JRCMetas.d.ts +4 -0
- package/dist/src/components/JRCMetas/JRCMetas.stories.d.ts +13 -0
- package/dist/src/components/JRCSocialActions/JRCSocialActions.d.ts +10 -0
- package/dist/src/components/JRCStyledHref/JRCStyledHref.d.ts +3 -0
- package/dist/src/components/Widgets/JRCWidgetQuickSurvey/JRCWidgetQuickSurveyEditor.d.ts +2 -1
- package/dist/src/components/Widgets/JRCWidgetQuickSurvey/JRCWidgetQuickSurveyEditorAddEntry.d.ts +1 -3
- package/dist/src/components/Widgets/JRCWidgetQuickSurvey/JRCWidgetQuickSurveyEditorEntries.d.ts +2 -1
- package/dist/src/components/Widgets/JRCWidgetQuickSurvey/JRCWidgetQuickSurveyItemWrapper.d.ts +1 -0
- package/dist/src/components/Widgets/JRCWidgetSurveyDate/JRCWidgetSurveyDate.d.ts +12 -0
- package/dist/src/components/Widgets/JRCWidgetSurveyDate/JRCWidgetSurveyDate.stories.d.ts +5 -0
- package/dist/src/components/Widgets/JRCWidgetSurveyDate/SurveyDateItem.d.ts +16 -0
- package/dist/src/components/Widgets/JRCWidgetSurveyDate/SurveyDateItemRespondents.d.ts +5 -0
- package/dist/src/components/Widgets/JRCWidgetSurveyDate/types.d.ts +18 -0
- package/dist/src/components/index.d.ts +9 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/styles/theme.d.ts +1 -0
- package/dist/src/translation/lang.json.d.ts +17 -0
- package/dist/src/types.d.ts +1 -1
- package/dist/src/utils/index.d.ts +3 -1
- package/dist/src/utils/utils.color.d.ts +32 -0
- package/dist/src/utils/utils.date.d.ts +1 -0
- package/dist/src/utils/utils.files.d.ts +1 -1
- package/dist/src/utils/utils.form.d.ts +2 -0
- package/dist/src/utils/utils.image.d.ts +3 -0
- package/package.json +2 -2
- package/scripts/generate.ts +121 -0
- package/dist/src/styles/utils.d.ts +0 -32
|
@@ -110,6 +110,8 @@ declare const _default: {
|
|
|
110
110
|
"CRPT_Report_Description_Required": "La description est obligatoire",
|
|
111
111
|
"CRPT_Report_Sent": "Report sent",
|
|
112
112
|
"DND_ADD_SECTION": "+ Add section",
|
|
113
|
+
"DND_LIST_TITLE": "Items",
|
|
114
|
+
"DND_EMPTY_STATE": "No items to display",
|
|
113
115
|
"DND_NEW_SECTION_LABEL": "New Section",
|
|
114
116
|
"DND_SECTIONS_TITLE": "Sections",
|
|
115
117
|
"DND_STACK_TITLE": "Active Buttons",
|
|
@@ -168,6 +170,7 @@ declare const _default: {
|
|
|
168
170
|
"GLOBAL_Confirm": "Confirm",
|
|
169
171
|
"GLOBAL_Continue": "Continue",
|
|
170
172
|
"GLOBAL_Creation_Date": "Creation date",
|
|
173
|
+
"Global_Create": "Créer",
|
|
171
174
|
"GLOBAL_Creator": "Creator",
|
|
172
175
|
"GLOBAL_DateTime_Placeholder": "Date and time",
|
|
173
176
|
"GLOBAL_Date_Placeholder": "Date",
|
|
@@ -208,6 +211,7 @@ declare const _default: {
|
|
|
208
211
|
"GLOBAL_Login": "Login",
|
|
209
212
|
"GLOBAL_Move": "Move",
|
|
210
213
|
"GLOBAL_Next": "Next",
|
|
214
|
+
"GLOBAL_New": "Nouveau",
|
|
211
215
|
"GLOBAL_No_Result": "No result",
|
|
212
216
|
"GLOBAL_Object_Link": "Objet lié",
|
|
213
217
|
"GLOBAL_Ok": "OK",
|
|
@@ -381,6 +385,9 @@ declare const _default: {
|
|
|
381
385
|
"WIDGET_Prompt_Logout": "Se déconnecter",
|
|
382
386
|
"WIDGET_Quick_Survey": "Add a survey to collect feedback",
|
|
383
387
|
"WIDGET_Quick_Survey_Text": "Add a survey to collect feedback",
|
|
388
|
+
"WIDGET_Quick_Survey_isStarted": "The survey has already some answers, you can't make any change to it, if you need to, please reset the survey.",
|
|
389
|
+
"WIDGET_Quick_Survey_Reset": "Reset the survey answers",
|
|
390
|
+
"WIDGET_Quick_Survey_isStarted_no_modification": "The survey has already some answers, some modifications are not possible, if needed, please start a new survey.",
|
|
384
391
|
"WIDGET_Set_Widget": "Configurer",
|
|
385
392
|
"WIDGET_Survey_After_Help": "Respondents will only see the results once after they respond. They will no longer be able to edit their answer.",
|
|
386
393
|
"WIDGET_Survey_Anonymize_Help": "Les réponses de ce sondage seront anonymes : personne ne pourra savoir qui a répondu quoi, seulement les pourcentages.",
|
|
@@ -406,6 +413,16 @@ declare const _default: {
|
|
|
406
413
|
"WIDGET_Welcome_Text": "Rendez vos pages plus personnelles en accueillant chaleureusement vos utilisateurs.",
|
|
407
414
|
"WIDGET_Welcome_Default_Message": "Bienvenue",
|
|
408
415
|
"WIDGET_Welcome_Linebreak_Label": "Saut de ligne (après le message)",
|
|
416
|
+
"WIDGET_Survey_Date_Add_Event": "Ajouter",
|
|
417
|
+
"WIDGET_Survey_Date_Label": "{label} {day} à {time}",
|
|
418
|
+
"WIDGET_Survey_Date_Participant_At": "Participants le {date}",
|
|
419
|
+
"WIDGET_Survey_Date_Revive": "Relancer les participants",
|
|
420
|
+
"WIDGET_Survey_Date_Revive_All": "Tous les participants",
|
|
421
|
+
"WIDGET_Survey_Date_Revive_Message": "Message de relance",
|
|
422
|
+
"WIDGET_Survey_Date_Revive_Confirm": "Relancer",
|
|
423
|
+
"WIDGET_Survey_Date_Revive_User_With_No_Response": "Les participants sans réponse",
|
|
424
|
+
"WIDGET_Survey_Date_Stats": "{totalResponse}/{totalRespondents} personnes ont répondu ({percent}%)",
|
|
425
|
+
"WIDGET_Survey_Date_End_At": "Fin le {dateEnd}",
|
|
409
426
|
"PANEL_Widget_Extension_Name": "Nom de l'extension"
|
|
410
427
|
}
|
|
411
428
|
}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export type { JRCColumnRightProps } from './components/JRCColumnRight/JRCColumnR
|
|
|
44
44
|
export type { Area } from './components/JRCCropImage/JRCCropImage';
|
|
45
45
|
export type { JRCDateProps } from './components/JRCDate/JRCDate';
|
|
46
46
|
export type { JRCDisplayCardProps } from './components/JRCDisplayCard/JRCDisplayCard';
|
|
47
|
-
export type { BaseDndItem, DndData, DndDragItem, DndEmptyStateComponentProps, DndItemComponentProps, DndSection, DndSectionComponentProps, ItemTypes, JRCDndTwoLevelWithStackProps, } from './components/JRCDragNDrop/types';
|
|
47
|
+
export type { BaseDndItem, DndData, DndDragItem, DndEmptyStateComponentProps, DndItemComponentProps, DndSection, DndSectionComponentProps, ItemTypes, JRCDndOneLevelProps, JRCDndTwoLevelWithStackProps, } from './components/JRCDragNDrop/types';
|
|
48
48
|
export type { JRCDropDownProps } from './components/JRCDropDown/JRCDropDown';
|
|
49
49
|
export type { JRCFileOpenProps } from './components/JRCFileOpen/JRCFileOpen';
|
|
50
50
|
export type { JRCFileViewerOpenWithOptionsType } from './components/JRCFileViewer/types';
|
|
@@ -2,9 +2,10 @@ import * as array from './utils.array';
|
|
|
2
2
|
import * as color from './utils.color';
|
|
3
3
|
import * as date from './utils.date';
|
|
4
4
|
import * as document from './utils.document';
|
|
5
|
+
import * as file from './utils.files';
|
|
6
|
+
import * as form from './utils.form';
|
|
5
7
|
import * as icons from './utils.icons';
|
|
6
8
|
import * as image from './utils.image';
|
|
7
|
-
import * as file from './utils.files';
|
|
8
9
|
import * as misc from './utils.misc';
|
|
9
10
|
import * as object from './utils.object';
|
|
10
11
|
import * as regexp from './utils.regexp';
|
|
@@ -16,6 +17,7 @@ export declare const Utils: {
|
|
|
16
17
|
date: typeof date;
|
|
17
18
|
document: typeof document;
|
|
18
19
|
file: typeof file;
|
|
20
|
+
form: typeof form;
|
|
19
21
|
icons: typeof icons;
|
|
20
22
|
image: typeof image;
|
|
21
23
|
misc: typeof misc;
|
|
@@ -52,6 +52,38 @@ export declare const colorimetry: {
|
|
|
52
52
|
export declare const getContrast50: (hexcolor: string) => "black" | "white";
|
|
53
53
|
export declare const getContrastYIQ: (hexcolor: string) => "black" | "white";
|
|
54
54
|
export declare function isValidHexColor(color: string): boolean;
|
|
55
|
+
export declare const hexToRgb: (hex: string) => {
|
|
56
|
+
r: number;
|
|
57
|
+
g: number;
|
|
58
|
+
b: number;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* @param hexColor a color in the format #XXX or #XXXXXX
|
|
62
|
+
* @param adjustPercent a number between -1 and 1, <0 for darkening, >0 for lightening
|
|
63
|
+
* @returns a string of the form #XXXXXX representing the modified color. Returns undefined if parameters are invalid.
|
|
64
|
+
*/
|
|
65
|
+
export declare const modifyColorBrightness: (hexColor: string, adjustPercent: number) => string | undefined;
|
|
66
|
+
export declare const HSBToRGB: (hue: number, saturation: number, brightness: number) => number[];
|
|
67
|
+
export declare const RGBToHSB: (r: number, g: number, b: number) => number[];
|
|
68
|
+
export declare const hexToHSL: (H: any) => number[];
|
|
69
|
+
export declare function hlsToHex(h: number, s: number, l: number): string[];
|
|
70
|
+
export declare const colorContrast: (color: string) => string;
|
|
71
|
+
export declare const brightness: (color: string) => number;
|
|
72
|
+
export declare const rgbToHex: (r: number, g: number, b: number) => string;
|
|
73
|
+
/**
|
|
74
|
+
* Darkens the color following a linear distorsion
|
|
75
|
+
* @param hex Color in hexadecimal format, beginning with the # character
|
|
76
|
+
* @param darkPercentage dark percentage (bewteen 0 and 1, 0 beeing the same color, 1 beeing black)
|
|
77
|
+
* @returns hexadecimal color
|
|
78
|
+
*/
|
|
79
|
+
export declare const getDarkShade: (hex: string, darkPercentage: number) => string;
|
|
80
|
+
/**
|
|
81
|
+
* Lightens the color following a linear distorsion
|
|
82
|
+
* @param hex Color in hexadecimal format, beginning with the # character
|
|
83
|
+
* @param lightPercentage light percentage (bewteen 0 and 1, 0 beeing the same color, 1 beeing white)
|
|
84
|
+
* @returns hexadecimal color
|
|
85
|
+
*/
|
|
86
|
+
export declare const getLightShade: (hex: string, lightPercentage: number) => string;
|
|
55
87
|
export type MessageType = 'success' | 'error' | 'warning';
|
|
56
88
|
export declare const MessageColor: {
|
|
57
89
|
readonly success: "green";
|
|
@@ -8,6 +8,7 @@ export interface extractDateProps {
|
|
|
8
8
|
}
|
|
9
9
|
export type DateFormat = 'date' | 'date-time' | 'date-time-sec' | 'time' | 'time-sec';
|
|
10
10
|
type DateArgs = number | string | Date;
|
|
11
|
+
export declare const padDate: (n: number) => string;
|
|
11
12
|
export declare const extractDate: (str?: DateArgs) => extractDateProps;
|
|
12
13
|
/**
|
|
13
14
|
* Format date to YYYY-MM-DD
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { Audience, AudienceAutocomplete, jFolderLittle } from 'jamespot-user-api';
|
|
1
2
|
import { ValidationRule } from 'react-hook-form';
|
|
2
3
|
export declare const formRuleMaxLength: (rule: ValidationRule<number> | undefined) => number | undefined;
|
|
4
|
+
export declare const audienceToAutocomplete: (audience: Array<Audience | jFolderLittle>) => AudienceAutocomplete[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Model } from 'jamespot-user-api';
|
|
1
2
|
export declare const getExtensionFromName: (name: string) => string;
|
|
2
3
|
export declare function getIconExtensionFile(fileName: string, basePath: string): {
|
|
3
4
|
path: string;
|
|
@@ -7,3 +8,5 @@ export declare function getIconExtensionFile(fileName: string, basePath: string)
|
|
|
7
8
|
dark: string;
|
|
8
9
|
};
|
|
9
10
|
};
|
|
11
|
+
export declare const imgCache: (type: string, id: number, date: string | null, size?: string) => string;
|
|
12
|
+
export declare const imgStatic: (model: Model | undefined, date: string | null, size?: string) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jamespot-react-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.48",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/jamespot-react-components.js",
|
|
6
6
|
"module": "dist/jamespot-react-components.mjs",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"globals": "^16.5.0",
|
|
79
79
|
"html2canvas": "^1.4.1",
|
|
80
80
|
"husky": "^9.1.7",
|
|
81
|
-
"jamespot-user-api": "^1.3.
|
|
81
|
+
"jamespot-user-api": "^1.3.48",
|
|
82
82
|
"jest": "^30.2.0",
|
|
83
83
|
"jest-environment-jsdom": "^30.2.0",
|
|
84
84
|
"knip": "^5.82.1",
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
5
|
+
// Lightweight arg parsing
|
|
6
|
+
const args = process.argv.slice(2);
|
|
7
|
+
if (args.length < 2) {
|
|
8
|
+
console.error('Usage: npx tsx generate.ts <stories> <path-to-component>');
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const mode = args[0];
|
|
13
|
+
const targetPath = args[1];
|
|
14
|
+
|
|
15
|
+
const OPENAI_API_KEY = process.env.OPENAI_API_KEY;
|
|
16
|
+
if (!OPENAI_API_KEY) {
|
|
17
|
+
console.error('Please set OPENAI_API_KEY in environment.');
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const MODEL = process.env.OPENAI_MODEL ?? 'gpt-4o-mini';
|
|
22
|
+
|
|
23
|
+
function readFileOrThrow(p: string) {
|
|
24
|
+
try {
|
|
25
|
+
return fs.readFileSync(p, 'utf8');
|
|
26
|
+
} catch (err) {
|
|
27
|
+
console.error(`Cannot read file ${p}`, err);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function callOpenAI(prompt: string) {
|
|
33
|
+
const body = {
|
|
34
|
+
model: MODEL,
|
|
35
|
+
messages: [{ role: 'user', content: prompt }],
|
|
36
|
+
temperature: 0.0,
|
|
37
|
+
max_tokens: 2000,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const res = await fetch('https://api.openai.com/v1/chat/completions', {
|
|
41
|
+
method: 'POST',
|
|
42
|
+
headers: {
|
|
43
|
+
'Content-Type': 'application/json',
|
|
44
|
+
Authorization: `Bearer ${OPENAI_API_KEY}`,
|
|
45
|
+
},
|
|
46
|
+
body: JSON.stringify(body),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
if (!res.ok) {
|
|
50
|
+
const text = await res.text();
|
|
51
|
+
throw new Error(`OpenAI API error: ${res.status} ${text}`);
|
|
52
|
+
}
|
|
53
|
+
const json = await res.json();
|
|
54
|
+
return json.choices[0].message.content as string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function generateStoriesForComponent(componentFilePath: string, storiesFilePath?: string) {
|
|
58
|
+
const compText = readFileOrThrow(componentFilePath);
|
|
59
|
+
let prompt;
|
|
60
|
+
if (storiesFilePath && fs.existsSync(storiesFilePath)) {
|
|
61
|
+
const storiesText = readFileOrThrow(storiesFilePath);
|
|
62
|
+
prompt = `Tu es un assistant qui transforme des fichiers Storybook (.stories.tsx) et qui y ajoute des tests (play) pour un composant React.\n\n
|
|
63
|
+
Composant:\n\n
|
|
64
|
+
${compText}\n\n
|
|
65
|
+
Storybook Stories:\n\n
|
|
66
|
+
${storiesText}\n\n
|
|
67
|
+
Part du fichier de stories :\n
|
|
68
|
+
- Change les meta (pour rajouter le tags: ['testing'] et aussi changer le title basé sur le chemin avec comme prefix generate/),\n
|
|
69
|
+
- complete les stories s'il manque de la couverture de props clés,\n
|
|
70
|
+
- pour chaque story une fonction 'play' qui teste le comportement (getByRole/getByText, userEvent, expect),\n
|
|
71
|
+
- imports nécessaires (storybook/test, action, etc.),\n
|
|
72
|
+
- parameters: { mode: 'test' } pour les stories de test.\n\n
|
|
73
|
+
- le code/commentaire doivent être en anglais.\n\n
|
|
74
|
+
Fournis uniquement le contenu du fichier .stories.tsx sans explications sans zone de code "\`\`\`tsx" ton résultat doit pouvoir être sauvegarder dans le fichier directement sans transformation.`;
|
|
75
|
+
} else {
|
|
76
|
+
prompt = `Tu es un assistant qui génère des fichiers Storybook (.stories.tsx) avec tests (play) pour un composant React.\n\n
|
|
77
|
+
Composant:\n\n
|
|
78
|
+
${compText}\n\n
|
|
79
|
+
Génère un fichier .stories.tsx complet qui expose :\n
|
|
80
|
+
- un export default meta (title basé sur le chemin),\n
|
|
81
|
+
- au moins 2-4 stories pertinentes couvrant props clés (args),\n
|
|
82
|
+
- pour chaque story une fonction 'play' qui teste le comportement (getByRole/getByText, userEvent, expect),\n
|
|
83
|
+
- imports nécessaires (storybook/test, action, etc.),\n
|
|
84
|
+
- parameters: { mode: 'test' } pour les stories de test.\n\n
|
|
85
|
+
- le code/commentaire doivent être en anglais.\n\n
|
|
86
|
+
Fournis uniquement le contenu du fichier .stories.tsx sans explications sans zone de code "\`\`\`tsx" ton résultat doit pouvoir être sauvegarder dans le fichier directement sans transformation.`;
|
|
87
|
+
}
|
|
88
|
+
const storiesSampleText = readFileOrThrow('../src/components/JRCButton/JRCButton.stories.tsx');
|
|
89
|
+
prompt += `\n\n
|
|
90
|
+
Le fichier de stories doit être compatible avec Storybook 7.0 et React 18\n\n
|
|
91
|
+
Voici un exemple de fichier de stories qu'on souhaite:\n\n
|
|
92
|
+
${storiesSampleText}
|
|
93
|
+
`;
|
|
94
|
+
return await callOpenAI(prompt);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async function modeStories(componentFilePath: string) {
|
|
98
|
+
const abs = path.resolve(componentFilePath);
|
|
99
|
+
const dir = path.dirname(abs);
|
|
100
|
+
const base = path.basename(abs).replace(/\.tsx?$/, '');
|
|
101
|
+
const storiesFilePath = path.join(dir, `${base}.stories.tsx`);
|
|
102
|
+
|
|
103
|
+
console.log('Generating .stories.tsx for', abs);
|
|
104
|
+
const storiesText = await generateStoriesForComponent(componentFilePath, storiesFilePath);
|
|
105
|
+
|
|
106
|
+
fs.writeFileSync(storiesFilePath, storiesText, 'utf8');
|
|
107
|
+
console.log(`Wrote story file to ${storiesFilePath}`);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
(async () => {
|
|
111
|
+
try {
|
|
112
|
+
if (mode === 'stories') await modeStories(targetPath);
|
|
113
|
+
else {
|
|
114
|
+
console.error('Unknown mode. Use `stories`');
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
} catch (err: any) {
|
|
118
|
+
console.error('Error:', err.message ?? err);
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
121
|
+
})();
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export declare const hexToRgb: (hex: string) => {
|
|
2
|
-
r: number;
|
|
3
|
-
g: number;
|
|
4
|
-
b: number;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Darkens the color following a linear distorsion
|
|
8
|
-
* @param hex Color in hexadecimal format, beginning with the # character
|
|
9
|
-
* @param darkPercentage dark percentage (bewteen 0 and 1, 0 beeing the same color, 1 beeing black)
|
|
10
|
-
* @returns hexadecimal color
|
|
11
|
-
*/
|
|
12
|
-
export declare const getDarkShade: (hex: string, darkPercentage: number) => string;
|
|
13
|
-
/**
|
|
14
|
-
* Lightens the color following a linear distorsion
|
|
15
|
-
* @param hex Color in hexadecimal format, beginning with the # character
|
|
16
|
-
* @param lightPercentage light percentage (bewteen 0 and 1, 0 beeing the same color, 1 beeing white)
|
|
17
|
-
* @returns hexadecimal color
|
|
18
|
-
*/
|
|
19
|
-
export declare const getLightShade: (hex: string, lightPercentage: number) => string;
|
|
20
|
-
/**
|
|
21
|
-
* @param hexColor a color in the format #XXX or #XXXXXX
|
|
22
|
-
* @param adjustPercent a number between -1 and 1, <0 for darkening, >0 for lightening
|
|
23
|
-
* @returns a string of the form #XXXXXX representing the modified color. Returns undefined if parameters are invalid.
|
|
24
|
-
*/
|
|
25
|
-
export declare const modifyColorBrightness: (hexColor: string, adjustPercent: number) => string | undefined;
|
|
26
|
-
export declare const HSBToRGB: (hue: number, saturation: number, brightness: number) => number[];
|
|
27
|
-
export declare const RGBToHSB: (r: number, g: number, b: number) => number[];
|
|
28
|
-
export declare const hexToHSL: (H: any) => number[];
|
|
29
|
-
export declare function hlsToHex(h: number, s: number, l: number): string[];
|
|
30
|
-
export declare const colorContrast: (color: string) => string;
|
|
31
|
-
export declare const brightness: (color: string) => number;
|
|
32
|
-
export declare const rgbToHex: (r: number, g: number, b: number) => string;
|