maz-ui 2.3.13 → 2.4.2
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/components/MazArrowIcon.d.ts +43 -0
- package/components/MazArrowIcon.js +1 -0
- package/components/MazAvatar.d.ts +149 -0
- package/components/MazAvatar.js +3 -0
- package/components/MazBackdrop.d.ts +89 -0
- package/components/MazBackdrop.js +3 -0
- package/components/MazBadge.d.ts +68 -0
- package/components/MazBadge.js +1 -0
- package/components/MazBottomSheet.d.ts +29 -0
- package/components/MazBottomSheet.js +3 -0
- package/components/MazBtn.d.ts +171 -0
- package/components/MazBtn.js +3 -0
- package/components/MazCard.d.ts +183 -0
- package/components/MazCard.js +3 -0
- package/components/MazCarousel.d.ts +16 -0
- package/components/MazCarousel.js +3 -0
- package/components/MazChart/includes.d.ts +11 -0
- package/components/MazChart.d.ts +114 -0
- package/components/MazChart.js +1 -0
- package/components/MazCheckbox.d.ts +49 -0
- package/components/MazCheckbox.js +1 -0
- package/components/MazDialog.d.ts +29 -0
- package/components/MazDialog.js +3 -0
- package/components/MazDialogPromise/use-maz-dialog-promise.d.ts +30 -0
- package/components/MazDialogPromise.d.ts +28 -0
- package/components/MazDialogPromise.js +3 -0
- package/components/MazDrawer.d.ts +59 -0
- package/components/MazDrawer.js +3 -0
- package/components/MazDropzone.d.ts +128 -0
- package/components/MazDropzone.js +3 -0
- package/components/MazGallery.d.ts +144 -0
- package/components/MazGallery.js +3 -0
- package/components/MazIcon.d.ts +66 -0
- package/components/MazIcon.js +3 -0
- package/components/MazInput.d.ts +276 -0
- package/components/MazInput.js +3 -0
- package/components/MazInputNumber.d.ts +67 -0
- package/components/MazInputNumber.js +3 -0
- package/components/MazInputPrice.d.ts +64 -0
- package/components/MazInputPrice.js +3 -0
- package/components/MazInputTags.d.ts +96 -0
- package/components/MazInputTags.js +3 -0
- package/components/MazLazyImg.d.ts +80 -0
- package/components/MazLazyImg.js +3 -0
- package/components/MazPhoneNumberInput/constantes/locales.d.ts +12 -0
- package/components/MazPhoneNumberInput/types.d.ts +21 -0
- package/components/MazPhoneNumberInput/utils/countries-name-list-by-iso-code.d.ts +2 -0
- package/components/MazPhoneNumberInput/utils/index.d.ts +12 -0
- package/components/MazPhoneNumberInput.d.ts +255 -0
- package/components/MazPhoneNumberInput.js +3 -0
- package/components/MazPicker/MazPickerCalendar.vue.d.ts +137 -0
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarDays.vue.d.ts +22 -0
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarGrid.vue.d.ts +114 -0
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarMonth.vue.d.ts +124 -0
- package/components/MazPicker/MazPickerCalendarSwitcher.vue.d.ts +38 -0
- package/components/MazPicker/MazPickerContainer.vue.d.ts +212 -0
- package/components/MazPicker/MazPickerHeader.vue.d.ts +84 -0
- package/components/MazPicker/MazPickerMonthSwitcher.vue.d.ts +43 -0
- package/components/MazPicker/MazPickerShortcuts.vue.d.ts +62 -0
- package/components/MazPicker/MazPickerTime.vue.d.ts +129 -0
- package/components/MazPicker/MazPickerYearSwitcher.vue.d.ts +35 -0
- package/components/MazPicker/types.d.ts +15 -0
- package/components/MazPicker/utils.d.ts +54 -0
- package/components/MazPicker.d.ts +313 -0
- package/components/MazPicker.js +3 -0
- package/components/MazRadioButtons.d.ts +69 -0
- package/components/MazRadioButtons.js +1 -0
- package/components/MazSelect.d.ts +176 -0
- package/components/MazSelect.js +3 -0
- package/components/MazSlider/utils.d.ts +15 -0
- package/components/MazSlider.d.ts +96 -0
- package/components/MazSlider.js +3 -0
- package/components/MazSpinner.d.ts +30 -0
- package/components/MazSpinner.js +1 -0
- package/components/MazStepper.d.ts +73 -0
- package/components/MazStepper.js +1 -0
- package/components/MazSwitch.d.ts +56 -0
- package/components/MazSwitch.js +1 -0
- package/components/MazTabsBar.d.ts +49 -0
- package/components/MazTabsBar.js +3 -0
- package/components/MazTabsContent.d.ts +16 -0
- package/components/MazTabsContent.js +1 -0
- package/components/MazTabsContentItem.d.ts +14 -0
- package/components/MazTabsContentItem.js +3 -0
- package/components/MazTextarea/textarea-autogrow.d.ts +9 -0
- package/components/MazTextarea.d.ts +125 -0
- package/components/MazTextarea.js +1 -0
- package/components/MazTransitionExpand.d.ts +4 -0
- package/components/MazTransitionExpand.js +1 -0
- package/components/index.d.ts +34 -0
- package/components/index.js +36 -0
- package/components/no_photo-a72545e4.js +1 -0
- package/components/types.d.ts +17 -0
- package/css/aos.css +1 -0
- package/css/main.css +1 -0
- package/maz-ui.d.ts +307 -0
- package/modules/index.js +3 -0
- package/modules/no_photo-a72545e4.js +1 -0
- package/package.json +145 -81
- package/tailwindcss/tailwind.config.js +65 -0
- package/tailwindcss/utils/colors.js +28 -0
- package/tailwindcss/variables/breakpoints.js +15 -0
- package/tailwindcss/variables/colors.js +44 -0
- package/tailwindcss/variables/utilities.js +20 -0
- package/tailwindcss/variables/z-indexes.js +15 -0
- package/LICENSE +0 -21
- package/README.md +0 -66
- package/bin/index.js +0 -63
- package/bin/lib/_constantes/default-colors.js +0 -69
- package/bin/lib/index.d.ts +0 -2
- package/bin/lib/index.js +0 -145
- package/bin/lib/methods/generate-root-css.js +0 -49
- package/bin/lib/methods/get-theme-settings.js +0 -58
- package/bin/lib/methods/set-css-vars.js +0 -11
- package/lib/css/base.css +0 -1
- package/lib/css/index.css +0 -1
- package/lib/css/maz-avatar.css +0 -1
- package/lib/css/maz-bottom-sheet.css +0 -1
- package/lib/css/maz-btn-group.css +0 -1
- package/lib/css/maz-btn.css +0 -0
- package/lib/css/maz-card.css +0 -1
- package/lib/css/maz-carousel.css +0 -1
- package/lib/css/maz-checkbox.css +0 -1
- package/lib/css/maz-collapse.css +0 -1
- package/lib/css/maz-dialog.css +0 -1
- package/lib/css/maz-draggable-list.css +0 -1
- package/lib/css/maz-dropdown.css +0 -1
- package/lib/css/maz-dropzone.css +0 -1
- package/lib/css/maz-flex.css +0 -0
- package/lib/css/maz-gallery.css +0 -0
- package/lib/css/maz-img.css +0 -1
- package/lib/css/maz-input-tags.css +0 -1
- package/lib/css/maz-input.css +0 -0
- package/lib/css/maz-list-item.css +0 -1
- package/lib/css/maz-list.css +0 -1
- package/lib/css/maz-loader.css +0 -0
- package/lib/css/maz-pagination.css +0 -1
- package/lib/css/maz-phone-number-input.css +0 -1
- package/lib/css/maz-picker.css +0 -1
- package/lib/css/maz-plotly.css +0 -0
- package/lib/css/maz-progress-bar.css +0 -1
- package/lib/css/maz-radio.css +0 -1
- package/lib/css/maz-read-more.css +0 -1
- package/lib/css/maz-responsive-menu.css +0 -1
- package/lib/css/maz-search.css +0 -1
- package/lib/css/maz-select.css +0 -0
- package/lib/css/maz-sidebar.css +0 -1
- package/lib/css/maz-slider.css +0 -1
- package/lib/css/maz-spinner.css +0 -0
- package/lib/css/maz-stepper.css +0 -1
- package/lib/css/maz-switch.css +0 -1
- package/lib/css/maz-tabs-bar.css +0 -1
- package/lib/css/maz-tabs-content-item.css +0 -1
- package/lib/css/maz-tabs-content.css +0 -1
- package/lib/css/maz-transition-expand.css +0 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/maz-avatar.d.ts +0 -3
- package/lib/maz-avatar.js +0 -430
- package/lib/maz-bottom-sheet.d.ts +0 -3
- package/lib/maz-bottom-sheet.js +0 -1045
- package/lib/maz-btn-group.d.ts +0 -3
- package/lib/maz-btn-group.js +0 -907
- package/lib/maz-btn.d.ts +0 -3
- package/lib/maz-btn.js +0 -764
- package/lib/maz-card.d.ts +0 -3
- package/lib/maz-card.js +0 -572
- package/lib/maz-carousel.d.ts +0 -3
- package/lib/maz-carousel.js +0 -569
- package/lib/maz-checkbox.d.ts +0 -3
- package/lib/maz-checkbox.js +0 -359
- package/lib/maz-collapse.d.ts +0 -3
- package/lib/maz-collapse.js +0 -1238
- package/lib/maz-dialog.d.ts +0 -3
- package/lib/maz-dialog.js +0 -1315
- package/lib/maz-draggable-list.d.ts +0 -3
- package/lib/maz-draggable-list.js +0 -439
- package/lib/maz-dropdown.d.ts +0 -3
- package/lib/maz-dropdown.js +0 -438
- package/lib/maz-dropzone.d.ts +0 -3
- package/lib/maz-dropzone.js +0 -664
- package/lib/maz-flex.d.ts +0 -3
- package/lib/maz-flex.js +0 -427
- package/lib/maz-gallery.d.ts +0 -3
- package/lib/maz-gallery.js +0 -672
- package/lib/maz-img.d.ts +0 -3
- package/lib/maz-img.js +0 -612
- package/lib/maz-input-tags.d.ts +0 -3
- package/lib/maz-input-tags.js +0 -1207
- package/lib/maz-input.d.ts +0 -3
- package/lib/maz-input.js +0 -1076
- package/lib/maz-list-item.d.ts +0 -3
- package/lib/maz-list-item.js +0 -304
- package/lib/maz-list.d.ts +0 -3
- package/lib/maz-list.js +0 -331
- package/lib/maz-loader.d.ts +0 -3
- package/lib/maz-loader.js +0 -304
- package/lib/maz-pagination.d.ts +0 -3
- package/lib/maz-pagination.js +0 -1414
- package/lib/maz-phone-number-input.d.ts +0 -3
- package/lib/maz-phone-number-input.js +0 -3776
- package/lib/maz-picker.d.ts +0 -3
- package/lib/maz-picker.js +0 -6474
- package/lib/maz-plotly.d.ts +0 -3
- package/lib/maz-plotly.js +0 -500
- package/lib/maz-progress-bar.d.ts +0 -3
- package/lib/maz-progress-bar.js +0 -398
- package/lib/maz-radio.d.ts +0 -3
- package/lib/maz-radio.js +0 -358
- package/lib/maz-read-more.d.ts +0 -3
- package/lib/maz-read-more.js +0 -344
- package/lib/maz-responsive-menu.d.ts +0 -3
- package/lib/maz-responsive-menu.js +0 -438
- package/lib/maz-search.d.ts +0 -3
- package/lib/maz-search.js +0 -1590
- package/lib/maz-select.d.ts +0 -3
- package/lib/maz-select.js +0 -2740
- package/lib/maz-sidebar.d.ts +0 -3
- package/lib/maz-sidebar.js +0 -815
- package/lib/maz-slider.d.ts +0 -3
- package/lib/maz-slider.js +0 -1014
- package/lib/maz-spinner.d.ts +0 -3
- package/lib/maz-spinner.js +0 -328
- package/lib/maz-stepper.d.ts +0 -3
- package/lib/maz-stepper.js +0 -1011
- package/lib/maz-switch.d.ts +0 -3
- package/lib/maz-switch.js +0 -375
- package/lib/maz-tabs-bar.d.ts +0 -3
- package/lib/maz-tabs-bar.js +0 -428
- package/lib/maz-tabs-content-item.d.ts +0 -3
- package/lib/maz-tabs-content-item.js +0 -376
- package/lib/maz-tabs-content.d.ts +0 -3
- package/lib/maz-tabs-content.js +0 -367
- package/lib/maz-transition-expand.d.ts +0 -3
- package/lib/maz-transition-expand.js +0 -328
- package/lib/maz-ui.common.d.ts +0 -1
- package/lib/maz-ui.common.js +0 -17202
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2019 LouisMazel
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/README.md
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# maz-ui
|
|
2
|
-
|
|
3
|
-
[](https://github.com/LouisMazel/maz-ui/blob/master/LICENSE)
|
|
4
|
-
[](https://vuejs.org)
|
|
5
|
-
[](https://www.npmjs.com/package/maz-ui)
|
|
6
|
-
[](https://www.npmjs.com/package/maz-ui)
|
|
7
|
-
[](https://www.codacy.com/app/LouisMazel/maz-ui)
|
|
8
|
-
|
|
9
|
-
[](https://www.npmjs.com/package/maz-ui)
|
|
10
|
-
|
|
11
|
-
> [Maz-ui](https://louismazel.github.io/maz-ui/) is a stand-alone components library for [VueJS](https://vuejs.org) & [NuxtJS](https://nuxtjs.org/)
|
|
12
|
-
|
|
13
|
-
## Documentation & Components
|
|
14
|
-
|
|
15
|
-
[Documentation & Components](https://louismazel.github.io/maz-ui/)
|
|
16
|
-
|
|
17
|
-
## Install
|
|
18
|
-
|
|
19
|
-
[Get Started](https://louismazel.github.io/maz-ui/documentation/get-started)
|
|
20
|
-
|
|
21
|
-
```shell
|
|
22
|
-
npm install maz-ui
|
|
23
|
-
|
|
24
|
-
# Or yarn add maz-ui
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### On demande install
|
|
28
|
-
|
|
29
|
-
To optimize your bundle size, it's recommanded to use the [on demand install](https://louismazel.github.io/maz-ui/documentation/get-started)
|
|
30
|
-
|
|
31
|
-
```javascript
|
|
32
|
-
import Vue from 'vue'
|
|
33
|
-
import {
|
|
34
|
-
...
|
|
35
|
-
MazBtn
|
|
36
|
-
MazInput
|
|
37
|
-
MazPicker
|
|
38
|
-
MazPhoneNumberInput
|
|
39
|
-
...
|
|
40
|
-
} from 'maz-ui'
|
|
41
|
-
|
|
42
|
-
...
|
|
43
|
-
Vue.use(MazBtn)
|
|
44
|
-
Vue.use(MazInput)
|
|
45
|
-
Vue.use(MazPicker)
|
|
46
|
-
Vue.use(MazPhoneNumberInput)
|
|
47
|
-
...
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Quick Start - Fully install (not recommanded)
|
|
51
|
-
|
|
52
|
-
```javascript
|
|
53
|
-
import Vue from "vue";
|
|
54
|
-
import "maz-ui/lib/css/index.css";
|
|
55
|
-
import MazUi from "maz-ui";
|
|
56
|
-
|
|
57
|
-
Vue.use(MazUi);
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Contribute
|
|
61
|
-
|
|
62
|
-
Read documentation of [CONTRIBUTING.md](./.github/CONTRIBUTING.md)
|
|
63
|
-
|
|
64
|
-
## LICENSE
|
|
65
|
-
|
|
66
|
-
[MIT](LICENSE)
|
package/bin/index.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const chalk = require('chalk')
|
|
4
|
-
const clear = require('clear')
|
|
5
|
-
const figlet = require('figlet')
|
|
6
|
-
const path = require('path')
|
|
7
|
-
const { Command } = require('commander')
|
|
8
|
-
|
|
9
|
-
const VERSION = require('../package').version
|
|
10
|
-
const NAME = require('../package').name
|
|
11
|
-
const PREFIX = 'maz-'
|
|
12
|
-
const generateRootCss = require('./lib/index.js')
|
|
13
|
-
|
|
14
|
-
const program = new Command()
|
|
15
|
-
|
|
16
|
-
clear()
|
|
17
|
-
console.log(
|
|
18
|
-
chalk.bold.keyword('dodgerblue')(
|
|
19
|
-
figlet.textSync(NAME, { horizontalLayout: 'full' })
|
|
20
|
-
)
|
|
21
|
-
)
|
|
22
|
-
console.log()
|
|
23
|
-
console.log(chalk.bold.keyword('dodgerblue')(`${NAME} v${VERSION}`))
|
|
24
|
-
console.log()
|
|
25
|
-
|
|
26
|
-
program
|
|
27
|
-
.version(`${NAME} ${VERSION}`)
|
|
28
|
-
.usage('<command> [options]')
|
|
29
|
-
|
|
30
|
-
program
|
|
31
|
-
.arguments('[command]')
|
|
32
|
-
.action((cmd) => {
|
|
33
|
-
program.outputHelp()
|
|
34
|
-
if (cmd) {
|
|
35
|
-
console.log()
|
|
36
|
-
console.log(
|
|
37
|
-
chalk.red(` ⛔️ Unknown command ${chalk.bold.keyword('dodgerblue')(cmd)}.`)
|
|
38
|
-
)
|
|
39
|
-
console.log()
|
|
40
|
-
}
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
program.on('--help', () => {
|
|
44
|
-
console.log()
|
|
45
|
-
console.log(` Run ${chalk.bold.keyword('dodgerblue')('maz <command> --help')} for detailed usage of given command.`)
|
|
46
|
-
console.log()
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
program
|
|
50
|
-
.command('get-theme')
|
|
51
|
-
.option('-c, --config <path-to-config-file>', 'Optionnal: Provide path to config file - Ex: "./maz-ui.config.js"')
|
|
52
|
-
.description('Generate css variables')
|
|
53
|
-
.action(async (options) => {
|
|
54
|
-
const configPath = path.resolve(process.env.PWD, options.config ? options.config : './maz-ui.config.js')
|
|
55
|
-
const config = require(configPath)
|
|
56
|
-
const output = config.output
|
|
57
|
-
const colors = config.theme
|
|
58
|
-
delete config.output
|
|
59
|
-
generateRootCss(PREFIX, colors, output)
|
|
60
|
-
process.exit(0)
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
program.parse(process.argv)
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
mainColors: {
|
|
3
|
-
primary: 'dodgerblue',
|
|
4
|
-
secondary: '#1CD1A1',
|
|
5
|
-
third: '#C41AF9',
|
|
6
|
-
danger: 'orangered',
|
|
7
|
-
success: 'yellowgreen',
|
|
8
|
-
info: '#17A2B8',
|
|
9
|
-
warning: '#FFA300',
|
|
10
|
-
light: '#EEEEEE',
|
|
11
|
-
dark: '#21222E',
|
|
12
|
-
grey: '#999999',
|
|
13
|
-
default: '#CCCCCC',
|
|
14
|
-
black: 'black',
|
|
15
|
-
white: 'white',
|
|
16
|
-
transparent: '#FFFFFF00',
|
|
17
|
-
disabled: '#F2F2F2'
|
|
18
|
-
},
|
|
19
|
-
typo: {
|
|
20
|
-
'base-font-size': '16px',
|
|
21
|
-
'base-font-family': 'system-ui, -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Helvetica, Arial, sans-serif, \'Apple Color Emoji\', \'Segoe UI Emoji\', \'Segoe UI Symbol\'',
|
|
22
|
-
'base-font-weight': '400',
|
|
23
|
-
'base-line-height': '1.5'
|
|
24
|
-
},
|
|
25
|
-
border: {
|
|
26
|
-
'border-width': '2px',
|
|
27
|
-
'border-radius': '8px'
|
|
28
|
-
},
|
|
29
|
-
light: {
|
|
30
|
-
typo: {
|
|
31
|
-
'text-color': '#212121',
|
|
32
|
-
'muted-color': 'rgba(0, 0, 0, .54)',
|
|
33
|
-
'placeholder-color': '#A7A7A7',
|
|
34
|
-
'icon-color': '#DEDEDE'
|
|
35
|
-
},
|
|
36
|
-
layout: {
|
|
37
|
-
'bg-color': 'white',
|
|
38
|
-
'bg-color-light': '#F2F2F2',
|
|
39
|
-
'overlay-color': 'rgba(86, 87, 117, .7)'
|
|
40
|
-
},
|
|
41
|
-
borderColor: {
|
|
42
|
-
'border-color': '#EEEEEE'
|
|
43
|
-
},
|
|
44
|
-
state: {
|
|
45
|
-
'hover-color': '#F2F2F2',
|
|
46
|
-
'disabled-color': '#F2F2F2'
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
dark: {
|
|
50
|
-
typo: {
|
|
51
|
-
'text-color': '#EEEEEE',
|
|
52
|
-
'muted-color': 'rgba(255, 255, 255, .54)',
|
|
53
|
-
'placeholder-color': 'rgba(255, 255, 255, .6)',
|
|
54
|
-
'icon-color': '#65678F'
|
|
55
|
-
},
|
|
56
|
-
layout: {
|
|
57
|
-
'bg-color': '#21222E',
|
|
58
|
-
'bg-color-light': '#303144',
|
|
59
|
-
'overlay-color': 'rgba(86, 87, 117, .7)'
|
|
60
|
-
},
|
|
61
|
-
borderColor: {
|
|
62
|
-
'border-color': '#3B3C53'
|
|
63
|
-
},
|
|
64
|
-
state: {
|
|
65
|
-
'hover-color': '#2E2F40',
|
|
66
|
-
'disabled-color': '#CCCCCC'
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
package/bin/lib/index.d.ts
DELETED
package/bin/lib/index.js
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
const { isColorName, colorNameToHex, shadeColor, hexToRgba } = require('color-transformer-ui')
|
|
2
|
-
const generateRootCss = require('./methods/generate-root-css')
|
|
3
|
-
|
|
4
|
-
const getAlpha = (color, coef) => {
|
|
5
|
-
const alpha = color.length === 7 ? hexToRgba(color, coef) : 'transparent'
|
|
6
|
-
|
|
7
|
-
const outputCoef = coef * 100 < 10 ? `0${coef * 100}` : coef * 100
|
|
8
|
-
|
|
9
|
-
return {
|
|
10
|
-
alpha,
|
|
11
|
-
coef: outputCoef
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const getMainVariants = (color) => {
|
|
16
|
-
if (isColorName(color)) color = colorNameToHex(color)
|
|
17
|
-
const darken = shadeColor(color, -20)
|
|
18
|
-
const alpha = getAlpha(color, 0.05)
|
|
19
|
-
const alpha5 = getAlpha(color, 0.5)
|
|
20
|
-
const alpha4 = getAlpha(color, 0.4)
|
|
21
|
-
const alpha6 = getAlpha(color, 0.6)
|
|
22
|
-
|
|
23
|
-
return [color, darken, [alpha, alpha4, alpha5, alpha6]]
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const getLayoutVariants = (color) => {
|
|
27
|
-
if (isColorName(color)) color = colorNameToHex(color)
|
|
28
|
-
const darken = shadeColor(color, -10)
|
|
29
|
-
|
|
30
|
-
return [color, darken]
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const getStateVariants = (color, dark) => {
|
|
34
|
-
if (isColorName(color)) color = colorNameToHex(color)
|
|
35
|
-
const darken = dark ? shadeColor(color, 15) : shadeColor(color, -10)
|
|
36
|
-
|
|
37
|
-
return [color, darken]
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
module.exports = (prefix, theme, output) => {
|
|
41
|
-
if (!prefix) throw new Error('The "prefix" should be defined')
|
|
42
|
-
if (!output) throw new Error('No "output" found in maz-ui.config.js - Ex: "output: ./assets/root-vars.css"')
|
|
43
|
-
if (!theme || !Object.keys(theme).length) throw new Error('No colors provided in maz-ui-config.js - Ex: "{ theme: { mainColors: { primary: "red" } } }"')
|
|
44
|
-
|
|
45
|
-
const results = {
|
|
46
|
-
light: {},
|
|
47
|
-
dark: {}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Main Colors
|
|
52
|
-
*/
|
|
53
|
-
if (theme.main) {
|
|
54
|
-
Object.entries(theme.main).forEach((values) => {
|
|
55
|
-
const variants = getMainVariants(values[1])
|
|
56
|
-
results.light[`--${prefix}${values[0]}`] = variants[0]
|
|
57
|
-
results.light[`--${prefix}${values[0]}-darken`] = variants[1]
|
|
58
|
-
variants[2].forEach((v) => {
|
|
59
|
-
results.light[`--${prefix}${values[0]}-alpha-${v.coef}`] = v.alpha
|
|
60
|
-
})
|
|
61
|
-
})
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Typo base
|
|
66
|
-
*/
|
|
67
|
-
if (theme.typo) {
|
|
68
|
-
Object.entries(theme.typo).forEach((values) => {
|
|
69
|
-
results.light[`--${prefix}${values[0]}`] = values[1]
|
|
70
|
-
})
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Border
|
|
75
|
-
*/
|
|
76
|
-
if (theme.border) {
|
|
77
|
-
Object.entries(theme.border).forEach((values) => {
|
|
78
|
-
results.light[`--${prefix}${values[0]}`] = values[1]
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Light
|
|
84
|
-
*/
|
|
85
|
-
if (theme.light) {
|
|
86
|
-
if (theme.light.typo) {
|
|
87
|
-
Object.entries(theme.light.typo).forEach((values) => {
|
|
88
|
-
results.light[`--${prefix}${values[0]}`] = values[1]
|
|
89
|
-
})
|
|
90
|
-
}
|
|
91
|
-
if (theme.light.layout) {
|
|
92
|
-
Object.entries(theme.light.layout).forEach((values) => {
|
|
93
|
-
results.light[`--${prefix}${values[0]}`] = values[1]
|
|
94
|
-
})
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (theme.light.borderColor) {
|
|
98
|
-
Object.entries(theme.light.borderColor).forEach((values) => {
|
|
99
|
-
const variants = getLayoutVariants(values[1])
|
|
100
|
-
results.light[`--${prefix}${values[0]}`] = variants[0]
|
|
101
|
-
results.light[`--${prefix}${values[0]}-darken`] = variants[1]
|
|
102
|
-
})
|
|
103
|
-
}
|
|
104
|
-
if (theme.light.state) {
|
|
105
|
-
Object.entries(theme.light.state).forEach((values) => {
|
|
106
|
-
const variants = getStateVariants(values[1])
|
|
107
|
-
results.light[`--${prefix}${values[0]}`] = variants[0]
|
|
108
|
-
results.light[`--${prefix}${values[0]}-darken`] = variants[1]
|
|
109
|
-
})
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Dark
|
|
115
|
-
*/
|
|
116
|
-
if (theme.dark) {
|
|
117
|
-
if (theme.dark.typo) {
|
|
118
|
-
Object.entries(theme.dark.typo).forEach((values) => {
|
|
119
|
-
results.dark[`--${prefix}${values[0]}`] = values[1]
|
|
120
|
-
})
|
|
121
|
-
}
|
|
122
|
-
if (theme.dark.layout) {
|
|
123
|
-
Object.entries(theme.dark.layout).forEach((values) => {
|
|
124
|
-
results.dark[`--${prefix}${values[0]}`] = values[1]
|
|
125
|
-
})
|
|
126
|
-
}
|
|
127
|
-
if (theme.dark.borderColor) {
|
|
128
|
-
Object.entries(theme.dark.borderColor).forEach((values) => {
|
|
129
|
-
const variants = getLayoutVariants(values[1])
|
|
130
|
-
results.dark[`--${prefix}${values[0]}`] = variants[0]
|
|
131
|
-
results.dark[`--${prefix}${values[0]}-darken`] = variants[1]
|
|
132
|
-
})
|
|
133
|
-
}
|
|
134
|
-
if (theme.dark.state) {
|
|
135
|
-
Object.entries(theme.dark.state).forEach((values) => {
|
|
136
|
-
const variants = getStateVariants(values[1], true)
|
|
137
|
-
results.dark[`--${prefix}${values[0]}`] = variants[0]
|
|
138
|
-
results.dark[`--${prefix}${values[0]}-darken`] = variants[1]
|
|
139
|
-
})
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
generateRootCss(results, output)
|
|
144
|
-
return results
|
|
145
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
const fs = require('fs')
|
|
2
|
-
const { EOL: endOfLine } = require('os')
|
|
3
|
-
const render = require('json-templater/string')
|
|
4
|
-
|
|
5
|
-
const LIGHT_TEMPLATE = `
|
|
6
|
-
/* Automatically generated by 'maz-ui' */
|
|
7
|
-
|
|
8
|
-
/* stylelint-disable */
|
|
9
|
-
|
|
10
|
-
:root {
|
|
11
|
-
{{light_include}}
|
|
12
|
-
}`
|
|
13
|
-
|
|
14
|
-
const DARK_TEMPLATE = `.maz-is-dark {
|
|
15
|
-
{{dark_include}}
|
|
16
|
-
}`
|
|
17
|
-
|
|
18
|
-
const END_TEMPLATE = `
|
|
19
|
-
/* stylelint-enable */`
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
module.exports = (variables, output) => {
|
|
24
|
-
const lightProperties = Object.entries(variables.light)
|
|
25
|
-
.map((values) => ` ${values[0]}: ${values[1]};`)
|
|
26
|
-
.join(endOfLine)
|
|
27
|
-
const darkProperties = Object.entries(variables.dark)
|
|
28
|
-
.map((values) => ` ${values[0]}: ${values[1]};`)
|
|
29
|
-
.join(endOfLine)
|
|
30
|
-
|
|
31
|
-
const lightTemplate = render(LIGHT_TEMPLATE, {
|
|
32
|
-
light_include: lightProperties,
|
|
33
|
-
dark_include: darkProperties
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
const darkTemplate = render(DARK_TEMPLATE, {
|
|
37
|
-
light_include: lightProperties,
|
|
38
|
-
dark_include: darkProperties
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
const result = `
|
|
42
|
-
${lightTemplate}
|
|
43
|
-
${darkProperties ? darkTemplate : ''}
|
|
44
|
-
${END_TEMPLATE}
|
|
45
|
-
`.trim()
|
|
46
|
-
|
|
47
|
-
fs.writeFileSync(output, result)
|
|
48
|
-
console.log('\x1B[32m', '[build root css file] DONE:', output)
|
|
49
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
const defaultTheme = require('./../_constantes/default-colors')
|
|
2
|
-
|
|
3
|
-
module.exports = (opts) => {
|
|
4
|
-
return {
|
|
5
|
-
mainColors: {
|
|
6
|
-
...defaultTheme.mainColors,
|
|
7
|
-
...opts.mainColors
|
|
8
|
-
},
|
|
9
|
-
typo: {
|
|
10
|
-
...defaultTheme.typo,
|
|
11
|
-
...opts.typo
|
|
12
|
-
},
|
|
13
|
-
border: {
|
|
14
|
-
...defaultTheme.border,
|
|
15
|
-
...opts.border
|
|
16
|
-
},
|
|
17
|
-
light: {
|
|
18
|
-
typo: {
|
|
19
|
-
...defaultTheme.light.typo,
|
|
20
|
-
...(opts.light ? opts.light.typo : {})
|
|
21
|
-
},
|
|
22
|
-
layout: {
|
|
23
|
-
...defaultTheme.light.layout,
|
|
24
|
-
...(opts.light ? opts.light.layout : {})
|
|
25
|
-
},
|
|
26
|
-
state: {
|
|
27
|
-
...defaultTheme.light.state,
|
|
28
|
-
...(opts.light ? opts.light.state : {})
|
|
29
|
-
},
|
|
30
|
-
borderColor: {
|
|
31
|
-
...defaultTheme.light.borderColor,
|
|
32
|
-
...(opts.light ? opts.light.borderColor : {})
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
dark: {
|
|
36
|
-
typo: {
|
|
37
|
-
...defaultTheme.dark.typo,
|
|
38
|
-
...(opts.dark ? opts.dark.typo : {})
|
|
39
|
-
},
|
|
40
|
-
layout: {
|
|
41
|
-
...defaultTheme.dark.layout,
|
|
42
|
-
...(opts.dark ? opts.dark.layout : {})
|
|
43
|
-
},
|
|
44
|
-
state: {
|
|
45
|
-
...defaultTheme.dark.state,
|
|
46
|
-
...(opts.dark ? opts.dark.state : {})
|
|
47
|
-
},
|
|
48
|
-
borderColor: {
|
|
49
|
-
...defaultTheme.dark.borderColor,
|
|
50
|
-
...(opts.dark ? opts.dark.borderColor : {})
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
breakpoints: {
|
|
54
|
-
...defaultTheme.breakpoints,
|
|
55
|
-
...opts.breakpoints
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
module.exports = (variables) => {
|
|
2
|
-
const root = document.documentElement.style
|
|
3
|
-
|
|
4
|
-
Object.entries(variables.light).forEach((values) => {
|
|
5
|
-
root.setProperty(values[0], values[1])
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
Object.entries(variables.dark).forEach((values) => {
|
|
9
|
-
root.setProperty(values[0], values[1])
|
|
10
|
-
})
|
|
11
|
-
}
|