Skip to content

Commit 4c3bc34

Browse files
committed
Merge branch 'next' of https://github.com/Dataport/polar into chore/update-mpapi
2 parents e0f73bc + 49b1a07 commit 4c3bc34

18 files changed

Lines changed: 245 additions & 228 deletions

File tree

package-lock.json

Lines changed: 133 additions & 104 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/kern/KernBlockButton.ce.vue

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<template>
2+
<button class="kern-btn">
3+
<span v-if="icon" class="kern-icon" :class="icon" aria-hidden="true" />
4+
<span class="kern-label" :class="{ 'kern-sr-only': labelSrOnly }">
5+
<slot />
6+
</span>
7+
</button>
8+
</template>
9+
10+
<script setup lang="ts">
11+
import type { Icon } from '@/core'
12+
13+
defineProps<{ icon?: Icon; labelSrOnly?: boolean }>()
14+
</script>

src/core/components/MoveHandle.ce.vue

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313
:class="{ 'polar-move-handle-has-action-button': actionButton !== null }"
1414
>
1515
<component :is="actionButton" v-if="actionButton" />
16-
<button class="kern-btn kern-btn--tertiary" @click="close(true)">
17-
<span :class="`kern-icon ${closeIcon}`" aria-hidden="true" />
18-
<span class="kern-label kern-sr-only">
19-
{{ closeLabel }}
20-
</span>
21-
</button>
16+
<KernButton
17+
class="kern-btn--tertiary"
18+
:icon="closeIcon"
19+
:label-sr-only="true"
20+
@click="close(true)"
21+
>
22+
{{ closeLabel }}
23+
</KernButton>
2224
</div>
2325
<component :is="component" />
2426
</div>
@@ -35,6 +37,8 @@ import {
3537
watch,
3638
} from 'vue'
3739
40+
import KernButton from '@/components/kern/KernButton.ce.vue'
41+
3842
import { useCoreStore } from '../stores'
3943
import { useMoveHandleStore } from '../stores/moveHandle'
4044

src/core/stores/moveHandle.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { defineStore } from 'pinia'
22
import { type Component, markRaw, ref } from 'vue'
33

4-
import type { MoveHandleProperties } from '../types'
4+
import type { Icon, MoveHandleProperties } from '../types'
55

