@syscore/ui-library 2.0.0-beta-publish-workflow-beta.16 → 2.0.0-beta-publish-workflow-beta.17

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 (269) hide show
  1. package/client/components/icons/IconUtility.tsx +353 -0
  2. package/client/components/icons/X.tsx +4 -3
  3. package/client/components/ui/alert-v02.tsx +2 -6
  4. package/client/components/ui/button-v01.tsx +2 -12
  5. package/client/components/ui/button.tsx +39 -3
  6. package/client/components/ui/dropdown.tsx +2 -12
  7. package/client/components/ui/navigation.tsx +25 -4
  8. package/client/components/ui/radio-v01.tsx +84 -0
  9. package/client/components/ui/search-field-v01.tsx +10 -28
  10. package/client/components/ui/section-heading.tsx +1 -1
  11. package/client/components/ui/sign-in-field-v01.tsx +150 -0
  12. package/client/global.css +354 -73
  13. package/client/lib/system-icons.ts +1583 -0
  14. package/client/lib/utility-icons.ts +121 -0
  15. package/client/ui/Button.stories.tsx +63 -0
  16. package/client/ui/Colors.stories.tsx +34 -31
  17. package/client/ui/Icons.stories.tsx +179 -0
  18. package/client/ui/RadioGroup/RadioGroup.stories.tsx +1 -1
  19. package/client/ui/RadioV01/RadioV01.stories.tsx +136 -0
  20. package/client/ui/SearchField/SearchField.stories.tsx +4 -1
  21. package/client/ui/TextAreaV01/TextAreaV01.stories.tsx +23 -2
  22. package/client/ui/TextFieldV01/PasswordFieldV01.stories.tsx +25 -11
  23. package/client/ui/TextFieldV01/SignInFieldV01.stories.tsx +196 -0
  24. package/dist/client/assets/alert/icon-clear.svg.js +4 -0
  25. package/dist/client/assets/alert/icon-done.svg.js +4 -0
  26. package/dist/client/assets/avatar-identity/placeholder-icon.svg.js +4 -0
  27. package/dist/client/assets/breadcrumb/icon-ellipsis.svg.js +4 -0
  28. package/dist/client/assets/breadcrumb/icon-home.svg.js +4 -0
  29. package/dist/client/assets/breadcrumb/icon-separator.svg.js +4 -0
  30. package/dist/client/assets/button-v01/icon-back.svg.js +4 -0
  31. package/dist/client/assets/button-v01/icon-check.svg.js +4 -0
  32. package/dist/client/assets/button-v01/icon-close.svg.js +4 -0
  33. package/dist/client/assets/button-v01/icon-delete.svg.js +4 -0
  34. package/dist/client/assets/button-v01/icon-device.svg.js +4 -0
  35. package/dist/client/assets/dropdown/icon-carrot-contract.svg.js +4 -0
  36. package/dist/client/assets/dropdown/icon-carrot-expand.svg.js +4 -0
  37. package/dist/client/assets/dropdown/icon-clear.svg.js +4 -0
  38. package/dist/client/assets/dropdown/icon-enter.svg.js +4 -0
  39. package/dist/client/components/icons/AlphaIcon.js +129 -0
  40. package/dist/client/components/icons/ConceptIcons.js +905 -0
  41. package/dist/client/components/icons/IconUtility.js +410 -0
  42. package/dist/client/components/icons/NavAccount.js +37 -0
  43. package/dist/client/components/icons/NavBullet.js +17 -0
  44. package/dist/client/components/icons/NavLogo.js +48 -0
  45. package/dist/client/components/icons/StandardLogo.js +93 -0
  46. package/dist/client/components/icons/UtilityAccordion.js +27 -0
  47. package/dist/client/components/icons/UtilityChangeType.js +26 -0
  48. package/dist/client/components/icons/UtilityCheck.js +28 -0
  49. package/dist/client/components/icons/UtilityChevronDown.js +39 -0
  50. package/dist/client/components/icons/UtilityClassification.js +53 -0
  51. package/dist/client/components/icons/UtilityClearRegular.js +51 -0
  52. package/dist/client/components/icons/UtilityClose.js +49 -0
  53. package/dist/client/components/icons/UtilityCompare.js +91 -0
  54. package/dist/client/components/icons/UtilityDrag.js +89 -0
  55. package/dist/client/components/icons/UtilityEdit.js +50 -0
  56. package/dist/client/components/icons/UtilityFeedback.js +38 -0
  57. package/dist/client/components/icons/UtilityHome.js +34 -0
  58. package/dist/client/components/icons/UtilityMessage.js +41 -0
  59. package/dist/client/components/icons/UtilityOptions.js +53 -0
  60. package/dist/client/components/icons/UtilityPortfolio.js +116 -0
  61. package/dist/client/components/icons/UtilityReset.js +49 -0
  62. package/dist/client/components/icons/UtilityRevisionsHide.js +76 -0
  63. package/dist/client/components/icons/UtilityRevisionsShow.js +56 -0
  64. package/dist/client/components/icons/UtilitySave.js +38 -0
  65. package/dist/client/components/icons/UtilityScopeLarge.js +123 -0
  66. package/dist/client/components/icons/UtilityScoring.js +51 -0
  67. package/dist/client/components/icons/UtilitySearch.js +46 -0
  68. package/dist/client/components/icons/UtilityShow.js +49 -0
  69. package/dist/client/components/icons/UtilitySort.js +63 -0
  70. package/dist/client/components/icons/UtilityTarget.js +29 -0
  71. package/dist/client/components/icons/UtilityTargetActive.js +48 -0
  72. package/dist/client/components/icons/UtilityText.js +59 -0
  73. package/dist/client/components/icons/UtilityTrash.js +66 -0
  74. package/dist/client/components/icons/UtilityTriangleInfo.js +38 -0
  75. package/dist/client/components/icons/X.js +40 -0
  76. package/dist/client/components/icons/achievement-badges/BadgeCertificationBronze.js +144 -0
  77. package/dist/client/components/icons/achievement-badges/BadgeCertificationGold.js +144 -0
  78. package/dist/client/components/icons/achievement-badges/BadgeCertificationPlatinum.js +144 -0
  79. package/dist/client/components/icons/achievement-badges/BadgeCertificationSilver.js +144 -0
  80. package/dist/client/components/icons/achievement-badges/BadgeRatingCoworking.js +91 -0
  81. package/dist/client/components/icons/achievement-badges/BadgeRatingDesign.js +91 -0
  82. package/dist/client/components/icons/achievement-badges/BadgeRatingEquity.js +91 -0
  83. package/dist/client/components/icons/achievement-badges/BadgeRatingHealthySafety.js +93 -0
  84. package/dist/client/components/icons/achievement-badges/BadgeRatingOperations.js +93 -0
  85. package/dist/client/components/icons/achievement-badges/BadgeRatingPerformance.js +93 -0
  86. package/dist/client/components/icons/achievement-badges/BadgeRatingRealEstate.js +93 -0
  87. package/dist/client/components/icons/achievement-badges/BadgeRatingResidential.js +93 -0
  88. package/dist/client/components/icons/achievement-badges/BadgeRatingWorkforce.js +91 -0
  89. package/dist/client/components/icons/imperative-badges/BadgeImperativePrimary.js +58 -0
  90. package/dist/client/components/icons/imperative-badges/BadgeImperativeSecondary.js +69 -0
  91. package/dist/client/components/icons/provider-badges/BadgeEnterpriseProvider.js +117 -0
  92. package/dist/client/components/icons/provider-badges/BadgePerformanceTestingProvider.js +124 -0
  93. package/dist/client/components/icons/provider-badges/BadgeProductProvider.js +117 -0
  94. package/dist/client/components/icons/provider-badges/BadgeSurveyProvider.js +117 -0
  95. package/dist/client/components/icons/provider-seals/SealEnterpriseProvider.js +100 -0
  96. package/dist/client/components/icons/provider-seals/SealPerformanceTestingProvider.js +100 -0
  97. package/dist/client/components/icons/provider-seals/SealProductProvider.js +98 -0
  98. package/dist/client/components/icons/provider-seals/SealProviders.js +98 -0
  99. package/dist/client/components/icons/provider-seals/SealSurveyProvider.js +98 -0
  100. package/dist/client/components/icons/seals/IWBILogo.js +301 -0
  101. package/dist/client/components/icons/seals/SealCertification.js +206 -0
  102. package/dist/client/components/icons/seals/SealCertificationBronze.js +140 -0
  103. package/dist/client/components/icons/seals/SealCertificationGold.js +140 -0
  104. package/dist/client/components/icons/seals/SealCertificationPlatinum.js +140 -0
  105. package/dist/client/components/icons/seals/SealCertificationSilver.js +140 -0
  106. package/dist/client/components/icons/seals/SealIwbiMember.js +134 -0
  107. package/dist/client/components/icons/seals/SealRating.js +157 -0
  108. package/dist/client/components/icons/seals/SealRatingCoworking.js +89 -0
  109. package/dist/client/components/icons/seals/SealRatingDesign.js +89 -0
  110. package/dist/client/components/icons/seals/SealRatingEquity.js +89 -0
  111. package/dist/client/components/icons/seals/SealRatingHealthSafety.js +91 -0
  112. package/dist/client/components/icons/seals/SealRatingOperations.js +89 -0
  113. package/dist/client/components/icons/seals/SealRatingPerformance.js +91 -0
  114. package/dist/client/components/icons/seals/SealRatingRealEstate.js +89 -0
  115. package/dist/client/components/icons/seals/SealRatingWorkforce.js +89 -0
  116. package/dist/client/components/icons/seals/SealWell.js +132 -0
  117. package/dist/client/components/icons/seals/SealWellCertification.js +225 -0
  118. package/dist/client/components/icons/seals/SealWellCommunity.js +197 -0
  119. package/dist/client/components/icons/seals/SealWellResidence.js +197 -0
  120. package/dist/client/components/icons/seals/SealWorksWithWell.js +227 -0
  121. package/dist/client/components/icons/seals/WaterMarkWWWProducts.js +27 -0
  122. package/dist/client/components/icons/seals/WaterMarkWellProjects.js +36 -0
  123. package/dist/client/components/icons/seals/WatermarkMemberOrg.js +24 -0
  124. package/dist/client/components/ui/accordion.js +326 -0
  125. package/dist/client/components/ui/alert-dialog-panel.js +156 -0
  126. package/dist/client/components/ui/alert-dialog.js +103 -0
  127. package/dist/client/components/ui/alert-v02.js +157 -0
  128. package/dist/client/components/ui/alert.js +55 -0
  129. package/dist/client/components/ui/app-bar.js +203 -0
  130. package/dist/client/components/ui/aspect-ratio.js +5 -0
  131. package/dist/client/components/ui/avatar-identity.js +93 -0
  132. package/dist/client/components/ui/avatar.js +56 -0
  133. package/dist/client/components/ui/back-link.js +27 -0
  134. package/dist/client/components/ui/banner.js +75 -0
  135. package/dist/client/components/ui/bottom-navigation.js +127 -0
  136. package/dist/client/components/ui/breadcrumb-trail.js +137 -0
  137. package/dist/client/components/ui/breadcrumb.js +91 -0
  138. package/dist/client/components/ui/button-v01.js +173 -0
  139. package/dist/client/components/ui/button.js +99 -0
  140. package/dist/client/components/ui/calendar.js +62 -0
  141. package/dist/client/components/ui/card.js +177 -0
  142. package/dist/client/components/ui/carousel.js +198 -0
  143. package/dist/client/components/ui/centered-page.js +10 -0
  144. package/dist/client/components/ui/chart.js +239 -0
  145. package/dist/client/components/ui/checkbox-field.js +39 -0
  146. package/dist/client/components/ui/checkbox.js +18 -0
  147. package/dist/client/components/ui/code-badge.js +29 -0
  148. package/dist/client/components/ui/collapsible.js +9 -0
  149. package/dist/client/components/ui/command.js +79 -0
  150. package/dist/client/components/ui/context-menu.js +138 -0
  151. package/dist/client/components/ui/copy.js +39 -0
  152. package/dist/client/components/ui/credit-card-preview.js +74 -0
  153. package/dist/client/components/ui/data-grid.js +156 -0
  154. package/dist/client/components/ui/date-picker.js +142 -0
  155. package/dist/client/components/ui/dialog.js +179 -0
  156. package/dist/client/components/ui/drawer.js +95 -0
  157. package/dist/client/components/ui/drop-zone.js +87 -0
  158. package/dist/client/components/ui/dropdown-menu.js +139 -0
  159. package/dist/client/components/ui/dropdown.js +339 -0
  160. package/dist/client/components/ui/empty-state.js +76 -0
  161. package/dist/client/components/ui/field-group.js +32 -0
  162. package/dist/client/components/ui/file-upload-trigger.js +70 -0
  163. package/dist/client/components/ui/file-upload.js +171 -0
  164. package/dist/client/components/ui/footer.js +97 -0
  165. package/dist/client/components/ui/form.js +109 -0
  166. package/dist/client/components/ui/height-container.js +41 -0
  167. package/dist/client/components/ui/hero-section.js +44 -0
  168. package/dist/client/components/ui/hero-split-image.js +45 -0
  169. package/dist/client/components/ui/hover-card.js +22 -0
  170. package/dist/client/components/ui/icon-button.js +30 -0
  171. package/dist/client/components/ui/inline-notice.js +19 -0
  172. package/dist/client/components/ui/input-otp.js +46 -0
  173. package/dist/client/components/ui/input.js +37 -0
  174. package/dist/client/components/ui/label.js +31 -0
  175. package/dist/client/components/ui/labeled-divider.js +23 -0
  176. package/dist/client/components/ui/layout.js +724 -0
  177. package/dist/client/components/ui/menubar.js +157 -0
  178. package/dist/client/components/ui/meta-row.js +19 -0
  179. package/dist/client/components/ui/mobile-nav.js +230 -0
  180. package/dist/client/components/ui/modal-panel.js +116 -0
  181. package/dist/client/components/ui/navigation-menu.js +89 -0
  182. package/dist/client/components/ui/navigation.js +452 -0
  183. package/dist/client/components/ui/outline-node.js +57 -0
  184. package/dist/client/components/ui/page-header.js +79 -0
  185. package/dist/client/components/ui/pagination-v01.js +124 -0
  186. package/dist/client/components/ui/pagination.js +105 -0
  187. package/dist/client/components/ui/password-field-v01.js +46 -0
  188. package/dist/client/components/ui/pill-button.js +34 -0
  189. package/dist/client/components/ui/popover.js +22 -0
  190. package/dist/client/components/ui/price-tag.js +20 -0
  191. package/dist/client/components/ui/profile-avatar.js +92 -0
  192. package/dist/client/components/ui/progress.js +23 -0
  193. package/dist/client/components/ui/radio-card.js +30 -0
  194. package/dist/client/components/ui/radio-group.js +32 -0
  195. package/dist/client/components/ui/radio-v01.js +58 -0
  196. package/dist/client/components/ui/resizable.js +32 -0
  197. package/dist/client/components/ui/resource-thumbnail.js +24 -0
  198. package/dist/client/components/ui/scroll-area.js +37 -0
  199. package/dist/client/components/ui/search-field-v01.js +111 -0
  200. package/dist/client/components/ui/search.js +109 -0
  201. package/dist/client/components/ui/section-badge.js +22 -0
  202. package/dist/client/components/ui/section-heading.js +21 -0
  203. package/dist/client/components/ui/select.js +96 -0
  204. package/dist/client/components/ui/separator.js +24 -0
  205. package/dist/client/components/ui/sheet.js +106 -0
  206. package/dist/client/components/ui/side-nav.js +173 -0
  207. package/dist/client/components/ui/sidebar.js +580 -0
  208. package/dist/client/components/ui/sign-in-field-v01.js +107 -0
  209. package/dist/client/components/ui/skeleton.js +17 -0
  210. package/dist/client/components/ui/slider.js +20 -0
  211. package/dist/client/components/ui/social-button.js +34 -0
  212. package/dist/client/components/ui/standard-navigation.js +454 -0
  213. package/dist/client/components/ui/status-pill.js +42 -0
  214. package/dist/client/components/ui/stepper.js +111 -0
  215. package/dist/client/components/ui/switch-v01.js +39 -0
  216. package/dist/client/components/ui/switch.js +17 -0
  217. package/dist/client/components/ui/system-bar.js +76 -0
  218. package/dist/client/components/ui/table.js +107 -0
  219. package/dist/client/components/ui/tabs-v01.js +74 -0
  220. package/dist/client/components/ui/tabs.js +253 -0
  221. package/dist/client/components/ui/tag-v02.js +85 -0
  222. package/dist/client/components/ui/tag.js +73 -0
  223. package/dist/client/components/ui/text-area-v01.js +26 -0
  224. package/dist/client/components/ui/text-field-v01.js +78 -0
  225. package/dist/client/components/ui/text-link.js +23 -0
  226. package/dist/client/components/ui/textarea.js +19 -0
  227. package/dist/client/components/ui/timeline.js +87 -0
  228. package/dist/client/components/ui/toast-v01.js +155 -0
  229. package/dist/client/components/ui/toast.js +88 -0
  230. package/dist/client/components/ui/toaster.js +22 -0
  231. package/dist/client/components/ui/toggle.js +56 -0
  232. package/dist/client/components/ui/tooltip.js +328 -0
  233. package/dist/client/components/ui/typography.js +119 -0
  234. package/dist/client/hooks/use-mobile.js +20 -0
  235. package/dist/client/hooks/use-segmented-control.js +32 -0
  236. package/dist/client/hooks/use-tabs.js +22 -0
  237. package/dist/client/hooks/use-toast.js +122 -0
  238. package/dist/client/lib/concept-colors.js +74 -0
  239. package/dist/client/lib/concept-icons.js +32 -0
  240. package/dist/client/lib/utility-icons.js +73 -0
  241. package/dist/client/lib/utils.js +13 -0
  242. package/dist/index.cjs +1 -0
  243. package/dist/index.d.ts +156 -0
  244. package/dist/ui/index.js +774 -0
  245. package/package.json +9 -6
  246. package/dist/index.cjs.js +0 -1
  247. package/dist/index.es.js +0 -18989
  248. /package/{dist → client}/fonts/FT-Made/FTMade-Regular.otf +0 -0
  249. /package/{dist → client}/fonts/FT-Made/FTMade-Regular.ttf +0 -0
  250. /package/{dist → client}/fonts/FT-Made/FTMade-Regular.woff +0 -0
  251. /package/{dist → client}/fonts/FT-Made/FTMade-Regular.woff2 +0 -0
  252. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-black.otf +0 -0
  253. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-blackitalic.otf +0 -0
  254. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-bold.otf +0 -0
  255. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-bolditalic.otf +0 -0
  256. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-extrabold.otf +0 -0
  257. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-extrabolditalic.otf +0 -0
  258. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-extralight.otf +0 -0
  259. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-extralightitalic.otf +0 -0
  260. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-italic.otf +0 -0
  261. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-light.otf +0 -0
  262. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-lightitalic.otf +0 -0
  263. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-medium.otf +0 -0
  264. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-mediumitalic.otf +0 -0
  265. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-regular.otf +0 -0
  266. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-semibold.otf +0 -0
  267. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-semibolditalic.otf +0 -0
  268. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-thin.otf +0 -0
  269. /package/{dist → client}/fonts/Mazzard-M/mazzardsoftm-thinitalic.otf +0 -0
