@citizenplane/pimp 18.12.1 → 18.12.3

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.12.1",
3
+ "version": "18.12.3",
4
4
  "scripts": {
5
5
  "dev": "storybook dev -p 8081",
6
6
  "build-storybook": "storybook build --output-dir ./docs",
@@ -320,10 +320,6 @@ onMounted(() => overrideAlignOverlay())
320
320
 
321
321
  <style lang="scss">
322
322
  .cpMultiselect {
323
- display: flex;
324
- flex-direction: column;
325
- gap: var(--cp-spacing-md);
326
-
327
323
  &:has(.cpMultiselect__input:disabled) {
328
324
  cursor: not-allowed;
329
325
  }
@@ -337,6 +333,7 @@ onMounted(() => overrideAlignOverlay())
337
333
  flex-shrink: 0;
338
334
  align-items: center;
339
335
  order: -1;
336
+ padding: var(--cp-spacing-xs);
340
337
 
341
338
  &:empty {
342
339
  display: none;
@@ -350,10 +347,10 @@ onMounted(() => overrideAlignOverlay())
350
347
  justify-content: space-between;
351
348
  padding: var(--cp-spacing-md);
352
349
  border-radius: var(--cp-radius-md);
350
+ background-color: var(--cp-background-primary);
353
351
  box-shadow:
354
352
  var(--cp-shadows-3xs-inset),
355
353
  0 0 0 var(--cp-dimensions-0_25) var(--cp-border-soft);
356
- gap: var(--cp-spacing-md);
357
354
 
358
355
  &--sm {
359
356
  padding: var(--cp-spacing-sm);
@@ -430,6 +427,9 @@ onMounted(() => overrideAlignOverlay())
430
427
  display: flex;
431
428
  align-items: center;
432
429
  justify-content: center;
430
+ width: fn.px-to-rem(24);
431
+ height: fn.px-to-rem(24);
432
+ padding-right: var(--cp-spacing-sm);
433
433
 
434
434
  &:disabled {
435
435
  cursor: not-allowed;
@@ -448,6 +448,7 @@ onMounted(() => overrideAlignOverlay())
448
448
  background-color: transparent;
449
449
  font-size: var(--cp-text-size-sm);
450
450
  line-height: var(--cp-line-height-md);
451
+ padding-inline: var(--cp-spacing-md);
451
452
 
452
453
  &::placeholder {
453
454
  color: var(--cp-text-placeholder);
@@ -88,13 +88,21 @@ export const Single: Story = {
88
88
  components: { CpMultiselect },
89
89
  setup() {
90
90
  const selectedSupplier = ref(null)
91
- return { args, selectedSupplier }
91
+
92
+ const getOptionIataCode = (option?: { iata_code?: string | null; icao_code?: string | null }) => {
93
+ return option?.iata_code || option?.icao_code || undefined
94
+ }
95
+
96
+ return { args, selectedSupplier, getOptionIataCode }
92
97
  },
93
98
  template: `
94
99
  <div style="padding: 20px; width: 25rem;">
95
100
  <CpMultiselect v-model="selectedSupplier" v-bind="args">
96
101
  <template #prefix>
97
- <cp-partner-badge type="supplier" size="sm" />
102
+ <div class="baseSelectAirline__prefix">
103
+ <partner-badge size="sm" type="airline" variant="soft" />
104
+ <cp-airline-logo :iata-code="getOptionIataCode(selectedSupplier)" size="20" />
105
+ </div>
98
106
  </template>
99
107
  </CpMultiselect>
100
108
  </div>
@@ -146,9 +154,6 @@ export const MultipleWithAsyncSearch: Story = {
146
154
  template: `
147
155
  <div style="padding: 20px; max-width: 25rem;">
148
156
  <CpMultiselect v-model="selectedAirlines" v-bind="args" :options="dynamicOptions" :is-loading="isLoading" @search="handleSearch">
149
- <template #prefix>
150
- <cp-partner-badge type="airline" size="sm" />
151
- </template>
152
157
  <template #tag-leading-icon="{ option }">
153
158
  <cp-airline-logo :iata-code="option.iata_code" size="14" />
154
159
  </template>