@dilipod/ui 0.4.28 → 0.4.30
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/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +164 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +157 -1
- package/dist/index.mjs.map +1 -1
- package/dist/lib/email.d.ts +48 -0
- package/dist/lib/email.d.ts.map +1 -0
- package/dist/lib/slack.d.ts +83 -0
- package/dist/lib/slack.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/index.ts +7 -0
- package/src/lib/email.ts +146 -0
- package/src/lib/slack.ts +142 -0
package/dist/index.mjs
CHANGED
|
@@ -492,17 +492,25 @@ __export(index_exports, {
|
|
|
492
492
|
WorkflowViewer: () => WorkflowViewer,
|
|
493
493
|
alertVariants: () => alertVariants,
|
|
494
494
|
badgeVariants: () => badgeVariants,
|
|
495
|
+
buttonHtml: () => buttonHtml,
|
|
495
496
|
buttonVariants: () => buttonVariants,
|
|
496
497
|
cn: () => cn,
|
|
498
|
+
emailTemplate: () => emailTemplate,
|
|
497
499
|
formatCentsToEuros: () => formatCentsToEuros,
|
|
498
500
|
formatDuration: () => formatDuration,
|
|
499
501
|
formatEuros: () => formatEuros,
|
|
500
502
|
formatRelativeTime: () => formatRelativeTime,
|
|
501
503
|
getDateRangeFromPreset: () => getDateRangeFromPreset,
|
|
502
504
|
iconBoxVariants: () => iconBoxVariants,
|
|
505
|
+
infoBoxHtml: () => infoBoxHtml,
|
|
503
506
|
metricCardVariants: () => metricCardVariants,
|
|
504
507
|
navigationMenuTriggerStyle: () => navigationMenuTriggerStyle,
|
|
508
|
+
noteBoxHtml: () => noteBoxHtml,
|
|
505
509
|
progressVariants: () => progressVariants,
|
|
510
|
+
slackActions: () => slackActions,
|
|
511
|
+
slackFields: () => slackFields,
|
|
512
|
+
slackMessage: () => slackMessage,
|
|
513
|
+
slackSection: () => slackSection,
|
|
506
514
|
statVariants: () => statVariants,
|
|
507
515
|
tagVariants: () => tagVariants,
|
|
508
516
|
toast: () => toast,
|
|
@@ -6852,9 +6860,157 @@ function formatRelativeTime(date) {
|
|
|
6852
6860
|
return formatDistanceToNow(d, { addSuffix: false });
|
|
6853
6861
|
}
|
|
6854
6862
|
|
|
6863
|
+
// src/lib/email.ts
|
|
6864
|
+
function emailTemplate({ body, preheader }) {
|
|
6865
|
+
const preheaderHtml = preheader ? `<div style="display:none;font-size:1px;color:#ffffff;line-height:1px;max-height:0;max-width:0;opacity:0;overflow:hidden;">${preheader}</div>` : "";
|
|
6866
|
+
return `<!DOCTYPE html>
|
|
6867
|
+
<html lang="en">
|
|
6868
|
+
<head>
|
|
6869
|
+
<meta charset="utf-8" />
|
|
6870
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6871
|
+
<meta name="color-scheme" content="light" />
|
|
6872
|
+
<meta name="supported-color-schemes" content="light" />
|
|
6873
|
+
<title>Dilipod</title>
|
|
6874
|
+
</head>
|
|
6875
|
+
<body style="margin: 0; padding: 0; background-color: #f0f0f0; -webkit-font-smoothing: antialiased;">
|
|
6876
|
+
${preheaderHtml}
|
|
6877
|
+
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color: #f0f0f0;">
|
|
6878
|
+
<tr>
|
|
6879
|
+
<td align="center" style="padding: 40px 16px;">
|
|
6880
|
+
<!-- Main card -->
|
|
6881
|
+
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="max-width: 560px;">
|
|
6882
|
+
<!-- Logo header -->
|
|
6883
|
+
<tr>
|
|
6884
|
+
<td style="padding: 0 0 24px 0;">
|
|
6885
|
+
<table role="presentation" cellpadding="0" cellspacing="0">
|
|
6886
|
+
<tr>
|
|
6887
|
+
<td style="width: 32px; height: 32px; background-color: #00e5cc; border-radius: 6px; text-align: center; vertical-align: middle; font-size: 16px; font-weight: 700; color: #111111; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;">
|
|
6888
|
+
D
|
|
6889
|
+
</td>
|
|
6890
|
+
<td style="padding-left: 10px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 17px; font-weight: 600; color: #111111; letter-spacing: -0.2px;">
|
|
6891
|
+
Dilipod
|
|
6892
|
+
</td>
|
|
6893
|
+
</tr>
|
|
6894
|
+
</table>
|
|
6895
|
+
</td>
|
|
6896
|
+
</tr>
|
|
6897
|
+
<!-- Content card -->
|
|
6898
|
+
<tr>
|
|
6899
|
+
<td>
|
|
6900
|
+
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color: #ffffff; border-radius: 6px; overflow: hidden; border: 1px solid #e2e2e2;">
|
|
6901
|
+
<!-- Accent bar -->
|
|
6902
|
+
<tr>
|
|
6903
|
+
<td style="height: 3px; background: linear-gradient(90deg, #00e5cc 0%, #00c8b5 100%); font-size: 0; line-height: 0;"> </td>
|
|
6904
|
+
</tr>
|
|
6905
|
+
<!-- Body content -->
|
|
6906
|
+
<tr>
|
|
6907
|
+
<td style="padding: 36px 40px 40px 40px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 15px; line-height: 1.7; color: #374151;">
|
|
6908
|
+
${body}
|
|
6909
|
+
</td>
|
|
6910
|
+
</tr>
|
|
6911
|
+
</table>
|
|
6912
|
+
</td>
|
|
6913
|
+
</tr>
|
|
6914
|
+
<!-- Footer -->
|
|
6915
|
+
<tr>
|
|
6916
|
+
<td style="padding: 24px 4px 0 4px;">
|
|
6917
|
+
<table role="presentation" width="100%" cellpadding="0" cellspacing="0">
|
|
6918
|
+
<tr>
|
|
6919
|
+
<td style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 12px; color: #9ca3af;">
|
|
6920
|
+
© ${(/* @__PURE__ */ new Date()).getFullYear()} Dilipod — Your Digital Workforce
|
|
6921
|
+
</td>
|
|
6922
|
+
<td align="right" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 12px;">
|
|
6923
|
+
<a href="https://dilipod.com" style="color: #9ca3af; text-decoration: none;">dilipod.com</a>
|
|
6924
|
+
</td>
|
|
6925
|
+
</tr>
|
|
6926
|
+
</table>
|
|
6927
|
+
</td>
|
|
6928
|
+
</tr>
|
|
6929
|
+
</table>
|
|
6930
|
+
</td>
|
|
6931
|
+
</tr>
|
|
6932
|
+
</table>
|
|
6933
|
+
</body>
|
|
6934
|
+
</html>`;
|
|
6935
|
+
}
|
|
6936
|
+
function buttonHtml({
|
|
6937
|
+
text,
|
|
6938
|
+
href,
|
|
6939
|
+
variant = "primary"
|
|
6940
|
+
}) {
|
|
6941
|
+
const bg = variant === "danger" ? "#dc2626" : "#111111";
|
|
6942
|
+
const color = "#ffffff";
|
|
6943
|
+
return `<table role="presentation" cellpadding="0" cellspacing="0" style="margin-top: 24px;">
|
|
6944
|
+
<tr>
|
|
6945
|
+
<td style="background-color: ${bg}; border-radius: 6px;">
|
|
6946
|
+
<a href="${href}" style="display: inline-block; padding: 12px 32px; color: ${color}; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 14px; font-weight: 600; text-decoration: none;">
|
|
6947
|
+
${text} →
|
|
6948
|
+
</a>
|
|
6949
|
+
</td>
|
|
6950
|
+
</tr>
|
|
6951
|
+
</table>`;
|
|
6952
|
+
}
|
|
6953
|
+
function infoBoxHtml(innerHtml) {
|
|
6954
|
+
return `<div style="background-color: #f8fafb; padding: 16px 20px; border-radius: 6px; border: 1px solid #e5e7eb; margin: 20px 0; border-left: 3px solid #00e5cc;">
|
|
6955
|
+
${innerHtml}
|
|
6956
|
+
</div>`;
|
|
6957
|
+
}
|
|
6958
|
+
function noteBoxHtml(text) {
|
|
6959
|
+
return `<div style="background-color: #fffbeb; padding: 14px 18px; border-radius: 6px; border: 1px solid #fde68a; margin: 20px 0; font-size: 13px; color: #92400e; border-left: 3px solid #f59e0b;">
|
|
6960
|
+
${text}
|
|
6961
|
+
</div>`;
|
|
6962
|
+
}
|
|
6963
|
+
|
|
6964
|
+
// src/lib/slack.ts
|
|
6965
|
+
function slackSection(mrkdwn) {
|
|
6966
|
+
return {
|
|
6967
|
+
type: "section",
|
|
6968
|
+
text: { type: "mrkdwn", text: mrkdwn }
|
|
6969
|
+
};
|
|
6970
|
+
}
|
|
6971
|
+
function slackFields(fields) {
|
|
6972
|
+
return {
|
|
6973
|
+
type: "section",
|
|
6974
|
+
fields: Object.entries(fields).map(([key, value]) => ({
|
|
6975
|
+
type: "mrkdwn",
|
|
6976
|
+
text: `*${key}:*
|
|
6977
|
+
${value}`
|
|
6978
|
+
}))
|
|
6979
|
+
};
|
|
6980
|
+
}
|
|
6981
|
+
function slackActions(buttons) {
|
|
6982
|
+
return {
|
|
6983
|
+
type: "actions",
|
|
6984
|
+
elements: buttons.map((btn) => ({
|
|
6985
|
+
type: "button",
|
|
6986
|
+
text: { type: "plain_text", text: btn.text },
|
|
6987
|
+
...btn.url ? { url: btn.url } : {},
|
|
6988
|
+
...btn.value ? { value: btn.value } : {},
|
|
6989
|
+
...btn.actionId ? { action_id: btn.actionId } : {},
|
|
6990
|
+
...btn.style ? { style: btn.style } : {}
|
|
6991
|
+
}))
|
|
6992
|
+
};
|
|
6993
|
+
}
|
|
6994
|
+
function slackMessage(options) {
|
|
6995
|
+
const blocks = [slackSection(`*${options.title}*`)];
|
|
6996
|
+
if (options.details && Object.keys(options.details).length > 0) {
|
|
6997
|
+
blocks.push(slackFields(options.details));
|
|
6998
|
+
}
|
|
6999
|
+
if (options.note) {
|
|
7000
|
+
blocks.push(slackSection(options.note));
|
|
7001
|
+
}
|
|
7002
|
+
if (options.buttonUrl && options.buttonText) {
|
|
7003
|
+
blocks.push(slackActions([{ text: options.buttonText, url: options.buttonUrl }]));
|
|
7004
|
+
}
|
|
7005
|
+
return {
|
|
7006
|
+
text: options.title,
|
|
7007
|
+
blocks
|
|
7008
|
+
};
|
|
7009
|
+
}
|
|
7010
|
+
|
|
6855
7011
|
// src/index.ts
|
|
6856
7012
|
__reExport(index_exports, icons_exports);
|
|
6857
7013
|
|
|
6858
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityTimeline, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, BreadcrumbLink, Breadcrumbs, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, ConfirmDialog, DateRangePicker, DateRangeSelect, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ErrorState, ExpandableSection, FilePreview, FlowchartDiagram, FormField, IconBox, ImpactMetricsForm, Input, Label2 as Label, LabeledSlider, LabeledSwitch, Logo, Metric, MetricCard, MetricLabel, MetricSubtext, MetricValue, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupCard, RadioGroupItem, RadioGroupOption, ScenariosManager, Select, Separator2 as Separator, SettingsNav, SettingsNavLink, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SimplePagination, SimpleTooltip, Skeleton, SkeletonCard, SkeletonText, Slider, Stat, StepDots, StepProgress, SupportChat, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsListUnderline, TabsTrigger, TabsTriggerUnderline, Tag, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastIcon, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger, UsageBar, UsageChart, WorkerSpec, WorkflowFlow, WorkflowViewer, alertVariants, badgeVariants, buttonVariants, cn, formatCentsToEuros, formatDuration, formatEuros, formatRelativeTime, getDateRangeFromPreset, iconBoxVariants, metricCardVariants, navigationMenuTriggerStyle, progressVariants, statVariants, tagVariants, toast, usageBarVariants, useExpandedSections, useServiceWorker, useToast, valueVariants };
|
|
7014
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityTimeline, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, BreadcrumbLink, Breadcrumbs, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, ConfirmDialog, DateRangePicker, DateRangeSelect, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ErrorState, ExpandableSection, FilePreview, FlowchartDiagram, FormField, IconBox, ImpactMetricsForm, Input, Label2 as Label, LabeledSlider, LabeledSwitch, Logo, Metric, MetricCard, MetricLabel, MetricSubtext, MetricValue, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupCard, RadioGroupItem, RadioGroupOption, ScenariosManager, Select, Separator2 as Separator, SettingsNav, SettingsNavLink, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SimplePagination, SimpleTooltip, Skeleton, SkeletonCard, SkeletonText, Slider, Stat, StepDots, StepProgress, SupportChat, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsListUnderline, TabsTrigger, TabsTriggerUnderline, Tag, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastIcon, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger, UsageBar, UsageChart, WorkerSpec, WorkflowFlow, WorkflowViewer, alertVariants, badgeVariants, buttonHtml, buttonVariants, cn, emailTemplate, formatCentsToEuros, formatDuration, formatEuros, formatRelativeTime, getDateRangeFromPreset, iconBoxVariants, infoBoxHtml, metricCardVariants, navigationMenuTriggerStyle, noteBoxHtml, progressVariants, slackActions, slackFields, slackMessage, slackSection, statVariants, tagVariants, toast, usageBarVariants, useExpandedSections, useServiceWorker, useToast, valueVariants };
|
|
6859
7015
|
//# sourceMappingURL=index.mjs.map
|
|
6860
7016
|
//# sourceMappingURL=index.mjs.map
|