@sbkbs/ui 1.0.5 → 2.0.0-beta.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.
- package/CHANGELOG.md +57 -0
- package/MIGRATION.md +96 -0
- package/README.md +221 -115
- package/dist/assets/favicon/apple-touch-icon.png +0 -0
- package/dist/assets/favicon/favicon-96x96.png +0 -0
- package/dist/assets/favicon/favicon.ico +0 -0
- package/dist/assets/favicon/favicon.svg +1 -0
- package/dist/assets/favicon/site.webmanifest +21 -0
- package/dist/assets/favicon/web-app-manifest-192x192.png +0 -0
- package/dist/assets/favicon/web-app-manifest-512x512.png +0 -0
- package/dist/base.css +38 -0
- package/dist/components/Accordion/Accordion.d.ts +13 -1
- package/dist/components/Accordion/Accordion.js +100 -52
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Alert/Alert.d.ts +17 -4
- package/dist/components/Alert/Alert.js +64 -20
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +17 -0
- package/dist/components/Avatar/Avatar.js +66 -0
- package/dist/components/Avatar/Avatar.js.map +1 -0
- package/dist/components/Badge/Badge.d.ts +11 -2
- package/dist/components/Badge/Badge.js +42 -30
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +5 -2
- package/dist/components/Breadcrumb/Breadcrumb.js +23 -16
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/Button/Button.d.ts +10 -8
- package/dist/components/Button/Button.js +73 -114
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Card/Card.d.ts +33 -3
- package/dist/components/Card/Card.js +91 -30
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +4 -1
- package/dist/components/Checkbox/Checkbox.js +32 -31
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Chip/Chip.d.ts +7 -1
- package/dist/components/Chip/Chip.js +19 -9
- package/dist/components/Chip/Chip.js.map +1 -1
- package/dist/components/Combobox/Combobox.d.ts +10 -2
- package/dist/components/Combobox/Combobox.js +146 -133
- package/dist/components/Combobox/Combobox.js.map +1 -1
- package/dist/components/Divider/Divider.d.ts +7 -1
- package/dist/components/Divider/Divider.js +28 -12
- package/dist/components/Divider/Divider.js.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +33 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +147 -0
- package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -0
- package/dist/components/EmptyState/EmptyState.d.ts +7 -1
- package/dist/components/EmptyState/EmptyState.js +28 -19
- package/dist/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/components/Field/Field.d.ts +21 -0
- package/dist/components/Field/Field.js +35 -0
- package/dist/components/Field/Field.js.map +1 -0
- package/dist/components/FileUpload/FileUpload.d.ts +9 -2
- package/dist/components/FileUpload/FileUpload.js +128 -102
- package/dist/components/FileUpload/FileUpload.js.map +1 -1
- package/dist/components/Footer/Footer.d.ts +19 -6
- package/dist/components/Footer/Footer.js +47 -50
- package/dist/components/Footer/Footer.js.map +1 -1
- package/dist/components/GlassPanel/GlassPanel.d.ts +18 -0
- package/dist/components/GlassPanel/GlassPanel.js +39 -0
- package/dist/components/GlassPanel/GlassPanel.js.map +1 -0
- package/dist/components/Header/Header.d.ts +27 -10
- package/dist/components/Header/Header.js +98 -98
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Highlight/Highlight.d.ts +13 -0
- package/dist/components/Highlight/Highlight.js +18 -0
- package/dist/components/Highlight/Highlight.js.map +1 -0
- package/dist/components/Icon/Icon.d.ts +21 -0
- package/dist/components/Icon/Icon.js +31 -0
- package/dist/components/Icon/Icon.js.map +1 -0
- package/dist/components/IconButton/IconButton.d.ts +12 -0
- package/dist/components/IconButton/IconButton.js +49 -0
- package/dist/components/IconButton/IconButton.js.map +1 -0
- package/dist/components/Input/Input.d.ts +3 -2
- package/dist/components/Input/Input.js +51 -69
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Layout/Layout.d.ts +2 -0
- package/dist/components/Layout/Layout.js +24 -18
- package/dist/components/Layout/Layout.js.map +1 -1
- package/dist/components/Logo/Logo.d.ts +27 -0
- package/dist/components/Logo/Logo.js +107 -0
- package/dist/components/Logo/Logo.js.map +1 -0
- package/dist/components/MiniCard/MiniCard.d.ts +21 -0
- package/dist/components/MiniCard/MiniCard.js +90 -0
- package/dist/components/MiniCard/MiniCard.js.map +1 -0
- package/dist/components/Modal/Modal.d.ts +16 -3
- package/dist/components/Modal/Modal.js +124 -93
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Navigation/Navigation.d.ts +1 -0
- package/dist/components/Navigation/Navigation.js +14 -14
- package/dist/components/Navigation/Navigation.js.map +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts +5 -2
- package/dist/components/NumberInput/NumberInput.js +98 -128
- package/dist/components/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/PageHeader/PageHeader.d.ts +8 -1
- package/dist/components/PageHeader/PageHeader.js +26 -25
- package/dist/components/PageHeader/PageHeader.js.map +1 -1
- package/dist/components/Pagination/Pagination.d.ts +15 -2
- package/dist/components/Pagination/Pagination.js +68 -34
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/Paragraph/Paragraph.d.ts +8 -2
- package/dist/components/Paragraph/Paragraph.js +39 -36
- package/dist/components/Paragraph/Paragraph.js.map +1 -1
- package/dist/components/Popover/Popover.d.ts +12 -1
- package/dist/components/Popover/Popover.js +49 -37
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +18 -0
- package/dist/components/ProgressBar/ProgressBar.js +71 -0
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -0
- package/dist/components/Radio/Radio.d.ts +2 -1
- package/dist/components/Radio/Radio.js +27 -31
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.d.ts +6 -1
- package/dist/components/SectionHeader/SectionHeader.js +14 -12
- package/dist/components/SectionHeader/SectionHeader.js.map +1 -1
- package/dist/components/Select/Select.d.ts +6 -2
- package/dist/components/Select/Select.js +47 -35
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/SideNav/SideNav.d.ts +55 -0
- package/dist/components/SideNav/SideNav.js +141 -0
- package/dist/components/SideNav/SideNav.js.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +12 -1
- package/dist/components/Skeleton/Skeleton.js +33 -18
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Spinner/Spinner.d.ts +15 -0
- package/dist/components/Spinner/Spinner.js +57 -0
- package/dist/components/Spinner/Spinner.js.map +1 -0
- package/dist/components/Stepper/Stepper.d.ts +1 -1
- package/dist/components/Stepper/Stepper.js +68 -55
- package/dist/components/Stepper/Stepper.js.map +1 -1
- package/dist/components/Subtitle/Subtitle.d.ts +9 -3
- package/dist/components/Subtitle/Subtitle.js +29 -35
- package/dist/components/Subtitle/Subtitle.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +2 -1
- package/dist/components/Switch/Switch.js +45 -33
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Table/Table.d.ts +19 -1
- package/dist/components/Table/Table.js +48 -11
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +16 -2
- package/dist/components/Tabs/Tabs.js +80 -44
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tag/Tag.d.ts +8 -1
- package/dist/components/Tag/Tag.js +27 -12
- package/dist/components/Tag/Tag.js.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +3 -1
- package/dist/components/Textarea/Textarea.js +36 -40
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Title/Title.d.ts +9 -3
- package/dist/components/Title/Title.js +42 -42
- package/dist/components/Title/Title.js.map +1 -1
- package/dist/components/Toast/Toast.d.ts +39 -11
- package/dist/components/Toast/Toast.js +130 -76
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +12 -2
- package/dist/components/Tooltip/Tooltip.js +50 -32
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Typography/weight.d.ts +9 -0
- package/dist/components/Typography/weight.js +5 -0
- package/dist/components/Typography/weight.js.map +1 -0
- package/dist/fonts.css +8 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +55 -43
- package/dist/index.js +118 -83
- package/dist/index.js.map +1 -1
- package/dist/reset.css +9 -0
- package/dist/styles.css +1 -0
- package/dist/tailwind.css +153 -0
- package/dist/theme/ThemeProvider.d.ts +21 -3
- package/dist/theme/ThemeProvider.js +57 -18
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/tokens.d.ts +43 -0
- package/dist/theme/tokens.js +39 -0
- package/dist/theme/tokens.js.map +1 -0
- package/dist/theme.css +296 -261
- package/dist/tokens.css +327 -0
- package/dist/utils/cn.d.ts +2 -2
- package/dist/utils/cn.js +19 -4
- package/dist/utils/cn.js.map +1 -1
- package/dist/utils/styles.d.ts +37 -0
- package/dist/utils/styles.js +35 -0
- package/dist/utils/styles.js.map +1 -0
- package/package.json +140 -114
- package/dist/components/Accordion/Accordion.stories.d.ts +0 -7
- package/dist/components/Alert/Alert.stories.d.ts +0 -8
- package/dist/components/Badge/Badge.stories.d.ts +0 -8
- package/dist/components/Breadcrumb/Breadcrumb.stories.d.ts +0 -8
- package/dist/components/Button/Button.stories.d.ts +0 -7
- package/dist/components/Card/Card.stories.d.ts +0 -8
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -7
- package/dist/components/Combobox/Combobox.stories.d.ts +0 -9
- package/dist/components/Feedback/Feedback.stories.d.ts +0 -5
- package/dist/components/FileUpload/FileUpload.stories.d.ts +0 -10
- package/dist/components/Input/Input.stories.d.ts +0 -9
- package/dist/components/Modal/Modal.stories.d.ts +0 -8
- package/dist/components/NumberInput/NumberInput.stories.d.ts +0 -8
- package/dist/components/Pagination/Pagination.stories.d.ts +0 -8
- package/dist/components/Radio/Radio.stories.d.ts +0 -7
- package/dist/components/Select/Select.stories.d.ts +0 -8
- package/dist/components/Stepper/Stepper.stories.d.ts +0 -8
- package/dist/components/Switch/Switch.stories.d.ts +0 -8
- package/dist/components/Tabs/Tabs.stories.d.ts +0 -8
- package/dist/components/Textarea/Textarea.stories.d.ts +0 -7
- package/dist/components/Toast/Toast.stories.d.ts +0 -8
- package/dist/oficios-ui.css +0 -1
- package/dist/oficios-ui.umd.cjs +0 -2
- package/dist/oficios-ui.umd.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sources":["../../../src/components/Header/Header.tsx"],"sourcesContent":["import type React from 'react';\nimport { useEffect, useState } from 'react';\nimport type { Theme } from '../../theme/ThemeProvider';\n\nexport interface HeaderProps {\n
|
|
1
|
+
{"version":3,"file":"Header.js","sources":["../../../src/components/Header/Header.tsx"],"sourcesContent":["import type React from 'react';\nimport { useEffect, useState } from 'react';\nimport { Menu } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport { buttonReset, focusRing, inverseScope } from '../../utils/styles';\nimport type { Theme } from '../../theme/ThemeProvider';\nimport { Logo, type LogoVariant } from '../Logo/Logo';\n\nexport type HeaderVariant = 'solid' | 'light' | 'glass';\n\nexport interface HeaderProps {\n className?: string;\n /** Texto alternativo da imagem de logo customizada. */\n logoAlt?: string;\n /** Imagem de logo para o tema escuro (substitui o SVG oficial). */\n logoDarkSrc?: string;\n /** Imagem de logo customizada (substitui o SVG oficial). */\n logoSrc?: string;\n /** Logo oficial usado quando não há `logoSrc`. Padrão: sbk. */\n logoVariant?: LogoVariant;\n /** Estado do menu lateral, anunciado no botão hamburger (aria-expanded). */\n menuExpanded?: boolean;\n /** Rótulo do botão hamburger. Padrão: \"Abrir menu\". */\n menuLabel?: string;\n /** Navegação principal, exibida ao centro. */\n navigation?: React.ReactNode;\n onLogoClick?: () => void;\n onMenuClick?: () => void;\n /** Conteúdo à direita (ações, seletor de tema, menu do usuário). */\n rightContent?: React.ReactNode;\n showMenuIcon?: boolean;\n /** Fixa o header no topo. Padrão: true. */\n sticky?: boolean;\n subtitle?: React.ReactNode;\n /** Tema para escolher entre logoSrc e logoDarkSrc sem depender do ThemeProvider. */\n theme?: Theme;\n title?: React.ReactNode;\n /** Iniciais do usuário exibidas no avatar (ex.: \"CF\"). */\n userInitials?: string;\n /** `solid`: verde escuro (padrão). `light`: superfície clara. `glass`: Liquid Glass. */\n variant?: HeaderVariant;\n}\n\nconst detectTheme = (): Theme =>\n typeof document !== 'undefined' && document.documentElement.getAttribute('data-theme') === 'dark'\n ? 'dark'\n : 'light';\n\nconst VARIANT_CLASS: Record<HeaderVariant, string> = {\n solid: inverseScope,\n light: 'border-b border-sbk-line bg-sbk-surface text-sbk-fg',\n glass: 'sbk-glass rounded-none border-x-0 border-t-0 text-sbk-fg',\n};\n\nexport const Header = ({\n logoSrc,\n logoDarkSrc,\n logoAlt = 'SBK',\n logoVariant = 'sbk',\n title,\n subtitle,\n theme,\n navigation,\n onLogoClick,\n onMenuClick,\n menuExpanded,\n menuLabel = 'Abrir menu',\n rightContent,\n showMenuIcon = true,\n sticky = true,\n userInitials,\n variant = 'solid',\n className,\n}: HeaderProps) => {\n const [resolvedTheme, setResolvedTheme] = useState<Theme>(() => theme ?? detectTheme());\n\n useEffect(() => {\n if (theme) {\n setResolvedTheme(theme);\n return;\n }\n if (!logoDarkSrc || typeof MutationObserver === 'undefined') return;\n const sync = () => setResolvedTheme(detectTheme());\n sync();\n const observer = new MutationObserver(sync);\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['data-theme'],\n });\n return () => observer.disconnect();\n }, [theme, logoDarkSrc]);\n\n const customLogo = resolvedTheme === 'dark' && logoDarkSrc ? logoDarkSrc : logoSrc;\n const brand = (\n <>\n {customLogo ? (\n <img alt={logoAlt} className=\"h-8 w-auto shrink-0 object-contain\" src={customLogo} />\n ) : (\n <Logo color={variant === 'solid' ? 'white' : 'auto'} height={28} variant={logoVariant} />\n )}\n {(title || subtitle) && (\n <span className=\"grid min-w-0 gap-px text-left\">\n {title && (\n <span className=\"truncate text-base font-semibold leading-tight text-sbk-fg-heading\">\n {title}\n </span>\n )}\n {subtitle && (\n <span className=\"truncate text-xs font-light leading-tight text-sbk-fg-muted\">\n {subtitle}\n </span>\n )}\n </span>\n )}\n </>\n );\n\n return (\n <header\n className={cn(\n 'z-[var(--sbk-z-sticky)] box-border flex h-16 w-full shrink-0 items-center justify-between gap-4 px-4 md:px-8',\n sticky && 'sticky top-0',\n VARIANT_CLASS[variant],\n className,\n )}\n >\n <div className=\"flex min-w-0 items-center gap-3\">\n {showMenuIcon && (\n <button\n aria-expanded={menuExpanded}\n aria-label={menuLabel}\n className={cn(\n buttonReset,\n 'inline-flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-sbk-sm text-sbk-fg hover:bg-sbk-surface-hover',\n focusRing,\n )}\n onClick={onMenuClick}\n type=\"button\"\n >\n <Menu aria-hidden=\"true\" className=\"size-5\" />\n </button>\n )}\n {onLogoClick ? (\n <button\n className={cn(\n buttonReset,\n 'flex min-w-0 cursor-pointer items-center gap-3 rounded-sbk-xs',\n focusRing,\n )}\n onClick={onLogoClick}\n type=\"button\"\n >\n {brand}\n </button>\n ) : (\n <div className=\"flex min-w-0 items-center gap-3\">{brand}</div>\n )}\n </div>\n\n {navigation && (\n <nav aria-label=\"Principal\" className=\"hidden min-w-0 flex-1 justify-center md:flex\">\n {navigation}\n </nav>\n )}\n\n <div className=\"flex shrink-0 items-center gap-2\">\n {rightContent}\n {userInitials && (\n <span\n aria-label={`Usuário: ${userInitials}`}\n className=\"inline-flex size-9 shrink-0 select-none items-center justify-center rounded-full bg-sbk-ciano text-[0.8125rem] font-semibold text-sbk-branco\"\n role=\"img\"\n >\n {userInitials}\n </span>\n )}\n </div>\n </header>\n );\n};\n\nHeader.displayName = 'Header';\n"],"names":["detectTheme","VARIANT_CLASS","inverseScope","Header","logoSrc","logoDarkSrc","logoAlt","logoVariant","title","subtitle","theme","navigation","onLogoClick","onMenuClick","menuExpanded","menuLabel","rightContent","showMenuIcon","sticky","userInitials","variant","className","resolvedTheme","setResolvedTheme","useState","useEffect","sync","observer","customLogo","brand","jsxs","Fragment","Logo","jsx","cn","buttonReset","focusRing","Menu"],"mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export interface HighlightProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
|
+
/** Ciano Escuro (padrão) ou Verde Claro, conforme o brand book. */
|
|
4
|
+
tone?: 'ciano' | 'verde';
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Highlight de palavra-chave do brand book: bloco retangular atrás de palavras
|
|
8
|
+
* estruturantes, sempre com texto branco. Use em poucas palavras por tela.
|
|
9
|
+
*/
|
|
10
|
+
export declare const Highlight: {
|
|
11
|
+
({ tone, className, ...props }: HighlightProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cn as i } from "../../utils/cn.js";
|
|
3
|
+
const s = ({ tone: o = "ciano", className: r, ...a }) => /* @__PURE__ */ e(
|
|
4
|
+
"mark",
|
|
5
|
+
{
|
|
6
|
+
className: i(
|
|
7
|
+
"rounded-sbk-xs px-1.5 py-0.5 font-semibold text-sbk-branco [box-decoration-break:clone]",
|
|
8
|
+
o === "ciano" ? "bg-sbk-ciano-escuro" : "bg-sbk-verde-claro",
|
|
9
|
+
r
|
|
10
|
+
),
|
|
11
|
+
...a
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
s.displayName = "Highlight";
|
|
15
|
+
export {
|
|
16
|
+
s as Highlight
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=Highlight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Highlight.js","sources":["../../../src/components/Highlight/Highlight.tsx"],"sourcesContent":["import type React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface HighlightProps extends React.HTMLAttributes<HTMLElement> {\n /** Ciano Escuro (padrão) ou Verde Claro, conforme o brand book. */\n tone?: 'ciano' | 'verde';\n}\n\n/**\n * Highlight de palavra-chave do brand book: bloco retangular atrás de palavras\n * estruturantes, sempre com texto branco. Use em poucas palavras por tela.\n */\nexport const Highlight = ({ tone = 'ciano', className, ...props }: HighlightProps) => (\n <mark\n className={cn(\n 'rounded-sbk-xs px-1.5 py-0.5 font-semibold text-sbk-branco [box-decoration-break:clone]',\n tone === 'ciano' ? 'bg-sbk-ciano-escuro' : 'bg-sbk-verde-claro',\n className,\n )}\n {...props}\n />\n);\n\nHighlight.displayName = 'Highlight';\n"],"names":["Highlight","tone","className","props","jsx","cn"],"mappings":";;AAYO,MAAMA,IAAY,CAAC,EAAE,MAAAC,IAAO,SAAS,WAAAC,GAAW,GAAGC,QACxD,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,MACAJ,MAAS,UAAU,wBAAwB;AAAA,MAC3CC;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN;AAGFH,EAAU,cAAc;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { LucideIcon, LucideProps } from 'lucide-react';
|
|
2
|
+
export type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export interface IconProps extends Omit<LucideProps, 'size' | 'ref'> {
|
|
4
|
+
/** Componente de ícone do lucide-react (ex.: `import { Search } from 'lucide-react'`). */
|
|
5
|
+
icon: LucideIcon;
|
|
6
|
+
/**
|
|
7
|
+
* Texto para leitores de tela. Sem label o ícone é decorativo (`aria-hidden`).
|
|
8
|
+
* Informe sempre que o ícone for o único conteúdo com significado.
|
|
9
|
+
*/
|
|
10
|
+
label?: string;
|
|
11
|
+
size?: IconSize | number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Wrapper padronizado para ícones lucide-react.
|
|
15
|
+
* Ícones herdam a cor do texto (currentColor), o que mantém a paleta da marca.
|
|
16
|
+
* Traço 1.75 acompanha o peso Leve da tipografia.
|
|
17
|
+
*/
|
|
18
|
+
export declare const Icon: {
|
|
19
|
+
({ icon: IconComponent, label, size, strokeWidth, className, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { cn as c } from "../../utils/cn.js";
|
|
3
|
+
const e = { xs: 12, sm: 16, md: 20, lg: 24, xl: 32 }, d = ({
|
|
4
|
+
icon: m,
|
|
5
|
+
label: o,
|
|
6
|
+
size: r = "md",
|
|
7
|
+
strokeWidth: n = 1.75,
|
|
8
|
+
className: t,
|
|
9
|
+
...s
|
|
10
|
+
}) => {
|
|
11
|
+
const i = typeof r == "number" ? r : e[r];
|
|
12
|
+
return /* @__PURE__ */ a(
|
|
13
|
+
m,
|
|
14
|
+
{
|
|
15
|
+
"aria-hidden": o ? void 0 : !0,
|
|
16
|
+
"aria-label": o,
|
|
17
|
+
className: c("shrink-0", t),
|
|
18
|
+
focusable: "false",
|
|
19
|
+
height: i,
|
|
20
|
+
role: o ? "img" : void 0,
|
|
21
|
+
strokeWidth: n,
|
|
22
|
+
width: i,
|
|
23
|
+
...s
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
d.displayName = "Icon";
|
|
28
|
+
export {
|
|
29
|
+
d as Icon
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=Icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.js","sources":["../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import type { LucideIcon, LucideProps } from 'lucide-react';\nimport { cn } from '../../utils/cn';\n\nexport type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nexport interface IconProps extends Omit<LucideProps, 'size' | 'ref'> {\n /** Componente de ícone do lucide-react (ex.: `import { Search } from 'lucide-react'`). */\n icon: LucideIcon;\n /**\n * Texto para leitores de tela. Sem label o ícone é decorativo (`aria-hidden`).\n * Informe sempre que o ícone for o único conteúdo com significado.\n */\n label?: string;\n size?: IconSize | number;\n}\n\nconst SIZE_PX: Record<IconSize, number> = { xs: 12, sm: 16, md: 20, lg: 24, xl: 32 };\n\n/**\n * Wrapper padronizado para ícones lucide-react.\n * Ícones herdam a cor do texto (currentColor), o que mantém a paleta da marca.\n * Traço 1.75 acompanha o peso Leve da tipografia.\n */\nexport const Icon = ({\n icon: IconComponent,\n label,\n size = 'md',\n strokeWidth = 1.75,\n className,\n ...props\n}: IconProps) => {\n const px = typeof size === 'number' ? size : SIZE_PX[size];\n return (\n <IconComponent\n aria-hidden={label ? undefined : true}\n aria-label={label}\n className={cn('shrink-0', className)}\n focusable=\"false\"\n height={px}\n role={label ? 'img' : undefined}\n strokeWidth={strokeWidth}\n width={px}\n {...props}\n />\n );\n};\n\nIcon.displayName = 'Icon';\n"],"names":["SIZE_PX","Icon","IconComponent","label","size","strokeWidth","className","props","px","jsx","cn"],"mappings":";;AAgBA,MAAMA,IAAoC,EAAE,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,GAAA,GAOnEC,IAAO,CAAC;AAAA,EACnB,MAAMC;AAAA,EACN,OAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,aAAAC,IAAc;AAAA,EACd,WAAAC;AAAA,EACA,GAAGC;AACL,MAAiB;AACf,QAAMC,IAAK,OAAOJ,KAAS,WAAWA,IAAOJ,EAAQI,CAAI;AACzD,SACE,gBAAAK;AAAA,IAACP;AAAA,IAAA;AAAA,MACC,eAAaC,IAAQ,SAAY;AAAA,MACjC,cAAYA;AAAA,MACZ,WAAWO,EAAG,YAAYJ,CAAS;AAAA,MACnC,WAAU;AAAA,MACV,QAAQE;AAAA,MACR,MAAML,IAAQ,QAAQ;AAAA,MACtB,aAAAE;AAAA,MACA,OAAOG;AAAA,MACN,GAAGD;AAAA,IAAA;AAAA,EAAA;AAGV;AAEAN,EAAK,cAAc;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type IconButtonVariant = 'primary' | 'secondary' | 'ghost' | 'outline' | 'inverse' | 'glass';
|
|
3
|
+
export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
/** Nome acessível obrigatório: o botão não tem texto visível. */
|
|
5
|
+
'aria-label': string;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
shape?: 'square' | 'circle';
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
variant?: IconButtonVariant;
|
|
10
|
+
}
|
|
11
|
+
/** Botão quadrado ou circular apenas com ícone. */
|
|
12
|
+
export declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import c from "react";
|
|
3
|
+
import { cn as g } from "../../utils/cn.js";
|
|
4
|
+
import { focusRing as d, transitionColors as m, buttonReset as k } from "../../utils/styles.js";
|
|
5
|
+
const u = {
|
|
6
|
+
sm: "size-8 [&_svg]:size-4",
|
|
7
|
+
md: "size-10 [&_svg]:size-5",
|
|
8
|
+
lg: "size-12 [&_svg]:size-6"
|
|
9
|
+
}, f = {
|
|
10
|
+
primary: "bg-sbk-primary text-sbk-on-primary hover:bg-sbk-primary-hover",
|
|
11
|
+
secondary: "bg-sbk-secondary text-sbk-on-secondary hover:bg-sbk-secondary-hover",
|
|
12
|
+
ghost: "bg-transparent text-sbk-fg-muted hover:bg-sbk-surface-hover hover:text-sbk-fg",
|
|
13
|
+
outline: "border-sbk-line-strong bg-sbk-surface text-sbk-fg hover:bg-sbk-surface-hover",
|
|
14
|
+
inverse: "bg-transparent text-sbk-branco hover:bg-sbk-branco/10",
|
|
15
|
+
glass: "sbk-glass text-sbk-fg"
|
|
16
|
+
}, l = c.forwardRef(
|
|
17
|
+
({
|
|
18
|
+
children: r,
|
|
19
|
+
shape: s = "square",
|
|
20
|
+
size: e = "md",
|
|
21
|
+
variant: o = "ghost",
|
|
22
|
+
className: t,
|
|
23
|
+
type: n = "button",
|
|
24
|
+
...b
|
|
25
|
+
}, a) => /* @__PURE__ */ i(
|
|
26
|
+
"button",
|
|
27
|
+
{
|
|
28
|
+
ref: a,
|
|
29
|
+
className: g(
|
|
30
|
+
k,
|
|
31
|
+
"inline-flex shrink-0 cursor-pointer items-center justify-center border border-transparent disabled:cursor-not-allowed disabled:opacity-50",
|
|
32
|
+
s === "circle" ? "rounded-full" : "rounded-sbk-sm",
|
|
33
|
+
m,
|
|
34
|
+
d,
|
|
35
|
+
u[e],
|
|
36
|
+
f[o],
|
|
37
|
+
t
|
|
38
|
+
),
|
|
39
|
+
type: n,
|
|
40
|
+
...b,
|
|
41
|
+
children: r
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
l.displayName = "IconButton";
|
|
46
|
+
export {
|
|
47
|
+
l as IconButton
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=IconButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.js","sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import React from 'react';\nimport { cn } from '../../utils/cn';\nimport { buttonReset, focusRing, transitionColors } from '../../utils/styles';\n\nexport type IconButtonVariant = 'primary' | 'secondary' | 'ghost' | 'outline' | 'inverse' | 'glass';\n\nexport interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Nome acessível obrigatório: o botão não tem texto visível. */\n 'aria-label': string;\n children: React.ReactNode;\n shape?: 'square' | 'circle';\n size?: 'sm' | 'md' | 'lg';\n variant?: IconButtonVariant;\n}\n\nconst SIZE_CLASS = {\n sm: 'size-8 [&_svg]:size-4',\n md: 'size-10 [&_svg]:size-5',\n lg: 'size-12 [&_svg]:size-6',\n} as const;\n\nconst VARIANT_CLASS: Record<IconButtonVariant, string> = {\n primary: 'bg-sbk-primary text-sbk-on-primary hover:bg-sbk-primary-hover',\n secondary: 'bg-sbk-secondary text-sbk-on-secondary hover:bg-sbk-secondary-hover',\n ghost: 'bg-transparent text-sbk-fg-muted hover:bg-sbk-surface-hover hover:text-sbk-fg',\n outline: 'border-sbk-line-strong bg-sbk-surface text-sbk-fg hover:bg-sbk-surface-hover',\n inverse: 'bg-transparent text-sbk-branco hover:bg-sbk-branco/10',\n glass: 'sbk-glass text-sbk-fg',\n};\n\n/** Botão quadrado ou circular apenas com ícone. */\nexport const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n children,\n shape = 'square',\n size = 'md',\n variant = 'ghost',\n className,\n type = 'button',\n ...props\n },\n ref,\n ) => (\n <button\n ref={ref}\n className={cn(\n buttonReset,\n 'inline-flex shrink-0 cursor-pointer items-center justify-center border border-transparent disabled:cursor-not-allowed disabled:opacity-50',\n shape === 'circle' ? 'rounded-full' : 'rounded-sbk-sm',\n transitionColors,\n focusRing,\n SIZE_CLASS[size],\n VARIANT_CLASS[variant],\n className,\n )}\n type={type}\n {...props}\n >\n {children}\n </button>\n ),\n);\n\nIconButton.displayName = 'IconButton';\n"],"names":["SIZE_CLASS","VARIANT_CLASS","IconButton","React","children","shape","size","variant","className","type","props","ref","jsx","cn","buttonReset","transitionColors","focusRing"],"mappings":";;;;AAeA,MAAMA,IAAa;AAAA,EACjB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEMC,IAAmD;AAAA,EACvD,SAAS;AAAA,EACT,WAAW;AAAA,EACX,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT,GAGaC,IAAaC,EAAM;AAAA,EAC9B,CACE;AAAA,IACE,UAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,MAAAC,IAAO;AAAA,IACP,SAAAC,IAAU;AAAA,IACV,WAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,GAAGC;AAAA,EAAA,GAELC,MAEA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,WAAWE;AAAA,QACTC;AAAA,QACA;AAAA,QACAT,MAAU,WAAW,iBAAiB;AAAA,QACtCU;AAAA,QACAC;AAAA,QACAhB,EAAWM,CAAI;AAAA,QACfL,EAAcM,CAAO;AAAA,QACrBC;AAAA,MAAA;AAAA,MAEF,MAAAC;AAAA,MACC,GAAGC;AAAA,MAEH,UAAAN;AAAA,IAAA;AAAA,EAAA;AAGP;AAEAF,EAAW,cAAc;"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type FieldSize } from '../../utils/styles';
|
|
2
3
|
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
3
4
|
error?: string;
|
|
4
5
|
fullWidth?: boolean;
|
|
5
6
|
helperText?: string;
|
|
6
|
-
label?:
|
|
7
|
+
label?: React.ReactNode;
|
|
7
8
|
leftIcon?: React.ReactNode;
|
|
8
9
|
rightIcon?: React.ReactNode;
|
|
9
|
-
size?:
|
|
10
|
+
size?: FieldSize;
|
|
10
11
|
}
|
|
11
12
|
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,78 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { cn as
|
|
4
|
-
|
|
1
|
+
import { jsx as e, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import N, { useId as w } from "react";
|
|
3
|
+
import { cn as i } from "../../utils/cn.js";
|
|
4
|
+
import { describedBy as y, fieldSize as g, fieldControl as h } from "../../utils/styles.js";
|
|
5
|
+
import { Field as z } from "../Field/Field.js";
|
|
6
|
+
const m = "pointer-events-none absolute z-[1] flex items-center text-sbk-fg-muted group-focus-within:text-sbk-primary [&_svg]:size-[1.125rem]", j = N.forwardRef(
|
|
5
7
|
({
|
|
6
|
-
label:
|
|
7
|
-
error:
|
|
8
|
-
helperText:
|
|
8
|
+
label: n,
|
|
9
|
+
error: s,
|
|
10
|
+
helperText: l,
|
|
9
11
|
leftIcon: t,
|
|
10
|
-
rightIcon:
|
|
11
|
-
fullWidth:
|
|
12
|
-
size:
|
|
13
|
-
className:
|
|
14
|
-
id:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
rightIcon: a,
|
|
13
|
+
fullWidth: o = !1,
|
|
14
|
+
size: p = "md",
|
|
15
|
+
className: c,
|
|
16
|
+
id: f,
|
|
17
|
+
required: d,
|
|
18
|
+
...u
|
|
19
|
+
}, b) => {
|
|
20
|
+
const v = w(), r = f ?? v;
|
|
21
|
+
return /* @__PURE__ */ e(
|
|
22
|
+
z,
|
|
20
23
|
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
className: i(o && "w-full"),
|
|
25
|
+
error: s,
|
|
26
|
+
helperText: l,
|
|
27
|
+
id: r,
|
|
28
|
+
label: n,
|
|
29
|
+
required: d,
|
|
30
|
+
children: /* @__PURE__ */ x("div", { className: "group relative flex w-full items-center", children: [
|
|
31
|
+
t && /* @__PURE__ */ e("span", { className: i(m, "left-3"), children: t }),
|
|
32
|
+
/* @__PURE__ */ e(
|
|
33
|
+
"input",
|
|
34
|
+
{
|
|
35
|
+
ref: b,
|
|
36
|
+
"aria-describedby": y(r, s, l),
|
|
37
|
+
"aria-invalid": s ? !0 : void 0,
|
|
38
|
+
className: i(
|
|
39
|
+
h,
|
|
40
|
+
g[p],
|
|
41
|
+
t && "pl-10",
|
|
42
|
+
a && "pr-10",
|
|
43
|
+
c
|
|
44
|
+
),
|
|
45
|
+
id: r,
|
|
46
|
+
required: d,
|
|
47
|
+
...u
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
a && /* @__PURE__ */ e("span", { className: i(m, "right-3"), children: a })
|
|
51
|
+
] })
|
|
52
|
+
}
|
|
29
53
|
);
|
|
30
|
-
return /* @__PURE__ */ d("div", { className: c("flex flex-col gap-[var(--spacing-xs)]", l && "w-full"), children: [
|
|
31
|
-
i && /* @__PURE__ */ a(
|
|
32
|
-
"label",
|
|
33
|
-
{
|
|
34
|
-
className: "text-[var(--font-size-sm)] font-[var(--font-weight-semibold)] text-[var(--md-on-surface)]",
|
|
35
|
-
htmlFor: r,
|
|
36
|
-
children: i
|
|
37
|
-
}
|
|
38
|
-
),
|
|
39
|
-
/* @__PURE__ */ d("div", { className: "group relative flex w-full items-center", children: [
|
|
40
|
-
t && /* @__PURE__ */ a("span", { className: "pointer-events-none absolute left-[var(--spacing-md)] z-[1] flex items-center justify-center text-[var(--md-on-surface-variant)] group-focus-within:text-[var(--md-primary)] [&_svg]:h-[1.125rem] [&_svg]:w-[1.125rem]", children: t }),
|
|
41
|
-
/* @__PURE__ */ a(
|
|
42
|
-
"input",
|
|
43
|
-
{
|
|
44
|
-
ref: u,
|
|
45
|
-
"aria-describedby": e ? `${r}-error` : s ? `${r}-helper` : void 0,
|
|
46
|
-
"aria-invalid": n ? !0 : void 0,
|
|
47
|
-
className: x,
|
|
48
|
-
id: r,
|
|
49
|
-
...f
|
|
50
|
-
}
|
|
51
|
-
),
|
|
52
|
-
o && /* @__PURE__ */ a("span", { className: "pointer-events-none absolute right-[var(--spacing-md)] z-[1] flex items-center justify-center text-[var(--md-on-surface-variant)] group-focus-within:text-[var(--md-primary)] [&_svg]:h-[1.125rem] [&_svg]:w-[1.125rem]", children: o })
|
|
53
|
-
] }),
|
|
54
|
-
e && /* @__PURE__ */ a(
|
|
55
|
-
"span",
|
|
56
|
-
{
|
|
57
|
-
className: "mt-[var(--spacing-xs)] block text-[var(--font-size-xs)] text-[var(--md-error)]",
|
|
58
|
-
id: `${r}-error`,
|
|
59
|
-
role: "alert",
|
|
60
|
-
children: e
|
|
61
|
-
}
|
|
62
|
-
),
|
|
63
|
-
s && !e && /* @__PURE__ */ a(
|
|
64
|
-
"span",
|
|
65
|
-
{
|
|
66
|
-
className: "mt-[var(--spacing-xs)] block text-[var(--font-size-xs)] text-[var(--md-on-surface-variant)]",
|
|
67
|
-
id: `${r}-helper`,
|
|
68
|
-
children: s
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
-
] });
|
|
72
54
|
}
|
|
73
55
|
);
|
|
74
|
-
|
|
56
|
+
j.displayName = "Input";
|
|
75
57
|
export {
|
|
76
|
-
|
|
58
|
+
j as Input
|
|
77
59
|
};
|
|
78
60
|
//# sourceMappingURL=Input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {\n error?: string;\n fullWidth?: boolean;\n helperText?: string;\n label?:
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import React, { useId } from 'react';\nimport { cn } from '../../utils/cn';\nimport { describedBy, fieldControl, fieldSize, type FieldSize } from '../../utils/styles';\nimport { Field } from '../Field/Field';\n\nexport interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {\n error?: string;\n fullWidth?: boolean;\n helperText?: string;\n label?: React.ReactNode;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n size?: FieldSize;\n}\n\nconst iconSlot =\n 'pointer-events-none absolute z-[1] flex items-center text-sbk-fg-muted group-focus-within:text-sbk-primary [&_svg]:size-[1.125rem]';\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n (\n {\n label,\n error,\n helperText,\n leftIcon,\n rightIcon,\n fullWidth = false,\n size = 'md',\n className,\n id,\n required,\n ...props\n },\n ref,\n ) => {\n const autoId = useId();\n const inputId = id ?? autoId;\n\n return (\n <Field\n className={cn(fullWidth && 'w-full')}\n error={error}\n helperText={helperText}\n id={inputId}\n label={label}\n required={required}\n >\n <div className=\"group relative flex w-full items-center\">\n {leftIcon && <span className={cn(iconSlot, 'left-3')}>{leftIcon}</span>}\n <input\n ref={ref}\n aria-describedby={describedBy(inputId, error, helperText)}\n aria-invalid={error ? true : undefined}\n className={cn(\n fieldControl,\n fieldSize[size],\n leftIcon && 'pl-10',\n rightIcon && 'pr-10',\n className,\n )}\n id={inputId}\n required={required}\n {...props}\n />\n {rightIcon && <span className={cn(iconSlot, 'right-3')}>{rightIcon}</span>}\n </div>\n </Field>\n );\n },\n);\n\nInput.displayName = 'Input';\n"],"names":["iconSlot","Input","React","label","error","helperText","leftIcon","rightIcon","fullWidth","size","className","id","required","props","ref","autoId","useId","inputId","jsx","Field","cn","jsxs","describedBy","fieldControl","fieldSize"],"mappings":";;;;;AAeA,MAAMA,IACJ,sIAEWC,IAAQC,EAAM;AAAA,EACzB,CACE;AAAA,IACE,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,MAAAC,IAAO;AAAA,IACP,WAAAC;AAAA,IACA,IAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAASC,EAAA,GACTC,IAAUN,KAAMI;AAEtB,WACE,gBAAAG;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,WAAWC,EAAGZ,KAAa,QAAQ;AAAA,QACnC,OAAAJ;AAAA,QACA,YAAAC;AAAA,QACA,IAAIY;AAAA,QACJ,OAAAd;AAAA,QACA,UAAAS;AAAA,QAEA,UAAA,gBAAAS,EAAC,OAAA,EAAI,WAAU,2CACZ,UAAA;AAAA,UAAAf,uBAAa,QAAA,EAAK,WAAWc,EAAGpB,GAAU,QAAQ,GAAI,UAAAM,GAAS;AAAA,UAChE,gBAAAY;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,KAAAJ;AAAA,cACA,oBAAkBQ,EAAYL,GAASb,GAAOC,CAAU;AAAA,cACxD,gBAAcD,IAAQ,KAAO;AAAA,cAC7B,WAAWgB;AAAA,gBACTG;AAAA,gBACAC,EAAUf,CAAI;AAAA,gBACdH,KAAY;AAAA,gBACZC,KAAa;AAAA,gBACbG;AAAA,cAAA;AAAA,cAEF,IAAIO;AAAA,cACJ,UAAAL;AAAA,cACC,GAAGC;AAAA,YAAA;AAAA,UAAA;AAAA,UAELN,uBAAc,QAAA,EAAK,WAAWa,EAAGpB,GAAU,SAAS,GAAI,UAAAO,EAAA,CAAU;AAAA,QAAA,EAAA,CACrE;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAN,EAAM,cAAc;"}
|
|
@@ -10,5 +10,7 @@ export declare const Stack: React.FC<StackProps>;
|
|
|
10
10
|
export interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
11
11
|
cols?: 1 | 2 | 3 | 4;
|
|
12
12
|
gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
13
|
+
/** Empilha colunas em telas pequenas. Padrão: true. */
|
|
14
|
+
responsive?: boolean;
|
|
13
15
|
}
|
|
14
16
|
export declare const Grid: React.FC<GridProps>;
|
|
@@ -1,41 +1,47 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
3
|
-
const t = ({ size: s = "lg", className:
|
|
4
|
-
const
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { cn as c } from "../../utils/cn.js";
|
|
3
|
+
const t = ({ size: s = "lg", className: g, ...l }) => {
|
|
4
|
+
const a = {
|
|
5
5
|
sm: "max-w-2xl",
|
|
6
6
|
md: "max-w-4xl",
|
|
7
7
|
lg: "max-w-6xl",
|
|
8
8
|
xl: "max-w-7xl",
|
|
9
9
|
full: "max-w-none"
|
|
10
10
|
}[s];
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
},
|
|
13
|
-
const
|
|
11
|
+
return /* @__PURE__ */ o("div", { className: c("mx-auto w-full px-4", a, g), ...l });
|
|
12
|
+
}, p = ({ gap: s = "md", className: g, ...l }) => {
|
|
13
|
+
const a = {
|
|
14
14
|
xs: "gap-1",
|
|
15
15
|
sm: "gap-2",
|
|
16
16
|
md: "gap-3",
|
|
17
17
|
lg: "gap-4",
|
|
18
18
|
xl: "gap-6"
|
|
19
19
|
}[s];
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
},
|
|
22
|
-
|
|
20
|
+
return /* @__PURE__ */ o("div", { className: c("flex flex-col", a, g), ...l });
|
|
21
|
+
}, n = ({
|
|
22
|
+
cols: s = 2,
|
|
23
|
+
gap: g = "md",
|
|
24
|
+
responsive: l = !0,
|
|
25
|
+
className: a,
|
|
26
|
+
...r
|
|
27
|
+
}) => {
|
|
28
|
+
const m = {
|
|
23
29
|
1: "grid-cols-1",
|
|
24
|
-
2: "grid-cols-2",
|
|
25
|
-
3: "grid-cols-3",
|
|
26
|
-
4: "grid-cols-4"
|
|
27
|
-
}[s],
|
|
30
|
+
2: l ? "grid-cols-1 sm:grid-cols-2" : "grid-cols-2",
|
|
31
|
+
3: l ? "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3" : "grid-cols-3",
|
|
32
|
+
4: l ? "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4" : "grid-cols-4"
|
|
33
|
+
}[s], d = {
|
|
28
34
|
xs: "gap-1",
|
|
29
35
|
sm: "gap-2",
|
|
30
36
|
md: "gap-3",
|
|
31
37
|
lg: "gap-4",
|
|
32
38
|
xl: "gap-6"
|
|
33
|
-
}[
|
|
34
|
-
return /* @__PURE__ */
|
|
39
|
+
}[g];
|
|
40
|
+
return /* @__PURE__ */ o("div", { className: c("grid", m, d, a), ...r });
|
|
35
41
|
};
|
|
36
42
|
export {
|
|
37
43
|
t as Container,
|
|
38
|
-
|
|
39
|
-
|
|
44
|
+
n as Grid,
|
|
45
|
+
p as Stack
|
|
40
46
|
};
|
|
41
47
|
//# sourceMappingURL=Layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.js","sources":["../../../src/components/Layout/Layout.tsx"],"sourcesContent":["import type React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {\n size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';\n}\n\nexport const Container: React.FC<ContainerProps> = ({ size = 'lg', className, ...props }) => {\n const sizeClass = {\n sm: 'max-w-2xl',\n md: 'max-w-4xl',\n lg: 'max-w-6xl',\n xl: 'max-w-7xl',\n full: 'max-w-none',\n }[size];\n return <div className={cn('mx-auto w-full px-4', sizeClass, className)} {...props} />;\n};\n\nexport interface StackProps extends React.HTMLAttributes<HTMLDivElement> {\n gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n}\n\nexport const Stack: React.FC<StackProps> = ({ gap = 'md', className, ...props }) => {\n const gapClass = {\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-3',\n lg: 'gap-4',\n xl: 'gap-6',\n }[gap];\n return <div className={cn('flex flex-col', gapClass, className)} {...props} />;\n};\n\nexport interface GridProps extends React.HTMLAttributes<HTMLDivElement> {\n cols?: 1 | 2 | 3 | 4;\n gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n}\n\nexport const Grid: React.FC<GridProps> = ({
|
|
1
|
+
{"version":3,"file":"Layout.js","sources":["../../../src/components/Layout/Layout.tsx"],"sourcesContent":["import type React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {\n size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';\n}\n\nexport const Container: React.FC<ContainerProps> = ({ size = 'lg', className, ...props }) => {\n const sizeClass = {\n sm: 'max-w-2xl',\n md: 'max-w-4xl',\n lg: 'max-w-6xl',\n xl: 'max-w-7xl',\n full: 'max-w-none',\n }[size];\n return <div className={cn('mx-auto w-full px-4', sizeClass, className)} {...props} />;\n};\n\nexport interface StackProps extends React.HTMLAttributes<HTMLDivElement> {\n gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n}\n\nexport const Stack: React.FC<StackProps> = ({ gap = 'md', className, ...props }) => {\n const gapClass = {\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-3',\n lg: 'gap-4',\n xl: 'gap-6',\n }[gap];\n return <div className={cn('flex flex-col', gapClass, className)} {...props} />;\n};\n\nexport interface GridProps extends React.HTMLAttributes<HTMLDivElement> {\n cols?: 1 | 2 | 3 | 4;\n gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** Empilha colunas em telas pequenas. Padrão: true. */\n responsive?: boolean;\n}\n\nexport const Grid: React.FC<GridProps> = ({\n cols = 2,\n gap = 'md',\n responsive = true,\n className,\n ...props\n}) => {\n const colsClass = {\n 1: 'grid-cols-1',\n 2: responsive ? 'grid-cols-1 sm:grid-cols-2' : 'grid-cols-2',\n 3: responsive ? 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3' : 'grid-cols-3',\n 4: responsive ? 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-4' : 'grid-cols-4',\n }[cols];\n const gapClass = {\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-3',\n lg: 'gap-4',\n xl: 'gap-6',\n }[gap];\n return <div className={cn('grid', colsClass, gapClass, className)} {...props} />;\n};\n"],"names":["Container","size","className","props","sizeClass","jsx","cn","Stack","gap","gapClass","Grid","cols","responsive","colsClass"],"mappings":";;AAOO,MAAMA,IAAsC,CAAC,EAAE,MAAAC,IAAO,MAAM,WAAAC,GAAW,GAAGC,QAAY;AAC3F,QAAMC,IAAY;AAAA,IAChB,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,MAAM;AAAA,EAAA,EACNH,CAAI;AACN,SAAO,gBAAAI,EAAC,SAAI,WAAWC,EAAG,uBAAuBF,GAAWF,CAAS,GAAI,GAAGC,GAAO;AACrF,GAMaI,IAA8B,CAAC,EAAE,KAAAC,IAAM,MAAM,WAAAN,GAAW,GAAGC,QAAY;AAClF,QAAMM,IAAW;AAAA,IACf,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,EACJD,CAAG;AACL,SAAO,gBAAAH,EAAC,SAAI,WAAWC,EAAG,iBAAiBG,GAAUP,CAAS,GAAI,GAAGC,GAAO;AAC9E,GASaO,IAA4B,CAAC;AAAA,EACxC,MAAAC,IAAO;AAAA,EACP,KAAAH,IAAM;AAAA,EACN,YAAAI,IAAa;AAAA,EACb,WAAAV;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMU,IAAY;AAAA,IAChB,GAAG;AAAA,IACH,GAAGD,IAAa,+BAA+B;AAAA,IAC/C,GAAGA,IAAa,8CAA8C;AAAA,IAC9D,GAAGA,IAAa,8CAA8C;AAAA,EAAA,EAC9DD,CAAI,GACAF,IAAW;AAAA,IACf,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA,EACJD,CAAG;AACL,SAAO,gBAAAH,EAAC,OAAA,EAAI,WAAWC,EAAG,QAAQO,GAAWJ,GAAUP,CAAS,GAAI,GAAGC,EAAA,CAAO;AAChF;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export type LogoVariant = 'sbk' | 'sbk-ia';
|
|
3
|
+
/**
|
|
4
|
+
* - `auto`: cor de título do tema atual (verde escuro no claro, branco no escuro)
|
|
5
|
+
* - `dark`: Verde Escuro, para fundos claros
|
|
6
|
+
* - `white`: para fundos escuros
|
|
7
|
+
* - `black`: monocromática
|
|
8
|
+
*/
|
|
9
|
+
export type LogoColor = 'auto' | 'dark' | 'white' | 'black';
|
|
10
|
+
export interface LogoProps extends Omit<React.SVGAttributes<SVGSVGElement>, 'color'> {
|
|
11
|
+
/** Reserva a zona de respiro do brand book (espaço livre igual à altura do símbolo). */
|
|
12
|
+
clearSpace?: boolean;
|
|
13
|
+
color?: LogoColor;
|
|
14
|
+
/** Altura em px. A largura acompanha a proporção oficial. */
|
|
15
|
+
height?: number;
|
|
16
|
+
/** Nome acessível. Padrão: "SBK" ou "SBK IA". */
|
|
17
|
+
title?: string;
|
|
18
|
+
variant?: LogoVariant;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Logo oficial SBK / SBK IA a partir dos SVGs do time de marca.
|
|
22
|
+
* Não aplica sombras, gradientes, distorção ou rotação (usos indevidos do brand book).
|
|
23
|
+
*/
|
|
24
|
+
export declare const Logo: {
|
|
25
|
+
({ variant, color, height, clearSpace, title, className, style, ...props }: LogoProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
};
|