actual-css 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 (129) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +21 -0
  3. package/README.md +166 -0
  4. package/dist/actual.css +4929 -0
  5. package/dist/actual.js +3 -0
  6. package/dist/actual.js.map +31 -0
  7. package/dist/actual.min.css +1 -0
  8. package/docs/README.md +26 -0
  9. package/docs/components.md +860 -0
  10. package/docs/design-notes/accessibility-decisions.md +32 -0
  11. package/docs/design-notes/browser-support.md +93 -0
  12. package/docs/design-notes/cascade-layer.md +52 -0
  13. package/docs/design-notes/css-anchor.md +33 -0
  14. package/docs/design-notes/naming.md +37 -0
  15. package/docs/design-notes/previous-work.md +5 -0
  16. package/docs/design-notes/references.md +324 -0
  17. package/docs/forms.md +1265 -0
  18. package/docs/javascript.md +426 -0
  19. package/docs/layout.md +480 -0
  20. package/docs/mental-model.md +73 -0
  21. package/docs/patterns.md +415 -0
  22. package/docs/reserved.md +7 -0
  23. package/docs/tokens.md +455 -0
  24. package/docs/typography.md +159 -0
  25. package/docs/ui.md +937 -0
  26. package/docs/utilities.md +384 -0
  27. package/llms.txt +17 -0
  28. package/package.json +101 -0
  29. package/src/css/actual.css +17 -0
  30. package/src/css/actual.full.css +2 -0
  31. package/src/css/actual.layer.css +3 -0
  32. package/src/css/base.css +70 -0
  33. package/src/css/components/accordion.css +97 -0
  34. package/src/css/components/actions.css +21 -0
  35. package/src/css/components/alert.css +137 -0
  36. package/src/css/components/avatar.css +199 -0
  37. package/src/css/components/badge.css +143 -0
  38. package/src/css/components/breadcrumb.css +56 -0
  39. package/src/css/components/busy.css +44 -0
  40. package/src/css/components/button.css +216 -0
  41. package/src/css/components/card.css +140 -0
  42. package/src/css/components/drawer.css +122 -0
  43. package/src/css/components/flyout.css +243 -0
  44. package/src/css/components/index.css +41 -0
  45. package/src/css/components/join.css +106 -0
  46. package/src/css/components/key.css +25 -0
  47. package/src/css/components/meter.css +81 -0
  48. package/src/css/components/modal.css +162 -0
  49. package/src/css/components/navbar.css +98 -0
  50. package/src/css/components/overline.css +49 -0
  51. package/src/css/components/pagination.css +30 -0
  52. package/src/css/components/progress.css +126 -0
  53. package/src/css/components/scrollspy.css +27 -0
  54. package/src/css/components/skeleton.css +67 -0
  55. package/src/css/components/spinner.css +60 -0
  56. package/src/css/components/status-bar.css +82 -0
  57. package/src/css/components/surface.css +48 -0
  58. package/src/css/components/tab.css +128 -0
  59. package/src/css/components/table.css +64 -0
  60. package/src/css/components/tooltip.css +107 -0
  61. package/src/css/dialog-fallback.css +56 -0
  62. package/src/css/focus.css +13 -0
  63. package/src/css/forms/choice-card.css +158 -0
  64. package/src/css/forms/choice.css +196 -0
  65. package/src/css/forms/control.css +106 -0
  66. package/src/css/forms/custom-select.css +93 -0
  67. package/src/css/forms/form-actions.css +43 -0
  68. package/src/css/forms/form.css +57 -0
  69. package/src/css/forms/index.css +15 -0
  70. package/src/css/forms/input-icon.css +36 -0
  71. package/src/css/forms/native.css +68 -0
  72. package/src/css/forms/select.css +36 -0
  73. package/src/css/forms/switch.css +127 -0
  74. package/src/css/forms/validation.css +63 -0
  75. package/src/css/grid.css +95 -0
  76. package/src/css/intents.css +33 -0
  77. package/src/css/layout.css +80 -0
  78. package/src/css/optional/index.css +5 -0
  79. package/src/css/optional/layout-extra.css +55 -0
  80. package/src/css/optional/scroll-snap.css +51 -0
  81. package/src/css/optional/scroller.css +51 -0
  82. package/src/css/optional/typography-fluid.css +48 -0
  83. package/src/css/optional/utilities-extra.css +289 -0
  84. package/src/css/print.css +47 -0
  85. package/src/css/prose.css +187 -0
  86. package/src/css/reset.css +56 -0
  87. package/src/css/theme.css +186 -0
  88. package/src/css/themes/corporate.css +60 -0
  89. package/src/css/themes/cyberpunk.css +60 -0
  90. package/src/css/themes/dark.css +32 -0
  91. package/src/css/themes/dim.css +33 -0
  92. package/src/css/themes/edge.css +143 -0
  93. package/src/css/themes/forest.css +65 -0
  94. package/src/css/themes/gradient.css +97 -0
  95. package/src/css/themes/index.css +43 -0
  96. package/src/css/themes/lavender.css +66 -0
  97. package/src/css/themes/mono.css +60 -0
  98. package/src/css/themes/neon.css +66 -0
  99. package/src/css/themes/ocean.css +60 -0
  100. package/src/css/themes/petrol.css +64 -0
  101. package/src/css/themes/spruce.css +64 -0
  102. package/src/css/themes/square.css +68 -0
  103. package/src/css/themes/sunset.css +66 -0
  104. package/src/css/tokens.css +122 -0
  105. package/src/css/utilities.css +162 -0
  106. package/src/css/variants.css +118 -0
  107. package/src/js/command.js +165 -0
  108. package/src/js/context-menu.js +291 -0
  109. package/src/js/dialog-fallback.js +163 -0
  110. package/src/js/dialog.js +503 -0
  111. package/src/js/enhance.js +208 -0
  112. package/src/js/events.js +22 -0
  113. package/src/js/filter.js +122 -0
  114. package/src/js/floating.js +462 -0
  115. package/src/js/flyout.js +187 -0
  116. package/src/js/focus.js +35 -0
  117. package/src/js/index.js +26 -0
  118. package/src/js/input.js +47 -0
  119. package/src/js/keys.js +30 -0
  120. package/src/js/mask.js +184 -0
  121. package/src/js/menu.js +88 -0
  122. package/src/js/password.js +98 -0
  123. package/src/js/scrollspy.js +121 -0
  124. package/src/js/selectors.js +59 -0
  125. package/src/js/status.js +158 -0
  126. package/src/js/surface.js +358 -0
  127. package/src/js/tab.js +173 -0
  128. package/src/js/tooltip.js +374 -0
  129. package/src/js/validation.js +419 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ All notable changes will be documented here.
