ies2-aulapp-ui-kit 0.1.13 → 0.2.0

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 (31) hide show
  1. package/dist/App.d.ts +5 -0
  2. package/dist/components/sections/BadgesPanel.d.ts +9 -1
  3. package/dist/components/sections/CallToActionPanel.d.ts +9 -1
  4. package/dist/components/sections/ComponentsPanel.d.ts +9 -1
  5. package/dist/components/sections/HeroBanner.d.ts +9 -1
  6. package/dist/index.cjs.js +24 -24
  7. package/dist/index.d.ts +6 -0
  8. package/dist/index.es.js +5867 -3732
  9. package/dist/lib/i18n/components/I18nProvider.d.ts +38 -0
  10. package/dist/lib/i18n/components/LanguageSwitcher.d.ts +6 -0
  11. package/dist/lib/i18n/config.d.ts +2 -0
  12. package/dist/lib/i18n/hooks/useI18n.d.ts +32 -0
  13. package/dist/lib/i18n/index.d.ts +5 -0
  14. package/dist/lib/i18n/locales/en-US/badges-panel.json.d.ts +13 -0
  15. package/dist/lib/i18n/locales/en-US/call-to-action-panel.json.d.ts +12 -0
  16. package/dist/lib/i18n/locales/en-US/common.json.d.ts +7 -0
  17. package/dist/lib/i18n/locales/en-US/components-panel.json.d.ts +19 -0
  18. package/dist/lib/i18n/locales/en-US/hero-banner.json.d.ts +7 -0
  19. package/dist/lib/i18n/locales/es/badges-panel.json.d.ts +13 -0
  20. package/dist/lib/i18n/locales/es/call-to-action-panel.json.d.ts +12 -0
  21. package/dist/lib/i18n/locales/es/common.json.d.ts +7 -0
  22. package/dist/lib/i18n/locales/es/components-panel.json.d.ts +19 -0
  23. package/dist/lib/i18n/locales/es/hero-banner.json.d.ts +7 -0
  24. package/dist/lib/i18n/locales/pt-BR/badges-panel.json.d.ts +13 -0
  25. package/dist/lib/i18n/locales/pt-BR/call-to-action-panel.json.d.ts +12 -0
  26. package/dist/lib/i18n/locales/pt-BR/common.json.d.ts +7 -0
  27. package/dist/lib/i18n/locales/pt-BR/components-panel.json.d.ts +19 -0
  28. package/dist/lib/i18n/locales/pt-BR/hero-banner.json.d.ts +7 -0
  29. package/dist/lib/i18n/types.d.ts +4 -0
  30. package/dist/stories/i18n.stories.d.ts +14 -0
  31. package/package.json +3 -1
