zark-design 1.0.0 → 2.0.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/bin/cli.js +7 -6
- package/package.json +2 -2
- package/templates/README.md +264 -0
- package/templates/html/components.css +740 -0
- package/templates/html/index.html +135 -0
- package/templates/html/showcase.html +3550 -0
- package/templates/{tokens.css → html/tokens.css} +89 -112
- package/templates/jsx/App.example.jsx +229 -0
- package/templates/jsx/components/AlertCritical.jsx +43 -0
- package/templates/jsx/components/Avatar.jsx +41 -0
- package/templates/jsx/components/Badge.jsx +12 -0
- package/templates/jsx/components/Banner.jsx +42 -0
- package/templates/jsx/components/Button.jsx +43 -0
- package/templates/jsx/components/Chip.jsx +28 -0
- package/templates/jsx/components/CodeBlock.jsx +42 -0
- package/templates/jsx/components/EmptyState.jsx +27 -0
- package/templates/jsx/components/Funnel.jsx +55 -0
- package/templates/jsx/components/Input.jsx +53 -0
- package/templates/jsx/components/KanbanColumn.jsx +51 -0
- package/templates/jsx/components/Kbd.jsx +11 -0
- package/templates/jsx/components/LeadCard.jsx +79 -0
- package/templates/jsx/components/Modal.jsx +57 -0
- package/templates/jsx/components/Panel.jsx +25 -0
- package/templates/jsx/components/Section.jsx +28 -0
- package/templates/jsx/components/Segmented.jsx +26 -0
- package/templates/jsx/components/Sidebar.jsx +49 -0
- package/templates/jsx/components/Spec.jsx +19 -0
- package/templates/jsx/components/StatCard.jsx +44 -0
- package/templates/jsx/components/TableActions.jsx +34 -0
- package/templates/jsx/components/Tag.jsx +21 -0
- package/templates/jsx/components/TagDot.jsx +26 -0
- package/templates/jsx/components/Toast.jsx +25 -0
- package/templates/jsx/components/Toggle.jsx +29 -0
- package/templates/jsx/components.css +740 -0
- package/templates/{icons.jsx → jsx/icons.jsx} +20 -9
- package/templates/jsx/index.js +31 -0
- package/templates/jsx/tokens.css +283 -0
- package/templates/jsx/tokens.js +62 -0
- package/templates/REFERENCE.md +0 -376
- package/templates/SHOWCASE.html +0 -254
- package/templates/brand.jsx +0 -89
- package/templates/components.jsx +0 -385
- package/templates/design-canvas.jsx +0 -789
- package/templates/foundations.jsx +0 -363
- package/templates/layouts.jsx +0 -232
- package/templates/patterns.jsx +0 -268
- package/templates/primitives.jsx +0 -306
- package/templates/visual-references/pasted-1777605750385-0.png +0 -0
- package/templates/visual-references/pasted-1777605766298-0.png +0 -0
- package/templates/visual-references/pasted-1777605775820-0.png +0 -0
- package/templates/visual-references/pasted-1777605789833-0.png +0 -0
- package/templates/visual-references/pasted-1777605802420-0.png +0 -0
- package/templates/visual-references/pasted-1777605812470-0.png +0 -0
- package/templates/visual-references/pasted-1777605817688-0.png +0 -0
- package/templates/visual-references/pasted-1777605828485-0.png +0 -0
- package/templates/visual-references/pasted-1777605837137-0.png +0 -0
- package/templates/visual-references/pasted-1777605849789-0.png +0 -0
- package/templates/visual-references/pasted-1777605864942-0.png +0 -0
- package/templates/visual-references/pasted-1777605877920-0.png +0 -0
- package/templates/visual-references/pasted-1777605897353-0.png +0 -0
- /package/templates/{assets/zark-logo.png → html/assets/logo-zark-laranja.png} +0 -0
- /package/templates/{assets → html/assets}/zark-icon.png +0 -0
- /package/templates/{visual-references/logo-zark-principal.png → jsx/assets/logo-zark-laranja.png} +0 -0
- /package/templates/{visual-references/icon-zark.png → jsx/assets/zark-icon.png} +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* StatCard — KPI unificado (substitui as 4 variantes que tinham no CRM)
|
|
5
|
+
*
|
|
6
|
+
* @param label uppercase mono label
|
|
7
|
+
* @param value número/valor (Inter, NUNCA Space Grotesk)
|
|
8
|
+
* @param sub texto auxiliar abaixo do valor
|
|
9
|
+
* @param icon ReactNode rendered no quadrado colorido
|
|
10
|
+
* @param iconColor 'green' | 'orange' | 'blue' | 'purple' | 'red' | 'ghost'
|
|
11
|
+
* @param progress 0–100 (renderiza barra de progresso)
|
|
12
|
+
* @param critical boolean — borda vermelha + bg danger-50
|
|
13
|
+
*/
|
|
14
|
+
export function StatCard({
|
|
15
|
+
label,
|
|
16
|
+
value,
|
|
17
|
+
sub,
|
|
18
|
+
icon,
|
|
19
|
+
iconColor = 'orange',
|
|
20
|
+
progress,
|
|
21
|
+
critical = false,
|
|
22
|
+
className = '',
|
|
23
|
+
...rest
|
|
24
|
+
}) {
|
|
25
|
+
const cls = ['stat', critical && 'is-critical', className].filter(Boolean).join(' ');
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div className={cls} {...rest}>
|
|
29
|
+
<div className="stat-head">
|
|
30
|
+
<span className="stat-label">{label}</span>
|
|
31
|
+
{icon && <span className={`stat-icon ${iconColor}`}>{icon}</span>}
|
|
32
|
+
</div>
|
|
33
|
+
<div className="stat-value">{value}</div>
|
|
34
|
+
{sub && <div className="stat-sub">{sub}</div>}
|
|
35
|
+
{typeof progress === 'number' && (
|
|
36
|
+
<div className="stat-progress">
|
|
37
|
+
<span style={{ width: `${Math.max(0, Math.min(100, progress))}%` }}/>
|
|
38
|
+
</div>
|
|
39
|
+
)}
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default StatCard;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TableActions — linha de ações em data-table (check / edit / delete)
|
|
5
|
+
* Substitui ícones soltos coloridos por botões com border + hover state.
|
|
6
|
+
*
|
|
7
|
+
* @param onConfirm function (botão verde de check, ex: confirmar pagamento)
|
|
8
|
+
* @param onEdit function (lápis cinza)
|
|
9
|
+
* @param onDelete function (lixeira vermelha — sempre pedir confirmação no handler)
|
|
10
|
+
* @param showConfirm boolean — esconde o check (default true)
|
|
11
|
+
*/
|
|
12
|
+
export function TableActions({ onConfirm, onEdit, onDelete, showConfirm = true, className = '' }) {
|
|
13
|
+
return (
|
|
14
|
+
<span className={`t-actions ${className}`.trim()}>
|
|
15
|
+
{showConfirm && onConfirm && (
|
|
16
|
+
<button className="t-act t-confirm" onClick={onConfirm} title="Confirmar">
|
|
17
|
+
<svg width="12" height="12" viewBox="0 0 18 18" fill="none" stroke="currentColor" strokeWidth="2"><path d="M4 9l4 4 6-8"/></svg>
|
|
18
|
+
</button>
|
|
19
|
+
)}
|
|
20
|
+
{onEdit && (
|
|
21
|
+
<button className="t-act t-edit" onClick={onEdit} title="Editar">
|
|
22
|
+
<svg width="12" height="12" viewBox="0 0 18 18" fill="none" stroke="currentColor" strokeWidth="1.5"><path d="M12 3l3 3-9 9H3v-3l9-9z"/></svg>
|
|
23
|
+
</button>
|
|
24
|
+
)}
|
|
25
|
+
{onDelete && (
|
|
26
|
+
<button className="t-act t-delete" onClick={onDelete} title="Excluir">
|
|
27
|
+
<svg width="12" height="12" viewBox="0 0 18 18" fill="none" stroke="currentColor" strokeWidth="1.5"><path d="M3 5h12M7 5V3h4v2M5 5v10a1 1 0 001 1h6a1 1 0 001-1V5"/></svg>
|
|
28
|
+
</button>
|
|
29
|
+
)}
|
|
30
|
+
</span>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default TableActions;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Tag — label sem dot indicator
|
|
5
|
+
* @param tone default · ember · mono · success · warning · danger · info
|
|
6
|
+
* @param size xs · sm · md
|
|
7
|
+
* @param square boolean — raio --r-xs (mais sharp ainda)
|
|
8
|
+
*/
|
|
9
|
+
export function Tag({ tone = 'default', size = 'sm', square = false, className = '', children, ...rest }) {
|
|
10
|
+
const cls = [
|
|
11
|
+
'tag',
|
|
12
|
+
`tag-${size}`,
|
|
13
|
+
tone !== 'default' && `tag-${tone}`,
|
|
14
|
+
square && 'tag-square',
|
|
15
|
+
className,
|
|
16
|
+
].filter(Boolean).join(' ');
|
|
17
|
+
|
|
18
|
+
return <span className={cls} {...rest}>{children}</span>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default Tag;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TagDot — tag com dot indicator à esquerda. Usado pra status, prioridade,
|
|
5
|
+
* espaço/cliente. SEMPRE usar este componente em vez do Tag puro quando
|
|
6
|
+
* representar um estado semântico (não decorativo).
|
|
7
|
+
*
|
|
8
|
+
* @param kind 'status' | 'priority' | 'space'
|
|
9
|
+
* @param value status: 'todo' | 'progress' | 'review' | 'done' | 'canceled' | 'overdue' | 'paused' | 'followup'
|
|
10
|
+
* priority: 'urgent' | 'high' | 'med' | 'low'
|
|
11
|
+
* space: 'zark' | 'allsec' | 'vipcar' | 'limppe' | 'gerais' | 'mixshop' | 'vipseg'
|
|
12
|
+
*
|
|
13
|
+
* Ordem recomendada num row de tarefa: space → status → priority
|
|
14
|
+
*/
|
|
15
|
+
export function TagDot({ kind, value, className = '', children, ...rest }) {
|
|
16
|
+
const prefixMap = { status: 's-', priority: 'p-', space: 'sp ' };
|
|
17
|
+
const prefix = prefixMap[kind] || '';
|
|
18
|
+
const variantClass = kind === 'space'
|
|
19
|
+
? `sp sp-${value}`
|
|
20
|
+
: `${prefix}${value}`;
|
|
21
|
+
|
|
22
|
+
const cls = ['tag-dot', variantClass, className].filter(Boolean).join(' ');
|
|
23
|
+
return <span className={cls} {...rest}>{children}</span>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default TagDot;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Toast — pill (na semântica) com bg ink-700 ou success-500, raio --r-md
|
|
5
|
+
* Usar em micro-confirmações (copied, saved, welcome).
|
|
6
|
+
*
|
|
7
|
+
* @param tone 'default' | 'success' | 'danger'
|
|
8
|
+
* @param icon ReactNode (default: nenhum) — ex: <img src="zark-icon.png"/>
|
|
9
|
+
*/
|
|
10
|
+
export function Toast({ tone = 'default', icon, className = '', children, ...rest }) {
|
|
11
|
+
const cls = [
|
|
12
|
+
'toast',
|
|
13
|
+
tone === 'success' && 'toast-success',
|
|
14
|
+
tone === 'danger' && 'toast-danger',
|
|
15
|
+
className,
|
|
16
|
+
].filter(Boolean).join(' ');
|
|
17
|
+
return (
|
|
18
|
+
<div className={cls} {...rest}>
|
|
19
|
+
{children}
|
|
20
|
+
{icon}
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default Toast;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Toggle — square switch (no pills)
|
|
5
|
+
* @param on boolean — controlled state
|
|
6
|
+
* @param onChange function(nextValue: boolean)
|
|
7
|
+
* @param size 'sm' | 'md'
|
|
8
|
+
*/
|
|
9
|
+
export function Toggle({ on = false, onChange, size = 'md', className = '', ...rest }) {
|
|
10
|
+
const cls = [
|
|
11
|
+
'toggle',
|
|
12
|
+
size === 'sm' && 'toggle-sm',
|
|
13
|
+
on && 'on',
|
|
14
|
+
className,
|
|
15
|
+
].filter(Boolean).join(' ');
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<button
|
|
19
|
+
type="button"
|
|
20
|
+
className={cls}
|
|
21
|
+
onClick={() => onChange?.(!on)}
|
|
22
|
+
{...rest}
|
|
23
|
+
>
|
|
24
|
+
<span className="knob"/>
|
|
25
|
+
</button>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default Toggle;
|