spoko-design-system 1.20.0 → 1.21.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.
- package/.claude/settings.json +48 -48
- package/.github/dependabot.yml +11 -11
- package/.github/todo.yml +3 -3
- package/.github/workflows/claude.yml +37 -37
- package/.github/workflows/code-quality.yml +72 -72
- package/.github/workflows/deploy.yml +43 -43
- package/.husky/README.md +41 -41
- package/.husky/commit-msg +1 -1
- package/.husky/pre-commit +40 -40
- package/.prettierignore +14 -14
- package/.prettierrc +30 -30
- package/.stackblitzrc +5 -5
- package/.vscode/extensions.json +4 -4
- package/.vscode/launch.json +11 -11
- package/.vscode/settings.json +21 -21
- package/CHANGELOG.md +476 -462
- package/CLAUDE.md +268 -268
- package/LICENSE +21 -21
- package/README.md +303 -303
- package/TOOLTIPS.md +236 -236
- package/astro.config.mjs +84 -84
- package/commitlint.config.js +3 -3
- package/dev-dist/sw.js +91 -91
- package/dev-dist/workbox-c676b6d3.js +3391 -3391
- package/eslint.config.js +70 -70
- package/icon.config.ts +348 -348
- package/index.ts +78 -78
- package/package.json +160 -160
- package/public/arrow-bottom.svg +7 -7
- package/public/fonts/lg.svg +53 -53
- package/public/fonts/vwhead-bold-demo.html +549 -549
- package/public/fonts/vwhead-regular-demo.html +549 -549
- package/public/fonts/vwtext-bold-demo.html +549 -549
- package/public/fonts/vwtext-regular-demo.html +549 -549
- package/public/github.svg +3 -3
- package/public/grid_dot.svg +4 -4
- package/public/linkedin.svg +44 -44
- package/public/make-scrollable-code-focusable.js +3 -3
- package/public/pagefind.yml +3 -3
- package/public/polo.blue.svg +29 -29
- package/public/spoko.space.svg +71 -71
- package/public/twitter.svg +46 -46
- package/renovate.json +6 -6
- package/sandbox.config.json +11 -11
- package/sonar-project.properties +26 -26
- package/src/components/Category/CategoriesCarousel.astro +3 -7
- package/src/pages/components/badges.mdx +57 -57
- package/src/pages/components/breadcrumbs.mdx +139 -139
- package/src/pages/components/buttons.mdx +359 -359
- package/src/pages/components/card.mdx +294 -294
- package/src/pages/components/carousel.mdx +62 -62
- package/src/pages/components/copyright.mdx +42 -42
- package/src/pages/components/details-list.mdx +207 -207
- package/src/pages/components/features-list.mdx +37 -37
- package/src/pages/components/flags.mdx +49 -49
- package/src/pages/components/fuck-russia.mdx +39 -39
- package/src/pages/components/hand-drive.mdx +78 -78
- package/src/pages/components/headline.mdx +337 -337
- package/src/pages/components/image.mdx +513 -513
- package/src/pages/components/input.mdx +367 -367
- package/src/pages/components/jumbotron.mdx +530 -530
- package/src/pages/components/modal.mdx +212 -212
- package/src/pages/components/post-header.mdx +64 -64
- package/src/pages/components/pr-code.mdx +213 -213
- package/src/pages/components/product-engine.mdx +418 -418
- package/src/pages/components/product-number.mdx +58 -58
- package/src/pages/components/product-tile.mdx +51 -51
- package/src/pages/components/quote.mdx +33 -33
- package/src/pages/components/slimbanner.mdx +260 -260
- package/src/pages/components/table.mdx +108 -108
- package/src/pages/core/colors.mdx +21 -21
- package/src/pages/core/grid.mdx +193 -193
- package/src/pages/core/introduction.mdx +77 -77
- package/src/pages/core/tooltips.mdx +491 -491
- package/src/pages/patterns/introduction.mdx +60 -60
- package/src/styles/_variables.scss +70 -70
- package/tailwind.config.cjs +8 -8
- package/tsconfig.json +28 -28
- package/uno-config/index.ts +269 -269
- package/uno-config/theme/breakpoints.ts +9 -9
- package/uno-config/theme/colors.ts +65 -65
- package/uno-config/theme/dimensions.ts +17 -17
- package/uno-config/theme/effects.ts +14 -14
- package/uno-config/theme/grid.ts +10 -10
- package/uno-config/theme/index.ts +26 -26
- package/uno-config/theme/shortcuts/buttons.ts +53 -53
- package/uno-config/theme/shortcuts/components.ts +124 -124
- package/uno-config/theme/shortcuts/index.ts +20 -20
- package/uno-config/theme/shortcuts/jumbotron.ts +71 -71
- package/uno-config/theme/shortcuts/layout.ts +75 -75
- package/uno-config/theme/typography.ts +29 -29
- package/uno.config.ts +2 -2
package/CLAUDE.md
CHANGED
|
@@ -1,268 +1,268 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
2
|
-
|
|
3
|
-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
-
|
|
5
|
-
## Project Overview
|
|
6
|
-
|
|
7
|
-
**Spoko Design System (SDS)** is an Astro-based design system with Vue 3 components and UnoCSS for styling. It's published as `spoko-design-system` on npm and serves as both a documentation site and a component library. The project uses automated semantic-release for version management and publishing.
|
|
8
|
-
|
|
9
|
-
## Common Commands
|
|
10
|
-
|
|
11
|
-
### Development
|
|
12
|
-
```bash
|
|
13
|
-
pnpm dev # Start development server on port 1234
|
|
14
|
-
pnpm start # Alias for dev
|
|
15
|
-
pnpm build # Build production site
|
|
16
|
-
pnpm preview # Preview production build
|
|
17
|
-
pnpm check # Run Astro type checking
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
### Code Quality
|
|
21
|
-
```bash
|
|
22
|
-
pnpm lint # Lint all source files
|
|
23
|
-
pnpm lint:fix # Lint and auto-fix issues
|
|
24
|
-
pnpm format # Format code with Prettier
|
|
25
|
-
pnpm format:check # Check code formatting
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### Publishing
|
|
29
|
-
```bash
|
|
30
|
-
pnpm semantic-release # Manual release (usually automated via CI)
|
|
31
|
-
pnpm prepublishOnly # Runs build before publish (automatic)
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Architecture
|
|
35
|
-
|
|
36
|
-
### Dual-Purpose Structure
|
|
37
|
-
This project serves two purposes simultaneously:
|
|
38
|
-
1. **Documentation Site**: Astro-based documentation at https://sds.spoko.space/
|
|
39
|
-
2. **npm Package**: Component library exported via `index.ts` at project root
|
|
40
|
-
|
|
41
|
-
**Key Principle**: Components must work in BOTH contexts:
|
|
42
|
-
- As part of the Astro documentation site (in `src/`)
|
|
43
|
-
- As importable npm package components (exported from root `index.ts`)
|
|
44
|
-
|
|
45
|
-
### Component Exports Pattern
|
|
46
|
-
Components are exported from root `index.ts`, NOT from `src/`:
|
|
47
|
-
```typescript
|
|
48
|
-
// ✅ Correct
|
|
49
|
-
export { default as Button } from './src/components/Button.vue';
|
|
50
|
-
|
|
51
|
-
// ❌ Wrong
|
|
52
|
-
export { default as Button } from './components/Button.vue';
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### UnoCSS Configuration System
|
|
56
|
-
|
|
57
|
-
**Critical**: UnoCSS config is split across two locations:
|
|
58
|
-
|
|
59
|
-
1. **Root `uno.config.ts`**: Simple wrapper that imports the main config
|
|
60
|
-
```typescript
|
|
61
|
-
import { createSdsConfig } from './uno-config';
|
|
62
|
-
export default createSdsConfig();
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
2. **`uno-config/` directory**: Main configuration system
|
|
66
|
-
- `uno-config/index.ts`: Core config with `createSdsConfig()` function
|
|
67
|
-
- `uno-config/theme/`: Theme definitions (colors, typography, breakpoints, etc.)
|
|
68
|
-
- `uno-config/theme/shortcuts/`: Component shortcuts organized by category
|
|
69
|
-
|
|
70
|
-
**When modifying UnoCSS**:
|
|
71
|
-
- Theme changes: Modify files in `uno-config/theme/`
|
|
72
|
-
- Shortcut additions: Add to appropriate file in `uno-config/theme/shortcuts/`
|
|
73
|
-
- Never edit root `uno.config.ts` directly
|
|
74
|
-
- The `createSdsConfig()` function can be imported by consumers to extend the config
|
|
75
|
-
|
|
76
|
-
### Icon System
|
|
77
|
-
|
|
78
|
-
Icons use two separate but coordinated systems:
|
|
79
|
-
|
|
80
|
-
1. **UnoCSS Icons** (in `uno-config/index.ts`):
|
|
81
|
-
- Static imports for all icon JSON files
|
|
82
|
-
- Used via `i-{collection}-{name}` classes (e.g., `i-lucide-car`)
|
|
83
|
-
- All collections statically imported to prevent Vite module runner issues
|
|
84
|
-
|
|
85
|
-
2. **astro-icon** (in `icon.config.ts`):
|
|
86
|
-
- Configured via `iconConfig` export
|
|
87
|
-
- Lists specific icons to include from each collection
|
|
88
|
-
- Used in Astro components via `<Icon name="collection:icon" />`
|
|
89
|
-
|
|
90
|
-
**Adding new icons**:
|
|
91
|
-
1. Add icon name to `icon.config.ts` in the appropriate collection's array
|
|
92
|
-
2. Icon is automatically available in both UnoCSS (class) and astro-icon (component)
|
|
93
|
-
|
|
94
|
-
### Navigation & Sidebar
|
|
95
|
-
|
|
96
|
-
Site navigation is configured in `src/config.ts`:
|
|
97
|
-
- `SITE`: Site metadata (title, description, social links)
|
|
98
|
-
- `SIDEBAR`: Array of navigation items with `text`, `link`, and optional `header` flag
|
|
99
|
-
- Headers create section dividers in the left sidebar
|
|
100
|
-
- Links are relative to site root (e.g., `/core/introduction/`)
|
|
101
|
-
|
|
102
|
-
### TypeScript Paths
|
|
103
|
-
|
|
104
|
-
Three main path aliases defined in `tsconfig.json`:
|
|
105
|
-
- `@components/*` → `src/components/*`
|
|
106
|
-
- `@utils/*` → `src/utils/*`
|
|
107
|
-
- `@types/*` → `src/types/*`
|
|
108
|
-
|
|
109
|
-
### Component Organization
|
|
110
|
-
|
|
111
|
-
Components are split by framework and purpose:
|
|
112
|
-
|
|
113
|
-
**Vue Components** (`.vue`):
|
|
114
|
-
- Interactive components with state
|
|
115
|
-
- Examples: `Button.vue`, `Input.vue`, `ProductDetailsList.vue`
|
|
116
|
-
|
|
117
|
-
**Astro Components** (`.astro`):
|
|
118
|
-
- Static or mostly-static components
|
|
119
|
-
- Examples: `Jumbotron.astro`, `Copyright.astro`, `HandDrive.astro`
|
|
120
|
-
|
|
121
|
-
**Component Subdirectories**:
|
|
122
|
-
- `components/Product/`: Product-related components
|
|
123
|
-
- `components/Category/`: Category management components
|
|
124
|
-
- `components/Post/`: Blog/post components
|
|
125
|
-
- `components/Jumbotron/variants/`: Jumbotron variations (Hero, Post, PostSplit, Default)
|
|
126
|
-
|
|
127
|
-
### Utilities Organization
|
|
128
|
-
|
|
129
|
-
Utilities are organized by domain in `src/utils/`:
|
|
130
|
-
- `text/`: Text formatting (formatDate, getNumberFormatted, etc.)
|
|
131
|
-
- `product/`: Product-related utilities (getPriceFormatted, getProductChecklist)
|
|
132
|
-
- `seo/`: SEO helpers (getShorterDescription)
|
|
133
|
-
- `api/`: API interaction utilities
|
|
134
|
-
- `category/`: Category management utilities
|
|
135
|
-
|
|
136
|
-
Root `src/utils/text.ts` exports common text utilities (text2paragraphs, countWords, etc.)
|
|
137
|
-
|
|
138
|
-
### Theme System
|
|
139
|
-
|
|
140
|
-
Theme is modular in `uno-config/theme/`:
|
|
141
|
-
- `colors.ts`: Complete color palette (blue shades, accent, neutral, slate, system)
|
|
142
|
-
- `typography.ts`: Font families, sizes, weights
|
|
143
|
-
- `breakpoints.ts`: Responsive breakpoints
|
|
144
|
-
- `dimensions.ts`: Spacing, sizing scales
|
|
145
|
-
- `effects.ts`: Shadows, borders, transitions
|
|
146
|
-
- `grid.ts`: Grid template configurations
|
|
147
|
-
- `container.ts`: Container max-widths and padding
|
|
148
|
-
|
|
149
|
-
Design constants are duplicated in `src/design.config.ts` for documentation pages showing colors, typography, shadows, and fonts.
|
|
150
|
-
|
|
151
|
-
### Shortcuts System
|
|
152
|
-
|
|
153
|
-
UnoCSS shortcuts are organized by component type in `uno-config/theme/shortcuts/`:
|
|
154
|
-
- `buttons.ts`: Button variants and states
|
|
155
|
-
- `inputs.ts`: Form input styling with floating labels
|
|
156
|
-
- `layout.ts`: Container, grid, and layout shortcuts
|
|
157
|
-
- `components.ts`: Breadcrumbs, features lists, category links
|
|
158
|
-
- `product.ts`: Product-specific component shortcuts
|
|
159
|
-
- `jumbotron.ts`: Jumbotron variants
|
|
160
|
-
- `constants.ts`: Shared constants used across shortcuts
|
|
161
|
-
|
|
162
|
-
## Semantic Release & Commit Conventions
|
|
163
|
-
|
|
164
|
-
This project uses automated semantic-release. **All commits MUST follow conventional commits format**:
|
|
165
|
-
|
|
166
|
-
```
|
|
167
|
-
<type>[optional scope]: <description>
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
**Commit Types**:
|
|
171
|
-
- `feat`: New feature → MINOR version bump (0.1.0)
|
|
172
|
-
- `fix`: Bug fix → PATCH version bump (0.0.1)
|
|
173
|
-
- `perf`, `refactor`, `style`, `docs`: → PATCH version bump
|
|
174
|
-
- `test`, `ci`, `chore`: → No release
|
|
175
|
-
|
|
176
|
-
**Breaking Changes**: Add `BREAKING CHANGE:` footer → MAJOR version bump (1.0.0)
|
|
177
|
-
|
|
178
|
-
**Examples**:
|
|
179
|
-
```bash
|
|
180
|
-
feat(components): add Modal component with accessibility features
|
|
181
|
-
fix(Input): resolve floating label positioning
|
|
182
|
-
docs: update Button component examples
|
|
183
|
-
chore: update dependencies [skip ci]
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
On merge to `main`, GitHub Actions automatically:
|
|
187
|
-
1. Analyzes commits
|
|
188
|
-
2. Determines version bump
|
|
189
|
-
3. Updates package.json and CHANGELOG.md
|
|
190
|
-
4. Creates GitHub release
|
|
191
|
-
5. Publishes to npm
|
|
192
|
-
|
|
193
|
-
## Development Guidelines
|
|
194
|
-
|
|
195
|
-
### Adding New Components
|
|
196
|
-
|
|
197
|
-
1. Create component in appropriate location:
|
|
198
|
-
- Vue: `src/components/ComponentName.vue`
|
|
199
|
-
- Astro: `src/components/ComponentName.astro`
|
|
200
|
-
|
|
201
|
-
2. Export from root `index.ts`:
|
|
202
|
-
```typescript
|
|
203
|
-
export { default as ComponentName } from './src/components/ComponentName.vue';
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
3. Add documentation page in `src/pages/components/component-name.mdx`
|
|
207
|
-
|
|
208
|
-
4. Add to navigation in `src/config.ts`:
|
|
209
|
-
```typescript
|
|
210
|
-
{ text: 'Component Name', link: '/components/component-name/' }
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
### Adding UnoCSS Shortcuts
|
|
214
|
-
|
|
215
|
-
1. Identify appropriate shortcuts file in `uno-config/theme/shortcuts/`
|
|
216
|
-
2. Add shortcut as `[name, classes]` tuple array entry
|
|
217
|
-
3. Shortcuts automatically available as classes
|
|
218
|
-
4. Use `.component-preview` class in docs to wrap component examples in grid
|
|
219
|
-
|
|
220
|
-
### Working with Astro Integration
|
|
221
|
-
|
|
222
|
-
- Astro config in `astro.config.mjs` loads:
|
|
223
|
-
- Vue integration for `.vue` components
|
|
224
|
-
- UnoCSS with SDS config
|
|
225
|
-
- MDX for markdown pages
|
|
226
|
-
- PWA support via vite-pwa
|
|
227
|
-
- Pagefind for search
|
|
228
|
-
- Sitemap generation
|
|
229
|
-
|
|
230
|
-
- Layouts in `src/layouts/`:
|
|
231
|
-
- `MainLayout.astro`: Standard page layout with sidebar
|
|
232
|
-
- `Layout.astro`: Base HTML layout
|
|
233
|
-
|
|
234
|
-
### Path Resolution
|
|
235
|
-
|
|
236
|
-
When importing:
|
|
237
|
-
- Use TypeScript paths (`@components/`, `@utils/`, `@types/`)
|
|
238
|
-
- Root imports in `index.ts` use `./src/` prefix
|
|
239
|
-
- Component imports within `src/` use aliases or relative paths
|
|
240
|
-
|
|
241
|
-
### Testing Icons
|
|
242
|
-
|
|
243
|
-
Before using an icon, verify it's in `icon.config.ts`:
|
|
244
|
-
- Check `include` object for the collection
|
|
245
|
-
- Icon must be listed in array for that collection
|
|
246
|
-
- Use helper functions: `isIconIncluded()`, `getIncludedIcons()`
|
|
247
|
-
|
|
248
|
-
## Package Configuration
|
|
249
|
-
|
|
250
|
-
- **Entry point**: `index.ts` (root level)
|
|
251
|
-
- **Exports**:
|
|
252
|
-
- `.`: Main component exports
|
|
253
|
-
- `./styles/*`: Direct style imports
|
|
254
|
-
- `./icons`: Icon configuration
|
|
255
|
-
- `./icon-collections`: Icon collection list
|
|
256
|
-
- `./uno-config`: UnoCSS config for consumers
|
|
257
|
-
|
|
258
|
-
- **Engines**: Node >= 22.17.0, pnpm >= 10.16.1
|
|
259
|
-
- **Package manager**: pnpm (v10.17.1)
|
|
260
|
-
|
|
261
|
-
## Important Notes
|
|
262
|
-
|
|
263
|
-
- Server runs on port 1234 (not default 4321)
|
|
264
|
-
- Build output goes to `dist/`
|
|
265
|
-
- Development artifacts in `.astro/` and `dev-dist/`
|
|
266
|
-
- Image domains whitelisted: placehold.co, polo.blue, img.freepik.com, polo6r.pl
|
|
267
|
-
- PWA manifest configured for "Spoko Design System"
|
|
268
|
-
- Compression and inlining enabled for production builds
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
**Spoko Design System (SDS)** is an Astro-based design system with Vue 3 components and UnoCSS for styling. It's published as `spoko-design-system` on npm and serves as both a documentation site and a component library. The project uses automated semantic-release for version management and publishing.
|
|
8
|
+
|
|
9
|
+
## Common Commands
|
|
10
|
+
|
|
11
|
+
### Development
|
|
12
|
+
```bash
|
|
13
|
+
pnpm dev # Start development server on port 1234
|
|
14
|
+
pnpm start # Alias for dev
|
|
15
|
+
pnpm build # Build production site
|
|
16
|
+
pnpm preview # Preview production build
|
|
17
|
+
pnpm check # Run Astro type checking
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Code Quality
|
|
21
|
+
```bash
|
|
22
|
+
pnpm lint # Lint all source files
|
|
23
|
+
pnpm lint:fix # Lint and auto-fix issues
|
|
24
|
+
pnpm format # Format code with Prettier
|
|
25
|
+
pnpm format:check # Check code formatting
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Publishing
|
|
29
|
+
```bash
|
|
30
|
+
pnpm semantic-release # Manual release (usually automated via CI)
|
|
31
|
+
pnpm prepublishOnly # Runs build before publish (automatic)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Architecture
|
|
35
|
+
|
|
36
|
+
### Dual-Purpose Structure
|
|
37
|
+
This project serves two purposes simultaneously:
|
|
38
|
+
1. **Documentation Site**: Astro-based documentation at https://sds.spoko.space/
|
|
39
|
+
2. **npm Package**: Component library exported via `index.ts` at project root
|
|
40
|
+
|
|
41
|
+
**Key Principle**: Components must work in BOTH contexts:
|
|
42
|
+
- As part of the Astro documentation site (in `src/`)
|
|
43
|
+
- As importable npm package components (exported from root `index.ts`)
|
|
44
|
+
|
|
45
|
+
### Component Exports Pattern
|
|
46
|
+
Components are exported from root `index.ts`, NOT from `src/`:
|
|
47
|
+
```typescript
|
|
48
|
+
// ✅ Correct
|
|
49
|
+
export { default as Button } from './src/components/Button.vue';
|
|
50
|
+
|
|
51
|
+
// ❌ Wrong
|
|
52
|
+
export { default as Button } from './components/Button.vue';
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### UnoCSS Configuration System
|
|
56
|
+
|
|
57
|
+
**Critical**: UnoCSS config is split across two locations:
|
|
58
|
+
|
|
59
|
+
1. **Root `uno.config.ts`**: Simple wrapper that imports the main config
|
|
60
|
+
```typescript
|
|
61
|
+
import { createSdsConfig } from './uno-config';
|
|
62
|
+
export default createSdsConfig();
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
2. **`uno-config/` directory**: Main configuration system
|
|
66
|
+
- `uno-config/index.ts`: Core config with `createSdsConfig()` function
|
|
67
|
+
- `uno-config/theme/`: Theme definitions (colors, typography, breakpoints, etc.)
|
|
68
|
+
- `uno-config/theme/shortcuts/`: Component shortcuts organized by category
|
|
69
|
+
|
|
70
|
+
**When modifying UnoCSS**:
|
|
71
|
+
- Theme changes: Modify files in `uno-config/theme/`
|
|
72
|
+
- Shortcut additions: Add to appropriate file in `uno-config/theme/shortcuts/`
|
|
73
|
+
- Never edit root `uno.config.ts` directly
|
|
74
|
+
- The `createSdsConfig()` function can be imported by consumers to extend the config
|
|
75
|
+
|
|
76
|
+
### Icon System
|
|
77
|
+
|
|
78
|
+
Icons use two separate but coordinated systems:
|
|
79
|
+
|
|
80
|
+
1. **UnoCSS Icons** (in `uno-config/index.ts`):
|
|
81
|
+
- Static imports for all icon JSON files
|
|
82
|
+
- Used via `i-{collection}-{name}` classes (e.g., `i-lucide-car`)
|
|
83
|
+
- All collections statically imported to prevent Vite module runner issues
|
|
84
|
+
|
|
85
|
+
2. **astro-icon** (in `icon.config.ts`):
|
|
86
|
+
- Configured via `iconConfig` export
|
|
87
|
+
- Lists specific icons to include from each collection
|
|
88
|
+
- Used in Astro components via `<Icon name="collection:icon" />`
|
|
89
|
+
|
|
90
|
+
**Adding new icons**:
|
|
91
|
+
1. Add icon name to `icon.config.ts` in the appropriate collection's array
|
|
92
|
+
2. Icon is automatically available in both UnoCSS (class) and astro-icon (component)
|
|
93
|
+
|
|
94
|
+
### Navigation & Sidebar
|
|
95
|
+
|
|
96
|
+
Site navigation is configured in `src/config.ts`:
|
|
97
|
+
- `SITE`: Site metadata (title, description, social links)
|
|
98
|
+
- `SIDEBAR`: Array of navigation items with `text`, `link`, and optional `header` flag
|
|
99
|
+
- Headers create section dividers in the left sidebar
|
|
100
|
+
- Links are relative to site root (e.g., `/core/introduction/`)
|
|
101
|
+
|
|
102
|
+
### TypeScript Paths
|
|
103
|
+
|
|
104
|
+
Three main path aliases defined in `tsconfig.json`:
|
|
105
|
+
- `@components/*` → `src/components/*`
|
|
106
|
+
- `@utils/*` → `src/utils/*`
|
|
107
|
+
- `@types/*` → `src/types/*`
|
|
108
|
+
|
|
109
|
+
### Component Organization
|
|
110
|
+
|
|
111
|
+
Components are split by framework and purpose:
|
|
112
|
+
|
|
113
|
+
**Vue Components** (`.vue`):
|
|
114
|
+
- Interactive components with state
|
|
115
|
+
- Examples: `Button.vue`, `Input.vue`, `ProductDetailsList.vue`
|
|
116
|
+
|
|
117
|
+
**Astro Components** (`.astro`):
|
|
118
|
+
- Static or mostly-static components
|
|
119
|
+
- Examples: `Jumbotron.astro`, `Copyright.astro`, `HandDrive.astro`
|
|
120
|
+
|
|
121
|
+
**Component Subdirectories**:
|
|
122
|
+
- `components/Product/`: Product-related components
|
|
123
|
+
- `components/Category/`: Category management components
|
|
124
|
+
- `components/Post/`: Blog/post components
|
|
125
|
+
- `components/Jumbotron/variants/`: Jumbotron variations (Hero, Post, PostSplit, Default)
|
|
126
|
+
|
|
127
|
+
### Utilities Organization
|
|
128
|
+
|
|
129
|
+
Utilities are organized by domain in `src/utils/`:
|
|
130
|
+
- `text/`: Text formatting (formatDate, getNumberFormatted, etc.)
|
|
131
|
+
- `product/`: Product-related utilities (getPriceFormatted, getProductChecklist)
|
|
132
|
+
- `seo/`: SEO helpers (getShorterDescription)
|
|
133
|
+
- `api/`: API interaction utilities
|
|
134
|
+
- `category/`: Category management utilities
|
|
135
|
+
|
|
136
|
+
Root `src/utils/text.ts` exports common text utilities (text2paragraphs, countWords, etc.)
|
|
137
|
+
|
|
138
|
+
### Theme System
|
|
139
|
+
|
|
140
|
+
Theme is modular in `uno-config/theme/`:
|
|
141
|
+
- `colors.ts`: Complete color palette (blue shades, accent, neutral, slate, system)
|
|
142
|
+
- `typography.ts`: Font families, sizes, weights
|
|
143
|
+
- `breakpoints.ts`: Responsive breakpoints
|
|
144
|
+
- `dimensions.ts`: Spacing, sizing scales
|
|
145
|
+
- `effects.ts`: Shadows, borders, transitions
|
|
146
|
+
- `grid.ts`: Grid template configurations
|
|
147
|
+
- `container.ts`: Container max-widths and padding
|
|
148
|
+
|
|
149
|
+
Design constants are duplicated in `src/design.config.ts` for documentation pages showing colors, typography, shadows, and fonts.
|
|
150
|
+
|
|
151
|
+
### Shortcuts System
|
|
152
|
+
|
|
153
|
+
UnoCSS shortcuts are organized by component type in `uno-config/theme/shortcuts/`:
|
|
154
|
+
- `buttons.ts`: Button variants and states
|
|
155
|
+
- `inputs.ts`: Form input styling with floating labels
|
|
156
|
+
- `layout.ts`: Container, grid, and layout shortcuts
|
|
157
|
+
- `components.ts`: Breadcrumbs, features lists, category links
|
|
158
|
+
- `product.ts`: Product-specific component shortcuts
|
|
159
|
+
- `jumbotron.ts`: Jumbotron variants
|
|
160
|
+
- `constants.ts`: Shared constants used across shortcuts
|
|
161
|
+
|
|
162
|
+
## Semantic Release & Commit Conventions
|
|
163
|
+
|
|
164
|
+
This project uses automated semantic-release. **All commits MUST follow conventional commits format**:
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
<type>[optional scope]: <description>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Commit Types**:
|
|
171
|
+
- `feat`: New feature → MINOR version bump (0.1.0)
|
|
172
|
+
- `fix`: Bug fix → PATCH version bump (0.0.1)
|
|
173
|
+
- `perf`, `refactor`, `style`, `docs`: → PATCH version bump
|
|
174
|
+
- `test`, `ci`, `chore`: → No release
|
|
175
|
+
|
|
176
|
+
**Breaking Changes**: Add `BREAKING CHANGE:` footer → MAJOR version bump (1.0.0)
|
|
177
|
+
|
|
178
|
+
**Examples**:
|
|
179
|
+
```bash
|
|
180
|
+
feat(components): add Modal component with accessibility features
|
|
181
|
+
fix(Input): resolve floating label positioning
|
|
182
|
+
docs: update Button component examples
|
|
183
|
+
chore: update dependencies [skip ci]
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
On merge to `main`, GitHub Actions automatically:
|
|
187
|
+
1. Analyzes commits
|
|
188
|
+
2. Determines version bump
|
|
189
|
+
3. Updates package.json and CHANGELOG.md
|
|
190
|
+
4. Creates GitHub release
|
|
191
|
+
5. Publishes to npm
|
|
192
|
+
|
|
193
|
+
## Development Guidelines
|
|
194
|
+
|
|
195
|
+
### Adding New Components
|
|
196
|
+
|
|
197
|
+
1. Create component in appropriate location:
|
|
198
|
+
- Vue: `src/components/ComponentName.vue`
|
|
199
|
+
- Astro: `src/components/ComponentName.astro`
|
|
200
|
+
|
|
201
|
+
2. Export from root `index.ts`:
|
|
202
|
+
```typescript
|
|
203
|
+
export { default as ComponentName } from './src/components/ComponentName.vue';
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
3. Add documentation page in `src/pages/components/component-name.mdx`
|
|
207
|
+
|
|
208
|
+
4. Add to navigation in `src/config.ts`:
|
|
209
|
+
```typescript
|
|
210
|
+
{ text: 'Component Name', link: '/components/component-name/' }
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Adding UnoCSS Shortcuts
|
|
214
|
+
|
|
215
|
+
1. Identify appropriate shortcuts file in `uno-config/theme/shortcuts/`
|
|
216
|
+
2. Add shortcut as `[name, classes]` tuple array entry
|
|
217
|
+
3. Shortcuts automatically available as classes
|
|
218
|
+
4. Use `.component-preview` class in docs to wrap component examples in grid
|
|
219
|
+
|
|
220
|
+
### Working with Astro Integration
|
|
221
|
+
|
|
222
|
+
- Astro config in `astro.config.mjs` loads:
|
|
223
|
+
- Vue integration for `.vue` components
|
|
224
|
+
- UnoCSS with SDS config
|
|
225
|
+
- MDX for markdown pages
|
|
226
|
+
- PWA support via vite-pwa
|
|
227
|
+
- Pagefind for search
|
|
228
|
+
- Sitemap generation
|
|
229
|
+
|
|
230
|
+
- Layouts in `src/layouts/`:
|
|
231
|
+
- `MainLayout.astro`: Standard page layout with sidebar
|
|
232
|
+
- `Layout.astro`: Base HTML layout
|
|
233
|
+
|
|
234
|
+
### Path Resolution
|
|
235
|
+
|
|
236
|
+
When importing:
|
|
237
|
+
- Use TypeScript paths (`@components/`, `@utils/`, `@types/`)
|
|
238
|
+
- Root imports in `index.ts` use `./src/` prefix
|
|
239
|
+
- Component imports within `src/` use aliases or relative paths
|
|
240
|
+
|
|
241
|
+
### Testing Icons
|
|
242
|
+
|
|
243
|
+
Before using an icon, verify it's in `icon.config.ts`:
|
|
244
|
+
- Check `include` object for the collection
|
|
245
|
+
- Icon must be listed in array for that collection
|
|
246
|
+
- Use helper functions: `isIconIncluded()`, `getIncludedIcons()`
|
|
247
|
+
|
|
248
|
+
## Package Configuration
|
|
249
|
+
|
|
250
|
+
- **Entry point**: `index.ts` (root level)
|
|
251
|
+
- **Exports**:
|
|
252
|
+
- `.`: Main component exports
|
|
253
|
+
- `./styles/*`: Direct style imports
|
|
254
|
+
- `./icons`: Icon configuration
|
|
255
|
+
- `./icon-collections`: Icon collection list
|
|
256
|
+
- `./uno-config`: UnoCSS config for consumers
|
|
257
|
+
|
|
258
|
+
- **Engines**: Node >= 22.17.0, pnpm >= 10.16.1
|
|
259
|
+
- **Package manager**: pnpm (v10.17.1)
|
|
260
|
+
|
|
261
|
+
## Important Notes
|
|
262
|
+
|
|
263
|
+
- Server runs on port 1234 (not default 4321)
|
|
264
|
+
- Build output goes to `dist/`
|
|
265
|
+
- Development artifacts in `.astro/` and `dev-dist/`
|
|
266
|
+
- Image domains whitelisted: placehold.co, polo.blue, img.freepik.com, polo6r.pl
|
|
267
|
+
- PWA manifest configured for "Spoko Design System"
|
|
268
|
+
- Compression and inlining enabled for production builds
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 Jordi Enric Roig Ramis
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Jordi Enric Roig Ramis
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|