@@ -0,0 +1,353 @@
1
+ import React from "react";
2
+
3
+ import { cn } from "../../lib/utils";
4
+
5
+ interface IconUtilityProps {
6
+ className?: string;
7
+ }
8
+
9
+ const IconSlot = ({
10
+ className,
11
+ width,
12
+ height,
13
+ viewBox,
14
+ children,
15
+ }: IconUtilityProps & {
16
+ width: number | string;
17
+ height: number | string;
18
+ viewBox: string;
19
+ children: React.ReactNode;
20
+ }) => (
21
+ <span className={cn("icon-utility", className)}>
22
+ <svg
23
+ width={width}
24
+ height={height}
25
+ viewBox={viewBox}
26
+ fill="none"
27
+ xmlns="http://www.w3.org/2000/svg"
28
+ aria-hidden="true"
29
+ focusable="false"
30
+ >
31
+ {children}
32
+ </svg>
33
+ </span>
34
+ );
35
+
36
+ const stroke = {
37
+ stroke: "currentColor",
38
+ strokeWidth: 1.5,
39
+ strokeLinecap: "round" as const,
40
+ strokeLinejoin: "round" as const,
41
+ };
42
+
43
+ export const IconUtilityClose: React.FC<IconUtilityProps> = ({ className }) => (
44
+ <IconSlot className={className} width="11.1" height="11.1" viewBox="0 0 11.1 11.1">
45
+ <path d="M10.35 0.75L0.75 10.35" {...stroke} />
46
+ <path d="M0.75 0.75L10.35 10.35" {...stroke} />
47
+ </IconSlot>
48
+ );
49
+
50
+ export const IconUtilityCheck: React.FC<IconUtilityProps> = ({ className }) => (
51
+ <IconSlot
52
+ className={className}
53
+ width="12.7"
54
+ height="9.15217"
55
+ viewBox="0 0 12.7 9.15217"
56
+ >
57
+ <path d="M11.95 0.75L4.25 8.40217L0.75 4.92391" {...stroke} />
58
+ </IconSlot>
59
+ );
60
+
61
+ export const IconUtilityBack: React.FC<IconUtilityProps> = ({ className }) => (
62
+ <IconSlot className={className} width="13.3" height="13.3" viewBox="0 0 13.3 13.3">
63
+ <path d="M6.65 12.65L0.65 6.65L6.65 0.65" {...stroke} strokeWidth={1.3} />
64
+ <path d="M12.65 6.65H0.65" {...stroke} strokeWidth={1.3} />
65
+ </IconSlot>
66
+ );
67
+
68
+ export const IconUtilityDelete: React.FC<IconUtilityProps> = ({ className }) => (
69
+ <IconSlot
70
+ className={className}
71
+ width="14.1"
72
+ height="15.5"
73
+ viewBox="8.95 8.25 14.1 15.5"
74
+ >
75
+ <path
76
+ d="M20.9 11.8V21.6C20.9 21.9713 20.7525 22.3274 20.4899 22.5899C20.2274 22.8525 19.8713 23 19.5 23H12.5C12.1287 23 11.7726 22.8525 11.5101 22.5899C11.2475 22.3274 11.1 21.9713 11.1 21.6V11.8M9.7 11.8H22.3M13.2 11.8V10.4C13.2 10.0287 13.3475 9.6726 13.6101 9.41005C13.8726 9.1475 14.2287 9 14.6 9H17.4C17.7713 9 18.1274 9.1475 18.3899 9.41005C18.6525 9.6726 18.8 10.0287 18.8 10.4V11.8"
77
+ {...stroke}
78
+ />
79
+ </IconSlot>
80
+ );
81
+
82
+ export const IconUtilityExpand: React.FC<IconUtilityProps> = ({ className }) => (
83
+ <IconSlot className={className} width="16" height="16" viewBox="0 0 16 16">
84
+ <path d="M13 5.75L8 10.25L3 5.75" {...stroke} />
85
+ </IconSlot>
86
+ );
87
+
88
+ export const IconUtilityContract: React.FC<IconUtilityProps> = ({ className }) => (
89
+ <IconSlot className={className} width="16" height="16" viewBox="0 0 16 16">
90
+ <path d="M3 10.25L8 5.75L13 10.25" {...stroke} />
91
+ </IconSlot>
92
+ );
93
+
94
+ export const IconUtilityEdit: React.FC<IconUtilityProps> = ({ className }) => (
95
+ <IconSlot
96
+ className={className}
97
+ width="15.5002"
98
+ height="15.5"
99
+ viewBox="0 0 15.5002 15.5"
100
+ >
101
+ <path
102
+ d="M14.1721 4.11874C14.5422 3.74873 14.7501 3.24685 14.7502 2.72351C14.7503 2.20017 14.5424 1.69823 14.1724 1.32813C13.8024 0.958025 13.3005 0.750066 12.7772 0.75C12.2538 0.749934 11.7519 0.957768 11.3818 1.32778L2.03938 10.6723C1.87685 10.8343 1.75666 11.0339 1.68938 11.2533L0.764654 14.2998C0.746563 14.3603 0.745196 14.4246 0.7607 14.4859C0.776204 14.5471 0.808 14.603 0.852714 14.6477C0.897428 14.6923 0.953393 14.724 1.01467 14.7394C1.07595 14.7548 1.14025 14.7534 1.20076 14.7352L4.24793 13.8112C4.46716 13.7445 4.66666 13.625 4.82895 13.4633L14.1721 4.11874Z"
103
+ fill="#FFFFFF"
104
+ {...stroke}
105
+ />
106
+ <path d="M9.85021 2.8503L12.6503 5.65037" {...stroke} />
107
+ </IconSlot>
108
+ );
109
+
110
+ export const IconUtilityPreview: React.FC<IconUtilityProps> = ({ className }) => (
111
+ <IconSlot
112
+ className={className}
113
+ width="15.5"
114
+ height="11.2986"
115
+ viewBox="0 0 15.5 11.2986"
116
+ >
117
+ <path
118
+ d="M0.793752 5.89291C0.735416 5.73576 0.735416 5.56289 0.793752 5.40573C1.36191 4.0281 2.32633 2.85019 3.56475 2.02133C4.80317 1.19248 6.25981 0.75 7.75 0.75C9.24019 0.75 10.6968 1.19248 11.9352 2.02133C13.1737 2.85019 14.1381 4.0281 14.7062 5.40573C14.7646 5.56289 14.7646 5.73576 14.7062 5.89291C14.1381 7.27054 13.1737 8.44845 11.9352 9.27731C10.6968 10.1062 9.24019 10.5486 7.75 10.5486C6.25981 10.5486 4.80317 10.1062 3.56475 9.27731C2.32633 8.44845 1.36191 7.27054 0.793752 5.89291Z"
119
+ {...stroke}
120
+ />
121
+ <path
122
+ d="M7.75017 7.74944C8.90997 7.74944 9.85017 6.80924 9.85017 5.64944C9.85017 4.48965 8.90997 3.54944 7.75017 3.54944C6.59037 3.54944 5.65017 4.48965 5.65017 5.64944C5.65017 6.80924 6.59037 7.74944 7.75017 7.74944Z"
123
+ {...stroke}
124
+ />
125
+ </IconSlot>
126
+ );
127
+
128
+ export const IconUtilityHide: React.FC<IconUtilityProps> = ({ className }) => (
129
+ <IconSlot
130
+ className={className}
131
+ width="15.5004"
132
+ height="8.50036"
133
+ viewBox="0 0 15.5004 8.50036"
134
+ >
135
+ <path d="M9.85026 7.7502L9.34486 5.4752" {...stroke} />
136
+ <path
137
+ d="M0.750204 0.750204C1.27405 2.18575 2.22659 3.42553 3.47873 4.30151C4.73088 5.1775 6.22207 5.64733 7.7502 5.64733C9.27834 5.64733 10.7695 5.1775 12.0217 4.30151C13.2738 3.42553 14.2264 2.18575 14.7502 0.750204"
138
+ {...stroke}
139
+ />
140
+ <path d="M13.3502 5.65021L12.142 4.21521" {...stroke} />
141
+ <path d="M2.1502 5.65021L3.3584 4.21521" {...stroke} />
142
+ <path d="M5.6502 7.7502L6.1556 5.4752" {...stroke} />
143
+ </IconSlot>
144
+ );
145
+
146
+ export const IconUtilityHidden: React.FC<IconUtilityProps> = ({ className }) => (
147
+ <IconSlot
148
+ className={className}
149
+ width="15.5006"
150
+ height="15.5"
151
+ viewBox="0 0 15.5006 15.5"
152
+ >
153
+ <path
154
+ d="M6.86338 2.90319C8.49395 2.70888 10.1433 3.05357 11.5596 3.88463C12.9759 4.71569 14.0812 5.98745 14.7069 7.50569C14.7652 7.66286 14.7652 7.83573 14.7069 7.99289C14.4496 8.61659 14.1096 9.20285 13.6961 9.73589"
155
+ {...stroke}
156
+ />
157
+ <path
158
+ d="M9.20907 9.26061C8.813 9.64314 8.28254 9.85481 7.73192 9.85003C7.18131 9.84524 6.6546 9.62439 6.26525 9.23503C5.87589 8.84567 5.65503 8.31897 5.65025 7.76835C5.64547 7.21774 5.85713 6.68728 6.23967 6.29121"
159
+ {...stroke}
160
+ />
161
+ <path
162
+ d="M11.5857 11.5993C10.6571 12.1493 9.62108 12.4932 8.54791 12.6076C7.47474 12.7219 6.38952 12.6041 5.3659 12.2621C4.34227 11.9201 3.40419 11.3619 2.6153 10.6254C1.82641 9.8889 1.20518 8.99133 0.793754 7.99358C0.735415 7.83642 0.735415 7.66354 0.793754 7.50638C1.4144 6.00128 2.50642 4.73805 3.90595 3.90628"
163
+ {...stroke}
164
+ />
165
+ <path d="M0.750342 0.75L14.7503 14.75" {...stroke} />
166
+ </IconSlot>
167
+ );
168
+
169
+ export const IconUtilityCompare: React.FC<IconUtilityProps> = ({ className }) => (
170
+ <span className={cn("icon-utility", className)}>
171
+ <span
172
+ style={{
173
+ display: "flex",
174
+ width: "12.6px",
175
+ height: "14px",
176
+ alignItems: "center",
177
+ justifyContent: "center",
178
+ }}
179
+ >
180
+ <span style={{ flex: "none", transform: "rotate(90deg) scaleY(-1)" }}>
181
+ <svg
182
+ width="15.5"
183
+ height="14.1"
184
+ viewBox="0 0 15.5 14.1"
185
+ fill="none"
186
+ xmlns="http://www.w3.org/2000/svg"
187
+ aria-hidden="true"
188
+ focusable="false"
189
+ >
190
+ <path
191
+ d="M2.85001 4.95001C4.00981 4.95001 4.95001 4.0098 4.95001 2.85C4.95001 1.6902 4.00981 0.75 2.85001 0.75C1.6902 0.75 0.75 1.6902 0.75 2.85C0.75 4.0098 1.6902 4.95001 2.85001 4.95001Z"
192
+ fill="#E0FBF5"
193
+ {...stroke}
194
+ />
195
+ <path
196
+ d="M7.75002 2.85002H11.25C11.6213 2.85002 11.9774 2.99752 12.24 3.26008C12.5025 3.52263 12.65 3.87872 12.65 4.25003V9.15004"
197
+ {...stroke}
198
+ />
199
+ <path d="M9.85003 4.95001L7.75002 2.85L9.85003 0.75" {...stroke} />
200
+ <path
201
+ d="M12.65 13.35C13.8098 13.35 14.75 12.4098 14.75 11.25C14.75 10.0902 13.8098 9.14999 12.65 9.14999C11.4902 9.14999 10.55 10.0902 10.55 11.25C10.55 12.4098 11.4902 13.35 12.65 13.35Z"
202
+ fill="#EFF5FB"
203
+ {...stroke}
204
+ />
205
+ <path
206
+ d="M7.74994 11.25H4.24993C3.87862 11.25 3.52252 11.1025 3.25997 10.84C2.99742 10.5774 2.84992 10.2213 2.84992 9.85V4.95"
207
+ {...stroke}
208
+ />
209
+ <path d="M5.6501 9.14999L7.75011 11.25L5.6501 13.35" {...stroke} />
210
+ </svg>
211
+ </span>
212
+ </span>
213
+ </span>
214
+ );
215
+
216
+ export const IconUtilityRevision: React.FC<IconUtilityProps> = ({ className }) => (
217
+ <IconSlot
218
+ className={className}
219
+ width="16.5"
220
+ height="14.1315"
221
+ viewBox="0 0 16.5 14.1315"
222
+ >
223
+ <path
224
+ d="M5.48682 6.27629L0.75 11.0131V13.3815H7.85523L10.2236 11.0131"
225
+ fill="#F6EFD0"
226
+ />
227
+ <path
228
+ d="M5.48682 6.27629L0.75 11.0131V13.3815H7.85523L10.2236 11.0131"
229
+ {...stroke}
230
+ />
231
+ <path
232
+ d="M15.75 7.06576L12.1184 10.6973C11.8233 10.9866 11.4265 11.1487 11.0132 11.1487C10.5999 11.1487 10.2031 10.9866 9.90792 10.6973L5.80268 6.59208C5.51337 6.29693 5.35132 5.90011 5.35132 5.48682C5.35132 5.07353 5.51337 4.67671 5.80268 4.38156L9.43424 0.75"
233
+ {...stroke}
234
+ />
235
+ </IconSlot>
236
+ );
237
+
238
+ export const IconUtilityChange: React.FC<IconUtilityProps> = ({ className }) => (
239
+ <IconSlot
240
+ className={className}
241
+ width="13.5"
242
+ height="12.3001"
243
+ viewBox="0 0 13.5 12.3001"
244
+ >
245
+ <path
246
+ d="M7.78821 1.348C7.6827 1.16611 7.53127 1.01514 7.34906 0.910189C7.16685 0.80524 6.96027 0.75 6.75 0.75C6.53973 0.75 6.33315 0.80524 6.15094 0.910189C5.96873 1.01514 5.8173 1.16611 5.71179 1.348L0.910803 9.74972C0.805511 9.93209 0.750054 10.139 0.75 10.3495C0.749946 10.5601 0.805297 10.767 0.910495 10.9494C1.01569 11.1319 1.16703 11.2834 1.34932 11.3888C1.53161 11.4943 1.73843 11.5499 1.94902 11.5501H11.551C11.7616 11.5499 11.9684 11.4943 12.1507 11.3888C12.333 11.2834 12.4843 11.1319 12.5895 10.9494C12.6947 10.767 12.7501 10.5601 12.75 10.3495C12.7499 10.139 12.6945 9.93209 12.5892 9.74972L7.78821 1.348Z"
247
+ fill="#D6F4FB"
248
+ {...stroke}
249
+ />
250
+ </IconSlot>
251
+ );
252
+
253
+ export const IconUtilityMappedContent: React.FC<IconUtilityProps> = ({
254
+ className,
255
+ }) => (
256
+ <IconSlot
257
+ className={className}
258
+ width="15.5"
259
+ height="12.3889"
260
+ viewBox="0 0 15.5 12.3889"
261
+ >
262
+ <path d="M10.8611 0.75H0.75" {...stroke} />
263
+ <path d="M6.97222 6.19444H0.75" {...stroke} />
264
+ <path d="M10.8611 11.6389H0.75" {...stroke} />
265
+ <path d="M12.4167 3.86111V8.52778" {...stroke} />
266
+ <path d="M14.75 6.19444H10.0833" {...stroke} />
267
+ </IconSlot>
268
+ );
269
+
270
+ export const IconUtilityReset: React.FC<IconUtilityProps> = ({ className }) => (
271
+ <IconSlot className={className} width="15.5" height="15.5" viewBox="0 0 15.5 15.5">
272
+ <path
273
+ d="M14.75 7.75C14.75 9.13447 14.3395 10.4878 13.5703 11.639C12.8011 12.7901 11.7079 13.6873 10.4288 14.2172C9.1497 14.747 7.74224 14.8856 6.38437 14.6155C5.0265 14.3454 3.77922 13.6787 2.80026 12.6997C1.82129 11.7208 1.1546 10.4735 0.884507 9.11563C0.61441 7.75776 0.753033 6.3503 1.28285 5.07122C1.81266 3.79213 2.70987 2.69888 3.86101 1.92971C5.01216 1.16054 6.36553 0.75 7.75 0.75C9.71 0.75 11.5844 1.52778 12.9922 2.88111L14.75 4.63889"
274
+ {...stroke}
275
+ />
276
+ <path d="M14.75 0.75V4.63889H10.8611" {...stroke} />
277
+ </IconSlot>
278
+ );
279
+
280
+ export const IconUtilityChangeHide: React.FC<IconUtilityProps> = ({ className }) => (
281
+ <IconSlot
282
+ className={className}
283
+ width="15.9584"
284
+ height="12.3001"
285
+ viewBox="0 0 15.9584 12.3001"
286
+ >
287
+ <path
288
+ d="M7.78821 1.348C7.6827 1.16611 7.53127 1.01514 7.34906 0.910189C7.16685 0.80524 6.96027 0.75 6.75 0.75C6.53973 0.75 6.33315 0.80524 6.15094 0.910189C5.96873 1.01514 5.8173 1.16611 5.71179 1.348L0.910803 9.74972C0.805511 9.93209 0.750054 10.139 0.75 10.3495C0.749946 10.5601 0.805297 10.767 0.910495 10.9494C1.01569 11.1319 1.16703 11.2834 1.34932 11.3888C1.53161 11.4943 1.73843 11.5499 1.94902 11.5501H11.551C11.7616 11.5499 11.9684 11.4943 12.1507 11.3888C12.333 11.2834 12.4843 11.1319 12.5895 10.9494C12.6947 10.767 12.7501 10.5601 12.75 10.3495C12.7499 10.139 12.6945 9.93209 12.5892 9.74972L7.78821 1.348Z"
289
+ fill="#D6F4FB"
290
+ {...stroke}
291
+ />
292
+ <path d="M12.2385 3.94757L15.2084 0.977608" {...stroke} />
293
+ <path d="M12.2216 0.9776L15.1916 3.94756" {...stroke} />
294
+ </IconSlot>
295
+ );
296
+
297
+ export const IconUtilityMappedContentHide: React.FC<IconUtilityProps> = ({
298
+ className,
299
+ }) => (
300
+ <IconSlot
301
+ className={className}
302
+ width="14.8168"
303
+ height="12.3889"
304
+ viewBox="0 0 14.8168 12.3889"
305
+ >
306
+ <path d="M10.8611 0.75H0.75" {...stroke} />
307
+ <path d="M6.97222 6.19444H0.75" {...stroke} />
308
+ <path d="M10.8611 11.6389H0.75" {...stroke} />
309
+ <path d="M10.7667 4.54473L14.0665 7.84456" {...stroke} />
310
+ <path d="M14.0668 4.54453L10.7669 7.84436" {...stroke} />
311
+ </IconSlot>
312
+ );
313
+
314
+ export const IconUtilityRevisionHide: React.FC<IconUtilityProps> = ({ className }) => (
315
+ <IconSlot
316
+ className={className}
317
+ width="16.5"
318
+ height="14.1315"
319
+ viewBox="0 0 16.5 14.1315"
320
+ >
321
+ <path
322
+ d="M5.48682 6.27629L0.75 11.0131V13.3815H7.85523L10.2236 11.0131"
323
+ fill="#F6EFD0"
324
+ />
325
+ <path
326
+ d="M5.48682 6.27629L0.75 11.0131V13.3815H7.85523L10.2236 11.0131"
327
+ {...stroke}
328
+ />
329
+ <path
330
+ d="M15.75 7.06576L12.1184 10.6973C11.8233 10.9866 11.4265 11.1487 11.0132 11.1487C10.5999 11.1487 10.2031 10.9866 9.90792 10.6973L5.80268 6.59208C5.51337 6.29693 5.35132 5.90011 5.35132 5.48682C5.35132 5.07353 5.51337 4.67671 5.80268 4.38156L9.43424 0.75"
331
+ {...stroke}
332
+ />
333
+ <path d="M12.75 3.71997L15.72 0.750008" {...stroke} />
334
+ <path d="M12.75 0.75L15.72 3.71996" {...stroke} />
335
+ </IconSlot>
336
+ );
337
+
338
+ export const IconUtilityQuestion: React.FC<IconUtilityProps> = ({ className }) => (
339
+ <IconSlot className={className} width="15.5" height="15.5" viewBox="0 0 15.5 15.5">
340
+ <path
341
+ d="M7.75 14.75C11.616 14.75 14.75 11.616 14.75 7.75C14.75 3.88401 11.616 0.75 7.75 0.75C3.88401 0.75 0.75 3.88401 0.75 7.75C0.75 11.616 3.88401 14.75 7.75 14.75Z"
342
+ fill="#F7F2F6"
343
+ {...stroke}
344
+ />
345
+ <path
346
+ d="M5.71289 5.65001C5.87746 5.18218 6.2023 4.78769 6.62986 4.53641C7.05742 4.28513 7.56012 4.19327 8.04891 4.27711C8.53771 4.36095 8.98106 4.61508 9.30044 4.99448C9.61983 5.37389 9.79463 5.85408 9.79389 6.35001C9.79389 7.75001 7.69389 8.45001 7.69389 8.45001"
347
+ {...stroke}
348
+ />
349
+ <path d="M7.75 11.25H7.757" {...stroke} />
350
+ </IconSlot>
351
+ );
352
+
353
+ export type { IconUtilityProps };
@@ -4,13 +4,14 @@ import { cn } from "../../lib/utils";
4
4
  interface XProps {
5
5
  className?: string;
6
6
  color?: string;
7
+ size?: number | string;
7
8
  }
