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
@@ -0,0 +1,21 @@
1
+ export * from './components/icons';
2
+ export * from './components/Button';
3
+ export * from './components/Badge';
4
+ export * from './components/Tile';
5
+ export * from './components/Layout';
6
+ export * from './components/Editorial';
7
+ export * from './components/List';
8
+ export * from './components/Accordion';
9
+ export * from './components/Sheet';
10
+ export * from './components/Controls';
11
+ export * from './components/Menu';
12
+ export * from './components/Stat';
13
+ export * from './components/Calendar';
14
+ export { cx, px } from './utils/cx';
15
+ export { copyText } from './utils/clipboard';
16
+ export { onDismiss } from './utils/dismiss';
17
+ export { dragScroll } from './utils/dragScroll';
18
+ export { createAction } from './utils/action';
19
+ export { storage, createStoredSignal } from './utils/storage';
20
+ export { applyTheme, type ColorScheme, type ThemeVariant } from './utils/theme';
21
+ export * as date from './utils/date';
@@ -0,0 +1,6 @@
1
+ export declare function createAction(onError?: (msg: string) => void): {
2
+ busy: import("solid-js").Accessor<boolean>;
3
+ error: import("solid-js").Accessor<string>;
4
+ setError: (msg: string) => void;
5
+ run: <T>(fn: () => Promise<T>) => Promise<T | undefined>;
6
+ };
@@ -0,0 +1 @@
1
+ export declare function copyText(text: string, host?: HTMLElement): Promise<boolean>;
@@ -0,0 +1,2 @@
1
+ export declare const cx: (...values: (string | false | null | undefined)[]) => string;
2
+ export declare const px: (n: number | undefined) => string | undefined;
@@ -0,0 +1,13 @@
1
+ export declare const midnight: (d: Date) => Date;
2
+ export declare const addDays: (d: Date, n: number) => Date;
3
+ export declare const dayKey: (d: Date) => number;
4
+ export declare const sameDay: (a: Date, b: Date) => boolean;
5
+ export declare const weekOf: (d: Date) => Date;
6
+ export declare const isFuture: (d: Date) => boolean;
7
+ export declare const monthOf: (d: Date) => Date;
8
+ export declare const addMonths: (d: Date, n: number) => Date;
9
+ export declare const daysInMonth: (d: Date) => number;
10
+ export declare const longDay: (d: Date) => string;
11
+ export declare const weekday: (d: Date) => string;
12
+ export declare function ago(when: string | Date | null | undefined): string;
13
+ export declare const plural: (n: number, word: string) => string;
@@ -0,0 +1 @@
1
+ export declare function onDismiss(root: () => HTMLElement | undefined, close: () => void, active?: () => boolean): void;
@@ -0,0 +1 @@
1
+ export declare function dragScroll(el: HTMLElement): void;
@@ -0,0 +1,19 @@
1
+ export declare const DRAG_PX = 5;
2
+ export declare const SWIPE_PX = 50;
3
+ export declare function createClickSwallow(): {
4
+ arm: () => boolean;
5
+ reset: () => boolean;
6
+ listener: {
7
+ capture: boolean;
8
+ handleEvent(e: MouseEvent): void;
9
+ };
10
+ };
11
+ export declare function createSwipe(onSwipe: (step: 1 | -1) => void): {
12
+ onPointerDown: (e: PointerEvent) => void;
13
+ onPointerUp: (e: PointerEvent) => void;
14
+ onPointerCancel: () => null;
15
+ 'on:click': {
16
+ capture: boolean;
17
+ handleEvent(e: MouseEvent): void;
18
+ };
19
+ };
@@ -0,0 +1,6 @@
1
+ import { type JSX } from 'solid-js';
2
+ type Slots<P, K extends keyof P> = {
3
+ [k in K]-?: () => JSX.Element;
4
+ };
5
+ export declare function slots<P, K extends keyof P>(props: P, keys: readonly K[]): Slots<P, K>;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ import { type Signal } from 'solid-js';
2
+ export declare const storage: {
3
+ get(key: string): string | null;
4
+ set(key: string, value: string | null): void;
5
+ getJson<T>(key: string, fallback: T): T;
6
+ setJson(key: string, value: unknown): void;
7
+ };
8
+ export declare function createStoredSignal<T extends string>(key: string, fallback: T, valid?: (v: string) => v is T): Signal<T>;
@@ -0,0 +1,6 @@
1
+ export type ColorScheme = 'auto' | 'light' | 'dark';
2
+ export type ThemeVariant = 'site' | 'app';
3
+ export declare function applyTheme(opts: {
4
+ scheme?: ColorScheme;
5
+ variant?: ThemeVariant;
6
+ }, root?: HTMLElement): void;
package/package.json CHANGED
@@ -1,6 +1,72 @@
1
1
  {
2
2
  "name": "my-design-kit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "SolidJS UI library: grouped lists, sheets, stat tiles, calendars, and editorial layout, with light/dark tokens.",
5
+ "keywords": [
6
+ "solid",
7
+ "solidjs",
8
+ "solid-js",
9
+ "ui",
10
+ "components",
11
+ "design-system",
12
+ "css"
13
+ ],
14
+ "license": "MIT",
15
+ "author": "Christopher Pettyjohn",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/chrismpettyjohn/my-design-kit.git"
19
+ },
20
+ "homepage": "https://github.com/chrismpettyjohn/my-design-kit#readme",
21
+ "bugs": {
22
+ "url": "https://github.com/chrismpettyjohn/my-design-kit/issues"
23
+ },
24
+ "type": "module",
25
+ "sideEffects": [
26
+ "*.css"
27
+ ],
28
+ "files": [
29
+ "dist"
30
+ ],
31
+ "main": "./dist/index.js",
32
+ "module": "./dist/index.js",
33
+ "types": "./dist/types/index.d.ts",
34
+ "exports": {
35
+ ".": {
36
+ "types": "./dist/types/index.d.ts",
37
+ "solid": "./dist/source/index.js",
38
+ "import": "./dist/index.js"
39
+ },
40
+ "./styles.css": "./dist/styles.css",
41
+ "./tokens.css": "./dist/tokens.css"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public",
45
+ "provenance": true
46
+ },
47
+ "scripts": {
48
+ "dev": "vite --config demo/vite.config.ts",
49
+ "build": "rm -rf dist && vite build && tsc -p tsconfig.build.json && bun scripts/build-css.ts",
50
+ "build:demo": "vite build --config demo/vite.config.ts",
51
+ "typecheck": "tsc --noEmit",
52
+ "prepublishOnly": "bun run typecheck && bun run build"
53
+ },
54
+ "browserslist": [
55
+ "safari >= 16.2",
56
+ "ios_saf >= 16.2",
57
+ "chrome >= 111",
58
+ "edge >= 111",
59
+ "firefox >= 121"
60
+ ],
61
+ "peerDependencies": {
62
+ "solid-js": ">=1.9.0 <2"
63
+ },
64
+ "devDependencies": {
65
+ "browserslist": "^4.29.6",
66
+ "lightningcss": "^1.33.0",
67
+ "solid-js": "^1.9.4",
68
+ "typescript": "^5.7.3",
69
+ "vite": "^6.0.7",
70
+ "vite-plugin-solid": "^2.11.0"
71
+ }
72
+ }