@syscore/ui-library 1.27.3 → 2.0.0-beta-publish-workflow-beta.1

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.
Files changed (168) hide show
  1. package/client/App.tsx +0 -2
  2. package/client/assets/alert/icon-clear.svg +4 -0
  3. package/client/assets/alert/icon-done.svg +3 -0
  4. package/client/assets/avatar-identity/photo.png +0 -0
  5. package/client/assets/avatar-identity/placeholder-icon.svg +8 -0
  6. package/client/assets/breadcrumb/icon-ellipsis.svg +5 -0
  7. package/client/assets/breadcrumb/icon-home.svg +3 -0
  8. package/client/assets/breadcrumb/icon-separator.svg +3 -0
  9. package/client/assets/button-v01/icon-back.svg +4 -0
  10. package/client/assets/button-v01/icon-check.svg +3 -0
  11. package/client/assets/button-v01/icon-close.svg +4 -0
  12. package/client/assets/button-v01/icon-delete.svg +3 -0
  13. package/client/assets/button-v01/icon-device.svg +3 -0
  14. package/client/assets/dropdown/icon-carrot-contract.svg +3 -0
  15. package/client/assets/dropdown/icon-carrot-expand.svg +3 -0
  16. package/client/assets/dropdown/icon-clear.svg +4 -0
  17. package/client/assets/dropdown/icon-enter.svg +3 -0
  18. package/client/components/icons/UtilityChangeType.tsx +21 -0
  19. package/client/components/ui/alert-dialog-panel.tsx +246 -0
  20. package/client/components/ui/alert-v02.tsx +214 -0
  21. package/client/components/ui/app-bar.tsx +299 -0
  22. package/client/components/ui/avatar-identity.tsx +122 -0
  23. package/client/components/ui/banner.tsx +108 -0
  24. package/client/components/ui/bottom-navigation.tsx +223 -0
  25. package/client/components/ui/breadcrumb-trail.tsx +170 -0
  26. package/client/components/ui/button-v01.tsx +238 -0
  27. package/client/components/ui/button.tsx +2 -0
  28. package/client/components/ui/card.tsx +108 -26
  29. package/client/components/ui/code-badge.tsx +62 -0
  30. package/client/components/ui/date-picker.tsx +188 -0
  31. package/client/components/ui/dropdown.tsx +448 -0
  32. package/client/components/ui/empty-state.tsx +197 -0
  33. package/client/components/ui/file-upload.tsx +214 -0
  34. package/client/components/ui/footer.tsx +179 -0
  35. package/client/components/ui/layout.tsx +1182 -0
  36. package/client/components/ui/pagination-v01.tsx +157 -0
  37. package/client/components/ui/password-field-v01.tsx +67 -0
  38. package/client/components/ui/search-field-v01.tsx +192 -0
  39. package/client/components/ui/section-heading.tsx +49 -0
  40. package/client/components/ui/sidebar.tsx +2 -3
  41. package/client/components/ui/stepper.tsx +148 -0
  42. package/client/components/ui/switch-v01.tsx +71 -0
  43. package/client/components/ui/system-bar.tsx +119 -0
  44. package/client/components/ui/table-v01.tsx +230 -0
  45. package/client/components/ui/tabs-v01.tsx +99 -0
  46. package/client/components/ui/tag-v02.tsx +113 -0
  47. package/client/components/ui/text-area-v01.tsx +33 -0
  48. package/client/components/ui/text-field-v01.tsx +108 -0
  49. package/client/components/ui/timeline.tsx +181 -0
  50. package/client/components/ui/toast-v01.tsx +206 -0
  51. package/client/components/ui/tooltip.tsx +264 -71
  52. package/client/global.css +9565 -4378
  53. package/client/storybook.css +125 -0
  54. package/client/ui/Accordion.stories.tsx +1 -1
  55. package/client/ui/AlertDialogPanel/AlertDialogPanel.stories.tsx +150 -0
  56. package/client/ui/AlertV02/AlertV02.stories.tsx +188 -0
  57. package/client/ui/AppBar/app-bar.stories.tsx +280 -0
  58. package/client/ui/AspectRatio.stories.tsx +1 -1
  59. package/client/ui/AvatarIdentity/AvatarIdentity.stories.tsx +77 -0
  60. package/client/ui/Banner/banner.stories.tsx +238 -0
  61. package/client/ui/BottomNavigation/bottom-navigation.stories.tsx +285 -0
  62. package/client/ui/BreadcrumbTrail/BreadcrumbTrail.stories.tsx +232 -0
  63. package/client/ui/Button.stories.tsx +1 -1
  64. package/client/ui/ButtonV01/ButtonV01.stories.tsx +417 -0
  65. package/client/ui/Calendar/Calendar.stories.tsx +1 -1
  66. package/client/ui/Card.stories.tsx +285 -168
  67. package/client/ui/Carousel/Carousel.stories.tsx +1 -1
  68. package/client/ui/Chart/Chart.stories.tsx +1 -1
  69. package/client/ui/Checkbox.stories.tsx +1 -1
  70. package/client/ui/Collapsible/Collapsible.stories.tsx +1 -1
  71. package/client/ui/Colors.stories.tsx +1 -1
  72. package/client/ui/Command/Command.stories.tsx +1 -1
  73. package/client/ui/ContextMenu/ContextMenu.stories.tsx +1 -1
  74. package/client/ui/DatePicker/DatePicker.stories.tsx +293 -0
  75. package/client/ui/Dialog.stories.tsx +1 -1
  76. package/client/ui/Drawer/Drawer.stories.tsx +1 -1
  77. package/client/ui/Dropdown/Dropdown.stories.tsx +205 -0
  78. package/client/ui/EmptyState/empty-state.stories.tsx +251 -0
  79. package/client/ui/FileUpload/FileUpload.stories.tsx +218 -0
  80. package/client/ui/Footer/footer.stories.tsx +194 -0
  81. package/client/ui/Form/Form.stories.tsx +1 -1
  82. package/client/ui/Hero.stories.tsx +1 -1
  83. package/client/ui/HoverCard/HoverCard.stories.tsx +1 -1
  84. package/client/ui/Icons.stories.tsx +1 -1
  85. package/client/ui/Input.stories.tsx +1 -1
  86. package/client/ui/InputOTP/InputOTP.stories.tsx +1 -1
  87. package/client/ui/Label.stories.tsx +1 -1
  88. package/client/ui/Layout/Center.stories.tsx +100 -0
  89. package/client/ui/Layout/Columns.stories.tsx +136 -0
  90. package/client/ui/Layout/Container.stories.tsx +104 -0
  91. package/client/ui/Layout/FormLayout.stories.tsx +144 -0
  92. package/client/ui/Layout/Grid.stories.tsx +158 -0
  93. package/client/ui/Layout/GridSpan.stories.tsx +75 -0
  94. package/client/ui/Layout/HStack.stories.tsx +128 -0
  95. package/client/ui/Layout/Layout.stories.tsx +287 -0
  96. package/client/ui/Layout/LayoutContent.stories.tsx +91 -0
  97. package/client/ui/Layout/LayoutFooter.stories.tsx +77 -0
  98. package/client/ui/Layout/LayoutHeader.stories.tsx +104 -0
  99. package/client/ui/Layout/LayoutPanel.stories.tsx +143 -0
  100. package/client/ui/Layout/Positioned.stories.tsx +113 -0
  101. package/client/ui/Layout/Section.stories.tsx +84 -0
  102. package/client/ui/Layout/ShowHide.stories.tsx +99 -0
  103. package/client/ui/Layout/Spacer.stories.tsx +149 -0
  104. package/client/ui/Layout/Stack.stories.tsx +69 -0
  105. package/client/ui/Layout/StackItem.stories.tsx +124 -0
  106. package/client/ui/Layout/VStack.stories.tsx +101 -0
  107. package/client/ui/Layout/controls.ts +33 -0
  108. package/client/ui/Layout/demo.tsx +37 -0
  109. package/client/ui/Menubar/Menubar.stories.tsx +1 -1
  110. package/client/ui/MobileNav.stories.tsx +1 -1
  111. package/client/ui/Navigation.stories.tsx +1 -1
  112. package/client/ui/NavigationMenu/NavigationMenu.stories.tsx +1 -1
  113. package/client/ui/PageHeader.stories.tsx +13 -13
  114. package/client/ui/Pagination/Pagination.stories.tsx +178 -98
  115. package/client/ui/Pagination/PaginationLegacy.stories.tsx +121 -0
  116. package/client/ui/Panel.stories.tsx +1 -1
  117. package/client/ui/Popover/Popover.stories.tsx +1 -1
  118. package/client/ui/Progress/Progress.stories.tsx +1 -1
  119. package/client/ui/RadioGroup/RadioGroup.stories.tsx +1 -1
  120. package/client/ui/Resizable/Resizable.stories.tsx +1 -1
  121. package/client/ui/ScrollArea/ScrollArea.stories.tsx +1 -1
  122. package/client/ui/SearchField/SearchField.stories.tsx +153 -0
  123. package/client/ui/{SearchField.stories.tsx → SearchField/SearchFieldLegacy.stories.tsx} +2 -2
  124. package/client/ui/SectionBadge.stories.tsx +1 -1
  125. package/client/ui/Select.stories.tsx +1 -1
  126. package/client/ui/Separator/Separator.stories.tsx +1 -1
  127. package/client/ui/Sheet/Sheet.stories.tsx +1 -1
  128. package/client/ui/Sidebar/Sidebar.stories.tsx +57 -8
  129. package/client/ui/Skeleton/Skeleton.stories.tsx +1 -1
  130. package/client/ui/Slider/Slider.stories.tsx +1 -1
  131. package/client/ui/StandardNavigation.stories.tsx +1 -1
  132. package/client/ui/Stepper/Stepper.stories.tsx +344 -0
  133. package/client/ui/Switch.stories.tsx +1 -1
  134. package/client/ui/SwitchV01/SwitchV01.stories.tsx +152 -0
  135. package/client/ui/SystemBar/system-bar.stories.tsx +179 -0
  136. package/client/ui/Table/TableV01.stories.tsx +256 -0
  137. package/client/ui/Tabs.stories.tsx +1 -1
  138. package/client/ui/TabsV01/TabsV01.stories.tsx +144 -0
  139. package/client/ui/Tag.stories.tsx +1 -1
  140. package/client/ui/TagV02/TagStatusV02.stories.tsx +132 -0
  141. package/client/ui/TagV02/TagV02.stories.tsx +142 -0
  142. package/client/ui/TextAreaV01/TextAreaV01.stories.tsx +146 -0
  143. package/client/ui/TextFieldV01/PasswordFieldV01.stories.tsx +161 -0
  144. package/client/ui/TextFieldV01/TextFieldV01.stories.tsx +160 -0
  145. package/client/ui/Textarea.stories.tsx +1 -1
  146. package/client/ui/Timeline/timeline.stories.tsx +404 -0
  147. package/client/ui/Toast/Toast.stories.tsx +1 -1
  148. package/client/ui/ToastV01/ToastV01.stories.tsx +201 -0
  149. package/client/ui/Toaster/Toaster.stories.tsx +1 -1
  150. package/client/ui/Toggle.stories.tsx +1 -1
  151. package/client/ui/Tooltip.stories.tsx +287 -114
  152. package/client/ui/Typography.stories.tsx +1 -1
  153. package/dist/index.cjs.js +1 -1
  154. package/dist/index.d.ts +649 -13
  155. package/dist/index.es.js +4401 -651
  156. package/package.json +1 -1
  157. package/client/components/ui/badge.tsx +0 -33
  158. package/client/components/ui/sonner.tsx +0 -26
  159. package/client/components/ui/toggle-group.tsx +0 -76
  160. package/client/ui/Alert/Alert.stories.tsx +0 -82
  161. package/client/ui/AlertDialog/AlertDialog.stories.tsx +0 -106
  162. package/client/ui/Avatar/Avatar.stories.tsx +0 -94
  163. package/client/ui/Badge/Badge.stories.tsx +0 -60
  164. package/client/ui/Breadcrumb/Breadcrumb.stories.tsx +0 -97
  165. package/client/ui/DropdownMenu/DropdownMenu.stories.tsx +0 -139
  166. package/client/ui/Sonner/Sonner.stories.tsx +0 -48
  167. package/client/ui/Table/Table.stories.tsx +0 -135
  168. package/client/ui/ToggleGroup/ToggleGroup.stories.tsx +0 -88
