@citizenplane/pimp 6.1.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 (38) hide show
  1. package/dist/pimp.common.js +1148 -684
  2. package/dist/pimp.common.js.map +1 -1
  3. package/dist/pimp.css +1 -1
  4. package/dist/pimp.umd.js +1148 -684
  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 +129 -106
  9. package/package.json +10 -10
  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/atomic-elements/CpBadge.vue +1 -1
  16. package/src/components/core/playground-sections/SectionButtons.vue +2 -2
  17. package/src/components/core/playground-sections/SectionContainer.vue +2 -2
  18. package/src/components/core/playground-sections/SectionDatePickers.vue +16 -3
  19. package/src/components/core/playground-sections/SectionFeedbackIndicators.vue +2 -2
  20. package/src/components/core/playground-sections/SectionInputs.vue +2 -2
  21. package/src/components/core/playground-sections/SectionListsAndTables.vue +60 -2
  22. package/src/components/core/playground-sections/SectionSelects.vue +2 -2
  23. package/src/components/core/playground-sections/SectionSimpleInputs.vue +2 -2
  24. package/src/components/core/playground-sections/SectionToasters.vue +0 -1
  25. package/src/components/core/playground-sections/SectionToggles.vue +1 -1
  26. package/src/components/date-pickers/CpDate.vue +403 -0
  27. package/src/components/feedback-indicators/CpAlert.vue +6 -7
  28. package/src/components/feedback-indicators/CpToaster.vue +2 -2
  29. package/src/components/index.js +2 -0
  30. package/src/components/lists-and-table/CpTable/{CpTableEmptyState.vue → CpTableEmptyState/index.vue} +4 -4
  31. package/src/components/lists-and-table/CpTable/index.scss +308 -0
  32. package/src/components/lists-and-table/CpTable/index.vue +41 -269
  33. package/src/components/toggles/CpCheckbox/index.scss +120 -0
  34. package/src/components/toggles/CpCheckbox/index.vue +1 -114
  35. package/src/components/toggles/CpRadio/index.scss +156 -0
  36. package/src/components/toggles/CpRadio/index.vue +1 -151
  37. package/src/libs/CoreDatepicker.vue +4 -4
  38. package/src/libs/CoreToaster.vue +40 -27
