@pattern-stack/frontend-patterns 0.1.3 → 0.2.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (446) hide show
  1. package/CHANGELOG.md +69 -74
  2. package/README.md +17 -2
  3. package/cli/commands/generate-hooks.ts +15 -6
  4. package/cli/commands/scaffold.ts +1 -1
  5. package/cli/index.ts +1 -3
  6. package/cli/src/codegen/openapi/__tests__/naming-utils.test.js +367 -0
  7. package/cli/src/codegen/openapi/client-generator.js +90 -35
  8. package/cli/src/codegen/openapi/confidence-scorer.js +89 -200
  9. package/cli/src/codegen/openapi/hook-config.js +45 -63
  10. package/cli/src/codegen/openapi/hook-generator.js +253 -547
  11. package/cli/src/codegen/openapi/naming-constants.js +98 -0
  12. package/cli/src/codegen/openapi/naming-utils.js +149 -0
  13. package/cli/src/codegen/openapi/parser.js +9 -14
  14. package/cli/src/codegen/openapi/type-generator.js +6 -16
  15. package/dist/atoms/components/core/Avatar/Avatar.d.ts +6 -6
  16. package/dist/atoms/components/core/Avatar/Avatar.d.ts.map +1 -1
  17. package/dist/atoms/components/core/Avatar/index.d.ts +1 -1
  18. package/dist/atoms/components/core/Badge/Badge.d.ts +6 -6
  19. package/dist/atoms/components/core/Badge/Badge.d.ts.map +1 -1
  20. package/dist/atoms/components/core/Badge/index.d.ts +1 -1
  21. package/dist/atoms/components/core/Button/Button.d.ts +3 -3
  22. package/dist/atoms/components/core/Button/Button.d.ts.map +1 -1
  23. package/dist/atoms/components/core/Button/index.d.ts +2 -2
  24. package/dist/atoms/components/core/Card/Card.d.ts +2 -2
  25. package/dist/atoms/components/core/Card/Card.d.ts.map +1 -1
  26. package/dist/atoms/components/core/Card/index.d.ts +2 -2
  27. package/dist/atoms/components/core/Card/index.d.ts.map +1 -1
  28. package/dist/atoms/components/core/Checkbox/Checkbox.d.ts +4 -4
  29. package/dist/atoms/components/core/Checkbox/Checkbox.d.ts.map +1 -1
  30. package/dist/atoms/components/core/Checkbox/index.d.ts +2 -2
  31. package/dist/atoms/components/core/Input/Input.d.ts +2 -2
  32. package/dist/atoms/components/core/Input/Input.d.ts.map +1 -1
  33. package/dist/atoms/components/core/Input/index.d.ts +2 -2
  34. package/dist/atoms/components/core/Label/Label.d.ts +3 -4
  35. package/dist/atoms/components/core/Label/Label.d.ts.map +1 -1
  36. package/dist/atoms/components/core/Label/index.d.ts +2 -2
  37. package/dist/atoms/components/core/Select/Select.d.ts +5 -5
  38. package/dist/atoms/components/core/Select/Select.d.ts.map +1 -1
  39. package/dist/atoms/components/core/Select/index.d.ts +2 -2
  40. package/dist/atoms/components/core/Select/index.d.ts.map +1 -1
  41. package/dist/atoms/components/core/Spinner/Spinner.d.ts +4 -4
  42. package/dist/atoms/components/core/Spinner/Spinner.d.ts.map +1 -1
  43. package/dist/atoms/components/core/Spinner/index.d.ts +2 -2
  44. package/dist/atoms/components/core/Switch/Switch.d.ts +4 -4
  45. package/dist/atoms/components/core/Switch/Switch.d.ts.map +1 -1
  46. package/dist/atoms/components/core/Switch/index.d.ts +1 -1
  47. package/dist/atoms/components/core/index.d.ts +10 -10
  48. package/dist/atoms/components/core/index.d.ts.map +1 -1
  49. package/dist/atoms/components/data/ActivityFeed/ActivityFeed.d.ts +2 -2
  50. package/dist/atoms/components/data/ActivityFeed/ActivityFeed.d.ts.map +1 -1
  51. package/dist/atoms/components/data/ActivityFeed/ActivityFeedItem.d.ts +3 -3
  52. package/dist/atoms/components/data/ActivityFeed/ActivityFeedItem.d.ts.map +1 -1
  53. package/dist/atoms/components/data/ActivityFeed/index.d.ts +3 -3
  54. package/dist/atoms/components/data/ActivityFeed/index.d.ts.map +1 -1
  55. package/dist/atoms/components/data/ActivityFeed/types.d.ts +3 -3
  56. package/dist/atoms/components/data/ActivityFeed/types.d.ts.map +1 -1
  57. package/dist/atoms/components/data/ActivityFeed/utils.d.ts +2 -2
  58. package/dist/atoms/components/data/ActivityFeed/utils.d.ts.map +1 -1
  59. package/dist/atoms/components/data/Chart/Chart.d.ts +52 -5
  60. package/dist/atoms/components/data/Chart/Chart.d.ts.map +1 -1
  61. package/dist/atoms/components/data/Chart/index.d.ts +2 -2
  62. package/dist/atoms/components/data/Chart/index.d.ts.map +1 -1
  63. package/dist/atoms/components/data/DataBadge/DataBadge.d.ts +6 -6
  64. package/dist/atoms/components/data/DataBadge/DataBadge.d.ts.map +1 -1
  65. package/dist/atoms/components/data/DataBadge/index.d.ts +1 -1
  66. package/dist/atoms/components/data/DataTable/DataTable.d.ts +4 -4
  67. package/dist/atoms/components/data/DataTable/DataTable.d.ts.map +1 -1
  68. package/dist/atoms/components/data/DataTable/DataTable.types.d.ts +4 -4
  69. package/dist/atoms/components/data/DataTable/DataTable.types.d.ts.map +1 -1
  70. package/dist/atoms/components/data/DataTable/TableCellWithTooltip.d.ts +1 -1
  71. package/dist/atoms/components/data/DataTable/index.d.ts +2 -2
  72. package/dist/atoms/components/data/DetailedCard/DetailedCard.d.ts +4 -4
  73. package/dist/atoms/components/data/DetailedCard/DetailedCard.d.ts.map +1 -1
  74. package/dist/atoms/components/data/DetailedCard/index.d.ts +2 -2
  75. package/dist/atoms/components/data/EntityIcon/EntityIcon.d.ts +3 -3
  76. package/dist/atoms/components/data/EntityIcon/EntityIcon.d.ts.map +1 -1
  77. package/dist/atoms/components/data/EntityIcon/index.d.ts +1 -1
  78. package/dist/atoms/components/data/IconBadge/IconBadge.d.ts +6 -6
  79. package/dist/atoms/components/data/IconBadge/IconBadge.d.ts.map +1 -1
  80. package/dist/atoms/components/data/IconBadge/index.d.ts +2 -2
  81. package/dist/atoms/components/data/ListCard/ListCard.d.ts +9 -9
  82. package/dist/atoms/components/data/ListCard/ListCard.d.ts.map +1 -1
  83. package/dist/atoms/components/data/ListCard/index.d.ts +1 -1
  84. package/dist/atoms/components/data/ProgressBar/ProgressBar.d.ts +5 -5
  85. package/dist/atoms/components/data/ProgressBar/ProgressBar.d.ts.map +1 -1
  86. package/dist/atoms/components/data/ProgressBar/index.d.ts +1 -1
  87. package/dist/atoms/components/data/StatCard/StatCard.d.ts +3 -3
  88. package/dist/atoms/components/data/StatCard/StatCard.d.ts.map +1 -1
  89. package/dist/atoms/components/data/StatCard/index.d.ts +1 -1
  90. package/dist/atoms/components/data/Table/Table.d.ts +2 -2
  91. package/dist/atoms/components/data/Table/Table.d.ts.map +1 -1
  92. package/dist/atoms/components/data/Table/index.d.ts +1 -1
  93. package/dist/atoms/components/data/TruncatedText/TruncatedText.d.ts +2 -2
  94. package/dist/atoms/components/data/TruncatedText/TruncatedText.d.ts.map +1 -1
  95. package/dist/atoms/components/data/TruncatedText/index.d.ts +1 -1
  96. package/dist/atoms/components/data/index.d.ts +12 -12
  97. package/dist/atoms/components/data/index.d.ts.map +1 -1
  98. package/dist/atoms/components/domain/SalesPanel/SalesPanel.d.ts +15 -15
  99. package/dist/atoms/components/domain/SalesPanel/SalesPanel.d.ts.map +1 -1
  100. package/dist/atoms/components/domain/SalesPanel/index.d.ts +1 -1
  101. package/dist/atoms/components/domain/SalesPanel/index.d.ts.map +1 -1
  102. package/dist/atoms/components/domain/index.d.ts +1 -1
  103. package/dist/atoms/components/feedback/Alert/Alert.d.ts +4 -4
  104. package/dist/atoms/components/feedback/Alert/Alert.d.ts.map +1 -1
  105. package/dist/atoms/components/feedback/Alert/index.d.ts +1 -1
  106. package/dist/atoms/components/feedback/EmptyState/EmptyState.d.ts +3 -3
  107. package/dist/atoms/components/feedback/EmptyState/EmptyState.d.ts.map +1 -1
  108. package/dist/atoms/components/feedback/EmptyState/index.d.ts +1 -1
  109. package/dist/atoms/components/feedback/ErrorBoundary/ErrorBoundary.d.ts +1 -1
  110. package/dist/atoms/components/feedback/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
  111. package/dist/atoms/components/feedback/ErrorBoundary/index.d.ts +1 -1
  112. package/dist/atoms/components/feedback/Skeleton/Skeleton.d.ts +30 -4
  113. package/dist/atoms/components/feedback/Skeleton/Skeleton.d.ts.map +1 -1
  114. package/dist/atoms/components/feedback/Skeleton/index.d.ts +1 -1
  115. package/dist/atoms/components/feedback/Toast/Toast.d.ts +4 -4
  116. package/dist/atoms/components/feedback/Toast/Toast.d.ts.map +1 -1
  117. package/dist/atoms/components/feedback/Toast/index.d.ts +1 -1
  118. package/dist/atoms/components/feedback/Toast/index.d.ts.map +1 -1
  119. package/dist/atoms/components/feedback/index.d.ts +5 -5
  120. package/dist/atoms/components/feedback/index.d.ts.map +1 -1
  121. package/dist/atoms/components/forms/DateTimePicker/DateTimePicker.d.ts +6 -6
  122. package/dist/atoms/components/forms/DateTimePicker/DateTimePicker.d.ts.map +1 -1
  123. package/dist/atoms/components/forms/DateTimePicker/index.d.ts +2 -2
  124. package/dist/atoms/components/forms/FileUpload/FileUpload.d.ts +3 -3
  125. package/dist/atoms/components/forms/FileUpload/FileUpload.d.ts.map +1 -1
  126. package/dist/atoms/components/forms/FileUpload/index.d.ts +2 -2
  127. package/dist/atoms/components/forms/FormField/FormField.d.ts +2 -2
  128. package/dist/atoms/components/forms/FormField/FormField.d.ts.map +1 -1
  129. package/dist/atoms/components/forms/FormField/index.d.ts +1 -1
  130. package/dist/atoms/components/forms/index.d.ts +3 -3
  131. package/dist/atoms/components/index.d.ts +9 -9
  132. package/dist/atoms/components/layout/Accordion/Accordion.d.ts +3 -3
  133. package/dist/atoms/components/layout/Accordion/Accordion.d.ts.map +1 -1
  134. package/dist/atoms/components/layout/Accordion/index.d.ts +1 -1
  135. package/dist/atoms/components/layout/Accordion/index.d.ts.map +1 -1
  136. package/dist/atoms/components/layout/Breadcrumb/Breadcrumb.d.ts +2 -3
  137. package/dist/atoms/components/layout/Breadcrumb/Breadcrumb.d.ts.map +1 -1
  138. package/dist/atoms/components/layout/Breadcrumb/index.d.ts +1 -1
  139. package/dist/atoms/components/layout/Breadcrumb/index.d.ts.map +1 -1
  140. package/dist/atoms/components/layout/Dialog/Dialog.d.ts +45 -0
  141. package/dist/atoms/components/layout/Dialog/Dialog.d.ts.map +1 -0
  142. package/dist/atoms/components/layout/Dialog/index.d.ts +2 -2
  143. package/dist/atoms/components/layout/Dialog/index.d.ts.map +1 -1
  144. package/dist/atoms/components/layout/Dropdown/Dropdown.d.ts +9 -9
  145. package/dist/atoms/components/layout/Dropdown/Dropdown.d.ts.map +1 -1
  146. package/dist/atoms/components/layout/Dropdown/index.d.ts +2 -2
  147. package/dist/atoms/components/layout/Dropdown/index.d.ts.map +1 -1
  148. package/dist/atoms/components/layout/Modal/Modal.d.ts +6 -6
  149. package/dist/atoms/components/layout/Modal/Modal.d.ts.map +1 -1
  150. package/dist/atoms/components/layout/Modal/index.d.ts +2 -2
  151. package/dist/atoms/components/layout/Tabs/Tabs.d.ts +46 -0
  152. package/dist/atoms/components/layout/Tabs/Tabs.d.ts.map +1 -0
  153. package/dist/atoms/components/layout/Tabs/index.d.ts +1 -1
  154. package/dist/atoms/components/layout/Tooltip/Tooltip.d.ts +6 -6
  155. package/dist/atoms/components/layout/Tooltip/Tooltip.d.ts.map +1 -1
  156. package/dist/atoms/components/layout/Tooltip/index.d.ts +1 -1
  157. package/dist/atoms/components/layout/index.d.ts +7 -7
  158. package/dist/atoms/components/layout/index.d.ts.map +1 -1
  159. package/dist/atoms/components/navigation/GlobalSearch/GlobalSearch.d.ts +2 -3
  160. package/dist/atoms/components/navigation/GlobalSearch/GlobalSearch.d.ts.map +1 -1
  161. package/dist/atoms/components/navigation/GlobalSearch/index.d.ts +1 -1
  162. package/dist/atoms/components/navigation/GlobalSearch/index.d.ts.map +1 -1
  163. package/dist/atoms/components/navigation/index.d.ts +1 -1
  164. package/dist/atoms/components/theme/ColorSwatch/ColorSwatch.d.ts +2 -2
  165. package/dist/atoms/components/theme/ColorSwatch/ColorSwatch.d.ts.map +1 -1
  166. package/dist/atoms/components/theme/ColorSwatch/index.d.ts +1 -1
  167. package/dist/atoms/components/theme/DarkModeToggle.d.ts.map +1 -1
  168. package/dist/atoms/components/theme/PaletteSwitcher.d.ts +1 -1
  169. package/dist/atoms/components/theme/PaletteSwitcher.d.ts.map +1 -1
  170. package/dist/atoms/components/theme/StyleGuide.d.ts +1 -1
  171. package/dist/atoms/components/theme/StyleGuide.d.ts.map +1 -1
  172. package/dist/atoms/components/theme/index.d.ts +4 -4
  173. package/dist/atoms/components/user/UserAvatar/UserAvatar.d.ts +2 -3
  174. package/dist/atoms/components/user/UserAvatar/UserAvatar.d.ts.map +1 -1
  175. package/dist/atoms/components/user/UserAvatar/index.d.ts +1 -1
  176. package/dist/atoms/components/user/UserAvatar/index.d.ts.map +1 -1
  177. package/dist/atoms/components/user/UserMenu/UserMenu.d.ts +2 -3
  178. package/dist/atoms/components/user/UserMenu/UserMenu.d.ts.map +1 -1
  179. package/dist/atoms/components/user/UserMenu/index.d.ts +1 -1
  180. package/dist/atoms/components/user/UserMenu/index.d.ts.map +1 -1
  181. package/dist/atoms/components/user/index.d.ts +2 -2
  182. package/dist/atoms/config/responsive.d.ts +16 -16
  183. package/dist/atoms/config/responsive.d.ts.map +1 -1
  184. package/dist/atoms/hooks/index.d.ts +4 -4
  185. package/dist/atoms/hooks/use-toast.d.ts +1 -1
  186. package/dist/atoms/hooks/use-toast.d.ts.map +1 -1
  187. package/dist/atoms/hooks/useApi.d.ts +2 -2
  188. package/dist/atoms/hooks/useApi.d.ts.map +1 -1
  189. package/dist/atoms/hooks/useResponsive.d.ts +1 -1
  190. package/dist/atoms/hooks/useResponsive.d.ts.map +1 -1
  191. package/dist/atoms/index.d.ts +6 -7
  192. package/dist/atoms/index.d.ts.map +1 -1
  193. package/dist/atoms/primitives/Badge.d.ts +6 -6
  194. package/dist/atoms/primitives/Badge.d.ts.map +1 -1
  195. package/dist/atoms/primitives/ErrorBoundary.d.ts +3 -3
  196. package/dist/atoms/primitives/ErrorBoundary.d.ts.map +1 -1
  197. package/dist/atoms/primitives/Select.d.ts +9 -7
  198. package/dist/atoms/primitives/Select.d.ts.map +1 -1
  199. package/dist/atoms/primitives/Switch.d.ts +4 -3
  200. package/dist/atoms/primitives/Switch.d.ts.map +1 -1
  201. package/dist/atoms/primitives/Tabs.d.ts +10 -10
  202. package/dist/atoms/primitives/Tabs.d.ts.map +1 -1
  203. package/dist/atoms/primitives/avatar.d.ts.map +1 -1
  204. package/dist/atoms/primitives/button.d.ts +2 -5
  205. package/dist/atoms/primitives/button.d.ts.map +1 -1
  206. package/dist/atoms/primitives/button.variants.d.ts +7 -0
  207. package/dist/atoms/primitives/button.variants.d.ts.map +1 -0
  208. package/dist/atoms/primitives/card.d.ts +3 -2
  209. package/dist/atoms/primitives/card.d.ts.map +1 -1
  210. package/dist/atoms/primitives/checkbox.d.ts +3 -3
  211. package/dist/atoms/primitives/checkbox.d.ts.map +1 -1
  212. package/dist/atoms/primitives/dialog.d.ts +4 -4
  213. package/dist/atoms/primitives/dialog.d.ts.map +1 -1
  214. package/dist/atoms/primitives/dropdown-menu.d.ts.map +1 -1
  215. package/dist/atoms/primitives/index.d.ts +16 -16
  216. package/dist/atoms/primitives/index.d.ts.map +1 -1
  217. package/dist/atoms/primitives/input.d.ts.map +1 -1
  218. package/dist/atoms/primitives/label.d.ts +4 -3
  219. package/dist/atoms/primitives/label.d.ts.map +1 -1
  220. package/dist/atoms/primitives/skeleton.d.ts.map +1 -1
  221. package/dist/atoms/primitives/spinner.d.ts +5 -5
  222. package/dist/atoms/primitives/spinner.d.ts.map +1 -1
  223. package/dist/atoms/primitives/table.d.ts.map +1 -1
  224. package/dist/atoms/services/api/client.d.ts +11 -2
  225. package/dist/atoms/services/api/client.d.ts.map +1 -1
  226. package/dist/atoms/services/auth-service.d.ts +1 -1
  227. package/dist/atoms/services/auth-service.d.ts.map +1 -1
  228. package/dist/atoms/services/health.d.ts +2 -2
  229. package/dist/atoms/services/index.d.ts +3 -3
  230. package/dist/atoms/shared/config/dashboard-sizes.d.ts +17 -17
  231. package/dist/atoms/shared/config/dashboard-sizes.d.ts.map +1 -1
  232. package/dist/atoms/shared/config/environment.d.ts.map +1 -1
  233. package/dist/atoms/shared/index.d.ts +4 -4
  234. package/dist/atoms/shared/index.d.ts.map +1 -1
  235. package/dist/atoms/types/auth.d.ts +11 -1
  236. package/dist/atoms/types/auth.d.ts.map +1 -1
  237. package/dist/atoms/types/entity-config.d.ts +9 -9
  238. package/dist/atoms/types/entity-config.d.ts.map +1 -1
  239. package/dist/atoms/types/generated.d.ts.map +1 -1
  240. package/dist/atoms/types/index.d.ts +6 -6
  241. package/dist/atoms/types/loading.d.ts +1 -1
  242. package/dist/atoms/types/navigation.d.ts +1 -1
  243. package/dist/atoms/types/navigation.d.ts.map +1 -1
  244. package/dist/atoms/types/ui-config.d.ts +8 -8
  245. package/dist/atoms/types/ui-config.d.ts.map +1 -1
  246. package/dist/atoms/utils/animations.d.ts +7 -7
  247. package/dist/atoms/utils/animations.d.ts.map +1 -1
  248. package/dist/atoms/utils/color-manager.d.ts +1 -1
  249. package/dist/atoms/utils/debounce.d.ts +1 -1
  250. package/dist/atoms/utils/debounce.d.ts.map +1 -1
  251. package/dist/atoms/utils/field-detection.d.ts +2 -2
  252. package/dist/atoms/utils/field-detection.d.ts.map +1 -1
  253. package/dist/atoms/utils/icon-map.d.ts +68 -0
  254. package/dist/atoms/utils/icon-map.d.ts.map +1 -0
  255. package/dist/atoms/utils/icon-resolver.d.ts +7 -67
  256. package/dist/atoms/utils/icon-resolver.d.ts.map +1 -1
  257. package/dist/atoms/utils/index.d.ts +4 -4
  258. package/dist/atoms/utils/metric-engine.d.ts +2 -10
  259. package/dist/atoms/utils/metric-engine.d.ts.map +1 -1
  260. package/dist/atoms/utils/tooltip-helpers.d.ts +1 -1
  261. package/dist/atoms/utils/tooltip-helpers.d.ts.map +1 -1
  262. package/dist/atoms/utils/ui-mapping.d.ts +6 -4
  263. package/dist/atoms/utils/ui-mapping.d.ts.map +1 -1
  264. package/dist/atoms/utils/utils.d.ts +7 -6
  265. package/dist/atoms/utils/utils.d.ts.map +1 -1
  266. package/dist/codegen/openapi/bulk-types.d.ts +4 -4
  267. package/dist/codegen/openapi/bulk-types.d.ts.map +1 -1
  268. package/dist/features/auth/components/LoginForm.d.ts.map +1 -1
  269. package/dist/features/auth/components/LogoutButton.d.ts.map +1 -1
  270. package/dist/features/auth/components/ProtectedRoute.d.ts +2 -2
  271. package/dist/features/auth/components/ProtectedRoute.d.ts.map +1 -1
  272. package/dist/features/auth/components/index.d.ts +3 -3
  273. package/dist/features/auth/hooks/auth-context.d.ts +3 -0
  274. package/dist/features/auth/hooks/auth-context.d.ts.map +1 -0
  275. package/dist/features/auth/hooks/index.d.ts +4 -3
  276. package/dist/features/auth/hooks/index.d.ts.map +1 -1
  277. package/dist/features/auth/hooks/use-auth.d.ts +3 -0
  278. package/dist/features/auth/hooks/use-auth.d.ts.map +1 -0
  279. package/dist/features/auth/hooks/useAuth.d.ts +3 -4
  280. package/dist/features/auth/hooks/useAuth.d.ts.map +1 -1
  281. package/dist/features/auth/hooks/useAuthContext.d.ts +1 -1
  282. package/dist/features/auth/hooks/useAuthContext.d.ts.map +1 -1
  283. package/dist/features/auth/hooks/usePermissions.d.ts +3 -3
  284. package/dist/features/auth/index.d.ts +3 -3
  285. package/dist/features/auth/providers/MockAuthProvider.d.ts +3 -4
  286. package/dist/features/auth/providers/MockAuthProvider.d.ts.map +1 -1
  287. package/dist/features/auth/providers/index.d.ts +2 -1
  288. package/dist/features/auth/providers/index.d.ts.map +1 -1
  289. package/dist/features/auth/providers/mock-auth-context.d.ts +3 -0
  290. package/dist/features/auth/providers/mock-auth-context.d.ts.map +1 -0
  291. package/dist/features/auth/providers/use-mock-auth.d.ts +3 -0
  292. package/dist/features/auth/providers/use-mock-auth.d.ts.map +1 -0
  293. package/dist/features/auth/services/mock-auth-service.d.ts +3 -3
  294. package/dist/features/auth/services/mock-auth-service.d.ts.map +1 -1
  295. package/dist/features/index.d.ts +1 -1
  296. package/dist/frontend-patterns.css +713 -576
  297. package/dist/index.d.ts +17 -17
  298. package/dist/index.d.ts.map +1 -1
  299. package/dist/index.es.js +21400 -21788
  300. package/dist/index.es.js.map +1 -1
  301. package/dist/index.js +21404 -21792
  302. package/dist/index.js.map +1 -1
  303. package/dist/molecules/forms/FormGroup.d.ts +2 -2
  304. package/dist/molecules/forms/FormGroup.d.ts.map +1 -1
  305. package/dist/molecules/forms/SearchInput.d.ts +1 -1
  306. package/dist/molecules/forms/SearchInput.d.ts.map +1 -1
  307. package/dist/molecules/forms/index.d.ts +2 -2
  308. package/dist/molecules/forms/index.d.ts.map +1 -1
  309. package/dist/molecules/index.d.ts +3 -3
  310. package/dist/molecules/layout/AppHeader/AppHeader.d.ts +1 -1
  311. package/dist/molecules/layout/AppHeader/AppHeader.d.ts.map +1 -1
  312. package/dist/molecules/layout/AppHeader/index.d.ts +1 -1
  313. package/dist/molecules/layout/BulkSelectionBar.d.ts +2 -2
  314. package/dist/molecules/layout/BulkSelectionBar.d.ts.map +1 -1
  315. package/dist/molecules/layout/DashboardWithSidePanel/DashboardWithSidePanel.d.ts +1 -1
  316. package/dist/molecules/layout/DashboardWithSidePanel/index.d.ts +1 -1
  317. package/dist/molecules/layout/NavigationContext.d.ts +3 -9
  318. package/dist/molecules/layout/NavigationContext.d.ts.map +1 -1
  319. package/dist/molecules/layout/PageTemplate.d.ts +1 -1
  320. package/dist/molecules/layout/PageTemplate.d.ts.map +1 -1
  321. package/dist/molecules/layout/SectionHeader/SectionHeader.d.ts +4 -4
  322. package/dist/molecules/layout/SectionHeader/SectionHeader.d.ts.map +1 -1
  323. package/dist/molecules/layout/SectionHeader/index.d.ts +1 -1
  324. package/dist/molecules/layout/ShowcaseSection.d.ts +4 -4
  325. package/dist/molecules/layout/ShowcaseSection.d.ts.map +1 -1
  326. package/dist/molecules/layout/Sidebar.d.ts.map +1 -1
  327. package/dist/molecules/layout/SidebarButton/SidebarButton.d.ts +1 -1
  328. package/dist/molecules/layout/SidebarButton/SidebarButton.d.ts.map +1 -1
  329. package/dist/molecules/layout/SidebarButton/index.d.ts +1 -1
  330. package/dist/molecules/layout/SidebarContext.d.ts +1 -8
  331. package/dist/molecules/layout/SidebarContext.d.ts.map +1 -1
  332. package/dist/molecules/layout/index.d.ts +14 -11
  333. package/dist/molecules/layout/index.d.ts.map +1 -1
  334. package/dist/molecules/layout/navigation-context.d.ts +9 -0
  335. package/dist/molecules/layout/navigation-context.d.ts.map +1 -0
  336. package/dist/molecules/layout/sidebar-context.d.ts +7 -0
  337. package/dist/molecules/layout/sidebar-context.d.ts.map +1 -0
  338. package/dist/molecules/layout/use-navigation.d.ts +2 -0
  339. package/dist/molecules/layout/use-navigation.d.ts.map +1 -0
  340. package/dist/molecules/layout/use-sidebar.d.ts +2 -0
  341. package/dist/molecules/layout/use-sidebar.d.ts.map +1 -0
  342. package/dist/molecules/navigation/NavMenu.d.ts +2 -2
  343. package/dist/molecules/navigation/NavMenu.d.ts.map +1 -1
  344. package/dist/molecules/navigation/Pagination.d.ts +2 -2
  345. package/dist/molecules/navigation/index.d.ts +2 -2
  346. package/dist/organisms/index.d.ts +1 -1
  347. package/dist/organisms/showcase/ComponentShowcasePage.d.ts +1 -1
  348. package/dist/organisms/showcase/ComponentShowcasePage.d.ts.map +1 -1
  349. package/dist/templates/AuthTemplate.d.ts +4 -4
  350. package/dist/templates/AuthTemplate.d.ts.map +1 -1
  351. package/dist/templates/ComponentShowcaseTemplate.d.ts +7 -7
  352. package/dist/templates/ComponentShowcaseTemplate.d.ts.map +1 -1
  353. package/dist/templates/DashboardTemplate.d.ts +3 -3
  354. package/dist/templates/DashboardTemplate.d.ts.map +1 -1
  355. package/dist/templates/DataTemplate.d.ts +3 -3
  356. package/dist/templates/DataTemplate.d.ts.map +1 -1
  357. package/dist/templates/EnhancedDataTemplate.d.ts +11 -11
  358. package/dist/templates/EnhancedDataTemplate.d.ts.map +1 -1
  359. package/dist/templates/EnhancedDataTemplate.hooks.bulk.d.ts +2 -2
  360. package/dist/templates/EnhancedDataTemplate.hooks.bulk.d.ts.map +1 -1
  361. package/dist/templates/EnhancedDataTemplate.hooks.d.ts +4 -4
  362. package/dist/templates/EnhancedDataTemplate.hooks.d.ts.map +1 -1
  363. package/dist/templates/admin/AdminCRUDTemplate.d.ts +4 -4
  364. package/dist/templates/admin/AdminCRUDTemplate.d.ts.map +1 -1
  365. package/dist/templates/admin/AdminDashboardTemplate.d.ts +7 -7
  366. package/dist/templates/admin/AdminDashboardTemplate.d.ts.map +1 -1
  367. package/dist/templates/admin/AdminDetailTemplate.d.ts +4 -4
  368. package/dist/templates/admin/AdminDetailTemplate.d.ts.map +1 -1
  369. package/dist/templates/admin/index.d.ts +3 -3
  370. package/dist/templates/admin/index.d.ts.map +1 -1
  371. package/dist/templates/api/APIDataTemplate.d.ts +14 -9
  372. package/dist/templates/api/APIDataTemplate.d.ts.map +1 -1
  373. package/dist/templates/api/create-api-data-template.d.ts +4 -0
  374. package/dist/templates/api/create-api-data-template.d.ts.map +1 -0
  375. package/dist/templates/api/index.d.ts +3 -2
  376. package/dist/templates/api/index.d.ts.map +1 -1
  377. package/dist/templates/factory.d.ts +3 -3
  378. package/dist/templates/factory.d.ts.map +1 -1
  379. package/dist/templates/index.d.ts +8 -8
  380. package/dist/templates/index.d.ts.map +1 -1
  381. package/package.json +10 -7
  382. package/LICENSE +0 -19
  383. package/cli/cli/commands/generate-hooks.js +0 -291
  384. package/cli/cli/commands/init.js +0 -25
  385. package/cli/cli/commands/scaffold.js +0 -201
  386. package/cli/cli/index.js +0 -113
  387. package/cli/commands/generate-hooks.js +0 -291
  388. package/cli/commands/init.js +0 -25
  389. package/cli/commands/scaffold.js +0 -201
  390. package/cli/index.js +0 -6665
  391. package/cli/src/codegen/openapi/bulk-hook-generator.js +0 -252
  392. package/cli/src/codegen/openapi/bulk-types.js +0 -89
  393. package/dist/atoms/components/data/ActivityFeed/ActivityFeed.stories.d.ts +0 -38
  394. package/dist/atoms/components/data/ActivityFeed/ActivityFeed.stories.d.ts.map +0 -1
  395. package/dist/codegen/index.d.ts +0 -7
  396. package/dist/codegen/index.d.ts.map +0 -1
  397. package/dist/codegen/openapi/bulk-hook-generator.d.ts +0 -40
  398. package/dist/codegen/openapi/bulk-hook-generator.d.ts.map +0 -1
  399. package/dist/codegen/openapi/client-generator.d.ts +0 -52
  400. package/dist/codegen/openapi/client-generator.d.ts.map +0 -1
  401. package/dist/codegen/openapi/confidence-scorer.d.ts +0 -30
  402. package/dist/codegen/openapi/confidence-scorer.d.ts.map +0 -1
  403. package/dist/codegen/openapi/hook-config.d.ts +0 -50
  404. package/dist/codegen/openapi/hook-config.d.ts.map +0 -1
  405. package/dist/codegen/openapi/hook-generator.d.ts +0 -108
  406. package/dist/codegen/openapi/hook-generator.d.ts.map +0 -1
  407. package/dist/codegen/openapi/index.d.ts +0 -27
  408. package/dist/codegen/openapi/index.d.ts.map +0 -1
  409. package/dist/codegen/openapi/parser.d.ts +0 -107
  410. package/dist/codegen/openapi/parser.d.ts.map +0 -1
  411. package/dist/codegen/openapi/type-generator.d.ts +0 -53
  412. package/dist/codegen/openapi/type-generator.d.ts.map +0 -1
  413. package/dist/generated/client/client.d.ts +0 -23
  414. package/dist/generated/client/client.d.ts.map +0 -1
  415. package/dist/generated/client/config.d.ts +0 -10
  416. package/dist/generated/client/config.d.ts.map +0 -1
  417. package/dist/generated/client/index.d.ts +0 -12
  418. package/dist/generated/client/index.d.ts.map +0 -1
  419. package/dist/generated/client/methods.d.ts +0 -591
  420. package/dist/generated/client/methods.d.ts.map +0 -1
  421. package/dist/generated/client/types.d.ts +0 -37
  422. package/dist/generated/client/types.d.ts.map +0 -1
  423. package/dist/generated/example.d.ts +0 -8
  424. package/dist/generated/example.d.ts.map +0 -1
  425. package/dist/generated/hooks/index.d.ts +0 -11
  426. package/dist/generated/hooks/index.d.ts.map +0 -1
  427. package/dist/generated/hooks/keys.d.ts +0 -59
  428. package/dist/generated/hooks/keys.d.ts.map +0 -1
  429. package/dist/generated/hooks/mutations.d.ts +0 -551
  430. package/dist/generated/hooks/mutations.d.ts.map +0 -1
  431. package/dist/generated/hooks/queries.d.ts +0 -426
  432. package/dist/generated/hooks/queries.d.ts.map +0 -1
  433. package/dist/generated/hooks/types.d.ts +0 -318
  434. package/dist/generated/hooks/types.d.ts.map +0 -1
  435. package/dist/generated/index.d.ts +0 -13
  436. package/dist/generated/index.d.ts.map +0 -1
  437. package/dist/generated/types/endpoints.d.ts +0 -1364
  438. package/dist/generated/types/endpoints.d.ts.map +0 -1
  439. package/dist/generated/types/index.d.ts +0 -11
  440. package/dist/generated/types/index.d.ts.map +0 -1
  441. package/dist/generated/types/parameters.d.ts +0 -8
  442. package/dist/generated/types/parameters.d.ts.map +0 -1
  443. package/dist/generated/types/responses.d.ts +0 -8
  444. package/dist/generated/types/responses.d.ts.map +0 -1
  445. package/dist/generated/types/schemas.d.ts +0 -652
  446. package/dist/generated/types/schemas.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -5,81 +5,76 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [0.1.2] - 2025-08-09
