@toski-labs/ds 0.3.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.
- package/CHANGELOG.md +77 -0
- package/LICENSE +21 -0
- package/README.en.md +92 -0
- package/README.md +105 -0
- package/assets/bolinha-claro.svg +5 -0
- package/assets/bolinha-escuro.svg +5 -0
- package/assets/icone-caramelo-colorido.svg +12 -0
- package/assets/icone-caramelo-escuro.svg +12 -0
- package/assets/icone-caramelo.svg +12 -0
- package/assets/icone-focinho.svg +12 -0
- package/assets/icone-papel.svg +12 -0
- package/assets/pacoca-bolinha-chao-claro.svg +13 -0
- package/assets/pacoca-bolinha-chao-escuro.svg +13 -0
- package/assets/pacoca-bolinha-claro.svg +13 -0
- package/assets/pacoca-bolinha-escuro.svg +13 -0
- package/assets/pacoca-sem-bolinha-claro.svg +7 -0
- package/assets/pacoca-sem-bolinha-escuro.svg +7 -0
- package/build/css/theme.css +56 -0
- package/build/css/tokens.css +139 -0
- package/build/json/app-tokens.json +364 -0
- package/build/json/mobile.json +500 -0
- package/build/json/web.json +233 -0
- package/build/swift/ToskiColors.swift +272 -0
- package/build/swift/ToskiTokens.swift +192 -0
- package/dist/components/AppIcon.d.ts +11 -0
- package/dist/components/Button.d.ts +24 -0
- package/dist/components/Card.d.ts +10 -0
- package/dist/components/CheckList.d.ts +10 -0
- package/dist/components/Icon.d.ts +19 -0
- package/dist/components/IconBox.d.ts +14 -0
- package/dist/components/Kicker.d.ts +7 -0
- package/dist/components/Mascot.d.ts +21 -0
- package/dist/components/Pill.d.ts +11 -0
- package/dist/components/SectionHeading.d.ts +12 -0
- package/dist/generated/icons.d.ts +652 -0
- package/dist/generated/tokens.d.ts +140 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +1019 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/cx.d.ts +2 -0
- package/icons/icons.json +253 -0
- package/icons/svg/ajuda.svg +3 -0
- package/icons/svg/ajustes.svg +3 -0
- package/icons/svg/alerta.svg +3 -0
- package/icons/svg/arquivo.svg +3 -0
- package/icons/svg/arrow-down.svg +3 -0
- package/icons/svg/arrow-right.svg +3 -0
- package/icons/svg/arrow-up.svg +3 -0
- package/icons/svg/baixar.svg +3 -0
- package/icons/svg/banho.svg +3 -0
- package/icons/svg/bug.svg +3 -0
- package/icons/svg/busca.svg +3 -0
- package/icons/svg/cachorro.svg +3 -0
- package/icons/svg/cadeado.svg +3 -0
- package/icons/svg/calendario-exportar.svg +3 -0
- package/icons/svg/calendario-ponto.svg +3 -0
- package/icons/svg/calendario.svg +3 -0
- package/icons/svg/camera.svg +3 -0
- package/icons/svg/celular.svg +3 -0
- package/icons/svg/check.svg +3 -0
- package/icons/svg/chevron-baixo.svg +3 -0
- package/icons/svg/chevron-direita.svg +3 -0
- package/icons/svg/chevron-esquerda.svg +3 -0
- package/icons/svg/chip.svg +3 -0
- package/icons/svg/compartilhar.svg +3 -0
- package/icons/svg/contato.svg +3 -0
- package/icons/svg/copiar.svg +3 -0
- package/icons/svg/coracao.svg +3 -0
- package/icons/svg/documento-linhas.svg +3 -0
- package/icons/svg/documento-riscado.svg +3 -0
- package/icons/svg/documento.svg +3 -0
- package/icons/svg/editar.svg +3 -0
- package/icons/svg/estrela.svg +3 -0
- package/icons/svg/fechar.svg +3 -0
- package/icons/svg/filtro.svg +3 -0
- package/icons/svg/flask.svg +3 -0
- package/icons/svg/gato.svg +3 -0
- package/icons/svg/globo.svg +3 -0
- package/icons/svg/info.svg +3 -0
- package/icons/svg/inicio.svg +3 -0
- package/icons/svg/lembrete-desligado.svg +3 -0
- package/icons/svg/lembrete.svg +3 -0
- package/icons/svg/link-externo.svg +3 -0
- package/icons/svg/list.svg +3 -0
- package/icons/svg/local.svg +3 -0
- package/icons/svg/mail.svg +3 -0
- package/icons/svg/mais-opcoes.svg +5 -0
- package/icons/svg/mais.svg +3 -0
- package/icons/svg/mensagem.svg +3 -0
- package/icons/svg/neve.svg +3 -0
- package/icons/svg/peso.svg +3 -0
- package/icons/svg/pessoas.svg +3 -0
- package/icons/svg/pets.svg +3 -0
- package/icons/svg/plano.svg +3 -0
- package/icons/svg/proximo.svg +3 -0
- package/icons/svg/racao.svg +3 -0
- package/icons/svg/recibo.svg +3 -0
- package/icons/svg/relogio.svg +3 -0
- package/icons/svg/remedio.svg +3 -0
- package/icons/svg/repetir.svg +3 -0
- package/icons/svg/spinner.svg +3 -0
- package/icons/svg/tema.svg +3 -0
- package/icons/svg/tosa.svg +3 -0
- package/icons/svg/vacina.svg +3 -0
- package/icons/svg/vet.svg +3 -0
- package/package.json +104 -0
- package/styles/tailwind.css +72 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface AppIconProps {
|
|
2
|
+
/** Lado em px. Padrão 36. */
|
|
3
|
+
size?: number;
|
|
4
|
+
/** Costura da bolinha. Padrão true. */
|
|
5
|
+
withBall?: boolean;
|
|
6
|
+
/** Texto para leitores de tela. Sem ele o ícone é decorativo. */
|
|
7
|
+
label?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Ícone da marca (caramelo), igual ao favicon e ao ícone do app. Mesmas cores nos dois temas. */
|
|
11
|
+
export declare function AppIcon({ size, withBall, label, className }: AppIconProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { type IconName } from './Icon';
|
|
3
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'light';
|
|
4
|
+
export type ButtonSize = 'lg' | 'md';
|
|
5
|
+
interface BaseProps {
|
|
6
|
+
/** primary = destaque · secondary = superfície com borda · light = superfície sem borda */
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
/** lg = 54px · md = 48px (raio 14) */
|
|
9
|
+
size?: ButtonSize;
|
|
10
|
+
/** Ícone depois do texto. */
|
|
11
|
+
icon?: IconName;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
type AsLink = BaseProps & AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
15
|
+
href: string;
|
|
16
|
+
};
|
|
17
|
+
type AsButton = BaseProps & ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
18
|
+
href?: undefined;
|
|
19
|
+
};
|
|
20
|
+
export type ButtonProps = AsLink | AsButton;
|
|
21
|
+
export declare function buttonClasses(variant?: ButtonVariant, size?: ButtonSize, className?: string): string;
|
|
22
|
+
/** Botão ou link com cara de botão (quando recebe href). Altura mínima 48px: passa a área de toque de 44px. */
|
|
23
|
+
export declare function Button(props: ButtonProps): import("react").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export type CardVariant = 'surface' | 'plain' | 'hero' | 'dashed';
|
|
3
|
+
export interface CardProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/** surface = superfície com borda · plain = sem borda · hero = fundo da Paçoca · dashed = tracejado */
|
|
5
|
+
variant?: CardVariant;
|
|
6
|
+
/** card = raio 18 · panel = raio 28 */
|
|
7
|
+
radius?: 'card' | 'panel';
|
|
8
|
+
as?: 'div' | 'article' | 'section' | 'li' | 'aside';
|
|
9
|
+
}
|
|
10
|
+
export declare function Card({ variant, radius, as, className, ...rest }: CardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface CheckListProps {
|
|
3
|
+
items: ReactNode[];
|
|
4
|
+
/** success = verde (grátis) · accent = destaque (Plus, PDF) */
|
|
5
|
+
tone?: 'success' | 'accent';
|
|
6
|
+
/** Em duas ou mais colunas quando houver espaço. */
|
|
7
|
+
columns?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function CheckList({ items, tone, columns, className }: CheckListProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
import { iconData } from '../generated/icons';
|
|
3
|
+
/**
|
|
4
|
+
* Ícones de traço 24×24 (cor = currentColor). Desenhos em icons/svg/, os mesmos do app iOS.
|
|
5
|
+
* Nome em inglês na web; `iconData[nome].mobile` é o nome no app (ex.: calendar → calendario).
|
|
6
|
+
*/
|
|
7
|
+
export { iconData };
|
|
8
|
+
export type IconName = keyof typeof iconData;
|
|
9
|
+
export declare const iconNames: IconName[];
|
|
10
|
+
export interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'name' | 'stroke'> {
|
|
11
|
+
name: IconName;
|
|
12
|
+
/** Lado em px. Padrão 24. O tamanho do canvas está em iconData[name].size. */
|
|
13
|
+
size?: number;
|
|
14
|
+
/** Espessura do traço. Padrão 1,8. O traço do canvas está em iconData[name].stroke. */
|
|
15
|
+
stroke?: number;
|
|
16
|
+
/** Texto para leitores de tela. Sem ele o ícone é decorativo (aria-hidden). */
|
|
17
|
+
label?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function Icon({ name, size, stroke, label, className, ...rest }: IconProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type IconName } from './Icon';
|
|
2
|
+
export interface IconBoxProps {
|
|
3
|
+
name: IconName;
|
|
4
|
+
/** md = 48px (raio 12) · lg = 88px (raio 20) */
|
|
5
|
+
size?: 'md' | 'lg';
|
|
6
|
+
/** Fundo da caixa: tint (padrão) ou surface (quando o card já é tint/hero). */
|
|
7
|
+
on?: 'tint' | 'surface';
|
|
8
|
+
/** Cor do ícone. */
|
|
9
|
+
tone?: 'accent' | 'muted';
|
|
10
|
+
/** Texto para leitores de tela. Sem ele a caixa é decorativa. */
|
|
11
|
+
label?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function IconBox({ name, size, on, tone, label, className }: IconBoxProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export interface KickerProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
tone?: 'accent' | 'muted';
|
|
4
|
+
as?: 'p' | 'span' | 'div';
|
|
5
|
+
}
|
|
6
|
+
/** Rótulo de seção: 13px, 600, caixa alta, espaçado. */
|
|
7
|
+
export declare function Kicker({ tone, as: Tag, className, ...rest }: KickerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Desenho da Paçoca (viewBox -6 -6 222 212). Usado pelo Mascot e pelo AppIcon. */
|
|
2
|
+
export declare const mascotPaths: {
|
|
3
|
+
readonly body: "M26 90 C26 84 32 80 40 79 L74 72 C82 70 86 62 94 56 C104 48 124 46 140 52 C158 58 166 76 168 96 C172 120 182 150 196 200 L72 200 C66 190 74 184 68 176 C62 168 72 162 68 154 C64 146 74 140 74 132 C70 126 64 122 58 118 C48 114 38 110 32 104 C27 100 25 95 26 90 Z";
|
|
4
|
+
readonly ear: "M112 64 C128 56 148 62 150 78 C154 98 150 116 140 126 C136 132 128 132 124 126 C120 120 122 114 118 110 C112 96 104 78 112 64 Z";
|
|
5
|
+
readonly seam: "M24 156 Q36 168 24 180 M44 156 Q32 168 44 180";
|
|
6
|
+
readonly seamGround: "M-26 180 Q-16 190 -26 200 M-10 180 Q-20 190 -10 200";
|
|
7
|
+
};
|
|
8
|
+
export interface MascotProps {
|
|
9
|
+
/** Largura (px ou CSS). Padrão 100%. */
|
|
10
|
+
width?: number | string;
|
|
11
|
+
/**
|
|
12
|
+
* bounce = bolinha pulando (1,8 s; parada com "reduzir movimento") · still = parada ·
|
|
13
|
+
* ground = caída no chão, menor e apagada (erro / 404) · none = sem bolinha
|
|
14
|
+
*/
|
|
15
|
+
ball?: 'bounce' | 'still' | 'ground' | 'none';
|
|
16
|
+
/** Texto para leitores de tela. Sem ele a mascote é decorativa. */
|
|
17
|
+
label?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Paçoca, a mascote da Toski Labs. */
|
|
21
|
+
export declare function Mascot({ width, ball, label, className }: MascotProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export type PillVariant = 'status' | 'outline' | 'tag' | 'plus';
|
|
3
|
+
export interface PillProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
/**
|
|
5
|
+
* status = fundo tint com bolinha de destaque ("Em desenvolvimento") ·
|
|
6
|
+
* outline = só borda ("iPhone · iOS 18+") · tag = etiqueta de recurso · plus = etiqueta PLUS
|
|
7
|
+
*/
|
|
8
|
+
variant?: PillVariant;
|
|
9
|
+
}
|
|
10
|
+
/** Etiqueta não interativa. */
|
|
11
|
+
export declare function Pill({ variant, className, children, ...rest }: PillProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface SectionHeadingProps {
|
|
3
|
+
kicker?: ReactNode;
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
lead?: ReactNode;
|
|
6
|
+
id?: string;
|
|
7
|
+
/** h1 no topo da página, h2 nas seções, h3 dentro de seções. */
|
|
8
|
+
as?: 'h1' | 'h2' | 'h3';
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Rótulo + título + texto de apoio. */
|
|
12
|
+
export declare function SectionHeading({ kicker, title, lead, id, as: Tag, className }: SectionHeadingProps): import("react").JSX.Element;
|