@citizenplane/pimp 8.9.5 → 8.11.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 (54) hide show
  1. package/dist/pimp.es.js +5051 -4622
  2. package/dist/pimp.umd.js +9 -2
  3. package/dist/style.css +1 -1
  4. package/package.json +15 -16
  5. package/src/App.vue +9 -9
  6. package/src/assets/styles/base/_base.scss +4 -4
  7. package/src/assets/styles/helpers/_keyframes.scss +0 -25
  8. package/src/assets/styles/helpers/_mixins.scss +23 -2
  9. package/src/assets/styles/main.scss +2 -16
  10. package/src/assets/styles/variables/_colors.scss +2 -0
  11. package/src/assets/styles/variables/_sizing.scss +3 -3
  12. package/src/assets/styles/variables/_spacing.scss +2 -2
  13. package/src/components/atomic-elements/CpBadge.vue +33 -33
  14. package/src/components/atomic-elements/CpDialog.vue +19 -19
  15. package/src/components/atomic-elements/CpTooltip.vue +6 -6
  16. package/src/components/buttons/CpButton.vue +53 -57
  17. package/src/components/core/{BaseInputLabel/index.vue → BaseInputLabel.vue} +3 -3
  18. package/src/components/core/playground-sections/SectionAtomicElements.vue +1 -1
  19. package/src/components/core/playground-sections/SectionButtons.vue +2 -2
  20. package/src/components/core/playground-sections/SectionContainer.vue +5 -5
  21. package/src/components/core/playground-sections/SectionDatePickers.vue +3 -3
  22. package/src/components/core/playground-sections/SectionDialog.vue +1 -1
  23. package/src/components/core/playground-sections/SectionFeedbackIndicators.vue +2 -2
  24. package/src/components/core/playground-sections/SectionInputs.vue +2 -2
  25. package/src/components/core/playground-sections/SectionListsAndTables.vue +9 -9
  26. package/src/components/core/playground-sections/SectionSelects.vue +2 -2
  27. package/src/components/core/playground-sections/SectionSimpleInputs.vue +2 -2
  28. package/src/components/core/playground-sections/SectionToggles.vue +4 -4
  29. package/src/components/date-pickers/CpCalendar.vue +14 -14
  30. package/src/components/date-pickers/{CpDate/index.vue → CpDate.vue} +165 -1
  31. package/src/components/date-pickers/CpDatepicker.vue +1 -1
  32. package/src/components/feedback-indicators/CpAlert.vue +22 -22
  33. package/src/components/feedback-indicators/CpToaster.vue +36 -38
  34. package/src/components/index.js +7 -7
  35. package/src/components/inputs/CpInput.vue +55 -55
  36. package/src/components/inputs/CpTextarea.vue +20 -20
  37. package/src/components/lists-and-table/CpTable.vue +722 -0
  38. package/src/components/lists-and-table/{CpTable/CpTableEmptyState/index.vue → CpTableEmptyState.vue} +9 -9
  39. package/src/components/selects/CpSelect.vue +29 -28
  40. package/src/components/selects/{CpSelectMenu/index.vue → CpSelectMenu.vue} +40 -41
  41. package/src/components/toggles/{CpCheckbox/index.vue → CpCheckbox.vue} +133 -1
  42. package/src/components/toggles/CpRadio.vue +253 -0
  43. package/src/components/toggles/{CpSwitch/index.vue → CpSwitch.vue} +19 -19
  44. package/src/components/typography/{CpHeading/index.vue → CpHeading.vue} +26 -26
  45. package/src/constants/index.js +1 -0
  46. package/src/constants/src/CpTableConfig.js +14 -0
  47. package/src/libs/CoreDatepicker.vue +383 -308
  48. package/src/assets/styl/colors.styl +0 -39
  49. package/src/components/date-pickers/CpDate/index.scss +0 -165
  50. package/src/components/lists-and-table/CpTable/index.scss +0 -325
  51. package/src/components/lists-and-table/CpTable/index.vue +0 -438
  52. package/src/components/toggles/CpCheckbox/index.scss +0 -136
  53. package/src/components/toggles/CpRadio/index.scss +0 -160
  54. package/src/components/toggles/CpRadio/index.vue +0 -97
