Skip to content

Commit

Permalink
feat: add new icons (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWaldschmidt authored May 2, 2024
1 parent 2e32e46 commit c9835d5
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 25 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## v2.0.48

- Add new icons for the `Icon` component
- `Details`
- `Previous`

## v2.0.47

- Use the correct classes for box shadow in `Overlay` and `Menu` component.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lob/ui-components",
"version": "2.0.47",
"version": "2.0.48",
"engines": {
"node": ">=20.2.0",
"npm": ">=10.2.0"
Expand Down
3 changes: 3 additions & 0 deletions src/components/Icon/svgs/Details.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/components/Icon/svgs/Previous.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/components/Icon/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const IconName = {
COIN: 'Coin',
CREDIT_CARD: 'CreditCard',
DELETE: 'Delete',
DETAILS: 'Details',
DUPLICATE: 'Duplicate',
EDIT: 'Edit',
ENVELOPE: 'Envelope',
Expand All @@ -60,6 +61,7 @@ export const IconName = {
PLAN_GROWTH: 'PlanGrowth',
PLAN_STARTUP: 'PlanStartup',
PLUS: 'Plus',
PREVIOUS: 'Previous',
PROCESSING: 'Processing',
SIGNAL: 'Signal',
SUCCESS: 'Success',
Expand Down
4 changes: 4 additions & 0 deletions src/components/IconButton/IconButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ const linkTag = computed(() => {
.uic-icon-button {
@apply rounded-lg;
&:disabled {
@apply cursor-not-allowed;
}
&.size- {
&sm {
@apply p-2;
Expand Down
43 changes: 23 additions & 20 deletions src/components/LoadingIndicator/LoadingIndicator.vue
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
<template>
<div
:class="loading ? `loading-gif ${loadingClass}` : ''"
:class="isLoading ? `loading-gif ${loadingClass}` : ''"
aria-live="polite"
:aria-busy="loading"
:aria-busy="isLoading"
data-testId="loading-indicator"
>
<slot />
</div>
</template>

<script>
import { Comment } from 'vue';
<script setup lang="ts">
import { Comment, computed, defineOptions, defineSlots } from 'vue';
export default {
name: 'LoadingIndicator',
props: {
loadingClass: {
type: String,
default: ''
}
},
computed: {
loading() {
return (
!this.$slots.default ||
this.$slots.default().findIndex((o) => o.type !== Comment) === -1
);
}
defineOptions({ name: 'LoadingIndicator' });
withDefaults(
defineProps<{
loadingClass?: string;
}>(),
{
loadingClass: undefined
}
};
);
const slots = defineSlots<{
default(): any;
}>();
const isLoading = computed(
() =>
!slots.default ||
slots.default().findIndex((o: any) => o.type !== Comment) === -1
);
</script>

<style lang="scss" scoped>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ describe('LoadingIndicator', () => {
});

describe('when there is content in the default slot', () => {
let slotContent;
let slots;
let slotContent: string;
let slots: Record<string, string>;
beforeEach(() => {
slotContent = 'Hello, this is the slot.';
slots = { default: slotContent };
Expand Down

0 comments on commit c9835d5

Please sign in to comment.