@citizenplane/pimp 18.19.5 → 18.19.6

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": "18.19.5",
3
+ "version": "18.19.6",
4
4
  "scripts": {
5
5
  "dev": "storybook dev -p 8081",
6
6
  "build-storybook": "storybook build --output-dir ./docs",
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="cpAncillaryCategory" :class="cpAncillaryCategoryDynamicClass">
2
+ <div class="cpAncillaryCategory">
3
3
  <component
4
4
  :is="headerTag"
5
5
  v-bind="headerAttrs"
@@ -26,20 +26,22 @@
26
26
  <span v-if="hasFromPrice" class="cpAncillaryCategory__price">{{ formattedPrice }}</span>
27
27
  <cp-switch v-model="checked" color="accent" />
28
28
  </div>
29
- <div v-else-if="isActuallyExpandable" class="cpAncillaryCategory__trailing">
30
- <span v-if="hasFromPrice" class="cpAncillaryCategory__fromPriceClip">
31
- <span :aria-hidden="isOpen" class="cpAncillaryCategory__fromPrice" :class="fromPriceDynamicClass">
32
- <span class="cpAncillaryCategory__fromPriceLabel">{{ fromPriceLabel }}</span>
33
- <span class="cpAncillaryCategory__fromPriceAmount">{{ formattedPrice }}</span>
34
- </span>
35
- </span>
29
+ <template v-else-if="isActuallyExpandable">
30
+ <div class="cpAncillaryCategory__trailing">
31
+ <cp-transition-expand>
32
+ <span v-if="!isOpen && hasFromPrice" class="cpAncillaryCategory__fromPrice">
33
+ <span class="cpAncillaryCategory__fromPriceLabel">{{ fromPriceLabel }}</span>
34
+ <span class="cpAncillaryCategory__fromPriceAmount">{{ formattedPrice }}</span>
35
+ </span>
36
+ </cp-transition-expand>
37
+ </div>
36
38
  <cp-icon
37
39
  class="cpAncillaryCategory__chevron"
38
40
  :class="chevronDynamicClass"
39
41
  size="24"
40
42
  type="chevron-down"
41
43
  />
42
- </div>
44
+ </template>
43
45
  </div>
44
46
  </div>
45
47
  </component>
@@ -133,14 +135,8 @@ const formattedPrice = computed(() => {
133
135
 
134
136
  const hasFromPrice = computed(() => formattedPrice.value !== null)
135
137
 
136
- const fromPriceDynamicClass = computed(() => ({ 'cpAncillaryCategory__fromPrice--isHidden': isOpen.value }))
137
-
138
138
  const chevronDynamicClass = computed(() => ({ 'cpAncillaryCategory__chevron--isRotated': isOpen.value }))
139
139
 
140
- const cpAncillaryCategoryDynamicClass = computed(() => ({
141
- 'cpAncillaryCategory--isOpen': isActuallyExpandable.value && isOpen.value,
142
- }))
143
-
144
140
  const handleHeaderClick = () => {
145
141
  if (isActuallyExpandable.value) isOpen.value = !isOpen.value
146
142
  }
@@ -187,6 +183,7 @@ const handleHeaderClick = () => {
187
183
  @container (width < 30rem) {
188
184
  flex-direction: column;
189
185
  align-items: stretch;
186
+ gap: 0;
190
187
  }
191
188
  }
192
189
 
@@ -199,12 +196,16 @@ const handleHeaderClick = () => {
199
196
  border-radius: var(--cp-radius-lg);
200
197
  gap: var(--cp-spacing-lg);
201
198
 
199
+ &:has(+ .cpAncillaryCategory__chevron) {
200
+ flex: 0 0 fn.px-to-rem(180);
201
+ }
202
+
202
203
  @container (width < 30rem) {
203
204
  justify-content: flex-start;
204
205
  padding: 0;
205
206
 
206
- .cpAncillaryCategory--isOpen & {
207
- display: none;
207
+ &:has(+ .cpAncillaryCategory__chevron) {
208
+ flex: none;
208
209
  }
209
210
  }
210
211
  }
@@ -217,24 +218,13 @@ const handleHeaderClick = () => {
217
218
  line-height: var(--cp-text-lg-line-height);
218
219
  }
219
220
 
220
- &__fromPriceClip {
221
- overflow: hidden;
222
- }
223
-
224
221
  &__fromPrice {
225
222
  display: flex;
226
223
  align-items: center;
227
224
  gap: var(--cp-spacing-sm);
228
- opacity: 1;
229
- transform: translate3d(0, 0, 0);
230
- transition:
231
- opacity 200ms ease,
232
- transform 200ms ease;
233
-
234
- &--isHidden {
235
- opacity: 0;
236
- pointer-events: none;
237
- transform: translate3d(0, 20px, 0);
225
+
226
+ @container (width < 30rem) {
227
+ margin-block-start: var(--cp-spacing-lg);
238
228
  }
239
229
  }
240
230
 
@@ -282,6 +272,11 @@ const handleHeaderClick = () => {
282
272
  min-width: 0;
283
273
  flex: auto;
284
274
  flex-direction: column;
275
+
276
+ .cpAncillaryCategory__content:has(.cpAncillaryCategory__chevron) & {
277
+ min-width: 0;
278
+ flex: 1 1 0;
279
+ }
285
280
  }
286
281
 
287
282
  &__title {