@@ -23,27 +23,27 @@ export default {
23
23
 
24
24
  <style lang="scss">
25
25
  .cpTableEmptyState {
26
- padding: 10vh $space-lg;
26
+ padding: 10vh sp.$space-lg;
27
27
  display: flex;
28
28
  align-items: center;
29
29
  justify-content: center;
30
30
 
31
31
  &__icon {
32
- margin-bottom: $space-xl;
33
- border-radius: px-to-rem(4);
32
+ margin-bottom: sp.$space-xl;
33
+ border-radius: fn.px-to-rem(4);
34
34
  display: inline-block;
35
- background-color: $neutral-light-1;
36
- padding: $space-lg;
37
- color: $neutral-dark-1;
35
+ background-color: colors.$neutral-light-1;
36
+ padding: sp.$space-lg;
37
+ color: colors.$neutral-dark-1;
38
38
  }
39
39
 
40
40
  &__headline {
41
- margin-bottom: $space;
42
- font-size: px-to-em(20);
41
+ margin-bottom: sp.$space;
42
+ font-size: fn.px-to-em(20);
43
43
  }
44
44
 
45
45
  &__description {
46
- color: $neutral-dark-1;
46
+ color: colors.$neutral-dark-1;
47
47
  }
48
48
  }
49
49
  </style>
@@ -35,7 +35,7 @@
35
35
  <script>
36
36
  import { randomString } from '@/helpers'
37
37
 
38
- import BaseInputLabel from '@/components/core/BaseInputLabel/index.vue'
38
+ import BaseInputLabel from '@/components/core/BaseInputLabel.vue'
39
39
  import TransitionExpand from '@/components/helpers-utilities/TransitionExpand.vue'
40
40
 
41
41
  export default {
@@ -130,7 +130,7 @@ export default {
130
130
 
131
131
  <style lang="scss">
132
132
  .cpSelect {
133
- $cp-select-icon-size: px-to-em(20);
133
+ $cp-select-icon-size: fn.px-to-em(20);
134
134
 
135
135
  &__container {
136
136
  position: relative;
@@ -138,7 +138,7 @@ export default {
138
138
  &:after {
139
139
  content: '';
140
140
  position: absolute;
141
- right: px-to-em(12);
141
+ right: fn.px-to-em(12);
142
142
  top: 50%;
143
143
  transform: translateY(-50%);
144
144
  width: $cp-select-icon-size;
@@ -151,31 +151,32 @@ export default {
151
151
 
152
152
  &__inner {
153
153
  @extend %u-text-ellipsis;
154
- box-shadow: inset 0 px-to-em(1) px-to-em(2) rgba(0, 0, 0, 0.12);
154
+ box-shadow: inset 0 fn.px-to-em(1) fn.px-to-em(2) rgba(0, 0, 0, 0.12);
155
155
  outline: none;
156
156
  appearance: none;
157
157
  -webkit-appearance: none;
158
158
  -moz-appearance: none;
159
- border: px-to-rem(1) solid $neutral-dark-4;
160
- border-radius: px-to-em(10);
161
- background-color: $neutral-light;
159
+ border: fn.px-to-rem(1) solid colors.$neutral-dark-4;
160
+ border-radius: fn.px-to-em(10);
161
+ background-color: colors.$neutral-light;
162
162
  width: 100%;
163
- height: $component-size-default;
164
- color: $neutral-dark;
163
+ height: sizing.$component-size-default;
164
+ color: colors.$neutral-dark;
165
165
  cursor: pointer;
166
- 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);
167
- font-size: px-to-em(16);
166
+ padding: fn.px-to-em(12) calc(#{$cp-select-icon-size} + #{fn.px-to-em(12)} + #{fn.px-to-em(8)}) fn.px-to-em(12)
167
+ fn.px-to-em(12);
168
+ font-size: fn.px-to-em(16);
168
169
 
169
170
  &:hover,
170
171
  &:focus {
171
- border-color: $secondary-color;
172
- background-color: $neutral-light;
172
+ border-color: colors.$primary-color;
173
+ background-color: colors.$neutral-light;
173
174
  }
174
175
 
175
176
  &:focus {
176
177
  box-shadow:
177
- rgba($secondary-color, 0.1) 0 0 0 px-to-rem(4),
178
- $secondary-color 0 0 0 px-to-rem(0.5);
178
+ rgba(colors.$primary-color, 0.1) 0 0 0 fn.px-to-rem(4),
179
+ colors.$primary-color 0 0 0 fn.px-to-rem(0.5);
179
180
  }
180
181
  }
181
182
 
@@ -183,24 +184,24 @@ export default {
183
184
  display: block;
184
185
 
185
186
  &:not(#{&}--isAfter) {
186
- margin-bottom: px-to-em(6);
187
+ margin-bottom: fn.px-to-em(6);
187
188
  }
188
189
 
189
190
  &--isAfter {
190
- margin-top: px-to-em(6);
191
+ margin-top: fn.px-to-em(6);
191
192
  }
192
193
  }
193
194
 
194
195
  &--isDisabled {
195
196
  .cpSelect__inner {
196
- border-color: $neutral-dark-4 !important;
197
- background: $neutral-light-1;
197
+ border-color: colors.$neutral-dark-4 !important;
198
+ background: colors.$neutral-light-1;
198
199
  }
199
200
 
200
201
  .cpSelect__inner,
201
202
  .cpSelect__container:after {
202
203
  cursor: not-allowed;
203
- color: $neutral-dark-2;
204
+ color: colors.$neutral-dark-2;
204
205
  }
205
206
 
206
207
  .cpSelect__container:after {
@@ -212,28 +213,28 @@ export default {
212
213
  .cpSelect__inner,
213
214
  .cpSelect__inner:hover,
214
215
  .cpSelect__inner:focus {
215
- border-color: $error-color;
216
+ border-color: colors.$error-color;
216
217
  }
217
218
 
218
219
  .cpSelect__inner:focus {
219
- box-shadow: 0 0 0 px-to-em(3) scale-color($error-color, $lightness: 60%);
220
+ box-shadow: 0 0 0 fn.px-to-em(3) color.scale(colors.$error-color, $lightness: 60%);
220
221
  }
221
222
  }
222
223
 
223
224
  &--isLarge {
224
- $cp-select-large-icon-size: px-to-em(24);
225
- $cp-select-large-padding: px-to-em(16);
225
+ $cp-select-large-icon-size: fn.px-to-em(24);
226
+ $cp-select-large-padding: fn.px-to-em(16);
226
227
 
227
228
  .cpSelect__container:after {
228
- right: px-to-em(16);
229
+ right: fn.px-to-em(16);
229
230
  width: $cp-select-large-icon-size;
230
231
  height: $cp-select-large-icon-size;
231
232
  }
232
233
 
233
234
  .cpSelect__inner {
234
- padding: px-to-em(16) calc(#{$cp-select-large-icon-size} + #{px-to-em(16)} + #{px-to-em(8)}) px-to-em(16)
235
- px-to-em(16);
236
- height: $component-size-large;
235
+ padding: fn.px-to-em(16) calc(#{$cp-select-large-icon-size} + #{fn.px-to-em(16)} + #{fn.px-to-em(8)})
236
+ fn.px-to-em(16) fn.px-to-em(16);
237
+ height: sizing.$component-size-large;
237
238
  }
238
239
  }
239
240
  }
@@ -47,7 +47,7 @@
47
47
  </template>
48
48
 
49
49
  <script>
50
- import anime from 'animejs'
50
+ import { animate } from 'animejs'
51
51
 
52
52
  export default {
53
53
  props: {
@@ -105,12 +105,11 @@ export default {
105
105
  },
106
106
  methods: {
107
107
  enter() {
108
- anime({
109
- targets: this.$refs.dropdownRef,
108
+ animate(this.$refs.dropdownRef, {
110
109
  scale: [0.8, 1],
111
110
  opacity: [0, 1],
112
111
  duration: 200,
113
- easing: 'cubicBezier(0.175, 0.885, 0.32, 1.175)',
112
+ ease: 'cubicBezier(0.175, 0.885, 0.32, 1.175)',
114
113
  })
115
114
  },
116
115
  toggleDropdown() {
@@ -149,16 +148,16 @@ export default {
149
148
  <style lang="scss">
150
149
  .cpSelectMenu {
151
150
  position: relative;
152
- font-size: px-to-em(16);
151
+ font-size: fn.px-to-em(16);
153
152
 
154
153
  &__button {
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
- background: $neutral-light;
159
- padding: px-to-em(12);
154
+ box-shadow: inset 0 fn.px-to-em(1) fn.px-to-em(2) rgba(0, 0, 0, 0.12);
155
+ border: fn.px-to-rem(1) solid colors.$neutral-dark-4;
156
+ border-radius: fn.px-to-em(10);
157
+ background: colors.$neutral-light;
158
+ padding: fn.px-to-em(12);
160
159
  width: 100%;
161
- height: $component-size-default;
160
+ height: sizing.$component-size-default;
162
161
  display: flex;
163
162
  align-items: center;
164
163
  justify-content: space-between;
@@ -169,12 +168,12 @@ export default {
169
168
  &:hover,
170
169
  &:active,
171
170
  &:focus {
172
- border-color: $secondary-color;
171
+ border-color: colors.$secondary-color;
173
172
  }
174
173
 
175
174
  &:focus {
176
175
  outline: none !important;
177
- box-shadow: 0 0 0 px-to-em(3) scale-color($secondary-color, $lightness: 80%);
176
+ box-shadow: 0 0 0 fn.px-to-em(3) color.scale(colors.$secondary-color, $lightness: 80%);
178
177
  }
179
178
  }
180
179
 
@@ -183,9 +182,9 @@ export default {
183
182
  }
184
183
 
185
184
  &__icon {
186
- margin-left: px-to-em(12);
187
- width: px-to-em(20);
188
- height: px-to-em(20);
185
+ margin-left: fn.px-to-em(12);
186
+ width: fn.px-to-em(20);
187
+ height: fn.px-to-em(20);
189
188
  flex-shrink: 0;
190
189
  transition: transform 0.2s ease-out;
191
190
 
@@ -199,50 +198,50 @@ export default {
199
198
  position: absolute;
200
199
  top: calc(100% + 4px);
201
200
  left: 0;
202
- border: px-to-rem(1) solid $neutral-dark-4;
203
- border-radius: px-to-em(10);
204
- background: $neutral-light;
205
- width: unquote('max(100%, #{px-to-rem(250)})');
201
+ border: fn.px-to-rem(1) solid colors.$neutral-dark-4;
202
+ border-radius: fn.px-to-em(10);
203
+ background: colors.$neutral-light;
204
+ width: max(100%, #{fn.px-to-rem(250)});
206
205
  font-size: inherit;
207
206
  }
208
207
 
209
208
  .dropdown {
210
209
  svg {
211
- width: px-to-em(18);
212
- height: px-to-em(18);
210
+ width: fn.px-to-em(18);
211
+ height: fn.px-to-em(18);
213
212
  }
214
213
 
215
214
  &__title {
216
- padding: px-to-em(12) px-to-em(8);
215
+ padding: fn.px-to-em(12) fn.px-to-em(8);
217
216
  display: flex;
218
217
  align-items: center;
219
218
  justify-content: space-between;
220
219
  white-space: normal;
221
220
  font-weight: 600;
222
- color: $neutral-dark;
221
+ color: colors.$neutral-dark;
223
222
  }
224
223
 
225
224
  &__filterBar {
226
- border-top: px-to-rem(1) solid $neutral-dark-4;
227
- border-bottom: px-to-rem(1) solid $neutral-dark-4;
228
- background-color: rgba($neutral-dark-5, 0.6);
229
- padding: px-to-em(8);
225
+ border-top: fn.px-to-rem(1) solid colors.$neutral-dark-4;
226
+ border-bottom: fn.px-to-rem(1) solid colors.$neutral-dark-4;
227
+ background-color: rgba(colors.$neutral-dark-5, 0.6);
228
+ padding: fn.px-to-em(8);
230
229
  display: flex;
231
230
  align-items: center;
232
231
 
233
232
  & > input {
234
233
  background-color: transparent;
235
234
  flex: 1;
236
- color: $neutral-dark;
235
+ color: colors.$neutral-dark;
237
236
 
238
237
  &::placeholder {
239
- color: $neutral-dark-1;
238
+ color: colors.$neutral-dark-1;
240
239
  }
241
240
  }
242
241
 
243
242
  i {
244
- margin-right: px-to-em(8);
245
- color: $neutral-dark;
243
+ margin-right: fn.px-to-em(8);
244
+ color: colors.$neutral-dark;
246
245
  flex-shrink: 0;
247
246
  }
248
247
  }
@@ -250,13 +249,13 @@ export default {
250
249
  &__list {
251
250
  display: flex;
252
251
  flex-direction: column;
253
- min-height: px-to-rem(250);
252
+ min-height: fn.px-to-rem(250);
254
253
  }
255
254
 
256
255
  &__items {
257
- margin: px-to-em(4) 0;
256
+ margin: fn.px-to-em(4) 0;
258
257
  padding: 0;
259
- max-height: px-to-rem(250);
258
+ max-height: fn.px-to-rem(250);
260
259
  overflow-y: auto;
261
260
 
262
261
  li {
@@ -266,7 +265,7 @@ export default {
266
265
 
267
266
  &__item {
268
267
  position: relative;
269
- padding: px-to-em(8) px-to-em(16) px-to-em(8) px-to-em(36);
268
+ padding: fn.px-to-em(8) fn.px-to-em(16) fn.px-to-em(8) fn.px-to-em(36);
270
269
  width: 100%;
271
270
  display: flex;
272
271
  text-align: initial;
@@ -274,7 +273,7 @@ export default {
274
273
  text-transform: capitalize;
275
274
 
276
275
  &:hover {
277
- background-color: rgba($neutral-dark-5, 0.5);
276
+ background-color: rgba(colors.$neutral-dark-5, 0.5);
278
277
  }
279
278
 
280
279
  input {
@@ -284,19 +283,19 @@ export default {
284
283
 
285
284
  &__icon {
286
285
  position: absolute;
287
- left: px-to-em(8);
286
+ left: fn.px-to-em(8);
288
287
  top: 50%;
289
288
  transform: translateY(-50%);
290
- color: $secondary-color;
289
+ color: colors.$secondary-color;
291
290
  }
292
291
 
293
292
  &__emptyState {
294
- padding: px-to-em(16) px-to-em(8);
293
+ padding: fn.px-to-em(16) fn.px-to-em(8);
295
294
  flex: 1;
296
295
  display: flex;
297
296
  align-items: center;
298
297
  justify-content: center;
299
- color: $neutral-dark-1;
298
+ color: colors.$neutral-dark-1;
300
299
  }
301
300
  }
302
301
  }
@@ -127,5 +127,137 @@ const onChange = () => emit('update:modelValue', checkedProxy.value)
127
127
  </script>
128
128
 
129
129
  <style lang="scss">
130
- @import 'index';
130
+ @mixin cp-checkbox-style($color, $className) {
131
+ &--is#{$className} input:checked {
132
+ background-color: $color;
133
+ border-color: $color;
134
+ }
135
+
136
+ &--is#{$className}:hover input {
137
+ background-color: color.scale($color, $lightness: 95%);
138
+ }
139
+
140
+ &--is#{$className}:hover input:checked {
141
+ background-color: color.adjust($color, $lightness: -10%);
142
+ }
143
+
144
+ &--is#{$className} input:focus-visible {
145
+ position: relative;
146
+ z-index: 1;
147
+ outline: fn.px-to-rem(2) solid $color;
148
+ outline-offset: fn.px-to-rem(2);
149
+ }
150
+ }
151
+
152
+ .cpCheckbox {
153
+ $cp-checkbox-base-width: fn.px-to-rem(16);
154
+ $cp-checkbox-tick-base-width: fn.px-to-rem(12);
155
+
156
+ position: relative;
157
+ display: flex;
158
+ align-items: flex-start;
159
+ cursor: pointer;
160
+
161
+ @include cp-checkbox-style(colors.$secondary-color, 'Blue');
162
+ @include cp-checkbox-style(colors.$primary-color, 'Purple');
163
+
164
+ &:not(&--isEmpty) {
165
+ gap: sp.$space-md;
166
+ }
167
+
168
+ &__wrapper {
169
+ display: flex;
170
+ align-items: center;
171
+ justify-content: center;
172
+ padding: sp.$space-sm;
173
+ flex-shrink: 0;
174
+ }
175
+
176
+ input {
177
+ -webkit-appearance: none;
178
+ -moz-appearance: none;
179
+ appearance: none;
180
+ border: fn.px-to-rem(1) solid colors.$neutral-dark-4;
181
+ border-radius: fn.px-to-rem(4);
182
+ width: $cp-checkbox-base-width;
183
+ height: $cp-checkbox-base-width;
184
+ flex-shrink: 0;
185
+ cursor: pointer;
186
+ transition:
187
+ background-color 0.1s ease-out,
188
+ transform 0.1s linear;
189
+ background-color: colors.$neutral-light;
190
+
191
+ & + i {
192
+ position: absolute;
193
+ z-index: 2;
194
+ width: $cp-checkbox-tick-base-width;
195
+ height: $cp-checkbox-tick-base-width;
196
+ color: colors.$neutral-light;
197
+ opacity: 0;
198
+ transition: opacity 0.2s linear 0.1s;
199
+ }
200
+
201
+ & + i svg {
202
+ stroke-width: 3;
203
+ }
204
+
205
+ &:checked + i {
206
+ visibility: visible;
207
+ opacity: 1;
208
+ }
209
+
210
+ &:disabled {
211
+ background-color: colors.$neutral-light-1;
212
+ cursor: not-allowed;
213
+
214
+ & ~ span {
215
+ color: colors.$neutral-dark-1;
216
+ }
217
+ }
218
+
219
+ &:checked:disabled {
220
+ border-color: colors.$neutral-dark-3;
221
+ background-color: colors.$neutral-dark-3;
222
+
223
+ & ~ span {
224
+ color: colors.$neutral-dark-3;
225
+ }
226
+ }
227
+
228
+ &:active:not(:disabled) {
229
+ transform: scale(0.8);
230
+ }
231
+ }
232
+
233
+ &--isDisabled {
234
+ cursor: not-allowed;
235
+ }
236
+
237
+ &--isReversed {
238
+ flex-direction: row-reverse;
239
+ }
240
+
241
+ &__content {
242
+ flex: 1;
243
+ }
244
+
245
+ &__label,
246
+ &__helper {
247
+ display: block;
248
+ line-height: fn.px-to-rem(24);
249
+ }
250
+
251
+ &__label {
252
+ font-weight: 500;
253
+
254
+ &--isCapitalized::first-letter {
255
+ text-transform: capitalize;
256
+ }
257
+ }
258
+
259
+ &__helper {
260
+ color: colors.$neutral-dark-1;
261
+ }
262
+ }
131
263
  </style>