@pebble-software/bonsai 0.0.3

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 (75) hide show
  1. package/README.md +332 -0
  2. package/dist/components/core/bonsai.d.ts +17 -0
  3. package/dist/components/ui/a.d.ts +3 -0
  4. package/dist/components/ui/accordion.d.ts +17 -0
  5. package/dist/components/ui/alert-dialog.d.ts +23 -0
  6. package/dist/components/ui/alert.d.ts +12 -0
  7. package/dist/components/ui/avatar.d.ts +21 -0
  8. package/dist/components/ui/badge.d.ts +10 -0
  9. package/dist/components/ui/breadcrumb.d.ts +10 -0
  10. package/dist/components/ui/button.d.ts +14 -0
  11. package/dist/components/ui/calendar.d.ts +9 -0
  12. package/dist/components/ui/card.d.ts +15 -0
  13. package/dist/components/ui/chart.d.ts +44 -0
  14. package/dist/components/ui/checkbox.d.ts +7 -0
  15. package/dist/components/ui/collapsible.d.ts +5 -0
  16. package/dist/components/ui/combobox.d.ts +31 -0
  17. package/dist/components/ui/command.d.ts +23 -0
  18. package/dist/components/ui/dialog.d.ts +23 -0
  19. package/dist/components/ui/drawer.d.ts +22 -0
  20. package/dist/components/ui/dropdown-menu.d.ts +29 -0
  21. package/dist/components/ui/form.d.ts +24 -0
  22. package/dist/components/ui/h.d.ts +10 -0
  23. package/dist/components/ui/input-group.d.ts +18 -0
  24. package/dist/components/ui/input-otp.d.ts +11 -0
  25. package/dist/components/ui/input.d.ts +3 -0
  26. package/dist/components/ui/label.d.ts +10 -0
  27. package/dist/components/ui/loader.d.ts +14 -0
  28. package/dist/components/ui/map.d.ts +30 -0
  29. package/dist/components/ui/p.d.ts +11 -0
  30. package/dist/components/ui/popover.d.ts +9 -0
  31. package/dist/components/ui/progress.d.ts +31 -0
  32. package/dist/components/ui/scroll-area.d.ts +13 -0
  33. package/dist/components/ui/select.d.ts +17 -0
  34. package/dist/components/ui/separator.d.ts +8 -0
  35. package/dist/components/ui/sidebar.d.ts +70 -0
  36. package/dist/components/ui/signature-pad.d.ts +7 -0
  37. package/dist/components/ui/skeleton.d.ts +7 -0
  38. package/dist/components/ui/switch.d.ts +8 -0
  39. package/dist/components/ui/table.d.ts +14 -0
  40. package/dist/components/ui/tabs.d.ts +15 -0
  41. package/dist/components/ui/textarea.d.ts +5 -0
  42. package/dist/components/ui/toast.d.ts +46 -0
  43. package/dist/components/ui/tooltip.d.ts +15 -0
  44. package/dist/hooks/haptics.d.ts +8 -0
  45. package/dist/hooks/use-mobile.d.ts +1 -0
  46. package/dist/index.d.ts +4 -0
  47. package/dist/index.js +4446 -0
  48. package/dist/lib/ast/cache.d.ts +8 -0
  49. package/dist/lib/ast/evaluator.d.ts +2 -0
  50. package/dist/lib/ast/helpers.d.ts +2 -0
  51. package/dist/lib/ast/index.d.ts +4 -0
  52. package/dist/lib/ast/setup.d.ts +2 -0
  53. package/dist/lib/ast/types.d.ts +1 -0
  54. package/dist/lib/ast/utils.d.ts +3 -0
  55. package/dist/lib/haptics.d.ts +8 -0
  56. package/dist/lib/ui/registry.d.ts +8 -0
  57. package/dist/lib/utils.d.ts +3 -0
  58. package/dist/tests/ast.bugs.test.d.ts +1 -0
  59. package/dist/tests/ast.engine.test.d.ts +1 -0
  60. package/dist/tests/ast.helpers.test.d.ts +1 -0
  61. package/dist/tests/fixtures/examples.d.ts +8 -0
  62. package/dist/tests/helpers.d.ts +4 -0
  63. package/dist/tests/render.bindings.test.d.ts +1 -0
  64. package/dist/tests/render.controlled.test.d.ts +1 -0
  65. package/dist/tests/render.examples.test.d.ts +1 -0
  66. package/dist/tests/render.granularity.test.d.ts +1 -0
  67. package/dist/tests/render.ssr-client.test.d.ts +1 -0
  68. package/dist/tests/render.structural.test.d.ts +1 -0
  69. package/dist/tests/schema.contract.test.d.ts +1 -0
  70. package/dist/tests/schema.examples.test.d.ts +1 -0
  71. package/dist/tests/schema.kitchen-sink.test.d.ts +1 -0
  72. package/dist/tests/setup.d.ts +1 -0
  73. package/dist/tests/store.paths.test.d.ts +1 -0
  74. package/dist/tests/ui.contracts.test.d.ts +1 -0
  75. package/package.json +86 -0
