@citizenplane/pimp 8.2.6 → 8.2.8

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 (31) hide show
  1. package/dist/pimp.es.js +8534 -7922
  2. package/dist/pimp.umd.js +2 -2
  3. package/dist/style.css +1 -1
  4. package/package.json +15 -15
  5. package/src/App.vue +7 -7
  6. package/src/assets/styles/helpers/_functions.scss +2 -2
  7. package/src/assets/styles/variables/_sizing.scss +2 -2
  8. package/src/assets/styles/variables/_spacing.scss +1 -1
  9. package/src/components/atomic-elements/CpBadge.vue +10 -10
  10. package/src/components/buttons/CpButton.vue +23 -20
  11. package/src/components/core/BaseInputLabel/index.vue +2 -1
  12. package/src/components/core/playground-sections/SectionContainer.vue +2 -2
  13. package/src/components/core/playground-sections/SectionListsAndTables.vue +2 -2
  14. package/src/components/core/playground-sections/SectionToggles.vue +1 -1
  15. package/src/components/date-pickers/CpDate/index.scss +17 -17
  16. package/src/components/feedback-indicators/CpAlert.vue +15 -14
  17. package/src/components/feedback-indicators/CpToaster.vue +12 -12
  18. package/src/components/index.js +11 -1
  19. package/src/components/inputs/CpInput.vue +22 -22
  20. package/src/components/inputs/CpTextarea.vue +12 -12
  21. package/src/components/lists-and-table/CpTable/CpTableEmptyState/index.vue +2 -2
  22. package/src/components/lists-and-table/CpTable/index.scss +24 -24
  23. package/src/components/lists-and-table/CpTable/index.vue +1 -1
  24. package/src/components/selects/CpSelect.vue +16 -15
  25. package/src/components/selects/CpSelectMenu/index.vue +25 -25
  26. package/src/components/toggles/CpCheckbox/index.scss +7 -7
  27. package/src/components/toggles/CpRadio/index.scss +5 -5
  28. package/src/components/toggles/CpSwitch/index.vue +7 -7
  29. package/src/components/typography/CpHeading/index.vue +23 -23
  30. package/src/main.js +1 -3
  31. package/src/plugins/toaster.js +1 -9
