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

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 (165) hide show
  1. package/dist/atoms/components/core/Badge/Badge.d.ts +1 -1
  2. package/dist/atoms/components/data/DataTable/ColumnFilterDropdown.d.ts +32 -0
  3. package/dist/atoms/components/data/DataTable/ColumnFilterDropdown.d.ts.map +1 -0
  4. package/dist/atoms/components/data/DataTable/ColumnVisibilityToggle.d.ts +32 -0
  5. package/dist/atoms/components/data/DataTable/ColumnVisibilityToggle.d.ts.map +1 -0
  6. package/dist/atoms/components/data/DataTable/DataTable.d.ts +5 -2
  7. package/dist/atoms/components/data/DataTable/DataTable.d.ts.map +1 -1
  8. package/dist/atoms/components/data/DataTable/DataTable.expansion.d.ts +91 -0
  9. package/dist/atoms/components/data/DataTable/DataTable.expansion.d.ts.map +1 -0
  10. package/dist/atoms/components/data/DataTable/DataTable.filters.d.ts +271 -0
  11. package/dist/atoms/components/data/DataTable/DataTable.filters.d.ts.map +1 -0
  12. package/dist/atoms/components/data/DataTable/DataTable.types.d.ts +155 -5
  13. package/dist/atoms/components/data/DataTable/DataTable.types.d.ts.map +1 -1
  14. package/dist/atoms/components/data/DataTable/ExpandButton.d.ts +37 -0
  15. package/dist/atoms/components/data/DataTable/ExpandButton.d.ts.map +1 -0
  16. package/dist/atoms/components/data/DataTable/FilterPill.d.ts +25 -0
  17. package/dist/atoms/components/data/DataTable/FilterPill.d.ts.map +1 -0
  18. package/dist/atoms/components/data/DataTable/QuickFilterBar.d.ts +35 -0
  19. package/dist/atoms/components/data/DataTable/QuickFilterBar.d.ts.map +1 -0
  20. package/dist/atoms/components/data/DataTable/filters/BooleanFilterEditor.d.ts +10 -0
  21. package/dist/atoms/components/data/DataTable/filters/BooleanFilterEditor.d.ts.map +1 -0
  22. package/dist/atoms/components/data/DataTable/filters/DateFilterEditor.d.ts +11 -0
  23. package/dist/atoms/components/data/DataTable/filters/DateFilterEditor.d.ts.map +1 -0
  24. package/dist/atoms/components/data/DataTable/filters/MultiSelectFilterEditor.d.ts +10 -0
  25. package/dist/atoms/components/data/DataTable/filters/MultiSelectFilterEditor.d.ts.map +1 -0
  26. package/dist/atoms/components/data/DataTable/filters/NumberFilterEditor.d.ts +10 -0
  27. package/dist/atoms/components/data/DataTable/filters/NumberFilterEditor.d.ts.map +1 -0
  28. package/dist/atoms/components/data/DataTable/filters/SelectFilterEditor.d.ts +10 -0
  29. package/dist/atoms/components/data/DataTable/filters/SelectFilterEditor.d.ts.map +1 -0
  30. package/dist/atoms/components/data/DataTable/filters/TextFilterEditor.d.ts +10 -0
  31. package/dist/atoms/components/data/DataTable/filters/TextFilterEditor.d.ts.map +1 -0
  32. package/dist/atoms/components/data/DataTable/filters/index.d.ts +14 -0
  33. package/dist/atoms/components/data/DataTable/filters/index.d.ts.map +1 -0
  34. package/dist/atoms/components/data/DataTable/index.d.ts +9 -0
  35. package/dist/atoms/components/data/DataTable/index.d.ts.map +1 -1
  36. package/dist/atoms/components/data/ProgressBar/ProgressBar.d.ts +1 -1
  37. package/dist/atoms/components/data/ProgressBar/ProgressBar.d.ts.map +1 -1
  38. package/dist/atoms/components/data/index.d.ts +3 -2
  39. package/dist/atoms/components/data/index.d.ts.map +1 -1
  40. package/dist/atoms/composed/ConnectionStatus/ConnectionStatus.d.ts +16 -0
  41. package/dist/atoms/composed/ConnectionStatus/ConnectionStatus.d.ts.map +1 -0
  42. package/dist/atoms/composed/ConnectionStatus/index.d.ts +3 -0
  43. package/dist/atoms/composed/ConnectionStatus/index.d.ts.map +1 -0
  44. package/dist/atoms/hooks/index.d.ts +9 -0
  45. package/dist/atoms/hooks/index.d.ts.map +1 -1
  46. package/dist/atoms/hooks/useAdaptiveTable.d.ts +49 -0
  47. package/dist/atoms/hooks/useAdaptiveTable.d.ts.map +1 -0
  48. package/dist/atoms/hooks/useApi.d.ts +1 -1
  49. package/dist/atoms/hooks/useApi.d.ts.map +1 -1
  50. package/dist/atoms/hooks/useColumnVisibility.d.ts +75 -0
  51. package/dist/atoms/hooks/useColumnVisibility.d.ts.map +1 -0
  52. package/dist/atoms/hooks/useEntityData.d.ts +36 -0
  53. package/dist/atoms/hooks/useEntityData.d.ts.map +1 -0
  54. package/dist/atoms/hooks/useEntityDetail.d.ts +43 -0
  55. package/dist/atoms/hooks/useEntityDetail.d.ts.map +1 -0
  56. package/dist/atoms/hooks/useExpandedRows.d.ts +66 -0
  57. package/dist/atoms/hooks/useExpandedRows.d.ts.map +1 -0
  58. package/dist/atoms/hooks/useFieldMetadata.d.ts +18 -0
  59. package/dist/atoms/hooks/useFieldMetadata.d.ts.map +1 -0
  60. package/dist/atoms/hooks/useOnlineStatus.d.ts +16 -0
  61. package/dist/atoms/hooks/useOnlineStatus.d.ts.map +1 -0
  62. package/dist/atoms/hooks/useResponsiveTable.d.ts +123 -0
  63. package/dist/atoms/hooks/useResponsiveTable.d.ts.map +1 -0
  64. package/dist/atoms/hooks/useTableFilters.d.ts +92 -0
  65. package/dist/atoms/hooks/useTableFilters.d.ts.map +1 -0
  66. package/dist/atoms/index.d.ts +1 -0
  67. package/dist/atoms/index.d.ts.map +1 -1
  68. package/dist/atoms/primitives/sheet.d.ts +23 -0
  69. package/dist/atoms/primitives/sheet.d.ts.map +1 -0
  70. package/dist/atoms/primitives/table.d.ts.map +1 -1
  71. package/dist/atoms/services/api/client.d.ts +12 -2
  72. package/dist/atoms/services/api/client.d.ts.map +1 -1
  73. package/dist/atoms/services/auth-service.d.ts +15 -0
  74. package/dist/atoms/services/auth-service.d.ts.map +1 -1
  75. package/dist/atoms/services/index.d.ts +2 -2
  76. package/dist/atoms/services/index.d.ts.map +1 -1
  77. package/dist/atoms/shared/config/table-config.d.ts +79 -0
  78. package/dist/atoms/shared/config/table-config.d.ts.map +1 -0
  79. package/dist/atoms/shared/index.d.ts +1 -0
  80. package/dist/atoms/shared/index.d.ts.map +1 -1
  81. package/dist/atoms/types/auth.d.ts +95 -2
  82. package/dist/atoms/types/auth.d.ts.map +1 -1
  83. package/dist/atoms/types/index.d.ts +1 -0
  84. package/dist/atoms/types/index.d.ts.map +1 -1
  85. package/dist/atoms/types/navigation.d.ts +1 -1
  86. package/dist/atoms/types/navigation.d.ts.map +1 -1
  87. package/dist/atoms/types/ui-config.d.ts +46 -11
  88. package/dist/atoms/types/ui-config.d.ts.map +1 -1
  89. package/dist/atoms/types/ui-metadata.d.ts +103 -0
  90. package/dist/atoms/types/ui-metadata.d.ts.map +1 -0
  91. package/dist/atoms/utils/entity-card-mapping.d.ts +105 -0
  92. package/dist/atoms/utils/entity-card-mapping.d.ts.map +1 -0
  93. package/dist/atoms/utils/field-detection.d.ts +2 -2
  94. package/dist/atoms/utils/field-detection.d.ts.map +1 -1
  95. package/dist/atoms/utils/icon-map.d.ts +48 -0
  96. package/dist/atoms/utils/icon-map.d.ts.map +1 -1
  97. package/dist/atoms/utils/index.d.ts +2 -0
  98. package/dist/atoms/utils/index.d.ts.map +1 -1
  99. package/dist/atoms/utils/ui-mapping.d.ts +9 -3
  100. package/dist/atoms/utils/ui-mapping.d.ts.map +1 -1
  101. package/dist/features/auth/components/ProtectedRoute.d.ts +3 -1
  102. package/dist/features/auth/components/ProtectedRoute.d.ts.map +1 -1
  103. package/dist/features/auth/hooks/useAuth.d.ts.map +1 -1
  104. package/dist/features/auth/providers/NoAuthProvider.d.ts +17 -0
  105. package/dist/features/auth/providers/NoAuthProvider.d.ts.map +1 -0
  106. package/dist/features/auth/providers/index.d.ts +1 -0
  107. package/dist/features/auth/providers/index.d.ts.map +1 -1
  108. package/dist/frontend-patterns.css +1 -4554
  109. package/dist/index.d.ts +12 -4
  110. package/dist/index.d.ts.map +1 -1
  111. package/dist/index.es.js +8793 -18275
  112. package/dist/index.es.js.map +1 -1
  113. package/dist/index.js +8790 -18271
  114. package/dist/index.js.map +1 -1
  115. package/dist/molecules/layout/AppHeader/AppHeader.d.ts.map +1 -1
  116. package/dist/molecules/layout/BulkSelectionBar.d.ts +14 -2
  117. package/dist/molecules/layout/BulkSelectionBar.d.ts.map +1 -1
  118. package/dist/molecules/layout/FieldGrid/FieldGrid.d.ts +61 -0
  119. package/dist/molecules/layout/FieldGrid/FieldGrid.d.ts.map +1 -0
  120. package/dist/molecules/layout/FieldGrid/index.d.ts +2 -0
  121. package/dist/molecules/layout/FieldGrid/index.d.ts.map +1 -0
  122. package/dist/molecules/layout/ListToolbar/ListToolbar.d.ts +37 -0
  123. package/dist/molecules/layout/ListToolbar/ListToolbar.d.ts.map +1 -0
  124. package/dist/molecules/layout/ListToolbar/index.d.ts +2 -0
  125. package/dist/molecules/layout/ListToolbar/index.d.ts.map +1 -0
  126. package/dist/molecules/layout/PageTitle/PageTitle.d.ts +17 -0
  127. package/dist/molecules/layout/PageTitle/PageTitle.d.ts.map +1 -0
  128. package/dist/molecules/layout/PageTitle/index.d.ts +2 -0
  129. package/dist/molecules/layout/PageTitle/index.d.ts.map +1 -0
  130. package/dist/molecules/layout/index.d.ts +3 -0
  131. package/dist/molecules/layout/index.d.ts.map +1 -1
  132. package/dist/molecules/layout/navigation-context.d.ts.map +1 -1
  133. package/dist/sync/EntityStoreProvider.d.ts +35 -0
  134. package/dist/sync/EntityStoreProvider.d.ts.map +1 -0
  135. package/dist/sync/createEntityHooks.d.ts +29 -0
  136. package/dist/sync/createEntityHooks.d.ts.map +1 -0
  137. package/dist/sync/createStore.d.ts +65 -0
  138. package/dist/sync/createStore.d.ts.map +1 -0
  139. package/dist/sync/index.d.ts +6 -0
  140. package/dist/sync/index.d.ts.map +1 -0
  141. package/dist/sync/types.d.ts +383 -0
  142. package/dist/sync/types.d.ts.map +1 -0
  143. package/dist/templates/ListPageTemplate.d.ts +21 -0
  144. package/dist/templates/ListPageTemplate.d.ts.map +1 -0
  145. package/dist/templates/admin/AdminCRUDTemplate.d.ts.map +1 -1
  146. package/dist/templates/factory.d.ts +11 -0
  147. package/dist/templates/factory.d.ts.map +1 -1
  148. package/dist/templates/index.d.ts +1 -0
  149. package/dist/templates/index.d.ts.map +1 -1
  150. package/package.json +11 -7
  151. package/cli/commands/generate-hooks.ts +0 -325
  152. package/cli/commands/init.ts +0 -33
  153. package/cli/commands/scaffold.ts +0 -224
  154. package/cli/index.ts +0 -122
  155. package/cli/src/codegen/openapi/__tests__/naming-utils.test.js +0 -367
  156. package/cli/src/codegen/openapi/client-generator.js +0 -727
  157. package/cli/src/codegen/openapi/confidence-scorer.js +0 -93
  158. package/cli/src/codegen/openapi/hook-config.js +0 -48
  159. package/cli/src/codegen/openapi/hook-generator.js +0 -763
  160. package/cli/src/codegen/openapi/naming-constants.js +0 -98
  161. package/cli/src/codegen/openapi/naming-utils.js +0 -149
  162. package/cli/src/codegen/openapi/parser.js +0 -274
  163. package/cli/src/codegen/openapi/type-generator.js +0 -329
  164. package/dist/codegen/openapi/bulk-types.d.ts +0 -142
  165. package/dist/codegen/openapi/bulk-types.d.ts.map +0 -1
@@ -1,367 +0,0 @@
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
- });