@stokelp/ui 2.127.0 → 3.0.0

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 (698) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/_rolldown/runtime.cjs +1 -1
  3. package/dist/_virtual/_rolldown/runtime.js +4 -5
  4. package/dist/components/accordion/Accordion.cjs +1 -1
  5. package/dist/components/accordion/Accordion.cjs.map +1 -1
  6. package/dist/components/accordion/Accordion.d.ts +1 -1
  7. package/dist/components/accordion/Accordion.js +1 -2
  8. package/dist/components/accordion/Accordion.js.map +1 -1
  9. package/dist/components/action-card/ActionCard.cjs.map +1 -1
  10. package/dist/components/action-card/ActionCard.d.ts +1 -1
  11. package/dist/components/action-card/ActionCard.js +1 -2
  12. package/dist/components/action-card/ActionCard.js.map +1 -1
  13. package/dist/components/alert/Alert.cjs.map +1 -1
  14. package/dist/components/alert/Alert.d.ts +1 -1
  15. package/dist/components/alert/Alert.js +1 -2
  16. package/dist/components/alert/Alert.js.map +1 -1
  17. package/dist/components/app/mobile-card/MobileCardEntityRow.cjs.map +1 -1
  18. package/dist/components/app/mobile-card/MobileCardEntityRow.d.ts +1 -1
  19. package/dist/components/app/mobile-card/MobileCardEntityRow.js +1 -2
  20. package/dist/components/app/mobile-card/MobileCardEntityRow.js.map +1 -1
  21. package/dist/components/app/mobile-card/MobileCardHeader.cjs.map +1 -1
  22. package/dist/components/app/mobile-card/MobileCardHeader.d.ts +1 -1
  23. package/dist/components/app/mobile-card/MobileCardHeader.js +1 -2
  24. package/dist/components/app/mobile-card/MobileCardHeader.js.map +1 -1
  25. package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs +1 -1
  26. package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs.map +1 -1
  27. package/dist/components/app/mobile-card/MobileCardNotificationBadge.d.ts +1 -1
  28. package/dist/components/app/mobile-card/MobileCardNotificationBadge.js +2 -3
  29. package/dist/components/app/mobile-card/MobileCardNotificationBadge.js.map +1 -1
  30. package/dist/components/app/mobile-card/MobileCardShell.cjs.map +1 -1
  31. package/dist/components/app/mobile-card/MobileCardShell.d.ts +1 -1
  32. package/dist/components/app/mobile-card/MobileCardShell.js +1 -2
  33. package/dist/components/app/mobile-card/MobileCardShell.js.map +1 -1
  34. package/dist/components/app/mobile-card/MobileCardSkeleton.cjs.map +1 -1
  35. package/dist/components/app/mobile-card/MobileCardSkeleton.d.ts +3 -3
  36. package/dist/components/app/mobile-card/MobileCardSkeleton.js +1 -2
  37. package/dist/components/app/mobile-card/MobileCardSkeleton.js.map +1 -1
  38. package/dist/components/app/mobile-navigation/MobileNavigation.cjs +1 -1
  39. package/dist/components/app/mobile-navigation/MobileNavigation.cjs.map +1 -1
  40. package/dist/components/app/mobile-navigation/MobileNavigation.js +2 -3
  41. package/dist/components/app/mobile-navigation/MobileNavigation.js.map +1 -1
  42. package/dist/components/app/navigation/AppNavigation.cjs +1 -1
  43. package/dist/components/app/navigation/AppNavigation.cjs.map +1 -1
  44. package/dist/components/app/navigation/AppNavigation.js +3 -4
  45. package/dist/components/app/navigation/AppNavigation.js.map +1 -1
  46. package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs +1 -1
  47. package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs.map +1 -1
  48. package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js +5 -6
  49. package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js.map +1 -1
  50. package/dist/components/app/price-tag/PriceTag.cjs.map +1 -1
  51. package/dist/components/app/price-tag/PriceTag.d.ts +3 -5
  52. package/dist/components/app/price-tag/PriceTag.js +1 -2
  53. package/dist/components/app/price-tag/PriceTag.js.map +1 -1
  54. package/dist/components/app/product-card-catalog/styled.cjs +1 -1
  55. package/dist/components/app/product-card-catalog/styled.cjs.map +1 -1
  56. package/dist/components/app/product-card-catalog/styled.d.ts +1 -1
  57. package/dist/components/app/product-card-catalog/styled.js +2 -3
  58. package/dist/components/app/product-card-catalog/styled.js.map +1 -1
  59. package/dist/components/avatar/styled.cjs +1 -1
  60. package/dist/components/avatar/styled.cjs.map +1 -1
  61. package/dist/components/avatar/styled.d.ts +4 -7
  62. package/dist/components/avatar/styled.js +2 -3
  63. package/dist/components/avatar/styled.js.map +1 -1
  64. package/dist/components/box/Box.cjs +1 -1
  65. package/dist/components/box/Box.cjs.map +1 -1
  66. package/dist/components/box/Box.d.ts +1 -1
  67. package/dist/components/box/Box.js +3 -4
  68. package/dist/components/box/Box.js.map +1 -1
  69. package/dist/components/breadcrumb/Breadcrumb.cjs.map +1 -1
  70. package/dist/components/breadcrumb/Breadcrumb.js +1 -2
  71. package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
  72. package/dist/components/button/Button.cjs.map +1 -1
  73. package/dist/components/button/Button.js +1 -2
  74. package/dist/components/button/Button.js.map +1 -1
  75. package/dist/components/button-filter/ButtonFilter.cjs.map +1 -1
  76. package/dist/components/button-filter/ButtonFilter.d.ts +4 -5
  77. package/dist/components/button-filter/ButtonFilter.js +1 -2
  78. package/dist/components/button-filter/ButtonFilter.js.map +1 -1
  79. package/dist/components/chat/Chat.cjs +1 -1
  80. package/dist/components/chat/Chat.cjs.map +1 -1
  81. package/dist/components/chat/Chat.d.ts +4 -8
  82. package/dist/components/chat/Chat.js +2 -3
  83. package/dist/components/chat/Chat.js.map +1 -1
  84. package/dist/components/chat/ChatDocumentMessage.cjs +1 -1
  85. package/dist/components/chat/ChatDocumentMessage.cjs.map +1 -1
  86. package/dist/components/chat/ChatDocumentMessage.js +3 -4
  87. package/dist/components/chat/ChatDocumentMessage.js.map +1 -1
  88. package/dist/components/chat/ChatMessage.cjs.map +1 -1
  89. package/dist/components/chat/ChatMessage.d.ts +4 -7
  90. package/dist/components/chat/ChatMessage.js +1 -2
  91. package/dist/components/chat/ChatMessage.js.map +1 -1
  92. package/dist/components/chat/ChatProfileAvatar.cjs.map +1 -1
  93. package/dist/components/chat/ChatProfileAvatar.js +1 -2
  94. package/dist/components/chat/ChatProfileAvatar.js.map +1 -1
  95. package/dist/components/chat/ChatScoreBreakdown.cjs.map +1 -1
  96. package/dist/components/chat/ChatScoreBreakdown.d.ts +1 -1
  97. package/dist/components/chat/ChatScoreBreakdown.js +1 -2
  98. package/dist/components/chat/ChatScoreBreakdown.js.map +1 -1
  99. package/dist/components/chat/ChatTextInput.cjs.map +1 -1
  100. package/dist/components/chat/ChatTextInput.js +1 -2
  101. package/dist/components/chat/ChatTextInput.js.map +1 -1
  102. package/dist/components/checkbox/Checkbox.cjs.map +1 -1
  103. package/dist/components/checkbox/Checkbox.js +1 -2
  104. package/dist/components/checkbox/Checkbox.js.map +1 -1
  105. package/dist/components/checkbox-card/CheckboxCard.cjs.map +1 -1
  106. package/dist/components/checkbox-card/CheckboxCard.js +1 -2
  107. package/dist/components/checkbox-card/CheckboxCard.js.map +1 -1
  108. package/dist/components/checkbox-card/namespace.cjs +1 -1
  109. package/dist/components/checkbox-card/namespace.cjs.map +1 -1
  110. package/dist/components/checkbox-card/namespace.js +2 -3
  111. package/dist/components/checkbox-card/namespace.js.map +1 -1
  112. package/dist/components/chip/Chip.cjs.map +1 -1
  113. package/dist/components/chip/Chip.d.ts +1 -1
  114. package/dist/components/chip/Chip.js +1 -2
  115. package/dist/components/chip/Chip.js.map +1 -1
  116. package/dist/components/collapsible/styled.cjs +1 -1
  117. package/dist/components/collapsible/styled.cjs.map +1 -1
  118. package/dist/components/collapsible/styled.d.ts +1 -1
  119. package/dist/components/collapsible/styled.js +2 -3
  120. package/dist/components/collapsible/styled.js.map +1 -1
  121. package/dist/components/combobox/Combobox.cjs +1 -1
  122. package/dist/components/combobox/Combobox.cjs.map +1 -1
  123. package/dist/components/combobox/Combobox.d.ts +1 -1
  124. package/dist/components/combobox/Combobox.js +6 -5
  125. package/dist/components/combobox/Combobox.js.map +1 -1
  126. package/dist/components/date-picker/DatePicker.cjs.map +1 -1
  127. package/dist/components/date-picker/DatePicker.js +1 -2
  128. package/dist/components/date-picker/DatePicker.js.map +1 -1
  129. package/dist/components/dialog/styled.cjs +1 -1
  130. package/dist/components/dialog/styled.cjs.map +1 -1
  131. package/dist/components/dialog/styled.d.ts +2 -2
  132. package/dist/components/dialog/styled.js +2 -3
  133. package/dist/components/dialog/styled.js.map +1 -1
  134. package/dist/components/drawer/Drawer.cjs.map +1 -1
  135. package/dist/components/drawer/Drawer.d.ts +2 -2
  136. package/dist/components/drawer/Drawer.js +1 -2
  137. package/dist/components/drawer/Drawer.js.map +1 -1
  138. package/dist/components/flag/styled.cjs.map +1 -1
  139. package/dist/components/flag/styled.d.ts +209 -211
  140. package/dist/components/flag/styled.js +1 -2
  141. package/dist/components/flag/styled.js.map +1 -1
  142. package/dist/components/form/FormControl.cjs +1 -1
  143. package/dist/components/form/FormControl.cjs.map +1 -1
  144. package/dist/components/form/FormControl.js +11 -7
  145. package/dist/components/form/FormControl.js.map +1 -1
  146. package/dist/components/form/FormHelperText.cjs.map +1 -1
  147. package/dist/components/form/FormHelperText.js +1 -2
  148. package/dist/components/form/FormHelperText.js.map +1 -1
  149. package/dist/components/form/FormLabel.cjs.map +1 -1
  150. package/dist/components/form/FormLabel.js +1 -2
  151. package/dist/components/form/FormLabel.js.map +1 -1
  152. package/dist/components/heading/Heading.cjs +1 -1
  153. package/dist/components/heading/Heading.cjs.map +1 -1
  154. package/dist/components/heading/Heading.d.ts +1 -1
  155. package/dist/components/heading/Heading.js +3 -4
  156. package/dist/components/heading/Heading.js.map +1 -1
  157. package/dist/components/icon/Icon.cjs.map +1 -1
  158. package/dist/components/icon/Icon.js +1 -2
  159. package/dist/components/icon/Icon.js.map +1 -1
  160. package/dist/components/icon-button/IconButton.cjs.map +1 -1
  161. package/dist/components/icon-button/IconButton.js +1 -2
  162. package/dist/components/icon-button/IconButton.js.map +1 -1
  163. package/dist/components/illustration/Illustration.cjs.map +1 -1
  164. package/dist/components/illustration/Illustration.js +1 -2
  165. package/dist/components/illustration/Illustration.js.map +1 -1
  166. package/dist/components/illustration/patterns.cjs.map +1 -1
  167. package/dist/components/illustration/patterns.js +1 -2
  168. package/dist/components/illustration/patterns.js.map +1 -1
  169. package/dist/components/input/HighlightedInput.cjs.map +1 -1
  170. package/dist/components/input/HighlightedInput.d.ts +1 -1
  171. package/dist/components/input/HighlightedInput.js +1 -2
  172. package/dist/components/input/HighlightedInput.js.map +1 -1
  173. package/dist/components/input/Input.cjs.map +1 -1
  174. package/dist/components/input/Input.js +1 -2
  175. package/dist/components/input/Input.js.map +1 -1
  176. package/dist/components/input/InputAddon.cjs.map +1 -1
  177. package/dist/components/input/InputAddon.d.ts +4 -5
  178. package/dist/components/input/InputAddon.js +1 -2
  179. package/dist/components/input/InputAddon.js.map +1 -1
  180. package/dist/components/input/InputGroup.cjs.map +1 -1
  181. package/dist/components/input/InputGroup.js +1 -2
  182. package/dist/components/input/InputGroup.js.map +1 -1
  183. package/dist/components/input/PhoneNumberInput.cjs.map +1 -1
  184. package/dist/components/input/PhoneNumberInput.js +1 -2
  185. package/dist/components/input/PhoneNumberInput.js.map +1 -1
  186. package/dist/components/menu/Menu.cjs +1 -1
  187. package/dist/components/menu/Menu.cjs.map +1 -1
  188. package/dist/components/menu/Menu.d.ts +2 -2
  189. package/dist/components/menu/Menu.js +2 -3
  190. package/dist/components/menu/Menu.js.map +1 -1
  191. package/dist/components/origin-select/OriginSelect.cjs.map +1 -1
  192. package/dist/components/origin-select/OriginSelect.d.ts +1 -1
  193. package/dist/components/origin-select/OriginSelect.js +1 -2
  194. package/dist/components/origin-select/OriginSelect.js.map +1 -1
  195. package/dist/components/pagination/Pagination.cjs.map +1 -1
  196. package/dist/components/pagination/Pagination.d.ts +1 -1
  197. package/dist/components/pagination/Pagination.js +1 -2
  198. package/dist/components/pagination/Pagination.js.map +1 -1
  199. package/dist/components/pagination/use-pagination.cjs.map +1 -1
  200. package/dist/components/pagination/use-pagination.js +1 -2
  201. package/dist/components/pagination/use-pagination.js.map +1 -1
  202. package/dist/components/popover/Popover.cjs.map +1 -1
  203. package/dist/components/popover/Popover.d.ts +2 -2
  204. package/dist/components/popover/Popover.js +1 -2
  205. package/dist/components/popover/Popover.js.map +1 -1
  206. package/dist/components/radio-button-group/RadioButtonGroup.cjs.map +1 -1
  207. package/dist/components/radio-button-group/RadioButtonGroup.d.ts +1 -1
  208. package/dist/components/radio-button-group/RadioButtonGroup.js +1 -2
  209. package/dist/components/radio-button-group/RadioButtonGroup.js.map +1 -1
  210. package/dist/components/radio-card-group/RadioCardGroup.cjs.map +1 -1
  211. package/dist/components/radio-card-group/RadioCardGroup.d.ts +1 -1
  212. package/dist/components/radio-card-group/RadioCardGroup.js +1 -2
  213. package/dist/components/radio-card-group/RadioCardGroup.js.map +1 -1
  214. package/dist/components/radio-card-group/namespace.cjs +1 -1
  215. package/dist/components/radio-card-group/namespace.cjs.map +1 -1
  216. package/dist/components/radio-card-group/namespace.js +2 -3
  217. package/dist/components/radio-card-group/namespace.js.map +1 -1
  218. package/dist/components/radio-group/RadioGroup.cjs.map +1 -1
  219. package/dist/components/radio-group/RadioGroup.d.ts +1 -1
  220. package/dist/components/radio-group/RadioGroup.js +1 -2
  221. package/dist/components/radio-group/RadioGroup.js.map +1 -1
  222. package/dist/components/select/Select.cjs +1 -1
  223. package/dist/components/select/Select.cjs.map +1 -1
  224. package/dist/components/select/Select.d.ts +1 -1
  225. package/dist/components/select/Select.js +2 -7
  226. package/dist/components/select/Select.js.map +1 -1
  227. package/dist/components/select-language/SelectLanguage.cjs +1 -1
  228. package/dist/components/select-language/SelectLanguage.cjs.map +1 -1
  229. package/dist/components/select-language/SelectLanguage.js +45 -43
  230. package/dist/components/select-language/SelectLanguage.js.map +1 -1
  231. package/dist/components/status-tag-select/StatusTagSelect.cjs +1 -1
  232. package/dist/components/status-tag-select/StatusTagSelect.cjs.map +1 -1
  233. package/dist/components/status-tag-select/StatusTagSelect.js +30 -31
  234. package/dist/components/status-tag-select/StatusTagSelect.js.map +1 -1
  235. package/dist/components/steps/Steps.cjs.map +1 -1
  236. package/dist/components/steps/Steps.d.ts +1 -1
  237. package/dist/components/steps/Steps.js +1 -2
  238. package/dist/components/steps/Steps.js.map +1 -1
  239. package/dist/components/supplier-rating-badge/SupplierRatingBadge.cjs.map +1 -1
  240. package/dist/components/supplier-rating-badge/SupplierRatingBadge.d.ts +1 -1
  241. package/dist/components/supplier-rating-badge/SupplierRatingBadge.js +1 -2
  242. package/dist/components/supplier-rating-badge/SupplierRatingBadge.js.map +1 -1
  243. package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.cjs +1 -1
  244. package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.cjs.map +1 -1
  245. package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.d.ts +1 -1
  246. package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.js +53 -54
  247. package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.js.map +1 -1
  248. package/dist/components/supplier-rating-badge/labels.cjs.map +1 -1
  249. package/dist/components/supplier-rating-badge/labels.js +1 -2
  250. package/dist/components/supplier-rating-badge/labels.js.map +1 -1
  251. package/dist/components/switch/Switch.cjs.map +1 -1
  252. package/dist/components/switch/Switch.js +1 -2
  253. package/dist/components/switch/Switch.js.map +1 -1
  254. package/dist/components/switch-card/SwitchCard.cjs.map +1 -1
  255. package/dist/components/switch-card/SwitchCard.d.ts +2 -1
  256. package/dist/components/switch-card/SwitchCard.js +1 -2
  257. package/dist/components/switch-card/SwitchCard.js.map +1 -1
  258. package/dist/components/switch-card/namespace.cjs +1 -1
  259. package/dist/components/switch-card/namespace.cjs.map +1 -1
  260. package/dist/components/switch-card/namespace.js +2 -3
  261. package/dist/components/switch-card/namespace.js.map +1 -1
  262. package/dist/components/table/Table.cjs +1 -1
  263. package/dist/components/table/Table.cjs.map +1 -1
  264. package/dist/components/table/Table.js +3 -4
  265. package/dist/components/table/Table.js.map +1 -1
  266. package/dist/components/table/TableProvider.cjs.map +1 -1
  267. package/dist/components/table/TableProvider.js +1 -2
  268. package/dist/components/table/TableProvider.js.map +1 -1
  269. package/dist/components/tabs/Tabs.cjs.map +1 -1
  270. package/dist/components/tabs/Tabs.d.ts +4 -7
  271. package/dist/components/tabs/Tabs.js +1 -2
  272. package/dist/components/tabs/Tabs.js.map +1 -1
  273. package/dist/components/tag/Tag.cjs.map +1 -1
  274. package/dist/components/tag/Tag.js +1 -2
  275. package/dist/components/tag/Tag.js.map +1 -1
  276. package/dist/components/text/Text.cjs +1 -1
  277. package/dist/components/text/Text.cjs.map +1 -1
  278. package/dist/components/text/Text.d.ts +1 -1
  279. package/dist/components/text/Text.js +3 -4
  280. package/dist/components/text/Text.js.map +1 -1
  281. package/dist/components/textarea/Textarea.cjs.map +1 -1
  282. package/dist/components/textarea/Textarea.d.ts +4 -5
  283. package/dist/components/textarea/Textarea.js +1 -2
  284. package/dist/components/textarea/Textarea.js.map +1 -1
  285. package/dist/components/tooltip/Tooltip.cjs.map +1 -1
  286. package/dist/components/tooltip/Tooltip.d.ts +2 -2
  287. package/dist/components/tooltip/Tooltip.js +1 -2
  288. package/dist/components/tooltip/Tooltip.js.map +1 -1
  289. package/dist/components/ui-labels/UiLabelsProvider.cjs.map +1 -1
  290. package/dist/components/ui-labels/UiLabelsProvider.js +1 -2
  291. package/dist/components/ui-labels/UiLabelsProvider.js.map +1 -1
  292. package/dist/icons/index.cjs.map +1 -1
  293. package/dist/icons/index.js +1 -2
  294. package/dist/icons/index.js.map +1 -1
  295. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs.map +1 -0
  296. package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js +4 -5
  297. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js.map +1 -0
  298. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs.map +1 -0
  299. package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js +4 -5
  300. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js.map +1 -0
  301. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs.map +1 -0
  302. package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js +4 -5
  303. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js.map +1 -0
  304. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs.map +1 -0
  305. package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.js +4 -5
  306. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.js.map +1 -0
  307. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs.map +1 -0
  308. package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js +4 -5
  309. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js.map +1 -0
  310. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs.map +1 -0
  311. package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.js +4 -5
  312. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.js.map +1 -0
  313. package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.cjs +1 -1
  314. package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.cjs.map +1 -1
  315. package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js +2 -3
  316. package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js.map +1 -1
  317. package/dist/preset.cjs +1 -1
  318. package/dist/preset.cjs.map +1 -1
  319. package/dist/preset.js +7 -6
  320. package/dist/preset.js.map +1 -1
  321. package/dist/shared/ConditionalWrapper.cjs.map +1 -1
  322. package/dist/shared/ConditionalWrapper.js +1 -2
  323. package/dist/shared/ConditionalWrapper.js.map +1 -1
  324. package/dist/shared/assets/icons.cjs.map +1 -1
  325. package/dist/shared/assets/icons.d.ts +2 -2
  326. package/dist/shared/assets/icons.js +1 -2
  327. package/dist/shared/assets/icons.js.map +1 -1
  328. package/dist/shared/hooks/useUncontrolled.cjs.map +1 -1
  329. package/dist/shared/hooks/useUncontrolled.js +1 -2
  330. package/dist/shared/hooks/useUncontrolled.js.map +1 -1
  331. package/dist/shared/utils/events.cjs.map +1 -1
  332. package/dist/shared/utils/events.js +1 -2
  333. package/dist/shared/utils/events.js.map +1 -1
  334. package/dist/theme/breakpoints.cjs.map +1 -1
  335. package/dist/theme/breakpoints.js +1 -2
  336. package/dist/theme/breakpoints.js.map +1 -1
  337. package/dist/theme/conditions.cjs.map +1 -1
  338. package/dist/theme/conditions.js +1 -2
  339. package/dist/theme/conditions.js.map +1 -1
  340. package/dist/theme/containers.cjs +1 -1
  341. package/dist/theme/containers.cjs.map +1 -1
  342. package/dist/theme/containers.d.ts +1 -1
  343. package/dist/theme/containers.js +2 -3
  344. package/dist/theme/containers.js.map +1 -1
  345. package/dist/theme/globalCss.cjs.map +1 -1
  346. package/dist/theme/globalCss.d.ts +1 -1
  347. package/dist/theme/globalCss.js +1 -2
  348. package/dist/theme/globalCss.js.map +1 -1
  349. package/dist/theme/keyframes.cjs.map +1 -1
  350. package/dist/theme/keyframes.d.ts +1 -1
  351. package/dist/theme/keyframes.js +1 -2
  352. package/dist/theme/keyframes.js.map +1 -1
  353. package/dist/theme/recipes/accordion.cjs.map +1 -1
  354. package/dist/theme/recipes/accordion.d.ts +32 -2
  355. package/dist/theme/recipes/accordion.js +1 -2
  356. package/dist/theme/recipes/accordion.js.map +1 -1
  357. package/dist/theme/recipes/action-card.cjs.map +1 -1
  358. package/dist/theme/recipes/action-card.d.ts +2 -2
  359. package/dist/theme/recipes/action-card.js +1 -2
  360. package/dist/theme/recipes/action-card.js.map +1 -1
  361. package/dist/theme/recipes/alert.cjs.map +1 -1
  362. package/dist/theme/recipes/alert.d.ts +30 -2
  363. package/dist/theme/recipes/alert.js +1 -2
  364. package/dist/theme/recipes/alert.js.map +1 -1
  365. package/dist/theme/recipes/app/mobile-navigation.cjs.map +1 -1
  366. package/dist/theme/recipes/app/mobile-navigation.d.ts +51 -2
  367. package/dist/theme/recipes/app/mobile-navigation.js +1 -2
  368. package/dist/theme/recipes/app/mobile-navigation.js.map +1 -1
  369. package/dist/theme/recipes/app/navigation-language-select.cjs +1 -1
  370. package/dist/theme/recipes/app/navigation-language-select.cjs.map +1 -1
  371. package/dist/theme/recipes/app/navigation-language-select.d.ts +105 -2
  372. package/dist/theme/recipes/app/navigation-language-select.js +31 -39
  373. package/dist/theme/recipes/app/navigation-language-select.js.map +1 -1
  374. package/dist/theme/recipes/app/navigation.cjs.map +1 -1
  375. package/dist/theme/recipes/app/navigation.d.ts +125 -2
  376. package/dist/theme/recipes/app/navigation.js +1 -2
  377. package/dist/theme/recipes/app/navigation.js.map +1 -1
  378. package/dist/theme/recipes/app/price-tag.cjs.map +1 -1
  379. package/dist/theme/recipes/app/price-tag.d.ts +41 -2
  380. package/dist/theme/recipes/app/price-tag.js +1 -2
  381. package/dist/theme/recipes/app/price-tag.js.map +1 -1
  382. package/dist/theme/recipes/app/product-card-catalog.cjs.map +1 -1
  383. package/dist/theme/recipes/app/product-card-catalog.d.ts +2 -2
  384. package/dist/theme/recipes/app/product-card-catalog.js +1 -2
  385. package/dist/theme/recipes/app/product-card-catalog.js.map +1 -1
  386. package/dist/theme/recipes/avatar-group.cjs.map +1 -1
  387. package/dist/theme/recipes/avatar-group.d.ts +14 -2
  388. package/dist/theme/recipes/avatar-group.js +1 -2
  389. package/dist/theme/recipes/avatar-group.js.map +1 -1
  390. package/dist/theme/recipes/avatar.cjs.map +1 -1
  391. package/dist/theme/recipes/avatar.d.ts +53 -2
  392. package/dist/theme/recipes/avatar.js +1 -2
  393. package/dist/theme/recipes/avatar.js.map +1 -1
  394. package/dist/theme/recipes/breadcrumb.cjs.map +1 -1
  395. package/dist/theme/recipes/breadcrumb.d.ts +2 -2
  396. package/dist/theme/recipes/breadcrumb.js +1 -2
  397. package/dist/theme/recipes/breadcrumb.js.map +1 -1
  398. package/dist/theme/recipes/button-filter.cjs.map +1 -1
  399. package/dist/theme/recipes/button-filter.d.ts +1 -1
  400. package/dist/theme/recipes/button-filter.js +1 -2
  401. package/dist/theme/recipes/button-filter.js.map +1 -1
  402. package/dist/theme/recipes/button.cjs.map +1 -1
  403. package/dist/theme/recipes/button.d.ts +93 -2
  404. package/dist/theme/recipes/button.js +1 -2
  405. package/dist/theme/recipes/button.js.map +1 -1
  406. package/dist/theme/recipes/chat/chat-document-message.cjs.map +1 -1
  407. package/dist/theme/recipes/chat/chat-document-message.d.ts +1 -1
  408. package/dist/theme/recipes/chat/chat-document-message.js +1 -2
  409. package/dist/theme/recipes/chat/chat-document-message.js.map +1 -1
  410. package/dist/theme/recipes/chat/chat-input-text.cjs.map +1 -1
  411. package/dist/theme/recipes/chat/chat-input-text.d.ts +1 -1
  412. package/dist/theme/recipes/chat/chat-input-text.js +1 -2
  413. package/dist/theme/recipes/chat/chat-input-text.js.map +1 -1
  414. package/dist/theme/recipes/chat/chat-message.cjs.map +1 -1
  415. package/dist/theme/recipes/chat/chat-message.d.ts +28 -2
  416. package/dist/theme/recipes/chat/chat-message.js +1 -2
  417. package/dist/theme/recipes/chat/chat-message.js.map +1 -1
  418. package/dist/theme/recipes/chat/chat-profile-avatar.cjs.map +1 -1
  419. package/dist/theme/recipes/chat/chat-profile-avatar.d.ts +9 -2
  420. package/dist/theme/recipes/chat/chat-profile-avatar.js +1 -2
  421. package/dist/theme/recipes/chat/chat-profile-avatar.js.map +1 -1
  422. package/dist/theme/recipes/chat/chat.cjs.map +1 -1
  423. package/dist/theme/recipes/chat/chat.d.ts +2 -2
  424. package/dist/theme/recipes/chat/chat.js +1 -2
  425. package/dist/theme/recipes/chat/chat.js.map +1 -1
  426. package/dist/theme/recipes/checkbox-card.cjs.map +1 -1
  427. package/dist/theme/recipes/checkbox-card.d.ts +1 -1
  428. package/dist/theme/recipes/checkbox-card.js +1 -2
  429. package/dist/theme/recipes/checkbox-card.js.map +1 -1
  430. package/dist/theme/recipes/checkbox-group.cjs.map +1 -1
  431. package/dist/theme/recipes/checkbox-group.d.ts +1 -1
  432. package/dist/theme/recipes/checkbox-group.js +1 -2
  433. package/dist/theme/recipes/checkbox-group.js.map +1 -1
  434. package/dist/theme/recipes/checkbox.cjs +1 -1
  435. package/dist/theme/recipes/checkbox.cjs.map +1 -1
  436. package/dist/theme/recipes/checkbox.d.ts +26 -2
  437. package/dist/theme/recipes/checkbox.js +7 -8
  438. package/dist/theme/recipes/checkbox.js.map +1 -1
  439. package/dist/theme/recipes/chip.cjs.map +1 -1
  440. package/dist/theme/recipes/chip.d.ts +148 -2
  441. package/dist/theme/recipes/chip.js +1 -2
  442. package/dist/theme/recipes/chip.js.map +1 -1
  443. package/dist/theme/recipes/collapsible.cjs.map +1 -1
  444. package/dist/theme/recipes/collapsible.d.ts +2 -2
  445. package/dist/theme/recipes/collapsible.js +1 -2
  446. package/dist/theme/recipes/collapsible.js.map +1 -1
  447. package/dist/theme/recipes/combobox.cjs +1 -1
  448. package/dist/theme/recipes/combobox.cjs.map +1 -1
  449. package/dist/theme/recipes/combobox.d.ts +33 -2
  450. package/dist/theme/recipes/combobox.js +6 -6
  451. package/dist/theme/recipes/combobox.js.map +1 -1
  452. package/dist/theme/recipes/common/group-card.cjs.map +1 -1
  453. package/dist/theme/recipes/common/group-card.d.ts +1 -1
  454. package/dist/theme/recipes/common/group-card.js +1 -2
  455. package/dist/theme/recipes/common/group-card.js.map +1 -1
  456. package/dist/theme/recipes/datepicker.cjs +1 -1
  457. package/dist/theme/recipes/datepicker.cjs.map +1 -1
  458. package/dist/theme/recipes/datepicker.d.ts +2 -2
  459. package/dist/theme/recipes/datepicker.js +6 -7
  460. package/dist/theme/recipes/datepicker.js.map +1 -1
  461. package/dist/theme/recipes/dialog.cjs.map +1 -1
  462. package/dist/theme/recipes/dialog.d.ts +2 -2
  463. package/dist/theme/recipes/dialog.js +1 -2
  464. package/dist/theme/recipes/dialog.js.map +1 -1
  465. package/dist/theme/recipes/drawer.cjs.map +1 -1
  466. package/dist/theme/recipes/drawer.d.ts +31 -2
  467. package/dist/theme/recipes/drawer.js +4 -4
  468. package/dist/theme/recipes/drawer.js.map +1 -1
  469. package/dist/theme/recipes/flag.cjs.map +1 -1
  470. package/dist/theme/recipes/flag.d.ts +15 -2
  471. package/dist/theme/recipes/flag.js +1 -2
  472. package/dist/theme/recipes/flag.js.map +1 -1
  473. package/dist/theme/recipes/form/control.cjs.map +1 -1
  474. package/dist/theme/recipes/form/control.d.ts +1 -1
  475. package/dist/theme/recipes/form/control.js +1 -2
  476. package/dist/theme/recipes/form/control.js.map +1 -1
  477. package/dist/theme/recipes/form/helper-text.cjs.map +1 -1
  478. package/dist/theme/recipes/form/helper-text.d.ts +1 -1
  479. package/dist/theme/recipes/form/helper-text.js +1 -2
  480. package/dist/theme/recipes/form/helper-text.js.map +1 -1
  481. package/dist/theme/recipes/form/label.cjs.map +1 -1
  482. package/dist/theme/recipes/form/label.d.ts +15 -2
  483. package/dist/theme/recipes/form/label.js +1 -2
  484. package/dist/theme/recipes/form/label.js.map +1 -1
  485. package/dist/theme/recipes/heading.cjs.map +1 -1
  486. package/dist/theme/recipes/heading.d.ts +33 -2
  487. package/dist/theme/recipes/heading.js +1 -2
  488. package/dist/theme/recipes/heading.js.map +1 -1
  489. package/dist/theme/recipes/highlightedInput.cjs.map +1 -1
  490. package/dist/theme/recipes/highlightedInput.d.ts +2 -2
  491. package/dist/theme/recipes/highlightedInput.js +1 -2
  492. package/dist/theme/recipes/highlightedInput.js.map +1 -1
  493. package/dist/theme/recipes/icon-button.cjs.map +1 -1
  494. package/dist/theme/recipes/icon-button.d.ts +1 -1
  495. package/dist/theme/recipes/icon-button.js +0 -1
  496. package/dist/theme/recipes/icon-button.js.map +1 -1
  497. package/dist/theme/recipes/icon.cjs.map +1 -1
  498. package/dist/theme/recipes/icon.d.ts +25 -2
  499. package/dist/theme/recipes/icon.js +1 -2
  500. package/dist/theme/recipes/icon.js.map +1 -1
  501. package/dist/theme/recipes/illustration.cjs.map +1 -1
  502. package/dist/theme/recipes/illustration.d.ts +29 -2
  503. package/dist/theme/recipes/illustration.js +1 -2
  504. package/dist/theme/recipes/illustration.js.map +1 -1
  505. package/dist/theme/recipes/index.cjs +1 -1
  506. package/dist/theme/recipes/index.cjs.map +1 -1
  507. package/dist/theme/recipes/index.d.ts +1464 -49
  508. package/dist/theme/recipes/index.js +3 -4
  509. package/dist/theme/recipes/index.js.map +1 -1
  510. package/dist/theme/recipes/input-addon.cjs.map +1 -1
  511. package/dist/theme/recipes/input-addon.d.ts +1 -1
  512. package/dist/theme/recipes/input-addon.js +1 -2
  513. package/dist/theme/recipes/input-addon.js.map +1 -1
  514. package/dist/theme/recipes/input-group.cjs.map +1 -1
  515. package/dist/theme/recipes/input-group.d.ts +1 -1
  516. package/dist/theme/recipes/input-group.js +1 -2
  517. package/dist/theme/recipes/input-group.js.map +1 -1
  518. package/dist/theme/recipes/input.cjs +1 -1
  519. package/dist/theme/recipes/input.cjs.map +1 -1
  520. package/dist/theme/recipes/input.d.ts +9 -2
  521. package/dist/theme/recipes/input.js +5 -6
  522. package/dist/theme/recipes/input.js.map +1 -1
  523. package/dist/theme/recipes/menu.cjs.map +1 -1
  524. package/dist/theme/recipes/menu.d.ts +20 -2
  525. package/dist/theme/recipes/menu.js +1 -2
  526. package/dist/theme/recipes/menu.js.map +1 -1
  527. package/dist/theme/recipes/pagination.cjs +1 -1
  528. package/dist/theme/recipes/pagination.cjs.map +1 -1
  529. package/dist/theme/recipes/pagination.d.ts +2 -2
  530. package/dist/theme/recipes/pagination.js +3 -4
  531. package/dist/theme/recipes/pagination.js.map +1 -1
  532. package/dist/theme/recipes/phone-number-input.cjs.map +1 -1
  533. package/dist/theme/recipes/phone-number-input.d.ts +9 -2
  534. package/dist/theme/recipes/phone-number-input.js +1 -2
  535. package/dist/theme/recipes/phone-number-input.js.map +1 -1
  536. package/dist/theme/recipes/popover.cjs.map +1 -1
  537. package/dist/theme/recipes/popover.d.ts +2 -2
  538. package/dist/theme/recipes/popover.js +1 -2
  539. package/dist/theme/recipes/popover.js.map +1 -1
  540. package/dist/theme/recipes/radio-button-group.cjs.map +1 -1
  541. package/dist/theme/recipes/radio-button-group.d.ts +25 -2
  542. package/dist/theme/recipes/radio-button-group.js +1 -2
  543. package/dist/theme/recipes/radio-button-group.js.map +1 -1
  544. package/dist/theme/recipes/radio-card-group.cjs.map +1 -1
  545. package/dist/theme/recipes/radio-card-group.d.ts +36 -2
  546. package/dist/theme/recipes/radio-card-group.js +1 -2
  547. package/dist/theme/recipes/radio-card-group.js.map +1 -1
  548. package/dist/theme/recipes/radio-group.cjs.map +1 -1
  549. package/dist/theme/recipes/radio-group.d.ts +27 -2
  550. package/dist/theme/recipes/radio-group.js +1 -2
  551. package/dist/theme/recipes/radio-group.js.map +1 -1
  552. package/dist/theme/recipes/select-language.cjs.map +1 -1
  553. package/dist/theme/recipes/select-language.d.ts +15 -2
  554. package/dist/theme/recipes/select-language.js +1 -2
  555. package/dist/theme/recipes/select-language.js.map +1 -1
  556. package/dist/theme/recipes/select.cjs +1 -1
  557. package/dist/theme/recipes/select.cjs.map +1 -1
  558. package/dist/theme/recipes/select.d.ts +30 -2
  559. package/dist/theme/recipes/select.js +3 -18
  560. package/dist/theme/recipes/select.js.map +1 -1
  561. package/dist/theme/recipes/status-tag-select.cjs.map +1 -1
  562. package/dist/theme/recipes/status-tag-select.d.ts +125 -2
  563. package/dist/theme/recipes/status-tag-select.js +1 -2
  564. package/dist/theme/recipes/status-tag-select.js.map +1 -1
  565. package/dist/theme/recipes/steps.cjs.map +1 -1
  566. package/dist/theme/recipes/steps.d.ts +2 -2
  567. package/dist/theme/recipes/steps.js +1 -2
  568. package/dist/theme/recipes/steps.js.map +1 -1
  569. package/dist/theme/recipes/switch-card.cjs.map +1 -1
  570. package/dist/theme/recipes/switch-card.d.ts +1 -1
  571. package/dist/theme/recipes/switch-card.js +1 -2
  572. package/dist/theme/recipes/switch-card.js.map +1 -1
  573. package/dist/theme/recipes/switch.cjs.map +1 -1
  574. package/dist/theme/recipes/switch.d.ts +22 -2
  575. package/dist/theme/recipes/switch.js +1 -2
  576. package/dist/theme/recipes/switch.js.map +1 -1
  577. package/dist/theme/recipes/table-container.cjs.map +1 -1
  578. package/dist/theme/recipes/table-container.d.ts +1 -1
  579. package/dist/theme/recipes/table-container.js +1 -2
  580. package/dist/theme/recipes/table-container.js.map +1 -1
  581. package/dist/theme/recipes/table-empty-row.cjs.map +1 -1
  582. package/dist/theme/recipes/table-empty-row.d.ts +1 -1
  583. package/dist/theme/recipes/table-empty-row.js +1 -2
  584. package/dist/theme/recipes/table-empty-row.js.map +1 -1
  585. package/dist/theme/recipes/table-group-title.cjs.map +1 -1
  586. package/dist/theme/recipes/table-group-title.d.ts +15 -2
  587. package/dist/theme/recipes/table-group-title.js +1 -2
  588. package/dist/theme/recipes/table-group-title.js.map +1 -1
  589. package/dist/theme/recipes/table.cjs.map +1 -1
  590. package/dist/theme/recipes/table.d.ts +2 -2
  591. package/dist/theme/recipes/table.js +1 -2
  592. package/dist/theme/recipes/table.js.map +1 -1
  593. package/dist/theme/recipes/tabs-chip.cjs.map +1 -1
  594. package/dist/theme/recipes/tabs-chip.d.ts +29 -2
  595. package/dist/theme/recipes/tabs-chip.js +1 -2
  596. package/dist/theme/recipes/tabs-chip.js.map +1 -1
  597. package/dist/theme/recipes/tabs.cjs.map +1 -1
  598. package/dist/theme/recipes/tabs.d.ts +49 -2
  599. package/dist/theme/recipes/tabs.js +1 -2
  600. package/dist/theme/recipes/tabs.js.map +1 -1
  601. package/dist/theme/recipes/tag.cjs.map +1 -1
  602. package/dist/theme/recipes/tag.d.ts +109 -2
  603. package/dist/theme/recipes/tag.js +1 -2
  604. package/dist/theme/recipes/tag.js.map +1 -1
  605. package/dist/theme/recipes/text.cjs.map +1 -1
  606. package/dist/theme/recipes/text.d.ts +29 -2
  607. package/dist/theme/recipes/text.js +1 -2
  608. package/dist/theme/recipes/text.js.map +1 -1
  609. package/dist/theme/recipes/textarea.cjs.map +1 -1
  610. package/dist/theme/recipes/textarea.d.ts +1 -1
  611. package/dist/theme/recipes/textarea.js +1 -2
  612. package/dist/theme/recipes/textarea.js.map +1 -1
  613. package/dist/theme/recipes/tooltip.cjs.map +1 -1
  614. package/dist/theme/recipes/tooltip.d.ts +2 -2
  615. package/dist/theme/recipes/tooltip.js +1 -2
  616. package/dist/theme/recipes/tooltip.js.map +1 -1
  617. package/dist/theme/semantic-tokens/colors.cjs.map +1 -1
  618. package/dist/theme/semantic-tokens/colors.js +1 -2
  619. package/dist/theme/semantic-tokens/colors.js.map +1 -1
  620. package/dist/theme/semantic-tokens/gradients.cjs.map +1 -1
  621. package/dist/theme/semantic-tokens/gradients.js +1 -2
  622. package/dist/theme/semantic-tokens/gradients.js.map +1 -1
  623. package/dist/theme/semantic-tokens/index.cjs.map +1 -1
  624. package/dist/theme/semantic-tokens/index.js +1 -2
  625. package/dist/theme/semantic-tokens/index.js.map +1 -1
  626. package/dist/theme/text-styles.cjs.map +1 -1
  627. package/dist/theme/text-styles.d.ts +1 -1
  628. package/dist/theme/text-styles.js +1 -2
  629. package/dist/theme/text-styles.js.map +1 -1
  630. package/dist/theme/tokens/animations.cjs.map +1 -1
  631. package/dist/theme/tokens/animations.js +1 -2
  632. package/dist/theme/tokens/animations.js.map +1 -1
  633. package/dist/theme/tokens/aspect-ratios.cjs.map +1 -1
  634. package/dist/theme/tokens/aspect-ratios.js +1 -2
  635. package/dist/theme/tokens/aspect-ratios.js.map +1 -1
  636. package/dist/theme/tokens/blurs.cjs.map +1 -1
  637. package/dist/theme/tokens/blurs.js +1 -2
  638. package/dist/theme/tokens/blurs.js.map +1 -1
  639. package/dist/theme/tokens/borders.cjs.map +1 -1
  640. package/dist/theme/tokens/borders.js +1 -2
  641. package/dist/theme/tokens/borders.js.map +1 -1
  642. package/dist/theme/tokens/colors.cjs.map +1 -1
  643. package/dist/theme/tokens/colors.js +1 -2
  644. package/dist/theme/tokens/colors.js.map +1 -1
  645. package/dist/theme/tokens/durations.cjs.map +1 -1
  646. package/dist/theme/tokens/durations.js +1 -2
  647. package/dist/theme/tokens/durations.js.map +1 -1
  648. package/dist/theme/tokens/easings.cjs.map +1 -1
  649. package/dist/theme/tokens/easings.js +1 -2
  650. package/dist/theme/tokens/easings.js.map +1 -1
  651. package/dist/theme/tokens/index.cjs.map +1 -1
  652. package/dist/theme/tokens/index.js +1 -2
  653. package/dist/theme/tokens/index.js.map +1 -1
  654. package/dist/theme/tokens/radii.cjs.map +1 -1
  655. package/dist/theme/tokens/radii.js +1 -2
  656. package/dist/theme/tokens/radii.js.map +1 -1
  657. package/dist/theme/tokens/shadows.cjs.map +1 -1
  658. package/dist/theme/tokens/shadows.js +1 -2
  659. package/dist/theme/tokens/shadows.js.map +1 -1
  660. package/dist/theme/tokens/sizes.cjs.map +1 -1
  661. package/dist/theme/tokens/sizes.js +1 -2
  662. package/dist/theme/tokens/sizes.js.map +1 -1
  663. package/dist/theme/tokens/spacing.cjs.map +1 -1
  664. package/dist/theme/tokens/spacing.js +1 -2
  665. package/dist/theme/tokens/spacing.js.map +1 -1
  666. package/dist/theme/tokens/typography.cjs.map +1 -1
  667. package/dist/theme/tokens/typography.js +1 -2
  668. package/dist/theme/tokens/typography.js.map +1 -1
  669. package/dist/theme/tokens/z-index.cjs.map +1 -1
  670. package/dist/theme/tokens/z-index.js +1 -2
  671. package/dist/theme/tokens/z-index.js.map +1 -1
  672. package/dist/theme/utilities.cjs.map +1 -1
  673. package/dist/theme/utilities.js +0 -1
  674. package/dist/theme/utilities.js.map +1 -1
  675. package/dist/ui.css +1 -1
  676. package/dist/utils/slots.cjs +1 -1
  677. package/dist/utils/slots.cjs.map +1 -1
  678. package/dist/utils/slots.js +3 -4
  679. package/dist/utils/slots.js.map +1 -1
  680. package/package.json +9 -9
  681. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs.map +0 -1
  682. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js.map +0 -1
  683. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs.map +0 -1
  684. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js.map +0 -1
  685. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs.map +0 -1
  686. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js.map +0 -1
  687. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs.map +0 -1
  688. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.js.map +0 -1
  689. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs.map +0 -1
  690. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js.map +0 -1
  691. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs.map +0 -1
  692. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.js.map +0 -1
  693. /package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs +0 -0
  694. /package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs +0 -0
  695. /package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs +0 -0
  696. /package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs +0 -0
  697. /package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs +0 -0
  698. /package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Steps.js","names":[],"sources":["../../../src/components/steps/Steps.tsx"],"sourcesContent":["import { Steps as ArkSteps } from '@ark-ui/react'\nimport { ComponentProps } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { steps } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots.tsx'\n\nconst { withProvider, withContext } = createStyleContext(steps)\n\nexport const Steps = withProvider(styled(ArkSteps.Root), 'root')\nexport const StepsList = withContext(styled(ArkSteps.List), 'list')\nexport const StepsItem = withContext(styled(ArkSteps.Item), 'item')\nexport const StepsTrigger = withContext(styled(ArkSteps.Trigger), 'trigger')\nexport const StepsIndicator = withContext(styled(ArkSteps.Indicator), 'indicator')\nexport const StepsSeparator = withContext(styled(ArkSteps.Separator), 'separator')\nexport const StepsContent = withContext(styled(ArkSteps.Content), 'content')\n\nexport interface StepsProps extends ComponentProps<typeof Steps> {}\n\nexport interface StepsListProps extends ComponentProps<typeof StepsList> {}\n\nexport interface StepsItemProps extends ComponentProps<typeof StepsItem> {}\n\nexport interface StepsTriggerProps extends ComponentProps<typeof StepsTrigger> {}\n\nexport interface StepsIndicatorProps extends ComponentProps<typeof StepsIndicator> {}\n\nexport interface StepsSeparatorProps extends ComponentProps<typeof StepsSeparator> {}\n\nexport interface StepsContentProps extends ComponentProps<typeof StepsContent> {}\n"],"mappings":";;;;;;AAMA,IAAM,EAAE,iBAAc,mBAAgB,EAAmB,CAAK,GAEjD,IAAQ,EAAa,EAAO,EAAS,IAAI,GAAG,MAAM,GAClD,IAAY,EAAY,EAAO,EAAS,IAAI,GAAG,MAAM,GACrD,IAAY,EAAY,EAAO,EAAS,IAAI,GAAG,MAAM,GACrD,IAAe,EAAY,EAAO,EAAS,OAAO,GAAG,SAAS,GAC9D,IAAiB,EAAY,EAAO,EAAS,SAAS,GAAG,WAAW,GACpE,IAAiB,EAAY,EAAO,EAAS,SAAS,GAAG,WAAW,GACpE,IAAe,EAAY,EAAO,EAAS,OAAO,GAAG,SAAS"}
