@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.
- package/dist/pimp.es.js +5051 -4622
- 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 +722 -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
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
@use 'sass:math';
|
|
2
|
-
@import '/src/assets/styles/main';
|
|
3
|
-
|
|
4
|
-
$cp-radio-base-width: px-to-em(20);
|
|
5
|
-
|
|
6
|
-
@mixin cp-radio-style($color, $className) {
|
|
7
|
-
&--is#{$className}#{&}--isActive {
|
|
8
|
-
border-color: $color;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
&--is#{$className} input:checked {
|
|
12
|
-
background-color: $color;
|
|
13
|
-
border-color: $color;
|
|
14
|
-
|
|
15
|
-
& ~ span .cpRadio {
|
|
16
|
-
&__label,
|
|
17
|
-
&__additionalData {
|
|
18
|
-
color: $color;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&--is#{$className}:hover,
|
|
24
|
-
&--is#{$className}:focus-within {
|
|
25
|
-
border-color: $color;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&--is#{$className}:focus-within {
|
|
29
|
-
box-shadow: 0 0 0 px-to-rem(4) rgba($color, 0.1);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.cpRadio {
|
|
34
|
-
position: relative;
|
|
35
|
-
border: px-to-rem(1) solid $neutral-dark-4;
|
|
36
|
-
border-radius: px-to-rem(10);
|
|
37
|
-
padding: $space-lg $space-md;
|
|
38
|
-
display: grid;
|
|
39
|
-
grid-template-columns: min-content 1fr;
|
|
40
|
-
grid-gap: $space-md;
|
|
41
|
-
align-items: center;
|
|
42
|
-
width: 100%;
|
|
43
|
-
|
|
44
|
-
&:not(#{&}--isDisabled),
|
|
45
|
-
&:not(#{&}--isDisabled) * {
|
|
46
|
-
cursor: pointer;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@include cp-radio-style($secondary-color, 'Blue');
|
|
50
|
-
@include cp-radio-style($primary-color, 'Purple');
|
|
51
|
-
|
|
52
|
-
&--isDisabled {
|
|
53
|
-
background-color: $neutral-light-1;
|
|
54
|
-
color: $neutral-dark-1;
|
|
55
|
-
|
|
56
|
-
&,
|
|
57
|
-
* {
|
|
58
|
-
cursor: not-allowed;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
&:hover,
|
|
62
|
-
&:focus {
|
|
63
|
-
box-shadow: none;
|
|
64
|
-
border-color: $neutral-dark-4;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
&--isActive#{&}--isDisabled,
|
|
69
|
-
&--isActive#{&}--isDisabled:hover {
|
|
70
|
-
border-color: $neutral-dark-4;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
&:not(:last-of-type) {
|
|
74
|
-
margin-bottom: $space-md;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
input {
|
|
78
|
-
-webkit-appearance: none;
|
|
79
|
-
-moz-appearance: none;
|
|
80
|
-
appearance: none;
|
|
81
|
-
border: px-to-rem(1) solid $neutral-dark-4;
|
|
82
|
-
border-radius: 100%;
|
|
83
|
-
padding: 25%;
|
|
84
|
-
width: $cp-radio-base-width;
|
|
85
|
-
height: $cp-radio-base-width;
|
|
86
|
-
transition: transform 0.1s linear;
|
|
87
|
-
|
|
88
|
-
&:before {
|
|
89
|
-
content: '';
|
|
90
|
-
display: flex;
|
|
91
|
-
width: 100%;
|
|
92
|
-
height: 100%;
|
|
93
|
-
border-radius: 100%;
|
|
94
|
-
background-color: $neutral-light;
|
|
95
|
-
transition: transform 0.15s linear;
|
|
96
|
-
transform: scale(0);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
&:active:not(:disabled) {
|
|
100
|
-
transform: scale(0.8);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
&:checked:before {
|
|
104
|
-
transform: scale(1);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
&:checked:disabled {
|
|
108
|
-
border-color: $neutral-dark-1;
|
|
109
|
-
background-color: $neutral-dark-1;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
&:checked:disabled ~ span .cpRadio {
|
|
113
|
-
&__label,
|
|
114
|
-
&__additionalData {
|
|
115
|
-
color: $neutral-dark-1;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
&__content {
|
|
121
|
-
display: flex;
|
|
122
|
-
align-items: center;
|
|
123
|
-
line-height: 1.3;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
&__information {
|
|
127
|
-
flex-grow: 2;
|
|
128
|
-
display: flex;
|
|
129
|
-
align-items: center;
|
|
130
|
-
justify-content: space-between;
|
|
131
|
-
flex-wrap: wrap;
|
|
132
|
-
text-transform: capitalize;
|
|
133
|
-
margin: 0 (-$space);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
&__label,
|
|
137
|
-
&__description {
|
|
138
|
-
margin: 0 $space;
|
|
139
|
-
flex-grow: 1;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
&__label,
|
|
143
|
-
&__additionalData {
|
|
144
|
-
font-weight: 500;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
&__description,
|
|
148
|
-
&__additionalData {
|
|
149
|
-
color: $neutral-dark-1;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
&__label {
|
|
153
|
-
white-space: nowrap;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
&__additionalData {
|
|
157
|
-
text-align: right;
|
|
158
|
-
margin-left: $space-lg;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<label
|
|
4
|
-
v-for="({ label, value, description, additionalData, disabled }, index) in options"
|
|
5
|
-
:key="getRadioId(index)"
|
|
6
|
-
:class="computedClasses({ value, disabled })"
|
|
7
|
-
class="cpRadio"
|
|
8
|
-
:for="getRadioId(index)"
|
|
9
|
-
>
|
|
10
|
-
<input
|
|
11
|
-
:id="getRadioId(index)"
|
|
12
|
-
:checked="isActive(value)"
|
|
13
|
-
:value="value"
|
|
14
|
-
:disabled="disabled"
|
|
15
|
-
type="radio"
|
|
16
|
-
:autofocus="autofocus"
|
|
17
|
-
:name="groupName"
|
|
18
|
-
@input="onChange(value)"
|
|
19
|
-
/>
|
|
20
|
-
<span class="cpRadio__content">
|
|
21
|
-
<span class="cpRadio__information">
|
|
22
|
-
<span class="cpRadio__label">{{ label }}</span>
|
|
23
|
-
<span v-if="description" class="cpRadio__description">{{ description }}</span>
|
|
24
|
-
</span>
|
|
25
|
-
<span v-if="additionalData" class="cpRadio__additionalData">{{ additionalData }}</span>
|
|
26
|
-
</span>
|
|
27
|
-
</label>
|
|
28
|
-
</div>
|
|
29
|
-
</template>
|
|
30
|
-
|
|
31
|
-
<script>
|
|
32
|
-
import { capitalizeFirstLetter, randomString } from '@/helpers'
|
|
33
|
-
import { ToggleColors } from '@/constants'
|
|
34
|
-
|
|
35
|
-
export default {
|
|
36
|
-
props: {
|
|
37
|
-
modelValue: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: '',
|
|
40
|
-
required: true,
|
|
41
|
-
},
|
|
42
|
-
options: {
|
|
43
|
-
type: Array,
|
|
44
|
-
required: true,
|
|
45
|
-
},
|
|
46
|
-
groupName: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: '',
|
|
49
|
-
required: false,
|
|
50
|
-
},
|
|
51
|
-
color: {
|
|
52
|
-
type: String,
|
|
53
|
-
required: false,
|
|
54
|
-
default: ToggleColors.BLUE,
|
|
55
|
-
validator: (value) => Object.values(ToggleColors).includes(value),
|
|
56
|
-
},
|
|
57
|
-
autofocus: {
|
|
58
|
-
type: Boolean,
|
|
59
|
-
required: false,
|
|
60
|
-
default: false,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
emits: ['update:modelValue'],
|
|
64
|
-
data() {
|
|
65
|
-
return {
|
|
66
|
-
radioUniqueId: '',
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
mounted() {
|
|
70
|
-
this.radioUniqueId = randomString()
|
|
71
|
-
},
|
|
72
|
-
methods: {
|
|
73
|
-
onChange(value) {
|
|
74
|
-
this.$emit('update:modelValue', value)
|
|
75
|
-
},
|
|
76
|
-
getRadioId(index) {
|
|
77
|
-
return `${this.radioUniqueId}${index}`
|
|
78
|
-
},
|
|
79
|
-
isActive(value) {
|
|
80
|
-
return value === this.modelValue
|
|
81
|
-
},
|
|
82
|
-
computedClasses({ value, disabled }) {
|
|
83
|
-
return [
|
|
84
|
-
{
|
|
85
|
-
'cpRadio--isActive': this.isActive(value),
|
|
86
|
-
'cpRadio--isDisabled': disabled,
|
|
87
|
-
},
|
|
88
|
-
`cpRadio--is${capitalizeFirstLetter(this.color)}`,
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
}
|
|
93
|
-
</script>
|
|
94
|
-
|
|
95
|
-
<style lang="scss">
|
|
96
|
-
@import 'index';
|
|
97
|
-
</style>
|