@micromag/core 0.3.824 → 0.4.4

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.
Files changed (64) hide show
  1. package/assets/css/styles.css +31 -31
  2. package/assets/css/vendor.css +4 -3
  3. package/es/components.d.ts +628 -0
  4. package/es/components.js +947 -2301
  5. package/es/contexts.d.ts +297 -0
  6. package/es/contexts.js +154 -341
  7. package/es/hooks.d.ts +333 -0
  8. package/es/hooks.js +22 -17
  9. package/es/index.d.ts +665 -0
  10. package/es/index.js +2 -772
  11. package/es/styles.css +35 -0
  12. package/es/utils.d.ts +214 -0
  13. package/lib/components.js +955 -2309
  14. package/lib/contexts.js +153 -340
  15. package/lib/hooks.js +21 -16
  16. package/lib/index.js +0 -771
  17. package/lib/styles.css +35 -0
  18. package/package.json +39 -46
  19. package/styles/bootstrap-overrides.css +111 -0
  20. package/styles/bootstrap-patches.css +486 -0
  21. package/styles/breadcrumb.module.css +5 -0
  22. package/styles/button.module.css +82 -0
  23. package/styles/buttons.module.css +3 -0
  24. package/styles/clear.module.css +23 -0
  25. package/styles/collapsable-panel.module.css +31 -0
  26. package/styles/conversation.module.css +37 -0
  27. package/styles/dialog.module.css +13 -0
  28. package/styles/empty.module.css +22 -0
  29. package/styles/form-panel.module.css +3 -0
  30. package/styles/form.module.css +22 -0
  31. package/styles/link.module.css +9 -0
  32. package/styles/map.module.css +43 -0
  33. package/styles/media.module.css +3 -0
  34. package/styles/modal.module.css +22 -0
  35. package/styles/modals.module.css +12 -0
  36. package/styles/navbar.module.css +9 -0
  37. package/styles/pagination.module.css +3 -0
  38. package/styles/panel.module.css +3 -0
  39. package/styles/panels.module.css +3 -0
  40. package/styles/placeholder-block.module.css +29 -0
  41. package/styles/placeholder-text.module.css +17 -0
  42. package/styles/placeholders.module.css +3 -0
  43. package/styles/preview.module.css +34 -0
  44. package/styles/quiz-answer.module.css +29 -0
  45. package/styles/screen-placeholder.module.css +5 -0
  46. package/styles/screen-sizer.module.css +14 -0
  47. package/styles/screen.module.css +52 -0
  48. package/styles/screens.module.css +16 -0
  49. package/styles/share-options.module.css +27 -0
  50. package/{scss/_placeholders.scss → styles/shared.module.css} +103 -97
  51. package/styles/slideshow.module.css +28 -0
  52. package/styles/spinner.module.css +43 -0
  53. package/styles/styles.css +1 -0
  54. package/styles/survey-answer.module.css +18 -0
  55. package/styles/tabs.module.css +4 -0
  56. package/styles/theme.css +84 -0
  57. package/styles/transition.module.css +9 -0
  58. package/{scss/vendor.scss → styles/vendor.css} +16 -30
  59. package/styles/video-360.module.css +15 -0
  60. package/scss/_mixins.scss +0 -34
  61. package/scss/_theme.scss +0 -114
  62. package/scss/_variables.scss +0 -12
  63. package/scss/styles.scss +0 -1
  64. package/scss/upload.scss +0 -1
@@ -1,7 +1,5 @@
1
- @import './variables';
2
-
3
1
  /* Utils */
