@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.
Files changed (107) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/LICENSE +21 -0
  3. package/README.en.md +92 -0
  4. package/README.md +105 -0
  5. package/assets/bolinha-claro.svg +5 -0
  6. package/assets/bolinha-escuro.svg +5 -0
  7. package/assets/icone-caramelo-colorido.svg +12 -0
  8. package/assets/icone-caramelo-escuro.svg +12 -0
  9. package/assets/icone-caramelo.svg +12 -0
  10. package/assets/icone-focinho.svg +12 -0
  11. package/assets/icone-papel.svg +12 -0
  12. package/assets/pacoca-bolinha-chao-claro.svg +13 -0
  13. package/assets/pacoca-bolinha-chao-escuro.svg +13 -0
  14. package/assets/pacoca-bolinha-claro.svg +13 -0
  15. package/assets/pacoca-bolinha-escuro.svg +13 -0
  16. package/assets/pacoca-sem-bolinha-claro.svg +7 -0
  17. package/assets/pacoca-sem-bolinha-escuro.svg +7 -0
  18. package/build/css/theme.css +56 -0
  19. package/build/css/tokens.css +139 -0
  20. package/build/json/app-tokens.json +364 -0
  21. package/build/json/mobile.json +500 -0
  22. package/build/json/web.json +233 -0
  23. package/build/swift/ToskiColors.swift +272 -0
  24. package/build/swift/ToskiTokens.swift +192 -0
  25. package/dist/components/AppIcon.d.ts +11 -0
  26. package/dist/components/Button.d.ts +24 -0
  27. package/dist/components/Card.d.ts +10 -0
  28. package/dist/components/CheckList.d.ts +10 -0
  29. package/dist/components/Icon.d.ts +19 -0
  30. package/dist/components/IconBox.d.ts +14 -0
  31. package/dist/components/Kicker.d.ts +7 -0
  32. package/dist/components/Mascot.d.ts +21 -0
  33. package/dist/components/Pill.d.ts +11 -0
  34. package/dist/components/SectionHeading.d.ts +12 -0
  35. package/dist/generated/icons.d.ts +652 -0
  36. package/dist/generated/tokens.d.ts +140 -0
  37. package/dist/index.d.ts +11 -0
  38. package/dist/index.js +1019 -0
  39. package/dist/index.js.map +1 -0
  40. package/dist/utils/cx.d.ts +2 -0
  41. package/icons/icons.json +253 -0
  42. package/icons/svg/ajuda.svg +3 -0
  43. package/icons/svg/ajustes.svg +3 -0
  44. package/icons/svg/alerta.svg +3 -0
  45. package/icons/svg/arquivo.svg +3 -0
  46. package/icons/svg/arrow-down.svg +3 -0
  47. package/icons/svg/arrow-right.svg +3 -0
  48. package/icons/svg/arrow-up.svg +3 -0
  49. package/icons/svg/baixar.svg +3 -0
  50. package/icons/svg/banho.svg +3 -0
  51. package/icons/svg/bug.svg +3 -0
  52. package/icons/svg/busca.svg +3 -0
  53. package/icons/svg/cachorro.svg +3 -0
  54. package/icons/svg/cadeado.svg +3 -0
  55. package/icons/svg/calendario-exportar.svg +3 -0
  56. package/icons/svg/calendario-ponto.svg +3 -0
  57. package/icons/svg/calendario.svg +3 -0
  58. package/icons/svg/camera.svg +3 -0
  59. package/icons/svg/celular.svg +3 -0
  60. package/icons/svg/check.svg +3 -0
  61. package/icons/svg/chevron-baixo.svg +3 -0
  62. package/icons/svg/chevron-direita.svg +3 -0
  63. package/icons/svg/chevron-esquerda.svg +3 -0
  64. package/icons/svg/chip.svg +3 -0
  65. package/icons/svg/compartilhar.svg +3 -0
  66. package/icons/svg/contato.svg +3 -0
  67. package/icons/svg/copiar.svg +3 -0
  68. package/icons/svg/coracao.svg +3 -0
  69. package/icons/svg/documento-linhas.svg +3 -0
  70. package/icons/svg/documento-riscado.svg +3 -0
  71. package/icons/svg/documento.svg +3 -0
  72. package/icons/svg/editar.svg +3 -0
  73. package/icons/svg/estrela.svg +3 -0
  74. package/icons/svg/fechar.svg +3 -0
  75. package/icons/svg/filtro.svg +3 -0
  76. package/icons/svg/flask.svg +3 -0
  77. package/icons/svg/gato.svg +3 -0
  78. package/icons/svg/globo.svg +3 -0
  79. package/icons/svg/info.svg +3 -0
  80. package/icons/svg/inicio.svg +3 -0
  81. package/icons/svg/lembrete-desligado.svg +3 -0
  82. package/icons/svg/lembrete.svg +3 -0
  83. package/icons/svg/link-externo.svg +3 -0
  84. package/icons/svg/list.svg +3 -0
  85. package/icons/svg/local.svg +3 -0
  86. package/icons/svg/mail.svg +3 -0
  87. package/icons/svg/mais-opcoes.svg +5 -0
  88. package/icons/svg/mais.svg +3 -0
  89. package/icons/svg/mensagem.svg +3 -0
  90. package/icons/svg/neve.svg +3 -0
  91. package/icons/svg/peso.svg +3 -0
  92. package/icons/svg/pessoas.svg +3 -0
  93. package/icons/svg/pets.svg +3 -0
  94. package/icons/svg/plano.svg +3 -0
  95. package/icons/svg/proximo.svg +3 -0
  96. package/icons/svg/racao.svg +3 -0
  97. package/icons/svg/recibo.svg +3 -0
  98. package/icons/svg/relogio.svg +3 -0
  99. package/icons/svg/remedio.svg +3 -0
  100. package/icons/svg/repetir.svg +3 -0
  101. package/icons/svg/spinner.svg +3 -0
  102. package/icons/svg/tema.svg +3 -0
  103. package/icons/svg/tosa.svg +3 -0
  104. package/icons/svg/vacina.svg +3 -0
  105. package/icons/svg/vet.svg +3 -0
  106. package/package.json +104 -0
  107. package/styles/tailwind.css +72 -0