@@ -0,0 +1,120 @@
1
+ @use 'sass:math';
2
+ @import "src/assets/styles/main";
3
+
4
+ $cp-checkbox-base-width: pxToEm(20);
5
+ $cp-checkbox-tick-base-width: pxToEm(14);
6
+
7
+ @mixin cp-checkbox-style($color, $className) {
8
+ &--is#{$className} input:checked {
9
+ background-color: $color;
10
+ border-color: $color;
11
+ }
12
+
13
+ &--is#{$className}:hover input {
14
+ background-color: scale-color($color, $lightness: 95%);
15
+ }
16
+
17
+ &--is#{$className}:hover input:checked {
18
+ background-color: darken($color, 10%);
19
+ }
20
+
21
+ &--is#{$className} input:focus-within {
22
+ position: relative;
23
+ z-index: 1;
24
+ box-shadow: 0 0 0 pxToEm(3) scale-color($color, $lightness: 70%);
25
+ border-color: scale-color($color, $lightness: 70%);
26
+ }
27
+ }
28
+
29
+ .cpCheckbox {
30
+ position: relative;
31
+ display: grid;
32
+ grid-template-columns: min-content 1fr;
33
+ grid-gap: pxToRem(12);
34
+ align-items: center;
35
+ cursor: pointer;
36
+
37
+ @include cp-checkbox-style($secondary-color, 'Blue');
38
+ @include cp-checkbox-style($primary-color, 'Purple');
39
+
40
+ input {
41
+ -webkit-appearance: none;
42
+ -moz-appearance: none;
43
+ appearance: none;
44
+ border: pxToRem(1) solid $neutral-dark-4;
45
+ border-radius: pxToEm(4);
46
+ width: $cp-checkbox-base-width;
47
+ height: $cp-checkbox-base-width;
48
+ flex-shrink: 0;
49
+ cursor: pointer;
50
+ transition: background-color 0.1s ease-out, transform 0.1s linear;
51
+
52
+ & + svg {
53
+ position: absolute;
54
+ z-index: 2;
55
+ top: 50%;
56
+ left: calc(#{math.div($cp-checkbox-base-width, 2)} - #{math.div($cp-checkbox-tick-base-width, 2)});
57
+ transform: translateY(-50%);
58
+ width: $cp-checkbox-tick-base-width;
59
+ height: $cp-checkbox-tick-base-width;
60
+ stroke: $neutral-light;
61
+ stroke-width: 3;
62
+ opacity: 0;
63
+ transition: opacity 0.2s linear 0.1s;
64
+ }
65
+
66
+ &:checked + svg {
67
+ visibility: visible;
68
+ opacity: 1;
69
+ }
70
+
71
+ &:disabled {
72
+ background-color: $neutral-light-1;
73
+ cursor: not-allowed;
74
+
75
+ & ~ span {
76
+ color: $neutral-dark-1;
77
+ }
78
+ }
79
+
80
+ &:checked:disabled {
81
+ border-color: $neutral-dark-1;
82
+ background-color: $neutral-dark-1;
83
+
84
+ & ~ span {
85
+ color: $neutral-dark-1;
86
+ }
87
+ }
88
+
89
+ &:active:not(:disabled) {
90
+ transform: scale(0.8);
91
+ }
92
+ }
93
+
94
+ &--isDisabled {
95
+ cursor: not-allowed;
96
+ }
97
+
98
+ &--isReversed {
99
+ grid-template-columns: 1fr min-content;
100
+
101
+ .cpCheckbox__label {
102
+ grid-row: 1;
103
+ }
104
+
105
+ input + svg {
106
+ left: auto;
107
+ right: calc(#{math.div($cp-checkbox-base-width, 2)} - #{math.div($cp-checkbox-tick-base-width, 2)});
108
+ }
109
+ }
110
+
111
+ &__label {
112
+ display: block;
113
+ font-weight: 500;
114
+ line-height: pxToEm(20);
115
+
116
+ &--isCapitalized::first-letter {
117
+ text-transform: capitalize;
118
+ }
119
+ }
120
+ }
@@ -113,118 +113,5 @@ export default {
113
113
  </script>
114
114
 
115
115
  <style lang="scss">
116
- @mixin cp-checkbox-style($color, $className) {
117
- &--is#{$className} input:checked {
118
- background-color: $color;
119
- border-color: $color;
120
- }
121
-
122
- &--is#{$className}:hover input {
123
- background-color: scale-color($color, $lightness: 95%);
124
- }
125
-
126
- &--is#{$className}:hover input:checked {
127
- background-color: darken($color, 10%);
128
- }
129
-
130
- &--is#{$className} input:focus-within {
131
- position: relative;
132
- z-index: 1;
133
- box-shadow: 0 0 0 pxToEm(3) scale-color($color, $lightness: 70%);
134
- border-color: scale-color($color, $lightness: 70%);
135
- }
136
- }
137
-
138
- .cpCheckbox {
139
- $cp-checkbox-base-width: pxToEm(20);
140
- $cp-checkbox-tick-base-width: pxToEm(14);
141
- position: relative;
142
- display: grid;
143
- grid-template-columns: min-content 1fr;
144
- grid-gap: pxToRem(12);
145
- align-items: center;
146
- cursor: pointer;
147
-
148
- @include cp-checkbox-style($secondary-color, 'Blue');
149
- @include cp-checkbox-style($primary-color, 'Purple');
150
-
151
- input {
152
- -webkit-appearance: none;
153
- -moz-appearance: none;
154
- appearance: none;
155
- border: pxToRem(1) solid $neutral-dark-4;
156
- border-radius: pxToEm(4);
157
- width: $cp-checkbox-base-width;
158
- height: $cp-checkbox-base-width;
159
- flex-shrink: 0;
160
- cursor: pointer;
161
- transition: background-color 0.1s ease-out;
162
-
163
- & + svg {
164
- position: absolute;
165
- z-index: 2;
166
- top: 50%;
167
- left: calc(#{$cp-checkbox-base-width / 2} - #{$cp-checkbox-tick-base-width / 2});
168
- transform: translateY(-50%);
169
- width: $cp-checkbox-tick-base-width;
170
- height: $cp-checkbox-tick-base-width;
171
- stroke: $neutral-light;
172
- stroke-width: 3;
173
- opacity: 0;
174
- transition: opacity 0.2s linear 0.1s;
175
- }
176
-
177
- &:checked {
178
- & + svg {
179
- visibility: visible;
180
- opacity: 1;
181
- }
182
- }
183
-
184
- &:disabled {
185
- background-color: $neutral-light-1;
186
- cursor: not-allowed;
187
-
188
- & ~ span {
189
- color: $neutral-dark-1;
190
- }
191
- }
192
-
193
- &:checked:disabled {
194
- border-color: $neutral-dark-1;
195
- background-color: $neutral-dark-1;
196
-
197
- & ~ span {
198
- color: $neutral-dark-1;
199
- }
200
- }
201
- }
202
-
203
- &--isDisabled {
204
- cursor: not-allowed;
205
- }
206
-
207
- &--isReversed {
208
- grid-template-columns: 1fr min-content;
209
-
210
- .cpCheckbox__label {
211
- grid-row: 1;
212
- }
213
-
214
- input + svg {
215
- left: auto;
216
- right: calc(#{$cp-checkbox-base-width / 2} - #{$cp-checkbox-tick-base-width / 2});
217
- }
218
- }
219
-
220
- &__label {
221
- display: block;
222
- font-weight: 500;
223
- line-height: pxToEm(20);
224
-
225
- &--isCapitalized::first-letter {
226
- text-transform: capitalize;
227
- }
228
- }
229
- }
116
+ @import 'index';
230
117
  </style>
@@ -0,0 +1,156 @@
1
+ @use 'sass:math';
2
+ @import "src/assets/styles/main";
3
+
4
+ $cp-radio-base-width: pxToEm(20);
5
+ $cp-radio-tick-base-width: pxToEm(8);
6
+
7
+ @mixin cp-radio-style($color, $className) {
8
+ &--is#{$className}#{&}--isActive {
9
+ border-color: $color;
10
+ }
11
+
12
+ &--is#{$className} input:checked {
13
+ background-color: $color;
14
+ border-color: $color;
15
+
16
+ & ~ span .cpRadio {
17
+ &__label,
18
+ &__additionalData {
19
+ color: $color;
20
+ }
21
+ }
22
+ }
23
+
24
+ &--is#{$className}:hover,
25
+ &--is#{$className}:focus-within {
26
+ border-color: $color;
27
+ }
28
+
29
+ &--is#{$className}:focus-within {
30
+ box-shadow: 0 0 0 pxToRem(4) rgba($color, 0.1);
31
+ }
32
+ }
33
+
34
+ .cpRadio {
35
+ position: relative;
36
+ border: pxToRem(1) solid $neutral-dark-4;
37
+ border-radius: pxToRem(10);
38
+ padding: $space-lg $space-md;
39
+ display: grid;
40
+ grid-template-columns: min-content 1fr;
41
+ grid-gap: $space-md;
42
+ align-items: center;
43
+ cursor: pointer;
44
+
45
+ @include cp-radio-style($secondary-color, 'Blue');
46
+ @include cp-radio-style($primary-color, 'Purple');
47
+
48
+ &--isDisabled {
49
+ background-color: $neutral-light-1;
50
+ cursor: not-allowed;
51
+ color: $neutral-dark-1;
52
+
53
+ &:hover,
54
+ &:focus {
55
+ box-shadow: none;
56
+ border-color: $neutral-dark-4;
57
+ }
58
+ }
59
+
60
+ &--isActive#{&}--isDisabled,
61
+ &--isActive#{&}--isDisabled:hover {
62
+ border-color: $neutral-dark-4;
63
+ }
64
+
65
+ &:not(:last-of-type) {
66
+ margin-bottom: $space-md;
67
+ }
68
+
69
+ input {
70
+ -webkit-appearance: none;
71
+ -moz-appearance: none;
72
+ appearance: none;
73
+ border: pxToRem(1) solid $neutral-dark-4;
74
+ border-radius: 100%;
75
+ width: $cp-radio-base-width;
76
+ height: $cp-radio-base-width;
77
+ flex-shrink: 0;
78
+ display: grid;
79
+ place-items: center;
80
+ cursor: pointer;
81
+ transition: transform 0.1s linear;
82
+
83
+ &:before {
84
+ content: "";
85
+ display: block;
86
+ width: $cp-radio-tick-base-width;
87
+ height: $cp-radio-tick-base-width;
88
+ border-radius: 100%;
89
+ background-color: $neutral-light;
90
+ transition: transform 0.15s linear;
91
+ transform: scale(0);
92
+ transform-origin: center;
93
+ }
94
+
95
+ &:active:not(:disabled) {
96
+ transform: scale(0.8);
97
+ }
98
+
99
+ &:checked:before {
100
+ transform: scale(1);
101
+ }
102
+
103
+ &:checked:disabled {
104
+ border-color: $neutral-dark-1;
105
+ background-color: $neutral-dark-1;
106
+ }
107
+
108
+ &:checked:disabled ~ span .cpRadio {
109
+ &__label,
110
+ &__additionalData {
111
+ color: $neutral-dark-1;
112
+ }
113
+ }
114
+ }
115
+
116
+ &__content {
117
+ display: flex;
118
+ align-items: center;
119
+ line-height: 1.3;
120
+ }
121
+
122
+ &__information {
123
+ flex-grow: 2;
124
+ display: flex;
125
+ align-items: center;
126
+ justify-content: space-between;
127
+ flex-wrap: wrap;
128
+ text-transform: capitalize;
129
+ margin: 0 -$space;
130
+ }
131
+
132
+ &__label,
133
+ &__description {
134
+ margin: 0 $space;
135
+ flex-grow: 1;
136
+ }
137
+
138
+ &__label,
139
+ &__additionalData {
140
+ font-weight: 500;
141
+ }
142
+
143
+ &__description,
144
+ &__additionalData {
145
+ color: $neutral-dark-1;
146
+ }
147
+
148
+ &__label {
149
+ white-space: nowrap;
150
+ }
151
+
152
+ &__additionalData {
153
+ text-align: right;
154
+ margin-left: $space-lg;
155
+ }
156
+ }
@@ -10,7 +10,6 @@
10
10
  :name="groupName"
