| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- /**
- * The few Lucide icons the panel uses (ZCode's icon set), as inline SVG so the bundle stays small.
- * Path data from Lucide (https://lucide.dev), ISC License, Copyright (c) Lucide Contributors 2022,
- * portions Copyright (c) Cole Bemis 2013-2022 (Feather, MIT). See THIRD_PARTY_NOTICES.txt.
- */
- const PATHS = {
- search: '<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>',
- x: '<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',
- "chevron-up": '<path d="m18 15-6-6-6 6"/>',
- "chevron-down": '<path d="m6 9 6 6 6-6"/>',
- minus: '<path d="M5 12h14"/>',
- plus: '<path d="M5 12h14"/><path d="M12 5v14"/>',
- ellipsis:
- '<circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/>',
- "panel-left": '<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/>',
- "file-text":
- '<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/>',
- copy: '<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>',
- "message-square-plus":
- '<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/><path d="M12 7v6"/><path d="M9 10h6"/>',
- "message-circle-question":
- '<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/>',
- check: '<path d="M20 6 9 17l-5-5"/>',
- "rotate-cw":
- '<path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/>',
- "arrow-down": '<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>',
- "arrow-up": '<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>',
- "folder-open":
- '<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"/>',
- "maximize-2":
- '<polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/>',
- } as const;
- export type IconName = keyof typeof PATHS;
- export function Icon({
- name,
- size = 14,
- className,
- }: {
- name: IconName;
- size?: 12 | 14 | 16 | 28;
- className?: string;
- }) {
- return (
- <svg
- className={`icon${className ? ` ${className}` : ""}`}
- width={size}
- height={size}
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth={2}
- strokeLinecap="round"
- strokeLinejoin="round"
- aria-hidden="true"
- // Static, trusted path data from this file only.
- dangerouslySetInnerHTML={{ __html: PATHS[name] }}
- />
- );
- }
- const TYPE_LABEL = { pdf: "PDF", docx: "W", xlsx: "X", pptx: "P" } as const;
- /** 16px coloured file-type square, used only where a list mixes document kinds. */
- export function FileType({ kind }: { kind: keyof typeof TYPE_LABEL }) {
- return (
- <span className={`filetype ${kind}`} aria-hidden="true">
- {TYPE_LABEL[kind]}
- </span>
- );
- }
|