@mgdis/mg-components 5.4.0 → 5.6.0
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/cjs/{index-94497267.js → index-4dcc1812.js} +11 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{mg-badge_29.cjs.entry.js → mg-badge_30.cjs.entry.js} +1112 -859
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +5 -4
- package/dist/collection/components/atoms/mg-badge/doc/mg-badge.stories.js +0 -7
- package/dist/collection/components/atoms/mg-badge/mg-badge.conf.js +1 -1
- package/dist/collection/components/atoms/mg-badge/mg-badge.css +13 -0
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +7 -10
- package/dist/collection/components/atoms/mg-button/doc/mg-button.stories.js +0 -7
- package/dist/collection/components/atoms/mg-button/mg-button.conf.js +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.css +15 -1
- package/dist/collection/components/atoms/mg-button/mg-button.js +12 -29
- package/dist/collection/components/atoms/mg-card/mg-card.css +17 -5
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +2 -3
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +0 -6
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +13 -3
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +5 -12
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +4 -8
- package/dist/collection/components/atoms/mg-tag/doc/mg-tag.stories.js +1 -9
- package/dist/collection/components/atoms/mg-tag/mg-tag.css +58 -0
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +61 -16
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.css +2 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +9 -22
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +17 -33
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +21 -26
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +24 -47
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +17 -29
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +18 -33
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +30 -36
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +23 -41
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +23 -45
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +16 -33
- package/dist/collection/components/molecules/menu/mg-menu/doc/mg-menu.stories.js +43 -11
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +17 -0
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.css +27 -0
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +145 -25
- package/dist/collection/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.js +7 -5
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +0 -4
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.css +51 -21
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +129 -92
- package/dist/collection/components/molecules/mg-details/mg-details.js +4 -8
- package/dist/collection/components/molecules/mg-form/mg-form.js +8 -22
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.css +2 -2
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +4 -9
- package/dist/collection/components/molecules/mg-message/mg-message.css +20 -19
- package/dist/collection/components/molecules/mg-message/mg-message.js +55 -33
- package/dist/collection/components/molecules/mg-modal/mg-modal.css +20 -8
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +8 -26
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +4 -13
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +17 -5
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +11 -22
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +82 -20
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +54 -26
- package/dist/collection/components/molecules/mg-skip-links/doc/mg-skip-links.stories.js +24 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.conf.js +1 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.css +28 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +108 -0
- package/dist/collection/components/molecules/mg-tabs/doc/mg-tabs.stories.js +5 -3
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +11 -7
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +109 -75
- package/dist/collection/locales/en/messages.json +7 -0
- package/dist/collection/locales/fr/messages.json +7 -0
- package/dist/collection/locales/index.js +2 -25
- package/dist/collection/styles/a11y.scss +32 -0
- package/dist/collection/styles/components.scss +3 -0
- package/dist/collection/styles/fonts.scss +21 -0
- package/dist/collection/styles/form.scss +3 -0
- package/dist/collection/styles/global.scss +87 -0
- package/dist/collection/styles/layout.scss +29 -0
- package/dist/collection/styles/main.scss +23 -0
- package/dist/collection/styles/navigation-button.scss +76 -0
- package/dist/collection/styles/reset-mg-card-slotted-variables.scss +9 -0
- package/dist/collection/styles/typography.scss +75 -0
- package/dist/collection/styles/utilities.scss +21 -0
- package/dist/collection/utils/behaviors.utils.js +169 -0
- package/dist/collection/utils/components.utils.js +50 -0
- package/dist/collection/utils/locale.utils.js +22 -0
- package/dist/collection/utils/unit.test.utils.js +37 -32
- package/dist/collection/variables.css +9 -9
- package/dist/components/components.utils.js +51 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +73 -18
- package/dist/components/mg-badge2.js +8 -11
- package/dist/components/mg-button2.js +13 -30
- package/dist/components/mg-card.js +1 -37
- package/dist/components/mg-card2.js +39 -0
- package/dist/components/mg-character-left2.js +2 -3
- package/dist/components/mg-details.js +4 -8
- package/dist/components/mg-divider.js +0 -6
- package/dist/components/mg-form.js +8 -22
- package/dist/components/mg-icon2.js +18 -15
- package/dist/components/mg-illustrated-message.js +5 -10
- package/dist/components/mg-input-checkbox.js +17 -33
- package/dist/components/mg-input-date.js +23 -29
- package/dist/components/mg-input-numeric.js +26 -50
- package/dist/components/mg-input-password.js +18 -30
- package/dist/components/mg-input-radio.js +18 -33
- package/dist/components/mg-input-select2.js +32 -38
- package/dist/components/mg-input-text2.js +24 -42
- package/dist/components/mg-input-textarea.js +24 -46
- package/dist/components/mg-input-title2.js +4 -8
- package/dist/components/mg-input-toggle.js +16 -33
- package/dist/components/mg-menu-item.js +1 -264
- package/dist/components/mg-menu-item2.js +517 -0
- package/dist/components/mg-menu.js +142 -28
- package/dist/components/mg-message.js +64 -36
- package/dist/components/mg-modal.js +18 -30
- package/dist/components/mg-pagination.js +4 -13
- package/dist/components/mg-panel.js +20 -25
- package/dist/components/mg-popover.js +1 -200
- package/dist/components/mg-popover2.js +212 -0
- package/dist/components/mg-skip-links.d.ts +11 -0
- package/dist/components/mg-skip-links.js +80 -0
- package/dist/components/mg-tabs.js +108 -73
- package/dist/components/mg-tag.js +35 -13
- package/dist/components/mg-tooltip2.js +10 -23
- package/dist/esm/{index-aad0184c.js → index-dc9a2348.js} +11 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mg-badge_29.entry.js → mg-badge_30.entry.js} +1112 -860
- package/dist/esm/mg-components.js +3 -3
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/mg-components/locales/en/messages.json +7 -0
- package/dist/mg-components/locales/fr/messages.json +7 -0
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-3899d5d2.js → p-182bd802.js} +2 -2
- package/dist/mg-components/p-f7da9dd2.entry.js +1 -0
- package/dist/mg-components/styles/a11y.scss +32 -0
- package/dist/mg-components/styles/components.scss +3 -0
- package/dist/mg-components/styles/fonts.scss +21 -0
- package/dist/mg-components/styles/form.scss +3 -0
- package/dist/mg-components/styles/global.scss +87 -0
- package/dist/mg-components/styles/layout.scss +29 -0
- package/dist/mg-components/styles/main.scss +23 -0
- package/dist/mg-components/styles/navigation-button.scss +76 -0
- package/dist/mg-components/styles/reset-mg-card-slotted-variables.scss +9 -0
- package/dist/mg-components/styles/typography.scss +75 -0
- package/dist/mg-components/styles/utilities.scss +21 -0
- package/dist/mg-components/variables.css +9 -9
- package/dist/types/components/atoms/mg-badge/doc/mg-badge.stories.d.ts +0 -11
- package/dist/types/components/atoms/mg-badge/mg-badge.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +1 -1
- package/dist/types/components/atoms/mg-button/doc/mg-button.stories.d.ts +0 -11
- package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +4 -4
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +6 -6
- package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-tag/doc/mg-tag.stories.d.ts +0 -13
- package/dist/types/components/atoms/mg-tag/mg-tag.conf.d.ts +5 -1
- package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +27 -6
- package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +1 -1
- package/dist/types/components/molecules/menu/mg-menu/doc/mg-menu.stories.d.ts +5 -0
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +37 -0
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +51 -3
- package/dist/types/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.d.ts +1 -0
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +0 -8
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +55 -15
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +1 -1
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +22 -5
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +1 -1
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +12 -0
- package/dist/types/components/molecules/mg-skip-links/doc/mg-skip-links.stories.d.ts +11 -0
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +7 -0
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +49 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +5 -3
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +24 -14
- package/dist/types/components.d.ts +81 -18
- package/dist/types/locales/index.d.ts +16 -9
- package/dist/types/stencil-public-runtime.d.ts +44 -3
- package/dist/types/utils/behaviors.utils.d.ts +83 -0
- package/dist/types/utils/components.utils.d.ts +14 -0
- package/dist/types/utils/locale.utils.d.ts +13 -0
- package/dist/types/utils/unit.test.utils.d.ts +78 -0
- package/package.json +51 -46
- package/readme.md +25 -14
- package/dist/components/locale.utils.js +0 -40
- package/dist/components/mg-menu.conf.js +0 -10
- package/dist/mg-components/p-059a9a59.entry.js +0 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A11Y
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Make content available only for screen reader
|
|
6
|
+
// https://gist.github.com/ffoodd/000b59f431e3e64e4ce1a24d5bb36034
|
|
7
|
+
.sr-only {
|
|
8
|
+
border: 0 !important;
|
|
9
|
+
clip: rect(1px, 1px, 1px, 1px) !important;
|
|
10
|
+
-webkit-clip-path: inset(50%) !important;
|
|
11
|
+
clip-path: inset(50%) !important;
|
|
12
|
+
height: 1px !important;
|
|
13
|
+
margin: -1px !important;
|
|
14
|
+
overflow: hidden !important;
|
|
15
|
+
padding: 0 !important;
|
|
16
|
+
position: absolute !important;
|
|
17
|
+
width: 1px !important;
|
|
18
|
+
white-space: nowrap !important;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Remove outline for non-keyboard :focus
|
|
22
|
+
// https://www.tpgi.com/focus-visible-and-backwards-compatibility/
|
|
23
|
+
*:focus:not(:focus-visible) {
|
|
24
|
+
outline: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@media (prefers-reduced-motion) {
|
|
28
|
+
.mg-a11y-animation {
|
|
29
|
+
animation: none !important;
|
|
30
|
+
transition: none !important;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Open Sans
|
|
3
|
+
* https://fonts.google.com/specimen/Open+Sans
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
@font-face {
|
|
7
|
+
font-family: 'Open Sans';
|
|
8
|
+
src: url('fonts/OpenSans-Regular.ttf') format('truetype');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@font-face {
|
|
12
|
+
font-family: 'Open Sans';
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
src: url('fonts/OpenSans-SemiBold.ttf') format('truetype');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@font-face {
|
|
18
|
+
font-family: 'Open Sans';
|
|
19
|
+
font-weight: 700;
|
|
20
|
+
src: url('fonts/OpenSans-Bold.ttf') format('truetype');
|
|
21
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Here we building the CSS for the component library
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Normalize CSS : https://necolas.github.io/normalize.css/
|
|
6
|
+
@import '~normalize.css/normalize.css';
|
|
7
|
+
|
|
8
|
+
// Fonts
|
|
9
|
+
@import './fonts.scss';
|
|
10
|
+
|
|
11
|
+
// Variables
|
|
12
|
+
@import './variables.css';
|
|
13
|
+
|
|
14
|
+
// Main style
|
|
15
|
+
@import './main.scss';
|
|
16
|
+
|
|
17
|
+
// Typography style
|
|
18
|
+
@import './typography.scss';
|
|
19
|
+
|
|
20
|
+
// Accessibility
|
|
21
|
+
@import './a11y.scss';
|
|
22
|
+
|
|
23
|
+
// Form
|
|
24
|
+
// already included by mg-form
|
|
25
|
+
// @import './form.scss';
|
|
26
|
+
|
|
27
|
+
// Layout
|
|
28
|
+
@import './layout.scss';
|
|
29
|
+
|
|
30
|
+
// Utilities
|
|
31
|
+
@import './utilities.scss';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Components style
|
|
35
|
+
* molecules
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
@import './components.scss';
|
|
39
|
+
|
|
40
|
+
/* Atoms */
|
|
41
|
+
|
|
42
|
+
// <mg-badge>
|
|
43
|
+
@import '../components/atoms/mg-badge/mg-badge.scss';
|
|
44
|
+
|
|
45
|
+
// <mg-button>
|
|
46
|
+
@import '../components/atoms/mg-button/mg-button.scss';
|
|
47
|
+
|
|
48
|
+
// <mg-character-left>
|
|
49
|
+
@import '../components/atoms/mg-character-left/mg-character-left.scss';
|
|
50
|
+
|
|
51
|
+
// <mg-icon>
|
|
52
|
+
@import '../components/atoms/mg-icon/mg-icon.scss';
|
|
53
|
+
|
|
54
|
+
// <mg-input-title>
|
|
55
|
+
//! For now input style will not be included
|
|
56
|
+
// @import '../components/atoms/mg-input-title/mg-input-title.scss';
|
|
57
|
+
|
|
58
|
+
// <mg-tag>
|
|
59
|
+
@import '../components/atoms/mg-tag/mg-tag.scss';
|
|
60
|
+
|
|
61
|
+
// <mg-tooltip>
|
|
62
|
+
@import '../components/atoms/mg-tooltip/mg-tooltip.scss';
|
|
63
|
+
|
|
64
|
+
/* Molecules */
|
|
65
|
+
|
|
66
|
+
// <mg-input-...>
|
|
67
|
+
//! For now input style will not be included
|
|
68
|
+
// @import '../components/molecules/inputs/styles/mg-input.scss';
|
|
69
|
+
// @import '../components/molecules/inputs/styles/mg-input-box.scss';
|
|
70
|
+
// @import '../components/molecules/inputs/styles/mg-input-charleft.scss';
|
|
71
|
+
// @import '../components/molecules/inputs/styles/mg-input-fieldset.scss';
|
|
72
|
+
// @import '../components/molecules/inputs/styles/mg-input-width.scss';
|
|
73
|
+
|
|
74
|
+
// <mg-form>
|
|
75
|
+
@import '../components/molecules/mg-form/mg-form.scss';
|
|
76
|
+
|
|
77
|
+
// <mg-message>
|
|
78
|
+
@import '../components/molecules/mg-message/mg-message.scss';
|
|
79
|
+
|
|
80
|
+
// <mg-pagination>
|
|
81
|
+
@import '../components/molecules/mg-pagination/mg-pagination.scss';
|
|
82
|
+
|
|
83
|
+
// <mg-popover>
|
|
84
|
+
@import '../components/molecules/mg-popover/mg-popover.scss';
|
|
85
|
+
|
|
86
|
+
// <mg-tabs>
|
|
87
|
+
@import '../components/molecules/mg-tabs/mg-tabs.scss';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
|
|
3
|
+
// Number of column
|
|
4
|
+
$grid-columns: 12;
|
|
5
|
+
|
|
6
|
+
// Calculate width
|
|
7
|
+
@function round-width($i) {
|
|
8
|
+
$width: math.div(100 * $i, $grid-columns);
|
|
9
|
+
@return #{$width}#{'%'};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.mg-grid {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-wrap: wrap;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Those columns will equaly share space
|
|
18
|
+
.mg-grid__col {
|
|
19
|
+
flex: 1 0 0;
|
|
20
|
+
padding: 0 var(--mg-grid-spacing);
|
|
21
|
+
|
|
22
|
+
// Building columns
|
|
23
|
+
@for $i from 1 through $grid-columns {
|
|
24
|
+
&.mg-grid__col-#{$i} {
|
|
25
|
+
flex: 0 0 auto;
|
|
26
|
+
width: round-width($i);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Make all element use the border box model
|
|
2
|
+
*,
|
|
3
|
+
*::before,
|
|
4
|
+
*::after {
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* We set html font size to 62.5% to get 10px in most of the case.
|
|
10
|
+
* This is a common use for an easiest calculation : 1rem = 10px
|
|
11
|
+
* Default font size will be defined in body element.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
html {
|
|
15
|
+
font-size: 62.5%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
body {
|
|
19
|
+
font-size: var(--font-size);
|
|
20
|
+
font-family: var(--font-family);
|
|
21
|
+
line-height: var(--line-height);
|
|
22
|
+
-webkit-font-smoothing: antialiased;
|
|
23
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
|
|
3
|
+
$border-bottom-size: 0.3rem;
|
|
4
|
+
$font-size-large: calc(var(--font-size) + 0.2rem);
|
|
5
|
+
$navigation-button-column-gap: 1rem;
|
|
6
|
+
|
|
7
|
+
@mixin navigation-button($element, $button-sizes) {
|
|
8
|
+
@each $name, $size in $button-sizes {
|
|
9
|
+
.#{$element}.#{$element}--size-#{$name} .#{$element}__navigation-button,
|
|
10
|
+
.#{$element}__navigation-button.#{$element}__navigation-button--size-#{$name} {
|
|
11
|
+
padding: #{map.get($size, 'vertical')} #{map.get($size, 'horizontal')};
|
|
12
|
+
height: calc(#{map.get($size, 'height')});
|
|
13
|
+
&,
|
|
14
|
+
::slotted([slot='label']),
|
|
15
|
+
::slotted([slot='metadata']) {
|
|
16
|
+
@if $name == 'regular' {
|
|
17
|
+
font-size: var(--font-size);
|
|
18
|
+
} @else {
|
|
19
|
+
font-size: $font-size-large;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
&.#{$element}__navigation-button--horizontal {
|
|
23
|
+
padding-bottom: calc(#{map.get($size, 'vertical')} - #{$border-bottom-size});
|
|
24
|
+
}
|
|
25
|
+
&.#{$element}__navigation-button--vertical {
|
|
26
|
+
padding-left: calc(#{map.get($size, 'horizontal')} - #{$border-bottom-size});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.#{$element}__navigation-button {
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
column-gap: var(--#{$element}-navigation-button-column-gap, $navigation-button-column-gap);
|
|
35
|
+
background-color: unset;
|
|
36
|
+
border: none;
|
|
37
|
+
font-family: var(--font-family);
|
|
38
|
+
color: hsl(var(--#{$element}-color-hsl, var(--color-dark)));
|
|
39
|
+
line-height: var(--line-height);
|
|
40
|
+
text-decoration: none;
|
|
41
|
+
white-space: nowrap;
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
&:disabled,
|
|
45
|
+
&--disabled {
|
|
46
|
+
cursor: default;
|
|
47
|
+
opacity: 0.3;
|
|
48
|
+
}
|
|
49
|
+
&:focus-visible {
|
|
50
|
+
z-index: 10;
|
|
51
|
+
}
|
|
52
|
+
&:hover:not(.#{$element}__navigation-button--disabled),
|
|
53
|
+
&:focus-visible:not(.#{$element}__navigation-button--disabled) {
|
|
54
|
+
background-color: hsl(var(--#{$element}-focused-background-color-hsl), 0.1);
|
|
55
|
+
}
|
|
56
|
+
&.#{$element}__navigation-button--active {
|
|
57
|
+
color: hsl(var(--#{$element}-color-active-hsl));
|
|
58
|
+
font-weight: 600;
|
|
59
|
+
&.#{$element}__navigation-button--horizontal {
|
|
60
|
+
border-bottom-color: hsl(var(--#{$element}-border-color-active-hsl));
|
|
61
|
+
}
|
|
62
|
+
&.#{$element}__navigation-button--vertical {
|
|
63
|
+
border-left-color: hsl(var(--#{$element}-border-color-active-hsl));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
&.#{$element}__navigation-button--hidden {
|
|
67
|
+
display: none;
|
|
68
|
+
}
|
|
69
|
+
&.#{$element}__navigation-button--horizontal {
|
|
70
|
+
border-bottom: $border-bottom-size solid transparent;
|
|
71
|
+
}
|
|
72
|
+
&.#{$element}__navigation-button--vertical {
|
|
73
|
+
border-left: $border-bottom-size solid transparent;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@mixin reset-slot-card-variables() {
|
|
2
|
+
::slotted(*) {
|
|
3
|
+
--mg-card-border: var(--mg-card-border-default);
|
|
4
|
+
--mg-card-padding: var(--mg-card-padding-default);
|
|
5
|
+
--mg-card-border-radius: var(--mg-card-border-radius-default);
|
|
6
|
+
--mg-card-background: var(--mg-card-background-default);
|
|
7
|
+
--mg-card-box-shadow: var(--mg-card-box-shadow-default);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Paragraph
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
p {
|
|
6
|
+
margin: 0;
|
|
7
|
+
& + p {
|
|
8
|
+
margin-top: 1rem;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Headings
|
|
14
|
+
*
|
|
15
|
+
* Classes can also be used on element to match attending, for exemples :
|
|
16
|
+
* <h4 class="h3">blu</h4>
|
|
17
|
+
* <div role="heading" aria-level="4" class="h4">blu</div>
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
@for $i from 1 through 6 {
|
|
21
|
+
h#{$i},
|
|
22
|
+
.h#{$i} {
|
|
23
|
+
font-family: var(--font-family-heading);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//h1
|
|
28
|
+
h1,
|
|
29
|
+
.h1 {
|
|
30
|
+
font-size: calc(var(--font-size) * 1.85);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//h2
|
|
34
|
+
h2,
|
|
35
|
+
.h2 {
|
|
36
|
+
font-size: calc(var(--font-size) * 1.65);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//h3
|
|
40
|
+
h3,
|
|
41
|
+
.h3 {
|
|
42
|
+
font-size: calc(var(--font-size) * 1.35);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//h4
|
|
46
|
+
h4,
|
|
47
|
+
.h4 {
|
|
48
|
+
font-size: calc(var(--font-size) * 1.2);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//h5
|
|
52
|
+
h5,
|
|
53
|
+
.h5 {
|
|
54
|
+
font-size: calc(var(--font-size) * 1.1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//h6
|
|
58
|
+
h6,
|
|
59
|
+
.h6 {
|
|
60
|
+
font-size: calc(var(--font-size) * 0.8);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Links
|
|
65
|
+
*/
|
|
66
|
+
a {
|
|
67
|
+
color: hsl(var(--color-primary));
|
|
68
|
+
text-decoration: underline;
|
|
69
|
+
|
|
70
|
+
&:hover,
|
|
71
|
+
&:focus,
|
|
72
|
+
&:active {
|
|
73
|
+
text-decoration: none;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Helper to manage space between elements
|
|
2
|
+
.mg-group-elements {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
gap: 1rem;
|
|
7
|
+
|
|
8
|
+
// remove default margin
|
|
9
|
+
& > * {
|
|
10
|
+
margin: 0 !important; // I would say important is allowed in utility classes ?
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Align button on right side
|
|
14
|
+
&.mg-group-elements--align-right {
|
|
15
|
+
justify-content: flex-end;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.no-padding {
|
|
20
|
+
padding: 0;
|
|
21
|
+
}
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
--color-secondary: hsl(var(--color-neutral));
|
|
97
97
|
|
|
98
98
|
/* Shadow */
|
|
99
|
-
--box-shadow: 0 0.3rem 0.8rem 0
|
|
99
|
+
--box-shadow: 0 0.3rem 0.8rem 0 hsl(var(--color-dark), 0.15);
|
|
100
100
|
|
|
101
101
|
/*
|
|
102
102
|
Global
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
--mg-panel-box-shadow: var(--box-shadow);
|
|
181
181
|
--mg-panel-content-padding: 1.5rem;
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
/*
|
|
184
184
|
<mg-illustrated-message>
|
|
185
185
|
*/
|
|
186
186
|
|
|
@@ -189,16 +189,16 @@
|
|
|
189
189
|
/*
|
|
190
190
|
<mg-card>
|
|
191
191
|
*/
|
|
192
|
-
--mg-card-padding: 1.6rem;
|
|
193
|
-
--mg-card-border-radius: 0.5rem;
|
|
194
|
-
--mg-card-background: hsl(var(--color-light));
|
|
195
|
-
--mg-card-border: 0.1rem solid
|
|
196
|
-
--mg-card-box-shadow: var(--box-shadow);
|
|
192
|
+
--mg-card-padding-default: 1.6rem;
|
|
193
|
+
--mg-card-border-radius-default: 0.5rem;
|
|
194
|
+
--mg-card-background-default: hsl(var(--color-light));
|
|
195
|
+
--mg-card-border-default: 0.1rem solid hsl(var(--color-dark), 0.05);
|
|
196
|
+
--mg-card-box-shadow-default: var(--box-shadow);
|
|
197
197
|
|
|
198
198
|
/*
|
|
199
199
|
<mg-divider>
|
|
200
200
|
*/
|
|
201
|
-
--mg-divider-background-color:
|
|
201
|
+
--mg-divider-background-color: hsl(var(--color-dark), 0.15);
|
|
202
202
|
--mg-divider-thickness: 0.1rem;
|
|
203
203
|
--mg-divider-vertical-spacing: 4rem;
|
|
204
204
|
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
--mg-menu-item-focused-background-color-hsl: var(--mg-color-app-hsl);
|
|
246
246
|
--mg-menu-item-border-color-active-hsl: var(--mg-color-app-hsl);
|
|
247
247
|
--mg-menu-item-color-active-hsl: var(--mg-color-app-hsl);
|
|
248
|
-
|
|
248
|
+
|
|
249
249
|
/*
|
|
250
250
|
<mg-tabs>
|
|
251
251
|
*/
|
|
@@ -2,17 +2,6 @@ declare const _default: {
|
|
|
2
2
|
component: string;
|
|
3
3
|
title: string;
|
|
4
4
|
argTypes: {
|
|
5
|
-
variant: {
|
|
6
|
-
options: readonly ["info", "primary", "secondary", "success", "warning", "danger"];
|
|
7
|
-
control: {
|
|
8
|
-
type: string;
|
|
9
|
-
};
|
|
10
|
-
table: {
|
|
11
|
-
defaultValue: {
|
|
12
|
-
summary: "info";
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
5
|
value: {
|
|
17
6
|
control: {
|
|
18
7
|
type: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* List of all possibles variants
|
|
3
3
|
*/
|
|
4
|
-
export declare const variants: readonly ["info", "primary", "secondary", "success", "warning", "danger"];
|
|
4
|
+
export declare const variants: readonly ["info", "primary", "secondary", "success", "warning", "danger", "text-color"];
|
|
5
5
|
/**
|
|
6
6
|
* Variant type from variants
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type BadgeVariantType = (typeof variants)[number];
|
|
@@ -2,17 +2,6 @@ declare const _default: {
|
|
|
2
2
|
component: string;
|
|
3
3
|
title: string;
|
|
4
4
|
argTypes: {
|
|
5
|
-
variant: {
|
|
6
|
-
options: readonly ["primary", "secondary", "danger", "danger-alt", "info", "flat", "success"];
|
|
7
|
-
control: {
|
|
8
|
-
type: string;
|
|
9
|
-
};
|
|
10
|
-
table: {
|
|
11
|
-
defaultValue: {
|
|
12
|
-
summary: "primary";
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
5
|
type: {
|
|
17
6
|
options: ("button" | "submit" | "reset")[];
|
|
18
7
|
control: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* List of all possibles variants
|
|
3
3
|
*/
|
|
4
|
-
export declare const variants: readonly ["primary", "secondary", "danger", "danger-alt", "info", "flat", "success"];
|
|
4
|
+
export declare const variants: readonly ["primary", "secondary", "danger", "danger-alt", "info", "flat", "success", "link"];
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* VariantType type from button variants
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type VariantType = (typeof variants)[number];
|
|
9
9
|
/**
|
|
10
10
|
* List of all possibles button types
|
|
11
11
|
*/
|
|
@@ -13,4 +13,4 @@ export declare const buttonTypes: readonly ["button", "submit", "reset"];
|
|
|
13
13
|
/**
|
|
14
14
|
* ButtonType type from buttonTypes
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export type ButtonType = (typeof buttonTypes)[number];
|
|
@@ -5,9 +5,9 @@ export declare class MgButton {
|
|
|
5
5
|
* Internal *
|
|
6
6
|
************/
|
|
7
7
|
private onClickElementFn;
|
|
8
|
-
private classDisabled;
|
|
9
|
-
private classLoading;
|
|
10
|
-
private classFullWidth;
|
|
8
|
+
private readonly classDisabled;
|
|
9
|
+
private readonly classLoading;
|
|
10
|
+
private readonly classFullWidth;
|
|
11
11
|
/**************
|
|
12
12
|
* Decorators *
|
|
13
13
|
**************/
|
|
@@ -37,7 +37,7 @@ export declare class MgButton {
|
|
|
37
37
|
* Set button to full-width
|
|
38
38
|
*/
|
|
39
39
|
fullWidth: boolean;
|
|
40
|
-
validateFullWidth(newValue:
|
|
40
|
+
validateFullWidth(newValue: MgButton['fullWidth']): void;
|
|
41
41
|
/**
|
|
42
42
|
* Define form id to attach button with.
|
|
43
43
|
* If this attribute is not set, the <button> is associated with its ancestor <form> element.
|
|
@@ -47,7 +47,7 @@ export declare class MgButton {
|
|
|
47
47
|
* Disable button
|
|
48
48
|
*/
|
|
49
49
|
disabled: boolean;
|
|
50
|
-
disabledHandler(isDisabled:
|
|
50
|
+
disabledHandler(isDisabled: MgButton['disabled']): void;
|
|
51
51
|
/**
|
|
52
52
|
* Define if button is round.
|
|
53
53
|
* Used for icon button.
|
|
@@ -64,7 +64,7 @@ export declare class MgButton {
|
|
|
64
64
|
* It's required to reset to false when action/promise in parent is done to stop the loading state
|
|
65
65
|
*/
|
|
66
66
|
loading: boolean;
|
|
67
|
-
loadingHandler(newValue:
|
|
67
|
+
loadingHandler(newValue: MgButton['loading']): void;
|
|
68
68
|
/**
|
|
69
69
|
* Component classes
|
|
70
70
|
*/
|
|
@@ -9,7 +9,7 @@ export declare const sizes: readonly ["small", "regular", "large", "extra-large"
|
|
|
9
9
|
/**
|
|
10
10
|
* Icon Size from sizes
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type IconSizeType = (typeof sizes)[number];
|
|
13
13
|
/**
|
|
14
14
|
* List of all possibles variants
|
|
15
15
|
*/
|
|
@@ -17,4 +17,4 @@ export declare const variants: readonly ["success", "warning", "danger", "info"]
|
|
|
17
17
|
/**
|
|
18
18
|
* Variant type from variants
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export type IconVariantType = (typeof variants)[number];
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
component: string;
|
|
3
3
|
title: string;
|
|
4
|
-
argTypes: {
|
|
5
|
-
variant: {
|
|
6
|
-
options: string[];
|
|
7
|
-
control: {
|
|
8
|
-
type: string;
|
|
9
|
-
};
|
|
10
|
-
table: {
|
|
11
|
-
defaultValue: {
|
|
12
|
-
summary: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
4
|
};
|
|
18
5
|
export default _default;
|
|
19
6
|
export declare const MgTag: any;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* List of all possibles variants
|
|
3
3
|
*/
|
|
4
|
-
export declare const variants:
|
|
4
|
+
export declare const variants: readonly ["primary", "secondary", "success", "warning", "danger", "info"];
|
|
5
|
+
/**
|
|
6
|
+
* TagVariantType type from tag variants
|
|
7
|
+
*/
|
|
8
|
+
export type TagVariantType = (typeof variants)[number];
|
|
@@ -1,26 +1,47 @@
|
|
|
1
|
+
import { TagVariantType } from './mg-tag.conf';
|
|
1
2
|
import { ClassList } from '../../../utils/components.utils';
|
|
2
3
|
export declare class MgTag {
|
|
3
4
|
/************
|
|
4
5
|
* Internal *
|
|
5
6
|
************/
|
|
6
|
-
private classOutline;
|
|
7
|
+
private readonly classOutline;
|
|
8
|
+
private readonly classSoft;
|
|
7
9
|
/**************
|
|
8
10
|
* Decorators *
|
|
9
11
|
**************/
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
13
|
+
* Get component DOM element
|
|
12
14
|
*/
|
|
13
|
-
|
|
14
|
-
validateVariant(newValue: string, oldValue?: string): void;
|
|
15
|
+
element: HTMLMgTagElement;
|
|
15
16
|
/**
|
|
16
|
-
* Define
|
|
17
|
+
* Define tag variant
|
|
18
|
+
*/
|
|
19
|
+
variant: TagVariantType;
|
|
20
|
+
validateVariant(newValue: MgTag['variant'], oldValue?: MgTag['variant']): void;
|
|
21
|
+
/**
|
|
22
|
+
* Define if tag is using outline style
|
|
17
23
|
*/
|
|
18
24
|
outline: boolean;
|
|
19
|
-
validateOutline(newValue:
|
|
25
|
+
validateOutline(newValue: MgTag['outline']): void;
|
|
26
|
+
/**
|
|
27
|
+
* Define if tag is using soft style
|
|
28
|
+
*/
|
|
29
|
+
soft: boolean;
|
|
30
|
+
validateSoft(newValue: MgTag['soft']): void;
|
|
20
31
|
/**
|
|
21
32
|
* Component classes
|
|
22
33
|
*/
|
|
23
34
|
classList: ClassList;
|
|
35
|
+
/*************
|
|
36
|
+
* Methods *
|
|
37
|
+
*************/
|
|
38
|
+
/**
|
|
39
|
+
* Validate the given textContent
|
|
40
|
+
*
|
|
41
|
+
* @param {string} textContent html element textContent property
|
|
42
|
+
* @returns {void}
|
|
43
|
+
*/
|
|
44
|
+
private validateTextContent;
|
|
24
45
|
/*************
|
|
25
46
|
* Lifecycle *
|
|
26
47
|
*************/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Possible input width
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type Width = 2 | 4 | 16 | 'full';
|
|
5
5
|
/**
|
|
6
6
|
* Possible Input types
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type HTMLMgInputsElement = HTMLMgInputCheckboxElement | HTMLMgInputDateElement | HTMLMgInputNumericElement | HTMLMgInputPasswordElement | HTMLMgInputRadioElement | HTMLMgInputSelectElement | HTMLMgInputTextElement | HTMLMgInputTextareaElement | (HTMLMgInputToggleElement & {
|
|
9
9
|
required: true;
|
|
10
10
|
invalid: false;
|
|
11
11
|
displayError: () => void;
|