8
+ ## [Unreleased]
9
9
 
10
10
  ### Fixed
11
- - CLI module format issue - removed `"type": "module"` from package.json to fix CommonJS/ESM conflict
12
- - CSS export paths - added multiple export paths for easier importing
13
- - TypeScript type exports - exported missing interface types (CardProps, SpinnerProps, LabelProps, SelectProps)
14
- - CLI help command - improved help text with examples and version info
11
+ - **TypeScript Build Errors**: Resolved all TypeScript compilation errors across codegen and auth modules
12
+ - Added missing type imports in OpenAPI codegen (`ParsedParameter`, `ClientGeneratorOptions`)
13
+ - Fixed OpenAPIV3 namespace imports and type casting
14
+ - Corrected parser method signatures and response array handling
15
+ - Updated `isListEndpoint` to correctly access responses as array
16
+ - **Auth Type System**: Consolidated user types for better type safety
17
+ - Moved `name`, `roles`, and `permissions` to `BaseUser` as optional fields
18
+ - Made `ExtendedUser` a type alias to `BaseUser` for backward compatibility
19
+ - Updated `MockAuthService` and `MockAuthProvider` to use consolidated types
20
+ - Added proper `RegisterData` interface
21
+ - **Test Suite**: Fixed all test failures
22
+ - Updated hook generator tests to use correct `ParsedEndpoint` response format (array instead of object)
23
+ - All 173 tests now passing
24
+ - **Performance**: Improved MockAuthProvider performance
25
+ - Added memoization to prevent creating new auth service instance on every render
26
+ - **Component Exports**: Standardized component export patterns
27
+ - Consolidated type exports using modern TypeScript syntax (`export { Component, type Props }`)
15
28
 
