@dilipod/ui 0.4.29 → 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.mjs CHANGED
@@ -507,6 +507,10 @@ __export(index_exports, {
507
507
  navigationMenuTriggerStyle: () => navigationMenuTriggerStyle,
508
508
  noteBoxHtml: () => noteBoxHtml,
509
509
  progressVariants: () => progressVariants,
510
+ slackActions: () => slackActions,
511
+ slackFields: () => slackFields,
512
+ slackMessage: () => slackMessage,
513
+ slackSection: () => slackSection,
510
514
  statVariants: () => statVariants,
511
515
  tagVariants: () => tagVariants,
512
516
  toast: () => toast,
@@ -6957,9 +6961,56 @@ function noteBoxHtml(text) {
6957
6961
  </div>`;
6958
6962
  }
6959
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
+
6960
7011
  // src/index.ts
6961
7012
  __reExport(index_exports, icons_exports);
6962
7013
 
6963
- 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, 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 };
6964
7015
  //# sourceMappingURL=index.mjs.map
6965
7016
  //# sourceMappingURL=index.mjs.map