-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Issue/#156 events counters
- Loading branch information
Showing
18 changed files
with
324 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from "./pages"; | ||
export * from './pages' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,6 @@ | ||
import { EVENT_TYPES } from "../types"; | ||
import {EVENT_TYPES} from "../types"; | ||
|
||
export const PAGE_TYPES = { | ||
VAR_DUMP: EVENT_TYPES.VAR_DUMP, | ||
SMTP: EVENT_TYPES.SMTP, | ||
SENTRY: EVENT_TYPES.SENTRY, | ||
PROFILER: EVENT_TYPES.PROFILER, | ||
MONOLOG: EVENT_TYPES.MONOLOG, | ||
INSPECTOR: EVENT_TYPES.INSPECTOR, | ||
HTTP_DUMP: EVENT_TYPES.HTTP_DUMP, | ||
RAY_DUMP: EVENT_TYPES.RAY_DUMP, | ||
...EVENT_TYPES, | ||
ALL_EVENTS: "all-events", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import type { Meta, StoryObj } from "@storybook/vue3"; | ||
import BadgeNumber from './badge-number.vue'; | ||
|
||
export default { | ||
title: "Shared/BadgeNumber", | ||
component: BadgeNumber, | ||
render: (args) => ({ | ||
setup() { | ||
return { | ||
args, | ||
}; | ||
}, | ||
components: { BadgeNumber }, | ||
template: ` | ||
<BadgeNumber v-bind="args"> | ||
<button style="width: 100px"> | ||
Button | ||
</button> | ||
</BadgeNumber> | ||
`, | ||
}) | ||
} as Meta<typeof BadgeNumber>; | ||
|
||
|
||
export const Default: StoryObj<typeof BadgeNumber> = { | ||
args: { | ||
number: 1, | ||
isVisible: true, | ||
} | ||
}; | ||
|
||
|
||
export const Maximum: StoryObj<typeof BadgeNumber> = { | ||
args: { | ||
number: 10000, | ||
isVisible: true, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<script lang="ts" setup> | ||
import { computed } from "vue"; | ||
type Props = { | ||
number: number; | ||
isVisible?: boolean; | ||
}; | ||
const props = withDefaults(defineProps<Props>(), { | ||
isVisible: true, | ||
}); | ||
const normalizedNumber = computed(() => | ||
props.number > 99 ? "*" : props.number | ||
); | ||
const isVisibleBadge = computed(() => props.number > 0 && props.isVisible); | ||
</script> | ||
|
||
<template> | ||
<div class="badge-number"> | ||
<slot></slot> | ||
|
||
<div v-if="isVisibleBadge" class="badge-number__badge"> | ||
{{ normalizedNumber }} | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
@import "src/assets/mixins"; | ||
.badge-number { | ||
@apply relative flex; | ||
} | ||
.badge-number__badge { | ||
@apply bg-red-700 dark:bg-red-800 text-white shadow-lg ring-1 dark:ring-gray-800 ring-gray-300; | ||
@apply flex justify-center items-center; | ||
@apply absolute rounded-full font-thin leading-none; | ||
@apply sm:-right-2 sm:-top-2 -right-1 -top-1 sm:w-4 sm:h-4 w-3 h-3 sm:text-[10px] text-[8px]; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as BadgeNumber } from "./badge-number.vue"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.