16
29
  ### Changed
17
- - Package is now properly marked as private on NPM (requires authentication)
18
-
19
- ## [0.1.1] - 2025-08-09 (skipped)
20
-
21
- ### Fixed
22
- - CLI module format issue - removed `"type": "module"` from package.json to fix CommonJS/ESM conflict
23
- - CSS export paths - added multiple export paths for easier importing
24
- - TypeScript type exports - exported missing interface types (CardProps, SpinnerProps, LabelProps, SelectProps)
25
- - CLI help command - improved help text with examples and version info
26
-
27
- ### Changed
28
- - Package is now properly marked as private on NPM (requires authentication)
29
-
30
- ## [0.1.0] - 2025-08-09
31
-
32
- ### Added - Initial Release 🚀
33
-
34
- #### Core Features
35
- - Complete atomic architecture component library (atoms, molecules, organisms, templates)
36
- - Factory pattern for creating React applications with minimal boilerplate
37
- - Comprehensive design system with 8 semantic color palettes
38
- - Domain-driven UI system for automatic component selection
39
-
40
- #### Components
41
- - **UI Primitives**: Button, Card, Input, Select, Badge, Table, and more
42
- - **Data Components**: DataTable with smart rendering, StatCard, Chart, DataBadge
43
- - **Layout Components**: AppLayout, Sidebar, AppHeader with responsive design
44
- - **Templates**: AdminDashboard, DataTemplate, EntityManagement templates
45
-
46
- #### Hook Generation System
47
- - CLI tool for generating React hooks from OpenAPI specifications
48
- - Automatic detection of bulk operations
49
- - Full TypeScript type safety
50
- - TanStack Query integration
51
-
52
- #### Responsive Design
53
- - Progressive responsive system with custom breakpoints
54
- - Mobile-first approach with intelligent component adaptation
55
- - Dynamic view modes (table/card switching)
56
-
57
- #### Enhanced DataTemplate
58
- - Server-side operations (pagination, filtering, sorting)
59
- - Inline editing with validation and optimistic updates
60
- - Bulk operations UI (85% complete, awaiting API integration)
61
- - Progressive responsive design
62
-
63
- #### Developer Experience
64
- - Zero-config setup with sensible defaults
65
- - Automatic UI component selection based on data types
66
- - Built-in authentication patterns
67
- - Comprehensive TypeScript support
68
-
69
- ### Infrastructure
70
- - Vite-based build system
71
- - ESLint rules for design system compliance
72
- - Local development testing setup
73
- - NPM package distribution ready
74
-
75
- ### Documentation
76
- - Comprehensive README with examples
77
- - Atomic architecture guidelines
78
- - Hook generation guide
79
- - Design system documentation
80
-
81
- ---
82
-
83
- This is the foundation release of Pattern Stack Frontend Patterns - a reusable React template for building production-ready applications with minimal boilerplate.
84
-
85
- Built with ❤️ for developers who want to focus on business logic, not infrastructure.
30
+ - **SkeletonAvatar API**: Changed from `size` prop to separate `width` and `height` props
31
+ - **Breaking Change**: `<SkeletonAvatar size={40} />` is no longer supported
32
+ - **Migration**: Use `<SkeletonAvatar width={40} height={40} />` instead
33
+ - Added comprehensive JSDoc with migration examples
34
+ - **DataTable Templates**: Removed unsupported props from DataTemplate usage
35
+ - Removed `onSort`, `selectedRows`, `onSelectionChange` props
36
+ - Added TODO comments for future server-side sorting support (FRO-4)
37
+
38
+ ### Removed
39
+ - **Map Components**: Temporarily removed map component suite due to `react-map-gl` type compatibility issues
40
+ - Removed: `MapCluster`, `MapContainer`, `MapHeatmap`, `MapMarker`, `MapPolygon`, `MapPopup`, `MapRoute`
41
+ - Removed: `MapProvider` context system
42
+ - Removed: `DataMap` and `LocationPicker` composed components
43
+ - Removed: Map-related templates and demo pages
44
+ - **Note**: Components preserved in `backup/map-components` branch for future restoration
45
+ - **Impact**: Applications using map components will need to use alternative mapping solutions until type issues are resolved
46
+ - **Entity Templates**: Removed incomplete entity template and organism components
47
+ - Removed: `EntityManagementTemplate`, `EntityPerformanceDashboardTemplate`
48
+ - Removed: `CategoryBreakdownPanel`, `EntityListPanel`, `MetricsOverviewPanel`, `TrendAnalysisPanel`
49
+ - **Reason**: Incomplete implementations with placeholder text and non-functional features
50
+ - **Note**: Will be properly implemented in example applications and promoted back to template when production-ready
51
+ - **Metric Card Refactoring**: Removed incomplete metric card refactoring files
52
+ - Removed: `MetricCardRefactored.tsx`, `NewMetricCard.tsx`, `NewMetricCard.demo.tsx`, `NewMetricCard.meta.ts`, `NewMetricCard.presets.tsx`, `REFACTORING.md`
53
+ - Removed: 16 commented export placeholders in `variants/index.ts`
54
+ - **Reason**: Only 3 of 19 variants were refactored, leaving most functionality using fallback implementations
55
+ - **Note**: Original MetricCard remains fully functional
56
+ - **Bulk Operations Code**: Removed commented placeholder code for future FRO-35 implementation
57
+ - Removed: ~150 lines of commented code from `hook-generator.ts`
58
+ - Removed: `APIConfig` interface, `detectResourceOperations()` method, `createDefaultConfig()` method
59
+ - **Reason**: Placeholder code should not ship in pre-release; will implement from scratch when FRO-35 begins
60
+ - **Impact**: No impact - code was non-functional and commented out
61
+ - **Production Code Cleanup**: Removed debug and temporary code
62
+ - Removed: Console.log statements from `hook-generator.ts`
63
+ - Removed: Placeholder alert() handlers from `UserAvatar.tsx` (replaced with documented extension points)
64
+ - Removed: WIP/TODO comments from `Chart.tsx` (replaced with professional JSDoc)
65
+
66
+ ### Internal
67
+ - **Build Status**: Clean TypeScript compilation with zero errors
68
+ - **Test Coverage**: 173/173 tests passing across 17 test files
69
+ - **Type Safety**: Improved type inference throughout auth and codegen modules
70
+ - **Code Quality**:
71
+ - Better component organization and import consistency
72
+ - Removed ~600+ lines of incomplete, commented, or placeholder code
73
+ - No console statements in production code
74
+ - All components have professional documentation
75
+ - Clean pre-release state with no partial implementations
76
+
77
+ ## Version History
78
+
79
+ ### Pre-release Development
80
+ This is a pre-release version of the React Frontend Template. Breaking changes may occur without prior notice until v1.0.0 release.
package/README.md CHANGED
@@ -34,11 +34,26 @@ app.addRoutes("/reports", ReportsRoutes)
34
34
 