4
+
5
+ This project follows Keep a Changelog and uses semver, including during 0.x.
6
+
7
+ ## [0.1.0] - Unreleased
8
+
9
+ - Initial pre-1.0 package surface.
10
+ - Public class grammar, theme contract, runtime DOM tests, and build guardrails.
11
+ - Changed `.nowrap` to only set text wrapping; use optional `.flex-nowrap` for flex wrapping.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 LeKoala
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 ADDED
@@ -0,0 +1,166 @@
1
+ # Actual CSS
2
+
3
+ Plain CSS component framework for new projects. Semantic classes, shared variants, small tokens, theme hooks, and progressive enhancement.
4
+
5
+ Actual CSS claims a small set (see `reserved-classes.json`) of global class names.
6
+
7
+ For existing projects: cascade layers, import order, or an optional prefix transform.
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ npm install actual-css
13
+ ```
14
+
15
+ Import the full framework in your CSS:
16
+
17
+ ```css
18
+ @import "actual-css";
19
+ ```
20
+
21
+ Or import only the pieces you use:
22
+
23
+ ```css
24
+ @import "actual-css/css/reset";
25
+ @import "actual-css/css/base";
26
+ @import "actual-css/css/tokens";
27
+ @import "actual-css/css/theme";
28
+ @import "actual-css/css/intents";
29
+ @import "actual-css/css/variants";
30
+ @import "actual-css/css/layout";
31
+ @import "actual-css/css/grid";
32
+ @import "actual-css/css/components/button";
33
+ @import "actual-css/css/components/card";
34
+ @import "actual-css/css/forms";
35
+ @import "actual-css/css/components/flyout";
36
+ @import "actual-css/css/utilities";
37
+ @import "actual-css/css/components/join";
38
+ /* Keep the focus baseline after components and controls. */
39
+ @import "actual-css/css/focus";
40
+ ```
41
+
42
+ `focus` is the final interactive baseline in modular builds: older browsers
43
+ retain a visible `:focus` outline, while browsers with `:focus-visible` avoid
44
+ showing it for pointer focus.
45
+
46
+ You can also use the compiled file directly:
47
+
48
+ ```html
49
+ <link rel="stylesheet" href="actual.min.css">
50
+ ```
51
+
52
+ ## Usage
53
+
54
+ Add classes to your HTML. Components define the structure, variants change the style, and intents set the color.
55
+
56
+ ```html
57
+ <button class="btn">Click me</button>
58
+ <button class="btn primary">Save</button>
59
+ <button class="btn primary outline lg">Publish</button>
60
+ <button class="btn success soft sm">Confirm</button>
61
+ ```
62
+
63
+ Intents such as `.primary`, `.secondary`, `.success`, `.warning`, and `.danger` work across components.
64
+
65
+ Variants such as `.solid`, `.soft`, and `.outline` are shared by components like buttons, badges, alerts, and cards. `.ghost` and `.link` are button-only variants.
66
+
67
+ Size variants `.sm` and `.lg` scale controls consistently.
68
+
69
+ ## Public Class Grammar
70
+
71
+ Actual CSS uses a small unprefixed class grammar:
72
+
73
+ ```text
74
+ .component [intent] [variant] [size] [modifier]
75
+ ```
76
+
77
+ Components, layout helpers, form helpers, and utilities claim their documented class names. Intents are `.primary`, `.secondary`, `.success`, `.warning`, and `.danger`; shared variants are `.solid`, `.soft`, and `.outline`; button-only variants are `.ghost` and `.link`; shared sizes are `.sm` and `.lg`.
78
+
79
+ Undocumented `is-*` classes are runtime internals.
80
+
81
+ ## What's included
82
+
83
+ **Components** — button, card, badge, alert, table, accordion, breadcrumb, pagination, skeleton, spinner, avatar, key, meter, progress, joined controls, and busy indicators.
84
+
85
+ **UI components** — dialog, drawer, flyout, tooltip, tabs, scrollspy, context menus, and other components that rely on JavaScript or modern platform behavior.
86
+
87
+ **Patterns** — actions, navbar, and overline. These are regular source files and can be imported only when needed.
88
+
89
+ **Layout primitives** — `.stack`, `.cluster`, `.grid`, `.switcher`, `.center`, `.media`, `.frame`, `.app-shell`, `.sidebar-layout`, and `.container-query`.
90
+
91
+ **Forms** — field layout, choices, switches, selects, custom selects, control base styles, validation states, and form actions.
92
+
93
+ **Prose** — opt-in rich text styling with `.prose`.
94
+
95
+ **Utilities** — spacing, gaps, logical margins, truncation, muted text, circles, screen-reader-only text, text wrapping, and link variants.
96
+
97
+ **Theme hooks** — public tokens for color, radius, shadow, motion, and typography. Reference presets in `src/css/themes/` are demo material, not default CSS or public package entrypoints.
98
+
99
+ ## Optional CSS
100
+
101
+ ```css
102
+ @import "actual-css/css/layer";
103
+ @import "actual-css/css/optional/index";
104
+ ```
105
+
106
+ Browse [`src/css/optional/`](src/css/optional/) for available modules such as custom scrollbars, scroll snap rails, extra utilities, and optional layout helpers.
107
+
108
+ ## JavaScript enhancers
109
+
110
+ Some components can be enhanced with JavaScript: dialog/drawer, flyout, tooltip, tabs, scrollspy, context menu, floating UI, opt-in `data-filter` input filtering, and input masks.
111
+
112
+ Use the full module:
113
+
114
+ ```html
115
+ <script src="actual.js" type="module"></script>
116
+ ```
117
+
118
+ Or import only the enhancers you need:
119
+
120
+ ```js
121
+ import "actual-css/js/dialog";
122
+ import "actual-css/js/flyout";
123
+ import "actual-css/js/filter";
124
+ import "actual-css/js/mask";
125
+ import "actual-css/js/tooltip";
126
+ ```
127
+
128
+ The package does not maintain separate partial bundles. Modular entrypoints map to source files, so each project can compose the framework shape it needs. To customize the full runtime, comment the imports you do not want in `src/js/index.js` and rebuild the JavaScript bundle. JavaScript modules are safe to import during server-side rendering; outside a browser, registration is a no-op.
129
+
130
+ For project-specific behavior, use `actual-css/js/enhance` and the small input helpers rather than patching built-in modules. See [JavaScript](docs/javascript.md) for custom filters, textarea autogrow, ajax forms, and htmx-like patterns.
131
+
132
+ ## Distribution
133
+
134
+ * `dist/actual.css` — readable modern CSS.
135
+ * `dist/actual.min.css` — the same CSS, minified for production.
136
+
137
+ Modern syntax such as `light-dark()`, `color-mix()`, `@container`, `:has()`, `100dvh`, and `100vi` is preserved in the distributed files.
138
+
139
+ Actual CSS does not currently ship a separate compatibility build. It is designed as progressive enhancement: modern features are guarded with `@supports` where needed, while older browsers still receive core layout, forms, and components.
140
+
141
+ For more conservative fallbacks, import and compose the source entrypoints directly.
142
+
143
+ ## Browser support
144
+
145
+ Actual CSS is built around progressive enhancement.
146
+
147
+ * **Degraded** — Firefox 78+, Safari 14+, Chromium 88+. Core layout, typography, forms, and components.
148
+ * **Minimum** — Firefox 98+, Safari 15.4+, Chromium 99+. Dialog, drawer, and top-layer behavior.
149
+ * **Intermediate** — Firefox 121+, Safari 16+, Chromium 106+. `:has()`, container queries, alert icon layout, and intent tints.
150
+ * **Recommended** — Firefox 129+, Safari 17.5+, Chromium 123+. `light-dark()`, `color-mix()`, and full theming.
151
+
152
+ ## Cascade layers
153
+
154
+ Actual CSS is layer-compatible, not layer-dependent. The default `actual.css` file is unlayered. See [`docs/design-notes/cascade-layer.md`](docs/design-notes/cascade-layer.md) for details.
155
+
156
+ ## AI Disclosure
157
+
158
+ Actual CSS uses AI-assisted tooling for code generation, refactoring, and debugging. Patterns and architecture come from hand-written prototypes and iterative human-driven refinement. AI output is reviewed, tested, and owned by the maintainer.
159
+
160
+ ## License
161
+
162
+ MIT
163
+
164
+ ## Docs
165
+
166
+ Start with [`docs/README.md`](docs/README.md).