@c-rex/components 0.1.37 → 0.1.39

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 (146) hide show
  1. package/README.md +73 -73
  2. package/package.json +250 -235
  3. package/src/article/article-action-bar.tsx +110 -110
  4. package/src/article/article-content.tsx +18 -46
  5. package/src/autocomplete.tsx +201 -201
  6. package/src/breadcrumb.tsx +124 -124
  7. package/src/carousel/carousel.tsx +353 -352
  8. package/src/check-article-lang.tsx +47 -43
  9. package/src/directoryNodes/directory-tree-context.tsx +388 -0
  10. package/src/directoryNodes/tree-of-content.tsx +68 -67
  11. package/src/documents/result-list.tsx +124 -127
  12. package/src/favorites/bookmark-button.tsx +97 -79
  13. package/src/favorites/favorite-button.tsx +137 -74
  14. package/src/footer/footer-shell.tsx +52 -0
  15. package/src/footer/footer.tsx +7 -0
  16. package/src/footer/legal-links-block.tsx +25 -0
  17. package/src/footer/organization-contact-block.tsx +94 -0
  18. package/src/footer/social-links-block.tsx +38 -0
  19. package/src/footer/types.ts +10 -0
  20. package/src/footer/vcard-footer.tsx +72 -0
  21. package/src/generated/client-components.tsx +1366 -1350
  22. package/src/generated/create-client-request.tsx +116 -113
  23. package/src/generated/create-server-request.tsx +70 -61
  24. package/src/generated/create-suggestions-request.tsx +55 -55
  25. package/src/generated/server-components.tsx +1056 -1056
  26. package/src/generated/suggestions.tsx +302 -299
  27. package/src/icons/file-icon.tsx +8 -8
  28. package/src/icons/flag-icon.tsx +15 -15
  29. package/src/icons/loading.tsx +11 -11
  30. package/src/icons/social-icon.tsx +24 -0
  31. package/src/info/info-card.tsx +43 -0
  32. package/src/info/{info-table.tsx → information-unit-metadata-grid.tsx} +157 -146
  33. package/src/info/shared.tsx +49 -25
  34. package/src/navbar/language-switcher/content-language-switch.tsx +92 -92
  35. package/src/navbar/language-switcher/shared.tsx +33 -33
  36. package/src/navbar/language-switcher/ui-language-switch.tsx +37 -38
  37. package/src/navbar/navbar.tsx +157 -148
  38. package/src/navbar/settings.tsx +62 -62
  39. package/src/navbar/sign-in-out-btns.tsx +35 -35
  40. package/src/navbar/user-menu.tsx +60 -60
  41. package/src/page-wrapper.tsx +54 -31
  42. package/src/render-article.module.css +155 -0
  43. package/src/render-article.tsx +75 -68
  44. package/src/renditions/file-download.tsx +83 -83
  45. package/src/renditions/html.tsx +64 -64
  46. package/src/renditions/image/container.tsx +54 -54
  47. package/src/renditions/image/rendition.tsx +55 -55
  48. package/src/restriction-menu/restriction-menu-container.tsx +117 -53
  49. package/src/restriction-menu/restriction-menu-item.tsx +155 -147
  50. package/src/restriction-menu/restriction-menu.tsx +341 -157
  51. package/src/results/dialog-filter.tsx +166 -166
  52. package/src/results/empty.tsx +15 -15
  53. package/src/results/filter-navbar.tsx +294 -261
  54. package/src/results/filter-sidebar/__tests__/utils.test.ts +129 -0
  55. package/src/results/filter-sidebar/index.tsx +270 -126
  56. package/src/results/filter-sidebar/utils.ts +196 -164
  57. package/src/results/generic/table-result-list.tsx +97 -99
  58. package/src/results/{table-with-images.tsx → information-unit-search-results-card-list.tsx} +125 -127
  59. package/src/results/{cards.tsx → information-unit-search-results-cards.tsx} +99 -99
  60. package/src/results/{table.tsx → information-unit-search-results-table.tsx} +104 -104
  61. package/src/results/pagination.tsx +81 -81
  62. package/src/results/summary.ts +30 -0
  63. package/src/results/utils.ts +54 -47
  64. package/src/search-input.tsx +70 -70
  65. package/src/share-button.tsx +49 -49
  66. package/src/stores/favorites-store.ts +88 -88
  67. package/src/stores/highlight-store.ts +15 -15
  68. package/src/stores/language-store.ts +14 -43
  69. package/src/stores/restriction-store.ts +11 -11
  70. package/src/stores/search-settings-store.ts +68 -64
  71. package/src/article/article-action-bar.analysis.md +0 -15
  72. package/src/article/article-action-bar.stories.tsx +0 -15
  73. package/src/article/article-content.analysis.md +0 -15
  74. package/src/article/article-content.stories.tsx +0 -21
  75. package/src/autocomplete.analysis.md +0 -17
  76. package/src/breadcrumb.analysis.md +0 -15
  77. package/src/carousel/carousel.analysis.md +0 -17
  78. package/src/check-article-lang.analysis.md +0 -15
  79. package/src/directoryNodes/tree-of-content.analysis.md +0 -14
  80. package/src/directoryNodes/tree-of-content.stories.tsx +0 -22
  81. package/src/documents/result-list.analysis.md +0 -14
  82. package/src/documents/result-list.stories.tsx +0 -19
  83. package/src/favorites/bookmark-button.analysis.md +0 -17
  84. package/src/favorites/bookmark-button.stories.tsx +0 -19
  85. package/src/favorites/favorite-button.analysis.md +0 -18
  86. package/src/favorites/favorite-button.stories.tsx +0 -22
  87. package/src/icons/file-icon.analysis.md +0 -14
  88. package/src/icons/file-icon.stories.tsx +0 -19
  89. package/src/icons/flag-icon.analysis.md +0 -14
  90. package/src/icons/flag-icon.stories.tsx +0 -25
  91. package/src/icons/loading.analysis.md +0 -14
  92. package/src/icons/loading.stories.tsx +0 -21
  93. package/src/info/info-table.analysis.md +0 -15
  94. package/src/info/shared.analysis.md +0 -14
  95. package/src/info/stories/info-table.stories.tsx +0 -31
  96. package/src/info/stories/shared.stories.tsx +0 -24
  97. package/src/navbar/language-switcher/content-language-switch.analysis.md +0 -15
  98. package/src/navbar/language-switcher/shared.analysis.md +0 -14
  99. package/src/navbar/language-switcher/ui-language-switch.analysis.md +0 -15
  100. package/src/navbar/navbar.analysis.md +0 -14
  101. package/src/navbar/settings.analysis.md +0 -14
  102. package/src/navbar/sign-in-out-btns.analysis.md +0 -14
  103. package/src/navbar/stories/navbar.stories.tsx +0 -31
  104. package/src/navbar/stories/settings.stories.tsx +0 -15
  105. package/src/navbar/stories/sign-in-out-btns.stories.tsx +0 -15
  106. package/src/navbar/stories/user-menu.stories.tsx +0 -20
  107. package/src/navbar/user-menu.analysis.md +0 -14
  108. package/src/page-wrapper.analysis.md +0 -14
  109. package/src/render-article.analysis.md +0 -15
  110. package/src/renditions/file-download.analysis.md +0 -14
  111. package/src/renditions/file-download.stories.tsx +0 -19
  112. package/src/renditions/html.analysis.md +0 -17
  113. package/src/renditions/html.stories.tsx +0 -19
  114. package/src/renditions/image/container.analysis.md +0 -15
  115. package/src/renditions/image/container.stories.tsx +0 -19
  116. package/src/renditions/image/rendition.analysis.md +0 -14
  117. package/src/renditions/image/rendition.stories.tsx +0 -19
  118. package/src/restriction-menu/restriction-menu-container.analysis.md +0 -14
  119. package/src/restriction-menu/restriction-menu-item.analysis.md +0 -14
  120. package/src/restriction-menu/restriction-menu.analysis.md +0 -17
  121. package/src/results/analysis/cards.analysis.md +0 -14
  122. package/src/results/analysis/dialog-filter.analysis.md +0 -17
  123. package/src/results/analysis/empty.analysis.md +0 -14
  124. package/src/results/analysis/filter-navbar.analysis.md +0 -16
  125. package/src/results/analysis/pagination.analysis.md +0 -14
  126. package/src/results/analysis/table-with-images.analysis.md +0 -15
  127. package/src/results/analysis/table.analysis.md +0 -15
  128. package/src/results/filter-sidebar/index.analysis.md +0 -14
  129. package/src/results/generic/table-result-list.analysis.md +0 -15
  130. package/src/results/generic/table-result-list.stories.tsx +0 -21
  131. package/src/results/stories/cards.stories.tsx +0 -66
  132. package/src/results/stories/dialog-filter.stories.tsx +0 -20
  133. package/src/results/stories/empty.stories.tsx +0 -25
  134. package/src/results/stories/filter-navbar.stories.tsx +0 -19
  135. package/src/results/stories/filter-sidebar.stories.tsx +0 -20
  136. package/src/results/stories/pagination.stories.tsx +0 -24
  137. package/src/results/stories/table-with-images.stories.tsx +0 -19
  138. package/src/results/stories/table.stories.tsx +0 -78
  139. package/src/search-input.analysis.md +0 -15
  140. package/src/share-button.analysis.md +0 -19
  141. package/src/stories/autocomplete.stories.tsx +0 -20
  142. package/src/stories/breadcrumb.stories.tsx +0 -93
  143. package/src/stories/check-article-lang.stories.tsx +0 -22
  144. package/src/stories/render-article.stories.tsx +0 -19
  145. package/src/stories/search-input.stories.tsx +0 -21
  146. package/src/stories/share-button.stories.tsx +0 -15
