@citizenplane/pimp 6.3.1 → 6.4.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.
Files changed (35) hide show
  1. package/dist/pimp.common.js +127 -110
  2. package/dist/pimp.common.js.map +1 -1
  3. package/dist/pimp.css +1 -1
  4. package/dist/pimp.umd.js +127 -110
  5. package/dist/pimp.umd.js.map +1 -1
  6. package/dist/pimp.umd.min.js +1 -1
  7. package/dist/pimp.umd.min.js.map +1 -1
  8. package/package-lock.json +48 -48
  9. package/package.json +5 -5
  10. package/src/assets/styles/base/_base.scss +1 -1
  11. package/src/assets/styles/helpers/{_function.scss → _functions.scss} +3 -2
  12. package/src/assets/styles/main.scss +1 -1
  13. package/src/assets/styles/variables/_sizing.scss +1 -1
  14. package/src/assets/styles/variables/_spacing.scss +9 -2
  15. package/src/components/core/playground-sections/SectionButtons.vue +2 -2
  16. package/src/components/core/playground-sections/SectionContainer.vue +2 -2
  17. package/src/components/core/playground-sections/SectionDatePickers.vue +3 -3
  18. package/src/components/core/playground-sections/SectionFeedbackIndicators.vue +2 -2
  19. package/src/components/core/playground-sections/SectionInputs.vue +2 -2
  20. package/src/components/core/playground-sections/SectionListsAndTables.vue +4 -4
  21. package/src/components/core/playground-sections/SectionSelects.vue +2 -2
  22. package/src/components/core/playground-sections/SectionSimpleInputs.vue +2 -2
  23. package/src/components/core/playground-sections/SectionToasters.vue +0 -1
  24. package/src/components/core/playground-sections/SectionToggles.vue +1 -1
  25. package/src/components/date-pickers/CpDate.vue +11 -11
  26. package/src/components/feedback-indicators/CpAlert.vue +6 -7
  27. package/src/components/feedback-indicators/CpToaster.vue +2 -2
  28. package/src/components/lists-and-table/CpTable/{CpTableEmptyState.vue → CpTableEmptyState/index.vue} +4 -4
  29. package/src/components/lists-and-table/CpTable/index.scss +308 -0
  30. package/src/components/lists-and-table/CpTable/index.vue +2 -307
  31. package/src/components/toggles/CpCheckbox/index.scss +120 -0
  32. package/src/components/toggles/CpCheckbox/index.vue +1 -114
  33. package/src/components/toggles/CpRadio/index.scss +156 -0
  34. package/src/components/toggles/CpRadio/index.vue +1 -151
  35. package/src/libs/CoreToaster.vue +40 -27