@@ -0,0 +1,8 @@
1
+ export declare class LRUCache<K, V> {
2
+ private cache;
3
+ private maxSize;
4
+ constructor(maxSize: number);
5
+ get(key: K): V | undefined;
6
+ set(key: K, value: V): void;
7
+ clear(): void;
8
+ }
@@ -0,0 +1,2 @@
1
+ import { ASTNode } from './types';
2
+ export declare function evaluate(node: ASTNode, data: Record<string, any>): any;
@@ -0,0 +1,2 @@
1
+ export type Helper = (...args: any[]) => any;
2
+ export declare const helpers: Record<string, Helper>;
@@ -0,0 +1,4 @@
1
+ export type { ASTNode } from './types';
2
+ export declare function extractVariables(expr: string): string[];
3
+ export declare function parseExpression(expr: string, data: Record<string, any>): any;
4
+ export declare function clearExpressionCache(): void;
@@ -0,0 +1,2 @@
1
+ import { default as jsep } from 'jsep';
2
+ export default jsep;
@@ -0,0 +1 @@
1
+ export type { Expression as ASTNode } from 'jsep';
@@ -0,0 +1,3 @@
1
+ import { ASTNode } from './types';
2
+ export declare function getOwn(obj: any, key: string | number): any;
3
+ export declare function extractIdentifiers(node: ASTNode): string[];
@@ -0,0 +1,8 @@
1
+ import { HapticInput } from 'web-haptics';
2
+ export { useWebHaptics as useHaptics } from 'web-haptics/react';
3
+ export declare const HAPTIC_BUTTON: HapticInput;
4
+ export declare const HAPTIC_TAB: HapticInput;
5
+ export declare const HAPTIC_SWITCH: HapticInput;
6
+ export declare const HAPTIC_CHECKBOX: HapticInput;
7
+ export declare const HAPTIC_ACCORDION: HapticInput;
8
+ export declare const HAPTIC_MENU_ITEM: HapticInput;
@@ -0,0 +1,8 @@
1
+ import { COMPONENT } from '../../../../../library/constants/src/index.ts';
2
+ export declare const componentMap: Record<COMPONENT[number], any>;
3
+ export interface ControlledInput {
4
+ valueProp: string;
5
+ changeProp: string;
6
+ extractor: (eventOrValue: any) => any;
7
+ }
8
+ export declare const controlledInputMap: Record<COMPONENT[number], Record<string, ControlledInput> | ControlledInput>;
@@ -0,0 +1,3 @@
1
+ import { ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
3
+ export declare function colorHash(text: string): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { Config } from '../../../../../library/schemas/src/index.ts';
2
+ export interface ExampleFixture {
3
+ name: string;
4
+ template: Config;
5
+ data?: Record<string, any>;
6
+ description?: string;
7
+ }
8
+ export declare function loadExamples(): ExampleFixture[];
@@ -0,0 +1,4 @@
1
+ import { RenderResult } from '@testing-library/react';
2
+ import { Config } from '../../../../library/schemas/src/index.ts';
3
+ export declare function renderTreeSSR(tree: Config, data?: Record<string, any>): RenderResult;
4
+ export declare function renderTreeClient(tree: Config, data?: Record<string, any>): RenderResult;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,86 @@
1
+ {
2
+ "name": "@pebble-software/bonsai",
3
+ "version": "0.0.3",
4
+ "type": "module",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/PebbleSoftwareInc/pebble-bonsai.git"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "scripts": {
13
+ "build": "vite build",
14
+ "type-check": "tsc --noEmit",
15
+ "lint": "eslint .",
16
+ "test": "vitest run",
17
+ "test:watch": "vitest"
18
+ },
19
+ "main": "dist/index.js",
20
+ "module": "dist/index.js",
21
+ "types": "dist/index.d.ts",
22
+ "exports": {
23
+ ".": {
24
+ "import": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
26
+ "default": "./dist/index.js"
27
+ },
28
+ "./index.css": {
29
+ "style": "./dist/index.css",
30
+ "import": "./dist/index.css",
31
+ "default": "./dist/index.css"
32
+ }
33
+ },
34
+ "files": [
35
+ "dist"
36
+ ],
37
+ "dependencies": {
38
+ "@base-ui/react": "^1.4.1",
39
+ "@jsep-plugin/arrow": "^1.0.6",
40
+ "@tabler/icons-react": "^3.34.0",
41
+ "class-variance-authority": "^0.7.1",
42
+ "clsx": "^2.1.1",
43
+ "cmdk": "^1.1.1",
44
+ "input-otp": "^1.4.2",
45
+ "jsep": "^1.4.0",
46
+ "maplibre-gl": "^5.7.3",
47
+ "react-day-picker": "^9.13.0",
48
+ "react-hook-form": "^7.73.1",
49
+ "react-map-gl": "^8.1.0",
50
+ "react-signature-canvas": "1.1.0-alpha.2",
51
+ "recharts": "^3.8.1",
52
+ "tailwind-merge": "^3.3.1",
53
+ "tailwindcss": "^4.1.11",
54
+ "tw-animate-css": "^1.3.5",
55
+ "valtio": "^2.1.7",
56
+ "web-haptics": "^0.0.6"
57
+ },
58
+ "devDependencies": {
59
+ "@bonsai/constants": "workspace:*",
60
+ "@bonsai/schemas": "workspace:*",
61
+ "@eslint/js": "^9.30.1",
62
+ "@tailwindcss/vite": "^4.1.11",
63
+ "@testing-library/jest-dom": "^6.9.1",
64
+ "@testing-library/react": "^16.3.2",
65
+ "@types/react": "^19.1.8",
66
+ "@types/react-dom": "^19.1.6",
67
+ "@vitejs/plugin-react": "^4.6.0",
68
+ "@vitest/coverage-v8": "^4.0.18",
69
+ "autoprefixer": "^10.4.21",
70
+ "canvas": "^3.2.3",
71
+ "eslint": "^9.30.1",
72
+ "eslint-plugin-react-hooks": "^5.2.0",
73
+ "eslint-plugin-react-refresh": "^0.4.20",
74
+ "globals": "^16.3.0",
75
+ "jsdom": "^29.0.2",
76
+ "typescript": "~5.8.3",
77
+ "typescript-eslint": "^8.35.1",
78
+ "vite": "^7.0.4",
79
+ "vite-plugin-dts": "^4.5.4",
80
+ "vitest": "^4.0.15"
81
+ },
82
+ "peerDependencies": {
83
+ "react": "^18.0.0 || ^19.0.0",
84
+ "react-dom": "^18.0.0 || ^19.0.0"
85
+ }
86
+ }