@citizenplane/pimp 18.12.0 → 18.12.2

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.0",
3
+ "version": "18.12.2",
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;
@@ -353,7 +350,6 @@ onMounted(() => overrideAlignOverlay())
353
350
  box-shadow:
354
351
  var(--cp-shadows-3xs-inset),
355
352
  0 0 0 var(--cp-dimensions-0_25) var(--cp-border-soft);
356
- gap: var(--cp-spacing-md);
357
353
 
358
354
  &--sm {
359
355
  padding: var(--cp-spacing-sm);
@@ -430,6 +426,9 @@ onMounted(() => overrideAlignOverlay())
430
426
  display: flex;
431
427
  align-items: center;
432
428
  justify-content: center;
429
+ width: fn.px-to-rem(24);
430
+ height: fn.px-to-rem(24);
431
+ padding-right: var(--cp-spacing-sm);
433
432
 
434
433
  &:disabled {
435
434
  cursor: not-allowed;
@@ -448,6 +447,7 @@ onMounted(() => overrideAlignOverlay())
448
447
  background-color: transparent;
449
448
  font-size: var(--cp-text-size-sm);
450
449
  line-height: var(--cp-line-height-md);
450
+ padding-inline: var(--cp-spacing-md);
451
451
 
452
452
  &::placeholder {
453
453
  color: var(--cp-text-placeholder);
@@ -80,10 +80,14 @@ const dynamicSegmentedControlItemClasses = computed(() => ({
80
80
  width: 100%;
81
81
  }
82
82
 
83
- &--md &__inner {
83
+ &--lg &__inner {
84
84
  padding: fn.px-to-rem(13) var(--cp-spacing-xl);
85
85
  }
86
86
 
87
+ &--md &__inner {
88
+ padding: fn.px-to-rem(9) var(--cp-spacing-xl);
89
+ }
90
+
87
91
  &--sm &__inner {
88
92
  padding: calc(var(--cp-spacing-sm-md) - 1px) var(--cp-spacing-xl);
89
93
  }
@@ -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>
@@ -5,7 +5,7 @@ import CpSegmentedControl from '@/components/CpSegmentedControl.vue'
5
5
 
6
6
  import { docCellStyle, docLabelStyle, docRowColumnStyle } from '@/stories/documentationStyles'
7
7
 
8
- const segmentedControlSizes = ['sm', 'md'] as const
8
+ const segmentedControlSizes = ['sm', 'md', 'lg'] as const
9
9
 
10
10
  const meta = {
11
11
  title: 'Molecules/CpSegmentedControl',