4
- %hide-scrollbars {
2
+ .hideScrollbars {
5
3
  scrollbar-width: none;
6
4
 
7
5
  &::-webkit-scrollbar {
@@ -10,87 +8,89 @@
10
8
  }
11
9
 
12
10
  /* Reset */
13
- %reset-viewer-fonts {
11
+ .resetViewerFonts {
14
12
  font-family: Helvetica, Arial, sans-serif;
15
13
  font-size: 16px;
16
14
  font-weight: normal;
17
15
  line-height: 1.1;
18
16
  }
19
17
 
20
- %reset-viewer-elements {
21
- margin: 0;
18
+ .resetViewerElements {
22
19
  padding: 0;
20
+ margin: 0;
23
21
  }
24
22
 
25
- %reset-viewer {
26
- @extend %reset-viewer-fonts;
27
-
28
- *,
29
- *::before,
30
- *::after {
31
- box-sizing: border-box; // 1
32
- }
33
-
34
- h1,
35
- h2,
36
- h3,
37
- h4,
38
- h5,
39
- h6,
40
- p,
41
- ul,
42
- ol,
43
- dl,
44
- li,
45
- address,
46
- blockquote,
47
- pre,
48
- figure,
49
- caption,
50
- label,
51
- legend {
52
- @extend %reset-viewer-elements;
53
- }
54
-
55
- h1,
56
- h2,
57
- h3,
58
- h4,
59
- h5,
60
- h6,
61
- p,
62
- li {
23
+ .resetViewer {
24
+ composes: resetviewerfonts;
25
+
26
+ & *,
27
+ & *::before,
28
+ & *::after {
29
+ box-sizing: border-box;
30
+ }
31
+
32
+ & h1,
33
+ & h2,
34
+ & h3,
35
+ & h4,
36
+ & h5,
37
+ & h6,
38
+ & p,
39
+ & ul,
40
+ & ol,
41
+ & dl,
42
+ & li,
43
+ & address,
44
+ & blockquote,
45
+ & pre,
46
+ & figure,
47
+ & caption,
48
+ & label,
49
+ & legend {
50
+ padding: 0;
51
+ margin: 0;
52
+ }
53
+
54
+ & h1,
55
+ & h2,
56
+ & h3,
57
+ & h4,
58
+ & h5,
59
+ & h6,
60
+ & p,
61
+ & li {
63
62
  font-weight: inherit;
64
63
  }
65
64
 
66
- mark, .mark {
65
+ & mark,
66
+ & .mark {
67
67
  color: inherit;
68
68
  }
69
69
  }
70
70
 
71
- %reset-button {
72
- display: inline-block;
71
+ .resetButton {
73
72
  position: relative;
73
+ display: inline-block;
74
74
  padding: 0;
75
75
  border: 0;
76
+ appearance: none;
76
77
  background: transparent;
77
78
  color: inherit;
78
- font-family: inherit;
79
79
  cursor: pointer;
80
- appearance: none;
80
+ font-family: inherit;
81
81
  }
82
82
 
83
- %reset-input {
83
+ .resetInput {
84
84
  padding: 0;
85
85
  border: 0;
86
+ appearance: none;
86
87
  background: transparent;
87
- font-family: inherit;
88
88
  cursor: pointer;
89
- appearance: none;
89
+ font-family: inherit;
90
90
  }
91
91
 
92
92
  /* Container */
93
- %fullscreen {
93
+ .fullscreen {
94
94
  position: absolute;
95
95
  top: 0;
96
96
  left: 0;
@@ -98,11 +98,11 @@
98
98
  height: 100%;
99
99
  }
100
100
 
101
- %screen {
101
+ .screen {
102
102
  position: relative;
103
+ overflow: hidden;
103
104
  width: 100%;
104
105
  height: 100%;
105
- overflow: hidden;
106
106
 
107
107
  &.disabled {
108
108
  overflow: hidden;
@@ -115,74 +115,75 @@
115
115
  }
116
116
 
117
117
  &.placeholder {
118
- .content {
118
+ & .content {
119
119
  position: relative;
120
120
  padding: 6px;
121
121
  }
122
122
  }
123
123
  }
124
124
 
125
- %empty {
125
+ .empty {
126
+ border: dashed 2px var(--mm-gray-800);
126
127
  margin: 5px auto;
127
- border: dashed 2px $gray-800;
128
- color: $gray-800;
128
+ color: var(--mm-gray-800);
129
129
  }
130
130
 
131
- %empty-text {
131
+ .emptyText {
132
132
  width: 100%;
133
133
  height: 100px;
134
134
  }
135
135
 
136
- %empty-image {
136
+ .emptyImage {
137
137
  width: 100%;
138
138
  height: 200px;
139
139
  }
140
140
 
141
141
  /* Text styles */
142
- %text-inner-styles {
143
- em,
144
- i {
142
+ .textInnerStyles {
143
+ & em,
144
+ & i {
145
145
  font-style: italic;
146
146
  }
147
147
 
148
- strong,
149
- b {
148
+ & strong,
149
+ & b {
150
150
  font-weight: bold;
151
151
  }
152
152
 
153
- p {
153
+ & p {
154
154
  margin-top: 0.5em;
155
155
  margin-bottom: 0.5em;
156
156
  }
157
157
 
158
- mark {
158
+ & mark {
159
159
  padding: 0;
160
160
  box-decoration-break: clone;
161
161
  }
162
162
  }
163
- %text-styles {
164
- @extend %reset-viewer-fonts;
165
- @extend %text-inner-styles;
163
+
164
+ .textStyles {
165
+ composes: resetviewerfonts;
166
+ composes: textinnerstyles;
166
167
  line-height: 1.3;
167
168
 
168
- h2 {
169
+ & h2 {
169
170
  font-size: 2em;
170
171
  }
171
172
 
172
- h3 {
173
+ & h3 {
173
174
  font-size: 1.75em;
174
175
  }
175
176
 
176
- h4 {
177
+ & h4 {
177
178
  font-size: 1.5em;
178
179
  }
179
180
 
180
- blockquote {
181
+ & blockquote {
181
182
  padding: 0;
182
183
  padding-left: 1em;
183
184
  }
184
185
 
185
- img {
186
+ & img {
186
187
  display: block;
187
188
  width: auto;
188
189
  max-width: 100%;
@@ -190,44 +191,44 @@
190
191
  }
191
192
  }
192
193
 
193
- %flex {
194
+ /* Layout */
195
+ .flex {
194
196
  display: flex;
195
197
  flex-direction: row;
196
198
  align-items: center;
197
199
  justify-content: center;
198
200
  }
199
201
 
200
- %flex-full {
202
+ .flexFull {
201
203
  display: flex;
204
+ width: 100%;
205
+ height: 100%;
202
206
  flex-direction: row;
203
207
  align-items: center;
204
208
  justify-content: center;
205
- width: 100%;
206
- height: 100%;
207
209
  }
208
210
 
209
- // TODO: remove this
210
-
211
- %placeholder-full {
211
+ .placeholderFull {
212
212
  width: 100%;
213
213
  }
214
214
 
215
- %placeholder-center {
215
+ .placeholderCenter {
216
216
  margin-right: auto;
217
217
  margin-left: auto;
218
218
  }
219
219
 
220
- %placeholder-left {
221
- float: left;
220
+ .placeholderLeft {
222
221
  clear: both;
222
+ float: left;
223
223
  }
224
224
 
225
- %placeholder-right {
226
- float: right;
225
+ .placeholderRight {
227
226
  clear: both;
227
+ float: right;
228
228
  }
229
229
 
230
- %form-disabled {
230
+ /* Form */
231
+ .formDisabled {
231
232
  position: absolute;
232
233
  z-index: 0;
233
234
  top: 0;
@@ -235,7 +236,7 @@
235
236
  width: 100%;
236
237
  }
237
238
 
238
- %form-transitions {
239
+ .formTransitions {
239
240
  position: relative;
240
241
 
241
242
  &.enterRight,
@@ -264,8 +265,8 @@
264
265
 
265
266
  &.enterActiveHorizontal,
266
267
  &.enterActiveVertical {
267
- transform: translate(0, 0);
268
268
  opacity: 1;
269
+ transform: translate(0, 0);
269
270
  }
270
271
 
271
272
  &.enterActiveHorizontal {
@@ -277,21 +278,25 @@
277
278
  }
278
279
 
279
280
  &.leave {
280
- @extend %form-disabled;
281
- transform: translate(0, 0);
281
+ position: absolute;
282
+ z-index: 0;
283
+ top: 0;
284
+ left: 0;
285
+ width: 100%;
282
286
  opacity: 1;
287
+ transform: translate(0, 0);
283
288
  }
284
289
 
285
290
  &.leaveActiveRight,
286
291
  &.leaveActiveLeft {
287
- transition: transform 0.2s ease-out, opacity 0.2s ease-out;
288
292
  opacity: 0.5;
293
+ transition: transform 0.2s ease-out, opacity 0.2s ease-out;
289
294
  }
290
295
 
291
296
  &.leaveActiveTop,
292
297
  &.leaveActiveBottom {
293
- transition: transform 0.5s ease-out, opacity 0.5s ease-out;
294
298
  opacity: 0.5;
299
+ transition: transform 0.5s ease-out, opacity 0.5s ease-out;
295
300
  }
296
301
 
297
302
  &.leaveActiveRight {
@@ -311,9 +316,10 @@
311
316
  }
312
317
  }
313
318
 
314
- %focus-outline {
319
+ /* Focus */
320
+ .focusOutline {
315
321
  &:focus-visible {
316
- outline: 3px solid $purple;
322
+ outline: 3px solid var(--mm-purple);
317
323
  outline-offset: 4px;
318
324
  }
319
325
  }
@@ -0,0 +1,28 @@
1
+ .container {
2
+ position: relative;
3
+ overflow: hidden;
4
+
5
+ .items {
6
+ width: 100%;
7
+ height: 100%;
8
+ }
9
+
10
+ .item {
11
+ position: absolute;
12
+ width: 100%;
13
+ height: 100%;
14
+ transition: transform 0.3s ease-out;
15
+
16
+ &.prev {
17
+ transform: translateX(-100%);
18
+ }
19
+
20
+ &.current {
21
+ transform: translateX(0);
22
+ }
23
+
24
+ &.next {
25
+ transform: translateX(100%);
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,43 @@
1
+ @keyframes rotate {
2
+ 100% {
3
+ transform: rotate(360deg);
4
+ }
5
+ }
6
+
7
+ @keyframes dash {
8
+ 0% {
9
+ stroke-dasharray: 1, 150;
10
+ stroke-dashoffset: 0;
11
+ }
12
+
13
+ 50% {
14
+ stroke-dasharray: 90, 150;
15
+ stroke-dashoffset: -35;
16
+ }
17
+
18
+ 100% {
19
+ stroke-dasharray: 90, 150;
20
+ stroke-dashoffset: -124;
21
+ }
22
+ }
23
+
24
+ .container {
25
+ display: block;
26
+ width: 40px;
27
+ height: 40px;
28
+
29
+ .path {
30
+ color: currentcolor;
31
+ stroke-linecap: round;
32
+ }
33
+
34
+ &.animated {
35
+ animation: rotate 2s linear infinite;
36
+
37
+ .path {
38
+ animation: dash 1.5s ease-in-out infinite;
39
+ }
40
+ }
41
+
42
+ }
43
+
@@ -0,0 +1 @@
1
+ @import '@micromag/core/assets/css/styles.css';
@@ -0,0 +1,18 @@
1
+ .container {
2
+ display: flex;
3
+ align-items: center;
4
+ mix-blend-mode: difference;
5
+
6
+ .block {
7
+ flex-grow: 1;
8
+ }
9
+
10
+ .percent {
11
+ margin-left: 4px;
12
+ }
13
+
14
+ .percentIcon {
15
+ padding: 1px;
16
+ color: rgb(var(--mm-white), 0.6);
17
+ }
18
+ }
@@ -0,0 +1,4 @@
1
+ .container {
2
+ position: relative;
3
+ display: inline-block;
4
+ }
@@ -0,0 +1,84 @@
1
+ :root {
2
+ /* Colors */
3
+ --mm-white: #fff;
4
+ --mm-black: #1c1c1c;
5
+ --mm-purple: #a13dff;
6
+ --mm-red: #ff2945;
7
+ --mm-green: #0ed88f;
8
+ --mm-blue: #2151ff;
9
+ --mm-yellow: #ffe535;
10
+
11
+ /* Theme aliases */
12
+ --mm-primary: var(--mm-purple);
13
+ --mm-secondary: var(--mm-gray-200);
14
+ --mm-info: var(--mm-blue);
15
+ --mm-light: var(--mm-white);
16
+ --mm-dark: #343434;
17
+
18
+ /* Gray scale */
19
+ --mm-gray-100: #f5f5f5;
20
+ --mm-gray-200: #e9e9e9;
21
+ --mm-gray-300: #dedede;
22
+ --mm-gray-400: #b3b3b3;
23
+ --mm-gray-500: #adadad;
24
+ --mm-gray-600: #6c6c6c;
25
+ --mm-gray-700: #494949;
26
+ --mm-gray-800: #343434;
27
+ --mm-gray-900: #2b2b2b;
28
+
29
+ /* Typography */
30
+ --mm-font-family-sans-serif: 'Libre Franklin', -apple-system, BlinkMacSystemFont, 'Segoe UI',
31
+ Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji',
32
+ 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
33
+ --mm-font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
34
+ 'Courier New', monospace;
35
+ --mm-font-weight-normal: 400;
36
+ --mm-font-weight-bold: 600;
37
+ --mm-font-size-sm: 0.875rem;
38
+
39
+ /* Input/Form variables */
40
+ --mm-input-bg: hsla(0, 0%, 100%, 0.07);
41
+ --mm-input-color: var(--mm-white);
42
+ --mm-input-border-width: 0;
43
+ --mm-input-border-color: transparent;
44
+ --mm-input-border-radius: 0.375rem;
45
+ --mm-input-border-radius-sm: 0.25rem;
46
+ --mm-input-border-radius-lg: 0.5rem;
47
+ --mm-input-line-height: 1.4;
48
+ --mm-input-font-size: 1rem;
49
+ --mm-input-font-size-sm: 0.875rem;
50
+ --mm-input-font-size-lg: 1.25rem;
51
+ --mm-input-btn-padding-y: 0.5rem;
52
+ --mm-input-btn-padding-y-sm: 0.25rem;
53
+ --mm-input-btn-padding-y-lg: 0.5rem;
54
+ --mm-input-btn-padding-x: 0.75rem;
55
+ --mm-input-btn-padding-x-sm: 0.75rem;
56
+ --mm-input-btn-padding-x-lg: 1.3rem;
57
+ --mm-input-btn-focus-color: rgba(161, 61, 255, 0.4);
58
+
59
+ /* Body */
60
+ --mm-body-bg: var(--mm-black);
61
+ --mm-body-color: var(--mm-gray-100);
62
+
63
+ /* Spacing */
64
+ --mm-spacer: 1rem;
65
+
66
+ /* Border */
67
+ --mm-border-color: #dee2e6;
68
+
69
+ /* Easing functions */
70
+ --mm-ease-in-bounce: cubic-bezier(0.075, 1.5, 0.35, 0.95);
71
+ --mm-ease-in-out-bounce: cubic-bezier(0.9, -0.5, 0.1, 1.5);
72
+ --mm-ease-in-out-soft-sine: cubic-bezier(0.4, 0, 0.6, 1);
73
+ --mm-ease-in-out-sine: cubic-bezier(0.6, 0, 0.4, 1);
74
+ --mm-ease-in-out-hard-sine: cubic-bezier(0.9, 0, 0.1, 1);
75
+ --mm-ease-in-ramp: cubic-bezier(0.6, 0, 1, 0.5);
76
+ --mm-ease-out-ramp: cubic-bezier(0, 0.6, 0.5, 1);
77
+ --mm-ease-in-kickback: cubic-bezier(0.41, 1.69, 0.04, 0.67);
78
+ --mm-ease-in-yo: cubic-bezier(0.21, 2.59, 0, 0.9);
79
+ --mm-ease-in-bump: cubic-bezier(0.4, 1.69, 0, 1);
80
+
81
+ /* Pre-computed rgba values used in component styles */
82
+ --mm-white-60: rgba(255, 255, 255, 0.6);
83
+ --mm-black-50: rgba(28, 28, 28, 0.5);
84
+ }
@@ -0,0 +1,9 @@
1
+ .container {
2
+ &.fullscreen {
3
+ position: absolute;
4
+ top: 0;
5
+ left: 0;
6
+ width: 100%;
7
+ height: 100%;
8
+ }
9
+ }
@@ -1,21 +1,25 @@
1
1
  /* stylelint-disable selector-class-pattern */
2
+
3
+ /* Google Fonts */
2
4
  @import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap');
3
- @import './variables';
4
- @import './placeholders';
5
- @import './mixins';
6
- @import '~bootstrap/scss/bootstrap';
5
+
6
+ /* Bootstrap (pre-compiled) */
7
+ @import 'bootstrap/dist/css/bootstrap.css';
8
+
9
+ /* Theme overrides */
10
+ @import './bootstrap-overrides.css';
11
+ @import './bootstrap-patches.css';
12
+
13
+ /* Uppy */
7
14
  @import '@uppy/core/css/style.min.css';
8
15
  @import '@uppy/dashboard/css/style.min.css';
9
16
 
10
- // TODO add more when needed
11
- @import '~@panneau/fields/scss/styles';
12
- @import '~@panneau/displays/scss/styles';
13
- // @import '~@panneau/actions/scss/styles';
14
- // @import '~@panneau/forms/scss/styles';
15
- // @import '~@panneau/lists/scss/styles';
16
- @import '~@panneau/filters/scss/styles';
17
- // @import '~@panneau/modals/scss/styles';
17
+ /* Panneau packages */
18
+ @import '@panneau/fields/assets/css/styles.css';
19
+ @import '@panneau/displays/assets/css/styles.css';
20
+ @import '@panneau/filters/assets/css/styles.css';
18
21
 
22
+ /* Panneau elements */
19
23
  @import '@panneau/element-button/assets/css/styles.css';
20
24
  @import '@panneau/element-dropdown/assets/css/styles.css';
21
25
  @import '@panneau/element-form-group/assets/css/styles.css';
@@ -26,21 +30,3 @@
26
30
  @import '@panneau/element-media-card/assets/css/styles.css';
27
31
  @import '@panneau/element-media-player/assets/css/styles.css';
28
32
  @import '@panneau/medias/assets/css/styles.css';
29
-
30
- .container-small {
31
- @include make-container();
32
-
33
- @each $breakpoint, $container-small-max-width in $container-small-max-widths {
34
- @include media-breakpoint-up($breakpoint, $grid-breakpoints) {
35
- max-width: $container-small-max-width;
36
- }
37
- }
38
- }
39
-
40
- .dropdown-menu-start {
41
- left: 0;
42
- }
43
-
44
- .dropdown-menu-end {
45
- right: 0;
46
- }
@@ -0,0 +1,15 @@
1
+ .container {
2
+ .box {
3
+ flex-direction: column;
4
+ }
5
+
6
+ .icon {
7
+ margin-bottom: 5px;
8
+ color: var(--mm-black);
9
+ }
10
+
11
+ .label {
12
+ color: var(--mm-black);
13
+ font-size: 0.75em;
14
+ }
15
+ }
package/scss/_mixins.scss DELETED
@@ -1,34 +0,0 @@
1
- @mixin clearfix {
2
- &::after {
3
- content: '';
4
- display: table;
5
- clear: both;
6
- }
7
- }
8
-
9
- @mixin background-grid($size: 30px, $color: black, $background: white) {
10
- background-color: $background;
11
- background-image: linear-gradient(
12
- 45deg,
13
- $color 25%,
14
- transparent 25%,
15
- transparent 75%,
16
- $color 75%,
17
- $color
18
- ),
19
- linear-gradient(45deg, $color 25%, transparent 25%, transparent 75%, $color 75%, $color);
20
- background-position: 0 0, $size $size;
21
- background-size: ($size * 2) ($size * 2);
22
- }
23
-
24
- @mixin match-story-screen($size: 'mobile') {
25
- :global(.story-screen-#{$size}) {
26
- @content;
27
- }
28
- }
29
-
30
- @mixin match-screen($size: 'mobile') {
31
- .screen-#{$size} {
32
- @content;
33
- }
34
- }