1
+ {"version":3,"file":"Steps.js","names":["Steps","ArkSteps","createStyleContext","steps","Steps$1","withProvider","styled","Steps","StepsList","withContext","StepsItem","StepsTrigger","StepsIndicator","StepsSeparator","StepsContent"],"sources":["../../../src/components/steps/Steps.tsx"],"sourcesContent":["import { Steps as ArkSteps } from '@ark-ui/react'\nimport { ComponentProps } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { steps } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots.tsx'\n\nconst { withProvider, withContext } = createStyleContext(steps)\n\nexport const Steps = withProvider(styled(ArkSteps.Root), 'root')\nexport const StepsList = withContext(styled(ArkSteps.List), 'list')\nexport const StepsItem = withContext(styled(ArkSteps.Item), 'item')\nexport const StepsTrigger = withContext(styled(ArkSteps.Trigger), 'trigger')\nexport const StepsIndicator = withContext(styled(ArkSteps.Indicator), 'indicator')\nexport const StepsSeparator = withContext(styled(ArkSteps.Separator), 'separator')\nexport const StepsContent = withContext(styled(ArkSteps.Content), 'content')\n\nexport interface StepsProps extends ComponentProps<typeof Steps> {}\n\nexport interface StepsListProps extends ComponentProps<typeof StepsList> {}\n\nexport interface StepsItemProps extends ComponentProps<typeof StepsItem> {}\n\nexport interface StepsTriggerProps extends ComponentProps<typeof StepsTrigger> {}\n\nexport interface StepsIndicatorProps extends ComponentProps<typeof StepsIndicator> {}\n\nexport interface StepsSeparatorProps extends ComponentProps<typeof StepsSeparator> {}\n\nexport interface StepsContentProps extends ComponentProps<typeof StepsContent> {}\n"],"mappings":";;;;;;AAMA,IAAM,EAAE,iBAAc,mBAAgBE,EAAmBC,CAAK,GAEjDH,IAAQK,EAAaC,EAAOL,EAAS,IAAI,GAAG,MAAM,GAClDO,IAAYC,EAAYH,EAAOL,EAAS,IAAI,GAAG,MAAM,GACrDS,IAAYD,EAAYH,EAAOL,EAAS,IAAI,GAAG,MAAM,GACrDU,IAAeF,EAAYH,EAAOL,EAAS,OAAO,GAAG,SAAS,GAC9DW,IAAiBH,EAAYH,EAAOL,EAAS,SAAS,GAAG,WAAW,GACpEY,IAAiBJ,EAAYH,EAAOL,EAAS,SAAS,GAAG,WAAW,GACpEa,IAAeL,EAAYH,EAAOL,EAAS,OAAO,GAAG,SAAS"}
@@ -1 +1 @@
1
- {"version":3,"file":"SupplierRatingBadge.cjs","names":[],"sources":["../../../src/components/supplier-rating-badge/SupplierRatingBadge.tsx"],"sourcesContent":["import { Box } from '@stokelp/styled-system/jsx'\nimport { PointerEvent, useCallback, useEffect, useRef, useState } from 'react'\n\nimport { Popover, PopoverContent, PopoverTrigger, Text } from '~/components'\n\nimport {\n formatOverall,\n SUPPLIER_RATING_MAX,\n SupplierRatingBreakdown,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './SupplierRatingBreakdown'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\n\nexport type SupplierRatingBadgeProps = {\n rating: SupplierRating\n /** Optional original response rate (0..100) reminded inside the breakdown. */\n responseRate?: number\n labels?: Partial<SupplierRatingLabels>\n}\n\nfunction getBadgeColors(overall: number): { bg: string; color: string } {\n const ratio = overall / SUPPLIER_RATING_MAX\n if (ratio >= 0.8) return { bg: '#E6F3D9', color: '#3B6D11' }\n if (ratio >= 0.6) return { bg: '#FBF1CC', color: '#92750C' }\n if (ratio >= 0.4) return { bg: '#FDF0E0', color: '#C2740C' }\n return { bg: '#FCEBEB', color: '#A32D2D' }\n}\n\n/** Compact supplier-rating pill (note /5) with an accessible, keyboard-openable breakdown popover. */\nexport function SupplierRatingBadge({ rating, responseRate, labels }: SupplierRatingBadgeProps) {\n const [open, setOpen] = useState(false)\n const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n const cancelClose = useCallback(() => {\n if (closeTimer.current) {\n clearTimeout(closeTimer.current)\n closeTimer.current = null\n }\n }, [])\n\n const scheduleClose = useCallback(() => {\n cancelClose()\n closeTimer.current = setTimeout(() => setOpen(false), 120)\n }, [cancelClose])\n\n useEffect(() => cancelClose, [cancelClose])\n\n const openOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n cancelClose()\n setOpen(true)\n }\n const closeOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n scheduleClose()\n }\n\n const insufficient = rating.insufficientData || rating.overall == null\n const uiLabels = useUiLabels()\n const insufficientLabel = labels?.insufficientData ?? uiLabels.supplierRating.insufficientData\n const colors = insufficient ? { bg: '#F1F2F4', color: '#5B6472' } : getBadgeColors(rating.overall as number)\n\n return (\n <Popover\n open={open}\n onOpenChange={e => setOpen(e.open)}\n positioning={{ placement: 'top-end', gutter: 8 }}\n autoFocus={false}\n restoreFocus={false}\n lazyMount\n unmountOnExit\n >\n <PopoverTrigger asChild>\n <Box\n display=\"inline-flex\"\n alignItems=\"center\"\n w=\"fit-content\"\n maxW=\"100%\"\n px=\"space-8\"\n py=\"space-2\"\n borderRadius=\"full\"\n tabIndex={0}\n cursor=\"default\"\n style={{ backgroundColor: colors.bg }}\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n onFocus={() => {\n cancelClose()\n setOpen(true)\n }}\n onBlur={() => setOpen(false)}\n >\n <Text size=\"sm\" bold whiteSpace=\"nowrap\" style={{ color: colors.color }}>\n {insufficient ? insufficientLabel : `${formatOverall(rating.overall as number, uiLabels.locale)} ★`}\n </Text>\n </Box>\n </PopoverTrigger>\n <PopoverContent\n className=\"panda-preflight-enabled\"\n zIndex={10000}\n p=\"0\"\n bg=\"transparent\"\n border=\"none\"\n borderRadius=\"radius-8\"\n boxShadow=\"0px 8px 16px 4px #1624861A\"\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n >\n <SupplierRatingBreakdown rating={rating} responseRate={responseRate} labels={labels} />\n </PopoverContent>\n </Popover>\n )\n}\n"],"mappings":"6QAqBA,SAAS,EAAe,EAAgD,CACtE,IAAM,EAAQ,EAAA,EAId,OAHI,GAAS,GAAY,CAAE,GAAI,UAAW,MAAO,SAAU,EACvD,GAAS,GAAY,CAAE,GAAI,UAAW,MAAO,SAAU,EACvD,GAAS,GAAY,CAAE,GAAI,UAAW,MAAO,SAAU,EACpD,CAAE,GAAI,UAAW,MAAO,SAAU,CAC3C,CAGA,SAAgB,EAAoB,CAAE,SAAQ,eAAc,UAAoC,CAC9F,GAAM,CAAC,EAAM,IAAA,EAAA,EAAA,UAAoB,EAAK,EAChC,GAAA,EAAA,EAAA,QAA0D,IAAI,EAE9D,GAAA,EAAA,EAAA,iBAAgC,CACpC,AAEE,EAAW,WADX,aAAa,EAAW,OAAO,EACV,KAEzB,EAAG,CAAC,CAAC,EAEC,GAAA,EAAA,EAAA,iBAAkC,CACtC,EAAY,EACZ,EAAW,QAAU,eAAiB,EAAQ,EAAK,EAAG,GAAG,CAC3D,EAAG,CAAC,CAAW,CAAC,GAEhB,EAAA,EAAA,eAAgB,EAAa,CAAC,CAAW,CAAC,EAE1C,IAAM,EAAe,GAAoB,CACnC,EAAE,cAAgB,UACtB,EAAY,EACZ,EAAQ,EAAI,EACd,EACM,EAAgB,GAAoB,CACpC,EAAE,cAAgB,SACtB,EAAc,CAChB,EAEM,EAAe,EAAO,kBAAoB,EAAO,SAAW,KAC5D,EAAW,EAAA,YAAY,EACvB,EAAoB,GAAQ,kBAAoB,EAAS,eAAe,iBACxE,EAAS,EAAe,CAAE,GAAI,UAAW,MAAO,SAAU,EAAI,EAAe,EAAO,OAAiB,EAE3G,OACE,EAAA,EAAA,MAAC,EAAA,QAAD,CACQ,OACN,aAAc,GAAK,EAAQ,EAAE,IAAI,EACjC,YAAa,CAAE,UAAW,UAAW,OAAQ,CAAE,EAC/C,UAAW,GACX,aAAc,GACd,UAAA,GACA,cAAA,YAPF,EASE,EAAA,EAAA,KAAC,EAAA,eAAD,CAAgB,QAAA,aACd,EAAA,EAAA,KAAC,EAAA,IAAD,CACE,QAAQ,cACR,WAAW,SACX,EAAE,cACF,KAAK,OACL,GAAG,UACH,GAAG,UACH,aAAa,OACb,SAAU,EACV,OAAO,UACP,MAAO,CAAE,gBAAiB,EAAO,EAAG,EACpC,eAAgB,EAChB,eAAgB,EAChB,YAAe,CACb,EAAY,EACZ,EAAQ,EAAI,CACd,EACA,WAAc,EAAQ,EAAK,YAE3B,EAAA,EAAA,KAAC,EAAA,KAAD,CAAM,KAAK,KAAK,KAAA,GAAK,WAAW,SAAS,MAAO,CAAE,MAAO,EAAO,KAAM,WACnE,EAAe,EAAoB,GAAG,EAAA,cAAc,EAAO,QAAmB,EAAS,MAAM,EAAE,GAC5F,CAAA,CACH,CAAA,CACS,CAAA,GAChB,EAAA,EAAA,KAAC,EAAA,eAAD,CACE,UAAU,0BACV,OAAQ,IACR,EAAE,IACF,GAAG,cACH,OAAO,OACP,aAAa,WACb,UAAU,6BACV,eAAgB,EAChB,eAAgB,YAEhB,EAAA,EAAA,KAAC,EAAA,wBAAD,CAAiC,SAAsB,eAAsB,QAAS,CAAA,CACxE,CAAA,CACT,GAEb"}
1
+ {"version":3,"file":"SupplierRatingBadge.cjs","names":["useState","useRef","useCallback","useUiLabels","Popover","PopoverTrigger","Box","Text","formatOverall","PopoverContent","SupplierRatingBreakdown","require_Text","require_UiLabelsProvider","require_Popover","require_SupplierRatingBreakdown","_stokelp_styled_system_jsx","react","react_jsx_runtime","getBadgeColors","ratio","overall","SupplierRatingBadge","open","setOpen","closeTimer","cancelClose","scheduleClose","openOnMouse","closeOnMouse","insufficient","rating","uiLabels","insufficientLabel","labels","colors"],"sources":["../../../src/components/supplier-rating-badge/SupplierRatingBadge.tsx"],"sourcesContent":["import { Box } from '@stokelp/styled-system/jsx'\nimport { PointerEvent, useCallback, useEffect, useRef, useState } from 'react'\n\nimport { Popover, PopoverContent, PopoverTrigger, Text } from '~/components'\n\nimport {\n formatOverall,\n SUPPLIER_RATING_MAX,\n SupplierRatingBreakdown,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './SupplierRatingBreakdown'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\n\nexport type SupplierRatingBadgeProps = {\n rating: SupplierRating\n /** Optional original response rate (0..100) reminded inside the breakdown. */\n responseRate?: number\n labels?: Partial<SupplierRatingLabels>\n}\n\nfunction getBadgeColors(overall: number): { bg: string; color: string } {\n const ratio = overall / SUPPLIER_RATING_MAX\n if (ratio >= 0.8) return { bg: '#E6F3D9', color: '#3B6D11' }\n if (ratio >= 0.6) return { bg: '#FBF1CC', color: '#92750C' }\n if (ratio >= 0.4) return { bg: '#FDF0E0', color: '#C2740C' }\n return { bg: '#FCEBEB', color: '#A32D2D' }\n}\n\n/** Compact supplier-rating pill (note /5) with an accessible, keyboard-openable breakdown popover. */\nexport function SupplierRatingBadge({ rating, responseRate, labels }: SupplierRatingBadgeProps) {\n const [open, setOpen] = useState(false)\n const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n const cancelClose = useCallback(() => {\n if (closeTimer.current) {\n clearTimeout(closeTimer.current)\n closeTimer.current = null\n }\n }, [])\n\n const scheduleClose = useCallback(() => {\n cancelClose()\n closeTimer.current = setTimeout(() => setOpen(false), 120)\n }, [cancelClose])\n\n useEffect(() => cancelClose, [cancelClose])\n\n const openOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n cancelClose()\n setOpen(true)\n }\n const closeOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n scheduleClose()\n }\n\n const insufficient = rating.insufficientData || rating.overall == null\n const uiLabels = useUiLabels()\n const insufficientLabel = labels?.insufficientData ?? uiLabels.supplierRating.insufficientData\n const colors = insufficient ? { bg: '#F1F2F4', color: '#5B6472' } : getBadgeColors(rating.overall as number)\n\n return (\n <Popover\n open={open}\n onOpenChange={e => setOpen(e.open)}\n positioning={{ placement: 'top-end', gutter: 8 }}\n autoFocus={false}\n restoreFocus={false}\n lazyMount\n unmountOnExit\n >\n <PopoverTrigger asChild>\n <Box\n display=\"inline-flex\"\n alignItems=\"center\"\n w=\"fit-content\"\n maxW=\"100%\"\n px=\"space-8\"\n py=\"space-2\"\n borderRadius=\"full\"\n tabIndex={0}\n cursor=\"default\"\n style={{ backgroundColor: colors.bg }}\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n onFocus={() => {\n cancelClose()\n setOpen(true)\n }}\n onBlur={() => setOpen(false)}\n >\n <Text size=\"sm\" bold whiteSpace=\"nowrap\" style={{ color: colors.color }}>\n {insufficient ? insufficientLabel : `${formatOverall(rating.overall as number, uiLabels.locale)} ★`}\n </Text>\n </Box>\n </PopoverTrigger>\n <PopoverContent\n className=\"panda-preflight-enabled\"\n zIndex={10000}\n p=\"0\"\n bg=\"transparent\"\n border=\"none\"\n borderRadius=\"radius-8\"\n boxShadow=\"0px 8px 16px 4px #1624861A\"\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n >\n <SupplierRatingBreakdown rating={rating} responseRate={responseRate} labels={labels} />\n </PopoverContent>\n </Popover>\n )\n}\n"],"mappings":"A,6QAqBA,SAASkB,EAAe,EAAgD,CACtE,IAAMC,EAAQC,EAAA,EAId,OAHID,GAAS,GAAY,CAAE,GAAI,UAAW,MAAO,SAAU,EACvDA,GAAS,GAAY,CAAE,GAAI,UAAW,MAAO,SAAU,EACvDA,GAAS,GAAY,CAAE,GAAI,UAAW,MAAO,SAAU,EACpD,CAAE,GAAI,UAAW,MAAO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,OAAO,UACP,MAAO,CAAE,gBAAiB4B,EAAO,EAAG,EACpC,eAAgBP,EAChB,eAAgBC,EAChB,YAAe,CACbH,EAAY,EACZF,EAAQ,EAAI,CACd,EACA,WAAcA,EAAQ,EAAK,EAE3B,UAAA,EAAAN,EAAA,IAAA,CAACV,EAAAA,KAAD,CAAM,KAAK,KAAK,KAAA,GAAK,WAAW,SAAS,MAAO,CAAE,MAAO2B,EAAO,KAAM,EACnE,SAAAL,EAAeG,EAAoB,GAAGxB,EAAAA,cAAcsB,EAAO,QAAmBC,EAAS,MAAM,EAAE,GAC5F,CAAA,CACH,CAAA,CACS,CAAA,GAChB,EAAAd,EAAA,IAAA,CAACR,EAAAA,eAAD,CACE,UAAU,0BACV,OAAQ,IACR,EAAE,IACF,GAAG,cACH,OAAO,OACP,aAAa,WACb,UAAU,6BACV,eAAgBkB,EAChB,eAAgBC,EAEhB,UAAA,EAAAX,EAAA,IAAA,CAACP,EAAAA,wBAAD,CAAiC,SAAsB,eAAsB,QAAS,CAAA,CACxE,CAAA,CACT,C,EAEb,C"}
@@ -6,4 +6,4 @@ export type SupplierRatingBadgeProps = {
6
6
  labels?: Partial<SupplierRatingLabels>;
7
7
  };
