@atomscraft/css 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nassim Farhat
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,3 +1,65 @@
1
- # Temporary Holding Version
1
+ # @atomscraft/css
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Generated AtomCraft design-system styles. The package provides the `ac-*`
4
+ utility and component classes plus semantic `--ac-*` CSS variables used by the
5
+ React components.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @atomscraft/css
11
+ ```
12
+
13
+ Import the complete stylesheet once at your application entry point, before
14
+ rendering AtomCraft components:
15
+
16
+ ```ts
17
+ import "@atomscraft/css";
18
+ ```
19
+
20
+ The package also exposes the token stylesheet separately:
21
+
22
+ ```ts
23
+ import "@atomscraft/css/tokens.css";
24
+ ```
25
+
26
+ ## What is included?
27
+
28
+ - Reset and base styles
29
+ - Semantic light/dark color variables
30
+ - Brand themes, density, shape and contrast variables
31
+ - Styles for AtomCraft fields, buttons, overlays, tables, navigation and layout
32
+ - Logical properties for RTL support
33
+ - `ac-*` classes and `--ac-*` variables with no external UI dependency
34
+
35
+ ## Using it with React
36
+
37
+ Install the React package alongside the stylesheet:
38
+
39
+ ```bash
40
+ npm install @atomscraft/react @atomscraft/css
41
+ ```
42
+
43
+ ```tsx
44
+ import "@atomscraft/css";
45
+ import { AtomCraftProvider, Button } from "@atomscraft/react";
46
+
47
+ export function App() {
48
+ return (
49
+ <AtomCraftProvider mode="light" theme="indigo">
50
+ <Button>Continue</Button>
51
+ </AtomCraftProvider>
52
+ );
53
+ }
54
+ ```
55
+
56
+ The provider sets the `data-ac-*` attributes consumed by the stylesheet. You
57
+ normally do not need to import individual component CSS files.
58
+
59
+ ## Related packages
60
+
61
+ - [`@atomscraft/react`](https://www.npmjs.com/package/@atomscraft/react) - accessible React components
62
+ - [`@atomscraft/tokens`](https://www.npmjs.com/package/@atomscraft/tokens) - source design tokens
63
+ - [`@atomscraft/core`](https://www.npmjs.com/package/@atomscraft/core) - framework-agnostic behavior
64
+
65
+ Documentation and examples: [AtomCraft UI on GitHub](https://github.com/NassimFarhat/AtomCraft-UI).
@@ -0,0 +1,396 @@
1
+ .ac-sidebar {
2
+ --_width: 16rem;
3
+
4
+ display: flex;
5
+ flex-direction: column;
6
+ flex-shrink: 0;
7
+ inline-size: var(--_width);
8
+ block-size: 100dvh;
9
+ position: sticky;
10
+ inset-block-start: 0;
11
+ border-inline-end: var(--ac-border-width-1) solid var(--ac-color-border-default);
12
+ background: var(--ac-color-bg-subtle);
13
+ transition: inline-size var(--ac-duration-normal) var(--ac-easing-standard);
14
+ }
15
+
16
+ .ac-sidebar[data-side="end"] {
17
+ order: 1;
18
+ border-inline-end: 0;
19
+ border-inline-start: var(--ac-border-width-1) solid var(--ac-color-border-default);
20
+ }
21
+
22
+ .ac-sidebar[data-state="collapsed"] {
23
+ --_width: 3.75rem;
24
+ }
25
+
26
+ .ac-sidebar__header,
27
+ .ac-sidebar__footer {
28
+ display: flex;
29
+ align-items: center;
30
+ gap: var(--ac-space-2);
31
+ min-block-size: 3.5rem;
32
+ padding: var(--ac-space-3);
33
+ }
34
+
35
+ .ac-sidebar__footer {
36
+ margin-block-start: auto;
37
+ border-block-start: var(--ac-border-width-1) solid var(--ac-color-border-default);
38
+ }
39
+
40
+ .ac-sidebar__content {
41
+ display: flex;
42
+ flex: 1;
43
+ flex-direction: column;
44
+ gap: var(--ac-space-4);
45
+ padding: var(--ac-space-2) var(--ac-space-3);
46
+ overflow-y: auto;
47
+ overflow-x: hidden;
48
+ }
49
+
50
+ .ac-sidebar__group {
51
+ display: flex;
52
+ flex-direction: column;
53
+ gap: var(--ac-space-1);
54
+ }
55
+
56
+ .ac-sidebar__group-label {
57
+ margin: 0;
58
+ padding-inline: var(--ac-space-2-5);
59
+ color: var(--ac-color-text-tertiary);
60
+ font-size: var(--ac-type-overline-size);
61
+ font-weight: var(--ac-type-overline-weight);
62
+ letter-spacing: var(--ac-type-overline-tracking);
63
+ text-transform: uppercase;
64
+ white-space: nowrap;
65
+ }
66
+
67
+ [lang|="ar"] .ac-sidebar__group-label {
68
+ letter-spacing: 0;
69
+ text-transform: none;
70
+ }
71
+
72
+ .ac-sidebar__items {
73
+ display: flex;
74
+ flex-direction: column;
75
+ gap: var(--ac-space-0-5);
76
+ margin: 0;
77
+ padding: 0;
78
+ list-style: none;
79
+ }
80
+
81
+ .ac-sidebar[data-state="collapsed"]
82
+ :is(.ac-sidebar__group-label, .ac-nav-item__label, .ac-nav-item__badge) {
83
+ position: absolute;
84
+ inline-size: 1px;
85
+ block-size: 1px;
86
+ overflow: hidden;
87
+ clip-path: inset(50%);
88
+ }
89
+
90
+ .ac-sidebar[data-state="collapsed"] .ac-nav-item {
91
+ justify-content: center;
92
+ padding-inline: 0;
93
+ }
94
+
95
+ .ac-sidebar-sheet {
96
+ inline-size: min(18rem, 85vw);
97
+ }
98
+
99
+ .ac-sidebar-sheet .ac-dialog__panel {
100
+ padding: 0;
101
+ }
102
+
103
+ .ac-sidebar-sheet .ac-sidebar {
104
+ inline-size: 100%;
105
+ position: static;
106
+ border: 0;
107
+ }
108
+
109
+ .ac-header {
110
+ display: flex;
111
+ align-items: center;
112
+ gap: var(--ac-space-3);
113
+ min-block-size: 3.5rem;
114
+ padding-inline: var(--ac-space-4);
115
+ border-block-end: var(--ac-border-width-1) solid var(--ac-color-border-default);
116
+ background: color-mix(in oklab, var(--ac-color-bg-canvas) 85%, transparent);
117
+ backdrop-filter: saturate(1.6) blur(12px);
118
+ }
119
+
120
+ .ac-header[data-sticky] {
121
+ position: sticky;
122
+ inset-block-start: 0;
123
+ z-index: var(--ac-z-sticky);
124
+ }
125
+
126
+ .ac-header__brand {
127
+ display: flex;
128
+ align-items: center;
129
+ gap: var(--ac-space-2);
130
+ font-weight: var(--ac-font-weight-semibold);
131
+ }
132
+
133
+ .ac-header__nav {
134
+ display: flex;
135
+ align-items: center;
136
+ gap: var(--ac-space-1);
137
+ margin-inline-start: var(--ac-space-4);
138
+ }
139
+
140
+ .ac-header__actions {
141
+ display: flex;
142
+ align-items: center;
143
+ gap: var(--ac-space-2);
144
+ margin-inline-start: auto;
145
+ }
146
+
147
+ .ac-header__menu-button {
148
+ display: none;
149
+ }
150
+
151
+ .ac-header__sheet-nav {
152
+ display: flex;
153
+ flex-direction: column;
154
+ gap: var(--ac-space-1);
155
+ }
156
+
157
+ @media (max-width: 767.98px) {
158
+ .ac-header__nav {
159
+ display: none;
160
+ }
161
+
162
+ .ac-header__menu-button {
163
+ display: inline-flex;
164
+ }
165
+ }
166
+
167
+ .ac-app-shell {
168
+ display: flex;
169
+ min-block-size: 100dvh;
170
+ background: var(--ac-color-bg-canvas);
171
+ }
172
+
173
+ .ac-app-shell__main {
174
+ display: flex;
175
+ flex: 1;
176
+ flex-direction: column;
177
+ min-inline-size: 0;
178
+ }
179
+
180
+ .ac-app-shell__content {
181
+ flex: 1;
182
+ outline: none;
183
+ }
184
+
185
+ .ac-skip-link {
186
+ position: fixed;
187
+ inset-block-start: var(--ac-space-2);
188
+ inset-inline-start: var(--ac-space-2);
189
+ z-index: var(--ac-z-tooltip);
190
+ padding: var(--ac-space-2) var(--ac-space-3);
191
+ border-radius: var(--ac-radius-control);
192
+ background: var(--ac-color-primary-solid);
193
+ color: var(--ac-color-primary-on-solid);
194
+ font-weight: var(--ac-font-weight-medium);
195
+ text-decoration: none;
196
+ transform: translateY(-200%);
197
+ }
198
+
199
+ .ac-skip-link:focus-visible {
200
+ transform: none;
201
+ }
202
+
203
+ /* Responsive layout variables must not leak into nested stacks and grids. */
204
+ @property --_direction-base {
205
+ syntax: "*";
206
+ inherits: false;
207
+ }
208
+
209
+ @property --_direction-sm {
210
+ syntax: "*";
211
+ inherits: false;
212
+ }
213
+
214
+ @property --_direction-md {
215
+ syntax: "*";
216
+ inherits: false;
217
+ }
218
+
219
+ @property --_direction-lg {
220
+ syntax: "*";
221
+ inherits: false;
222
+ }
223
+
224
+ @property --_columns-base {
225
+ syntax: "*";
226
+ inherits: false;
227
+ }
228
+
229
+ @property --_columns-sm {
230
+ syntax: "*";
231
+ inherits: false;
232
+ }
233
+
234
+ @property --_columns-md {
235
+ syntax: "*";
236
+ inherits: false;
237
+ }
238
+
239
+ @property --_columns-lg {
240
+ syntax: "*";
241
+ inherits: false;
242
+ }
243
+
244
+ @property --_columns-xl {
245
+ syntax: "*";
246
+ inherits: false;
247
+ }
248
+
249
+ @property --_min-item {
250
+ syntax: "*";
251
+ inherits: false;
252
+ }
253
+
254
+ @property --_gap {
255
+ syntax: "*";
256
+ inherits: false;
257
+ }
258
+
259
+ .ac-stack {
260
+ display: flex;
261
+ flex-direction: var(--_direction-base, column);
262
+ gap: var(--_gap);
263
+ }
264
+
265
+ .ac-stack[data-wrap] {
266
+ flex-wrap: wrap;
267
+ }
268
+
269
+ .ac-stack[data-align="start"] {
270
+ align-items: flex-start;
271
+ }
272
+
273
+ .ac-stack[data-align="center"] {
274
+ align-items: center;
275
+ }
276
+
277
+ .ac-stack[data-align="end"] {
278
+ align-items: flex-end;
279
+ }
280
+
281
+ .ac-stack[data-align="stretch"] {
282
+ align-items: stretch;
283
+ }
284
+
285
+ .ac-stack[data-align="baseline"] {
286
+ align-items: baseline;
287
+ }
288
+
289
+ .ac-stack[data-justify="start"] {
290
+ justify-content: flex-start;
291
+ }
292
+
293
+ .ac-stack[data-justify="center"] {
294
+ justify-content: center;
295
+ }
296
+
297
+ .ac-stack[data-justify="end"] {
298
+ justify-content: flex-end;
299
+ }
300
+
301
+ .ac-stack[data-justify="between"] {
302
+ justify-content: space-between;
303
+ }
304
+
305
+ .ac-grid {
306
+ display: grid;
307
+ grid-template-columns: repeat(var(--_columns-base, 1), minmax(0, 1fr));
308
+ gap: var(--_gap);
309
+ }
310
+
311
+ .ac-grid[data-fluid] {
312
+ grid-template-columns: repeat(auto-fill, minmax(min(var(--_min-item), 100%), 1fr));
313
+ }
314
+
315
+ .ac-container {
316
+ inline-size: 100%;
317
+ max-inline-size: var(--_max, 64rem);
318
+ margin-inline: auto;
319
+ padding-inline: var(--ac-space-4);
320
+ }
321
+
322
+ .ac-container[data-size="sm"] {
323
+ --_max: 40rem;
324
+ }
325
+
326
+ .ac-container[data-size="md"] {
327
+ --_max: 48rem;
328
+ }
329
+
330
+ .ac-container[data-size="xl"] {
331
+ --_max: 80rem;
332
+ }
333
+
334
+ .ac-container[data-size="full"] {
335
+ --_max: none;
336
+ }
337
+
338
+ /* Breakpoints: sm 640, md 768, lg 1024, xl 1280 (see the breakpoint tokens). */
339
+ @media (min-width: 640px) {
340
+ .ac-stack {
341
+ flex-direction: var(--_direction-sm, var(--_direction-base, column));
342
+ }
343
+
344
+ .ac-grid:not([data-fluid]) {
345
+ grid-template-columns: repeat(var(--_columns-sm, var(--_columns-base, 1)), minmax(0, 1fr));
346
+ }
347
+
348
+ .ac-container {
349
+ padding-inline: var(--ac-space-6);
350
+ }
351
+ }
352
+
353
+ @media (min-width: 768px) {
354
+ .ac-stack {
355
+ flex-direction: var(--_direction-md, var(--_direction-sm, var(--_direction-base, column)));
356
+ }
357
+
358
+ .ac-grid:not([data-fluid]) {
359
+ grid-template-columns: repeat(
360
+ var(--_columns-md, var(--_columns-sm, var(--_columns-base, 1))),
361
+ minmax(0, 1fr)
362
+ );
363
+ }
364
+ }
365
+
366
+ @media (min-width: 1024px) {
367
+ .ac-stack {
368
+ flex-direction: var(
369
+ --_direction-lg,
370
+ var(--_direction-md, var(--_direction-sm, var(--_direction-base, column)))
371
+ );
372
+ }
373
+
374
+ .ac-grid:not([data-fluid]) {
375
+ grid-template-columns: repeat(
376
+ var(--_columns-lg, var(--_columns-md, var(--_columns-sm, var(--_columns-base, 1)))),
377
+ minmax(0, 1fr)
378
+ );
379
+ }
380
+
381
+ .ac-container {
382
+ padding-inline: var(--ac-space-8);
383
+ }
384
+ }
385
+
386
+ @media (min-width: 1280px) {
387
+ .ac-grid:not([data-fluid]) {
388
+ grid-template-columns: repeat(
389
+ var(
390
+ --_columns-xl,
391
+ var(--_columns-lg, var(--_columns-md, var(--_columns-sm, var(--_columns-base, 1))))
392
+ ),
393
+ minmax(0, 1fr)
394
+ );
395
+ }
396
+ }
@@ -0,0 +1,134 @@
1
+ /* Variant × tone: tone rules (tokens.css) set --ac-tone-*, variants decide how to use them. */
2
+ .ac-button {
3
+ --_bg: var(--ac-tone-solid);
4
+ --_bg-hover: var(--ac-tone-solid-hover);
5
+ --_fg: var(--ac-tone-on-solid);
6
+ --_border: transparent;
7
+ --_shadow: var(--ac-shadow-highlight), var(--ac-shadow-xs);
8
+ --_height: var(--ac-size-control-md);
9
+ --_padding: var(--ac-padding-control-md);
10
+
11
+ position: relative;
12
+ display: inline-flex;
13
+ flex-shrink: 0;
14
+ align-items: center;
15
+ justify-content: center;
16
+ gap: var(--ac-space-2);
17
+ block-size: var(--_height);
18
+ padding-inline: var(--_padding);
19
+ border: var(--ac-border-width-1) solid var(--_border);
20
+ border-radius: var(--ac-radius-control);
21
+ background: var(--_bg);
22
+ color: var(--_fg);
23
+ box-shadow: var(--_shadow);
24
+ font: inherit;
25
+ font-size: var(--ac-type-label-md-size);
26
+ font-weight: var(--ac-font-weight-medium);
27
+ line-height: 1;
28
+ white-space: nowrap;
29
+ text-decoration: none;
30
+ cursor: pointer;
31
+ user-select: none;
32
+ transition-property: background-color, border-color, color, box-shadow, transform;
33
+ transition-duration: var(--ac-duration-fast);
34
+ transition-timing-function: var(--ac-easing-standard);
35
+ }
36
+
37
+ .ac-button:hover:not(:disabled) {
38
+ background: var(--_bg-hover);
39
+ }
40
+
41
+ .ac-button:active:not(:disabled) {
42
+ transform: translateY(1px);
43
+ }
44
+
45
+ .ac-button:disabled {
46
+ opacity: var(--ac-opacity-disabled);
47
+ cursor: not-allowed;
48
+ box-shadow: none;
49
+ }
50
+
51
+ .ac-button[data-loading] {
52
+ cursor: progress;
53
+ }
54
+
55
+ .ac-button .ac-icon {
56
+ inline-size: 1rem;
57
+ block-size: 1rem;
58
+ }
59
+
60
+ .ac-button[data-variant="soft"] {
61
+ --_bg: var(--ac-tone-soft);
62
+ --_bg-hover: var(--ac-tone-soft-hover);
63
+ --_fg: var(--ac-tone-text);
64
+ --_shadow: none;
65
+ }
66
+
67
+ .ac-button[data-variant="outline"] {
68
+ --_bg: var(--ac-color-bg-surface);
69
+ --_bg-hover: var(--ac-tone-soft);
70
+ --_fg: var(--ac-tone-text);
71
+ --_border: var(--ac-tone-border);
72
+ --_shadow: var(--ac-shadow-xs);
73
+ }
74
+
75
+ .ac-button[data-variant="outline"][data-tone="neutral"] {
76
+ --_border: var(--ac-color-border-default);
77
+ --_bg-hover: var(--ac-color-bg-muted);
78
+ }
79
+
80
+ .ac-button[data-variant="ghost"] {
81
+ --_bg: transparent;
82
+ --_bg-hover: var(--ac-tone-soft);
83
+ --_fg: var(--ac-tone-text);
84
+ --_shadow: none;
85
+ }
86
+
87
+ .ac-button[data-variant="ghost"][data-tone="neutral"] {
88
+ --_bg-hover: var(--ac-color-bg-muted);
89
+ }
90
+
91
+ .ac-button[data-variant="link"] {
92
+ --_bg: transparent;
93
+ --_bg-hover: transparent;
94
+ --_fg: var(--ac-tone-text);
95
+ --_shadow: none;
96
+ --_padding: 0;
97
+ block-size: auto;
98
+ text-underline-offset: 0.25em;
99
+ }
100
+
101
+ .ac-button[data-variant="link"]:hover:not(:disabled) {
102
+ text-decoration: underline;
103
+ }
104
+
105
+ .ac-button[data-size="xs"] {
106
+ --_height: var(--ac-size-control-xs);
107
+ --_padding: var(--ac-space-2);
108
+ gap: var(--ac-space-1);
109
+ font-size: var(--ac-type-label-sm-size);
110
+ border-radius: min(var(--ac-radius-control), var(--ac-radius-md));
111
+ }
112
+
113
+ .ac-button[data-size="sm"] {
114
+ --_height: var(--ac-size-control-sm);
115
+ --_padding: var(--ac-padding-control-sm);
116
+ gap: var(--ac-space-1-5);
117
+ }
118
+
119
+ .ac-button[data-size="lg"] {
120
+ --_height: var(--ac-size-control-lg);
121
+ --_padding: var(--ac-padding-control-lg);
122
+ font-size: var(--ac-type-body-md-size);
123
+ }
124
+
125
+ .ac-button[data-icon-only] {
126
+ inline-size: var(--_height);
127
+ padding-inline: 0;
128
+ }
129
+
130
+ .ac-button[data-block] {
131
+ flex-shrink: 1;
132
+ inline-size: 100%;
133
+ min-inline-size: 0;
134
+ }