@scania/tegel-lite 0.0.3-rules-beta.7 → 0.1.0

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 (38) hide show
  1. package/README.md +0 -29
  2. package/dist/assets/icons/scania/microphone.svg +4 -0
  3. package/dist/assets/icons/scania/microphone_inactive.svg +7 -0
  4. package/dist/assets/icons/scania/notification_snooze.svg +6 -0
  5. package/dist/assets/icons/scania/paperclip.svg +3 -0
  6. package/dist/components.css +2036 -1807
  7. package/dist/global.css +3 -2
  8. package/dist/scania-variables.css +8 -0
  9. package/dist/tl-button.css +19 -0
  10. package/dist/tl-dropdown.css +36 -1
  11. package/dist/tl-folder-tabs.css +64 -0
  12. package/dist/tl-header.css +207 -51
  13. package/dist/tl-icon.css +16 -0
  14. package/dist/tl-inline-tabs.css +81 -0
  15. package/dist/tl-navigation-tabs.css +81 -0
  16. package/dist/tl-slider.css +1024 -1485
  17. package/dist/tl-text-field.css +32 -13
  18. package/package.json +3 -14
  19. package/.ai/rules/01-design-tokens.mdc +0 -318
  20. package/.ai/rules/02-components-forms.mdc +0 -396
  21. package/.ai/rules/03-components-display.mdc +0 -474
  22. package/.ai/rules/04-components-navigation.mdc +0 -358
  23. package/.ai/rules/05-guidelines.mdc +0 -144
  24. package/.ai/rules/06-patterns.mdc +0 -352
  25. package/.cursor/rules/tegel-lite/01-design-tokens.mdc +0 -317
  26. package/.cursor/rules/tegel-lite/02-components-forms.mdc +0 -395
  27. package/.cursor/rules/tegel-lite/03-components-display.mdc +0 -473
  28. package/.cursor/rules/tegel-lite/04-components-navigation.mdc +0 -357
  29. package/.cursor/rules/tegel-lite/05-guidelines.mdc +0 -143
  30. package/.cursor/rules/tegel-lite/06-patterns.mdc +0 -351
  31. package/.github/copilot-instructions.md +0 -2045
  32. package/AGENTS.md +0 -2045
  33. package/CLAUDE.md +0 -2045
  34. package/bin/setup-ai-rules.js +0 -368
  35. package/dist/tl-folder-tab.css +0 -87
  36. package/dist/tl-inline-tab.css +0 -80
  37. package/dist/tl-navigation-tab.css +0 -114
  38. package/dist/tl-textarea-mixins.css +0 -0