@@ -0,0 +1,38 @@
1
+ import { ReactNode } from 'react';
2
+ import { SupportedLocale } from '../types.js';
3
+ export interface I18nProviderProps {
4
+ /**
5
+ * Componentes filhos que terão acesso ao contexto de tradução
6
+ */
7
+ children: ReactNode;
8
+ /**
9
+ * Locale inicial ou controlado externamente.
10
+ * Se fornecido, o i18n será inicializado/atualizado com este idioma.
11
+ */
12
+ locale?: SupportedLocale;
13
+ }
14
+ /**
15
+ * Provider de internacionalização para o UI Kit.
16
+ * Envolva sua aplicação com este provider para habilitar traduções.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * // Uso básico (idioma padrão pt-BR)
21
+ * <I18nProvider>
22
+ * <App />
23
+ * </I18nProvider>
24
+ *
25
+ * // Controlando o idioma externamente
26
+ * function MyApp() {
27
+ * const [locale, setLocale] = useState<SupportedLocale>('en-US')
28
+ *
29
+ * return (
30
+ * <I18nProvider locale={locale}>
31
+ * <App />
32
+ * <button onClick={() => setLocale('pt-BR')}>PT-BR</button>
33
+ * </I18nProvider>
34
+ * )
35
+ * }
36
+ * ```
37
+ */
38
+ export declare function I18nProvider({ children, locale }: I18nProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Componente de exemplo que demonstra como trocar o idioma da aplicação
3
+ * Este componente pode ser usado como referência para implementar
4
+ * seleção de idioma em aplicações que consomem o UI Kit
5
+ */
6
+ export declare function LanguageSwitcher(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { default as i18n } from 'i18next';
2
+ export default i18n;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Hook personalizado para gerenciar internacionalização no UI Kit
3
+ * O i18n do kit é auto-contido e não interfere com o sistema de
4
+ * tradução do projeto consumidor.
5
+ *
6
+ * @param namespace - O namespace de tradução a ser usado
7
+ * (ex: 'heroBanner', 'componentsPanel')
8
+ * @param locale - Locale opcional (string simples, ex: 'pt-BR',
9
+ * 'en-US', 'es'). Se não fornecido, usa o padrão (pt-BR)
10
+ * @returns Objeto contendo a função de tradução e utilidades
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * // Uso simples - idioma padrão
15
+ * function MyComponent() {
16
+ * const { t } = useI18n('heroBanner')
17
+ * return <h1>{t('title')}</h1>
18
+ * }
19
+ *
20
+ * // Com locale específico (vem do projeto pai)
21
+ * function MyComponent({ userLocale }: { userLocale?: string }) {
22
+ * const { t } = useI18n('heroBanner', userLocale)
23
+ * return <h1>{t('title')}</h1>
24
+ * }
25
+ * ```
26
+ */
27
+ export declare function useI18n(namespace?: string, locale?: string): {
28
+ t: import('i18next').TFunction<string, undefined>;
29
+ changeLanguage: (newLocale: string) => Promise<void>;
30
+ currentLanguage: string;
31
+ i18n: import('i18next').i18n;
32
+ };
@@ -0,0 +1,5 @@
1
+ export { default as i18n } from './config.js';
2
+ export * from './types.js';
3
+ export * from './hooks/useI18n.js';
4
+ export * from './components/LanguageSwitcher.js';
5
+ export * from './components/I18nProvider.js';
@@ -0,0 +1,13 @@
1
+ declare const _default: {
2
+ "sectionLabel": "Tags",
3
+ "sectionTitle": "Badges",
4
+ "description": "Quick indicators of content and available resources.",
5
+ "appearances": {
6
+ "solid": "Solid",
7
+ "subtle": "Subtle",
8
+ "outline": "Outline",
9
+ "text": "Text"
10
+ }
11
+ };
12
+
13
+ export default _default;
@@ -0,0 +1,12 @@
1
+ declare const _default: {
2
+ "sectionLabel": "Action",
3
+ "sectionTitle": "Call to Action",
4
+ "description": "Use the kit to accelerate the development of consistent experiences across multiple React apps.",
5
+ "buttons": {
6
+ "explore": "Explore components",
7
+ "documentation": "Documentation",
8
+ "undo": "Undo change"
9
+ }
10
+ };
11
+
12
+ export default _default;
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ "loading": "Loading...",
3
+ "error": "Error",
4
+ "success": "Success"
5
+ };
6
+
7
+ export default _default;
@@ -0,0 +1,19 @@
1
+ declare const _default: {
2
+ "sectionLabel": "Components",
3
+ "sectionTitle": "Buttons",
4
+ "buttons": {
5
+ "primary": "Primary",
6
+ "secondary": "Secondary",
7
+ "neutral": "Neutral",
8
+ "ctaWithRadius": "CTA with 8px radius",
9
+ "outline": "Soft outline",
10
+ "outlineWithRadius": "Soft outline with 8px radius",
11
+ "ghost": "Ghost",
12
+ "createAriaLabel": "Create"
13
+ },
14
+ "switch": {
15
+ "airplaneMode": "Airplane Mode"
16
+ }
17
+ };
18
+
19
+ export default _default;
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ "subtitle": "ies2 aulapp ui kit",
3
+ "title": "Production-ready shareable components",
4
+ "description": "This sandbox reflects the current state of the design system. Evaluate each component before publishing a new npm release."
5
+ };
6
+
7
+ export default _default;
@@ -0,0 +1,13 @@
1
+ declare const _default: {
2
+ "sectionLabel": "Etiquetas",
3
+ "sectionTitle": "Badges",
4
+ "description": "Indicadores rápidos de contenido y recursos disponibles.",
5
+ "appearances": {
6
+ "solid": "Solid",
7
+ "subtle": "Subtle",
8
+ "outline": "Outline",
9
+ "text": "Text"
10
+ }
11
+ };
12
+
13
+ export default _default;
@@ -0,0 +1,12 @@
1
+ declare const _default: {
2
+ "sectionLabel": "Acción",
3
+ "sectionTitle": "Call to Action",
4
+ "description": "Use el kit para acelerar el desarrollo de experiencias consistentes en múltiples apps React.",
5
+ "buttons": {
6
+ "explore": "Explorar componentes",
7
+ "documentation": "Documentación",
8
+ "undo": "Deshacer cambio"
9
+ }
10
+ };
11
+
12
+ export default _default;
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ "loading": "Cargando...",
3
+ "error": "Error",
4
+ "success": "Éxito"
5
+ };
6
+
7
+ export default _default;
@@ -0,0 +1,19 @@
1
+ declare const _default: {
2
+ "sectionLabel": "Componentes",
3
+ "sectionTitle": "Botones",
4
+ "buttons": {
5
+ "primary": "Primario",
6
+ "secondary": "Secundario",
7
+ "neutral": "Neutral",
8
+ "ctaWithRadius": "CTA con radio 8px",
9
+ "outline": "Contorno suave",
10
+ "outlineWithRadius": "Contorno suave con radio 8px",
11
+ "ghost": "Ghost",
12
+ "createAriaLabel": "Crear"
13
+ },
14
+ "switch": {
15
+ "airplaneMode": "Modo Avión"
16
+ }
17
+ };
18
+
19
+ export default _default;
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ "subtitle": "ies2 aulapp ui kit",
3
+ "title": "Componentes compartibles listos para producción",
4
+ "description": "Este sandbox refleja el estado actual del design system. Evalúe cada componente antes de publicar una nueva versión en npm."
5
+ };
6
+
7
+ export default _default;
@@ -0,0 +1,13 @@
1
+ declare const _default: {
2
+ "sectionLabel": "Tags",
3
+ "sectionTitle": "Badges",
4
+ "description": "Indicadores rápidos de conteúdo e recursos disponíveis.",
5
+ "appearances": {
6
+ "solid": "Solid",
7
+ "subtle": "Subtle",
8
+ "outline": "Outline",
9
+ "text": "Text"
10
+ }
11
+ };
12
+
13
+ export default _default;
@@ -0,0 +1,12 @@
1
+ declare const _default: {
2
+ "sectionLabel": "Ação",
3
+ "sectionTitle": "Call to Action",
4
+ "description": "Use o kit para acelerar o desenvolvimento de experiências consistentes em múltiplos apps React.",
5
+ "buttons": {
6
+ "explore": "Explorar componentes",
7
+ "documentation": "Documentação",
8
+ "undo": "Desfazer alteração"
9
+ }
10
+ };
11
+
12
+ export default _default;
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ "loading": "Carregando...",
3
+ "error": "Erro",
4
+ "success": "Sucesso"
5
+ };
6
+
7
+ export default _default;
@@ -0,0 +1,19 @@
1
+ declare const _default: {
2
+ "sectionLabel": "Componentes",
3
+ "sectionTitle": "Botões",
4
+ "buttons": {
5
+ "primary": "Primário",
6
+ "secondary": "Secundário",
7
+ "neutral": "Neutro",
8
+ "ctaWithRadius": "CTA com raio 8px",
9
+ "outline": "Outline suave",
10
+ "outlineWithRadius": "Outline suave com raio 8px",
11
+ "ghost": "Ghost",
12
+ "createAriaLabel": "Criar"
13
+ },
14
+ "switch": {
15
+ "airplaneMode": "Modo Avião"
16
+ }
17
+ };
18
+
19
+ export default _default;
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ "subtitle": "ies2 aulapp ui kit",
3
+ "title": "Componentes compartilháveis prontos para produção",
4
+ "description": "Esta sandbox reflete o estado atual do design system. Avalie cada componente antes de publicar um novo release no npm."
5
+ };
6
+
7
+ export default _default;
@@ -0,0 +1,4 @@
1
+ export type SupportedLocale = 'pt-BR' | 'en-US' | 'es';
2
+ export declare const SUPPORTED_LOCALES: SupportedLocale[];
3
+ export declare const DEFAULT_LOCALE: SupportedLocale;
4
+ export declare const LOCALE_LABELS: Record<SupportedLocale, string>;
@@ -0,0 +1,14 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { LanguageSwitcher } from '../lib/i18n/components/LanguageSwitcher';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof LanguageSwitcher;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const LanguageSwitcherComponent: Story;
14
+ export declare const WithTranslatedContent: Story;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ies2-aulapp-ui-kit",
3
3
  "private": false,
4
- "version": "0.1.13",
4
+ "version": "0.2.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.es.js",
@@ -25,7 +25,9 @@
25
25
  "@radix-ui/react-tabs": "^1.1.13",
26
26
  "class-variance-authority": "^0.7.1",
27
27
  "clsx": "^2.1.1",
28
+ "i18next": "^25.7.4",
28
29
  "iconsax-react": "^0.0.8",
30
+ "react-i18next": "^16.5.3",
29
31
  "tailwind-merge": "^3.4.0"
30
32
  },
31
33
  "peerDependencies": {