@@ -1,17 +0,0 @@
1
- # Analysis: html
2
-
3
- - Component: packages/components/src/renditions/html.tsx
4
- - Type: Server component
5
- - Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=yes
6
-
7
- ## Possible re-render causes
8
- - No obvious excessive re-render trigger beyond normal prop/context updates.
9
-
10
- ## Possible bugs/risks
11
- - Async flows can hit race conditions during fast param/route changes.
12
- - fetch(url) runs inside async server rendering path and can increase list/page latency.
13
-
14
- ## Recommended improvements
15
- - Consider cancellation guards (isMounted or AbortController) and standardized error handling.
16
- - Consider caching/revalidation and lighter fallback strategy to reduce N+1 impact.
17
-
@@ -1,19 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { HtmlRendition } from '../html';
3
-
4
- const meta: Meta<typeof HtmlRendition> = {
5
- title: 'Components/Renditions/HtmlRendition',
6
- component: HtmlRendition,
7
- parameters: {
8
- layout: 'centered',
9
- },
10
- tags: ['autodocs'],
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof HtmlRendition>;
14
-
15
- export const Basic: Story = {
16
- args: {
17
- shortId: 'doc-1',
18
- },
19
- };
@@ -1,15 +0,0 @@
1
- # Analysis: container
2
-
3
- - Component: packages/components/src/renditions/image/container.tsx
4
- - Type: Client component
5
- - Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
6
-
7
- ## Possible re-render causes
8
- - No obvious excessive re-render trigger beyond normal prop/context updates.
9
-
10
- ## Possible bugs/risks
11
- - imageRestrictions prop exists but is not applied to Restrict composition.
12
-
13
- ## Recommended improvements
14
- - Apply imageRestrictions to Restrict or remove the prop to avoid misleading API behavior.
15
-
@@ -1,19 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { ImageRenditionContainer } from './container';
3
-
4
- const meta: Meta<typeof ImageRenditionContainer> = {
5
- title: 'Components/Renditions/ImageRenditionContainer',
6
- component: ImageRenditionContainer,
7
- parameters: {
8
- layout: 'centered',
9
- },
10
- tags: ['autodocs'],
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof ImageRenditionContainer>;
14
-
15
- export const Basic: Story = {
16
- args: {
17
- itemShortId: 'doc-1',
18
- },
19
- };
@@ -1,14 +0,0 @@
1
- # Analysis: rendition
2
-
3
- - Component: packages/components/src/renditions/image/rendition.tsx
4
- - Type: Server component
5
- - Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
6
-
7
- ## Possible re-render causes
8
- - No obvious excessive re-render trigger beyond normal prop/context updates.
9
-
10
- ## Possible bugs/risks
11
- - No critical bug is evident in this quick static pass; keep tests for error and loading paths.
12
-
13
- ## Recommended improvements
14
- - Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
@@ -1,19 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { ImageRendition } from './rendition';
3
-
4
- const meta: Meta<typeof ImageRendition> = {
5
- title: 'Components/Renditions/ImageRendition',
6
- component: ImageRendition,
7
- parameters: {
8
- layout: 'centered',
9
- },
10
- tags: ['autodocs'],
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof ImageRendition>;
14
-
15
- export const Basic: Story = {
16
- args: {
17
- items: [],
18
- },
19
- };
@@ -1,14 +0,0 @@
1
- # Analysis: restriction-menu-container
2
-
3
- - Component: packages/components/src/restriction-menu/restriction-menu-container.tsx
4
- - Type: Client component
5
- - Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
6
-
7
- ## Possible re-render causes
8
- - No obvious excessive re-render trigger beyond normal prop/context updates.
9
-
10
- ## Possible bugs/risks
11
- - No critical bug is evident in this quick static pass; keep tests for error and loading paths.
12
-
13
- ## Recommended improvements
14
- - Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
@@ -1,14 +0,0 @@
1
- # Analysis: restriction-menu-item
2
-
3
- - Component: packages/components/src/restriction-menu/restriction-menu-item.tsx
4
- - Type: Client component
5
- - Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
6
-
7
- ## Possible re-render causes
8
- - No obvious excessive re-render trigger beyond normal prop/context updates.
9
-
10
- ## Possible bugs/risks
11
- - No critical bug is evident in this quick static pass; keep tests for error and loading paths.
12
-
13
- ## Recommended improvements
14
- - Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
@@ -1,17 +0,0 @@
1
- # Analysis: restriction-menu
2
-
3
- - Component: packages/components/src/restriction-menu/restriction-menu.tsx
4
- - Type: Client component
5
- - Detected signals: useQueryStates=yes, stores=yes, window/document=no, effects=yes, fetch/call=no
6
-
7
- ## Possible re-render causes
8
- - useQueryStates triggers re-renders whenever relevant query-string values change.
9
- - Store subscriptions can re-render this component whenever the selected slice changes.
10
- - Effects that update state can add extra renders on mount and dependency changes.
11
-
12
- ## Possible bugs/risks
13
- - Breakpoint-driven sorting/partitioning can trigger chained updates (visibleCount, visibleItems, hiddenItems).
14
-
15
- ## Recommended improvements
16
- - Derive visibleItems/hiddenItems via useMemo from sortedItems + visibleCount to reduce duplicated state.
17
-
@@ -1,14 +0,0 @@
1
- # Analysis: cards
2
-
3
- - Component: packages/components/src/results/cards.tsx
4
- - Type: Client component
5
- - Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
6
-
7
- ## Possible re-render causes
8
- - No obvious excessive re-render trigger beyond normal prop/context updates.
9
-
10
- ## Possible bugs/risks
11
- - No critical bug is evident in this quick static pass; keep tests for error and loading paths.
12
-
13
- ## Recommended improvements
14
- - Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
@@ -1,17 +0,0 @@
1
- # Analysis: dialog-filter
2
-
3
- - Component: packages/components/src/results/dialog-filter.tsx
4
- - Type: Client component
5
- - Detected signals: useQueryStates=yes, stores=yes, window/document=no, effects=no, fetch/call=no
6
-
7
- ## Possible re-render causes
8
- - useQueryStates triggers re-renders whenever relevant query-string values change.
9
- - Store subscriptions can re-render this component whenever the selected slice changes.
10
- - Form changes and URL/store synchronization can re-render the dialog multiple times in dev mode.
11
-
12
- ## Possible bugs/risks
13
- - No critical bug is evident in this quick static pass; keep tests for error and loading paths.
14
-
15
- ## Recommended improvements
16
- - If needed, memoize trigger in parent and consider React.memo when props are stable.
17
-
@@ -1,14 +0,0 @@
1
- # Analysis: empty
2
-
3
- - Component: packages/components/src/results/empty.tsx
4
- - Type: Server component
5
- - Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
6
-
7
- ## Possible re-render causes
8
- - No obvious excessive re-render trigger beyond normal prop/context updates.
9
-
10
- ## Possible bugs/risks
11
- - No critical bug is evident in this quick static pass; keep tests for error and loading paths.
12
-
13
- ## Recommended improvements
14
- - Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
@@ -1,16 +0,0 @@
1
- # Analysis: filter-navbar
2
-
3
- - Component: packages/components/src/results/filter-navbar.tsx
4
- - Type: Client component
5
- - Detected signals: useQueryStates=yes, stores=yes, window/document=no, effects=no, fetch/call=no
6
-
7
- ## Possible re-render causes
8
- - useQueryStates triggers re-renders whenever relevant query-string values change.
9
- - Store subscriptions can re-render this component whenever the selected slice changes.
10
-
11
- ## Possible bugs/risks
12
- - Query defaults based on getState() may diverge between SSR and CSR when cookie/store state changes between renders.
13
-
14
- ## Recommended improvements
15
- - Centralize defaults from server-provided props or a stable context to reduce mismatch risk.
16
-
@@ -1,14 +0,0 @@
1
- # Analysis: pagination
2
-
3
- - Component: packages/components/src/results/pagination.tsx
4
- - Type: Client component
5
- - Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
6
-
7
- ## Possible re-render causes
8
- - No obvious excessive re-render trigger beyond normal prop/context updates.
9
-
10
- ## Possible bugs/risks
11
- - No critical bug is evident in this quick static pass; keep tests for error and loading paths.
12
-
13
- ## Recommended improvements
14
- - Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
@@ -1,15 +0,0 @@
1
- # Analysis: table-with-images
2
-
3
- - Component: packages/components/src/results/table-with-images.tsx
4
- - Type: Server component
5
- - Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
6
-
7
- ## Possible re-render causes
8
- - No obvious excessive re-render trigger beyond normal prop/context updates.
9
-
10
- ## Possible bugs/risks
11
- - The component renders list-heavy UI; key stability and memoization strongly affect perceived performance.
12
-
13
- ## Recommended improvements
14
- - Review key strategy and extract memoized subcomponents for large-list rendering.
15
-
@@ -1,15 +0,0 @@
1
- # Analysis: table
2
-
3
- - Component: packages/components/src/results/table.tsx
4
- - Type: Server component
5
- - Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
6
-
7
- ## Possible re-render causes
8
- - No obvious excessive re-render trigger beyond normal prop/context updates.
9
-
10
- ## Possible bugs/risks
11
- - The component renders list-heavy UI; key stability and memoization strongly affect perceived performance.
12
-
13
- ## Recommended improvements
14
- - Review key strategy and extract memoized subcomponents for large-list rendering.
15
-
@@ -1,14 +0,0 @@
1
- # Analysis: index
2
-
3
- - Component: packages/components/src/results/filter-sidebar/index.tsx
4
- - Type: Client component
5
- - Detected signals: useQueryStates=yes, stores=no, window/document=no, effects=no, fetch/call=no
6
-
7
- ## Possible re-render causes
8
- - useQueryStates triggers re-renders whenever relevant query-string values change.
9
-
10
- ## Possible bugs/risks
11
- - No critical bug is evident in this quick static pass; keep tests for error and loading paths.
12
-
13
- ## Recommended improvements
14
- - Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
@@ -1,15 +0,0 @@
1
- # Analysis: table-result-list
2
-
3
- - Component: packages/components/src/results/generic/table-result-list.tsx
4
- - Type: Server component
5
- - Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
6
-
7
- ## Possible re-render causes
8
- - No obvious excessive re-render trigger beyond normal prop/context updates.
9
-
10
- ## Possible bugs/risks
11
- - The component renders list-heavy UI; key stability and memoization strongly affect perceived performance.
12
-
13
- ## Recommended improvements
14
- - Review key strategy and extract memoized subcomponents for large-list rendering.
15
-
@@ -1,21 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { GenericTableResultList } from './table-result-list';
3
-
4
- const meta: Meta<typeof GenericTableResultList> = {
5
- title: 'Components/Results/GenericTableResultList',
6
- component: GenericTableResultList,
7
- parameters: {
8
- layout: 'centered',
9
- },
10
- tags: ['autodocs'],
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof GenericTableResultList>;
14
-
15
- export const Basic: Story = {
16
- args: {
17
- items: [],
18
- linkPattern: '/docs/[id]',
19
- addPackageId: false,
20
- },
21
- };
@@ -1,66 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import BlogView from '../cards';
3
-
4
- const meta: Meta<typeof BlogView> = {
5
- title: 'Components/ResultView/Blog',
6
- component: BlogView,
7
- parameters: {
8
- layout: 'centered',
9
- },
10
- tags: ['autodocs'],
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof BlogView>;
14
-
15
- const items = [
16
- {
17
- id: '1',
18
- shortId: 'doc-1',
19
- labels: [
20
- { value: 'Getting Started with C-Rex', language: 'en-US' },
21
- { value: 'Começando com C-Rex', language: 'pt-BR' }
22
- ],
23
- languages: ['pt-BR'],
24
- type: 'document',
25
- renditions: [],
26
- directoryNodes: [],
27
- disabled: false,
28
- },
29
- {
30
- id: '2',
31
- shortId: 'doc-2',
32
- labels: [
33
- { value: 'Advanced Configuration Guide', language: 'en-US' }
34
- ],
35
- languages: ['en-US'],
36
- type: 'document',
37
- renditions: [],
38
- directoryNodes: [],
39
- disabled: false,
40
- },
41
- {
42
- id: '3',
43
- shortId: 'doc-3',
44
- labels: [
45
- { value: 'API Documentation', language: 'en-US' },
46
- { value: 'Documentation API', language: 'fr-FR' }
47
- ],
48
- languages: ['fr-FR'],
49
- type: 'document',
50
- renditions: [],
51
- directoryNodes: [],
52
- disabled: true,
53
- }
54
- ];
55
-
56
- export const Basic: Story = {
57
- args: {
58
- items,
59
- },
60
- };
61
-
62
- export const WithDisabled: Story = {
63
- args: {
64
- items: items.map((item, i) => ({ ...item, disabled: i === 2 })),
65
- },
66
- };
@@ -1,20 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { DialogFilter } from '../dialog-filter';
3
- import { Button } from '@c-rex/ui/button';
4
-
5
- const meta: Meta<typeof DialogFilter> = {
6
- title: 'Components/Results/DialogFilter',
7
- component: DialogFilter,
8
- parameters: {
9
- layout: 'centered',
10
- },
11
- tags: ['autodocs'],
12
- };
13
- export default meta;
14
- type Story = StoryObj<typeof DialogFilter>;
15
-
16
- export const Basic: Story = {
17
- args: {
18
- trigger: <Button>Open Filter</Button>,
19
- },
20
- };
@@ -1,25 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { Empty } from '../empty';
3
-
4
- const meta = {
5
- title: 'Components/Empty',
6
- component: Empty,
7
- tags: ['autodocs'],
8
- } satisfies Meta<typeof Empty>;
9
-
10
- export default meta;
11
- type Story = StoryObj<typeof meta>;
12
-
13
-
14
- export const Basic: Story = {};
15
-
16
- export const CustomMessage: Story = {
17
- render: () => (
18
- <div style={{ maxWidth: 400 }}>
19
- <Empty />
20
- <div style={{ marginTop: 16, color: '#888' }}>
21
- Nenhum resultado encontrado para sua busca personalizada.
22
- </div>
23
- </div>
24
- ),
25
- };
@@ -1,19 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { FilterNavbar } from '../filter-navbar';
3
-
4
- const meta: Meta<typeof FilterNavbar> = {
5
- title: 'Components/Results/FilterNavbar',
6
- component: FilterNavbar,
7
- parameters: {
8
- layout: 'centered',
9
- },
10
- tags: ['autodocs'],
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof FilterNavbar>;
14
-
15
- export const Basic: Story = {
16
- args: {
17
- tags: {},
18
- },
19
- };
@@ -1,20 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { FilterSidebar } from './index';
3
-
4
- const meta: Meta<typeof FilterSidebar> = {
5
- title: 'Components/Results/FilterSidebar',
6
- component: FilterSidebar,
7
- parameters: {
8
- layout: 'centered',
9
- },
10
- tags: ['autodocs'],
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof FilterSidebar>;
14
-
15
- export const Basic: Story = {
16
- args: {
17
- tags: {},
18
- totalItemCount: 0,
19
- },
20
- };
@@ -1,24 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { Pagination } from '../pagination';
3
-
4
- const meta: Meta<typeof Pagination> = {
5
- title: 'Components/Results/Pagination',
6
- component: Pagination,
7
- parameters: {
8
- layout: 'centered',
9
- },
10
- tags: ['autodocs'],
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof Pagination>;
14
-
15
- export const Basic: Story = {
16
- args: {
17
- pageInfo: {
18
- pageNumber: 1,
19
- pageSize: 10,
20
- totalPages: 5,
21
- totalItems: 50,
22
- },
23
- },
24
- };
@@ -1,19 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { TableWithImage } from '../table-with-images';
3
-
4
- const meta: Meta<typeof TableWithImage> = {
5
- title: 'Components/Results/TableWithImage',
6
- component: TableWithImage,
7
- parameters: {
8
- layout: 'centered',
9
- },
10
- tags: ['autodocs'],
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof TableWithImage>;
14
-
15
- export const Basic: Story = {
16
- args: {
17
- items: [],
18
- },
19
- };
@@ -1,78 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import TableView from '../table';
3
-
4
- const meta: Meta<typeof TableView> = {
5
- title: 'Components/ResultView/Table',
6
- component: TableView,
7
- parameters: {
8
- layout: 'centered',
9
- },
10
- tags: ['autodocs'],
11
- };
12
-
13
- export default meta;
14
- type Story = StoryObj<typeof TableView>;
15
-
16
- const items = [
17
- {
18
- id: '1',
19
- labels: [
20
- { value: 'Installation Guide', language: 'en-US' },
21
- { value: "Guide d'installation", language: 'fr-FR' }
22
- ],
23
- languages: ['fr-FR'],
24
- type: 'document',
25
- renditions: [],
26
- directoryNodes: [],
27
- disabled: false,
28
- link: '/docs/1',
29
- language: 'fr-FR',
30
- files: {
31
- 'application/pdf': {
32
- view: '/docs/1/view',
33
- download: '/docs/1/download',
34
- },
35
- },
36
- },
37
- {
38
- id: '2',
39
- labels: [
40
- { value: 'User Manual', language: 'en-US' },
41
- { value: 'Manual del Usuario', language: 'es-ES' }
42
- ],
43
- languages: ['es-ES'],
44
- type: 'document',
45
- renditions: [],
46
- directoryNodes: [],
47
- disabled: false,
48
- link: '/docs/2',
49
- language: 'es-ES',
50
- files: {},
51
- },
52
- {
53
- id: '3',
54
- labels: [
55
- { value: 'Technical Specifications', language: 'en-US' }
56
- ],
57
- languages: ['en-US'],
58
- type: 'document',
59
- renditions: [],
60
- directoryNodes: [],
61
- disabled: true,
62
- link: '/docs/3',
63
- language: 'en-US',
64
- files: {},
65
- },
66
- ];
67
-
68
- export const Basic: Story = {
69
- args: {
70
- items,
71
- },
72
- };
73
-
74
- export const WithFilesAndDisabled: Story = {
75
- args: {
76
- items,
77
- },
78
- };
@@ -1,15 +0,0 @@
1
- # Analysis: search-input
2
-
3
- - Component: packages/components/src/search-input.tsx
4
- - Type: Client component
5
- - Detected signals: useQueryStates=no, stores=no, window/document=no, effects=yes, fetch/call=no
6
-
7
- ## Possible re-render causes
8
- - Effects that update state can add extra renders on mount and dependency changes.
9
-
10
- ## Possible bugs/risks
11
- - Dynamic autocomplete component selection based on pathname/local state can add redundant mount renders.
12
-
13
- ## Recommended improvements
14
- - Avoid derived state when possible; compute autocomplete type with useMemo.
15
-
@@ -1,19 +0,0 @@
1
- # Analysis: share-button
2
-
3
- - Component: packages/components/src/share-button.tsx
4
- - Type: Client component
5
- - Detected signals: useQueryStates=no, stores=no, window/document=yes, effects=yes, fetch/call=no
6
-
7
- ## Possible re-render causes
8
- - Effects that update state can add extra renders on mount and dependency changes.
9
-
10
- ## Possible bugs/risks
11
- - Access to window/document needs care to avoid hydration mismatch and non-browser runtime issues.
12
- - Console logs in production can add noise and leak internal details.
13
- - Timeout used to reset copied state is not cleaned up on unmount.
14
-
15
- ## Recommended improvements
16
- - Keep browser-only access inside event handlers or useEffect, not in initial render paths.
17
- - Remove debug logs or gate them by environment flag.
18
- - Store timer in ref and clear it in effect cleanup.
19
-
@@ -1,20 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { AutoComplete } from '../autocomplete';
3
-
4
- const meta: Meta<typeof AutoComplete> = {
5
- title: 'Components/AutoComplete',
6
- component: AutoComplete,
7
- parameters: {
8
- layout: 'centered',
9
- },
10
- tags: ['autodocs'],
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof AutoComplete>;
14
-
15
- export const Basic: Story = {
16
- args: {
17
- endpoint: '/api/suggestions',
18
- onSelectPath: '/',
19
- },
20
- };