Skip to content

Commit

Permalink
fix(*): add title or decorative prop to icons
Browse files Browse the repository at this point in the history
  • Loading branch information
portikM committed Apr 17, 2024
1 parent 2dff8c3 commit bc4f713
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 20 deletions.
2 changes: 2 additions & 0 deletions src/components/KCheckbox/KCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
v-if="modelValue"
class="checkbox-icon"
data-testid="check-icon"
decorative
:size="KUI_ICON_SIZE_40"
tabindex="-1"
/>
<IndeterminateSmallIcon
v-if="isIndeterminate && !modelValue"
class="checkbox-icon"
data-testid="indeterminate-icon"
decorative
:size="KUI_ICON_SIZE_40"
tabindex="-1"
/>
Expand Down
14 changes: 8 additions & 6 deletions src/components/KCodeBlock/KCodeBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@
type="button"
@click="clearQuery"
>
<CloseIcon />
<CloseIcon decorative />
</button>
<SearchIcon
v-else
class="code-block-search-icon"
decorative
/>
</Transition>
</template>
Expand All @@ -56,6 +57,7 @@
:color="getIconColor"
data-testid="code-block-processing-icon"
:size="KUI_ICON_SIZE_30"
title="Loading spinner"
/>
</Transition>

Expand Down Expand Up @@ -89,7 +91,7 @@
:title="`Use regular expression (${ALT_SHORTCUT_LABEL}+R)`"
@click="toggleRegExpMode"
>
<RegexIcon />
<RegexIcon decorative />
</KCodeBlockIconButton>

<KCodeBlockIconButton
Expand All @@ -102,7 +104,7 @@
:title="`Filter results (${ALT_SHORTCUT_LABEL}+F)`"
@click="toggleFilterMode"
>
<FilterIcon />
<FilterIcon decorative />
</KCodeBlockIconButton>

<KCodeBlockIconButton
Expand All @@ -114,7 +116,7 @@
title="Previous match (Shift+F3)"
@click="jumpToPreviousMatch"
>
<ArrowUpIcon />
<ArrowUpIcon decorative />
</KCodeBlockIconButton>

<KCodeBlockIconButton
Expand All @@ -126,7 +128,7 @@
title="Next match (F3)"
@click="jumpToNextMatch"
>
<ArrowDownIcon />
<ArrowDownIcon decorative />
</KCodeBlockIconButton>
</div>
</div>
Expand Down Expand Up @@ -204,7 +206,7 @@
:theme="theme"
@click="copyCode"
>
<CopyIcon />
<CopyIcon decorative />
</KCodeBlockIconButton>

