@ama-pt/agora-design-system 3.7.0 → 4.0.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 (105) hide show
  1. package/README.md +33 -76
  2. package/artifacts/dist/index.css +1 -0
  3. package/artifacts/dist/index.mjs +6673 -6956
  4. package/artifacts/dist/index.mjs.map +1 -1
  5. package/artifacts/dist/index.umd.js +1 -5
  6. package/artifacts/dist/index.umd.js.map +1 -1
  7. package/artifacts/dist/{solid-hand-heart-XS9tzo8e.mjs → solid-hand-heart-CmuM78yB.mjs} +4 -4
  8. package/artifacts/dist/{solid-hand-heart-XS9tzo8e.mjs.map → solid-hand-heart-CmuM78yB.mjs.map} +1 -1
  9. package/artifacts/dist/types/components/button/button.d.ts +1 -1
  10. package/artifacts/dist/types/components/cards/card-general/card-general.d.ts +23 -2
  11. package/artifacts/dist/types/components/cards/card-general/variants.d.ts +3 -0
  12. package/artifacts/dist/types/components/cards/card-general-v2/body-section/body-section-container.d.ts +7 -0
  13. package/artifacts/dist/types/components/cards/card-general-v2/card-general.d.ts +28 -0
  14. package/artifacts/dist/types/components/cards/card-general-v2/footer-section/footer-section-container.d.ts +7 -0
  15. package/artifacts/dist/types/components/cards/card-general-v2/header-section/header-section-container.d.ts +7 -0
  16. package/artifacts/dist/types/components/cards/card-general-v2/helpers.d.ts +32 -0
  17. package/artifacts/dist/types/components/cards/card-general-v2/image-section/image-section-container.d.ts +10 -0
  18. package/artifacts/dist/types/components/cards/card-general-v2/index.d.ts +31 -0
  19. package/artifacts/dist/types/components/cards/card-general-v2/shared/card-anchor/card-anchor.d.ts +6 -0
  20. package/artifacts/dist/types/components/cards/card-general-v2/shared/card-category/card-category.d.ts +6 -0
  21. package/artifacts/dist/types/components/cards/card-general-v2/shared/card-description/card-description.d.ts +6 -0
  22. package/artifacts/dist/types/components/cards/card-general-v2/shared/card-icon/card-icon.d.ts +8 -0
  23. package/artifacts/dist/types/components/cards/card-general-v2/shared/card-logo/card-logo.d.ts +8 -0
  24. package/artifacts/dist/types/components/cards/card-general-v2/shared/card-pills/card-pills.d.ts +14 -0
  25. package/artifacts/dist/types/components/cards/card-general-v2/shared/card-status/card-status.d.ts +14 -0
  26. package/artifacts/dist/types/components/cards/card-general-v2/shared/card-subtitle/card-subtitle.d.ts +6 -0
  27. package/artifacts/dist/types/components/cards/card-general-v2/shared/card-title/card-title.d.ts +10 -0
  28. package/artifacts/dist/types/components/cards/card-general-v2/shared/card-topics/card-topics.d.ts +9 -0
  29. package/artifacts/dist/types/components/cards/card-general-v2/variants.d.ts +20 -0
  30. package/artifacts/dist/types/components/cards/index.d.ts +2 -6
  31. package/artifacts/dist/types/components/header/general-bar/ecosystem-panel/ecosystem-panel-anchor.d.ts +5 -0
  32. package/artifacts/dist/types/components/header/general-bar/ecosystem-panel/ecosystem-panel-go-back.d.ts +5 -0
  33. package/artifacts/dist/types/components/header/general-bar/ecosystem-panel/ecosystem-panel-section-title.d.ts +5 -0
  34. package/artifacts/dist/types/components/header/general-bar/ecosystem-panel/ecosystem-panel-short-description.d.ts +5 -0
  35. package/artifacts/dist/types/components/header/general-bar/ecosystem-panel/ecosystem-panel-title.d.ts +5 -0
  36. package/artifacts/dist/types/components/header/general-bar/ecosystem-panel/ecosystem-panel.d.ts +5 -0
  37. package/artifacts/dist/types/components/header/header.d.ts +2 -2
  38. package/artifacts/dist/types/components/header/index.d.ts +40 -12
  39. package/artifacts/dist/types/components/header/internals/context/data-context/header-data-context.d.ts +7 -5
  40. package/artifacts/dist/types/components/header/internals/context/data-context/utils/areas-utils.d.ts +4 -3
  41. package/artifacts/dist/types/components/header/internals/context/data-context/utils/ecosystem-panel-utils.d.ts +15 -0
  42. package/artifacts/dist/types/components/header/internals/context/data-context/utils/navigation-bar-utils.d.ts +10 -0
  43. package/artifacts/dist/types/components/header/internals/context/data-context/utils/navigation-utils.d.ts +2 -2
  44. package/artifacts/dist/types/components/header/internals/context/external-context/header-external-controller.d.ts +2 -1
  45. package/artifacts/dist/types/components/header/internals/context/menu-context/header-menu-context.d.ts +2 -1
  46. package/artifacts/dist/types/components/header/internals/context/menu-context/menu-type.enum.d.ts +2 -1
  47. package/artifacts/dist/types/components/header/internals/general-bar/ecosystem-panel/internal-ecosystem-panel-anchor.d.ts +6 -0
  48. package/artifacts/dist/types/components/header/internals/general-bar/ecosystem-panel/internal-ecosystem-panel-go-back.d.ts +6 -0
  49. package/artifacts/dist/types/components/header/internals/general-bar/ecosystem-panel/internal-ecosystem-panel-section-title.d.ts +6 -0
  50. package/artifacts/dist/types/components/header/internals/general-bar/ecosystem-panel/internal-ecosystem-panel-short-description.d.ts +6 -0
  51. package/artifacts/dist/types/components/header/internals/general-bar/ecosystem-panel/internal-ecosystem-panel-title.d.ts +6 -0
  52. package/artifacts/dist/types/components/header/internals/general-bar/ecosystem-panel/internal-ecosystem-panel.d.ts +8 -0
  53. package/artifacts/dist/types/components/header/internals/navigation-bar/helper.d.ts +9 -0
  54. package/artifacts/dist/types/components/header/internals/navigation-bar/navigation-area/internal-navigation-area.d.ts +11 -0
  55. package/artifacts/dist/types/components/header/internals/navigation-bar/navigation-link/internal-navigation-link.d.ts +8 -0
  56. package/artifacts/dist/types/components/header/internals/navigation-bar/navigation-modal/internal-modal-content.d.ts +1 -1
  57. package/artifacts/dist/types/components/header/internals/navigation-bar/navigation-root/internal-navigation-root.d.ts +20 -0
  58. package/artifacts/dist/types/components/header/navigation-bar/navigation-area.d.ts +5 -0
  59. package/artifacts/dist/types/components/header/navigation-bar/navigation-bar.d.ts +3 -1
  60. package/artifacts/dist/types/components/header/navigation-bar/navigation-link.d.ts +2 -27
  61. package/artifacts/dist/types/components/header/navigation-bar/navigation-section.d.ts +5 -0
  62. package/artifacts/dist/types/components/input-search/input-search.d.ts +15 -1
  63. package/artifacts/dist/types/components/pill/pill.d.ts +2 -2
  64. package/artifacts/dist/types/components/progress-bar/index.d.ts +1 -1
  65. package/artifacts/dist/types/components/progress-bar/progress-bar.d.ts +37 -1
  66. package/artifacts/dist/types/components/progress-bar-group/progress-bar-group.d.ts +6 -1
  67. package/artifacts/dist/types/components/quiz/quiz-item-summary/quiz-item-summary.d.ts +0 -5
  68. package/artifacts/dist/types/components/timelines/timeline-horizontal/timeline-horizontal.d.ts +4 -0
  69. package/artifacts/dist/types/components/timelines/timeline-vertical/timeline-vertical.d.ts +4 -0
  70. package/artifacts/dist/types/components/toggle/toggle.d.ts +13 -1
  71. package/artifacts/dist/types/components/tooltip/tooltip.d.ts +8 -0
  72. package/artifacts/dist/types/configs/tailwind-config.d.ts +4 -385
  73. package/artifacts/dist/types/hooks/use-breakpoints-to-number.d.ts +3 -3
  74. package/artifacts/dist/types/index.d.ts +11 -1
  75. package/package.json +19 -8
  76. package/src/styles/theme.css +418 -0
  77. package/artifacts/dist/style.css +0 -1
  78. package/artifacts/dist/tailwind.css +0 -43719
  79. package/artifacts/dist/types/components/cards/card-article/card-article.d.ts +0 -49
  80. package/artifacts/dist/types/components/cards/card-article/index.d.ts +0 -2
  81. package/artifacts/dist/types/components/cards/card-collection/card-collection.d.ts +0 -27
  82. package/artifacts/dist/types/components/cards/card-collection/index.d.ts +0 -2
  83. package/artifacts/dist/types/components/cards/card-emphasize/card-emphasize.d.ts +0 -31
  84. package/artifacts/dist/types/components/cards/card-emphasize/index.d.ts +0 -2
  85. package/artifacts/dist/types/components/cards/card-highlight-single/card-highlight-single.d.ts +0 -23
  86. package/artifacts/dist/types/components/cards/card-highlight-single/index.d.ts +0 -2
  87. package/artifacts/dist/types/components/cards/card-single/card-single.d.ts +0 -40
  88. package/artifacts/dist/types/components/cards/card-single/index.d.ts +0 -2
  89. package/artifacts/dist/types/components/cards/card-topic/card-topic.d.ts +0 -56
  90. package/artifacts/dist/types/components/cards/card-topic/index.d.ts +0 -2
  91. package/artifacts/dist/types/components/header/general-bar/direct-link/direct-link-anchor.d.ts +0 -5
  92. package/artifacts/dist/types/components/header/general-bar/direct-link/direct-link-go-back.d.ts +0 -5
  93. package/artifacts/dist/types/components/header/general-bar/direct-link/direct-link-section-title.d.ts +0 -5
  94. package/artifacts/dist/types/components/header/general-bar/direct-link/direct-link-short-description.d.ts +0 -5
  95. package/artifacts/dist/types/components/header/general-bar/direct-link/direct-link-title.d.ts +0 -5
  96. package/artifacts/dist/types/components/header/general-bar/direct-link/direct-link.d.ts +0 -5
  97. package/artifacts/dist/types/components/header/internals/context/data-context/utils/direct-link-utils.d.ts +0 -15
  98. package/artifacts/dist/types/components/header/internals/general-bar/areas/internal-area.d.ts +0 -6
  99. package/artifacts/dist/types/components/header/internals/general-bar/areas/internal-areas.d.ts +0 -5
  100. package/artifacts/dist/types/components/header/internals/general-bar/direct-link/internal-direct-link-anchor.d.ts +0 -6
  101. package/artifacts/dist/types/components/header/internals/general-bar/direct-link/internal-direct-link-go-back.d.ts +0 -6
  102. package/artifacts/dist/types/components/header/internals/general-bar/direct-link/internal-direct-link-section-title.d.ts +0 -6
  103. package/artifacts/dist/types/components/header/internals/general-bar/direct-link/internal-direct-link-short-description.d.ts +0 -6
  104. package/artifacts/dist/types/components/header/internals/general-bar/direct-link/internal-direct-link-title.d.ts +0 -6
  105. package/artifacts/dist/types/components/header/internals/general-bar/direct-link/internal-direct-link.d.ts +0 -8
