@teseor/css 2.5.0 → 2.5.2
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/LICENSE +21 -0
- package/README.md +88 -40
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Teseor
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,102 +1,150 @@
|
|
|
1
1
|
# @teseor/css
|
|
2
2
|
|
|
3
|
-
CSS components library with design tokens and standalone support.
|
|
3
|
+
CSS components library with design tokens, 8px grid rhythm, and standalone component support.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm install @teseor/css
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @teseor/css
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### CDN
|
|
14
|
+
|
|
15
|
+
Use directly without a build step:
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@teseor/css/dist/index.css">
|
|
19
|
+
<!-- or -->
|
|
20
|
+
<link rel="stylesheet" href="https://unpkg.com/@teseor/css/dist/index.css">
|
|
9
21
|
```
|
|
10
22
|
|
|
11
23
|
## Usage
|
|
12
24
|
|
|
13
|
-
###
|
|
25
|
+
### Full bundle (recommended)
|
|
14
26
|
|
|
15
|
-
Import everything
|
|
27
|
+
Import everything -- tokens, reset, base styles, components, and utilities:
|
|
16
28
|
|
|
17
29
|
```css
|
|
18
30
|
@import '@teseor/css/dist/index.css';
|
|
19
31
|
```
|
|
20
32
|
|
|
21
|
-
###
|
|
33
|
+
### Standalone component
|
|
22
34
|
|
|
23
|
-
Components include
|
|
35
|
+
Components include hardcoded fallbacks and work without the token layer:
|
|
24
36
|
|
|
25
37
|
```css
|
|
26
|
-
/* Works standalone - uses hardcoded fallback values */
|
|
27
38
|
@import '@teseor/css/dist/components/button.css';
|
|
28
39
|
```
|
|
29
40
|
|
|
30
|
-
|
|
41
|
+
Without the full bundle, theming via CSS custom properties won't apply.
|
|
31
42
|
|
|
32
43
|
## Theming
|
|
33
44
|
|
|
34
|
-
### Global
|
|
45
|
+
### Global tokens
|
|
35
46
|
|
|
36
47
|
Override design tokens at the root level:
|
|
37
48
|
|
|
38
49
|
```css
|
|
39
50
|
:root {
|
|
40
|
-
--color-primary:
|
|
41
|
-
--radius-
|
|
51
|
+
--ui-color-primary: oklch(55% 0.25 270);
|
|
52
|
+
--ui-radius-base: 4px;
|
|
53
|
+
--ui-font-sans: "Inter", system-ui, sans-serif;
|
|
54
|
+
--ui-shadow-strength: 8%;
|
|
42
55
|
}
|
|
43
56
|
```
|
|
44
57
|
|
|
45
|
-
### Component-
|
|
58
|
+
### Component-level overrides
|
|
46
59
|
|
|
47
|
-
Each component exposes `--component
|
|
60
|
+
Each component exposes `--ui-<component>-*` custom properties:
|
|
48
61
|
|
|
49
62
|
```css
|
|
50
63
|
:root {
|
|
51
|
-
|
|
52
|
-
--button-
|
|
53
|
-
--button-radius: 0;
|
|
64
|
+
--ui-button-bg: navy;
|
|
65
|
+
--ui-button-radius: 0;
|
|
54
66
|
}
|
|
55
67
|
|
|
56
68
|
.my-special-button {
|
|
57
|
-
|
|
58
|
-
--button-bg: gold;
|
|
69
|
+
--ui-button-bg: gold;
|
|
59
70
|
}
|
|
60
71
|
```
|
|
61
72
|
|
|
62
|
-
|
|
73
|
+
### Token cascade
|
|
63
74
|
|
|
64
|
-
Components use a three-level fallback
|
|
75
|
+
Components use a three-level fallback:
|
|
65
76
|
|
|
66
77
|
```
|
|
67
|
-
--button-bg
|
|
78
|
+
--ui-button-bg -> --ui-color-primary -> oklch(55% 0.22 250)
|
|
79
|
+
(component) (global token) (hardcoded fallback)
|
|
68
80
|
```
|
|
69
81
|
|
|
70
|
-
1. **Component
|
|
71
|
-
2. **Global token** (`--color-primary`)
|
|
72
|
-
3. **
|
|
82
|
+
1. **Component token** (`--ui-button-bg`) -- highest priority, scoped override
|
|
83
|
+
2. **Global token** (`--ui-color-primary`) -- design system default
|
|
84
|
+
3. **Hardcoded fallback** -- static value for standalone usage
|
|
85
|
+
|
|
86
|
+
## Components (62)
|
|
87
|
+
|
|
88
|
+
| Category | Components |
|
|
89
|
+
|----------|-----------|
|
|
90
|
+
| **Actions** | button, button-group, close-button |
|
|
91
|
+
| **Typography** | heading, link, code, code-block, kbd, blockquote, list, mark |
|
|
92
|
+
| **Forms** | input, select, checkbox, radio, toggle, slider, textarea, fieldset, field, label, form, form-error, form-helper, number-input, password-input, search-input, checkbox-group, radio-group |
|
|
93
|
+
| **Data display** | avatar, badge, card, table, tag, stat, status, data-list, icon, image |
|
|
94
|
+
| **Feedback** | alert, spinner, progress, progress-circle, skeleton, toast |
|
|
95
|
+
| **Overlays** | modal, dialog, drawer, tooltip, popover, overlay |
|
|
96
|
+
| **Disclosure** | accordion, disclosure |
|
|
97
|
+
| **Navigation** | tabs, breadcrumb, menu, dropdown-menu, nav, pagination |
|
|
98
|
+
| **Content** | divider, spacer, scroll-area |
|
|
73
99
|
|
|
74
|
-
|
|
100
|
+
**Layout primitives** (16): app-shell, grid, column, row, box, center, container, content, sidebar, sidebar-nav, topbar, nav-rail, page-header, footer, main, aspect-ratio
|
|
75
101
|
|
|
76
|
-
|
|
102
|
+
**Utilities** (10): spacing, display, position, text, border, container, visually-hidden, scroll-snap, scroll-animation, view-transition
|
|
77
103
|
|
|
78
|
-
##
|
|
104
|
+
## Naming
|
|
105
|
+
|
|
106
|
+
- **Classes (BEM)**: `.ui-button`, `.ui-button--primary`, `.ui-button__icon`
|
|
107
|
+
- **Global tokens**: `--ui-color-primary`, `--ui-space-2`, `--ui-row-2`
|
|
108
|
+
- **Component tokens**: `--ui-button-height`, `--ui-input-radius`
|
|
109
|
+
- **Internal vars**: `--_bg`, `--_height` (component-scoped, not public API)
|
|
110
|
+
|
|
111
|
+
## Source structure
|
|
79
112
|
|
|
80
113
|
```
|
|
81
114
|
packages/css/src/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
115
|
+
config/ # Layer order, design tokens, guides
|
|
116
|
+
reset/ # CSS reset
|
|
117
|
+
base/ # Base HTML element styles
|
|
118
|
+
layout/ # Layout primitives (grid, column, row, box, ...)
|
|
119
|
+
components/ # UI components grouped by category
|
|
120
|
+
actions/ # button, button-group, close-button
|
|
121
|
+
typography/ # heading, link, code, ...
|
|
122
|
+
forms/ # input, select, checkbox, ...
|
|
123
|
+
data-display/ # avatar, badge, card, ...
|
|
124
|
+
feedback/ # alert, spinner, progress, ...
|
|
125
|
+
overlays/ # modal, dialog, drawer, ...
|
|
126
|
+
disclosure/ # accordion, disclosure
|
|
127
|
+
navigation/ # tabs, breadcrumb, menu, ...
|
|
128
|
+
content/ # divider, spacer, scroll-area
|
|
129
|
+
utilities/ # Helper classes
|
|
130
|
+
debug/ # Dev tools (grid overlay, token inspector)
|
|
89
131
|
```
|
|
90
132
|
|
|
133
|
+
Each component directory contains:
|
|
134
|
+
- `index.scss` -- styles with internal tokens (`--_` prefix)
|
|
135
|
+
- `<name>.api.json` -- CSS API definition (classes, modifiers, custom properties)
|
|
136
|
+
- `<name>.docs.json` -- documentation content
|
|
137
|
+
- `<name>.visual.spec.ts` -- visual regression test
|
|
138
|
+
|
|
91
139
|
## Development
|
|
92
140
|
|
|
93
141
|
```bash
|
|
94
|
-
#
|
|
95
|
-
pnpm nx
|
|
142
|
+
pnpm nx build css # build the package
|
|
143
|
+
pnpm nx test css # visual regression tests (Playwright)
|
|
144
|
+
```
|
|
96
145
|
|
|
97
|
-
|
|
98
|
-
pnpm nx run css:watch
|
|
146
|
+
See the root [CONTRIBUTING.md](../../CONTRIBUTING.md) for the full development workflow.
|
|
99
147
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
[MIT](../../LICENSE)
|