material-inspired-component-library 3.0.2 → 3.1.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/README.md +7 -12
- package/components/alert/index.scss +120 -0
- package/components/checkbox/README.md +49 -11
- package/components/checkbox/index.scss +145 -182
- package/components/checkbox/index.ts +148 -0
- package/components/list/index.ts +2 -3
- package/components/menu/index.ts +2 -2
- package/components/radio/index.scss +6 -24
- package/components/slider/index.ts +9 -10
- package/components/stepper/index.ts +141 -78
- package/components/textfield/index.ts +3 -4
- package/dist/alert.css +1 -0
- package/dist/alert.js +1 -0
- package/dist/checkbox.css +1 -1
- package/dist/components/checkbox/index.d.ts +5 -0
- package/dist/micl.css +1 -1
- package/dist/micl.js +1 -1
- package/dist/radio.css +1 -1
- package/docs/alert.html +181 -0
- package/docs/checkbox.html +31 -7
- package/docs/micl.css +1 -1
- package/docs/micl.js +1 -1
- package/micl.ts +2 -0
- package/package.json +1 -1
- package/styles.scss +1 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright © 2025 Hermana AS
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
// in the Software without restriction, including without limitation the rights
|
|
7
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
// furnished to do so, subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
// copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
// SOFTWARE.
|
|
21
|
+
|
|
22
|
+
export const checkboxGroupSelector = '.micl-checkbox-group';
|
|
23
|
+
|
|
24
|
+
export default (() =>
|
|
25
|
+
{
|
|
26
|
+
const getParentCheckbox = (checkboxGroup: HTMLElement): HTMLInputElement | null =>
|
|
27
|
+
{
|
|
28
|
+
const parentCheckbox = checkboxGroup.querySelector<HTMLInputElement>('.micl-checkbox__parent');
|
|
29
|
+
return (parentCheckbox?.closest(checkboxGroupSelector) === checkboxGroup) ? parentCheckbox : null;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const refreshParentCheckbox = (checkboxGroup: HTMLElement): boolean =>
|
|
33
|
+
{
|
|
34
|
+
const parentCheckbox = getParentCheckbox(checkboxGroup);
|
|
35
|
+
if (!parentCheckbox) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
let nrCheckboxes = 0,
|
|
39
|
+
nrCheckedCheckboxes = 0;
|
|
40
|
+
|
|
41
|
+
checkboxGroup.querySelectorAll<HTMLInputElement>(
|
|
42
|
+
'input[type="checkbox"].micl-checkbox'
|
|
43
|
+
).forEach(cb =>
|
|
44
|
+
{
|
|
45
|
+
if (cb !== parentCheckbox) {
|
|
46
|
+
const group = cb.closest(checkboxGroupSelector) as HTMLElement;
|
|
47
|
+
if (group === checkboxGroup) {
|
|
48
|
+
nrCheckboxes++;
|
|
49
|
+
if (cb.checked && !cb.indeterminate) {
|
|
50
|
+
nrCheckedCheckboxes++;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
else if (
|
|
54
|
+
cb.classList.contains('micl-checkbox__parent')
|
|
55
|
+
&& (group?.parentElement?.closest(checkboxGroupSelector) === checkboxGroup)
|
|
56
|
+
) {
|
|
57
|
+
nrCheckboxes++;
|
|
58
|
+
if (refreshParentCheckbox(group)) {
|
|
59
|
+
nrCheckedCheckboxes++;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
if (nrCheckedCheckboxes === 0) {
|
|
66
|
+
parentCheckbox.checked = false;
|
|
67
|
+
parentCheckbox.indeterminate = false;
|
|
68
|
+
}
|
|
69
|
+
else if (nrCheckedCheckboxes === nrCheckboxes) {
|
|
70
|
+
parentCheckbox.checked = true;
|
|
71
|
+
parentCheckbox.indeterminate = false;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
parentCheckbox.checked = true;
|
|
75
|
+
parentCheckbox.indeterminate = true;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return nrCheckedCheckboxes === nrCheckboxes;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const updateCheckboxGroup = (checkboxGroup: HTMLElement, checked: boolean): void =>
|
|
82
|
+
{
|
|
83
|
+
checkboxGroup.querySelectorAll<HTMLInputElement>(
|
|
84
|
+
'input[type="checkbox"].micl-checkbox'
|
|
85
|
+
).forEach(cb =>
|
|
86
|
+
{
|
|
87
|
+
const group = cb.closest(checkboxGroupSelector) as HTMLElement;
|
|
88
|
+
if (group === checkboxGroup) {
|
|
89
|
+
cb.checked = checked;
|
|
90
|
+
}
|
|
91
|
+
else if (
|
|
92
|
+
cb.classList.contains('micl-checkbox__parent')
|
|
93
|
+
&& (group?.parentElement?.closest(checkboxGroupSelector) === checkboxGroup)
|
|
94
|
+
) {
|
|
95
|
+
cb.checked = checked;
|
|
96
|
+
updateCheckboxGroup(group, checked);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const refreshCheckboxGroup = (checkboxGroup: HTMLElement, input: HTMLInputElement | null): void =>
|
|
102
|
+
{
|
|
103
|
+
const parentCheckbox = getParentCheckbox(checkboxGroup);
|
|
104
|
+
if (!parentCheckbox) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (input === parentCheckbox) {
|
|
109
|
+
updateCheckboxGroup(checkboxGroup, input.checked);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
let parentCheckboxGroup,
|
|
113
|
+
cbg = checkboxGroup;
|
|
114
|
+
do {
|
|
115
|
+
parentCheckboxGroup = cbg;
|
|
116
|
+
cbg = cbg.parentElement?.closest(checkboxGroupSelector) as HTMLElement;
|
|
117
|
+
}
|
|
118
|
+
while (cbg);
|
|
119
|
+
|
|
120
|
+
refreshParentCheckbox(parentCheckboxGroup);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
initialize: (element: HTMLElement): void =>
|
|
125
|
+
{
|
|
126
|
+
if (
|
|
127
|
+
!element.matches(checkboxGroupSelector)
|
|
128
|
+
|| element.dataset.miclinitialized
|
|
129
|
+
) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
element.dataset.miclinitialized = '1';
|
|
133
|
+
|
|
134
|
+
element.addEventListener('change', event =>
|
|
135
|
+
{
|
|
136
|
+
const input = event.target as HTMLInputElement;
|
|
137
|
+
if (!input.classList.contains('micl-checkbox')) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
event.stopPropagation();
|
|
141
|
+
|
|
142
|
+
refreshCheckboxGroup(element, input);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
refreshCheckboxGroup(element, null);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
})();
|
package/components/list/index.ts
CHANGED
|
@@ -23,9 +23,8 @@ export const listSelector = '.micl-list-item-one,.micl-list-item-two,.micl-list-
|
|
|
23
23
|
|
|
24
24
|
export default (() =>
|
|
25
25
|
{
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
isSelected = (item: HTMLElement | null): boolean => !!item && item.matches(':has(input[type=checkbox]:checked)');
|
|
26
|
+
const isDisabled = (item: HTMLElement | null): boolean => !!item && item.classList.contains('micl-list-item--disabled');
|
|
27
|
+
const isSelected = (item: HTMLElement | null): boolean => !!item && item.matches(':has(input[type=checkbox]:checked)');
|
|
29
28
|
|
|
30
29
|
return {
|
|
31
30
|
keydown: (event: Event) =>
|
package/components/menu/index.ts
CHANGED
|
@@ -25,8 +25,8 @@ export default (() =>
|
|
|
25
25
|
{
|
|
26
26
|
const getOrigin = (invoker: Element, popover: Element): string =>
|
|
27
27
|
{
|
|
28
|
-
const invokerRect = invoker.getBoundingClientRect()
|
|
29
|
-
|
|
28
|
+
const invokerRect = invoker.getBoundingClientRect();
|
|
29
|
+
const popoverRect = popover.getBoundingClientRect();
|
|
30
30
|
|
|
31
31
|
return ((invokerRect.x > popoverRect.x) ? 'right ' : 'left ') +
|
|
32
32
|
((invokerRect.y > popoverRect.y) ? 'bottom' : 'top');
|
|
@@ -85,9 +85,10 @@ input[type=radio].micl-radio {
|
|
|
85
85
|
background-size 3000ms,
|
|
86
86
|
--statelayer-opacity var(--md-sys-radio-motion-duration) linear;
|
|
87
87
|
|
|
88
|
-
&:hover
|
|
88
|
+
&:hover,
|
|
89
|
+
&:focus-visible,
|
|
90
|
+
&:active {
|
|
89
91
|
--statelayer-color: var(--md-sys-color-on-surface);
|
|
90
|
-
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
|
|
91
92
|
|
|
92
93
|
&:checked {
|
|
93
94
|
--statelayer-color: var(--md-sys-color-primary);
|
|
@@ -99,38 +100,19 @@ input[type=radio].micl-radio {
|
|
|
99
100
|
border-color: var(--md-sys-color-primary);
|
|
100
101
|
}
|
|
101
102
|
}
|
|
103
|
+
&:hover {
|
|
104
|
+
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
|
|
105
|
+
}
|
|
102
106
|
&:focus-visible {
|
|
103
|
-
--statelayer-color: var(--md-sys-color-on-surface);
|
|
104
107
|
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
|
|
105
108
|
|
|
106
109
|
outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
|
|
107
|
-
|
|
108
|
-
&:checked {
|
|
109
|
-
--statelayer-color: var(--md-sys-color-primary);
|
|
110
|
-
}
|
|
111
|
-
&::after {
|
|
112
|
-
border-color: var(--md-sys-color-on-surface);
|
|
113
|
-
}
|
|
114
|
-
&:checked::after {
|
|
115
|
-
border-color: var(--md-sys-color-primary);
|
|
116
|
-
}
|
|
117
110
|
}
|
|
118
111
|
&:active {
|
|
119
|
-
--statelayer-color: var(--md-sys-color-on-surface);
|
|
120
112
|
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
|
|
121
113
|
|
|
122
114
|
background-size: 0%, 100%;
|
|
123
115
|
transition: background-size 0ms;
|
|
124
|
-
|
|
125
|
-
&:checked {
|
|
126
|
-
--statelayer-color: var(--md-sys-color-primary);
|
|
127
|
-
}
|
|
128
|
-
&::after {
|
|
129
|
-
border-color: var(--md-sys-color-on-surface);
|
|
130
|
-
}
|
|
131
|
-
&:checked::after {
|
|
132
|
-
border-color: var(--md-sys-color-primary);
|
|
133
|
-
}
|
|
134
116
|
}
|
|
135
117
|
}
|
|
136
118
|
&:disabled {
|
|
@@ -97,18 +97,17 @@ export default (() =>
|
|
|
97
97
|
setValue(element);
|
|
98
98
|
setVars(element);
|
|
99
99
|
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
});
|
|
100
|
+
const max = parseFloat(element.max);
|
|
101
|
+
const min = parseFloat(element.min);
|
|
102
|
+
const rect = element.getBoundingClientRect();
|
|
103
|
+
const percentages = getTickValues(element, max, min).sort((a, b) => a - b).map(value => {
|
|
104
|
+
return Math.round(100 * (value - min) / (max - min));
|
|
105
|
+
});
|
|
107
106
|
|
|
108
107
|
if (percentages.length > 0) {
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
const canvas = document.createElement('canvas');
|
|
109
|
+
const ctx = canvas.getContext('2d');
|
|
110
|
+
|
|
112
111
|
if (ctx) {
|
|
113
112
|
ctx.font = window.getComputedStyle(element).getPropertyValue('font');
|
|
114
113
|
let blankWidth = ctx.measureText(blank).width,
|
|
@@ -19,96 +19,135 @@
|
|
|
19
19
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
20
|
// SOFTWARE.
|
|
21
21
|
|
|
22
|
+
type StepperAction = HTMLButtonElement & {
|
|
23
|
+
classList: { contains(token: string): boolean };
|
|
24
|
+
addEventListener(type: 'click', listener: (this: HTMLButtonElement, ev: MouseEvent) => any): void;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
type StepperStep = HTMLElement & {
|
|
28
|
+
dataset : { miclstep?: string };
|
|
29
|
+
nextElementSibling : Element | null;
|
|
30
|
+
previousElementSibling: Element | null;
|
|
31
|
+
};
|
|
32
|
+
|
|
22
33
|
export const stepperSelector = '.micl-stepper';
|
|
23
34
|
|
|
24
35
|
export default (() =>
|
|
25
36
|
{
|
|
26
|
-
const getCurrentStep = (stepper: HTMLElement):
|
|
37
|
+
const getCurrentStep = (stepper: HTMLElement): StepperStep | null =>
|
|
27
38
|
{
|
|
28
|
-
let step = stepper.querySelector('.micl-stepper__step--current') as
|
|
39
|
+
let step = stepper.querySelector('.micl-stepper__step--current') as StepperStep;
|
|
29
40
|
if (step) {
|
|
30
41
|
return step;
|
|
31
42
|
}
|
|
32
|
-
step = stepper.querySelector('.micl-stepper__step') as
|
|
33
|
-
if (
|
|
34
|
-
|
|
43
|
+
step = stepper.querySelector('.micl-stepper__step') as StepperStep;
|
|
44
|
+
if (step) {
|
|
45
|
+
step.classList.add('micl-stepper__step--current');
|
|
35
46
|
}
|
|
36
|
-
step.classList.add('micl-stepper__step--current');
|
|
37
47
|
return step;
|
|
38
48
|
};
|
|
39
49
|
|
|
40
50
|
const endTransitionCurrent = (event: Event): void =>
|
|
41
51
|
{
|
|
42
|
-
|
|
52
|
+
const target = event.currentTarget as Element;
|
|
53
|
+
if ((event as TransitionEvent).propertyName !== 'transform' || !target) {
|
|
43
54
|
return;
|
|
44
55
|
}
|
|
45
|
-
|
|
56
|
+
target.classList.remove(
|
|
46
57
|
'micl-stepper__step--fromcurrent',
|
|
47
58
|
'micl-stepper__step--tocurrent'
|
|
48
59
|
);
|
|
49
|
-
|
|
60
|
+
target.removeEventListener('transitionend', endTransitionCurrent);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const goToSibling = (currentStep: StepperStep, sibling: StepperStep): void =>
|
|
64
|
+
{
|
|
65
|
+
currentStep.addEventListener('transitionend', endTransitionCurrent);
|
|
66
|
+
currentStep.classList.add('micl-stepper__step--fromcurrent');
|
|
67
|
+
currentStep.offsetHeight;
|
|
68
|
+
|
|
69
|
+
sibling.addEventListener('transitionend', endTransitionCurrent);
|
|
70
|
+
sibling.classList.add('micl-stepper__step--tocurrent');
|
|
71
|
+
sibling.offsetHeight;
|
|
72
|
+
|
|
73
|
+
sibling.classList.add('micl-stepper__step--current');
|
|
74
|
+
currentStep.classList.remove('micl-stepper__step--current');
|
|
75
|
+
currentStep.offsetHeight;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const showHideActions = (actions: StepperAction[], step: StepperStep, back: boolean): void =>
|
|
79
|
+
{
|
|
80
|
+
actions.forEach(action =>
|
|
81
|
+
{
|
|
82
|
+
const siblingKey = back ? 'previousElementSibling' : 'nextElementSibling';
|
|
83
|
+
const hasSiblingStep = (step[siblingKey] as Element)?.classList.contains('micl-stepper__step');
|
|
84
|
+
|
|
85
|
+
action.classList.toggle('micl-hidden', !hasSiblingStep);
|
|
86
|
+
});
|
|
50
87
|
};
|
|
51
88
|
|
|
52
|
-
const
|
|
89
|
+
const showHideElements = (stepper: HTMLElement, step: StepperStep): void =>
|
|
53
90
|
{
|
|
54
|
-
|
|
91
|
+
const stepIdentifier = step.dataset.miclstep;
|
|
92
|
+
|
|
93
|
+
stepIdentifier && stepper.querySelectorAll<HTMLElement>('[data-step]').forEach(element =>
|
|
55
94
|
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
'nextElementSibling' : 'previousElementSibling'
|
|
59
|
-
]?.classList.contains('micl-stepper__step'));
|
|
95
|
+
const shouldHide = element.dataset.step !== stepIdentifier;
|
|
96
|
+
element.classList.toggle('micl-hidden', shouldHide);
|
|
60
97
|
});
|
|
61
98
|
};
|
|
62
99
|
|
|
63
|
-
const
|
|
100
|
+
const checkGroupValidity= (parent: HTMLElement | null): boolean =>
|
|
64
101
|
{
|
|
65
|
-
|
|
102
|
+
if (!parent) {
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
const groups = parent.querySelectorAll<HTMLFieldSetElement>(
|
|
106
|
+
'fieldset.micl-checkbox-group[data-miclname]'
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
return Array.from(groups).every(fieldset =>
|
|
66
110
|
{
|
|
67
|
-
|
|
111
|
+
const name = fieldset.dataset.miclname;
|
|
112
|
+
if (!name) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const checkedCount = fieldset.querySelectorAll<HTMLInputElement>(
|
|
116
|
+
`input[type="checkbox"][name="${name}"]:checked`
|
|
117
|
+
).length;
|
|
118
|
+
|
|
119
|
+
return checkedCount > 0;
|
|
68
120
|
});
|
|
69
121
|
};
|
|
70
122
|
|
|
71
123
|
const checkStepValidity = (stepper: HTMLElement): HTMLElement | null =>
|
|
72
124
|
{
|
|
73
|
-
|
|
74
|
-
if (currentStep) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
{
|
|
79
|
-
if (!input.checkValidity()) {
|
|
80
|
-
currentStep = null;
|
|
81
|
-
}
|
|
82
|
-
});
|
|
125
|
+
const currentStep = getCurrentStep(stepper);
|
|
126
|
+
if (!currentStep) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
let isValid = true;
|
|
83
130
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
if (nrChecked === 0) {
|
|
98
|
-
console.log("NOT ENGOUGH CHECKS");
|
|
99
|
-
}
|
|
100
|
-
});
|
|
131
|
+
currentStep.querySelectorAll<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>(
|
|
132
|
+
'input,select,textarea'
|
|
133
|
+
).forEach(element =>
|
|
134
|
+
{
|
|
135
|
+
if (!element.checkValidity()) {
|
|
136
|
+
isValid = false;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
if (!checkGroupValidity(currentStep)) {
|
|
141
|
+
isValid = false;
|
|
101
142
|
}
|
|
102
|
-
|
|
143
|
+
|
|
144
|
+
return isValid ? currentStep : null;
|
|
103
145
|
};
|
|
104
146
|
|
|
105
147
|
return {
|
|
106
148
|
initialize: (stepper: HTMLElement): void =>
|
|
107
149
|
{
|
|
108
|
-
if (
|
|
109
|
-
!stepper.matches(stepperSelector)
|
|
110
|
-
|| stepper.dataset.miclinitialized
|
|
111
|
-
) {
|
|
150
|
+
if (!stepper.matches(stepperSelector) || stepper.dataset.miclinitialized) {
|
|
112
151
|
return;
|
|
113
152
|
}
|
|
114
153
|
stepper.dataset.miclinitialized = '1';
|
|
@@ -118,46 +157,70 @@ export default (() =>
|
|
|
118
157
|
step.dataset.miclstep = `${index + 1}`;
|
|
119
158
|
});
|
|
120
159
|
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
160
|
+
const step = getCurrentStep(stepper);
|
|
161
|
+
const backActions = Array.from(stepper.querySelectorAll<StepperAction>(
|
|
162
|
+
'button.micl-stepper--goback'
|
|
163
|
+
));
|
|
164
|
+
const nextActions = Array.from(stepper.querySelectorAll<StepperAction>(
|
|
165
|
+
'button.micl-stepper--gonext'
|
|
166
|
+
));
|
|
167
|
+
|
|
168
|
+
if (step) {
|
|
169
|
+
showHideActions(backActions, step, true);
|
|
170
|
+
showHideActions(nextActions, step, false);
|
|
171
|
+
showHideElements(stepper, step);
|
|
172
|
+
}
|
|
128
173
|
|
|
129
|
-
|
|
174
|
+
backActions.forEach(action =>
|
|
130
175
|
{
|
|
131
|
-
action.addEventListener('click', () =>
|
|
176
|
+
action.addEventListener('click', (event: Event) =>
|
|
132
177
|
{
|
|
133
|
-
const currentStep =
|
|
178
|
+
const currentStep = getCurrentStep(stepper);
|
|
134
179
|
if (!currentStep) {
|
|
135
180
|
return;
|
|
136
181
|
}
|
|
137
|
-
const
|
|
138
|
-
goNext = action.classList.contains('micl-stepper--gonext'),
|
|
139
|
-
sibling = currentStep[
|
|
140
|
-
goNext ? 'nextElementSibling' : 'previousElementSibling'
|
|
141
|
-
] as HTMLElement;
|
|
182
|
+
const sibling = currentStep['previousElementSibling'] as StepperStep;
|
|
142
183
|
|
|
143
184
|
if (sibling?.classList.contains('micl-stepper__step')) {
|
|
144
|
-
currentStep
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
185
|
+
goToSibling(currentStep, sibling);
|
|
186
|
+
showHideActions(backActions, sibling, true);
|
|
187
|
+
showHideElements(stepper, sibling);
|
|
188
|
+
}
|
|
189
|
+
}, true);
|
|
190
|
+
});
|
|
191
|
+
nextActions.forEach(action =>
|
|
192
|
+
{
|
|
193
|
+
action.addEventListener('click', (event: Event) =>
|
|
194
|
+
{
|
|
195
|
+
const currentStep = checkStepValidity(stepper);
|
|
196
|
+
if (!currentStep) {
|
|
197
|
+
event.stopImmediatePropagation();
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
const sibling = currentStep['nextElementSibling'] as StepperStep;
|
|
155
201
|
|
|
156
|
-
|
|
202
|
+
if (sibling?.classList.contains('micl-stepper__step')) {
|
|
203
|
+
goToSibling(currentStep, sibling);
|
|
204
|
+
showHideActions(nextActions, sibling, false);
|
|
157
205
|
showHideElements(stepper, sibling);
|
|
158
206
|
}
|
|
159
|
-
});
|
|
207
|
+
}, true);
|
|
160
208
|
});
|
|
209
|
+
|
|
210
|
+
if (stepper instanceof HTMLFormElement) {
|
|
211
|
+
stepper.addEventListener('submit', (event: SubmitEvent) =>
|
|
212
|
+
{
|
|
213
|
+
if (!event.submitter?.classList.contains('micl-form--dosubmit')) {
|
|
214
|
+
event.preventDefault();
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const isValid = stepper.checkValidity() && checkGroupValidity(stepper);
|
|
218
|
+
if (!isValid) {
|
|
219
|
+
event.stopImmediatePropagation();
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
}, true);
|
|
223
|
+
}
|
|
161
224
|
}
|
|
162
225
|
};
|
|
163
226
|
})();
|
|
@@ -84,10 +84,9 @@ export default (() =>
|
|
|
84
84
|
if (input instanceof HTMLSelectElement) {
|
|
85
85
|
input.addEventListener('mousedown', () =>
|
|
86
86
|
{
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
roomBelow = window.innerHeight - rect.bottom;
|
|
87
|
+
const rect = input.getBoundingClientRect();
|
|
88
|
+
const roomAbove = rect.top;
|
|
89
|
+
const roomBelow = window.innerHeight - rect.bottom;
|
|
91
90
|
|
|
92
91
|
!input.matches(':open') && input.style.setProperty(
|
|
93
92
|
'--md-sys-select-picker-origin',
|
package/dist/alert.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--md-sys-shape-corner-none: 0px;--md-sys-shape-corner-extra-small: 4px;--md-sys-shape-corner-small: 8px;--md-sys-shape-corner-medium: 12px;--md-sys-shape-corner-large: 16px;--md-sys-shape-corner-large-increased: 20px;--md-sys-shape-corner-extra-large: 28px;--md-sys-shape-corner-extra-large-increased: 32px;--md-sys-shape-corner-extra-extra-large: 48px;--md-sys-shape-corner-full: 50%}:root{--md-ref-typeface-plain: Roboto, system-ui, sans-serif;--md-ref-typeface-brand: Roboto, system-ui, sans-serif;--md-ref-typeface-weight-regular: 400;--md-ref-typeface-weight-medium: 500;--md-ref-typeface-weight-bold: 700;--md-sys-typescale-display-large-font: var(--md-ref-typeface-brand);--md-sys-typescale-display-large-size: 3.5625rem;--md-sys-typescale-display-large-line-height: 4rem;--md-sys-typescale-display-large-weight: var(--md-ref-typeface-weight-regular);--md-sys-typescale-display-large-tracking: -0.015625rem;--md-sys-typescale-display-medium-font: var(--md-ref-typeface-brand);--md-sys-typescale-display-medium-size: 2.8125rem;--md-sys-typescale-display-medium-line-height: 3.25rem;--md-sys-typescale-display-medium-weight: var(--md-ref-typeface-weight-regular);--md-sys-typescale-display-medium-tracking: 0;--md-sys-typescale-display-small-font: var(--md-ref-typeface-brand);--md-sys-typescale-display-small-size: 2.25rem;--md-sys-typescale-display-small-line-height: 2.75rem;--md-sys-typescale-display-small-weight: var(--md-ref-typeface-weight-regular);--md-sys-typescale-display-small-tracking: 0;--md-sys-typescale-headline-large-font: var(--md-ref-typeface-brand);--md-sys-typescale-headline-large-size: 2rem;--md-sys-typescale-headline-large-line-height: 2.5rem;--md-sys-typescale-headline-large-weight: var(--md-ref-typeface-weight-regular);--md-sys-typescale-headline-large-tracking: 0;--md-sys-typescale-headline-medium-font: var(--md-ref-typeface-brand);--md-sys-typescale-headline-medium-size: 1.75rem;--md-sys-typescale-headline-medium-line-height: 2.25rem;--md-sys-typescale-headline-medium-weight: var(--md-ref-typeface-weight-regular);--md-sys-typescale-headline-medium-tracking: 0;--md-sys-typescale-headline-small-font: var(--md-ref-typeface-brand);--md-sys-typescale-headline-small-size: 1.5rem;--md-sys-typescale-headline-small-line-height: 2rem;--md-sys-typescale-headline-small-weight: var(--md-ref-typeface-weight-regular);--md-sys-typescale-headline-small-tracking: 0;--md-sys-typescale-title-large-font: var(--md-ref-typeface-brand);--md-sys-typescale-title-large-size: 1.375rem;--md-sys-typescale-title-large-line-height: 1.75rem;--md-sys-typescale-title-large-weight: var(--md-ref-typeface-weight-regular);--md-sys-typescale-title-large-tracking: 0;--md-sys-typescale-title-medium-font: var(--md-ref-typeface-plain);--md-sys-typescale-title-medium-size: 1rem;--md-sys-typescale-title-medium-line-height: 1.5rem;--md-sys-typescale-title-medium-weight: var(--md-ref-typeface-weight-medium);--md-sys-typescale-title-medium-tracking: 0,009375rem;--md-sys-typescale-title-small-font: var(--md-ref-typeface-plain);--md-sys-typescale-title-small-size: 0.875rem;--md-sys-typescale-title-small-line-height: 1.25rem;--md-sys-typescale-title-small-weight: var(--md-ref-typeface-weight-medium);--md-sys-typescale-title-small-tracking: 0.00625rem;--md-sys-typescale-body-large-font: var(--md-ref-typeface-plain);--md-sys-typescale-body-large-size: 1rem;--md-sys-typescale-body-large-line-height: 1.5rem;--md-sys-typescale-body-large-weight: var(--md-ref-typeface-weight-regular);--md-sys-typescale-body-large-tracking: 0.03125rem;--md-sys-typescale-body-medium-font: var(--md-ref-typeface-plain);--md-sys-typescale-body-medium-size: 0.875rem;--md-sys-typescale-body-medium-line-height: 1.25rem;--md-sys-typescale-body-medium-weight: var(--md-ref-typeface-weight-regular);--md-sys-typescale-body-medium-tracking: 0.015625rem;--md-sys-typescale-body-small-font: var(--md-ref-typeface-plain);--md-sys-typescale-body-small-size: 0.75rem;--md-sys-typescale-body-small-line-height: 1rem;--md-sys-typescale-body-small-weight: var(--md-ref-typeface-weight-regular);--md-sys-typescale-body-small-tracking: 0.025rem;--md-sys-typescale-label-large-font: var(--md-ref-typeface-plain);--md-sys-typescale-label-large-size: 0.875rem;--md-sys-typescale-label-large-line-height: 1.25rem;--md-sys-typescale-label-large-weight: var(--md-ref-typeface-weight-medium);--md-sys-typescale-label-large-tracking: 0.00625rem;--md-sys-typescale-label-medium-font: var(--md-ref-typeface-plain);--md-sys-typescale-label-medium-size: 0.75rem;--md-sys-typescale-label-medium-line-height: 1rem;--md-sys-typescale-label-medium-weight: var(--md-ref-typeface-weight-medium);--md-sys-typescale-label-medium-tracking: 0.03125rem;--md-sys-typescale-label-small-font: var(--md-ref-typeface-plain);--md-sys-typescale-label-small-size: 0.6875rem;--md-sys-typescale-label-small-line-height: 1rem;--md-sys-typescale-label-small-weight: var(--md-ref-typeface-weight-medium);--md-sys-typescale-label-small-tracking: 0.03125rem;--md-sys-typescale-emphasized-display-large-font: var(--md-ref-typeface-brand);--md-sys-typescale-emphasized-display-large-size: 3.5625rem;--md-sys-typescale-emphasized-display-large-line-height: 4rem;--md-sys-typescale-emphasized-display-large-weight: var(--md-ref-typeface-weight-medium);--md-sys-typescale-emphasized-display-large-tracking: -0.015625rem;--md-sys-typescale-emphasized-display-medium-font: var(--md-ref-typeface-brand);--md-sys-typescale-emphasized-display-medium-size: 2.8125rem;--md-sys-typescale-emphasized-display-medium-line-height: 3.25rem;--md-sys-typescale-emphasized-display-medium-weight: var(--md-ref-typeface-weight-medium);--md-sys-typescale-emphasized-display-medium-tracking: 0;--md-sys-typescale-emphasized-display-small-font: var(--md-ref-typeface-brand);--md-sys-typescale-emphasized-display-small-size: 2.25rem;--md-sys-typescale-emphasized-display-small-line-height: 2.75rem;--md-sys-typescale-emphasized-display-small-weight: var(--md-ref-typeface-weight-medium);--md-sys-typescale-emphasized-display-small-tracking: 0;--md-sys-typescale-emphasized-headline-large-font: var(--md-ref-typeface-brand);--md-sys-typescale-emphasized-headline-large-size: 2rem;--md-sys-typescale-emphasized-headline-large-line-height: 2.5rem;--md-sys-typescale-emphasized-headline-large-weight: var(--md-ref-typeface-weight-medium);--md-sys-typescale-emphasized-headline-large-tracking: 0;--md-sys-typescale-emphasized-headline-medium-font: var(--md-ref-typeface-brand);--md-sys-typescale-emphasized-headline-medium-size: 1.75rem;--md-sys-typescale-emphasized-headline-medium-line-height: 2.25rem;--md-sys-typescale-emphasized-headline-medium-weight: var(--md-ref-typeface-weight-medium);--md-sys-typescale-emphasized-headline-medium-tracking: 0;--md-sys-typescale-emphasized-headline-small-font: var(--md-ref-typeface-brand);--md-sys-typescale-emphasized-headline-small-size: 1.5rem;--md-sys-typescale-emphasized-headline-small-line-height: 2rem;--md-sys-typescale-emphasized-headline-small-weight: var(--md-ref-typeface-weight-medium);--md-sys-typescale-emphasized-headline-small-tracking: 0;--md-sys-typescale-emphasized-title-large-font: var(--md-ref-typeface-brand);--md-sys-typescale-emphasized-title-large-size: 1.375rem;--md-sys-typescale-emphasized-title-large-line-height: 1.75rem;--md-sys-typescale-emphasized-title-large-weight: var(--md-ref-typeface-weight-medium);--md-sys-typescale-emphasized-title-large-tracking: 0;--md-sys-typescale-emphasized-title-medium-font: var(--md-ref-typeface-plain);--md-sys-typescale-emphasized-title-medium-size: 1rem;--md-sys-typescale-emphasized-title-medium-line-height: 1.5rem;--md-sys-typescale-emphasized-title-medium-weight: var(--md-ref-typeface-weight-bold);--md-sys-typescale-emphasized-title-medium-tracking: 0,009375rem;--md-sys-typescale-emphasized-title-small-font: var(--md-ref-typeface-plain);--md-sys-typescale-emphasized-title-small-size: 0.875rem;--md-sys-typescale-emphasized-title-small-line-height: 1.25rem;--md-sys-typescale-emphasized-title-small-weight: var(--md-ref-typeface-weight-bold);--md-sys-typescale-emphasized-title-small-tracking: 0.00625rem;--md-sys-typescale-emphasized-body-large-font: var(--md-ref-typeface-plain);--md-sys-typescale-emphasized-body-large-size: 1rem;--md-sys-typescale-emphasized-body-large-line-height: 1.5rem;--md-sys-typescale-emphasized-body-large-weight: var(--md-ref-typeface-weight-medium);--md-sys-typescale-emphasized-body-large-tracking: 0.03125rem;--md-sys-typescale-emphasized-body-medium-font: var(--md-ref-typeface-plain);--md-sys-typescale-emphasized-body-medium-size: 0.875rem;--md-sys-typescale-emphasized-body-medium-line-height: 1.25rem;--md-sys-typescale-emphasized-body-medium-weight: var(--md-ref-typeface-weight-medium);--md-sys-typescale-emphasized-body-medium-tracking: 0.015625rem;--md-sys-typescale-emphasized-body-small-font: var(--md-ref-typeface-plain);--md-sys-typescale-emphasized-body-small-size: 0.75rem;--md-sys-typescale-emphasized-body-small-line-height: 1rem;--md-sys-typescale-emphasized-body-small-weight: var(--md-ref-typeface-weight-medium);--md-sys-typescale-emphasized-body-small-tracking: 0.025rem;--md-sys-typescale-emphasized-label-large-font: var(--md-ref-typeface-plain);--md-sys-typescale-emphasized-label-large-size: 0.875rem;--md-sys-typescale-emphasized-label-large-line-height: 1.25rem;--md-sys-typescale-emphasized-label-large-weight: var(--md-ref-typeface-weight-bold);--md-sys-typescale-emphasized-label-large-tracking: 0.00625rem;--md-sys-typescale-emphasized-label-medium-font: var(--md-ref-typeface-plain);--md-sys-typescale-emphasized-label-medium-size: 0.75rem;--md-sys-typescale-emphasized-label-medium-line-height: 1rem;--md-sys-typescale-emphasized-label-medium-weight: var(--md-ref-typeface-weight-bold);--md-sys-typescale-emphasized-label-medium-tracking: 0.03125rem;--md-sys-typescale-emphasized-label-small-font: var(--md-ref-typeface-plain);--md-sys-typescale-emphasized-label-small-size: 0.6875rem;--md-sys-typescale-emphasized-label-small-line-height: 1rem;--md-sys-typescale-emphasized-label-small-weight: var(--md-ref-typeface-weight-bold);--md-sys-typescale-emphasized-label-small-tracking: 0.03125rem}.md-sys-typescale-display-large{font-family:var(--md-sys-typescale-display-large-font);font-size:var(--md-sys-typescale-display-large-size);line-height:var(--md-sys-typescale-display-large-line-height);font-weight:var(--md-sys-typescale-display-large-weight);letter-spacing:var(--md-sys-typescale-display-large-tracking)}.md-sys-typescale-display-medium{font-family:var(--md-sys-typescale-display-medium-font);font-size:var(--md-sys-typescale-display-medium-size);line-height:var(--md-sys-typescale-display-medium-line-height);font-weight:var(--md-sys-typescale-display-medium-weight);letter-spacing:var(--md-sys-typescale-display-medium-tracking)}.md-sys-typescale-display-small{font-family:var(--md-sys-typescale-display-small-font);font-size:var(--md-sys-typescale-display-small-size);line-height:var(--md-sys-typescale-display-small-line-height);font-weight:var(--md-sys-typescale-display-small-weight);letter-spacing:var(--md-sys-typescale-display-small-tracking)}.md-sys-typescale-headline-large{font-family:var(--md-sys-typescale-headline-large-font);font-size:var(--md-sys-typescale-headline-large-size);line-height:var(--md-sys-typescale-headline-large-line-height);font-weight:var(--md-sys-typescale-headline-large-weight);letter-spacing:var(--md-sys-typescale-headline-large-tracking)}.md-sys-typescale-headline-medium{font-family:var(--md-sys-typescale-headline-medium-font);font-size:var(--md-sys-typescale-headline-medium-size);line-height:var(--md-sys-typescale-headline-medium-line-height);font-weight:var(--md-sys-typescale-headline-medium-weight);letter-spacing:var(--md-sys-typescale-headline-medium-tracking)}.md-sys-typescale-headline-small{font-family:var(--md-sys-typescale-headline-small-font);font-size:var(--md-sys-typescale-headline-small-size);line-height:var(--md-sys-typescale-headline-small-line-height);font-weight:var(--md-sys-typescale-headline-small-weight);letter-spacing:var(--md-sys-typescale-headline-small-tracking)}.md-sys-typescale-title-large{font-family:var(--md-sys-typescale-title-large-font);font-size:var(--md-sys-typescale-title-large-size);line-height:var(--md-sys-typescale-title-large-line-height);font-weight:var(--md-sys-typescale-title-large-weight);letter-spacing:var(--md-sys-typescale-title-large-tracking)}.md-sys-typescale-title-medium{font-family:var(--md-sys-typescale-title-medium-font);font-size:var(--md-sys-typescale-title-medium-size);line-height:var(--md-sys-typescale-title-medium-line-height);font-weight:var(--md-sys-typescale-title-medium-weight);letter-spacing:var(--md-sys-typescale-title-medium-tracking)}.md-sys-typescale-title-small{font-family:var(--md-sys-typescale-title-small-font);font-size:var(--md-sys-typescale-title-small-size);line-height:var(--md-sys-typescale-title-small-line-height);font-weight:var(--md-sys-typescale-title-small-weight);letter-spacing:var(--md-sys-typescale-title-small-tracking)}.md-sys-typescale-body-large{font-family:var(--md-sys-typescale-body-large-font);font-size:var(--md-sys-typescale-body-large-size);line-height:var(--md-sys-typescale-body-large-line-height);font-weight:var(--md-sys-typescale-body-large-weight);letter-spacing:var(--md-sys-typescale-body-large-tracking)}.md-sys-typescale-body-medium{font-family:var(--md-sys-typescale-body-medium-font);font-size:var(--md-sys-typescale-body-medium-size);line-height:var(--md-sys-typescale-body-medium-line-height);font-weight:var(--md-sys-typescale-body-medium-weight);letter-spacing:var(--md-sys-typescale-body-medium-tracking)}.md-sys-typescale-body-small{font-family:var(--md-sys-typescale-body-small-font);font-size:var(--md-sys-typescale-body-small-size);line-height:var(--md-sys-typescale-body-small-line-height);font-weight:var(--md-sys-typescale-body-small-weight);letter-spacing:var(--md-sys-typescale-body-small-tracking)}.md-sys-typescale-label-large{font-family:var(--md-sys-typescale-label-large-font);font-size:var(--md-sys-typescale-label-large-size);line-height:var(--md-sys-typescale-label-large-line-height);font-weight:var(--md-sys-typescale-label-large-weight);letter-spacing:var(--md-sys-typescale-label-large-tracking)}.md-sys-typescale-label-medium{font-family:var(--md-sys-typescale-label-medium-font);font-size:var(--md-sys-typescale-label-medium-size);line-height:var(--md-sys-typescale-label-medium-line-height);font-weight:var(--md-sys-typescale-label-medium-weight);letter-spacing:var(--md-sys-typescale-label-medium-tracking)}.md-sys-typescale-label-small{font-family:var(--md-sys-typescale-label-small-font);font-size:var(--md-sys-typescale-label-small-size);line-height:var(--md-sys-typescale-label-small-line-height);font-weight:var(--md-sys-typescale-label-small-weight);letter-spacing:var(--md-sys-typescale-label-small-tracking)}.md-sys-typescale-emphasized-display-large{font-family:var(--md-sys-typescale-emphasized-display-large-font);font-size:var(--md-sys-typescale-emphasized-display-large-size);line-height:var(--md-sys-typescale-emphasized-display-large-line-height);font-weight:var(--md-sys-typescale-emphasized-display-large-weight);letter-spacing:var(--md-sys-typescale-emphasized-display-large-tracking)}.md-sys-typescale-emphasized-display-medium{font-family:var(--md-sys-typescale-emphasized-display-medium-font);font-size:var(--md-sys-typescale-emphasized-display-medium-size);line-height:var(--md-sys-typescale-emphasized-display-medium-line-height);font-weight:var(--md-sys-typescale-emphasized-display-medium-weight);letter-spacing:var(--md-sys-typescale-emphasized-display-medium-tracking)}.md-sys-typescale-emphasized-display-small{font-family:var(--md-sys-typescale-emphasized-display-small-font);font-size:var(--md-sys-typescale-emphasized-display-small-size);line-height:var(--md-sys-typescale-emphasized-display-small-line-height);font-weight:var(--md-sys-typescale-emphasized-display-small-weight);letter-spacing:var(--md-sys-typescale-emphasized-display-small-tracking)}.md-sys-typescale-emphasized-headline-large{font-family:var(--md-sys-typescale-emphasized-headline-large-font);font-size:var(--md-sys-typescale-emphasized-headline-large-size);line-height:var(--md-sys-typescale-emphasized-headline-large-line-height);font-weight:var(--md-sys-typescale-emphasized-headline-large-weight);letter-spacing:var(--md-sys-typescale-emphasized-headline-large-tracking)}.md-sys-typescale-emphasized-headline-medium{font-family:var(--md-sys-typescale-emphasized-headline-medium-font);font-size:var(--md-sys-typescale-emphasized-headline-medium-size);line-height:var(--md-sys-typescale-emphasized-headline-medium-line-height);font-weight:var(--md-sys-typescale-emphasized-headline-medium-weight);letter-spacing:var(--md-sys-typescale-emphasized-headline-medium-tracking)}.md-sys-typescale-emphasized-headline-small{font-family:var(--md-sys-typescale-emphasized-headline-small-font);font-size:var(--md-sys-typescale-emphasized-headline-small-size);line-height:var(--md-sys-typescale-emphasized-headline-small-line-height);font-weight:var(--md-sys-typescale-emphasized-headline-small-weight);letter-spacing:var(--md-sys-typescale-emphasized-headline-small-tracking)}.md-sys-typescale-emphasized-title-large{font-family:var(--md-sys-typescale-emphasized-title-large-font);font-size:var(--md-sys-typescale-emphasized-title-large-size);line-height:var(--md-sys-typescale-emphasized-title-large-line-height);font-weight:var(--md-sys-typescale-emphasized-title-large-weight);letter-spacing:var(--md-sys-typescale-emphasized-title-large-tracking)}.md-sys-typescale-emphasized-title-medium{font-family:var(--md-sys-typescale-emphasized-title-medium-font);font-size:var(--md-sys-typescale-emphasized-title-medium-size);line-height:var(--md-sys-typescale-emphasized-title-medium-line-height);font-weight:var(--md-sys-typescale-emphasized-title-medium-weight);letter-spacing:var(--md-sys-typescale-emphasized-title-medium-tracking)}.md-sys-typescale-emphasized-title-small{font-family:var(--md-sys-typescale-emphasized-title-small-font);font-size:var(--md-sys-typescale-emphasized-title-small-size);line-height:var(--md-sys-typescale-emphasized-title-small-line-height);font-weight:var(--md-sys-typescale-emphasized-title-small-weight);letter-spacing:var(--md-sys-typescale-emphasized-title-small-tracking)}.md-sys-typescale-emphasized-body-large{font-family:var(--md-sys-typescale-emphasized-body-large-font);font-size:var(--md-sys-typescale-emphasized-body-large-size);line-height:var(--md-sys-typescale-emphasized-body-large-line-height);font-weight:var(--md-sys-typescale-emphasized-body-large-weight);letter-spacing:var(--md-sys-typescale-emphasized-body-large-tracking)}.md-sys-typescale-emphasized-body-medium{font-family:var(--md-sys-typescale-emphasized-body-medium-font);font-size:var(--md-sys-typescale-emphasized-body-medium-size);line-height:var(--md-sys-typescale-emphasized-body-medium-line-height);font-weight:var(--md-sys-typescale-emphasized-body-medium-weight);letter-spacing:var(--md-sys-typescale-emphasized-body-medium-tracking)}.md-sys-typescale-emphasized-body-small{font-family:var(--md-sys-typescale-emphasized-body-small-font);font-size:var(--md-sys-typescale-emphasized-body-small-size);line-height:var(--md-sys-typescale-emphasized-body-small-line-height);font-weight:var(--md-sys-typescale-emphasized-body-small-weight);letter-spacing:var(--md-sys-typescale-emphasized-body-small-tracking)}.md-sys-typescale-emphasized-label-large{font-family:var(--md-sys-typescale-emphasized-label-large-font);font-size:var(--md-sys-typescale-emphasized-label-large-size);line-height:var(--md-sys-typescale-emphasized-label-large-line-height);font-weight:var(--md-sys-typescale-emphasized-label-large-weight);letter-spacing:var(--md-sys-typescale-emphasized-label-large-tracking)}.md-sys-typescale-emphasized-label-medium{font-family:var(--md-sys-typescale-emphasized-label-medium-font);font-size:var(--md-sys-typescale-emphasized-label-medium-size);line-height:var(--md-sys-typescale-emphasized-label-medium-line-height);font-weight:var(--md-sys-typescale-emphasized-label-medium-weight);letter-spacing:var(--md-sys-typescale-emphasized-label-medium-tracking)}.md-sys-typescale-emphasized-label-small{font-family:var(--md-sys-typescale-emphasized-label-small-font);font-size:var(--md-sys-typescale-emphasized-label-small-size);line-height:var(--md-sys-typescale-emphasized-label-small-line-height);font-weight:var(--md-sys-typescale-emphasized-label-small-weight);letter-spacing:var(--md-sys-typescale-emphasized-label-small-tracking)}:root{--md-sys-alert-padding: 16px;--md-sys-alert-space: 16px}.micl-alert-filled,.micl-alert-tonal,.micl-alert-outlined{--md-sys-alert-background-color: inherit;--md-sys-alert-color: inherit;box-sizing:border-box;display:flex;inline-size:100%;padding:var(--md-sys-alert-padding, 16px);column-gap:var(--md-sys-alert-space, 8px);border:none;outline:none;border-radius:var(--md-sys-shape-corner-small, 8px);background-color:var(--md-sys-alert-background-color);color:var(--md-sys-alert-color)}.micl-alert-filled .micl-alert__icon,.micl-alert-tonal .micl-alert__icon,.micl-alert-outlined .micl-alert__icon{block-size:var(--md-sys-layout-icon-size, 24px);inline-size:var(--md-sys-layout-icon-size, 24px);font-size:var(--md-sys-layout-icon-size, 24px)}.micl-alert-filled .micl-alert__text,.micl-alert-tonal .micl-alert__text,.micl-alert-outlined .micl-alert__text{display:flex;flex-direction:column;row-gap:8px}.micl-alert-filled .micl-alert__text h1,.micl-alert-filled .micl-alert__text h2,.micl-alert-filled .micl-alert__text h3,.micl-alert-filled .micl-alert__text h4,.micl-alert-filled .micl-alert__text h5,.micl-alert-filled .micl-alert__text h6,.micl-alert-filled .micl-alert__text .micl-heading,.micl-alert-tonal .micl-alert__text h1,.micl-alert-tonal .micl-alert__text h2,.micl-alert-tonal .micl-alert__text h3,.micl-alert-tonal .micl-alert__text h4,.micl-alert-tonal .micl-alert__text h5,.micl-alert-tonal .micl-alert__text h6,.micl-alert-tonal .micl-alert__text .micl-heading,.micl-alert-outlined .micl-alert__text h1,.micl-alert-outlined .micl-alert__text h2,.micl-alert-outlined .micl-alert__text h3,.micl-alert-outlined .micl-alert__text h4,.micl-alert-outlined .micl-alert__text h5,.micl-alert-outlined .micl-alert__text h6,.micl-alert-outlined .micl-alert__text .micl-heading{font-family:var(--md-sys-typescale-title-medium-font);font-size:var(--md-sys-typescale-title-medium-size);line-height:var(--md-sys-typescale-title-medium-line-height);font-weight:var(--md-sys-typescale-title-medium-weight);letter-spacing:var(--md-sys-typescale-title-medium-tracking);margin:0}.micl-alert-filled .micl-alert__text .micl-alert__supporting-text,.micl-alert-tonal .micl-alert__text .micl-alert__supporting-text,.micl-alert-outlined .micl-alert__text .micl-alert__supporting-text{font-family:var(--md-sys-typescale-body-medium-font);font-size:var(--md-sys-typescale-body-medium-size);line-height:var(--md-sys-typescale-body-medium-line-height);font-weight:var(--md-sys-typescale-body-medium-weight);letter-spacing:var(--md-sys-typescale-body-medium-tracking);margin:0}.micl-alert-filled{--md-sys-alert-background-color: var(--md-sys-color-error);--md-sys-alert-color: var(--md-sys-color-on-error)}.micl-alert-filled.micl-alert--primary{--md-sys-alert-background-color: var(--md-sys-color-primary);--md-sys-alert-color: var(--md-sys-color-on-primary)}.micl-alert-filled.micl-alert--secondary{--md-sys-alert-background-color: var(--md-sys-color-secondary);--md-sys-alert-color: var(--md-sys-color-on-secondary)}.micl-alert-filled.micl-alert--tertiary{--md-sys-alert-background-color: var(--md-sys-color-tertiary);--md-sys-alert-color: var(--md-sys-color-on-tertiary)}.micl-alert-tonal{--md-sys-alert-background-color: var(--md-sys-color-error-container);--md-sys-alert-color: var(--md-sys-color-on-error-container)}.micl-alert-tonal.micl-alert--primary{--md-sys-alert-background-color: var(--md-sys-color-primary-container);--md-sys-alert-color: var(--md-sys-color-on-primary-container)}.micl-alert-tonal.micl-alert--secondary{--md-sys-alert-background-color: var(--md-sys-color-secondary-container);--md-sys-alert-color: var(--md-sys-color-on-secondary-container)}.micl-alert-tonal.micl-alert--tertiary{--md-sys-alert-background-color: var(--md-sys-color-tertiary-container);--md-sys-alert-color: var(--md-sys-color-on-tertiary-container)}.micl-alert-outlined{--md-sys-alert-color: var(--md-sys-color-error);border:1px solid var(--md-sys-alert-color)}.micl-alert-outlined.micl-alert--primary{--md-sys-alert-color: var(--md-sys-color-primary)}.micl-alert-outlined.micl-alert--secondary{--md-sys-alert-color: var(--md-sys-color-secondary)}.micl-alert-outlined.micl-alert--tertiary{--md-sys-alert-color: var(--md-sys-color-tertiary)}
|
package/dist/alert.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.micl=o():e.micl=o()}(self,()=>(()=>{"use strict";var e={};return(e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e),e})());
|