35
35
  ### Installation
36
36
 
37
+ This is a private package published to npm. Install using standard npm commands:
38
+
37
39
  ```bash
38
- # Install from NPM
40
+ # Install latest version
39
41
  npm install @pattern-stack/frontend-patterns
40
42
 
41
- # Or for local development/testing
43
+ # Install specific version
44
+ npm install @pattern-stack/frontend-patterns@0.2.0-alpha.0
45
+
46
+ # Or add to package.json dependencies
47
+ {
48
+ "dependencies": {
49
+ "@pattern-stack/frontend-patterns": "^0.2.0-alpha.0"
50
+ }
51
+ }
52
+ ```
53
+
54
+ **For Local Development:**
55
+ ```bash
56
+ # Install from local filesystem
42
57
  npm install file:../path/to/frontend-patterns
43
58
 
44
59
  # Or link for active development
@@ -7,12 +7,16 @@
7
7
  */
8
8
 
9
9
  import { promises as fs } from 'fs'
10
- import { join, dirname, resolve } from 'path'
10
+ import { join, dirname } from 'path'
11
+ import { fileURLToPath } from 'url'
11
12
  import { loadOpenAPISpec, parseOpenAPI } from '../../src/codegen/openapi/parser.js'
12
13
  import { generateTypes } from '../../src/codegen/openapi/type-generator.js'
13
14
  import { generateAPIClient } from '../../src/codegen/openapi/client-generator.js'
14
15
  import { generateHooks } from '../../src/codegen/openapi/hook-generator.js'
15
16
 
17
+ const __filename = fileURLToPath(import.meta.url)
18
+ const __dirname = dirname(__filename)
19
+
16
20
  interface GenerateHooksOptions {
17
21
  output: string
18
22
  prefix?: string
@@ -121,6 +125,11 @@ export async function generateHooksCommand(source: string, options: GenerateHook
121
125
  await writeFile(join(options.output, 'hooks', 'keys.ts'), hooks.keys)
122
126
  await writeFile(join(options.output, 'hooks', 'types.ts'), hooks.types)
123
127
  await writeFile(join(options.output, 'hooks', 'index.ts'), hooks.index)
128
+
129
+ // Copy bulk-types.ts to output directory (referenced by hooks/types.ts)
130
+ const bulkTypesPath = join(__dirname, '../../src/codegen/openapi/bulk-types.ts')
131
+ const bulkTypesContent = await fs.readFile(bulkTypesPath, 'utf8')
132
+ await writeFile(join(options.output, 'bulk-types.ts'), bulkTypesContent)
124
133
 
125
134
  // Write confidence report if available
126
135
  if (hooks.report) {
@@ -154,10 +163,10 @@ export { queryKeys } from './hooks'`
154
163
 
