@citizenplane/pimp 8.9.5 → 8.10.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.
- package/dist/pimp.es.js +5057 -4628
- package/dist/pimp.umd.js +9 -2
- package/dist/style.css +1 -1
- package/package.json +15 -16
- package/src/App.vue +9 -9
- package/src/assets/styles/base/_base.scss +4 -4
- package/src/assets/styles/helpers/_keyframes.scss +0 -25
- package/src/assets/styles/helpers/_mixins.scss +23 -2
- package/src/assets/styles/main.scss +2 -16
- package/src/assets/styles/variables/_colors.scss +2 -0
- package/src/assets/styles/variables/_sizing.scss +3 -3
- package/src/assets/styles/variables/_spacing.scss +2 -2
- package/src/components/atomic-elements/CpBadge.vue +33 -33
- package/src/components/atomic-elements/CpDialog.vue +19 -19
- package/src/components/atomic-elements/CpTooltip.vue +6 -6
- package/src/components/buttons/CpButton.vue +53 -57
- package/src/components/core/{BaseInputLabel/index.vue → BaseInputLabel.vue} +3 -3
- package/src/components/core/playground-sections/SectionAtomicElements.vue +1 -1
- package/src/components/core/playground-sections/SectionButtons.vue +2 -2
- package/src/components/core/playground-sections/SectionContainer.vue +5 -5
- package/src/components/core/playground-sections/SectionDatePickers.vue +3 -3
- package/src/components/core/playground-sections/SectionDialog.vue +1 -1
- package/src/components/core/playground-sections/SectionFeedbackIndicators.vue +2 -2
- package/src/components/core/playground-sections/SectionInputs.vue +2 -2
- package/src/components/core/playground-sections/SectionListsAndTables.vue +9 -9
- package/src/components/core/playground-sections/SectionSelects.vue +2 -2
- package/src/components/core/playground-sections/SectionSimpleInputs.vue +2 -2
- package/src/components/core/playground-sections/SectionToggles.vue +4 -4
- package/src/components/date-pickers/CpCalendar.vue +14 -14
- package/src/components/date-pickers/{CpDate/index.vue → CpDate.vue} +165 -1
- package/src/components/date-pickers/CpDatepicker.vue +1 -1
- package/src/components/feedback-indicators/CpAlert.vue +22 -22
- package/src/components/feedback-indicators/CpToaster.vue +36 -38
- package/src/components/index.js +7 -7
- package/src/components/inputs/CpInput.vue +55 -55
- package/src/components/inputs/CpTextarea.vue +20 -20
- package/src/components/lists-and-table/CpTable.vue +718 -0
- package/src/components/lists-and-table/{CpTable/CpTableEmptyState/index.vue → CpTableEmptyState.vue} +9 -9
- package/src/components/selects/CpSelect.vue +29 -28
- package/src/components/selects/{CpSelectMenu/index.vue → CpSelectMenu.vue} +40 -41
- package/src/components/toggles/{CpCheckbox/index.vue → CpCheckbox.vue} +133 -1
- package/src/components/toggles/CpRadio.vue +253 -0
- package/src/components/toggles/{CpSwitch/index.vue → CpSwitch.vue} +19 -19
- package/src/components/typography/{CpHeading/index.vue → CpHeading.vue} +26 -26
- package/src/constants/index.js +1 -0
- package/src/constants/src/CpTableConfig.js +14 -0
- package/src/libs/CoreDatepicker.vue +383 -308
- package/src/assets/styl/colors.styl +0 -39
- package/src/components/date-pickers/CpDate/index.scss +0 -165
- package/src/components/lists-and-table/CpTable/index.scss +0 -325
- package/src/components/lists-and-table/CpTable/index.vue +0 -438
- package/src/components/toggles/CpCheckbox/index.scss +0 -136
- package/src/components/toggles/CpRadio/index.scss +0 -160
- package/src/components/toggles/CpRadio/index.vue +0 -97
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
<script setup>
|
|
60
60
|
import { ref, useAttrs, useSlots, computed, nextTick, onMounted, useId } from 'vue'
|
|
61
61
|
|
|
62
|
-
import BaseInputLabel from '@/components/core/BaseInputLabel
|
|
62
|
+
import BaseInputLabel from '@/components/core/BaseInputLabel.vue'
|
|
63
63
|
|
|
64
64
|
import { randomString } from '@/helpers'
|
|
65
65
|
|
|
@@ -214,7 +214,7 @@ onMounted(async () => {
|
|
|
214
214
|
<style lang="scss">
|
|
215
215
|
// Mixins
|
|
216
216
|
@mixin cp-input-hover-style() {
|
|
217
|
-
border-color:
|
|
217
|
+
border-color: colors.$primary-color;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
// Main
|
|
@@ -224,7 +224,7 @@ onMounted(async () => {
|
|
|
224
224
|
flex-direction: column;
|
|
225
225
|
|
|
226
226
|
&:has(.cpInput__help, .cpInput__error) .cpInput__container {
|
|
227
|
-
margin-bottom:
|
|
227
|
+
margin-bottom: sp.$space;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
&__container {
|
|
@@ -239,46 +239,46 @@ onMounted(async () => {
|
|
|
239
239
|
|
|
240
240
|
&__clear {
|
|
241
241
|
display: flex;
|
|
242
|
-
padding: px-to-em(3);
|
|
243
|
-
color:
|
|
242
|
+
padding: fn.px-to-em(3);
|
|
243
|
+
color: colors.$neutral-light;
|
|
244
244
|
border-radius: 50%;
|
|
245
|
-
background-color:
|
|
245
|
+
background-color: colors.$neutral-dark-1;
|
|
246
246
|
|
|
247
247
|
&:focus-visible {
|
|
248
|
-
outline: px-to-em(3) solid scale
|
|
248
|
+
outline: fn.px-to-em(3) solid color.scale(colors.$primary-color, $lightness: 80%);
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
&__clearIcon {
|
|
253
|
-
width: px-to-em(12);
|
|
254
|
-
height: px-to-em(12);
|
|
253
|
+
width: fn.px-to-em(12);
|
|
254
|
+
height: fn.px-to-em(12);
|
|
255
255
|
pointer-events: none;
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
&__inner {
|
|
259
|
-
box-shadow: inset 0 px-to-em(1) px-to-em(2) rgba(0, 0, 0, 0.12);
|
|
259
|
+
box-shadow: inset 0 fn.px-to-em(1) fn.px-to-em(2) rgba(0, 0, 0, 0.12);
|
|
260
260
|
appearance: none;
|
|
261
|
-
border: px-to-rem(1) solid
|
|
262
|
-
border-radius: px-to-em(10);
|
|
261
|
+
border: fn.px-to-rem(1) solid colors.$neutral-dark-4;
|
|
262
|
+
border-radius: fn.px-to-em(10);
|
|
263
263
|
outline: none;
|
|
264
264
|
width: 100%;
|
|
265
|
-
height:
|
|
265
|
+
height: sizing.$component-size-default;
|
|
266
266
|
color: inherit;
|
|
267
|
-
padding: px-to-em(12);
|
|
268
|
-
font-size: px-to-em(16);
|
|
267
|
+
padding: fn.px-to-em(12);
|
|
268
|
+
font-size: fn.px-to-em(16);
|
|
269
269
|
|
|
270
270
|
&:hover {
|
|
271
271
|
@include cp-input-hover-style;
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
&:focus {
|
|
275
|
-
box-shadow: 0 0 0 px-to-em(3) scale
|
|
276
|
-
border-color:
|
|
277
|
-
background-color:
|
|
275
|
+
box-shadow: 0 0 0 fn.px-to-em(3) color.scale(colors.$primary-color, $lightness: 80%);
|
|
276
|
+
border-color: colors.$primary-color;
|
|
277
|
+
background-color: colors.$neutral-light;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
&::placeholder {
|
|
281
|
-
color:
|
|
281
|
+
color: colors.$neutral-dark-1;
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
|
|
@@ -287,32 +287,32 @@ onMounted(async () => {
|
|
|
287
287
|
.cpInput__inner:hover,
|
|
288
288
|
.cpInput__inner:focus,
|
|
289
289
|
.cpInput__icon:hover ~ .cpInput__inner {
|
|
290
|
-
border: px-to-rem(1) solid
|
|
290
|
+
border: fn.px-to-rem(1) solid colors.$error-color;
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
.cpInput__inner:focus {
|
|
294
|
-
box-shadow: 0 0 0 px-to-em(3) scale
|
|
294
|
+
box-shadow: 0 0 0 fn.px-to-em(3) color.scale(colors.$error-color, $lightness: 60%);
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
&--isDisabled {
|
|
299
|
-
color:
|
|
299
|
+
color: colors.$neutral-dark-2 !important;
|
|
300
300
|
|
|
301
301
|
.cpInput__container * {
|
|
302
302
|
cursor: not-allowed;
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
.cpInput__inner {
|
|
306
|
-
background:
|
|
306
|
+
background: colors.$neutral-light-1;
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
.cpInput__inner,
|
|
310
310
|
.cpInput__inner:hover {
|
|
311
|
-
border-color:
|
|
311
|
+
border-color: colors.$neutral-dark-4 !important;
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
.cpInput__icon svg {
|
|
315
|
-
stroke:
|
|
315
|
+
stroke: colors.$neutral-dark-2 !important;
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
|
|
@@ -327,52 +327,52 @@ onMounted(async () => {
|
|
|
327
327
|
&__label {
|
|
328
328
|
display: flex;
|
|
329
329
|
align-items: center;
|
|
330
|
-
font-size: px-to-em(14);
|
|
331
|
-
line-height: px-to-rem(24);
|
|
332
|
-
margin-bottom:
|
|
333
|
-
gap:
|
|
330
|
+
font-size: fn.px-to-em(14);
|
|
331
|
+
line-height: fn.px-to-rem(24);
|
|
332
|
+
margin-bottom: sp.$space;
|
|
333
|
+
gap: sp.$space-sm;
|
|
334
334
|
|
|
335
335
|
sup {
|
|
336
|
-
color:
|
|
336
|
+
color: colors.$error-color;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
&__tooltip {
|
|
341
341
|
display: flex;
|
|
342
|
-
padding:
|
|
342
|
+
padding: sp.$space-sm;
|
|
343
343
|
align-items: center;
|
|
344
344
|
justify-content: center;
|
|
345
345
|
border-radius: 50%;
|
|
346
|
-
color:
|
|
347
|
-
outline-offset: px-to-em(-3);
|
|
346
|
+
color: colors.$neutral-dark-3;
|
|
347
|
+
outline-offset: fn.px-to-em(-3);
|
|
348
348
|
|
|
349
349
|
&:hover,
|
|
350
350
|
&:focus {
|
|
351
|
-
color:
|
|
351
|
+
color: colors.$primary-color;
|
|
352
352
|
}
|
|
353
353
|
|
|
354
354
|
&:focus-visible {
|
|
355
|
-
outline: px-to-em(2) solid
|
|
355
|
+
outline: fn.px-to-em(2) solid colors.$primary-color;
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
|
|
359
359
|
&__tooltipIcon {
|
|
360
|
-
width: px-to-rem(16);
|
|
361
|
-
height: px-to-rem(16);
|
|
360
|
+
width: fn.px-to-rem(16);
|
|
361
|
+
height: fn.px-to-rem(16);
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
&__help,
|
|
365
365
|
&__error {
|
|
366
|
-
font-size: px-to-em(14);
|
|
367
|
-
line-height: px-to-rem(24);
|
|
366
|
+
font-size: fn.px-to-em(14);
|
|
367
|
+
line-height: fn.px-to-rem(24);
|
|
368
368
|
}
|
|
369
369
|
|
|
370
370
|
&__help {
|
|
371
|
-
color:
|
|
371
|
+
color: colors.$neutral-dark-1;
|
|
372
372
|
}
|
|
373
373
|
|
|
374
374
|
&__error {
|
|
375
|
-
color:
|
|
375
|
+
color: colors.$error-color;
|
|
376
376
|
font-weight: 500;
|
|
377
377
|
|
|
378
378
|
&::first-letter {
|
|
@@ -380,10 +380,10 @@ onMounted(async () => {
|
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
|
|
383
|
-
$cp-input-icon-size: px-to-em(20);
|
|
383
|
+
$cp-input-icon-size: fn.px-to-em(20);
|
|
384
384
|
|
|
385
385
|
&__icon {
|
|
386
|
-
left: px-to-em(12);
|
|
386
|
+
left: fn.px-to-em(12);
|
|
387
387
|
z-index: 1;
|
|
388
388
|
position: absolute;
|
|
389
389
|
top: 50%;
|
|
@@ -403,13 +403,13 @@ onMounted(async () => {
|
|
|
403
403
|
}
|
|
404
404
|
|
|
405
405
|
&--isInvalidity svg {
|
|
406
|
-
stroke:
|
|
406
|
+
stroke: colors.$error-color;
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
&--isAfter,
|
|
410
410
|
&--isInvalidity {
|
|
411
411
|
left: auto;
|
|
412
|
-
right: px-to-em(12);
|
|
412
|
+
right: fn.px-to-em(12);
|
|
413
413
|
justify-content: flex-end;
|
|
414
414
|
}
|
|
415
415
|
|
|
@@ -418,36 +418,36 @@ onMounted(async () => {
|
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
&--isAfter ~ input {
|
|
421
|
-
padding-right: calc(#{px-to-em(12)} + #{$cp-input-icon-size} * 2 + #{px-to-em(8)});
|
|
421
|
+
padding-right: calc(#{fn.px-to-em(12)} + #{$cp-input-icon-size} * 2 + #{fn.px-to-em(8)});
|
|
422
422
|
}
|
|
423
423
|
|
|
424
424
|
&--isBefore ~ input {
|
|
425
|
-
padding-left: calc(#{px-to-em(12)} + #{$cp-input-icon-size} + #{px-to-em(8)});
|
|
425
|
+
padding-left: calc(#{fn.px-to-em(12)} + #{$cp-input-icon-size} + #{fn.px-to-em(8)});
|
|
426
426
|
}
|
|
427
427
|
|
|
428
428
|
&--isInvalidity ~ input {
|
|
429
|
-
padding-right: calc(#{px-to-em(12)} + #{$cp-input-icon-size} + #{px-to-em(8)});
|
|
429
|
+
padding-right: calc(#{fn.px-to-em(12)} + #{$cp-input-icon-size} + #{fn.px-to-em(8)});
|
|
430
430
|
}
|
|
431
431
|
|
|
432
432
|
&--hasAfterAndInvalidityIcon ~ input {
|
|
433
|
-
padding-right: calc(#{px-to-em(12)} + #{$cp-input-icon-size} * 2 + #{px-to-em(8)} * 2);
|
|
433
|
+
padding-right: calc(#{fn.px-to-em(12)} + #{$cp-input-icon-size} * 2 + #{fn.px-to-em(8)} * 2);
|
|
434
434
|
}
|
|
435
435
|
|
|
436
436
|
&--isInvalidity {
|
|
437
437
|
& ~ .cpInput__icon--isAfter {
|
|
438
|
-
right: calc(#{px-to-em(12)} + #{$cp-input-icon-size} + #{px-to-em(8)});
|
|
438
|
+
right: calc(#{fn.px-to-em(12)} + #{$cp-input-icon-size} + #{fn.px-to-em(8)});
|
|
439
439
|
transition: right 0.25s cubic-bezier(0.17, 0.84, 0.44, 1);
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
|
|
444
444
|
&--isLarge {
|
|
445
|
-
$cp-input-large-icon-size: px-to-em(24);
|
|
446
|
-
$cp-input-large-spacing: px-to-em(12);
|
|
447
|
-
$cp-input-large-padding: px-to-em(16);
|
|
445
|
+
$cp-input-large-icon-size: fn.px-to-em(24);
|
|
446
|
+
$cp-input-large-spacing: fn.px-to-em(12);
|
|
447
|
+
$cp-input-large-padding: fn.px-to-em(16);
|
|
448
448
|
|
|
449
449
|
.cpInput__inner {
|
|
450
|
-
height:
|
|
450
|
+
height: sizing.$component-size-large;
|
|
451
451
|
padding: $cp-input-large-padding;
|
|
452
452
|
}
|
|
453
453
|
|
|
@@ -483,7 +483,7 @@ onMounted(async () => {
|
|
|
483
483
|
|
|
484
484
|
.cpInput__icon--isInvalidity ~ .cpInput__icon--isAfter {
|
|
485
485
|
& ~ .cpInput__icon--isAfter {
|
|
486
|
-
right: calc(#{$cp-input-large-padding} + #{$cp-input-large-icon-size} + #{px-to-em(8)});
|
|
486
|
+
right: calc(#{$cp-input-large-padding} + #{$cp-input-large-icon-size} + #{fn.px-to-em(8)});
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<script setup>
|
|
30
30
|
import { ref, computed } from 'vue'
|
|
31
31
|
|
|
32
|
-
import BaseInputLabel from '@/components/core/BaseInputLabel
|
|
32
|
+
import BaseInputLabel from '@/components/core/BaseInputLabel.vue'
|
|
33
33
|
import TransitionExpand from '@/components/helpers-utilities/TransitionExpand.vue'
|
|
34
34
|
|
|
35
35
|
import { randomString } from '@/helpers'
|
|
@@ -109,49 +109,49 @@ const handleChange = (newValue) => emit('update:modelValue', newValue)
|
|
|
109
109
|
<style lang="scss">
|
|
110
110
|
.cpTextarea {
|
|
111
111
|
&__input {
|
|
112
|
-
box-shadow: inset 0 px-to-em(1) px-to-em(2) rgba(0, 0, 0, 0.12);
|
|
112
|
+
box-shadow: inset 0 fn.px-to-em(1) fn.px-to-em(2) rgba(0, 0, 0, 0.12);
|
|
113
113
|
appearance: none;
|
|
114
|
-
border: px-to-rem(1) solid
|
|
115
|
-
border-radius: px-to-em(10);
|
|
114
|
+
border: fn.px-to-rem(1) solid colors.$neutral-dark-4;
|
|
115
|
+
border-radius: fn.px-to-em(10);
|
|
116
116
|
outline: none;
|
|
117
|
-
padding: px-to-em(16);
|
|
117
|
+
padding: fn.px-to-em(16);
|
|
118
118
|
width: 100%;
|
|
119
119
|
max-width: 100%;
|
|
120
120
|
height: 100%;
|
|
121
|
-
font-size: px-to-em(16);
|
|
122
|
-
color:
|
|
121
|
+
font-size: fn.px-to-em(16);
|
|
122
|
+
color: colors.$neutral-dark;
|
|
123
123
|
|
|
124
124
|
&:hover {
|
|
125
|
-
border-color:
|
|
125
|
+
border-color: colors.$primary-color;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
&:focus {
|
|
129
|
-
box-shadow: 0 0 0 px-to-em(3) scale
|
|
130
|
-
border-color:
|
|
131
|
-
background-color:
|
|
129
|
+
box-shadow: 0 0 0 fn.px-to-em(3) color.scale(colors.$primary-color, $lightness: 80%);
|
|
130
|
+
border-color: colors.$primary-color;
|
|
131
|
+
background-color: colors.$neutral-light;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
&:disabled {
|
|
135
|
-
background:
|
|
135
|
+
background: colors.$neutral-light-1;
|
|
136
136
|
cursor: not-allowed;
|
|
137
|
-
color:
|
|
137
|
+
color: colors.$neutral-dark-1;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
&::placeholder {
|
|
141
|
-
color: rgba(
|
|
141
|
+
color: rgba(colors.$neutral-dark, 0.6);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
&--isInvalid {
|
|
145
|
-
box-shadow: 0 0 0 px-to-rem(0.5)
|
|
146
|
-
border: px-to-rem(1) solid
|
|
145
|
+
box-shadow: 0 0 0 fn.px-to-rem(0.5) colors.$error-color;
|
|
146
|
+
border: fn.px-to-rem(1) solid colors.$error-color;
|
|
147
147
|
|
|
148
148
|
&:hover,
|
|
149
149
|
&:focus {
|
|
150
|
-
border: px-to-rem(1) solid
|
|
150
|
+
border: fn.px-to-rem(1) solid colors.$error-color;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
&:focus {
|
|
154
|
-
box-shadow: 0 0 0 px-to-em(3) scale
|
|
154
|
+
box-shadow: 0 0 0 fn.px-to-em(3) color.scale(colors.$error-color, $lightness: 60%);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
}
|
|
@@ -160,11 +160,11 @@ const handleChange = (newValue) => emit('update:modelValue', newValue)
|
|
|
160
160
|
display: block;
|
|
161
161
|
|
|
162
162
|
&:not(#{&}--isAfter) {
|
|
163
|
-
margin-bottom: px-to-em(6);
|
|
163
|
+
margin-bottom: fn.px-to-em(6);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
&--isAfter {
|
|
167
|
-
margin-top: px-to-em(6);
|
|
167
|
+
margin-top: fn.px-to-em(6);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
}
|