@citizenplane/pimp 10.1.9 → 10.1.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citizenplane/pimp",
3
- "version": "10.1.9",
3
+ "version": "10.1.11",
4
4
  "scripts": {
5
5
  "dev": "storybook dev -p 8080",
6
6
  "build-storybook": "storybook build --output-dir ./docs",
@@ -85,17 +85,17 @@
85
85
  --cp-colors-red-900: #48000c;
86
86
  --cp-colors-red-1000: #320006;
87
87
 
88
- --cp-colors-violet-50: #f8f9ff;
89
- --cp-colors-violet-100: #eaecff;
90
- --cp-colors-violet-200: #ccd0ff;
91
- --cp-colors-violet-300: #acb1ff;
92
- --cp-colors-violet-400: #807dff;
93
- --cp-colors-violet-500: #603dfd;
94
- --cp-colors-violet-600: #4a00da;
95
- --cp-colors-violet-700: #3400a0;
96
- --cp-colors-violet-800: #2a0084;
97
- --cp-colors-violet-900: #1f0067;
98
- --cp-colors-violet-1000: #13004a;
88
+ --cp-colors-accent-50: #f8f9ff;
89
+ --cp-colors-accent-100: #eaecff;
90
+ --cp-colors-accent-200: #ccd0ff;
91
+ --cp-colors-accent-300: #acb1ff;
92
+ --cp-colors-accent-400: #807dff;
93
+ --cp-colors-accent-500: #603dfd;
94
+ --cp-colors-accent-600: #4a00da;
95
+ --cp-colors-accent-700: #3400a0;
96
+ --cp-colors-accent-800: #2a0084;
97
+ --cp-colors-accent-900: #1f0067;
98
+ --cp-colors-accent-1000: #13004a;
99
99
 
100
100
  --cp-colors-white: #ffffff;
101
101
 
@@ -6,7 +6,7 @@
6
6
  --cp-background-surface: var(--cp-colors-white);
7
7
  --cp-background-primary: var(--cp-colors-white);
8
8
  --cp-background-primary-hover: var(--cp-colors-grey-100);
9
- --cp-background-primary-hover-alt: var(--cp-colors-violet-100);
9
+ --cp-background-primary-hover-alt: var(--cp-colors-accent-100);
10
10
  --cp-background-secondary: var(--cp-colors-grey-50);
11
11
  --cp-background-secondary-hover: var(--cp-colors-grey-100);
12
12
  --cp-background-tertiary: var(--cp-colors-grey-100);
@@ -18,12 +18,12 @@
18
18
  --cp-background-disabled: var(--cp-colors-grey-50);
19
19
  --cp-background-overlay: rgba(62, 62, 91, 0.86);
20
20
 
21
- --cp-background-accent-primary: var(--cp-colors-violet-50);
22
- --cp-background-accent-primary-hover: var(--cp-colors-violet-100);
23
- --cp-background-accent-secondary: var(--cp-colors-violet-100);
24
- --cp-background-accent-secondary-hover: var(--cp-colors-violet-200);
25
- --cp-background-accent-solid: var(--cp-colors-violet-500);
26
- --cp-background-accent-solid-hover: var(--cp-colors-violet-600);
21
+ --cp-background-accent-primary: var(--cp-colors-accent-50);
22
+ --cp-background-accent-primary-hover: var(--cp-colors-accent-100);
23
+ --cp-background-accent-secondary: var(--cp-colors-accent-100);
24
+ --cp-background-accent-secondary-hover: var(--cp-colors-accent-200);
25
+ --cp-background-accent-solid: var(--cp-colors-accent-500);
26
+ --cp-background-accent-solid-hover: var(--cp-colors-accent-600);
27
27
 
28
28
  --cp-background-error-primary: var(--cp-colors-red-50);
29
29
  --cp-background-error-primary-hover: var(--cp-colors-red-100);
@@ -81,9 +81,9 @@
81
81
  --cp-border-disabled: var(--cp-colors-grey-100);
82
82
  --cp-border-solid: var(--cp-colors-grey-800);
83
83
 
84
- --cp-border-accent-primary: var(--cp-colors-violet-200);
85
- --cp-border-accent-primary-hover: var(--cp-colors-violet-300);
86
- --cp-border-accent-solid: var(--cp-colors-violet-500);
84
+ --cp-border-accent-primary: var(--cp-colors-accent-200);
85
+ --cp-border-accent-primary-hover: var(--cp-colors-accent-300);
86
+ --cp-border-accent-solid: var(--cp-colors-accent-500);
87
87
 
88
88
  --cp-border-error-primary: var(--cp-colors-red-200);
89
89
  --cp-border-error-solid: var(--cp-colors-red-500);
@@ -115,10 +115,10 @@
115
115
  --cp-foreground-placeholder: var(--cp-colors-grey-500);
116
116
  --cp-foreground-white: var(--cp-colors-white);
117
117
 
118
- --cp-foreground-accent-primary: var(--cp-colors-violet-500);
119
- --cp-foreground-accent-primary-hover: var(--cp-colors-violet-600);
120
- --cp-foreground-accent-secondary: var(--cp-colors-violet-400);
121
- --cp-foreground-accent-secondary-hover: var(--cp-colors-violet-500);
118
+ --cp-foreground-accent-primary: var(--cp-colors-accent-500);
119
+ --cp-foreground-accent-primary-hover: var(--cp-colors-accent-600);
120
+ --cp-foreground-accent-secondary: var(--cp-colors-accent-400);
121
+ --cp-foreground-accent-secondary-hover: var(--cp-colors-accent-500);
122
122
 
123
123
  --cp-foreground-error-primary: var(--cp-colors-red-500);
124
124
  --cp-foreground-error-primary-hover: var(--cp-colors-red-600);
@@ -163,10 +163,10 @@
163
163
  --cp-text-placeholder: var(--cp-colors-grey-500);
164
164
  --cp-text-white: var(--cp-colors-white);
165
165
 
166
- --cp-text-accent-primary: var(--cp-colors-violet-500);
167
- --cp-text-accent-primary-hover: var(--cp-colors-violet-600);
168
- --cp-text-accent-secondary: var(--cp-colors-violet-700);
169
- --cp-text-accent-secondary-hover: var(--cp-colors-violet-800);
166
+ --cp-text-accent-primary: var(--cp-colors-accent-500);
167
+ --cp-text-accent-primary-hover: var(--cp-colors-accent-600);
168
+ --cp-text-accent-secondary: var(--cp-colors-accent-700);
169
+ --cp-text-accent-secondary-hover: var(--cp-colors-accent-800);
170
170
 
171
171
  --cp-text-error-primary: var(--cp-colors-red-500);
172
172
  --cp-text-error-primary-hover: var(--cp-colors-red-600);
@@ -203,17 +203,17 @@
203
203
  --cp-text-yellow-secondary: var(--cp-colors-yellow-700);
204
204
  --cp-text-yellow-secondary-hover: var(--cp-colors-yellow-800);
205
205
 
206
- --cp-utility-accent-50: var(--cp-colors-violet-50);
207
- --cp-utility-accent-100: var(--cp-colors-violet-100);
208
- --cp-utility-accent-200: var(--cp-colors-violet-200);
209
- --cp-utility-accent-300: var(--cp-colors-violet-300);
210
- --cp-utility-accent-400: var(--cp-colors-violet-400);
211
- --cp-utility-accent-500: var(--cp-colors-violet-500);
212
- --cp-utility-accent-600: var(--cp-colors-violet-600);
213
- --cp-utility-accent-700: var(--cp-colors-violet-700);
214
- --cp-utility-accent-800: var(--cp-colors-violet-800);
215
- --cp-utility-accent-900: var(--cp-colors-violet-900);
216
- --cp-utility-accent-1000: var(--cp-colors-violet-1000);
206
+ --cp-utility-accent-50: var(--cp-colors-accent-50);
207
+ --cp-utility-accent-100: var(--cp-colors-accent-100);
208
+ --cp-utility-accent-200: var(--cp-colors-accent-200);
209
+ --cp-utility-accent-300: var(--cp-colors-accent-300);
210
+ --cp-utility-accent-400: var(--cp-colors-accent-400);
211
+ --cp-utility-accent-500: var(--cp-colors-accent-500);
212
+ --cp-utility-accent-600: var(--cp-colors-accent-600);
213
+ --cp-utility-accent-700: var(--cp-colors-accent-700);
214
+ --cp-utility-accent-800: var(--cp-colors-accent-800);
215
+ --cp-utility-accent-900: var(--cp-colors-accent-900);
216
+ --cp-utility-accent-1000: var(--cp-colors-accent-1000);
217
217
 
218
218
  --cp-utility-blue-50: var(--cp-colors-blue-50);
219
219
  --cp-utility-blue-100: var(--cp-colors-blue-100);
@@ -45,7 +45,7 @@ defineOptions({
45
45
  letter-spacing: var(--cp-letter-spacing-sm);
46
46
  margin-bottom: var(--cp-spacing-md);
47
47
  color: var(--cp-text-primary);
48
- z-index: 1;
48
+ z-index: 2;
49
49
 
50
50
  &::first-letter {
51
51
  text-transform: capitalize;
@@ -125,16 +125,6 @@ const handleClear = () => emit('onClear')
125
125
  }
126
126
  }
127
127
 
128
- &--isDisabled {
129
- background-color: var(--cp-background-disabled);
130
- color: var(--cp-text-disabled);
131
-
132
- &.cpBadge--isStroked,
133
- &.cpBadge--isDashed {
134
- outline-color: var(--cp-border-disabled);
135
- }
136
- }
137
-
138
128
  @include cp-badge-dynamic-padding(
139
129
  var(--cp-spacing-md),
140
130
  var(--cp-spacing-sm),
@@ -311,6 +301,16 @@ const handleClear = () => emit('onClear')
311
301
  var(--cp-border-error-primary)
312
302
  ); // TODO: Should be replace by ERROR
313
303
 
304
+ &--isDisabled {
305
+ background-color: var(--cp-background-disabled);
306
+ color: var(--cp-text-disabled);
307
+
308
+ &.cpBadge--isStroked,
309
+ &.cpBadge--isDashed {
310
+ outline-color: var(--cp-border-disabled);
311
+ }
312
+ }
313
+
314
314
  &__icon {
315
315
  width: var(--cp-dimensions-4);
316
316
  aspect-ratio: 1/1;
@@ -162,7 +162,7 @@ const dynamicClasses = computed(() => {
162
162
 
163
163
  .cpButton {
164
164
  border-radius: fn.px-to-rem(1000);
165
- background-color: transparent;
165
+ background-color: var(--cp-background-primary);
166
166
  padding: var(--cp-spacing-md) var(--cp-spacing-lg);
167
167
  font-size: var(--cp-text-size-md);
168
168
  box-shadow: var(--cp-shadows-3xs);
@@ -431,16 +431,16 @@ watch(year, handleUpdate)
431
431
  &--isInvalid {
432
432
  .cpDate__inputs,
433
433
  .cpDate__inputs:hover {
434
- box-shadow: 0 0 0 var(--cp-dimensions-0_25) var(--cp-border-error-primary);
434
+ box-shadow: 0 0 0 var(--cp-dimensions-0_25) var(--cp-border-error-solid);
435
435
  }
436
436
 
437
437
  .cpDate__inputs:focus-within {
438
- outline: var(--cp-dimensions-0_5) solid var(--cp-border-error-primary);
439
- box-shadow: 0 0 0 var(--cp-dimensions-0_25) color-mix(in srgb, #{var(--cp-border-error-primary)} 40%, transparent);
438
+ outline: var(--cp-dimensions-0_5) solid var(--cp-border-error-solid);
439
+ box-shadow: 0 0 0 var(--cp-dimensions-0_25) color-mix(in srgb, #{var(--cp-border-error-solid)} 40%, transparent);
440
440
  }
441
441
 
442
442
  .cpDate__divider {
443
- background-color: var(--cp-border-error-primary);
443
+ background-color: var(--cp-border-error-solid);
444
444
  }
445
445
  }
446
446
 
@@ -195,6 +195,10 @@ onMounted(async () => {
195
195
  margin-bottom: var(--cp-spacing-md);
196
196
  }
197
197
 
198
+ &:has(.v-popper__popper--shown) {
199
+ z-index: 3;
200
+ }
201
+
198
202
  &__container {
199
203
  z-index: 1;
200
204
  position: relative;
@@ -209,7 +213,7 @@ onMounted(async () => {
209
213
  box-shadow:
210
214
  var(--cp-drop-shadow-3xs-offset-x) var(--cp-drop-shadow-3xs-offset-y) var(--cp-drop-shadow-3xs-blur) -1px
211
215
  var(--cp-drop-shadow-3xs-color),
212
- 0 0 0 var(--cp-dimensions-0_25) var(--cp-border-soft);
216
+ 0 0 0 var(--cp-dimensions-0_25) var(--cp-border-strong);
213
217
  appearance: none;
214
218
  border-radius: var(--cp-radius-md);
215
219
  width: 100%;
@@ -222,7 +226,7 @@ onMounted(async () => {
222
226
  box-shadow:
223
227
  var(--cp-drop-shadow-3xs-offset-x) var(--cp-drop-shadow-3xs-offset-y) var(--cp-drop-shadow-3xs-blur) -1px
224
228
  var(--cp-drop-shadow-3xs-color),
225
- 0 0 0 var(--cp-dimensions-0_25) var(--cp-border-soft-hover);
229
+ 0 0 0 var(--cp-dimensions-0_25) var(--cp-border-strong-hover);
226
230
  }
227
231
 
228
232
  &:focus {
@@ -274,6 +274,10 @@ onMounted(() => overrideAlignOverlay())
274
274
  flex-direction: column;
275
275
  gap: var(--cp-spacing-md);
276
276
 
277
+ &:has(.cpMultiselect__input:disabled) {
278
+ cursor: not-allowed;
279
+ }
280
+
277
281
  &__label {
278
282
  margin-bottom: 0;
279
283
  }
@@ -313,8 +317,8 @@ onMounted(() => overrideAlignOverlay())
313
317
  }
314
318
 
315
319
  &:has(input:disabled) {
316
- background-color: var(--cp-background-white);
317
- cursor: not-allowed;
320
+ background: var(--cp-background-disabled);
321
+ pointer-events: none;
318
322
  box-shadow: 0 0 0 var(--cp-dimensions-0_25) var(--cp-border-disabled);
319
323
  color: var(--cp-text-disabled);
320
324
 
@@ -699,7 +699,13 @@ defineExpose({ hideContextualMenu, resetPagination, currentRowData })
699
699
  box-shadow: inset 0 calc(var(--cp-dimensions-0_25) * -1) 0 var(--cp-border-soft);
700
700
  }
701
701
 
702
- &--body:has(+ #{&}--isFullWidth) {
702
+ &--body:has(+ #{&}--isFullWidth),
703
+ &--isFullWidth:has(+ .cpTable__row:hover) {
704
+ box-shadow: none !important;
705
+ }
706
+
707
+ &--isFullWidth:has(+ .cpTable__row:is(:hover, :focus, :focus-within), + .cpTable__row--isSelected)
708
+ + .cpTable__row::after {
703
709
  box-shadow: none !important;
704
710
  }
705
711
 
@@ -708,6 +714,7 @@ defineExpose({ hideContextualMenu, resetPagination, currentRowData })
708
714
  }
709
715
 
710
716
  &--body:not(#{&}--isFullWidth):is(:hover, :focus, :focus-within) {
717
+ position: relative;
711
718
  transition: background-color 100ms ease-in-out;
712
719
  }
713
720
 
@@ -715,11 +722,10 @@ defineExpose({ hideContextualMenu, resetPagination, currentRowData })
715
722
  background-color: var(--cp-background-primary-hover);
716
723
  }
717
724
 
718
- &--body:not(#{&}--isFullWidth):is(:hover, :focus, :focus-within) {
719
- position: relative;
720
- }
721
-
722
- &--body:not(#{&}--isFullWidth):is(:hover, :focus, :focus-within)::after {
725
+ &--body:not(#{&}--isFullWidth):not(
726
+ :has(+ #{&}--isSelected),
727
+ :has(+ .cpTable__row:is(:hover, :focus, :focus-within))
728
+ ):is(:hover, :focus, :focus-within)::after {
723
729
  content: '';
724
730
  position: absolute;
725
731
  inset: 0;
@@ -785,7 +791,7 @@ defineExpose({ hideContextualMenu, resetPagination, currentRowData })
785
791
  position: relative;
786
792
  }
787
793
 
788
- &--isSelected::after {
794
+ &--isSelected:not(:has(+ #{&}--isFullWidth))::after {
789
795
  content: '';
790
796
  position: absolute;
791
797
  inset: 0;
@@ -1012,7 +1018,6 @@ defineExpose({ hideContextualMenu, resetPagination, currentRowData })
1012
1018
  // On desktop devices, display options only on row focus or hover
1013
1019
  @media (hover: hover) and (pointer: fine) {
1014
1020
  &__cell--isOptions {
1015
- opacity: 0;
1016
1021
  min-width: calc(var(--cp-dimensions-1) * 12.5);
1017
1022
  transition: none;
1018
1023
  }
@@ -1020,6 +1025,7 @@ defineExpose({ hideContextualMenu, resetPagination, currentRowData })
1020
1025
  // Actions wrapper on desktop : displayed only if there are quick actions inside
1021
1026
  &__cell--isOptions .cpTable__actions {
1022
1027
  position: absolute;
1028
+ opacity: 0;
1023
1029
  top: 50%;
1024
1030
  transform: translateY(-50%);
1025
1031
  right: var(--cp-dimensions-3);
@@ -1040,9 +1046,9 @@ defineExpose({ hideContextualMenu, resetPagination, currentRowData })
1040
1046
  display: flex;
1041
1047
  }
1042
1048
 
1043
- &__row:focus &__cell--isOptions,
1044
- &__row:focus-within &__cell--isOptions,
1045
- &__row:hover &__cell--isOptions {
1049
+ &__row:focus &__cell--isOptions > .cpTable__actions,
1050
+ &__row:focus-within &__cell--isOptions > .cpTable__actions,
1051
+ &__row:hover &__cell--isOptions > .cpTable__actions {
1046
1052
  opacity: 1;
1047
1053
  }
1048
1054
  }
@@ -432,7 +432,7 @@ const handleOnValidate = (phoneObject: PhoneObject) => {
432
432
  }
433
433
 
434
434
  &__error {
435
- color: var(--cp-text-error-primary-hover);
435
+ color: var(--cp-text-error-primary);
436
436
 
437
437
  &::first-letter {
438
438
  text-transform: capitalize;
@@ -208,6 +208,18 @@ export const IsDisabled: Story = {
208
208
  render: defaultRender,
209
209
  }
210
210
 
211
+ export const IsDisabledWithIcon: Story = {
212
+ args: {
213
+ ...Default.args,
214
+ isDisabled: true,
215
+ label: 'Disabled',
216
+ color: Colors.RED,
217
+ leadingIcon: 'check',
218
+ trailingIcon: 'arrow-right',
219
+ },
220
+ render: defaultRender,
221
+ }
222
+
211
223
  export const WithSlot: Story = {
212
224
  render: (args: Args) => ({
213
225
  components: { CpBadge },