155
164
  await writeFile(join(options.output, 'index.ts'), mainIndex)
156
165
 
157
- // Generate usage example
166
+ // Generate usage example (as .tsx since it contains JSX)
158
167
  const usageExample = generateUsageExample(spec.info.title, options)
159
- await writeFile(join(options.output, 'example.ts'), usageExample)
160
-
168
+ await writeFile(join(options.output, 'example.tsx'), usageExample)
169
+
161
170
  console.log()
162
171
  console.log('✅ Generation complete!')
163
172
  console.log(`📦 Generated files in: ${options.output}`)
@@ -165,7 +174,7 @@ export { queryKeys } from './hooks'`
165
174
  console.log('🚀 Quick start:')
166
175
  console.log(`import { createAPIClient, useGetUsers } from './${options.output}'`)
167
176
  console.log()
168
- console.log('💡 See example.ts for detailed usage instructions')
177
+ console.log('💡 See example.tsx for detailed usage instructions')
169
178
 
170
179
  } catch (error) {
171
180
  console.error('❌ Generation failed:')
@@ -177,7 +186,7 @@ export { queryKeys } from './hooks'`
177
186
  async function ensureDir(dir: string) {
178
187
  try {
179
188
  await fs.mkdir(dir, { recursive: true })
180
- } catch (error) {
189
+ } catch {
181
190
  // Directory might already exist
182
191
  }
183
192
  }