@@ -126,7 +126,7 @@ export default {
126
126
 
127
127
  <style lang="scss">
128
128
  .cpSelect {
129
- $cp-select-icon-size: pxToEm(20);
129
+ $cp-select-icon-size: px-to-em(20);
130
130
 
131
131
  &__container {
132
132
  position: relative;
@@ -134,7 +134,7 @@ export default {
134
134
  &:after {
135
135
  content: '';
136
136
  position: absolute;
137
- right: pxToEm(12);
137
+ right: px-to-em(12);
138
138
  top: 50%;
139
139
  transform: translateY(-50%);
140
140
  width: $cp-select-icon-size;
@@ -147,20 +147,20 @@ export default {
147
147
 
148
148
  &__inner {
149
149
  @extend %u-text-ellipsis;
150
- box-shadow: inset 0 pxToEm(1) pxToEm(2) rgba(0, 0, 0, 0.12);
150
+ box-shadow: inset 0 px-to-em(1) px-to-em(2) rgba(0, 0, 0, 0.12);
151
151
  outline: none;
152
152
  appearance: none;
153
153
  -webkit-appearance: none;
154
154
  -moz-appearance: none;
155
- border: pxToRem(1) solid $neutral-dark-4;
156
- border-radius: pxToEm(10);
155
+ border: px-to-rem(1) solid $neutral-dark-4;
156
+ border-radius: px-to-em(10);
157
157
  background-color: $neutral-light;
158
158
  width: 100%;
159
159
  height: $component-size-default;
160
160
  color: $neutral-dark;
161
161
  cursor: pointer;
162
- padding: pxToEm(12) calc(#{$cp-select-icon-size} + #{pxToEm(12)} + #{pxToEm(8)}) pxToEm(12) pxToEm(12);
163
- font-size: pxToEm(16);
162
+ padding: px-to-em(12) calc(#{$cp-select-icon-size} + #{px-to-em(12)} + #{px-to-em(8)}) px-to-em(12) px-to-em(12);
163
+ font-size: px-to-em(16);
164
164
 
165
165
  &:hover,
166
166
  &:focus {
@@ -169,7 +169,7 @@ export default {
169
169
  }
170
170
 
171
171
  &:focus {
172
- box-shadow: rgba($secondary-color, 0.1) 0 0 0 pxToRem(4), $secondary-color 0 0 0 pxToRem(0.5);
172
+ box-shadow: rgba($secondary-color, 0.1) 0 0 0 px-to-rem(4), $secondary-color 0 0 0 px-to-rem(0.5);
173
173
  }
174
174
  }
175
175
 
@@ -177,11 +177,11 @@ export default {
177
177
  display: block;
178
178
 
179
179
  &:not(#{&}--isAfter) {
180
- margin-bottom: pxToEm(6);
180
+ margin-bottom: px-to-em(6);
181
181
  }
182
182
 
183
183
  &--isAfter {
184
- margin-top: pxToEm(6);
184
+ margin-top: px-to-em(6);
185
185
  }
186
186
  }
187
187
 
@@ -210,22 +210,23 @@ export default {
210
210
  }
211
211
 
212
212
  .cpSelect__inner:focus {
213
- box-shadow: 0 0 0 pxToEm(3) scale-color($error-color, $lightness: 60%);
213
+ box-shadow: 0 0 0 px-to-em(3) scale-color($error-color, $lightness: 60%);
214
214
  }
215
215
  }
216
216
 
217
217
  &--isLarge {
218
- $cp-select-large-icon-size: pxToEm(24);
219
- $cp-select-large-padding: pxToEm(16);
218
+ $cp-select-large-icon-size: px-to-em(24);
219
+ $cp-select-large-padding: px-to-em(16);
220
220
 
221
221
  .cpSelect__container:after {
222
- right: pxToEm(16);
222
+ right: px-to-em(16);
223
223
  width: $cp-select-large-icon-size;
224
224
  height: $cp-select-large-icon-size;
225
225
  }
226
226
 
227
227
  .cpSelect__inner {
228
- padding: pxToEm(16) calc(#{$cp-select-large-icon-size} + #{pxToEm(16)} + #{pxToEm(8)}) pxToEm(16) pxToEm(16);
228
+ padding: px-to-em(16) calc(#{$cp-select-large-icon-size} + #{px-to-em(16)} + #{px-to-em(8)}) px-to-em(16)
229
+ px-to-em(16);
229
230
  height: $component-size-large;
230
231
  }
231
232
  }
@@ -149,14 +149,14 @@ export default {
149
149
  <style lang="scss">
150
150
  .cpSelectMenu {
151
151
  position: relative;
152
- font-size: pxToEm(16);
152
+ font-size: px-to-em(16);
153
153
 
154
154
  &__button {
155
- box-shadow: inset 0 pxToEm(1) pxToEm(2) rgba(0, 0, 0, 0.12);
156
- border: pxToRem(1) solid $neutral-dark-4;
157
- border-radius: pxToEm(10);
155
+ box-shadow: inset 0 px-to-em(1) px-to-em(2) rgba(0, 0, 0, 0.12);
156
+ border: px-to-rem(1) solid $neutral-dark-4;
157
+ border-radius: px-to-em(10);
158
158
  background: $neutral-light;
159
- padding: pxToEm(12);
159
+ padding: px-to-em(12);
160
160
  width: 100%;
161
161
  height: $component-size-default;
162
162
  display: flex;
@@ -174,7 +174,7 @@ export default {
174
174
 
175
175
  &:focus {
176
176
  outline: none !important;
177
- box-shadow: 0 0 0 pxToEm(3) scale-color($secondary-color, $lightness: 80%);
177
+ box-shadow: 0 0 0 px-to-em(3) scale-color($secondary-color, $lightness: 80%);
178
178
  }
179
179
  }
180
180
 
@@ -183,9 +183,9 @@ export default {
183
183
  }
184
184
 
185
185
  &__icon {
186
- margin-left: pxToEm(12);
187
- width: pxToEm(20);
188
- height: pxToEm(20);
186
+ margin-left: px-to-em(12);
187
+ width: px-to-em(20);
188
+ height: px-to-em(20);
189
189
  flex-shrink: 0;
190
190
  transition: transform 0.2s ease-out;
191
191
 
@@ -199,21 +199,21 @@ export default {
199
199
  position: absolute;
200
200
  top: calc(100% + 4px);
201
201
  left: 0;
202
- border: pxToRem(1) solid $neutral-dark-4;
203
- border-radius: pxToEm(10);
202
+ border: px-to-rem(1) solid $neutral-dark-4;
203
+ border-radius: px-to-em(10);
204
204
  background: $neutral-light;
205
- width: unquote('max(100%, #{pxToRem(250)})');
205
+ width: unquote('max(100%, #{px-to-rem(250)})');
206
206
  font-size: inherit;
207
207
  }
208
208
 
209
209
  .dropdown {
210
210
  svg {
211
- width: pxToEm(18);
212
- height: pxToEm(18);
211
+ width: px-to-em(18);
212
+ height: px-to-em(18);
213
213
  }
214
214
 
215
215
  &__title {
216
- padding: pxToEm(12) pxToEm(8);
216
+ padding: px-to-em(12) px-to-em(8);
217
217
  display: flex;
218
218
  align-items: center;
219
219
  justify-content: space-between;
@@ -223,10 +223,10 @@ export default {
223
223
  }
224
224
 
225
225
  &__filterBar {
226
- border-top: pxToRem(1) solid $neutral-dark-4;
227
- border-bottom: pxToRem(1) solid $neutral-dark-4;
226
+ border-top: px-to-rem(1) solid $neutral-dark-4;
227
+ border-bottom: px-to-rem(1) solid $neutral-dark-4;
228
228
  background-color: rgba($neutral-dark-5, 0.6);
229
- padding: pxToEm(8);
229
+ padding: px-to-em(8);
230
230
  display: flex;
231
231
  align-items: center;
232
232
 
@@ -241,7 +241,7 @@ export default {
241
241
  }
242
242
 
243
243
  i {
244
- margin-right: pxToEm(8);
244
+ margin-right: px-to-em(8);
245
245
  color: $neutral-dark;
246
246
  flex-shrink: 0;
247
247
  }
@@ -250,13 +250,13 @@ export default {
250
250
  &__list {
251
251
  display: flex;
252
252
  flex-direction: column;
253
- min-height: pxToRem(250);
253
+ min-height: px-to-rem(250);
254
254
  }
255
255
 
256
256
  &__items {
257
- margin: pxToEm(4) 0;
257
+ margin: px-to-em(4) 0;
258
258
  padding: 0;
259
- max-height: pxToRem(250);
259
+ max-height: px-to-rem(250);
260
260
  overflow-y: auto;
261
261
 
262
262
  li {
@@ -266,7 +266,7 @@ export default {
266
266
 
267
267
  &__item {
268
268
  position: relative;
269
- padding: pxToEm(8) pxToEm(16) pxToEm(8) pxToEm(36);
269
+ padding: px-to-em(8) px-to-em(16) px-to-em(8) px-to-em(36);
270
270
  width: 100%;
271
271
  display: flex;
272
272
  text-align: initial;
@@ -284,14 +284,14 @@ export default {
284
284
 
285
285
  &__icon {
286
286
  position: absolute;
287
- left: pxToEm(8);
287
+ left: px-to-em(8);
288
288
  top: 50%;
289
289
  transform: translateY(-50%);
290
290
  color: $secondary-color;
291
291
  }
292
292
 
293
293
  &__emptyState {
294
- padding: pxToEm(16) pxToEm(8);
294
+ padding: px-to-em(16) px-to-em(8);
295
295
  flex: 1;
296
296
  display: flex;
297
297
  align-items: center;
@@ -1,8 +1,8 @@
1
1
  @use 'sass:math';
2
2
  @import 'src/assets/styles/main';
3
3
 
4
- $cp-checkbox-base-width: pxToEm(20);
5
- $cp-checkbox-tick-base-width: pxToEm(14);
4
+ $cp-checkbox-base-width: px-to-em(20);
5
+ $cp-checkbox-tick-base-width: px-to-em(14);
6
6
 
7
7
  @mixin cp-checkbox-style($color, $className) {
8
8
  &--is#{$className} input:checked {
@@ -21,7 +21,7 @@ $cp-checkbox-tick-base-width: pxToEm(14);
21
21
  &--is#{$className} input:focus-within {
22
22
  position: relative;
23
23
  z-index: 1;
24
- box-shadow: 0 0 0 pxToEm(3) scale-color($color, $lightness: 70%);
24
+ box-shadow: 0 0 0 px-to-em(3) scale-color($color, $lightness: 70%);
25
25
  border-color: scale-color($color, $lightness: 70%);
26
26
  }
27
27
  }
@@ -30,7 +30,7 @@ $cp-checkbox-tick-base-width: pxToEm(14);
30
30
  position: relative;
31
31
  display: grid;
32
32
  grid-template-columns: min-content 1fr;
33
- grid-gap: pxToRem(12);
33
+ grid-gap: px-to-rem(12);
34
34
  align-items: center;
35
35
  cursor: pointer;
36
36
 
@@ -41,8 +41,8 @@ $cp-checkbox-tick-base-width: pxToEm(14);
41
41
  -webkit-appearance: none;
42
42
  -moz-appearance: none;
43
43
  appearance: none;
44
- border: pxToRem(1) solid $neutral-dark-4;
45
- border-radius: pxToEm(4);
44
+ border: px-to-rem(1) solid $neutral-dark-4;
45
+ border-radius: px-to-em(4);
46
46
  width: $cp-checkbox-base-width;
47
47
  height: $cp-checkbox-base-width;
48
48
  flex-shrink: 0;
@@ -114,7 +114,7 @@ $cp-checkbox-tick-base-width: pxToEm(14);
114
114
  &__label {
115
115
  display: block;
116
116
  font-weight: 500;
117
- line-height: pxToEm(20);
117
+ line-height: px-to-em(20);
118
118
 
119
119
  &--isCapitalized::first-letter {
120
120
  text-transform: capitalize;
@@ -1,7 +1,7 @@
1
1
  @use 'sass:math';
2
2
  @import 'src/assets/styles/main';
3
3
 
4
- $cp-radio-base-width: pxToEm(20);
4
+ $cp-radio-base-width: px-to-em(20);
5
5
 
6
6
  @mixin cp-radio-style($color, $className) {
7
7
  &--is#{$className}#{&}--isActive {
@@ -26,14 +26,14 @@ $cp-radio-base-width: pxToEm(20);
26
26
  }
27
27
 
28
28
  &--is#{$className}:focus-within {
29
- box-shadow: 0 0 0 pxToRem(4) rgba($color, 0.1);
29
+ box-shadow: 0 0 0 px-to-rem(4) rgba($color, 0.1);
30
30
  }
31
31
  }
32
32
 
33
33
  .cpRadio {
34
34
  position: relative;
35
- border: pxToRem(1) solid $neutral-dark-4;
36
- border-radius: pxToRem(10);
35
+ border: px-to-rem(1) solid $neutral-dark-4;
36
+ border-radius: px-to-rem(10);
37
37
  padding: $space-lg $space-md;
38
38
  display: grid;
39
39
  grid-template-columns: min-content 1fr;
@@ -78,7 +78,7 @@ $cp-radio-base-width: pxToEm(20);
78
78
  -webkit-appearance: none;
79
79
  -moz-appearance: none;
80
80
  appearance: none;
81
- border: pxToRem(1) solid $neutral-dark-4;
81
+ border: px-to-rem(1) solid $neutral-dark-4;
82
82
  border-radius: 100%;
83
83
  padding: 25%;
84
84
  width: $cp-radio-base-width;
@@ -102,7 +102,7 @@ export default {
102
102
  }
103
103
 
104
104
  &--is#{$className} &__switch:focus-within {
105
- box-shadow: 0 0 0 pxToEm(3) scale-color($color, $lightness: 70%);
105
+ box-shadow: 0 0 0 px-to-em(3) scale-color($color, $lightness: 70%);
106
106
  }
107
107
 
108
108
  &--is#{$className}:hover:not(#{&}--isDisabled) &__switch {
@@ -120,7 +120,7 @@ export default {
120
120
  }
121
121
 
122
122
  .cpSwitch {
123
- $cp-switch-base-height: pxToEm(24);
123
+ $cp-switch-base-height: px-to-em(24);
124
124
  align-items: center;
125
125
 
126
126
  &,
@@ -131,7 +131,7 @@ export default {
131
131
  &--hasLabel {
132
132
  display: grid;
133
133
  grid-template-columns: min-content 1fr;
134
- grid-gap: pxToRem(12);
134
+ grid-gap: px-to-rem(12);
135
135
  align-items: center;
136
136
  }
137
137
 
@@ -209,7 +209,7 @@ export default {
209
209
  top: 50%;
210
210
  transform: translateY(-50%);
211
211
  opacity: 0;
212
- padding-left: pxToRem(4);
212
+ padding-left: px-to-rem(4);
213
213
  display: flex;
214
214
  align-items: center;
215
215
  justify-content: center;
@@ -230,7 +230,7 @@ export default {
230
230
 
231
231
  &__knobContainer {
232
232
  width: 100%;
233
- padding: pxToRem(2);
233
+ padding: px-to-rem(2);
234
234
  display: flex;
235
235
  align-items: center;
236
236
  transition: transform 0.3s cubic-bezier(0.08, 0.82, 0.17, 1) 0s;
@@ -239,8 +239,8 @@ export default {
239
239
  &__knob {
240
240
  background-color: $neutral-light;
241
241
  border-radius: 100%;
242
- width: calc(#{$cp-switch-base-height} - #{pxToRem(4)});
243
- height: calc(#{$cp-switch-base-height} - #{pxToRem(4)});
242
+ width: calc(#{$cp-switch-base-height} - #{px-to-rem(4)});
243
+ height: calc(#{$cp-switch-base-height} - #{px-to-rem(4)});
244
244
  }
245
245
  }
246
246
  </style>
@@ -45,64 +45,64 @@ export default {
45
45
  }
46
46
 
47
47
  &--100 {
48
- font-size: pxToRem(11);
48
+ font-size: px-to-rem(11);
49
49
  font-weight: 400;
50
- line-height: pxToRem(16);
51
- letter-spacing: pxToEm(0.6);
50
+ line-height: px-to-rem(16);
51
+ letter-spacing: px-to-em(0.6);
52
52
  color: $neutral-dark-1;
53
53
  }
54
54
 
55
55
  &--200 {
56
- font-size: pxToRem(12);
56
+ font-size: px-to-rem(12);
57
57
  font-weight: 600;
58
- line-height: pxToRem(16);
58
+ line-height: px-to-rem(16);
59
59
  color: $neutral-dark-1;
60
60
  }
61
61
 
62
62
  &--300 {
63
- font-size: pxToRem(12);
63
+ font-size: px-to-rem(12);
64
64
  font-weight: 600;
65
- line-height: pxToRem(16);
65
+ line-height: px-to-rem(16);
66
66
  }
67
67
 
68
68
  &--400 {
69
- font-size: pxToRem(14);
69
+ font-size: px-to-rem(14);
70
70
  font-weight: 500;
71
- line-height: pxToRem(18);
71
+ line-height: px-to-rem(18);
72
72
  }
73
73
 
74
74
  &--500 {
75
- font-size: pxToRem(16);
75
+ font-size: px-to-rem(16);
76
76
  font-weight: 500;
77
- line-height: pxToRem(20);
77
+ line-height: px-to-rem(20);
78
78
  }
79
79
 
80
80
  &--600 {
81
- font-size: pxToRem(18);
81
+ font-size: px-to-rem(18);
82
82
  font-weight: 500;
83
- line-height: pxToRem(23);
84
- letter-spacing: pxToEm(0.4);
83
+ line-height: px-to-rem(23);
84
+ letter-spacing: px-to-em(0.4);
85
85
  }
86
86
 
87
87
  &--700 {
88
- font-size: pxToRem(20);
88
+ font-size: px-to-rem(20);
89
89
  font-weight: 500;
90
- line-height: pxToRem(25);
91
- letter-spacing: pxToEm(0.4);
90
+ line-height: px-to-rem(25);
91
+ letter-spacing: px-to-em(0.4);
92
92
  }
93
93
 
94
94
  &--800 {
95
- font-size: pxToRem(29);
95
+ font-size: px-to-rem(29);
96
96
  font-weight: 500;
97
- line-height: pxToRem(32);
98
- letter-spacing: pxToEm(0.4);
97
+ line-height: px-to-rem(32);
98
+ letter-spacing: px-to-em(0.4);
99
99
  }
100
100
 
101
101
  &--900 {
102
- font-size: pxToRem(35);
102
+ font-size: px-to-rem(35);
103
103
  font-weight: 500;
104
- line-height: pxToRem(40);
105
- letter-spacing: pxToEm(0.4);
104
+ line-height: px-to-rem(40);
105
+ letter-spacing: px-to-em(0.4);
106
106
  }
107
107
  }
108
108
  </style>
package/src/main.js CHANGED
@@ -5,10 +5,8 @@ const app = createApp(App)
5
5
 
6
6
  // Plugins
7
7
  import Pimp from './components'
8
- app.use(Pimp)
9
8
 
10
- import Toaster from './plugins/toaster'
11
- app.use(Toaster)
9
+ app.use(Pimp)
12
10
 
13
11
  // Mount
14
12
  app.mount('#app')
@@ -58,12 +58,4 @@ const createToaster = (globalOptions = {}) => {
58
58
  }
59
59
  }
60
60
 
61
- export default {
62
- install(app, options) {
63
- app.component('CpToaster', CpToaster)
64
-
65
- let methods = createToaster(options)
66
- app.$toaster = methods
67
- app.config.globalProperties.$toaster = methods
68
- },
69
- }
61
+ export default createToaster