@zohodesk/components 1.0.0-alpha-220 → 1.0.0-alpha-224
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/README.md +17 -0
- package/es/Animation/docs/Animation__default.docs.js +2 -2
- package/es/Animation/docs/Animation__fadeIn.docs.js +2 -2
- package/es/Animation/docs/Animation__scaleIn.docs.js +2 -2
- package/es/Animation/docs/Animation__skewIn.docs.js +2 -2
- package/es/Animation/docs/Animation__slideDown.docs.js +2 -2
- package/es/Animation/docs/Animation__slideLeft.docs.js +2 -2
- package/es/Animation/docs/Animation__zoomIn.docs.js +2 -2
- package/es/Appearance/dark/mode/darkMode.module.css +355 -392
- package/es/Appearance/dark/themes/blue/blueDarkCTATheme.module.css +33 -33
- package/es/Appearance/dark/themes/blue/blueDarkComponentTheme.module.css +41 -47
- package/es/Appearance/dark/themes/green/greenDarkCTATheme.module.css +32 -32
- package/es/Appearance/dark/themes/green/greenDarkComponentTheme.module.css +40 -46
- package/es/Appearance/dark/themes/orange/orangeDarkCTATheme.module.css +32 -32
- package/es/Appearance/dark/themes/orange/orangeDarkComponentTheme.module.css +40 -46
- package/es/Appearance/dark/themes/red/redDarkCTATheme.module.css +32 -32
- package/es/Appearance/dark/themes/red/redDarkComponentTheme.module.css +40 -46
- package/es/Appearance/dark/themes/yellow/yellowDarkCTATheme.module.css +32 -32
- package/es/Appearance/dark/themes/yellow/yellowDarkComponentTheme.module.css +40 -46
- package/es/Appearance/default/mode/defaultMode.module.css +356 -395
- package/es/Appearance/default/themes/blue/blueDefaultCTATheme.module.css +33 -33
- package/es/Appearance/default/themes/blue/blueDefaultComponentTheme.module.css +41 -47
- package/es/Appearance/default/themes/green/greenDefaultCTATheme.module.css +32 -32
- package/es/Appearance/default/themes/green/greenDefaultComponentTheme.module.css +40 -46
- package/es/Appearance/default/themes/orange/orangeDefaultCTATheme.module.css +32 -32
- package/es/Appearance/default/themes/orange/orangeDefaultComponentTheme.module.css +40 -46
- package/es/Appearance/default/themes/red/redDefaultCTATheme.module.css +32 -32
- package/es/Appearance/default/themes/red/redDefaultComponentTheme.module.css +40 -46
- package/es/Appearance/default/themes/yellow/yellowDefaultCTATheme.module.css +32 -32
- package/es/Appearance/default/themes/yellow/yellowDefaultComponentTheme.module.css +40 -46
- package/es/AvatarTeam/docs/AvatarTeam__palette.docs.js +1 -1
- package/es/Card/Card.module.css +3 -3
- package/es/Card/docs/Card__Default.docs.js +4 -4
- package/es/Card/docs/Card__Scroll.docs.js +4 -4
- package/es/Layout/docs/Layout__Hidden.docs.js +1 -1
- package/es/Layout/docs/Layout__four_Column.docs.js +1 -1
- package/es/Layout/docs/Layout__three_Column.docs.js +1 -1
- package/es/MultiSelect/MultiSelect.js +8 -1
- package/es/PopOver/PopOver.module.css +1 -1
- package/es/RippleEffect/docs/RippleEffect__default.docs.js +8 -8
- package/es/Select/Select.js +14 -0
- package/es/Tab/Tabs.js +14 -2
- package/es/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +2 -2
- package/es/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +2 -2
- package/es/common/docStyle.module.css +9 -9
- package/lib/Accordion/Accordion.js +3 -3
- package/lib/Accordion/AccordionItem.js +3 -3
- package/lib/Accordion/docs/Accordion__Demo.docs.js +3 -3
- package/lib/Animation/Animation.js +3 -3
- package/lib/Animation/docs/Animation__default.docs.js +5 -5
- package/lib/Animation/docs/Animation__fadeIn.docs.js +5 -5
- package/lib/Animation/docs/Animation__scaleIn.docs.js +5 -5
- package/lib/Animation/docs/Animation__skewIn.docs.js +5 -5
- package/lib/Animation/docs/Animation__slideDown.docs.js +5 -5
- package/lib/Animation/docs/Animation__slideLeft.docs.js +5 -5
- package/lib/Animation/docs/Animation__zoomIn.docs.js +5 -5
- package/lib/AppContainer/AppContainer.js +3 -3
- package/lib/AppContainer/docs/AppContainer__default.docs.js +3 -3
- package/lib/Appearance/dark/mode/darkMode.module.css +355 -392
- package/lib/Appearance/dark/themes/blue/blueDarkCTATheme.module.css +33 -33
- package/lib/Appearance/dark/themes/blue/blueDarkComponentTheme.module.css +41 -47
- package/lib/Appearance/dark/themes/green/greenDarkCTATheme.module.css +32 -32
- package/lib/Appearance/dark/themes/green/greenDarkComponentTheme.module.css +40 -46
- package/lib/Appearance/dark/themes/orange/orangeDarkCTATheme.module.css +32 -32
- package/lib/Appearance/dark/themes/orange/orangeDarkComponentTheme.module.css +40 -46
- package/lib/Appearance/dark/themes/red/redDarkCTATheme.module.css +32 -32
- package/lib/Appearance/dark/themes/red/redDarkComponentTheme.module.css +40 -46
- package/lib/Appearance/dark/themes/yellow/yellowDarkCTATheme.module.css +32 -32
- package/lib/Appearance/dark/themes/yellow/yellowDarkComponentTheme.module.css +40 -46
- package/lib/Appearance/default/mode/defaultMode.module.css +356 -395
- package/lib/Appearance/default/themes/blue/blueDefaultCTATheme.module.css +33 -33
- package/lib/Appearance/default/themes/blue/blueDefaultComponentTheme.module.css +41 -47
- package/lib/Appearance/default/themes/green/greenDefaultCTATheme.module.css +32 -32
- package/lib/Appearance/default/themes/green/greenDefaultComponentTheme.module.css +40 -46
- package/lib/Appearance/default/themes/orange/orangeDefaultCTATheme.module.css +32 -32
- package/lib/Appearance/default/themes/orange/orangeDefaultComponentTheme.module.css +40 -46
- package/lib/Appearance/default/themes/red/redDefaultCTATheme.module.css +32 -32
- package/lib/Appearance/default/themes/red/redDefaultComponentTheme.module.css +40 -46
- package/lib/Appearance/default/themes/yellow/yellowDefaultCTATheme.module.css +32 -32
- package/lib/Appearance/default/themes/yellow/yellowDefaultComponentTheme.module.css +40 -46
- package/lib/Avatar/Avatar.js +3 -3
- package/lib/Avatar/docs/Avatar__custom.docs.js +3 -3
- package/lib/Avatar/docs/Avatar__default.docs.js +3 -3
- package/lib/Avatar/docs/Avatar__palette.docs.js +3 -3
- package/lib/Avatar/docs/Avatar__text.docs.js +3 -3
- package/lib/AvatarTeam/AvatarTeam.js +3 -3
- package/lib/AvatarTeam/docs/AvatarTeam__custom.docs.js +3 -3
- package/lib/AvatarTeam/docs/AvatarTeam__default.docs.js +3 -3
- package/lib/AvatarTeam/docs/AvatarTeam__palette.docs.js +4 -4
- package/lib/AvatarTeam/docs/AvatarTeam__size.docs.js +3 -3
- package/lib/Button/Button.js +3 -3
- package/lib/Button/docs/Button__custom.docs.js +3 -3
- package/lib/Button/docs/Button__default.docs.js +3 -3
- package/lib/Buttongroup/Buttongroup.js +3 -3
- package/lib/Buttongroup/docs/Buttongroup__custom.docs.js +3 -3
- package/lib/Buttongroup/docs/Buttongroup__footer.docs.js +3 -3
- package/lib/Buttongroup/docs/Buttongroup__header.docs.js +3 -3
- package/lib/Card/Card.js +3 -3
- package/lib/Card/Card.module.css +3 -3
- package/lib/Card/__tests__/Card.spec.js +1 -1
- package/lib/Card/docs/Card__Custom.docs.js +3 -3
- package/lib/Card/docs/Card__Default.docs.js +7 -7
- package/lib/Card/docs/Card__Scroll.docs.js +7 -7
- package/lib/Card/index.js +1 -1
- package/lib/CheckBox/CheckBox.js +3 -3
- package/lib/CheckBox/docs/CheckBox__custom.docs.js +3 -3
- package/lib/CheckBox/docs/CheckBox__default.docs.js +3 -3
- package/lib/DateTime/CalendarView.js +3 -3
- package/lib/DateTime/DateTime.js +3 -3
- package/lib/DateTime/DateTimePopupFooter.js +3 -3
- package/lib/DateTime/DateTimePopupHeader.js +3 -3
- package/lib/DateTime/DateWidget.js +3 -3
- package/lib/DateTime/DaysRow.js +3 -3
- package/lib/DateTime/Time.js +3 -3
- package/lib/DateTime/YearView.js +3 -3
- package/lib/DateTime/__tests__/CalendarView.spec.js +1 -1
- package/lib/DateTime/__tests__/DateTime.spec.js +1 -1
- package/lib/DateTime/docs/DateTime__default.docs.js +3 -3
- package/lib/DateTime/docs/DateWidget__default.docs.js +3 -3
- package/lib/DateTime/objectUtils.js +1 -1
- package/lib/DropBox/DropBox.js +3 -3
- package/lib/DropBox/docs/DropBox__custom.docs.js +3 -3
- package/lib/DropBox/docs/DropBox__customOrder.docs.js +3 -3
- package/lib/DropBox/docs/DropBox__fixedPosition.docs.js +3 -3
- package/lib/DropBox/docs/DropBox__position.docs.js +3 -3
- package/lib/DropBox/docs/DropBox__size.docs.js +3 -3
- package/lib/DropDown/DropDown.js +3 -3
- package/lib/DropDown/DropDownHeading.js +3 -3
- package/lib/DropDown/DropDownItem.js +3 -3
- package/lib/DropDown/DropDownSearch.js +3 -3
- package/lib/DropDown/DropDownSeparator.js +3 -3
- package/lib/DropDown/docs/DropDownHeading__custom.docs.js +3 -3
- package/lib/DropDown/docs/DropDownHeading__default.docs.js +3 -3
- package/lib/Label/Label.js +3 -3
- package/lib/Label/docs/Label__clipped.docs.js +3 -3
- package/lib/Label/docs/Label__custom.docs.js +3 -3
- package/lib/Label/docs/Label__palette.docs.js +3 -3
- package/lib/Label/docs/Label__size.docs.js +3 -3
- package/lib/Label/docs/Label__type.docs.js +3 -3
- package/lib/Layout/docs/Layout__Hidden.docs.js +4 -4
- package/lib/Layout/docs/Layout__default.docs.js +3 -3
- package/lib/Layout/docs/Layout__four_Column.docs.js +4 -4
- package/lib/Layout/docs/Layout__three_Column.docs.js +4 -4
- package/lib/Layout/docs/Layout__two_Column.docs.js +3 -3
- package/lib/LightNightMode/docs/AlternativeColors.docs.js +3 -3
- package/lib/ListItem/ListItem.js +3 -3
- package/lib/ListItem/ListItemWithAvatar.js +3 -3
- package/lib/ListItem/ListItemWithCheckBox.js +3 -3
- package/lib/ListItem/ListItemWithIcon.js +3 -3
- package/lib/ListItem/ListItemWithRadio.js +3 -3
- package/lib/ListItem/docs/ListItemWithAvatar__custom.docs.js +3 -3
- package/lib/ListItem/docs/ListItemWithAvatar__default.docs.js +3 -3
- package/lib/ListItem/docs/ListItemWithCheckBox__custom.docs.js +3 -3
- package/lib/ListItem/docs/ListItemWithCheckBox__default.docs.js +3 -3
- package/lib/ListItem/docs/ListItemWithIcon__custom.docs.js +3 -3
- package/lib/ListItem/docs/ListItemWithIcon__default.docs.js +3 -3
- package/lib/ListItem/docs/ListItemWithRadio__custom.docs.js +3 -3
- package/lib/ListItem/docs/ListItemWithRadio__default.docs.js +3 -3
- package/lib/ListItem/docs/ListItem__custom.docs.js +3 -3
- package/lib/ListItem/docs/ListItem__default.docs.js +3 -3
- package/lib/Modal/Modal.js +3 -3
- package/lib/Modal/__docs__/Modal__default.docs.js +3 -3
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +3 -3
- package/lib/MultiSelect/AdvancedMultiSelect.js +3 -3
- package/lib/MultiSelect/EmptyState.js +3 -3
- package/lib/MultiSelect/MultiSelect.js +10 -4
- package/lib/MultiSelect/MultiSelectHeader.js +3 -3
- package/lib/MultiSelect/MultiSelectWithAvatar.js +3 -3
- package/lib/MultiSelect/SelectedOptions.js +3 -3
- package/lib/MultiSelect/Suggestions.js +5 -5
- package/lib/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +3 -3
- package/lib/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +3 -3
- package/lib/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +3 -3
- package/lib/MultiSelect/docs/MultiSelect__default.docs.js +3 -3
- package/lib/PopOver/PopOver.js +3 -3
- package/lib/PopOver/PopOver.module.css +1 -1
- package/lib/PopOver/docs/PopOver__default.docs.js +3 -3
- package/lib/Popup/Popup.js +3 -3
- package/lib/Popup/__tests__/Popup.spec.js +3 -3
- package/lib/Provider/LibraryContext.js +3 -3
- package/lib/Provider/NumberGenerator/NumberGenerator.js +1 -1
- package/lib/Provider/docs/Provider_Id__Class.docs.js +3 -3
- package/lib/Provider/docs/Provider_Zindex__Class.docs.js +3 -3
- package/lib/Provider.js +3 -3
- package/lib/Radio/Radio.js +3 -3
- package/lib/Radio/docs/Radio__custom.docs.js +3 -3
- package/lib/Radio/docs/Radio__default.docs.js +3 -3
- package/lib/Responsive/CustomResponsive.js +3 -3
- package/lib/Responsive/RefWrapper.js +1 -1
- package/lib/Responsive/ResizeComponent.js +3 -3
- package/lib/Responsive/ResizeObserver.js +1 -1
- package/lib/Responsive/Responsive.js +3 -3
- package/lib/Responsive/docs/Responsive__Custom.docs.js +3 -3
- package/lib/Responsive/docs/Responsive__default.docs.js +3 -3
- package/lib/Responsive/sizeObservers.js +3 -3
- package/lib/Responsive/utils/shallowCompare.js +1 -1
- package/lib/Ribbon/Ribbon.js +3 -3
- package/lib/Ribbon/docs/Ribbon__custom.docs.js +3 -3
- package/lib/Ribbon/docs/Ribbon__default.docs.js +3 -3
- package/lib/RippleEffect/docs/RippleEffect__default.docs.js +11 -11
- package/lib/Select/GroupSelect.js +3 -3
- package/lib/Select/Select.js +19 -5
- package/lib/Select/SelectWithAvatar.js +3 -3
- package/lib/Select/SelectWithIcon.js +3 -3
- package/lib/Select/docs/GroupSelect__default.docs.js +3 -3
- package/lib/Select/docs/SelectWithAvatar__default.docs.js +3 -3
- package/lib/Select/docs/SelectWithIcon__default.docs.js +3 -3
- package/lib/Select/docs/Select__default.docs.js +3 -3
- package/lib/Stencils/Stencils.js +3 -3
- package/lib/Stencils/docs/Stencils__custom.docs.js +3 -3
- package/lib/Stencils/docs/Stencils__default.docs.js +3 -3
- package/lib/Switch/Switch.js +3 -3
- package/lib/Switch/docs/Switch__custom.docs.js +3 -3
- package/lib/Switch/docs/Switch__default.docs.js +3 -3
- package/lib/Tab/Tab.js +1 -1
- package/lib/Tab/TabWrapper.js +1 -1
- package/lib/Tab/Tabs.js +16 -5
- package/lib/Tab/docs/Tab__default.docs.js +3 -3
- package/lib/Tag/Tag.js +3 -3
- package/lib/Tag/docs/Tag__custom.docs.js +3 -3
- package/lib/Tag/docs/Tag__default.docs.js +3 -3
- package/lib/TextBox/TextBox.js +3 -3
- package/lib/TextBox/docs/TextBox__custom.docs.js +3 -3
- package/lib/TextBox/docs/TextBox__default.docs.js +3 -3
- package/lib/TextBox/docs/TextBox__size.docs.js +3 -3
- package/lib/TextBox/docs/TextBox__variant.docs.js +3 -3
- package/lib/TextBoxIcon/TextBoxIcon.js +3 -3
- package/lib/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +3 -3
- package/lib/TextBoxIcon/docs/TextBoxIcon__default.docs.js +3 -3
- package/lib/Textarea/Textarea.js +3 -3
- package/lib/Textarea/docs/Textarea__animated.docs.js +3 -3
- package/lib/Textarea/docs/Textarea__custom.docs.js +3 -3
- package/lib/Textarea/docs/Textarea__default.docs.js +3 -3
- package/lib/Textarea/docs/Textarea__disabled.docs.js +3 -3
- package/lib/Tooltip/Tooltip.js +3 -3
- package/lib/Tooltip/__tests__/Tooltip.spec.js +3 -3
- package/lib/Tooltip/docs/Tooltip__default.docs.js +3 -3
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +3 -3
- package/lib/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +5 -5
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +3 -3
- package/lib/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +5 -5
- package/lib/a11y/FocusScope/FocusScope.js +1 -1
- package/lib/a11y/FocusScope/docs/FocusScope__default.docs.js +3 -3
- package/lib/beta/FocusRing/FocusRing.js +3 -3
- package/lib/beta/FocusRing/docs/FocusRing__default.docs.js +3 -3
- package/lib/common/docStyle.module.css +9 -9
- package/lib/deprecated/PortalLayer/PortalLayer.js +3 -3
- package/lib/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +3 -3
- package/lib/semantic/Button/Button.js +3 -3
- package/lib/semantic/Button/docs/Button__default.docs.js +3 -3
- package/lib/utils/datetime/common.js +1 -1
- package/lib/utils/dropDownUtils.js +1 -1
- package/lib/utils/shallowEqual.js +1 -1
- package/package.json +10 -6
- package/preprocess/componentAppearanceColors.js +65 -0
- package/preprocess/componentThemeColors.js +119 -0
- package/preprocess/ctaThemeColors.js +95 -0
- package/preprocess/index.js +3 -0
- package/preprocess/json/componentAppearanceVariableJson.js +1515 -0
- package/preprocess/json/componentThemeVariableJson.js +259 -0
- package/preprocess/json/ctaThemeVariableJson.js +337 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
var { componentThemeVariables } = require('./json/componentThemeVariableJson');
|
|
2
|
+
let fs = require('fs');
|
|
3
|
+
let path = require('path');
|
|
4
|
+
let baseFolder = 'Appearance';
|
|
5
|
+
let mode = ['default', 'dark'];
|
|
6
|
+
let themes = ['blue', 'green', 'orange', 'red', 'yellow'];
|
|
7
|
+
let themeFiles = [];
|
|
8
|
+
mode.forEach(mode => {
|
|
9
|
+
themes.forEach(theme => {
|
|
10
|
+
let themeFilesString = `../src/${baseFolder}/${mode}/themes/${theme}/${
|
|
11
|
+
theme + capitalizeFirstLetter(mode)
|
|
12
|
+
}ComponentTheme.module.css`;
|
|
13
|
+
themeFiles.push(path.join(__dirname, themeFilesString));
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
let files = themeFiles;
|
|
17
|
+
|
|
18
|
+
function capitalizeFirstLetter(string) {
|
|
19
|
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function generate(mode, theme) {
|
|
23
|
+
let exportVariables = [];
|
|
24
|
+
let counter = 0;
|
|
25
|
+
let newLine = '';
|
|
26
|
+
componentThemeVariables.map(componentVariable => {
|
|
27
|
+
let commentName = componentVariable[3];
|
|
28
|
+
counting = counter++;
|
|
29
|
+
if (counting != 0) {
|
|
30
|
+
newLine = `\n\t`;
|
|
31
|
+
}
|
|
32
|
+
if (mode == 'default') {
|
|
33
|
+
let componentDefaultColors = componentVariable[1][1];
|
|
34
|
+
|
|
35
|
+
let colorsResult = '';
|
|
36
|
+
if (theme == 'blue') {
|
|
37
|
+
colorsResult = [
|
|
38
|
+
`\n\t--zdt_${componentVariable[0]}: ${componentDefaultColors[0]};`
|
|
39
|
+
];
|
|
40
|
+
} else if (theme == 'green') {
|
|
41
|
+
colorsResult = [
|
|
42
|
+
`\n\t--zdt_${componentVariable[0]}: ${componentDefaultColors[1]};`
|
|
43
|
+
];
|
|
44
|
+
} else if (theme == 'orange') {
|
|
45
|
+
colorsResult = [
|
|
46
|
+
`\n\t--zdt_${componentVariable[0]}: ${componentDefaultColors[2]};`
|
|
47
|
+
];
|
|
48
|
+
} else if (theme == 'red') {
|
|
49
|
+
colorsResult = [
|
|
50
|
+
`\n\t--zdt_${componentVariable[0]}: ${componentDefaultColors[3]};`
|
|
51
|
+
];
|
|
52
|
+
} else if (theme == 'yellow') {
|
|
53
|
+
colorsResult = [
|
|
54
|
+
`\n\t--zdt_${componentVariable[0]}: ${componentDefaultColors[4]};`
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
exportVariables.push(
|
|
58
|
+
commentName ? `${newLine}\n\t/* ${commentName} */` : '',
|
|
59
|
+
colorsResult
|
|
60
|
+
);
|
|
61
|
+
} else if (mode == 'dark') {
|
|
62
|
+
let componentDarkColors = componentVariable[2][1];
|
|
63
|
+
let colorsResult = '';
|
|
64
|
+
if (theme == 'blue') {
|
|
65
|
+
colorsResult = [
|
|
66
|
+
`\n\t--zdt_${componentVariable[0]}: ${componentDarkColors[0]};`
|
|
67
|
+
];
|
|
68
|
+
} else if (theme == 'green') {
|
|
69
|
+
colorsResult = [
|
|
70
|
+
`\n\t--zdt_${componentVariable[0]}: ${componentDarkColors[1]};`
|
|
71
|
+
];
|
|
72
|
+
} else if (theme == 'orange') {
|
|
73
|
+
colorsResult = [
|
|
74
|
+
`\n\t--zdt_${componentVariable[0]}: ${componentDarkColors[2]};`
|
|
75
|
+
];
|
|
76
|
+
} else if (theme == 'red') {
|
|
77
|
+
colorsResult = [
|
|
78
|
+
`\n\t--zdt_${componentVariable[0]}: ${componentDarkColors[3]};`
|
|
79
|
+
];
|
|
80
|
+
} else if (theme == 'yellow') {
|
|
81
|
+
colorsResult = [
|
|
82
|
+
`\n\t--zdt_${componentVariable[0]}: ${componentDarkColors[4]};`
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
exportVariables.push(
|
|
86
|
+
commentName ? `${newLine}\n\t/* ${commentName} */` : '',
|
|
87
|
+
colorsResult
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return exportVariables.join('');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
let arrayIndexCounter = 0;
|
|
95
|
+
mode.forEach(mode => {
|
|
96
|
+
themes.forEach(theme => {
|
|
97
|
+
let fileString = files[arrayIndexCounter];
|
|
98
|
+
// let splitPath = fileString.split(/\\/g);
|
|
99
|
+
let getMode = mode;
|
|
100
|
+
let getTheme = theme;
|
|
101
|
+
if (theme == 'blue') {
|
|
102
|
+
if (mode == 'default') {
|
|
103
|
+
blueSelector = ', :global(.blueDefaultTheme) [data-desk-theme="blue"]';
|
|
104
|
+
} else if (mode == 'dark') {
|
|
105
|
+
blueSelector = ', :global(.blueDarkTheme) [data-desk-theme="blue"]';
|
|
106
|
+
}
|
|
107
|
+
} else {
|
|
108
|
+
blueSelector = '';
|
|
109
|
+
}
|
|
110
|
+
fs.writeFileSync(
|
|
111
|
+
fileString,
|
|
112
|
+
`[data-mode='${getMode}'][data-theme='${getTheme}']${blueSelector} {${generate(
|
|
113
|
+
getMode,
|
|
114
|
+
getTheme
|
|
115
|
+
)}\n}`
|
|
116
|
+
);
|
|
117
|
+
arrayIndexCounter++;
|
|
118
|
+
});
|
|
119
|
+
});
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var { ctaThemeVariables } = require('./json/ctaThemeVariableJson');
|
|
2
|
+
let fs = require('fs');
|
|
3
|
+
let path = require('path');
|
|
4
|
+
let baseFolder = 'Appearance';
|
|
5
|
+
let mode = ['default', 'dark'];
|
|
6
|
+
let themes = ['blue', 'green', 'orange', 'red', 'yellow'];
|
|
7
|
+
let themeFiles = [];
|
|
8
|
+
mode.forEach(mode => {
|
|
9
|
+
themes.forEach(theme => {
|
|
10
|
+
let themeFilesString = `../src/${baseFolder}/${mode}/themes/${theme}/${
|
|
11
|
+
theme + capitalizeFirstLetter(mode)
|
|
12
|
+
}CTATheme.module.css`;
|
|
13
|
+
themeFiles.push(path.join(__dirname, themeFilesString));
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
let files = themeFiles;
|
|
17
|
+
|
|
18
|
+
function capitalizeFirstLetter(string) {
|
|
19
|
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function generate(mode, theme) {
|
|
23
|
+
let exportVariables = [];
|
|
24
|
+
ctaThemeVariables.map(ctaVariable => {
|
|
25
|
+
if (mode == 'default') {
|
|
26
|
+
let ctaDefaultColors = ctaVariable[1][1];
|
|
27
|
+
let colorsResult = '';
|
|
28
|
+
if (theme == 'blue') {
|
|
29
|
+
colorsResult = [
|
|
30
|
+
`\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDefaultColors[0]}`
|
|
31
|
+
];
|
|
32
|
+
} else if (theme == 'green') {
|
|
33
|
+
colorsResult = [
|
|
34
|
+
`\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDefaultColors[1]}`
|
|
35
|
+
];
|
|
36
|
+
} else if (theme == 'orange') {
|
|
37
|
+
colorsResult = [
|
|
38
|
+
`\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDefaultColors[2]}`
|
|
39
|
+
];
|
|
40
|
+
} else if (theme == 'red') {
|
|
41
|
+
colorsResult = [
|
|
42
|
+
`\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDefaultColors[3]}`
|
|
43
|
+
];
|
|
44
|
+
} else if (theme == 'yellow') {
|
|
45
|
+
colorsResult = [
|
|
46
|
+
`\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDefaultColors[4]}`
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
exportVariables.push(colorsResult);
|
|
50
|
+
} else if (mode == 'dark') {
|
|
51
|
+
let ctaDarkColors = ctaVariable[2][1];
|
|
52
|
+
let colorsResult = '';
|
|
53
|
+
if (theme == 'blue') {
|
|
54
|
+
colorsResult = [`\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDarkColors[0]}`];
|
|
55
|
+
} else if (theme == 'green') {
|
|
56
|
+
colorsResult = [`\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDarkColors[1]}`];
|
|
57
|
+
} else if (theme == 'orange') {
|
|
58
|
+
colorsResult = [`\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDarkColors[2]}`];
|
|
59
|
+
} else if (theme == 'red') {
|
|
60
|
+
colorsResult = [`\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDarkColors[3]}`];
|
|
61
|
+
} else if (theme == 'yellow') {
|
|
62
|
+
colorsResult = [`\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDarkColors[4]}`];
|
|
63
|
+
}
|
|
64
|
+
exportVariables.push(colorsResult);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
return exportVariables.join(';');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
let arrayIndexCounter = 0;
|
|
71
|
+
mode.forEach(mode => {
|
|
72
|
+
themes.forEach(theme => {
|
|
73
|
+
let fileString = files[arrayIndexCounter];
|
|
74
|
+
// let splitPath = fileString.split(/\\/g);
|
|
75
|
+
let getMode = mode;
|
|
76
|
+
let getTheme = theme;
|
|
77
|
+
if (theme == 'blue') {
|
|
78
|
+
if (mode == 'default') {
|
|
79
|
+
blueSelector = ', :global(.blueDefaultTheme) [data-desk-theme="blue"]';
|
|
80
|
+
} else if (mode == 'dark') {
|
|
81
|
+
blueSelector = ', :global(.blueDarkTheme) [data-desk-theme="blue"]';
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
blueSelector = '';
|
|
85
|
+
}
|
|
86
|
+
fs.writeFileSync(
|
|
87
|
+
fileString,
|
|
88
|
+
`[data-mode='${getMode}'][data-theme='${getTheme}']${blueSelector} {${generate(
|
|
89
|
+
getMode,
|
|
90
|
+
getTheme
|
|
91
|
+
)}\n}`
|
|
92
|
+
);
|
|
93
|
+
arrayIndexCounter++;
|
|
94
|
+
});
|
|
95
|
+
});
|