package/README.md CHANGED
@@ -38,90 +38,47 @@ ADS presents a set of rules and guidelines that must be followed in the design a
38
38
  > npm install @ama-pt/agora-design-system
39
39
  ```
40
40
 
41
- ## Tailwind configuration
41
+ ## Tailwind CSS v4 configuration
42
42
 
43
- In order to reduce bundle size, we needed do strip some classes from the bundle. As result, some of the tailwind classes may not be available out of the box. To have access to all tailwind AgoraDS themed classes you have to do some additional steps.
44
-
45
- - Install and initialize tailwindcss
46
-
47
- ```sh
48
- > npm install -D tailwindcss postcss autoprefixer
49
- > npx tailwindcss init -p
50
- ```
51
-
52
- - Add the @tailwind directives for each of Tailwind’s layers to your main CSS file
43
+ AgoraDS 4 requires Tailwind CSS v4. Configure Tailwind for your framework using the
44
+ [official installation guide](https://tailwindcss.com/docs/installation), then add these imports to your main CSS file in the order shown:
53
45
 
54
46
  ```css
55
- @tailwind base;
56
- @tailwind components;
57
- @tailwind utilities;
58
- ```
47
+ /* AgoraDS design tokens */
48
+ @import '@ama-pt/agora-design-system/theme.css';
59
49
 
60
- - Open tailwind.config.ts, set AgoraDS configs, and set the **content** config with the desired glob to allow tailwind to generate all of the corresponding CSS needed for your project:
50
+ /* Tailwind v4 reset and utilities */
51
+ @import 'tailwindcss/preflight';
52
+ @import 'tailwindcss/utilities';
61
53
 
62
- ```typescript
63
- import { AgoraTailwindConfig } from '@ama-pt/agora-design-system';
64
- import type { Config } from 'tailwindcss';
65
-
66
- const TailwindConfig: Config = {
67
- content: ['src/**/*.{ts,tsx}'],
68
- theme: AgoraTailwindConfig.theme,
69
- plugins: AgoraTailwindConfig.plugins,
70
- safelist: AgoraTailwindConfig.safelist,
71
- corePlugins: {
72
- preflight: false
73
- }
74
- };
75
-
76
- export default TailwindConfig;
54
+ /* AgoraDS compiled component styles */
55
+ @import '@ama-pt/agora-design-system/index.css';
77
56
  ```
78
57
 
79
- - import the css style file that exists in node_modules folder into your layout.tsx file (if working with NextJS) or index.tsx (if working with React only)
58
+ No `tailwind.config` file or `AgoraTailwindConfig` import is required. AgoraDS uses Tailwind v4's CSS-first configuration.
80
59
 
81
- ```typescript
82
- // typescript import
83
- import '@ama-pt/agora-design-system/artifacts/dist/index.css';
84
- // or equivalent for javascript imports
85
- ```
60
+ ## Overriding the AgoraDS theme
86
61
 
87
- - Run and test the app...
88
-
89
- ## Overriding Tailwind configuration
90
-
91
- To override any tailwind config you need to update the tailwind.config.ts file as explained in the following example:
92
-
93
- ```typescript
94
- import { AgoraTailwindConfig } from '@ama-pt/agora-design-system';
95
- import type { Config } from 'tailwindcss';
96
-
97
- const TailwindConfig: Config = {
98
- content: ['src/**/*.tsx'],
99
- theme: {
100
- ...AgoraTailwindConfig.theme,
101
- colors: {
102
- ...AgoraTailwindConfig.theme.colors,
103
- primary: {
104
- 50: '#FFF000',
105
- 100: '#FFF000',
106
- 200: '#FFF000',
107
- 300: '#FFF000',
108
- 400: '#FFF000',
109
- 500: '#FFF000',
110
- 600: '#FFF000',
111
- 700: '#FFF000',
112
- 800: '#FFF000',
113
- 900: '#FFF000'
114
- }
115
- }
116
- },
117
- plugins: AgoraTailwindConfig.plugins,
118
- safelist: AgoraTailwindConfig.safelist,
119
- corePlugins: { preflight: false }
120
- };
121
-
122
- export default TailwindConfig;
123
- ```
62
+ Override design tokens with an `@theme` block after the imports. For example, the following changes the primary color palette:
124
63
 
125
- With this example we are transforming all primary color shades into yellow.
64
+ ```css
65
+ @import '@ama-pt/agora-design-system/theme.css';
66
+ @import 'tailwindcss/preflight';
67
+ @import 'tailwindcss/utilities';
68
+ @import '@ama-pt/agora-design-system/index.css';
69
+
70
+ @theme {
71
+ --color-primary-50: #fff000;
72
+ --color-primary-100: #fff000;
73
+ --color-primary-200: #fff000;
74
+ --color-primary-300: #fff000;
75
+ --color-primary-400: #fff000;
76
+ --color-primary-500: #fff000;
77
+ --color-primary-600: #fff000;
78
+ --color-primary-700: #fff000;
79
+ --color-primary-800: #fff000;
80
+ --color-primary-900: #fff000;
81
+ }
82
+ ```
126
83
 
127
- **corePlugins** - is used to disable de tailwind resets already done by the AgoraDS library.
84
+ See the Storybook Installation Guide, Tailwind Theme Configuration, and Migration Guide for the complete setup and all v3-to-v4 breaking changes.