package/client/App.tsx CHANGED
@@ -2,7 +2,6 @@ import "./global.css";
2
2
 
3
3
  import { Toaster } from "@/components/ui/toaster";
4
4
  import { createRoot } from "react-dom/client";
5
- import { Toaster as Sonner } from "@/components/ui/sonner";
6
5
  import { TooltipProvider } from "@/components/ui/tooltip";
7
6
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
8
7
  import { BrowserRouter, Routes, Route, Link } from "react-router-dom";
@@ -15,7 +14,6 @@ const App = () => (
15
14
  <QueryClientProvider client={queryClient}>
16
15
  <TooltipProvider>
17
16
  <Toaster />
18
- <Sonner />
19
17
  <BrowserRouter>
20
18
  <div className="min-h-screen">
21
19
  <header className="sticky top-0 z-50 border-b bg-background/80 backdrop-blur-sm">
@@ -0,0 +1,4 @@
1
+ <svg width="9.5" height="9.5" viewBox="0 0 9.5 9.5" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0.75 0.75L8.75 8.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <path d="M8.75 0.75L0.75 8.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="12.7" height="9.15217" viewBox="0 0 12.7 9.15217" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M11.95 0.75L4.25 8.40217L0.75 4.92391" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg viewBox="0 0 50.0084 63.25" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="icon">
3
+ <g id="icon_2">
4
+ <path d="M25.0045 27.5C31.0796 27.5 36.0045 22.5751 36.0045 16.5C36.0045 10.4249 31.0796 5.5 25.0045 5.5C18.9293 5.5 14.0045 10.4249 14.0045 16.5C14.0045 22.5751 18.9293 27.5 25.0045 27.5Z" fill="#FFFFFF"/>
5
+ <path d="M0 51.7864C4.34615 42.3222 13.9076 35.75 25.0041 35.75C36.1007 35.75 45.6623 42.3224 50.0084 51.7869C43.9567 58.8064 34.9995 63.25 25.0044 63.25C15.009 63.25 6.05161 58.8062 0 51.7864Z" fill="#FFFFFF"/>
6
+ </g>
7
+ </g>
8
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M8.00004 8.66666C8.36823 8.66666 8.66671 8.36818 8.66671 7.99999C8.66671 7.63181 8.36823 7.33333 8.00004 7.33333C7.63185 7.33333 7.33337 7.63181 7.33337 7.99999C7.33337 8.36818 7.63185 8.66666 8.00004 8.66666Z" stroke="#52545D" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <path d="M12.6667 8.66666C13.0349 8.66666 13.3333 8.36818 13.3333 7.99999C13.3333 7.63181 13.0349 7.33333 12.6667 7.33333C12.2985 7.33333 12 7.63181 12 7.99999C12 8.36818 12.2985 8.66666 12.6667 8.66666Z" stroke="#52545D" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M3.33329 8.66666C3.70148 8.66666 3.99996 8.36818 3.99996 7.99999C3.99996 7.63181 3.70148 7.33333 3.33329 7.33333C2.9651 7.33333 2.66663 7.63181 2.66663 7.99999C2.66663 8.36818 2.9651 8.66666 3.33329 8.66666Z" stroke="#52545D" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="14" height="13.5475" viewBox="0 0 14 13.5475" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M13.13 3.8375L8.17 0.3675C7.47 -0.1225 6.54 -0.1225 5.83 0.3675L0.87 3.8375C0.33 4.2175 0 4.8375 0 5.5075V11.5075C0 12.6275 0.91 13.5475 2.04 13.5475H3.95C4.39 13.5475 4.75 13.1875 4.75 12.7475V8.9575C4.75 7.7675 5.61 6.6575 6.8 6.5575C8.13 6.4375 9.25 7.4875 9.25 8.7975V12.7475C9.25 13.1875 9.61 13.5475 10.05 13.5475H11.96C13.08 13.5475 14 12.6375 14 11.5075V5.5075C14 4.8475 13.68 4.2175 13.13 3.8375Z" fill="#52545D"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="4.5" height="7.5" viewBox="0 0 4.5 7.5" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0.75 6.75L3.75 3.75L0.75 0.75" stroke="#CBCDD2" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="13.3" height="13.3" viewBox="0 0 13.3 13.3" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M6.65 12.65L0.65 6.65L6.65 0.65" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <path d="M12.65 6.65H0.65" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="12.7" height="9.15217" viewBox="0 0 12.7 9.15217" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M11.95 0.75L4.25 8.40217L0.75 4.92391" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="11.1" height="11.1" viewBox="0 0 11.1 11.1" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M10.35 0.75L0.75 10.35" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <path d="M0.75 0.75L10.35 10.35" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="14.1" height="15.5" viewBox="0 0 14.1 15.5" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M11.95 3.55V13.35C11.95 13.7213 11.8025 14.0774 11.5399 14.3399C11.2774 14.6025 10.9213 14.75 10.55 14.75H3.55C3.1787 14.75 2.8226 14.6025 2.56005 14.3399C2.2975 14.0774 2.15 13.7213 2.15 13.35V3.55M0.75 3.55H13.35M4.25 3.55V2.15C4.25 1.7787 4.3975 1.4226 4.66005 1.16005C4.9226 0.8975 5.2787 0.75 5.65 0.75H8.45C8.8213 0.75 9.1774 0.8975 9.43995 1.16005C9.7025 1.4226 9.85 1.7787 9.85 2.15V3.55" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="20" height="19.0963" viewBox="0 0 20 19.0963" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M19 13.6C19 14.0774 18.8104 14.5352 18.4728 14.8728C18.1352 15.2104 17.6774 15.4 17.2 15.4H5.3452C4.86785 15.4001 4.41009 15.5898 4.0726 15.9274L2.0908 17.9092C2.00143 17.9985 1.88758 18.0594 1.76364 18.084C1.6397 18.1087 1.51123 18.096 1.39448 18.0477C1.27772 17.9993 1.17793 17.9174 1.10772 17.8124C1.0375 17.7073 1.00002 17.5838 1 17.4574V2.8C1 2.32261 1.18964 1.86477 1.52721 1.52721C1.86477 1.18964 2.32261 1 2.8 1H17.2C17.6774 1 18.1352 1.18964 18.4728 1.52721C18.8104 1.86477 19 2.32261 19 2.8V13.6Z" fill="white" fill-opacity="0.2" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M3 10.25L8 5.75L13 10.25" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M13 5.75L8 10.25L3 5.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="11.1" height="11.1" viewBox="0 0 11.1 11.1" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M10.35 0.75L0.75 10.35" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <path d="M0.75 0.75L10.35 10.35" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M9.16667 13.6L15 8.00002L9.16667 2.40002M15 8.00002L1 8.00002" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -0,0 +1,21 @@
1
+ const CHANGE_TYPE_PATH =
2
+ "M7.03821 0.597996C6.9327 0.416112 6.78127 0.265138 6.59906 0.160189C6.41685 0.0552399 6.21027 2.66508e-16 6 0C5.78973 2.66508e-16 5.58315 0.0552399 5.40094 0.160189C5.21873 0.265138 5.0673 0.416112 4.96179 0.597996L0.160803 8.99972C0.0555113 9.18209 5.41026e-05 9.38895 3.95658e-08 9.59953C-5.40234e-05 9.81012 0.0552969 10.017 0.160495 10.1994C0.265693 10.3819 0.417035 10.5334 0.599324 10.6388C0.781613 10.7443 0.988433 10.7999 1.19902 10.8001L10.801 10.8001C11.0116 10.7999 11.2184 10.7443 11.4007 10.6388C11.583 10.5334 11.7343 10.3819 11.8395 10.1994C11.9447 10.017 12.0001 9.81012 12 9.59953C11.9999 9.38895 11.9445 9.18209 11.8392 8.99972L7.03821 0.597996Z";
3
+
4
+ export function UtilityChangeType({ className }: { className?: string }) {
5
+ return (
6
+ <svg
7
+ className={className}
8
+ viewBox="-0.75 -0.75 13.5 12.3"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ aria-hidden
11
+ >
12
+ <path
13
+ d={CHANGE_TYPE_PATH}
14
+ fill="var(--change-fill)"
15
+ stroke="var(--change-stroke)"
16
+ strokeWidth={1.5}
17
+ strokeLinejoin="round"
18
+ />
19
+ </svg>
20
+ );
21
+ }
@@ -0,0 +1,246 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
5
+ import { cva, type VariantProps } from "class-variance-authority";
6
+
7
+ import { cn } from "@/lib/utils";
8
+ import { ButtonV01 } from "@/components/ui/button-v01";
9
+
10
+ const alertDialogPanelVariants = cva("alert-dialog-panel", {
11
+ variants: {
12
+ variant: {
13
+ default: "alert-dialog-panel--default",
14
+ destruction: "alert-dialog-panel--destruction",
15
+ success: "alert-dialog-panel--success",
16
+ },
17
+ size: {
18
+ medium: "alert-dialog-panel--medium",
19
+ small: "alert-dialog-panel--small",
20
+ },
21
+ },
22
+ defaultVariants: {
23
+ variant: "default",
24
+ size: "medium",
25
+ },
26
+ });
27
+
28
+ type AlertDialogPanelVariant = "default" | "destruction" | "success";
29
+ type AlertDialogPanelSize = "medium" | "small";
30
+
31
+ /**
32
+ * Cancel and confirm buttons resolve to different design-system button
33
+ * variants per variant/size combination, mirroring the Figma component set.
34
+ */
35
+ const cancelHierarchy = (
36
+ variant: AlertDialogPanelVariant,
37
+ size: AlertDialogPanelSize,
38
+ ): "secondary" | "tertiary" =>
39
+ size === "medium" && variant !== "success" ? "tertiary" : "secondary";
40
+
41
+ /**
42
+ * Figma's success action is a flat translucent pill, not a gradient — the CTA
43
+ * type is used for its shape and label, and `.alert-dialog-panel-button--success`
44
+ * replaces the surface with `--alert-dialog-action-success-bg`.
45
+ */
46
+ const actionIsCta = (variant: AlertDialogPanelVariant) => variant === "success";
47
+
48
+ /**
49
+ * Design-system typography utilities. These carry the cap-height trim that
50
+ * reproduces the Figma frame heights exactly.
51
+ */
52
+ const titleTypography: Record<AlertDialogPanelSize, string> = {
53
+ medium: "heading-xsmall",
54
+ small: "heading-xxsmall",
55
+ };
56
+
57
+ const descriptionTypography: Record<AlertDialogPanelSize, string> = {
58
+ medium: "body-base",
59
+ small: "body-small",
60
+ };
61
+
62
+ /** Body copy and button labels are set in Mazzard Soft M, headings in FT Made. */
63
+ const bodyFontClass = "font-mazzardSoft";
64
+
65
+ // ---------------------------------------------------------------------------
66
+ // Surface — the presentational panel, usable inline or inside a modal
67
+ // ---------------------------------------------------------------------------
68
+
69
+ interface AlertDialogPanelSurfaceProps
70
+ extends Omit<React.HTMLAttributes<HTMLDivElement>, "title">,
71
+ VariantProps<typeof alertDialogPanelVariants> {
72
+ title: React.ReactNode;
73
+ description?: React.ReactNode;
74
+ /** Mirrors the Figma `show description` boolean property. */
75
+ showDescription?: boolean;
76
+ cancelLabel?: React.ReactNode;
77
+ actionLabel?: React.ReactNode;
78
+ onCancel?: () => void;
79
+ onAction?: () => void;
80
+ /** Render labelled elements as Radix Cancel/Action targets. */
81
+ asPrimitive?: boolean;
82
+ }
83
+
84
+ const AlertDialogPanelSurface = React.forwardRef<
85
+ HTMLDivElement,
86
+ AlertDialogPanelSurfaceProps
87
+ >(
88
+ (
89
+ {
90
+ className,
91
+ variant = "default",
92
+ size = "medium",
93
+ title,
94
+ description,
95
+ showDescription = true,
96
+ cancelLabel = "Cancel",
97
+ actionLabel = "Confirm",
98
+ onCancel,
99
+ onAction,
100
+ asPrimitive = false,
101
+ children,
102
+ ...props
103
+ },
104
+ ref,
105
+ ) => {
106
+ const resolvedVariant = (variant ?? "default") as AlertDialogPanelVariant;
107
+ const resolvedSize = (size ?? "medium") as AlertDialogPanelSize;
108
+ const buttonSize = resolvedSize === "medium" ? "medium" : "small";
109
+
110
+ const TitleTag = asPrimitive ? AlertDialogPrimitive.Title : "h2";
111
+ const DescriptionTag = asPrimitive ? AlertDialogPrimitive.Description : "p";
112
+
113
+ const cancelButton = (
114
+ <ButtonV01
115
+ type="button"
116
+ size={buttonSize}
117
+ typeVariant="cta"
118
+ hierarchy={cancelHierarchy(resolvedVariant, resolvedSize)}
119
+ appearance="stroke"
120
+ theme="light"
121
+ className="alert-dialog-panel-button"
122
+ onClick={onCancel}
123
+ >
124
+ {cancelLabel}
125
+ </ButtonV01>
126
+ );
127
+
128
+ const actionButton = (
129
+ <ButtonV01
130
+ type="button"
131
+ size={buttonSize}
132
+ typeVariant={actionIsCta(resolvedVariant) ? "cta" : "utility"}
133
+ hierarchy="primary"
134
+ appearance={actionIsCta(resolvedVariant) ? "gradient" : "solid"}
135
+ className={cn(
136
+ "alert-dialog-panel-button",
137
+ resolvedVariant === "destruction" &&
138
+ "alert-dialog-panel-button--destruction",
139
+ resolvedVariant === "success" && "alert-dialog-panel-button--success",
140
+ )}
141
+ onClick={onAction}
142
+ >
143
+ {actionLabel}
144
+ </ButtonV01>
145
+ );
146
+
147
+ return (
148
+ <div
149
+ ref={ref}
150
+ className={cn(alertDialogPanelVariants({ variant, size }), className)}
151
+ {...props}
152
+ >
153
+ <div className="alert-dialog-panel-text">
154
+ <TitleTag
155
+ className={cn(
156
+ "alert-dialog-panel-title",
157
+ titleTypography[resolvedSize],
158
+ )}
159
+ >
160
+ {title}
161
+ </TitleTag>
162
+ {showDescription && description ? (
163
+ <DescriptionTag
164
+ className={cn(
165
+ "alert-dialog-panel-description",
166
+ descriptionTypography[resolvedSize],
167
+ bodyFontClass,
168
+ )}
169
+ >
170
+ {description}
171
+ </DescriptionTag>
172
+ ) : null}
173
+ </div>
174
+
175
+ {children ?? (
176
+ <div className="alert-dialog-panel-actions">
177
+ {asPrimitive ? (
178
+ <>
179
+ <AlertDialogPrimitive.Cancel asChild>
180
+ {cancelButton}
181
+ </AlertDialogPrimitive.Cancel>
182
+ <AlertDialogPrimitive.Action asChild>
183
+ {actionButton}
184
+ </AlertDialogPrimitive.Action>
185
+ </>
186
+ ) : (
187
+ <>
188
+ {cancelButton}
189
+ {actionButton}
190
+ </>
191
+ )}
192
+ </div>
193
+ )}
194
+ </div>
195
+ );
196
+ },
197
+ );
198
+ AlertDialogPanelSurface.displayName = "AlertDialogPanelSurface";
199
+
200
+ // ---------------------------------------------------------------------------
201
+ // Modal — Radix-backed dialog wrapping the surface
202
+ // ---------------------------------------------------------------------------
203
+
204
+ interface AlertDialogPanelProps
205
+ extends Omit<AlertDialogPanelSurfaceProps, "asPrimitive"> {
206
+ open?: boolean;
207
+ defaultOpen?: boolean;
208
+ onOpenChange?: (open: boolean) => void;
209
+ trigger?: React.ReactNode;
210
+ }
211
+
212
+ const AlertDialogPanel = ({
213
+ open,
214
+ defaultOpen,
215
+ onOpenChange,
216
+ trigger,
217
+ ...surfaceProps
218
+ }: AlertDialogPanelProps) => (
219
+ <AlertDialogPrimitive.Root
220
+ open={open}
221
+ defaultOpen={defaultOpen}
222
+ onOpenChange={onOpenChange}
223
+ >
224
+ {trigger ? (
225
+ <AlertDialogPrimitive.Trigger asChild>
226
+ {trigger}
227
+ </AlertDialogPrimitive.Trigger>
228
+ ) : null}
229
+ <AlertDialogPrimitive.Portal>
230
+ <AlertDialogPrimitive.Overlay className="alert-dialog-panel-overlay" />
231
+ <AlertDialogPrimitive.Content className="alert-dialog-panel-positioner">
232
+ <AlertDialogPanelSurface asPrimitive {...surfaceProps} />
233
+ </AlertDialogPrimitive.Content>
234
+ </AlertDialogPrimitive.Portal>
235
+ </AlertDialogPrimitive.Root>
236
+ );
237
+ AlertDialogPanel.displayName = "AlertDialogPanel";
238
+
239
+ export { AlertDialogPanel, AlertDialogPanelSurface, alertDialogPanelVariants };
240
+
241
+ export type {
242
+ AlertDialogPanelProps,
243
+ AlertDialogPanelSurfaceProps,
244
+ AlertDialogPanelVariant,
245
+ AlertDialogPanelSize,
246
+ };
@@ -0,0 +1,214 @@
1
+ import * as React from "react";
2
+ import { cva, type VariantProps } from "class-variance-authority";
3
+
4
+ import { cn } from "@/lib/utils";
5
+ import { ButtonV01 } from "@/components/ui/button-v01";
6
+ import { AvatarIdentity } from "@/components/ui/avatar-identity";
7
+ import iconDone from "@/assets/alert/icon-done.svg";
8
+ import iconClear from "@/assets/alert/icon-clear.svg";
9
+
10
+ const alertV02Variants = cva("alert-v02 font-mazzardSoft", {
11
+ variants: {
12
+ variant: {
13
+ solid: "alert-v02--solid",
14
+ subtle: "alert-v02--subtle",
15
+ outline: "alert-v02--outline",
16
+ },
17
+ size: {
18
+ large: "alert-v02--large",
19
+ small: "alert-v02--small",
20
+ },
21
+ color: {
22
+ default: "alert-v02--default",
23
+ success: "alert-v02--success",
24
+ error: "alert-v02--error",
25
+ },
26
+ },
27
+ defaultVariants: {
28
+ variant: "solid",
29
+ size: "large",
30
+ color: "default",
31
+ },
32
+ });
33
+
34
+ export type AlertV02Variant = NonNullable<
35
+ VariantProps<typeof alertV02Variants>["variant"]
36
+ >;
37
+ export type AlertV02Size = NonNullable<
38
+ VariantProps<typeof alertV02Variants>["size"]
39
+ >;
40
+ export type AlertV02Color = NonNullable<
41
+ VariantProps<typeof alertV02Variants>["color"]
42
+ >;
43
+ export type AlertV02Indicator = "icon" | "avatar";
44
+
45
+ function MaskIcon({
46
+ src,
47
+ className,
48
+ }: {
49
+ src: string;
50
+ className?: string;
51
+ }) {
52
+ return (
53
+ <span
54
+ className={cn("alert-v02-mask-icon", className)}
55
+ style={{
56
+ WebkitMaskImage: `url(${src})`,
57
+ maskImage: `url(${src})`,
58
+ }}
59
+ aria-hidden
60
+ />
61
+ );
62
+ }
63
+
64
+ export interface AlertV02Props
65
+ extends Omit<React.HTMLAttributes<HTMLDivElement>, "color" | "title">,
66
+ VariantProps<typeof alertV02Variants> {
67
+ /** Figma `indicator`. */
68
+ indicator?: AlertV02Indicator;
69
+ /** Figma `action` — shows Confirm (and Cancel on large). */
70
+ action?: boolean;
71
+ title?: React.ReactNode;
72
+ description?: React.ReactNode;
73
+ confirmLabel?: React.ReactNode;
74
+ cancelLabel?: React.ReactNode;
75
+ onConfirm?: () => void;
76
+ onCancel?: () => void;
77
+ onDismiss?: () => void;
78
+ /** Replace the default checkmark. */
79
+ icon?: React.ReactNode;
80
+ /** Replace the default avatar. */
81
+ avatar?: React.ReactNode;
82
+ avatarSrc?: string;
83
+ avatarAlt?: string;
84
+ }
85
+
86
+ const AlertV02 = React.forwardRef<HTMLDivElement, AlertV02Props>(
87
+ (
88
+ {
89
+ className,
90
+ variant = "solid",
91
+ size = "large",
92
+ color = "default",
93
+ indicator = "icon",
94
+ action = true,
95
+ title,
96
+ description,
97
+ confirmLabel = "Confirm",
98
+ cancelLabel = "Cancel",
99
+ onConfirm,
100
+ onCancel,
101
+ onDismiss,
102
+ icon,
103
+ avatar,
104
+ avatarSrc,
105
+ avatarAlt,
106
+ children,
107
+ ...props
108
+ },
109
+ ref,
110
+ ) => {
111
+ const isLarge = size !== "small";
112
+ const showDescription = isLarge && description != null && description !== "";
113
+ const showCancel = isLarge && action;
114
+ const heading = title ?? children;
115
+
116
+ const indicatorNode =
117
+ indicator === "avatar"
118
+ ? (avatar ?? (
119
+ <AvatarIdentity
120
+ className="alert-v02-avatar"
121
+ size="medium"
122
+ variant={avatarSrc ? "image" : "placeholder"}
123
+ src={avatarSrc}
124
+ alt={avatarAlt}
125
+ showText={false}
126
+ />
127
+ ))
128
+ : (icon ?? (
129
+ <span className="alert-v02-indicator">
130
+ <MaskIcon src={iconDone} className="alert-v02-icon-done" />
131
+ </span>
132
+ ));
133
+
134
+ const dismissButton = (
135
+ <button
136
+ type="button"
137
+ className="alert-v02-dismiss"
138
+ aria-label="Dismiss"
139
+ onClick={onDismiss}
140
+ >
141
+ <MaskIcon src={iconClear} className="alert-v02-icon-clear" />
142
+ </button>
143
+ );
144
+
145
+ const confirmButton = (
146
+ <ButtonV01
147
+ type="button"
148
+ size="small"
149
+ typeVariant="utility"
150
+ hierarchy="primary"
151
+ appearance="solid"
152
+ context="general"
153
+ className="alert-v02-button"
154
+ onClick={onConfirm}
155
+ >
156
+ {confirmLabel}
157
+ </ButtonV01>
158
+ );
159
+
160
+ const cancelButton = (
161
+ <ButtonV01
162
+ type="button"
163
+ size="small"
164
+ typeVariant="utility"
165
+ hierarchy="tertiary"
166
+ appearance="stroke"
167
+ theme="light"
168
+ context="general"
169
+ className="alert-v02-button"
170
+ onClick={onCancel}
171
+ >
172
+ {cancelLabel}
173
+ </ButtonV01>
174
+ );
175
+
176
+ return (
177
+ <div
178
+ ref={ref}
179
+ role="alert"
180
+ className={cn(alertV02Variants({ variant, size, color }), className)}
181
+ {...props}
182
+ >
183
+ {indicatorNode}
184
+
185
+ {isLarge ? (
186
+ <div className="alert-v02-content">
187
+ <div className="alert-v02-heading">
188
+ <h5 className="alert-v02-title">{heading}</h5>
189
+ {dismissButton}
190
+ </div>
191
+ {showDescription ? (
192
+ <div className="alert-v02-description">{description}</div>
193
+ ) : null}
194
+ {action ? (
195
+ <div className="alert-v02-actions">
196
+ {confirmButton}
197
+ {showCancel ? cancelButton : null}
198
+ </div>
199
+ ) : null}
200
+ </div>
201
+ ) : (
202
+ <>
203
+ <h5 className="alert-v02-title">{heading}</h5>
204
+ {action ? confirmButton : null}
205
+ {dismissButton}
206
+ </>
207
+ )}
208
+ </div>
209
+ );
210
+ },
211
+ );
212
+ AlertV02.displayName = "AlertV02";
213
+
214
+ export { AlertV02, alertV02Variants };