8
8
  /** Compact supplier-rating pill (note /5) with an accessible, keyboard-openable breakdown popover. */
9
- export declare function SupplierRatingBadge({ rating, responseRate, labels }: SupplierRatingBadgeProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function SupplierRatingBadge({ rating, responseRate, labels }: SupplierRatingBadgeProps): import('react').JSX.Element;
@@ -6,7 +6,7 @@ import { SupplierRatingBreakdown as a, formatOverall as o } from "./SupplierRati
6
6
  import { Box as s } from "@stokelp/styled-system/jsx";
7
7
  import { useCallback as c, useEffect as l, useRef as u, useState as d } from "react";
8
8
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
9
- //#region src/components/supplier-rating-badge/SupplierRatingBadge.tsx
9
+ // src/components/supplier-rating-badge/SupplierRatingBadge.tsx
10
10
  function m(e) {
11
11
  let t = e / 5;
12
12
  return t >= .8 ? {
@@ -94,7 +94,6 @@ function h({ rating: h, responseRate: g, labels: _ }) {
94
94
  })]
95
95
  });
96
96
  }
97
- //#endregion
98
97
  export { h as SupplierRatingBadge };
99
98
 
100
99
  //# sourceMappingURL=SupplierRatingBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SupplierRatingBadge.js","names":[],"sources":["../../../src/components/supplier-rating-badge/SupplierRatingBadge.tsx"],"sourcesContent":["import { Box } from '@stokelp/styled-system/jsx'\nimport { PointerEvent, useCallback, useEffect, useRef, useState } from 'react'\n\nimport { Popover, PopoverContent, PopoverTrigger, Text } from '~/components'\n\nimport {\n formatOverall,\n SUPPLIER_RATING_MAX,\n SupplierRatingBreakdown,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './SupplierRatingBreakdown'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\n\nexport type SupplierRatingBadgeProps = {\n rating: SupplierRating\n /** Optional original response rate (0..100) reminded inside the breakdown. */\n responseRate?: number\n labels?: Partial<SupplierRatingLabels>\n}\n\nfunction getBadgeColors(overall: number): { bg: string; color: string } {\n const ratio = overall / SUPPLIER_RATING_MAX\n if (ratio >= 0.8) return { bg: '#E6F3D9', color: '#3B6D11' }\n if (ratio >= 0.6) return { bg: '#FBF1CC', color: '#92750C' }\n if (ratio >= 0.4) return { bg: '#FDF0E0', color: '#C2740C' }\n return { bg: '#FCEBEB', color: '#A32D2D' }\n}\n\n/** Compact supplier-rating pill (note /5) with an accessible, keyboard-openable breakdown popover. */\nexport function SupplierRatingBadge({ rating, responseRate, labels }: SupplierRatingBadgeProps) {\n const [open, setOpen] = useState(false)\n const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n const cancelClose = useCallback(() => {\n if (closeTimer.current) {\n clearTimeout(closeTimer.current)\n closeTimer.current = null\n }\n }, [])\n\n const scheduleClose = useCallback(() => {\n cancelClose()\n closeTimer.current = setTimeout(() => setOpen(false), 120)\n }, [cancelClose])\n\n useEffect(() => cancelClose, [cancelClose])\n\n const openOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n cancelClose()\n setOpen(true)\n }\n const closeOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n scheduleClose()\n }\n\n const insufficient = rating.insufficientData || rating.overall == null\n const uiLabels = useUiLabels()\n const insufficientLabel = labels?.insufficientData ?? uiLabels.supplierRating.insufficientData\n const colors = insufficient ? { bg: '#F1F2F4', color: '#5B6472' } : getBadgeColors(rating.overall as number)\n\n return (\n <Popover\n open={open}\n onOpenChange={e => setOpen(e.open)}\n positioning={{ placement: 'top-end', gutter: 8 }}\n autoFocus={false}\n restoreFocus={false}\n lazyMount\n unmountOnExit\n >\n <PopoverTrigger asChild>\n <Box\n display=\"inline-flex\"\n alignItems=\"center\"\n w=\"fit-content\"\n maxW=\"100%\"\n px=\"space-8\"\n py=\"space-2\"\n borderRadius=\"full\"\n tabIndex={0}\n cursor=\"default\"\n style={{ backgroundColor: colors.bg }}\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n onFocus={() => {\n cancelClose()\n setOpen(true)\n }}\n onBlur={() => setOpen(false)}\n >\n <Text size=\"sm\" bold whiteSpace=\"nowrap\" style={{ color: colors.color }}>\n {insufficient ? insufficientLabel : `${formatOverall(rating.overall as number, uiLabels.locale)} ★`}\n </Text>\n </Box>\n </PopoverTrigger>\n <PopoverContent\n className=\"panda-preflight-enabled\"\n zIndex={10000}\n p=\"0\"\n bg=\"transparent\"\n border=\"none\"\n borderRadius=\"radius-8\"\n boxShadow=\"0px 8px 16px 4px #1624861A\"\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n >\n <SupplierRatingBreakdown rating={rating} responseRate={responseRate} labels={labels} />\n </PopoverContent>\n </Popover>\n )\n}\n"],"mappings":";;;;;;;;;AAqBA,SAAS,EAAe,GAAgD;CACtE,IAAM,IAAQ,IAAA;CAId,OAHI,KAAS,KAAY;EAAE,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e;KAEb,AADA,EAAY,GACZ,EAAQ,EAAI;IACd;IACA,cAAc,EAAQ,EAAK;cAE3B,kBAAC,GAAD;KAAM,MAAK;KAAK,MAAA;KAAK,YAAW;KAAS,OAAO,EAAE,OAAO,EAAO,MAAM;eACnE,IAAe,IAAoB,GAAG,EAAc,EAAO,SAAmB,EAAS,MAAM,EAAE;IAC5F,CAAA;GACH,CAAA;EACS,CAAA,GAChB,kBAAC,GAAD;GACE,WAAU;GACV,QAAQ;GACR,GAAE;GACF,IAAG;GACH,QAAO;GACP,cAAa;GACb,WAAU;GACV,gBAAgB;GAChB,gBAAgB;aAEhB,kBAAC,GAAD;IAAiC;IAAsB;IAAsB;GAAS,CAAA;EACxE,CAAA,CACT;;AAEb"}