11
11
  @change="onChange(radioValue)"
12
12
  />
13
- <check-icon />
14
13
  <span class="cpRadio__content">
15
14
  <span class="cpRadio__information">
16
15
  <span class="cpRadio__label">{{ radioLabel }}</span>
@@ -22,15 +21,10 @@
22
21
  </template>
23
22
 
24
23
  <script>
25
- import { CheckIcon } from 'vue-feather-icons'
26
-
27
24
  import { capitalizeFirstLetter, randomString } from '@/helpers'
28
25
  import { ToggleColors } from '@/constants'
29
26
 
30
27
  export default {
31
- components: {
32
- CheckIcon,
33
- },
34
28
  props: {
35
29
  radioValue: {
36
30
  type: String,
@@ -110,149 +104,5 @@ export default {
110
104
  </script>
111
105
 
112
106
  <style lang="scss">
113
- @mixin cp-radio-style($color, $className) {
114
- &--is#{$className}#{&}--isActive {
115
- border-color: $color;
116
- }
117
-
118
- &--is#{$className} input:checked {
119
- background-color: $color;
120
- border-color: $color;
121
-
122
- & ~ span .cpRadio {
123
- &__label,
124
- &__additionalData {
125
- color: $color;
126
- }
127
- }
128
- }
129
-
130
- &--is#{$className}:hover,
131
- &--is#{$className}:focus-within {
132
- border-color: $color;
133
- }
134
-
135
- &--is#{$className}:focus-within {
136
- box-shadow: 0 0 0 pxToRem(4) rgba($color, 0.1);
137
- }
138
- }
139
-
140
- .cpRadio {
141
- position: relative;
142
- border: pxToRem(1) solid $neutral-dark-4;
143
- border-radius: pxToRem(10);
144
- padding: pxToRem(16) pxToRem(12);
145
- display: grid;
146
- grid-template-columns: min-content 1fr;
147
- grid-gap: pxToRem(12);
148
- align-items: center;
149
- cursor: pointer;
150
-
151
- @include cp-radio-style($secondary-color, 'Blue');
152
- @include cp-radio-style($primary-color, 'Purple');
153
-
154
- &--isDisabled {
155
- background-color: $neutral-light-1;
156
- cursor: not-allowed;
157
- color: $neutral-dark-1;
158
-
159
- &:hover,
160
- &:focus {
161
- box-shadow: none;
162
- border-color: $neutral-dark-4;
163
- }
164
- }
165
-
166
- &--isActive#{&}--isDisabled,
167
- &--isActive#{&}--isDisabled:hover {
168
- border-color: $neutral-dark-4;
169
- }
170
-
171
- &:not(:last-of-type) {
172
- margin-bottom: pxToRem(12);
173
- }
174
-
175
- input {
176
- -webkit-appearance: none;
177
- -moz-appearance: none;
178
- appearance: none;
179
- border: pxToRem(1) solid $neutral-dark-4;
180
- border-radius: 100%;
181
- width: pxToRem(20);
182
- height: pxToRem(20);
183
- flex-shrink: 0;
184
- cursor: pointer;
185
-
186
- & + svg {
187
- position: absolute;
188
- top: 50%;
189
- left: calc(#{pxToRem(12)} + #{pxToRem(10)} - #{pxToRem(7)});
190
- transform: translateY(-50%);
191
- width: pxToEm(14);
192
- height: pxToEm(14);
193
- stroke: $neutral-light;
194
- stroke-width: pxToRem(3);
195
- opacity: 0;
196
- transition: opacity 0.2s linear;
197
- }
198
-
199
- &:checked + svg {
200
- visibility: visible;
201
- opacity: 1;
202
- }
203
-
204
- &:checked:disabled {
205
- border-color: $neutral-dark-1;
206
- background-color: $neutral-dark-1;
207
- }
208
-
209
- &:checked:disabled ~ span .cpRadio {
210
- &__label,
211
- &__additionalData {
212
- color: $neutral-dark-1;
213
- }
214
- }
215
- }
216
-
217
- &__content {
218
- display: flex;
219
- align-items: center;
220
- line-height: 1.3;
221
- }
222
-
223
- &__information {
224
- flex-grow: 2;
225
- display: flex;
226
- align-items: center;
227
- justify-content: space-between;
228
- flex-wrap: wrap;
229
- text-transform: capitalize;
230
- margin: 0 -$spacing-unit;
231
- }
232
-
233
- &__label,
234
- &__description {
235
- margin: 0 $spacing-unit;
236
- flex-grow: 1;
237
- }
238
-
239
- &__label,
240
- &__additionalData {
241
- font-weight: 500;
242
- }
243
-
244
- &__description,
245
- &__additionalData {
246
- color: $neutral-dark-1;
247
- }
248
-
249
- &__label {
250
- white-space: nowrap;
251
- }
252
-
253
- &__additionalData {
254
- text-align: right;
255
- margin-left: $spacing-unit * 2;
256
- }
257
- }
107
+ @import 'index';
258
108
  </style>
@@ -1262,16 +1262,16 @@ degrade()
1262
1262
  span
1263
1263
  color $neutral-light !important
1264
1264
 
1265
- &--disabled,
1266
- &--empty
1267
- color $neutral-dark-1
1268
- opacity 0.5
1265
+ &--disabled .asd__day-number,
1266
+ &--empty .asd__day-number
1267
+ color $neutral-dark-3 !important
1269
1268
 
1270
1269
  button
1271
1270
  cursor default
1272
1271
 
1273
1272
  &--today .asd__day-button .asd__day-number
1274
1273
  color $primary-color
1274
+ font-weight 600
1275
1275
 
1276
1276
  &--recurency
1277
1277
  &:not(.asd__selected-date-one):not(.asd__selected-date-two)