@1money/component-ui 0.0.23 → 0.0.25
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/es/components/Table/interface.d.ts +2 -1
- package/es/components/Table/renderers/EmptyState.d.ts +2 -1
- package/es/components/Table/renderers/EmptyState.js +15 -8
- package/es/components/Table/style/Table.css +1 -1
- package/es/index.css +1 -1
- package/es/stories/docs/ComponentDocsPage.js +234 -0
- package/es/stories/docs/componentDocMeta.js +97 -0
- package/es/stories/docs/storybook-docs.css +79 -0
- package/lib/components/Table/interface.d.ts +2 -1
- package/lib/components/Table/renderers/EmptyState.d.ts +2 -1
- package/lib/components/Table/renderers/EmptyState.js +15 -7
- package/lib/components/Table/style/Table.css +1 -1
- package/lib/index.css +1 -1
- package/lib/stories/docs/ComponentDocsPage.js +244 -0
- package/lib/stories/docs/componentDocMeta.js +104 -0
- package/lib/stories/docs/storybook-docs.css +79 -0
- package/package.json +23 -8
- package/scripts/mcp-server/README.md +267 -0
- package/scripts/mcp-server/bin.mjs +2 -0
- package/scripts/mcp-server/drift.json +5 -0
- package/scripts/mcp-server/examples.generated.json +2651 -0
- package/scripts/mcp-server/index.generated.json +18098 -0
- package/scripts/mcp-server/index.mjs +308 -26
- package/scripts/mcp-server/tools/get-examples.mjs +125 -0
- package/scripts/mcp-server/tools/get-library-info.mjs +25 -0
- package/scripts/mcp-server/tools/get-symbol.mjs +232 -0
- package/scripts/mcp-server/tools/get-token.mjs +60 -0
- package/scripts/mcp-server/tools/list-icons.mjs +38 -0
- package/scripts/mcp-server/tools/list-symbols.mjs +46 -0
- package/scripts/mcp-server/tools/resolve-import.mjs +125 -0
- package/scripts/mcp-server/tools/search-symbols.mjs +79 -0
- package/.agents/skills/1money-component-dev/SKILL.md +0 -224
- package/.agents/skills/1money-component-dev/checklist.md +0 -159
- package/.agents/skills/1money-component-dev/references/ComponentPatterns.md +0 -478
- package/.agents/skills/1money-component-dev/references/FigmaExtractionChecklist.md +0 -144
- package/.agents/skills/1money-component-dev/references/HooksGuide.md +0 -360
- package/.agents/skills/1money-component-dev/references/SemanticColors.md +0 -215
- package/.agents/skills/1money-component-dev/references/StyleSystemAPI.md +0 -389
- package/.claude/settings.local.json +0 -120
- package/.claude/skills/1money-component-dev/SKILL.md +0 -229
- package/.claude/skills/1money-component-dev/checklist.md +0 -159
- package/.claude/skills/1money-component-dev/references/ComponentPatterns.md +0 -478
- package/.claude/skills/1money-component-dev/references/FigmaExtractionChecklist.md +0 -144
- package/.claude/skills/1money-component-dev/references/HooksGuide.md +0 -360
- package/.claude/skills/1money-component-dev/references/SemanticColors.md +0 -215
- package/.claude/skills/1money-component-dev/references/StyleSystemAPI.md +0 -389
- package/.claude/skills/1money-component-review/SKILL.md +0 -316
- package/.claude/skills/component-pipeline/SKILL.md +0 -116
- package/.claude/skills/component-pipeline/checklist.md +0 -125
- package/.hintrc +0 -13
- package/@types/global.d.ts +0 -28
- package/AGENTS.md +0 -546
- package/CLAUDE.md +0 -1
- package/jest.setup.d.ts +0 -1
- package/jest.setup.ts +0 -1
- package/patches/primereact.patch +0 -323
- package/patches/react-pro-sidebar.patch +0 -6421
- package/public/favicon.ico +0 -0
- package/public/fonts/Aeonik/Aeonik-Air.ttf +0 -0
- package/public/fonts/Aeonik/Aeonik-AirItalic.ttf +0 -0
- package/public/fonts/Aeonik/Aeonik-Black.ttf +0 -0
- package/public/fonts/Aeonik/Aeonik-BlackItalic.ttf +0 -0
- package/public/fonts/Aeonik/Aeonik-Bold.ttf +0 -0
- package/public/fonts/Aeonik/Aeonik-BoldItalic.ttf +0 -0
- package/public/fonts/Aeonik/Aeonik-Light.ttf +0 -0
- package/public/fonts/Aeonik/Aeonik-LightItalic.ttf +0 -0
- package/public/fonts/Aeonik/Aeonik-Medium.ttf +0 -0
- package/public/fonts/Aeonik/Aeonik-MediumItalic.ttf +0 -0
- package/public/fonts/Aeonik/Aeonik-Regular.ttf +0 -0
- package/public/fonts/Aeonik/Aeonik-RegularItalic.ttf +0 -0
- package/public/fonts/Aeonik/Aeonik-Thin.ttf +0 -0
- package/public/fonts/Aeonik/Aeonik-ThinItalic.ttf +0 -0
- package/public/fonts/Inter/Inter-Black.ttf +0 -0
- package/public/fonts/Inter/Inter-BlackItalic.ttf +0 -0
- package/public/fonts/Inter/Inter-Bold.ttf +0 -0
- package/public/fonts/Inter/Inter-BoldItalic.ttf +0 -0
- package/public/fonts/Inter/Inter-ExtraBold.ttf +0 -0
- package/public/fonts/Inter/Inter-ExtraBoldItalic.ttf +0 -0
- package/public/fonts/Inter/Inter-ExtraLight.ttf +0 -0
- package/public/fonts/Inter/Inter-ExtraLightItalic.ttf +0 -0
- package/public/fonts/Inter/Inter-Italic.ttf +0 -0
- package/public/fonts/Inter/Inter-Light.ttf +0 -0
- package/public/fonts/Inter/Inter-LightItalic.ttf +0 -0
- package/public/fonts/Inter/Inter-Medium.ttf +0 -0
- package/public/fonts/Inter/Inter-MediumItalic.ttf +0 -0
- package/public/fonts/Inter/Inter-Regular.ttf +0 -0
- package/public/fonts/Inter/Inter-SemiBold.ttf +0 -0
- package/public/fonts/Inter/Inter-SemiBoldItalic.ttf +0 -0
- package/public/fonts/Inter/Inter-Thin.ttf +0 -0
- package/public/fonts/Inter/Inter-ThinItalic.ttf +0 -0
- package/public/fonts/Outfit/Outfit-Black.ttf +0 -0
- package/public/fonts/Outfit/Outfit-Bold.ttf +0 -0
- package/public/fonts/Outfit/Outfit-ExtraBold.ttf +0 -0
- package/public/fonts/Outfit/Outfit-ExtraLight.ttf +0 -0
- package/public/fonts/Outfit/Outfit-Light.ttf +0 -0
- package/public/fonts/Outfit/Outfit-Medium.ttf +0 -0
- package/public/fonts/Outfit/Outfit-Regular.ttf +0 -0
- package/public/fonts/Outfit/Outfit-SemiBold.ttf +0 -0
- package/public/fonts/Outfit/Outfit-Thin.ttf +0 -0
- package/public/github-mark.svg +0 -3
- package/public/tokens/GYEN.svg +0 -9
- package/public/tokens/PYUSD.svg +0 -9
- package/public/tokens/USDT.svg +0 -6
- package/scripts/mcp-server/resources.d.mts +0 -1
- package/scripts/mcp-server/resources.mjs +0 -102
- package/test/jsdom-global-register.d.ts +0 -1
- package/test/jsdom-global-register.js +0 -1
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
# Style System API Reference
|
|
2
|
-
|
|
3
|
-
Internal SCSS authoring reference for `@1money/components-ui` component development.
|
|
4
|
-
|
|
5
|
-
## Import
|
|
6
|
-
|
|
7
|
-
```scss
|
|
8
|
-
@use '@/styles/api' as theme;
|
|
9
|
-
@use '@/styles/recipes/variants' as variants;
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
Components use **namespaced** imports:
|
|
13
|
-
- `theme.*` for all token functions, semantic helpers, typography mixins, and responsive mixins
|
|
14
|
-
- `variants.*` for the Variant DSL helpers
|
|
15
|
-
- `theme.$prefix` for the BEM prefix (`om-react-ui`)
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Token Functions
|
|
20
|
-
|
|
21
|
-
### `theme.spacing($domain, $key)` — Spacing
|
|
22
|
-
|
|
23
|
-
Domain determines the spacing group. Available domains: `scale`, `gap`, `component-padding`, `section-padding`.
|
|
24
|
-
|
|
25
|
-
#### `theme.spacing(scale, $key)` — Raw Spacing Scale
|
|
26
|
-
|
|
27
|
-
| Key | Value |
|
|
28
|
-
|-----|-------|
|
|
29
|
-
| `0` | 0 |
|
|
30
|
-
| `100` | 4px |
|
|
31
|
-
| `200` | 8px |
|
|
32
|
-
| `300` | 12px |
|
|
33
|
-
| `400` | 16px |
|
|
34
|
-
| `500` | 20px |
|
|
35
|
-
| `600` | 24px |
|
|
36
|
-
| `800` | 32px |
|
|
37
|
-
| `1000` | 40px |
|
|
38
|
-
| `1200` | 48px |
|
|
39
|
-
| `1400` | 56px |
|
|
40
|
-
| `1600` | 64px |
|
|
41
|
-
| `2000` | 80px |
|
|
42
|
-
| `2400` | 96px |
|
|
43
|
-
| `3200` | 128px |
|
|
44
|
-
| `4000` | 160px |
|
|
45
|
-
|
|
46
|
-
```scss
|
|
47
|
-
.element { padding: theme.spacing(scale, 400); } // 16px
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
#### `theme.spacing(gap, $key)` — Gap Spacing
|
|
51
|
-
|
|
52
|
-
Allowed keys: `050`, `100`, `200`, `300`, `400`, `600`, `1600`
|
|
53
|
-
|
|
54
|
-
```scss
|
|
55
|
-
.stack { gap: theme.spacing(gap, 400); } // 16px
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
#### `theme.spacing(component-padding, $key)` — Component Internal Padding
|
|
59
|
-
|
|
60
|
-
Allowed keys: `050`, `100`, `200`, `300`, `400`, `600`, `800`
|
|
61
|
-
|
|
62
|
-
```scss
|
|
63
|
-
.button { padding: theme.spacing(component-padding, 400); }
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
#### `theme.spacing(section-padding, $key)` — Page Section Padding
|
|
67
|
-
|
|
68
|
-
Allowed keys: `800`, `1600`, `2400`, `4000`
|
|
69
|
-
|
|
70
|
-
```scss
|
|
71
|
-
.section { padding: theme.spacing(section-padding, 1600); }
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### `theme.shape($key)` — Border Radius
|
|
75
|
-
|
|
76
|
-
| Key | Value |
|
|
77
|
-
|-----|-------|
|
|
78
|
-
| `0` | 0 |
|
|
79
|
-
| `100` | 4px |
|
|
80
|
-
| `200` | 8px |
|
|
81
|
-
| `300` | 12px |
|
|
82
|
-
| `400` | 16px |
|
|
83
|
-
| `600` | 24px |
|
|
84
|
-
| `full` | 9999px |
|
|
85
|
-
|
|
86
|
-
```scss
|
|
87
|
-
.element { border-radius: theme.shape(300); } // 12px
|
|
88
|
-
.pill { border-radius: theme.shape('full'); } // 9999px
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### `theme.shadows($key)` — Box Shadow
|
|
92
|
-
|
|
93
|
-
| Key | Value |
|
|
94
|
-
|-----|-------|
|
|
95
|
-
| `0` | none |
|
|
96
|
-
| `100` | `0 4px 8px rgba(65, 91, 130, 12%)` |
|
|
97
|
-
| `200` | `0 10px 22px rgba(0, 0, 0, 10%)` |
|
|
98
|
-
|
|
99
|
-
```scss
|
|
100
|
-
.element { box-shadow: theme.shadows(100); }
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### `theme.sizing($domain, $key)` — Sizing
|
|
104
|
-
|
|
105
|
-
Domain determines the sizing group. Available domains: `scale`, `component-height`.
|
|
106
|
-
|
|
107
|
-
#### `theme.sizing(scale, $key)` — Percentage Sizing
|
|
108
|
-
|
|
109
|
-
| Key | Value |
|
|
110
|
-
|-----|-------|
|
|
111
|
-
| `25` | 25% |
|
|
112
|
-
| `33` | 33.333% |
|
|
113
|
-
| `50` | 50% |
|
|
114
|
-
| `66` | 66.667% |
|
|
115
|
-
| `75` | 75% |
|
|
116
|
-
| `100` | 100% |
|
|
117
|
-
| `auto` | auto |
|
|
118
|
-
|
|
119
|
-
#### `theme.sizing(component-height, $key)` — Component Heights
|
|
120
|
-
|
|
121
|
-
Standardized heights for interactive elements.
|
|
122
|
-
|
|
123
|
-
| Key | Value | Use case |
|
|
124
|
-
|-----|-------|----------|
|
|
125
|
-
| `xs` | 24px | Badge, small chips |
|
|
126
|
-
| `sm` | 32px | Small button, icon button |
|
|
127
|
-
| `md` | 40px | Medium button, sidebar items |
|
|
128
|
-
| `lg` | 44px | Small input/select |
|
|
129
|
-
| `xl` | 48px | Cell, stepper step |
|
|
130
|
-
| `2xl` | 52px | Default button |
|
|
131
|
-
| `3xl` | 56px | Default input/select |
|
|
132
|
-
|
|
133
|
-
```scss
|
|
134
|
-
.button { height: theme.sizing(component-height, 'md'); } // 40px
|
|
135
|
-
.icon-circle { width: theme.sizing(component-height, 'sm'); height: theme.sizing(component-height, 'sm'); } // 32px
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### `theme.opacity($key)` — Opacity
|
|
139
|
-
|
|
140
|
-
| Key | Value |
|
|
141
|
-
|-----|-------|
|
|
142
|
-
| `subtle` | 0.05 |
|
|
143
|
-
| `light` | 0.1 |
|
|
144
|
-
| `medium` | 0.2 |
|
|
145
|
-
| `disabled-light` | 0.3 |
|
|
146
|
-
| `overlay` | 0.4 |
|
|
147
|
-
| `disabled` | 0.5 |
|
|
148
|
-
| `disabled-heavy` | 0.6 |
|
|
149
|
-
|
|
150
|
-
```scss
|
|
151
|
-
.disabled { opacity: theme.opacity('disabled'); } // 0.5
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
---
|
|
155
|
-
|
|
156
|
-
## Semantic Color Functions
|
|
157
|
-
|
|
158
|
-
### `theme.palette($domain, $token, $state?)` — All Color Domains
|
|
159
|
-
|
|
160
|
-
A single function handles all four color domains: `bg`, `text`, `icon`, `border`.
|
|
161
|
-
|
|
162
|
-
When called with three arguments, `$token` and `$state` are concatenated with a hyphen (e.g., `theme.palette(bg, 'brand', 'hover')` → resolves key `'brand-hover'`). When called with two arguments, `$token` is used as the key directly.
|
|
163
|
-
|
|
164
|
-
```scss
|
|
165
|
-
// Background colors
|
|
166
|
-
.card { background-color: theme.palette(bg, 'brand'); }
|
|
167
|
-
.card:hover { background-color: theme.palette(bg, 'brand-hover'); }
|
|
168
|
-
.card:hover { background-color: theme.palette(bg, 'brand', 'hover'); } // equivalent
|
|
169
|
-
|
|
170
|
-
// Text colors
|
|
171
|
-
.label { color: theme.palette(text, 'default'); }
|
|
172
|
-
.label-muted { color: theme.palette(text, 'default-tertiary'); }
|
|
173
|
-
.on-dark { color: theme.palette(text, 'on-neutral'); }
|
|
174
|
-
|
|
175
|
-
// Icon colors
|
|
176
|
-
.icon { color: theme.palette(icon, 'default'); }
|
|
177
|
-
.icon-brand { color: theme.palette(icon, 'brand'); }
|
|
178
|
-
|
|
179
|
-
// Border colors
|
|
180
|
-
.input { border-color: theme.palette(border, 'default'); }
|
|
181
|
-
.input:focus { border-color: theme.palette(border, 'brand'); }
|
|
182
|
-
.input.error { border-color: theme.palette(border, 'danger'); }
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
See `SemanticColors.md` for the complete key list for each domain.
|
|
186
|
-
|
|
187
|
-
---
|
|
188
|
-
|
|
189
|
-
## Typography
|
|
190
|
-
|
|
191
|
-
All typography tokens are emitted as CSS custom properties under `:root`, enabling runtime theme overrides:
|
|
192
|
-
|
|
193
|
-
```css
|
|
194
|
-
--om-body-md-font-size: 14px;
|
|
195
|
-
--om-body-md-line-height: 19.6px;
|
|
196
|
-
--om-body-md-font-weight: 400;
|
|
197
|
-
--om-body-md-strong-font-weight: 500;
|
|
198
|
-
--om-link-md-text-decoration: underline;
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
Variable naming: `--om-{category}-{size}-{property}`
|
|
202
|
-
|
|
203
|
-
### `@include theme.typography($category, $size, [$strong: false])`
|
|
204
|
-
|
|
205
|
-
Emits all CSS properties as `var()` references: `font-family`, `font-size`, `line-height`, `letter-spacing`, `font-weight`.
|
|
206
|
-
|
|
207
|
-
```scss
|
|
208
|
-
.body { @include theme.typography(body, md); }
|
|
209
|
-
// Compiles to:
|
|
210
|
-
// font-size: var(--om-body-md-font-size);
|
|
211
|
-
// font-family: var(--om-body-md-font-family);
|
|
212
|
-
// line-height: var(--om-body-md-line-height);
|
|
213
|
-
// letter-spacing: var(--om-body-md-letter-spacing);
|
|
214
|
-
// font-weight: var(--om-body-md-font-weight);
|
|
215
|
-
|
|
216
|
-
.body-bold { @include theme.typography(body, md, $strong: true); }
|
|
217
|
-
// font-weight: var(--om-body-md-strong-font-weight);
|
|
218
|
-
|
|
219
|
-
.link { @include theme.typography(link, md); }
|
|
220
|
-
// Also emits: text-decoration: var(--om-link-md-text-decoration);
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### Categories & Sizes
|
|
224
|
-
|
|
225
|
-
| Category | Sizes | Font | Strong weight |
|
|
226
|
-
|----------|-------|------|---------------|
|
|
227
|
-
| `display` | `xl`, `lg`, `md`, `sm`, `xs` | Aeonik | -- |
|
|
228
|
-
| `headline` | `lg`, `md`, `sm`, `xs` | Aeonik | -- |
|
|
229
|
-
| `title` | `lg`, `md`, `sm` | Inter | 700 |
|
|
230
|
-
| `body` | `lg`, `md`, `sm` | Inter | 500 |
|
|
231
|
-
| `link` | `md`, `sm` | Inter | -- |
|
|
232
|
-
| `label` | `xl`, `lg`, `md`, `sm`, `xs` | Inter | 600-700 |
|
|
233
|
-
|
|
234
|
-
---
|
|
235
|
-
|
|
236
|
-
## Responsive Mixins
|
|
237
|
-
|
|
238
|
-
Mobile-first breakpoint helpers using `max-width` media queries.
|
|
239
|
-
|
|
240
|
-
### `@include theme.down($breakpoint)`
|
|
241
|
-
|
|
242
|
-
| Breakpoint | Max-width |
|
|
243
|
-
|------------|-----------|
|
|
244
|
-
| `lg` | 1279.98px |
|
|
245
|
-
| `md` | 1023.98px |
|
|
246
|
-
| `sm` | 767.98px |
|
|
247
|
-
|
|
248
|
-
```scss
|
|
249
|
-
.sidebar {
|
|
250
|
-
width: 280px;
|
|
251
|
-
@include theme.down(md) { width: 200px; }
|
|
252
|
-
@include theme.down(sm) { display: none; }
|
|
253
|
-
}
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
### Other Responsive Mixins
|
|
257
|
-
|
|
258
|
-
```scss
|
|
259
|
-
@include theme.up($bp) // min-width
|
|
260
|
-
@include theme.between($lo, $hi) // min-width and max-width
|
|
261
|
-
@include theme.only($bp) // exact range for one breakpoint
|
|
262
|
-
@include theme.respond($bp) // alias for theme.down
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
---
|
|
266
|
-
|
|
267
|
-
## Variant DSL
|
|
268
|
-
|
|
269
|
-
Use the variant helpers when a component has multiple color/status modifiers that differ only by a set of token values. The DSL eliminates repetitive `&-{variant}` blocks by declaring a schema once and generating all modifier classes automatically.
|
|
270
|
-
|
|
271
|
-
**Import**: `@use '@/styles/recipes/variants' as variants;`
|
|
272
|
-
|
|
273
|
-
### Concepts
|
|
274
|
-
|
|
275
|
-
1. **Schema** — maps CSS custom property names to token keys inside each variant payload. Use `variants.om-variant-schema($component, $keys...)` to auto-generate this from the component name and key list.
|
|
276
|
-
2. **Variants map** — keyed by string variant names, each value is a token map matching the schema
|
|
277
|
-
3. **Mixins** — `variants.om-variant-default` sets the base, `variants.om-variant-classes` generates all modifier classes
|
|
278
|
-
|
|
279
|
-
### Basic Example
|
|
280
|
-
|
|
281
|
-
```scss
|
|
282
|
-
@use '@/styles/api' as theme;
|
|
283
|
-
@use '@/styles/recipes/variants' as variants;
|
|
284
|
-
|
|
285
|
-
$component: 'badge';
|
|
286
|
-
// Auto-generates: (--om-badge-text: text, --om-badge-bg: bg)
|
|
287
|
-
$badge-variant-schema: variants.om-variant-schema($component, text, bg);
|
|
288
|
-
|
|
289
|
-
$badge-variants: (
|
|
290
|
-
'info': (
|
|
291
|
-
text: theme.palette(text, 'brand'),
|
|
292
|
-
bg: theme.palette(bg, 'brand-secondary'),
|
|
293
|
-
),
|
|
294
|
-
'danger': (
|
|
295
|
-
text: theme.palette(text, 'danger'),
|
|
296
|
-
bg: theme.palette(bg, 'danger-secondary'),
|
|
297
|
-
),
|
|
298
|
-
);
|
|
299
|
-
|
|
300
|
-
.#{theme.$prefix}-#{$component} {
|
|
301
|
-
// Set default variant values + validate all variants against schema
|
|
302
|
-
@include variants.om-variant-default($badge-variants, 'info', $badge-variant-schema);
|
|
303
|
-
|
|
304
|
-
color: var(--om-badge-text);
|
|
305
|
-
background-color: var(--om-badge-bg);
|
|
306
|
-
|
|
307
|
-
// Generate modifier classes, skipping 'info' (already set as default)
|
|
308
|
-
@include variants.om-variant-classes($badge-variants, $badge-variant-schema, $default: 'info');
|
|
309
|
-
}
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
### Extending a Base Variant
|
|
313
|
-
|
|
314
|
-
Use `variants.om-variant-extend` when variants share a common base:
|
|
315
|
-
|
|
316
|
-
```scss
|
|
317
|
-
$base: (
|
|
318
|
-
text: theme.palette(text, 'default'),
|
|
319
|
-
bg: theme.palette(bg, 'default'),
|
|
320
|
-
hover-bg: theme.palette(bg, 'default-hover'),
|
|
321
|
-
);
|
|
322
|
-
|
|
323
|
-
$variants: (
|
|
324
|
-
'default': $base,
|
|
325
|
-
'active': variants.om-variant-extend($base, (
|
|
326
|
-
bg: theme.palette(bg, 'brand'),
|
|
327
|
-
hover-bg: theme.palette(bg, 'brand-hover'),
|
|
328
|
-
)),
|
|
329
|
-
);
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
### Available Helpers
|
|
333
|
-
|
|
334
|
-
| Helper | Description |
|
|
335
|
-
|--------|-------------|
|
|
336
|
-
| `variants.om-variant-schema($component, $keys...)` | Auto-generates a schema map from component name + token key list |
|
|
337
|
-
| `variants.om-variant($variants, $name)` | Returns a variant token map; errors on unknown names |
|
|
338
|
-
| `variants.om-variant-value($tokens, $key)` | Returns a token value; errors on missing keys |
|
|
339
|
-
| `variants.om-variant-extend($base, $overrides)` | Creates a new variant by merging overrides into a base |
|
|
340
|
-
| `@include variants.om-variant-apply($schema, $tokens)` | Emits CSS declarations for one variant payload |
|
|
341
|
-
| `@include variants.om-variant-default($variants, $name, $schema)` | Validates all variants against schema, then applies the default |
|
|
342
|
-
| `@include variants.om-variant-classes($variants, $schema, $default, $selector-prefix)` | Validates and generates modifier classes; `$default` skips the default variant |
|
|
343
|
-
|
|
344
|
-
### Compile-Time Safety
|
|
345
|
-
|
|
346
|
-
Both `variants.om-variant-default` and `variants.om-variant-classes` validate that every variant contains all token keys required by the schema. A missing key triggers a Sass `@error` at build time.
|
|
347
|
-
|
|
348
|
-
### Naming Conventions
|
|
349
|
-
|
|
350
|
-
- Schema variable: `$component-variant-schema`
|
|
351
|
-
- Variants map: `$component-variants`
|
|
352
|
-
- Individual variant (if extracted): `$component-{name}-variant`
|
|
353
|
-
- Always quote variant names: `'white'`, `'black'`, `'grey'` (prevents Sass color literal issues)
|
|
354
|
-
|
|
355
|
-
---
|
|
356
|
-
|
|
357
|
-
## Architecture
|
|
358
|
-
|
|
359
|
-
The style system has three layers:
|
|
360
|
-
|
|
361
|
-
1. **Tokens** (`src/styles/tokens/`): Raw primitives — colors, spacing multipliers, font sizes, scale maps
|
|
362
|
-
2. **Theme** (`src/styles/theme/`): Functions that resolve tokens to CSS variables or raw values, breakpoint mixins, typography mixin
|
|
363
|
-
3. **System** (`src/styles/system/`): The `om-sx` mixin — a compact shorthand API for layout (used in business code, **not** in component SCSS)
|
|
364
|
-
|
|
365
|
-
All three layers are exposed through the `@use '@/styles/api' as theme;` import (namespaced under `theme`).
|
|
366
|
-
|
|
367
|
-
The Variant DSL lives in `src/styles/recipes/` and is imported separately: `@use '@/styles/recipes/variants' as variants;`.
|
|
368
|
-
|
|
369
|
-
---
|
|
370
|
-
|
|
371
|
-
## Quick Decision Table
|
|
372
|
-
|
|
373
|
-
| Figma concept | SCSS function |
|
|
374
|
-
|---------------|---------------|
|
|
375
|
-
| Background fill | `theme.palette(bg, 'key')` |
|
|
376
|
-
| Text color | `theme.palette(text, 'key')` |
|
|
377
|
-
| Icon color | `theme.palette(icon, 'key')` |
|
|
378
|
-
| Border color | `theme.palette(border, 'key')` |
|
|
379
|
-
| Padding/margin | `theme.spacing(scale, key)` or `theme.spacing(component-padding, key)` |
|
|
380
|
-
| Gap between items | `theme.spacing(gap, key)` |
|
|
381
|
-
| Section padding | `theme.spacing(section-padding, key)` |
|
|
382
|
-
| Corner radius | `theme.shape(key)` |
|
|
383
|
-
| Box shadow/elevation | `theme.shadows(key)` |
|
|
384
|
-
| Component height | `theme.sizing(component-height, key)` |
|
|
385
|
-
| Font styles | `@include theme.typography(cat, size)` |
|
|
386
|
-
| Opacity/disabled | `theme.opacity(key)` |
|
|
387
|
-
| Width/height % | `theme.sizing(scale, key)` |
|
|
388
|
-
| Responsive breakpoint | `@include theme.down(bp)` |
|
|
389
|
-
| Multi-variant color scheme | Variant DSL: `variants.om-variant-default` + `variants.om-variant-classes` |
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Bash(for dir in Tab Switch Radio Cell Selector Accordion Collapse LogoType Navigation Dropdown Search Select Input InputAmount InputNumber AutoComplete Alert Segment Empty Typography)",
|
|
5
|
-
"Bash(do [ -d \"/Users/bobbytalvin/Desktop/Github/1money-components-ui/src/components/$dir\" ])",
|
|
6
|
-
"Bash(echo:*)",
|
|
7
|
-
"Bash(done)",
|
|
8
|
-
"WebFetch(domain:www.figma.com)",
|
|
9
|
-
"Bash(pnpm lint:*)",
|
|
10
|
-
"Bash(pnpm test:*)",
|
|
11
|
-
"Bash(npx jest:*)",
|
|
12
|
-
"mcp__plugin_figma_figma__get_design_context",
|
|
13
|
-
"mcp__plugin_figma_figma__get_screenshot",
|
|
14
|
-
"Bash(npx tsc:*)",
|
|
15
|
-
"Bash(curl -sL \"https://www.figma.com/api/mcp/asset/7aba8d6c-7a4a-4d10-b433-0755dd8ddddd\" -o /tmp/info_icon.svg)",
|
|
16
|
-
"Read(//tmp/**)",
|
|
17
|
-
"Bash(curl -sL \"https://www.figma.com/api/mcp/asset/359376ab-faeb-4324-b32d-c992a92ed3e8\" -o /tmp/warning_icon.svg)",
|
|
18
|
-
"Bash(curl -sL \"https://www.figma.com/api/mcp/asset/095d2f84-6f1d-45a3-bca0-548b17c1c99f\" -o /tmp/check_icon.svg)",
|
|
19
|
-
"Bash(curl -sL \"https://www.figma.com/api/mcp/asset/6a4f2b3f-bb19-44ed-9527-3546a5bd3c55\" -o /tmp/cross_icon.svg)",
|
|
20
|
-
"Bash(pnpm lint:style)",
|
|
21
|
-
"mcp__plugin_figma_figma__get_variable_defs",
|
|
22
|
-
"Bash(pnpm lint:es)",
|
|
23
|
-
"Bash(npx storybook:*)",
|
|
24
|
-
"Bash(env)",
|
|
25
|
-
"mcp__figma-remote-mcp__get_design_context",
|
|
26
|
-
"Bash(pnpm build:*)",
|
|
27
|
-
"Bash(pnpm:*)",
|
|
28
|
-
"Bash(find /Users/derrick/Desktop/1money/1money-components-ui/src/components -type d -name *[Ff]orm*)",
|
|
29
|
-
"Bash(open:*)",
|
|
30
|
-
"Bash(ls /Users/derrick/Desktop/1money/1money-components-ui/src/components/*/interface.ts)",
|
|
31
|
-
"Bash(npx eslint:*)",
|
|
32
|
-
"Bash(npx stylelint:*)",
|
|
33
|
-
"Bash(grep -r \"useBodyScrollLock\\\\|useEscapeClose\\\\|useDialogFocus\\\\|usePresence\" /Users/derrick/Desktop/1money/1money-components-ui/src/components/ --include=*.tsx --include=*.ts)",
|
|
34
|
-
"Bash(npx sass:*)",
|
|
35
|
-
"Bash(lsof -i :6206 -P -n -sTCP:LISTEN)",
|
|
36
|
-
"mcp__chrome-devtools__list_console_messages",
|
|
37
|
-
"mcp__chrome-devtools__list_pages",
|
|
38
|
-
"mcp__chrome-devtools__new_page",
|
|
39
|
-
"mcp__chrome-devtools__take_screenshot",
|
|
40
|
-
"mcp__chrome-devtools__navigate_page",
|
|
41
|
-
"mcp__chrome-devtools__evaluate_script",
|
|
42
|
-
"mcp__plugin_figma_figma__get_metadata",
|
|
43
|
-
"mcp__plugin_figma_figma__search_design_system",
|
|
44
|
-
"Bash(git merge:*)",
|
|
45
|
-
"Bash(git stash:*)",
|
|
46
|
-
"Bash(git worktree:*)",
|
|
47
|
-
"Bash(git branch:*)",
|
|
48
|
-
"Skill(commit-commands:commit)",
|
|
49
|
-
"Bash(git add:*)",
|
|
50
|
-
"Bash(git commit:*)",
|
|
51
|
-
"mcp__figma-dev-mode-mcp-server__get_screenshot",
|
|
52
|
-
"mcp__figma-dev-mode-mcp-server__get_design_context",
|
|
53
|
-
"mcp__figma-dev-mode-mcp-server__get_metadata",
|
|
54
|
-
"Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:6205)",
|
|
55
|
-
"Bash(git status:*)",
|
|
56
|
-
"Bash(mkdir:*)",
|
|
57
|
-
"mcp__chrome-devtools__click",
|
|
58
|
-
"mcp__chrome-devtools__take_snapshot",
|
|
59
|
-
"Bash(grep -n 'prefix\\\\b\\\\|$prefix' /Users/wali/1Money/1money-components-ui/src/styles/_settings.scss)",
|
|
60
|
-
"WebFetch(domain:primereact.org)",
|
|
61
|
-
"Bash(xargs cat:*)",
|
|
62
|
-
"WebFetch(domain:www.npmjs.com)",
|
|
63
|
-
"mcp__plugin_context7_context7__resolve-library-id",
|
|
64
|
-
"mcp__plugin_context7_context7__query-docs",
|
|
65
|
-
"Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:6210)",
|
|
66
|
-
"Bash(tr '{' '\\\\n')",
|
|
67
|
-
"Bash(tr '}' '\\\\n')",
|
|
68
|
-
"Bash(grep -r import.*style src/components/*/Button.stories.tsx src/components/*/*.stories.tsx)",
|
|
69
|
-
"Bash(for component:*)",
|
|
70
|
-
"Bash(do)",
|
|
71
|
-
"Read(//Users/derrick/Desktop/1money/1money-components-ui/src/components/**)",
|
|
72
|
-
"Bash(find /Users/derrick/Desktop/1money/1money-components-ui/src/components/Form -type f -name *)",
|
|
73
|
-
"WebFetch(domain:ant.design)",
|
|
74
|
-
"WebSearch",
|
|
75
|
-
"Read(//Users/wali/1Money/1money-hooks/**)",
|
|
76
|
-
"Read(//Users/wali/1Money/1money-hooks/src/**)",
|
|
77
|
-
"Bash(grep -r \"prefix\" src/utils/classnames*)",
|
|
78
|
-
"Bash(node -e \"const {render} = require\\('@testing-library/react'\\); const React = require\\('react'\\);\")",
|
|
79
|
-
"Bash(node -e ':*)",
|
|
80
|
-
"Bash(npx tsx -e ':*)",
|
|
81
|
-
"Bash(curl -s http://localhost:6205 -o /dev/null -w '%{http_code}')",
|
|
82
|
-
"Bash(curl -s -o /dev/null -w '%{http_code}\\\\n' http://localhost:6205)",
|
|
83
|
-
"Bash(lsof -ti:6205,6206,6208)",
|
|
84
|
-
"Bash(yes)",
|
|
85
|
-
"Bash(kill %1)",
|
|
86
|
-
"Bash(pkill -f 'storybook')",
|
|
87
|
-
"Bash(lsof -ti:6205,6206,6207,6208)",
|
|
88
|
-
"Bash(lsof -ti:6205)",
|
|
89
|
-
"Bash(lsof -ti:6206)",
|
|
90
|
-
"Bash(lsof -ti:6208)",
|
|
91
|
-
"Bash(node_modules/.bin/storybook dev:*)",
|
|
92
|
-
"Bash(curl -s -o /dev/null -w '%{http_code}' http://localhost:6210)",
|
|
93
|
-
"Bash(curl -s -o /dev/null -w '%{http_code}\\\\n' http://127.0.0.1:6210)",
|
|
94
|
-
"Bash(curl -sI http://localhost:6210)",
|
|
95
|
-
"Bash(pkill -f 'storybook dev')",
|
|
96
|
-
"Bash(grep -q 'Storybook.*started\\\\|started$' /private/tmp/claude-501/-Users-wali-1Money-1money-components-ui/6381d364-f524-4226-886d-7d169f582d00/tasks/bwh7mb09v.output)",
|
|
97
|
-
"Bash(break)",
|
|
98
|
-
"Bash(grep -nE 'blue-700|grey-300|grey-200|grey-100|grey-400|red-600|grey-900|grey-800|grey-700|grey-500|grey-50\\\\b|^\\\\s*$grey|^\\\\s*$blue|^\\\\s*$red' src/styles/tokens/color/_primitives.scss)",
|
|
99
|
-
"Bash(grep -n \"box-sizing\" /Users/wali/1Money/1money-components-ui/src/styles/_*.scss /Users/wali/1Money/1money-components-ui/src/styles/system/*.scss)",
|
|
100
|
-
"Bash(git mv:*)",
|
|
101
|
-
"mcp__figma-remote-mcp__get_metadata",
|
|
102
|
-
"Bash(grep -B5 -A 20 \"type MiddlewareData\\\\|interface MiddlewareData\" /Users/derrick/Desktop/1money/1money-components-ui/node_modules/.pnpm/@floating-ui+core@*/node_modules/@floating-ui/core/dist/floating-ui.core.d.ts)",
|
|
103
|
-
"Bash(grep:*)",
|
|
104
|
-
"mcp__figma-dev-mode-mcp-server__get_variable_defs",
|
|
105
|
-
"Bash(gh api *)",
|
|
106
|
-
"Bash(cp /Users/wali/1Money/1money-react-ui/src/components/Loading/lottie-pure.json /Users/wali/1Money/1money-components-ui/src/components/Spinner/lottie-pure.json)",
|
|
107
|
-
"Bash(cp /Users/wali/1Money/1money-react-ui/src/components/Loading/lottie-pattern.json /Users/wali/1Money/1money-components-ui/src/components/Spinner/lottie-pattern.json)",
|
|
108
|
-
"mcp__ide__getDiagnostics",
|
|
109
|
-
"Bash(curl -s \"http://localhost:6205/iframe.html?id=components-proform--all-field-types&viewMode=story\")",
|
|
110
|
-
"Bash(git checkout *)",
|
|
111
|
-
"Bash(curl -s \"http://localhost:6205/iframe.html?id=components-proform--default&viewMode=story\")",
|
|
112
|
-
"Bash(node -e ' *)",
|
|
113
|
-
"Bash(curl -s \"http://localhost:6205/@fs/Users/derrick/Desktop/1money/1money-components-ui/src/components/ProForm/ProForm.stories.tsx\")",
|
|
114
|
-
"Bash(curl -s \"http://localhost:6205/@fs/Users/derrick/Desktop/1money/1money-components-ui/src/components/ProForm/ProFormGroup.tsx\")",
|
|
115
|
-
"Bash(curl -s \"http://localhost:6205/@fs/Users/derrick/Desktop/1money/1money-components-ui/src/components/Typography/index.ts\")",
|
|
116
|
-
"Bash(curl -s \"http://localhost:6205/@fs/Users/derrick/Desktop/1money/1money-components-ui/src/components/ProForm/index.ts\")",
|
|
117
|
-
"Bash(curl -s \"http://localhost:6205/@fs/Users/derrick/Desktop/1money/1money-components-ui/src/components/ProForm/ProForm.tsx\")"
|
|
118
|
-
]
|
|
119
|
-
}
|
|
120
|
-
}
|