Skip to main content
Version: v1 (Current)

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 commit fc6bfb108634735f1657e533206c3f8702ad357d; 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'

Repository source

Props​

NameTypeRequired / defaultDescription
activityDataActivityItem[] | undefined[]—
maxToastsnumber | undefined3—
maxQueuednumber | undefined5—
displayDurationnumber | undefined5000—

Exposed methods and values​

NameTypeRequired / defaultDescription
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'

Repository source

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'

Repository source

Props​

NameTypeRequired / defaultDescription
entriesLeaderboardEntry[] | undefined[]—
titlestring | undefined"Leaderboard"—
descriptionstring | undefined——
maxEntriesnumber | undefined10—
showPlaceholdersboolean | undefinedtrue—
topThreeStyle"circle" | "square" | "number_only" | "badge" | undefined"square"—
firstPlaceColorstring | undefined"#FFD700"—
secondPlaceColorstring | undefined"#C0C0C0"—
thirdPlaceColorstring | undefined"#CD7F32"—
showAllTimeRankboolean | undefinedfalse—
loadingboolean | undefinedfalse—
errorstring | undefined——
lockTextstring | undefined——

Slots​

NameTypeRequired / defaultDescription
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'

Repository source

Props​

NameTypeRequired / defaultDescription
activitiesRecentActivityItem[] | undefined[]—
loadingboolean | undefinedfalse—
errorstring | Error | null | undefinednull—
buttonTextstring | undefined"Activity"—
modalTitlestring | undefined"Recent Activity"—

Events​

NameTypeRequired / defaultDescription
open[]——
close[]——
retry[]——

Exposed methods and values​

NameTypeRequired / defaultDescription
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" />',
}),
}