@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.
- package/dist/pimp.es.js +1305 -1303
- package/dist/pimp.umd.js +22 -22
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/assets/css/base.css +16 -1
- package/src/assets/css/colors.css +111 -110
- package/src/assets/css/dimensions.css +36 -35
- package/src/assets/css/easings.css +2 -1
- package/src/assets/css/shadows.css +67 -65
- package/src/assets/css/tokens.css +355 -386
- package/src/assets/css/typography.css +109 -0
- package/src/assets/main.css +1 -1
- package/src/assets/styles/helpers/_functions.scss +2 -2
- package/src/assets/styles/helpers/_mixins.scss +1 -3
- package/src/assets/styles/utilities/_index.scss +3 -6
- package/src/components/BaseInputLabel.vue +23 -21
- package/src/components/BaseSelectClearButton.vue +15 -9
- package/src/components/CpAirlineLogo.vue +1 -1
- package/src/components/CpAlert.vue +16 -16
- package/src/components/CpBadge.vue +149 -29
- package/src/components/CpButton.vue +135 -110
- package/src/components/CpButtonGroup.vue +3 -3
- package/src/components/CpCalendar.vue +32 -32
- package/src/components/CpCheckbox.vue +43 -33
- package/src/components/CpContextualMenu.vue +6 -9
- package/src/components/CpDate.vue +53 -40
- package/src/components/CpDatepicker.vue +3 -3
- package/src/components/CpDialog.vue +19 -19
- package/src/components/CpHeading.vue +23 -23
- package/src/components/CpInput.vue +71 -52
- package/src/components/CpItemActions.vue +4 -4
- package/src/components/CpLoader.vue +14 -7
- package/src/components/CpMenuItem.vue +23 -17
- package/src/components/CpMultiselect.vue +84 -58
- package/src/components/CpPartnerBadge.vue +13 -13
- package/src/components/CpRadio.vue +32 -24
- package/src/components/CpSelect.vue +43 -30
- package/src/components/CpSelectMenu.vue +39 -39
- package/src/components/CpSwitch.vue +51 -40
- package/src/components/CpTable.vue +249 -81
- package/src/components/CpTableColumnEditor.vue +18 -16
- package/src/components/CpTableEmptyState.vue +9 -9
- package/src/components/CpTabs.vue +15 -15
- package/src/components/CpTelInput.vue +76 -70
- package/src/components/CpTextarea.vue +27 -17
- package/src/components/CpToast.vue +49 -49
- package/src/components/CpTooltip.vue +6 -6
- package/src/components/CpTransitionDialog.vue +1 -1
- package/src/constants/Sizes.ts +5 -0
- package/src/constants/colors/Colors.ts +15 -5
- package/src/constants/colors/ToggleColors.ts +2 -1
- package/src/libs/CoreDatepicker.vue +21 -18
- package/src/stories/CpBadge.stories.ts +25 -17
- package/src/stories/CpButton.stories.ts +6 -5
- package/src/stories/CpCheckbox.stories.ts +4 -4
- package/src/stories/CpContextualMenu.stories.ts +3 -2
- package/src/stories/CpLoader.stories.ts +2 -2
- package/src/stories/CpMenuItem.stories.ts +104 -0
- package/src/stories/CpRadio.stories.ts +29 -2
- package/src/stories/CpSwitch.stories.ts +27 -0
- package/src/stories/CpTable.stories.ts +94 -0
- package/src/assets/css/spacing.css +0 -43
- package/src/assets/styles/helpers/_keyframes.scss +0 -48
- package/src/assets/styles/variables/_colors.scss +0 -89
- package/src/assets/styles/variables/_easings.scss +0 -1
- package/src/assets/styles/variables/_sizing.scss +0 -4
- 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:
|
|
142
|
+
font-size: var(--cp-text-size-sm);
|
|
143
143
|
|
|
144
144
|
&__button {
|
|
145
|
-
box-shadow: inset 0
|
|
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:
|
|
148
|
-
border-radius:
|
|
149
|
-
background:
|
|
150
|
-
padding:
|
|
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:
|
|
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:
|
|
163
|
+
outline: var(--cp-dimensions-0_25) solid var(--cp-background-accent-solid);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
&:focus {
|
|
167
|
-
outline:
|
|
168
|
-
box-shadow: 0 0 0
|
|
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:
|
|
178
|
-
width:
|
|
179
|
-
height:
|
|
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% +
|
|
191
|
+
top: calc(100% + var(--cp-dimensions-1));
|
|
192
192
|
left: 0;
|
|
193
|
-
border:
|
|
194
|
-
border-radius:
|
|
195
|
-
background:
|
|
196
|
-
width: max(100%,
|
|
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:
|
|
203
|
-
height:
|
|
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:
|
|
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:
|
|
213
|
+
color: var(--cp-text-primary);
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
&__filterBar {
|
|
217
|
-
border-top:
|
|
218
|
-
border-bottom:
|
|
219
|
-
background-color:
|
|
220
|
-
padding:
|
|
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:
|
|
227
|
+
color: var(--cp-text-primary);
|
|
228
228
|
|
|
229
229
|
&::placeholder {
|
|
230
|
-
color:
|
|
230
|
+
color: var(--cp-text-secondary);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
i {
|
|
235
|
-
margin-right:
|
|
236
|
-
color:
|
|
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:
|
|
244
|
+
min-height: calc(var(--cp-dimensions-1) * 62.5);
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
&__items {
|
|
248
|
-
margin:
|
|
248
|
+
margin: var(--cp-spacing-sm) 0;
|
|
249
249
|
padding: 0;
|
|
250
|
-
max-height:
|
|
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:
|
|
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:
|
|
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:
|
|
278
|
+
left: var(--cp-spacing-md);
|
|
279
279
|
top: 50%;
|
|
280
280
|
transform: translateY(-50%);
|
|
281
|
-
color:
|
|
281
|
+
color: var(--cp-background-accent-solid);
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
&__emptyState {
|
|
285
|
-
padding:
|
|
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:
|
|
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}
|
|
101
|
-
outline: $color solid
|
|
102
|
-
outline-offset:
|
|
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:
|
|
106
|
+
background-color: var(--cp-background-quaternary-hover);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
&--is#{$className}#{&}--isActive:not(#{&}--isDisabled):hover &__switch {
|
|
110
|
-
background-color:
|
|
110
|
+
background-color: $color;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
.cpSwitch {
|
|
115
|
-
|
|
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:
|
|
130
|
-
line-height:
|
|
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:
|
|
136
|
+
gap: var(--cp-spacing-sm);
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
&__label {
|
|
140
|
-
line-height:
|
|
140
|
+
line-height: var(--cp-line-height-md);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
&__tooltip {
|
|
144
|
-
color:
|
|
145
|
-
padding:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
168
|
-
|
|
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
|
-
|
|
176
|
-
|
|
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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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(
|
|
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:
|
|
195
|
-
background-color:
|
|
204
|
+
border-radius: var(--cp-radius-full);
|
|
205
|
+
background-color: var(--cp-background-quaternary);
|
|
196
206
|
overflow: hidden;
|
|
197
|
-
transition: background-color
|
|
207
|
+
transition: background-color 100ms ease-out;
|
|
198
208
|
display: flex;
|
|
199
|
-
height:
|
|
200
|
-
width:
|
|
201
|
-
margin-block:
|
|
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:
|
|
226
|
+
padding: var(--cp-dimensions-0_5);
|
|
217
227
|
display: flex;
|
|
218
228
|
align-items: center;
|
|
219
|
-
transition: transform 300ms
|
|
229
|
+
transition: transform 300ms var(--cp-easing-elastic);
|
|
220
230
|
}
|
|
221
231
|
|
|
222
232
|
&__knob {
|
|
223
|
-
background-color:
|
|
224
|
-
border-radius:
|
|
225
|
-
|
|
226
|
-
|
|
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>
|