@maggioli-design-system/mds-push-notification 1.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/dist/cjs/index-04ec0413.js +1642 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/mds-push-notification.cjs.entry.js +34 -0
- package/dist/cjs/mds-push-notification.cjs.js +23 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/common/aria.js +29 -0
- package/dist/collection/common/file.js +48 -0
- package/dist/collection/common/icon.js +15 -0
- package/dist/collection/common/keyboard-manager.js +40 -0
- package/dist/collection/common/unit.js +22 -0
- package/dist/collection/common/yugop/core.js +16 -0
- package/dist/collection/common/yugop/index.js +3 -0
- package/dist/collection/common/yugop/random-text.js +59 -0
- package/dist/collection/common/yugop/utils/math.js +11 -0
- package/dist/collection/common/yugop/utils/noop.js +1 -0
- package/dist/collection/common/yugop/utils/prng.js +21 -0
- package/dist/collection/common/yugop/utils/string.js +2 -0
- package/dist/collection/components/mds-push-notification/mds-push-notification.css +668 -0
- package/dist/collection/components/mds-push-notification/mds-push-notification.js +202 -0
- package/dist/collection/components/mds-push-notification/meta/dictionary.js +5 -0
- package/dist/collection/components/mds-push-notification/meta/types.js +1 -0
- package/dist/collection/components/mds-push-notification/test/mds-push-notification.e2e.js +9 -0
- package/dist/collection/components/mds-push-notification/test/mds-push-notification.spec.js +23 -0
- package/dist/collection/components/mds-push-notification/test/mds-push-notification.stories.js +105 -0
- package/dist/collection/dictionary/autocomplete.js +59 -0
- package/dist/collection/dictionary/button.js +30 -0
- package/dist/collection/dictionary/color.js +19 -0
- package/dist/collection/dictionary/file-extensions.js +64 -0
- package/dist/collection/dictionary/floating-ui.js +19 -0
- package/dist/collection/dictionary/icon.js +10 -0
- package/dist/collection/dictionary/input.js +37 -0
- package/dist/collection/dictionary/loading.js +5 -0
- package/dist/collection/dictionary/text.js +6 -0
- package/dist/collection/dictionary/typography.js +67 -0
- package/dist/collection/dictionary/variant.js +90 -0
- package/dist/collection/fixtures/cities.js +110 -0
- package/dist/collection/fixtures/filenames.js +57 -0
- package/dist/collection/interface/input-value.js +1 -0
- package/dist/collection/type/autocomplete.js +1 -0
- package/dist/collection/type/button.js +1 -0
- package/dist/collection/type/file-types.js +1 -0
- package/dist/collection/type/floating-ui.js +1 -0
- package/dist/collection/type/form-rel.js +1 -0
- package/dist/collection/type/input.js +1 -0
- package/dist/collection/type/loading.js +1 -0
- package/dist/collection/type/text.js +1 -0
- package/dist/collection/type/typography.js +1 -0
- package/dist/collection/type/variant-file-format.js +111 -0
- package/dist/collection/type/variant.js +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +1 -0
- package/dist/components/mds-push-notification.d.ts +11 -0
- package/dist/components/mds-push-notification.js +57 -0
- package/dist/documentation.d.ts +401 -0
- package/dist/documentation.json +370 -0
- package/dist/esm/index-55392a50.js +1614 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +9 -0
- package/dist/esm/mds-push-notification.entry.js +30 -0
- package/dist/esm/mds-push-notification.js +18 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm-es5/index-55392a50.js +1 -0
- package/dist/esm-es5/index.js +0 -0
- package/dist/esm-es5/loader.js +1 -0
- package/dist/esm-es5/mds-push-notification.entry.js +1 -0
- package/dist/esm-es5/mds-push-notification.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/mds-push-notification/index.esm.js +0 -0
- package/dist/mds-push-notification/mds-push-notification.esm.js +1 -0
- package/dist/mds-push-notification/mds-push-notification.js +127 -0
- package/dist/mds-push-notification/p-34044354.entry.js +1 -0
- package/dist/mds-push-notification/p-50ea2036.system.js +1 -0
- package/dist/mds-push-notification/p-8a9749fc.system.entry.js +1 -0
- package/dist/mds-push-notification/p-8cb59c6e.system.js +1 -0
- package/dist/mds-push-notification/p-a4428770.js +2 -0
- package/dist/mds-push-notification/p-b107cf73.system.js +2 -0
- package/dist/stats.json +835 -0
- package/dist/types/common/aria.d.ts +5 -0
- package/dist/types/common/file.d.ts +12 -0
- package/dist/types/common/icon.d.ts +5 -0
- package/dist/types/common/keyboard-manager.d.ts +11 -0
- package/dist/types/common/unit.d.ts +3 -0
- package/dist/types/common/yugop/core.d.ts +10 -0
- package/dist/types/common/yugop/index.d.ts +1 -0
- package/dist/types/common/yugop/random-text.d.ts +31 -0
- package/dist/types/common/yugop/utils/math.d.ts +3 -0
- package/dist/types/common/yugop/utils/noop.d.ts +1 -0
- package/dist/types/common/yugop/utils/prng.d.ts +8 -0
- package/dist/types/common/yugop/utils/string.d.ts +1 -0
- package/dist/types/components/mds-push-notification/meta/dictionary.d.ts +2 -0
- package/dist/types/components/mds-push-notification/meta/types.d.ts +1 -0
- package/dist/types/components/mds-push-notification/test/mds-push-notification.stories.d.ts +77 -0
- package/dist/types/components.d.ts +105 -0
- package/dist/types/dictionary/autocomplete.d.ts +2 -0
- package/dist/types/dictionary/button.d.ts +6 -0
- package/dist/types/dictionary/color.d.ts +3 -0
- package/dist/types/dictionary/file-extensions.d.ts +11 -0
- package/dist/types/dictionary/floating-ui.d.ts +3 -0
- package/dist/types/dictionary/icon.d.ts +4 -0
- package/dist/types/dictionary/input.d.ts +5 -0
- package/dist/types/dictionary/loading.d.ts +2 -0
- package/dist/types/dictionary/text.d.ts +2 -0
- package/dist/types/dictionary/typography.d.ts +11 -0
- package/dist/types/dictionary/variant.d.ts +11 -0
- package/dist/types/fixtures/cities.d.ts +2 -0
- package/dist/types/fixtures/filenames.d.ts +2 -0
- package/dist/types/interface/input-value.d.ts +4 -0
- package/dist/types/stencil-public-runtime.d.ts +1681 -0
- package/dist/types/type/autocomplete.d.ts +2 -0
- package/dist/types/type/button.d.ts +5 -0
- package/dist/types/type/file-types.d.ts +1 -0
- package/dist/types/type/floating-ui.d.ts +2 -0
- package/dist/types/type/form-rel.d.ts +1 -0
- package/dist/types/type/input.d.ts +4 -0
- package/dist/types/type/loading.d.ts +1 -0
- package/dist/types/type/text.d.ts +1 -0
- package/dist/types/type/typography.d.ts +10 -0
- package/dist/types/type/variant-file-format.d.ts +11 -0
- package/dist/types/type/variant.d.ts +12 -0
- package/documentation.json +788 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +51 -0
- package/readme.md +67 -0
- package/src/common/aria.ts +39 -0
- package/src/common/file.ts +63 -0
- package/src/common/icon.ts +25 -0
- package/src/common/keyboard-manager.ts +46 -0
- package/src/common/unit.ts +33 -0
- package/src/common/yugop/core.ts +47 -0
- package/src/common/yugop/index.ts +4 -0
- package/src/common/yugop/random-text.ts +95 -0
- package/src/common/yugop/utils/math.ts +21 -0
- package/src/common/yugop/utils/noop.ts +1 -0
- package/src/common/yugop/utils/prng.ts +35 -0
- package/src/common/yugop/utils/string.ts +4 -0
- package/src/components/mds-push-notification/.gitlab-ci.yml +25 -0
- package/src/components/mds-push-notification/css/mds-push-notification-variant-label.css +191 -0
- package/src/components/mds-push-notification/css/mds-push-notification-variant-primary.css +20 -0
- package/src/components/mds-push-notification/css/mds-push-notification-variant-state.css +77 -0
- package/src/components/mds-push-notification/mds-push-notification.css +130 -0
- package/src/components/mds-push-notification/mds-push-notification.tsx +84 -0
- package/src/components/mds-push-notification/meta/dictionary.ts +8 -0
- package/src/components/mds-push-notification/meta/types.ts +3 -0
- package/src/components/mds-push-notification/readme.md +42 -0
- package/src/components/mds-push-notification/test/mds-push-notification.e2e.ts +11 -0
- package/src/components/mds-push-notification/test/mds-push-notification.spec.tsx +24 -0
- package/src/components/mds-push-notification/test/mds-push-notification.stories.tsx +137 -0
- package/src/components.d.ts +105 -0
- package/src/dictionary/autocomplete.ts +62 -0
- package/src/dictionary/button.ts +41 -0
- package/src/dictionary/color.ts +24 -0
- package/src/dictionary/file-extensions.ts +81 -0
- package/src/dictionary/floating-ui.ts +25 -0
- package/src/dictionary/icon.ts +15 -0
- package/src/dictionary/input.ts +48 -0
- package/src/dictionary/loading.ts +9 -0
- package/src/dictionary/text.ts +9 -0
- package/src/dictionary/typography.ts +88 -0
- package/src/dictionary/variant.ts +111 -0
- package/src/fixtures/cities.ts +116 -0
- package/src/fixtures/filenames.ts +60 -0
- package/src/fixtures/icons.json +314 -0
- package/src/fixtures/iconsauce.json +235 -0
- package/src/interface/input-value.ts +5 -0
- package/src/tailwind/components.css +15 -0
- package/src/type/autocomplete.ts +69 -0
- package/src/type/button.ts +28 -0
- package/src/type/file-types.ts +55 -0
- package/src/type/floating-ui.ts +17 -0
- package/src/type/form-rel.ts +11 -0
- package/src/type/input.ts +25 -0
- package/src/type/loading.ts +3 -0
- package/src/type/text.ts +4 -0
- package/src/type/typography.ts +65 -0
- package/src/type/variant-file-format.ts +128 -0
- package/src/type/variant.ts +99 -0
- package/www/build/index.esm.js +0 -0
- package/www/build/mds-push-notification.esm.js +1 -0
- package/www/build/mds-push-notification.js +127 -0
- package/www/build/p-34044354.entry.js +1 -0
- package/www/build/p-50ea2036.system.js +1 -0
- package/www/build/p-8a9749fc.system.entry.js +1 -0
- package/www/build/p-8cb59c6e.system.js +1 -0
- package/www/build/p-a4428770.js +2 -0
- package/www/build/p-b107cf73.system.js +2 -0
- package/www/host.config.json +15 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
@tailwind utilities;
|
|
2
|
+
|
|
3
|
+
:host( [variant="orange"][tone="strong"] ) {
|
|
4
|
+
|
|
5
|
+
--mds-push-notification-icon-background-color: theme('colors.label-orange-05');
|
|
6
|
+
--mds-push-notification-icon-color: theme('colors.label-orange-10');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host( [variant="orange"] ),
|
|
10
|
+
:host( [variant="orange"][tone="weak"] ) {
|
|
11
|
+
|
|
12
|
+
--mds-push-notification-icon-background-color: theme('colors.label-orange-09');
|
|
13
|
+
--mds-push-notification-icon-color: theme('colors.label-orange-05');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host( [variant="orange"][tone="quiet"] ) {
|
|
17
|
+
|
|
18
|
+
--mds-push-notification-icon-background-color: transparent;
|
|
19
|
+
--mds-push-notification-icon-color: theme('colors.label-orange-05');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host( [variant="amaranth"][tone="strong"] ) {
|
|
23
|
+
|
|
24
|
+
--mds-push-notification-icon-background-color: theme('colors.label-amaranth-05');
|
|
25
|
+
--mds-push-notification-icon-color: theme('colors.label-amaranth-10');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host( [variant="amaranth"] ),
|
|
29
|
+
:host( [variant="amaranth"][tone="weak"] ) {
|
|
30
|
+
|
|
31
|
+
--mds-push-notification-icon-background-color: theme('colors.label-amaranth-09');
|
|
32
|
+
--mds-push-notification-icon-color: theme('colors.label-amaranth-05');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host( [variant="amaranth"][tone="quiet"] ) {
|
|
36
|
+
|
|
37
|
+
--mds-push-notification-icon-background-color: transparent;
|
|
38
|
+
--mds-push-notification-icon-color: theme('colors.label-amaranth-05');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host( [variant="orchid"][tone="strong"] ) {
|
|
42
|
+
|
|
43
|
+
--mds-push-notification-icon-background-color: theme('colors.label-orchid-05');
|
|
44
|
+
--mds-push-notification-icon-color: theme('colors.label-orchid-10');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host( [variant="orchid"] ),
|
|
48
|
+
:host( [variant="orchid"][tone="weak"] ) {
|
|
49
|
+
|
|
50
|
+
--mds-push-notification-icon-background-color: theme('colors.label-orchid-09');
|
|
51
|
+
--mds-push-notification-icon-color: theme('colors.label-orchid-05');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host( [variant="orchid"][tone="quiet"] ) {
|
|
55
|
+
|
|
56
|
+
--mds-push-notification-icon-background-color: transparent;
|
|
57
|
+
--mds-push-notification-icon-color: theme('colors.label-orchid-05');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:host( [variant="violet"][tone="strong"] ) {
|
|
61
|
+
|
|
62
|
+
--mds-push-notification-icon-background-color: theme('colors.label-violet-05');
|
|
63
|
+
--mds-push-notification-icon-color: theme('colors.label-violet-10');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host( [variant="violet"] ),
|
|
67
|
+
:host( [variant="violet"][tone="weak"] ) {
|
|
68
|
+
|
|
69
|
+
--mds-push-notification-icon-background-color: theme('colors.label-violet-09');
|
|
70
|
+
--mds-push-notification-icon-color: theme('colors.label-violet-05');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host( [variant="violet"][tone="quiet"] ) {
|
|
74
|
+
|
|
75
|
+
--mds-push-notification-icon-background-color: transparent;
|
|
76
|
+
--mds-push-notification-icon-color: theme('colors.label-violet-05');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host( [variant="blue"][tone="strong"] ) {
|
|
80
|
+
|
|
81
|
+
--mds-push-notification-icon-background-color: theme('colors.label-blue-05');
|
|
82
|
+
--mds-push-notification-icon-color: theme('colors.label-blue-10');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:host( [variant="blue"] ),
|
|
86
|
+
:host( [variant="blue"][tone="weak"] ) {
|
|
87
|
+
|
|
88
|
+
--mds-push-notification-icon-background-color: theme('colors.label-blue-09');
|
|
89
|
+
--mds-push-notification-icon-color: theme('colors.label-blue-05');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host( [variant="blue"][tone="quiet"] ) {
|
|
93
|
+
|
|
94
|
+
--mds-push-notification-icon-background-color: transparent;
|
|
95
|
+
--mds-push-notification-icon-color: theme('colors.label-blue-05');
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:host( [variant="sky"][tone="strong"] ) {
|
|
99
|
+
|
|
100
|
+
--mds-push-notification-icon-background-color: theme('colors.label-sky-05');
|
|
101
|
+
--mds-push-notification-icon-color: theme('colors.label-sky-10');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:host( [variant="sky"] ),
|
|
105
|
+
:host( [variant="sky"][tone="weak"] ) {
|
|
106
|
+
|
|
107
|
+
--mds-push-notification-icon-background-color: theme('colors.label-sky-09');
|
|
108
|
+
--mds-push-notification-icon-color: theme('colors.label-sky-05');
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
:host( [variant="sky"][tone="quiet"] ) {
|
|
112
|
+
|
|
113
|
+
--mds-push-notification-icon-background-color: transparent;
|
|
114
|
+
--mds-push-notification-icon-color: theme('colors.label-sky-05');
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
:host( [variant="aqua"][tone="strong"] ) {
|
|
118
|
+
|
|
119
|
+
--mds-push-notification-icon-background-color: theme('colors.label-aqua-05');
|
|
120
|
+
--mds-push-notification-icon-color: theme('colors.label-aqua-10');
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
:host( [variant="aqua"] ),
|
|
124
|
+
:host( [variant="aqua"][tone="weak"] ) {
|
|
125
|
+
|
|
126
|
+
--mds-push-notification-icon-background-color: theme('colors.label-aqua-09');
|
|
127
|
+
--mds-push-notification-icon-color: theme('colors.label-aqua-05');
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:host( [variant="aqua"][tone="quiet"] ) {
|
|
131
|
+
|
|
132
|
+
--mds-push-notification-icon-background-color: transparent;
|
|
133
|
+
--mds-push-notification-icon-color: theme('colors.label-aqua-05');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
:host( [variant="green"][tone="strong"] ) {
|
|
137
|
+
|
|
138
|
+
--mds-push-notification-icon-background-color: theme('colors.label-green-05');
|
|
139
|
+
--mds-push-notification-icon-color: theme('colors.label-green-10');
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:host( [variant="green"] ),
|
|
143
|
+
:host( [variant="green"][tone="weak"] ) {
|
|
144
|
+
|
|
145
|
+
--mds-push-notification-icon-background-color: theme('colors.label-green-09');
|
|
146
|
+
--mds-push-notification-icon-color: theme('colors.label-green-05');
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
:host( [variant="green"][tone="quiet"] ) {
|
|
150
|
+
|
|
151
|
+
--mds-push-notification-icon-background-color: transparent;
|
|
152
|
+
--mds-push-notification-icon-color: theme('colors.label-green-05');
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
:host( [variant="lime"][tone="strong"] ) {
|
|
156
|
+
|
|
157
|
+
--mds-push-notification-icon-background-color: theme('colors.label-lime-05');
|
|
158
|
+
--mds-push-notification-icon-color: theme('colors.label-lime-10');
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:host( [variant="lime"] ),
|
|
162
|
+
:host( [variant="lime"][tone="weak"] ) {
|
|
163
|
+
|
|
164
|
+
--mds-push-notification-icon-background-color: theme('colors.label-lime-09');
|
|
165
|
+
--mds-push-notification-icon-color: theme('colors.label-lime-05');
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:host( [variant="lime"][tone="quiet"] ) {
|
|
169
|
+
|
|
170
|
+
--mds-push-notification-icon-background-color: transparent;
|
|
171
|
+
--mds-push-notification-icon-color: theme('colors.label-lime-05');
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
:host( [variant="yellow"][tone="strong"] ) {
|
|
175
|
+
|
|
176
|
+
--mds-push-notification-icon-background-color: theme('colors.label-yellow-05');
|
|
177
|
+
--mds-push-notification-icon-color: theme('colors.label-yellow-10');
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
:host( [variant="yellow"] ),
|
|
181
|
+
:host( [variant="yellow"][tone="weak"] ) {
|
|
182
|
+
|
|
183
|
+
--mds-push-notification-icon-background-color: theme('colors.label-yellow-09');
|
|
184
|
+
--mds-push-notification-icon-color: theme('colors.label-yellow-05');
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
:host( [variant="yellow"][tone="quiet"] ) {
|
|
188
|
+
|
|
189
|
+
--mds-push-notification-icon-background-color: transparent;
|
|
190
|
+
--mds-push-notification-icon-color: theme('colors.label-yellow-05');
|
|
191
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@tailwind utilities;
|
|
2
|
+
|
|
3
|
+
:host( [variant="primary"][tone="strong"] ) {
|
|
4
|
+
|
|
5
|
+
--mds-push-notification-icon-background-color: theme('colors.brand-maggioli-05');
|
|
6
|
+
--mds-push-notification-icon-color: theme('colors.brand-maggioli-10');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host( [variant="primary"] ),
|
|
10
|
+
:host( [variant="primary"][tone="weak"] ) {
|
|
11
|
+
|
|
12
|
+
--mds-push-notification-icon-background-color: theme('colors.brand-maggioli-09');
|
|
13
|
+
--mds-push-notification-icon-color: theme('colors.brand-maggioli-05');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host( [variant="primary"][tone="quiet"] ) {
|
|
17
|
+
|
|
18
|
+
--mds-push-notification-icon-background-color: transparent;
|
|
19
|
+
--mds-push-notification-icon-color: theme('colors.brand-maggioli-05');
|
|
20
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
@tailwind utilities;
|
|
2
|
+
|
|
3
|
+
:host( [variant="error"][tone="strong"] ) {
|
|
4
|
+
|
|
5
|
+
--mds-push-notification-icon-background-color: theme('colors.status-error-05');
|
|
6
|
+
--mds-push-notification-icon-color: theme('colors.status-error-10');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host( [variant="error"] ),
|
|
10
|
+
:host( [variant="error"][tone="weak"] ) {
|
|
11
|
+
|
|
12
|
+
--mds-push-notification-icon-background-color: theme('colors.status-error-09');
|
|
13
|
+
--mds-push-notification-icon-color: theme('colors.status-error-05');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host( [variant="error"][tone="quiet"] ) {
|
|
17
|
+
|
|
18
|
+
--mds-push-notification-icon-background-color: transparent;
|
|
19
|
+
--mds-push-notification-icon-color: theme('colors.status-error-05');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host( [variant="warning"][tone="strong"] ) {
|
|
23
|
+
|
|
24
|
+
--mds-push-notification-icon-background-color: theme('colors.status-warning-05');
|
|
25
|
+
--mds-push-notification-icon-color: theme('colors.status-warning-10');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host( [variant="warning"] ),
|
|
29
|
+
:host( [variant="warning"][tone="weak"] ) {
|
|
30
|
+
|
|
31
|
+
--mds-push-notification-icon-background-color: theme('colors.status-warning-09');
|
|
32
|
+
--mds-push-notification-icon-color: theme('colors.status-warning-05');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host( [variant="warning"][tone="quiet"] ) {
|
|
36
|
+
|
|
37
|
+
--mds-push-notification-icon-background-color: transparent;
|
|
38
|
+
--mds-push-notification-icon-color: theme('colors.status-warning-05');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host( [variant="success"][tone="strong"] ) {
|
|
42
|
+
|
|
43
|
+
--mds-push-notification-icon-background-color: theme('colors.status-success-05');
|
|
44
|
+
--mds-push-notification-icon-color: theme('colors.status-success-10');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host( [variant="success"] ),
|
|
48
|
+
:host( [variant="success"][tone="weak"] ) {
|
|
49
|
+
|
|
50
|
+
--mds-push-notification-icon-background-color: theme('colors.status-success-09');
|
|
51
|
+
--mds-push-notification-icon-color: theme('colors.status-success-05');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host( [variant="success"][tone="quiet"] ) {
|
|
55
|
+
|
|
56
|
+
--mds-push-notification-icon-background-color: transparent;
|
|
57
|
+
--mds-push-notification-icon-color: theme('colors.status-success-05');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:host( [variant="info"][tone="strong"] ) {
|
|
61
|
+
|
|
62
|
+
--mds-push-notification-icon-background-color: theme('colors.status-info-05');
|
|
63
|
+
--mds-push-notification-icon-color: theme('colors.status-info-10');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host( [variant="info"] ),
|
|
67
|
+
:host( [variant="info"][tone="weak"] ) {
|
|
68
|
+
|
|
69
|
+
--mds-push-notification-icon-background-color: theme('colors.status-info-09');
|
|
70
|
+
--mds-push-notification-icon-color: theme('colors.status-info-05');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host( [variant="info"][tone="quiet"] ) {
|
|
74
|
+
|
|
75
|
+
--mds-push-notification-icon-background-color: transparent;
|
|
76
|
+
--mds-push-notification-icon-color: theme('colors.status-info-05');
|
|
77
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
@import '../../tailwind/components.css';
|
|
2
|
+
@tailwind utilities;
|
|
3
|
+
@tailwind components;
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
|
|
7
|
+
--mds-push-notification-duration: 200ms;
|
|
8
|
+
--mds-push-notification-icon-background-color: transparent;
|
|
9
|
+
--mds-push-notification-icon-color: theme('colors.tone-neutral-04');
|
|
10
|
+
--mds-push-notification-message-line-clamp: 2;
|
|
11
|
+
--mds-push-notification-shadow: theme('boxShadow.DEFAULT');
|
|
12
|
+
--mds-push-notification-subject-line-clamp: 1;
|
|
13
|
+
--mds-push-notification-timing-function: theme('transitionTimingFunction.in-out-expo');
|
|
14
|
+
|
|
15
|
+
@apply
|
|
16
|
+
gap-400
|
|
17
|
+
max-w-8000
|
|
18
|
+
min-w-7200
|
|
19
|
+
p-400
|
|
20
|
+
pr-800
|
|
21
|
+
rounded-lg;
|
|
22
|
+
|
|
23
|
+
align-items: flex-start;
|
|
24
|
+
background-color: theme('colors.tone-neutral');
|
|
25
|
+
box-shadow: var(--mds-push-notification-shadow);
|
|
26
|
+
color: theme('colors.tone-neutral-02');
|
|
27
|
+
display: flex;
|
|
28
|
+
position: relative;
|
|
29
|
+
transition-duration: var(--mds-push-notification-duration);
|
|
30
|
+
transition-property: transform;
|
|
31
|
+
transition-timing-function: var(--mds-push-notification-timing-function);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.content {
|
|
35
|
+
display: grid;
|
|
36
|
+
flex-grow: 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.actions {
|
|
40
|
+
@apply
|
|
41
|
+
gap-200
|
|
42
|
+
pt-200;
|
|
43
|
+
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-wrap: wrap;
|
|
46
|
+
min-width: 1px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.avatar,
|
|
50
|
+
.picture {
|
|
51
|
+
flex-shrink: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.picture {
|
|
55
|
+
@apply
|
|
56
|
+
max-w-1200
|
|
57
|
+
rounded;
|
|
58
|
+
|
|
59
|
+
box-shadow: theme('boxShadow.sm-sharp');
|
|
60
|
+
width: 100%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.close-button {
|
|
64
|
+
|
|
65
|
+
@apply
|
|
66
|
+
p-150
|
|
67
|
+
transition-opacity;
|
|
68
|
+
|
|
69
|
+
--mds-button-icon-color: inherit;
|
|
70
|
+
|
|
71
|
+
background-color: transparent;
|
|
72
|
+
fill: theme('colors.tone-neutral-06');
|
|
73
|
+
opacity: 0;
|
|
74
|
+
position: absolute;
|
|
75
|
+
right: 0;
|
|
76
|
+
top: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host(:hover) .close-button {
|
|
80
|
+
opacity: 1;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.close-button:focus-visible,
|
|
84
|
+
.close-button:hover {
|
|
85
|
+
fill: theme('colors.tone-neutral-03');
|
|
86
|
+
opacity: 1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.subject {
|
|
90
|
+
|
|
91
|
+
--mds-text-line-clamp: var(--mds-push-notification-subject-line-clamp);
|
|
92
|
+
|
|
93
|
+
line-height: theme('lineHeight.sm');
|
|
94
|
+
text-overflow: ellipsis;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.message {
|
|
98
|
+
|
|
99
|
+
--mds-text-line-clamp: var(--mds-push-notification-message-line-clamp);
|
|
100
|
+
|
|
101
|
+
line-height: theme('lineHeight.sm');
|
|
102
|
+
text-overflow: ellipsis;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.avatar {
|
|
106
|
+
@apply
|
|
107
|
+
h-900
|
|
108
|
+
transition-colors
|
|
109
|
+
w-900;
|
|
110
|
+
|
|
111
|
+
background-color: var(--mds-push-notification-icon-background-color);
|
|
112
|
+
border-radius: 1000px;
|
|
113
|
+
fill: var(--mds-push-notification-icon-color);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.avatar::part(svg) {
|
|
117
|
+
@apply w-600;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
:host([src]) .avatar {
|
|
121
|
+
background-color: transparent;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:host([icon]) .avatar::part(wrapper) {
|
|
125
|
+
@apply p-150;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@import './css/mds-push-notification-variant-primary.css';
|
|
129
|
+
@import './css/mds-push-notification-variant-label.css';
|
|
130
|
+
@import './css/mds-push-notification-variant-state.css';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Component, Element, Host, h, Prop } from '@stencil/core'
|
|
2
|
+
import miBaselineCancel from '@icon/mi/baseline/cancel.svg'
|
|
3
|
+
import { ThemeFullVariantAvatarType, ToneMinimalVariantType } from '@type/variant'
|
|
4
|
+
import { NotificationPreviewType } from './meta/types'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @part actions - The actions wrapper
|
|
8
|
+
* @part content - The content wrapper of the message
|
|
9
|
+
* @part icon - The icon set by `icon` attribute
|
|
10
|
+
* @part picture - The picture image added by `src` attribute
|
|
11
|
+
* @slot actions - Add `HTML elements` or `components`, it is **recommended** to use `mds-button` element.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
tag: 'mds-push-notification',
|
|
16
|
+
styleUrl: 'mds-push-notification.css',
|
|
17
|
+
shadow: true,
|
|
18
|
+
})
|
|
19
|
+
export class MdsPushNotification {
|
|
20
|
+
|
|
21
|
+
private hasActions?: boolean
|
|
22
|
+
@Element() host: HTMLMdsPushNotificationElement
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Specifies the icon to be displayed
|
|
26
|
+
*/
|
|
27
|
+
@Prop({ reflect: true }) readonly icon?: string
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The user's inizials displayed if there's no image available, initials will override tone and variant senttings to keep user recognizable from others
|
|
31
|
+
*/
|
|
32
|
+
@Prop({ mutable:true, reflect: true }) readonly initials?: string
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Specifies the message of the component
|
|
36
|
+
*/
|
|
37
|
+
@Prop({ reflect: true }) readonly message: string = 'Nessun messaggio disponibile'
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Specifies if the `src` attribute is used to show a the image as avatar or full image
|
|
41
|
+
*/
|
|
42
|
+
@Prop({ reflect: true }) readonly preview?: NotificationPreviewType = 'image'
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Specifies the path to the image
|
|
46
|
+
*/
|
|
47
|
+
@Prop({ reflect: true }) readonly src?: string
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Specifies the subject of the component
|
|
51
|
+
*/
|
|
52
|
+
@Prop({ reflect: true }) readonly subject?: string
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Specifies the color tone of the component
|
|
56
|
+
*/
|
|
57
|
+
@Prop({ reflect: true }) readonly tone?: ToneMinimalVariantType = 'weak'
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Specifies the color variant of the component
|
|
61
|
+
*/
|
|
62
|
+
@Prop({ reflect: true }) readonly variant?: ThemeFullVariantAvatarType
|
|
63
|
+
|
|
64
|
+
componentWillLoad ():void {
|
|
65
|
+
this.hasActions = this.host.querySelector('[slot="actions"]') !== null
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
render () {
|
|
69
|
+
return (
|
|
70
|
+
<Host>
|
|
71
|
+
{ (this.icon ?? this.preview === 'avatar') && <mds-avatar class="avatar" icon={this.icon} initials={this.initials} part="avatar" src={this.src} tone={this.tone} variant={this.variant}></mds-avatar> }
|
|
72
|
+
{ this.src && this.preview !== 'avatar' && <mds-img class="picture" part="picture" src={this.src}></mds-img> }
|
|
73
|
+
<div class="content" part="content">
|
|
74
|
+
{ this.subject && <mds-text class="subject" typography="h6" variant="title">{ this.subject }</mds-text> }
|
|
75
|
+
<mds-text class="message" truncate="all" typography="caption" variant="info">{ this.message }</mds-text>
|
|
76
|
+
{ this.hasActions && <div class="actions" part="actions">
|
|
77
|
+
<slot name="actions"></slot>
|
|
78
|
+
</div> }
|
|
79
|
+
</div>
|
|
80
|
+
<mds-button class="close-button" icon={miBaselineCancel}></mds-button>
|
|
81
|
+
</Host>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# mds-push-notification
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<!-- Auto Generated Below -->
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Properties
|
|
9
|
+
|
|
10
|
+
| Property | Attribute | Description | Type | Default |
|
|
11
|
+
| ---------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
|
|
12
|
+
| `icon` | `icon` | Specifies the icon to be displayed | `string \| undefined` | `undefined` |
|
|
13
|
+
| `initials` | `initials` | The user's inizials displayed if there's no image available, initials will override tone and variant senttings to keep user recognizable from others | `string \| undefined` | `undefined` |
|
|
14
|
+
| `message` | `message` | Specifies the message of the component | `string` | `'Nessun messaggio disponibile'` |
|
|
15
|
+
| `preview` | `preview` | Specifies if the `src` attribute is used to show a the image as avatar or full image | `"avatar" \| "image" \| undefined` | `'image'` |
|
|
16
|
+
| `src` | `src` | Specifies the path to the image | `string \| undefined` | `undefined` |
|
|
17
|
+
| `subject` | `subject` | Specifies the subject of the component | `string \| undefined` | `undefined` |
|
|
18
|
+
| `tone` | `tone` | Specifies the color tone of the component | `"strong" \| "weak" \| undefined` | `'weak'` |
|
|
19
|
+
| `variant` | `variant` | Specifies the color variant of the component | `"amaranth" \| "aqua" \| "blue" \| "error" \| "green" \| "info" \| "lime" \| "orange" \| "orchid" \| "primary" \| "sky" \| "success" \| "violet" \| "warning" \| "yellow" \| undefined` | `undefined` |
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Slots
|
|
23
|
+
|
|
24
|
+
| Slot | Description |
|
|
25
|
+
| ----------- | --------------------------------------------------------------------------------------- |
|
|
26
|
+
| `"actions"` | Add `HTML elements` or `components`, it is **recommended** to use `mds-button` element. |
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## Shadow Parts
|
|
30
|
+
|
|
31
|
+
| Part | Description |
|
|
32
|
+
| ----------- | ------------------------------------------ |
|
|
33
|
+
| `"actions"` | The actions wrapper |
|
|
34
|
+
| `"avatar"` | |
|
|
35
|
+
| `"content"` | The content wrapper of the message |
|
|
36
|
+
| `"icon"` | The icon set by `icon` attribute |
|
|
37
|
+
| `"picture"` | The picture image added by `src` attribute |
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
----------------------------------------------
|
|
41
|
+
|
|
42
|
+
Built with love @ [Gruppo Maggioli](https://www.maggioli.com) from [R&D Department](https://www.maggioli.com/it-it/chi-siamo/ricerca-sviluppo)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing'
|
|
2
|
+
|
|
3
|
+
describe('mds-push-notification', () => {
|
|
4
|
+
it('renders', async () => {
|
|
5
|
+
const page = await newE2EPage()
|
|
6
|
+
await page.setContent('<mds-push-notification></mds-push-notification>')
|
|
7
|
+
|
|
8
|
+
const element = await page.find('mds-push-notification')
|
|
9
|
+
expect(element).toHaveAttribute('hydrated')
|
|
10
|
+
})
|
|
11
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { newSpecPage } from '@stencil/core/testing'
|
|
2
|
+
import { MdsPushNotification } from '../mds-push-notification'
|
|
3
|
+
|
|
4
|
+
describe('mds-push-notification', () => {
|
|
5
|
+
it('renders', async () => {
|
|
6
|
+
const page = await newSpecPage({
|
|
7
|
+
components: [MdsPushNotification],
|
|
8
|
+
html: '<mds-push-notification></mds-push-notification>',
|
|
9
|
+
})
|
|
10
|
+
expect(page.root).toEqualHtml(`
|
|
11
|
+
<mds-push-notification message="Nessun messaggio disponibile" preview="image" tone="weak">
|
|
12
|
+
<mock:shadow-root>
|
|
13
|
+
<div class="content" part="content">
|
|
14
|
+
<mds-text class="message" truncate="all" typography="caption" variant="info">
|
|
15
|
+
Nessun messaggio disponibile
|
|
16
|
+
</mds-text>
|
|
17
|
+
</div>
|
|
18
|
+
<mds-button class="close-button">
|
|
19
|
+
</mds-button>
|
|
20
|
+
</mock:shadow-root>
|
|
21
|
+
</mds-push-notification>
|
|
22
|
+
`)
|
|
23
|
+
})
|
|
24
|
+
})
|