@aspect-ops/exon-ui 0.2.0 → 0.2.2
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/README.md +200 -0
- package/dist/components/Accordion/Accordion.svelte +2 -2
- package/dist/components/Accordion/AccordionItem.svelte +2 -2
- package/dist/components/AspectRatio/AspectRatio.svelte +1 -0
- package/dist/components/Card/FlipCard.svelte +155 -0
- package/dist/components/Card/FlipCard.svelte.d.ts +13 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Card/index.js +1 -0
- package/dist/components/Chatbot/ChatMessage.svelte +143 -0
- package/dist/components/Chatbot/ChatMessage.svelte.d.ts +8 -0
- package/dist/components/Chatbot/Chatbot.svelte +640 -0
- package/dist/components/Chatbot/Chatbot.svelte.d.ts +22 -0
- package/dist/components/Chatbot/index.d.ts +3 -0
- package/dist/components/Chatbot/index.js +2 -0
- package/dist/components/Chatbot/types.d.ts +48 -0
- package/dist/components/Chatbot/types.js +2 -0
- package/dist/components/ContactForm/ContactForm.svelte +564 -0
- package/dist/components/ContactForm/ContactForm.svelte.d.ts +44 -0
- package/dist/components/ContactForm/index.d.ts +1 -0
- package/dist/components/ContactForm/index.js +1 -0
- package/dist/components/Container/Container.svelte +1 -0
- package/dist/components/DataTable/DataTable.svelte +460 -0
- package/dist/components/DataTable/DataTable.svelte.d.ts +49 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DataTable/index.js +1 -0
- package/dist/components/DoughnutChart/DoughnutChart.svelte +390 -0
- package/dist/components/DoughnutChart/DoughnutChart.svelte.d.ts +25 -0
- package/dist/components/DoughnutChart/index.d.ts +1 -0
- package/dist/components/DoughnutChart/index.js +1 -0
- package/dist/components/FAB/FAB.svelte +5 -1
- package/dist/components/FAB/FABGroup.svelte +10 -2
- package/dist/components/FileUpload/FileUpload.svelte +12 -12
- package/dist/components/Icon/Icon.svelte +15 -18
- package/dist/components/Icon/Icon.svelte.d.ts +2 -1
- package/dist/components/Menu/MenuContent.svelte +1 -0
- package/dist/components/Menu/MenuSubContent.svelte +1 -0
- package/dist/components/Mermaid/Mermaid.svelte +320 -0
- package/dist/components/Mermaid/Mermaid.svelte.d.ts +38 -0
- package/dist/components/Mermaid/index.d.ts +1 -0
- package/dist/components/Mermaid/index.js +1 -0
- package/dist/components/Mermaid/mermaid.d.ts +21 -0
- package/dist/components/PageHeader/PageHeader.svelte +140 -0
- package/dist/components/PageHeader/PageHeader.svelte.d.ts +30 -0
- package/dist/components/PageHeader/index.d.ts +1 -0
- package/dist/components/PageHeader/index.js +1 -0
- package/dist/components/Popover/PopoverTrigger.svelte +1 -3
- package/dist/components/StatCircle/StatCircle.svelte +172 -0
- package/dist/components/StatCircle/StatCircle.svelte.d.ts +19 -0
- package/dist/components/StatCircle/index.d.ts +1 -0
- package/dist/components/StatCircle/index.js +1 -0
- package/dist/components/StatsCard/StatsCard.svelte +301 -0
- package/dist/components/StatsCard/StatsCard.svelte.d.ts +32 -0
- package/dist/components/StatsCard/index.d.ts +2 -0
- package/dist/components/StatsCard/index.js +1 -0
- package/dist/components/StatusBadge/StatusBadge.svelte +221 -0
- package/dist/components/StatusBadge/StatusBadge.svelte.d.ts +22 -0
- package/dist/components/StatusBadge/index.d.ts +2 -0
- package/dist/components/StatusBadge/index.js +1 -0
- package/dist/components/StatusBanner/StatusBanner.svelte +325 -0
- package/dist/components/StatusBanner/StatusBanner.svelte.d.ts +13 -0
- package/dist/components/StatusBanner/index.d.ts +1 -0
- package/dist/components/StatusBanner/index.js +1 -0
- package/dist/components/ViewCounter/ViewCounter.svelte +157 -0
- package/dist/components/ViewCounter/ViewCounter.svelte.d.ts +17 -0
- package/dist/components/ViewCounter/index.d.ts +1 -0
- package/dist/components/ViewCounter/index.js +1 -0
- package/dist/index.d.ts +17 -2
- package/dist/index.js +16 -1
- package/dist/styles/tokens.css +2 -1
- package/dist/types/data-display.d.ts +72 -0
- package/dist/types/feedback.d.ts +10 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/input.d.ts +20 -0
- package/package.json +4 -2
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
/** Unique identifier for the content being viewed */
|
|
6
|
+
slug: string;
|
|
7
|
+
/** Whether to show the "views" label */
|
|
8
|
+
showLabel?: boolean;
|
|
9
|
+
/** Whether to track the view (POST to API) or just display */
|
|
10
|
+
trackView?: boolean;
|
|
11
|
+
/** Custom class */
|
|
12
|
+
class?: string;
|
|
13
|
+
/** Callback to get current view count */
|
|
14
|
+
onGetCount?: (slug: string) => Promise<number>;
|
|
15
|
+
/** Callback to track/increment view */
|
|
16
|
+
onTrackView?: (slug: string) => Promise<number>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let {
|
|
20
|
+
slug,
|
|
21
|
+
showLabel = true,
|
|
22
|
+
trackView = true,
|
|
23
|
+
class: className = '',
|
|
24
|
+
onGetCount,
|
|
25
|
+
onTrackView
|
|
26
|
+
}: Props = $props();
|
|
27
|
+
|
|
28
|
+
let viewCount = $state<number | null>(null);
|
|
29
|
+
let isLoading = $state(true);
|
|
30
|
+
let hasError = $state(false);
|
|
31
|
+
|
|
32
|
+
// Format large numbers (1K, 1M, etc.)
|
|
33
|
+
function formatCount(count: number): string {
|
|
34
|
+
if (count >= 1000000) {
|
|
35
|
+
return (count / 1000000).toFixed(1).replace(/\.0$/, '') + 'M';
|
|
36
|
+
}
|
|
37
|
+
if (count >= 1000) {
|
|
38
|
+
return (count / 1000).toFixed(1).replace(/\.0$/, '') + 'K';
|
|
39
|
+
}
|
|
40
|
+
return count.toString();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Check if already viewed in this session
|
|
44
|
+
function hasViewedInSession(): boolean {
|
|
45
|
+
if (typeof window === 'undefined') return false;
|
|
46
|
+
const viewed = sessionStorage.getItem(`viewed_${slug}`);
|
|
47
|
+
return viewed === 'true';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Mark as viewed in session
|
|
51
|
+
function markViewedInSession(): void {
|
|
52
|
+
if (typeof window !== 'undefined') {
|
|
53
|
+
sessionStorage.setItem(`viewed_${slug}`, 'true');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
onMount(async () => {
|
|
58
|
+
try {
|
|
59
|
+
// If tracking is enabled and not already viewed
|
|
60
|
+
if (trackView && onTrackView && !hasViewedInSession()) {
|
|
61
|
+
viewCount = await onTrackView(slug);
|
|
62
|
+
markViewedInSession();
|
|
63
|
+
} else if (onGetCount) {
|
|
64
|
+
// Just get the count without tracking
|
|
65
|
+
viewCount = await onGetCount(slug);
|
|
66
|
+
} else {
|
|
67
|
+
// No callbacks provided, show 0
|
|
68
|
+
viewCount = 0;
|
|
69
|
+
}
|
|
70
|
+
} catch {
|
|
71
|
+
hasError = true;
|
|
72
|
+
viewCount = 0;
|
|
73
|
+
} finally {
|
|
74
|
+
isLoading = false;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const formattedCount = $derived(viewCount !== null ? formatCount(viewCount) : '—');
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<span class="view-counter {className}" class:view-counter--loading={isLoading}>
|
|
82
|
+
<svg
|
|
83
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
84
|
+
width="16"
|
|
85
|
+
height="16"
|
|
86
|
+
viewBox="0 0 24 24"
|
|
87
|
+
fill="none"
|
|
88
|
+
stroke="currentColor"
|
|
89
|
+
stroke-width="2"
|
|
90
|
+
stroke-linecap="round"
|
|
91
|
+
stroke-linejoin="round"
|
|
92
|
+
class="view-counter__icon"
|
|
93
|
+
aria-hidden="true"
|
|
94
|
+
>
|
|
95
|
+
<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" />
|
|
96
|
+
<circle cx="12" cy="12" r="3" />
|
|
97
|
+
</svg>
|
|
98
|
+
<span class="view-counter__count">
|
|
99
|
+
{#if isLoading}
|
|
100
|
+
<span class="view-counter__skeleton"></span>
|
|
101
|
+
{:else}
|
|
102
|
+
{formattedCount}
|
|
103
|
+
{/if}
|
|
104
|
+
</span>
|
|
105
|
+
{#if showLabel}
|
|
106
|
+
<span class="view-counter__label">views</span>
|
|
107
|
+
{/if}
|
|
108
|
+
</span>
|
|
109
|
+
|
|
110
|
+
<style>
|
|
111
|
+
.view-counter {
|
|
112
|
+
display: inline-flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
gap: var(--space-xs, 0.25rem);
|
|
115
|
+
font-size: var(--text-sm, 0.875rem);
|
|
116
|
+
color: var(--color-text-muted, #6b7280);
|
|
117
|
+
font-family: inherit;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.view-counter__icon {
|
|
121
|
+
flex-shrink: 0;
|
|
122
|
+
opacity: 0.7;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.view-counter__count {
|
|
126
|
+
font-weight: var(--font-medium, 500);
|
|
127
|
+
min-width: 1.5rem;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.view-counter__label {
|
|
131
|
+
opacity: 0.8;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.view-counter__skeleton {
|
|
135
|
+
display: inline-block;
|
|
136
|
+
width: 2rem;
|
|
137
|
+
height: 1em;
|
|
138
|
+
background: linear-gradient(
|
|
139
|
+
90deg,
|
|
140
|
+
var(--color-bg-muted, #f3f4f6) 25%,
|
|
141
|
+
var(--color-border, #e5e7eb) 50%,
|
|
142
|
+
var(--color-bg-muted, #f3f4f6) 75%
|
|
143
|
+
);
|
|
144
|
+
background-size: 200% 100%;
|
|
145
|
+
animation: skeleton-pulse 1.5s ease-in-out infinite;
|
|
146
|
+
border-radius: var(--radius-sm, 0.25rem);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@keyframes skeleton-pulse {
|
|
150
|
+
0% {
|
|
151
|
+
background-position: 200% 0;
|
|
152
|
+
}
|
|
153
|
+
100% {
|
|
154
|
+
background-position: -200% 0;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Unique identifier for the content being viewed */
|
|
3
|
+
slug: string;
|
|
4
|
+
/** Whether to show the "views" label */
|
|
5
|
+
showLabel?: boolean;
|
|
6
|
+
/** Whether to track the view (POST to API) or just display */
|
|
7
|
+
trackView?: boolean;
|
|
8
|
+
/** Custom class */
|
|
9
|
+
class?: string;
|
|
10
|
+
/** Callback to get current view count */
|
|
11
|
+
onGetCount?: (slug: string) => Promise<number>;
|
|
12
|
+
/** Callback to track/increment view */
|
|
13
|
+
onTrackView?: (slug: string) => Promise<number>;
|
|
14
|
+
}
|
|
15
|
+
declare const ViewCounter: import("svelte").Component<Props, {}, "">;
|
|
16
|
+
type ViewCounter = ReturnType<typeof ViewCounter>;
|
|
17
|
+
export default ViewCounter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ViewCounter } from './ViewCounter.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ViewCounter } from './ViewCounter.svelte';
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,9 @@ export { OTPInput } from './components/OTPInput/index.js';
|
|
|
19
19
|
export { TimePicker } from './components/TimePicker/index.js';
|
|
20
20
|
export { Rating } from './components/Rating/index.js';
|
|
21
21
|
export { ToggleGroup, ToggleGroupItem } from './components/ToggleGroup/index.js';
|
|
22
|
+
export { NumberInput } from './components/NumberInput/index.js';
|
|
23
|
+
export { Pagination } from './components/Pagination/index.js';
|
|
24
|
+
export { Chip, ChipGroup } from './components/Chip/index.js';
|
|
22
25
|
export { default as Tabs } from './components/Tabs/Tabs.svelte';
|
|
23
26
|
export { default as TabList } from './components/Tabs/TabList.svelte';
|
|
24
27
|
export { default as TabTrigger } from './components/Tabs/TabTrigger.svelte';
|
|
@@ -49,16 +52,22 @@ export { ProgressBar, ProgressCircle, Spinner } from './components/Progress/inde
|
|
|
49
52
|
export { Tooltip } from './components/Tooltip/index.js';
|
|
50
53
|
export { Popover, PopoverTrigger, PopoverContent } from './components/Popover/index.js';
|
|
51
54
|
export { Skeleton } from './components/Skeleton/index.js';
|
|
52
|
-
export {
|
|
55
|
+
export { StatusBanner } from './components/StatusBanner/index.js';
|
|
56
|
+
export { Card, CardHeader, CardBody, CardFooter, FlipCard } from './components/Card/index.js';
|
|
53
57
|
export { Avatar, AvatarGroup } from './components/Avatar/index.js';
|
|
54
58
|
export { Tag } from './components/Tag/index.js';
|
|
55
59
|
export { EmptyState } from './components/EmptyState/index.js';
|
|
60
|
+
export { PageHeader } from './components/PageHeader/index.js';
|
|
56
61
|
export { List, ListItem } from './components/List/index.js';
|
|
62
|
+
export { StatCircle } from './components/StatCircle/index.js';
|
|
57
63
|
export { Table, TableHead, TableHeader, TableBody, TableRow, TableCell } from './components/Table/index.js';
|
|
58
64
|
export { Accordion, AccordionItem } from './components/Accordion/index.js';
|
|
59
65
|
export { Slider } from './components/Slider/index.js';
|
|
60
66
|
export { Carousel, CarouselSlide } from './components/Carousel/index.js';
|
|
61
67
|
export { Image } from './components/Image/index.js';
|
|
68
|
+
export { StatusBadge } from './components/StatusBadge/index.js';
|
|
69
|
+
export { StatsCard } from './components/StatsCard/index.js';
|
|
70
|
+
export { DataTable } from './components/DataTable/index.js';
|
|
62
71
|
export { Container } from './components/Container/index.js';
|
|
63
72
|
export { Grid } from './components/Grid/index.js';
|
|
64
73
|
export { GridItem } from './components/Grid/index.js';
|
|
@@ -74,4 +83,10 @@ export { ActionSheet, ActionSheetItem } from './components/ActionSheet/index.js'
|
|
|
74
83
|
export { PullToRefresh } from './components/PullToRefresh/index.js';
|
|
75
84
|
export { SwipeActions, SwipeAction } from './components/SwipeActions/index.js';
|
|
76
85
|
export { FAB, FABGroup } from './components/FAB/index.js';
|
|
77
|
-
export
|
|
86
|
+
export { Chatbot, ChatMessage } from './components/Chatbot/index.js';
|
|
87
|
+
export type { ChatMessage as ChatMessageType, MessageRole, LeadData, ChatbotProps } from './components/Chatbot/types.js';
|
|
88
|
+
export { ContactForm } from './components/ContactForm/index.js';
|
|
89
|
+
export { ViewCounter } from './components/ViewCounter/index.js';
|
|
90
|
+
export { Mermaid } from './components/Mermaid/index.js';
|
|
91
|
+
export { DoughnutChart } from './components/DoughnutChart/index.js';
|
|
92
|
+
export type { ButtonProps, ButtonVariant, ButtonSize, TypographyProps, TypographyVariant, IconProps, IconSize, BadgeProps, BadgeVariant, LinkProps, InputSize, TextInputType, FormFieldProps, TextInputProps, TextareaProps, SelectOption, SelectProps, CheckboxProps, RadioProps, RadioGroupProps, SwitchProps, SearchInputProps, DatePickerProps, FileUploadProps, OTPInputProps, TimeFormat, TimePickerProps, RatingProps, ToggleGroupType, ToggleGroupOrientation, ToggleGroupProps, ToggleGroupItemProps, NumberInputProps, PaginationProps, TabsOrientation, TabsProps, TabListProps, TabTriggerProps, TabContentProps, MenuProps, MenuTriggerProps, MenuContentProps, MenuItemProps, MenuSeparatorProps, MenuSubProps, MenuSubTriggerProps, MenuSubContentProps, BreadcrumbItemData, BreadcrumbsProps, BreadcrumbItemProps, BottomNavItemData, BottomNavProps, BottomNavItemProps, NavItemProps, NavbarProps, SidebarItemData, SidebarProps, SidebarItemProps, SidebarGroupProps, StepperOrientation, StepperProps, StepperStepProps, AlertVariant, AlertProps, ToastVariant, ToastPosition, ToastData, ToastProps, ToastContainerProps, ModalSize, ModalProps, ModalHeaderProps, ModalBodyProps, ModalFooterProps, ProgressSize, ProgressBarProps, ProgressCircleProps, SpinnerProps, TooltipSide, TooltipProps, PopoverSide, PopoverProps, PopoverTriggerProps, PopoverContentProps, SkeletonVariant, SkeletonProps, StatusBannerStatus, StatusBannerPosition, StatusBannerProps, CardVariant, CardProps, CardHeaderProps, CardBodyProps, CardFooterProps, FlipDirection, FlipTrigger, FlipCardProps, AvatarSize, AvatarShape, AvatarProps, AvatarGroupProps, TagVariant, TagSize, TagProps, ChipVariant, ChipColor, ChipSize, ChipProps, ChipGroupProps, EmptyStateSize, EmptyStateProps, PageHeaderProps, StatCircleColor, StatCircleSize, StatCircleProps, ListProps, ListItemProps, TableProps, TableHeadProps, TableHeaderAlign, TableHeaderSortDirection, TableHeaderProps, TableBodyProps, TableRowProps, TableCellAlign, TableCellProps, AccordionProps, AccordionItemProps, SliderProps, CarouselProps, CarouselSlideProps, ImageObjectFit, ImageRounded, ImageProps, StatusBadgeColor, StatusBadgeSize, StatusBadgeProps, StatsCardColor, StatsCardTrend, StatsCardProps, DataTableSortOrder, DataTableColumnAlign, DataTableColumn, DataTableProps, ContainerSize, ContainerProps, GridAlign, GridJustify, SpacingToken, GridProps, GridItemProps, StackDirection, StackProps, DividerOrientation, DividerProps, SpacerSize, SpacerProps, AspectRatioPreset, AspectRatioProps, CenterProps, BoxProps, SafeAreaEdge, SafeAreaProps, BottomSheetSnapPoint, BottomSheetProps, BottomSheetHeaderProps, BottomSheetBodyProps, ActionSheetAction, ActionSheetProps, ActionSheetItemProps, PullToRefreshProps, SwipeActionSide, SwipeActionData, SwipeActionsProps, SwipeActionProps, FABSize, FABPosition, FABProps, FABAction, FABGroupProps } from './types/index.js';
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,9 @@ export { OTPInput } from './components/OTPInput/index.js';
|
|
|
23
23
|
export { TimePicker } from './components/TimePicker/index.js';
|
|
24
24
|
export { Rating } from './components/Rating/index.js';
|
|
25
25
|
export { ToggleGroup, ToggleGroupItem } from './components/ToggleGroup/index.js';
|
|
26
|
+
export { NumberInput } from './components/NumberInput/index.js';
|
|
27
|
+
export { Pagination } from './components/Pagination/index.js';
|
|
28
|
+
export { Chip, ChipGroup } from './components/Chip/index.js';
|
|
26
29
|
// Navigation Components
|
|
27
30
|
export { default as Tabs } from './components/Tabs/Tabs.svelte';
|
|
28
31
|
export { default as TabList } from './components/Tabs/TabList.svelte';
|
|
@@ -55,17 +58,23 @@ export { ProgressBar, ProgressCircle, Spinner } from './components/Progress/inde
|
|
|
55
58
|
export { Tooltip } from './components/Tooltip/index.js';
|
|
56
59
|
export { Popover, PopoverTrigger, PopoverContent } from './components/Popover/index.js';
|
|
57
60
|
export { Skeleton } from './components/Skeleton/index.js';
|
|
61
|
+
export { StatusBanner } from './components/StatusBanner/index.js';
|
|
58
62
|
// Data Display Components
|
|
59
|
-
export { Card, CardHeader, CardBody, CardFooter } from './components/Card/index.js';
|
|
63
|
+
export { Card, CardHeader, CardBody, CardFooter, FlipCard } from './components/Card/index.js';
|
|
60
64
|
export { Avatar, AvatarGroup } from './components/Avatar/index.js';
|
|
61
65
|
export { Tag } from './components/Tag/index.js';
|
|
62
66
|
export { EmptyState } from './components/EmptyState/index.js';
|
|
67
|
+
export { PageHeader } from './components/PageHeader/index.js';
|
|
63
68
|
export { List, ListItem } from './components/List/index.js';
|
|
69
|
+
export { StatCircle } from './components/StatCircle/index.js';
|
|
64
70
|
export { Table, TableHead, TableHeader, TableBody, TableRow, TableCell } from './components/Table/index.js';
|
|
65
71
|
export { Accordion, AccordionItem } from './components/Accordion/index.js';
|
|
66
72
|
export { Slider } from './components/Slider/index.js';
|
|
67
73
|
export { Carousel, CarouselSlide } from './components/Carousel/index.js';
|
|
68
74
|
export { Image } from './components/Image/index.js';
|
|
75
|
+
export { StatusBadge } from './components/StatusBadge/index.js';
|
|
76
|
+
export { StatsCard } from './components/StatsCard/index.js';
|
|
77
|
+
export { DataTable } from './components/DataTable/index.js';
|
|
69
78
|
// Layout Components
|
|
70
79
|
export { Container } from './components/Container/index.js';
|
|
71
80
|
export { Grid } from './components/Grid/index.js';
|
|
@@ -83,3 +92,9 @@ export { ActionSheet, ActionSheetItem } from './components/ActionSheet/index.js'
|
|
|
83
92
|
export { PullToRefresh } from './components/PullToRefresh/index.js';
|
|
84
93
|
export { SwipeActions, SwipeAction } from './components/SwipeActions/index.js';
|
|
85
94
|
export { FAB, FABGroup } from './components/FAB/index.js';
|
|
95
|
+
// Website Components
|
|
96
|
+
export { Chatbot, ChatMessage } from './components/Chatbot/index.js';
|
|
97
|
+
export { ContactForm } from './components/ContactForm/index.js';
|
|
98
|
+
export { ViewCounter } from './components/ViewCounter/index.js';
|
|
99
|
+
export { Mermaid } from './components/Mermaid/index.js';
|
|
100
|
+
export { DoughnutChart } from './components/DoughnutChart/index.js';
|
package/dist/styles/tokens.css
CHANGED
|
@@ -153,7 +153,8 @@
|
|
|
153
153
|
* Scale: 1.2 → 1.25
|
|
154
154
|
* ======================================== */
|
|
155
155
|
|
|
156
|
-
--font-family:
|
|
156
|
+
--font-family:
|
|
157
|
+
'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
157
158
|
--font-family-mono: ui-monospace, 'SF Mono', Menlo, Monaco, 'Cascadia Code', monospace;
|
|
158
159
|
|
|
159
160
|
/* Fluid type scale */
|
|
@@ -13,6 +13,12 @@ export interface CardBodyProps {
|
|
|
13
13
|
export interface CardFooterProps {
|
|
14
14
|
class?: string;
|
|
15
15
|
}
|
|
16
|
+
export interface FlipCardProps {
|
|
17
|
+
flipped?: boolean;
|
|
18
|
+
class?: string;
|
|
19
|
+
front?: import('svelte').Snippet;
|
|
20
|
+
back?: import('svelte').Snippet;
|
|
21
|
+
}
|
|
16
22
|
export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
17
23
|
export type AvatarShape = 'circle' | 'square';
|
|
18
24
|
export interface AvatarProps {
|
|
@@ -45,6 +51,24 @@ export interface EmptyStateProps {
|
|
|
45
51
|
size?: EmptyStateSize;
|
|
46
52
|
class?: string;
|
|
47
53
|
}
|
|
54
|
+
export interface PageHeaderProps {
|
|
55
|
+
greeting?: string;
|
|
56
|
+
userName: string;
|
|
57
|
+
avatarSrc?: string;
|
|
58
|
+
avatarInitials?: string;
|
|
59
|
+
class?: string;
|
|
60
|
+
}
|
|
61
|
+
export type StatCircleColor = 'default' | 'primary' | 'warning' | 'error' | 'success';
|
|
62
|
+
export type StatCircleSize = 'sm' | 'md' | 'lg';
|
|
63
|
+
export interface StatCircleProps {
|
|
64
|
+
value: number | string;
|
|
65
|
+
label: string;
|
|
66
|
+
color?: StatCircleColor;
|
|
67
|
+
size?: StatCircleSize;
|
|
68
|
+
clickable?: boolean;
|
|
69
|
+
class?: string;
|
|
70
|
+
onclick?: (event: MouseEvent) => void;
|
|
71
|
+
}
|
|
48
72
|
export interface ListProps {
|
|
49
73
|
dividers?: boolean;
|
|
50
74
|
class?: string;
|
|
@@ -159,3 +183,51 @@ export interface ImageProps {
|
|
|
159
183
|
aspectRatio?: string;
|
|
160
184
|
class?: string;
|
|
161
185
|
}
|
|
186
|
+
export type StatusBadgeColor = 'success' | 'warning' | 'error' | 'info' | 'default';
|
|
187
|
+
export type StatusBadgeSize = 'sm' | 'md' | 'lg';
|
|
188
|
+
export interface StatusBadgeProps {
|
|
189
|
+
status: string;
|
|
190
|
+
colorMap?: Record<string, StatusBadgeColor>;
|
|
191
|
+
size?: StatusBadgeSize;
|
|
192
|
+
dot?: boolean;
|
|
193
|
+
uppercase?: boolean;
|
|
194
|
+
class?: string;
|
|
195
|
+
}
|
|
196
|
+
export type StatsCardColor = 'default' | 'primary' | 'success' | 'warning' | 'error';
|
|
197
|
+
export interface StatsCardTrend {
|
|
198
|
+
value: number;
|
|
199
|
+
direction: 'up' | 'down';
|
|
200
|
+
}
|
|
201
|
+
export interface StatsCardProps {
|
|
202
|
+
label: string;
|
|
203
|
+
value: number | string;
|
|
204
|
+
color?: StatsCardColor;
|
|
205
|
+
selected?: boolean;
|
|
206
|
+
onclick?: (event: MouseEvent) => void;
|
|
207
|
+
trend?: StatsCardTrend;
|
|
208
|
+
loading?: boolean;
|
|
209
|
+
class?: string;
|
|
210
|
+
}
|
|
211
|
+
export type DataTableSortOrder = 'asc' | 'desc';
|
|
212
|
+
export type DataTableColumnAlign = 'left' | 'center' | 'right';
|
|
213
|
+
export interface DataTableColumn {
|
|
214
|
+
key: string;
|
|
215
|
+
header: string;
|
|
216
|
+
sortable?: boolean;
|
|
217
|
+
width?: string;
|
|
218
|
+
align?: DataTableColumnAlign;
|
|
219
|
+
cell?: import('svelte').Snippet<[value: unknown, row: unknown]>;
|
|
220
|
+
}
|
|
221
|
+
export interface DataTableProps {
|
|
222
|
+
data: unknown[];
|
|
223
|
+
columns: DataTableColumn[];
|
|
224
|
+
sortBy?: string;
|
|
225
|
+
sortOrder?: DataTableSortOrder;
|
|
226
|
+
onsort?: (column: string, order: DataTableSortOrder) => void;
|
|
227
|
+
loading?: boolean;
|
|
228
|
+
loadingRows?: number;
|
|
229
|
+
rowHover?: boolean;
|
|
230
|
+
striped?: boolean;
|
|
231
|
+
stickyHeader?: boolean;
|
|
232
|
+
class?: string;
|
|
233
|
+
}
|
package/dist/types/feedback.d.ts
CHANGED
|
@@ -90,3 +90,13 @@ export interface SkeletonProps {
|
|
|
90
90
|
height?: string;
|
|
91
91
|
class?: string;
|
|
92
92
|
}
|
|
93
|
+
export type StatusBannerStatus = 'online' | 'offline' | 'warning' | 'error' | 'reconnecting';
|
|
94
|
+
export type StatusBannerPosition = 'fixed' | 'sticky' | 'static';
|
|
95
|
+
export interface StatusBannerProps {
|
|
96
|
+
status: StatusBannerStatus;
|
|
97
|
+
message?: string;
|
|
98
|
+
description?: string;
|
|
99
|
+
dismissible?: boolean;
|
|
100
|
+
position?: StatusBannerPosition;
|
|
101
|
+
class?: string;
|
|
102
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -127,8 +127,8 @@ export interface SwitchProps {
|
|
|
127
127
|
class?: string;
|
|
128
128
|
}
|
|
129
129
|
export type { TabsOrientation, TabsProps, TabListProps, TabTriggerProps, TabContentProps, MenuProps, MenuTriggerProps, MenuContentProps, MenuItemProps, MenuSeparatorProps, MenuSubProps, MenuSubTriggerProps, MenuSubContentProps, BreadcrumbItemData, BreadcrumbsProps, BreadcrumbItemProps, BottomNavItemData, BottomNavProps, BottomNavItemProps, NavItemProps, NavbarProps, SidebarItemData, SidebarProps, SidebarItemProps, SidebarGroupProps, StepperOrientation, StepperProps, StepperStepProps } from './navigation.js';
|
|
130
|
-
export type { AlertVariant, AlertProps, ToastVariant, ToastPosition, ToastData, ToastProps, ToastContainerProps, ModalSize, ModalProps, ModalHeaderProps, ModalBodyProps, ModalFooterProps, ProgressSize, ProgressBarProps, ProgressCircleProps, SpinnerProps, TooltipSide, TooltipProps, PopoverSide, PopoverProps, PopoverTriggerProps, PopoverContentProps, SkeletonVariant, SkeletonProps } from './feedback.js';
|
|
131
|
-
export type { CardVariant, CardProps, CardHeaderProps, CardBodyProps, CardFooterProps, AvatarSize, AvatarShape, AvatarProps, AvatarGroupProps, TagVariant, TagSize, TagProps, ChipVariant, ChipColor, ChipSize, ChipProps, ChipGroupProps, EmptyStateSize, EmptyStateProps, ListProps, ListItemProps, TableProps, TableHeadProps, TableHeaderAlign, TableHeaderSortDirection, TableHeaderProps, TableBodyProps, TableRowProps, TableCellAlign, TableCellProps, AccordionProps, AccordionItemProps, SliderProps, CarouselProps, CarouselSlideProps, ImageObjectFit, ImageRounded, ImageProps } from './data-display.js';
|
|
130
|
+
export type { AlertVariant, AlertProps, ToastVariant, ToastPosition, ToastData, ToastProps, ToastContainerProps, ModalSize, ModalProps, ModalHeaderProps, ModalBodyProps, ModalFooterProps, ProgressSize, ProgressBarProps, ProgressCircleProps, SpinnerProps, TooltipSide, TooltipProps, PopoverSide, PopoverProps, PopoverTriggerProps, PopoverContentProps, SkeletonVariant, SkeletonProps, StatusBannerStatus, StatusBannerPosition, StatusBannerProps } from './feedback.js';
|
|
131
|
+
export type { CardVariant, CardProps, CardHeaderProps, CardBodyProps, CardFooterProps, FlipCardProps, AvatarSize, AvatarShape, AvatarProps, AvatarGroupProps, TagVariant, TagSize, TagProps, ChipVariant, ChipColor, ChipSize, ChipProps, ChipGroupProps, EmptyStateSize, EmptyStateProps, PageHeaderProps, StatCircleColor, StatCircleSize, StatCircleProps, ListProps, ListItemProps, TableProps, TableHeadProps, TableHeaderAlign, TableHeaderSortDirection, TableHeaderProps, TableBodyProps, TableRowProps, TableCellAlign, TableCellProps, AccordionProps, AccordionItemProps, SliderProps, CarouselProps, CarouselSlideProps, ImageObjectFit, ImageRounded, ImageProps, StatusBadgeColor, StatusBadgeSize, StatusBadgeProps, StatsCardColor, StatsCardTrend, StatsCardProps, DataTableSortOrder, DataTableColumnAlign, DataTableColumn, DataTableProps } from './data-display.js';
|
|
132
132
|
export type { ContainerSize, ContainerProps, GridAlign, GridJustify, SpacingToken, GridProps, GridItemProps, StackDirection, StackProps, DividerOrientation, DividerProps, SpacerSize, SpacerProps, AspectRatioPreset, AspectRatioProps, CenterProps, BoxProps } from './layout.js';
|
|
133
133
|
export type { SafeAreaEdge, SafeAreaProps, BottomSheetSnapPoint, BottomSheetProps, BottomSheetHeaderProps, BottomSheetBodyProps, ActionSheetAction, ActionSheetProps, ActionSheetItemProps, PullToRefreshProps, SwipeActionSide, SwipeActionData, SwipeActionsProps, SwipeActionProps, FABSize, FABPosition, FABProps, FABAction, FABGroupProps } from './mobile.js';
|
|
134
|
-
export type { SearchInputProps, DatePickerProps, FileUploadProps, OTPInputProps, TimeFormat, TimePickerProps, RatingProps, ToggleGroupType, ToggleGroupOrientation, ToggleGroupProps, ToggleGroupItemProps } from './input.js';
|
|
134
|
+
export type { SearchInputProps, DatePickerProps, FileUploadProps, OTPInputProps, TimeFormat, TimePickerProps, RatingProps, ToggleGroupType, ToggleGroupOrientation, ToggleGroupProps, ToggleGroupItemProps, NumberInputProps, PaginationProps } from './input.js';
|
package/dist/types/input.d.ts
CHANGED
|
@@ -80,3 +80,23 @@ export interface ToggleGroupItemProps {
|
|
|
80
80
|
disabled?: boolean;
|
|
81
81
|
class?: string;
|
|
82
82
|
}
|
|
83
|
+
export interface NumberInputProps {
|
|
84
|
+
value?: number | null;
|
|
85
|
+
min?: number;
|
|
86
|
+
max?: number;
|
|
87
|
+
step?: number;
|
|
88
|
+
disabled?: boolean;
|
|
89
|
+
placeholder?: string;
|
|
90
|
+
name?: string;
|
|
91
|
+
id?: string;
|
|
92
|
+
error?: boolean;
|
|
93
|
+
class?: string;
|
|
94
|
+
onValueChange?: (value: number | null) => void;
|
|
95
|
+
}
|
|
96
|
+
export interface PaginationProps {
|
|
97
|
+
currentPage: number;
|
|
98
|
+
totalPages: number;
|
|
99
|
+
siblingCount?: number;
|
|
100
|
+
onPageChange?: (page: number) => void;
|
|
101
|
+
class?: string;
|
|
102
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aspect-ops/exon-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Reusable Svelte UI components for web and Capacitor mobile apps",
|
|
5
5
|
"author": "Exon Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -98,6 +98,7 @@
|
|
|
98
98
|
"husky": "^9.1.7",
|
|
99
99
|
"jsdom": "^25.0.0",
|
|
100
100
|
"lint-staged": "^16.2.7",
|
|
101
|
+
"mermaid": "^11.12.2",
|
|
101
102
|
"prettier": "^3.0.0",
|
|
102
103
|
"prettier-plugin-svelte": "^3.0.0",
|
|
103
104
|
"publint": "^0.2.0",
|
|
@@ -110,7 +111,8 @@
|
|
|
110
111
|
"vitest": "^2.0.0"
|
|
111
112
|
},
|
|
112
113
|
"dependencies": {
|
|
113
|
-
"bits-ui": "^1.0.0"
|
|
114
|
+
"bits-ui": "^1.0.0",
|
|
115
|
+
"lucide-svelte": "^0.562.0"
|
|
114
116
|
},
|
|
115
117
|
"publishConfig": {
|
|
116
118
|
"access": "public"
|