@c-rex/components 0.1.37 → 0.1.38

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 (91) hide show
  1. package/package.json +1 -18
  2. package/src/carousel/carousel.tsx +6 -5
  3. package/src/check-article-lang.tsx +8 -4
  4. package/src/favorites/bookmark-button.tsx +26 -11
  5. package/src/favorites/favorite-button.tsx +67 -21
  6. package/src/info/info-table.tsx +60 -38
  7. package/src/info/set-available-versions.tsx +19 -0
  8. package/src/navbar/language-switcher/content-language-switch.tsx +36 -36
  9. package/src/navbar/language-switcher/ui-language-switch.tsx +5 -6
  10. package/src/navbar/navbar.tsx +6 -2
  11. package/src/restriction-menu/restriction-menu.tsx +2 -3
  12. package/src/results/generic/table-result-list.tsx +1 -1
  13. package/src/results/utils.ts +9 -2
  14. package/src/stores/favorites-store.ts +21 -21
  15. package/src/stores/language-store.ts +2 -31
  16. package/src/article/article-action-bar.analysis.md +0 -15
  17. package/src/article/article-action-bar.stories.tsx +0 -15
  18. package/src/article/article-content.analysis.md +0 -15
  19. package/src/article/article-content.stories.tsx +0 -21
  20. package/src/autocomplete.analysis.md +0 -17
  21. package/src/breadcrumb.analysis.md +0 -15
  22. package/src/carousel/carousel.analysis.md +0 -17
  23. package/src/check-article-lang.analysis.md +0 -15
  24. package/src/directoryNodes/tree-of-content.analysis.md +0 -14
  25. package/src/directoryNodes/tree-of-content.stories.tsx +0 -22
  26. package/src/documents/result-list.analysis.md +0 -14
  27. package/src/documents/result-list.stories.tsx +0 -19
  28. package/src/favorites/bookmark-button.analysis.md +0 -17
  29. package/src/favorites/bookmark-button.stories.tsx +0 -19
  30. package/src/favorites/favorite-button.analysis.md +0 -18
  31. package/src/favorites/favorite-button.stories.tsx +0 -22
  32. package/src/icons/file-icon.analysis.md +0 -14
  33. package/src/icons/file-icon.stories.tsx +0 -19
  34. package/src/icons/flag-icon.analysis.md +0 -14
  35. package/src/icons/flag-icon.stories.tsx +0 -25
  36. package/src/icons/loading.analysis.md +0 -14
  37. package/src/icons/loading.stories.tsx +0 -21
  38. package/src/info/info-table.analysis.md +0 -15
  39. package/src/info/shared.analysis.md +0 -14
  40. package/src/info/stories/info-table.stories.tsx +0 -31
  41. package/src/info/stories/shared.stories.tsx +0 -24
  42. package/src/navbar/language-switcher/content-language-switch.analysis.md +0 -15
  43. package/src/navbar/language-switcher/shared.analysis.md +0 -14
  44. package/src/navbar/language-switcher/ui-language-switch.analysis.md +0 -15
  45. package/src/navbar/navbar.analysis.md +0 -14
  46. package/src/navbar/settings.analysis.md +0 -14
  47. package/src/navbar/sign-in-out-btns.analysis.md +0 -14
  48. package/src/navbar/stories/navbar.stories.tsx +0 -31
  49. package/src/navbar/stories/settings.stories.tsx +0 -15
  50. package/src/navbar/stories/sign-in-out-btns.stories.tsx +0 -15
  51. package/src/navbar/stories/user-menu.stories.tsx +0 -20
  52. package/src/navbar/user-menu.analysis.md +0 -14
  53. package/src/page-wrapper.analysis.md +0 -14
  54. package/src/render-article.analysis.md +0 -15
  55. package/src/renditions/file-download.analysis.md +0 -14
  56. package/src/renditions/file-download.stories.tsx +0 -19
  57. package/src/renditions/html.analysis.md +0 -17
  58. package/src/renditions/html.stories.tsx +0 -19
  59. package/src/renditions/image/container.analysis.md +0 -15
  60. package/src/renditions/image/container.stories.tsx +0 -19
  61. package/src/renditions/image/rendition.analysis.md +0 -14
  62. package/src/renditions/image/rendition.stories.tsx +0 -19
  63. package/src/restriction-menu/restriction-menu-container.analysis.md +0 -14
  64. package/src/restriction-menu/restriction-menu-item.analysis.md +0 -14
  65. package/src/restriction-menu/restriction-menu.analysis.md +0 -17
  66. package/src/results/analysis/cards.analysis.md +0 -14
  67. package/src/results/analysis/dialog-filter.analysis.md +0 -17
  68. package/src/results/analysis/empty.analysis.md +0 -14
  69. package/src/results/analysis/filter-navbar.analysis.md +0 -16
  70. package/src/results/analysis/pagination.analysis.md +0 -14
  71. package/src/results/analysis/table-with-images.analysis.md +0 -15
  72. package/src/results/analysis/table.analysis.md +0 -15
  73. package/src/results/filter-sidebar/index.analysis.md +0 -14
  74. package/src/results/generic/table-result-list.analysis.md +0 -15
  75. package/src/results/generic/table-result-list.stories.tsx +0 -21
  76. package/src/results/stories/cards.stories.tsx +0 -66
  77. package/src/results/stories/dialog-filter.stories.tsx +0 -20
  78. package/src/results/stories/empty.stories.tsx +0 -25
  79. package/src/results/stories/filter-navbar.stories.tsx +0 -19
  80. package/src/results/stories/filter-sidebar.stories.tsx +0 -20
  81. package/src/results/stories/pagination.stories.tsx +0 -24
  82. package/src/results/stories/table-with-images.stories.tsx +0 -19
  83. package/src/results/stories/table.stories.tsx +0 -78
  84. package/src/search-input.analysis.md +0 -15
  85. package/src/share-button.analysis.md +0 -19
  86. package/src/stories/autocomplete.stories.tsx +0 -20
  87. package/src/stories/breadcrumb.stories.tsx +0 -93
  88. package/src/stories/check-article-lang.stories.tsx +0 -22
  89. package/src/stories/render-article.stories.tsx +0 -19
  90. package/src/stories/search-input.stories.tsx +0 -21
  91. package/src/stories/share-button.stories.tsx +0 -15
