@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
@@ -1,39 +0,0 @@
1
- // CitizenPlane colors
2
- $astronaut = #3E3E5B
3
- $gray-1 = #8B8B9D
4
- $gray-2 = #B2B2BD
5
- $gray-3 = #C6C6CE
6
- $gray-4 = #D8D8DE
7
- $gray-5 = #ECECEF
8
-
9
- $red = #FC5959
10
- $yellow = #FFD00B
11
- $green-2 = #00C582
12
- $green-1 = #00F8A4
13
-
14
- $purple = #5341F9
15
- $blue = #144DC2
16
- $blue-1 = #56C1FE
17
- $pink = #FF7DC1
18
-
19
- // Main colors
20
- $primary-color = $purple
21
- $secondary-color = $blue
22
- $tertiary-color = $pink
23
-
24
- // Accent colors
25
- $error-color = $red
26
- $success-color = $green-2
27
- $success-color-light = $green-1
28
- $accent-color-1 = $blue-1
29
-
30
- // Neutral colors
31
- $neutral-dark = $astronaut
32
- // Gray
33
- $neutral-dark-1 = $gray-1
34
- $neutral-dark-2 = $gray-2
35
- $neutral-dark-3 = $gray-3
36
- $neutral-dark-4 = $gray-4
37
- $neutral-dark-5 = $gray-5
38
- // White
39
- $neutral-light = #FFFFFF
@@ -1,165 +0,0 @@
1
- // Reset default input style
2
- .cpDate {
3
- input,
4
- select {
5
- background-color: transparent;
6
- color: $neutral-dark;
7
- }
8
-
9
- // Hide arrows from number input
10
- input::-webkit-outer-spin-button,
11
- input::-webkit-inner-spin-button {
12
- -webkit-appearance: none;
13
- margin: 0;
14
- }
15
-
16
- input[type='number'] {
17
- -moz-appearance: textfield;
18
- }
19
-
20
- // Remove select style
21
- select {
22
- appearance: none;
23
- -webkit-appearance: none;
24
- -moz-appearance: none;
25
- outline: none;
26
- border: none;
27
- }
28
- }
29
-
30
- .cpDate {
31
- input::placeholder,
32
- &__month--isEmpty {
33
- color: $neutral-dark;
34
- }
35
-
36
- &__label {
37
- display: flex;
38
- align-items: center;
39
- margin-bottom: px-to-em(6);
40
- font-size: px-to-em(14);
41
- font-weight: 600;
42
-
43
- i {
44
- margin-left: $space-sm;
45
- width: px-to-rem(16);
46
- height: px-to-rem(16);
47
- color: $error-color;
48
- }
49
- }
50
-
51
- &__inputs {
52
- display: flex;
53
- height: px-to-em(44);
54
- border: px-to-rem(1) solid $neutral-dark-4;
55
- border-radius: px-to-em(10);
56
- overflow: hidden;
57
- background-color: $neutral-light;
58
- box-shadow: inset 0 px-to-em(1) px-to-em(2) rgba($neutral-dark, 0.12);
59
-
60
- &:hover,
61
- &:focus-within {
62
- border-color: $secondary-color;
63
- background-color: $neutral-light;
64
- }
65
-
66
- &:focus-within {
67
- box-shadow:
68
- rgba($secondary-color, 0.1) 0 0 0 px-to-rem(4),
69
- $secondary-color 0 0 0 px-to-rem(0.5);
70
- }
71
- }
72
-
73
- &__divider {
74
- flex-shrink: 0;
75
- width: px-to-rem(1);
76
- height: 100%;
77
- background-color: $border-color;
78
- }
79
-
80
- &__month,
81
- &__day,
82
- &__year {
83
- min-width: 0;
84
- }
85
-
86
- &__month {
87
- position: relative;
88
- flex: 1 1 50%;
89
-
90
- &::after {
91
- position: absolute;
92
- top: 50%;
93
- right: px-to-em(12);
94
- width: px-to-em(20);
95
- height: px-to-em(20);
96
- background-image: url('@/assets/images/icons/chevron-down-icon.svg');
97
- background-size: cover;
98
- transform: translateY(-50%);
99
- content: '';
100
- pointer-events: none;
101
- }
102
-
103
- select {
104
- @extend %u-text-ellipsis;
105
- width: 100%;
106
- padding: px-to-em(12) px-to-em(40) px-to-em(12) px-to-em(12);
107
- color: inherit;
108
- cursor: pointer;
109
-
110
- &:focus-visible {
111
- text-decoration: underline;
112
- font-weight: 500;
113
- }
114
- }
115
-
116
- select > option:not(:disabled) {
117
- color: $neutral-dark;
118
- }
119
- }
120
-
121
- &__day,
122
- &__year {
123
- flex: 0 0 25%;
124
- padding: $space-md;
125
- }
126
-
127
- &--isInvalid {
128
- .cpDate__inputs,
129
- .cpDate__inputs:hover,
130
- .cpDate__inputs:focus-within {
131
- border-color: $error-color;
132
- }
133
-
134
- .cpDate__inputs:focus-within {
135
- box-shadow: 0 0 0 px-to-em(3) scale-color($error-color, $lightness: 60%);
136
- }
137
-
138
- .cpDate__divider {
139
- background-color: $error-color;
140
- }
141
- }
142
-
143
- &--isDisabled {
144
- .cpDate__inputs {
145
- border-color: $neutral-dark-4;
146
- background: $neutral-light-1;
147
- }
148
-
149
- .cpDate__inputs * {
150
- color: $neutral-dark-2 !important;
151
- cursor: not-allowed !important;
152
- }
153
-
154
- .cpDate__month::after {
155
- opacity: 0.4;
156
- }
157
- }
158
-
159
- &__errorMessage {
160
- margin-top: px-to-rem(6);
161
- color: $error-color;
162
- font-weight: 500;
163
- font-size: px-to-em(14);
164
- }
165
- }
@@ -1,325 +0,0 @@
1
- @import '/src/assets/styles/main';
2
-
3
- .cpTable {
4
- position: relative;
5
- display: flex;
6
- flex-direction: column;
7
-
8
- &__container {
9
- position: relative;
10
- display: flex;
11
- flex-direction: column;
12
- flex: 1;
13
-
14
- &--hasPagination {
15
- border-bottom: px-to-rem(1) solid $border-color;
16
- }
17
- }
18
-
19
- /* Standard Tables */
20
- &__container[role='region'][aria-labelledby][tabindex] {
21
- overflow: auto;
22
- }
23
-
24
- &__container[role='region'][aria-labelledby][tabindex]:focus {
25
- border-radius: px-to-rem(10);
26
- box-shadow: 0 0 0 px-to-em(3) scale-color($blue, $lightness: 70%);
27
- }
28
-
29
- &__container[role='region'][aria-labelledby][tabindex] &__table {
30
- margin: 0;
31
- border: none;
32
- }
33
-
34
- /* Scrolling Visual Cue */
35
- &__container[role='region'][aria-labelledby][tabindex] {
36
- background:
37
- linear-gradient(to right, $neutral-light 30%, rgba(255, 255, 255, 0)),
38
- linear-gradient(to right, rgba($neutral-light, 0), $neutral-light 70%) 0 100%,
39
- radial-gradient(farthest-side at 0% 50%, rgba($neutral-dark, 0.2), rgba($neutral-dark, 0)),
40
- radial-gradient(farthest-side at 100% 50%, rgba($neutral-dark, 0.2), rgba($neutral-dark, 0)) 0 100%;
41
- background-repeat: no-repeat;
42
- background-color: $neutral-light;
43
- background-size:
44
- 40px 100%,
45
- 40px 100%,
46
- 14px 100%,
47
- 14px 100%;
48
- background-position:
49
- 0 0,
50
- 100%,
51
- 0 0,
52
- 100%;
53
- background-attachment: local, local, scroll, scroll;
54
- }
55
-
56
- &__caption {
57
- position: sticky;
58
- left: 0;
59
- margin-bottom: $space-lg;
60
- text-align: left;
61
- font-size: px-to-em(18);
62
-
63
- &:first-letter {
64
- text-transform: capitalize;
65
- }
66
- }
67
-
68
- &__table {
69
- border-collapse: collapse;
70
- width: 100%;
71
- }
72
-
73
- &__row {
74
- &--body:not(:last-of-type) {
75
- border-bottom: px-to-rem(1) solid $border-color;
76
- }
77
-
78
- &--body:not(#{&}--isFullWidth):not(#{&}--isSelected):hover,
79
- &--body:not(#{&}--isFullWidth):not(#{&}--isSelected):focus,
80
- &--body:not(#{&}--isFullWidth):not(#{&}--isSelected):focus-within {
81
- background-color: rgba($neutral-dark, 0.05);
82
- transition: background-color 0.1s ease-in-out;
83
- }
84
-
85
- &--body:not(#{&}--isFullWidth):not(#{&}--isSelected):focus,
86
- &--body:not(#{&}--isFullWidth):not(#{&}--isSelected):focus-within {
87
- color: $primary-color;
88
- }
89
-
90
- &--isFullWidth td {
91
- padding: $space;
92
- background-color: rgba($neutral-dark, 0.03);
93
- }
94
-
95
- &--isClickable {
96
- cursor: pointer;
97
- }
98
-
99
- &--isSelected {
100
- background-color: rgba($primary-color, 0.1);
101
- color: $primary-color;
102
- }
103
-
104
- &--body td {
105
- font-size: px-to-em(14);
106
- }
107
- }
108
-
109
- &__column {
110
- position: sticky;
111
- top: 0;
112
- z-index: 3;
113
- background-color: $neutral-light;
114
- padding: $space $space-md;
115
- text-align: left;
116
- white-space: nowrap;
117
- font-size: px-to-em(12);
118
- font-weight: normal;
119
- color: $neutral-dark-1;
120
-
121
- &:first-letter {
122
- text-transform: capitalize;
123
- }
124
-
125
- /* Workaround for sticky header border-bottom */
126
- &:after {
127
- content: '';
128
- position: absolute;
129
- bottom: 0;
130
- left: 0;
131
- width: 100%;
132
- height: px-to-rem(1);
133
- background-color: $border-color;
134
- }
135
- }
136
-
137
- &__body {
138
- vertical-align: middle;
139
- }
140
-
141
- &__row--body,
142
- &__cell {
143
- vertical-align: inherit;
144
- }
145
-
146
- &__cell {
147
- &:not(#{&}--isFullWidth):not(#{&}--isOptions) {
148
- padding: $space-lg $space-md;
149
- white-space: nowrap;
150
- }
151
-
152
- &--isFullWidth span,
153
- &--isOptions {
154
- position: sticky;
155
- }
156
-
157
- &--isFullWidth span {
158
- left: 50%;
159
- transform: translateX(-50%);
160
- display: inline-block;
161
- }
162
-
163
- &--isOptions {
164
- right: 0;
165
- padding: 0 $space-md;
166
- }
167
-
168
- &--isOptions button {
169
- border: px-to-rem(1) solid $border-color;
170
- border-radius: px-to-rem(8);
171
- background-color: $neutral-light;
172
- display: inline-flex;
173
- padding: $space-sm;
174
- color: $neutral-dark-1;
175
-
176
- &:hover {
177
- background-color: scale-color($neutral-dark, $lightness: 98%);
178
- color: $neutral-dark;
179
- }
180
-
181
- &:focus {
182
- outline: none !important;
183
- box-shadow: 0 0 0 px-to-em(3) scale-color($secondary-color, $lightness: 80%);
184
- }
185
- }
186
-
187
- &--isOptions i {
188
- width: px-to-rem(16);
189
- height: px-to-rem(16);
190
- }
191
- }
192
-
193
- // On desktop devices, display options only on row focus or hover
194
- @media (hover: hover) and (pointer: fine) {
195
- &__cell--isOptions {
196
- opacity: 0;
197
- transition: opacity 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.175);
198
- }
199
-
200
- &__row:focus &__cell--isOptions,
201
- &__row:focus-within &__cell--isOptions,
202
- &__row:hover &__cell--isOptions {
203
- opacity: 1;
204
- }
205
- }
206
-
207
- &__emptyState {
208
- flex: 1;
209
- }
210
-
211
- &--isLoading &__overlay {
212
- opacity: 0.5;
213
- pointer-events: all;
214
- }
215
-
216
- &__overlay {
217
- position: absolute;
218
- overflow: hidden;
219
- left: 0;
220
- right: 0;
221
- top: 0;
222
- bottom: 0;
223
- border-radius: px-to-rem(10);
224
- background-color: $neutral-light;
225
- z-index: 4;
226
- opacity: 0;
227
- transition: 0.15s opacity ease-in-out;
228
- cursor: wait;
229
- pointer-events: none;
230
-
231
- &::after {
232
- content: '';
233
- position: absolute;
234
- top: 0;
235
- right: 0;
236
- bottom: 0;
237
- left: 0;
238
- transform: translateX(-100%);
239
- background-image: linear-gradient(
240
- 90deg,
241
- rgba($neutral-dark-3, 0) 0,
242
- rgba($neutral-dark-3, 0.2) 20%,
243
- rgba($neutral-dark-3, 0.5) 60%,
244
- rgba($neutral-dark-3, 0)
245
- );
246
- animation: shimmer 2s infinite;
247
- }
248
-
249
- @keyframes shimmer {
250
- 100% {
251
- transform: translateX(100%);
252
- }
253
- }
254
- }
255
-
256
- &__loader {
257
- width: px-to-rem(32);
258
- height: px-to-rem(32);
259
-
260
- &--isSmall {
261
- display: inline-block;
262
- vertical-align: middle;
263
- width: px-to-rem(24);
264
- height: px-to-rem(24);
265
- }
266
- }
267
-
268
- &__footer {
269
- padding: $space-lg $space-md 0;
270
- display: flex;
271
- align-items: center;
272
- font-size: px-to-em(14);
273
- }
274
-
275
- .footer {
276
- &__details,
277
- &__pagination {
278
- flex: 1;
279
- }
280
-
281
- &__results {
282
- font-variant-numeric: tabular-nums;
283
- color: $neutral-dark-1;
284
- }
285
-
286
- &__results strong {
287
- color: $neutral-dark;
288
- }
289
-
290
- &__pagination {
291
- text-align: right;
292
- }
293
-
294
- &__pagination button {
295
- box-shadow: 0 px-to-rem(1) px-to-rem(2) rgba($neutral-dark, 0.08);
296
- border-radius: px-to-rem(10);
297
- border: px-to-rem(1) solid $border-color;
298
- padding: px-to-rem(6) px-to-rem(10);
299
- transition: background-color 0.15s;
300
- background-color: $neutral-light;
301
-
302
- &:hover {
303
- background-color: rgba($neutral-dark, 0.05);
304
- }
305
-
306
- &:focus {
307
- outline: none !important;
308
- box-shadow: 0 0 0 px-to-em(3) scale-color($blue, $lightness: 70%);
309
- }
310
-
311
- &:disabled {
312
- box-shadow: none;
313
- border-color: $neutral-light-1;
314
- background-color: $neutral-light-1;
315
- color: $neutral-dark-2;
316
- cursor: not-allowed;
317
- user-select: none;
318
- }
319
-
320
- &:last-of-type {
321
- margin-left: $space;
322
- }
323
- }
324
- }
325
- }