@quilltap/theme-storybook 1.0.39 → 1.0.41

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.
@@ -10,6 +10,7 @@ import {
10
10
  Dialogs,
11
11
  EmptyState,
12
12
  FilePreview,
13
+ Icons,
13
14
  Inputs,
14
15
  Loading,
15
16
  Participant,
@@ -18,7 +19,7 @@ import {
18
19
  Terminal,
19
20
  ThemeComparison,
20
21
  Typography
21
- } from "../chunk-7CI72GBQ.mjs";
22
+ } from "../chunk-U2PTQQL5.mjs";
22
23
  import "../chunk-WUKYLWAZ.mjs";
23
24
  export {
24
25
  Avatars,
@@ -32,6 +33,7 @@ export {
32
33
  Dialogs,
33
34
  EmptyState,
34
35
  FilePreview,
36
+ Icons,
35
37
  Inputs,
36
38
  Loading,
37
39
  Participant,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quilltap/theme-storybook",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "Storybook preset and stories for developing Quilltap theme plugins",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Icons Story Component
3
+ *
4
+ * A reference for theme authors: the catalogue of override-able Quilltap icon
5
+ * names, plus the recipe for replacing them from a `.qtap-theme` bundle.
6
+ *
7
+ * This is a lightweight reference — it documents the icon-name contract and the
8
+ * override mechanism rather than live-rendering every glyph (which would require
9
+ * bundling the app's default SVG set into this package). The grouped name list
10
+ * below mirrors the app's icon registry (`components/ui/icons/icon-registry.ts`);
11
+ * keep it in sync when icons are added or renamed.
12
+ */
13
+
14
+ import React from 'react';
15
+
16
+ interface IconGroup {
17
+ category: string;
18
+ names: string[];
19
+ }
20
+
21
+ const ICON_GROUPS: IconGroup[] = [
22
+ {
23
+ category: 'General UI',
24
+ names: [
25
+ 'close', 'pencil', 'refresh', 'check', 'check-circle', 'chat', 'info', 'trash',
26
+ 'copy', 'plus', 'search', 'download', 'upload', 'cloud-upload', 'external-link',
27
+ 'link', 'send', 'paperclip', 'eye', 'eye-off', 'star', 'bookmark', 'tag', 'expand', 'compress',
28
+ ],
29
+ },
30
+ {
31
+ category: 'Navigation arrows',
32
+ names: [
33
+ 'chevron-down', 'chevron-right', 'chevron-left',
34
+ 'arrow-left', 'arrow-right', 'arrow-up', 'arrow-down',
35
+ ],
36
+ },
37
+ {
38
+ category: 'Status & alerts',
39
+ names: ['alert-triangle', 'alert-circle', 'shield', 'ban', 'clock', 'calendar'],
40
+ },
41
+ {
42
+ category: 'Media',
43
+ names: ['image', 'camera', 'play', 'pause', 'stop', 'zoom-in', 'zoom-out'],
44
+ },
45
+ {
46
+ category: 'Content & sidebar navigation',
47
+ names: [
48
+ 'projects', 'files', 'file', 'file-plus', 'folder', 'folder-plus', 'book',
49
+ 'characters', 'scriptorium', 'photos', 'scenarios',
50
+ ],
51
+ },
52
+ {
53
+ category: 'People',
54
+ names: ['profile', 'user', 'user-plus', 'users', 'megaphone', 'dice'],
55
+ },
56
+ {
57
+ category: 'System & tooling',
58
+ names: ['sparkles', 'wand', 'wrench', 'code', 'cpu', 'database', 'layers', 'zap', 'swap', 'log-out'],
59
+ },
60
+ {
61
+ category: 'Appearance & system',
62
+ names: ['settings', 'themes', 'wardrobe', 'help', 'sun', 'moon', 'monitor'],
63
+ },
64
+ {
65
+ category: 'Brand',
66
+ names: ['brand'],
67
+ },
68
+ ];
69
+
70
+ const sectionHeading: React.CSSProperties = {
71
+ fontSize: '1.125rem',
72
+ fontWeight: 700,
73
+ marginBottom: '1rem',
74
+ borderBottom: '1px solid var(--color-border)',
75
+ paddingBottom: '0.5rem',
76
+ };
77
+
78
+ const chip: React.CSSProperties = {
79
+ fontFamily: 'var(--theme-font-mono, ui-monospace, monospace)',
80
+ fontSize: '0.8125rem',
81
+ padding: '0.25rem 0.6rem',
82
+ borderRadius: 'var(--radius-md, 0.375rem)',
83
+ border: '1px solid var(--color-border)',
84
+ background: 'var(--color-muted)',
85
+ color: 'var(--color-foreground)',
86
+ };
87
+
88
+ const codeBlock: React.CSSProperties = {
89
+ fontFamily: 'var(--theme-font-mono, ui-monospace, monospace)',
90
+ fontSize: '0.8125rem',
91
+ background: 'var(--color-muted)',
92
+ color: 'var(--color-foreground)',
93
+ border: '1px solid var(--color-border)',
94
+ borderRadius: 'var(--radius-md, 0.375rem)',
95
+ padding: '1rem',
96
+ overflowX: 'auto',
97
+ lineHeight: 1.6,
98
+ };
99
+
100
+ export const Icons: React.FC = () => {
101
+ return (
102
+ <div style={{ padding: '1.5rem' }}>
103
+ <h2 style={{ fontSize: '1.5rem', fontWeight: 700, marginBottom: '0.5rem' }}>Icons</h2>
104
+ <p style={{ color: 'var(--color-muted-foreground)', marginBottom: '2rem', maxWidth: '46rem' }}>
105
+ Quilltap renders its UI icons through a central registry, so a theme can replace any of
106
+ them. The default icons are monochrome and follow the current text color; a theme overrides
107
+ an icon by mapping its name to a bundled asset.
108
+ </p>
109
+
110
+ {/* How overrides work */}
111
+ <section style={{ marginBottom: '2.5rem' }}>
112
+ <h3 style={sectionHeading}>Overriding an icon</h3>
113
+ <p style={{ color: 'var(--color-muted-foreground)', marginBottom: '1rem', maxWidth: '46rem' }}>
114
+ Drop replacement assets into your bundle&apos;s <code>icons/</code> folder and add an{' '}
115
+ <code>icons</code> map to <code>theme.json</code>, keyed by the built-in icon name:
116
+ </p>
117
+ <pre style={codeBlock}>{`{
118
+ "icons": {
119
+ "settings": "icons/settings.svg",
120
+ "brand": "icons/brand.webp"
121
+ }
122
+ }`}</pre>
123
+ <ul style={{ color: 'var(--color-muted-foreground)', marginTop: '1rem', maxWidth: '46rem', lineHeight: 1.7 }}>
124
+ <li>
125
+ <strong style={{ color: 'var(--color-foreground)' }}>.svg overrides</strong> are tinted by
126
+ the current text color, exactly like the built-in icons — best for monochrome glyphs that
127
+ should follow the theme.
128
+ </li>
129
+ <li>
130
+ <strong style={{ color: 'var(--color-foreground)' }}>.webp overrides</strong> are drawn in
131
+ full color — best for textured or multi-color marks.
132
+ </li>
133
+ <li>
134
+ The <code>brand</code> mark follows the same rule: an <code>.svg</code> override is
135
+ tinted like any other icon, so ship it as <code>.webp</code> if it should keep its own
136
+ colors.
137
+ </li>
138
+ <li>
139
+ Names must match the built-in names below; unknown names are ignored. Run{' '}
140
+ <code>quilltap themes validate</code> to catch typos and bad asset paths.
141
+ </li>
142
+ </ul>
143
+ </section>
144
+
145
+ {/* Override-able names */}
146
+ <section>
147
+ <h3 style={sectionHeading}>Override-able icon names</h3>
148
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '1.5rem' }}>
149
+ {ICON_GROUPS.map((group) => (
150
+ <div key={group.category}>
151
+ <p style={{ fontWeight: 600, marginBottom: '0.6rem', fontSize: '0.9375rem' }}>
152
+ {group.category}
153
+ </p>
154
+ <div style={{ display: 'flex', flexWrap: 'wrap', gap: '0.5rem' }}>
155
+ {group.names.map((name) => (
156
+ <code key={name} style={chip}>{name}</code>
157
+ ))}
158
+ </div>
159
+ </div>
160
+ ))}
161
+ </div>
162
+ </section>
163
+ </div>
164
+ );
165
+ };
@@ -7,6 +7,7 @@
7
7
  */
8
8
 
9
9
  export * from './components/ColorPalette';
10
+ export * from './components/Icons';
10
11
  export * from './components/Typography';
11
12
  export * from './components/Spacing';
12
13
  export * from './components/Buttons';