@kodentuzo/spotstrap 0.0.0-stage → 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 (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +77 -2
  3. package/dist/js/index.d.ts +17 -0
  4. package/dist/js/spotstrap.js +3 -0
  5. package/dist/js/spotstrap.js.map +7 -0
  6. package/dist/recipes/index.d.ts +86 -0
  7. package/dist/recipes/index.js +211 -0
  8. package/dist/recipes/sizes.d.ts +21 -0
  9. package/dist/spotstrap.css +1694 -0
  10. package/dist/themes/kodentuzo.css +128 -0
  11. package/dist/themes/librelifts.css +128 -0
  12. package/dist/themes/librevitalis.css +128 -0
  13. package/dist/themes/neutral.css +128 -0
  14. package/dist/themes/sokobanko.css +135 -0
  15. package/dist/themes/spotcraft.css +128 -0
  16. package/dist/themes/tagtape.css +128 -0
  17. package/dist/themes/vinskiano.css +128 -0
  18. package/dist/tokens.json +2473 -0
  19. package/package.json +81 -4
  20. package/src/components/button.css +168 -0
  21. package/src/components/disclosure.css +235 -0
  22. package/src/components/field.css +173 -0
  23. package/src/components/menu.css +129 -0
  24. package/src/components/overlay.css +160 -0
  25. package/src/components/toggle.css +219 -0
  26. package/src/dark-class.css +19 -0
  27. package/src/js/index.ts +246 -0
  28. package/src/native.css +17 -0
  29. package/src/recipes/index.ts +262 -0
  30. package/src/recipes/sizes.ts +20 -0
  31. package/src/tailwind.css +67 -0
  32. package/src/themes/kodentuzo.css +136 -0
  33. package/src/themes/librelifts.css +136 -0
  34. package/src/themes/librevitalis.css +136 -0
  35. package/src/themes/neutral.css +137 -0
  36. package/src/themes/sokobanko.css +144 -0
  37. package/src/themes/spotcraft.css +136 -0
  38. package/src/themes/tagtape.css +136 -0
  39. package/src/themes/vinskiano.css +136 -0
  40. package/src/tokens.css +42 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ivan Vinski
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,78 @@
1
- # Temporary Holding Version
1
+ # Spotstrap
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
+ Bootstrap's reach, shadcn's look, made for phones.
4
+
5
+ - **No framework needed.** One CSS file and plain HTML. Tailwind and React, Vue or Svelte are
6
+ optional.
7
+ - **Feels right on phones.** 44pt touch targets and Apple's type scale, so a web app feels
8
+ native.
9
+ - **Web and native match.** The same sizes and tokens in React Native.
10
+ - **Your brand in one file.** Change the accent, radius and fonts, and every app follows.
11
+
12
+ Spotstrap is a styling layer, not a component runtime. Its classes style the states that
13
+ headless libraries already expose (react-aria, Radix, reka-ui, bits-ui, Headless UI), and
14
+ the browser's own elements (`<dialog>`, `popover`, `<details>`) in plain HTML.
15
+
16
+ ## Scope
17
+
18
+ - **Tokens:** shadcn's names, in oklch, with light and dark values. Brand themes set the
19
+ values.
20
+ - **Sizes and type:** controls are 44px tall by default; the type scale follows Apple's text
21
+ styles.
22
+ - **Components:** the Headless UI set. Button, Input, Textarea, Select, Checkbox, Radio Group,
23
+ Switch, Field, Fieldset, Label, Description, Dialog, Popover, Menu, Listbox, Combobox,
24
+ Disclosure, Tabs, Transition.
25
+ - **Outputs:** Tailwind v4 source, prebuilt CSS, tokens as JSON, and class recipes for React
26
+ Native (Uniwind).
27
+
28
+ ## Use
29
+
30
+ With Tailwind v4:
31
+
32
+ ```css
33
+ @import "tailwindcss";
34
+ @import "@kodentuzo/spotstrap/tailwind.css";
35
+ @import "@kodentuzo/spotstrap/themes/neutral.css";
36
+ /* Optional: follow a .dark class on <html> instead of the system setting. */
37
+ @import "@kodentuzo/spotstrap/dark-class.css";
38
+ ```
39
+
40
+ Without Tailwind:
41
+
42
+ ```html
43
+ <link rel="stylesheet" href="…/spotstrap/dist/spotstrap.css" />
44
+ <link rel="stylesheet" href="…/spotstrap/dist/themes/neutral.css" />
45
+ ```
46
+
47
+ Themes: `neutral`, `kodentuzo`, `librevitalis`, `librelifts`, `spotcraft`, `sokobanko`,
48
+ `tagtape`, `vinskiano`. They name fonts but don't load them; load the font files yourself.
49
+
50
+ Colors outside CSS (meta tags, favicons, canvas) come from `@kodentuzo/spotstrap/tokens.json`.
51
+
52
+ React Native with Uniwind: import `@kodentuzo/spotstrap/native.css` and a theme, then build components with
53
+ `@kodentuzo/spotstrap/recipes` ([docs](docs/react-native.md)).
54
+
55
+ Menu, Listbox, Combobox and Tabs in plain HTML need a little script:
56
+
57
+ ```html
58
+ <script type="module">
59
+ import { init } from "@kodentuzo/spotstrap/js"
60
+ init()
61
+ </script>
62
+ ```
63
+
64
+ ## Docs
65
+
66
+ On [spotstrap.dev](https://spotstrap.dev), and in this repository:
67
+
68
+ - [Getting started](docs/getting-started.md): install, the three ways in, themes.
69
+ - [Components](https://spotstrap.dev/components/button): live examples, classes and the states
70
+ they style (source in `site/src/content/components/`).
71
+ - [React Native](docs/react-native.md): recipes and `native.css`.
72
+ - [Guidelines](docs/guidelines.md): the interface rules, taken from Apple's Human Interface
73
+ Guidelines.
74
+ - [Decisions](docs/decisions/README.md): architecture decision records.
75
+
76
+ ## License
77
+
78
+ MIT.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @kodentuzo/spotstrap/js: keyboard and ARIA behavior for Menu, Listbox, Combobox
3
+ * and Tabs, built on Zag.js state machines (docs/decisions/0004-style-state-not-runtime.md).
4
+ * Framework apps keep their own headless library and don't need this.
5
+ *
6
+ * <script type="module">
7
+ * import { init } from "@kodentuzo/spotstrap/js"
8
+ * init()
9
+ * </script>
10
+ *
11
+ * Components are found by `data-spotstrap="menu|listbox|combobox|tabs"` and their parts by
12
+ * `data-part="…"`. A menu written with `popover` and `commandfor` works without this
13
+ * script; init() swaps those for Zag's behavior.
14
+ */
15
+ export type Cleanup = () => void;
16
+ /** Starts every component under `root` that isn't running yet. Returns a function that stops them. */
17
+ export declare function init(root?: ParentNode): Cleanup;