Leaderboard
Generated from public Vue/TypeScript exports by
pnpm docs:generate. Edit source comments and stories to update this reference. Types describe the declared API; browser/device constraints are covered in the guides. This catalog reflects source commitfc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.
ActivityNotifications
import { ActivityNotifications } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
activityData | ActivityItem[] | undefined | [] | — |
maxToasts | number | undefined | 3 | — |
maxQueued | number | undefined | 5 | — |
displayDuration | number | undefined | 5000 | — |
Exposed methods and values
| Name | Type | Required / default | Description |
|---|---|---|---|
addToast | (activity: ActivityItem) => void | — | — |
removeToast | (toastId: string) => void | — | — |
clearAll | () => void | — | — |
Examples
These are authored Storybook excerpts, not complete standalone modules. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import ActivityNotifications from './ActivityNotifications.vue'
import type { ActivityItem } from './ActivityNotifications.vue'
const defaultArgs = {
maxToasts: 3,
maxQueued: 5,
displayDuration: 5000,
}
{
render: (args) => ({
components: { ActivityNotifications },
setup() {
const activityData = ref<ActivityItem[]>([])
const addEarned = () => {
const names = ['Alice', 'Bob', 'Charlie', 'Diana', 'Eve', 'Frank']
const rules = ['Daily Login', 'Quiz Complete', 'Purchase', 'Referral', 'Survey']
activityData.value = [
{
name: names[Math.floor(Math.random() * names.length)],
points: Math.floor(Math.random() * 500) + 50,
transaction_type: 'earned',
game_rule_name: rules[Math.floor(Math.random() * rules.length)],
},
]
}
const addDeducted = () => {
const names = ['Alice', 'Bob', 'Charlie']
activityData.value = [
{
name: names[Math.floor(Math.random() * names.length)],
points: Math.floor(Math.random() * 100) + 10,
transaction_type: 'deducted',
game_rule_name: 'Penalty',
},
]
}
return { args, activityData, addEarned, addDeducted }
},
template: `
<div>
<ActivityNotifications v-bind="args" :activityData="activityData" />
<div class="flex gap-2">
<button
class="rounded bg-emerald-600 px-4 py-2 text-sm font-medium text-white hover:bg-emerald-700"
@click="addEarned"
>
Add Earned Toast
</button>
<button
class="rounded bg-red-600 px-4 py-2 text-sm font-medium text-white hover:bg-red-700"
@click="addDeducted"
>
Add Deducted Toast
</button>
</div>
<p class="mt-4 text-sm text-muted-foreground">
Click the buttons to trigger toast notifications. Toasts auto-dismiss after {{ args.displayDuration / 1000 }}s or can be clicked to dismiss.
</p>
</div>
`,
}),
}
EarnedNotification
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import ActivityNotifications from './ActivityNotifications.vue'
import type { ActivityItem } from './ActivityNotifications.vue'
const defaultArgs = {
maxToasts: 3,
maxQueued: 5,
displayDuration: 5000,
}
{
name: 'Earned Points',
args: {
activityData: [
{
name: 'Alice Johnson',
points: 250,
transaction_type: 'earned',
game_rule_name: 'Daily Login Bonus',
},
],
},
}
DeductedNotification
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import ActivityNotifications from './ActivityNotifications.vue'
import type { ActivityItem } from './ActivityNotifications.vue'
const defaultArgs = {
maxToasts: 3,
maxQueued: 5,
displayDuration: 5000,
}
{
name: 'Deducted Points',
args: {
activityData: [
{
name: 'Bob Smith',
points: 75,
transaction_type: 'deducted',
game_rule_name: 'Late Penalty',
},
],
},
}
AwardIcon
import { AwardIcon } from '@gxp-dev/app-ui'
Examples
These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import AwardIcon from './AwardIcon.vue'
{}
Gold
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import AwardIcon from './AwardIcon.vue'
{
name: 'Gold (1st Place)',
decorators: [
() => ({
template: '<div style="width: 64px; height: 64px; color: #FFD700;"><story /></div>',
}),
],
}
Silver
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import AwardIcon from './AwardIcon.vue'
{
name: 'Silver (2nd Place)',
decorators: [
() => ({
template: '<div style="width: 64px; height: 64px; color: #C0C0C0;"><story /></div>',
}),
],
}
Leaderboard
import { Leaderboard } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
entries | LeaderboardEntry[] | undefined | [] | — |
title | string | undefined | "Leaderboard" | — |
description | string | undefined | — | — |
maxEntries | number | undefined | 10 | — |
showPlaceholders | boolean | undefined | true | — |
topThreeStyle | "circle" | "square" | "number_only" | "badge" | undefined | "square" | — |
firstPlaceColor | string | undefined | "#FFD700" | — |
secondPlaceColor | string | undefined | "#C0C0C0" | — |
thirdPlaceColor | string | undefined | "#CD7F32" | — |
showAllTimeRank | boolean | undefined | false | — |
loading | boolean | undefined | false | — |
error | string | undefined | — | — |
lockText | string | undefined | — | — |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
header | {} | — | — |
footer | {} | — | — |
Examples
These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import Leaderboard from './Leaderboard.vue'
import type { LeaderboardEntry } from './Leaderboard.vue'
const defaultArgs = {
entries: sampleEntries,
title: 'Leaderboard',
maxEntries: 10,
showPlaceholders: true,
topThreeStyle: 'square',
}
{}
SquareStyle
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import Leaderboard from './Leaderboard.vue'
import type { LeaderboardEntry } from './Leaderboard.vue'
const defaultArgs = {
entries: sampleEntries,
title: 'Leaderboard',
maxEntries: 10,
showPlaceholders: true,
topThreeStyle: 'square',
}
{
name: 'Top 3: Square',
args: {
topThreeStyle: 'square',
},
}
CircleStyle
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import Leaderboard from './Leaderboard.vue'
import type { LeaderboardEntry } from './Leaderboard.vue'
const defaultArgs = {
entries: sampleEntries,
title: 'Leaderboard',
maxEntries: 10,
showPlaceholders: true,
topThreeStyle: 'square',
}
{
name: 'Top 3: Circle',
args: {
topThreeStyle: 'circle',
},
}
RecentActivity
import { RecentActivity } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
activities | RecentActivityItem[] | undefined | [] | — |
loading | boolean | undefined | false | — |
error | string | Error | null | undefined | null | — |
buttonText | string | undefined | "Activity" | — |
modalTitle | string | undefined | "Recent Activity" | — |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
open | [] | — | — |
close | [] | — | — |
retry | [] | — | — |
Exposed methods and values
| Name | Type | Required / default | Description |
|---|---|---|---|
toggleModal | () => void | — | — |
closeModal | () => void | — | — |
Examples
These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import RecentActivity from './RecentActivity.vue'
import type { RecentActivityItem } from './RecentActivity.vue'
const defaultArgs = {
activities: sampleActivities,
loading: false,
buttonText: 'Activity',
modalTitle: 'Recent Activity',
}
{
render: (args) => ({
components: { RecentActivity },
setup() {
return { args }
},
template: '<RecentActivity v-bind="args" />',
}),
}
NoActivities
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import RecentActivity from './RecentActivity.vue'
import type { RecentActivityItem } from './RecentActivity.vue'
const defaultArgs = {
activities: sampleActivities,
loading: false,
buttonText: 'Activity',
modalTitle: 'Recent Activity',
}
{
args: {
activities: [],
},
render: (args) => ({
components: { RecentActivity },
setup() {
return { args }
},
template: '<RecentActivity v-bind="args" />',
}),
}
Loading
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import RecentActivity from './RecentActivity.vue'
import type { RecentActivityItem } from './RecentActivity.vue'
const defaultArgs = {
activities: sampleActivities,
loading: false,
buttonText: 'Activity',
modalTitle: 'Recent Activity',
}
{
args: {
loading: true,
},
render: (args) => ({
components: { RecentActivity },
setup() {
return { args }
},
template: '<RecentActivity v-bind="args" />',
}),
}