@citizenplane/pimp 10.0.8 → 10.1.1

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 (67) hide show
  1. package/dist/pimp.es.js +1305 -1303
  2. package/dist/pimp.umd.js +22 -22
  3. package/dist/style.css +1 -1
  4. package/package.json +1 -1
  5. package/src/assets/css/base.css +16 -1
  6. package/src/assets/css/colors.css +111 -110
  7. package/src/assets/css/dimensions.css +36 -35
  8. package/src/assets/css/easings.css +2 -1
  9. package/src/assets/css/shadows.css +67 -65
  10. package/src/assets/css/tokens.css +355 -386
  11. package/src/assets/css/typography.css +109 -0
  12. package/src/assets/main.css +1 -1
  13. package/src/assets/styles/helpers/_functions.scss +2 -2
  14. package/src/assets/styles/helpers/_mixins.scss +1 -3
  15. package/src/assets/styles/utilities/_index.scss +3 -6
  16. package/src/components/BaseInputLabel.vue +23 -21
  17. package/src/components/BaseSelectClearButton.vue +15 -9
  18. package/src/components/CpAirlineLogo.vue +1 -1
  19. package/src/components/CpAlert.vue +16 -16
  20. package/src/components/CpBadge.vue +149 -29
  21. package/src/components/CpButton.vue +135 -110
  22. package/src/components/CpButtonGroup.vue +3 -3
  23. package/src/components/CpCalendar.vue +32 -32
  24. package/src/components/CpCheckbox.vue +43 -33
  25. package/src/components/CpContextualMenu.vue +6 -9
  26. package/src/components/CpDate.vue +53 -40
  27. package/src/components/CpDatepicker.vue +3 -3
  28. package/src/components/CpDialog.vue +19 -19
  29. package/src/components/CpHeading.vue +23 -23
  30. package/src/components/CpInput.vue +71 -52
  31. package/src/components/CpItemActions.vue +4 -4
  32. package/src/components/CpLoader.vue +14 -7
  33. package/src/components/CpMenuItem.vue +23 -17
  34. package/src/components/CpMultiselect.vue +84 -58
  35. package/src/components/CpPartnerBadge.vue +13 -13
  36. package/src/components/CpRadio.vue +32 -24
  37. package/src/components/CpSelect.vue +43 -30
  38. package/src/components/CpSelectMenu.vue +39 -39
  39. package/src/components/CpSwitch.vue +51 -40
  40. package/src/components/CpTable.vue +249 -81
  41. package/src/components/CpTableColumnEditor.vue +18 -16
  42. package/src/components/CpTableEmptyState.vue +9 -9
  43. package/src/components/CpTabs.vue +15 -15
  44. package/src/components/CpTelInput.vue +76 -70
  45. package/src/components/CpTextarea.vue +27 -17
  46. package/src/components/CpToast.vue +49 -49
  47. package/src/components/CpTooltip.vue +6 -6
  48. package/src/components/CpTransitionDialog.vue +1 -1
  49. package/src/constants/Sizes.ts +5 -0
  50. package/src/constants/colors/Colors.ts +15 -5
  51. package/src/constants/colors/ToggleColors.ts +2 -1
  52. package/src/libs/CoreDatepicker.vue +21 -18
  53. package/src/stories/CpBadge.stories.ts +25 -17
  54. package/src/stories/CpButton.stories.ts +6 -5
  55. package/src/stories/CpCheckbox.stories.ts +4 -4
  56. package/src/stories/CpContextualMenu.stories.ts +3 -2
  57. package/src/stories/CpLoader.stories.ts +2 -2
  58. package/src/stories/CpMenuItem.stories.ts +104 -0
  59. package/src/stories/CpRadio.stories.ts +29 -2
  60. package/src/stories/CpSwitch.stories.ts +27 -0
  61. package/src/stories/CpTable.stories.ts +94 -0
  62. package/src/assets/css/spacing.css +0 -43
  63. package/src/assets/styles/helpers/_keyframes.scss +0 -48
  64. package/src/assets/styles/variables/_colors.scss +0 -89
  65. package/src/assets/styles/variables/_easings.scss +0 -1
  66. package/src/assets/styles/variables/_sizing.scss +0 -4
  67. package/src/assets/styles/variables/_spacing.scss +0 -10
