@eeacms/volto-tabs-block 5.1.0 → 6.0.1

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.
@@ -13,6 +13,14 @@ const messages = defineMessages({
13
13
  id: 'menu',
14
14
  defaultMessage: 'Menu',
15
15
  },
16
+ MenuPointing: {
17
+ id: 'menu-pointing',
18
+ defaultMessage: 'Pointing',
19
+ },
20
+ MenuSecondary: {
21
+ id: 'menu-secondary',
22
+ defaultMessage: 'Secondary',
23
+ },
16
24
  Style: {
17
25
  id: 'style',
18
26
  defaultMessage: 'Style',
@@ -54,7 +62,12 @@ export default (config, props) => ({
54
62
  {
55
63
  id: 'menu',
56
64
  title: props.intl.formatMessage(messages.Menu),
57
- fields: ['menuInverted', 'accordionIconRight'],
65
+ fields: [
66
+ 'menuInverted',
67
+ 'menuSecondary',
68
+ 'menuPointing',
69
+ 'accordionIconRight',
70
+ ],
58
71
  },
59
72
  {
60
73
  id: 'style',
@@ -77,6 +90,14 @@ export default (config, props) => ({
77
90
  title: props.intl.formatMessage(messages.Inverted),
78
91
  type: 'boolean',
79
92
  },
93
+ menuPointing: {
94
+ title: props.intl.formatMessage(messages.MenuPointing),
95
+ type: 'boolean',
96
+ },
97
+ menuSecondary: {
98
+ title: props.intl.formatMessage(messages.MenuSecondary),
99
+ type: 'boolean',
100
+ },
80
101
  theme: {
81
102
  title: props.intl.formatMessage(messages.Theme),
82
103
  description: props.intl.formatMessage(
@@ -123,8 +123,8 @@ const View = (props) => {
123
123
 
124
124
  React.useEffect(() => {
125
125
  if (!slider.current?.innerSlider?.list) return;
126
- const unfocuseElements = ['a', 'button', 'input'];
127
- unfocuseElements.forEach((tag) => {
126
+ const unfocusedElements = ['a', 'button', 'input'];
127
+ unfocusedElements.forEach((_tag) => {
128
128
  for (let element of slider.current.innerSlider.list.querySelectorAll(
129
129
  ".slick-slide[aria-hidden='true'] a",
130
130
  )) {
@@ -134,10 +134,10 @@ const View = (props) => {
134
134
  }, [activeTab]);
135
135
  React.useEffect(() => {
136
136
  if (!slider.current?.innerSlider?.list) return;
137
- let unaccesibileElements = slider.current.innerSlider.list.querySelectorAll(
137
+ let inaccessibleElements = slider.current.innerSlider.list.querySelectorAll(
138
138
  '.slick-slide',
139
139
  );
140
- for (let element of unaccesibileElements) {
140
+ for (let element of inaccessibleElements) {
141
141
  element.setAttribute('tabindex', '0');
142
142
  element.setAttribute('aria-hidden', 'false');
143
143
  element.style.removeProperty('outline');
@@ -147,7 +147,7 @@ const View = (props) => {
147
147
  carouselDiv.setAttribute('tabindex', '0');
148
148
  }, []);
149
149
 
150
- const panes = tabsList.map((tab, index) => {
150
+ const panes = tabsList.map((tab, _index) => {
151
151
  return {
152
152
  id: tab,
153
153
  renderItem: (
@@ -27,7 +27,7 @@ const View = (props) => {
27
27
  verticalSwiping: true,
28
28
  };
29
29
 
30
- const panes = tabsList.map((tab, index) => {
30
+ const panes = tabsList.map((tab, _index) => {
31
31
  return {
32
32
  id: tab,
33
33
  renderItem: (
@@ -209,7 +209,7 @@ const Edit = (props) => {
209
209
  <Tab.Pane as={isContainer ? Container : undefined}>
210
210
  <BlocksForm
211
211
  allowedBlocks={data?.allowedBlocks}
212
- description={data?.instrunctions?.data}
212
+ description={data?.instructions?.data}
213
213
  manage={manage}
214
214
  metadata={metadata}
215
215
  pathname={props.pathname}
@@ -276,10 +276,7 @@ const Edit = (props) => {
276
276
  menu={{
277
277
  attached: menuPosition.attached,
278
278
  borderless: getDataValue('menuBorderless'),
279
- color:
280
- props?.template === 'accordion' && props?.data?.theme
281
- ? `theme-${props?.data?.theme}`
282
- : getDataValue('menuColor'),
279
+ color: getDataValue('menuColor'),
283
280
  compact: getDataValue('menuCompact'),
284
281
  fluid: getDataValue('menuFluid'),
285
282
  inverted: getDataValue('menuInverted'),
@@ -291,6 +288,7 @@ const Edit = (props) => {
291
288
  text: getDataValue('menuText'),
292
289
  vertical: menuPosition.vertical,
293
290
  className: cx(
291
+ 'tabs-secondary-variant',
294
292
  data.menuAlign,
295
293
  menuPosition.direction === 'left' ? 'border-right' : '',
296
294
  menuPosition.direction === 'right' ? 'border-left' : '',
@@ -171,6 +171,7 @@ const View = (props) => {
171
171
  text: getDataValue('menuText'),
172
172
  vertical: menuPosition.vertical,
173
173
  className: cx(
174
+ 'tabs-secondary-variant',
174
175
  data.menuAlign,
175
176
  menuPosition.direction === 'left' ? 'border-right' : '',
176
177
  menuPosition.direction === 'right' ? 'border-left' : '',
@@ -12,14 +12,14 @@
12
12
  }
13
13
 
14
14
  .remove-menu {
15
- padding-right: 0px !important;
16
- padding-bottom: 0px !important;
15
+ padding-right: 0 !important;
16
+ padding-bottom: 0 !important;
17
17
  overflow-y: hidden;
18
18
  }
19
19
 
20
20
  .remove-menu :not(.RRT__tab--collapsed) {
21
- padding-top: 0px !important;
22
- padding-left: 0px !important;
21
+ padding-top: 0 !important;
22
+ padding-left: 0 !important;
23
23
  border-bottom: none !important;
24
24
  }
25
25
 
@@ -143,13 +143,12 @@
143
143
  }
144
144
  }
145
145
 
146
- .RRT__container {
147
- .inverted {
148
- .RRT__tab.active {
149
- background-color: rgba(0, 0, 0, 0.1) !important;
150
- }
151
- }
146
+ .RRT__accordion.tabs-accordion-icon-left {
147
+ --accordion-title-justify: flex-start;
148
+ --accordion-title-icon-order: 0;
149
+ }
152
150
 
151
+ .RRT__container {
153
152
  > .ui.tab .rah-animating {
154
153
  transition: height 0ms ease 0ms !important;
155
154
 
@@ -157,364 +156,7 @@
157
156
  transition: opacity 0ms ease 0ms !important;
158
157
  }
159
158
  }
160
-
161
- .RRT__tabs.inverted.ui.secondary.pointing.menu:not(.RRT__accordion) {
162
- background-color: @green !important;
163
- }
164
-
165
- .inverted .RRT__tab--collapsed {
166
- background-color: @green !important;
167
- }
168
- }
169
-
170
- .ui.menu.RRT__accordion.tabs-accordion-icon-right {
171
- .tabs-icon {
172
- position: absolute;
173
- right: 0%;
174
- }
175
-
176
- .item {
177
- padding-top: 0.6875rem !important;
178
- padding-bottom: 0.6875rem !important;
179
- }
180
- }
181
-
182
- .ui.menu.RRT__accordion {
183
- &::before {
184
- display: none;
185
- }
186
-
187
- border-bottom: none !important;
188
-
189
- .ui.item {
190
- display: flex;
191
- width: 100%;
192
- padding: 0 1rem !important;
193
- border-bottom: 0.0625rem solid #e6e7e8;
194
- margin: 0 !important;
195
-
196
- .icon {
197
- margin: 0 !important;
198
- }
199
-
200
- .dropdown.icon {
201
- transform: rotate(-90deg);
202
- }
203
-
204
- &.active {
205
- .dropdown.icon {
206
- transform: rotate(0);
207
- }
208
- }
209
- }
210
-
211
- .RRT__tab:not(.active) .icon {
212
- color: #808285;
213
- }
214
-
215
- &.theme-primary {
216
- .ui.item:not(.active):hover {
217
- color: @primaryColor !important;
218
-
219
- .icon {
220
- color: @primaryColor !important;
221
- }
222
- }
223
-
224
- .ui.item.active {
225
- background-color: @primaryColor !important;
226
- color: #fff !important;
227
- }
228
-
229
- .active .menu-item-text {
230
- color: #fff !important;
231
- }
232
- }
233
-
234
- &.theme-secondary {
235
- .ui.item:not(.active):hover {
236
- color: @secondaryColor !important;
237
-
238
- .icon {
239
- color: @secondaryColor !important;
240
- }
241
- }
242
-
243
- .ui.item.active {
244
- background-color: @secondaryColor !important;
245
- color: #fff !important;
246
- }
247
-
248
- .active .menu-item-text {
249
- color: #fff !important;
250
- }
251
- }
252
-
253
- &.theme-tertiary {
254
- .ui.item:not(.active):hover {
255
- color: @tertiaryColor !important;
256
-
257
- .icon {
258
- color: @tertiaryColor !important;
259
- }
260
- }
261
-
262
- .ui.item.active {
263
- background-color: @tertiaryColor !important;
264
- color: #fff !important;
265
- }
266
-
267
- .active .menu-item-text {
268
- color: #fff !important;
269
- }
270
- }
271
-
272
- &.red {
273
- color: @red !important;
274
-
275
- .ui.item.active {
276
- background-color: @red !important;
277
- color: #fff !important;
278
- }
279
-
280
- .active .menu-item-text {
281
- color: #fff !important;
282
- }
283
- }
284
-
285
- &.orange {
286
- .ui.item:hover {
287
- color: @orange !important;
288
- }
289
-
290
- .ui.item.active {
291
- background-color: @orange !important;
292
- color: #fff !important;
293
- }
294
-
295
- .active .menu-item-text {
296
- color: #fff !important;
297
- }
298
- }
299
-
300
- &.yellow {
301
- .ui.item:hover {
302
- color: @yellow !important;
303
- }
304
-
305
- .ui.item.active {
306
- background-color: @yellow !important;
307
- color: #fff !important;
308
- }
309
-
310
- .active .menu-item-text {
311
- color: #fff !important;
312
- }
313
- }
314
-
315
- &.olive {
316
- .ui.item:hover {
317
- color: @olive !important;
318
- }
319
-
320
- .ui.item.active {
321
- background-color: @olive !important;
322
- color: #fff !important;
323
- }
324
-
325
- .active .menu-item-text {
326
- color: #fff !important;
327
- }
328
- }
329
-
330
- &.green {
331
- .ui.item:hover {
332
- color: @green !important;
333
- }
334
-
335
- .ui.item.active {
336
- background-color: @green !important;
337
- color: #fff !important;
338
- }
339
-
340
- .active .menu-item-text {
341
- color: #fff !important;
342
- }
343
- }
344
-
345
- &.teal {
346
- .ui.item:hover {
347
- color: @teal !important;
348
- }
349
-
350
- .ui.item.active {
351
- background-color: @teal !important;
352
- color: #fff !important;
353
- }
354
-
355
- .active .menu-item-text {
356
- color: #fff !important;
357
- }
358
- }
359
-
360
- &.blue {
361
- .ui.item:hover {
362
- color: @blue !important;
363
- }
364
-
365
- .ui.item.active {
366
- background-color: @blue !important;
367
- color: #fff !important;
368
- }
369
-
370
- .active .menu-item-text {
371
- color: #fff !important;
372
- }
373
- }
374
-
375
- &.violet {
376
- .ui.item:hover {
377
- color: @violet !important;
378
- }
379
-
380
- .ui.item.active {
381
- background-color: @violet !important;
382
- color: #fff !important;
383
- }
384
-
385
- .active .menu-item-text {
386
- color: #fff !important;
387
- }
388
- }
389
-
390
- &.purple {
391
- .ui.item:hover {
392
- color: @purple !important;
393
- }
394
-
395
- .ui.item.active {
396
- background-color: @purple !important;
397
- color: #fff !important;
398
- }
399
-
400
- .active .menu-item-text {
401
- color: #fff !important;
402
- }
403
- }
404
-
405
- &.brown {
406
- .ui.item:hover {
407
- color: @brown !important;
408
- }
409
-
410
- .ui.item.active {
411
- background-color: @brown !important;
412
- color: #fff !important;
413
- }
414
- }
415
-
416
- &.grey {
417
- .ui.item:hover {
418
- color: @grey !important;
419
- }
420
-
421
- .ui.item.active {
422
- background-color: @grey !important;
423
- color: #fff !important;
424
- }
425
-
426
- .active .menu-item-text {
427
- color: #fff !important;
428
- }
429
- }
430
-
431
- &.black {
432
- .ui.item:hover {
433
- color: @black !important;
434
- }
435
-
436
- .ui.item.active {
437
- background-color: @black !important;
438
- color: #fff !important;
439
- }
440
-
441
- .active .menu-item-text {
442
- color: #fff !important;
443
- }
444
- }
445
-
446
- .ui.tab {
447
- padding: 1rem;
448
- margin-bottom: 0;
449
- background-color: @accordionTabBackground !important;
450
- }
451
159
  }
452
160
  }
453
161
 
454
- .ui.menu.RRT__tabs {
455
- .item.ui {
456
- color: #323232;
457
- }
458
-
459
- &.theme-primary {
460
- .item.ui:hover {
461
- color: @primaryColor !important;
462
- }
463
-
464
- .item.ui.active {
465
- border-bottom: 0.1875rem solid @primaryColor !important;
466
- color: @primaryColor !important;
467
- }
468
- }
469
-
470
- &.theme-secondary {
471
- .item.ui:hover {
472
- color: @secondaryColor !important;
473
- }
474
-
475
- .item.ui.active {
476
- border-bottom: 0.1875rem solid @secondaryColor !important;
477
- color: @secondaryColor !important;
478
- }
479
- }
480
-
481
- &.theme-tertiary {
482
- .item.ui:hover {
483
- color: @tertiaryColor !important;
484
- }
485
-
486
- .ui.item.active {
487
- border-bottom: 0.1875rem solid @tertiaryColor !important;
488
- color: @tertiaryColor !important;
489
- }
490
- }
491
- }
492
-
493
- .tabs-block {
494
- .theme-primary {
495
- .active.item {
496
- border-bottom: 0.1875rem solid @primaryColor !important;
497
- color: @primaryColor !important;
498
- }
499
- }
500
-
501
- .theme-secondary {
502
- .active.item {
503
- border-bottom: 0.1875rem solid @secondaryColor !important;
504
- color: @secondaryColor !important;
505
- }
506
- }
507
-
508
- .theme-tertiary {
509
- .active.item {
510
- border-bottom: 0.1875rem solid @tertiaryColor !important;
511
- color: @tertiaryColor !important;
512
- }
513
- }
514
- }
515
-
516
- // .tabs-block .ui.menu.RRT__accordion .ui.item .icon {
517
- // color: #808285;
518
- // }
519
-
520
162
  .loadAddonOverrides();
@@ -8,7 +8,6 @@
8
8
  @menuTitleFontSize: 24px;
9
9
  @menuTitleFontWeight: normal;
10
10
  @menuTitleColor: #013C60;
11
- @menuTitleBackgrounnd: none;
12
11
  @menuTitleHoverColor: #013C60;
13
12
  @menuTitleHoverBackground: none;
14
13
 
@@ -18,10 +17,10 @@
18
17
  /* Menu item */
19
18
  @menuItemCountDisplay: none;
20
19
 
21
- @accordionMenuItemBackground: #F3F4F5;
20
+ @accordionMenuItemBackground: #F3F4F5; /* not used */
22
21
  @accordionTabBackground: transparent;
23
22
 
24
23
  /* Theme variables */
25
24
  @primaryColor : #004B7F;
26
25
  @secondaryColor : #007B6C;
27
- @tertiaryColor : #3D5265;
26
+ @tertiaryColor : #3D5265;
@@ -7,6 +7,10 @@
7
7
  .loadAddonVariables();
8
8
 
9
9
  .tabs-block {
10
+ .remove-menu.active {
11
+ overflow: revert; /* needed for edit double click to modify title to remove scrollbar */
12
+ }
13
+
10
14
  .tabs-accessibility {
11
15
  .ui.button.item:focus-visible {
12
16
  outline: 1px dotted #212121 !important;
@@ -2,9 +2,9 @@
2
2
  Tabs block
3
3
  *******************************/
4
4
 
5
- @tabsBlockColor: #000;
5
+ @tabsBlockColor: var(--text-color, #000);
6
6
  @verticalPadding: 1rem;
7
7
  @horizontalPadding: 1rem;
8
8
 
9
9
  /* Tab pane */
10
- @tabPanePadding: @verticalPadding @horizontalPadding;
10
+ @tabPanePadding: @verticalPadding @horizontalPadding;