@@ -0,0 +1,233 @@
1
+ {
2
+ "$description": "Gerado por scripts/build-tokens.ts a partir de tokens/tokens.json. Não edite à mão. Plataforma: web.",
3
+ "brand": {
4
+ "caramelo": "#DB9A5B",
5
+ "ferrugem": "#A9541F",
6
+ "creme": "#F4E4CC",
7
+ "papel": "#F7F1E8",
8
+ "carvao": "#231B17"
9
+ },
10
+ "light": {
11
+ "background": "#F7F1E8",
12
+ "surface": "#FFFFFF",
13
+ "tint": "#F3E4CF",
14
+ "hero": "#EFDCC2",
15
+ "ink": "#231B17",
16
+ "muted": "#6B5648",
17
+ "line": "#E6D8C4",
18
+ "accent": "#A9541F",
19
+ "accent-hover": "#7E3C14",
20
+ "on-accent": "#FFF8EE",
21
+ "critical": "#A3341A",
22
+ "critical-bg": "#F8E0D4",
23
+ "critical-line": "#EBC0AA",
24
+ "success": "#3F6E3B",
25
+ "success-bg": "#E4EEDC",
26
+ "segment": "#FFFFFF",
27
+ "tabbar": "#FFFDF9",
28
+ "tab-idle": "#7D6858",
29
+ "mascot-outline": "transparent",
30
+ "mascot-nose": "#231B17",
31
+ "accent-text": "#94481A",
32
+ "link": "#94481A",
33
+ "ball-outline": "#EFDCC2",
34
+ "phone-ring": "transparent",
35
+ "footer": "#231B17",
36
+ "footer-ink": "#F7F1E8",
37
+ "footer-muted": "#C2AE98",
38
+ "footer-line": "#43352B"
39
+ },
40
+ "dark": {
41
+ "background": "#231B17",
42
+ "surface": "#2E241D",
43
+ "tint": "#3A2D23",
44
+ "hero": "#33271F",
45
+ "ink": "#F7F1E8",
46
+ "muted": "#C2AE98",
47
+ "line": "#43352B",
48
+ "accent": "#DB9A5B",
49
+ "accent-hover": "#E8B27C",
50
+ "on-accent": "#231B17",
51
+ "critical": "#F09A78",
52
+ "critical-bg": "#45261A",
53
+ "critical-line": "#6A3A26",
54
+ "success": "#9CC48F",
55
+ "success-bg": "#2C3A27",
56
+ "segment": "#4A3A2E",
57
+ "tabbar": "#1B1511",
58
+ "tab-idle": "#A08B78",
59
+ "mascot-outline": "#F4E4CC",
60
+ "mascot-nose": "#100C0A",
61
+ "accent-text": "#DB9A5B",
62
+ "link": "#E8B27C",
63
+ "ball-outline": "#F4E4CC",
64
+ "phone-ring": "#43352B",
65
+ "footer": "#1B1511",
66
+ "footer-ink": "#F7F1E8",
67
+ "footer-muted": "#C2AE98",
68
+ "footer-line": "#43352B"
69
+ },
70
+ "font": {
71
+ "family": "Outfit",
72
+ "stack": [
73
+ "Outfit Variable",
74
+ "Outfit",
75
+ "system-ui",
76
+ "sans-serif"
77
+ ],
78
+ "weights": {
79
+ "regular": 400,
80
+ "medium": 500,
81
+ "semibold": 600,
82
+ "bold": 700
83
+ }
84
+ },
85
+ "radius": {
86
+ "icon": 12,
87
+ "button": 14,
88
+ "card": 18,
89
+ "panel": 28
90
+ },
91
+ "layout": {
92
+ "container": 1168,
93
+ "gutter": 24
94
+ },
95
+ "motion": {
96
+ "curve": {
97
+ "easeInOut": [
98
+ 0.42,
99
+ 0,
100
+ 0.58,
101
+ 1
102
+ ],
103
+ "easeOut": [
104
+ 0,
105
+ 0,
106
+ 0.58,
107
+ 1
108
+ ]
109
+ },
110
+ "ball": {
111
+ "keyframes": [
112
+ 0,
113
+ 0.45,
114
+ 0.6,
115
+ 1
116
+ ],
117
+ "viewBoxWidth": 222,
118
+ "slow": {
119
+ "duration": 1.8,
120
+ "rise": 14
121
+ },
122
+ "fast": {
123
+ "duration": 1.2,
124
+ "rise": 16
125
+ }
126
+ },
127
+ "dots": {
128
+ "duration": 1.2,
129
+ "delays": [
130
+ 0,
131
+ 0.2,
132
+ 0.4
133
+ ],
134
+ "keyframes": [
135
+ 0,
136
+ 0.4,
137
+ 0.8,
138
+ 1
139
+ ],
140
+ "low": 0.25,
141
+ "high": 1
142
+ },
143
+ "spinner": {
144
+ "duration": 0.9
145
+ },
146
+ "panel": {
147
+ "duration": 0.3,
148
+ "reducedDuration": 0.2,
149
+ "dragReturnDuration": 0.2
150
+ },
151
+ "toast": {
152
+ "enterDuration": 0.25,
153
+ "curve": "easeOut",
154
+ "slide": 16,
155
+ "reducedDuration": 0.2,
156
+ "visible": {
157
+ "withoutAction": 4,
158
+ "withAction": 6,
159
+ "voiceOver": 10
160
+ }
161
+ },
162
+ "interaction": {
163
+ "pressedOpacity": 0.7,
164
+ "disabledOpacity": 0.5
165
+ }
166
+ },
167
+ "icons": [
168
+ "help",
169
+ "settings",
170
+ "alert",
171
+ "archive",
172
+ "download",
173
+ "bath",
174
+ "bug",
175
+ "search",
176
+ "dog",
177
+ "lock",
178
+ "calendar-export",
179
+ "calendar-dot",
180
+ "calendar",
181
+ "camera",
182
+ "phone",
183
+ "check",
184
+ "chevron-down",
185
+ "chevron-right",
186
+ "chevron-left",
187
+ "microchip",
188
+ "share",
189
+ "contact",
190
+ "copy",
191
+ "heart",
192
+ "document-lines",
193
+ "document-off",
194
+ "document",
195
+ "edit",
196
+ "star",
197
+ "close",
198
+ "filter",
199
+ "cat",
200
+ "globe",
201
+ "info",
202
+ "home",
203
+ "bell-off",
204
+ "bell",
205
+ "external-link",
206
+ "location",
207
+ "more",
208
+ "plus",
209
+ "message",
210
+ "snow",
211
+ "weight",
212
+ "people",
213
+ "paw",
214
+ "plan",
215
+ "next",
216
+ "food",
217
+ "receipt",
218
+ "clock",
219
+ "medicine",
220
+ "repeat",
221
+ "spinner",
222
+ "theme",
223
+ "grooming",
224
+ "vaccine",
225
+ "vet",
226
+ "arrow-down",
227
+ "arrow-up",
228
+ "arrow-right",
229
+ "flask",
230
+ "list",
231
+ "mail"
232
+ ]
233
+ }
@@ -0,0 +1,272 @@
1
+ // ToskiColors.swift
2
+ // Gerado por scripts/build-tokens.ts a partir de tokens/tokens.json. Não edite à mão.
3
+ // Plataforma: mobile (iOS). Nomes iguais aos do app.
4
+ //
5
+ // Uso: Text("Olá").foregroundStyle(ToskiColors.textPrimary)
6
+ // As cores semânticas mudam sozinhas entre claro e escuro. Não depende de Asset Catalog.
7
+
8
+ import SwiftUI
9
+ #if canImport(UIKit)
10
+ import UIKit
11
+ #elseif canImport(AppKit)
12
+ import AppKit
13
+ #endif
14
+
15
+ public enum ToskiColors {
16
+ // MARK: Marca (iguais nos dois temas)
17
+
18
+ /// Pelo da Paçoca. Destaque no escuro.
19
+ public static let caramelo = fixed(0xDB9A5B)
20
+ /// Destaque no claro.
21
+ public static let ferrugem = fixed(0xA9541F)
22
+ /// Contornos e detalhes da mascote.
23
+ public static let creme = fixed(0xF4E4CC)
24
+ /// Fundo claro.
25
+ public static let papel = fixed(0xF7F1E8)
26
+ /// Texto no claro e fundo no escuro.
27
+ public static let carvao = fixed(0x231B17)
28
+
29
+ // MARK: Semânticas — compartilhadas com a web
30
+
31
+ /// Fundo das telas
32
+ public static let background = dynamic(light: 0xF7F1E8, dark: 0x231B17)
33
+ /// Cards, listas, campos
34
+ public static let surface = dynamic(light: 0xFFFFFF, dark: 0x2E241D)
35
+ /// Fundos suaves, caixas de ícone, chips
36
+ public static let tint = dynamic(light: 0xF3E4CF, dark: 0x3A2D23)
37
+ /// Círculo atrás da Paçoca
38
+ public static let heroBackground = dynamic(light: 0xEFDCC2, dark: 0x33271F)
39
+ /// Texto principal
40
+ public static let textPrimary = dynamic(light: 0x231B17, dark: 0xF7F1E8)
41
+ /// Texto de apoio, rótulos
42
+ public static let textSecondary = dynamic(light: 0x6B5648, dark: 0xC2AE98)
43
+ /// Bordas e divisores
44
+ public static let border = dynamic(light: 0xE6D8C4, dark: 0x43352B)
45
+ /// Botão principal, aba ativa, links
46
+ public static let accent = dynamic(light: 0xA9541F, dark: 0xDB9A5B)
47
+ /// Ferrugem escura (no escuro, caramelo claro): botão de texto da tela Erro, links ao passar o mouse
48
+ public static let accentDeep = dynamic(light: 0x7E3C14, dark: 0xE8B27C)
49
+ /// Texto sobre o destaque
50
+ public static let onAccent = dynamic(light: 0xFFF8EE, dark: 0x231B17)
51
+ /// Atrasados, alertas, ações destrutivas
52
+ public static let critical = dynamic(light: 0xA3341A, dark: 0xF09A78)
53
+ /// Fundo de alertas
54
+ public static let criticalBackground = dynamic(light: 0xF8E0D4, dark: 0x45261A)
55
+ /// Borda de cards atrasados
56
+ public static let criticalBorder = dynamic(light: 0xEBC0AA, dark: 0x6A3A26)
57
+ /// Em dia, concluído
58
+ public static let success = dynamic(light: 0x3F6E3B, dark: 0x9CC48F)
59
+ /// Fundo de status positivo
60
+ public static let successBackground = dynamic(light: 0xE4EEDC, dark: 0x2C3A27)
61
+ /// Opção selecionada do controle segmentado
62
+ public static let segmentSelected = dynamic(light: 0xFFFFFF, dark: 0x4A3A2E)
63
+ /// Barra de abas
64
+ public static let tabBar = dynamic(light: 0xFFFDF9, dark: 0x1B1511)
65
+ /// Aba inativa
66
+ public static let tabIdle = dynamic(light: 0x7D6858, dark: 0xA08B78)
67
+ /// Contorno do corpo da Paçoca
68
+ public static let mascotOutline = dynamic(light: 0x000000, lightAlpha: 0, dark: 0xF4E4CC, darkAlpha: 1)
69
+ /// Focinho da Paçoca
70
+ public static let mascotNose = dynamic(light: 0x231B17, dark: 0x100C0A)
71
+
72
+ // MARK: Semânticas — só do app
73
+
74
+ /// Texto sobre crítico
75
+ public static let onCritical = dynamic(light: 0xFFF8EE, dark: 0x231B17)
76
+ /// Interruptor desligado
77
+ public static let switchOff = dynamic(light: 0xDCCDB9, dark: 0x5A4A3D)
78
+ /// Fundo do toast (invertido)
79
+ public static let toastBackground = dynamic(light: 0x231B17, dark: 0xF7F1E8)
80
+ /// Texto do toast
81
+ public static let toastText = dynamic(light: 0xF7F1E8, dark: 0x231B17)
82
+ /// Ação do toast (Desfazer, Abrir)
83
+ public static let toastAction = dynamic(light: 0xE8B27C, dark: 0xA9541F)
84
+ /// Fundo atrás de painéis
85
+ public static let scrim = dynamic(light: 0x140E0A, lightAlpha: 0.45, dark: 0x140E0A, darkAlpha: 0.45)
86
+ /// Contorno e costura da bolinha
87
+ public static let ballOutline = dynamic(light: 0xF7F1E8, dark: 0xF4E4CC)
88
+ /// Texto e elementos apagados (dia fora do mês, texto miúdo do PDF)
89
+ public static let faint = dynamic(light: 0xB3A190, dark: 0x6E5D50)
90
+ /// Linhas finas internas (grade do gráfico, linhas do PDF)
91
+ public static let divider = dynamic(light: 0xEDE3D6, dark: 0x43352B)
92
+ /// Borda mais forte (botão do Google no login)
93
+ public static let borderStrong = dynamic(light: 0xDCCDB9, dark: 0x5A4A3D)
94
+ /// Barra do valor antigo (troca de ração)
95
+ public static let barInactive = dynamic(light: 0xDCCDB9, dark: 0x6E5D50)
96
+ /// Cartão de destaque (plano de saúde, Fase 2)
97
+ public static let featureCard = dynamic(light: 0xA9541F, dark: 0x7E3C14)
98
+ /// Texto sobre o cartão de destaque
99
+ public static let onFeatureCard = dynamic(light: 0xFFF8EE, dark: 0xFFF8EE)
100
+ /// Caixa translúcida sobre o destaque
101
+ public static let onAccentSubtle = dynamic(light: 0xFFF8EE, lightAlpha: 0.18, dark: 0xFFF8EE, darkAlpha: 0.18)
102
+ /// Fundo do cadeado (recurso do Plus, pet congelado)
103
+ public static let lockBackground = dynamic(light: 0xDB9A5B, dark: 0x3A2D23)
104
+ /// Ícone do cadeado
105
+ public static let onLock = dynamic(light: 0xFFF8EE, dark: 0xF7F1E8)
106
+ /// Fundo do alerta do sistema (ex.: desconectar calendário)
107
+ public static let alertBackground = dynamic(light: 0xF7F1E8, dark: 0x3A2D23)
108
+ /// Fundo do aviso de notificação
109
+ public static let bannerBackground = dynamic(light: 0xFFFDF9, lightAlpha: 0.92, dark: 0x2E241D, darkAlpha: 0.92)
110
+ /// Fundo atrás da prévia do PDF
111
+ public static let previewBackdrop = dynamic(light: 0xEDE3D6, dark: 0x1B1511)
112
+ /// Cartões das miniaturas de tema (Aparência)
113
+ public static let themePreviewCard = dynamic(light: 0xA9541F, lightAlpha: 0.35, dark: 0xA9541F, darkAlpha: 0.35)
114
+
115
+ // MARK: Pets
116
+
117
+ /// Cores dos avatares dos pets, na ordem de cadastro.
118
+ public static let petAvatars: [Color] = [fixed(0xDB9A5B), fixed(0x8FA07C), fixed(0xE2C79A), fixed(0xC9B8A6), fixed(0xB7C4D1), fixed(0xD8C0D6)]
119
+ /// Bolinhas do calendário por pet (visão Todos).
120
+ public static let petCalendarDots: [Color] = [
121
+ dynamic(light: 0xC27A3A, dark: 0xDB9A5B),
122
+ dynamic(light: 0x6F8A5C, dark: 0x9DB089)
123
+ ]
124
+ /// Inicial sobre o avatar.
125
+ public static let onPetAvatar = fixed(0x231B17)
126
+ /// Avatar da usuária (não é cor de pet).
127
+ public static let avatarUser = fixed(0xE8B27C)
128
+
129
+ // MARK: Black Friday (tema fixo da campanha)
130
+
131
+ public enum BlackFriday {
132
+ public static let background = ToskiColors.fixed(0x120D0A)
133
+ public static let surface = ToskiColors.fixed(0x2E241D)
134
+ public static let accent = ToskiColors.fixed(0xDB9A5B)
135
+ public static let text = ToskiColors.fixed(0xF7F1E8)
136
+ public static let textSecondary = ToskiColors.fixed(0xCDB9A3)
137
+ }
138
+
139
+ // MARK: Auxiliares
140
+
141
+ private static func components(_ hex: UInt32) -> (CGFloat, CGFloat, CGFloat) {
142
+ (CGFloat((hex >> 16) & 0xFF) / 255, CGFloat((hex >> 8) & 0xFF) / 255, CGFloat(hex & 0xFF) / 255)
143
+ }
144
+
145
+ fileprivate static func fixed(_ hex: UInt32, alpha: CGFloat = 1) -> Color {
146
+ let (r, g, b) = components(hex)
147
+ return Color(.sRGB, red: r, green: g, blue: b, opacity: alpha)
148
+ }
149
+
150
+ private static func dynamic(light: UInt32, lightAlpha: CGFloat = 1, dark: UInt32, darkAlpha: CGFloat = 1) -> Color {
151
+ #if canImport(UIKit)
152
+ return Color(UIColor { traits in
153
+ let isDark = traits.userInterfaceStyle == .dark
154
+ let (r, g, b) = components(isDark ? dark : light)
155
+ return UIColor(red: r, green: g, blue: b, alpha: isDark ? darkAlpha : lightAlpha)
156
+ })
157
+ #elseif canImport(AppKit)
158
+ return Color(NSColor(name: nil) { appearance in
159
+ let isDark = appearance.bestMatch(from: [.darkAqua, .aqua]) == .darkAqua
160
+ let (r, g, b) = components(isDark ? dark : light)
161
+ return NSColor(srgbRed: r, green: g, blue: b, alpha: isDark ? darkAlpha : lightAlpha)
162
+ })
163
+ #else
164
+ return fixed(light, alpha: lightAlpha)
165
+ #endif
166
+ }
167
+ }
168
+
169
+ public enum ToskiRadius {
170
+ /// Caixa de ícone
171
+ public static let iconBox: CGFloat = 12
172
+ /// Botões
173
+ public static let button: CGFloat = 14
174
+ /// Cards
175
+ public static let card: CGFloat = 18
176
+ /// Painéis, faixas e painel inferior
177
+ public static let sheet: CGFloat = 28
178
+ /// Caixa de seleção
179
+ public static let checkbox: CGFloat = 7
180
+ /// Amostra de cor
181
+ public static let swatch: CGFloat = 3
182
+ /// Página do PDF
183
+ public static let pdfPage: CGFloat = 4
184
+ /// Elementos pequenos
185
+ public static let small: CGFloat = 9
186
+ /// Botão de card
187
+ public static let buttonSmall: CGFloat = 12
188
+ /// Trilho do controle segmentado
189
+ public static let segmentTrack: CGFloat = 12
190
+ /// Campos
191
+ public static let input: CGFloat = 14
192
+ /// Tiles
193
+ public static let tile: CGFloat = 16
194
+ /// Aviso de notificação
195
+ public static let notification: CGFloat = 22
196
+ /// Ícone do app: raio 22 num lado de referência 96 (escala com o lado)
197
+ public static let appIconRadius: CGFloat = 22
198
+ public static let appIconSide: CGFloat = 96
199
+ /// Raio do ícone para um lado qualquer (proporcional ao de referência).
200
+ public static func appIcon(side: CGFloat) -> CGFloat { side * appIconRadius / appIconSide }
201
+ }
202
+
203
+ /// Valores do box-shadow do canvas (x = 0). Em SwiftUI o radius é blur / 2. Iguais no claro e no escuro.
204
+ public enum ToskiShadow {
205
+ public struct Style: Sendable {
206
+ public let y: CGFloat
207
+ public let blur: CGFloat
208
+ public let color: Color
209
+ public let opacity: Double
210
+ /// Raio para .shadow(color:radius:x:y:) do SwiftUI.
211
+ public var radius: CGFloat { blur / 2 }
212
+ }
213
+
214
+ public static let knob = Style(y: 1, blur: 3, color: ToskiColors.fixed(0x000000), opacity: 0.25)
215
+ public static let raised = Style(y: 1, blur: 3, color: ToskiColors.fixed(0x231B17), opacity: 0.15)
216
+ public static let floating = Style(y: 8, blur: 24, color: ToskiColors.fixed(0x231B17), opacity: 0.22)
217
+ public static let sheet = Style(y: -8, blur: 32, color: ToskiColors.fixed(0x231B17), opacity: 0.18)
218
+ }
219
+
220
+ public enum ToskiSpacing {
221
+ public static let xs: CGFloat = 4
222
+ public static let s: CGFloat = 8
223
+ public static let m: CGFloat = 12
224
+ public static let l: CGFloat = 16
225
+ public static let xl: CGFloat = 20
226
+ public static let xxl: CGFloat = 24
227
+ public static let screenPadding: CGFloat = 20
228
+ }
229
+
230
+ public enum ToskiSize {
231
+ public static let minTouchTarget: CGFloat = 44
232
+ public static let primaryButtonHeight: CGFloat = 54
233
+ public static let avatarSmall: CGFloat = 24
234
+ public static let avatar: CGFloat = 48
235
+ public static let avatarLarge: CGFloat = 76
236
+ }
237
+
238
+ public enum ToskiFont {
239
+ /// Nome da família registrada no app (adicione os .ttf do Outfit em "Fonts provided by application").
240
+ public static let family = "Outfit"
241
+
242
+ public struct Style: Sendable {
243
+ public let size: CGFloat
244
+ public let weight: Font.Weight
245
+ /// Espaçamento entre letras em em (multiplique pelo tamanho para pontos).
246
+ public let tracking: CGFloat
247
+ public let uppercase: Bool
248
+
249
+ public init(size: CGFloat, weight: Font.Weight, tracking: CGFloat = 0, uppercase: Bool = false) {
250
+ self.size = size
251
+ self.weight = weight
252
+ self.tracking = tracking
253
+ self.uppercase = uppercase
254
+ }
255
+
256
+ /// Fonte Outfit que acompanha o Tamanho do Texto do sistema.
257
+ public var font: Font { .custom(ToskiFont.family, size: size).weight(weight) }
258
+ /// Tracking em pontos, para .tracking(_:).
259
+ public var trackingPoints: CGFloat { tracking * size }
260
+ }
261
+
262
+ public static let largeTitle = Style(size: 28, weight: .semibold, tracking: -0.01)
263
+ public static let title = Style(size: 22, weight: .semibold)
264
+ public static let headline = Style(size: 17, weight: .semibold)
265
+ public static let body = Style(size: 16, weight: .regular)
266
+ public static let callout = Style(size: 15, weight: .regular)
267
+ public static let subheadline = Style(size: 14, weight: .regular)
268
+ public static let footnote = Style(size: 13, weight: .regular)
269
+ public static let sectionLabel = Style(size: 13, weight: .semibold, tracking: 0.06, uppercase: true)
270
+ public static let caption = Style(size: 12, weight: .regular)
271
+ public static let tabLabel = Style(size: 11, weight: .medium)
272
+ }
@@ -0,0 +1,192 @@
1
+ // ToskiTokens.swift
2
+ // Gerado por scripts/build-tokens.ts a partir de tokens/tokens.json. Não edite à mão.
3
+ // Plataforma: mobile (iOS). Medidas dos componentes e animações do app.
4
+ //
5
+ // Uso: .frame(height: ToskiComponent.Button.Large.height)
6
+ // ToskiMotionTokens.Ball.Slow.duration
7
+
8
+ import CoreGraphics
9
+
10
+ /// Medidas dos componentes do app (pt). Toque mínimo de 44 pt mesmo quando o desenho é menor. Raios por nome de ToskiRadius.
11
+ public enum ToskiComponent {
12
+ public enum Button {
13
+ public enum Large {
14
+ public static let height: CGFloat = 54
15
+ public static let radius = "button"
16
+ public static let fontSize: CGFloat = 17
17
+ public static let secondaryFontSize: CGFloat = 16
18
+ }
19
+ public enum Card {
20
+ public static let height: CGFloat = 46
21
+ public static let radius = "buttonSmall"
22
+ public static let fontSize: CGFloat = 15
23
+ }
24
+ public enum Text {
25
+ public static let height: CGFloat = 48
26
+ public static let radius = "button"
27
+ public static let fontSize: CGFloat = 16
28
+ public static let horizontalPadding: CGFloat = 4
29
+ }
30
+ public enum Link {
31
+ public static let height: CGFloat = 44
32
+ public static let fontSize: CGFloat = 15
33
+ }
34
+ public enum LinkSmall {
35
+ public static let fontSize: CGFloat = 14
36
+ }
37
+ }
38
+ public enum Pill {
39
+ public static let height: CGFloat = 40
40
+ public static let radius: CGFloat = 20
41
+ public static let fontSize: CGFloat = 14
42
+ public static let horizontalPadding: CGFloat = 16
43
+ }
44
+ public enum CircleButton {
45
+ public static let regular: CGFloat = 44
46
+ public static let critical: CGFloat = 48
47
+ }
48
+ public enum Chip {
49
+ public enum Filter {
50
+ public static let height: CGFloat = 44
51
+ public static let fontSize: CGFloat = 15
52
+ public static let trailing: CGFloat = 16
53
+ }
54
+ public enum Option {
55
+ public static let height: CGFloat = 38
56
+ public static let fontSize: CGFloat = 14.5
57
+ public static let trailing: CGFloat = 14
58
+ }
59
+ public enum Compact {
60
+ public static let height: CGFloat = 36
61
+ public static let fontSize: CGFloat = 14
62
+ public static let trailing: CGFloat = 12
63
+ }
64
+ }
65
+ public enum Tag {
66
+ public enum Small {
67
+ public static let height: CGFloat = 26
68
+ public static let fontSize: CGFloat = 12.5
69
+ }
70
+ public enum Medium {
71
+ public static let height: CGFloat = 32
72
+ public static let fontSize: CGFloat = 14
73
+ }
74
+ }
75
+ public enum Row {
76
+ public static let height: CGFloat = 50
77
+ public static let heightWithIcon: CGFloat = 48
78
+ public static let iconSide: CGFloat = 30
79
+ public static let gap: CGFloat = 8
80
+ }
81
+ public enum FormRow {
82
+ public static let height: CGFloat = 50
83
+ public static let heightWithSubtitle: CGFloat = 58
84
+ public static let verticalPadding: CGFloat = 10
85
+ public static let subtitleFontSize: CGFloat = 12.5
86
+ public static let valueButtonHeight: CGFloat = 36
87
+ }
88
+ public enum Segmented {
89
+ public static let itemHeight: CGFloat = 38
90
+ public static let trackPadding: CGFloat = 3
91
+ public static let fontSize: CGFloat = 14
92
+ }
93
+ public enum Stepper {
94
+ public static let side: CGFloat = 36
95
+ }
96
+ public enum TextField {
97
+ public static let height: CGFloat = 50
98
+ public static let fontSize: CGFloat = 15.5
99
+ public static let lineHeight: CGFloat = 1.4
100
+ }
101
+ public enum ProgressBar {
102
+ public static let height: CGFloat = 6
103
+ }
104
+ public enum LoadingDots {
105
+ public static let diameter: CGFloat = 8
106
+ public static let spacing: CGFloat = 8
107
+ }
108
+ public enum SyncSpinner {
109
+ public static let size: CGFloat = 14
110
+ }
111
+ public enum TabBar {
112
+ public static let itemHeight: CGFloat = 49
113
+ public static let topPadding: CGFloat = 8
114
+ public static let borderHeight: CGFloat = 1
115
+ public static let safeAreaOverlap: CGFloat = 8
116
+ }
117
+ public enum BottomPanel {
118
+ public static let handleWidth: CGFloat = 40
119
+ public static let handleHeight: CGFloat = 5
120
+ public static let maxHeightFraction: CGFloat = 0.9
121
+ public static let scrimOpacity: CGFloat = 0.45
122
+ }
123
+ public enum Toast {
124
+ public static let minHeight: CGFloat = 56
125
+ public static let spacing: CGFloat = 10
126
+ public static let leadingPadding: CGFloat = 16
127
+ public static let padding: CGFloat = 6
128
+ public static let offsetAboveTabBar: CGFloat = 16
129
+ }
130
+ public enum Mascot {
131
+ public static let width: CGFloat = 156
132
+ public static let discSide: CGFloat = 200
133
+ public static let fallenBallWidth: CGFloat = 168
134
+ public static let ballSide: CGFloat = 37
135
+ }
136
+ }
137
+
138
+ /// Animações (docs/design/assets/animacoes.md do app). Tempos em segundos, distâncias em pt/px. Curvas no formato cubic-bezier(x1, y1, x2, y2).
139
+ public enum ToskiMotionTokens {
140
+ public enum Curve {
141
+ public static let easeInOut: [Double] = [0.42, 0, 0.58, 1]
142
+ public static let easeOut: [Double] = [0, 0, 0.58, 1]
143
+ }
144
+ /// Bolinha da Paçoca: sobe de 0 a 45%, fica no alto até 60% e desce até 100% (ease-in-out em cada trecho). Para com "reduzir movimento".
145
+ public enum Ball {
146
+ public static let keyframes: [Double] = [0, 0.45, 0.6, 1]
147
+ public static let viewBoxWidth: Double = 222
148
+ public enum Slow {
149
+ public static let duration: Double = 1.8
150
+ public static let rise: Double = 14
151
+ }
152
+ public enum Fast {
153
+ public static let duration: Double = 1.2
154
+ public static let rise: Double = 16
155
+ }
156
+ }
157
+ /// Três pontinhos de carregando: opacidade sobe até 40%, desce até 80% e fica baixa até o fim. Continuam com "reduzir movimento".
158
+ public enum Dots {
159
+ public static let duration: Double = 1.2
160
+ public static let delays: [Double] = [0, 0.2, 0.4]
161
+ public static let keyframes: [Double] = [0, 0.4, 0.8, 1]
162
+ public static let low: Double = 0.25
163
+ public static let high: Double = 1
164
+ }
165
+ /// Ícone de sincronizando: uma volta por ciclo. Continua com "reduzir movimento".
166
+ public enum Spinner {
167
+ public static let duration: Double = 0.9
168
+ }
169
+ /// Painel inferior: snappy de 0,3 s; com "reduzir movimento", ease-in-out de 0,2 s. Volta do arrasto: snappy 0,2 s.
170
+ public enum Panel {
171
+ public static let duration: Double = 0.3
172
+ public static let reducedDuration: Double = 0.2
173
+ public static let dragReturnDuration: Double = 0.2
174
+ }
175
+ /// Toast entra deslizando 16 pt com ease-out em 0,25 s (com "reduzir movimento", ease-in-out de 0,2 s). Fica 4 s sem ação, 6 s com ação e 10 s com VoiceOver.
176
+ public enum Toast {
177
+ public static let enterDuration: Double = 0.25
178
+ public static let curve = "easeOut"
179
+ public static let slide: Double = 16
180
+ public static let reducedDuration: Double = 0.2
181
+ public enum Visible {
182
+ public static let withoutAction: Double = 4
183
+ public static let withAction: Double = 6
184
+ public static let voiceOver: Double = 10
185
+ }
186
+ }
187
+ /// Pressionado e desabilitado (opacidade).
188
+ public enum Interaction {
189
+ public static let pressedOpacity: Double = 0.7
190
+ public static let disabledOpacity: Double = 0.5
191
+ }
192
+ }