@mgdis/mg-components 5.5.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-c3450336.js → index-4dcc1812.js} +11 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/mg-badge_30.cjs.entry.js +742 -244
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +4 -4
- 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 +3 -3
- package/dist/collection/components/atoms/mg-button/mg-button.css +2 -1
- package/dist/collection/components/atoms/mg-card/mg-card.css +13 -6
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +13 -3
- package/dist/collection/components/atoms/mg-tag/mg-tag.css +6 -6
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +3 -3
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.css +2 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +3 -3
- 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 +4 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +3 -3
- 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 +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +3 -3
- 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 +141 -18
- package/dist/collection/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.js +5 -10
- 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 +47 -21
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +118 -70
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +4 -3
- package/dist/collection/components/molecules/mg-message/mg-message.css +7 -0
- package/dist/collection/components/molecules/mg-message/mg-message.js +53 -12
- package/dist/collection/components/molecules/mg-modal/mg-modal.css +8 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +7 -0
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +72 -14
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +48 -4
- package/dist/collection/components/molecules/mg-skip-links/doc/mg-skip-links.stories.js +1 -1
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +32 -1
- 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 +101 -54
- package/dist/collection/locales/en/messages.json +4 -0
- package/dist/collection/locales/fr/messages.json +4 -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/index2.js +65 -18
- package/dist/components/mg-badge2.js +4 -4
- package/dist/components/mg-button2.js +1 -1
- package/dist/components/mg-card2.js +1 -1
- package/dist/components/mg-icon2.js +13 -3
- package/dist/components/mg-illustrated-message.js +4 -3
- package/dist/components/mg-input-date.js +6 -4
- package/dist/components/mg-input-numeric.js +2 -3
- package/dist/components/mg-input-password.js +1 -1
- package/dist/components/mg-input-select2.js +8 -4
- package/dist/components/mg-input-text2.js +1 -1
- package/dist/components/mg-input-textarea.js +1 -1
- package/dist/components/mg-menu-item.js +1 -253
- package/dist/components/mg-menu-item2.js +517 -0
- package/dist/components/mg-menu.js +138 -21
- package/dist/components/mg-message.js +54 -13
- package/dist/components/mg-modal.js +1 -1
- package/dist/components/mg-panel.js +1 -1
- package/dist/components/mg-popover.js +1 -190
- package/dist/components/mg-popover2.js +212 -0
- package/dist/components/mg-skip-links.js +16 -2
- package/dist/components/mg-tabs.js +100 -52
- package/dist/components/mg-tag.js +4 -4
- package/dist/components/mg-tooltip2.js +4 -4
- package/dist/esm/{index-78edde1d.js → index-dc9a2348.js} +11 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-badge_30.entry.js +742 -244
- package/dist/esm/mg-components.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/mg-components/locales/en/messages.json +4 -0
- package/dist/mg-components/locales/fr/messages.json +4 -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-125c54ca.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/mg-badge.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-tag/mg-tag.conf.d.ts +1 -1
- 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/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-message/mg-message.d.ts +21 -4
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +12 -0
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +1 -1
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +15 -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 +22 -12
- package/dist/types/components.d.ts +44 -12
- package/dist/types/locales/index.d.ts +10 -9
- package/dist/types/stencil-public-runtime.d.ts +39 -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 +50 -14
- package/package.json +26 -26
- package/readme.md +22 -13
- package/dist/components/locale.utils.js +0 -40
- package/dist/components/mg-menu.conf.js +0 -10
- package/dist/mg-components/p-4961c96c.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
|
*/
|
|
@@ -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];
|
|
@@ -5,7 +5,7 @@ export declare const variants: readonly ["primary", "secondary", "danger", "dang
|
|
|
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];
|
|
@@ -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,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;
|
package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* type CheckboxItem
|
|
3
3
|
* use to match checkbox attributes
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type CheckboxItem = {
|
|
6
6
|
id: string;
|
|
7
7
|
title: string;
|
|
8
8
|
value: boolean | null;
|
|
@@ -12,7 +12,7 @@ export declare type CheckboxItem = {
|
|
|
12
12
|
* type CheckboxValue
|
|
13
13
|
* use to match returned value
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export type CheckboxValue = {
|
|
16
16
|
title: string;
|
|
17
17
|
value: boolean | null;
|
|
18
18
|
disabled?: boolean;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* type SelectOption
|
|
3
3
|
* use to match select>option attributes
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type SelectOption = {
|
|
6
6
|
title: string;
|
|
7
7
|
value: unknown;
|
|
8
8
|
disabled?: boolean;
|
|
@@ -12,7 +12,7 @@ export declare type SelectOption = {
|
|
|
12
12
|
* type OptGroup
|
|
13
13
|
* use to match select>optgroup attributes
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export type OptGroup = {
|
|
16
16
|
group: string;
|
|
17
17
|
options: SelectOption[];
|
|
18
18
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { MgIcon } from '../../../atoms/mg-icon/mg-icon';
|
|
2
|
+
import { MgMenu } from './mg-menu';
|
|
1
3
|
/**
|
|
2
4
|
* Menu direction type
|
|
3
5
|
*/
|
|
@@ -5,3 +7,38 @@ export declare enum Direction {
|
|
|
5
7
|
VERTICAL = "vertical",
|
|
6
8
|
HORIZONTAL = "horizontal"
|
|
7
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* message type
|
|
12
|
+
*/
|
|
13
|
+
export type MessageType = {
|
|
14
|
+
moreLabel: string;
|
|
15
|
+
badgeLabel: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* more item type
|
|
19
|
+
*/
|
|
20
|
+
export type MoreItemType = {
|
|
21
|
+
mgIcon?: {
|
|
22
|
+
icon: MgIcon['icon'];
|
|
23
|
+
};
|
|
24
|
+
slotLabel?: {
|
|
25
|
+
label?: string;
|
|
26
|
+
display?: boolean;
|
|
27
|
+
};
|
|
28
|
+
size?: MgMenu['size'];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* More item type guard
|
|
32
|
+
*
|
|
33
|
+
* @param {unknown} element element to control
|
|
34
|
+
* @returns {boolean} truthy if element is more-item
|
|
35
|
+
*/
|
|
36
|
+
export declare const isMoreItem: (element: unknown) => element is MoreItemType;
|
|
37
|
+
/**
|
|
38
|
+
* List of all possibles sizes
|
|
39
|
+
*/
|
|
40
|
+
export declare const sizes: readonly ["regular", "medium", "large"];
|
|
41
|
+
/**
|
|
42
|
+
* item Size from sizes
|
|
43
|
+
*/
|
|
44
|
+
export type MenuSizeType = (typeof sizes)[number];
|