@@ -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
- };
@@ -1,93 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { Breadcrumb } from '../breadcrumb';
3
-
4
- const meta: Meta<typeof Breadcrumb> = {
5
- title: 'Components/Breadcrumb',
6
- component: Breadcrumb,
7
- parameters: {
8
- layout: 'centered',
9
- },
10
- tags: ['autodocs'],
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof Breadcrumb>;
14
-
15
- const tree = [
16
- {
17
- id: 'home',
18
- label: 'Home',
19
- linkId: 'home',
20
- active: false,
21
- children: [
22
- {
23
- id: 'docs',
24
- label: 'Docs',
25
- linkId: 'docs',
26
- active: false,
27
- children: [
28
- {
29
- id: 'breadcrumb',
30
- label: 'Breadcrumb',
31
- linkId: 'breadcrumb',
32
- active: true,
33
- children: [],
34
- },
35
- ],
36
- },
37
- ],
38
- },
39
- ];
40
-
41
- export const Basic: Story = {
42
- args: {
43
- tree,
44
- lang: 'en',
45
- },
46
- };
47
-
48
- export const WithLongTree: Story = {
49
- args: {
50
- tree: [
51
- {
52
- id: 'home',
53
- label: 'Home',
54
- linkId: 'home',
55
- active: false,
56
- children: [
57
- {
58
- id: 'section',
59
- label: 'Section',
60
- linkId: 'section',
61
- active: false,
62
- children: [
63
- {
64
- id: 'docs',
65
- label: 'Docs',
66
- linkId: 'docs',
67
- active: false,
68
- children: [
69
- {
70
- id: 'components',
71
- label: 'Components',
72
- linkId: 'components',
73
- active: false,
74
- children: [
75
- {
76
- id: 'breadcrumb',
77
- label: 'Breadcrumb',
78
- linkId: 'breadcrumb',
79
- active: true,
80
- children: [],
81
- },
82
- ],
83
- },
84
- ],
85
- },
86
- ],
87
- },
88
- ],
89
- },
90
- ],
91
- lang: 'en',
92
- },
93
- };
@@ -1,22 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { CheckArticleLangToast } from '../check-article-lang';
3
-
4
- const meta: Meta<typeof CheckArticleLangToast> = {
5
- title: 'Components/CheckArticleLangToast',
6
- component: CheckArticleLangToast,
7
- parameters: {
8
- layout: 'centered',
9
- },
10
- tags: ['autodocs'],
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof CheckArticleLangToast>;
14
-
15
- export const Basic: Story = {
16
- args: {
17
- availableVersions: [
18
- { shortId: '1', active: true, lang: 'en', country: 'US', link: '/en' },
19
- { shortId: '2', active: false, lang: 'pt', country: 'BR', link: '/pt' },
20
- ],
21
- },
22
- };
@@ -1,19 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { RenderArticle } from '../render-article';
3
-
4
- const meta: Meta<typeof RenderArticle> = {
5
- title: 'Components/RenderArticle',
6
- component: RenderArticle,
7
- parameters: {
8
- layout: 'centered',
9
- },
10
- tags: ['autodocs'],
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof RenderArticle>;
14
-
15
- export const Basic: Story = {
16
- args: {
17
- htmlContent: '<h1>Hello World</h1><p>This is a test article.</p>',
18
- },
19
- };
@@ -1,21 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { SearchInput } from '../search-input';
3
-
4
- const meta: Meta<typeof SearchInput> = {
5
- title: 'Components/SearchInput',
6
- component: SearchInput,
7
- parameters: {
8
- layout: 'centered',
9
- },
10
- tags: ['autodocs'],
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof SearchInput>;
14
-
15
- export const Basic: Story = {
16
- args: {
17
- showPkgFilter: false,
18
- autocompleteType: 'default', // ajuste conforme opções reais
19
- onSelectPath: '/',
20
- },
21
- };
@@ -1,15 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { ShareButton } from '../share-button';
3
-
4
- const meta: Meta<typeof ShareButton> = {
5
- title: 'Components/ShareButton',
6
- component: ShareButton,
7
- parameters: {
8
- layout: 'centered',
9
- },
10
- tags: ['autodocs'],
11
- };
12
- export default meta;
13
- type Story = StoryObj<typeof ShareButton>;
14
-
15
- export const Basic: Story = {};