my-design-kit 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 (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +105 -2
  3. package/dist/index.js +2029 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/source/components/Accordion.jsx +141 -0
  6. package/dist/source/components/Badge.jsx +43 -0
  7. package/dist/source/components/Button.jsx +22 -0
  8. package/dist/source/components/Calendar.jsx +105 -0
  9. package/dist/source/components/Controls.jsx +83 -0
  10. package/dist/source/components/Editorial.jsx +68 -0
  11. package/dist/source/components/Layout.jsx +142 -0
  12. package/dist/source/components/List.jsx +134 -0
  13. package/dist/source/components/Menu.jsx +62 -0
  14. package/dist/source/components/Sheet.jsx +111 -0
  15. package/dist/source/components/Stat.jsx +42 -0
  16. package/dist/source/components/Tile.jsx +36 -0
  17. package/dist/source/components/icons.jsx +100 -0
  18. package/dist/source/index.js +21 -0
  19. package/dist/source/utils/action.js +25 -0
  20. package/dist/source/utils/clipboard.js +22 -0
  21. package/dist/source/utils/cx.js +2 -0
  22. package/dist/source/utils/date.js +26 -0
  23. package/dist/source/utils/dismiss.js +22 -0
  24. package/dist/source/utils/dragScroll.js +31 -0
  25. package/dist/source/utils/gesture.js +41 -0
  26. package/dist/source/utils/slots.js +7 -0
  27. package/dist/source/utils/storage.js +40 -0
  28. package/dist/source/utils/theme.js +14 -0
  29. package/dist/styles.css +2 -0
  30. package/dist/styles.css.map +1 -0
  31. package/dist/tokens.css +2 -0
  32. package/dist/tokens.css.map +1 -0
  33. package/dist/types/components/Accordion.d.ts +11 -0
  34. package/dist/types/components/Badge.d.ts +33 -0
  35. package/dist/types/components/Button.d.ts +31 -0
  36. package/dist/types/components/Calendar.d.ts +11 -0
  37. package/dist/types/components/Controls.d.ts +55 -0
  38. package/dist/types/components/Editorial.d.ts +37 -0
  39. package/dist/types/components/Layout.d.ts +85 -0
  40. package/dist/types/components/List.d.ts +52 -0
  41. package/dist/types/components/Menu.d.ts +34 -0
  42. package/dist/types/components/Sheet.d.ts +49 -0
  43. package/dist/types/components/Stat.d.ts +26 -0
  44. package/dist/types/components/Tile.d.ts +30 -0
  45. package/dist/types/components/icons.d.ts +34 -0
  46. package/dist/types/index.d.ts +21 -0
  47. package/dist/types/utils/action.d.ts +6 -0
  48. package/dist/types/utils/clipboard.d.ts +1 -0
  49. package/dist/types/utils/cx.d.ts +2 -0
  50. package/dist/types/utils/date.d.ts +13 -0
  51. package/dist/types/utils/dismiss.d.ts +1 -0
  52. package/dist/types/utils/dragScroll.d.ts +1 -0
  53. package/dist/types/utils/gesture.d.ts +19 -0
  54. package/dist/types/utils/slots.d.ts +6 -0
  55. package/dist/types/utils/storage.d.ts +8 -0
  56. package/dist/types/utils/theme.d.ts +6 -0
  57. package/package.json +70 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Christopher Pettyjohn
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,106 @@
1
- # Temporary Holding Version
1
+ # my-design-kit
2
+
3
+ A SolidJS UI library extracted from **MySnakes** (the app layer: grouped lists, sheets, stat tiles, calendars) and **imchris.dev** (the site layer: hero, sections, timeline, chips, prose, marquee). Both share one Apple-style base: SF font stack, `#1d1d1f` ink, hairline rules, pill buttons, and automatic light/dark themes.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ bun add my-design-kit solid-js@^1.9
9
+ # or: npm install my-design-kit solid-js@^1.9
10
+ ```
11
+
12
+ The kit targets Solid 1.9.x. Solid 2 is not supported yet, so pin `solid-js@^1.9`: a bare `bun add solid-js` installs 2.x.
13
+
14
+ ```tsx
15
+ import 'my-design-kit/styles.css';
16
+ import {applyTheme, Button, ListSection, Cell} from 'my-design-kit';
17
+
18
+ applyTheme({variant: 'app'});
19
+ ```
20
+
21
+ - `my-design-kit/styles.css`: tokens plus every component style.
22
+ - `my-design-kit/tokens.css`: only the CSS variables, if you want to style things yourself.
23
+ - Under Vite with `vite-plugin-solid`, the `solid` export condition serves untranspiled JSX, so your app compiles it (SSR-safe). Other consumers get the compiled `dist/index.js`.
24
+
25
+ ## Theming
26
+
27
+ Every token is a CSS variable prefixed `--dk-`. Override any of them on `:root` or on a subtree:
28
+
29
+ ```css
30
+ :root {
31
+ --dk-tint: #34c759;
32
+ --dk-radius: 16px;
33
+ }
34
+ ```
35
+
36
+ `applyTheme({scheme, variant})` sets attributes on `<html>`:
37
+
38
+ | option | values | effect |
39
+ | --------- | -------------------------- | ----------------------------------------------------------------------------------- |
40
+ | `scheme` | `auto` \| `light` \| `dark` | `auto` follows `prefers-color-scheme`; the others force a scheme. |
41
+ | `variant` | `site` \| `app` | `app` uses the grey grouped background, a tighter gutter and an 880px column (MySnakes). `site` uses white, a 24px gutter and a 960px column (imchris.dev). |
42
+
43
+ ## Components
44
+
45
+ **Layout**: `Container`, `Navbar` (plain / tinted / blur), `Brand`, `Footer`, `PageHead` (app header, optional `lead` tile, `small`), `Hero`, `Section` (heading, lede, aside), `Lede`, `Meta`, `Actions`, `Stack`, `Row`, `AuthCard`
46
+
47
+ **Editorial**: `Prose`, `PostList`, `Timeline` / `TimelineItem`, `SpecGrid` / `Spec`, `Marquee`
48
+
49
+ **Actions**: `Button` (`primary`, `ink`, `secondary`, `gray`, `tinted`, `danger`, `plain`; sizes `sm`, `md`, `lg`; `block`, `round`; renders `<a>` when given `href`), `IconButton`, `PillButton`
50
+
51
+ **Lists**: `ListSection` (title, foot, `collapse` key remembered in localStorage), `Group`, `Cell` (lead, title, detail, label, value, trailing, chevron, checked; renders `<a>`, `<button>` or `<div>` from `href` / `onClick`), `CopyCell`, `SwipeRow`, `Accordion` / `AccordionGroup` (linked: opening one closes the others, with animated scrolling)
52
+
53
+ **Overlays**: `Sheet` (a modal `<dialog>` that becomes a bottom sheet on mobile; sheets opened over another one stack and get a Back button), `SheetHero`, `ActionSheet`, `FormSheet`, `Menu` / `MenuTrigger` / `MenuItem` / `MenuHeader` / `MenuLabel` / `MenuSeparator`
54
+
55
+ **Controls**: `Segmented`, `Toggle`, `Field`, `SearchField`, `Scroller` (drag-to-scroll with edge fades), `SwatchPicker`, `GlyphPicker`
56
+
57
+ **Data**: `StatGrid` / `Stat` (icon, value and unit, label, sub, progress meter; tones `ok`, `warn`, `bad`; states `alert`, `stale`, `empty`), `Meter`, `Badge`, `Chip` / `Chips`, `StatusDot`, `Alert`, `EmptyState`
58
+
59
+ **Calendar**: `WeekStrip`, `MonthCalendar` (swipe, arrow keys, per-day dots, future days blocked unless `allowFuture`)
60
+
61
+ **Identity**: `IconTile` (named gradients from `GRADIENTS`, or any CSS background), `Avatar` (colour hashed from the name), `Portrait`, `LogoTile`
62
+
63
+ **Icons**: `Icon.*` (chevron, check, plus, close, more, search, download, thermostat, droplet, house, bell…) and `svgIcon()` for your own stroked 24×24 icons.
64
+
65
+ **Utilities**: `cx`, `createAction` (busy/error state around an async call), `onDismiss` (outside click and Escape), `storage` / `createStoredSignal`, `dragScroll`, `copyText`, `date.*`
66
+
67
+ Class names are all prefixed `dk-`, so the kit can sit next to existing app CSS. Variants are plain modifier classes (`dk-btn ink lg`), so markup you write by hand works as well.
68
+
69
+ ## CSS pipeline
70
+
71
+ The source CSS is compiled with [lightningcss](https://lightningcss.dev) against the `browserslist` in `package.json` (Safari/iOS 16.2+, Chrome/Edge 111+, Firefox 121+; the floor is set by `color-mix()` and `:has()`). The published `dist/styles.css` is plain, minified CSS, so consumers need no build step for it.
72
+
73
+ - **Colours** are written once with `light-dark()` in `tokens.css`. lightningcss lowers it for older browsers, and the scheme follows `color-scheme`, which `data-dk-scheme` sets.
74
+ - **Breakpoints** are `@custom-media` (`--dk-tablet`, `--dk-mobile`, `--dk-narrow`) in `media.css`.
75
+ - **Vendor prefixes** (`-webkit-user-select`, `-webkit-backdrop-filter`, …) are added automatically. Don't write them by hand.
76
+ - **The element reset** (`body`, headings, `a`, `button`) is in `@layer dk.base`, so your app's own element styles always win over it. Component classes are unlayered.
77
+ - `Prose` with `innerHTML` renders the string as-is: sanitize untrusted HTML first.
78
+
79
+ ## Develop
80
+
81
+ ```sh
82
+ bun install
83
+ bun run dev # kitchen-sink demo at http://localhost:5180
84
+ bun run typecheck
85
+ bun run build # dist/index.js, dist/source (JSX), dist/types, dist/styles.css + tokens.css (lightningcss)
86
+ ```
87
+
88
+ ## Releasing
89
+
90
+ Publishing is automatic. `.github/workflows/ci.yml` typechecks and builds every pull request and push. On `main`, if the `version` in `package.json` isn't on npm yet, it publishes that version, then tags `v<version>` and creates a GitHub release with generated notes.
91
+
92
+ To release, bump the version and merge to `main`:
93
+
94
+ ```sh
95
+ npm version patch --no-git-tag-version # or minor / major / prerelease --preid=beta
96
+ ```
97
+
98
+ Versions with a pre-release suffix (`0.2.0-beta.1`) publish under the `next` dist-tag and are marked as pre-releases. Pushes that don't change the version publish nothing.
99
+
100
+ Packages are published with npm provenance, so each version on npmjs.com links to the commit and workflow run that built it.
101
+
102
+ ### One-time npm setup
103
+
104
+ 1. **First publish:** create an npm [granular access token](https://docs.npmjs.com/creating-and-viewing-access-tokens) with read and write access to packages (and *Bypass 2FA* enabled, so CI can publish), and add it to the repo as the `NPM_TOKEN` Actions secret. The workflow uses it to create the package.
105
+ 2. **Optional, recommended:** on npmjs.com, open the package's *Settings → Trusted publishing* and add this repo with workflow `ci.yml`. npm then signs in with the workflow's GitHub OIDC identity, so you can delete the `NPM_TOKEN` secret.
2
106
 
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.