@krrli/cm-designsystem 1.1.0 → 1.19.7

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 (174) hide show
  1. package/README.md +391 -2
  2. package/dist/components/avatar/Avatar.d.ts +71 -0
  3. package/dist/components/avatar/Avatar.js +63 -0
  4. package/dist/components/branding/BrandingGallery.d.ts +1 -0
  5. package/dist/components/branding/BrandingGallery.js +139 -0
  6. package/dist/components/button/Button.d.ts +54 -0
  7. package/dist/components/button/Button.js +56 -0
  8. package/dist/components/button/Button.test.d.ts +1 -0
  9. package/dist/components/button/Button.test.js +30 -0
  10. package/dist/components/color/ColorDoc.d.ts +4 -0
  11. package/dist/components/color/ColorDoc.js +10 -0
  12. package/dist/components/file-upload/FileUpload.d.ts +83 -0
  13. package/dist/components/file-upload/FileUpload.js +70 -0
  14. package/dist/components/form/Form.d.ts +54 -0
  15. package/dist/components/form/Form.js +38 -0
  16. package/dist/components/icon-button/IconButton.d.ts +50 -0
  17. package/dist/components/icon-button/IconButton.js +22 -0
  18. package/dist/components/icon-button/IconButton.test.d.ts +1 -0
  19. package/dist/components/icon-button/IconButton.test.js +22 -0
  20. package/dist/components/icons/IconBase.d.ts +5 -0
  21. package/dist/components/icons/IconBase.js +9 -0
  22. package/dist/components/icons/generated/ArrowDown.d.ts +3 -0
  23. package/dist/components/icons/generated/ArrowDown.js +4 -0
  24. package/dist/components/icons/generated/ArrowLeft.d.ts +3 -0
  25. package/dist/components/icons/generated/ArrowLeft.js +4 -0
  26. package/dist/components/icons/generated/ArrowRight.d.ts +3 -0
  27. package/dist/components/icons/generated/ArrowRight.js +4 -0
  28. package/dist/components/icons/generated/ArrowUp.d.ts +3 -0
  29. package/dist/components/icons/generated/ArrowUp.js +4 -0
  30. package/dist/components/icons/generated/Calendar.d.ts +3 -0
  31. package/dist/components/icons/generated/Calendar.js +4 -0
  32. package/dist/components/icons/generated/Cancel.d.ts +3 -0
  33. package/dist/components/icons/generated/Cancel.js +4 -0
  34. package/dist/components/icons/generated/Checkmark.d.ts +3 -0
  35. package/dist/components/icons/generated/Checkmark.js +4 -0
  36. package/dist/components/icons/generated/Edit.d.ts +3 -0
  37. package/dist/components/icons/generated/Edit.js +4 -0
  38. package/dist/components/icons/generated/Eye.d.ts +3 -0
  39. package/dist/components/icons/generated/Eye.js +4 -0
  40. package/dist/components/icons/generated/Fullscreen.d.ts +3 -0
  41. package/dist/components/icons/generated/Fullscreen.js +4 -0
  42. package/dist/components/icons/generated/HeartFilled.d.ts +3 -0
  43. package/dist/components/icons/generated/HeartFilled.js +4 -0
  44. package/dist/components/icons/generated/HeartOutline.d.ts +3 -0
  45. package/dist/components/icons/generated/HeartOutline.js +4 -0
  46. package/dist/components/icons/generated/Location.d.ts +3 -0
  47. package/dist/components/icons/generated/Location.js +4 -0
  48. package/dist/components/icons/generated/LogOut.d.ts +3 -0
  49. package/dist/components/icons/generated/LogOut.js +4 -0
  50. package/dist/components/icons/generated/Mumble.d.ts +3 -0
  51. package/dist/components/icons/generated/Mumble.js +4 -0
  52. package/dist/components/icons/generated/Profile.d.ts +3 -0
  53. package/dist/components/icons/generated/Profile.js +4 -0
  54. package/dist/components/icons/generated/ReplyFilled.d.ts +3 -0
  55. package/dist/components/icons/generated/ReplyFilled.js +4 -0
  56. package/dist/components/icons/generated/ReplyOutline.d.ts +3 -0
  57. package/dist/components/icons/generated/ReplyOutline.js +4 -0
  58. package/dist/components/icons/generated/Repost.d.ts +3 -0
  59. package/dist/components/icons/generated/Repost.js +4 -0
  60. package/dist/components/icons/generated/Send.d.ts +3 -0
  61. package/dist/components/icons/generated/Send.js +4 -0
  62. package/dist/components/icons/generated/Settings.d.ts +3 -0
  63. package/dist/components/icons/generated/Settings.js +4 -0
  64. package/dist/components/icons/generated/Share.d.ts +3 -0
  65. package/dist/components/icons/generated/Share.js +4 -0
  66. package/dist/components/icons/generated/Time.d.ts +3 -0
  67. package/dist/components/icons/generated/Time.js +4 -0
  68. package/dist/components/icons/generated/Upload.d.ts +3 -0
  69. package/dist/components/icons/generated/Upload.js +4 -0
  70. package/dist/components/icons/generated/index.d.ts +24 -0
  71. package/dist/components/icons/generated/index.js +24 -0
  72. package/dist/components/index.d.ts +25 -0
  73. package/dist/components/index.js +25 -0
  74. package/dist/components/input/Input.d.ts +61 -0
  75. package/dist/components/input/Input.js +47 -0
  76. package/dist/components/like-toggle/LikeToggle.d.ts +97 -0
  77. package/dist/components/like-toggle/LikeToggle.js +185 -0
  78. package/dist/components/like-toggle/LikeToggle.test.d.ts +1 -0
  79. package/dist/components/like-toggle/LikeToggle.test.js +35 -0
  80. package/dist/components/modal/Modal.d.ts +75 -0
  81. package/dist/components/modal/Modal.js +63 -0
  82. package/dist/components/modal/Modal.test.d.ts +1 -0
  83. package/dist/components/modal/Modal.test.js +24 -0
  84. package/dist/components/navi-button/NaviButton.d.ts +26 -0
  85. package/dist/components/navi-button/NaviButton.js +29 -0
  86. package/dist/components/navi-button/NaviButton.test.d.ts +1 -0
  87. package/dist/components/navi-button/NaviButton.test.js +22 -0
  88. package/dist/components/navi-user-button/NaviUserButton.d.ts +26 -0
  89. package/dist/components/navi-user-button/NaviUserButton.js +29 -0
  90. package/dist/components/round-button/RoundButton.d.ts +25 -0
  91. package/dist/components/round-button/RoundButton.js +28 -0
  92. package/dist/components/round-button/RoundButton.test.d.ts +1 -0
  93. package/dist/components/round-button/RoundButton.test.js +21 -0
  94. package/dist/components/tabs/TabItem.d.ts +11 -0
  95. package/dist/components/tabs/TabItem.js +13 -0
  96. package/dist/components/tabs/Tabs.d.ts +67 -0
  97. package/dist/components/tabs/Tabs.js +67 -0
  98. package/dist/components/tabs/Tabs.test.d.ts +1 -0
  99. package/dist/components/tabs/Tabs.test.js +61 -0
  100. package/dist/components/text-link/TextLink.d.ts +9 -0
  101. package/dist/components/text-link/TextLink.js +15 -0
  102. package/dist/components/text-link/TextLink.test.d.ts +1 -0
  103. package/dist/components/text-link/TextLink.test.js +14 -0
  104. package/dist/components/textarea/Textarea.d.ts +48 -0
  105. package/dist/components/textarea/Textarea.js +46 -0
  106. package/dist/components/timed-button/TimedButton.d.ts +56 -0
  107. package/dist/components/timed-button/TimedButton.js +106 -0
  108. package/dist/components/timed-button/TimedButton.test.d.ts +1 -0
  109. package/dist/components/timed-button/TimedButton.test.js +35 -0
  110. package/dist/components/toggle/Toggle.d.ts +62 -0
  111. package/dist/components/toggle/Toggle.js +67 -0
  112. package/dist/components/toggle/Toggle.test.d.ts +1 -0
  113. package/dist/components/toggle/Toggle.test.js +93 -0
  114. package/dist/components/typography/Heading.d.ts +17 -0
  115. package/dist/components/typography/Heading.js +11 -0
  116. package/dist/components/typography/Label.d.ts +15 -0
  117. package/dist/components/typography/Label.js +7 -0
  118. package/dist/components/typography/Paragraph.d.ts +15 -0
  119. package/dist/components/typography/Paragraph.js +7 -0
  120. package/dist/components/typography/Placeholder.d.ts +13 -0
  121. package/dist/components/typography/Placeholder.js +7 -0
  122. package/dist/components/typography/ValidationMessage.d.ts +15 -0
  123. package/dist/components/typography/ValidationMessage.js +9 -0
  124. package/dist/components/typography/styles.d.ts +74 -0
  125. package/dist/components/typography/styles.js +52 -0
  126. package/dist/favicon.svg +18 -0
  127. package/dist/index.d.ts +1 -0
  128. package/dist/index.es.js +7550 -0
  129. package/dist/index.js +2 -0
  130. package/dist/logo-inline-gradient.svg +43 -0
  131. package/dist/setupTests.d.ts +1 -0
  132. package/dist/setupTests.js +7 -0
  133. package/package.json +78 -33
  134. package/.github/CODEOWNERS +0 -7
  135. package/.github/semantic.yml +0 -24
  136. package/.github/workflows/publish-npm.yml +0 -29
  137. package/.github/workflows/storybook.yml +0 -44
  138. package/.releaserc.json +0 -9
  139. package/.storybook/main.ts +0 -19
  140. package/.storybook/preview.ts +0 -21
  141. package/.storybook/vitest.setup.ts +0 -7
  142. package/src/index.ts +0 -4
  143. package/stories/Button.stories.ts +0 -54
  144. package/stories/Button.tsx +0 -37
  145. package/stories/Button2.stories.ts +0 -54
  146. package/stories/Button2.tsx +0 -41
  147. package/stories/Configure.mdx +0 -364
  148. package/stories/Header.stories.ts +0 -34
  149. package/stories/Header.tsx +0 -56
  150. package/stories/Page.stories.ts +0 -33
  151. package/stories/Page.tsx +0 -73
  152. package/stories/assets/accessibility.png +0 -0
  153. package/stories/assets/accessibility.svg +0 -1
  154. package/stories/assets/addon-library.png +0 -0
  155. package/stories/assets/assets.png +0 -0
  156. package/stories/assets/avif-test-image.avif +0 -0
  157. package/stories/assets/context.png +0 -0
  158. package/stories/assets/discord.svg +0 -1
  159. package/stories/assets/docs.png +0 -0
  160. package/stories/assets/figma-plugin.png +0 -0
  161. package/stories/assets/github.svg +0 -1
  162. package/stories/assets/share.png +0 -0
  163. package/stories/assets/styling.png +0 -0
  164. package/stories/assets/testing.png +0 -0
  165. package/stories/assets/theming.png +0 -0
  166. package/stories/assets/tutorials.svg +0 -1
  167. package/stories/assets/youtube.svg +0 -1
  168. package/stories/button.css +0 -30
  169. package/stories/button2.css +0 -30
  170. package/stories/header.css +0 -32
  171. package/stories/page.css +0 -68
  172. package/tsconfig.json +0 -13
  173. package/vitest.config.ts +0 -35
  174. package/vitest.shims.d.ts +0 -1