<slot name="secondary-actions" />
Expand Down
1 change: 1 addition & 0 deletions src/components/KCopy/KCopy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
class="text-icon"
:hide-title="!!copyTooltip || undefined"
:size="KUI_ICON_SIZE_30"
:title="tooltipText"
/>
</button>
</KClipboardProvider>
Expand Down
1 change: 1 addition & 0 deletions src/components/KDropdown/KDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
{{ triggerButtonText }}
<ChevronDownIcon
v-if="showCaret"
decorative
/>
</KButton>
</slot>
Expand Down
1 change: 1 addition & 0 deletions src/components/KExternalLink/KExternalLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<ExternalLinkIcon
v-if="!hideIcon"
:size="KUI_ICON_SIZE_30"
title="External link icon"
/>
</a>
</template>
Expand Down
1 change: 1 addition & 0 deletions src/components/KLabel/KLabel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
class="tooltip-trigger-icon"
:color="`var(--kui-color-text-neutral, ${KUI_COLOR_TEXT_NEUTRAL})`"
tabindex="0"
title="More info"
/>
<template #content>
<slot name="tooltip">{{ info || help }}</slot>
Expand Down
5 changes: 4 additions & 1 deletion src/components/KModal/KModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
type="button"
@click="$emit('cancel')"
>
<CloseIcon :color="KUI_COLOR_TEXT_NEUTRAL" />
<CloseIcon
:color="KUI_COLOR_TEXT_NEUTRAL"
decorative
/>
</button>
</div>
<div
Expand Down
4 changes: 3 additions & 1 deletion src/components/KMultiselect/KMultiselect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
type="button"
@click="handleItemSelect(item)"
>
<CloseIcon />
<CloseIcon decorative />
</button>
</template>
</KBadge>
Expand Down Expand Up @@ -139,10 +139,12 @@
v-else-if="loading"
class="multiselect-loading-icon"
:size="KUI_ICON_SIZE_40"
title="Loading spinner"
/>
<ChevronDownIcon
v-else
class="multiselect-chevron-icon"
decorative
:size="KUI_ICON_SIZE_40"
/>
</div>
Expand Down
15 changes: 12 additions & 3 deletions src/components/KPagination/KPagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
type="button"
@click="pageBack"
>
<BackIcon class="pagination-arrow-icon" />
<BackIcon
class="pagination-arrow-icon"
decorative
/>
</KButton>
</li>
<li v-if="!disablePageJump && firstDetached">
Expand Down Expand Up @@ -85,7 +88,10 @@
type="button"
@click="pageForward"
>
<ForwardIcon class="pagination-arrow-icon" />
<ForwardIcon
class="pagination-arrow-icon"
decorative
/>
</KButton>
</li>
</ul>
Expand Down Expand Up @@ -113,7 +119,10 @@
:disabled="pageSizeOptions.length <= 1"
type="button"
>
{{ pageSizeText }}<ChevronDownIcon v-if="pageSizeOptions.length > 1" />
{{ pageSizeText }}<ChevronDownIcon
v-if="pageSizeOptions.length > 1"
decorative
/>
</KButton>
</KDropdown>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/KPagination/PaginationOffset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
type="button"
@click.prevent="emit('getPreviousOffset')"
>
<BackIcon />
<BackIcon decorative />
</KButton>
<KButton
appearance="tertiary"
Expand All @@ -20,7 +20,7 @@
type="button"
@click.prevent="emit('getNextOffset')"
>
<ForwardIcon />
<ForwardIcon decorative />
</KButton>
</div>
</template>
Expand Down
8 changes: 6 additions & 2 deletions src/components/KSelect/KSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@
type="button"
@click="clearSelection"
>
<CloseIcon />
<CloseIcon decorative />
</button>
<ChevronDownIcon
class="chevron-down-icon"
:class="{ 'disabled': isDisabled }"
decorative
/>
</template>
<template
Expand Down Expand Up @@ -110,7 +111,10 @@
data-testid="select-loading"
>
<slot name="loading">
<ProgressIcon class="loading-icon" />
<ProgressIcon
class="loading-icon"
title="Loading in progress"
/>
</slot>
</div>
<div
Expand Down
1 change: 1 addition & 0 deletions src/components/KSkeleton/KSkeleton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
v-else-if="type === 'spinner'"
class="skeleton-spinner"
:color="KUI_COLOR_TEXT_NEUTRAL"
title="Loading in progress"
/>

<Skeleton v-else />
Expand Down
5 changes: 4 additions & 1 deletion src/components/KSlideout/KSlideout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
type="button"
@click.stop="$emit('close')"
>
<CloseIcon :color="KUI_COLOR_TEXT_NEUTRAL" />
<CloseIcon
:color="KUI_COLOR_TEXT_NEUTRAL"
decorative
/>
</button>
</div>
<div class="slideout-content">
Expand Down
3 changes: 2 additions & 1 deletion src/components/KTable/ColumnVisibilityMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
<KTooltip text="Show/Hide Columns">
<KButton
appearance="secondary"
aria-label="Show/Hide Columns"
class="menu-button"
data-testid="column-visibility-menu-button"
size="large"
>
<template #icon>
<TableColumnsIcon />
<TableColumnsIcon decorative />
</template>
</KButton>
</KTooltip>
Expand Down
2 changes: 1 addition & 1 deletion src/components/KTreeList/KTreeItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
data-testid="tree-item-icon"
>
<slot name="item-icon">
<ServiceDocumentIcon />
<ServiceDocumentIcon decorative />
</slot>
</div>
<div
Expand Down
8 changes: 6 additions & 2 deletions src/components/KTruncate/KTruncate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
:truncated-count="truncatedCount"
>
<button
:aria-label="`Show ${truncatedCount} more items`"
class="expand-trigger"
type="button"
@click.stop="handleToggleClick"
Expand All @@ -43,12 +44,15 @@
name="collapse-trigger"
>
<button
aria-label="Toggle"
aria-label="Collapse content"
class="collapse-trigger"
type="button"
@click.stop="handleToggleClick"
>
<ChevronUpIcon :size="KUI_ICON_SIZE_30" />
<ChevronUpIcon
decorative
:size="KUI_ICON_SIZE_30"
/>
</button>
</slot>
</div>
Expand Down

0 comments on commit bc4f713

Please sign in to comment.