8
9
 
9
- export const X: React.FC<XProps> = ({ className = "", color = "#71747D" }) => {
10
+ export const X: React.FC<XProps> = ({ className = "", color = "#71747D", size = 10 }) => {
10
11
  return (
11
12
  <svg
12
- width="10"
13
- height="10"
13
+ width={size}
14
+ height={size}
14
15
  viewBox="0 0 10 10"
15
16
  fill="none"
16
17
  xmlns="http://www.w3.org/2000/svg"
@@ -53,8 +53,8 @@ function MaskIcon({
53
53
  <span
54
54
  className={cn("alert-v02-mask-icon", className)}
55
55
  style={{
56
- WebkitMaskImage: `url(${src})`,
57
- maskImage: `url(${src})`,
56
+ WebkitMaskImage: `url("${src}")`,
57
+ maskImage: `url("${src}")`,
58
58
  }}
59
59
  aria-hidden
60
60
  />
@@ -64,9 +64,7 @@ function MaskIcon({
64
64
  export interface AlertV02Props
65
65
  extends Omit<React.HTMLAttributes<HTMLDivElement>, "color" | "title">,
66
66
  VariantProps<typeof alertV02Variants> {
67
- /** Figma `indicator`. */
68
67
  indicator?: AlertV02Indicator;
69
- /** Figma `action` — shows Confirm (and Cancel on large). */
70
68
  action?: boolean;
71
69
  title?: React.ReactNode;
72
70
  description?: React.ReactNode;
@@ -75,9 +73,7 @@ export interface AlertV02Props
75
73
  onConfirm?: () => void;
76
74
  onCancel?: () => void;
77
75
  onDismiss?: () => void;
78
- /** Replace the default checkmark. */
79
76
  icon?: React.ReactNode;
80
- /** Replace the default avatar. */
81
77
  avatar?: React.ReactNode;
82
78
  avatarSrc?: string;
83
79
  avatarAlt?: string;
@@ -68,9 +68,6 @@ function resolveLook({
68
68
  return "button-v01--icon-light";
69
69
  }
70
70
 
71
- // `general`, `cancel`, `done` and `back` deliberately fall through: in Figma
72
- // they carry no look of their own. `general` resolves via Type/Hierarchy
73
- // below, and the other three only ever appear on Icon buttons, handled above.
74
71
  if (context === "floating") return "button-v01--floating";
75
72
  if (context === "confirm") return "button-v01--confirm";
76
73
  if (context === "error") return "button-v01--error";
@@ -106,8 +103,8 @@ function MaskIcon({
106
103
  <span
107
104
  className={cn("button-v01-mask", className)}
108
105
  style={{
109
- WebkitMaskImage: `url(${src})`,
110
- maskImage: `url(${src})`,
106
+ WebkitMaskImage: `url("${src}")`,
107
+ maskImage: `url("${src}")`,
111
108
  }}
112
109
  aria-hidden
113
110
  />
@@ -135,19 +132,12 @@ function defaultLabel({
135
132
  export interface ButtonV01Props
136
133
  extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "style">,
137
134
  VariantProps<typeof buttonV01Variants> {
138
- /** Figma `Type`. */
139
135
  typeVariant?: ButtonV01Type;
140
- /** Figma `Hierarchy`. */
141
136
  hierarchy?: ButtonV01Hierarchy;
142
- /** Figma `Style`. */
143
137
  appearance?: ButtonV01Appearance;
144
- /** Figma `Theme`. */
145
138
  theme?: ButtonV01Theme;
146
- /** Figma `Context`. `toolti` in the file maps to `tooltip`. */
147
139
  context?: ButtonV01Context;
148
- /** Figma `Icon`. Used when `typeVariant="icon"`. */
149
140
  icon?: ButtonV01Icon;
150
- /** Replace the built-in leading/icon glyph. */
151
141
  iconSlot?: React.ReactNode;
152
142
  }
153
143
 
@@ -49,6 +49,13 @@ const buttonVariants = cva(
49
49
  }
50
50
  );
51
51
 
52
+ type IconComponent = React.ComponentType<{
53
+ size?: number | string;
54
+ strokeWidth?: number;
55
+ className?: string;
56
+ "aria-hidden"?: boolean;
57
+ }>;
58
+
52
59
  export interface ButtonProps
53
60
  extends Omit<
54
61
  React.ButtonHTMLAttributes<HTMLButtonElement>,
@@ -58,6 +65,11 @@ export interface ButtonProps
58
65
  asChild?: boolean;
59
66
  ftMadeFont?: boolean;
60
67
  mazzardSoftFont?: boolean;
68
+ icon?: IconComponent;
69
+ iconPosition?: "leading" | "trailing";
70
+ iconGap?: "tight" | "normal";
71
+ /** Default `"asymmetric"` reduces padding only on the icon's side. `"symmetric"` keeps both sides equal to the size variant's own padding. */
72
+ iconPadding?: "asymmetric" | "symmetric";
61
73
  }
62
74
 
63
75
  const sizeTextClasses: Record<string, string> = {
@@ -68,13 +80,35 @@ const sizeTextClasses: Record<string, string> = {
68
80
  };
69
81
 
70
82
  const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
71
- ({ className, variant, size, ftMadeFont, mazzardSoftFont, children, style, ...props }, ref) => {
83
+ (
84
+ {
85
+ className,
86
+ variant,
87
+ size,
88
+ ftMadeFont,
89
+ mazzardSoftFont,
90
+ icon: Icon,
91
+ iconPosition = "leading",
92
+ iconGap = "tight",
93
+ iconPadding = "asymmetric",
94
+ children,
95
+ style,
96
+ ...props
97
+ },
98
+ ref,
99
+ ) => {
72
100
  const textClass = sizeTextClasses[size || "large"];
101
+ const iconEl = Icon ? (
102
+ <Icon size={16} strokeWidth={2} className="button-icon" aria-hidden={true} />
103
+ ) : null;
73
104
 
74
105
  return (
75
106
  <button
76
107
  className={cn(
77
108
  buttonVariants({ variant, size }),
109
+ Icon && iconPadding === "asymmetric" && iconPosition === "leading" && "button--has-icon-leading",
110
+ Icon && iconPadding === "asymmetric" && iconPosition === "trailing" && "button--has-icon-trailing",
111
+ Icon && iconGap === "normal" && "button--icon-gap-normal",
78
112
  ftMadeFont && "font-ftMade",
79
113
  mazzardSoftFont && "font-mazzardSoft",
80
114
  className,
@@ -86,8 +120,10 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
86
120
  {size === "icon" ? (
87
121
  children
88
122
  ) : (
89
- <span className={cn("button-text", textClass)}>
90
- {children}
123
+ <span className="button-text">
124
+ {iconPosition === "leading" ? iconEl : null}
125
+ <span className={textClass}>{children}</span>
126
+ {iconPosition === "trailing" ? iconEl : null}
91
127
  </span>
92
128
  )}
93
129
  </button>
@@ -14,20 +14,15 @@ export type DropdownOption = {
14
14
  actionLabel?: string;
15
15
  };
16
16
 
17
- /** Figma `icon_utility_change-type_*`. */
18
17
  export type DropdownTagChangeType = "mild" | "medium" | "hot";
19
18
 
20
- /** Figma `tags / tag`. */
21
19
  export type DropdownTag = {
22
20
  id: string;
23
21
  label: string;
24
- /** Renders `dot_branded_large`. */
25
22
  dot?: boolean;
26
- /** Renders one `icon_utility_change-type_*` glyph. */
27
23
  changeType?: DropdownTagChangeType;
28
24
  };
29
25
 
30
- /** Two-tone glyph, so it is inline rather than a masked `<img>`. */
31
26
  function ChangeTypeIcon({ kind }: { kind: DropdownTagChangeType }) {
32
27
  return (
33
28
  <UtilityChangeType
@@ -50,17 +45,12 @@ export type DropdownProps = Omit<
50
45
  error?: boolean;
51
46
  errorMessage?: string;
52
47
  disabled?: boolean;
53
- /** Force the menu open — used by Storybook state specimens. */
54
48
  open?: boolean;
55
49
  defaultOpen?: boolean;
56
50
  onOpenChange?: (open: boolean) => void;
57
- /** Seed the input text — used for typeahead / auto-suggest specimens. */
58
51
  defaultInputValue?: string;
59
- /** Figma `tags` row. Rendered between the label and the field. */
60
52
  tags?: DropdownTag[];
61
- /** Remove one tag. Omit to render tags as non-removable. */
62
53
  onTagRemove?: (id: string) => void;
63
- /** Clear-all control in the label row. Omit to hide it. */
64
54
  onClearTags?: () => void;
65
55
  name?: string;
66
56
  id?: string;
@@ -71,8 +61,8 @@ function MaskIcon({ src, className }: { src: string; className?: string }) {
71
61
  <span
72
62
  className={cn("dropdown-mask-icon", className)}
73
63
  style={{
74
- WebkitMaskImage: `url(${src})`,
75
- maskImage: `url(${src})`,
64
+ WebkitMaskImage: `url("${src}")`,
65
+ maskImage: `url("${src}")`,
76
66
  }}
77
67
  aria-hidden
78
68
  />
@@ -17,6 +17,7 @@ interface NavigationContextValue {
17
17
  setActiveIndex: (index: number | null) => void;
18
18
  setIsOpen: (open: boolean) => void;
19
19
  registerTrays: (trays: React.ReactNode[]) => void;
20
+ cancelClose: () => void;
20
21
  }
21
22
 
22
23
  const NavigationContext = React.createContext<NavigationContextValue | null>(
@@ -39,12 +40,29 @@ const Navigation = React.forwardRef<HTMLElement, NavigationProps>(
39
40
  const [isOpen, setIsOpen] = React.useState(false);
40
41
  const [activeIndex, setActiveIndex] = React.useState<number | null>(null);
41
42
  const [trays, setTrays] = React.useState<React.ReactNode[]>([]);
43
+ const closeTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);
44
+
45
+ // Delay nav close so pointer can reach the tray during the height animation.
46
+ const CLOSE_DELAY_MS = 150;
47
+
48
+ const cancelClose = React.useCallback(() => {
49
+ if (closeTimeoutRef.current !== null) {
50
+ clearTimeout(closeTimeoutRef.current);
51
+ closeTimeoutRef.current = null;
52
+ }
53
+ }, []);
42
54
 
43
55
  const handleMouseLeave = () => {
44
- setIsOpen(false);
45
- setActiveIndex(null);
56
+ cancelClose();
57
+ closeTimeoutRef.current = setTimeout(() => {
58
+ setIsOpen(false);
59
+ setActiveIndex(null);
60
+ closeTimeoutRef.current = null;
61
+ }, CLOSE_DELAY_MS);
46
62
  };
47
63
 
64
+ React.useEffect(() => () => cancelClose(), [cancelClose]);
65
+
48
66
  const registerTrays = React.useCallback((newTrays: React.ReactNode[]) => {
49
67
  setTrays(newTrays);
50
68
  }, []);
@@ -57,8 +75,9 @@ const Navigation = React.forwardRef<HTMLElement, NavigationProps>(
57
75
  setActiveIndex,
58
76
  setIsOpen,
59
77
  registerTrays,
78
+ cancelClose,
60
79
  }),
61
- [light, isOpen, activeIndex, registerTrays],
80
+ [light, isOpen, activeIndex, registerTrays, cancelClose],
62
81
  );
63
82
 
64
83
  return (
@@ -66,6 +85,7 @@ const Navigation = React.forwardRef<HTMLElement, NavigationProps>(
66
85
  <nav
67
86
  ref={ref}
68
87
  className={cn("navigation", light && "navigation--light", className)}
88
+ onMouseEnter={cancelClose}
69
89
  onMouseLeave={handleMouseLeave}
70
90
  {...props}
71
91
  >
@@ -344,11 +364,12 @@ const NavigationTray = React.forwardRef<HTMLDivElement, NavigationTrayProps>(
344
364
  },
345
365
  ref,
346
366
  ) => {
347
- const { light, activeIndex, setActiveIndex, setIsOpen, isOpen } =
367
+ const { light, activeIndex, setActiveIndex, setIsOpen, isOpen, cancelClose } =
348
368
  useNavigation();
349
369
  const isActive = activeIndex === _index;
350
370
 
351
371
  const handleMouseEnter = () => {
372
+ cancelClose();
352
373
  setIsOpen(true);
353
374
  setActiveIndex(_index ?? null);
354
375
  };