1
+ {"version":3,"file":"SupplierRatingBadge.js","names":["getBadgeColors","ratio","overall","SupplierRatingBadge","open","setOpen","useState","closeTimer","useRef","cancelClose","useCallback","scheduleClose","openOnMouse","closeOnMouse","insufficient","rating","uiLabels","useUiLabels","insufficientLabel","labels","colors","Popover","PopoverTrigger","Box","Text","formatOverall","PopoverContent","SupplierRatingBreakdown"],"sources":["../../../src/components/supplier-rating-badge/SupplierRatingBadge.tsx"],"sourcesContent":["import { Box } from '@stokelp/styled-system/jsx'\nimport { PointerEvent, useCallback, useEffect, useRef, useState } from 'react'\n\nimport { Popover, PopoverContent, PopoverTrigger, Text } from '~/components'\n\nimport {\n formatOverall,\n SUPPLIER_RATING_MAX,\n SupplierRatingBreakdown,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './SupplierRatingBreakdown'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\n\nexport type SupplierRatingBadgeProps = {\n rating: SupplierRating\n /** Optional original response rate (0..100) reminded inside the breakdown. */\n responseRate?: number\n labels?: Partial<SupplierRatingLabels>\n}\n\nfunction getBadgeColors(overall: number): { bg: string; color: string } {\n const ratio = overall / SUPPLIER_RATING_MAX\n if (ratio >= 0.8) return { bg: '#E6F3D9', color: '#3B6D11' }\n if (ratio >= 0.6) return { bg: '#FBF1CC', color: '#92750C' }\n if (ratio >= 0.4) return { bg: '#FDF0E0', color: '#C2740C' }\n return { bg: '#FCEBEB', color: '#A32D2D' }\n}\n\n/** Compact supplier-rating pill (note /5) with an accessible, keyboard-openable breakdown popover. */\nexport function SupplierRatingBadge({ rating, responseRate, labels }: SupplierRatingBadgeProps) {\n const [open, setOpen] = useState(false)\n const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n const cancelClose = useCallback(() => {\n if (closeTimer.current) {\n clearTimeout(closeTimer.current)\n closeTimer.current = null\n }\n }, [])\n\n const scheduleClose = useCallback(() => {\n cancelClose()\n closeTimer.current = setTimeout(() => setOpen(false), 120)\n }, [cancelClose])\n\n useEffect(() => cancelClose, [cancelClose])\n\n const openOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n cancelClose()\n setOpen(true)\n }\n const closeOnMouse = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return\n scheduleClose()\n }\n\n const insufficient = rating.insufficientData || rating.overall == null\n const uiLabels = useUiLabels()\n const insufficientLabel = labels?.insufficientData ?? uiLabels.supplierRating.insufficientData\n const colors = insufficient ? { bg: '#F1F2F4', color: '#5B6472' } : getBadgeColors(rating.overall as number)\n\n return (\n <Popover\n open={open}\n onOpenChange={e => setOpen(e.open)}\n positioning={{ placement: 'top-end', gutter: 8 }}\n autoFocus={false}\n restoreFocus={false}\n lazyMount\n unmountOnExit\n >\n <PopoverTrigger asChild>\n <Box\n display=\"inline-flex\"\n alignItems=\"center\"\n w=\"fit-content\"\n maxW=\"100%\"\n px=\"space-8\"\n py=\"space-2\"\n borderRadius=\"full\"\n tabIndex={0}\n cursor=\"default\"\n style={{ backgroundColor: colors.bg }}\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n onFocus={() => {\n cancelClose()\n setOpen(true)\n }}\n onBlur={() => setOpen(false)}\n >\n <Text size=\"sm\" bold whiteSpace=\"nowrap\" style={{ color: colors.color }}>\n {insufficient ? insufficientLabel : `${formatOverall(rating.overall as number, uiLabels.locale)} ★`}\n </Text>\n </Box>\n </PopoverTrigger>\n <PopoverContent\n className=\"panda-preflight-enabled\"\n zIndex={10000}\n p=\"0\"\n bg=\"transparent\"\n border=\"none\"\n borderRadius=\"radius-8\"\n boxShadow=\"0px 8px 16px 4px #1624861A\"\n onPointerEnter={openOnMouse}\n onPointerLeave={closeOnMouse}\n >\n <SupplierRatingBreakdown rating={rating} responseRate={responseRate} labels={labels} />\n </PopoverContent>\n </Popover>\n )\n}\n"],"mappings":";;;;;;;;;AAqBA,SAASA,EAAe,GAAgD;CACtE,IAAMC,IAAQC,IAAA;CAId,OAHID,KAAS,KAAY;EAAE,IAAI;EAAW,OAAO;CAAU,IACvDA,KAAS,KAAY;EAAE,IAAI;EAAW,OAAO;CAAU,IACvDA,KAAS,KAAY;EAAE,IAAI;EAAW,OAAO;CAAU,IACpD;EAAE,IAAI;EAAW,OAAO;CAAU;AAC3C;AAGA,SAAgBE,EAAoB,EAAE,WAAQ,iBAAc,aAAoC;CAC9F,IAAM,CAACC,GAAMC,KAAWC,EAAS,EAAK,GAChCC,IAAaC,EAA6C,IAAI,GAE9DC,IAAcC,QAAkB;EACpC,AAEEH,EAAW,aADX,aAAaA,EAAW,OAAO,GACV;CAEzB,GAAG,CAAC,CAAC,GAECI,IAAgBD,QAAkB;EAEtC,AADAD,EAAY,GACZ,EAAW,UAAU,iBAAiBJ,EAAQ,EAAK,GAAG,GAAG;CAC3D,GAAG,CAACI,CAAW,CAAC;CAEhB,QAAgBA,GAAa,CAACA,CAAW,CAAC;CAE1C,IAAMG,KAAe,MAAoB;EACvC,AAAI,EAAE,gBAAgB,YACtBH,EAAY,GACZJ,EAAQ,EAAI;CACd,GACMQ,KAAgB,MAAoB;EACxC,AAAI,EAAE,gBAAgB,WACtBF,EAAc;CAChB,GAEMG,IAAeC,EAAO,oBAAoBA,EAAO,WAAW,MAC5DC,IAAWC,EAAY,GACvBC,IAAoBC,GAAQ,oBAAoBH,EAAS,eAAe,kBACxEI,IAASN,IAAe;EAAE,IAAI;EAAW,OAAO;CAAU,IAAId,EAAee,EAAO,OAAiB;CAE3G,OACE,kBAACM,GAAD;EACQ;EACN,eAAc,MAAKhB,EAAQ,EAAE,IAAI;EACjC,aAAa;GAAE,WAAW;GAAW,QAAQ;EAAE;EAC/C,WAAW;EACX,cAAc;EACd,WAAA;EACA,eAAA;EAPF,UAAA,CASE,kBAACiB,GAAD;GAAgB,SAAA;GACd,UAAA,kBAACC,GAAD;IACE,SAAQ;IACR,YAAW;IACX,GAAE;IACF,MAAK;IACL,IAAG;IACH,IAAG;IACH,cAAa;IACb,UAAU;IACV,QAAO;IACP,OAAO,EAAE,iBAAiBH,EAAO,GAAG;IACpC,gBAAgBR;IAChB,gBAAgBC;IAChB,eAAe;KAEb,AADAJ,EAAY,GACZJ,EAAQ,EAAI;IACd;IACA,cAAcA,EAAQ,EAAK;IAE3B,UAAA,kBAACmB,GAAD;KAAM,MAAK;KAAK,MAAA;KAAK,YAAW;KAAS,OAAO,EAAE,OAAOJ,EAAO,MAAM;KACnE,UAAAN,IAAeI,IAAoB,GAAGO,EAAcV,EAAO,SAAmBC,EAAS,MAAM,EAAE;IAC5F,CAAA;GACH,CAAA;EACS,CAAA,GAChB,kBAACU,GAAD;GACE,WAAU;GACV,QAAQ;GACR,GAAE;GACF,IAAG;GACH,QAAO;GACP,cAAa;GACb,WAAU;GACV,gBAAgBd;GAChB,gBAAgBC;GAEhB,UAAA,kBAACc,GAAD;IAAiC;IAAsB;IAAsB;GAAS,CAAA;EACxE,CAAA,CACT;;AAEb"}
@@ -1,2 +1,2 @@
1
- "use client";const e=require("../text/Text.cjs"),t=require("./labels.cjs"),n=require("../ui-labels/UiLabelsProvider.cjs"),r=require("../icon/Icon.cjs"),i=require("../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs"),a=require("../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs");let o=require("@stokelp/styled-system/jsx"),s=require("react/jsx-runtime");var c=5,l=[`profile`,`location`,`contacts`,`legalBanking`,`sector`,`certificate`];function u(e,t=`fr-FR`){return new Intl.NumberFormat(t,{minimumFractionDigits:1,maximumFractionDigits:1}).format(e)}function d(e,t,n=`fr-FR`){if(e<60)return`${Math.round(e)} ${t.minutes}`;let r=e/60;if(r<48)return`${Math.round(r)} ${t.hours}`;let i=r/24;return`${new Intl.NumberFormat(n,{maximumFractionDigits:1}).format(i)} ${t.days}`}function f(e){let t=e/5;return t>=.7?`#3B6D11`:t>=.4?`#854F0B`:`#A32D2D`}function p(e){return e>=70?`#639922`:e>=40?`#BA7517`:`#E24B4A`}var m=({rating:c,responseRate:m,labels:h})=>{let g=n.useUiLabels(),_=t.mergeSupplierRatingLabels(g.supplierRating,h),v=m!=null,y=c.responseDelayMinutes!=null,b=c.responseDelayScore==null?null:Math.round(c.responseDelayScore*100),x=Math.round(c.completionScore*100),S=[{key:`responseRate`,value:v?`${Math.round(m)} %`:_.notAvailable,barPercent:v?Math.round(m):null,color:v?p(Math.round(m)):void 0},{key:`responseDelay`,value:y?d(c.responseDelayMinutes,_.units,g.locale):_.notAvailable,barPercent:b,color:b==null?void 0:p(b)},{key:`completion`,value:`${x} %`,barPercent:x,color:p(x)}];return(0,s.jsxs)(o.Box,{bg:`white`,borderRadius:`radius-8`,p:`space-16`,minW:`240px`,maxW:`260px`,css:{"& *":{fontFamily:`inherit`}},children:[(0,s.jsxs)(o.HStack,{justify:`space-between`,alignItems:`baseline`,mb:`space-8`,children:[(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.md`,fontWeight:`bold`,children:_.title}),c.insufficientData||c.overall==null?(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,fontWeight:`medium`,color:`grey.400`,children:_.insufficientData}):(0,s.jsxs)(e.Text,{as:`span`,fontSize:`body.lg`,fontWeight:`medium`,style:{color:f(c.overall)},children:[u(c.overall,g.locale),` / `,5,` ★`]})]}),(0,s.jsx)(o.Box,{h:`1px`,bg:`grey.100`,mb:`space-8`}),(0,s.jsxs)(o.VStack,{alignItems:`stretch`,gap:`space-8`,mb:`space-8`,children:[(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,fontWeight:`bold`,color:`grey.400`,children:_.componentsTitle}),S.map(t=>(0,s.jsxs)(o.VStack,{alignItems:`stretch`,gap:`space-2`,children:[(0,s.jsxs)(o.HStack,{justify:`space-between`,alignItems:`baseline`,gap:`space-8`,children:[(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,color:`grey.500`,children:_.components[t.key]}),(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,fontWeight:`medium`,whiteSpace:`nowrap`,style:{color:t.color},color:t.color?void 0:`grey.300`,children:t.value})]}),(0,s.jsx)(o.Box,{h:`3px`,bg:`grey.100`,borderRadius:`full`,overflow:`hidden`,children:(0,s.jsx)(o.Box,{h:`100%`,borderRadius:`full`,style:{width:t.barPercent==null?`0%`:`${t.barPercent}%`,background:t.color??`transparent`}})})]},t.key))]}),(0,s.jsx)(o.Box,{h:`1px`,bg:`grey.100`,mb:`space-8`}),(0,s.jsxs)(o.VStack,{alignItems:`stretch`,gap:`space-4`,children:[(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,fontWeight:`bold`,color:`grey.400`,children:_.completionTitle}),l.map(t=>{let n=c.completion[t];return(0,s.jsxs)(o.HStack,{alignItems:`center`,gap:`space-8`,children:[(0,s.jsx)(r.Icon,{size:`sm`,color:n?`success.500`:`grey.300`,flexShrink:`0`,children:n?(0,s.jsx)(i.default,{}):(0,s.jsx)(a.default,{})}),(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,color:n?`grey.500`:`grey.400`,children:_.completion[t]})]},t)})]}),_.footer&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.Box,{h:`1px`,bg:`grey.100`,mt:`space-8`,mb:`space-8`}),(0,s.jsx)(e.Text,{as:`span`,fontSize:`9px`,color:`grey.300`,style:{lineHeight:1},children:_.footer})]})]})};exports.SUPPLIER_RATING_MAX=c,exports.SupplierRatingBreakdown=m,exports.formatOverall=u,exports.formatResponseDelay=d,exports.getHeadlineColor=f;
1
+ "use client";const e=require("../text/Text.cjs"),t=require("./labels.cjs"),n=require("../ui-labels/UiLabelsProvider.cjs"),r=require("../icon/Icon.cjs"),i=require("../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs"),a=require("../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs");let o=require("@stokelp/styled-system/jsx"),s=require("react/jsx-runtime");var c=5,l=[`profile`,`location`,`contacts`,`legalBanking`,`sector`,`certificate`];function u(e,t=`fr-FR`){return new Intl.NumberFormat(t,{minimumFractionDigits:1,maximumFractionDigits:1}).format(e)}function d(e,t,n=`fr-FR`){if(e<60)return`${Math.round(e)} ${t.minutes}`;let r=e/60;if(r<48)return`${Math.round(r)} ${t.hours}`;let i=r/24;return`${new Intl.NumberFormat(n,{maximumFractionDigits:1}).format(i)} ${t.days}`}function f(e){let t=e/5;return t>=.7?`#3B6D11`:t>=.4?`#854F0B`:`#A32D2D`}function p(e){return e>=70?`#639922`:e>=40?`#BA7517`:`#E24B4A`}var m=({rating:c,responseRate:m,labels:h})=>{let g=n.useUiLabels(),_=t.mergeSupplierRatingLabels(g.supplierRating,h),v=m!=null,y=c.responseDelayMinutes!=null,b=c.responseDelayScore==null?null:Math.round(c.responseDelayScore*100),x=Math.round(c.completionScore*100),S=[{key:`responseRate`,value:v?`${Math.round(m)} %`:_.notAvailable,barPercent:v?Math.round(m):null,color:v?p(Math.round(m)):void 0},{key:`responseDelay`,value:y?d(c.responseDelayMinutes,_.units,g.locale):_.notAvailable,barPercent:b,color:b==null?void 0:p(b)},{key:`completion`,value:`${x} %`,barPercent:x,color:p(x)}];return(0,s.jsxs)(o.Box,{bg:`white`,borderRadius:`radius-8`,p:`space-16`,minW:`240px`,maxW:`260px`,css:{"& *":{fontFamily:`inherit`}},children:[(0,s.jsxs)(o.HStack,{justify:`space-between`,alignItems:`baseline`,mb:`space-8`,children:[(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.md`,fontWeight:`bold`,children:_.title}),c.insufficientData||c.overall==null?(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,fontWeight:`medium`,color:`grey.400`,children:_.insufficientData}):(0,s.jsxs)(e.Text,{as:`span`,fontSize:`body.lg`,fontWeight:`medium`,style:{color:f(c.overall)},children:[u(c.overall,g.locale),` / `,5,` ★`]})]}),(0,s.jsx)(o.Box,{h:`1px`,bg:`grey.100`,mb:`space-8`}),(0,s.jsxs)(o.VStack,{alignItems:`stretch`,gap:`space-8`,mb:`space-8`,children:[(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,fontWeight:`bold`,color:`grey.400`,children:_.componentsTitle}),S.map(t=>(0,s.jsxs)(o.VStack,{alignItems:`stretch`,gap:`space-2`,children:[(0,s.jsxs)(o.HStack,{justify:`space-between`,alignItems:`baseline`,gap:`space-8`,children:[(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,color:`grey.500`,children:_.components[t.key]}),(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,fontWeight:`medium`,whiteSpace:`nowrap`,style:{color:t.color},color:t.color?void 0:`grey.300`,children:t.value})]}),(0,s.jsx)(o.Box,{h:`3px`,bg:`grey.100`,borderRadius:`full`,overflow:`hidden`,children:(0,s.jsx)(o.Box,{h:`100%`,borderRadius:`full`,style:{width:t.barPercent==null?`0%`:`${t.barPercent}%`,background:t.color??`transparent`}})})]},t.key))]}),(0,s.jsx)(o.Box,{h:`1px`,bg:`grey.100`,mb:`space-8`}),(0,s.jsxs)(o.VStack,{alignItems:`stretch`,gap:`space-4`,children:[(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,fontWeight:`bold`,color:`grey.400`,children:_.completionTitle}),l.map(t=>{let n=c.completion[t];return(0,s.jsxs)(o.HStack,{alignItems:`center`,gap:`space-8`,children:[(0,s.jsx)(r.Icon,{size:`sm`,color:n?`success.500`:`grey.300`,flexShrink:`0`,children:n?(0,s.jsx)(i.default,{}):(0,s.jsx)(a.default,{})}),(0,s.jsx)(e.Text,{as:`span`,fontSize:`body.sm`,color:n?`grey.500`:`grey.400`,children:_.completion[t]})]},t)})]}),_.footer&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.Box,{h:`1px`,bg:`grey.100`,mt:`space-8`,mb:`space-8`}),(0,s.jsx)(e.Text,{as:`span`,fontSize:`9px`,color:`grey.300`,style:{lineHeight:1},children:_.footer})]})]})};exports.DEFAULT_SUPPLIER_RATING_LABELS=t.DEFAULT_SUPPLIER_RATING_LABELS,exports.SUPPLIER_RATING_MAX=c,exports.SupplierRatingBreakdown=m,exports.formatOverall=u,exports.formatResponseDelay=d,exports.getHeadlineColor=f,exports.mergeSupplierRatingLabels=t.mergeSupplierRatingLabels;
2
2
  //# sourceMappingURL=SupplierRatingBreakdown.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SupplierRatingBreakdown.cjs","names":[],"sources":["../../../src/components/supplier-rating-badge/SupplierRatingBreakdown.tsx"],"sourcesContent":["import { CheckCircleIcon, XCircleIcon } from '@heroicons/react/24/outline'\nimport { Box, HStack, VStack } from '@stokelp/styled-system/jsx'\n\nimport { Icon, Text } from '~/components'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport {\n mergeSupplierRatingLabels,\n type SupplierRatingCompletionKey,\n type SupplierRatingComponentKey,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './labels'\n\nexport * from './labels'\n\nexport const SUPPLIER_RATING_MAX = 5\n\nconst COMPLETION_ORDER: SupplierRatingCompletionKey[] = [\n 'profile',\n 'location',\n 'contacts',\n 'legalBanking',\n 'sector',\n 'certificate',\n]\n\n/** Note with one decimal in the reader's number format (\"4,2\" in French, \"4.2\" in English). */\nexport function formatOverall(overall: number, locale = 'fr-FR'): string {\n return new Intl.NumberFormat(locale, { minimumFractionDigits: 1, maximumFractionDigits: 1 }).format(overall)\n}\n\n/** Average response delay: minutes → \"45 min\" / \"18 h\" / \"2,5 j\". */\nexport function formatResponseDelay(minutes: number, units: SupplierRatingLabels['units'], locale = 'fr-FR'): string {\n if (minutes < 60) return `${Math.round(minutes)} ${units.minutes}`\n const hours = minutes / 60\n if (hours < 48) return `${Math.round(hours)} ${units.hours}`\n const days = hours / 24\n return `${new Intl.NumberFormat(locale, { maximumFractionDigits: 1 }).format(days)} ${units.days}`\n}\n\nexport function getHeadlineColor(overall: number): string {\n const ratio = overall / SUPPLIER_RATING_MAX\n if (ratio >= 0.7) return '#3B6D11'\n if (ratio >= 0.4) return '#854F0B'\n return '#A32D2D'\n}\n\nfunction getBarColor(ratioPercent: number): string {\n if (ratioPercent >= 70) return '#639922'\n if (ratioPercent >= 40) return '#BA7517'\n return '#E24B4A'\n}\n\ntype ComponentRow = {\n key: SupplierRatingComponentKey\n value: string\n /** 0..100 bar fill, or null when there is no data. */\n barPercent: number | null\n /** Bar/value colour, or undefined for the neutral (no-data) state. */\n color?: string\n}\n\ntype SupplierRatingBreakdownProps = {\n rating: SupplierRating\n /** Original response rate (0..100), displayed as the \"Taux de réponse\" value. */\n responseRate?: number\n labels?: Partial<SupplierRatingLabels>\n}\n\nexport const SupplierRatingBreakdown = ({ rating, responseRate, labels: labelsProp }: SupplierRatingBreakdownProps) => {\n const uiLabels = useUiLabels()\n const labels = mergeSupplierRatingLabels(uiLabels.supplierRating, labelsProp)\n\n const hasResponseRate = responseRate != null\n const hasDelay = rating.responseDelayMinutes != null\n const delayPercent = rating.responseDelayScore != null ? Math.round(rating.responseDelayScore * 100) : null\n const completionPercent = Math.round(rating.completionScore * 100)\n\n const rows: ComponentRow[] = [\n {\n key: 'responseRate',\n value: hasResponseRate ? `${Math.round(responseRate)} %` : labels.notAvailable,\n barPercent: hasResponseRate ? Math.round(responseRate) : null,\n color: hasResponseRate ? getBarColor(Math.round(responseRate)) : undefined,\n },\n {\n key: 'responseDelay',\n value: hasDelay\n ? formatResponseDelay(rating.responseDelayMinutes as number, labels.units, uiLabels.locale)\n : labels.notAvailable,\n barPercent: delayPercent,\n color: delayPercent != null ? getBarColor(delayPercent) : undefined,\n },\n {\n key: 'completion',\n value: `${completionPercent} %`,\n barPercent: completionPercent,\n color: getBarColor(completionPercent),\n },\n ]\n\n return (\n <Box\n bg=\"white\"\n borderRadius=\"radius-8\"\n p=\"space-16\"\n minW=\"240px\"\n maxW=\"260px\"\n css={{ '& *': { fontFamily: 'inherit' } }}\n >\n <HStack justify=\"space-between\" alignItems=\"baseline\" mb=\"space-8\">\n <Text as=\"span\" fontSize=\"body.md\" fontWeight=\"bold\">\n {labels.title}\n </Text>\n {rating.insufficientData || rating.overall == null ? (\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"medium\" color=\"grey.400\">\n {labels.insufficientData}\n </Text>\n ) : (\n <Text as=\"span\" fontSize=\"body.lg\" fontWeight=\"medium\" style={{ color: getHeadlineColor(rating.overall) }}>\n {formatOverall(rating.overall, uiLabels.locale)} / {SUPPLIER_RATING_MAX} ★\n </Text>\n )}\n </HStack>\n\n <Box h=\"1px\" bg=\"grey.100\" mb=\"space-8\" />\n\n <VStack alignItems=\"stretch\" gap=\"space-8\" mb=\"space-8\">\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"bold\" color=\"grey.400\">\n {labels.componentsTitle}\n </Text>\n {rows.map(row => (\n <VStack key={row.key} alignItems=\"stretch\" gap=\"space-2\">\n <HStack justify=\"space-between\" alignItems=\"baseline\" gap=\"space-8\">\n <Text as=\"span\" fontSize=\"body.sm\" color=\"grey.500\">\n {labels.components[row.key]}\n </Text>\n <Text\n as=\"span\"\n fontSize=\"body.sm\"\n fontWeight=\"medium\"\n whiteSpace=\"nowrap\"\n style={{ color: row.color }}\n color={row.color ? undefined : 'grey.300'}\n >\n {row.value}\n </Text>\n </HStack>\n <Box h=\"3px\" bg=\"grey.100\" borderRadius=\"full\" overflow=\"hidden\">\n <Box\n h=\"100%\"\n borderRadius=\"full\"\n style={{\n width: row.barPercent != null ? `${row.barPercent}%` : '0%',\n background: row.color ?? 'transparent',\n }}\n />\n </Box>\n </VStack>\n ))}\n </VStack>\n\n <Box h=\"1px\" bg=\"grey.100\" mb=\"space-8\" />\n\n <VStack alignItems=\"stretch\" gap=\"space-4\">\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"bold\" color=\"grey.400\">\n {labels.completionTitle}\n </Text>\n {COMPLETION_ORDER.map(key => {\n const done = rating.completion[key]\n return (\n <HStack key={key} alignItems=\"center\" gap=\"space-8\">\n <Icon size=\"sm\" color={done ? 'success.500' : 'grey.300'} flexShrink=\"0\">\n {done ? <CheckCircleIcon /> : <XCircleIcon />}\n </Icon>\n <Text as=\"span\" fontSize=\"body.sm\" color={done ? 'grey.500' : 'grey.400'}>\n {labels.completion[key]}\n </Text>\n </HStack>\n )\n })}\n </VStack>\n\n {labels.footer && (\n <>\n <Box h=\"1px\" bg=\"grey.100\" mt=\"space-8\" mb=\"space-8\" />\n <Text as=\"span\" fontSize=\"9px\" color=\"grey.300\" style={{ lineHeight: 1 }}>\n {labels.footer}\n </Text>\n </>\n )}\n </Box>\n )\n}\n"],"mappings":"qfAeA,IAAa,EAAsB,EAE7B,EAAkD,CACtD,UACA,WACA,WACA,eACA,SACA,aACF,EAGA,SAAgB,EAAc,EAAiB,EAAS,QAAiB,CACvE,OAAO,IAAI,KAAK,aAAa,EAAQ,CAAE,sBAAuB,EAAG,sBAAuB,CAAE,CAAC,EAAE,OAAO,CAAO,CAC7G,CAGA,SAAgB,EAAoB,EAAiB,EAAsC,EAAS,QAAiB,CACnH,GAAI,EAAU,GAAI,MAAO,GAAG,KAAK,MAAM,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,EACE,EAAA,EAAA,KAAC,EAAA,IAAD,CAAK,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,SAAW,CAAA,GACtD,EAAA,EAAA,KAAC,EAAA,KAAD,CAAM,GAAG,OAAO,SAAS,MAAM,MAAM,WAAW,MAAO,CAAE,WAAY,CAAE,WACpE,EAAO,MACJ,CAAA,CACN,CAAA,CAAA,CAED,GAET"}
1
+ {"version":3,"file":"SupplierRatingBreakdown.cjs","names":["useUiLabels","mergeSupplierRatingLabels","Box","HStack","Text","VStack","Icon","CheckCircleIcon","XCircleIcon","_Fragment","require_Text","require_labels","require_UiLabelsProvider","require_Icon","require_CheckCircleIcon","require_XCircleIcon","_stokelp_styled_system_jsx","react_jsx_runtime","SUPPLIER_RATING_MAX","COMPLETION_ORDER","formatOverall","locale","overall","formatResponseDelay","minutes","units","hours","days","getHeadlineColor","ratio","getBarColor","ratioPercent","SupplierRatingBreakdown","labelsProp","uiLabels","labels","hasResponseRate","responseRate","hasDelay","rating","delayPercent","completionPercent","rows","row","done","key"],"sources":["../../../src/components/supplier-rating-badge/SupplierRatingBreakdown.tsx"],"sourcesContent":["import { CheckCircleIcon, XCircleIcon } from '@heroicons/react/24/outline'\nimport { Box, HStack, VStack } from '@stokelp/styled-system/jsx'\n\nimport { Icon, Text } from '~/components'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport {\n mergeSupplierRatingLabels,\n type SupplierRatingCompletionKey,\n type SupplierRatingComponentKey,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './labels'\n\nexport * from './labels'\n\nexport const SUPPLIER_RATING_MAX = 5\n\nconst COMPLETION_ORDER: SupplierRatingCompletionKey[] = [\n 'profile',\n 'location',\n 'contacts',\n 'legalBanking',\n 'sector',\n 'certificate',\n]\n\n/** Note with one decimal in the reader's number format (\"4,2\" in French, \"4.2\" in English). */\nexport function formatOverall(overall: number, locale = 'fr-FR'): string {\n return new Intl.NumberFormat(locale, { minimumFractionDigits: 1, maximumFractionDigits: 1 }).format(overall)\n}\n\n/** Average response delay: minutes → \"45 min\" / \"18 h\" / \"2,5 j\". */\nexport function formatResponseDelay(minutes: number, units: SupplierRatingLabels['units'], locale = 'fr-FR'): string {\n if (minutes < 60) return `${Math.round(minutes)} ${units.minutes}`\n const hours = minutes / 60\n if (hours < 48) return `${Math.round(hours)} ${units.hours}`\n const days = hours / 24\n return `${new Intl.NumberFormat(locale, { maximumFractionDigits: 1 }).format(days)} ${units.days}`\n}\n\nexport function getHeadlineColor(overall: number): string {\n const ratio = overall / SUPPLIER_RATING_MAX\n if (ratio >= 0.7) return '#3B6D11'\n if (ratio >= 0.4) return '#854F0B'\n return '#A32D2D'\n}\n\nfunction getBarColor(ratioPercent: number): string {\n if (ratioPercent >= 70) return '#639922'\n if (ratioPercent >= 40) return '#BA7517'\n return '#E24B4A'\n}\n\ntype ComponentRow = {\n key: SupplierRatingComponentKey\n value: string\n /** 0..100 bar fill, or null when there is no data. */\n barPercent: number | null\n /** Bar/value colour, or undefined for the neutral (no-data) state. */\n color?: string\n}\n\ntype SupplierRatingBreakdownProps = {\n rating: SupplierRating\n /** Original response rate (0..100), displayed as the \"Taux de réponse\" value. */\n responseRate?: number\n labels?: Partial<SupplierRatingLabels>\n}\n\nexport const SupplierRatingBreakdown = ({ rating, responseRate, labels: labelsProp }: SupplierRatingBreakdownProps) => {\n const uiLabels = useUiLabels()\n const labels = mergeSupplierRatingLabels(uiLabels.supplierRating, labelsProp)\n\n const hasResponseRate = responseRate != null\n const hasDelay = rating.responseDelayMinutes != null\n const delayPercent = rating.responseDelayScore != null ? Math.round(rating.responseDelayScore * 100) : null\n const completionPercent = Math.round(rating.completionScore * 100)\n\n const rows: ComponentRow[] = [\n {\n key: 'responseRate',\n value: hasResponseRate ? `${Math.round(responseRate)} %` : labels.notAvailable,\n barPercent: hasResponseRate ? Math.round(responseRate) : null,\n color: hasResponseRate ? getBarColor(Math.round(responseRate)) : undefined,\n },\n {\n key: 'responseDelay',\n value: hasDelay\n ? formatResponseDelay(rating.responseDelayMinutes as number, labels.units, uiLabels.locale)\n : labels.notAvailable,\n barPercent: delayPercent,\n color: delayPercent != null ? getBarColor(delayPercent) : undefined,\n },\n {\n key: 'completion',\n value: `${completionPercent} %`,\n barPercent: completionPercent,\n color: getBarColor(completionPercent),\n },\n ]\n\n return (\n <Box\n bg=\"white\"\n borderRadius=\"radius-8\"\n p=\"space-16\"\n minW=\"240px\"\n maxW=\"260px\"\n css={{ '& *': { fontFamily: 'inherit' } }}\n >\n <HStack justify=\"space-between\" alignItems=\"baseline\" mb=\"space-8\">\n <Text as=\"span\" fontSize=\"body.md\" fontWeight=\"bold\">\n {labels.title}\n </Text>\n {rating.insufficientData || rating.overall == null ? (\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"medium\" color=\"grey.400\">\n {labels.insufficientData}\n </Text>\n ) : (\n <Text as=\"span\" fontSize=\"body.lg\" fontWeight=\"medium\" style={{ color: getHeadlineColor(rating.overall) }}>\n {formatOverall(rating.overall, uiLabels.locale)} / {SUPPLIER_RATING_MAX} ★\n </Text>\n )}\n </HStack>\n\n <Box h=\"1px\" bg=\"grey.100\" mb=\"space-8\" />\n\n <VStack alignItems=\"stretch\" gap=\"space-8\" mb=\"space-8\">\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"bold\" color=\"grey.400\">\n {labels.componentsTitle}\n </Text>\n {rows.map(row => (\n <VStack key={row.key} alignItems=\"stretch\" gap=\"space-2\">\n <HStack justify=\"space-between\" alignItems=\"baseline\" gap=\"space-8\">\n <Text as=\"span\" fontSize=\"body.sm\" color=\"grey.500\">\n {labels.components[row.key]}\n </Text>\n <Text\n as=\"span\"\n fontSize=\"body.sm\"\n fontWeight=\"medium\"\n whiteSpace=\"nowrap\"\n style={{ color: row.color }}\n color={row.color ? undefined : 'grey.300'}\n >\n {row.value}\n </Text>\n </HStack>\n <Box h=\"3px\" bg=\"grey.100\" borderRadius=\"full\" overflow=\"hidden\">\n <Box\n h=\"100%\"\n borderRadius=\"full\"\n style={{\n width: row.barPercent != null ? `${row.barPercent}%` : '0%',\n background: row.color ?? 'transparent',\n }}\n />\n </Box>\n </VStack>\n ))}\n </VStack>\n\n <Box h=\"1px\" bg=\"grey.100\" mb=\"space-8\" />\n\n <VStack alignItems=\"stretch\" gap=\"space-4\">\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"bold\" color=\"grey.400\">\n {labels.completionTitle}\n </Text>\n {COMPLETION_ORDER.map(key => {\n const done = rating.completion[key]\n return (\n <HStack key={key} alignItems=\"center\" gap=\"space-8\">\n <Icon size=\"sm\" color={done ? 'success.500' : 'grey.300'} flexShrink=\"0\">\n {done ? <CheckCircleIcon /> : <XCircleIcon />}\n </Icon>\n <Text as=\"span\" fontSize=\"body.sm\" color={done ? 'grey.500' : 'grey.400'}>\n {labels.completion[key]}\n </Text>\n </HStack>\n )\n })}\n </VStack>\n\n {labels.footer && (\n <>\n <Box h=\"1px\" bg=\"grey.100\" mt=\"space-8\" mb=\"space-8\" />\n <Text as=\"span\" fontSize=\"9px\" color=\"grey.300\" style={{ lineHeight: 1 }}>\n {labels.footer}\n </Text>\n </>\n )}\n </Box>\n )\n}\n"],"mappings":"A,qfAeA,IAAakB,EAAsB,EAE7BC,EAAkD,CACtD,UACA,WACA,WACA,eACA,SACA,aACF,EAGA,SAAgBC,EAAc,EAAiB,EAAS,QAAiB,CACvE,OAAO,IAAI,KAAK,aAAaC,EAAQ,CAAE,sBAAuB,EAAG,sBAAuB,CAAE,CAAC,CAAC,CAAC,OAAOC,CAAO,CAC7G,CAGA,SAAgBC,EAAoB,EAAiB,EAAsC,EAAS,QAAiB,CACnH,GAAIC,EAAU,GAAI,MAAO,GAAG,KAAK,MAAMA,CAAO,EAAE,GAAGC,EAAM,UACzD,IAAMC,EAAQF,EAAU,GACxB,GAAIE,EAAQ,GAAI,MAAO,GAAG,KAAK,MAAMA,CAAK,EAAE,GAAGD,EAAM,QACrD,IAAME,EAAOD,EAAQ,GACr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A,GAAI,EAAAU,EAAA,IAAA,CAACT,EAAAA,QAAD,CAAc,CAAA,CACxC,CAAA,GACN,EAAAS,EAAA,IAAA,CAACb,EAAAA,KAAD,CAAM,GAAG,OAAO,SAAS,UAAU,MAAOwC,EAAO,WAAa,WAC3D,SAAAT,EAAO,WAAWU,EACf,CAAA,CACA,CAPK,EAAAA,CAOL,CAEZ,CAAC,CACK,C,GAEPV,EAAO,SACN,EAAAlB,EAAA,KAAA,CAAAR,EAAAA,SAAA,CAAA,SAAA,EACE,EAAAQ,EAAA,IAAA,CAACf,EAAAA,IAAD,CAAK,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,SAAW,CAAA,GACtD,EAAAe,EAAA,IAAA,CAACb,EAAAA,KAAD,CAAM,GAAG,OAAO,SAAS,MAAM,MAAM,WAAW,MAAO,CAAE,WAAY,CAAE,EACpE,SAAA+B,EAAO,MACJ,CAAA,CACN,CAAA,CAAA,CAED,C,EAET,E"}
@@ -12,4 +12,4 @@ type SupplierRatingBreakdownProps = {
12
12
  responseRate?: number;
13
13
  labels?: Partial<SupplierRatingLabels>;
14
14
  };
15
- export declare const SupplierRatingBreakdown: ({ rating, responseRate, labels: labelsProp }: SupplierRatingBreakdownProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const SupplierRatingBreakdown: ({ rating, responseRate, labels: labelsProp }: SupplierRatingBreakdownProps) => import('react').JSX.Element;
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  import { Text as e } from "../text/Text.js";
3
- import { mergeSupplierRatingLabels as t } from "./labels.js";
4
- import { useUiLabels as n } from "../ui-labels/UiLabelsProvider.js";
5
- import { Icon as r } from "../icon/Icon.js";
6
- import i from "../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.js";
7
- import a from "../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.js";
8
- import { Box as o, HStack as s, VStack as c } from "@stokelp/styled-system/jsx";
9
- import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
10
- //#region src/components/supplier-rating-badge/SupplierRatingBreakdown.tsx
11
- var f = 5, p = [
3
+ import { DEFAULT_SUPPLIER_RATING_LABELS as t, mergeSupplierRatingLabels as n } from "./labels.js";
4
+ import { useUiLabels as r } from "../ui-labels/UiLabelsProvider.js";
5
+ import { Icon as i } from "../icon/Icon.js";
6
+ import a from "../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.js";
7
+ import o from "../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.js";
8
+ import { Box as s, HStack as c, VStack as l } from "@stokelp/styled-system/jsx";
9
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
10
+ // src/components/supplier-rating-badge/SupplierRatingBreakdown.tsx
11
+ var p = 5, m = [
12
12
  "profile",
13
13
  "location",
14
14
  "contacts",
@@ -16,48 +16,48 @@ var f = 5, p = [
16
16
  "sector",
17
17
  "certificate"
18
18
  ];
19
- function m(e, t = "fr-FR") {
19
+ function h(e, t = "fr-FR") {
20
20
  return new Intl.NumberFormat(t, {
21
21
  minimumFractionDigits: 1,
22
22
  maximumFractionDigits: 1
23
23
  }).format(e);
24
24
  }
25
- function h(e, t, n = "fr-FR") {
25
+ function g(e, t, n = "fr-FR") {
26
26
  if (e < 60) return `${Math.round(e)} ${t.minutes}`;
27
27
  let r = e / 60;
28
28
  if (r < 48) return `${Math.round(r)} ${t.hours}`;
29
29
  let i = r / 24;
30
30
  return `${new Intl.NumberFormat(n, { maximumFractionDigits: 1 }).format(i)} ${t.days}`;
31
31
  }
32
- function g(e) {
32
+ function _(e) {
33
33
  let t = e / 5;
34
34
  return t >= .7 ? "#3B6D11" : t >= .4 ? "#854F0B" : "#A32D2D";
35
35
  }
36
- function _(e) {
36
+ function v(e) {
37
37
  return e >= 70 ? "#639922" : e >= 40 ? "#BA7517" : "#E24B4A";
38
38
  }
39
- var v = ({ rating: f, responseRate: v, labels: y }) => {
40
- let b = n(), x = t(b.supplierRating, y), S = v != null, C = f.responseDelayMinutes != null, w = f.responseDelayScore == null ? null : Math.round(f.responseDelayScore * 100), T = Math.round(f.completionScore * 100), E = [
39
+ var y = ({ rating: t, responseRate: p, labels: y }) => {
40
+ let b = r(), x = n(b.supplierRating, y), S = p != null, C = t.responseDelayMinutes != null, w = t.responseDelayScore == null ? null : Math.round(t.responseDelayScore * 100), T = Math.round(t.completionScore * 100), E = [
41
41
  {
42
42
  key: "responseRate",
43
- value: S ? `${Math.round(v)} %` : x.notAvailable,
44
- barPercent: S ? Math.round(v) : null,
45
- color: S ? _(Math.round(v)) : void 0
43
+ value: S ? `${Math.round(p)} %` : x.notAvailable,
44
+ barPercent: S ? Math.round(p) : null,
45
+ color: S ? v(Math.round(p)) : void 0
46
46
  },
47
47
  {
48
48
  key: "responseDelay",
49
- value: C ? h(f.responseDelayMinutes, x.units, b.locale) : x.notAvailable,
49
+ value: C ? g(t.responseDelayMinutes, x.units, b.locale) : x.notAvailable,
50
50
  barPercent: w,
51
- color: w == null ? void 0 : _(w)
51
+ color: w == null ? void 0 : v(w)
52
52
  },
53
53
  {
54
54
  key: "completion",
55
55
  value: `${T} %`,
56
56
  barPercent: T,
57
- color: _(T)
57
+ color: v(T)
58
58
  }
59
59
  ];
60
- return /* @__PURE__ */ d(o, {
60
+ return /* @__PURE__ */ f(s, {
61
61
  bg: "white",
62
62
  borderRadius: "radius-8",
63
63
  p: "space-16",
@@ -65,62 +65,62 @@ var v = ({ rating: f, responseRate: v, labels: y }) => {
65
65
  maxW: "260px",
66
66
  css: { "& *": { fontFamily: "inherit" } },
67
67
  children: [
68
- /* @__PURE__ */ d(s, {
68
+ /* @__PURE__ */ f(c, {
69
69
  justify: "space-between",
70
70
  alignItems: "baseline",
71
71
  mb: "space-8",
72
- children: [/* @__PURE__ */ u(e, {
72
+ children: [/* @__PURE__ */ d(e, {
73
73
  as: "span",
74
74
  fontSize: "body.md",
75
75
  fontWeight: "bold",
76
76
  children: x.title
77
- }), f.insufficientData || f.overall == null ? /* @__PURE__ */ u(e, {
77
+ }), t.insufficientData || t.overall == null ? /* @__PURE__ */ d(e, {
78
78
  as: "span",
79
79
  fontSize: "body.sm",
80
80
  fontWeight: "medium",
81
81
  color: "grey.400",
82
82
  children: x.insufficientData
83
- }) : /* @__PURE__ */ d(e, {
83
+ }) : /* @__PURE__ */ f(e, {
84
84
  as: "span",
85
85
  fontSize: "body.lg",
86
86
  fontWeight: "medium",
87
- style: { color: g(f.overall) },
87
+ style: { color: _(t.overall) },
88
88
  children: [
89
- m(f.overall, b.locale),
89
+ h(t.overall, b.locale),
90
90
  " / ",
91
91
  5,
92
92
  " ★"
93
93
  ]
94
94
  })]
95
95
  }),
96
- /* @__PURE__ */ u(o, {
96
+ /* @__PURE__ */ d(s, {
97
97
  h: "1px",
98
98
  bg: "grey.100",
99
99
  mb: "space-8"
100
100
  }),
101
- /* @__PURE__ */ d(c, {
101
+ /* @__PURE__ */ f(l, {
102
102
  alignItems: "stretch",
103
103
  gap: "space-8",
104
104
  mb: "space-8",
105
- children: [/* @__PURE__ */ u(e, {
105
+ children: [/* @__PURE__ */ d(e, {
106
106
  as: "span",
107
107
  fontSize: "body.sm",
108
108
  fontWeight: "bold",
109
109
  color: "grey.400",
110
110
  children: x.componentsTitle
111
- }), E.map((t) => /* @__PURE__ */ d(c, {
111
+ }), E.map((t) => /* @__PURE__ */ f(l, {
112
112
  alignItems: "stretch",
113
113
  gap: "space-2",
114
- children: [/* @__PURE__ */ d(s, {
114
+ children: [/* @__PURE__ */ f(c, {
115
115
  justify: "space-between",
116
116
  alignItems: "baseline",
117
117
  gap: "space-8",
118
- children: [/* @__PURE__ */ u(e, {
118
+ children: [/* @__PURE__ */ d(e, {
119
119
  as: "span",
120
120
  fontSize: "body.sm",
121
121
  color: "grey.500",
122
122
  children: x.components[t.key]
123
- }), /* @__PURE__ */ u(e, {
123
+ }), /* @__PURE__ */ d(e, {
124
124
  as: "span",
125
125
  fontSize: "body.sm",
126
126
  fontWeight: "medium",
@@ -129,12 +129,12 @@ var v = ({ rating: f, responseRate: v, labels: y }) => {
129
129
  color: t.color ? void 0 : "grey.300",
130
130
  children: t.value
131
131
  })]
132
- }), /* @__PURE__ */ u(o, {
132
+ }), /* @__PURE__ */ d(s, {
133
133
  h: "3px",
134
134
  bg: "grey.100",
135
135
  borderRadius: "full",
136
136
  overflow: "hidden",
137
- children: /* @__PURE__ */ u(o, {
137
+ children: /* @__PURE__ */ d(s, {
138
138
  h: "100%",
139
139
  borderRadius: "full",
140
140
  style: {
@@ -145,45 +145,45 @@ var v = ({ rating: f, responseRate: v, labels: y }) => {
145
145
  })]
146
146
  }, t.key))]
147
147
  }),
148
- /* @__PURE__ */ u(o, {
148
+ /* @__PURE__ */ d(s, {
149
149
  h: "1px",
150
150
  bg: "grey.100",
151
151
  mb: "space-8"
152
152
  }),
153
- /* @__PURE__ */ d(c, {
153
+ /* @__PURE__ */ f(l, {
154
154
  alignItems: "stretch",
155
155
  gap: "space-4",
156
- children: [/* @__PURE__ */ u(e, {
156
+ children: [/* @__PURE__ */ d(e, {
157
157
  as: "span",
158
158
  fontSize: "body.sm",
159
159
  fontWeight: "bold",
160
160
  color: "grey.400",
161
161
  children: x.completionTitle
162
- }), p.map((t) => {
163
- let n = f.completion[t];
164
- return /* @__PURE__ */ d(s, {
162
+ }), m.map((n) => {
163
+ let r = t.completion[n];
164
+ return /* @__PURE__ */ f(c, {
165
165
  alignItems: "center",
166
166
  gap: "space-8",
167
- children: [/* @__PURE__ */ u(r, {
167
+ children: [/* @__PURE__ */ d(i, {
168
168
  size: "sm",
169
- color: n ? "success.500" : "grey.300",
169
+ color: r ? "success.500" : "grey.300",
170
170
  flexShrink: "0",
171
- children: u(n ? i : a, {})
172
- }), /* @__PURE__ */ u(e, {
171
+ children: d(r ? a : o, {})
172
+ }), /* @__PURE__ */ d(e, {
173
173
  as: "span",
174
174
  fontSize: "body.sm",
175
- color: n ? "grey.500" : "grey.400",
176
- children: x.completion[t]
175
+ color: r ? "grey.500" : "grey.400",
176
+ children: x.completion[n]
177
177
  })]
178
- }, t);
178
+ }, n);
179
179
  })]
180
180
  }),
181
- x.footer && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(o, {
181
+ x.footer && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(s, {
182
182
  h: "1px",
183
183
  bg: "grey.100",
184
184
  mt: "space-8",
185
185
  mb: "space-8"
186
- }), /* @__PURE__ */ u(e, {
186
+ }), /* @__PURE__ */ d(e, {
187
187
  as: "span",
188
188
  fontSize: "9px",
189
189
  color: "grey.300",
@@ -193,7 +193,6 @@ var v = ({ rating: f, responseRate: v, labels: y }) => {
193
193
  ]
194
194
  });
195
195
  };
196
- //#endregion
197
- export { f as SUPPLIER_RATING_MAX, v as SupplierRatingBreakdown, m as formatOverall, h as formatResponseDelay, g as getHeadlineColor };
196
+ export { t as DEFAULT_SUPPLIER_RATING_LABELS, p as SUPPLIER_RATING_MAX, y as SupplierRatingBreakdown, h as formatOverall, g as formatResponseDelay, _ as getHeadlineColor, n as mergeSupplierRatingLabels };
198
197
 
199
198
  //# sourceMappingURL=SupplierRatingBreakdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SupplierRatingBreakdown.js","names":[],"sources":["../../../src/components/supplier-rating-badge/SupplierRatingBreakdown.tsx"],"sourcesContent":["import { CheckCircleIcon, XCircleIcon } from '@heroicons/react/24/outline'\nimport { Box, HStack, VStack } from '@stokelp/styled-system/jsx'\n\nimport { Icon, Text } from '~/components'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport {\n mergeSupplierRatingLabels,\n type SupplierRatingCompletionKey,\n type SupplierRatingComponentKey,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './labels'\n\nexport * from './labels'\n\nexport const SUPPLIER_RATING_MAX = 5\n\nconst COMPLETION_ORDER: SupplierRatingCompletionKey[] = [\n 'profile',\n 'location',\n 'contacts',\n 'legalBanking',\n 'sector',\n 'certificate',\n]\n\n/** Note with one decimal in the reader's number format (\"4,2\" in French, \"4.2\" in English). */\nexport function formatOverall(overall: number, locale = 'fr-FR'): string {\n return new Intl.NumberFormat(locale, { minimumFractionDigits: 1, maximumFractionDigits: 1 }).format(overall)\n}\n\n/** Average response delay: minutes → \"45 min\" / \"18 h\" / \"2,5 j\". */\nexport function formatResponseDelay(minutes: number, units: SupplierRatingLabels['units'], locale = 'fr-FR'): string {\n if (minutes < 60) return `${Math.round(minutes)} ${units.minutes}`\n const hours = minutes / 60\n if (hours < 48) return `${Math.round(hours)} ${units.hours}`\n const days = hours / 24\n return `${new Intl.NumberFormat(locale, { maximumFractionDigits: 1 }).format(days)} ${units.days}`\n}\n\nexport function getHeadlineColor(overall: number): string {\n const ratio = overall / SUPPLIER_RATING_MAX\n if (ratio >= 0.7) return '#3B6D11'\n if (ratio >= 0.4) return '#854F0B'\n return '#A32D2D'\n}\n\nfunction getBarColor(ratioPercent: number): string {\n if (ratioPercent >= 70) return '#639922'\n if (ratioPercent >= 40) return '#BA7517'\n return '#E24B4A'\n}\n\ntype ComponentRow = {\n key: SupplierRatingComponentKey\n value: string\n /** 0..100 bar fill, or null when there is no data. */\n barPercent: number | null\n /** Bar/value colour, or undefined for the neutral (no-data) state. */\n color?: string\n}\n\ntype SupplierRatingBreakdownProps = {\n rating: SupplierRating\n /** Original response rate (0..100), displayed as the \"Taux de réponse\" value. */\n responseRate?: number\n labels?: Partial<SupplierRatingLabels>\n}\n\nexport const SupplierRatingBreakdown = ({ rating, responseRate, labels: labelsProp }: SupplierRatingBreakdownProps) => {\n const uiLabels = useUiLabels()\n const labels = mergeSupplierRatingLabels(uiLabels.supplierRating, labelsProp)\n\n const hasResponseRate = responseRate != null\n const hasDelay = rating.responseDelayMinutes != null\n const delayPercent = rating.responseDelayScore != null ? Math.round(rating.responseDelayScore * 100) : null\n const completionPercent = Math.round(rating.completionScore * 100)\n\n const rows: ComponentRow[] = [\n {\n key: 'responseRate',\n value: hasResponseRate ? `${Math.round(responseRate)} %` : labels.notAvailable,\n barPercent: hasResponseRate ? Math.round(responseRate) : null,\n color: hasResponseRate ? getBarColor(Math.round(responseRate)) : undefined,\n },\n {\n key: 'responseDelay',\n value: hasDelay\n ? formatResponseDelay(rating.responseDelayMinutes as number, labels.units, uiLabels.locale)\n : labels.notAvailable,\n barPercent: delayPercent,\n color: delayPercent != null ? getBarColor(delayPercent) : undefined,\n },\n {\n key: 'completion',\n value: `${completionPercent} %`,\n barPercent: completionPercent,\n color: getBarColor(completionPercent),\n },\n ]\n\n return (\n <Box\n bg=\"white\"\n borderRadius=\"radius-8\"\n p=\"space-16\"\n minW=\"240px\"\n maxW=\"260px\"\n css={{ '& *': { fontFamily: 'inherit' } }}\n >\n <HStack justify=\"space-between\" alignItems=\"baseline\" mb=\"space-8\">\n <Text as=\"span\" fontSize=\"body.md\" fontWeight=\"bold\">\n {labels.title}\n </Text>\n {rating.insufficientData || rating.overall == null ? (\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"medium\" color=\"grey.400\">\n {labels.insufficientData}\n </Text>\n ) : (\n <Text as=\"span\" fontSize=\"body.lg\" fontWeight=\"medium\" style={{ color: getHeadlineColor(rating.overall) }}>\n {formatOverall(rating.overall, uiLabels.locale)} / {SUPPLIER_RATING_MAX} ★\n </Text>\n )}\n </HStack>\n\n <Box h=\"1px\" bg=\"grey.100\" mb=\"space-8\" />\n\n <VStack alignItems=\"stretch\" gap=\"space-8\" mb=\"space-8\">\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"bold\" color=\"grey.400\">\n {labels.componentsTitle}\n </Text>\n {rows.map(row => (\n <VStack key={row.key} alignItems=\"stretch\" gap=\"space-2\">\n <HStack justify=\"space-between\" alignItems=\"baseline\" gap=\"space-8\">\n <Text as=\"span\" fontSize=\"body.sm\" color=\"grey.500\">\n {labels.components[row.key]}\n </Text>\n <Text\n as=\"span\"\n fontSize=\"body.sm\"\n fontWeight=\"medium\"\n whiteSpace=\"nowrap\"\n style={{ color: row.color }}\n color={row.color ? undefined : 'grey.300'}\n >\n {row.value}\n </Text>\n </HStack>\n <Box h=\"3px\" bg=\"grey.100\" borderRadius=\"full\" overflow=\"hidden\">\n <Box\n h=\"100%\"\n borderRadius=\"full\"\n style={{\n width: row.barPercent != null ? `${row.barPercent}%` : '0%',\n background: row.color ?? 'transparent',\n }}\n />\n </Box>\n </VStack>\n ))}\n </VStack>\n\n <Box h=\"1px\" bg=\"grey.100\" mb=\"space-8\" />\n\n <VStack alignItems=\"stretch\" gap=\"space-4\">\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"bold\" color=\"grey.400\">\n {labels.completionTitle}\n </Text>\n {COMPLETION_ORDER.map(key => {\n const done = rating.completion[key]\n return (\n <HStack key={key} alignItems=\"center\" gap=\"space-8\">\n <Icon size=\"sm\" color={done ? 'success.500' : 'grey.300'} flexShrink=\"0\">\n {done ? <CheckCircleIcon /> : <XCircleIcon />}\n </Icon>\n <Text as=\"span\" fontSize=\"body.sm\" color={done ? 'grey.500' : 'grey.400'}>\n {labels.completion[key]}\n </Text>\n </HStack>\n )\n })}\n </VStack>\n\n {labels.footer && (\n <>\n <Box h=\"1px\" bg=\"grey.100\" mt=\"space-8\" mb=\"space-8\" />\n <Text as=\"span\" fontSize=\"9px\" color=\"grey.300\" style={{ lineHeight: 1 }}>\n {labels.footer}\n </Text>\n </>\n )}\n </Box>\n )\n}\n"],"mappings":";;;;;;;;;;AAeA,IAAa,IAAsB,GAE7B,IAAkD;CACtD;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,SAAgB,EAAc,GAAiB,IAAS,SAAiB;CACvE,OAAO,IAAI,KAAK,aAAa,GAAQ;EAAE,uBAAuB;EAAG,uBAAuB;CAAE,CAAC,EAAE,OAAO,CAAO;AAC7G;AAGA,SAAgB,EAAo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AC,GAAD;MAAK,GAAE;MAAM,IAAG;MAAW,cAAa;MAAO,UAAS;gBACtD,kBAAC,GAAD;OACE,GAAE;OACF,cAAa;OACb,OAAO;QACL,OAAO,EAAI,cAAc,OAA8B,OAAvB,GAAG,EAAI,WAAW;QAClD,YAAY,EAAI,SAAS;OAC3B;MACD,CAAA;KACE,CAAA,CACC;OA1BK,EAAI,GA0BT,CACT,CACK;;GAER,kBAAC,GAAD;IAAK,GAAE;IAAM,IAAG;IAAW,IAAG;GAAW,CAAA;GAEzC,kBAAC,GAAD;IAAQ,YAAW;IAAU,KAAI;cAAjC,CACE,kBAAC,GAAD;KAAM,IAAG;KAAO,UAAS;KAAU,YAAW;KAAO,OAAM;eACxD,EAAO;IACJ,CAAA,GACL,EAAiB,KAAI,MAAO;KAC3B,IAAM,IAAO,EAAO,WAAW;KAC/B,OACE,kBAAC,GAAD;MAAkB,YAAW;MAAS,KAAI;gBAA1C,CACE,kBAAC,GAAD;OAAM,MAAK;OAAK,OAAO,IAAO,gBAAgB;OAAY,YAAW;iBAC3D,EAAP,IAAQ,IAAsB,GAAvB,CAAkB,CAAkB;MACxC,CAAA,GACN,kBAAC,GAAD;OAAM,IAAG;OAAO,UAAS;OAAU,OAAO,IAAO,aAAa;iBAC3D,EAAO,WAAW;MACf,CAAA,CACA;QAPK,CAOL;IAEZ,CAAC,CACK;;GAEP,EAAO,UACN,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;IAAK,GAAE;IAAM,IAAG;IAAW,IAAG;IAAU,IAAG;GAAW,CAAA,GACtD,kBAAC,GAAD;IAAM,IAAG;IAAO,UAAS;IAAM,OAAM;IAAW,OAAO,EAAE,YAAY,EAAE;cACpE,EAAO;GACJ,CAAA,CACN,EAAA,CAAA;EAED;;AAET"}
1
+ {"version":3,"file":"SupplierRatingBreakdown.js","names":["CheckCircleIcon","XCircleIcon","_Fragment","ForwardRef","ForwardRef$1","SUPPLIER_RATING_MAX","COMPLETION_ORDER","formatOverall","locale","overall","formatResponseDelay","minutes","units","hours","days","getHeadlineColor","ratio","getBarColor","ratioPercent","SupplierRatingBreakdown","labelsProp","uiLabels","useUiLabels","labels","mergeSupplierRatingLabels","hasResponseRate","responseRate","hasDelay","rating","delayPercent","completionPercent","rows","Box","HStack","Text","VStack","row","done","key","Icon","jsx","Fragment","DEFAULT_SUPPLIER_RATING_LABELS"],"sources":["../../../src/components/supplier-rating-badge/SupplierRatingBreakdown.tsx"],"sourcesContent":["import { CheckCircleIcon, XCircleIcon } from '@heroicons/react/24/outline'\nimport { Box, HStack, VStack } from '@stokelp/styled-system/jsx'\n\nimport { Icon, Text } from '~/components'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport {\n mergeSupplierRatingLabels,\n type SupplierRatingCompletionKey,\n type SupplierRatingComponentKey,\n type SupplierRating,\n type SupplierRatingLabels,\n} from './labels'\n\nexport * from './labels'\n\nexport const SUPPLIER_RATING_MAX = 5\n\nconst COMPLETION_ORDER: SupplierRatingCompletionKey[] = [\n 'profile',\n 'location',\n 'contacts',\n 'legalBanking',\n 'sector',\n 'certificate',\n]\n\n/** Note with one decimal in the reader's number format (\"4,2\" in French, \"4.2\" in English). */\nexport function formatOverall(overall: number, locale = 'fr-FR'): string {\n return new Intl.NumberFormat(locale, { minimumFractionDigits: 1, maximumFractionDigits: 1 }).format(overall)\n}\n\n/** Average response delay: minutes → \"45 min\" / \"18 h\" / \"2,5 j\". */\nexport function formatResponseDelay(minutes: number, units: SupplierRatingLabels['units'], locale = 'fr-FR'): string {\n if (minutes < 60) return `${Math.round(minutes)} ${units.minutes}`\n const hours = minutes / 60\n if (hours < 48) return `${Math.round(hours)} ${units.hours}`\n const days = hours / 24\n return `${new Intl.NumberFormat(locale, { maximumFractionDigits: 1 }).format(days)} ${units.days}`\n}\n\nexport function getHeadlineColor(overall: number): string {\n const ratio = overall / SUPPLIER_RATING_MAX\n if (ratio >= 0.7) return '#3B6D11'\n if (ratio >= 0.4) return '#854F0B'\n return '#A32D2D'\n}\n\nfunction getBarColor(ratioPercent: number): string {\n if (ratioPercent >= 70) return '#639922'\n if (ratioPercent >= 40) return '#BA7517'\n return '#E24B4A'\n}\n\ntype ComponentRow = {\n key: SupplierRatingComponentKey\n value: string\n /** 0..100 bar fill, or null when there is no data. */\n barPercent: number | null\n /** Bar/value colour, or undefined for the neutral (no-data) state. */\n color?: string\n}\n\ntype SupplierRatingBreakdownProps = {\n rating: SupplierRating\n /** Original response rate (0..100), displayed as the \"Taux de réponse\" value. */\n responseRate?: number\n labels?: Partial<SupplierRatingLabels>\n}\n\nexport const SupplierRatingBreakdown = ({ rating, responseRate, labels: labelsProp }: SupplierRatingBreakdownProps) => {\n const uiLabels = useUiLabels()\n const labels = mergeSupplierRatingLabels(uiLabels.supplierRating, labelsProp)\n\n const hasResponseRate = responseRate != null\n const hasDelay = rating.responseDelayMinutes != null\n const delayPercent = rating.responseDelayScore != null ? Math.round(rating.responseDelayScore * 100) : null\n const completionPercent = Math.round(rating.completionScore * 100)\n\n const rows: ComponentRow[] = [\n {\n key: 'responseRate',\n value: hasResponseRate ? `${Math.round(responseRate)} %` : labels.notAvailable,\n barPercent: hasResponseRate ? Math.round(responseRate) : null,\n color: hasResponseRate ? getBarColor(Math.round(responseRate)) : undefined,\n },\n {\n key: 'responseDelay',\n value: hasDelay\n ? formatResponseDelay(rating.responseDelayMinutes as number, labels.units, uiLabels.locale)\n : labels.notAvailable,\n barPercent: delayPercent,\n color: delayPercent != null ? getBarColor(delayPercent) : undefined,\n },\n {\n key: 'completion',\n value: `${completionPercent} %`,\n barPercent: completionPercent,\n color: getBarColor(completionPercent),\n },\n ]\n\n return (\n <Box\n bg=\"white\"\n borderRadius=\"radius-8\"\n p=\"space-16\"\n minW=\"240px\"\n maxW=\"260px\"\n css={{ '& *': { fontFamily: 'inherit' } }}\n >\n <HStack justify=\"space-between\" alignItems=\"baseline\" mb=\"space-8\">\n <Text as=\"span\" fontSize=\"body.md\" fontWeight=\"bold\">\n {labels.title}\n </Text>\n {rating.insufficientData || rating.overall == null ? (\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"medium\" color=\"grey.400\">\n {labels.insufficientData}\n </Text>\n ) : (\n <Text as=\"span\" fontSize=\"body.lg\" fontWeight=\"medium\" style={{ color: getHeadlineColor(rating.overall) }}>\n {formatOverall(rating.overall, uiLabels.locale)} / {SUPPLIER_RATING_MAX} ★\n </Text>\n )}\n </HStack>\n\n <Box h=\"1px\" bg=\"grey.100\" mb=\"space-8\" />\n\n <VStack alignItems=\"stretch\" gap=\"space-8\" mb=\"space-8\">\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"bold\" color=\"grey.400\">\n {labels.componentsTitle}\n </Text>\n {rows.map(row => (\n <VStack key={row.key} alignItems=\"stretch\" gap=\"space-2\">\n <HStack justify=\"space-between\" alignItems=\"baseline\" gap=\"space-8\">\n <Text as=\"span\" fontSize=\"body.sm\" color=\"grey.500\">\n {labels.components[row.key]}\n </Text>\n <Text\n as=\"span\"\n fontSize=\"body.sm\"\n fontWeight=\"medium\"\n whiteSpace=\"nowrap\"\n style={{ color: row.color }}\n color={row.color ? undefined : 'grey.300'}\n >\n {row.value}\n </Text>\n </HStack>\n <Box h=\"3px\" bg=\"grey.100\" borderRadius=\"full\" overflow=\"hidden\">\n <Box\n h=\"100%\"\n borderRadius=\"full\"\n style={{\n width: row.barPercent != null ? `${row.barPercent}%` : '0%',\n background: row.color ?? 'transparent',\n }}\n />\n </Box>\n </VStack>\n ))}\n </VStack>\n\n <Box h=\"1px\" bg=\"grey.100\" mb=\"space-8\" />\n\n <VStack alignItems=\"stretch\" gap=\"space-4\">\n <Text as=\"span\" fontSize=\"body.sm\" fontWeight=\"bold\" color=\"grey.400\">\n {labels.completionTitle}\n </Text>\n {COMPLETION_ORDER.map(key => {\n const done = rating.completion[key]\n return (\n <HStack key={key} alignItems=\"center\" gap=\"space-8\">\n <Icon size=\"sm\" color={done ? 'success.500' : 'grey.300'} flexShrink=\"0\">\n {done ? <CheckCircleIcon /> : <XCircleIcon />}\n </Icon>\n <Text as=\"span\" fontSize=\"body.sm\" color={done ? 'grey.500' : 'grey.400'}>\n {labels.completion[key]}\n </Text>\n </HStack>\n )\n })}\n </VStack>\n\n {labels.footer && (\n <>\n <Box h=\"1px\" bg=\"grey.100\" mt=\"space-8\" mb=\"space-8\" />\n <Text as=\"span\" fontSize=\"9px\" color=\"grey.300\" style={{ lineHeight: 1 }}>\n {labels.footer}\n </Text>\n </>\n )}\n </Box>\n )\n}\n"],"mappings":";;;;;;;;;;AAeA,IAAaK,IAAsB,GAE7BC,IAAkD;CACtD;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,SAAgBC,EAAc,GAAiB,IAAS,SAAiB;CACvE,OAAO,IAAI,KAAK,aAAaC,GAAQ;EAAE,uBAAuB;EAAG,uBAAuB;CAAE,CAAC,CAAC,CAAC,OAAOC,CAAO;AAC7G;AAGA,SAAgBC,EAAoB,GAAiB,GAAsC,IAAS,SAAiB;CACnH,IAAIC,IAAU,IAAI,OAAO,GAAG,KAAK,MAAMA,CAAO,EAAE,GAAGC,EAAM;CACzD,IAAMC,IAAQF,IAAU;CACxB,IAAIE,IAAQ,IAAI,OAAO,GAAG,KAAK,MAAMA,CAAK,EAAE,GAAGD,EAAM;CACrD,IAAME,IAAOD,IAAQ;CACrB,OAAO,GAAG,IAAI,KAAK,aAAaL,GAAQ,EAAE,uBAAuB,EAAE,CAAC,CAAC,CAAC,OAAOM,CAAI,EAAE,GAAGF,EAAM;AAC9F;AAEA,SAAgBG,EAAiB,GAAyB;CACxD,IAAMC,IAAQP,IAAA;CAGd,OAFIO,KAAS,KAAY,YACrBA,KAAS,KAAY,YAClB;AACT;AAEA,SAASC,EAAY,GAA8B;CAGjD,OAFIC,KAAgB,KAAW,YAC3BA,KAAgB,KAAW,YACxB;AACT;AAkBA,IAAaC,KAA2B,EAAE,WAAQ,iBAAc,QAAQC,QAA+C;CACrH,IAAMC,IAAWC,EAAY,GACvBC,I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M;KACxD,UAAAX,EAAO;IACJ,CAAA,GACLjB,EAAiB,KAAI,MAAO;KAC3B,IAAM+B,IAAOT,EAAO,WAAWU;KAC/B,OACE,kBAACL,GAAD;MAAkB,YAAW;MAAS,KAAI;MAA1C,UAAA,CACE,kBAACM,GAAD;OAAM,MAAK;OAAK,OAAOF,IAAO,gBAAgB;OAAY,YAAW;OAClE,UAAOG,EAAPH,IAAQrC,IAAsBC,GAAvB,CAAkB,CAAkB;MACxC,CAAA,GACN,kBAACiC,GAAD;OAAM,IAAG;OAAO,UAAS;OAAU,OAAOG,IAAO,aAAa;OAC3D,UAAAd,EAAO,WAAWe;MACf,CAAA,CACA;KAPK,GAAAA,CAOL;IAEZ,CAAC,CACK;;GAEPf,EAAO,UACN,kBAAArB,GAAA,EAAA,UAAA,CACE,kBAAC8B,GAAD;IAAK,GAAE;IAAM,IAAG;IAAW,IAAG;IAAU,IAAG;GAAW,CAAA,GACtD,kBAACE,GAAD;IAAM,IAAG;IAAO,UAAS;IAAM,OAAM;IAAW,OAAO,EAAE,YAAY,EAAE;IACpE,UAAAX,EAAO;GACJ,CAAA,CACN,EAAA,CAAA;EAED;;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"labels.cjs","names":[],"sources":["../../../src/components/supplier-rating-badge/labels.ts"],"sourcesContent":["// Labels of the supplier rating, apart from the components so UiLabelsProvider can carry an\n// app-wide translation without an import cycle. The defaults are French: an app that renders in\n// another locale passes its own through UiLabelsProvider (or the `labels` prop).\n\nexport type SupplierRatingComponentKey = 'responseRate' | 'responseDelay' | 'completion'\n\nexport type SupplierRatingCompletionKey =\n | 'profile'\n | 'location'\n | 'contacts'\n | 'legalBanking'\n | 'sector'\n | 'certificate'\n\nexport type SupplierRatingCompletion = Record<SupplierRatingCompletionKey, boolean>\n\nexport type SupplierRating = {\n /** Overall note out of 5. Absent when insufficientData is true. */\n overall?: number\n /** Response-rate sub-score, 0..1 (note calc only). Absent when insufficientData is true. */\n responseRateScore?: number\n /** Response-delay sub-score, 0..1 (note calc + colours the delay row). Absent when insufficientData is true. */\n responseDelayScore?: number\n /** Average response delay in MINUTES, for display. Absent when insufficientData is true. */\n responseDelayMinutes?: number\n /** Account-completion sub-score, 0..1. Always present. */\n completionScore: number\n /** True when the supplier has too few interactions for a reliable note. */\n insufficientData: boolean\n /** Completion checklist shown in the breakdown. */\n completion: SupplierRatingCompletion\n}\n\nexport type SupplierRatingLabels = {\n title: string\n /** Neutral state shown instead of a note when data is insufficient. */\n insufficientData: string\n /** Section heading above the sub-scores. */\n componentsTitle: string\n /** Section heading above the completion checklist. */\n completionTitle: string\n /** Value shown when a component has no data yet (e.g. \"-\"). */\n notAvailable: string\n /** Unit suffixes for the average response-delay value. */\n units: { minutes: string; hours: string; days: string }\n components: Record<SupplierRatingComponentKey, string>\n completion: Record<SupplierRatingCompletionKey, string>\n footer?: string\n}\n\nexport const DEFAULT_SUPPLIER_RATING_LABELS: SupplierRatingLabels = {\n title: 'Note fournisseur',\n insufficientData: 'Non noté',\n componentsTitle: 'Détail de la note',\n completionTitle: 'Complétion du compte',\n notAvailable: '-',\n units: { minutes: 'min', hours: 'h', days: 'j' },\n components: {\n responseRate: 'Taux de réponse',\n responseDelay: 'Délai de réponse',\n completion: 'Complétion du compte',\n },\n completion: {\n profile: 'Profil (photo et description)',\n location: 'Localisation',\n contacts: 'Contact',\n legalBanking: 'Coordonnées légales et bancaires',\n sector: \"Secteur d'activité\",\n certificate: 'Certificat',\n },\n}\n\n/** `base` overridden by `override`, nested groups merged key by key. */\nexport function mergeSupplierRatingLabels(\n base: SupplierRatingLabels,\n override?: Partial<SupplierRatingLabels>,\n): SupplierRatingLabels {\n return {\n ...base,\n ...override,\n units: { ...base.units, ...override?.units },\n components: { ...base.components, ...override?.components },\n completion: { ...base.completion, ...override?.completion },\n }\n}\n"],"mappings":"aAkDA,IAAa,EAAuD,CAClE,MAAO,mBACP,iBAAkB,WAClB,gBAAiB,oBACjB,gBAAiB,uBACjB,aAAc,IACd,MAAO,CAAE,QAAS,MAAO,MAAO,IAAK,KAAM,GAAI,EAC/C,WAAY,CACV,aAAc,kBACd,cAAe,mBACf,WAAY,sBACd,EACA,WAAY,CACV,QAAS,gCACT,SAAU,eACV,SAAU,UACV,aAAc,mCACd,OAAQ,qBACR,YAAa,YACf,CACF,EAGA,SAAgB,EACd,EACA,EACsB,CACtB,MAAO,CACL,GAAG,EACH,GAAG,EACH,MAAO,CAAE,GAAG,EAAK,MAAO,GAAG,GAAU,KAAM,EAC3C,WAAY,CAAE,GAAG,EAAK,WAAY,GAAG,GAAU,UAAW,EAC1D,WAAY,CAAE,GAAG,EAAK,WAAY,GAAG,GAAU,UAAW,CAC5D,CACF"}
1
+ {"version":3,"file":"labels.cjs","names":["DEFAULT_SUPPLIER_RATING_LABELS","mergeSupplierRatingLabels","base","override"],"sources":["../../../src/components/supplier-rating-badge/labels.ts"],"sourcesContent":["// Labels of the supplier rating, apart from the components so UiLabelsProvider can carry an\n// app-wide translation without an import cycle. The defaults are French: an app that renders in\n// another locale passes its own through UiLabelsProvider (or the `labels` prop).\n\nexport type SupplierRatingComponentKey = 'responseRate' | 'responseDelay' | 'completion'\n\nexport type SupplierRatingCompletionKey =\n 'profile' | 'location' | 'contacts' | 'legalBanking' | 'sector' | 'certificate'\n\nexport type SupplierRatingCompletion = Record<SupplierRatingCompletionKey, boolean>\n\nexport type SupplierRating = {\n /** Overall note out of 5. Absent when insufficientData is true. */\n overall?: number\n /** Response-rate sub-score, 0..1 (note calc only). Absent when insufficientData is true. */\n responseRateScore?: number\n /** Response-delay sub-score, 0..1 (note calc + colours the delay row). Absent when insufficientData is true. */\n responseDelayScore?: number\n /** Average response delay in MINUTES, for display. Absent when insufficientData is true. */\n responseDelayMinutes?: number\n /** Account-completion sub-score, 0..1. Always present. */\n completionScore: number\n /** True when the supplier has too few interactions for a reliable note. */\n insufficientData: boolean\n /** Completion checklist shown in the breakdown. */\n completion: SupplierRatingCompletion\n}\n\nexport type SupplierRatingLabels = {\n title: string\n /** Neutral state shown instead of a note when data is insufficient. */\n insufficientData: string\n /** Section heading above the sub-scores. */\n componentsTitle: string\n /** Section heading above the completion checklist. */\n completionTitle: string\n /** Value shown when a component has no data yet (e.g. \"-\"). */\n notAvailable: string\n /** Unit suffixes for the average response-delay value. */\n units: { minutes: string; hours: string; days: string }\n components: Record<SupplierRatingComponentKey, string>\n completion: Record<SupplierRatingCompletionKey, string>\n footer?: string\n}\n\nexport const DEFAULT_SUPPLIER_RATING_LABELS: SupplierRatingLabels = {\n title: 'Note fournisseur',\n insufficientData: 'Non noté',\n componentsTitle: 'Détail de la note',\n completionTitle: 'Complétion du compte',\n notAvailable: '-',\n units: { minutes: 'min', hours: 'h', days: 'j' },\n components: {\n responseRate: 'Taux de réponse',\n responseDelay: 'Délai de réponse',\n completion: 'Complétion du compte',\n },\n completion: {\n profile: 'Profil (photo et description)',\n location: 'Localisation',\n contacts: 'Contact',\n legalBanking: 'Coordonnées légales et bancaires',\n sector: \"Secteur d'activité\",\n certificate: 'Certificat',\n },\n}\n\n/** `base` overridden by `override`, nested groups merged key by key. */\nexport function mergeSupplierRatingLabels(\n base: SupplierRatingLabels,\n override?: Partial<SupplierRatingLabels>,\n): SupplierRatingLabels {\n return {\n ...base,\n ...override,\n units: { ...base.units, ...override?.units },\n components: { ...base.components, ...override?.components },\n completion: { ...base.completion, ...override?.completion },\n }\n}\n"],"mappings":"A,aA6CA,IAAaA,EAAuD,CAClE,MAAO,mBACP,iBAAkB,WAClB,gBAAiB,oBACjB,gBAAiB,uBACjB,aAAc,IACd,MAAO,CAAE,QAAS,MAAO,MAAO,IAAK,KAAM,GAAI,EAC/C,WAAY,CACV,aAAc,kBACd,cAAe,mBACf,WAAY,sBACd,EACA,WAAY,CACV,QAAS,gCACT,SAAU,eACV,SAAU,UACV,aAAc,mCACd,OAAQ,qBACR,YAAa,YACf,CACF,EAGA,SAAgBC,EACd,EACA,EACsB,CACtB,MAAO,CACL,GAAGC,EACH,GAAGC,EACH,MAAO,CAAE,GAAGD,EAAK,MAAO,GAAGC,GAAU,KAAM,EAC3C,WAAY,CAAE,GAAGD,EAAK,WAAY,GAAGC,GAAU,UAAW,EAC1D,WAAY,CAAE,GAAGD,EAAK,WAAY,GAAGC,GAAU,UAAW,CAC5D,CACF,C"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- //#region src/components/supplier-rating-badge/labels.ts
2
+ // src/components/supplier-rating-badge/labels.ts
3
3
  var e = {
4
4
  title: "Note fournisseur",
5
5
  insufficientData: "Non noté",
@@ -43,7 +43,6 @@ function t(e, t) {
43
43
  }
44
44
  };
45
45
  }
46
- //#endregion
47
46
  export { e as DEFAULT_SUPPLIER_RATING_LABELS, t as mergeSupplierRatingLabels };
48
47
 
49
48
  //# sourceMappingURL=labels.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"labels.js","names":[],"sources":["../../../src/components/supplier-rating-badge/labels.ts"],"sourcesContent":["// Labels of the supplier rating, apart from the components so UiLabelsProvider can carry an\n// app-wide translation without an import cycle. The defaults are French: an app that renders in\n// another locale passes its own through UiLabelsProvider (or the `labels` prop).\n\nexport type SupplierRatingComponentKey = 'responseRate' | 'responseDelay' | 'completion'\n\nexport type SupplierRatingCompletionKey =\n | 'profile'\n | 'location'\n | 'contacts'\n | 'legalBanking'\n | 'sector'\n | 'certificate'\n\nexport type SupplierRatingCompletion = Record<SupplierRatingCompletionKey, boolean>\n\nexport type SupplierRating = {\n /** Overall note out of 5. Absent when insufficientData is true. */\n overall?: number\n /** Response-rate sub-score, 0..1 (note calc only). Absent when insufficientData is true. */\n responseRateScore?: number\n /** Response-delay sub-score, 0..1 (note calc + colours the delay row). Absent when insufficientData is true. */\n responseDelayScore?: number\n /** Average response delay in MINUTES, for display. Absent when insufficientData is true. */\n responseDelayMinutes?: number\n /** Account-completion sub-score, 0..1. Always present. */\n completionScore: number\n /** True when the supplier has too few interactions for a reliable note. */\n insufficientData: boolean\n /** Completion checklist shown in the breakdown. */\n completion: SupplierRatingCompletion\n}\n\nexport type SupplierRatingLabels = {\n title: string\n /** Neutral state shown instead of a note when data is insufficient. */\n insufficientData: string\n /** Section heading above the sub-scores. */\n componentsTitle: string\n /** Section heading above the completion checklist. */\n completionTitle: string\n /** Value shown when a component has no data yet (e.g. \"-\"). */\n notAvailable: string\n /** Unit suffixes for the average response-delay value. */\n units: { minutes: string; hours: string; days: string }\n components: Record<SupplierRatingComponentKey, string>\n completion: Record<SupplierRatingCompletionKey, string>\n footer?: string\n}\n\nexport const DEFAULT_SUPPLIER_RATING_LABELS: SupplierRatingLabels = {\n title: 'Note fournisseur',\n insufficientData: 'Non noté',\n componentsTitle: 'Détail de la note',\n completionTitle: 'Complétion du compte',\n notAvailable: '-',\n units: { minutes: 'min', hours: 'h', days: 'j' },\n components: {\n responseRate: 'Taux de réponse',\n responseDelay: 'Délai de réponse',\n completion: 'Complétion du compte',\n },\n completion: {\n profile: 'Profil (photo et description)',\n location: 'Localisation',\n contacts: 'Contact',\n legalBanking: 'Coordonnées légales et bancaires',\n sector: \"Secteur d'activité\",\n certificate: 'Certificat',\n },\n}\n\n/** `base` overridden by `override`, nested groups merged key by key. */\nexport function mergeSupplierRatingLabels(\n base: SupplierRatingLabels,\n override?: Partial<SupplierRatingLabels>,\n): SupplierRatingLabels {\n return {\n ...base,\n ...override,\n units: { ...base.units, ...override?.units },\n components: { ...base.components, ...override?.components },\n completion: { ...base.completion, ...override?.completion },\n }\n}\n"],"mappings":";;AAkDA,IAAa,IAAuD;CAClE,OAAO;CACP,kBAAkB;CAClB,iBAAiB;CACjB,iBAAiB;CACjB,cAAc;CACd,OAAO;EAAE,SAAS;EAAO,OAAO;EAAK,MAAM;CAAI;CAC/C,YAAY;EACV,cAAc;EACd,eAAe;EACf,YAAY;CACd;CACA,YAAY;EACV,SAAS;EACT,UAAU;EACV,UAAU;EACV,cAAc;EACd,QAAQ;EACR,aAAa;CACf;AACF;AAGA,SAAgB,EACd,GACA,GACsB;CACtB,OAAO;EACL,GAAG;EACH,GAAG;EACH,OAAO;GAAE,GAAG,EAAK;GAAO,GAAG,GAAU;EAAM;EAC3C,YAAY;GAAE,GAAG,EAAK;GAAY,GAAG,GAAU;EAAW;EAC1D,YAAY;GAAE,GAAG,EAAK;GAAY,GAAG,GAAU;EAAW;CAC5D;AACF"}
1
+ {"version":3,"file":"labels.js","names":["DEFAULT_SUPPLIER_RATING_LABELS","mergeSupplierRatingLabels","base","override"],"sources":["../../../src/components/supplier-rating-badge/labels.ts"],"sourcesContent":["// Labels of the supplier rating, apart from the components so UiLabelsProvider can carry an\n// app-wide translation without an import cycle. The defaults are French: an app that renders in\n// another locale passes its own through UiLabelsProvider (or the `labels` prop).\n\nexport type SupplierRatingComponentKey = 'responseRate' | 'responseDelay' | 'completion'\n\nexport type SupplierRatingCompletionKey =\n 'profile' | 'location' | 'contacts' | 'legalBanking' | 'sector' | 'certificate'\n\nexport type SupplierRatingCompletion = Record<SupplierRatingCompletionKey, boolean>\n\nexport type SupplierRating = {\n /** Overall note out of 5. Absent when insufficientData is true. */\n overall?: number\n /** Response-rate sub-score, 0..1 (note calc only). Absent when insufficientData is true. */\n responseRateScore?: number\n /** Response-delay sub-score, 0..1 (note calc + colours the delay row). Absent when insufficientData is true. */\n responseDelayScore?: number\n /** Average response delay in MINUTES, for display. Absent when insufficientData is true. */\n responseDelayMinutes?: number\n /** Account-completion sub-score, 0..1. Always present. */\n completionScore: number\n /** True when the supplier has too few interactions for a reliable note. */\n insufficientData: boolean\n /** Completion checklist shown in the breakdown. */\n completion: SupplierRatingCompletion\n}\n\nexport type SupplierRatingLabels = {\n title: string\n /** Neutral state shown instead of a note when data is insufficient. */\n insufficientData: string\n /** Section heading above the sub-scores. */\n componentsTitle: string\n /** Section heading above the completion checklist. */\n completionTitle: string\n /** Value shown when a component has no data yet (e.g. \"-\"). */\n notAvailable: string\n /** Unit suffixes for the average response-delay value. */\n units: { minutes: string; hours: string; days: string }\n components: Record<SupplierRatingComponentKey, string>\n completion: Record<SupplierRatingCompletionKey, string>\n footer?: string\n}\n\nexport const DEFAULT_SUPPLIER_RATING_LABELS: SupplierRatingLabels = {\n title: 'Note fournisseur',\n insufficientData: 'Non noté',\n componentsTitle: 'Détail de la note',\n completionTitle: 'Complétion du compte',\n notAvailable: '-',\n units: { minutes: 'min', hours: 'h', days: 'j' },\n components: {\n responseRate: 'Taux de réponse',\n responseDelay: 'Délai de réponse',\n completion: 'Complétion du compte',\n },\n completion: {\n profile: 'Profil (photo et description)',\n location: 'Localisation',\n contacts: 'Contact',\n legalBanking: 'Coordonnées légales et bancaires',\n sector: \"Secteur d'activité\",\n certificate: 'Certificat',\n },\n}\n\n/** `base` overridden by `override`, nested groups merged key by key. */\nexport function mergeSupplierRatingLabels(\n base: SupplierRatingLabels,\n override?: Partial<SupplierRatingLabels>,\n): SupplierRatingLabels {\n return {\n ...base,\n ...override,\n units: { ...base.units, ...override?.units },\n components: { ...base.components, ...override?.components },\n completion: { ...base.completion, ...override?.completion },\n }\n}\n"],"mappings":";;AA6CA,IAAaA,IAAuD;CAClE,OAAO;CACP,kBAAkB;CAClB,iBAAiB;CACjB,iBAAiB;CACjB,cAAc;CACd,OAAO;EAAE,SAAS;EAAO,OAAO;EAAK,MAAM;CAAI;CAC/C,YAAY;EACV,cAAc;EACd,eAAe;EACf,YAAY;CACd;CACA,YAAY;EACV,SAAS;EACT,UAAU;EACV,UAAU;EACV,cAAc;EACd,QAAQ;EACR,aAAa;CACf;AACF;AAGA,SAAgBC,EACd,GACA,GACsB;CACtB,OAAO;EACL,GAAGC;EACH,GAAGC;EACH,OAAO;GAAE,GAAGD,EAAK;GAAO,GAAGC,GAAU;EAAM;EAC3C,YAAY;GAAE,GAAGD,EAAK;GAAY,GAAGC,GAAU;EAAW;EAC1D,YAAY;GAAE,GAAGD,EAAK;GAAY,GAAGC,GAAU;EAAW;CAC5D;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.cjs","names":[],"sources":["../../../src/components/switch/Switch.tsx"],"sourcesContent":["import { Switch as ArkSwitch, type SwitchRootProps } from '@ark-ui/react'\nimport { css, cx } from '@stokelp/styled-system/css'\nimport { splitCssProps } from '@stokelp/styled-system/jsx'\nimport { switchRecipe, type SwitchRecipeVariantProps } from '@stokelp/styled-system/recipes'\nimport type { Assign, JsxStyleProps } from '@stokelp/styled-system/types'\nimport { forwardRef, type ReactNode } from 'react'\n\nexport interface SwitchProps extends Assign<JsxStyleProps, SwitchRootProps>, SwitchRecipeVariantProps {\n children?: ReactNode\n}\n\nexport const Switch = forwardRef<HTMLLabelElement, SwitchProps>((props, ref) => {\n const [variantProps, switchProps] = switchRecipe.splitVariantProps(props)\n const [cssProps, localProps] = splitCssProps(switchProps)\n const { children, className, ...rootProps } = localProps\n const styles = switchRecipe(variantProps)\n\n return (\n <ArkSwitch.Root ref={ref} className={cx(styles.root, css(cssProps), className)} {...rootProps}>\n <ArkSwitch.Control className={styles.control}>\n <ArkSwitch.Thumb className={styles.thumb} />\n </ArkSwitch.Control>\n {children ? <ArkSwitch.Label className={styles.label}>{children}</ArkSwitch.Label> : null}\n <ArkSwitch.HiddenInput />\n </ArkSwitch.Root>\n )\n})\n\nSwitch.displayName = 'Switch'\n"],"mappings":"0NAWA,IAAa,GAAA,EAAA,EAAA,aAAoD,EAAO,IAAQ,CAC9E,GAAM,CAAC,EAAc,GAAe,EAAA,aAAa,kBAAkB,CAAK,EAClE,CAAC,EAAU,IAAA,EAAA,EAAA,eAA4B,CAAW,EAClD,CAAE,WAAU,YAAW,GAAG,GAAc,EACxC,GAAA,EAAA,EAAA,cAAsB,CAAY,EAExC,OACE,EAAA,EAAA,MAAC,EAAA,OAAU,KAAX,CAAqB,MAAK,WAAA,EAAA,EAAA,IAAc,EAAO,MAAA,EAAA,EAAA,KAAU,CAAQ,EAAG,CAAS,EAAG,GAAI,WAApF,EACE,EAAA,EAAA,KAAC,EAAA,OAAU,QAAX,CAAmB,UAAW,EAAO,kBACnC,EAAA,EAAA,KAAC,EAAA,OAAU,MAAX,CAAiB,UAAW,EAAO,KAAQ,CAAA,CAC1B,CAAA,EAClB,GAAW,EAAA,EAAA,KAAC,EAAA,OAAU,MAAX,CAAiB,UAAW,EAAO,MAAQ,UAA0B,CAAA,EAAI,MACrF,EAAA,EAAA,KAAC,EAAA,OAAU,YAAX,CAAwB,CAAA,CACV,GAEpB,CAAC,EAED,EAAO,YAAc"}
1
+ {"version":3,"file":"Switch.cjs","names":["forwardRef","switchRecipe","splitCssProps","ArkSwitch","cx","css","_ark_ui_react","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react","react_jsx_runtime","_stokelp_styled_system_css","Switch","variantProps","switchProps","props","cssProps","localProps","rootProps","styles","className","children"],"sources":["../../../src/components/switch/Switch.tsx"],"sourcesContent":["import { Switch as ArkSwitch, type SwitchRootProps } from '@ark-ui/react'\nimport { css, cx } from '@stokelp/styled-system/css'\nimport { splitCssProps } from '@stokelp/styled-system/jsx'\nimport { switchRecipe, type SwitchRecipeVariantProps } from '@stokelp/styled-system/recipes'\nimport type { Assign, JsxStyleProps } from '@stokelp/styled-system/types'\nimport { forwardRef, type ReactNode } from 'react'\n\nexport interface SwitchProps extends Assign<JsxStyleProps, SwitchRootProps>, SwitchRecipeVariantProps {\n children?: ReactNode\n}\n\nexport const Switch = forwardRef<HTMLLabelElement, SwitchProps>((props, ref) => {\n const [variantProps, switchProps] = switchRecipe.splitVariantProps(props)\n const [cssProps, localProps] = splitCssProps(switchProps)\n const { children, className, ...rootProps } = localProps\n const styles = switchRecipe(variantProps)\n\n return (\n <ArkSwitch.Root ref={ref} className={cx(styles.root, css(cssProps), className)} {...rootProps}>\n <ArkSwitch.Control className={styles.control}>\n <ArkSwitch.Thumb className={styles.thumb} />\n </ArkSwitch.Control>\n {children ? <ArkSwitch.Label className={styles.label}>{children}</ArkSwitch.Label> : null}\n <ArkSwitch.HiddenInput />\n </ArkSwitch.Root>\n )\n})\n\nSwitch.displayName = 'Switch'\n"],"mappings":"A,0NAWA,IAAaY,GAAA,EAASZ,EAAAA,WAAAA,EAA2C,EAAO,IAAQ,CAC9E,GAAM,CAACa,EAAcC,GAAeb,EAAAA,aAAa,kBAAkBc,CAAK,EAClE,CAACC,EAAUC,IAAA,EAAcf,EAAAA,cAAAA,CAAcY,CAAW,EAClD,CAAE,WAAU,YAAW,GAAGI,GAAcD,EACxCE,GAAA,EAASlB,EAAAA,aAAAA,CAAaY,CAAY,EAExC,OACE,EAAAH,EAAA,KAAA,CAACP,EAAAA,OAAU,KAAX,CAAqB,MAAK,WAAA,EAAWC,EAAAA,GAAAA,CAAGe,EAAO,MAAA,EAAMd,EAAAA,IAAAA,CAAIW,CAAQ,EAAGI,CAAS,EAAG,GAAIF,EAApF,SAAA,EACE,EAAAR,EAAA,IAAA,CAACP,EAAAA,OAAU,QAAX,CAAmB,UAAWgB,EAAO,QACnC,UAAA,EAAAT,EAAA,IAAA,CAACP,EAAAA,OAAU,MAAX,CAAiB,UAAWgB,EAAO,KAAQ,CAAA,CAC1B,CAAA,EAClBE,GAAW,EAAAX,EAAA,IAAA,CAACP,EAAAA,OAAU,MAAX,CAAiB,UAAWgB,EAAO,MAAQ,UAA0B,CAAA,EAAI,MACrF,EAAAT,EAAA,IAAA,CAACP,EAAAA,OAAU,YAAX,CAAwB,CAAA,CACV,C,EAEpB,CAAC,EAED,EAAO,YAAc,S"}