package/README.md CHANGED
@@ -1,2 +1,391 @@
1
- # cm-designsystem
2
- Design System
1
+ # CM Design System
2
+
3
+ A modern React component library built with TypeScript, Tailwind CSS, and Storybook.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Quick Start](#quick-start)
8
+ - [Technical Stack](#technical-stack)
9
+ - [Development](#development)
10
+ - [Quality Checks](#quality-checks)
11
+ - [Code Style](#code-style)
12
+ - [TypeScript Guidelines](#typescript-guidelines)
13
+ - [Project Structure](#project-structure)
14
+ - [Icon Generation](#icon-generation)
15
+ - [Visual Testing](#visual-testing)
16
+ - [Contributing](#contributing)
17
+ - [Continuous Integration](#continuous-integration)
18
+ - [EditorConfig & VS Code Settings](#editorconfig--vs-code-settings)
19
+
20
+ ## Quick Start
21
+
22
+ ```bash
23
+ # Install dependencies
24
+ npm install
25
+
26
+ # Start Storybook development server
27
+ npm run storybook
28
+ ```
29
+
30
+ Storybook will be available at [http://localhost:6006](http://localhost:6006)
31
+
32
+ 📚 View the deployed Storybook: [https://ost-cas-fea-25-26.github.io/cm-designsystem/](https://ost-cas-fea-25-26.github.io/cm-designsystem/?path=/docs/branding-assets--docs)
33
+
34
+ ## Technical Stack
35
+
36
+ - React 19 with TypeScript
37
+ - Vite for fast development and building
38
+ - Tailwind CSS v4 for styling
39
+ - Storybook for component documentation
40
+ - Vitest for unit testing
41
+ - Playwright for visual regression testing
42
+ - Radix UI Primitives for accessible component primitives
43
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react) for Fast Refresh
44
+
45
+ ---
46
+
47
+ ## Development
48
+
49
+ ### Quality Checks
50
+
51
+ Run all quality checks before committing:
52
+
53
+ ```bash
54
+ npm run preflight # Runs format, lint, type-check, test, and build
55
+ ```
56
+
57
+ Individual commands:
58
+
59
+ ```bash
60
+ # Formatting
61
+ npm run format # Auto-format all files with Prettier
62
+ npm run format:check # Check formatting without making changes
63
+
64
+ # Linting
65
+ npm run lint # Check for linting errors
66
+ npm run lint:fix # Auto-fix linting errors where possible
67
+
68
+ # Type Checking
69
+ npx tsc -b --noEmit # Run TypeScript type checking
70
+
71
+ # Testing
72
+ npm test # Run unit tests with Vitest
73
+
74
+ # Building
75
+ npm run build # Build the project
76
+ npm run build-storybook # Build Storybook for production
77
+ ```
78
+
79
+ ### Code Style
80
+
81
+ We enforce consistent code style using automated tools:
82
+
83
+ Prettier Configuration:
84
+
85
+ - Uses double quotes
86
+ - 2-space indentation
87
+ - Semicolons required
88
+ - Line width: 80 characters
89
+ - Includes Tailwind CSS class sorting plugin
90
+
91
+ ESLint Configuration:
92
+
93
+ - TypeScript ESLint rules
94
+ - React and React Hooks best practices
95
+ - JSX Accessibility (a11y) rules
96
+ - Import sorting and organization
97
+ - Storybook rules
98
+ - Prettier integration (no conflicts)
99
+
100
+ ### TypeScript Guidelines
101
+
102
+ We follow a consistent pattern for component type definitions:
103
+
104
+ Standard Component Pattern:
105
+
106
+ ```tsx
107
+ import { tv, type VariantProps } from "tailwind-variants";
108
+
109
+ // 1. Define styles with tailwind-variants
110
+ const buttonStyles = tv({
111
+ variants: {
112
+ intent: {
113
+ primary: ["bg-slate-600"],
114
+ secondary: ["bg-violet-600"],
115
+ },
116
+ size: {
117
+ md: ["pt-3", "pb-3"],
118
+ lg: ["pt-4", "pb-4"],
119
+ },
120
+ },
121
+ });
122
+
123
+ // 2. Extract variant types from styles
124
+ type ButtonVariants = VariantProps<typeof buttonStyles>;
125
+
126
+ // 3. Define specific union types for variant options
127
+ type ButtonIntent = "primary" | "secondary";
128
+ type ButtonSize = "md" | "lg";
129
+
130
+ // 4. Create component props interface extending variants
131
+ interface ButtonProps extends ButtonVariants {
132
+ label: string;
133
+ onClick: () => void;
134
+ className?: string;
135
+ }
136
+ ```
137
+
138
+ When to use `type` vs `interface`:
139
+
140
+ - `type`: For VariantProps, union types, and type aliases
141
+ - `interface`: For component props (always extends variants)
142
+ - `export`: Export interfaces for public component APIs
143
+
144
+ Best Practices:
145
+
146
+ - Always extend `VariantProps` for styled components
147
+ - Define union types for variant options to ensure type safety
148
+ - Export prop interfaces for components
149
+ - Use strict TypeScript (enabled by default)
150
+
151
+ ### Project Structure
152
+
153
+ Components and their Storybook stories are co-located in the same folder for better organization:
154
+
155
+ ```
156
+ src/components/
157
+ ├── button/
158
+ │ ├── Button.tsx # Component implementation
159
+ │ ├── Button.stories.tsx # Storybook stories
160
+ │ └── Button.test.tsx # Unit tests (if applicable)
161
+ ├── avatar/
162
+ │ ├── Avatar.tsx
163
+ │ └── Avatar.stories.tsx
164
+ └── ...
165
+ ```
166
+
167
+ Benefits of co-location:
168
+
169
+ - ✅ Related files stay together
170
+ - ✅ Easier to find and maintain stories
171
+ - ✅ Clear 1:1 relationship between components and documentation
172
+ - ✅ Stories serve as living documentation and examples
173
+
174
+ Story file naming: Always use `ComponentName.stories.tsx` format for Storybook to auto-discover them.
175
+
176
+ ---
177
+
178
+ ## Icon Generation
179
+
180
+ SVG icons are automatically converted to React components with proper accessibility support.
181
+
182
+ ### Workflow
183
+
184
+ 1. Add SVG files to `src/components/icons/svg/`
185
+ 2. Optimize SVGs (optional but recommended):
186
+ ```bash
187
+ npx svgo -f src/components/icons/svg
188
+ ```
189
+ 3. Generate React components:
190
+ ```bash
191
+ npm run icons:generate
192
+ ```
193
+
194
+ ### Configuration
195
+
196
+ Edit `svg.config.json` to customize the generation process:
197
+
198
+ ```json
199
+ {
200
+ "sourceDir": "src/components/icons/svg",
201
+ "outputDir": "src/components/icons/generated",
202
+ "baseComponentImport": {
203
+ "name": "IconBase",
204
+ "path": "../IconBase"
205
+ }
206
+ }
207
+ ```
208
+
209
+ ### Usage Example
210
+
211
+ ```tsx
212
+ import { Calendar, LogOut } from "src/components/icons/generated";
213
+
214
+ export function Example() {
215
+ return (
216
+ <div className="flex gap-2 text-slate-600">
217
+ <Calendar />
218
+ <LogOut className="text-red-600" />
219
+ </div>
220
+ );
221
+ }
222
+ ```
223
+
224
+ How it works:
225
+
226
+ - File names are converted to PascalCase (`log-out.svg` → `LogOut`)
227
+ - Fill colors are normalized to `currentColor` for theming
228
+ - All icons are wrapped in `IconBase` for accessibility
229
+ - A barrel export (`index.ts`) is generated automatically
230
+
231
+ ---
232
+
233
+ ## Visual Testing
234
+
235
+ We use Playwright for visual regression testing against Storybook. Tests run in Docker for consistent results across environments.
236
+
237
+ ### Setup
238
+
239
+ Build the Docker image (first time only):
240
+
241
+ ```bash
242
+ npm run e2e:build
243
+ ```
244
+
245
+ ### Running Tests
246
+
247
+ ```bash
248
+ npm run e2e:test # Run visual regression tests
249
+ npm run e2e:update # Update baseline snapshots
250
+ ```
251
+
252
+ ### Viewing Reports
253
+
254
+ View test reports locally:
255
+
256
+ ```bash
257
+ npx playwright show-report
258
+ ```
259
+
260
+ GitHub Artifacts:
261
+ Test reports are uploaded as CI artifacts. Download and view them with:
262
+
263
+ ```bash
264
+ npx playwright show-report <path/to/extracted-artifact>
265
+ ```
266
+
267
+ ### Configuration
268
+
269
+ - Docker: Tests run in containers for consistency across environments
270
+ - Network: Storybook accepts connections from `host.docker.internal`
271
+ - Tolerance: 1% pixel difference allowed (`maxDiffPixelRatio: 0.01`)
272
+ - Files: `playwright.config.ts` and `.storybook/main.ts`
273
+
274
+ ---
275
+
276
+ ## Contributing
277
+
278
+ ### Pull Request Process
279
+
280
+ 1. Create a feature branch:
281
+
282
+ ```bash
283
+ git checkout -b feature/initials/your-feature-name
284
+ ```
285
+
286
+ Use format: `feature/<mm or ci>/<description>`
287
+
288
+ 2. Make your changes and ensure quality:
289
+
290
+ ```bash
291
+ npm run preflight
292
+ ```
293
+
294
+ 3. Commit with conventional commits (see below)
295
+
296
+ 4. Push to your feature branch:
297
+
298
+ ```bash
299
+ git push origin feature/initials/your-feature-name
300
+ ```
301
+
302
+ 5. Create a pull request to `main`
303
+
304
+ 6. Wait for CI checks to pass
305
+
306
+ 7. Request review from team members
307
+
308
+ 8. Address feedback and merge
309
+
310
+ ### Commit Messages
311
+
312
+ We use [Conventional Commits](https://www.conventionalcommits.org/) for consistent versioning and changelog generation.
313
+
314
+ Format:
315
+
316
+ ```
317
+ <type>: <description>
318
+
319
+ [optional body]
320
+ ```
321
+
322
+ Types:
323
+
324
+ - `feat`: New feature
325
+ - `fix`: Bug fix
326
+ - `docs`: Documentation changes
327
+ - `style`: Code style/formatting (no logic change)
328
+ - `refactor`: Code refactoring (no feature/bug change)
329
+ - `test`: Adding or updating tests
330
+ - `chore`: Maintenance tasks (dependencies, config, etc.)
331
+ - `perf`: Performance improvements
332
+
333
+ Examples:
334
+
335
+ ```
336
+ feat: add new Button variant
337
+ fix: correct Typography component spacing
338
+ docs: update README with visual testing guide
339
+ chore: update dependencies
340
+ test: add tests for TextLink component
341
+ ```
342
+
343
+ ---
344
+
345
+ ## Continuous Integration
346
+
347
+ All pull requests are automatically validated through our CI pipeline.
348
+
349
+ ### Required Checks
350
+
351
+ 1. ✅ Format & Lint - Code must be properly formatted and pass linting
352
+ 2. ✅ Type Check - No TypeScript errors
353
+ 3. ✅ Tests - All unit tests must pass
354
+ 4. ✅ Build - Project must build successfully
355
+ 5. ✅ Build Storybook - Storybook must build successfully
356
+ 6. ✅ Visual Tests - Playwright visual regression tests must pass
357
+
358
+ ### Pipeline Triggers
359
+
360
+ - Pull requests to `main`
361
+ - Pushes to `main`
362
+
363
+ ### Why No Pre-commit Hooks?
364
+
365
+ We intentionally don't use pre-commit hooks (like Husky):
366
+
367
+ - ✅ Quality checks in CI can't be bypassed
368
+ - ✅ Faster local development workflow
369
+ - ✅ CI is the single source of truth
370
+
371
+ Note: You're encouraged to run `npm run preflight` locally before pushing!
372
+
373
+ ---
374
+
375
+ ## EditorConfig & VS Code Settings
376
+
377
+ This project uses a strict `.editorconfig` to ensure consistent code style across all editors and platforms. Most formatting rules (indentation, line endings, trailing whitespace, etc.) are enforced automatically if you have the [EditorConfig extension](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) installed in VS Code.
378
+
379
+ Additionally, the repository includes a `.vscode/settings.json` file to avoid conflicts between VS Code's built-in formatting and EditorConfig:
380
+
381
+ ```json
382
+ {
383
+ "editor.formatOnSave": true,
384
+ "files.trimTrailingWhitespace": false,
385
+ "files.insertFinalNewline": false,
386
+ "files.eol": "\n"
387
+ }
388
+ ```
389
+
390
+ - No further VS Code settings are required—just make sure the EditorConfig extension is enabled.
391
+ - These settings ensure that formatting is always consistent, regardless of individual developer/editor preferences.
@@ -0,0 +1,71 @@
1
+ import { type VariantProps } from "tailwind-variants";
2
+ declare const avatarStyles: import("tailwind-variants").TVReturnType<{
3
+ size: {
4
+ sm: {
5
+ avatar: string[];
6
+ };
7
+ md: {
8
+ avatar: string[];
9
+ };
10
+ lg: {
11
+ avatar: string[];
12
+ };
13
+ xl: {
14
+ avatar: string[];
15
+ };
16
+ };
17
+ }, {
18
+ base: string[];
19
+ avatar: string[];
20
+ action: string[];
21
+ }, undefined, {
22
+ size: {
23
+ sm: {
24
+ avatar: string[];
25
+ };
26
+ md: {
27
+ avatar: string[];
28
+ };
29
+ lg: {
30
+ avatar: string[];
31
+ };
32
+ xl: {
33
+ avatar: string[];
34
+ };
35
+ };
36
+ }, {
37
+ base: string[];
38
+ avatar: string[];
39
+ action: string[];
40
+ }, import("tailwind-variants").TVReturnType<{
41
+ size: {
42
+ sm: {
43
+ avatar: string[];
44
+ };
45
+ md: {
46
+ avatar: string[];
47
+ };
48
+ lg: {
49
+ avatar: string[];
50
+ };
51
+ xl: {
52
+ avatar: string[];
53
+ };
54
+ };
55
+ }, {
56
+ base: string[];
57
+ avatar: string[];
58
+ action: string[];
59
+ }, undefined, unknown, unknown, undefined>>;
60
+ type AvatarVariants = VariantProps<typeof avatarStyles>;
61
+ type AvatarSize = "sm" | "md" | "lg" | "xl";
62
+ interface AvatarProps extends AvatarVariants {
63
+ label: string;
64
+ size: AvatarSize;
65
+ src: string;
66
+ children: React.ReactNode;
67
+ onClick?: () => void;
68
+ onActionClick?: () => void;
69
+ }
70
+ export declare const Avatar: (props: AvatarProps) => import("react/jsx-runtime").JSX.Element;
71
+ export {};
@@ -0,0 +1,63 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as RadixAvatar from "@radix-ui/react-avatar";
3
+ import { tv } from "tailwind-variants";
4
+ import { Edit } from "../icons/generated";
5
+ import { RoundButton } from "../round-button/RoundButton";
6
+ const avatarStyles = tv({
7
+ slots: {
8
+ base: ["relative", "inline-block"],
9
+ avatar: [
10
+ "rounded-full",
11
+ "transition",
12
+ "duration-300",
13
+ "ease-in-out",
14
+ "min-w-10",
15
+ "min-h-10",
16
+ "flex",
17
+ "items-center",
18
+ "justify-center",
19
+ ],
20
+ action: ["absolute", "bottom-2", "right-2"],
21
+ },
22
+ variants: {
23
+ size: {
24
+ sm: { avatar: ["w-10", "h-10", "hover:scale-105"] },
25
+ md: {
26
+ avatar: [
27
+ "w-16",
28
+ "h-16",
29
+ "border",
30
+ "border-solid",
31
+ "border-slate-100",
32
+ "border-6",
33
+ "hover:scale-105",
34
+ ],
35
+ },
36
+ lg: {
37
+ avatar: [
38
+ "w-24",
39
+ "h-24",
40
+ "border",
41
+ "border-solid",
42
+ "border-slate-100",
43
+ "border-6",
44
+ "hover:scale-95",
45
+ ],
46
+ },
47
+ xl: {
48
+ avatar: [
49
+ "w-40",
50
+ "h-40",
51
+ "border",
52
+ "border-solid",
53
+ "border-slate-100",
54
+ "border-6",
55
+ ],
56
+ },
57
+ },
58
+ },
59
+ });
60
+ export const Avatar = (props) => {
61
+ const { base, avatar, action } = avatarStyles(props);
62
+ return (_jsxs(RadixAvatar.Root, { onClick: props.onClick, className: base(props), children: [_jsx(RadixAvatar.Image, { src: props.src, alt: props.label, className: avatar(props) }), props.size === "xl" && props.onActionClick && (_jsx("div", { className: action(props), children: _jsx(RoundButton, { intent: "primary", ariaLabel: `Edit ${props.label}`, onClick: props.onActionClick ?? (() => { }), children: _jsx(Edit, {}) }) })), _jsx(RadixAvatar.Fallback, { children: _jsx("div", { className: avatar(props), children: props.children }) })] }));
63
+ };
@@ -0,0 +1 @@
1
+ export declare const BrandingGallery: React.FC;
@@ -0,0 +1,139 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import appIconGradient from "./app-icon-gradient.svg";
3
+ import appIconWhite from "./app-icon-white.svg";
4
+ import hoverLogo from "./hover-logo.svg";
5
+ import logoInlineGradient from "./logo-inline-gradient.svg";
6
+ import logoInlineViolet from "./logo-inline-violet.svg";
7
+ import logoInlineWhite from "./logo-inline-white.svg";
8
+ import logoStackedGradient from "./logo-stacked-gradient.svg";
9
+ import logoStackedViolet from "./logo-stacked-violet.svg";
10
+ import logoStackedWhite from "./logo-stacked-white.svg";
11
+ import superzeichen from "./superzeichen.svg";
12
+ const brandingAssets = {
13
+ "App Icons": [
14
+ {
15
+ name: "App Icon Gradient",
16
+ src: appIconGradient,
17
+ width: 64,
18
+ height: 64,
19
+ filename: "app-icon-gradient.svg",
20
+ },
21
+ {
22
+ name: "App Icon White",
23
+ src: appIconWhite,
24
+ width: 64,
25
+ height: 64,
26
+ filename: "app-icon-white.svg",
27
+ },
28
+ ],
29
+ Logos: [
30
+ {
31
+ name: "Logo Inline Gradient",
32
+ src: logoInlineGradient,
33
+ width: 335,
34
+ height: 64,
35
+ filename: "logo-inline-gradient.svg",
36
+ },
37
+ {
38
+ name: "Logo Inline Violet",
39
+ src: logoInlineViolet,
40
+ width: 335,
41
+ height: 64,
42
+ filename: "logo-inline-violet.svg",
43
+ },
44
+ {
45
+ name: "Logo Inline White",
46
+ src: logoInlineWhite,
47
+ width: 335,
48
+ height: 64,
49
+ filename: "logo-inline-white.svg",
50
+ },
51
+ {
52
+ name: "Logo Stacked Gradient",
53
+ src: logoStackedGradient,
54
+ width: 210,
55
+ height: 80,
56
+ filename: "logo-stacked-gradient.svg",
57
+ },
58
+ {
59
+ name: "Logo Stacked Violet",
60
+ src: logoStackedViolet,
61
+ width: 210,
62
+ height: 80,
63
+ filename: "logo-stacked-violet.svg",
64
+ },
65
+ {
66
+ name: "Logo Stacked White",
67
+ src: logoStackedWhite,
68
+ width: 210,
69
+ height: 80,
70
+ filename: "logo-stacked-white.svg",
71
+ },
72
+ ],
73
+ "Hover Logo": [
74
+ {
75
+ name: "Hover Logo",
76
+ src: hoverLogo,
77
+ width: 64,
78
+ height: 64,
79
+ filename: "hover-logo.svg",
80
+ },
81
+ ],
82
+ Superzeichen: [
83
+ {
84
+ name: "Superzeichen",
85
+ src: superzeichen,
86
+ width: 64,
87
+ height: 64,
88
+ filename: "superzeichen.svg",
89
+ },
90
+ ],
91
+ };
92
+ export const BrandingGallery = () => (_jsx("div", { children: Object.entries(brandingAssets).map(([category, assets]) => (_jsxs("div", { style: { marginBottom: 48 }, children: [_jsx("h2", { style: {
93
+ fontSize: 20,
94
+ fontWeight: 600,
95
+ marginBottom: 24,
96
+ marginTop: 0,
97
+ }, children: category }), _jsx("div", { style: {
98
+ display: "grid",
99
+ gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
100
+ gap: 32,
101
+ padding: 4,
102
+ }, children: assets.map(({ name, src, width, height, filename }) => {
103
+ const isWhiteVariant = filename.includes("white") || filename.includes("hover");
104
+ return (_jsxs("div", { style: {
105
+ display: "flex",
106
+ flexDirection: "column",
107
+ alignItems: "center",
108
+ border: "1px solid #eee",
109
+ padding: 24,
110
+ borderRadius: 8,
111
+ backgroundColor: "#fafafa",
112
+ gap: 16,
113
+ }, children: [_jsx("div", { style: {
114
+ display: "flex",
115
+ alignItems: "center",
116
+ justifyContent: "center",
117
+ minHeight: 120,
118
+ width: "100%",
119
+ backgroundColor: isWhiteVariant ? "#7c3aed" : "transparent",
120
+ borderRadius: 4,
121
+ padding: isWhiteVariant ? 16 : 0,
122
+ }, children: _jsx("img", { src: src, alt: name, style: {
123
+ maxWidth: "100%",
124
+ height: "auto",
125
+ objectFit: "contain",
126
+ } }) }), _jsxs("div", { style: {
127
+ textAlign: "center",
128
+ width: "100%",
129
+ }, children: [_jsx("div", { style: { fontWeight: 600, marginBottom: 8 }, children: name }), _jsx("code", { style: {
130
+ fontSize: 11,
131
+ color: "#666",
132
+ display: "block",
133
+ marginBottom: 4,
134
+ }, children: filename }), _jsxs("code", { style: {
135
+ fontSize: 11,
136
+ color: "#666",
137
+ display: "block",
138
+ }, children: [width, " \u00D7 ", height] })] })] }, name));
139
+ }) })] }, category))) }));