@@ -1,351 +0,0 @@
1
- ---
2
- description: 06-patterns
3
- alwaysApply: true
4
- ---
5
- # Composed Page Patterns
6
-
7
- ## Login Page
8
-
9
- ```html
10
- <body class="scania tds-mode-light">
11
- <div
12
- style="display: flex; align-items: center; justify-content: center; min-height: 100vh; background-color: var(--color-background-base);"
13
- >
14
- <div class="tl-card" style="width: 400px; max-width: 100%;">
15
- <div class="tl-card__header">
16
- <div class="tl-card__headings">
17
- <span class="tl-card__title">Sign In</span>
18
- <span class="tl-card__subtitle">Enter your credentials</span>
19
- </div>
20
- </div>
21
- <div class="tl-card__body">
22
- <div class="tl-card__content" style="max-inline-size: unset;">
23
- <!-- Email field -->
24
- <div
25
- class="tl-text-field tl-text-field--lg"
26
- style="margin-bottom: 16px;"
27
- >
28
- <label class="tl-text-field__label" for="login-email">Email</label>
29
- <input
30
- class="tl-text-field__input"
31
- id="login-email"
32
- type="email"
33
- placeholder="user@scania.com"
34
- />
35
- </div>
36
- <!-- Password field -->
37
- <div
38
- class="tl-text-field tl-text-field--lg"
39
- style="margin-bottom: 24px;"
40
- >
41
- <label class="tl-text-field__label" for="login-pass"
42
- >Password</label
43
- >
44
- <input
45
- class="tl-text-field__input"
46
- id="login-pass"
47
- type="password"
48
- placeholder="Enter password"
49
- />
50
- </div>
51
- <button
52
- class="tl-button tl-button--primary tl-button--md tl-button--full-width"
53
- >
54
- Sign In
55
- </button>
56
- </div>
57
- </div>
58
- </div>
59
- </div>
60
- </body>
61
- ```
62
-
63
- ---
64
-
65
- ## Dashboard Layout (Header + Sidebar + Content)
66
-
67
- ```html
68
- <body class="scania tds-mode-light">
69
- <!-- Header -->
70
- <header class="tl-header">
71
- <nav class="tl-header__nav">
72
- <ul class="tl-header__list">
73
- <li class="tl-header__item">
74
- <a class="tl-header__item-wrapper" href="/"
75
- ><span class="tl-header__brand"></span
76
- ></a>
77
- </li>
78
- <li class="tl-header__item">
79
- <div class="tl-header__title">
80
- <span class="tl-header__title-text">Fleet Manager</span>
81
- </div>
82
- </li>
83
- <li class="tl-header__middle-spacer"></li>
84
- <li class="tl-header__item">
85
- <button class="tl-header__item-wrapper" aria-label="Notifications">
86
- <span class="tl-icon tl-icon--notification"></span>
87
- </button>
88
- </li>
89
- </ul>
90
- </nav>
91
- </header>
92
-
93
- <!-- Layout -->
94
- <div style="display: flex; min-height: calc(100vh - 64px);">
95
- <!-- Side Menu -->
96
- <nav
97
- class="tl-side-menu tl-side-menu--persistent"
98
- aria-label="Main navigation"
99
- style="position: static; height: auto;"
100
- >
101
- <div class="tl-side-menu__wrapper tl-side-menu__wrapper--open">
102
- <aside class="tl-side-menu__aside">
103
- <div class="tl-side-menu__navigation">
104
- <div class="tl-side-menu__list-wrapper">
105
- <ul class="tl-side-menu__upper-list">
106
- <li>
107
- <a
108
- class="tl-side-menu__item tl-side-menu__item--selected"
109
- href="/dashboard"
110
- >
111
- <span class="tl-icon tl-icon--dashboard"></span> Dashboard
112
- </a>
113
- </li>
114
- <li>
115
- <a class="tl-side-menu__item" href="/vehicles">
116
- <span class="tl-icon tl-icon--truck"></span> Vehicles
117
- </a>
118
- </li>
119
- </ul>
120
- </div>
121
- </div>
122
- </aside>
123
- </div>
124
- </nav>
125
-
126
- <!-- Main Content -->
127
- <main
128
- style="flex: 1; padding: var(--dimension-space-medium); background-color: var(--color-background-base);"
129
- >
130
- <!-- Cards grid -->
131
- <div
132
- style="display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 24px;"
133
- >
134
- <div class="tl-card">
135
- <div class="tl-card__header">
136
- <div class="tl-card__headings">
137
- <span class="tl-card__title">Total Vehicles</span>
138
- </div>
139
- </div>
140
- <div class="tl-card__body">
141
- <div
142
- class="tl-card__content"
143
- style="max-inline-size: unset; font-size: 32px; font-weight: 700;"
144
- >
145
- 142
146
- </div>
147
- </div>
148
- </div>
149
- </div>
150
-
151
- <!-- Table -->
152
- <table class="tl-table tl-table--responsive">
153
- <thead class="tl-table__header">
154
- <tr class="tl-table__row">
155
- <th class="tl-table__header-cell">Vehicle</th>
156
- <th class="tl-table__header-cell">Status</th>
157
- <th class="tl-table__header-cell">Location</th>
158
- </tr>
159
- </thead>
160
- <tbody class="tl-table__body">
161
- <tr class="tl-table__row">
162
- <td class="tl-table__body-cell">SCN-2024-001</td>
163
- <td class="tl-table__body-cell">Active</td>
164
- <td class="tl-table__body-cell">Södertälje</td>
165
- </tr>
166
- </tbody>
167
- </table>
168
- </main>
169
- </div>
170
- </body>
171
- ```
172
-
173
- ---
174
-
175
- ## Form Page
176
-
177
- ```html
178
- <main
179
- style="max-width: 600px; margin: 0 auto; padding: var(--dimension-space-medium);"
180
- >
181
- <h2
182
- style="font-family: var(--scania-font-family-default); font-weight: var(--scania-font-weight-bold); margin-bottom: 24px;"
183
- >
184
- New Vehicle Registration
185
- </h2>
186
-
187
- <form>
188
- <div style="display: flex; flex-direction: column; gap: 16px;">
189
- <div class="tl-text-field tl-text-field--lg">
190
- <label class="tl-text-field__label" for="vin">VIN Number</label>
191
- <input
192
- class="tl-text-field__input"
193
- id="vin"
194
- type="text"
195
- placeholder="Enter VIN"
196
- />
197
- </div>
198
-
199
- <div class="tl-dropdown tl-dropdown--lg">
200
- <label class="tl-dropdown__label" for="type">Vehicle Type</label>
201
- <select class="tl-dropdown__select" id="type">
202
- <option value="">Select type</option>
203
- <option value="truck">Truck</option>
204
- <option value="bus">Bus</option>
205
- </select>
206
- </div>
207
-
208
- <div class="tl-datetime">
209
- <label class="tl-datetime__label" for="reg-date"
210
- >Registration Date</label
211
- >
212
- <div class="tl-datetime__wrapper">
213
- <input class="tl-datetime__input" id="reg-date" type="date" />
214
- </div>
215
- </div>
216
-
217
- <div class="tl-textarea">
218
- <label class="tl-textarea__label" for="notes">Notes</label>
219
- <textarea
220
- class="tl-textarea__input"
221
- id="notes"
222
- rows="4"
223
- placeholder="Additional details..."
224
- ></textarea>
225
- </div>
226
-
227
- <label class="tl-checkbox">
228
- <input class="tl-checkbox__input" type="checkbox" />
229
- <span class="tl-checkbox__label"
230
- >I confirm all information is correct</span
231
- >
232
- </label>
233
-
234
- <div style="display: flex; gap: 16px; padding-top: 8px;">
235
- <button
236
- type="button"
237
- class="tl-button tl-button--secondary tl-button--md"
238
- >
239
- Cancel
240
- </button>
241
- <button
242
- type="submit"
243
- class="tl-button tl-button--primary tl-button--md"
244
- >
245
- Register
246
- </button>
247
- </div>
248
- </div>
249
- </form>
250
- </main>
251
- ```
252
-
253
- ---
254
-
255
- # AI Assistant Prompt Rules
256
-
257
- ## CRITICAL: NO INLINE STYLES
258
-
259
- **NEVER EVER use inline `style=""` attributes for design properties on ANY element, especially not on Tegel components.**
260
-
261
- This includes:
262
-
263
- - ❌ Colors: `style="color: ..."` or `style="background-color: ..."`
264
- - ❌ Spacing: `style="padding: ..."` or `style="margin: ..."`
265
- - ❌ Typography: `style="font-size: ..."` or `style="font-weight: ..."`
266
- - ❌ Any design tokens: `style="background-color: var(--color-system-success-discrete);"`
267
-
268
- **ALWAYS create CSS classes instead:**
269
-
270
- - ✅ Define class in `<style>` section with Tegel tokens
271
- - ✅ Use BEM naming: `.custom-component--variant`
272
- - ✅ Mark with comment: `<!-- CUSTOM: Description -->`
273
-
274
- **If a Tegel component doesn't have the variant you need (e.g., status badges), create a custom component with proper CSS classes, NOT inline styles.**
275
-
276
- ---
277
-
278
- ## Component Generation
279
-
280
- 1. When the user asks for a button, ALWAYS default to `tl-button tl-button--md` (variant is optional).
281
- 2. When the user asks for a button with icon:
282
- - ALWAYS add `tl-button--icon` modifier
283
- - ALWAYS put text BEFORE the icon
284
- - ALWAYS add `aria-hidden="true"` to the icon
285
- - Example: `<button class="tl-button tl-button--icon tl-button--md">Save<span class="tl-icon tl-icon--save" aria-hidden="true"></span></button>`
286
- 3. When the user asks for an icon-only button:
287
- - ALWAYS add `tl-button--only-icon` modifier
288
- - ALWAYS add `aria-label` attribute describing the action
289
- - Example: `<button class="tl-button tl-button--only-icon tl-button--md" aria-label="Settings"><span class="tl-icon tl-icon--settings"></span></button>`
290
- 4. When the user asks for an input/text field, ALWAYS default to `tl-text-field tl-text-field--lg` with an external label.
291
- 5. When the user asks for a card, ALWAYS include `tl-card__header` and `tl-card__body` sections.
292
- 6. When the user asks for a table, ALWAYS include `tl-table__header` with `th.tl-table__header-cell` and `tl-table__body`.
293
-
294
- ## Code Quality
295
-
296
- 7. Generate ALWAYS complete, production-ready HTML – never pseudocode.
297
- 8. Generate ALWAYS all necessary wrapper elements (e.g., `tl-card__body` > `tl-card__content`).
298
- 9. Include ALWAYS relevant ARIA attributes for accessibility:
299
- - Decorative icons in buttons with text: `aria-hidden="true"`
300
- - Icon-only buttons: `aria-label="Action description"`
301
- - Form labels: proper `for` and `id` attributes
302
- 10. Comment HTML with `<!-- -->` to explain structure sections.
303
- 11. Use ALWAYS the `scania tds-mode-light` classes on the `<body>` or root element.
304
-
305
- ## Token Usage
306
-
307
- 12. Use NEVER hardcoded color values – ALWAYS CSS custom properties.
308
- 13. Use NEVER hardcoded pixel spacing – prefer Tegel spacing tokens.
309
- 14. Use NEVER inline styles for any design properties (color, background, spacing, typography).
310
- - ❌ `style="color: blue"` or `style="color: var(--color-foreground-text-accent-default)"`
311
- - ✅ Create CSS class: `.custom-text { color: var(--color-foreground-text-accent-default); }`
312
- 15. Use NEVER `style="background: #f5f5f5"` – create a CSS class instead.
313
- 16. If a Tegel component lacks a needed variant, create a CUSTOM component with BEM classes, not inline styles.
314
-
315
- ## Custom Components
316
-
317
- 17. If the user requests a component that doesn't exist in Tegel Lite, build it using existing tokens and classes, and clearly mark it with a comment: `<!-- CUSTOM: Not a native Tegel Lite component -->`.
318
- 18. Custom components should follow the BEM naming convention: `.tl-custom-{name}__element--modifier`.
319
-
320
- ## File Structure
321
-
322
- 19. Always import CSS files in the correct order: variables → global → components.
323
- 20. Never modify the Tegel Lite source CSS files.
324
- 21. Place custom overrides in a separate stylesheet loaded AFTER the Tegel files.
325
-
326
- ## Dark Mode
327
-
328
- 22. To switch to dark mode, replace `tds-mode-light` with `tds-mode-dark` on the wrapper element.
329
- 23. All components automatically adapt – no additional work needed.
330
- 24. When showing dark mode examples, add `tds-mode-dark` to the root wrapper.
331
-
332
- ## Icon Usage
333
-
334
- 25. Icons use the pattern `tl-icon tl-icon--{name}` and optionally `tl-icon--{size}`.
335
- 26. Icons inherit color from parent. Use `color: var(--color-foreground-icon-strong)` on parent if needed.
336
- 27. Decorative icons in buttons with text MUST have `aria-hidden="true"`.
337
- 28. Icon-only interactive elements MUST have `aria-label` describing the action.
338
-
339
- ## Size Convention
340
-
341
- 29. Component sizes follow this convention (unless stated otherwise):
342
- - `--xs` = 24px height (buttons only)
343
- - `--sm` = 40px height
344
- - `--md` = 48px height
345
- - `--lg` = 56px height (default for inputs)
346
-
347
- ## Mode Variants
348
-
349
- 30. Components with `--primary` use `var(--color-background-layer-01)`.
350
- 31. Components with `--secondary` use `var(--color-background-layer-02)`.
351
- 32. Variant modifiers (primary, secondary, ghost, danger) are optional for buttons – use based on context.