@@ -0,0 +1,308 @@
1
+ @import "src/assets/styles/main";
2
+
3
+ .cpTable {
4
+ position: relative;
5
+ display: flex;
6
+ flex-direction: column;
7
+
8
+ &__container {
9
+ position: relative;
10
+ display: flex;
11
+ flex-direction: column;
12
+ flex: 1;
13
+
14
+ &--hasPagination {
15
+ border-bottom: pxToRem(1) solid $border-color;
16
+ }
17
+ }
18
+
19
+ /* Standard Tables */
20
+ &__container[role='region'][aria-labelledby][tabindex] {
21
+ overflow: auto;
22
+ }
23
+
24
+ &__container[role='region'][aria-labelledby][tabindex]:focus {
25
+ border-radius: pxToRem(10);
26
+ box-shadow: 0 0 0 pxToEm(3) scale-color($blue, $lightness: 70%);
27
+ }
28
+
29
+ &__container[role='region'][aria-labelledby][tabindex] &__table {
30
+ margin: 0;
31
+ border: none;
32
+ }
33
+
34
+ /* Scrolling Visual Cue */
35
+ &__container[role='region'][aria-labelledby][tabindex] {
36
+ background: linear-gradient(to right, $neutral-light 30%, rgba(255, 255, 255, 0)),
37
+ linear-gradient(to right, rgba($neutral-light, 0), $neutral-light 70%) 0 100%,
38
+ radial-gradient(farthest-side at 0% 50%, rgba($neutral-dark, 0.2), rgba($neutral-dark, 0)),
39
+ radial-gradient(farthest-side at 100% 50%, rgba($neutral-dark, 0.2), rgba($neutral-dark, 0)) 0 100%;
40
+ background-repeat: no-repeat;
41
+ background-color: $neutral-light;
42
+ background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
43
+ background-position: 0 0, 100%, 0 0, 100%;
44
+ background-attachment: local, local, scroll, scroll;
45
+ }
46
+
47
+ &__caption {
48
+ position: sticky;
49
+ left: 0;
50
+ margin-bottom: $space-lg;
51
+ text-align: left;
52
+ font-size: pxToEm(18);
53
+
54
+ &:first-letter {
55
+ text-transform: capitalize;
56
+ }
57
+ }
58
+
59
+ &__table {
60
+ border-collapse: collapse;
61
+ width: 100%;
62
+ }
63
+
64
+ &__row {
65
+ &--body:not(:last-of-type) {
66
+ border-bottom: pxToRem(1) solid $border-color;
67
+ }
68
+
69
+ &--body:not(#{&}--isFullWidth):not(#{&}--isSelected):hover,
70
+ &--body:not(#{&}--isFullWidth):not(#{&}--isSelected):focus,
71
+ &--body:not(#{&}--isFullWidth):not(#{&}--isSelected):focus-within {
72
+ background-color: rgba($neutral-dark, 0.05);
73
+ transition: background-color 0.1s ease-in-out;
74
+ }
75
+
76
+ &--body:not(#{&}--isFullWidth):not(#{&}--isSelected):focus,
77
+ &--body:not(#{&}--isFullWidth):not(#{&}--isSelected):focus-within {
78
+ color: $primary-color;
79
+ }
80
+
81
+ &--isFullWidth td {
82
+ padding: $space;
83
+ background-color: rgba($neutral-dark, 0.03);
84
+ }
85
+
86
+ &--isClickable {
87
+ cursor: pointer;
88
+ }
89
+
90
+ &--isSelected {
91
+ background-color: rgba($primary-color, 0.1);
92
+ color: $primary-color;
93
+ }
94
+
95
+ &--body td {
96
+ font-size: pxToEm(14);
97
+ }
98
+ }
99
+
100
+ &__column {
101
+ position: sticky;
102
+ top: 0;
103
+ z-index: 3;
104
+ background-color: $neutral-light;
105
+ padding: $space $space-md;
106
+ text-align: left;
107
+ white-space: nowrap;
108
+ font-size: pxToEm(12);
109
+ font-weight: normal;
110
+ color: $neutral-dark-1;
111
+
112
+ &:first-letter {
113
+ text-transform: capitalize;
114
+ }
115
+
116
+ /* Workaround for sticky header border-bottom */
117
+ &:after {
118
+ content: '';
119
+ position: absolute;
120
+ bottom: 0;
121
+ left: 0;
122
+ width: 100%;
123
+ height: pxToRem(1);
124
+ background-color: $border-color;
125
+ }
126
+ }
127
+
128
+ &__body {
129
+ vertical-align: middle;
130
+ }
131
+
132
+ &__row--body,
133
+ &__cell {
134
+ vertical-align: inherit;
135
+ }
136
+
137
+ &__cell {
138
+ &:not(#{&}--isFullWidth):not(#{&}--isOptions) {
139
+ padding: $space-lg $space-md;
140
+ white-space: nowrap;
141
+ }
142
+
143
+ &--isFullWidth span,
144
+ &--isOptions {
145
+ position: sticky;
146
+ }
147
+
148
+ &--isFullWidth span {
149
+ left: 50%;
150
+ transform: translateX(-50%);
151
+ display: inline-block;
152
+ }
153
+
154
+ &--isOptions {
155
+ right: 0;
156
+ padding: 0 $space-md;
157
+ }
158
+
159
+ &--isOptions button {
160
+ border: pxToRem(1) solid $border-color;
161
+ border-radius: pxToRem(8);
162
+ background-color: $neutral-light;
163
+ padding: $space-sm;
164
+ color: $neutral-dark-1;
165
+
166
+ &:hover {
167
+ background-color: scale-color($neutral-dark, $lightness: 98%);
168
+ color: $neutral-dark;
169
+ }
170
+ }
171
+
172
+ &--isOptions svg {
173
+ width: pxToRem(16);
174
+ height: pxToRem(16);
175
+ }
176
+ }
177
+
178
+ // On desktop devices, display options only on row focus or hover
179
+ @media (hover: hover) and (pointer: fine) {
180
+ &__cell--isOptions {
181
+ opacity: 0;
182
+ transition: opacity 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.175);
183
+ }
184
+
185
+ &__row:focus &__cell--isOptions,
186
+ &__row:focus-within &__cell--isOptions,
187
+ &__row:hover &__cell--isOptions {
188
+ opacity: 1;
189
+ }
190
+ }
191
+
192
+ &__emptyState {
193
+ flex: 1;
194
+ }
195
+
196
+ &--isLoading &__overlay {
197
+ opacity: 0.5;
198
+ pointer-events: all;
199
+ }
200
+
201
+ &__overlay {
202
+ position: absolute;
203
+ overflow: hidden;
204
+ left: 0;
205
+ right: 0;
206
+ top: 0;
207
+ bottom: 0;
208
+ border-radius: pxToRem(10);
209
+ background-color: $neutral-light;
210
+ z-index: 4;
211
+ opacity: 0;
212
+ transition: 0.15s opacity ease-in-out;
213
+ cursor: wait;
214
+ pointer-events: none;
215
+
216
+ &::after {
217
+ content: '';
218
+ position: absolute;
219
+ top: 0;
220
+ right: 0;
221
+ bottom: 0;
222
+ left: 0;
223
+ transform: translateX(-100%);
224
+ background-image: linear-gradient(
225
+ 90deg,
226
+ rgba($neutral-dark-3, 0) 0,
227
+ rgba($neutral-dark-3, 0.2) 20%,
228
+ rgba($neutral-dark-3, 0.5) 60%,
229
+ rgba($neutral-dark-3, 0)
230
+ );
231
+ animation: shimmer 2s infinite;
232
+ }
233
+
234
+ @keyframes shimmer {
235
+ 100% {
236
+ transform: translateX(100%);
237
+ }
238
+ }
239
+ }
240
+
241
+ &__loader {
242
+ width: pxToRem(32);
243
+ height: pxToRem(32);
244
+
245
+ &--isSmall {
246
+ display: inline-block;
247
+ vertical-align: middle;
248
+ width: pxToRem(24);
249
+ height: pxToRem(24);
250
+ }
251
+ }
252
+
253
+ &__footer {
254
+ padding: $space-lg $space-md 0;
255
+ display: flex;
256
+ align-items: center;
257
+ font-size: pxToEm(14);
258
+ }
259
+
260
+ .footer {
261
+ &__details,
262
+ &__pagination {
263
+ flex: 1;
264
+ }
265
+
266
+ &__results {
267
+ font-variant-numeric: tabular-nums;
268
+ color: $neutral-dark-1;
269
+ }
270
+
271
+ &__results strong {
272
+ color: $neutral-dark;
273
+ }
274
+
275
+ &__pagination {
276
+ text-align: right;
277
+ }
278
+
279
+ &__pagination button {
280
+ box-shadow: 0 pxToRem(1) pxToRem(2) rgba($neutral-dark, 0.08);
281
+ border-radius: pxToRem(10);
282
+ border: pxToRem(1) solid $border-color;
283
+ padding: pxToRem(6) pxToRem(10);
284
+ transition: background-color 0.15s;
285
+
286
+ &:hover {
287
+ background-color: rgba($neutral-dark, 0.05);
288
+ }
289
+
290
+ &:focus {
291
+ box-shadow: 0 0 0 pxToEm(3) scale-color($blue, $lightness: 70%);
292
+ }
293
+
294
+ &:disabled {
295
+ box-shadow: none;
296
+ border-color: $neutral-light-1;
297
+ background-color: $neutral-light-1;
298
+ color: $neutral-dark-2;
299
+ cursor: not-allowed;
300
+ user-select: none;
301
+ }
302
+
303
+ &:last-of-type {
304
+ margin-left: $space;
305
+ }
306
+ }
307
+ }
308
+ }
@@ -54,7 +54,7 @@
54
54
  <template v-else>{{ cellValue }}</template>
55
55
  </slot>
56
56
  </td>
57
- <td v-show="areRowOptionsEnabled(rowData)" class="cpTable__cell--isOptions">
57
+ <td v-show="areRowOptionsEnabled(rowData)" class="cpTable__cell cpTable__cell--isOptions">
58
58
  <button @click.stop="handleRowRightClick({ rowData, rowIndex }, $event)"><more-vertical-icon /></button>
59
59
  </td>
60
60
  </slot>
@@ -428,310 +428,5 @@ export default {
428
428
  </script>
429
429
 
430
430
  <style lang="scss">
431
- .cpTable {
432
- position: relative;
433
- display: flex;
434
- flex-direction: column;
435
-
436
- &__container {
437
- position: relative;
438
- display: flex;
439
- flex-direction: column;
440
- flex: 1;
441
-
442
- &--hasPagination {
443
- border-bottom: pxToRem(1) solid $border-color;
444
- }
445
- }
446
-
447
- /* Standard Tables */
448
- &__container[role='region'][aria-labelledby][tabindex] {
449
- overflow: auto;
450
- }
451
-
452
- &__container[role='region'][aria-labelledby][tabindex]:focus {
453
- border-radius: pxToRem(10);
454
- box-shadow: 0 0 0 pxToEm(3) scale-color($blue, $lightness: 70%);
455
- }
456
-
457
- &__container[role='region'][aria-labelledby][tabindex] &__table {
458
- margin: 0;
459
- border: none;
460
- }
461
-
462
- /* Scrolling Visual Cue */
463
- &__container[role='region'][aria-labelledby][tabindex] {
464
- background: linear-gradient(to right, $neutral-light 30%, rgba(255, 255, 255, 0)),
465
- linear-gradient(to right, rgba($neutral-light, 0), $neutral-light 70%) 0 100%,
466
- radial-gradient(farthest-side at 0% 50%, rgba($neutral-dark, 0.2), rgba($neutral-dark, 0)),
467
- radial-gradient(farthest-side at 100% 50%, rgba($neutral-dark, 0.2), rgba($neutral-dark, 0)) 0 100%;
468
- background-repeat: no-repeat;
469
- background-color: $neutral-light;
470
- background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
471
- background-position: 0 0, 100%, 0 0, 100%;
472
- background-attachment: local, local, scroll, scroll;
473
- }
474
-
475
- &__caption {
476
- position: sticky;
477
- left: 0;
478
- margin-bottom: $spacing-unit * 2;
479
- text-align: left;
480
- font-size: pxToEm(18);
481
-
482
- &:first-letter {
483
- text-transform: capitalize;
484
- }
485
- }
486
-
487
- &__table {
488
- border-collapse: collapse;
489
- width: 100%;
490
- }
491
-
492
- &__row {
493
- &--body:not(:last-of-type) {
494
- border-bottom: pxToRem(1) solid $border-color;
495
- }
496
-
497
- &--body:not(#{&}--isFullWidth):not(#{&}--isSelected):hover,
498
- &--body:not(#{&}--isFullWidth):not(#{&}--isSelected):focus,
499
- &--body:not(#{&}--isFullWidth):not(#{&}--isSelected):focus-within {
500
- background-color: rgba($neutral-dark, 0.05);
501
- transition: background-color 0.1s ease-in-out;
502
- }
503
-
504
- &--body:not(#{&}--isFullWidth):not(#{&}--isSelected):focus,
505
- &--body:not(#{&}--isFullWidth):not(#{&}--isSelected):focus-within {
506
- color: $primary-color;
507
- }
508
-
509
- &--isFullWidth td {
510
- padding: $spacing-unit;
511
- background-color: rgba($neutral-dark, 0.03);
512
- }
513
-
514
- &--isClickable {
515
- cursor: pointer;
516
- }
517
-
518
- &--isSelected {
519
- background-color: rgba($primary-color, 0.1);
520
- color: $primary-color;
521
- }
522
-
523
- &--body td {
524
- font-size: pxToEm(14);
525
- }
526
- }
527
-
528
- &__column {
529
- position: sticky;
530
- top: 0;
531
- z-index: 3;
532
- background-color: $neutral-light;
533
- padding: $spacing-unit $spacing-unit * 1.5;
534
- text-align: left;
535
- white-space: nowrap;
536
- font-size: pxToEm(12);
537
- font-weight: normal;
538
- color: $neutral-dark-1;
539
-
540
- &:first-letter {
541
- text-transform: capitalize;
542
- }
543
-
544
- /* Workaround for sticky header border-bottom */
545
- &:after {
546
- content: '';
547
- position: absolute;
548
- bottom: 0;
549
- left: 0;
550
- width: 100%;
551
- height: pxToRem(1);
552
- background-color: $border-color;
553
- }
554
- }
555
-
556
- &__body {
557
- vertical-align: middle;
558
- }
559
-
560
- &__row--body,
561
- &__cell {
562
- vertical-align: inherit;
563
- }
564
-
565
- &__cell {
566
- &:not(#{&}--isFullWidth) {
567
- padding: $spacing-unit * 2 $spacing-unit * 1.5;
568
- white-space: nowrap;
569
- }
570
-
571
- &--isFullWidth span,
572
- &--isOptions {
573
- position: sticky;
574
- }
575
-
576
- &--isFullWidth span {
577
- left: 50%;
578
- transform: translateX(-50%);
579
- display: inline-block;
580
- }
581
-
582
- &--isOptions {
583
- right: $spacing-unit * 1.5;
584
- padding-left: $spacing-unit * 1.5;
585
- }
586
-
587
- &--isOptions button {
588
- border: pxToRem(1) solid $border-color;
589
- border-radius: pxToRem(8);
590
- background-color: $neutral-light;
591
- padding: $spacing-unit / 2;
592
- color: $neutral-dark-1;
593
-
594
- &:hover {
595
- background-color: scale-color($neutral-dark, $lightness: 98%);
596
- color: $neutral-dark;
597
- }
598
- }
599
-
600
- &--isOptions svg {
601
- width: pxToRem(16);
602
- height: pxToRem(16);
603
- }
604
- }
605
-
606
- // On desktop devices, display options only on row focus or hover
607
- @media (hover: hover) and (pointer: fine) {
608
- &__cell--isOptions {
609
- opacity: 0;
610
- transition: opacity 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.175);
611
- }
612
-
613
- &__row:focus &__cell--isOptions,
614
- &__row:focus-within &__cell--isOptions,
615
- &__row:hover &__cell--isOptions {
616
- opacity: 1;
617
- }
618
- }
619
-
620
- &__emptyState {
621
- flex: 1;
622
- }
623
-
624
- &--isLoading &__overlay {
625
- opacity: 0.5;
626
- pointer-events: all;
627
- }
628
-
629
- &__overlay {
630
- position: absolute;
631
- overflow: hidden;
632
- left: 0;
633
- right: 0;
634
- top: 0;
635
- bottom: 0;
636
- border-radius: pxToRem(10);
637
- background-color: $neutral-light;
638
- z-index: 4;
639
- opacity: 0;
640
- transition: 0.15s opacity ease-in-out;
641
- cursor: wait;
642
- pointer-events: none;
643
-
644
- &::after {
645
- content: '';
646
- position: absolute;
647
- top: 0;
648
- right: 0;
649
- bottom: 0;
650
- left: 0;
651
- transform: translateX(-100%);
652
- background-image: linear-gradient(
653
- 90deg,
654
- rgba($neutral-dark-3, 0) 0,
655
- rgba($neutral-dark-3, 0.2) 20%,
656
- rgba($neutral-dark-3, 0.5) 60%,
657
- rgba($neutral-dark-3, 0)
658
- );
659
- animation: shimmer 2s infinite;
660
- }
661
-
662
- @keyframes shimmer {
663
- 100% {
664
- transform: translateX(100%);
665
- }
666
- }
667
- }
668
-
669
- &__loader {
670
- width: pxToRem(32);
671
- height: pxToRem(32);
672
-
673
- &--isSmall {
674
- display: inline-block;
675
- vertical-align: middle;
676
- width: pxToRem(24);
677
- height: pxToRem(24);
678
- }
679
- }
680
-
681
- &__footer {
682
- padding: $spacing-unit * 2 $spacing-unit * 1.5 0;
683
- display: flex;
684
- align-items: center;
685
- font-size: pxToEm(14);
686
- }
687
-
688
- .footer {
689
- &__details,
690
- &__pagination {
691
- flex: 1;
692
- }
693
-
694
- &__results {
695
- font-variant-numeric: tabular-nums;
696
- color: $neutral-dark-1;
697
- }
698
-
699
- &__results strong {
700
- color: $neutral-dark;
701
- }
702
-
703
- &__pagination {
704
- text-align: right;
705
- }
706
-
707
- &__pagination button {
708
- box-shadow: 0 pxToRem(1) pxToRem(2) rgba($neutral-dark, 0.08);
709
- border-radius: pxToRem(10);
710
- border: pxToRem(1) solid $border-color;
711
- padding: pxToRem(6) pxToRem(10);
712
- transition: background-color 0.15s;
713
-
714
- &:hover {
715
- background-color: rgba($neutral-dark, 0.05);
716
- }
717
-
718
- &:focus {
719
- box-shadow: 0 0 0 pxToEm(3) scale-color($blue, $lightness: 70%);
720
- }
721
-
722
- &:disabled {
723
- box-shadow: none;
724
- border-color: $neutral-light-1;
725
- background-color: $neutral-light-1;
726
- color: $neutral-dark-2;
727
- cursor: not-allowed;
728
- user-select: none;
729
- }
730
-
731
- &:last-of-type {
732
- margin-left: $spacing-unit;
733
- }
734
- }
735
- }
736
- }
431
+ @import 'index';
737
432
  </style>