Skip to content

Commit

Permalink
feat: overlay improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWaldschmidt committed Jul 11, 2024
1 parent 9a97430 commit cab4815
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## v2.0.84

- Improve `Overlay` flexibility
- Add `Filter` icon

## v2.0.83

- Fix attribute handling for conditionally clickable components
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.83",
"version": "2.0.84",
"engines": {
"node": ">=20.2.0",
"npm": ">=10.2.0"
Expand Down
3 changes: 3 additions & 0 deletions src/components/Icon/svgs/Filter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components/Icon/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const IconName = {
FILE_ALT: 'FileAlt',
FILE_INFO: 'FileInfo',
FILE_SHARE: 'FileShare',
FILTER: 'Filter',
FIRE: 'Fire',
FOLDER_INFO: 'FolderInfo',
FUTURE: 'Future',
Expand Down
2 changes: 1 addition & 1 deletion src/components/Overlay/Overlay.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { Primary } from './Overlay.stories';
</script>

<template>
<button @click="(e) => overlayRef.toggle(e)">Toggle Overlay</button>
<button @click="overlayRef.toggle($event)">Toggle Overlay</button>
<Overlay ref="overlayRef" />
</template>
```
Expand Down
17 changes: 14 additions & 3 deletions src/components/Overlay/Overlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,35 @@
}
}"
>
<slot />
<div v-bind="contentProps">
<slot />
</div>
</OverlayPanel>
</template>

<script setup lang="ts">
import OverlayPanel from 'primevue/overlaypanel';
import { ref } from 'vue';
import { HTMLAttributes, ref } from 'vue';
const overlay = ref();
withDefaults(
defineProps<{
contentProps?: HTMLAttributes;
}>(),
{
contentProps: () => ({})
}
);
defineExpose({
toggle: (e: Event) => overlay.value.toggle(e)
});
</script>

<style lang="scss">
.uic-overlay {
@apply my-1 p-2;
@apply my-1;
@apply border border-gray-100 rounded-lg;
@apply bg-white;
@apply shadow-large;
Expand Down

0 comments on commit cab4815

Please sign in to comment.