@scania/tegel-lite 0.0.3-rules-beta.9 → 0.1.0-beta.5
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/README.md +0 -29
- package/dist/assets/icons/scania/configurator.svg +1 -0
- package/dist/assets/icons/scania/microphone.svg +4 -0
- package/dist/assets/icons/scania/microphone_inactive.svg +7 -0
- package/dist/assets/icons/scania/notification_snooze.svg +6 -0
- package/dist/assets/icons/scania/paperclip.svg +3 -0
- package/dist/components.css +2443 -2023
- package/dist/global.css +3128 -4749
- package/dist/scania-variables.css +16 -4
- package/dist/tl-accordion.css +8 -8
- package/dist/tl-badge.css +15 -0
- package/dist/tl-banner.css +2 -2
- package/dist/tl-button.css +20 -0
- package/dist/tl-card.css +16 -6
- package/dist/tl-checkbox-vars.css +1 -1
- package/dist/tl-checkbox.css +1 -1
- package/dist/tl-chip.css +6 -6
- package/dist/tl-datetime.css +7 -4
- package/dist/tl-dropdown.css +55 -3
- package/dist/tl-folder-tabs.css +64 -0
- package/dist/tl-footer.css +64 -0
- package/dist/tl-header.css +214 -60
- package/dist/tl-icon.css +18 -2
- package/dist/tl-inline-tabs.css +81 -0
- package/dist/tl-modal.css +35 -0
- package/dist/tl-navigation-tabs.css +81 -0
- package/dist/tl-radio-button.css +1 -1
- package/dist/tl-side-menu.css +74 -0
- package/dist/tl-slider.css +565 -1016
- package/dist/tl-spinner.css +8 -0
- package/dist/tl-step.css +8 -0
- package/dist/tl-stepper.css +8 -0
- package/dist/tl-table.css +18 -21
- package/dist/tl-text-field.css +34 -63
- package/dist/tl-toggle.css +1 -1
- package/dist/traton-variables.css +4 -2
- package/package.json +4 -15
- package/.ai/rules/01-design-tokens.mdc +0 -318
- package/.ai/rules/02-components-forms.mdc +0 -396
- package/.ai/rules/03-components-display.mdc +0 -474
- package/.ai/rules/04-components-navigation.mdc +0 -358
- package/.ai/rules/05-guidelines.mdc +0 -144
- package/.ai/rules/06-patterns.mdc +0 -352
- package/.cursor/rules/tegel-lite/01-design-tokens.mdc +0 -317
- package/.cursor/rules/tegel-lite/02-components-forms.mdc +0 -395
- package/.cursor/rules/tegel-lite/03-components-display.mdc +0 -473
- package/.cursor/rules/tegel-lite/04-components-navigation.mdc +0 -357
- package/.cursor/rules/tegel-lite/05-guidelines.mdc +0 -143
- package/.cursor/rules/tegel-lite/06-patterns.mdc +0 -351
- package/.github/copilot-instructions.md +0 -2045
- package/AGENTS.md +0 -2045
- package/CLAUDE.md +0 -2045
- package/bin/setup-ai-rules.js +0 -368
- package/dist/tl-folder-tab.css +0 -87
- package/dist/tl-inline-tab.css +0 -80
- package/dist/tl-navigation-tab.css +0 -114
- package/dist/tl-textarea-mixins.css +0 -0
- /package/dist/assets/icons/scania/{gift inactive.svg → gift_inactive.svg} +0 -0
|
@@ -1,396 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Form component patterns including buttons, inputs, checkboxes, dropdowns, and datetime
|
|
3
|
-
alwaysApply: true
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Form Components
|
|
7
|
-
|
|
8
|
-
## Button
|
|
9
|
-
|
|
10
|
-
**Classes**: `tl-button`, `tl-button--primary`, `tl-button--secondary`, `tl-button--ghost`, `tl-button--danger`
|
|
11
|
-
**Sizes**: `tl-button--xs` (24px), `tl-button--sm` (40px), `tl-button--md` (48px), `tl-button--lg` (56px)
|
|
12
|
-
**Modifiers**: `tl-button--full-width`, `tl-button--icon`, `tl-button--only-icon`
|
|
13
|
-
|
|
14
|
-
```html
|
|
15
|
-
<!-- Primary button (default) -->
|
|
16
|
-
<button class="tl-button tl-button--primary tl-button--md">
|
|
17
|
-
Primary Action
|
|
18
|
-
</button>
|
|
19
|
-
|
|
20
|
-
<!-- Secondary button -->
|
|
21
|
-
<button class="tl-button tl-button--secondary tl-button--md">Secondary</button>
|
|
22
|
-
|
|
23
|
-
<!-- Ghost button -->
|
|
24
|
-
<button class="tl-button tl-button--ghost tl-button--sm">Ghost</button>
|
|
25
|
-
|
|
26
|
-
<!-- Danger button -->
|
|
27
|
-
<button class="tl-button tl-button--danger tl-button--md">Delete</button>
|
|
28
|
-
|
|
29
|
-
<!-- Button with icon (text BEFORE icon) -->
|
|
30
|
-
<button class="tl-button tl-button--primary tl-button--icon tl-button--md">
|
|
31
|
-
Save
|
|
32
|
-
<span class="tl-icon tl-icon--save" aria-hidden="true"></span>
|
|
33
|
-
</button>
|
|
34
|
-
|
|
35
|
-
<!-- Icon-only button -->
|
|
36
|
-
<button
|
|
37
|
-
class="tl-button tl-button--only-icon tl-button--md"
|
|
38
|
-
aria-label="Settings"
|
|
39
|
-
>
|
|
40
|
-
<span class="tl-icon tl-icon--settings"></span>
|
|
41
|
-
</button>
|
|
42
|
-
|
|
43
|
-
<!-- Full width -->
|
|
44
|
-
<button
|
|
45
|
-
class="tl-button tl-button--primary tl-button--md tl-button--full-width"
|
|
46
|
-
>
|
|
47
|
-
Full Width
|
|
48
|
-
</button>
|
|
49
|
-
|
|
50
|
-
<!-- Disabled -->
|
|
51
|
-
<button class="tl-button tl-button--primary tl-button--md" disabled>
|
|
52
|
-
Disabled
|
|
53
|
-
</button>
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
**Structure Rules**:
|
|
57
|
-
|
|
58
|
-
- **Button with icon**: Text comes FIRST, then icon. Add `tl-button--icon` modifier. Icon should have `aria-hidden="true"`.
|
|
59
|
-
- **Icon-only button**: Add `tl-button--only-icon` modifier and `aria-label` for accessibility.
|
|
60
|
-
- **Size**: Always include a size modifier (--xs, --sm, --md, --lg).
|
|
61
|
-
- **Variant**: Primary, secondary, ghost, or danger (optional, defaults to primary).
|
|
62
|
-
|
|
63
|
-
**Do's**:
|
|
64
|
-
|
|
65
|
-
- Always put text before icon in buttons with icons
|
|
66
|
-
- Always add `aria-hidden="true"` to decorative icons in buttons with text
|
|
67
|
-
- Always use `aria-label` for icon-only buttons
|
|
68
|
-
|
|
69
|
-
**Don'ts**:
|
|
70
|
-
|
|
71
|
-
- Never use `<div>` as a button
|
|
72
|
-
- Never style buttons with custom colors
|
|
73
|
-
- Never put icon before text in buttons with text
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## Text Field (Input)
|
|
78
|
-
|
|
79
|
-
**Classes**: `tl-text-field`, `tl-text-field--lg` (56px, default), `tl-text-field--md` (48px), `tl-text-field--sm` (40px)
|
|
80
|
-
**Variants**: `tl-text-field--primary`, `tl-text-field--secondary`, `tl-text-field--label-inside`
|
|
81
|
-
**States**: `tl-text-field--error`, `tl-text-field--success`
|
|
82
|
-
|
|
83
|
-
```html
|
|
84
|
-
<!-- Basic text field with external label -->
|
|
85
|
-
<div class="tl-text-field tl-text-field--lg">
|
|
86
|
-
<label class="tl-text-field__label" for="name">Name</label>
|
|
87
|
-
<input
|
|
88
|
-
class="tl-text-field__input"
|
|
89
|
-
id="name"
|
|
90
|
-
type="text"
|
|
91
|
-
placeholder="Enter your name"
|
|
92
|
-
/>
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
<!-- Label inside -->
|
|
96
|
-
<div class="tl-text-field tl-text-field--lg tl-text-field--label-inside">
|
|
97
|
-
<label class="tl-text-field__label" for="email">Email</label>
|
|
98
|
-
<input class="tl-text-field__input" id="email" type="email" placeholder=" " />
|
|
99
|
-
</div>
|
|
100
|
-
|
|
101
|
-
<!-- With helper text -->
|
|
102
|
-
<div class="tl-text-field tl-text-field--lg">
|
|
103
|
-
<label class="tl-text-field__label" for="phone">Phone</label>
|
|
104
|
-
<input
|
|
105
|
-
class="tl-text-field__input"
|
|
106
|
-
id="phone"
|
|
107
|
-
type="tel"
|
|
108
|
-
placeholder="+46..."
|
|
109
|
-
/>
|
|
110
|
-
<div class="tl-text-field__bottom">
|
|
111
|
-
<span class="tl-text-field__helper">Include country code</span>
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
114
|
-
|
|
115
|
-
<!-- Error state -->
|
|
116
|
-
<div class="tl-text-field tl-text-field--lg tl-text-field--error">
|
|
117
|
-
<label class="tl-text-field__label" for="req">Required field</label>
|
|
118
|
-
<input class="tl-text-field__input" id="req" type="text" placeholder=" " />
|
|
119
|
-
<div class="tl-text-field__bottom">
|
|
120
|
-
<span class="tl-text-field__helper">This field is required</span>
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
|
-
|
|
124
|
-
<!-- With prefix/suffix icons -->
|
|
125
|
-
<div class="tl-text-field tl-text-field--lg">
|
|
126
|
-
<label class="tl-text-field__label" for="search">Search</label>
|
|
127
|
-
<span class="tl-text-field__prefix--icon tl-icon tl-icon--search"></span>
|
|
128
|
-
<input
|
|
129
|
-
class="tl-text-field__input"
|
|
130
|
-
id="search"
|
|
131
|
-
type="text"
|
|
132
|
-
placeholder="Search..."
|
|
133
|
-
/>
|
|
134
|
-
</div>
|
|
135
|
-
|
|
136
|
-
<!-- With character counter -->
|
|
137
|
-
<div class="tl-text-field tl-text-field--lg">
|
|
138
|
-
<label class="tl-text-field__label" for="bio">Bio</label>
|
|
139
|
-
<input
|
|
140
|
-
class="tl-text-field__input"
|
|
141
|
-
id="bio"
|
|
142
|
-
type="text"
|
|
143
|
-
placeholder=" "
|
|
144
|
-
maxlength="100"
|
|
145
|
-
/>
|
|
146
|
-
<div class="tl-text-field__bottom">
|
|
147
|
-
<span class="tl-text-field__helper">Short description</span>
|
|
148
|
-
<span class="tl-text-field__charcounter">
|
|
149
|
-
0<span class="tl-text-field__charcounter-divider">/</span>100
|
|
150
|
-
</span>
|
|
151
|
-
</div>
|
|
152
|
-
</div>
|
|
153
|
-
|
|
154
|
-
<!-- Disabled -->
|
|
155
|
-
<div class="tl-text-field tl-text-field--lg">
|
|
156
|
-
<label class="tl-text-field__label" for="dis">Disabled</label>
|
|
157
|
-
<input
|
|
158
|
-
class="tl-text-field__input"
|
|
159
|
-
id="dis"
|
|
160
|
-
type="text"
|
|
161
|
-
disabled
|
|
162
|
-
placeholder="Cannot edit"
|
|
163
|
-
/>
|
|
164
|
-
</div>
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
**IMPORTANT for label-inside**: The `placeholder` attribute MUST be set (even to `" "` a space) for the floating label animation to work.
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## Textarea
|
|
172
|
-
|
|
173
|
-
**Classes**: `tl-textarea`
|
|
174
|
-
**Variants**: `tl-textarea--primary`, `tl-textarea--secondary`, `tl-textarea--label-inside`
|
|
175
|
-
**States**: `tl-textarea--error`, `tl-textarea--success`
|
|
176
|
-
|
|
177
|
-
```html
|
|
178
|
-
<div class="tl-textarea">
|
|
179
|
-
<label class="tl-textarea__label" for="msg">Message</label>
|
|
180
|
-
<textarea
|
|
181
|
-
class="tl-textarea__input"
|
|
182
|
-
id="msg"
|
|
183
|
-
rows="4"
|
|
184
|
-
placeholder="Type here..."
|
|
185
|
-
></textarea>
|
|
186
|
-
<div class="tl-textarea__bottom">
|
|
187
|
-
<span class="tl-textarea__helper">Max 500 characters</span>
|
|
188
|
-
<span class="tl-textarea__charcounter">
|
|
189
|
-
0<span class="tl-textarea__charcounter-divider">/</span>500
|
|
190
|
-
</span>
|
|
191
|
-
</div>
|
|
192
|
-
</div>
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
|
|
197
|
-
## Checkbox
|
|
198
|
-
|
|
199
|
-
**Classes**: `tl-checkbox`
|
|
200
|
-
|
|
201
|
-
```html
|
|
202
|
-
<label class="tl-checkbox">
|
|
203
|
-
<input class="tl-checkbox__input" type="checkbox" />
|
|
204
|
-
<span class="tl-checkbox__label">Accept terms</span>
|
|
205
|
-
</label>
|
|
206
|
-
|
|
207
|
-
<!-- Checked -->
|
|
208
|
-
<label class="tl-checkbox">
|
|
209
|
-
<input class="tl-checkbox__input" type="checkbox" checked />
|
|
210
|
-
<span class="tl-checkbox__label">Selected</span>
|
|
211
|
-
</label>
|
|
212
|
-
|
|
213
|
-
<!-- Disabled -->
|
|
214
|
-
<label class="tl-checkbox">
|
|
215
|
-
<input class="tl-checkbox__input" type="checkbox" disabled />
|
|
216
|
-
<span class="tl-checkbox__label">Disabled</span>
|
|
217
|
-
</label>
|
|
218
|
-
|
|
219
|
-
<!-- Indeterminate (add class manually) -->
|
|
220
|
-
<label class="tl-checkbox">
|
|
221
|
-
<input
|
|
222
|
-
class="tl-checkbox__input tl-checkbox__input--indeterminate"
|
|
223
|
-
type="checkbox"
|
|
224
|
-
/>
|
|
225
|
-
<span class="tl-checkbox__label">Indeterminate</span>
|
|
226
|
-
</label>
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
---
|
|
230
|
-
|
|
231
|
-
## Radio Button
|
|
232
|
-
|
|
233
|
-
**Classes**: `tl-radio-button`
|
|
234
|
-
|
|
235
|
-
```html
|
|
236
|
-
<label class="tl-radio-button">
|
|
237
|
-
<input class="tl-radio-button__input" type="radio" name="group1" value="a" />
|
|
238
|
-
<span class="tl-radio-button__label">Option A</span>
|
|
239
|
-
</label>
|
|
240
|
-
|
|
241
|
-
<label class="tl-radio-button">
|
|
242
|
-
<input class="tl-radio-button__input" type="radio" name="group1" value="b" />
|
|
243
|
-
<span class="tl-radio-button__label">Option B</span>
|
|
244
|
-
</label>
|
|
245
|
-
|
|
246
|
-
<label class="tl-radio-button">
|
|
247
|
-
<input
|
|
248
|
-
class="tl-radio-button__input"
|
|
249
|
-
type="radio"
|
|
250
|
-
name="group1"
|
|
251
|
-
value="c"
|
|
252
|
-
disabled
|
|
253
|
-
/>
|
|
254
|
-
<span class="tl-radio-button__label">Disabled</span>
|
|
255
|
-
</label>
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
---
|
|
259
|
-
|
|
260
|
-
## Toggle / Switch
|
|
261
|
-
|
|
262
|
-
**Classes**: `tl-toggle`
|
|
263
|
-
**Sizes**: default (44×24px), `tl-toggle__input--sm` (28×16px)
|
|
264
|
-
|
|
265
|
-
```html
|
|
266
|
-
<div class="tl-toggle">
|
|
267
|
-
<span class="tl-toggle__headline">Dark mode</span>
|
|
268
|
-
<label>
|
|
269
|
-
<input class="tl-toggle__input" type="checkbox" />
|
|
270
|
-
<span class="tl-toggle__label">Enable</span>
|
|
271
|
-
</label>
|
|
272
|
-
</div>
|
|
273
|
-
|
|
274
|
-
<!-- Small toggle -->
|
|
275
|
-
<div class="tl-toggle">
|
|
276
|
-
<label>
|
|
277
|
-
<input
|
|
278
|
-
class="tl-toggle__input tl-toggle__input--sm"
|
|
279
|
-
type="checkbox"
|
|
280
|
-
checked
|
|
281
|
-
/>
|
|
282
|
-
<span class="tl-toggle__label">On</span>
|
|
283
|
-
</label>
|
|
284
|
-
</div>
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
---
|
|
288
|
-
|
|
289
|
-
## Dropdown / Select
|
|
290
|
-
|
|
291
|
-
**Classes**: `tl-dropdown`
|
|
292
|
-
**Sizes**: default (56px), `tl-dropdown--md` (48px), `tl-dropdown--sm` (40px)
|
|
293
|
-
**Variants**: `tl-dropdown--primary`, `tl-dropdown--secondary`, `tl-dropdown--label-inside`
|
|
294
|
-
**States**: `tl-dropdown--error`
|
|
295
|
-
|
|
296
|
-
### Native Select
|
|
297
|
-
|
|
298
|
-
```html
|
|
299
|
-
<div class="tl-dropdown tl-dropdown--lg">
|
|
300
|
-
<label class="tl-dropdown__label" for="country">Country</label>
|
|
301
|
-
<select class="tl-dropdown__select" id="country">
|
|
302
|
-
<option value="">Select a country</option>
|
|
303
|
-
<option value="se">Sweden</option>
|
|
304
|
-
<option value="no">Norway</option>
|
|
305
|
-
<option value="dk">Denmark</option>
|
|
306
|
-
</select>
|
|
307
|
-
</div>
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
### Custom Dropdown (requires JS for open/close)
|
|
311
|
-
|
|
312
|
-
```html
|
|
313
|
-
<div class="tl-dropdown tl-dropdown--lg">
|
|
314
|
-
<label class="tl-dropdown__label">Status</label>
|
|
315
|
-
<button
|
|
316
|
-
class="tl-dropdown__button"
|
|
317
|
-
aria-expanded="false"
|
|
318
|
-
aria-haspopup="listbox"
|
|
319
|
-
>
|
|
320
|
-
<span class="tl-dropdown__text" data-placeholder="Select status"></span>
|
|
321
|
-
</button>
|
|
322
|
-
<ul class="tl-dropdown__list" role="listbox">
|
|
323
|
-
<li class="tl-dropdown__option" role="option" tabindex="0">Active</li>
|
|
324
|
-
<li class="tl-dropdown__option" role="option" tabindex="0">Inactive</li>
|
|
325
|
-
<li class="tl-dropdown__option tl-dropdown__option--disabled" role="option">
|
|
326
|
-
Archived
|
|
327
|
-
</li>
|
|
328
|
-
</ul>
|
|
329
|
-
</div>
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
### Filterable Dropdown
|
|
333
|
-
|
|
334
|
-
```html
|
|
335
|
-
<div class="tl-dropdown tl-dropdown--lg">
|
|
336
|
-
<label class="tl-dropdown__label">Search items</label>
|
|
337
|
-
<div class="tl-dropdown__input-wrapper">
|
|
338
|
-
<input
|
|
339
|
-
class="tl-dropdown__input"
|
|
340
|
-
type="text"
|
|
341
|
-
placeholder="Type to filter..."
|
|
342
|
-
aria-expanded="false"
|
|
343
|
-
role="combobox"
|
|
344
|
-
autocomplete="off"
|
|
345
|
-
/>
|
|
346
|
-
<button class="tl-dropdown__input-clear" aria-label="Clear">×</button>
|
|
347
|
-
</div>
|
|
348
|
-
<ul class="tl-dropdown__list" role="listbox">
|
|
349
|
-
<li class="tl-dropdown__option" role="option" tabindex="0">Item 1</li>
|
|
350
|
-
<li class="tl-dropdown__option" role="option" tabindex="0">Item 2</li>
|
|
351
|
-
</ul>
|
|
352
|
-
</div>
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
---
|
|
356
|
-
|
|
357
|
-
## Datetime / Date Picker
|
|
358
|
-
|
|
359
|
-
**Classes**: `tl-datetime`
|
|
360
|
-
**Sizes**: default lg (56px), `tl-datetime--md` (48px), `tl-datetime--sm` (40px)
|
|
361
|
-
**Variants**: `tl-datetime--primary`, `tl-datetime--secondary`, `tl-datetime--label-inside`
|
|
362
|
-
**States**: `tl-datetime--error`
|
|
363
|
-
|
|
364
|
-
```html
|
|
365
|
-
<div class="tl-datetime tl-datetime--label-inside">
|
|
366
|
-
<div class="tl-datetime__wrapper">
|
|
367
|
-
<span class="tl-datetime__label-inside">Date</span>
|
|
368
|
-
<input class="tl-datetime__input" type="date" />
|
|
369
|
-
</div>
|
|
370
|
-
</div>
|
|
371
|
-
|
|
372
|
-
<!-- With external label -->
|
|
373
|
-
<div class="tl-datetime">
|
|
374
|
-
<label class="tl-datetime__label" for="start">Start date</label>
|
|
375
|
-
<div class="tl-datetime__wrapper">
|
|
376
|
-
<input class="tl-datetime__input" id="start" type="date" />
|
|
377
|
-
</div>
|
|
378
|
-
</div>
|
|
379
|
-
|
|
380
|
-
<!-- Time picker -->
|
|
381
|
-
<div class="tl-datetime">
|
|
382
|
-
<label class="tl-datetime__label" for="time">Time</label>
|
|
383
|
-
<div class="tl-datetime__wrapper">
|
|
384
|
-
<input class="tl-datetime__input" id="time" type="time" />
|
|
385
|
-
</div>
|
|
386
|
-
</div>
|
|
387
|
-
|
|
388
|
-
<!-- Error state -->
|
|
389
|
-
<div class="tl-datetime tl-datetime--error">
|
|
390
|
-
<label class="tl-datetime__label" for="due">Due date</label>
|
|
391
|
-
<div class="tl-datetime__wrapper">
|
|
392
|
-
<input class="tl-datetime__input" id="due" type="date" />
|
|
393
|
-
</div>
|
|
394
|
-
<span class="tl-datetime__helper">Date cannot be in the past</span>
|
|
395
|
-
</div>
|
|
396
|
-
```
|