@@ -139,33 +139,33 @@ const isSelectedValue = (value: string): boolean => {
139
139
  <style lang="scss">
140
140
  .cpSelectMenu {
141
141
  position: relative;
142
- font-size: fn.px-to-em(14);
142
+ font-size: var(--cp-text-size-sm);
143
143
 
144
144
  &__button {
145
- box-shadow: inset 0 fn.px-to-em(1) fn.px-to-em(2) rgba(0, 0, 0, 0.12);
145
+ box-shadow: inset 0 var(--cp-dimensions-0_25) var(--cp-dimensions-0_5) rgba(0, 0, 0, 0.12);
146
146
  border: none;
147
- outline: fn.px-to-rem(1) solid colors.$neutral-dark-4;
148
- border-radius: fn.px-to-em(10);
149
- background: colors.$neutral-light;
150
- padding: fn.px-to-rem(8);
147
+ outline: var(--cp-dimensions-0_25) solid var(--cp-border-soft);
148
+ border-radius: var(--cp-radius-md-lg);
149
+ background: var(--cp-background-white);
150
+ padding: var(--cp-spacing-md);
151
151
  width: 100%;
152
152
  display: flex;
153
153
  align-items: center;
154
154
  justify-content: space-between;
155
155
  font-size: inherit;
156
- line-height: fn.px-to-rem(24);
156
+ line-height: var(--cp-line-height-md);
157
157
  font-weight: normal;
158
158
  text-transform: capitalize;
159
159
 
160
160
  &:hover,
161
161
  &:active,
162
162
  &:focus {
163
- outline: fn.px-to-rem(1) solid colors.$secondary-color;
163
+ outline: var(--cp-dimensions-0_25) solid var(--cp-background-accent-solid);
164
164
  }
165
165
 
166
166
  &:focus {
167
- outline: fn.px-to-rem(2) solid colors.$secondary-color;
168
- box-shadow: 0 0 0 fn.px-to-em(2) color.scale(colors.$secondary-color, $lightness: 80%);
167
+ outline: var(--cp-dimensions-0_5) solid var(--cp-background-accent-solid);
168
+ box-shadow: 0 0 0 var(--cp-dimensions-0_5) var(--cp-background-accent-solid);
169
169
  }
170
170
  }
171
171
 
@@ -174,9 +174,9 @@ const isSelectedValue = (value: string): boolean => {
174
174
  }
175
175
 
176
176
  &__icon {
177
- margin-left: fn.px-to-em(12);
178
- width: fn.px-to-em(20);
179
- height: fn.px-to-em(20);
177
+ margin-left: var(--cp-dimensions-3);
178
+ width: var(--cp-dimensions-5);
179
+ height: var(--cp-dimensions-5);
180
180
  flex-shrink: 0;
181
181
  transition: transform 0.2s ease-out;
182
182
 
@@ -188,52 +188,52 @@ const isSelectedValue = (value: string): boolean => {
188
188
  &__dropdown {
189
189
  z-index: 3;
190
190
  position: absolute;
191
- top: calc(100% + 4px);
191
+ top: calc(100% + var(--cp-dimensions-1));
192
192
  left: 0;
193
- border: fn.px-to-rem(1) solid colors.$neutral-dark-4;
194
- border-radius: fn.px-to-em(10);
195
- background: colors.$neutral-light;
196
- width: max(100%, #{fn.px-to-rem(250)});
193
+ border: var(--cp-dimensions-0_25) solid var(--cp-border-soft);
194
+ border-radius: var(--cp-radius-md-lg);
195
+ background: var(--cp-background-white);
196
+ width: max(100%, calc(var(--cp-dimensions-1) * 62.5));
197
197
  font-size: inherit;
198
198
  }
199
199
 
200
200
  .dropdown {
201
201
  svg {
202
- width: fn.px-to-em(18);
203
- height: fn.px-to-em(18);
202
+ width: calc(var(--cp-dimensions-1) * 4.5);
203
+ height: calc(var(--cp-dimensions-1) * 4.5);
204
204
  }
205
205
 
206
206
  &__title {
207
- padding: fn.px-to-em(12) fn.px-to-em(8);
207
+ padding: var(--cp-spacing-lg) var(--cp-spacing-md);
208
208
  display: flex;
209
209
  align-items: center;
210
210
  justify-content: space-between;
211
211
  white-space: normal;
212
212
  font-weight: 600;
213
- color: colors.$neutral-dark;
213
+ color: var(--cp-text-primary);
214
214
  }
215
215
 
216
216
  &__filterBar {
217
- border-top: fn.px-to-rem(1) solid colors.$neutral-dark-4;
218
- border-bottom: fn.px-to-rem(1) solid colors.$neutral-dark-4;
219
- background-color: rgba(colors.$neutral-dark-5, 0.6);
220
- padding: fn.px-to-em(8);
217
+ border-top: var(--cp-dimensions-0_25) solid var(--cp-border-soft);
218
+ border-bottom: var(--cp-dimensions-0_25) solid var(--cp-border-soft);
219
+ background-color: var(--cp-background-disabled);
220
+ padding: var(--cp-spacing-md);
221
221
  display: flex;
222
222
  align-items: center;
223
223
 
224
224
  & > input {
225
225
  background-color: transparent;
226
226
  flex: 1;
227
- color: colors.$neutral-dark;
227
+ color: var(--cp-text-primary);
228
228
 
229
229
  &::placeholder {
230
- color: colors.$neutral-dark-1;
230
+ color: var(--cp-text-secondary);
231
231
  }
232
232
  }
233
233
 
234
234
  i {
235
- margin-right: fn.px-to-em(8);
236
- color: colors.$neutral-dark;
235
+ margin-right: var(--cp-spacing-md);
236
+ color: var(--cp-text-primary);
237
237
  flex-shrink: 0;
238
238
  }
239
239
  }
@@ -241,13 +241,13 @@ const isSelectedValue = (value: string): boolean => {
241
241
  &__list {
242
242
  display: flex;
243
243
  flex-direction: column;
244
- min-height: fn.px-to-rem(250);
244
+ min-height: calc(var(--cp-dimensions-1) * 62.5);
245
245
  }
246
246
 
247
247
  &__items {
248
- margin: fn.px-to-em(4) 0;
248
+ margin: var(--cp-spacing-sm) 0;
249
249
  padding: 0;
250
- max-height: fn.px-to-rem(250);
250
+ max-height: calc(var(--cp-dimensions-1) * 62.5);
251
251
  overflow-y: auto;
252
252
 
253
253
  li {
@@ -257,7 +257,7 @@ const isSelectedValue = (value: string): boolean => {
257
257
 
258
258
  &__item {
259
259
  position: relative;
260
- padding: fn.px-to-em(8) fn.px-to-em(16) fn.px-to-em(8) fn.px-to-em(36);
260
+ padding: var(--cp-spacing-md) var(--cp-spacing-xl) var(--cp-spacing-md) calc(var(--cp-dimensions-1) * 9);
261
261
  width: 100%;
262
262
  display: flex;
263
263
  text-align: initial;
@@ -265,7 +265,7 @@ const isSelectedValue = (value: string): boolean => {
265
265
  text-transform: capitalize;
266
266
 
267
267
  &:hover {
268
- background-color: rgba(colors.$neutral-dark-5, 0.5);
268
+ background-color: var(--cp-background-disabled);
269
269
  }
270
270
 
271
271
  input {
@@ -275,19 +275,19 @@ const isSelectedValue = (value: string): boolean => {
275
275
 
276
276
  &__icon {
277
277
  position: absolute;
278
- left: fn.px-to-em(8);
278
+ left: var(--cp-spacing-md);
279
279
  top: 50%;
280
280
  transform: translateY(-50%);
281
- color: colors.$secondary-color;
281
+ color: var(--cp-background-accent-solid);
282
282
  }
283
283
 
284
284
  &__emptyState {
285
- padding: fn.px-to-em(16) fn.px-to-em(8);
285
+ padding: var(--cp-spacing-xl) var(--cp-spacing-md);
286
286
  flex: 1;
287
287
  display: flex;
288
288
  align-items: center;
289
289
  justify-content: center;
290
- color: colors.$neutral-dark-1;
290
+ color: var(--cp-text-secondary);
291
291
  }
292
292
  }
293
293
  }
@@ -97,22 +97,22 @@ const handleClick = (value: boolean): void => {
97
97
  background-color: $color;
98
98
  }
99
99
 
100
- &--is#{$className} &__switch:focus-within {
101
- outline: $color solid fn.px-to-rem(3);
102
- outline-offset: fn.px-to-rem(3);
100
+ &--is#{$className}:has(input:focus-visible) &__switch {
101
+ outline: $color solid calc(var(--cp-dimensions-0_5) * 1.5);
102
+ outline-offset: calc(var(--cp-dimensions-0_5) * 1.5);
103
103
  }
104
104
 
105
105
  &--is#{$className}:hover:not(#{&}--isDisabled) &__switch {
106
- background-color: colors.$neutral-dark-1;
106
+ background-color: var(--cp-background-quaternary-hover);
107
107
  }
108
108
 
109
109
  &--is#{$className}#{&}--isActive:not(#{&}--isDisabled):hover &__switch {
110
- background-color: colors.$purple-600;
110
+ background-color: $color;
111
111
  }
112
112
  }
113
113
 
114
114
  .cpSwitch {
115
- $cp-switch-base-height: fn.px-to-rem(20);
115
+ --cp-switch-base-height: var(--cp-dimensions-5);
116
116
  align-items: center;
117
117
 
118
118
  &,
@@ -126,32 +126,40 @@ const handleClick = (value: boolean): void => {
126
126
  }
127
127
 
128
128
  &__helper {
129
- color: colors.$neutral-dark-1;
130
- line-height: fn.px-to-rem(24);
129
+ color: var(--cp-text-secondary);
130
+ line-height: var(--cp-line-height-md);
131
131
  }
132
132
 
133
133
  &__labelContainer {
134
134
  display: flex;
135
135
  align-items: center;
136
- gap: sp.$space-sm;
136
+ gap: var(--cp-spacing-sm);
137
137
  }
138
138
 
139
139
  &__label {
140
- line-height: fn.px-to-rem(24);
140
+ line-height: var(--cp-line-height-md);
141
141
  }
142
142
 
143
143
  &__tooltip {
144
- color: colors.$neutral-dark-3;
145
- padding: sp.$space-sm;
144
+ color: var(--cp-foreground-quaternary);
145
+ padding: var(--cp-spacing-sm);
146
146
  }
147
147
 
148
148
  &--hasLabel {
149
149
  display: grid;
150
150
  grid-template-columns: min-content 1fr;
151
- grid-gap: fn.px-to-rem(12);
151
+ grid-gap: var(--cp-spacing-lg);
152
152
  align-items: flex-start;
153
153
  }
154
154
 
155
+ &--isReversed {
156
+ grid-template-columns: 1fr min-content;
157
+
158
+ .cpSwitch__content {
159
+ grid-row: 1;
160
+ }
161
+ }
162
+
155
163
  &--isDisabled,
156
164
  &--isDisabled:hover {
157
165
  &,
@@ -160,25 +168,25 @@ const handleClick = (value: boolean): void => {
160
168
  }
161
169
 
162
170
  .cpSwitch__switch {
163
- background-color: colors.$neutral-dark-4;
171
+ background-color: var(--cp-background-disabled);
172
+ border: var(--cp-dimensions-0_25) solid var(--cp-border-disabled);
164
173
  }
165
- }
166
174
 
167
- &--isReversed {
168
- grid-template-columns: 1fr min-content;
169
-
170
- .cpSwitch__content {
171
- grid-row: 1;
175
+ .cpSwitch__label,
176
+ .cpSwitch__helper {
177
+ color: var(--cp-text-disabled);
172
178
  }
173
- }
174
179
 
175
- &--isDisabled &__label {
176
- color: colors.$neutral-dark-1;
177
- }
180
+ .cpSwitch__knob {
181
+ background-color: var(--cp-foreground-disabled);
182
+ box-shadow: none;
183
+ width: calc(var(--cp-switch-base-height) * 0.5 - var(--cp-dimensions-0_5));
184
+ height: calc(var(--cp-switch-base-height) * 0.5 - var(--cp-dimensions-0_5));
185
+ }
178
186
 
179
- &--isDisabled &__switch,
180
- &--isDisabled:hover &__switch {
181
- background-color: colors.$neutral-dark-5;
187
+ .cpSwitch__knobContainer {
188
+ padding: calc(var(--cp-switch-base-height) * 0.25 + var(--cp-dimensions-0_25));
189
+ }
182
190
  }
183
191
 
184
192
  &--isActive .cpSwitch {
@@ -187,18 +195,20 @@ const handleClick = (value: boolean): void => {
187
195
  }
188
196
  }
189
197
 
190
- @include cp-switch-style(colors.$primary-color, 'Purple');
198
+ @include cp-switch-style(var(--cp-background-accent-solid), 'Accent');
199
+
200
+ @include cp-switch-style(var(--cp-background-accent-solid), 'Purple'); // TODO: Should be replace by ACCENT
191
201
 
192
202
  &__switch {
193
203
  position: relative;
194
- border-radius: 1000px;
195
- background-color: colors.$gray-3;
204
+ border-radius: var(--cp-radius-full);
205
+ background-color: var(--cp-background-quaternary);
196
206
  overflow: hidden;
197
- transition: background-color 0.1s ease-out;
207
+ transition: background-color 100ms ease-out;
198
208
  display: flex;
199
- height: $cp-switch-base-height;
200
- width: $cp-switch-base-height * 2;
201
- margin-block: sp.$space-xs;
209
+ height: var(--cp-switch-base-height);
210
+ width: calc(var(--cp-switch-base-height) * 2);
211
+ margin-block: var(--cp-spacing-xs);
202
212
  }
203
213
 
204
214
  input {
@@ -213,17 +223,18 @@ const handleClick = (value: boolean): void => {
213
223
 
214
224
  &__knobContainer {
215
225
  width: 100%;
216
- padding: fn.px-to-rem(2);
226
+ padding: var(--cp-dimensions-0_5);
217
227
  display: flex;
218
228
  align-items: center;
219
- transition: transform 300ms easings.$easing-elastic;
229
+ transition: transform 300ms var(--cp-easing-elastic);
220
230
  }
221
231
 
222
232
  &__knob {
223
- background-color: colors.$neutral-light;
224
- border-radius: 100%;
225
- width: calc(#{$cp-switch-base-height} - #{fn.px-to-rem(4)});
226
- height: calc(#{$cp-switch-base-height} - #{fn.px-to-rem(4)});
233
+ background-color: var(--cp-foreground-white);
234
+ border-radius: var(--cp-radius-full);
235
+ box-shadow: var(--cp-shadows-3xs);
236
+ width: calc(var(--cp-switch-base-height) - var(--cp-dimensions-1));
237
+ height: calc(var(--cp-switch-base-height) - var(--cp-dimensions-1));
227
238
  }
228
239
  }
229
240
  </style>