@@ -213,7 +213,7 @@ export type { ${name}TemplateProps } from './${name}Template'`
213
213
  async function ensureDir(dir: string) {
214
214
  try {
215
215
  await fs.mkdir(dir, { recursive: true })
216
- } catch (error) {
216
+ } catch {
217
217
  // Directory might already exist
218
218
  }
219
219
  }
package/cli/index.ts CHANGED
@@ -18,9 +18,7 @@ const program = new Command()
18
18
  program
19
19
  .name('pattern-stack')
20
20
  .description('Pattern-Stack CLI for code generation and scaffolding')
21
- .version('0.1.1')
22
- .helpOption('-h, --help', 'Display help for command')
23
- .addHelpText('after', '\nExamples:\n $ pattern-stack generate hooks ./openapi.json --output ./src/api\n $ pattern-stack scaffold component UserCard\n $ pattern-stack init financial --name my-app')
21
+ .version('1.0.0')
24
22
 
25
23
  // Generate commands
26
24
  const generateCommand = program
@@ -0,0 +1,367 @@
1
+ import { singularize, pluralize, isPlural } from '../naming-utils.js';
2
+
3
+ describe('singularize()', () => {
4
+ describe('regular plurals', () => {
5
+ it('should convert cats to cat', () => {
6
+ expect(singularize('cats')).toBe('cat');
7
+ });
8
+
9
+ it('should convert dogs to dog', () => {
10
+ expect(singularize('dogs')).toBe('dog');
11
+ });
12
+
13
+ it('should convert users to user', () => {
14
+ expect(singularize('users')).toBe('user');
15
+ });
16
+
17
+ it('should convert accounts to account', () => {
18
+ expect(singularize('accounts')).toBe('account');
19
+ });
20
+ });
21
+
22
+ describe('-ies plurals', () => {
23
+ it('should convert activities to activity', () => {
24
+ expect(singularize('activities')).toBe('activity');
25
+ });
26
+
27
+ it('should convert categories to category', () => {
28
+ expect(singularize('categories')).toBe('category');
29
+ });
30
+
31
+ it('should convert companies to company', () => {
32
+ expect(singularize('companies')).toBe('company');
33
+ });
34
+
35
+ it('should convert opportunities to opportunity', () => {
36
+ expect(singularize('opportunities')).toBe('opportunity');
37
+ });
38
+ });
39
+
40
+ describe('-es plurals', () => {
41
+ it('should convert boxes to box', () => {
42
+ expect(singularize('boxes')).toBe('box');
43
+ });
44
+
45
+ it('should convert watches to watch', () => {
46
+ expect(singularize('watches')).toBe('watch');
47
+ });
48
+
49
+ it('should convert dishes to dish', () => {
50
+ expect(singularize('dishes')).toBe('dish');
51
+ });
52
+
53
+ it('should convert benches to bench', () => {
54
+ expect(singularize('benches')).toBe('bench');
55
+ });
56
+ });
57
+
58
+ describe('-ses plurals (tricky cases)', () => {
59
+ it('should convert addresses to address', () => {
60
+ expect(singularize('addresses')).toBe('address');
61
+ });
62
+
63
+ it('should convert businesses to business', () => {
64
+ expect(singularize('businesses')).toBe('business');
65
+ });
66
+
67
+ it('should convert processes to process', () => {
68
+ expect(singularize('processes')).toBe('process');
69
+ });
70
+ });
71
+
72
+ describe('irregular plurals', () => {
73
+ it('should convert people to person', () => {
74
+ expect(singularize('people')).toBe('person');
75
+ });
76
+
77
+ it('should convert children to child', () => {
78
+ expect(singularize('children')).toBe('child');
79
+ });
80
+
81
+ it('should convert men to man', () => {
82
+ expect(singularize('men')).toBe('man');
83
+ });
84
+
85
+ it('should convert women to woman', () => {
86
+ expect(singularize('women')).toBe('woman');
87
+ });
88
+ });
89
+
90
+ describe('already singular', () => {
91
+ it('should keep data as data', () => {
92
+ expect(singularize('data')).toBe('data');
93
+ });
94
+
95
+ it('should keep metadata as metadata', () => {
96
+ expect(singularize('metadata')).toBe('metadata');
97
+ });
98
+
99
+ it('should keep user as user', () => {
100
+ expect(singularize('user')).toBe('user');
101
+ });
102
+
103
+ it('should keep account as account', () => {
104
+ expect(singularize('account')).toBe('account');
105
+ });
106
+ });
107
+
108
+ describe('edge cases', () => {
109
+ it('should keep status as status', () => {
110
+ expect(singularize('status')).toBe('status');
111
+ });
112
+
113
+ it('should keep class as class', () => {
114
+ expect(singularize('class')).toBe('class');
115
+ });
116
+
117
+ it('should keep bus as bus', () => {
118
+ expect(singularize('bus')).toBe('bus');
119
+ });
120
+
121
+ it('should convert pass to pass (not pas)', () => {
122
+ expect(singularize('pass')).toBe('pass');
123
+ });
124
+
125
+ it('should handle empty string', () => {
126
+ expect(singularize('')).toBe('');
127
+ });
128
+
129
+ it('should handle single character', () => {
130
+ expect(singularize('a')).toBe('a');
131
+ });
132
+ });
133
+ });
134
+
135
+ describe('pluralize()', () => {
136
+ describe('regular plurals', () => {
137
+ it('should convert cat to cats', () => {
138
+ expect(pluralize('cat')).toBe('cats');
139
+ });
140
+
141
+ it('should convert dog to dogs', () => {
142
+ expect(pluralize('dog')).toBe('dogs');
143
+ });
144
+
145
+ it('should convert user to users', () => {
146
+ expect(pluralize('user')).toBe('users');
147
+ });
148
+
149
+ it('should convert account to accounts', () => {
150
+ expect(pluralize('account')).toBe('accounts');
151
+ });
152
+ });
153
+
154
+ describe('-y endings (consonant + y)', () => {
155
+ it('should convert activity to activities', () => {
156
+ expect(pluralize('activity')).toBe('activities');
157
+ });
158
+
159
+ it('should convert category to categories', () => {
160
+ expect(pluralize('category')).toBe('categories');
161
+ });
162
+
163
+ it('should convert company to companies', () => {
164
+ expect(pluralize('company')).toBe('companies');
165
+ });
166
+
167
+ it('should convert opportunity to opportunities', () => {
168
+ expect(pluralize('opportunity')).toBe('opportunities');
169
+ });
170
+ });
171
+
172
+ describe('vowel + y endings', () => {
173
+ it('should convert day to days', () => {
174
+ expect(pluralize('day')).toBe('days');
175
+ });
176
+
177
+ it('should convert key to keys', () => {
178
+ expect(pluralize('key')).toBe('keys');
179
+ });
180
+
181
+ it('should convert boy to boys', () => {
182
+ expect(pluralize('boy')).toBe('boys');
183
+ });
184
+
185
+ it('should convert array to arrays', () => {
186
+ expect(pluralize('array')).toBe('arrays');
187
+ });
188
+ });
189
+
190
+ describe('-x, -ch, -sh, -s, -ss endings', () => {
191
+ it('should convert box to boxes', () => {
192
+ expect(pluralize('box')).toBe('boxes');
193
+ });
194
+
195
+ it('should convert watch to watches', () => {
196
+ expect(pluralize('watch')).toBe('watches');
197
+ });
198
+
199
+ it('should convert dish to dishes', () => {
200
+ expect(pluralize('dish')).toBe('dishes');
201
+ });
202
+
203
+ it('should convert bench to benches', () => {
204
+ expect(pluralize('bench')).toBe('benches');
205
+ });
206
+
207
+ it('should convert address to addresses', () => {
208
+ expect(pluralize('address')).toBe('addresses');
209
+ });
210
+
211
+ it('should convert business to businesses', () => {
212
+ expect(pluralize('business')).toBe('businesses');
213
+ });
214
+
215
+ it('should convert class to classes', () => {
216
+ expect(pluralize('class')).toBe('classes');
217
+ });
218
+ });
219
+
220
+ describe('irregular plurals', () => {
221
+ it('should convert person to people', () => {
222
+ expect(pluralize('person')).toBe('people');
223
+ });
224
+
225
+ it('should convert child to children', () => {
226
+ expect(pluralize('child')).toBe('children');
227
+ });
228
+
229
+ it('should convert man to men', () => {
230
+ expect(pluralize('man')).toBe('men');
231
+ });
232
+
233
+ it('should convert woman to women', () => {
234
+ expect(pluralize('woman')).toBe('women');
235
+ });
236
+ });
237
+
238
+ describe('already plural (no double-pluralize)', () => {
239
+ it('should keep accounts as accounts', () => {
240
+ expect(pluralize('accounts')).toBe('accounts');
241
+ });
242
+
243
+ it('should keep users as users', () => {
244
+ expect(pluralize('users')).toBe('users');
245
+ });
246
+
247
+ it('should keep activities as activities', () => {
248
+ expect(pluralize('activities')).toBe('activities');
249
+ });
250
+
251
+ it('should keep boxes as boxes', () => {
252
+ expect(pluralize('boxes')).toBe('boxes');
253
+ });
254
+ });
255
+
256
+ describe('edge cases', () => {
257
+ it('should handle empty string', () => {
258
+ expect(pluralize('')).toBe('');
259
+ });
260
+
261
+ it('should handle single character', () => {
262
+ expect(pluralize('a')).toBe('as');
263
+ });
264
+
265
+ it('should keep status as status (special case)', () => {
266
+ expect(pluralize('status')).toBe('status');
267
+ });
268
+ });
269
+ });
270
+
271
+ describe('isPlural()', () => {
272
+ describe('should return true for plural words', () => {
273
+ it('should identify cats as plural', () => {
274
+ expect(isPlural('cats')).toBe(true);
275
+ });
276
+
277
+ it('should identify activities as plural', () => {
278
+ expect(isPlural('activities')).toBe(true);
279
+ });
280
+
281
+ it('should identify boxes as plural', () => {
282
+ expect(isPlural('boxes')).toBe(true);
283
+ });
284
+
285
+ it('should identify watches as plural', () => {
286
+ expect(isPlural('watches')).toBe(true);
287
+ });
288
+
289
+ it('should identify addresses as plural', () => {
290
+ expect(isPlural('addresses')).toBe(true);
291
+ });
292
+
293
+ it('should identify people as plural', () => {
294
+ expect(isPlural('people')).toBe(true);
295
+ });
296
+
297
+ it('should identify children as plural', () => {
298
+ expect(isPlural('children')).toBe(true);
299
+ });
300
+
301
+ it('should identify users as plural', () => {
302
+ expect(isPlural('users')).toBe(true);
303
+ });
304
+
305
+ it('should identify accounts as plural', () => {
306
+ expect(isPlural('accounts')).toBe(true);
307
+ });
308
+ });
309
+
310
+ describe('should return false for singular words', () => {
311
+ it('should identify cat as singular', () => {
312
+ expect(isPlural('cat')).toBe(false);
313
+ });
314
+
315
+ it('should identify activity as singular', () => {
316
+ expect(isPlural('activity')).toBe(false);
317
+ });
318
+
319
+ it('should identify box as singular', () => {
320
+ expect(isPlural('box')).toBe(false);
321
+ });
322
+
323
+ it('should identify user as singular', () => {
324
+ expect(isPlural('user')).toBe(false);
325
+ });
326
+
327
+ it('should identify account as singular', () => {
328
+ expect(isPlural('account')).toBe(false);
329
+ });
330
+ });
331
+
332
+ describe('should return false for edge cases', () => {
333
+ it('should identify status as singular', () => {
334
+ expect(isPlural('status')).toBe(false);
335
+ });
336
+
337
+ it('should identify class as singular', () => {
338
+ expect(isPlural('class')).toBe(false);
339
+ });
340
+
341
+ it('should identify bus as singular', () => {
342
+ expect(isPlural('bus')).toBe(false);
343
+ });
344
+
345
+ it('should identify process as singular', () => {
346
+ expect(isPlural('process')).toBe(false);
347
+ });
348
+
349
+ it('should identify data as singular', () => {
350
+ expect(isPlural('data')).toBe(false);
351
+ });
352
+
353
+ it('should identify metadata as singular', () => {
354
+ expect(isPlural('metadata')).toBe(false);
355
+ });
356
+ });
357
+
358
+ describe('should handle empty/minimal input', () => {
359
+ it('should return false for empty string', () => {
360
+ expect(isPlural('')).toBe(false);
361
+ });
362
+
363
+ it('should return false for single character', () => {
364
+ expect(isPlural('a')).toBe(false);
365
+ });
366
+ });
367
+ });