66
export const useMoveHandleStore = defineStore('moveHandle', () => {
77
const actionButton = ref<Component | null>(null)
88
const closeFunction = ref<(userInteraction: boolean) => void>(() => {})
9-
const closeIcon = ref('kern-icon--close')
9+
const closeIcon = ref<Icon>('kern-icon--close')
1010
const closeLabel = ref('')
1111
const component = ref<Component | null>(null)
1212
const isActive = ref(false)

src/core/types/moveHandle.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import type { Component } from 'vue'
22

3+
import type { Icon } from '../types'
4+
35
export interface MoveHandleProperties {
46
closeFunction: (...args: unknown[]) => unknown
57
closeLabel: string
68
component: Component
79

810
/** Id of the plugin that added the moveHandle. */
911
plugin: string
10-
closeIcon?: string
12+
closeIcon?: Icon
1113
}

src/plugins/addressSearch/components/AddressSearch.ce.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,16 @@
4444
v-if="isLoading"
4545
:style="`right: ${slotPlacement}; top: ${slotPlacement}`"
4646
/>
47-
<button
47+
<KernButton
4848
v-if="inputValue.length && !isLoading"
49-
class="kern-btn kern-btn--tertiary polar-plugin-address-search-input-button"
49+
class="kern-btn--tertiary polar-plugin-address-search-input-button"
5050
:style="`right: ${slotPlacement}; top: ${slotPlacement}`"
51+
icon="kern-icon--close"
52+
:label-sr-only="true"
5153
@click="clear"
5254
>
53-
<span class="kern-icon kern-icon--close" aria-hidden="true" />
54-
<span class="kern-label kern-sr-only">
55-
{{ $t(($) => $.hint.clear, { ns: PluginId }) }}
56-
</span>
57-
</button>
55+
{{ $t(($) => $.hint.clear, { ns: PluginId }) }}
56+
</KernButton>
5857
<!-- Additionally needed so screen readers can detect the aria live region -->
5958
<span class="kern-sr-only" aria-live="polite">
6059
{{ hint }}
@@ -73,6 +72,7 @@ import { t } from 'i18next'
7372
import { storeToRefs } from 'pinia'
7473
import { computed, nextTick } from 'vue'
7574
75+
import KernButton from '@/components/kern/KernButton.ce.vue'
7676
import PolarCard from '@/components/PolarCard.ce.vue'
7777
import PolarSelect from '@/components/PolarSelect.ce.vue'
7878
import { useCoreStore } from '@/core/stores'

src/plugins/addressSearch/components/SearchResults.ce.vue

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,29 +57,28 @@
5757
</li>
5858
</template>
5959
</ul>
60-
<button
60+
<KernButton
6161
v-if="searchResults[i].features.features.length > limitResults"
62-
class="kern-btn kern-btn--tertiary"
62+
class="kern-btn--tertiary"
63+
:icon="
64+
areResultsExpanded(result.categoryId)
65+
? 'kern-icon--keyboard-arrow-up'
66+
: 'kern-icon--keyboard-arrow-down'
67+
"
6368
@keydown.down.prevent.stop="(event) => focusNextElement(true, event)"
6469
@keydown.up.prevent.stop="(event) => focusNextElement(false, event)"
6570
@click="toggle(result.categoryId)"
6671
>
67-
<span
68-
:class="`kern-icon ${areResultsExpanded(result.categoryId) ? 'kern-icon--keyboard-arrow-up' : 'kern-icon--keyboard-arrow-down'}`"
69-
aria-hidden="true"
70-
/>
71-
<span class="kern-label">
72-
{{
73-
$t(
74-
($) =>
75-
$.resultList[
76-
areResultsExpanded(result.categoryId) ? 'reduce' : 'extend'
77-
],
78-
{ ns: PluginId }
79-
)
80-
}}
81-
</span>
82-
</button>
72+
{{
73+
$t(
74+
($) =>
75+
$.resultList[
76+
areResultsExpanded(result.categoryId) ? 'reduce' : 'extend'
77+
],
78+
{ ns: PluginId }
79+
)
80+
}}
81+
</KernButton>
8382
<hr
8483
v-if="i < results.length - 1"
8584
class="kern-divider"
@@ -93,6 +92,7 @@
9392
import { storeToRefs } from 'pinia'
9493
import { computed, nextTick, ref, toRaw, watch } from 'vue'
9594
95+
import KernButton from '@/components/kern/KernButton.ce.vue'
9696
import { useCoreStore } from '@/core/stores'
9797
9898
import { useAddressSearchStore } from '../store'

src/plugins/filter/components/FilterCategory.ce.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
"
1414
>
1515
<div class="polar-filter-category-values">
16-
<KernBlockButton
16+
<KernButton
1717
v-if="category.selectAll"
18+
class="kern-btn--block kern-btn--tertiary"
1819
icon="kern-icon--deselect"
1920
@click="filterStore.selectOrDeselectAllFromCategory(category)"
2021
>
2122
{{ $t(($) => $.category.deselectAll, { ns: PluginId }) }}
22-
</KernBlockButton>
23+
</KernButton>
2324
<component
2425
:is="
2526
coreStore.layout === 'standard'
@@ -58,8 +59,8 @@
5859
</template>
5960

6061
<script setup lang="ts">
61-
import KernBlockButton from '@/components/kern/KernBlockButton.ce.vue'
6262
import KernBlockButtonCheckbox from '@/components/kern/KernBlockButtonCheckbox.ce.vue'
63+
import KernButton from '@/components/kern/KernButton.ce.vue'
6364
import KernCheckbox from '@/components/kern/KernCheckbox.ce.vue'
6465
import { useCoreStore } from '@/core/stores'
6566
@@ -71,3 +72,11 @@ import FilterSection from './FilterSection.ce.vue'
7172
const coreStore = useCoreStore()
7273
const filterStore = useFilterStore()
7374
</script>
75+
76+
<style scoped>
77+
.kern-btn--tertiary {
78+
background-color: #edf1fa;
79+
justify-content: left;
80+
margin-bottom: var(--kern-metric-space-small);
81+
}
82+
</style>

src/plugins/filter/components/FilterUI.ce.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const filterStore = useFilterStore()
3939
}
4040
4141
:deep(.kern-accordion-group .polar-filter-category-values) {
42-
margin-top: var(--kern-metric-space-default);
42+
margin-top: var(--kern-metric-space-small);
4343
}
4444
4545
.kern-accordion-group {

0 commit comments

Comments
 (0)