@betterworldcollective/dashboard 0.0.0-stage → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/card/CampaignCard.vue.d.ts +9 -0
- package/dist/components/header/BwHeader.story-mocks.d.ts +4 -0
- package/dist/components/header/BwHeader.vue.d.ts +25 -0
- package/dist/components/header/index.d.ts +1 -0
- package/dist/components/layout/BwLayout.vue.d.ts +29 -0
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/onboarding/campaign-card/BwOnboardingCampaignCardCreation.vue.d.ts +43 -0
- package/dist/components/onboarding/campaign-card/index.d.ts +1 -0
- package/dist/components/organization/OrganizationLogo.vue.d.ts +7 -0
- package/dist/components/sidebar/BwSidebar.vue.d.ts +12 -0
- package/dist/components/sidebar/BwSidebarBadge.vue.d.ts +12 -0
- package/dist/components/sidebar/BwSidebarGroup.vue.d.ts +18 -0
- package/dist/components/sidebar/BwSidebarItem.vue.d.ts +34 -0
- package/dist/components/sidebar/BwSidebarSubItem.vue.d.ts +27 -0
- package/dist/components/sidebar/context.d.ts +13 -0
- package/dist/components/sidebar/icons.d.ts +4 -0
- package/dist/components/sidebar/index.d.ts +5 -0
- package/dist/components/ticket/BwTicketStatsCard.vue.d.ts +34 -0
- package/dist/components/ticket/TicketStatsRing.vue.d.ts +9 -0
- package/dist/components/ticket/index.d.ts +2 -0
- package/dist/composables/useChart.d.ts +12 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +488 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +3 -0
- package/dist/types/Campaign.d.ts +17 -0
- package/package.json +47 -3
- package/README.md +0 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
title: string;
|
|
3
|
+
items: {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}[];
|
|
7
|
+
};
|
|
8
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const globalSearch = "\n <label class=\"flex h-[36px] min-w-0 flex-1 items-center gap-[10px] rounded-xs bg-white/20 px-4 text-white\">\n <SearchIcon class=\"shrink-0\" />\n <input\n type=\"search\"\n placeholder=\"Search anything...\"\n class=\"min-w-0 flex-1 bg-transparent text-[14px] text-white outline-none placeholder:text-white/80\"\n />\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" class=\"shrink-0\" aria-hidden=\"true\">\n <rect x=\"1.75\" y=\"1.75\" width=\"10.5\" height=\"10.5\" rx=\"2\" stroke=\"currentColor\" stroke-width=\"1.5\" />\n <path d=\"M4.5 9.5 6 4.5h.5L8 9.5M5 8h2.5M10 4.5v5\" stroke=\"currentColor\" stroke-width=\"1.2\" stroke-linecap=\"round\" />\n <path d=\"M13 11v4M11 13h4\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </label>\n";
|
|
2
|
+
export declare const notification = "\n <button type=\"button\" class=\"relative ml-[56px] shrink-0 text-white\" aria-label=\"Notifications\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M10 2a5.5 5.5 0 0 0-5.5 5.5v3.2L3 13.5V15h14v-1.5l-1.5-2.8V7.5A5.5 5.5 0 0 0 10 2Zm-2 14.5a2 2 0 0 0 4 0H8Z\" />\n </svg>\n <span class=\"absolute right-0 top-0 size-[7px] rounded-full bg-[#E5484D] ring-2 ring-text-primary\" />\n </button>\n";
|
|
3
|
+
export declare const userDropdown = "\n <button\n type=\"button\"\n class=\"ml-[15px] flex h-[32px] w-[202px] shrink-0 items-center gap-[10px] rounded-full bg-black/20 pr-[14px] text-left text-white\"\n aria-haspopup=\"menu\"\n >\n <span class=\"flex size-[32px] shrink-0 items-center justify-center rounded-full bg-white text-text-primary\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"m8 1.5 1.9 4 4.3.5-3.2 3 .9 4.3L8 11.2l-3.9 2.1.9-4.3-3.2-3 4.3-.5L8 1.5Z\" stroke=\"currentColor\" stroke-width=\"1.3\" stroke-linejoin=\"round\" />\n </svg>\n </span>\n <span class=\"flex min-w-0 flex-1 flex-col font-normal leading-[1.2]\">\n <span class=\"truncate text-[12px]\">Youthstar</span>\n <span class=\"truncate text-[10px] text-white/40\">Sergey</span>\n </span>\n <ChevronDownIcon class=\"shrink-0\" />\n </button>\n";
|
|
4
|
+
export declare const productBuilderNavigation = "\n <div class=\"flex h-[54px] items-center gap-[28px] border-b border-[#E6E8EB] px-[28px]\">\n <div class=\"flex min-w-0 flex-1 items-center gap-2 text-[16px]\">\n <span class=\"truncate\">My event</span>\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M8.6 1.2 10.8 3.4 4.2 10H2V7.8L8.6 1.2ZM1.5 11h9v1h-9z\" />\n </svg>\n </div>\n <button type=\"button\" class=\"flex h-[36px] w-[248px] shrink-0 items-center justify-between rounded-xs border border-[#D9DCE0] px-4 text-[13px]\">\n 2. Event date\n <ChevronDownIcon />\n </button>\n <div class=\"flex shrink-0 items-center gap-3 text-[13px] text-text-primary/50\">\n 2 of 7\n <span class=\"h-[4px] w-[140px] rounded-full bg-[#E6E8EB]\">\n <span class=\"block h-full w-[28.6%] rounded-full bg-[#41A07D]\" />\n </span>\n </div>\n <button type=\"button\" class=\"shrink-0 text-[13px] text-text-primary/50\">← Back</button>\n <button type=\"button\" class=\"h-[38px] w-[170px] shrink-0 rounded-xs bg-[#41A07D] text-[13px] text-white\">Next →</button>\n </div>\n";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Where the default logo links to. */
|
|
3
|
+
logoHref?: string;
|
|
4
|
+
/** Shows the `sub-header` slot in a second row below the header, sliding it open and closed. */
|
|
5
|
+
isSubHeaderVisible?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_9: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
left?: (props: typeof __VLS_1) => any;
|
|
10
|
+
} & {
|
|
11
|
+
right?: (props: typeof __VLS_3) => any;
|
|
12
|
+
} & {
|
|
13
|
+
'sub-header'?: (props: typeof __VLS_9) => any;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
16
|
+
logoHref: string;
|
|
17
|
+
isSubHeaderVisible: boolean;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BwHeader } from './BwHeader.vue';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Passed to BwHeader: where the default logo links to. */
|
|
3
|
+
logoHref?: string;
|
|
4
|
+
/** Passed to BwHeader: shows the `sub-header` slot in a second row below the header. */
|
|
5
|
+
isSubHeaderVisible?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare var __VLS_5: {}, __VLS_7: {}, __VLS_9: {}, __VLS_15: {}, __VLS_17: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
'header-left'?: (props: typeof __VLS_5) => any;
|
|
10
|
+
} & {
|
|
11
|
+
'header-right'?: (props: typeof __VLS_7) => any;
|
|
12
|
+
} & {
|
|
13
|
+
'sub-header'?: (props: typeof __VLS_9) => any;
|
|
14
|
+
} & {
|
|
15
|
+
sidebar?: (props: typeof __VLS_15) => any;
|
|
16
|
+
} & {
|
|
17
|
+
default?: (props: typeof __VLS_17) => any;
|
|
18
|
+
};
|
|
19
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
20
|
+
logoHref: string;
|
|
21
|
+
isSubHeaderVisible: boolean;
|
|
22
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BwLayout } from './BwLayout.vue';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { CampaignType } from '../../../types/Campaign';
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Picks the glyph in the icon tile. */
|
|
4
|
+
type: CampaignType;
|
|
5
|
+
title?: string;
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
/** Makes the whole card a checkbox: shows the check / empty box on the right and toggles v-model on click. */
|
|
8
|
+
canSelect?: boolean;
|
|
9
|
+
/** Forces the active look (green icon tile, gradient background) whatever v-model holds. */
|
|
10
|
+
active?: boolean;
|
|
11
|
+
showIcon?: boolean;
|
|
12
|
+
}
|
|
13
|
+
type __VLS_Props = Props;
|
|
14
|
+
type __VLS_Slots = {
|
|
15
|
+
title?(): unknown;
|
|
16
|
+
subtitle?(): unknown;
|
|
17
|
+
/** Right-hand side; wraps the check / empty box shown when `canSelect` is set. */
|
|
18
|
+
right?(props: {
|
|
19
|
+
selected: boolean;
|
|
20
|
+
}): unknown;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
23
|
+
/** Selected (true) or default (false). A selected card also takes the active look. */
|
|
24
|
+
modelValue?: boolean;
|
|
25
|
+
};
|
|
26
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
27
|
+
"update:modelValue": (value: boolean) => any;
|
|
28
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
29
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
30
|
+
}>, {
|
|
31
|
+
title: string;
|
|
32
|
+
active: boolean;
|
|
33
|
+
subtitle: string;
|
|
34
|
+
canSelect: boolean;
|
|
35
|
+
showIcon: boolean;
|
|
36
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
37
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
40
|
+
new (): {
|
|
41
|
+
$slots: S;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BwOnboardingCampaignCardCreation } from './BwOnboardingCampaignCardCreation.vue';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
logoUrl: string;
|
|
3
|
+
organizationName: string;
|
|
4
|
+
organizationUrl: string;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Section title, drawn small and faded with a rule running to the right. Omit for an untitled section. */
|
|
3
|
+
label?: string;
|
|
4
|
+
}
|
|
5
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
label?: (props: typeof __VLS_1) => any;
|
|
8
|
+
} & {
|
|
9
|
+
default?: (props: typeof __VLS_3) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Component } from 'vue';
|
|
2
|
+
import { type IconName } from './icons';
|
|
3
|
+
interface Props {
|
|
4
|
+
/** Row text; the `label` slot overrides it. */
|
|
5
|
+
label?: string;
|
|
6
|
+
/** A named sidebar glyph or any icon component; the `icon` slot overrides it. */
|
|
7
|
+
icon?: IconName | Component;
|
|
8
|
+
/** Marks the current page: tinted row and `aria-current="page"`. */
|
|
9
|
+
active?: boolean;
|
|
10
|
+
/** Count or short tag shown at the row's end (shadcn's SidebarMenuBadge); the `badge` slot overrides it. */
|
|
11
|
+
badge?: number | string;
|
|
12
|
+
/** Turns a childless row into a link. Ignored on a row with children, which only expands. */
|
|
13
|
+
href?: string;
|
|
14
|
+
/** Escape hatch for a custom tag or component (e.g. RouterLink) without depending on vue-router. */
|
|
15
|
+
as?: string | Component;
|
|
16
|
+
}
|
|
17
|
+
declare var __VLS_9: {}, __VLS_15: {}, __VLS_20: {}, __VLS_36: {};
|
|
18
|
+
type __VLS_Slots = {} & {
|
|
19
|
+
icon?: (props: typeof __VLS_9) => any;
|
|
20
|
+
} & {
|
|
21
|
+
label?: (props: typeof __VLS_15) => any;
|
|
22
|
+
} & {
|
|
23
|
+
badge?: (props: typeof __VLS_20) => any;
|
|
24
|
+
} & {
|
|
25
|
+
default?: (props: typeof __VLS_36) => any;
|
|
26
|
+
};
|
|
27
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Component } from 'vue';
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Row text; the default slot overrides it. */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** Marks the current page: tinted row and `aria-current="page"`. Auto-expands the parent item. */
|
|
6
|
+
active?: boolean;
|
|
7
|
+
/** Count or short tag shown at the row's end (shadcn's SidebarMenuBadge); the `badge` slot overrides it. */
|
|
8
|
+
badge?: number | string;
|
|
9
|
+
/** Turns the row into a link. */
|
|
10
|
+
href?: string;
|
|
11
|
+
/** Escape hatch for a custom tag or component (e.g. RouterLink) without depending on vue-router. */
|
|
12
|
+
as?: string | Component;
|
|
13
|
+
}
|
|
14
|
+
declare var __VLS_5: {}, __VLS_10: {};
|
|
15
|
+
type __VLS_Slots = {} & {
|
|
16
|
+
default?: (props: typeof __VLS_5) => any;
|
|
17
|
+
} & {
|
|
18
|
+
badge?: (props: typeof __VLS_10) => any;
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey, Ref } from 'vue';
|
|
2
|
+
export interface SidebarItemRegistration {
|
|
3
|
+
id: symbol;
|
|
4
|
+
hasActiveChild: ComputedRef<boolean>;
|
|
5
|
+
}
|
|
6
|
+
export interface SidebarContext {
|
|
7
|
+
/** Id of the item whose dropdown is open, or null when the sidebar is in its default state. */
|
|
8
|
+
expandedId: Ref<symbol | null> | ComputedRef<symbol | null>;
|
|
9
|
+
register: (item: SidebarItemRegistration) => void;
|
|
10
|
+
unregister: (id: symbol) => void;
|
|
11
|
+
toggle: (id: symbol) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const SIDEBAR_CONTEXT: InjectionKey<SidebarContext>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
export type IconName = 'home' | 'donation' | 'form' | 'campaign' | 'event' | 'donor' | 'gift';
|
|
3
|
+
/** Named glyphs from the sidebar design, so `icon="home"` works without an icon-font dependency. */
|
|
4
|
+
export declare const SIDEBAR_ICONS: Record<IconName, Component>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as BwSidebar } from './BwSidebar.vue';
|
|
2
|
+
export { default as BwSidebarGroup } from './BwSidebarGroup.vue';
|
|
3
|
+
export { default as BwSidebarItem } from './BwSidebarItem.vue';
|
|
4
|
+
export { default as BwSidebarSubItem } from './BwSidebarSubItem.vue';
|
|
5
|
+
export type { IconName } from './icons';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Component } from 'vue';
|
|
2
|
+
export interface TicketStatsChartData {
|
|
3
|
+
/** Amount reached, e.g. tickets sold or dollars received. */
|
|
4
|
+
value: number;
|
|
5
|
+
/** Amount the ring represents when full, e.g. tickets available or dollars expected. */
|
|
6
|
+
total: number;
|
|
7
|
+
/** Overrides the centre text, which defaults to the rounded percentage ("23%"). */
|
|
8
|
+
label?: string;
|
|
9
|
+
}
|
|
10
|
+
interface Props {
|
|
11
|
+
/** A glyph component, typically from @betterworldcollective/icons. */
|
|
12
|
+
icon?: Component;
|
|
13
|
+
title?: string;
|
|
14
|
+
/** Optional ring chart; omit it for a plain number card. */
|
|
15
|
+
chartData?: TicketStatsChartData;
|
|
16
|
+
description?: string | number;
|
|
17
|
+
subText?: string;
|
|
18
|
+
}
|
|
19
|
+
declare var __VLS_1: {}, __VLS_10: {}, __VLS_12: {};
|
|
20
|
+
type __VLS_Slots = {} & {
|
|
21
|
+
'pre-header'?: (props: typeof __VLS_1) => any;
|
|
22
|
+
} & {
|
|
23
|
+
body?: (props: typeof __VLS_10) => any;
|
|
24
|
+
} & {
|
|
25
|
+
description?: (props: typeof __VLS_12) => any;
|
|
26
|
+
};
|
|
27
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** 0–100. */
|
|
3
|
+
percent: number;
|
|
4
|
+
label: string;
|
|
5
|
+
/** Accessible description of the ring, e.g. "12 of 52 (23%)". */
|
|
6
|
+
summary: string;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ComposeOption, type ECharts } from 'echarts/core';
|
|
2
|
+
import type { PieSeriesOption } from 'echarts/charts';
|
|
3
|
+
import { type Ref } from 'vue';
|
|
4
|
+
export type ChartOption = ComposeOption<PieSeriesOption>;
|
|
5
|
+
/**
|
|
6
|
+
* Mounts an ECharts instance on `el` and keeps it in sync with `option`.
|
|
7
|
+
* The chart is resized in place through a ResizeObserver on its own element, so it also reacts to
|
|
8
|
+
* layout changes, not just window resizes, without being disposed and re-initialised.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useChart(el: Ref<HTMLElement | null>, option: Ref<ChartOption>): {
|
|
11
|
+
chart: import("vue").ShallowRef<ECharts | undefined, ECharts | undefined>;
|
|
12
|
+
};
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let e=require("vue"),t=require("@betterworldcollective/core"),n=require("@betterworldcollective/icons"),r=require("echarts/charts"),i=require("echarts/core"),a=require("echarts/renderers");var o={class:`bw-header flex w-full flex-col bg-surface-brand text-white`},s={class:`flex min-h-15 w-full items-stretch`},c={class:`flex w-72.5 shrink-0 items-center px-7`},l=[`href`],u={class:`relative flex min-w-0 flex-1 items-center px-7 py-3`},d={key:0,class:`bg-white text-text-primary`},f=(0,e.defineComponent)({__name:`BwHeader`,props:{logoHref:{default:`/`},isSubHeaderVisible:{type:Boolean,default:!1}},setup(n){return(r,i)=>((0,e.openBlock)(),(0,e.createElementBlock)(`header`,o,[(0,e.createElementVNode)(`div`,s,[(0,e.createElementVNode)(`div`,c,[(0,e.renderSlot)(r.$slots,`left`,{},()=>[(0,e.createElementVNode)(`a`,{class:`block shrink-0 rounded-[4px] outline-none focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-white`,href:n.logoHref,"aria-label":`BetterWorld`},[...i[0]||=[(0,e.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`136`,height:`20`,viewBox:`0 0 170 25`,fill:`none`,"aria-hidden":`true`},[(0,e.createElementVNode)(`path`,{fill:`currentColor`,"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M4.39 23.25c-.14-.1-.36 0-.36.17v.74c0 .11-.1.2-.21.2H2.68c-.93 0-1.68-.74-1.68-1.67V1.2c0-.12.1-.21.21-.21h1.24c.92 0 1.68.75 1.68 1.68V9.8c0 .18.2.28.35.17a7.4 7.4 0 0 1 4.39-1.4 7.3 7.3 0 0 1 3.78.99 8.2 8.2 0 0 1 3.98 7.07 8.1 8.1 0 0 1-3.95 7.05A8 8 0 0 1 8.8 24.7c-1.67 0-3.2-.52-4.41-1.45m29.2-6.15q-.03.18-.21.2h-11.5a.2.2 0 0 0-.2.22 5 5 0 0 0 4.97 4.45c1.4 0 2.4-.41 3.17-.95.78-.54 1.84-.62 2.53.03l.65.62c.08.07.09.2.02.28a8.2 8.2 0 0 1-6.4 2.75c-4.5 0-8-3.43-8-8.07s3.16-8.06 7.54-8.06c4.31 0 7.44 3.49 7.44 8.06l-.02.47m-3.32-2.7a4.3 4.3 0 0 0-4.01-3.1 4.5 4.5 0 0 0-4.27 3.1.2.2 0 0 0 .2.26h7.89a.2.2 0 0 0 .2-.26m15.91 8.82c-.2-.91-1.15-1.48-2.08-1.48-.83 0-1.72-.3-2.14-.83-.4-.46-.46-1.15-.46-1.97V11.9q.02-.2.2-.21h3.05c.93 0 1.68-.76 1.68-1.68V9.1a.2.2 0 0 0-.2-.21H41.7a.2.2 0 0 1-.21-.21V4.83c0-.12-.1-.21-.21-.21h-1.24c-.93 0-1.68.75-1.68 1.68v2.4c0 .12-.1.2-.21.2H36.1c-.93 0-1.68.76-1.68 1.7v.9c0 .11.1.2.21.2h3.53q.19.02.2.22v6.86c0 1.68.34 3.1 1.26 4.12A5.6 5.6 0 0 0 44 24.7c.8 0 1.66-.1 2.25-.27a.2.2 0 0 0 .14-.24zm11.07-1.48c.94 0 1.88.57 2.09 1.48l.2.96a.2.2 0 0 1-.13.24c-.6.17-1.45.28-2.26.28-1.94 0-3.39-.7-4.38-1.81-.92-1.02-1.25-2.44-1.25-4.12v-6.86q-.02-.2-.2-.21h-3.54a.2.2 0 0 1-.2-.21v-.9c0-.94.75-1.7 1.68-1.7h2.05q.2-.01.21-.2V6.3c0-.93.76-1.68 1.69-1.68h1.23c.12 0 .21.1.21.21V8.7c0 .12.1.2.21.2h4.52q.18.02.2.22v.9c0 .93-.74 1.69-1.67 1.69h-3.05a.2.2 0 0 0-.2.2v7.04c0 .82.06 1.51.45 1.97.43.53 1.32.83 2.14.83m18.58-4.45c.1 0 .2-.08.2-.19q.03-.3.02-.47c0-4.57-3.12-8.06-7.44-8.06-4.37 0-7.53 3.42-7.53 8.06a7.86 7.86 0 0 0 8 8.07 8.2 8.2 0 0 0 6.4-2.75.2.2 0 0 0-.03-.28l-.65-.62c-.68-.65-1.75-.57-2.52-.03-.78.54-1.78.95-3.17.95a5 5 0 0 1-4.99-4.45.2.2 0 0 1 .21-.23zm-7.12-5.99a4.3 4.3 0 0 1 4.02 3.1.2.2 0 0 1-.2.26h-7.89a.2.2 0 0 1-.2-.26 4.5 4.5 0 0 1 4.27-3.1m19.32-2.66a.2.2 0 0 1 .17.23l-.19 1.57c-.07.65-.71 1.1-1.36 1.1a5.2 5.2 0 0 0-4.15 2.54l-.03.1v8.5c0 .94-.75 1.69-1.68 1.69h-1.24a.2.2 0 0 1-.2-.21V10.58c0-.93.74-1.68 1.67-1.68h1.14c.12 0 .21.1.21.2v.92c0 .2.28.3.42.16a6 6 0 0 1 4.22-1.61c.27 0 .68.02 1.02.07m14.64.26c-.66 0-1.25.4-1.49 1l-3.65 9.08a.21.21 0 0 1-.39 0l-3.62-9.03a1.7 1.7 0 0 0-1.56-1.05h-1.78a.2.2 0 0 0-.2.29l6.12 15.05q.06.13.2.13h1.88q.15 0 .2-.13l4.1-10.25a.21.21 0 0 1 .39 0l4.1 10.25q.05.12.19.13h1.89q.13 0 .2-.13l6.1-15.05a.21.21 0 0 0-.19-.3h-1.77c-.7 0-1.3.43-1.56 1.06l-3.63 9.03a.21.21 0 0 1-.4 0l-3.64-9.07a1.6 1.6 0 0 0-1.49-1.01m21.46 15.8c-4.58 0-8-3.46-8-8.07 0-4.6 3.42-8.06 8-8.06s8 3.46 8 8.06-3.43 8.07-8 8.07m0-13.17c-2.86 0-4.87 2.27-4.87 5.1s2 5.1 4.87 5.1c2.86 0 4.87-2.27 4.87-5.1s-2-5.1-4.87-5.1m20.16-2.66a.2.2 0 0 0-.17-.23 9 9 0 0 0-1.03-.07 6 6 0 0 0-4.22 1.61c-.14.15-.42.05-.42-.16v-.91a.2.2 0 0 0-.2-.21h-1.15c-.92 0-1.68.75-1.68 1.68v13.58c0 .11.1.2.21.2h1.24c.93 0 1.68-.74 1.68-1.67v-8.5q0-.06.03-.1a5.2 5.2 0 0 1 4.15-2.56c.65 0 1.29-.44 1.37-1.09zm3.02 15.5a.2.2 0 0 1-.21-.21V2.68c0-.93.75-1.68 1.68-1.68h1.24c.11 0 .2.1.2.21v21.48c0 .93-.75 1.68-1.67 1.68zm18.8-.21c0 .11.1.2.21.2h1.14c.93 0 1.68-.74 1.68-1.67V1.2c0-.12-.1-.21-.21-.21h-1.24c-.92 0-1.68.75-1.68 1.68V9.8c0 .18-.2.28-.35.17a7.4 7.4 0 0 0-4.39-1.4 7.3 7.3 0 0 0-3.78.99 8.2 8.2 0 0 0-3.98 7.07 8.1 8.1 0 0 0 3.95 7.05 8 8 0 0 0 3.88 1.02c1.67 0 3.2-.52 4.41-1.45.15-.1.36 0 .36.17zm.37-7.55a5.05 5.05 0 1 1-10.1 0 5.05 5.05 0 0 1 10.1 0M8.77 21.66a5.05 5.05 0 1 0 0-10.1 5.05 5.05 0 0 0 0 10.1`})],-1)]],8,l)])]),(0,e.createElementVNode)(`div`,u,[(0,e.renderSlot)(r.$slots,`right`)])]),(0,e.createVNode)((0,e.unref)(t.BwSlideTransition),null,{default:(0,e.withCtx)(()=>[n.isSubHeaderVisible&&r.$slots[`sub-header`]?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,d,[(0,e.renderSlot)(r.$slots,`sub-header`)])):(0,e.createCommentVNode)(``,!0)]),_:3})]))}}),p=Symbol(`BwSidebar`),m={class:`bw-sidebar relative flex h-full w-72.5 overflow-hidden bg-white`},h={class:`min-h-0 w-72.5 shrink-0 overflow-y-auto overflow-x-hidden bg-white py-[25px]`},g={class:`flex flex-col`},_=(0,e.defineComponent)({__name:`BwSidebar`,setup(t){let n=(0,e.shallowRef)([]),r=(0,e.computed)(()=>n.value.find(e=>e.hasActiveChild.value)?.id??null),i=(0,e.ref)(null),a=(0,e.computed)(()=>i.value&&n.value.some(e=>e.id===i.value)?i.value:r.value);return(0,e.provide)(p,{expandedId:a,register:e=>{n.value=[...n.value,e]},unregister:e=>{n.value=n.value.filter(t=>t.id!==e)},toggle:e=>{i.value=i.value===e?null:e}}),(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,m,[(0,e.createElementVNode)(`nav`,h,[(0,e.createElementVNode)(`ul`,g,[(0,e.renderSlot)(t.$slots,`default`)])])]))}}),v={class:`bw-sidebar-group not-first:mt-5`},y={key:0,class:`mx-4 flex w-65.5 items-center gap-3 pl-6 pr-2 text-[11px] font-normal leading-[1.35] text-text-primary opacity-30`},b=[`id`],ee=[`aria-labelledby`],x=(0,e.defineComponent)({__name:`BwSidebarGroup`,props:{label:{}},setup(t){let n=(0,e.useId)();return(r,i)=>((0,e.openBlock)(),(0,e.createElementBlock)(`li`,v,[t.label||r.$slots.label?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,y,[(0,e.createElementVNode)(`span`,{id:(0,e.unref)(n),class:`shrink-0`},[(0,e.renderSlot)(r.$slots,`label`,{},()=>[(0,e.createTextVNode)((0,e.toDisplayString)(t.label),1)])],8,b),i[0]||=(0,e.createElementVNode)(`span`,{class:`h-px flex-1 bg-current opacity-30`},null,-1)])):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`ul`,{class:`flex flex-col`,"aria-labelledby":t.label||r.$slots.label?(0,e.unref)(n):void 0},[(0,e.renderSlot)(r.$slots,`default`)],8,ee)]))}}),S={"data-slot":`sidebar-menu-badge`,class:`inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-action-primary px-1 text-[11px] leading-none font-normal text-white tabular-nums`},C=(0,e.defineComponent)({__name:`BwSidebarBadge`,setup(t){return(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`span`,S,[(0,e.renderSlot)(t.$slots,`default`)]))}}),w={home:n.HomeIcon,donation:n.DonationIcon,form:n.DonationFormIcon,campaign:n.CampaignIcon,event:n.EventIcon,donor:n.DonorIcon,gift:n.GiftIcon},T={class:`bw-sidebar-item [.bw-sidebar-item+&]:mt-1 [.bw-sidebar-group+&]:mt-5`},E={class:`flex w-[17px] shrink-0 items-center justify-center`},D={class:`min-w-0 flex-1 truncate text-[15px] font-normal leading-[1.35]`},O={key:0},k={class:`flex flex-col gap-1 pt-1`},A=(0,e.defineComponent)({__name:`BwSidebarItem`,props:{label:{},icon:{},active:{type:Boolean},badge:{},href:{},as:{}},setup(t){let r=t,i=(0,e.useSlots)(),a=(0,e.inject)(p,null),o=Symbol(`BwSidebarItem`);function s(t){let n=[];for(let r of t)(0,e.isVNode)(r)&&(r.type===e.Fragment?n.push(...s(r.children??[])):r.type!==e.Comment&&n.push(r));return n}let c=(0,e.computed)(()=>s(i.default?.()??[])),l=(0,e.computed)(()=>c.value.length>0),u=(0,e.computed)(()=>c.value.some(e=>e.props?.active===``||e.props?.active===!0));a?.register({id:o,hasActiveChild:u}),(0,e.onUnmounted)(()=>a?.unregister(o));let d=(0,e.computed)(()=>a?.expandedId.value===o),f=(0,e.computed)(()=>r.badge!==void 0&&r.badge!==``||!!i.badge),m=(0,e.computed)(()=>r.icon?typeof r.icon==`string`?w[r.icon]:r.icon:null),h=(0,e.computed)(()=>r.as??(r.href&&!l.value?`a`:`button`));function g(e){let t=e;t.style.height=`0px`,t.style.opacity=`0`,t.offsetHeight,t.style.height=`${t.scrollHeight}px`,t.style.opacity=`1`}function _(e){let t=e;t.style.height=``,t.style.opacity=``}function v(e){let t=e;t.style.height=`${t.scrollHeight}px`,t.style.opacity=`1`,t.offsetHeight,t.style.height=`0px`,t.style.opacity=`0`}return(r,i)=>((0,e.openBlock)(),(0,e.createElementBlock)(`li`,T,[((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(h.value),{href:h.value===`a`?t.href:void 0,type:h.value===`button`?`button`:void 0,class:(0,e.normalizeClass)([`mx-4 flex w-65.5 items-center gap-[7px] rounded-[4px] py-2 pl-6 pr-2 text-left text-text-primary transition-colors duration-250 ease-in-out outline-none hover:bg-surface-brand/10 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring`,t.active?`bg-surface-brand/5`:``]),"aria-expanded":l.value?d.value:void 0,"aria-current":t.active?`page`:void 0,onClick:i[0]||=t=>l.value?(0,e.unref)(a)?.toggle((0,e.unref)(o)):void 0},{default:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`span`,E,[(0,e.renderSlot)(r.$slots,`icon`,{},()=>[m.value?((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(m.value),{key:0})):(0,e.createCommentVNode)(``,!0)])]),(0,e.createElementVNode)(`span`,D,[(0,e.renderSlot)(r.$slots,`label`,{},()=>[(0,e.createTextVNode)((0,e.toDisplayString)(t.label),1)])]),f.value?((0,e.openBlock)(),(0,e.createBlock)(C,{key:0},{default:(0,e.withCtx)(()=>[(0,e.renderSlot)(r.$slots,`badge`,{},()=>[(0,e.createTextVNode)((0,e.toDisplayString)(t.badge),1)])]),_:3})):(0,e.createCommentVNode)(``,!0),l.value?((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(n.ChevronDownIcon),{key:1,class:(0,e.normalizeClass)([`shrink-0 transition-[rotate] duration-250 ease-in-out`,d.value?`rotate-180`:``])},null,8,[`class`])):(0,e.createCommentVNode)(``,!0)]),_:3},8,[`href`,`type`,`class`,`aria-expanded`,`aria-current`])),(0,e.createVNode)(e.Transition,{"enter-active-class":`overflow-hidden transition-[height,opacity] duration-250 ease-in-out`,"leave-active-class":`overflow-hidden transition-[height,opacity] duration-250 ease-in-out`,onEnter:g,onAfterEnter:_,onLeave:v},{default:(0,e.withCtx)(()=>[l.value&&d.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,O,[(0,e.createElementVNode)(`ul`,k,[(0,e.renderSlot)(r.$slots,`default`)])])):(0,e.createCommentVNode)(``,!0)]),_:3})]))}}),j={class:`bw-sidebar-sub-item`},M={class:`min-w-0 flex-1 truncate`},N=(0,e.defineComponent)({__name:`BwSidebarSubItem`,props:{label:{},active:{type:Boolean},badge:{},href:{},as:{}},setup(t){let n=t,r=(0,e.useSlots)(),i=(0,e.computed)(()=>n.badge!==void 0&&n.badge!==``||!!r.badge),a=(0,e.computed)(()=>n.as??(n.href?`a`:`button`));return(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`li`,j,[((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(a.value),{href:t.href,type:a.value===`button`?`button`:void 0,class:(0,e.normalizeClass)([`ml-14 mr-4 flex w-55.5 items-center gap-[7px] rounded-[4px] py-2 pl-6 pr-2 text-left text-[15px] font-normal leading-[1.35] text-text-primary transition-colors outline-none hover:bg-surface-brand/10 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring`,t.active?`bg-surface-brand/5`:``]),"aria-current":t.active?`page`:void 0},{default:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`span`,M,[(0,e.renderSlot)(n.$slots,`default`,{},()=>[(0,e.createTextVNode)((0,e.toDisplayString)(t.label),1)])]),i.value?((0,e.openBlock)(),(0,e.createBlock)(C,{key:0},{default:(0,e.withCtx)(()=>[(0,e.renderSlot)(n.$slots,`badge`,{},()=>[(0,e.createTextVNode)((0,e.toDisplayString)(t.badge),1)])]),_:3})):(0,e.createCommentVNode)(``,!0)]),_:3},8,[`href`,`type`,`class`,`aria-current`]))]))}}),P={class:`bw-layout flex h-full w-full flex-col bg-[#F4F4F6]`},F={class:`flex min-h-0 flex-1`},I={class:`min-w-0 flex-1 overflow-y-auto`},L=(0,e.defineComponent)({__name:`BwLayout`,props:{logoHref:{default:`/`},isSubHeaderVisible:{type:Boolean,default:!1}},setup(t){return(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,P,[(0,e.createVNode)((0,e.unref)(f),{class:`shrink-0`,"logo-href":t.logoHref,"is-sub-header-visible":t.isSubHeaderVisible},(0,e.createSlots)({_:2},[n.$slots[`header-left`]?{name:`left`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(n.$slots,`header-left`)]),key:`0`}:void 0,n.$slots[`header-right`]?{name:`right`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(n.$slots,`header-right`)]),key:`1`}:void 0,n.$slots[`sub-header`]?{name:`sub-header`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(n.$slots,`sub-header`)]),key:`2`}:void 0]),1032,[`logo-href`,`is-sub-header-visible`]),(0,e.createElementVNode)(`div`,F,[n.$slots.sidebar?((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(_),{key:0},{default:(0,e.withCtx)(()=>[(0,e.renderSlot)(n.$slots,`sidebar`)]),_:3})):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`main`,I,[(0,e.renderSlot)(n.$slots,`default`)])])]))}}),R={class:`flex h-6 w-6 items-center justify-center`},z={class:`relative flex min-w-0 flex-1 flex-col gap-1.5`},B={class:`text-[18px] leading-[1.2]`},V={key:0,class:`text-[13px] font-light leading-[1.2] text-text-primary/70`},H={key:1,class:`relative flex shrink-0 items-center`},U={"aria-hidden":`true`,class:`grid h-6 w-6 place-items-center`},W={key:1,class:`h-5.5 w-5.5 rounded-[5px] border-[1.5px] border-text-primary [grid-area:1/1]`},te=`shadow-[30px_0px_64px_0px_#3A4E610D,0px_6px_24px_0px_#0000001A,0px_4px_4px_0px_#0000000D] hover:shadow-[30px_0px_64px_0px_#3A4E610D,0px_4px_4px_0px_#0000000D]`,G=(0,e.defineComponent)({__name:`BwOnboardingCampaignCardCreation`,props:(0,e.mergeModels)({type:{},title:{default:``},subtitle:{default:``},canSelect:{type:Boolean,default:!1},active:{type:Boolean,default:!1},showIcon:{type:Boolean,default:!0}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(t){let r=t,i=(0,e.useModel)(t,`modelValue`),a={auction:n.SilentAuctionIcon,"live-auction":n.LiveAuctionIcon,donation:n.DonationFormIcon,impact:n.ImpactGivingIcon,crowdfunding:n.CrowdfundingIcon,paddleraise:n.PaddleRaiseIcon,"peer-to-peer":n.PeerToPeerIcon,"ticketed-event":n.EventIcon,giveaway:n.GiveawaysIcon,"a-thons":n.AthonIcon},o=(0,e.computed)(()=>r.active||i.value),s=(0,e.ref)(`50% 50%`),c=(0,e.ref)(null);async function l(t){if(!r.canSelect)return;let n=t.currentTarget.getBoundingClientRect(),a=t.detail>0?`${t.clientX-n.left}px ${t.clientY-n.top}px`:`50% 50%`,o=c.value;o&&a!==s.value&&(o.style.transition=`none`,s.value=a,await(0,e.nextTick)(),o.offsetWidth,o.style.transition=``),i.value=!i.value}let u=(0,e.computed)(()=>({clipPath:`circle(${o.value?`150%`:`0%`} at ${s.value})`})),d=(0,e.computed)(()=>o.value?`bg-action-primary/15 text-action-primary`:`bg-surface-brand/15 text-text-primary`);return(r,o)=>((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.canSelect?`button`:`div`),{type:t.canSelect?`button`:void 0,role:t.canSelect?`checkbox`:void 0,"aria-checked":t.canSelect?i.value:void 0,class:(0,e.normalizeClass)([`relative flex w-full items-center gap-6 rounded-[24px] border border-white bg-white/40 px-5 py-4.5 text-left text-text-primary [transition:box-shadow_200ms_ease,transform_200ms_cubic-bezier(0.34,1.56,0.64,1)] motion-reduce:transition-none`,[te,t.canSelect&&`cursor-pointer active:scale-[0.99] focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-action-primary`]]),onClick:l},{default:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`span`,{ref_key:`rippleLayer`,ref:c,"aria-hidden":`true`,class:`pointer-events-none absolute inset-0 rounded-[inherit] bg-[linear-gradient(158.53deg,#FFFFFF_20.63%,rgba(255,255,255,0.4)_100%)] [transition:clip-path_200ms_cubic-bezier(0.4,0,0.2,1)] motion-reduce:transition-none`,style:(0,e.normalizeStyle)(u.value)},null,4),t.showIcon?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,{key:0,"aria-hidden":`true`,class:(0,e.normalizeClass)([`relative flex shrink-0 items-center justify-center rounded-lg p-5 transition-colors duration-200 motion-reduce:transition-none`,d.value])},[(0,e.createElementVNode)(`span`,R,[((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(a[t.type])))])],2)):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`span`,z,[(0,e.createElementVNode)(`span`,B,[(0,e.renderSlot)(r.$slots,`title`,{},()=>[(0,e.createTextVNode)((0,e.toDisplayString)(t.title),1)])]),t.subtitle||r.$slots.subtitle?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,V,[(0,e.renderSlot)(r.$slots,`subtitle`,{},()=>[(0,e.createTextVNode)((0,e.toDisplayString)(t.subtitle),1)])])):(0,e.createCommentVNode)(``,!0)]),t.canSelect||r.$slots.right?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,H,[(0,e.renderSlot)(r.$slots,`right`,{selected:i.value},()=>[(0,e.createElementVNode)(`span`,U,[(0,e.createVNode)(e.Transition,{"enter-active-class":`transition duration-200 ease-[cubic-bezier(0.34,1.56,0.64,1)] motion-reduce:transition-none`,"enter-from-class":`opacity-0 scale-50`,"leave-active-class":`transition duration-100 ease-in motion-reduce:transition-none`,"leave-to-class":`opacity-0 scale-75`},{default:(0,e.withCtx)(()=>[i.value?((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(n.CheckIcon),{key:0,class:`text-action-primary [grid-area:1/1]`,width:`24`,height:`24`})):((0,e.openBlock)(),(0,e.createElementBlock)(`span`,W))]),_:1})])])])):(0,e.createCommentVNode)(``,!0)]),_:3},8,[`type`,`role`,`aria-checked`,`class`]))}});(0,i.use)([r.PieChart,a.SVGRenderer]);function K(t,n){let r=(0,e.shallowRef)(),a;return(0,e.onMounted)(()=>{t.value&&(r.value=(0,e.markRaw)((0,i.init)(t.value,void 0,{renderer:`svg`})),r.value.setOption(n.value),a=new ResizeObserver(()=>r.value?.resize()),a.observe(t.value))}),(0,e.watch)(n,e=>r.value?.setOption(e),{deep:!0}),(0,e.onBeforeUnmount)(()=>{a?.disconnect(),r.value?.dispose()}),{chart:r}}var q=[`aria-label`],J={class:`pointer-events-none absolute inset-0 flex items-center justify-center text-[11px] leading-none`},Y=44,X=`77%`,Z=(0,e.defineComponent)({__name:`TicketStatsRing`,props:{percent:{},label:{},summary:{}},setup(t){let n=t,r=(0,e.ref)(null);return K(r,(0,e.computed)(()=>({series:[{type:`pie`,radius:[X,`100%`],startAngle:90,clockwise:!0,silent:!0,label:{show:!1},labelLine:{show:!1},animationDuration:800,animationDurationUpdate:800,animationEasing:`cubicOut`,animationEasingUpdate:`cubicOut`,data:[{value:n.percent,itemStyle:{color:`#1D9E75`}},{value:100-n.percent,itemStyle:{color:`#D9D9D9`}}]}]}))),(n,i)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`relative shrink-0`,style:(0,e.normalizeStyle)({width:`${Y}px`,height:`${Y}px`}),role:`img`,"aria-label":t.summary},[(0,e.createElementVNode)(`div`,{ref_key:`el`,ref:r,class:`h-full w-full`,"aria-hidden":`true`},null,512),(0,e.createElementVNode)(`span`,J,(0,e.toDisplayString)(t.label),1)],12,q))}}),Q={class:`flex flex-col gap-3 rounded-lg border border-solid border-transparent px-3.5 py-3 text-text-primary shadow-[0px_5px_20px_0px_#3A4E6112] [background:linear-gradient(#FFFFFF,#FFFFFF)_padding-box,linear-gradient(180deg,rgba(229,232,235,0)_0%,#E5E8EB_100%)_border-box]`},ne={class:`flex items-center gap-2`},re={key:0,class:`flex shrink-0 items-center`,"aria-hidden":`true`},ie={class:`text-[14px] leading-normal`},ae={class:`flex items-center gap-3`},oe={class:`flex min-w-0 flex-col`},se={class:`text-[32px] leading-none`},ce={key:0,class:`mt-1 text-[10px] uppercase leading-normal tracking-[0.9px]`},le=(0,e.defineComponent)({__name:`BwTicketStatsCard`,props:{icon:{},title:{},chartData:{},description:{},subText:{}},setup(t){let n=t,r=(0,e.computed)(()=>{let e=n.chartData;return!e||e.total<=0?0:Math.min(100,Math.max(0,e.value/e.total*100))}),i=(0,e.computed)(()=>n.chartData?.label??`${Math.round(r.value)}%`);return(n,a)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Q,[(0,e.createElementVNode)(`div`,ne,[(0,e.renderSlot)(n.$slots,`pre-header`),t.icon?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,re,[((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.icon)))])):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`span`,ie,(0,e.toDisplayString)(t.title),1)]),a[0]||=(0,e.createElementVNode)(`hr`,{class:`m-0 border-0 border-t-[0.5px] border-solid border-t-[rgba(58,78,97,0.15)]`},null,-1),(0,e.createElementVNode)(`div`,ae,[t.chartData?((0,e.openBlock)(),(0,e.createBlock)(Z,{key:0,percent:r.value,label:i.value,summary:`${t.chartData.value} of ${t.chartData.total} (${i.value})`},null,8,[`percent`,`label`,`summary`])):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`div`,oe,[(0,e.renderSlot)(n.$slots,`body`,{},()=>[(0,e.createElementVNode)(`span`,se,[(0,e.renderSlot)(n.$slots,`description`,{},()=>[(0,e.createTextVNode)((0,e.toDisplayString)(t.description),1)])]),t.subText?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,ce,(0,e.toDisplayString)(t.subText),1)):(0,e.createCommentVNode)(``,!0)])])])]))}}),ue={Auction:`auction`,LiveAuction:`live-auction`,Donation:`donation`,Impact:`impact`,Crowdfunding:`crowdfunding`,PaddleRaise:`paddleraise`,PeerToPeer:`peer-to-peer`,TicketedEvent:`ticketed-event`,Giveaway:`giveaway`,Athons:`a-thons`},de={class:`py-3 px-4 shadow-high rounded-sm`},fe={class:`text-text-primary font-medium`},pe={class:`mt-4`},$={class:`font-medium`},me=(0,e.defineComponent)({__name:`CampaignCard`,props:{title:{},items:{}},setup(t){return(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,de,[(0,e.createElementVNode)(`h6`,fe,(0,e.toDisplayString)(t.title),1),(0,e.createElementVNode)(`div`,pe,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.items,(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:n,class:`flex items-center gap-1`},[(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(t.label)+`:`,1),(0,e.createElementVNode)(`span`,$,(0,e.toDisplayString)(t.value),1)]))),128))])]))}}),he={class:`flex gap-2.5 items-center text-left`},ge={key:0,class:`rounded-xs bg-surface-brand w-12 h-12`},_e=[`src`],ve=[`href`],ye={class:`text-base leading-6 lg:text-[20px] font-normal mt-1 text-text-primary`},be=(0,e.defineComponent)({__name:`OrganizationLogo`,props:{logoUrl:{},organizationName:{},organizationUrl:{}},setup(t){return(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,he,[t.logoUrl?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,ge,[(0,e.createElementVNode)(`img`,{src:t.logoUrl,alt:`Logo`,width:`48`,height:`48`,class:`rounded-[inherit] w-[inherit] h-[inherit]`},null,8,_e)])):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`div`,null,[r[1]||=(0,e.createElementVNode)(`div`,{class:`text-sm m-0 text-pineStone`},` Organized by `,-1),(0,e.createElementVNode)(`a`,{href:t.organizationUrl,class:`no-underline flex items-center gap-1 hover:gap-2 hover:underline transition-all`},[(0,e.createElementVNode)(`span`,ye,(0,e.toDisplayString)(t.organizationName),1),r[0]||=(0,e.createElementVNode)(`svg`,{width:`9`,height:`7`,viewBox:`0 0 9 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,class:`mt-1`},[(0,e.createElementVNode)(`path`,{d:`M5.66675 1L7.99995 3.33321L5.66675 5.66641`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),(0,e.createElementVNode)(`path`,{d:`M7.22192 3.33325L1.00004 3.33325`,stroke:`currentColor`,"stroke-linecap":`round`})],-1)],8,ve)])]))}}),xe={install(){}};exports.BwHeader=f,exports.BwLayout=L,exports.BwOnboardingCampaignCardCreation=G,exports.BwSidebar=_,exports.BwSidebarGroup=x,exports.BwSidebarItem=A,exports.BwSidebarSubItem=N,exports.BwTicketStatsCard=le,exports.CampaignCard=me,exports.CampaignType=ue,exports.OrganizationLogo=be,exports.default=xe;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|